@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.
Files changed (125) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/lib/{cjs/unified-selection → unified-selection}/CachingHiliteSetProvider.d.ts +3 -3
  4. package/lib/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -0
  5. package/lib/unified-selection/CachingHiliteSetProvider.js.map +1 -0
  6. package/lib/unified-selection/DisposePolyfill.d.ts.map +1 -0
  7. package/lib/unified-selection/DisposePolyfill.js.map +1 -0
  8. package/lib/{cjs/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.d.ts +7 -7
  9. package/lib/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +1 -0
  10. package/lib/{esm/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.js +1 -1
  11. package/lib/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +1 -0
  12. package/lib/{cjs/unified-selection → unified-selection}/HiliteSetProvider.d.ts +3 -3
  13. package/lib/unified-selection/HiliteSetProvider.d.ts.map +1 -0
  14. package/lib/{esm/unified-selection → unified-selection}/HiliteSetProvider.js +2 -2
  15. package/lib/unified-selection/HiliteSetProvider.js.map +1 -0
  16. package/lib/{esm/unified-selection → unified-selection}/IModelHiliteSetProvider.d.ts +4 -3
  17. package/lib/unified-selection/IModelHiliteSetProvider.d.ts.map +1 -0
  18. package/lib/unified-selection/IModelHiliteSetProvider.js.map +1 -0
  19. package/lib/{esm/unified-selection → unified-selection}/Selectable.d.ts +1 -1
  20. package/lib/unified-selection/Selectable.d.ts.map +1 -0
  21. package/lib/unified-selection/Selectable.js.map +1 -0
  22. package/lib/{cjs/unified-selection → unified-selection}/SelectionChangeEvent.d.ts +2 -2
  23. package/lib/unified-selection/SelectionChangeEvent.d.ts.map +1 -0
  24. package/lib/unified-selection/SelectionChangeEvent.js.map +1 -0
  25. package/lib/{cjs/unified-selection → unified-selection}/SelectionScope.d.ts +3 -3
  26. package/lib/unified-selection/SelectionScope.d.ts.map +1 -0
  27. package/lib/unified-selection/SelectionScope.js.map +1 -0
  28. package/lib/{esm/unified-selection → unified-selection}/SelectionStorage.d.ts +4 -3
  29. package/lib/unified-selection/SelectionStorage.d.ts.map +1 -0
  30. package/lib/unified-selection/SelectionStorage.js.map +1 -0
  31. package/lib/{esm/unified-selection → unified-selection}/Utils.d.ts +3 -3
  32. package/lib/unified-selection/Utils.d.ts.map +1 -0
  33. package/lib/{esm/unified-selection → unified-selection}/Utils.js +1 -1
  34. package/lib/unified-selection/Utils.js.map +1 -0
  35. package/lib/{esm/unified-selection → unified-selection}/types/IModel.d.ts +2 -2
  36. package/lib/unified-selection/types/IModel.d.ts.map +1 -0
  37. package/lib/unified-selection/types/IModel.js.map +1 -0
  38. package/lib/unified-selection.d.ts +16 -0
  39. package/lib/unified-selection.d.ts.map +1 -0
  40. package/lib/{esm/unified-selection.js → unified-selection.js} +2 -3
  41. package/lib/unified-selection.js.map +1 -0
  42. package/package.json +13 -15
  43. package/lib/cjs/package.json +0 -1
  44. package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts.map +0 -1
  45. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js +0 -27
  46. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js.map +0 -1
  47. package/lib/cjs/unified-selection/DisposePolyfill.d.ts +0 -1
  48. package/lib/cjs/unified-selection/DisposePolyfill.d.ts.map +0 -1
  49. package/lib/cjs/unified-selection/DisposePolyfill.js +0 -11
  50. package/lib/cjs/unified-selection/DisposePolyfill.js.map +0 -1
  51. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +0 -1
  52. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js +0 -392
  53. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +0 -1
  54. package/lib/cjs/unified-selection/HiliteSetProvider.d.ts.map +0 -1
  55. package/lib/cjs/unified-selection/HiliteSetProvider.js +0 -382
  56. package/lib/cjs/unified-selection/HiliteSetProvider.js.map +0 -1
  57. package/lib/cjs/unified-selection/IModelHiliteSetProvider.d.ts +0 -51
  58. package/lib/cjs/unified-selection/IModelHiliteSetProvider.d.ts.map +0 -1
  59. package/lib/cjs/unified-selection/IModelHiliteSetProvider.js +0 -66
  60. package/lib/cjs/unified-selection/IModelHiliteSetProvider.js.map +0 -1
  61. package/lib/cjs/unified-selection/Selectable.d.ts +0 -150
  62. package/lib/cjs/unified-selection/Selectable.d.ts.map +0 -1
  63. package/lib/cjs/unified-selection/Selectable.js +0 -238
  64. package/lib/cjs/unified-selection/Selectable.js.map +0 -1
  65. package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts.map +0 -1
  66. package/lib/cjs/unified-selection/SelectionChangeEvent.js +0 -7
  67. package/lib/cjs/unified-selection/SelectionChangeEvent.js.map +0 -1
  68. package/lib/cjs/unified-selection/SelectionScope.d.ts.map +0 -1
  69. package/lib/cjs/unified-selection/SelectionScope.js +0 -252
  70. package/lib/cjs/unified-selection/SelectionScope.js.map +0 -1
  71. package/lib/cjs/unified-selection/SelectionStorage.d.ts +0 -105
  72. package/lib/cjs/unified-selection/SelectionStorage.d.ts.map +0 -1
  73. package/lib/cjs/unified-selection/SelectionStorage.js +0 -153
  74. package/lib/cjs/unified-selection/SelectionStorage.js.map +0 -1
  75. package/lib/cjs/unified-selection/Utils.d.ts +0 -39
  76. package/lib/cjs/unified-selection/Utils.d.ts.map +0 -1
  77. package/lib/cjs/unified-selection/Utils.js +0 -82
  78. package/lib/cjs/unified-selection/Utils.js.map +0 -1
  79. package/lib/cjs/unified-selection/types/IModel.d.ts +0 -133
  80. package/lib/cjs/unified-selection/types/IModel.d.ts.map +0 -1
  81. package/lib/cjs/unified-selection/types/IModel.js +0 -24
  82. package/lib/cjs/unified-selection/types/IModel.js.map +0 -1
  83. package/lib/cjs/unified-selection.d.ts +0 -10
  84. package/lib/cjs/unified-selection.d.ts.map +0 -1
  85. package/lib/cjs/unified-selection.js +0 -27
  86. package/lib/cjs/unified-selection.js.map +0 -1
  87. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts +0 -56
  88. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts.map +0 -1
  89. package/lib/esm/unified-selection/CachingHiliteSetProvider.js.map +0 -1
  90. package/lib/esm/unified-selection/DisposePolyfill.d.ts.map +0 -1
  91. package/lib/esm/unified-selection/DisposePolyfill.js.map +0 -1
  92. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts +0 -119
  93. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +0 -1
  94. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +0 -1
  95. package/lib/esm/unified-selection/HiliteSetProvider.d.ts +0 -48
  96. package/lib/esm/unified-selection/HiliteSetProvider.d.ts.map +0 -1
  97. package/lib/esm/unified-selection/HiliteSetProvider.js.map +0 -1
  98. package/lib/esm/unified-selection/IModelHiliteSetProvider.d.ts.map +0 -1
  99. package/lib/esm/unified-selection/IModelHiliteSetProvider.js.map +0 -1
  100. package/lib/esm/unified-selection/Selectable.d.ts.map +0 -1
  101. package/lib/esm/unified-selection/Selectable.js.map +0 -1
  102. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts +0 -60
  103. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts.map +0 -1
  104. package/lib/esm/unified-selection/SelectionChangeEvent.js.map +0 -1
  105. package/lib/esm/unified-selection/SelectionScope.d.ts +0 -54
  106. package/lib/esm/unified-selection/SelectionScope.d.ts.map +0 -1
  107. package/lib/esm/unified-selection/SelectionScope.js.map +0 -1
  108. package/lib/esm/unified-selection/SelectionStorage.d.ts.map +0 -1
  109. package/lib/esm/unified-selection/SelectionStorage.js.map +0 -1
  110. package/lib/esm/unified-selection/Utils.d.ts.map +0 -1
  111. package/lib/esm/unified-selection/Utils.js.map +0 -1
  112. package/lib/esm/unified-selection/types/IModel.d.ts.map +0 -1
  113. package/lib/esm/unified-selection/types/IModel.js.map +0 -1
  114. package/lib/esm/unified-selection.d.ts +0 -10
  115. package/lib/esm/unified-selection.d.ts.map +0 -1
  116. package/lib/esm/unified-selection.js.map +0 -1
  117. /package/lib/{esm/unified-selection → unified-selection}/CachingHiliteSetProvider.js +0 -0
  118. /package/lib/{esm/unified-selection → unified-selection}/DisposePolyfill.d.ts +0 -0
  119. /package/lib/{esm/unified-selection → unified-selection}/DisposePolyfill.js +0 -0
  120. /package/lib/{esm/unified-selection → unified-selection}/IModelHiliteSetProvider.js +0 -0
  121. /package/lib/{esm/unified-selection → unified-selection}/Selectable.js +0 -0
  122. /package/lib/{esm/unified-selection → unified-selection}/SelectionChangeEvent.js +0 -0
  123. /package/lib/{esm/unified-selection → unified-selection}/SelectionScope.js +0 -0
  124. /package/lib/{esm/unified-selection → unified-selection}/SelectionStorage.js +0 -0
  125. /package/lib/{esm/unified-selection → unified-selection}/types/IModel.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnableUnifiedSelectionSyncWithIModel.js","sourceRoot":"","sources":["../../../src/unified-selection/EnableUnifiedSelectionSyncWithIModel.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GhG,oFAGC;AA3GD,gCAA8B;AAE9B,+BAA4F;AAC5F,sDAAyE;AAGzE,iEAA+F;AAC/F,6EAAsG;AACtG,mDAAqE;AAErE,2DAAuE;AAEvE,iDAM2B;AAC3B,yCAAyC;AAgFzC;;;;GAIG;AACH,SAAgB,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;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C,CAAC;AAED,qBAAqB;AACrB,SAAS,gDAAgD,CACvD,wBAA4G,EAC5G,iBAAoC;IAEpC,OAAO;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,iBAAiB;QAC7C,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,YAAY,CAAC,KAAK,CAAC;QAC5E,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,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, GuidString, Id64Arg, Id64Set } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, ECSqlQueryExecutor } from \"@itwin/presentation-shared\";\nimport { CachingHiliteSetProvider } from \"./CachingHiliteSetProvider.js\";\nimport { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from \"./HiliteSetProvider.js\";\nimport { createIModelHiliteSetProvider, IModelHiliteSetProvider } from \"./IModelHiliteSetProvider.js\";\nimport { SelectableInstanceKey, Selectables } from \"./Selectable.js\";\nimport { StorageSelectionChangeEventArgs, StorageSelectionChangeType } from \"./SelectionChangeEvent.js\";\nimport { computeSelection, SelectionScope } from \"./SelectionScope.js\";\nimport { SelectionStorage } from \"./SelectionStorage.js\";\nimport {\n CoreIModelHiliteSet,\n CoreIModelSelectionSet,\n CoreSelectableIds,\n CoreSelectionSetEventType,\n CoreSelectionSetEventUnsafe,\n} from \"./types/IModel.js\";\nimport { safeDispose } from \"./Utils.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 +0,0 @@
