diff --git a/packages/tree-widget/docs/SharedVisibilityHandling.md b/packages/tree-widget/docs/SharedVisibilityHandling.md index c19287115e..cc0670ac15 100644 --- a/packages/tree-widget/docs/SharedVisibilityHandling.md +++ b/packages/tree-widget/docs/SharedVisibilityHandling.md @@ -49,7 +49,7 @@ flowchart TD RESULT_Empty([No status produced]) %% Start - TITLE(["mergeVisibilityStatuses"]) --> A["Inspect supplied VisibilityStatus.state values"] + TITLE(["mergeVisibilityStatuses"]) --> A["Inspect supplied VisibilityStatus.state values"] PROPS[\" input diff --git a/packages/tree-widget/docs/Visibility.md b/packages/tree-widget/docs/Visibility.md index b809dce40d..6c205ccd1a 100644 --- a/packages/tree-widget/docs/Visibility.md +++ b/packages/tree-widget/docs/Visibility.md @@ -57,48 +57,48 @@ Every flowchart in these documents follows the same conventions: ## Key Internal APIs -- [`useCachedVisibility`](../src/tree-widget-react/components/trees/common/internal/hooks/UseCachedVisibility.ts) — React hook that returns a factory for the shared hierarchy visibility handler. +- [`useCachedVisibility`](../src/tree-widget-react/shared/internal/hooks/UseCachedVisibility.ts) — React hook that returns a factory for the shared hierarchy visibility handler. - Creates and disposes a tree-specific handler for each status or change request. - - Cancels an in-progress `getVisibilityStatus()` when the same node receives a change request or the viewport emits a relevant visibility event. [`useHierarchyVisibility`](../src/tree-widget-react/components/trees/common/UseHierarchyVisibility.ts) requests the status again through `onVisibilityChange()`. - - Runs changes against a [`BufferingViewport`](../src/tree-widget-react/components/trees/common/internal/BufferingViewport.ts). The buffered viewport is committed only when the complete change pipeline finishes normally; cancellation discards all buffered mutations. + - Cancels an in-progress `getVisibilityStatus()` when the same node receives a change request or the viewport emits a relevant visibility event. [`useHierarchyVisibility`](../src/tree-widget-react/shared/UseHierarchyVisibility.ts) requests the status again through `onVisibilityChange()`. + - Runs changes against a [`BufferingViewport`](../src/tree-widget-react/shared/internal/BufferingViewport.ts). The buffered viewport is committed only when the complete change pipeline finishes normally; cancellation discards all buffered mutations. - Suppresses viewport and always/never-drawn cache events during a change, then resumes them after commit or cancellation. - Applies special handling when search paths are present, because filtered hierarchy nodes may omit children that still contribute to visibility. -- [`BaseVisibilityHelper`](../src/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.ts) — shared get/change operations for visibility status based on element/model/category ids. - - Uses [`BaseIdsCache`](../src/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.ts) to retrieve information about nodes. +- [`BaseVisibilityHelper`](../src/tree-widget-react/shared/internal/visibility/BaseVisibilityHelper.ts) — shared get/change operations for visibility status based on element/model/category ids. + - Uses [`BaseIdsCache`](../src/tree-widget-react/shared/internal/caches/BaseIdsCache.ts) to retrieve information about nodes. - Examples: `getModelsVisibilityStatus()`, `getCategoriesVisibilityStatus()`, `changeModelsVisibilityStatus()`, `changeCategoriesVisibilityStatus()`. -- Tree-specific visibility handlers [`CategoriesTreeVisibilityHandler`](../src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts), [`ClassificationsTreeVisibilityHandler`](../src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts), [`ModelsTreeVisibilityHandler`](../src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts): +- Tree-specific visibility handlers [`CategoriesTreeVisibilityHandler`](../src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts), [`ClassificationsTreeVisibilityHandler`](../src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts), [`ModelsTreeVisibilityHandler`](../src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts): - These handlers are aware of tree-specific hierarchy structure. - Take tree nodes as input, determine node type via nodes' `extendedData` property, and use appropriate methods from visibility helpers. - Expose get/change visibility status logic for search-target nodes. - Models and Classifications tree visibility is 3D-only. Categories tree visibility supports 2D and 3D viewports. - Before changing visibility in always-drawn-exclusive mode, preserve the current visible set while converting the viewport to normal mode, then apply the requested change. -- Tree-specific visibility helpers ([`CategoriesTreeVisibilityHelper`](../src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts), [`ClassificationsTreeVisibilityHelper`](../src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts), [`ModelsTreeVisibilityHelper`](../src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts)): +- Tree-specific visibility helpers ([`CategoriesTreeVisibilityHelper`](../src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts), [`ClassificationsTreeVisibilityHelper`](../src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts), [`ModelsTreeVisibilityHelper`](../src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts)): - Cover tree-specific cases (e.g. definition containers exist only in the Categories tree, so `CategoriesTreeVisibilityHelper` implements get/change visibility methods for definition containers). - - All of them use [`BaseVisibilityHelper`](../src/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.ts) to get/change visibility for those tree-specific cases. + - All of them use [`BaseVisibilityHelper`](../src/tree-widget-react/shared/internal/visibility/BaseVisibilityHelper.ts) to get/change visibility for those tree-specific cases. -- Search-results trees ([`BaseSearchResultsTree`](../src/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.ts) and tree-specific implementations: [Categories](../src/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.ts), [Classifications](../src/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.ts), [Models](../src/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.ts)): +- Search-results trees ([`BaseSearchResultsTree`](../src/tree-widget-react/shared/internal/visibility/BaseSearchResultsTree.ts) and tree-specific implementations: [Categories](../src/tree-widget-react/trees/categories-tree/internal/visibility/SearchResultsTree.ts), [Classifications](../src/tree-widget-react/trees/classifications-tree/internal/visibility/SearchResultsTree.ts), [Models](../src/tree-widget-react/trees/models-tree/internal/visibility/SearchResultsTree.ts)): - Help get/change visibility of nodes which are not search targets and don't have search-target ancestors (since these nodes might have some children missing). They allow retrieving child search targets for such nodes and then getting/changing visibility is done based on search targets instead. - Caching: - - [`BaseIdsCache`](../src/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.ts) - stores data that is relevant to models/categories/classifications trees (e.g. model <-> category relationship). - - This cache is composed of other caches ([`DescendantsCountCache`](../src/tree-widget-react/components/trees/common/internal/caches/DescendantsCountCache.ts), [`ChildElementsCache`](../src/tree-widget-react/components/trees/common/internal/caches/ChildElementsCache.ts), [`SubCategoriesCache`](../src/tree-widget-react/components/trees/common/internal/caches/SubCategoriesCache.ts), and others). + - [`BaseIdsCache`](../src/tree-widget-react/shared/internal/caches/BaseIdsCache.ts) - stores data that is relevant to models/categories/classifications trees (e.g. model <-> category relationship). + - This cache is composed of other caches ([`DescendantsCountCache`](../src/tree-widget-react/shared/internal/caches/DescendantsCountCache.ts), [`ChildElementsCache`](../src/tree-widget-react/shared/internal/caches/ChildElementsCache.ts), [`SubCategoriesCache`](../src/tree-widget-react/shared/internal/caches/SubCategoriesCache.ts), and others). - Data stored in this cache is requested only once, because it does not change. - - Tree-specific id caches ([`CategoriesTreeIdsCache`](../src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.ts), [`ClassificationsTreeIdsCache`](../src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts), [`ModelsTreeIdsCache`](../src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.ts)): + - Tree-specific id caches ([`CategoriesTreeIdsCache`](../src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.ts), [`ClassificationsTreeIdsCache`](../src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts), [`ModelsTreeIdsCache`](../src/tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.ts)): - Store various tree-specific relationships, (e.g. models tree ids cache stores element's model <-> subject relationship). - - Extend `BaseIdsCacheImpl` so each tree-specific cache can be used in [`BaseVisibilityHelper`](../src/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.ts). + - Extend `BaseIdsCacheImpl` so each tree-specific cache can be used in [`BaseVisibilityHelper`](../src/tree-widget-react/shared/internal/visibility/BaseVisibilityHelper.ts). - - [`AlwaysAndNeverDrawnElementInfoCache`](../src/tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.ts) — caches extra data (like category) for always/never drawn elements. + - [`AlwaysAndNeverDrawnElementInfoCache`](../src/tree-widget-react/shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.ts) — caches extra data (like category) for always/never drawn elements. - Always and never drawn caches are reset when always and never drawn sets change respectively. - Always and never drawn elements can be retrieved by model, actual category, and hierarchy path. - - [`DescendantsCountCache`](../src/tree-widget-react/components/trees/common/internal/caches/DescendantsCountCache.ts) — retrieves descendant counts grouped by each descendant's actual category. + - [`DescendantsCountCache`](../src/tree-widget-react/shared/internal/caches/DescendantsCountCache.ts) — retrieves descendant counts grouped by each descendant's actual category. - Status requests use these counts with path-scoped always/never-drawn information. They do not load all descendant IDs. - Change requests use the grouped counts to decide which category groups already match the requested state. - - [`ChildElementsCache`](../src/tree-widget-react/components/trees/common/internal/caches/ChildElementsCache.ts) — cache for retrieving elements' children. + - [`ChildElementsCache`](../src/tree-widget-react/shared/internal/caches/ChildElementsCache.ts) — cache for retrieving elements' children. - Used only during changes, for category and element/grouping operations whose descendants are in categories that do not already match the requested state. - It retrieves IDs only for those non-matching category groups so they can be added to `alwaysDrawn` or `neverDrawn`. - It is not used for status requests. A hierarchy branch may contain hundreds of thousands of descendants, so status is computed from grouped counts instead. @@ -120,7 +120,7 @@ flowchart TD RESULT_ChangeCancelled([Change discarded]) %% Start - TITLE(["HierarchyVisibilityHandlerImpl request lifecycle"]) --> A{"Request operation"} + TITLE(["HierarchyVisibilityHandlerImpl request lifecycle"]) --> A{"Request operation"} PROPS[\" request @@ -194,8 +194,8 @@ The viewport only renders elements. Element visibility is resolved in the follow A trace of what happens when the user clicks the eye icon of a hidden category node in the Categories tree (no search active): -1. [`useHierarchyVisibility`](../src/tree-widget-react/components/trees/common/UseHierarchyVisibility.ts) calls `changeVisibility(node, true)` on the shared hierarchy visibility handler created by [`useCachedVisibility`](../src/tree-widget-react/components/trees/common/internal/hooks/UseCachedVisibility.ts). -2. The handler announces the change request, cancelling any in-progress status or change request for the same node. It creates a [`BufferingViewport`](../src/tree-widget-react/components/trees/common/internal/BufferingViewport.ts), suppresses viewport and always/never-drawn cache events, and creates a `CategoriesTreeVisibilityHandler` against the buffered viewport. +1. [`useHierarchyVisibility`](../src/tree-widget-react/shared/UseHierarchyVisibility.ts) calls `changeVisibility(node, true)` on the shared hierarchy visibility handler created by [`useCachedVisibility`](../src/tree-widget-react/shared/internal/hooks/UseCachedVisibility.ts). +2. The handler announces the change request, cancelling any in-progress status or change request for the same node. It creates a [`BufferingViewport`](../src/tree-widget-react/shared/internal/BufferingViewport.ts), suppresses viewport and always/never-drawn cache events, and creates a `CategoriesTreeVisibilityHandler` against the buffered viewport. 3. The tree-specific handler reads the node's `extendedData`, identifies a category node, and — after calling [removeAlwaysDrawnExclusive](./SharedVisibilityHandling.md#removealwaysdrawnexclusive) first if exclusive mode is active — delegates to the shared [changeCategoriesVisibilityStatus](./SharedVisibilityHandling.md#changecategoriesvisibilitystatus) without a `modelId`. 4. The shared helper enables the category in the category selector, then for every related model: clears the per-model category override, clears path-scoped always/never-drawn entries, and recursively changes scoped sub-models. Hidden related models are prepared by [showModelWithoutAnyCategoriesOrElements](./SharedVisibilityHandling.md#showmodelwithoutanycategoriesorelements) so no unrelated categories become visible. Descendants in other actual categories are reconciled through [queueElementsVisibilityChange](./SharedVisibilityHandling.md#queueelementsvisibilitychange), and hidden sub-categories of the requested category are enabled. 5. The change pipeline completes, so all buffered viewport mutations are committed in one batch, events are resumed, and the tree-specific handler is disposed. diff --git a/packages/tree-widget/src/test/trees/common/FocusedInstancesContext.test.tsx b/packages/tree-widget/src/test/shared/FocusedInstancesContext.test.tsx similarity index 98% rename from packages/tree-widget/src/test/trees/common/FocusedInstancesContext.test.tsx rename to packages/tree-widget/src/test/shared/FocusedInstancesContext.test.tsx index 4f39bf304b..5839802f55 100644 --- a/packages/tree-widget/src/test/trees/common/FocusedInstancesContext.test.tsx +++ b/packages/tree-widget/src/test/shared/FocusedInstancesContext.test.tsx @@ -5,8 +5,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { createStorage } from "@itwin/unified-selection"; -import { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../../../tree-widget-react/components/trees/common/FocusedInstancesContext.js"; -import { act, createAsyncIterator, renderHook, waitFor } from "../../TestUtils.js"; +import { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../../tree-widget-react/shared/FocusedInstancesContext.js"; +import { act, createAsyncIterator, renderHook, waitFor } from "../TestUtils.js"; import type { PropsWithChildren } from "react"; import type { GroupingHierarchyNode } from "@itwin/presentation-hierarchies"; diff --git a/packages/tree-widget/src/test/trees/common/TreeWidgetViewport.test.ts b/packages/tree-widget/src/test/shared/TreeWidgetViewport.test.ts similarity index 97% rename from packages/tree-widget/src/test/trees/common/TreeWidgetViewport.test.ts rename to packages/tree-widget/src/test/shared/TreeWidgetViewport.test.ts index 915c4336fb..144840195a 100644 --- a/packages/tree-widget/src/test/trees/common/TreeWidgetViewport.test.ts +++ b/packages/tree-widget/src/test/shared/TreeWidgetViewport.test.ts @@ -16,8 +16,8 @@ import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { withEditTxn } from "@itwin/core-backend"; import { Code, ColorDef, IModel, RenderMode } from "@itwin/core-common"; import { IModelApp, OffScreenViewport, SpatialViewState, ViewRect } from "@itwin/core-frontend"; -import { createTreeWidgetViewport } from "../../../tree-widget-react/components/trees/common/TreeWidgetViewport.js"; -import { buildIModel } from "../../IModelUtils.js"; +import { createTreeWidgetViewport } from "../../tree-widget-react/shared/TreeWidgetViewport.js"; +import { buildIModel } from "../IModelUtils.js"; import type { Id64Array } from "@itwin/core-bentley"; import type { IModelConnection, Viewport } from "@itwin/core-frontend"; diff --git a/packages/tree-widget/src/test/trees/common/UseHierarchyVisibility.test.ts b/packages/tree-widget/src/test/shared/UseHierarchyVisibility.test.ts similarity index 96% rename from packages/tree-widget/src/test/trees/common/UseHierarchyVisibility.test.ts rename to packages/tree-widget/src/test/shared/UseHierarchyVisibility.test.ts index ad381ba56e..17fba2183c 100644 --- a/packages/tree-widget/src/test/trees/common/UseHierarchyVisibility.test.ts +++ b/packages/tree-widget/src/test/shared/UseHierarchyVisibility.test.ts @@ -5,12 +5,12 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { BeEvent } from "@itwin/core-bentley"; -import { useHierarchyVisibility } from "../../../tree-widget-react/components/trees/common/UseHierarchyVisibility.js"; -import { TreeWidget } from "../../../tree-widget-react/TreeWidget.js"; -import { act, renderHook, waitFor } from "../../TestUtils.js"; -import { createTreeNode } from "../TreeUtils.js"; +import { useHierarchyVisibility } from "../../tree-widget-react/shared/UseHierarchyVisibility.js"; +import { TreeWidget } from "../../tree-widget-react/TreeWidget.js"; +import { act, renderHook, waitFor } from "../TestUtils.js"; +import { createTreeNode } from "../trees/TreeUtils.js"; -import type { HierarchyVisibilityHandler } from "../../../tree-widget-react/components/trees/common/UseHierarchyVisibility.js"; +import type { HierarchyVisibilityHandler } from "../../tree-widget-react/shared/UseHierarchyVisibility.js"; type UseHierarchyVisibilityProps = Parameters[0]; diff --git a/packages/tree-widget/src/test/trees/common/Utils.test.ts b/packages/tree-widget/src/test/shared/Utils.test.ts similarity index 98% rename from packages/tree-widget/src/test/trees/common/Utils.test.ts rename to packages/tree-widget/src/test/shared/Utils.test.ts index 72b4640368..a830e8dc98 100644 --- a/packages/tree-widget/src/test/trees/common/Utils.test.ts +++ b/packages/tree-widget/src/test/shared/Utils.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it } from "vitest"; -import { joinHierarchySearchTrees } from "../../../tree-widget-react/components/trees/common/Utils.js"; +import { joinHierarchySearchTrees } from "../../tree-widget-react/shared/Utils.js"; import type { IModelInstanceKey } from "@itwin/presentation-hierarchies"; diff --git a/packages/tree-widget/src/test/trees/common/VisibilityValidation.ts b/packages/tree-widget/src/test/shared/VisibilityValidation.ts similarity index 83% rename from packages/tree-widget/src/test/trees/common/VisibilityValidation.ts rename to packages/tree-widget/src/test/shared/VisibilityValidation.ts index 382a2a5e61..2c64256132 100644 --- a/packages/tree-widget/src/test/trees/common/VisibilityValidation.ts +++ b/packages/tree-widget/src/test/shared/VisibilityValidation.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import { EMPTY, expand, from, mergeMap, tap } from "rxjs"; -import { toVoidPromise } from "../../../tree-widget-react/components/trees/common/internal/Rxjs.js"; +import { toVoidPromise } from "../../tree-widget-react/shared/internal/Rxjs.js"; import type { HierarchyNode, HierarchyProvider } from "@itwin/presentation-hierarchies"; -import type { Visibility } from "../../../tree-widget-react/components/trees/common/internal/Tooltip.js"; -import type { HierarchyVisibilityHandler } from "../../../tree-widget-react/components/trees/common/UseHierarchyVisibility.js"; -import type { TreeWidgetTestingViewport } from "../TreeUtils.js"; +import type { Visibility } from "../../tree-widget-react/shared/internal/Tooltip.js"; +import type { HierarchyVisibilityHandler } from "../../tree-widget-react/shared/UseHierarchyVisibility.js"; +import type { TreeWidgetTestingViewport } from "../trees/TreeUtils.js"; export interface VisibilityExpectations { [id: string]: Visibility | "disabled"; diff --git a/packages/tree-widget/src/test/trees/common/internal/AlwaysAndNeverDrawnElementInfoCache.test.ts b/packages/tree-widget/src/test/shared/internal/AlwaysAndNeverDrawnElementInfoCache.test.ts similarity index 98% rename from packages/tree-widget/src/test/trees/common/internal/AlwaysAndNeverDrawnElementInfoCache.test.ts rename to packages/tree-widget/src/test/shared/internal/AlwaysAndNeverDrawnElementInfoCache.test.ts index bcea620cb4..ba83214cf6 100644 --- a/packages/tree-widget/src/test/trees/common/internal/AlwaysAndNeverDrawnElementInfoCache.test.ts +++ b/packages/tree-widget/src/test/shared/internal/AlwaysAndNeverDrawnElementInfoCache.test.ts @@ -10,14 +10,14 @@ import { ALWAYS_NEVER_BUFFER_THRESHOLD, AlwaysAndNeverDrawnElementInfoCache, SET_CHANGE_DEBOUNCE_TIME, -} from "../../../../tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; -import { createResolvablePromise } from "../../../TestUtils.js"; -import { createFakeViewport } from "../../Common.js"; +} from "../../../tree-widget-react/shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +import { createResolvablePromise } from "../../TestUtils.js"; +import { createFakeViewport } from "../../trees/Common.js"; import type { Id64String } from "@itwin/core-bentley"; import type { QueryBinder } from "@itwin/core-common"; -import type { TreeWidgetViewport } from "../../../../tree-widget-react.js"; -import type { ElementPathSegment } from "../../../../tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +import type { ElementPathSegment } from "../../../tree-widget-react/shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +import type { TreeWidgetViewport } from "../../../tree-widget-react/shared/TreeWidgetViewport.js"; describe("AlwaysAndNeverDrawnElementInfoCache", () => { beforeEach(() => { diff --git a/packages/tree-widget/src/test/trees/common/internal/BufferingViewport.test.ts b/packages/tree-widget/src/test/shared/internal/BufferingViewport.test.ts similarity index 97% rename from packages/tree-widget/src/test/trees/common/internal/BufferingViewport.test.ts rename to packages/tree-widget/src/test/shared/internal/BufferingViewport.test.ts index 66bc945a0d..e18da0e75e 100644 --- a/packages/tree-widget/src/test/trees/common/internal/BufferingViewport.test.ts +++ b/packages/tree-widget/src/test/shared/internal/BufferingViewport.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it } from "vitest"; -import { BufferingViewport } from "../../../../tree-widget-react/components/trees/common/internal/BufferingViewport.js"; -import { createTreeWidgetTestingViewport } from "../../TreeUtils.js"; +import { BufferingViewport } from "../../../tree-widget-react/shared/internal/BufferingViewport.js"; +import { createTreeWidgetTestingViewport } from "../../trees/TreeUtils.js"; import type { IModelConnection } from "@itwin/core-frontend"; -import type { TreeWidgetViewport } from "../../../../tree-widget-react/components/trees/common/TreeWidgetViewport.js"; +import type { TreeWidgetViewport } from "../../../tree-widget-react/shared/TreeWidgetViewport.js"; describe("BufferingViewport", () => { describe("models", () => { diff --git a/packages/tree-widget/src/test/trees/common/internal/ChildElementsCache.test.ts b/packages/tree-widget/src/test/shared/internal/ChildElementsCache.test.ts similarity index 98% rename from packages/tree-widget/src/test/trees/common/internal/ChildElementsCache.test.ts rename to packages/tree-widget/src/test/shared/internal/ChildElementsCache.test.ts index 3d3f1b4d05..5f1d3c75d5 100644 --- a/packages/tree-widget/src/test/trees/common/internal/ChildElementsCache.test.ts +++ b/packages/tree-widget/src/test/shared/internal/ChildElementsCache.test.ts @@ -21,10 +21,10 @@ import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import { createLimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; -import { ChildElementsCache } from "../../../../tree-widget-react/components/trees/common/internal/caches/ChildElementsCache.js"; -import { CLASS_NAME_GeometricElement3d } from "../../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { buildIModel } from "../../../IModelUtils.js"; -import { createFakeViewport } from "../../Common.js"; +import { ChildElementsCache } from "../../../tree-widget-react/shared/internal/caches/ChildElementsCache.js"; +import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { buildIModel } from "../../IModelUtils.js"; +import { createFakeViewport } from "../../trees/Common.js"; import type { IModelConnection } from "@itwin/core-frontend"; diff --git a/packages/tree-widget/src/test/trees/common/internal/DescendantsCountCache.test.ts b/packages/tree-widget/src/test/shared/internal/DescendantsCountCache.test.ts similarity index 98% rename from packages/tree-widget/src/test/trees/common/internal/DescendantsCountCache.test.ts rename to packages/tree-widget/src/test/shared/internal/DescendantsCountCache.test.ts index d4be455be8..174dda5c29 100644 --- a/packages/tree-widget/src/test/trees/common/internal/DescendantsCountCache.test.ts +++ b/packages/tree-widget/src/test/shared/internal/DescendantsCountCache.test.ts @@ -20,10 +20,10 @@ import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import { createLimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; -import { DescendantsCountCache } from "../../../../tree-widget-react/components/trees/common/internal/caches/DescendantsCountCache.js"; -import { CLASS_NAME_GeometricElement3d } from "../../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { buildIModel } from "../../../IModelUtils.js"; -import { createFakeViewport } from "../../Common.js"; +import { DescendantsCountCache } from "../../../tree-widget-react/shared/internal/caches/DescendantsCountCache.js"; +import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { buildIModel } from "../../IModelUtils.js"; +import { createFakeViewport } from "../../trees/Common.js"; import type { IModelConnection } from "@itwin/core-frontend"; diff --git a/packages/tree-widget/src/test/trees/common/internal/Utils.test.ts b/packages/tree-widget/src/test/shared/internal/Utils.test.ts similarity index 98% rename from packages/tree-widget/src/test/trees/common/internal/Utils.test.ts rename to packages/tree-widget/src/test/shared/internal/Utils.test.ts index 7815a15db5..a064a80441 100644 --- a/packages/tree-widget/src/test/trees/common/internal/Utils.test.ts +++ b/packages/tree-widget/src/test/shared/internal/Utils.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it } from "vitest"; -import { createWhereClause, mergeWithDefaults, stableStringify } from "../../../../tree-widget-react/components/trees/common/internal/Utils.js"; +import { createWhereClause, mergeWithDefaults, stableStringify } from "../../../tree-widget-react/shared/internal/Utils.js"; describe("Utils", () => { describe("createWhereClause", () => { diff --git a/packages/tree-widget/src/test/trees/common/internal/VisibilityChangeEventListener.test.ts b/packages/tree-widget/src/test/shared/internal/VisibilityChangeEventListener.test.ts similarity index 96% rename from packages/tree-widget/src/test/trees/common/internal/VisibilityChangeEventListener.test.ts rename to packages/tree-widget/src/test/shared/internal/VisibilityChangeEventListener.test.ts index 7974c547a2..5a19264a7f 100644 --- a/packages/tree-widget/src/test/trees/common/internal/VisibilityChangeEventListener.test.ts +++ b/packages/tree-widget/src/test/shared/internal/VisibilityChangeEventListener.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it, vi } from "vitest"; -import { createVisibilityChangeEventListener } from "../../../../tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js"; -import { waitFor } from "../../../TestUtils.js"; -import { createFakeViewport } from "../../Common.js"; +import { createVisibilityChangeEventListener } from "../../../tree-widget-react/shared/internal/VisibilityChangeEventListener.js"; +import { waitFor } from "../../TestUtils.js"; +import { createFakeViewport } from "../../trees/Common.js"; describe("VisibilityChangeEventListener", () => { it("raises event on `onAlwaysDrawnChanged` event", async () => { diff --git a/packages/tree-widget/src/test/trees/common/internal/VisibilityUtils.test.ts b/packages/tree-widget/src/test/shared/internal/VisibilityUtils.test.ts similarity index 97% rename from packages/tree-widget/src/test/trees/common/internal/VisibilityUtils.test.ts rename to packages/tree-widget/src/test/shared/internal/VisibilityUtils.test.ts index 14c30fb5b7..ea6a7ada1d 100644 --- a/packages/tree-widget/src/test/trees/common/internal/VisibilityUtils.test.ts +++ b/packages/tree-widget/src/test/shared/internal/VisibilityUtils.test.ts @@ -20,7 +20,7 @@ import { IModelApp, NoRenderApp } from "@itwin/core-frontend"; import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; -import { createVisibilityStatus } from "../../../../tree-widget-react/components/trees/common/internal/Tooltip.js"; +import { createVisibilityStatus } from "../../../tree-widget-react/shared/internal/Tooltip.js"; import { changeCategoryDisplay, changeElementStateNoChildrenOperator, @@ -30,16 +30,16 @@ import { invertAllModels, mergeVisibilityStatuses, showAll, -} from "../../../../tree-widget-react/components/trees/common/internal/VisibilityUtils.js"; -import { buildIModel } from "../../../IModelUtils.js"; -import { TestUtils } from "../../../TestUtils.js"; -import { createFakeViewport } from "../../Common.js"; -import { createTreeWidgetTestingViewport } from "../../TreeUtils.js"; +} from "../../../tree-widget-react/shared/internal/VisibilityUtils.js"; +import { buildIModel } from "../../IModelUtils.js"; +import { TestUtils } from "../../TestUtils.js"; +import { createFakeViewport } from "../../trees/Common.js"; +import { createTreeWidgetTestingViewport } from "../../trees/TreeUtils.js"; import type { IModelDb } from "@itwin/core-backend"; import type { Id64Array, Id64String } from "@itwin/core-bentley"; import type { IModelConnection } from "@itwin/core-frontend"; -import type { TreeWidgetTestingViewport } from "../../TreeUtils.js"; +import type { TreeWidgetTestingViewport } from "../../trees/TreeUtils.js"; describe("VisibilityUtils", () => { beforeAll(async () => { diff --git a/packages/tree-widget/src/test/trees/common/internal/hooks/UseCachedVisibility.test.ts b/packages/tree-widget/src/test/shared/internal/hooks/UseCachedVisibility.test.ts similarity index 96% rename from packages/tree-widget/src/test/trees/common/internal/hooks/UseCachedVisibility.test.ts rename to packages/tree-widget/src/test/shared/internal/hooks/UseCachedVisibility.test.ts index 101307835e..623ef87f37 100644 --- a/packages/tree-widget/src/test/trees/common/internal/hooks/UseCachedVisibility.test.ts +++ b/packages/tree-widget/src/test/shared/internal/hooks/UseCachedVisibility.test.ts @@ -5,14 +5,14 @@ import { EMPTY, of, Subject } from "rxjs"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { HierarchyVisibilityHandlerImpl } from "../../../../../tree-widget-react/components/trees/common/internal/hooks/UseCachedVisibility.js"; -import { createVisibilityStatus } from "../../../../../tree-widget-react/components/trees/common/internal/Tooltip.js"; -import { createFakeViewport } from "../../../Common.js"; +import { HierarchyVisibilityHandlerImpl } from "../../../../tree-widget-react/shared/internal/hooks/UseCachedVisibility.js"; +import { createVisibilityStatus } from "../../../../tree-widget-react/shared/internal/Tooltip.js"; +import { createFakeViewport } from "../../../trees/Common.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; -import type { HierarchyVisibilityHandlerImplProps } from "../../../../../tree-widget-react/components/trees/common/internal/hooks/UseCachedVisibility.js"; -import type { TreeSpecificVisibilityHandler } from "../../../../../tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js"; -import type { VisibilityStatus } from "../../../../../tree-widget-react/components/trees/common/UseHierarchyVisibility.js"; +import type { HierarchyVisibilityHandlerImplProps } from "../../../../tree-widget-react/shared/internal/hooks/UseCachedVisibility.js"; +import type { TreeSpecificVisibilityHandler } from "../../../../tree-widget-react/shared/internal/visibility/BaseVisibilityHelper.js"; +import type { VisibilityStatus } from "../../../../tree-widget-react/shared/UseHierarchyVisibility.js"; function createNode(props?: { instanceKeys?: Array<{ className: string; id: string }>; parentKeys?: HierarchyNode["parentKeys"] }): HierarchyNode { return { diff --git a/packages/tree-widget/src/test/trees/common/internal/hooks/UseIdsCache.test.ts b/packages/tree-widget/src/test/shared/internal/hooks/UseIdsCache.test.ts similarity index 97% rename from packages/tree-widget/src/test/trees/common/internal/hooks/UseIdsCache.test.ts rename to packages/tree-widget/src/test/shared/internal/hooks/UseIdsCache.test.ts index 1b13bdefa2..f956bb7a78 100644 --- a/packages/tree-widget/src/test/trees/common/internal/hooks/UseIdsCache.test.ts +++ b/packages/tree-widget/src/test/shared/internal/hooks/UseIdsCache.test.ts @@ -5,8 +5,8 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; import { BeEvent } from "@itwin/core-bentley"; -import { useIdsCache } from "../../../../../tree-widget-react/components/trees/common/internal/hooks/UseIdsCache.js"; -import { act, renderHook } from "../../../../TestUtils.js"; +import { useIdsCache } from "../../../../tree-widget-react/shared/internal/hooks/UseIdsCache.js"; +import { act, renderHook } from "../../../TestUtils.js"; import type { BriefcaseConnection } from "@itwin/core-frontend"; diff --git a/packages/tree-widget/src/test/trees/Common.ts b/packages/tree-widget/src/test/trees/Common.ts index afa477c69c..72079326f9 100644 --- a/packages/tree-widget/src/test/trees/Common.ts +++ b/packages/tree-widget/src/test/trees/Common.ts @@ -15,7 +15,7 @@ import type { QueryBinder, QueryOptions } from "@itwin/core-common"; import type { IModelConnection } from "@itwin/core-frontend"; import type { LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; import type { ECClassHierarchyInspector, ECSchemaProvider } from "@itwin/presentation-shared"; -import type { TreeWidgetViewport } from "../../tree-widget-react/components/trees/common/TreeWidgetViewport.js"; +import type { TreeWidgetViewport } from "../../tree-widget-react/shared/TreeWidgetViewport.js"; import type { TreeWidgetTestingViewport } from "./TreeUtils.js"; type QueryHandler = (query: string, params?: QueryBinder, config?: QueryOptions) => any[] | Promise; diff --git a/packages/tree-widget/src/test/trees/HierarchyValidation.ts b/packages/tree-widget/src/test/trees/HierarchyValidation.ts index 0f551320ba..e2b147f3d2 100644 --- a/packages/tree-widget/src/test/trees/HierarchyValidation.ts +++ b/packages/tree-widget/src/test/trees/HierarchyValidation.ts @@ -9,7 +9,7 @@ import { collect } from "./Common.js"; import type { GenericNodeKey, HierarchyProvider, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; -export interface HierarchyDef { +interface HierarchyDef { node: TNode; children?: Array> | boolean; } diff --git a/packages/tree-widget/src/test/trees/TreeUtils.ts b/packages/tree-widget/src/test/trees/TreeUtils.ts index 1d4ba10caf..24affcbc66 100644 --- a/packages/tree-widget/src/test/trees/TreeUtils.ts +++ b/packages/tree-widget/src/test/trees/TreeUtils.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import { BeEvent, Id64 } from "@itwin/core-bentley"; -import { getOrCreate } from "../../tree-widget-react/components/trees/common/internal/Utils.js"; +import { getOrCreate } from "../../tree-widget-react/shared/internal/Utils.js"; import type { Id64Arg, Id64String } from "@itwin/core-bentley"; import type { NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; import type { TreeNode } from "@itwin/presentation-hierarchies-react"; -import type { CategoryId, ElementId, ModelId, SubCategoryId } from "../../tree-widget-react/components/trees/common/internal/Types.js"; -import type { TreeWidgetViewport } from "../../tree-widget-react/components/trees/common/TreeWidgetViewport.js"; +import type { CategoryId, ElementId, ModelId, SubCategoryId } from "../../tree-widget-react/shared/internal/Types.js"; +import type { TreeWidgetViewport } from "../../tree-widget-react/shared/TreeWidgetViewport.js"; export const CLASS_NAME_DefinitionModel = "BisCore.DefinitionModel"; diff --git a/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeDefinition.test.ts b/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeDefinition.test.ts index 1d7ab79538..995e542f18 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeDefinition.test.ts +++ b/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeDefinition.test.ts @@ -24,13 +24,10 @@ import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { createIModelHierarchyProvider } from "@itwin/presentation-hierarchies"; -import { - CategoriesTreeDefinition, - defaultHierarchyConfiguration, -} from "../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js"; -import { CategoriesTreeIdsCache } from "../../../tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; -import { BaseIdsCache } from "../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; -import { getClassesByView, mergeWithDefaults } from "../../../tree-widget-react/components/trees/common/internal/Utils.js"; +import { BaseIdsCache } from "../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; +import { getClassesByView, mergeWithDefaults } from "../../../tree-widget-react/shared/internal/Utils.js"; +import { CategoriesTreeDefinition, defaultHierarchyConfiguration } from "../../../tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.js"; +import { CategoriesTreeIdsCache } from "../../../tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; import { buildIModel, TestSchema } from "../../IModelUtils.js"; import { createIModelAccess } from "../Common.js"; import { NodeValidators, validateHierarchy } from "../HierarchyValidation.js"; @@ -40,7 +37,7 @@ import { getInsertFunctionByViewType } from "./internal/Utils.js"; import type { IModelConnection } from "@itwin/core-frontend"; import type { HierarchyProvider } from "@itwin/presentation-hierarchies"; import type { EC } from "@itwin/presentation-shared"; -import type { CategoriesTreeHierarchyConfiguration } from "../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js"; +import type { CategoriesTreeHierarchyConfiguration } from "../../../tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.js"; describe("Categories tree", () => { describe("Hierarchy definition", () => { diff --git a/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeFiltering.test.tsx b/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeFiltering.test.tsx index 6394022b22..b60c4eefa9 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeFiltering.test.tsx +++ b/packages/tree-widget/src/test/trees/categories-tree/CategoriesTreeFiltering.test.tsx @@ -25,13 +25,10 @@ import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { act, renderHook } from "@testing-library/react"; -import { useCategoriesTree } from "../../../tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js"; -import { - CLASS_NAME_GeometricElement2d, - CLASS_NAME_GeometricElement3d, -} from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { getClassesByView } from "../../../tree-widget-react/components/trees/common/internal/Utils.js"; -import { SharedTreeContextProvider } from "../../../tree-widget-react/components/trees/common/SharedTreeContextProvider.js"; +import { CLASS_NAME_GeometricElement2d, CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { getClassesByView } from "../../../tree-widget-react/shared/internal/Utils.js"; +import { SharedTreeContextProvider } from "../../../tree-widget-react/shared/SharedTreeContextProvider.js"; +import { useCategoriesTree } from "../../../tree-widget-react/trees/categories-tree/UseCategoriesTree.js"; import { buildIModel } from "../../IModelUtils.js"; import { createFakeViewport, createIModelAccess } from "../Common.js"; import { CLASS_NAME_DefinitionModel } from "../TreeUtils.js"; @@ -39,7 +36,7 @@ import { getInsertFunctionByViewType } from "./internal/Utils.js"; import type { IModelConnection } from "@itwin/core-frontend"; import type { EC, Props } from "@itwin/presentation-shared"; -import type { CategoryInfo } from "../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js"; +import type { CategoryInfo } from "../../../tree-widget-react/trees/categories-tree/CategoriesTreeButtons.js"; // cspell:words egory // cspell complains about Cat_egory and Cat%egory diff --git a/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeIdsCache.test.ts b/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeIdsCache.test.ts index f1fdf4397a..f08786259b 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeIdsCache.test.ts +++ b/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeIdsCache.test.ts @@ -22,10 +22,10 @@ import { IModelReadRpcInterface } from "@itwin/core-common"; import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; -import { CategoriesTreeIdsCache } from "../../../../tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; -import { BaseIdsCache } from "../../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; -import { collect } from "../../../../tree-widget-react/components/trees/common/internal/Rxjs.js"; -import { getClassesByView } from "../../../../tree-widget-react/components/trees/common/internal/Utils.js"; +import { BaseIdsCache } from "../../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; +import { collect } from "../../../../tree-widget-react/shared/internal/Rxjs.js"; +import { getClassesByView } from "../../../../tree-widget-react/shared/internal/Utils.js"; +import { CategoriesTreeIdsCache } from "../../../../tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; import { buildIModel } from "../../../IModelUtils.js"; import { createIModelAccess } from "../../Common.js"; import { CLASS_NAME_DefinitionModel, getDefaultSubCategoryId } from "../../TreeUtils.js"; diff --git a/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeNode.test.ts b/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeNode.test.ts index fe55ae7b49..f236d48ea9 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeNode.test.ts +++ b/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeNode.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it } from "vitest"; -import { CategoriesTreeNode } from "../../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.js"; -import { CLASS_NAME_GeometricElement3d } from "../../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; +import { CLASS_NAME_GeometricElement3d } from "../../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { CategoriesTreeNode } from "../../../../tree-widget-react/trees/categories-tree/CategoriesTreeNode.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; diff --git a/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeVisibilityHandler.test.ts b/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeVisibilityHandler.test.ts index af18ba6224..6006ac8b5d 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeVisibilityHandler.test.ts +++ b/packages/tree-widget/src/test/trees/categories-tree/internal/CategoriesTreeVisibilityHandler.test.ts @@ -23,23 +23,20 @@ import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { createIModelHierarchyProvider } from "@itwin/presentation-hierarchies"; -import { - CategoriesTreeDefinition, - defaultHierarchyConfiguration, -} from "../../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js"; -import { CategoriesTreeIdsCache } from "../../../../tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; -import { createCategoriesTreeVisibilityHandler } from "../../../../tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js"; -import { BaseIdsCache } from "../../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; +import { BaseIdsCache } from "../../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; import { CLASS_NAME_GeometricElement3d, CLASS_NAME_SubCategory, CLASS_NAME_Subject, -} from "../../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { getClassesByView, mergeWithDefaults } from "../../../../tree-widget-react/components/trees/common/internal/Utils.js"; +} from "../../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { getClassesByView, mergeWithDefaults } from "../../../../tree-widget-react/shared/internal/Utils.js"; +import { CategoriesTreeDefinition, defaultHierarchyConfiguration } from "../../../../tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.js"; +import { CategoriesTreeIdsCache } from "../../../../tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; +import { createCategoriesTreeVisibilityHandler } from "../../../../tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js"; import { buildIModel } from "../../../IModelUtils.js"; +import { validateHierarchyVisibility } from "../../../shared/VisibilityValidation.js"; import { TestUtils } from "../../../TestUtils.js"; import { createIModelAccess } from "../../Common.js"; -import { validateHierarchyVisibility } from "../../common/VisibilityValidation.js"; import { CLASS_NAME_DefinitionModel, createTreeWidgetTestingViewport, getDefaultSubCategoryId } from "../../TreeUtils.js"; import { createCategoryHierarchyNode, @@ -59,8 +56,8 @@ import type { InstanceKey, Props } from "@itwin/presentation-shared"; import type { CategoriesTreeHierarchyConfiguration, RequiredCategoriesTreeHierarchyConfiguration, -} from "../../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js"; -import type { VisibilityExpectations } from "../../common/VisibilityValidation.js"; +} from "../../../../tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.js"; +import type { VisibilityExpectations } from "../../../shared/VisibilityValidation.js"; import type { TreeWidgetTestingViewport } from "../../TreeUtils.js"; describe("CategoriesTreeVisibilityHandler", () => { diff --git a/packages/tree-widget/src/test/trees/categories-tree/internal/Utils.ts b/packages/tree-widget/src/test/trees/categories-tree/internal/Utils.ts index 91c3b6ccdc..a006d89ea1 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/internal/Utils.ts +++ b/packages/tree-widget/src/test/trees/categories-tree/internal/Utils.ts @@ -17,16 +17,16 @@ import { CLASS_NAME_DefinitionContainer, CLASS_NAME_Element, CLASS_NAME_SubCategory, -} from "../../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { getClassesByView } from "../../../../tree-widget-react/components/trees/common/internal/Utils.js"; +} from "../../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { getClassesByView } from "../../../../tree-widget-react/shared/internal/Utils.js"; import { TestSchema } from "../../../IModelUtils.js"; import type { EditTxn } from "@itwin/core-backend"; import type { Id64Array, Id64String } from "@itwin/core-bentley"; import type { ClassGroupingNodeKey, GroupingHierarchyNode, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; import type { EC, InstanceKey } from "@itwin/presentation-shared"; -import type { ElementId, ModelId } from "../../../../tree-widget-react/components/trees/common/internal/Types.js"; -import type { ParentElementsPath } from "../../../../tree-widget-react/components/trees/common/internal/Utils.js"; +import type { ElementId, ModelId } from "../../../../tree-widget-react/shared/internal/Types.js"; +import type { ParentElementsPath } from "../../../../tree-widget-react/shared/internal/Utils.js"; /** @internal */ export function createCategoryHierarchyNode(props: { diff --git a/packages/tree-widget/src/test/trees/categories-tree/internal/VisibilityValidation.ts b/packages/tree-widget/src/test/trees/categories-tree/internal/VisibilityValidation.ts index 8757ebadc6..af22c62b2a 100644 --- a/packages/tree-widget/src/test/trees/categories-tree/internal/VisibilityValidation.ts +++ b/packages/tree-widget/src/test/trees/categories-tree/internal/VisibilityValidation.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { expect } from "vitest"; -import { CategoriesTreeNode } from "../../../../tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.js"; -import { CategoriesTreeNodeInternal } from "../../../../tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNodeInternal.js"; +import { CategoriesTreeNode } from "../../../../tree-widget-react/trees/categories-tree/CategoriesTreeNode.js"; +import { CategoriesTreeNodeInternal } from "../../../../tree-widget-react/trees/categories-tree/internal/CategoriesTreeNodeInternal.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; -import type { ValidateNodeProps } from "../../common/VisibilityValidation.js"; +import type { ValidateNodeProps } from "../../../shared/VisibilityValidation.js"; export async function validateNodeVisibility({ node, diff --git a/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeFiltering.test.tsx b/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeFiltering.test.tsx index a539e08d6a..090cbfee34 100644 --- a/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeFiltering.test.tsx +++ b/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeFiltering.test.tsx @@ -8,13 +8,13 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { withEditTxn } from "@itwin/core-backend"; import { Id64 } from "@itwin/core-bentley"; import { act, renderHook } from "@testing-library/react"; -import { useClassificationsTreeDefinition } from "../../../tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js"; import { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable, CLASS_NAME_GeometricElement3d, -} from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { SharedTreeContextProvider } from "../../../tree-widget-react/components/trees/common/SharedTreeContextProvider.js"; +} from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { SharedTreeContextProvider } from "../../../tree-widget-react/shared/SharedTreeContextProvider.js"; +import { useClassificationsTreeDefinition } from "../../../tree-widget-react/trees/classifications-tree/UseClassificationsTreeDefinition.js"; import { buildIModel } from "../../IModelUtils.js"; import { initializeITwinJs, terminateITwinJs } from "../../Initialize.js"; import { diff --git a/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeNode.test.ts b/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeNode.test.ts index 76ceeb852a..cd57e439f0 100644 --- a/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeNode.test.ts +++ b/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeNode.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it } from "vitest"; -import { ClassificationsTreeNode } from "../../../tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.js"; +import { ClassificationsTreeNode } from "../../../tree-widget-react/trees/classifications-tree/ClassificationsTreeNode.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; diff --git a/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeVisibilityHandler.test.ts b/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeVisibilityHandler.test.ts index ea0fc17158..e73e6d8a89 100644 --- a/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeVisibilityHandler.test.ts +++ b/packages/tree-widget/src/test/trees/classifications-tree/ClassificationsTreeVisibilityHandler.test.ts @@ -7,15 +7,15 @@ import { insertPhysicalElement, insertPhysicalModelWithPartition, insertSpatialC import { afterAll, beforeAll, describe, it } from "vitest"; import { withEditTxn } from "@itwin/core-backend"; import { createIModelHierarchyProvider } from "@itwin/presentation-hierarchies"; -import { ClassificationsTreeDefinition } from "../../../tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js"; -import { ClassificationsTreeIdsCache } from "../../../tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js"; -import { createClassificationsTreeVisibilityHandler } from "../../../tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js"; -import { BaseIdsCache } from "../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; -import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; +import { BaseIdsCache } from "../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; +import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { ClassificationsTreeDefinition } from "../../../tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.js"; +import { ClassificationsTreeIdsCache } from "../../../tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js"; +import { createClassificationsTreeVisibilityHandler } from "../../../tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js"; import { buildIModel } from "../../IModelUtils.js"; import { initializeITwinJs, terminateITwinJs } from "../../Initialize.js"; +import { validateHierarchyVisibility } from "../../shared/VisibilityValidation.js"; import { createIModelAccess } from "../Common.js"; -import { validateHierarchyVisibility } from "../common/VisibilityValidation.js"; import { createTreeWidgetTestingViewport } from "../TreeUtils.js"; import { createClassificationHierarchyNode, createClassificationTableHierarchyNode, createPhysicalElementHierarchyNode } from "./HierarchyNodeUtils.js"; import { @@ -33,8 +33,8 @@ import { validateNodeVisibility } from "./VisibilityValidation.js"; import type { IModelConnection } from "@itwin/core-frontend"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { Props } from "@itwin/presentation-shared"; -import type { ClassificationsTreeHierarchyConfiguration } from "../../../tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js"; -import type { ClassificationsTreeVisibilityHandlerConfiguration } from "../../../tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js"; +import type { ClassificationsTreeHierarchyConfiguration } from "../../../tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.js"; +import type { ClassificationsTreeVisibilityHandlerConfiguration } from "../../../tree-widget-react/trees/classifications-tree/UseClassificationsTree.js"; describe("ClassificationsTreeVisibilityHandler", () => { beforeAll(async () => { diff --git a/packages/tree-widget/src/test/trees/classifications-tree/HierarchyNodeUtils.ts b/packages/tree-widget/src/test/trees/classifications-tree/HierarchyNodeUtils.ts index ed9fbefce3..ab2ac76754 100644 --- a/packages/tree-widget/src/test/trees/classifications-tree/HierarchyNodeUtils.ts +++ b/packages/tree-widget/src/test/trees/classifications-tree/HierarchyNodeUtils.ts @@ -3,12 +3,12 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable } from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; +import { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; import type { Id64String } from "@itwin/core-bentley"; import type { NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; import type { InstanceKey } from "@itwin/presentation-shared"; -import type { ParentElementsPath } from "../../../tree-widget-react/components/trees/common/internal/Utils.js"; +import type { ParentElementsPath } from "../../../tree-widget-react/shared/internal/Utils.js"; export function createClassificationTableHierarchyNode({ id, diff --git a/packages/tree-widget/src/test/trees/classifications-tree/Utils.ts b/packages/tree-widget/src/test/trees/classifications-tree/Utils.ts index 88ebf46961..430035cc08 100644 --- a/packages/tree-widget/src/test/trees/classifications-tree/Utils.ts +++ b/packages/tree-widget/src/test/trees/classifications-tree/Utils.ts @@ -8,10 +8,10 @@ import { createRequire } from "node:module"; import { createCode, importSchema, insertDefinitionSubModel } from "test-utilities"; import { Code, IModel } from "@itwin/core-common"; import { createIModelHierarchyProvider } from "@itwin/presentation-hierarchies"; -import { ClassificationsTreeDefinition } from "../../../tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js"; -import { ClassificationsTreeIdsCache } from "../../../tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js"; -import { BaseIdsCache } from "../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; -import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; +import { BaseIdsCache } from "../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; +import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { ClassificationsTreeDefinition } from "../../../tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.js"; +import { ClassificationsTreeIdsCache } from "../../../tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js"; import { createIModelAccess } from "../Common.js"; import type { EditTxn, IModelDb } from "@itwin/core-backend"; @@ -20,7 +20,7 @@ import type { DefinitionElementProps } from "@itwin/core-common"; import type { IModelConnection } from "@itwin/core-frontend"; import type { HierarchyProvider } from "@itwin/presentation-hierarchies"; import type { EC } from "@itwin/presentation-shared"; -import type { ClassificationsTreeHierarchyConfiguration } from "../../../tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js"; +import type { ClassificationsTreeHierarchyConfiguration } from "../../../tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.js"; export function createClassificationsTreeProvider( imodel: IModelConnection, diff --git a/packages/tree-widget/src/test/trees/classifications-tree/VisibilityValidation.ts b/packages/tree-widget/src/test/trees/classifications-tree/VisibilityValidation.ts index 93501a3ce8..bade4bab73 100644 --- a/packages/tree-widget/src/test/trees/classifications-tree/VisibilityValidation.ts +++ b/packages/tree-widget/src/test/trees/classifications-tree/VisibilityValidation.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { expect } from "vitest"; -import { ClassificationsTreeNode } from "../../../tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.js"; +import { ClassificationsTreeNode } from "../../../tree-widget-react/trees/classifications-tree/ClassificationsTreeNode.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; -import type { ValidateNodeProps } from "../common/VisibilityValidation.js"; +import type { ValidateNodeProps } from "../../shared/VisibilityValidation.js"; export async function validateNodeVisibility({ node, diff --git a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeDefinition.test.ts b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeDefinition.test.ts index b837da74e0..dae5911166 100644 --- a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeDefinition.test.ts +++ b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeDefinition.test.ts @@ -20,7 +20,7 @@ import { IModel, IModelReadRpcInterface } from "@itwin/core-common"; import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; -import { CLASS_NAME_GeometricElement2d, CLASS_NAME_Subject } from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; +import { CLASS_NAME_GeometricElement2d, CLASS_NAME_Subject } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; import { buildIModel, TestSchema } from "../../IModelUtils.js"; import { NodeValidators, validateHierarchy } from "../HierarchyValidation.js"; import { createModelsTreeProvider } from "./Utils.js"; diff --git a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeFiltering.test.tsx b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeFiltering.test.tsx index b996c4ae51..1aa4df7dd7 100644 --- a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeFiltering.test.tsx +++ b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeFiltering.test.tsx @@ -28,9 +28,9 @@ import { CLASS_NAME_GeometricElement3d, CLASS_NAME_GeometricModel3d, CLASS_NAME_Subject, -} from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { SharedTreeContextProvider } from "../../../tree-widget-react/components/trees/common/SharedTreeContextProvider.js"; -import { useModelsTree } from "../../../tree-widget-react/components/trees/models-tree/UseModelsTree.js"; +} from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { SharedTreeContextProvider } from "../../../tree-widget-react/shared/SharedTreeContextProvider.js"; +import { useModelsTree } from "../../../tree-widget-react/trees/models-tree/UseModelsTree.js"; import { buildIModel } from "../../IModelUtils.js"; import { createFakeViewport, createIModelAccess } from "../Common.js"; import { NodeValidators, validateHierarchy } from "../HierarchyValidation.js"; @@ -41,7 +41,7 @@ import type { Id64String } from "@itwin/core-bentley"; import type { IModelConnection } from "@itwin/core-frontend"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { InstanceKey, Props } from "@itwin/presentation-shared"; -import type { ElementsGroupInfo, ModelsTreeHierarchyConfiguration } from "../../../tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; +import type { ElementsGroupInfo, ModelsTreeHierarchyConfiguration } from "../../../tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; import type { ExpectedHierarchyDef } from "../HierarchyValidation.js"; interface TreeSearchTestCaseDefinition { diff --git a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeHierarchyLevelFiltering.test.ts b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeHierarchyLevelFiltering.test.ts index 794833499d..72c04b4df7 100644 --- a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeHierarchyLevelFiltering.test.ts +++ b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeHierarchyLevelFiltering.test.ts @@ -23,7 +23,7 @@ import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { DefaultContentDisplayTypes, KeySet, PresentationRpcInterface, PropertyValueFormat } from "@itwin/presentation-common"; import { Presentation } from "@itwin/presentation-frontend"; import { normalizeFullClassName } from "@itwin/presentation-shared"; -import { CLASS_NAME_Subject } from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; +import { CLASS_NAME_Subject } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; import { buildIModel } from "../../IModelUtils.js"; import { collect } from "../Common.js"; import { NodeValidators, validateHierarchyLevel } from "../HierarchyValidation.js"; diff --git a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeNode.test.ts b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeNode.test.ts index 5aad8ad803..65d4a3696a 100644 --- a/packages/tree-widget/src/test/trees/models-tree/ModelsTreeNode.test.ts +++ b/packages/tree-widget/src/test/trees/models-tree/ModelsTreeNode.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { describe, expect, it } from "vitest"; -import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { ModelsTreeNode } from "../../../tree-widget-react/components/trees/models-tree/ModelsTreeNode.js"; +import { CLASS_NAME_GeometricElement3d } from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { ModelsTreeNode } from "../../../tree-widget-react/trees/models-tree/ModelsTreeNode.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; diff --git a/packages/tree-widget/src/test/trees/models-tree/UseModelsTree.test.tsx b/packages/tree-widget/src/test/trees/models-tree/UseModelsTree.test.tsx index 1938b7546c..4b6103d7d6 100644 --- a/packages/tree-widget/src/test/trees/models-tree/UseModelsTree.test.tsx +++ b/packages/tree-widget/src/test/trees/models-tree/UseModelsTree.test.tsx @@ -18,9 +18,9 @@ import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { createStorage } from "@itwin/unified-selection"; -import { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../../../tree-widget-react/components/trees/common/FocusedInstancesContext.js"; -import { SharedTreeContextProviderInternal } from "../../../tree-widget-react/components/trees/common/internal/SharedTreeContextProviderInternal.js"; -import { useModelsTree } from "../../../tree-widget-react/components/trees/models-tree/UseModelsTree.js"; +import { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../../../tree-widget-react/shared/FocusedInstancesContext.js"; +import { SharedTreeContextProviderInternal } from "../../../tree-widget-react/shared/internal/SharedTreeContextProviderInternal.js"; +import { useModelsTree } from "../../../tree-widget-react/trees/models-tree/UseModelsTree.js"; import { TreeWidget } from "../../../tree-widget-react/TreeWidget.js"; import { buildIModel } from "../../IModelUtils.js"; import { act, renderHook, waitFor } from "../../TestUtils.js"; @@ -33,7 +33,7 @@ import type { IModelConnection } from "@itwin/core-frontend"; import type { InstanceKey } from "@itwin/presentation-common"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { SelectionStorage } from "@itwin/unified-selection"; -import type { UseModelsTreeProps } from "../../../tree-widget-react/components/trees/models-tree/UseModelsTree.js"; +import type { UseModelsTreeProps } from "../../../tree-widget-react/trees/models-tree/UseModelsTree.js"; import type { TreeWidgetTestingViewport } from "../TreeUtils.js"; describe("useModelsTree", () => { diff --git a/packages/tree-widget/src/test/trees/models-tree/Utils.ts b/packages/tree-widget/src/test/trees/models-tree/Utils.ts index f9e0a834c5..d610300db1 100644 --- a/packages/tree-widget/src/test/trees/models-tree/Utils.ts +++ b/packages/tree-widget/src/test/trees/models-tree/Utils.ts @@ -7,17 +7,17 @@ import { concatMap, EMPTY, expand, from, of, toArray } from "rxjs"; import { vi } from "vitest"; import { Id64 } from "@itwin/core-bentley"; import { createIModelHierarchyProvider } from "@itwin/presentation-hierarchies"; -import { BaseIdsCache } from "../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; +import { BaseIdsCache } from "../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; import { CLASS_NAME_Element, CLASS_NAME_GeometricElement3d, CLASS_NAME_Model, CLASS_NAME_SpatialCategory, CLASS_NAME_Subject, -} from "../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { mergeWithDefaults } from "../../../tree-widget-react/components/trees/common/internal/Utils.js"; -import { ModelsTreeIdsCache } from "../../../tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js"; -import { defaultHierarchyConfiguration, ModelsTreeDefinition } from "../../../tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; +} from "../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { mergeWithDefaults } from "../../../tree-widget-react/shared/internal/Utils.js"; +import { ModelsTreeIdsCache } from "../../../tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.js"; +import { defaultHierarchyConfiguration, ModelsTreeDefinition } from "../../../tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; import { createIModelAccess } from "../Common.js"; import type { Id64Arg, Id64Array, Id64String } from "@itwin/core-bentley"; @@ -30,8 +30,8 @@ import type { NonGroupingHierarchyNode, } from "@itwin/presentation-hierarchies"; import type { EC, InstanceKey } from "@itwin/presentation-shared"; -import type { ParentElementsPath } from "../../../tree-widget-react/components/trees/common/internal/Utils.js"; -import type { ModelsTreeHierarchyConfiguration } from "../../../tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; +import type { ParentElementsPath } from "../../../tree-widget-react/shared/internal/Utils.js"; +import type { ModelsTreeHierarchyConfiguration } from "../../../tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; interface CreateModelsTreeProviderProps { imodelConnection: IModelConnection; diff --git a/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeIdsCache.test.ts b/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeIdsCache.test.ts index 551b2381a7..eff4777724 100644 --- a/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeIdsCache.test.ts +++ b/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeIdsCache.test.ts @@ -7,9 +7,9 @@ import { firstValueFrom } from "rxjs"; import { describe, expect, it, vi } from "vitest"; import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import { createLimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; -import { BaseIdsCache } from "../../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; -import { ModelsTreeIdsCache } from "../../../../tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js"; -import { defaultHierarchyConfiguration } from "../../../../tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; +import { BaseIdsCache } from "../../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; +import { ModelsTreeIdsCache } from "../../../../tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.js"; +import { defaultHierarchyConfiguration } from "../../../../tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; import { createIModelMock } from "../../Common.js"; describe("ModelsTreeIdsCache", () => { diff --git a/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeVisibilityHandler.test.ts b/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeVisibilityHandler.test.ts index 635c41053b..5d3c603937 100644 --- a/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeVisibilityHandler.test.ts +++ b/packages/tree-widget/src/test/trees/models-tree/internal/ModelsTreeVisibilityHandler.test.ts @@ -25,22 +25,22 @@ import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl"; import { PresentationRpcInterface } from "@itwin/presentation-common"; import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import { createIModelHierarchyProvider, createLimitingECSqlQueryExecutor, HierarchySearchTree } from "@itwin/presentation-hierarchies"; -import { BaseIdsCache } from "../../../../tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; +import { BaseIdsCache } from "../../../../tree-widget-react/shared/internal/caches/BaseIdsCache.js"; import { CLASS_NAME_GeometricElement3d, CLASS_NAME_GeometricModel3d, CLASS_NAME_SpatialCategory, CLASS_NAME_Subject, -} from "../../../../tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js"; -import { createVisibilityStatus } from "../../../../tree-widget-react/components/trees/common/internal/Tooltip.js"; -import { mergeWithDefaults } from "../../../../tree-widget-react/components/trees/common/internal/Utils.js"; -import { ModelsTreeIdsCache } from "../../../../tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js"; -import { createModelsTreeVisibilityHandler } from "../../../../tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; -import { defaultHierarchyConfiguration, ModelsTreeDefinition } from "../../../../tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; +} from "../../../../tree-widget-react/shared/internal/ClassNameDefinitions.js"; +import { createVisibilityStatus } from "../../../../tree-widget-react/shared/internal/Tooltip.js"; +import { mergeWithDefaults } from "../../../../tree-widget-react/shared/internal/Utils.js"; +import { ModelsTreeIdsCache } from "../../../../tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.js"; +import { createModelsTreeVisibilityHandler } from "../../../../tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; +import { defaultHierarchyConfiguration, ModelsTreeDefinition } from "../../../../tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; import { buildIModel, TestSchema } from "../../../IModelUtils.js"; +import { validateHierarchyVisibility } from "../../../shared/VisibilityValidation.js"; import { TestUtils } from "../../../TestUtils.js"; import { createFakeViewport, createIModelAccess } from "../../Common.js"; -import { validateHierarchyVisibility } from "../../common/VisibilityValidation.js"; import { createTreeWidgetTestingViewport } from "../../TreeUtils.js"; import { createCategoryHierarchyNode, @@ -57,15 +57,15 @@ import type { GeometricElement3dProps, QueryBinder } from "@itwin/core-common"; import type { IModelConnection } from "@itwin/core-frontend"; import type { GroupingHierarchyNode, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; import type { EC, ECClassHierarchyInspector, InstanceKey, Props } from "@itwin/presentation-shared"; -import type { Visibility } from "../../../../tree-widget-react/components/trees/common/internal/Tooltip.js"; -import type { TreeWidgetViewport } from "../../../../tree-widget-react/components/trees/common/TreeWidgetViewport.js"; -import type { HierarchyVisibilityHandler } from "../../../../tree-widget-react/components/trees/common/UseHierarchyVisibility.js"; -import type { ModelsTreeVisibilityHandlerProps } from "../../../../tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; +import type { Visibility } from "../../../../tree-widget-react/shared/internal/Tooltip.js"; +import type { TreeWidgetViewport } from "../../../../tree-widget-react/shared/TreeWidgetViewport.js"; +import type { HierarchyVisibilityHandler } from "../../../../tree-widget-react/shared/UseHierarchyVisibility.js"; +import type { ModelsTreeVisibilityHandlerProps } from "../../../../tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; import type { ModelsTreeHierarchyConfiguration, RequiredModelsTreeHierarchyConfiguration, -} from "../../../../tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; -import type { VisibilityExpectations } from "../../common/VisibilityValidation.js"; +} from "../../../../tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; +import type { VisibilityExpectations } from "../../../shared/VisibilityValidation.js"; interface VisibilityOverrides { models?: Map; diff --git a/packages/tree-widget/src/test/trees/models-tree/internal/VisibilityValidation.ts b/packages/tree-widget/src/test/trees/models-tree/internal/VisibilityValidation.ts index 3127203556..c3ed64742b 100644 --- a/packages/tree-widget/src/test/trees/models-tree/internal/VisibilityValidation.ts +++ b/packages/tree-widget/src/test/trees/models-tree/internal/VisibilityValidation.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { expect } from "vitest"; -import { ModelsTreeNodeInternal } from "../../../../tree-widget-react/components/trees/models-tree/internal/ModelsTreeNodeInternal.js"; -import { ModelsTreeNode } from "../../../../tree-widget-react/components/trees/models-tree/ModelsTreeNode.js"; +import { ModelsTreeNodeInternal } from "../../../../tree-widget-react/trees/models-tree/internal/ModelsTreeNodeInternal.js"; +import { ModelsTreeNode } from "../../../../tree-widget-react/trees/models-tree/ModelsTreeNode.js"; import type { HierarchyNode } from "@itwin/presentation-hierarchies"; -import type { ValidateNodeProps } from "../../common/VisibilityValidation.js"; +import type { ValidateNodeProps } from "../../../shared/VisibilityValidation.js"; export async function validateNodeVisibility({ node, diff --git a/packages/tree-widget/src/tree-widget-react-internal.ts b/packages/tree-widget/src/tree-widget-react-internal.ts index 04c0417a8e..96621def8e 100644 --- a/packages/tree-widget/src/tree-widget-react-internal.ts +++ b/packages/tree-widget/src/tree-widget-react-internal.ts @@ -6,27 +6,27 @@ // WARNING: This barrel file exports internal APIs only for use by packages in `https://github.com/iTwin/viewer-components-react` monorepo. // They should not be used outside of these packages. These APIs may be broken or removed at any time without notice. -export { toVoidPromise, collect } from "./tree-widget-react/components/trees/common/internal/Rxjs.js"; +export { toVoidPromise, collect } from "./tree-widget-react/shared/internal/Rxjs.js"; export { ModelsTreeDefinition, defaultHierarchyConfiguration as defaultModelsTreeHierarchyConfiguration, -} from "./tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js"; -export { ModelsTreeIdsCache } from "./tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js"; -export { createModelsTreeVisibilityHandler } from "./tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; +} from "./tree-widget-react/trees/models-tree/ModelsTreeDefinition.js"; +export { ModelsTreeIdsCache } from "./tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.js"; +export { createModelsTreeVisibilityHandler } from "./tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; export { CategoriesTreeDefinition, defaultHierarchyConfiguration as defaultCategoriesTreeHierarchyConfiguration, -} from "./tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js"; -export { CategoriesTreeIdsCache } from "./tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; -export { createCategoriesTreeVisibilityHandler } from "./tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js"; +} from "./tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.js"; +export { CategoriesTreeIdsCache } from "./tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.js"; +export { createCategoriesTreeVisibilityHandler } from "./tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js"; -export { ClassificationsTreeDefinition } from "./tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js"; -export { ClassificationsTreeIdsCache } from "./tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js"; -export { releaseMainThreadOnItemsCount } from "./tree-widget-react/components/trees/common/internal/Rxjs.js"; -export { createClassificationsTreeVisibilityHandler } from "./tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js"; +export { ClassificationsTreeDefinition } from "./tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.js"; +export { ClassificationsTreeIdsCache } from "./tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js"; +export { releaseMainThreadOnItemsCount } from "./tree-widget-react/shared/internal/Rxjs.js"; +export { createClassificationsTreeVisibilityHandler } from "./tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js"; -export { BaseIdsCache } from "./tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js"; +export { BaseIdsCache } from "./tree-widget-react/shared/internal/caches/BaseIdsCache.js"; -export { SET_CHANGE_DEBOUNCE_TIME } from "./tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +export { SET_CHANGE_DEBOUNCE_TIME } from "./tree-widget-react/shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; diff --git a/packages/tree-widget/src/tree-widget-react.ts b/packages/tree-widget/src/tree-widget-react.ts index 75d80ff2d2..a7054b1f84 100644 --- a/packages/tree-widget/src/tree-widget-react.ts +++ b/packages/tree-widget/src/tree-widget-react.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ export { TreeWidget } from "./tree-widget-react/TreeWidget.js"; -export { createTreeWidget, TreeWidgetComponent } from "./tree-widget-react/components/TreeWidgetUiItemsProvider.js"; -export type { TreeDefinition } from "./tree-widget-react/components/TreeWidgetComponentImpl.js"; -export { SelectableTree } from "./tree-widget-react/components/tree-header/SelectableTree.js"; -export * from "./tree-widget-react/components/trees/index.js"; +export { createTreeWidget, TreeWidgetComponent } from "./tree-widget-react/TreeWidgetUiItemsProvider.js"; +export type { TreeDefinition } from "./tree-widget-react/TreeWidgetComponentImpl.js"; +export { SelectableTree } from "./tree-widget-react/tree-header/SelectableTree.js"; +export * from "./tree-widget-react/trees/index.js"; -export { LocalizationContextProvider, LOCALIZATION_NAMESPACES } from "./tree-widget-react/components/trees/common/components/LocalizationContext.js"; +export { LocalizationContextProvider, LOCALIZATION_NAMESPACES } from "./tree-widget-react/shared/components/LocalizationContext.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/TreeWidgetComponentImpl.css b/packages/tree-widget/src/tree-widget-react/TreeWidgetComponentImpl.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/TreeWidgetComponentImpl.css rename to packages/tree-widget/src/tree-widget-react/TreeWidgetComponentImpl.css diff --git a/packages/tree-widget/src/tree-widget-react/components/TreeWidgetComponentImpl.tsx b/packages/tree-widget/src/tree-widget-react/TreeWidgetComponentImpl.tsx similarity index 97% rename from packages/tree-widget/src/tree-widget-react/components/TreeWidgetComponentImpl.tsx rename to packages/tree-widget/src/tree-widget-react/TreeWidgetComponentImpl.tsx index 93e7ab8f63..04a9f8cb11 100644 --- a/packages/tree-widget/src/tree-widget-react/components/TreeWidgetComponentImpl.tsx +++ b/packages/tree-widget/src/tree-widget-react/TreeWidgetComponentImpl.tsx @@ -8,13 +8,13 @@ import "./TreeWidgetComponentImpl.css"; import { useCallback, useEffect, useMemo, useState } from "react"; import { useActiveIModelConnection } from "@itwin/appui-react"; import { Skeleton } from "@stratakit/bricks"; +import { useTranslation } from "./shared/components/LocalizationContext.js"; +import { SkeletonTree } from "./shared/components/SkeletonTree.js"; import { SelectableTree } from "./tree-header/SelectableTree.js"; import { WidgetHeader } from "./tree-header/WidgetHeader.js"; -import { useTranslation } from "./trees/common/components/LocalizationContext.js"; -import { SkeletonTree } from "./trees/common/components/SkeletonTree.js"; import type { IModelConnection } from "@itwin/core-frontend"; -import type { TranslateFunc } from "./shared/LocalizationHelpers.js"; +import type { TranslateFunc } from "./shared/internal/LocalizationHelpers.js"; import type { TreeContentDefinition, TreeSelectionProps } from "./tree-header/WidgetHeader.js"; /** @beta */ diff --git a/packages/tree-widget/src/tree-widget-react/components/TreeWidgetUiItemsProvider.css b/packages/tree-widget/src/tree-widget-react/TreeWidgetUiItemsProvider.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/TreeWidgetUiItemsProvider.css rename to packages/tree-widget/src/tree-widget-react/TreeWidgetUiItemsProvider.css diff --git a/packages/tree-widget/src/tree-widget-react/components/TreeWidgetUiItemsProvider.tsx b/packages/tree-widget/src/tree-widget-react/TreeWidgetUiItemsProvider.tsx similarity index 95% rename from packages/tree-widget/src/tree-widget-react/components/TreeWidgetUiItemsProvider.tsx rename to packages/tree-widget/src/tree-widget-react/TreeWidgetUiItemsProvider.tsx index d954bb8d2c..21b83124b5 100644 --- a/packages/tree-widget/src/tree-widget-react/components/TreeWidgetUiItemsProvider.tsx +++ b/packages/tree-widget/src/tree-widget-react/TreeWidgetUiItemsProvider.tsx @@ -10,9 +10,9 @@ import { ErrorBoundary } from "react-error-boundary"; import { StagePanelLocation, StagePanelSection, useTransientState } from "@itwin/appui-react"; import { Icon } from "@stratakit/foundations"; import hierarchyTreeSvg from "@stratakit/icons/hierarchy-tree.svg"; -import { getLocalizationKey } from "./shared/LocalizationHelpers.js"; +import { LocalizationContextProvider } from "./shared/components/LocalizationContext.js"; +import { getLocalizationKey } from "./shared/internal/LocalizationHelpers.js"; import { ErrorState } from "./tree-header/ErrorState.js"; -import { LocalizationContextProvider } from "./trees/common/components/LocalizationContext.js"; import { SharedTreeContextProvider } from "./trees/index.js"; import { TreeWidgetComponentImpl } from "./TreeWidgetComponentImpl.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/utils/IsPromiseLike.ts b/packages/tree-widget/src/tree-widget-react/components/utils/IsPromiseLike.ts deleted file mode 100644 index b9c0f91a12..0000000000 --- a/packages/tree-widget/src/tree-widget-react/components/utils/IsPromiseLike.ts +++ /dev/null @@ -1,12 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Bentley Systems, Incorporated. All rights reserved. - * See LICENSE.md in the project root for license terms and full copyright notice. - *--------------------------------------------------------------------------------------------*/ - -/** - * Checks if the specified argument is a promise - * @internal - */ -export function isPromiseLike(obj: unknown): obj is PromiseLike { - return !!(obj && typeof obj === "object" && typeof (obj as any).then === "function"); -} diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/FocusedInstancesContext.tsx b/packages/tree-widget/src/tree-widget-react/shared/FocusedInstancesContext.tsx similarity index 98% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/FocusedInstancesContext.tsx rename to packages/tree-widget/src/tree-widget-react/shared/FocusedInstancesContext.tsx index 727f8b6c1a..98cf2565a6 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/common/FocusedInstancesContext.tsx +++ b/packages/tree-widget/src/tree-widget-react/shared/FocusedInstancesContext.tsx @@ -8,7 +8,7 @@ import { from, map } from "rxjs"; import { HierarchyNode } from "@itwin/presentation-hierarchies-react"; import { normalizeFullClassName } from "@itwin/presentation-shared"; import { Selectable, Selectables } from "@itwin/unified-selection"; -import { eachValueFrom } from "../../utils/EachValueFrom.js"; +import { eachValueFrom } from "./internal/EachValueFrom.js"; import type { PropsWithChildren } from "react"; import type { GroupingHierarchyNode } from "@itwin/presentation-hierarchies"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/SharedTreeContextProvider.tsx b/packages/tree-widget/src/tree-widget-react/shared/SharedTreeContextProvider.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/SharedTreeContextProvider.tsx rename to packages/tree-widget/src/tree-widget-react/shared/SharedTreeContextProvider.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/TreeErrors.ts b/packages/tree-widget/src/tree-widget-react/shared/TreeErrors.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/TreeErrors.ts rename to packages/tree-widget/src/tree-widget-react/shared/TreeErrors.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/TreeWidgetViewport.ts b/packages/tree-widget/src/tree-widget-react/shared/TreeWidgetViewport.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/TreeWidgetViewport.ts rename to packages/tree-widget/src/tree-widget-react/shared/TreeWidgetViewport.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/UseHierarchyVisibility.ts b/packages/tree-widget/src/tree-widget-react/shared/UseHierarchyVisibility.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/UseHierarchyVisibility.ts rename to packages/tree-widget/src/tree-widget-react/shared/UseHierarchyVisibility.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/UseTelemetryContext.tsx b/packages/tree-widget/src/tree-widget-react/shared/UseTelemetryContext.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/UseTelemetryContext.tsx rename to packages/tree-widget/src/tree-widget-react/shared/UseTelemetryContext.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/Utils.ts b/packages/tree-widget/src/tree-widget-react/shared/Utils.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/Utils.ts rename to packages/tree-widget/src/tree-widget-react/shared/Utils.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/Delayed.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/Delayed.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/Delayed.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/Delayed.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/EmptyTree.css b/packages/tree-widget/src/tree-widget-react/shared/components/EmptyTree.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/EmptyTree.css rename to packages/tree-widget/src/tree-widget-react/shared/components/EmptyTree.css diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/EmptyTree.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/EmptyTree.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/EmptyTree.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/EmptyTree.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/LocalizationContext.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/LocalizationContext.tsx similarity index 91% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/LocalizationContext.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/LocalizationContext.tsx index 4c517ffd8e..a573c2dcfa 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/LocalizationContext.tsx +++ b/packages/tree-widget/src/tree-widget-react/shared/components/LocalizationContext.tsx @@ -8,11 +8,11 @@ import { LocalizationContextProvider as HierarchiesLocalizationContext, LOCALIZATION_NAMESPACES as HierarchiesReactLocalizationNamespaces, } from "@itwin/presentation-hierarchies-react"; -import { getLocalizationKey, LOCALIZATION_NAMESPACE } from "../../../shared/LocalizationHelpers.js"; +import { getLocalizationKey, LOCALIZATION_NAMESPACE } from "../internal/LocalizationHelpers.js"; import type { JSX, PropsWithChildren } from "react"; import type { Localization } from "@itwin/core-common"; -import type { TranslateFunc } from "../../../shared/LocalizationHelpers.js"; +import type { TranslateFunc } from "../internal/LocalizationHelpers.js"; const localizationContext = createContext((key) => key); diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/ProgressOverlay.css b/packages/tree-widget/src/tree-widget-react/shared/components/ProgressOverlay.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/ProgressOverlay.css rename to packages/tree-widget/src/tree-widget-react/shared/components/ProgressOverlay.css diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/ProgressOverlay.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/ProgressOverlay.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/ProgressOverlay.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/ProgressOverlay.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/SkeletonTree.css b/packages/tree-widget/src/tree-widget-react/shared/components/SkeletonTree.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/SkeletonTree.css rename to packages/tree-widget/src/tree-widget-react/shared/components/SkeletonTree.css diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/SkeletonTree.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/SkeletonTree.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/SkeletonTree.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/SkeletonTree.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/Tree.css b/packages/tree-widget/src/tree-widget-react/shared/components/Tree.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/Tree.css rename to packages/tree-widget/src/tree-widget-react/shared/components/Tree.css diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/Tree.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/Tree.tsx similarity index 99% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/Tree.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/Tree.tsx index 120d98863c..bff84914c0 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/Tree.tsx +++ b/packages/tree-widget/src/tree-widget-react/shared/components/Tree.tsx @@ -10,7 +10,7 @@ import { BeEvent } from "@itwin/core-bentley"; import { SchemaMetadataContextProvider } from "@itwin/presentation-components"; import { useIModelUnifiedSelectionTree, useNodeHighlighting } from "@itwin/presentation-hierarchies-react"; import { StrataKitRootErrorRenderer } from "@itwin/presentation-hierarchies-react/stratakit"; -import { TreeWidget } from "../../../../TreeWidget.js"; +import { TreeWidget } from "../../TreeWidget.js"; import { useHierarchyLevelFiltering } from "../internal/hooks/UseHierarchyFiltering.js"; import { useIModelAccess } from "../internal/hooks/UseIModelAccess.js"; import { useIModelChangeListener } from "../internal/hooks/UseIModelChangeListener.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.scss b/packages/tree-widget/src/tree-widget-react/shared/components/TreeNodeCheckbox.scss similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.scss rename to packages/tree-widget/src/tree-widget-react/shared/components/TreeNodeCheckbox.scss diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.css b/packages/tree-widget/src/tree-widget-react/shared/components/TreeNodeVisibilityButton.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.css rename to packages/tree-widget/src/tree-widget-react/shared/components/TreeNodeVisibilityButton.css diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/TreeNodeVisibilityButton.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/TreeNodeVisibilityButton.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeRenderer.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/TreeRenderer.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/TreeRenderer.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/TreeRenderer.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.ts b/packages/tree-widget/src/tree-widget-react/shared/components/UseVisibilityButtonHandler.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.ts rename to packages/tree-widget/src/tree-widget-react/shared/components/UseVisibilityButtonHandler.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/VisibilityTree.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/VisibilityTree.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/VisibilityTree.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/VisibilityTree.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.tsx b/packages/tree-widget/src/tree-widget-react/shared/components/VisibilityTreeRenderer.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.tsx rename to packages/tree-widget/src/tree-widget-react/shared/components/VisibilityTreeRenderer.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/BufferingViewport.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/BufferingViewport.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/BufferingViewport.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/BufferingViewport.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/ClassNameDefinitions.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/ClassNameDefinitions.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/utils/EachValueFrom.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/EachValueFrom.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/utils/EachValueFrom.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/EachValueFrom.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/shared/LocalizationHelpers.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/LocalizationHelpers.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/shared/LocalizationHelpers.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/LocalizationHelpers.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Rxjs.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/Rxjs.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Rxjs.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/Rxjs.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/SharedTreeContextProviderInternal.tsx b/packages/tree-widget/src/tree-widget-react/shared/internal/SharedTreeContextProviderInternal.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/SharedTreeContextProviderInternal.tsx rename to packages/tree-widget/src/tree-widget-react/shared/internal/SharedTreeContextProviderInternal.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Tooltip.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/Tooltip.ts similarity index 94% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Tooltip.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/Tooltip.ts index dcee77e369..5dbe96e3fc 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Tooltip.ts +++ b/packages/tree-widget/src/tree-widget-react/shared/internal/Tooltip.ts @@ -3,8 +3,8 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import type { TranslateFunc } from "../../../shared/LocalizationHelpers.js"; import type { VisibilityStatus } from "../UseHierarchyVisibility.js"; +import type { TranslateFunc } from "./LocalizationHelpers.js"; /** @internal */ export type Visibility = "visible" | "hidden" | "partial"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Types.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/Types.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Types.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/Types.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Utils.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/Utils.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/Utils.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/Utils.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/VisibilityChangeEventListener.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/VisibilityChangeEventListener.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/VisibilityUtils.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/VisibilityUtils.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/VisibilityUtils.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/VisibilityUtils.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/BaseIdsCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/BaseIdsCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/BatchingCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/BatchingCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/BatchingCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/BatchingCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/ChildElementsCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/ChildElementsCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/ChildElementsCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/ChildElementsCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/DescendantsCountCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/DescendantsCountCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/DescendantsCountCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/DescendantsCountCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/ElementModelCategoriesCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/ElementModelCategoriesCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/ElementModelCategoriesCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/ElementModelCategoriesCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/ModeledElementsCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/ModeledElementsCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/ModeledElementsCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/ModeledElementsCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/SubCategoriesCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/caches/SubCategoriesCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/caches/SubCategoriesCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/caches/SubCategoriesCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseActiveTreeWidgetViewport.tsx b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseActiveTreeWidgetViewport.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseActiveTreeWidgetViewport.tsx rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseActiveTreeWidgetViewport.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseCachedVisibility.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseCachedVisibility.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseCachedVisibility.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseCachedVisibility.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseErrorState.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseErrorState.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseErrorState.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseErrorState.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseGuid.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseGuid.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseGuid.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseGuid.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseHierarchyFiltering.tsx b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseHierarchyFiltering.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseHierarchyFiltering.tsx rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseHierarchyFiltering.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIModelAccess.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIModelAccess.ts similarity index 97% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIModelAccess.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIModelAccess.ts index a627700353..130f23a22c 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIModelAccess.ts +++ b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIModelAccess.ts @@ -7,7 +7,7 @@ import { useMemo } from "react"; import { createECSchemaProvider, createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import { createLimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; import { createCachingECClassHierarchyInspector } from "@itwin/presentation-shared"; -import { TreeWidget } from "../../../../../TreeWidget.js"; +import { TreeWidget } from "../../../TreeWidget.js"; import { LOGGING_NAMESPACE } from "../../Utils.js"; import type { IModelConnection } from "@itwin/core-frontend"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIModelChangeListener.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIModelChangeListener.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIModelChangeListener.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIModelChangeListener.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIdsCache.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIdsCache.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseIdsCache.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseIdsCache.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseLatest.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseLatest.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/hooks/UseLatest.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/hooks/UseLatest.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/visibility/BaseSearchResultsTree.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/visibility/BaseSearchResultsTree.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.ts b/packages/tree-widget/src/tree-widget-react/shared/internal/visibility/BaseVisibilityHelper.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.ts rename to packages/tree-widget/src/tree-widget-react/shared/internal/visibility/BaseVisibilityHelper.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/tree-header/ErrorState.tsx b/packages/tree-widget/src/tree-widget-react/tree-header/ErrorState.tsx similarity index 92% rename from packages/tree-widget/src/tree-widget-react/components/tree-header/ErrorState.tsx rename to packages/tree-widget/src/tree-widget-react/tree-header/ErrorState.tsx index e70d873c87..bb9b5de800 100644 --- a/packages/tree-widget/src/tree-widget-react/components/tree-header/ErrorState.tsx +++ b/packages/tree-widget/src/tree-widget-react/tree-header/ErrorState.tsx @@ -6,7 +6,7 @@ import { Button, Text } from "@stratakit/bricks"; import { Icon } from "@stratakit/foundations"; import errorSvg from "@stratakit/icons/status-error.svg"; -import { useTranslation } from "../trees/common/components/LocalizationContext.js"; +import { useTranslation } from "../shared/components/LocalizationContext.js"; import type { FallbackProps } from "react-error-boundary"; diff --git a/packages/tree-widget/src/tree-widget-react/components/tree-header/SearchBox.tsx b/packages/tree-widget/src/tree-widget-react/tree-header/SearchBox.tsx similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/tree-header/SearchBox.tsx rename to packages/tree-widget/src/tree-widget-react/tree-header/SearchBox.tsx index 6a10b1a6cf..6adf35acbf 100644 --- a/packages/tree-widget/src/tree-widget-react/components/tree-header/SearchBox.tsx +++ b/packages/tree-widget/src/tree-widget-react/tree-header/SearchBox.tsx @@ -7,8 +7,8 @@ import { useEffect, useState } from "react"; import { IconButton, TextBox } from "@stratakit/bricks"; import dismissSvg from "@stratakit/icons/dismiss.svg"; import searchSvg from "@stratakit/icons/search.svg"; -import { useTranslation } from "../trees/common/components/LocalizationContext.js"; -import { useLatest } from "../trees/common/internal/hooks/UseLatest.js"; +import { useTranslation } from "../shared/components/LocalizationContext.js"; +import { useLatest } from "../shared/internal/hooks/UseLatest.js"; interface DebouncedSearchBoxProps { isOpened: boolean; diff --git a/packages/tree-widget/src/tree-widget-react/components/tree-header/SelectableTree.css b/packages/tree-widget/src/tree-widget-react/tree-header/SelectableTree.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/tree-header/SelectableTree.css rename to packages/tree-widget/src/tree-widget-react/tree-header/SelectableTree.css diff --git a/packages/tree-widget/src/tree-widget-react/components/tree-header/SelectableTree.tsx b/packages/tree-widget/src/tree-widget-react/tree-header/SelectableTree.tsx similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/tree-header/SelectableTree.tsx rename to packages/tree-widget/src/tree-widget-react/tree-header/SelectableTree.tsx index fbb6f9f3ba..5c153c0b85 100644 --- a/packages/tree-widget/src/tree-widget-react/components/tree-header/SelectableTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/tree-header/SelectableTree.tsx @@ -10,7 +10,7 @@ import { Divider } from "@stratakit/bricks"; import { ErrorState } from "./ErrorState.js"; import type { PropsWithChildren, ReactNode } from "react"; -import type { TreeWidgetViewport } from "../trees/common/TreeWidgetViewport.js"; +import type { TreeWidgetViewport } from "../shared/TreeWidgetViewport.js"; /** @public */ export interface TreeToolbarButtonProps { diff --git a/packages/tree-widget/src/tree-widget-react/components/tree-header/WidgetHeader.css b/packages/tree-widget/src/tree-widget-react/tree-header/WidgetHeader.css similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/tree-header/WidgetHeader.css rename to packages/tree-widget/src/tree-widget-react/tree-header/WidgetHeader.css diff --git a/packages/tree-widget/src/tree-widget-react/components/tree-header/WidgetHeader.tsx b/packages/tree-widget/src/tree-widget-react/tree-header/WidgetHeader.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/tree-header/WidgetHeader.tsx rename to packages/tree-widget/src/tree-widget-react/tree-header/WidgetHeader.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTree.tsx similarity index 86% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTree.tsx index a624103025..126efb8186 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTree.tsx @@ -3,12 +3,12 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import { VisibilityTree } from "../common/components/VisibilityTree.js"; -import { VisibilityTreeRenderer } from "../common/components/VisibilityTreeRenderer.js"; +import { VisibilityTree } from "../../shared/components/VisibilityTree.js"; +import { VisibilityTreeRenderer } from "../../shared/components/VisibilityTreeRenderer.js"; import { useCategoriesTree } from "./UseCategoriesTree.js"; -import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js"; -import type { ExtendedVisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js"; +import type { VisibilityTreeProps } from "../../shared/components/VisibilityTree.js"; +import type { ExtendedVisibilityTreeRendererProps } from "../../shared/components/VisibilityTreeRenderer.js"; import type { UseCategoriesTreeProps } from "./UseCategoriesTree.js"; /** @beta */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.tsx b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeButtons.tsx similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.tsx rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeButtons.tsx index 743a8f3791..9b9ed88a12 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeButtons.tsx @@ -10,19 +10,19 @@ import { IconButton } from "@stratakit/bricks"; import visibilityHideSvg from "@stratakit/icons/visibility-hide.svg"; import visibilityInvertSvg from "@stratakit/icons/visibility-invert.svg"; import visibilityShowSvg from "@stratakit/icons/visibility-show.svg"; -import { useTranslation } from "../common/components/LocalizationContext.js"; -import { useErrorState } from "../common/internal/hooks/UseErrorState.js"; -import { useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { getClassesByView } from "../common/internal/Utils.js"; -import { hideAllCategories, invertAllCategories, showAll } from "../common/internal/VisibilityUtils.js"; +import { useTranslation } from "../../shared/components/LocalizationContext.js"; +import { useErrorState } from "../../shared/internal/hooks/UseErrorState.js"; +import { useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { getClassesByView } from "../../shared/internal/Utils.js"; +import { hideAllCategories, invertAllCategories, showAll } from "../../shared/internal/VisibilityUtils.js"; import type { Observable } from "rxjs"; import type { Id64Array, Id64String } from "@itwin/core-bentley"; +import type { BaseIdsCache } from "../../shared/internal/caches/BaseIdsCache.js"; +import type { ModelId } from "../../shared/internal/Types.js"; +import type { CategoryInfosMap } from "../../shared/internal/VisibilityUtils.js"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { TreeToolbarButtonProps } from "../../tree-header/SelectableTree.js"; -import type { BaseIdsCache } from "../common/internal/caches/BaseIdsCache.js"; -import type { ModelId } from "../common/internal/Types.js"; -import type { CategoryInfosMap } from "../common/internal/VisibilityUtils.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; /** * Data structure that describes category. diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.tsx b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeComponent.tsx similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.tsx rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeComponent.tsx index 6bca80fc68..28f47e3799 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeComponent.tsx @@ -6,18 +6,18 @@ import { Fragment } from "react"; import { useActiveIModelConnection } from "@itwin/appui-react"; import { Skeleton } from "@stratakit/bricks"; +import { useActiveTreeWidgetViewport } from "../../shared/internal/hooks/UseActiveTreeWidgetViewport.js"; +import { SharedTreeContextProviderInternal, useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { getClassesByView } from "../../shared/internal/Utils.js"; +import { TelemetryContextProvider } from "../../shared/UseTelemetryContext.js"; import { SelectableTree } from "../../tree-header/SelectableTree.js"; -import { useActiveTreeWidgetViewport } from "../common/internal/hooks/UseActiveTreeWidgetViewport.js"; -import { SharedTreeContextProviderInternal, useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { getClassesByView } from "../common/internal/Utils.js"; -import { TelemetryContextProvider } from "../common/UseTelemetryContext.js"; import { CategoriesTree } from "./CategoriesTree.js"; import { HideAllButton, InvertAllButton, ShowAllButton, useCategoriesTreeButtonProps } from "./CategoriesTreeButtons.js"; import type { ReactNode } from "react"; import type { IModelConnection } from "@itwin/core-frontend"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { StandardTreeLabels } from "../../TreeWidgetComponentImpl.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; import type { CategoriesTreeProps } from "./CategoriesTree.js"; import type { CategoriesTreeHeaderButtonProps, CategoriesTreeHeaderButtonType } from "./CategoriesTreeButtons.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.ts similarity index 99% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.ts index 7e72c5cedb..c8d41d0f60 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeDefinition.ts @@ -25,15 +25,15 @@ import { import { assert, Guid } from "@itwin/core-bentley"; import { createPredicateBasedHierarchyDefinition, ProcessedHierarchyNode } from "@itwin/presentation-hierarchies"; import { createBisInstanceLabelSelectClauseFactory, ECSql } from "@itwin/presentation-shared"; -import { eachValueFrom } from "../../utils/EachValueFrom.js"; import { CLASS_NAME_DefinitionContainer, CLASS_NAME_ISubModeledElement, CLASS_NAME_Model, CLASS_NAME_SubCategory, -} from "../common/internal/ClassNameDefinitions.js"; -import { catchBeSQLiteInterrupts } from "../common/internal/hooks/UseErrorState.js"; -import { fromWithRelease, releaseMainThreadOnItemsCount } from "../common/internal/Rxjs.js"; +} from "../../shared/internal/ClassNameDefinitions.js"; +import { eachValueFrom } from "../../shared/internal/EachValueFrom.js"; +import { catchBeSQLiteInterrupts } from "../../shared/internal/hooks/UseErrorState.js"; +import { fromWithRelease, releaseMainThreadOnItemsCount } from "../../shared/internal/Rxjs.js"; import { createExcludedClassesClause, createIdsSelector, @@ -44,8 +44,8 @@ import { groupingNodeDataFromChildren, ParentElementsPath, parseIdsSelectorResult, -} from "../common/internal/Utils.js"; -import { SearchLimitExceededError } from "../common/TreeErrors.js"; +} from "../../shared/internal/Utils.js"; +import { SearchLimitExceededError } from "../../shared/TreeErrors.js"; import { CategoriesTreeNodeInternal } from "./internal/CategoriesTreeNodeInternal.js"; import type { Observable, ObservedValueOf, OperatorFunction } from "rxjs"; @@ -74,8 +74,8 @@ import type { InstanceKey, Props, } from "@itwin/presentation-shared"; -import type { CategoryId, DefinitionContainerId, ElementId, ModelId, SubCategoryId } from "../common/internal/Types.js"; -import type { DeepRequired } from "../common/internal/Utils.js"; +import type { CategoryId, DefinitionContainerId, ElementId, ModelId, SubCategoryId } from "../../shared/internal/Types.js"; +import type { DeepRequired } from "../../shared/internal/Utils.js"; import type { CachedCategoryInfo, CategoriesTreeIdsCache } from "./internal/CategoriesTreeIdsCache.js"; import type { CategoryNodeProps, ElementNodeProps } from "./internal/CategoriesTreeNodeInternal.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeIcon.tsx b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeIcon.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeIcon.tsx rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeIcon.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeNode.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/CategoriesTreeNode.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/UseCategoriesTree.tsx similarity index 91% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/UseCategoriesTree.tsx index a0254829b8..1329107970 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/UseCategoriesTree.tsx @@ -6,11 +6,11 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import categorySvg from "@stratakit/icons/bis-category-3d.svg"; -import { EmptyTreeContent, NoSearchMatches, SearchUnknownError, TooManySearchMatches } from "../common/components/EmptyTree.js"; -import { useCachedVisibility } from "../common/internal/hooks/UseCachedVisibility.js"; -import { useGuid } from "../common/internal/hooks/UseGuid.js"; -import { useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { getClassesByView, mergeWithDefaults, stableStringify } from "../common/internal/Utils.js"; +import { EmptyTreeContent, NoSearchMatches, SearchUnknownError, TooManySearchMatches } from "../../shared/components/EmptyTree.js"; +import { useCachedVisibility } from "../../shared/internal/hooks/UseCachedVisibility.js"; +import { useGuid } from "../../shared/internal/hooks/UseGuid.js"; +import { useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { getClassesByView, mergeWithDefaults, stableStringify } from "../../shared/internal/Utils.js"; import { CategoriesTreeDefinition, defaultHierarchyConfiguration } from "./CategoriesTreeDefinition.js"; import { CategoriesTreeIcon } from "./CategoriesTreeIcon.js"; import { CategoriesTreeIdsCache } from "./internal/CategoriesTreeIdsCache.js"; @@ -22,11 +22,11 @@ import type { ReactNode } from "react"; import type { GuidString, Id64Array } from "@itwin/core-bentley"; import type { IModelConnection } from "@itwin/core-frontend"; import type { EC } from "@itwin/presentation-shared"; -import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js"; -import type { ExtendedVisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js"; -import type { CreateSearchResultsTreeProps, CreateTreeSpecificVisibilityHandlerProps } from "../common/internal/hooks/UseCachedVisibility.js"; -import type { SearchResultsTree } from "../common/internal/visibility/BaseSearchResultsTree.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; +import type { VisibilityTreeProps } from "../../shared/components/VisibilityTree.js"; +import type { ExtendedVisibilityTreeRendererProps } from "../../shared/components/VisibilityTreeRenderer.js"; +import type { CreateSearchResultsTreeProps, CreateTreeSpecificVisibilityHandlerProps } from "../../shared/internal/hooks/UseCachedVisibility.js"; +import type { SearchResultsTree } from "../../shared/internal/visibility/BaseSearchResultsTree.js"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { CategoryInfo } from "./CategoriesTreeButtons.js"; import type { CategoriesTreeHierarchyConfiguration, RequiredCategoriesTreeHierarchyConfiguration } from "./CategoriesTreeDefinition.js"; import type { CategoriesTreeSearchError } from "./internal/UseSearchPaths.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.ts similarity index 97% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.ts index 6bcfeb32c8..d0274ba7d3 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeIdsCache.ts @@ -5,18 +5,18 @@ import { defaultIfEmpty, defer, EMPTY, forkJoin, from, map, merge, mergeMap, of, reduce, shareReplay, toArray } from "rxjs"; import { Guid, Id64 } from "@itwin/core-bentley"; -import { BaseIdsCacheImpl } from "../../common/internal/caches/BaseIdsCache.js"; -import { CLASS_NAME_DefinitionContainer, CLASS_NAME_Model, CLASS_NAME_SubCategory } from "../../common/internal/ClassNameDefinitions.js"; -import { catchBeSQLiteInterrupts } from "../../common/internal/hooks/UseErrorState.js"; -import { fromWithRelease } from "../../common/internal/Rxjs.js"; -import { createWhereClause, getClassesByView, getOrCreate } from "../../common/internal/Utils.js"; +import { BaseIdsCacheImpl } from "../../../shared/internal/caches/BaseIdsCache.js"; +import { CLASS_NAME_DefinitionContainer, CLASS_NAME_Model, CLASS_NAME_SubCategory } from "../../../shared/internal/ClassNameDefinitions.js"; +import { catchBeSQLiteInterrupts } from "../../../shared/internal/hooks/UseErrorState.js"; +import { fromWithRelease } from "../../../shared/internal/Rxjs.js"; +import { createWhereClause, getClassesByView, getOrCreate } from "../../../shared/internal/Utils.js"; import type { Observable } from "rxjs"; import type { GuidString, Id64Arg, Id64Array, Id64String } from "@itwin/core-bentley"; import type { HierarchyNodeIdentifiersPath, LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; import type { EC } from "@itwin/presentation-shared"; -import type { BaseIdsCacheImplProps } from "../../common/internal/caches/BaseIdsCache.js"; -import type { CategoryId, DefinitionContainerId, ElementId, ModelId } from "../../common/internal/Types.js"; +import type { BaseIdsCacheImplProps } from "../../../shared/internal/caches/BaseIdsCache.js"; +import type { CategoryId, DefinitionContainerId, ElementId, ModelId } from "../../../shared/internal/Types.js"; interface DefinitionContainerInfo { modelId: Id64String; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNodeInternal.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeNodeInternal.ts similarity index 96% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNodeInternal.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeNodeInternal.ts index 40f2f261cb..a5863c11cf 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNodeInternal.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/CategoriesTreeNodeInternal.ts @@ -7,8 +7,8 @@ import { CategoriesTreeNode } from "../CategoriesTreeNode.js"; import type { Id64Array, Id64String } from "@itwin/core-bentley"; import type { ClassGroupingNodeKey, GroupingHierarchyNode, HierarchyNode, InstancesNodeKey, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; -import type { ElementId } from "../../common/internal/Types.js"; -import type { ParentElementsPath } from "../../common/internal/Utils.js"; +import type { ElementId } from "../../../shared/internal/Types.js"; +import type { ParentElementsPath } from "../../../shared/internal/Utils.js"; /** * Contains utility functions for working with Models Tree nodes. diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/UseSearchPaths.ts similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/UseSearchPaths.ts index 4e583e5594..5694e2f27b 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/UseSearchPaths.ts @@ -7,17 +7,17 @@ import { useEffect, useMemo, useState } from "react"; import { filter, firstValueFrom, identity, tap } from "rxjs"; import { assert } from "@itwin/core-bentley"; import { HierarchyNodeIdentifier, HierarchySearchTree } from "@itwin/presentation-hierarchies"; -import { CLASS_NAME_DefinitionContainer, CLASS_NAME_SubCategory } from "../../common/internal/ClassNameDefinitions.js"; -import { toVoidPromise } from "../../common/internal/Rxjs.js"; -import { getClassesByView, getOrCreate } from "../../common/internal/Utils.js"; -import { SearchLimitExceededError } from "../../common/TreeErrors.js"; -import { useTelemetryContext } from "../../common/UseTelemetryContext.js"; +import { CLASS_NAME_DefinitionContainer, CLASS_NAME_SubCategory } from "../../../shared/internal/ClassNameDefinitions.js"; +import { toVoidPromise } from "../../../shared/internal/Rxjs.js"; +import { getClassesByView, getOrCreate } from "../../../shared/internal/Utils.js"; +import { SearchLimitExceededError } from "../../../shared/TreeErrors.js"; +import { useTelemetryContext } from "../../../shared/UseTelemetryContext.js"; import { CategoriesTreeDefinition } from "../CategoriesTreeDefinition.js"; import type { GuidString } from "@itwin/core-bentley"; import type { InstanceKey } from "@itwin/presentation-shared"; -import type { VisibilityTreeProps } from "../../common/components/VisibilityTree.js"; -import type { CategoryId, ElementId, ModelId, SubCategoryId } from "../../common/internal/Types.js"; +import type { VisibilityTreeProps } from "../../../shared/components/VisibilityTree.js"; +import type { CategoryId, ElementId, ModelId, SubCategoryId } from "../../../shared/internal/Types.js"; import type { CategoryInfo } from "../CategoriesTreeButtons.js"; import type { RequiredCategoriesTreeHierarchyConfiguration } from "../CategoriesTreeDefinition.js"; import type { CategoriesTreeIdsCache } from "./CategoriesTreeIdsCache.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts index 96d0fbc3e5..ebae1188f6 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts @@ -5,23 +5,23 @@ import { concat, defer, EMPTY, from, merge, mergeAll, mergeMap, of, Subject } from "rxjs"; import { assert, Guid } from "@itwin/core-bentley"; -import { HierarchyVisibilityHandlerImpl } from "../../../common/internal/hooks/UseCachedVisibility.js"; -import { fromWithRelease } from "../../../common/internal/Rxjs.js"; -import { createVisibilityStatus } from "../../../common/internal/Tooltip.js"; -import { getClassesByView } from "../../../common/internal/Utils.js"; -import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js"; -import { CategoriesTreeNodeInternal } from "../../internal/CategoriesTreeNodeInternal.js"; +import { HierarchyVisibilityHandlerImpl } from "../../../../shared/internal/hooks/UseCachedVisibility.js"; +import { fromWithRelease } from "../../../../shared/internal/Rxjs.js"; +import { createVisibilityStatus } from "../../../../shared/internal/Tooltip.js"; +import { getClassesByView } from "../../../../shared/internal/Utils.js"; +import { mergeVisibilityStatuses } from "../../../../shared/internal/VisibilityUtils.js"; +import { CategoriesTreeNodeInternal } from "../CategoriesTreeNodeInternal.js"; import { CategoriesTreeVisibilityHelper } from "./CategoriesTreeVisibilityHelper.js"; import { createCategoriesSearchResultsTree } from "./SearchResultsTree.js"; import type { Observable } from "rxjs"; import type { HierarchyNode, HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { ECClassHierarchyInspector } from "@itwin/presentation-shared"; -import type { AlwaysAndNeverDrawnElementInfoCache } from "../../../common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; -import type { SearchResultsTree } from "../../../common/internal/visibility/BaseSearchResultsTree.js"; -import type { TreeSpecificVisibilityHandler } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import type { TreeWidgetViewport } from "../../../common/TreeWidgetViewport.js"; -import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js"; +import type { AlwaysAndNeverDrawnElementInfoCache } from "../../../../shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +import type { SearchResultsTree } from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; +import type { TreeSpecificVisibilityHandler } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import type { TreeWidgetViewport } from "../../../../shared/TreeWidgetViewport.js"; +import type { VisibilityStatus } from "../../../../shared/UseHierarchyVisibility.js"; import type { RequiredCategoriesTreeHierarchyConfiguration } from "../../CategoriesTreeDefinition.js"; import type { CategoriesTreeIdsCache } from "../CategoriesTreeIdsCache.js"; import type { CategoriesTreeSearchTargets } from "./SearchResultsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts similarity index 92% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts index 7398b3c394..04584dddc7 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import { bufferCount, concat, concatMap, delay, EMPTY, from, map, merge, mergeMap, reduce, toArray } from "rxjs"; -import { createVisibilityStatus } from "../../../common/internal/Tooltip.js"; -import { getOptimalBatchSize } from "../../../common/internal/Utils.js"; -import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js"; +import { createVisibilityStatus } from "../../../../shared/internal/Tooltip.js"; +import { getOptimalBatchSize } from "../../../../shared/internal/Utils.js"; +import { BaseVisibilityHelper } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import { mergeVisibilityStatuses } from "../../../../shared/internal/VisibilityUtils.js"; import type { Observable } from "rxjs"; import type { Id64Arg, Id64String } from "@itwin/core-bentley"; -import type { BaseVisibilityHelperProps } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import type { TreeWidgetViewport } from "../../../common/TreeWidgetViewport.js"; -import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js"; +import type { BaseVisibilityHelperProps } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import type { TreeWidgetViewport } from "../../../../shared/TreeWidgetViewport.js"; +import type { VisibilityStatus } from "../../../../shared/UseHierarchyVisibility.js"; import type { RequiredCategoriesTreeHierarchyConfiguration } from "../../CategoriesTreeDefinition.js"; import type { CategoriesTreeIdsCache } from "../CategoriesTreeIdsCache.js"; import type { ElementClassGroupingNodeProps } from "../CategoriesTreeNodeInternal.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.ts b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/SearchResultsTree.ts similarity index 97% rename from packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.ts rename to packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/SearchResultsTree.ts index 9688a742dd..70f0fb7c49 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/categories-tree/internal/visibility/SearchResultsTree.ts @@ -5,25 +5,25 @@ import { firstValueFrom, forkJoin } from "rxjs"; import { assert } from "@itwin/core-bentley"; -import { CLASS_NAME_SubCategory } from "../../../common/internal/ClassNameDefinitions.js"; -import { getOrCreate, ParentElementsPath } from "../../../common/internal/Utils.js"; +import { CLASS_NAME_SubCategory } from "../../../../shared/internal/ClassNameDefinitions.js"; +import { getOrCreate, ParentElementsPath } from "../../../../shared/internal/Utils.js"; import { createSearchResultsTree, InternalSearchTargetCategories, InternalSearchTargetElements, SearchResultsNodesHandler, -} from "../../../common/internal/visibility/BaseSearchResultsTree.js"; +} from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; import type { Id64Set, Id64String } from "@itwin/core-bentley"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { EC, ECClassHierarchyInspector } from "@itwin/presentation-shared"; -import type { CategoryId, ElementId, ModelId, SubCategoryId } from "../../../common/internal/Types.js"; +import type { CategoryId, ElementId, ModelId, SubCategoryId } from "../../../../shared/internal/Types.js"; import type { BaseSearchResultsTreeNode, SearchResultsTree, SearchResultsTreeNodeChildren, SearchResultsTreeRootNode, -} from "../../../common/internal/visibility/BaseSearchResultsTree.js"; +} from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; import type { CategoriesTreeIdsCache } from "../CategoriesTreeIdsCache.js"; /** @internal */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTree.tsx similarity index 86% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTree.tsx index b92292870b..62a9e459b1 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTree.tsx @@ -3,12 +3,12 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import { VisibilityTree } from "../common/components/VisibilityTree.js"; -import { VisibilityTreeRenderer } from "../common/components/VisibilityTreeRenderer.js"; +import { VisibilityTree } from "../../shared/components/VisibilityTree.js"; +import { VisibilityTreeRenderer } from "../../shared/components/VisibilityTreeRenderer.js"; import { useClassificationsTree } from "./UseClassificationsTree.js"; -import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js"; -import type { ExtendedVisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js"; +import type { VisibilityTreeProps } from "../../shared/components/VisibilityTree.js"; +import type { ExtendedVisibilityTreeRendererProps } from "../../shared/components/VisibilityTreeRenderer.js"; import type { UseClassificationsTreeProps } from "./UseClassificationsTree.js"; /** @alpha */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.tsx b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeComponent.tsx similarity index 90% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.tsx rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeComponent.tsx index df0689277d..2e912e8d87 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeComponent.tsx @@ -5,15 +5,15 @@ import { useActiveIModelConnection } from "@itwin/appui-react"; import { SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata"; +import { useActiveTreeWidgetViewport } from "../../shared/internal/hooks/UseActiveTreeWidgetViewport.js"; +import { SharedTreeContextProviderInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { TelemetryContextProvider } from "../../shared/UseTelemetryContext.js"; import { SelectableTree } from "../../tree-header/SelectableTree.js"; -import { useActiveTreeWidgetViewport } from "../common/internal/hooks/UseActiveTreeWidgetViewport.js"; -import { SharedTreeContextProviderInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { TelemetryContextProvider } from "../common/UseTelemetryContext.js"; import { ClassificationsTree } from "./ClassificationsTree.js"; import type { IModelConnection } from "@itwin/core-frontend"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { StandardTreeLabels } from "../../TreeWidgetComponentImpl.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; import type { ClassificationsTreeProps } from "./ClassificationsTree.js"; /** @alpha */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.ts similarity index 98% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.ts index 544e01a16b..366431022e 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeDefinition.ts @@ -24,7 +24,6 @@ import { import { assert, Guid } from "@itwin/core-bentley"; import { createPredicateBasedHierarchyDefinition } from "@itwin/presentation-hierarchies"; import { createBisInstanceLabelSelectClauseFactory, ECSql } from "@itwin/presentation-shared"; -import { eachValueFrom } from "../../utils/EachValueFrom.js"; import { CLASS_NAME_Classification, CLASS_NAME_ClassificationSystem, @@ -33,11 +32,12 @@ import { CLASS_NAME_ElementHasClassifications, CLASS_NAME_GeometricElement, CLASS_NAME_GeometricElement3d, -} from "../common/internal/ClassNameDefinitions.js"; -import { catchBeSQLiteInterrupts } from "../common/internal/hooks/UseErrorState.js"; -import { fromWithRelease, releaseMainThreadOnItemsCount } from "../common/internal/Rxjs.js"; -import { createExcludedClassesClause, createWhereClause, getOptimalBatchSize, ParentElementsPath } from "../common/internal/Utils.js"; -import { SearchLimitExceededError } from "../common/TreeErrors.js"; +} from "../../shared/internal/ClassNameDefinitions.js"; +import { eachValueFrom } from "../../shared/internal/EachValueFrom.js"; +import { catchBeSQLiteInterrupts } from "../../shared/internal/hooks/UseErrorState.js"; +import { fromWithRelease, releaseMainThreadOnItemsCount } from "../../shared/internal/Rxjs.js"; +import { createExcludedClassesClause, createWhereClause, getOptimalBatchSize, ParentElementsPath } from "../../shared/internal/Utils.js"; +import { SearchLimitExceededError } from "../../shared/TreeErrors.js"; import { ClassificationsTreeNodeInternal } from "./internal/ClassificationsTreeNodeInternal.js"; import type { Observable, ObservedValueOf, OperatorFunction } from "rxjs"; @@ -61,7 +61,7 @@ import type { IInstanceLabelSelectClauseFactory, InstanceKey, } from "@itwin/presentation-shared"; -import type { ClassificationId, ClassificationTableId, ElementId } from "../common/internal/Types.js"; +import type { ClassificationId, ClassificationTableId, ElementId } from "../../shared/internal/Types.js"; import type { ClassificationsTreeIdsCache } from "./internal/ClassificationsTreeIdsCache.js"; const MAX_SEARCH_INSTANCE_KEY_COUNT = 100; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.tsx b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeIcon.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.tsx rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeIcon.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeNode.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/ClassificationsTreeNode.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/UseClassificationsTree.tsx similarity index 90% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/UseClassificationsTree.tsx index 291267b273..ef6a782024 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/UseClassificationsTree.tsx @@ -6,13 +6,13 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop"; import iconBisCategory3d from "@stratakit/icons/bis-category-3d.svg"; -import { EmptyTreeContent, NoSearchMatches, SearchUnknownError, TooManySearchMatches } from "../common/components/EmptyTree.js"; -import { useCachedVisibility } from "../common/internal/hooks/UseCachedVisibility.js"; -import { useGuid } from "../common/internal/hooks/UseGuid.js"; -import { useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { getClassesByView, stableStringify } from "../common/internal/Utils.js"; -import { SearchLimitExceededError } from "../common/TreeErrors.js"; -import { useTelemetryContext } from "../common/UseTelemetryContext.js"; +import { EmptyTreeContent, NoSearchMatches, SearchUnknownError, TooManySearchMatches } from "../../shared/components/EmptyTree.js"; +import { useCachedVisibility } from "../../shared/internal/hooks/UseCachedVisibility.js"; +import { useGuid } from "../../shared/internal/hooks/UseGuid.js"; +import { useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { getClassesByView, stableStringify } from "../../shared/internal/Utils.js"; +import { SearchLimitExceededError } from "../../shared/TreeErrors.js"; +import { useTelemetryContext } from "../../shared/UseTelemetryContext.js"; import { ClassificationsTreeComponent } from "./ClassificationsTreeComponent.js"; import { ClassificationsTreeIcon } from "./ClassificationsTreeIcon.js"; import { ClassificationsTreeIdsCache } from "./internal/ClassificationsTreeIdsCache.js"; @@ -25,12 +25,12 @@ import type { GuidString } from "@itwin/core-bentley"; import type { IModelConnection } from "@itwin/core-frontend"; import type { useTree } from "@itwin/presentation-hierarchies-react"; import type { EC } from "@itwin/presentation-shared"; -import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js"; -import type { ExtendedVisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js"; -import type { CreateSearchResultsTreeProps, CreateTreeSpecificVisibilityHandlerProps } from "../common/internal/hooks/UseCachedVisibility.js"; -import type { SearchResultsTree } from "../common/internal/visibility/BaseSearchResultsTree.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; -import type { FunctionProps } from "../common/Utils.js"; +import type { VisibilityTreeProps } from "../../shared/components/VisibilityTree.js"; +import type { ExtendedVisibilityTreeRendererProps } from "../../shared/components/VisibilityTreeRenderer.js"; +import type { CreateSearchResultsTreeProps, CreateTreeSpecificVisibilityHandlerProps } from "../../shared/internal/hooks/UseCachedVisibility.js"; +import type { SearchResultsTree } from "../../shared/internal/visibility/BaseSearchResultsTree.js"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; +import type { FunctionProps } from "../../shared/Utils.js"; import type { ClassificationsTreeHierarchyConfiguration } from "./ClassificationsTreeDefinition.js"; import type { HierarchyConfigForClassificationsCache, VisibilityHandlerConfigForClassificationsCache } from "./internal/ClassificationsTreeIdsCache.js"; import type { ClassificationsTreeSearchTargets } from "./internal/visibility/SearchResultsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/UseClassificationsTreeDefinition.ts similarity index 94% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/UseClassificationsTreeDefinition.ts index 429a982ab7..475bfc2634 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/UseClassificationsTreeDefinition.ts @@ -5,9 +5,9 @@ import { useEffect, useMemo } from "react"; import { HierarchySearchTree } from "@itwin/presentation-hierarchies"; -import { createIModelAccess } from "../common/internal/hooks/UseIModelAccess.js"; -import { useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { useTelemetryContext } from "../common/UseTelemetryContext.js"; +import { createIModelAccess } from "../../shared/internal/hooks/UseIModelAccess.js"; +import { useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { useTelemetryContext } from "../../shared/UseTelemetryContext.js"; import { ClassificationsTreeDefinition } from "./ClassificationsTreeDefinition.js"; import { getClassificationsTreeIdsCache } from "./UseClassificationsTree.js"; @@ -15,7 +15,7 @@ import type { IModelConnection } from "@itwin/core-frontend"; import type { HierarchyDefinition } from "@itwin/presentation-hierarchies"; import type { useTree } from "@itwin/presentation-hierarchies-react"; import type { InstanceKey } from "@itwin/presentation-shared"; -import type { FunctionProps } from "../common/Utils.js"; +import type { FunctionProps } from "../../shared/Utils.js"; import type { ClassificationsTreeHierarchyConfiguration } from "./ClassificationsTreeDefinition.js"; import type { ClassificationsTreeVisibilityHandlerConfiguration } from "./UseClassificationsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts similarity index 96% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts index 47f6e5d03d..6eda7f7fb5 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeIdsCache.ts @@ -5,7 +5,7 @@ import { defer, EMPTY, expand, from, map, merge, mergeMap, of, reduce, shareReplay } from "rxjs"; import { Guid, Id64 } from "@itwin/core-bentley"; -import { BaseIdsCacheImpl } from "../../common/internal/caches/BaseIdsCache.js"; +import { BaseIdsCacheImpl } from "../../../shared/internal/caches/BaseIdsCache.js"; import { CLASS_NAME_Classification, CLASS_NAME_ClassificationSystem, @@ -13,16 +13,16 @@ import { CLASS_NAME_ElementHasClassifications, CLASS_NAME_GeometricElement3d, CLASS_NAME_SpatialCategory, -} from "../../common/internal/ClassNameDefinitions.js"; -import { catchBeSQLiteInterrupts } from "../../common/internal/hooks/UseErrorState.js"; -import { fromWithRelease } from "../../common/internal/Rxjs.js"; -import { createWhereClause, getOrCreate } from "../../common/internal/Utils.js"; +} from "../../../shared/internal/ClassNameDefinitions.js"; +import { catchBeSQLiteInterrupts } from "../../../shared/internal/hooks/UseErrorState.js"; +import { fromWithRelease } from "../../../shared/internal/Rxjs.js"; +import { createWhereClause, getOrCreate } from "../../../shared/internal/Utils.js"; import type { Observable } from "rxjs"; import type { GuidString, Id64Arg, Id64Array, Id64String } from "@itwin/core-bentley"; import type { HierarchyNodeIdentifiersPath, LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; -import type { BaseIdsCacheImplProps } from "../../common/internal/caches/BaseIdsCache.js"; -import type { CategoryId, ClassificationId, ClassificationTableId, ElementId } from "../../common/internal/Types.js"; +import type { BaseIdsCacheImplProps } from "../../../shared/internal/caches/BaseIdsCache.js"; +import type { CategoryId, ClassificationId, ClassificationTableId, ElementId } from "../../../shared/internal/Types.js"; import type { ClassificationsTreeHierarchyConfiguration } from "../ClassificationsTreeDefinition.js"; import type { ClassificationsTreeVisibilityHandlerConfiguration } from "../UseClassificationsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.ts similarity index 95% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.ts index ab9cfced14..0fea8bb095 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.ts @@ -7,7 +7,7 @@ import { ClassificationsTreeNode } from "../ClassificationsTreeNode.js"; import type { Id64String } from "@itwin/core-bentley"; import type { HierarchyNode, InstancesNodeKey, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; -import type { ParentElementsPath } from "../../common/internal/Utils.js"; +import type { ParentElementsPath } from "../../../shared/internal/Utils.js"; /** * Contains utility functions for working with Classifications Tree nodes. diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts similarity index 92% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts index b52b2c17c7..ab32e84420 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts @@ -5,10 +5,10 @@ import { concat, defer, EMPTY, from, merge, mergeAll, mergeMap, of, Subject } from "rxjs"; import { assert, Guid } from "@itwin/core-bentley"; -import { HierarchyVisibilityHandlerImpl } from "../../../common/internal/hooks/UseCachedVisibility.js"; -import { fromWithRelease } from "../../../common/internal/Rxjs.js"; -import { createVisibilityStatus } from "../../../common/internal/Tooltip.js"; -import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js"; +import { HierarchyVisibilityHandlerImpl } from "../../../../shared/internal/hooks/UseCachedVisibility.js"; +import { fromWithRelease } from "../../../../shared/internal/Rxjs.js"; +import { createVisibilityStatus } from "../../../../shared/internal/Tooltip.js"; +import { mergeVisibilityStatuses } from "../../../../shared/internal/VisibilityUtils.js"; import { ClassificationsTreeNodeInternal } from "../ClassificationsTreeNodeInternal.js"; import { ClassificationsTreeVisibilityHelper } from "./ClassificationsTreeVisibilityHelper.js"; import { createClassificationsSearchResultsTree } from "./SearchResultsTree.js"; @@ -16,11 +16,11 @@ import { createClassificationsSearchResultsTree } from "./SearchResultsTree.js"; import type { Observable } from "rxjs"; import type { HierarchyNode, HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { ECClassHierarchyInspector } from "@itwin/presentation-shared"; -import type { AlwaysAndNeverDrawnElementInfoCache } from "../../../common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; -import type { SearchResultsTree } from "../../../common/internal/visibility/BaseSearchResultsTree.js"; -import type { TreeSpecificVisibilityHandler } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import type { TreeWidgetViewport } from "../../../common/TreeWidgetViewport.js"; -import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js"; +import type { AlwaysAndNeverDrawnElementInfoCache } from "../../../../shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +import type { SearchResultsTree } from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; +import type { TreeSpecificVisibilityHandler } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import type { TreeWidgetViewport } from "../../../../shared/TreeWidgetViewport.js"; +import type { VisibilityStatus } from "../../../../shared/UseHierarchyVisibility.js"; import type { ClassificationsTreeIdsCache } from "../ClassificationsTreeIdsCache.js"; import type { ClassificationsTreeSearchTargets } from "./SearchResultsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts similarity index 90% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts index edd9bf6ef8..bafae8ff59 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import { defaultIfEmpty, filter, mergeMap, toArray } from "rxjs"; -import { createVisibilityStatus } from "../../../common/internal/Tooltip.js"; -import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; +import { createVisibilityStatus } from "../../../../shared/internal/Tooltip.js"; +import { BaseVisibilityHelper } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; import type { Observable } from "rxjs"; import type { Id64Arg } from "@itwin/core-bentley"; -import type { CategoryId } from "../../../common/internal/Types.js"; -import type { BaseVisibilityHelperProps } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js"; +import type { CategoryId } from "../../../../shared/internal/Types.js"; +import type { BaseVisibilityHelperProps } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import type { VisibilityStatus } from "../../../../shared/UseHierarchyVisibility.js"; import type { ClassificationsTreeIdsCache } from "../ClassificationsTreeIdsCache.js"; /** @internal */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.ts b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/SearchResultsTree.ts similarity index 95% rename from packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.ts rename to packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/SearchResultsTree.ts index 2c0c970372..251a61d9e4 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/classifications-tree/internal/visibility/SearchResultsTree.ts @@ -5,20 +5,24 @@ import { firstValueFrom } from "rxjs"; import { assert } from "@itwin/core-bentley"; -import { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable } from "../../../common/internal/ClassNameDefinitions.js"; -import { ParentElementsPath } from "../../../common/internal/Utils.js"; -import { createSearchResultsTree, InternalSearchTargetElements, SearchResultsNodesHandler } from "../../../common/internal/visibility/BaseSearchResultsTree.js"; +import { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable } from "../../../../shared/internal/ClassNameDefinitions.js"; +import { ParentElementsPath } from "../../../../shared/internal/Utils.js"; +import { + createSearchResultsTree, + InternalSearchTargetElements, + SearchResultsNodesHandler, +} from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; import type { Id64Set, Id64String } from "@itwin/core-bentley"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { EC, ECClassHierarchyInspector } from "@itwin/presentation-shared"; -import type { ElementId } from "../../../common/internal/Types.js"; +import type { ElementId } from "../../../../shared/internal/Types.js"; import type { BaseSearchResultsTreeNode, SearchResultsTree, SearchResultsTreeNodeChildren, SearchResultsTreeRootNode, -} from "../../../common/internal/visibility/BaseSearchResultsTree.js"; +} from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; import type { ClassificationsTreeIdsCache } from "../ClassificationsTreeIdsCache.js"; /** @internal */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTree.tsx similarity index 88% rename from packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTree.tsx index d18a240967..07673886f9 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTree.tsx @@ -9,18 +9,18 @@ import classSvg from "@stratakit/icons/bis-class.svg"; import elementSvg from "@stratakit/icons/bis-element.svg"; import documentSvg from "@stratakit/icons/document.svg"; import ecSchemaSvg from "@stratakit/icons/selection-children.svg"; -import { EmptyTreeContent } from "../common/components/EmptyTree.js"; -import { Tree } from "../common/components/Tree.js"; -import { TreeRenderer } from "../common/components/TreeRenderer.js"; -import { useGuid } from "../common/internal/hooks/UseGuid.js"; +import { EmptyTreeContent } from "../../shared/components/EmptyTree.js"; +import { Tree } from "../../shared/components/Tree.js"; +import { TreeRenderer } from "../../shared/components/TreeRenderer.js"; +import { useGuid } from "../../shared/internal/hooks/UseGuid.js"; import { ExternalSourcesTreeComponent } from "./ExternalSourcesTreeComponent.js"; import { ExternalSourcesTreeDefinition } from "./ExternalSourcesTreeDefinition.js"; import type { GuidString } from "@itwin/core-bentley"; import type { TreeNode } from "@itwin/presentation-hierarchies-react"; import type { Props } from "@itwin/presentation-shared"; -import type { TreeProps } from "../common/components/Tree.js"; -import type { ExtendedTreeRendererProps } from "../common/components/TreeRenderer.js"; +import type { TreeProps } from "../../shared/components/Tree.js"; +import type { ExtendedTreeRendererProps } from "../../shared/components/TreeRenderer.js"; /** @beta */ export type ExternalSourcesTreeProps = Pick< diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx b/packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx similarity index 96% rename from packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx rename to packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx index 5c53d94a2f..879d379269 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { useActiveIModelConnection } from "@itwin/appui-react"; +import { TelemetryContextProvider } from "../../shared/UseTelemetryContext.js"; import { SelectableTree } from "../../tree-header/SelectableTree.js"; -import { TelemetryContextProvider } from "../common/UseTelemetryContext.js"; import { ExternalSourcesTree } from "./ExternalSourcesTree.js"; import type { StandardTreeLabels } from "../../TreeWidgetComponentImpl.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.ts b/packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTreeDefinition.ts similarity index 98% rename from packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.ts rename to packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTreeDefinition.ts index 0b16a545dc..9f605b7098 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/external-sources-tree/ExternalSourcesTreeDefinition.ts @@ -6,8 +6,8 @@ import { Guid } from "@itwin/core-bentley"; import { createPredicateBasedHierarchyDefinition, HierarchyNode } from "@itwin/presentation-hierarchies"; import { createBisInstanceLabelSelectClauseFactory, ECSql } from "@itwin/presentation-shared"; -import { CLASS_NAME_GeometricElement } from "../common/internal/ClassNameDefinitions.js"; -import { createWhereClause } from "../common/internal/Utils.js"; +import { CLASS_NAME_GeometricElement } from "../../shared/internal/ClassNameDefinitions.js"; +import { createWhereClause } from "../../shared/internal/Utils.js"; import type { GuidString } from "@itwin/core-bentley"; import type { diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTree.tsx similarity index 90% rename from packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTree.tsx index 75b95f6b83..9f73385791 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTree.tsx @@ -12,17 +12,17 @@ import subjectSvg from "@stratakit/icons/bis-subject.svg"; import groupSvg from "@stratakit/icons/group.svg"; import modelSvg from "@stratakit/icons/model-cube.svg"; import hierarchyTreeSvg from "@stratakit/icons/selection-children.svg"; -import { EmptyTreeContent } from "../common/components/EmptyTree.js"; -import { Tree } from "../common/components/Tree.js"; -import { TreeRenderer } from "../common/components/TreeRenderer.js"; -import { useGuid } from "../common/internal/hooks/UseGuid.js"; +import { EmptyTreeContent } from "../../shared/components/EmptyTree.js"; +import { Tree } from "../../shared/components/Tree.js"; +import { TreeRenderer } from "../../shared/components/TreeRenderer.js"; +import { useGuid } from "../../shared/internal/hooks/UseGuid.js"; import { IModelContentTreeComponent } from "./IModelContentTreeComponent.js"; import { defaultHierarchyConfiguration, IModelContentTreeDefinition } from "./IModelContentTreeDefinition.js"; import { IModelContentTreeIdsCache } from "./internal/IModelContentTreeIdsCache.js"; import type { TreeNode } from "@itwin/presentation-hierarchies-react"; -import type { TreeProps } from "../common/components/Tree.js"; -import type { ExtendedTreeRendererProps } from "../common/components/TreeRenderer.js"; +import type { TreeProps } from "../../shared/components/Tree.js"; +import type { ExtendedTreeRendererProps } from "../../shared/components/TreeRenderer.js"; import type { IModelContentTreeHierarchyConfiguration } from "./IModelContentTreeDefinition.js"; /** @beta */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.tsx b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTreeComponent.tsx similarity index 96% rename from packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.tsx rename to packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTreeComponent.tsx index 5068ab5aa8..31b9bc298b 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTreeComponent.tsx @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { useActiveIModelConnection } from "@itwin/appui-react"; +import { TelemetryContextProvider } from "../../shared/UseTelemetryContext.js"; import { SelectableTree } from "../../tree-header/SelectableTree.js"; -import { TelemetryContextProvider } from "../common/UseTelemetryContext.js"; import { IModelContentTree } from "./IModelContentTree.js"; import type { StandardTreeLabels } from "../../TreeWidgetComponentImpl.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.ts b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTreeDefinition.ts similarity index 99% rename from packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.ts rename to packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTreeDefinition.ts index 1c2a790ce8..f6606371f7 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/IModelContentTreeDefinition.ts @@ -15,8 +15,8 @@ import { CLASS_NAME_Model, CLASS_NAME_SpatialCategory, CLASS_NAME_Subject, -} from "../common/internal/ClassNameDefinitions.js"; -import { createIdsSelector, createWhereClause, getClassesByView, parseIdsSelectorResult } from "../common/internal/Utils.js"; +} from "../../shared/internal/ClassNameDefinitions.js"; +import { createIdsSelector, createWhereClause, getClassesByView, parseIdsSelectorResult } from "../../shared/internal/Utils.js"; import type { DefineGenericNodeChildHierarchyLevelProps, diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.ts b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.ts similarity index 97% rename from packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.ts rename to packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.ts index 3c775462b4..ac970f2878 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.ts @@ -10,13 +10,13 @@ import { CLASS_NAME_InformationPartitionElement, CLASS_NAME_Model, CLASS_NAME_Subject, -} from "../../common/internal/ClassNameDefinitions.js"; -import { isBeSqliteInterruptError } from "../../common/internal/hooks/UseErrorState.js"; -import { createWhereClause, getOrCreate } from "../../common/internal/Utils.js"; +} from "../../../shared/internal/ClassNameDefinitions.js"; +import { isBeSqliteInterruptError } from "../../../shared/internal/hooks/UseErrorState.js"; +import { createWhereClause, getOrCreate } from "../../../shared/internal/Utils.js"; import type { GuidString, Id64Array, Id64Set, Id64String } from "@itwin/core-bentley"; import type { LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; -import type { ModelId, SubjectId } from "../../common/internal/Types.js"; +import type { ModelId, SubjectId } from "../../../shared/internal/Types.js"; interface SubjectInfo { parentSubjectId: Id64String | undefined; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/index.ts b/packages/tree-widget/src/tree-widget-react/trees/index.ts similarity index 74% rename from packages/tree-widget/src/tree-widget-react/components/trees/index.ts rename to packages/tree-widget/src/tree-widget-react/trees/index.ts index 99cf248098..c03ee9e754 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/index.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/index.ts @@ -27,20 +27,20 @@ export { IModelContentTreeIcon } from "./imodel-content-tree/IModelContentTree.j export { ExternalSourcesTreeComponent } from "./external-sources-tree/ExternalSourcesTreeComponent.js"; export { ExternalSourcesTreeIcon } from "./external-sources-tree/ExternalSourcesTree.js"; -export { FocusedInstancesContextProvider, useFocusedInstancesContext } from "./common/FocusedInstancesContext.js"; - -export { Tree } from "./common/components/Tree.js"; -export type { TreeWidgetViewport } from "./common/TreeWidgetViewport.js"; -export { createTreeWidgetViewport } from "./common/TreeWidgetViewport.js"; -export { VisibilityTree } from "./common/components/VisibilityTree.js"; -export { VisibilityAction } from "./common/components/TreeNodeVisibilityButton.js"; -export { TreeRenderer } from "./common/components/TreeRenderer.js"; -export { VisibilityTreeRenderer } from "./common/components/VisibilityTreeRenderer.js"; -export { SkeletonTree } from "./common/components/SkeletonTree.js"; -export type { HierarchyVisibilityHandler, VisibilityStatus } from "./common/UseHierarchyVisibility.js"; -export { SharedTreeContextProvider } from "./common/SharedTreeContextProvider.js"; -export { TelemetryContextProvider } from "./common/UseTelemetryContext.js"; -export { SearchLimitExceededError } from "./common/TreeErrors.js"; +export { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../shared/FocusedInstancesContext.js"; + +export { Tree } from "../shared/components/Tree.js"; +export type { TreeWidgetViewport } from "../shared/TreeWidgetViewport.js"; +export { createTreeWidgetViewport } from "../shared/TreeWidgetViewport.js"; +export { VisibilityTree } from "../shared/components/VisibilityTree.js"; +export { VisibilityAction } from "../shared/components/TreeNodeVisibilityButton.js"; +export { TreeRenderer } from "../shared/components/TreeRenderer.js"; +export { VisibilityTreeRenderer } from "../shared/components/VisibilityTreeRenderer.js"; +export { SkeletonTree } from "../shared/components/SkeletonTree.js"; +export type { HierarchyVisibilityHandler, VisibilityStatus } from "../shared/UseHierarchyVisibility.js"; +export { SharedTreeContextProvider } from "../shared/SharedTreeContextProvider.js"; +export { TelemetryContextProvider } from "../shared/UseTelemetryContext.js"; +export { SearchLimitExceededError } from "../shared/TreeErrors.js"; export type { ModelsTreeVisibilityHandlerOverrides } from "./models-tree/internal/visibility/ModelsTreeVisibilityHandler.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTree.tsx similarity index 86% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTree.tsx index 6d67076cbc..b46a9dc322 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTree.tsx @@ -3,12 +3,12 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import { VisibilityTree } from "../common/components/VisibilityTree.js"; -import { VisibilityTreeRenderer } from "../common/components/VisibilityTreeRenderer.js"; +import { VisibilityTree } from "../../shared/components/VisibilityTree.js"; +import { VisibilityTreeRenderer } from "../../shared/components/VisibilityTreeRenderer.js"; import { useModelsTree } from "./UseModelsTree.js"; -import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js"; -import type { ExtendedVisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js"; +import type { VisibilityTreeProps } from "../../shared/components/VisibilityTree.js"; +import type { ExtendedVisibilityTreeRendererProps } from "../../shared/components/VisibilityTreeRenderer.js"; import type { UseModelsTreeProps } from "./UseModelsTree.js"; /** @beta */ diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.tsx b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeButtons.tsx similarity index 94% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.tsx rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeButtons.tsx index 40e9d7a2f5..cb60e1567e 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeButtons.tsx @@ -12,20 +12,20 @@ import focusModeSvg from "@stratakit/icons/cursor-click.svg"; import visibilityHideSvg from "@stratakit/icons/visibility-hide.svg"; import visibilityInvertSvg from "@stratakit/icons/visibility-invert.svg"; import visibilityShowSvg from "@stratakit/icons/visibility-show.svg"; -import { useTranslation } from "../common/components/LocalizationContext.js"; -import { useFocusedInstancesContext } from "../common/FocusedInstancesContext.js"; -import { useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { getClassesByView } from "../common/internal/Utils.js"; -import { invertAllModels, showAll } from "../common/internal/VisibilityUtils.js"; +import { useTranslation } from "../../shared/components/LocalizationContext.js"; +import { useFocusedInstancesContext } from "../../shared/FocusedInstancesContext.js"; +import { useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { getClassesByView } from "../../shared/internal/Utils.js"; +import { invertAllModels, showAll } from "../../shared/internal/VisibilityUtils.js"; import type { ReactElement } from "react"; import type { Observable } from "rxjs"; import type { Id64String } from "@itwin/core-bentley"; import type { IModelConnection } from "@itwin/core-frontend"; +import type { BaseIdsCache } from "../../shared/internal/caches/BaseIdsCache.js"; +import type { CategoryInfosMap } from "../../shared/internal/VisibilityUtils.js"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { TreeToolbarButtonProps } from "../../tree-header/SelectableTree.js"; -import type { BaseIdsCache } from "../common/internal/caches/BaseIdsCache.js"; -import type { CategoryInfosMap } from "../common/internal/VisibilityUtils.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; /** * Information about a single Model. diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.tsx b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeComponent.tsx similarity index 94% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.tsx rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeComponent.tsx index 2104edf944..fcefbac88b 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeComponent.tsx @@ -6,12 +6,12 @@ import { Fragment, useEffect } from "react"; import { useActiveIModelConnection } from "@itwin/appui-react"; import { Skeleton } from "@stratakit/bricks"; +import { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../../shared/FocusedInstancesContext.js"; +import { useActiveTreeWidgetViewport } from "../../shared/internal/hooks/UseActiveTreeWidgetViewport.js"; +import { SharedTreeContextProviderInternal, useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { getClassesByView } from "../../shared/internal/Utils.js"; +import { TelemetryContextProvider } from "../../shared/UseTelemetryContext.js"; import { SelectableTree } from "../../tree-header/SelectableTree.js"; -import { FocusedInstancesContextProvider, useFocusedInstancesContext } from "../common/FocusedInstancesContext.js"; -import { useActiveTreeWidgetViewport } from "../common/internal/hooks/UseActiveTreeWidgetViewport.js"; -import { SharedTreeContextProviderInternal, useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { getClassesByView } from "../common/internal/Utils.js"; -import { TelemetryContextProvider } from "../common/UseTelemetryContext.js"; import { ModelsTree } from "./ModelsTree.js"; import { HideAllButton, @@ -25,8 +25,8 @@ import { import type { ReactNode } from "react"; import type { IModelConnection } from "@itwin/core-frontend"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { StandardTreeLabels } from "../../TreeWidgetComponentImpl.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; import type { ModelsTreeProps } from "./ModelsTree.js"; import type { ModelsTreeHeaderButtonProps, ModelsTreeHeaderButtonType } from "./ModelsTreeButtons.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeDefinition.ts similarity index 99% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeDefinition.ts index 87a8813d51..f6b99d9d8e 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeDefinition.ts @@ -8,7 +8,6 @@ import { assert, Guid } from "@itwin/core-bentley"; import { IModel } from "@itwin/core-common"; import { createPredicateBasedHierarchyDefinition, ProcessedHierarchyNode } from "@itwin/presentation-hierarchies"; import { createBisInstanceLabelSelectClauseFactory, ECSql, parseFullClassName } from "@itwin/presentation-shared"; -import { eachValueFrom } from "../../utils/EachValueFrom.js"; import { CLASS_NAME_Element, CLASS_NAME_GeometricElement3d, @@ -18,9 +17,10 @@ import { CLASS_NAME_Model, CLASS_NAME_SpatialCategory, CLASS_NAME_Subject, -} from "../common/internal/ClassNameDefinitions.js"; -import { catchBeSQLiteInterrupts } from "../common/internal/hooks/UseErrorState.js"; -import { fromWithRelease, releaseMainThreadOnItemsCount } from "../common/internal/Rxjs.js"; +} from "../../shared/internal/ClassNameDefinitions.js"; +import { eachValueFrom } from "../../shared/internal/EachValueFrom.js"; +import { catchBeSQLiteInterrupts } from "../../shared/internal/hooks/UseErrorState.js"; +import { fromWithRelease, releaseMainThreadOnItemsCount } from "../../shared/internal/Rxjs.js"; import { createExcludedClassesClause, createIdsSelector, @@ -29,8 +29,8 @@ import { groupingNodeDataFromChildren, ParentElementsPath, parseIdsSelectorResult, -} from "../common/internal/Utils.js"; -import { SearchLimitExceededError } from "../common/TreeErrors.js"; +} from "../../shared/internal/Utils.js"; +import { SearchLimitExceededError } from "../../shared/TreeErrors.js"; import { ModelsTreeNodeInternal } from "./internal/ModelsTreeNodeInternal.js"; import type { Observable, ObservedValueOf, OperatorFunction } from "rxjs"; @@ -60,8 +60,8 @@ import type { InstanceKey, Props, } from "@itwin/presentation-shared"; -import type { CategoryId } from "../common/internal/Types.js"; -import type { DeepRequired } from "../common/internal/Utils.js"; +import type { CategoryId } from "../../shared/internal/Types.js"; +import type { DeepRequired } from "../../shared/internal/Utils.js"; import type { ModelsTreeIdsCache } from "./internal/ModelsTreeIdsCache.js"; import type { CategoryNodeProps, ElementNodeProps } from "./internal/ModelsTreeNodeInternal.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeIcon.tsx b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeIcon.tsx similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeIcon.tsx rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeIcon.tsx diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeNode.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeNode.ts similarity index 100% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/ModelsTreeNode.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/ModelsTreeNode.ts diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/UseModelsTree.tsx b/packages/tree-widget/src/tree-widget-react/trees/models-tree/UseModelsTree.tsx similarity index 93% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/UseModelsTree.tsx rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/UseModelsTree.tsx index 6e9e2d2e2c..9341cd0e07 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/UseModelsTree.tsx +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/UseModelsTree.tsx @@ -14,11 +14,11 @@ import { TooManyInstancesFocused, TooManySearchMatches, UnknownInstanceFocusError, -} from "../common/components/EmptyTree.js"; -import { useCachedVisibility } from "../common/internal/hooks/UseCachedVisibility.js"; -import { useGuid } from "../common/internal/hooks/UseGuid.js"; -import { useSharedTreeContextInternal } from "../common/internal/SharedTreeContextProviderInternal.js"; -import { mergeWithDefaults, stableStringify } from "../common/internal/Utils.js"; +} from "../../shared/components/EmptyTree.js"; +import { useCachedVisibility } from "../../shared/internal/hooks/UseCachedVisibility.js"; +import { useGuid } from "../../shared/internal/hooks/UseGuid.js"; +import { useSharedTreeContextInternal } from "../../shared/internal/SharedTreeContextProviderInternal.js"; +import { mergeWithDefaults, stableStringify } from "../../shared/internal/Utils.js"; import { ModelsTreeIdsCache } from "./internal/ModelsTreeIdsCache.js"; import { useSearchPaths } from "./internal/UseSearchPaths.js"; import { ModelsTreeVisibilityHandler } from "./internal/visibility/ModelsTreeVisibilityHandler.js"; @@ -33,11 +33,11 @@ import type { IModelConnection } from "@itwin/core-frontend"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { TreeNode } from "@itwin/presentation-hierarchies-react"; import type { InstanceKey } from "@itwin/presentation-shared"; -import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js"; -import type { ExtendedVisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js"; -import type { CreateSearchResultsTreeProps, CreateTreeSpecificVisibilityHandlerProps } from "../common/internal/hooks/UseCachedVisibility.js"; -import type { SearchResultsTree } from "../common/internal/visibility/BaseSearchResultsTree.js"; -import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js"; +import type { VisibilityTreeProps } from "../../shared/components/VisibilityTree.js"; +import type { ExtendedVisibilityTreeRendererProps } from "../../shared/components/VisibilityTreeRenderer.js"; +import type { CreateSearchResultsTreeProps, CreateTreeSpecificVisibilityHandlerProps } from "../../shared/internal/hooks/UseCachedVisibility.js"; +import type { SearchResultsTree } from "../../shared/internal/visibility/BaseSearchResultsTree.js"; +import type { TreeWidgetViewport } from "../../shared/TreeWidgetViewport.js"; import type { ModelsTreeSearchError, ModelsTreeSubTreeError } from "./internal/UseSearchPaths.js"; import type { ModelsTreeVisibilityHandlerOverrides } from "./internal/visibility/ModelsTreeVisibilityHandler.js"; import type { ModelsTreeSearchTargets } from "./internal/visibility/SearchResultsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.ts similarity index 96% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.ts index 7a49ece9d4..8924ec9454 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/ModelsTreeIdsCache.ts @@ -6,17 +6,17 @@ import { defer, filter, forkJoin, map, mergeMap, of, reduce, shareReplay } from "rxjs"; import { assert, Guid, Id64 } from "@itwin/core-bentley"; import { IModel } from "@itwin/core-common"; -import { BaseIdsCacheImpl } from "../../common/internal/caches/BaseIdsCache.js"; -import { CLASS_NAME_GeometricModel3d, CLASS_NAME_InformationPartitionElement, CLASS_NAME_Subject } from "../../common/internal/ClassNameDefinitions.js"; -import { catchBeSQLiteInterrupts } from "../../common/internal/hooks/UseErrorState.js"; -import { createWhereClause, getOrCreate } from "../../common/internal/Utils.js"; +import { BaseIdsCacheImpl } from "../../../shared/internal/caches/BaseIdsCache.js"; +import { CLASS_NAME_GeometricModel3d, CLASS_NAME_InformationPartitionElement, CLASS_NAME_Subject } from "../../../shared/internal/ClassNameDefinitions.js"; +import { catchBeSQLiteInterrupts } from "../../../shared/internal/hooks/UseErrorState.js"; +import { createWhereClause, getOrCreate } from "../../../shared/internal/Utils.js"; import type { Observable } from "rxjs"; import type { GuidString, Id64Arg, Id64Array, Id64Set, Id64String } from "@itwin/core-bentley"; import type { HierarchyNodeIdentifiersPath, LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies"; import type { InstanceKey } from "@itwin/presentation-shared"; -import type { BaseIdsCacheImplProps } from "../../common/internal/caches/BaseIdsCache.js"; -import type { ModelId, SubjectId } from "../../common/internal/Types.js"; +import type { BaseIdsCacheImplProps } from "../../../shared/internal/caches/BaseIdsCache.js"; +import type { ModelId, SubjectId } from "../../../shared/internal/Types.js"; import type { RequiredModelsTreeHierarchyConfiguration } from "../ModelsTreeDefinition.js"; /** diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNodeInternal.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/ModelsTreeNodeInternal.ts similarity index 95% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNodeInternal.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/ModelsTreeNodeInternal.ts index 53630d3705..657f6cce72 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNodeInternal.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/ModelsTreeNodeInternal.ts @@ -7,8 +7,8 @@ import { ModelsTreeNode } from "../ModelsTreeNode.js"; import type { Id64Array, Id64String } from "@itwin/core-bentley"; import type { ClassGroupingNodeKey, GroupingHierarchyNode, HierarchyNode, InstancesNodeKey, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies"; -import type { ElementId } from "../../common/internal/Types.js"; -import type { ParentElementsPath } from "../../common/internal/Utils.js"; +import type { ElementId } from "../../../shared/internal/Types.js"; +import type { ParentElementsPath } from "../../../shared/internal/Utils.js"; /** * Contains utility functions for working with Models Tree nodes. diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/UseSearchPaths.ts similarity index 96% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/UseSearchPaths.ts index b682f86041..3ed253cb86 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/UseSearchPaths.ts @@ -6,18 +6,18 @@ import { useEffect, useMemo, useState } from "react"; import { firstValueFrom } from "rxjs"; import { HierarchyNode, HierarchyNodeIdentifier, HierarchyNodeKey, HierarchySearchTree } from "@itwin/presentation-hierarchies"; -import { useFocusedInstancesContext } from "../../common/FocusedInstancesContext.js"; -import { CLASS_NAME_GeometricModel3d, CLASS_NAME_Subject } from "../../common/internal/ClassNameDefinitions.js"; -import { SearchLimitExceededError } from "../../common/TreeErrors.js"; -import { useTelemetryContext } from "../../common/UseTelemetryContext.js"; -import { joinHierarchySearchTrees } from "../../common/Utils.js"; +import { useFocusedInstancesContext } from "../../../shared/FocusedInstancesContext.js"; +import { CLASS_NAME_GeometricModel3d, CLASS_NAME_Subject } from "../../../shared/internal/ClassNameDefinitions.js"; +import { SearchLimitExceededError } from "../../../shared/TreeErrors.js"; +import { useTelemetryContext } from "../../../shared/UseTelemetryContext.js"; +import { joinHierarchySearchTrees } from "../../../shared/Utils.js"; import { ModelsTreeDefinition } from "../ModelsTreeDefinition.js"; import { ModelsTreeNode } from "../ModelsTreeNode.js"; import type { GuidString, Id64Array, Id64String } from "@itwin/core-bentley"; import type { GroupingHierarchyNode, InstancesNodeKey } from "@itwin/presentation-hierarchies"; import type { ECClassHierarchyInspector, InstanceKey } from "@itwin/presentation-shared"; -import type { VisibilityTreeProps } from "../../common/components/VisibilityTree.js"; +import type { VisibilityTreeProps } from "../../../shared/components/VisibilityTree.js"; import type { ClassGroupingHierarchyNode, ElementsGroupInfo, RequiredModelsTreeHierarchyConfiguration } from "../ModelsTreeDefinition.js"; import type { ModelsTreeIdsCache } from "./ModelsTreeIdsCache.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts similarity index 94% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts index f38680006e..ecc40a494d 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts @@ -5,10 +5,10 @@ import { concat, defer, EMPTY, from, merge, mergeAll, mergeMap, of, Subject } from "rxjs"; import { assert, Guid } from "@itwin/core-bentley"; -import { HierarchyVisibilityHandlerImpl } from "../../../common/internal/hooks/UseCachedVisibility.js"; -import { fromWithRelease } from "../../../common/internal/Rxjs.js"; -import { createVisibilityStatus } from "../../../common/internal/Tooltip.js"; -import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js"; +import { HierarchyVisibilityHandlerImpl } from "../../../../shared/internal/hooks/UseCachedVisibility.js"; +import { fromWithRelease } from "../../../../shared/internal/Rxjs.js"; +import { createVisibilityStatus } from "../../../../shared/internal/Tooltip.js"; +import { mergeVisibilityStatuses } from "../../../../shared/internal/VisibilityUtils.js"; import { ModelsTreeNodeInternal } from "../ModelsTreeNodeInternal.js"; import { ModelsTreeVisibilityHelper } from "./ModelsTreeVisibilityHelper.js"; import { createModelsSearchResultsTree } from "./SearchResultsTree.js"; @@ -17,15 +17,15 @@ import type { Observable } from "rxjs"; import type { Id64Arg } from "@itwin/core-bentley"; import type { GroupingHierarchyNode, HierarchyNode, HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { ECClassHierarchyInspector } from "@itwin/presentation-shared"; -import type { AlwaysAndNeverDrawnElementInfoCache } from "../../../common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; -import type { SearchResultsTree } from "../../../common/internal/visibility/BaseSearchResultsTree.js"; -import type { BaseTreeVisibilityHandlerOverrides, TreeSpecificVisibilityHandler } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import type { TreeWidgetViewport } from "../../../common/TreeWidgetViewport.js"; +import type { AlwaysAndNeverDrawnElementInfoCache } from "../../../../shared/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js"; +import type { SearchResultsTree } from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; +import type { BaseTreeVisibilityHandlerOverrides, TreeSpecificVisibilityHandler } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import type { TreeWidgetViewport } from "../../../../shared/TreeWidgetViewport.js"; import type { HierarchyVisibilityHandlerOverridableMethod, HierarchyVisibilityOverrideHandler, VisibilityStatus, -} from "../../../common/UseHierarchyVisibility.js"; +} from "../../../../shared/UseHierarchyVisibility.js"; import type { ModelsTreeIdsCache } from "../ModelsTreeIdsCache.js"; import type { ModelsTreeSearchTargets } from "./SearchResultsTree.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts similarity index 89% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts index b8790f0081..225a4602ff 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import { defaultIfEmpty, defer, mergeMap } from "rxjs"; -import { createVisibilityStatus } from "../../../common/internal/Tooltip.js"; -import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js"; +import { createVisibilityStatus } from "../../../../shared/internal/Tooltip.js"; +import { BaseVisibilityHelper } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import { mergeVisibilityStatuses } from "../../../../shared/internal/VisibilityUtils.js"; import type { Observable } from "rxjs"; import type { Id64Arg } from "@itwin/core-bentley"; -import type { BaseVisibilityHelperProps } from "../../../common/internal/visibility/BaseVisibilityHelper.js"; -import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js"; +import type { BaseVisibilityHelperProps } from "../../../../shared/internal/visibility/BaseVisibilityHelper.js"; +import type { VisibilityStatus } from "../../../../shared/UseHierarchyVisibility.js"; import type { ModelsTreeIdsCache } from "../ModelsTreeIdsCache.js"; import type { ElementClassGroupingNodeProps } from "../ModelsTreeNodeInternal.js"; import type { ModelsTreeVisibilityHandlerOverrides } from "./ModelsTreeVisibilityHandler.js"; diff --git a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.ts b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/SearchResultsTree.ts similarity index 97% rename from packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.ts rename to packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/SearchResultsTree.ts index cbd00b596a..0dd938d7a6 100644 --- a/packages/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.ts +++ b/packages/tree-widget/src/tree-widget-react/trees/models-tree/internal/visibility/SearchResultsTree.ts @@ -5,25 +5,25 @@ import { firstValueFrom } from "rxjs"; import { assert } from "@itwin/core-bentley"; -import { CLASS_NAME_Category, CLASS_NAME_Model, CLASS_NAME_Subject } from "../../../common/internal/ClassNameDefinitions.js"; -import { getOrCreate, ParentElementsPath } from "../../../common/internal/Utils.js"; +import { CLASS_NAME_Category, CLASS_NAME_Model, CLASS_NAME_Subject } from "../../../../shared/internal/ClassNameDefinitions.js"; +import { getOrCreate, ParentElementsPath } from "../../../../shared/internal/Utils.js"; import { createSearchResultsTree, InternalSearchTargetCategories, InternalSearchTargetElements, SearchResultsNodesHandler, -} from "../../../common/internal/visibility/BaseSearchResultsTree.js"; +} from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; import type { Id64Set, Id64String } from "@itwin/core-bentley"; import type { HierarchySearchTree } from "@itwin/presentation-hierarchies"; import type { EC, ECClassHierarchyInspector } from "@itwin/presentation-shared"; -import type { CategoryId, ElementId } from "../../../common/internal/Types.js"; +import type { CategoryId, ElementId } from "../../../../shared/internal/Types.js"; import type { BaseSearchResultsTreeNode, SearchResultsTree, SearchResultsTreeNodeChildren, SearchResultsTreeRootNode, -} from "../../../common/internal/visibility/BaseSearchResultsTree.js"; +} from "../../../../shared/internal/visibility/BaseSearchResultsTree.js"; import type { ModelsTreeIdsCache } from "../ModelsTreeIdsCache.js"; /** @internal */