1
- {"version":3,"file":"HiliteSetProvider.d.ts","sourceRoot":"","sources":["../../../src/unified-selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,yBAAyB,EAGzB,kBAAkB,EAInB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAyB,WAAW,EAA+B,MAAM,iBAAiB,CAAC;AAKlG;;;;;;;;;;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"}
@@ -1,382 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createHiliteSetProvider = createHiliteSetProvider;
8
- const rxjs_1 = require("rxjs");
9
- const rxjs_for_await_1 = require("rxjs-for-await");
10
- const core_bentley_1 = require("@itwin/core-bentley");
11
- const presentation_shared_1 = require("@itwin/presentation-shared");
12
- const Selectable_js_1 = require("./Selectable.js");
13
- const Utils_js_1 = require("./Utils.js");
14
- const HILITE_SET_EMIT_FREQUENCY = 20;
15
- /**
16
- * Creates a hilite set provider that returns a `HiliteSet` for given selectables.
17
- * @public
18
- */
19
- function createHiliteSetProvider(props) {
20
- return new HiliteSetProviderImpl(props);
21
- }
22
- class HiliteSetProviderImpl {
23
- _imodelAccess;
24
- // Map between a class name and its type
25
- _classRelationCache;
26
- #componentId;
27
- #componentName;
28
- constructor(props) {
29
- this._imodelAccess = props.imodelAccess;
30
- this._classRelationCache = new Map();
31
- this.#componentId = core_bentley_1.Guid.createValue();
32
- this.#componentName = "HiliteSetProvider";
33
- }
34
- /**
35
- * Get hilite set iterator for supplied `Selectables`.
36
- */
37
- getHiliteSet(props) {
38
- const obs = this.getHiliteSetObservable(props);
39
- return (0, rxjs_for_await_1.eachValueFrom)(obs);
40
- }
41
- /**
42
- * Returns a "hot" observable of hilite sets.
43
- */
44
- getHiliteSetObservable({ selectables }) {
45
- const instancesByType = this.getInstancesByType(selectables);
46
- const observables = {
47
- models: this.getHilitedModels(instancesByType),
48
- subCategories: this.getHilitedSubCategories(instancesByType),
49
- elements: this.getHilitedElements(instancesByType),
50
- };
51
- let hiliteSet = { models: [], subCategories: [], elements: [] };
52
- let lastEmitTime = performance.now();
53
- const subject = new rxjs_1.Subject();
54
- const subscriptions = ["models", "subCategories", "elements"].map((key) => observables[key].subscribe({
55
- next(val) {
56
- hiliteSet[key].push(val);
57
- if (performance.now() - lastEmitTime < HILITE_SET_EMIT_FREQUENCY) {
58
- return;
59
- }
60
- subject.next(hiliteSet);
61
- hiliteSet = { models: [], subCategories: [], elements: [] };
62
- lastEmitTime = performance.now();
63
- },
64
- complete() {
65
- observables[key] = undefined;
66
- if (observables.models || observables.subCategories || observables.elements) {
67
- return;
68
- }
69
- // Emit last batch before completing the observable.
70
- if (hiliteSet.elements.length || hiliteSet.models.length || hiliteSet.subCategories.length) {
71
- subject.next(hiliteSet);
72
- }
73
- subject.complete();
74
- },
75
- error(err) {
76
- subscriptions.forEach((x) => x.unsubscribe());
77
- subscriptions.length = 0;
78
- subject.error(err);
79
- },
80
- }));
81
- return subject;
82
- }
83
- async getType(key) {
84
- if (key.className === Selectable_js_1.TRANSIENT_ELEMENT_CLASSNAME) {
85
- return "transient";
86
- }
87
- const normalizedClassName = (0, presentation_shared_1.normalizeFullClassName)(key.className);
88
- const cachedType = this._classRelationCache.get(normalizedClassName);
89
- if (cachedType) {
90
- return cachedType;
91
- }
92
- const promise = this.getTypeImpl(normalizedClassName).then((res) => {
93
- // Update the cache with the result of the promise.
94
- this._classRelationCache.set(normalizedClassName, res);
95
- return res;
96
- });
97
- // Add the promise to cache to prevent `getTypeImpl` being called multiple times.
98
- this._classRelationCache.set(normalizedClassName, promise);
99
- return promise;
100
- }
101
- async getTypeImpl(fullClassName) {
102
- return ((await this.checkType(fullClassName, "BisCore.Subject", "subject")) ??
103
- (await this.checkType(fullClassName, "BisCore.Model", "model")) ??
104
- (await this.checkType(fullClassName, "BisCore.Category", "category")) ??
105
- (await this.checkType(fullClassName, "BisCore.SubCategory", "subCategory")) ??
106
- (await this.checkType(fullClassName, "Functional.FunctionalElement", "functionalElement")) ??
107
- (await this.checkType(fullClassName, "BisCore.GroupInformationElement", "groupInformationElement")) ??
108
- (await this.checkType(fullClassName, "BisCore.GeometricElement", "geometricElement")) ??
109
- (await this.checkType(fullClassName, "BisCore.Element", "element")) ??
110
- "unknown");
111
- }
112
- async checkType(keyClassName, checkClassName, type) {
113
- try {
114
- const res = this._imodelAccess.classDerivesFrom(keyClassName, checkClassName);
115
- const isOfType = typeof res === "boolean" ? res : await res;
116
- return isOfType ? type : undefined;
117
- }
118
- catch (e) {
119
- // we may be checking against a non-existing schema (e.g. Functional), in which case we should
120
- // return undefined instead of throwing an error
121
- if (e instanceof Error && e.message.match(/Schema "[\w\d_]+" not found/)) {
122
- return undefined;
123
- }
124
- throw e;
125
- }
126
- }
127
- getInstancesByType(selectables) {
128
- const keyTypeObs = (0, rxjs_1.merge)((0, rxjs_1.from)(selectables.custom.values()).pipe((0, rxjs_1.mergeMap)((selectable) => selectable.loadInstanceKeys())), (0, rxjs_1.from)(selectables.instanceKeys).pipe((0, rxjs_1.mergeMap)(([className, idSet]) => (0, rxjs_1.from)(idSet).pipe((0, rxjs_1.map)((id) => ({ className, id })))))).pipe((0, Utils_js_1.releaseMainThreadOnItemsCount)(500),
129
- // Get types for each instance key
130
- (0, rxjs_1.mergeMap)((instanceKey) => (0, rxjs_1.from)(this.getType(instanceKey)).pipe((0, rxjs_1.map)((instanceIdType) => ({ instanceId: instanceKey.id, instanceIdType })))),
131
- // Cache the results
132
- (0, rxjs_1.shareReplay)());
133
- return Object.fromEntries(INSTANCE_TYPES.map((type) => [
134
- type,
135
- keyTypeObs.pipe((0, rxjs_1.filter)(({ instanceIdType }) => instanceIdType === type), (0, rxjs_1.map)(({ instanceId }) => instanceId), unique()),
136
- ]));
137
- }
138
- getHilitedModels(instancesByType) {
139
- return (0, rxjs_1.forkJoin)({
140
- modelKeys: instancesByType.model.pipe((0, rxjs_1.toArray)()),
141
- subjectKeys: instancesByType.subject.pipe((0, rxjs_1.toArray)()),
142
- }).pipe((0, rxjs_1.mergeMap)(({ modelKeys, subjectKeys }) => {
143
- if (!modelKeys.length && !subjectKeys.length) {
144
- return rxjs_1.EMPTY;
145
- }
146
- const bindings = [];
147
- const ctes = [
148
- `
149
- ChildSubjects(ECInstanceId, JsonProperties) AS (
150
- SELECT ECInstanceId, JsonProperties
151
- FROM BisCore.Subject
152
- WHERE ${(0, Utils_js_1.formIdBindings)("ECInstanceId", subjectKeys, bindings)}
153
- UNION ALL
154
- SELECT r.ECInstanceId, r.JsonProperties
155
- FROM ChildSubjects s
156
- JOIN BisCore.Subject r ON r.Parent.Id = s.ECInstanceId
157
- )
158
- `,
159
- `
160
- Models(ECInstanceId) AS (
161
- SELECT s.ECInstanceId AS ECInstanceId
162
- FROM BisCore.Model s
163
- WHERE ${(0, Utils_js_1.formIdBindings)("ECInstanceId", modelKeys, bindings)}
164
- )
165
- `,
166
- ];
167
- const ecsql = [
168
- `
169
- SELECT r.ECInstanceId AS ECInstanceId
170
- FROM ChildSubjects s
171
- JOIN BisCore.PhysicalPartition r ON r.Parent.Id = s.ECInstanceId OR json_extract(s.JsonProperties,'$.Subject.Model.TargetPartition') = printf('0x%x', r.ECInstanceId)
172
- `,
173
- `
174
- SELECT ECInstanceId FROM Models
175
- `,
176
- ].join(" UNION ");
177
- return (0, rxjs_1.from)(executeQuery({
178
- queryExecutor: this._imodelAccess,
179
- query: { ctes, ecsql, bindings },
180
- config: { restartToken: `${this.#componentName}/${this.#componentId}/models/${core_bentley_1.Guid.createValue()}` },
181
- }));
182
- }));
183
- }
184
- getHilitedSubCategories(instancesByType) {
185
- return (0, rxjs_1.forkJoin)({
186
- subCategoryKeys: instancesByType.subCategory.pipe((0, rxjs_1.toArray)()),
187
- categoryKeys: instancesByType.category.pipe((0, rxjs_1.toArray)()),
188
- }).pipe((0, rxjs_1.mergeMap)(({ subCategoryKeys, categoryKeys }) => {
189
- if (!subCategoryKeys.length && !categoryKeys.length) {
190
- return rxjs_1.EMPTY;
191
- }
192
- const bindings = [];
193
- const ctes = [
194
- `
195
- CategorySubCategories(ECInstanceId) AS (
196
- SELECT r.ECInstanceId AS ECInstanceId
197
- FROM BisCore.Category s
198
- JOIN BisCore.SubCategory r ON r.Parent.Id = s.ECInstanceId
199
- WHERE ${(0, Utils_js_1.formIdBindings)("s.ECInstanceId", categoryKeys, bindings)}
200
- )
201
- `,
202
- `
203
- SubCategories(ECInstanceId) AS (
204
- SELECT s.ECInstanceId AS ECInstanceId
205
- FROM BisCore.SubCategory s
206
- WHERE ${(0, Utils_js_1.formIdBindings)("s.ECInstanceId", subCategoryKeys, bindings)}
207
- )
208
- `,
209
- ];
210
- const ecsql = [`SELECT ECInstanceId FROM CategorySubCategories`, `SELECT ECInstanceId FROM SubCategories`].join(" UNION ");
211
- return (0, rxjs_1.from)(executeQuery({
212
- queryExecutor: this._imodelAccess,
213
- query: { ctes, ecsql, bindings },
214
- config: {
215
- restartToken: `${this.#componentName}/${this.#componentId}/sub-categories/${core_bentley_1.Guid.createValue()}`,
216
- },
217
- }));
218
- }));
219
- }
220
- getHilitedElements(instancesByType) {
221
- return (0, rxjs_1.forkJoin)({
222
- groupInformationElementIds: instancesByType.groupInformationElement.pipe((0, rxjs_1.toArray)()),
223
- geometricElementIds: instancesByType.geometricElement.pipe((0, rxjs_1.toArray)()),
224
- functionalElementIds: instancesByType.functionalElement.pipe((0, rxjs_1.toArray)()),
225
- elementIds: instancesByType.element.pipe((0, rxjs_1.toArray)()),
226
- transientIds: instancesByType.transient.pipe((0, rxjs_1.toArray)()),
227
- }).pipe((0, rxjs_1.mergeMap)(({ groupInformationElementIds, geometricElementIds, functionalElementIds, elementIds, transientIds }) => {
228
- const hasFunctionalElementIds = !!functionalElementIds.length;
229
- const hasPersistentElementIds = hasFunctionalElementIds ||
230
- !!(groupInformationElementIds.length || geometricElementIds.length || elementIds.length);
231
- const hasTransientElementIds = !!transientIds.length;
232
- if (!hasPersistentElementIds && !hasTransientElementIds) {
233
- return rxjs_1.EMPTY;
234
- }
235
- if (!hasPersistentElementIds) {
236
- return (0, rxjs_1.from)(transientIds);
237
- }
238
- const bindings = [];
239
- const ctes = [
240
- ...(hasFunctionalElementIds
241
- ? this.getHilitedFunctionalElementsQueryCTEs(functionalElementIds, bindings)
242
- : []),
243
- `
244
- GroupMembers(ECInstanceId, ECClassId) AS (
245
- SELECT TargetECInstanceId, TargetECClassId
246
- FROM BisCore.ElementGroupsMembers
247
- WHERE ${(0, Utils_js_1.formIdBindings)("SourceECInstanceId", groupInformationElementIds, bindings)}
248
- )
249
- `,
250
- `
251
- GroupGeometricElements(ECInstanceId, ECClassId) AS (
252
- SELECT ECInstanceId, ECClassId FROM GroupMembers
253
- UNION ALL
254
- SELECT r.ECInstanceId, r.ECClassId
255
- FROM GroupGeometricElements s
256
- JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId
257
- )
258
- `,
259
- `
260
- ElementGeometricElements(ECInstanceId, ECClassId) AS (
261
- SELECT ECInstanceId, ECClassId
262
- FROM BisCore.Element
263
- WHERE ${(0, Utils_js_1.formIdBindings)("ECInstanceId", elementIds, bindings)}
264
- UNION ALL
265
- SELECT r.ECInstanceId, r.ECClassId
266
- FROM ElementGeometricElements s
267
- JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId
268
- )
269
- `,
270
- `
271
- GeometricElementGeometricElements(ECInstanceId, ECClassId) AS (
272
- SELECT ECInstanceId, ECClassId
273
- FROM BisCore.GeometricElement
274
- WHERE ${(0, Utils_js_1.formIdBindings)("ECInstanceId", geometricElementIds, bindings)}
275
- UNION ALL
276
- SELECT r.ECInstanceId, r.ECClassId
277
- FROM GeometricElementGeometricElements s
278
- JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId
279
- )
280
- `,
281
- ];
282
- const ecsql = [
283
- ...(hasFunctionalElementIds
284
- ? [
285
- "SELECT ECInstanceId FROM FunctionalElementChildGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)",
286
- ]
287
- : []),
288
- "SELECT ECInstanceId FROM GeometricElementGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)",
289
- "SELECT ECInstanceId FROM GroupGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)",
290
- "SELECT ECInstanceId FROM ElementGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)",
291
- ].join(" UNION ");
292
- return (0, rxjs_1.merge)((0, rxjs_1.from)(executeQuery({
293
- queryExecutor: this._imodelAccess,
294
- query: { ctes, ecsql, bindings },
295
- config: { restartToken: `${this.#componentName}/${this.#componentId}/elements/${core_bentley_1.Guid.createValue()}` },
296
- })), (0, rxjs_1.from)(transientIds));
297
- }));
298
- }
299
- getHilitedFunctionalElementsQueryCTEs(functionalElements, bindings) {
300
- return [
301
- `
302
- ChildFunctionalElements(ECInstanceId, ECClassId) AS (
303
- SELECT ECInstanceId, ECClassId
304
- FROM Functional.FunctionalElement
305
- WHERE ${(0, Utils_js_1.formIdBindings)("ECInstanceId", functionalElements, bindings)}
306
- UNION ALL
307
- SELECT r.ECInstanceId, r.ECClassId
308
- FROM ChildFunctionalElements s
309
- JOIN Functional.FunctionalElement r ON r.Parent.Id = s.ECInstanceId
310
- )
311
- `,
312
- `
313
- PhysicalElements(ECInstanceId, ECClassId) AS (
314
- SELECT r.SourceECInstanceId, r.SourceECClassId
315
- FROM ChildFunctionalElements s
316
- JOIN Functional.PhysicalElementFulfillsFunction r ON r.TargetECInstanceId = s.ECInstanceId
317
- )
318
- `,
319
- `
320
- DrawingGraphicElements(ECInstanceId, ECClassId) AS (
321
- SELECT r.SourceECInstanceId, r.SourceECClassId
322
- FROM ChildFunctionalElements s
323
- JOIN Functional.DrawingGraphicRepresentsFunctionalElement r ON r.TargetECInstanceId = s.ECInstanceId
324
- )
325
- `,
326
- `
327
- PhysicalElementGeometricElements(ECInstanceId, ECClassId) AS (
328
- SELECT ECInstanceId, ECClassId FROM PhysicalElements
329
- UNION ALL
330
- SELECT r.ECInstanceId, r.ECClassId
331
- FROM PhysicalElementGeometricElements s
332
- JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId
333
- )
334
- `,
335
- `
336
- DrawingGraphicElementGeometricElements(ECInstanceId, ECClassId) AS (
337
- SELECT ECInstanceId, ECClassId FROM DrawingGraphicElements
338
- UNION ALL
339
- SELECT r.ECInstanceId, r.ECClassId
340
- FROM DrawingGraphicElementGeometricElements s
341
- JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId
342
- )
343
- `,
344
- `
345
- FunctionalElementChildGeometricElements(ECInstanceId, ECClassId) AS (
346
- SELECT ECInstanceId, ECClassId FROM PhysicalElementGeometricElements
347
- UNION
348
- SELECT ECInstanceId, ECClassId FROM DrawingGraphicElementGeometricElements
349
- )
350
- `,
351
- ];
352
- }
353
- }
354
- const INSTANCE_TYPES = [
355
- "subject",
356
- "model",
357
- "category",
358
- "subCategory",
359
- "functionalElement",
360
- "groupInformationElement",
361
- "geometricElement",
362
- "element",
363
- "transient",
364
- "unknown",
365
- ];
366
- function unique() {
367
- return function (obs) {
368
- return obs.pipe((0, rxjs_1.scan)((acc, val) => {
369
- if (acc.set.has(val)) {
370
- delete acc.val;
371
- return acc;
372
- }
373
- acc.set.add(val);
374
- acc.val = val;
375
- return acc;
376
- }, { set: new Set() }), (0, rxjs_1.map)(({ val }) => val), (0, rxjs_1.filter)((x) => !!x));
377
- };
378
- }
379
- async function* executeQuery(props) {
380
- yield* (0, Utils_js_1.genericExecuteQuery)({ ...props, parseQueryRow: (row) => row.ECInstanceId });
381
- }
382
- //# sourceMappingURL=HiliteSetProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../src/unified-selection/HiliteSetProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AA4EhG,0DAEC;AA5ED,+BAac;AACd,mDAA+C;AAC/C,sDAAmE;AACnE,oEAQoC;AACpC,mDAAkG;AAClG,yCAAgG;AAEhG,MAAM,yBAAyB,GAAG,EAAE,CAAC;AA0CrC;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,KAA6B;IACnE,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,qBAAqB;IACjB,aAAa,CAAiD;IACtE,wCAAwC;IAChC,mBAAmB,CAAwD;IACnF,YAAY,CAAa;IACzB,cAAc,CAAS;IAEvB,YAAY,KAA6B;QACvC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,mBAAI,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAmC;QACrD,MAAM,GAAG,GAAG,IAAI,CA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D;;;;;;;;OAQC;YACD;;;;;;;;OAQC;YACD;;;;;;OAMC;SACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,cAAc,GAAG;IACrB,SAAS;IACT,OAAO;IACP,UAAU;IACV,aAAa;IACb,mBAAmB;IACnB,yBAAyB;IACzB,kBAAkB;IAClB,SAAS;IACT,WAAW;IACX,SAAS;CACD,CAAC;AAQX,SAAS,MAAM;IACb,OAAO,UAAU,GAAkB;QACjC,OAAO,GAAG,CAAC,IAAI,CACb,IAAA,WAAI,EACF,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACX,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,GAAG,CAAC,GAAG,CAAC;gBACf,OAAO,GAAG,CAAC;YACb,CAAC;YAED,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;YACd,OAAO,GAAG,CAAC;QACb,CAAC,EACD,EAAE,GAAG,EAAE,IAAI,GAAG,EAAK,EAA8B,CAClD,EACD,IAAA,UAAG,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,EACrB,IAAA,aAAM,EAAC,CAAC,CAAC,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,SAAS,CAAC,CAAC,YAAY,CAAC,KAI5B;IACC,KAAK,CAAC,CAAC,IAAA,8BAAmB,EAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,CAAC,GAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,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 {\n EMPTY,\n filter,\n forkJoin,\n from,\n map,\n merge,\n mergeMap,\n Observable,\n scan,\n shareReplay,\n Subject,\n toArray,\n} from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { Guid, GuidString, Id64String } from \"@itwin/core-bentley\";\nimport {\n ECClassHierarchyInspector,\n ECSqlBinding,\n ECSqlQueryDef,\n ECSqlQueryExecutor,\n ECSqlQueryReaderOptions,\n ECSqlQueryRow,\n normalizeFullClassName,\n} from \"@itwin/presentation-shared\";\nimport { SelectableInstanceKey, Selectables, TRANSIENT_ELEMENT_CLASSNAME } from \"./Selectable.js\";\nimport { formIdBindings, genericExecuteQuery, releaseMainThreadOnItemsCount } from \"./Utils.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: string): 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(keyClassName: string, checkClassName: string, type: InstanceIdType) {\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,51 +0,0 @@
1
- import "./DisposePolyfill.js";
2
- import { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
3
- import { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from "./HiliteSetProvider.js";
4
- import { SelectionStorage } from "./SelectionStorage.js";
5
- /**
6
- * Props for creating an `IModelHiliteSetProvider` instance.
7
- * @public
8
- */
9
- export interface IModelHiliteSetProviderProps {
10
- /** Selection storage to use for retrieving the hilite set. */
11
- selectionStorage: SelectionStorage;
12
- /** A callback that should return iModel access by iModel key. */
13
- imodelProvider: (imodelKey: string) => ECClassHierarchyInspector & ECSqlQueryExecutor;
14
- /** An optional hilite set provider factory. If not provided, defaults to `createHiliteSetProvider` from this package. */
15
- createHiliteSetProvider?: typeof createHiliteSetProvider;
16
- }
17
- /**
18
- * Defines return value of `createIModelHiliteSetProvider`.
19
- *
20
- * **Warning:** Used in public API as a return value. Not expected to be created / extended by package
21
- * consumers, may be supplemented with required attributes any time.
22
- *
23
- * @see `createIModelHiliteSetProvider`
24
- * @public
25
- */
26
- export interface IModelHiliteSetProvider {
27
- /** Get the hilite set provider for the specified iModel. */
28
- getHiliteSetProvider(props: {
29
- /** iModel to get hilite set provider for */
30
- imodelKey: string;
31
- }): HiliteSetProvider;
32
- /** Get the hilite set iterator for active selection in the specified iModel. */
33
- getCurrentHiliteSet(props: {
34
- /** iModel to get hilite set for */
35
- imodelKey: string;
36
- }): AsyncIterableIterator<HiliteSet>;
37
- /**
38
- * Disposes the cache.
39
- */
40
- [Symbol.dispose]: () => void;
41
- }
42
- /**
43
- * Creates a hilite set provider that can efficiently get a hilite set for the "active" selection in an iModel.
44
- *
45
- * This specific implementation caches the hilite set for the current selection, so subsequent hilite set
46
- * requests for the same iModel, don't cost until selection changes.
47
- *
48
- * @public
49
- */
50
- export declare function createIModelHiliteSetProvider(props: IModelHiliteSetProviderProps): IModelHiliteSetProvider;
51
- //# sourceMappingURL=IModelHiliteSetProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IModelHiliteSetProvider.d.ts","sourceRoot":"","sources":["../../../src/unified-selection/IModelHiliteSetProvider.ts"],"names":[],"mappings":"AAKA,OAAO,sBAAsB,CAAC;AAI9B,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAkC,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzF;;;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;QACnC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAErC;;OAEG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,4BAA4B,GAAG,uBAAuB,CAE1G"}
@@ -1,66 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createIModelHiliteSetProvider = createIModelHiliteSetProvider;
8
- require("./DisposePolyfill.js");
9
- const rxjs_1 = require("rxjs");
10
- const rxjs_for_await_1 = require("rxjs-for-await");
11
- const HiliteSetProvider_js_1 = require("./HiliteSetProvider.js");
12
- const SelectionStorage_js_1 = require("./SelectionStorage.js");
13
- /**
14
- * Creates a hilite set provider that can efficiently get a hilite set for the "active" selection in an iModel.
15
- *
16
- * This specific implementation caches the hilite set for the current selection, so subsequent hilite set
17
- * requests for the same iModel, don't cost until selection changes.
18
- *
19
- * @public
20
- */
21
- function createIModelHiliteSetProvider(props) {
22
- return new IModelHiliteSetProviderImpl(props);
23
- }
24
- class IModelHiliteSetProviderImpl {
25
- _selectionStorage;
26
- _hiliteSetProviders = new Map();
27
- _cache = new Map();
28
- _removeListener;
29
- _imodelProvider;
30
- _createHiliteSetProvider;
31
- constructor(props) {
32
- this._selectionStorage = props.selectionStorage;
33
- this._imodelProvider = props.imodelProvider;
34
- this._removeListener = this._selectionStorage.selectionChangeEvent.addListener((args) => {
35
- this._cache.delete(args.imodelKey);
36
- if (args.changeType === "clear" && args.source === SelectionStorage_js_1.CLEAR_SELECTION_STORAGE_SOURCE) {
37
- this._hiliteSetProviders.delete(args.imodelKey);
38
- }
39
- });
40
- /* v8 ignore next -- @preserve */
41
- this._createHiliteSetProvider = props.createHiliteSetProvider ?? HiliteSetProvider_js_1.createHiliteSetProvider;
42
- }
43
- getHiliteSetProvider({ imodelKey }) {
44
- let provider = this._hiliteSetProviders.get(imodelKey);
45
- if (!provider) {
46
- provider = this._createHiliteSetProvider({ imodelAccess: this._imodelProvider(imodelKey) });
47
- this._hiliteSetProviders.set(imodelKey, provider);
48
- }
49
- return provider;
50
- }
51
- getCurrentHiliteSet({ imodelKey }) {
52
- let hiliteSet = this._cache.get(imodelKey);
53
- if (!hiliteSet) {
54
- const selectables = this._selectionStorage.getSelection({ imodelKey });
55
- hiliteSet = (0, rxjs_1.from)(this.getHiliteSetProvider({ imodelKey }).getHiliteSet({ selectables })).pipe((0, rxjs_1.shareReplay)({ refCount: true }));
56
- this._cache.set(imodelKey, hiliteSet);
57
- }
58
- return (0, rxjs_for_await_1.eachValueFrom)(hiliteSet);
59
- }
60
- [Symbol.dispose]() {
61
- this._removeListener();
62
- this._hiliteSetProviders = new Map();
63
- this._cache = new Map();
64
- }
65
- }
66
- //# sourceMappingURL=IModelHiliteSetProvider.js.map