@cognite/reveal-components 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/poi-markers/poi-create-cursor.js +4 -0
- package/dist/data-providers/FdmSDK.d.ts +8 -0
- package/dist/data-providers/FdmSDK.js +34 -21
- package/dist/data-providers/assets/createClassicAssetsCache.d.ts +7 -0
- package/dist/data-providers/assets/createClassicAssetsCache.js +18 -0
- package/dist/data-providers/assets/createDmsDescribableNodesCache.d.ts +23 -0
- package/dist/data-providers/assets/createDmsDescribableNodesCache.js +19 -0
- package/dist/data-providers/cache/PointCloudAnnotationCache.js +10 -10
- package/dist/data-providers/cache/annotationModelUtils.js +8 -6
- package/dist/data-providers/cache/cad/CadInstanceMappingsCacheImpl.js +6 -6
- package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.js +11 -11
- package/dist/data-providers/core-dm-provider/filterNodesByMappedTo3d.js +13 -13
- package/dist/data-providers/core-dm-provider/getCadConnectionsForInstances.js +18 -18
- package/dist/data-providers/core-dm-provider/getCadConnectionsForRevisions.js +11 -11
- package/dist/data-providers/core-dm-provider/getCadModelsForInstance.js +3 -3
- package/dist/data-providers/core-dm-provider/getDMSModels.js +6 -6
- package/dist/data-providers/core-dm-provider/getEdgeConnected3dInstances.js +8 -8
- package/dist/data-providers/core-dm-provider/getFdmConnectionsForNodes.js +19 -19
- package/dist/data-providers/core-dm-provider/listMappedFdmNodes.js +14 -14
- package/dist/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.js +3 -3
- package/dist/data-providers/network/cad/searchClassicAssetsForCadModels.js +5 -5
- package/dist/data-providers/network/cad/searchHybridDmAssetsForCadModels.js +3 -3
- package/dist/data-providers/network/common/getDMAssetsForAnnotationReference.js +3 -3
- package/dist/data-providers/utils/getDMSModelRevisionRefs.js +3 -3
- package/dist/domains/annotation360/image360SceneCollectionTransform.d.ts +18 -0
- package/dist/domains/annotation360/image360SceneCollectionTransform.js +37 -0
- package/dist/domains/index.d.ts +2 -1
- package/dist/domains/index.js +3 -2
- package/dist/domains/pointsOfInterest/PointsOfInterestTool.d.ts +5 -0
- package/dist/domains/pointsOfInterest/PointsOfInterestTool.js +36 -17
- package/dist/domains/reveal/RevealDomainObjectUtils.d.ts +1 -0
- package/dist/domains/reveal/RevealDomainObjectUtils.js +1 -1
- package/dist/domains/reveal/cad/CadDomainObject.d.ts +18 -1
- package/dist/domains/reveal/cad/CadDomainObject.js +31 -15
- package/dist/foundation/renderTarget/CdfCaches.d.ts +9 -1
- package/dist/foundation/renderTarget/CdfCaches.js +24 -14
- package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.d.ts +3 -1
- package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.js +33 -22
- package/dist/foundation/treeNodes/cad-tree-node/cad-node-update-styling.js +6 -6
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.js +1 -1
- package/dist/ui/components/InstanceLabel/InstanceLabel.js +18 -30
- package/dist/ui/components/Reveal3DResources/Reveal3DResources.js +20 -20
- package/dist/ui/components/RevealCanvas/SDKProvider.js +6 -6
- package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.d.ts +3 -0
- package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.js +6 -0
- package/dist/ui/components/RevealCanvas/ViewerContext.d.ts +2 -0
- package/dist/ui/components/RevealCanvas/ViewerContext.js +5 -5
- package/dist/ui/components/RevealContext/RevealContext.js +6 -6
- package/dist/ui/components/RevealToolbar/AssetContextualizedButton.js +1 -1
- package/dist/ui/components/RuleBasedOutputs/hooks/useGetDMConnectionWithNodeFromHybridMappingsQuery.js +11 -11
- package/dist/ui/components/Widget/RevealWidget.context.d.ts +2 -1
- package/dist/ui/components/Widget/RevealWidget.context.js +1 -1
- package/dist/ui/components/Widget/RevealWidget.d.ts +11 -2
- package/dist/ui/components/Widget/RevealWidget.js +35 -20
- package/dist/ui/components/Widget/RevealWidgetCameraController.d.ts +3 -1
- package/dist/ui/components/Widget/RevealWidgetCameraController.js +12 -10
- package/dist/ui/components/Widget/RevealWidgetController.d.ts +3 -1
- package/dist/ui/components/Widget/RevealWidgetController.js +40 -33
- package/dist/ui/components/Widget/index.d.ts +1 -1
- package/dist/ui/components/Widget/styling/applyPointCloudInstanceStyling.js +5 -5
- package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.d.ts +21 -0
- package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.js +33 -0
- package/dist/ui/components/commandBased/Factories/DefaultIcons.js +31 -31
- package/dist/ui/components/commandBased/buttons/DropdownButton.d.ts +2 -0
- package/dist/ui/components/commandBased/buttons/DropdownButton.js +67 -48
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.d.ts +13 -2
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.js +17 -9
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.js +21 -20
- package/dist/ui/components/commandBased/treeView/TreeView/components/tree-view-info.js +2 -2
- package/dist/ui/components/commandBased/treeView/TreeView/extraComponents/CadTreeAssetMappingDropdown.js +34 -33
- package/dist/ui/components/commandBased/treeView/TreeView/tree-view-node.js +1 -0
- package/dist/ui/components/commandBased/treeView/TreeView/tree-view-props.d.ts +1 -0
- package/dist/ui/components/commandBased/treeView/TreeView/tree-view.js +27 -25
- package/dist/ui/components/i18n/I18n.js +3 -3
- package/dist/ui/components/index.d.ts +1 -1
- package/dist/ui/hooks/network/fetchLinkFromRelationshipsByTimeseries.js +4 -4
- package/dist/ui/hooks/network/getImage360CollectionsForDmInstance.js +7 -7
- package/dist/ui/hooks/network/getTimeseriesLatestDatapoints.js +3 -3
- package/dist/ui/hooks/pointClouds/fetchAnnotationsForModel.js +4 -4
- package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingForIntersection.js +11 -11
- package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingsForAssetInstances.js +4 -4
- package/dist/ui/hooks/scenes/use3dScenes.js +4 -4
- package/dist/ui/query/core-dm/usePointCloudDMVolumeMappingForIntersection.js +9 -9
- package/dist/ui/query/core-dm/usePointCloudDMVolumes.js +10 -10
- package/dist/ui/query/index.d.ts +1 -0
- package/dist/ui/query/index.js +17 -16
- package/dist/ui/query/useAll3dDirectConnectionsWithProperties.js +6 -6
- package/dist/ui/query/useAssetsAndTimeseriesLinkageDataQuery.js +24 -24
- package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.d.ts +3 -2
- package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.js +4 -4
- package/dist/ui/query/useAssetsAndTimeseriesLinkages.js +13 -13
- package/dist/ui/query/useAssetsByIdsQuery.js +10 -11
- package/dist/ui/query/useFetchClassicAssetsByIds.js +5 -5
- package/dist/ui/query/useFilterOnClassicAssetsInScene.js +6 -6
- package/dist/ui/query/useHybridMappingsForAssetInstances.js +9 -9
- package/dist/ui/query/useInstanceNames.d.ts +11 -0
- package/dist/ui/query/useInstanceNames.js +17 -0
- package/dist/ui/query/useInstancesByIdsQuery.context.d.ts +3 -5
- package/dist/ui/query/useInstancesByIdsQuery.context.js +4 -8
- package/dist/ui/query/useInstancesByIdsQuery.d.ts +9 -6
- package/dist/ui/query/useInstancesByIdsQuery.js +14 -23
- package/dist/ui/query/useNamedDmInstancesByIds.d.ts +12 -0
- package/dist/utilities/cache/ReadonlyEntityCache.d.ts +4 -0
- package/dist/utilities/cache/ReadonlyEntityCache.js +27 -0
- package/dist/utilities/createMixpanelUsageMetricsTracker.d.ts +23 -0
- package/dist/utilities/createMixpanelUsageMetricsTracker.js +23 -0
- package/dist/utilities/externalIndex.d.ts +2 -0
- package/dist/utilities/externalIndex.js +3 -1
- package/dist/utilities/getInstancesFromClick.js +9 -9
- package/dist/utilities/index.d.ts +2 -1
- package/dist/utilities/index.js +12 -9
- package/dist/utilities/signal/useCombinedUpdateSignal.d.ts +9 -0
- package/dist/utilities/signal/useCombinedUpdateSignal.js +14 -0
- package/dist/utilities/signal/useMemoWithUpdateSignal.d.ts +3 -0
- package/dist/utilities/signal/useMemoWithUpdateSignal.js +13 -0
- package/dist/utilities/usageMetricsTracker.d.ts +4 -0
- package/dist/utilities/usageMetricsTracker.js +4 -0
- package/package.json +6 -3
- package/dist/ui/hooks/network/getAssetsByIds.d.ts +0 -2
- package/dist/ui/hooks/network/getAssetsByIds.js +0 -4
- package/dist/ui/query/useDmsInstanceByIdsQuery.d.ts +0 -3
- package/dist/ui/query/useDmsInstanceByIdsQuery.js +0 -18
|
@@ -3,22 +3,25 @@ import { Changes as t } from "../../../foundation/domainObjectsHelpers/Changes.j
|
|
|
3
3
|
import { VIEWER_TO_CDF_TRANSFORMATION as n } from "../../../foundation/renderTarget/convertCoordinates.js";
|
|
4
4
|
import { RevealDomainObject as r } from "../RevealDomainObject.js";
|
|
5
5
|
import { getViewer as i } from "../utils/getViewer.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { clearSelection as a } from "../../../foundation/treeNodes/tree-node/tree-node-functions.js";
|
|
7
|
+
import { CadTreeNode as o } from "../../../foundation/treeNodes/cad-tree-node/cad-tree-node.js";
|
|
8
|
+
import { updateSelectedNodes as s } from "../../../foundation/treeNodes/cad-tree-node/cad-node-update-styling.js";
|
|
9
|
+
import { CadLazyLoader as c } from "../../../foundation/treeNodes/cad-tree-node/cad-lazy-loader.js";
|
|
10
|
+
import { CadTreeNodeViewAdapter as l } from "../../../foundation/treeNodes/cad-tree-node/cad-tree-node-view-adapter.js";
|
|
11
|
+
import { ClassicInstanceMappingsSdk as u } from "../../../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.js";
|
|
12
|
+
import { NodesAndInstanceMappingsSdk as d } from "../../../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/nodes-and-instance-mappings-sdk.js";
|
|
11
13
|
//#region libs/shared/reveal-components/src/domains/reveal/cad/CadDomainObject.ts
|
|
12
|
-
var
|
|
14
|
+
var f = class extends r {
|
|
13
15
|
_model;
|
|
14
16
|
_collections = /* @__PURE__ */ new Map();
|
|
17
|
+
_zoomOnNodeSelect;
|
|
15
18
|
_cadLazyLoader;
|
|
16
19
|
_cadRootLoadState = "idle";
|
|
17
20
|
get model() {
|
|
18
21
|
return this._model;
|
|
19
22
|
}
|
|
20
|
-
constructor(e) {
|
|
21
|
-
super(), this._model = e;
|
|
23
|
+
constructor(e, t) {
|
|
24
|
+
super(), this._model = e, this._zoomOnNodeSelect = t?.zoomOnNodeSelect ?? !0;
|
|
22
25
|
}
|
|
23
26
|
get typeName() {
|
|
24
27
|
return { untranslated: "CAD" };
|
|
@@ -46,7 +49,7 @@ var u = class extends r {
|
|
|
46
49
|
this.loadCadRootOnce(t);
|
|
47
50
|
return;
|
|
48
51
|
}
|
|
49
|
-
for (let e of n.getChildren(t)) e instanceof
|
|
52
|
+
for (let e of n.getChildren(t)) e instanceof o && (yield new l(e, t));
|
|
50
53
|
}
|
|
51
54
|
expandBoundingBox(e) {
|
|
52
55
|
let t = this.model;
|
|
@@ -68,21 +71,34 @@ var u = class extends r {
|
|
|
68
71
|
}
|
|
69
72
|
addStyledNodeCollections(e, t) {
|
|
70
73
|
let n = this.getStyledNodeCollections(e);
|
|
71
|
-
n !== void 0 && n.forEach((e) => this.
|
|
74
|
+
n !== void 0 && n.forEach((e) => this.unassignIfAttached(e.collection)), this._collections.set(e, t), t.forEach((e) => this.model.assignStyledNodeCollection(e.collection, e.appearance, e.importance));
|
|
72
75
|
}
|
|
73
76
|
removeStyledNodeCollections(e) {
|
|
74
77
|
let t = this.getStyledNodeCollections(e);
|
|
75
|
-
t !== void 0 && (t.forEach((e) => this.
|
|
78
|
+
t !== void 0 && (t.forEach((e) => this.unassignIfAttached(e.collection)), this._collections.delete(e));
|
|
79
|
+
}
|
|
80
|
+
isCollectionAttached(e) {
|
|
81
|
+
return this.model.styledNodeCollections.some((t) => t.nodeCollection === e);
|
|
82
|
+
}
|
|
83
|
+
unassignIfAttached(e) {
|
|
84
|
+
this.isCollectionAttached(e) && this.model.unassignStyledNodeCollection(e);
|
|
85
|
+
}
|
|
86
|
+
clearNodeSelection() {
|
|
87
|
+
let e = this._cadLazyLoader?.root;
|
|
88
|
+
e !== void 0 && a(e) && s(this, e);
|
|
76
89
|
}
|
|
77
90
|
getCadLazyLoader() {
|
|
78
91
|
if (this._cadLazyLoader !== void 0) return this._cadLazyLoader;
|
|
79
92
|
let t = e(this)?.sdk;
|
|
80
93
|
if (t === void 0) return;
|
|
81
|
-
let n = new
|
|
82
|
-
return this._cadLazyLoader = new
|
|
94
|
+
let n = new d(t, new u(t));
|
|
95
|
+
return this._cadLazyLoader = new c(n, {
|
|
83
96
|
modelId: this._model.modelId,
|
|
84
97
|
revisionId: this._model.revisionId
|
|
85
|
-
}, {
|
|
98
|
+
}, {
|
|
99
|
+
domainObject: this,
|
|
100
|
+
zoomOnSelect: this._zoomOnNodeSelect
|
|
101
|
+
}), this._cadLazyLoader;
|
|
86
102
|
}
|
|
87
103
|
loadCadRootOnce(e) {
|
|
88
104
|
this._cadRootLoadState === "idle" && (this._cadRootLoadState = "loading", e.loadInitialRoot().catch((e) => {
|
|
@@ -93,4 +109,4 @@ var u = class extends r {
|
|
|
93
109
|
}
|
|
94
110
|
};
|
|
95
111
|
//#endregion
|
|
96
|
-
export {
|
|
112
|
+
export { f as CadDomainObject };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Cognite3DViewer, DataSourceType } from '@cognite/reveal';
|
|
2
|
-
import { CogniteClient } from '@cognite/sdk';
|
|
2
|
+
import { Asset, CogniteInstanceId, IdEither, CogniteClient } from '@cognite/sdk';
|
|
3
|
+
import { DmsDescribableNode } from '../../data-providers/assets/createDmsDescribableNodesCache';
|
|
4
|
+
import { FdmKey } from '../../data-providers/cache';
|
|
3
5
|
import { CadInstanceMappingsCache } from '../../data-providers/cache/cad/CadInstanceMappingsCache';
|
|
4
6
|
import { ClassicCadAssetMappingCache } from '../../data-providers/cache/cad/ClassicCadAssetMappingCache';
|
|
5
7
|
import { FdmCadNodeCache } from '../../data-providers/cache/cad/FdmCadNodeCache';
|
|
6
8
|
import { Image360AnnotationCache } from '../../data-providers/cache/Image360AnnotationCache';
|
|
7
9
|
import { PointCloudAnnotationCache } from '../../data-providers/cache/PointCloudAnnotationCache';
|
|
8
10
|
import { Fdm3dDataProvider } from '../../data-providers/Fdm3dDataProvider';
|
|
11
|
+
import { InstanceReferenceKey } from '../../utilities';
|
|
12
|
+
import { ReadonlyEntityCache } from '../../utilities/cache/ReadonlyEntityCache';
|
|
9
13
|
import { LoadMetricsRecorder } from '../../utilities/loadMetricsParameters';
|
|
10
14
|
import { TrackingDelegate } from '../utilities/types';
|
|
11
15
|
export type CdfCachesOptions = {
|
|
@@ -20,6 +24,8 @@ export declare class CdfCaches {
|
|
|
20
24
|
private readonly _fdmCadNodeCache;
|
|
21
25
|
private readonly _pointCloudAnnotationCache;
|
|
22
26
|
private readonly _image360AnnotationCache;
|
|
27
|
+
private readonly _classicAssetsCache;
|
|
28
|
+
private readonly _dmsDescribableNodeCache;
|
|
23
29
|
private readonly _coreDmOnly;
|
|
24
30
|
private readonly _cogniteClient;
|
|
25
31
|
private readonly _fdm3dDataProvider;
|
|
@@ -31,5 +37,7 @@ export declare class CdfCaches {
|
|
|
31
37
|
get image360Cache(): Image360AnnotationCache;
|
|
32
38
|
get cogniteClient(): CogniteClient;
|
|
33
39
|
get fdm3dDataProvider(): Fdm3dDataProvider | undefined;
|
|
40
|
+
get classicAssetsCache(): ReadonlyEntityCache<IdEither, Asset, InstanceReferenceKey>;
|
|
41
|
+
get dmsDescribableCache(): ReadonlyEntityCache<CogniteInstanceId, DmsDescribableNode, FdmKey>;
|
|
34
42
|
get coreDmOnly(): boolean;
|
|
35
43
|
}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { FdmSDK as e } from "../../data-providers/FdmSDK.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { createClassicAssetsCache as t } from "../../data-providers/assets/createClassicAssetsCache.js";
|
|
3
|
+
import { createDmsDescribableNodesCache as n } from "../../data-providers/assets/createDmsDescribableNodesCache.js";
|
|
4
|
+
import { createCadInstanceMappingsCache as r } from "../../data-providers/cache/cad/CadInstanceMappingsCacheImpl.js";
|
|
5
|
+
import { createClassicCadAssetMappingCache as i } from "../../data-providers/cache/cad/ClassicCadAssetMappingCacheImpl.js";
|
|
6
|
+
import { createFdmCadNodeCache as a } from "../../data-providers/cache/cad/FdmCadNodeCacheImpl.js";
|
|
7
|
+
import { Image360AnnotationCache as o } from "../../data-providers/cache/Image360AnnotationCache.js";
|
|
8
|
+
import { PointCloudAnnotationCache as s } from "../../data-providers/cache/PointCloudAnnotationCache.js";
|
|
9
|
+
import { CoreDm3dFdm3dDataProvider as c } from "../../data-providers/core-dm-provider/CoreDm3dDataProvider.js";
|
|
10
|
+
import { LegacyFdm3dDataProvider as l } from "../../data-providers/legacy-fdm-provider/LegacyFdm3dDataProvider.js";
|
|
9
11
|
//#region libs/shared/reveal-components/src/foundation/renderTarget/CdfCaches.ts
|
|
10
|
-
var
|
|
12
|
+
var u = class {
|
|
11
13
|
_cadMappingsCache;
|
|
12
14
|
_classicCadNodeCache;
|
|
13
15
|
_fdmCadNodeCache;
|
|
14
16
|
_pointCloudAnnotationCache;
|
|
15
17
|
_image360AnnotationCache;
|
|
18
|
+
_classicAssetsCache;
|
|
19
|
+
_dmsDescribableNodeCache;
|
|
16
20
|
_coreDmOnly;
|
|
17
21
|
_cogniteClient;
|
|
18
22
|
_fdm3dDataProvider;
|
|
19
|
-
constructor(
|
|
20
|
-
let
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
+
constructor(u, d, { coreDmOnly: f, enableLegacy3dFdm: p, trackingDelegate: m, featureDataLoadPerformanceMetrics: h }) {
|
|
24
|
+
let g = new e(u, { featureDataLoadPerformanceMetrics: h }), _ = (() => {
|
|
25
|
+
if (f) return new c(g);
|
|
26
|
+
if (p) return new l(g, u, { trackingDelegate: m });
|
|
23
27
|
})();
|
|
24
|
-
this._classicCadNodeCache =
|
|
28
|
+
this._classicCadNodeCache = i(u), this._pointCloudAnnotationCache = new s(u), this._image360AnnotationCache = new o(u, d), _ !== void 0 && (this._fdmCadNodeCache = a(u, _)), this._cadMappingsCache = r(f ? void 0 : this._classicCadNodeCache, this._fdmCadNodeCache), this._cogniteClient = u, this._fdm3dDataProvider = _, this._coreDmOnly = f, this._classicAssetsCache = t(this._cogniteClient), this._dmsDescribableNodeCache = n(g);
|
|
25
29
|
}
|
|
26
30
|
get cadMappingsCache() {
|
|
27
31
|
return this._cadMappingsCache;
|
|
@@ -44,9 +48,15 @@ var c = class {
|
|
|
44
48
|
get fdm3dDataProvider() {
|
|
45
49
|
return this._fdm3dDataProvider;
|
|
46
50
|
}
|
|
51
|
+
get classicAssetsCache() {
|
|
52
|
+
return this._classicAssetsCache;
|
|
53
|
+
}
|
|
54
|
+
get dmsDescribableCache() {
|
|
55
|
+
return this._dmsDescribableNodeCache;
|
|
56
|
+
}
|
|
47
57
|
get coreDmOnly() {
|
|
48
58
|
return this._coreDmOnly;
|
|
49
59
|
}
|
|
50
60
|
};
|
|
51
61
|
//#endregion
|
|
52
|
-
export {
|
|
62
|
+
export { u as CdfCaches };
|
|
@@ -8,6 +8,7 @@ export type CadLazyLoaderOptions = {
|
|
|
8
8
|
showInstanceMappings?: boolean;
|
|
9
9
|
listNodesLimit?: number;
|
|
10
10
|
domainObject?: CadDomainObject;
|
|
11
|
+
zoomOnSelect?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare class CadLazyLoader implements ILazyLoader {
|
|
13
14
|
private readonly _sdk;
|
|
@@ -16,8 +17,9 @@ export declare class CadLazyLoader implements ILazyLoader {
|
|
|
16
17
|
private readonly _listNodesLimit;
|
|
17
18
|
private _showInstanceMappings;
|
|
18
19
|
private readonly _domainObject;
|
|
20
|
+
private readonly _zoomOnSelect;
|
|
19
21
|
get root(): CadTreeNode | undefined;
|
|
20
|
-
constructor(sdk: INodesAndInstanceMappingsSdk, revisionId: RevisionId, { showInstanceMappings, listNodesLimit, domainObject, }?: CadLazyLoaderOptions);
|
|
22
|
+
constructor(sdk: INodesAndInstanceMappingsSdk, revisionId: RevisionId, { showInstanceMappings, listNodesLimit, domainObject, zoomOnSelect, }?: CadLazyLoaderOptions);
|
|
21
23
|
get revisionId(): RevisionId;
|
|
22
24
|
onNodeLoaded(child: TreeNodeType, parent?: TreeNodeType): void;
|
|
23
25
|
loadInitialRoot(): Promise<TreeNodeType>;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { CheckboxState as e } from "../../utilities/types.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { getViewer as t } from "../../../domains/reveal/utils/getViewer.js";
|
|
3
|
+
import { concatenateMapValues as n } from "../../../utilities/map/concatenateMapValues.js";
|
|
4
|
+
import { onSelectNode as r, onToggleNode as i } from "../tree-node/tree-node-functions.js";
|
|
5
|
+
import { CadTreeNode as a } from "./cad-tree-node.js";
|
|
6
|
+
import { updateHiddenNodes as o, updateSelectedNodes as s } from "./cad-node-update-styling.js";
|
|
6
7
|
//#region libs/shared/reveal-components/src/foundation/treeNodes/cad-tree-node/cad-lazy-loader.ts
|
|
7
|
-
var
|
|
8
|
+
var c = class {
|
|
8
9
|
_sdk;
|
|
9
10
|
_revisionId;
|
|
10
11
|
_root;
|
|
11
12
|
_listNodesLimit;
|
|
12
13
|
_showInstanceMappings;
|
|
13
14
|
_domainObject;
|
|
15
|
+
_zoomOnSelect;
|
|
14
16
|
get root() {
|
|
15
17
|
return this._root;
|
|
16
18
|
}
|
|
17
|
-
constructor(e, t, { showInstanceMappings: n = !1, listNodesLimit: r = 100, domainObject: i } = {}) {
|
|
18
|
-
this._sdk = e, this._revisionId = t, this._listNodesLimit = r, this._showInstanceMappings = n, this._domainObject = i;
|
|
19
|
+
constructor(e, t, { showInstanceMappings: n = !1, listNodesLimit: r = 100, domainObject: i, zoomOnSelect: a = !0 } = {}) {
|
|
20
|
+
this._sdk = e, this._revisionId = t, this._listNodesLimit = r, this._showInstanceMappings = n, this._domainObject = i, this._zoomOnSelect = a;
|
|
19
21
|
}
|
|
20
22
|
get revisionId() {
|
|
21
23
|
return this._revisionId;
|
|
@@ -33,7 +35,7 @@ var s = class {
|
|
|
33
35
|
return this._root = n, this._root;
|
|
34
36
|
}
|
|
35
37
|
async loadChildren(e) {
|
|
36
|
-
if (!(e instanceof
|
|
38
|
+
if (!(e instanceof a)) throw Error("Parent node should be a CadTreeNode");
|
|
37
39
|
let t = await this._sdk.list3DNodes(this._revisionId.modelId, this._revisionId.revisionId, {
|
|
38
40
|
depth: 1,
|
|
39
41
|
limit: this._listNodesLimit,
|
|
@@ -48,9 +50,9 @@ var s = class {
|
|
|
48
50
|
return r;
|
|
49
51
|
}
|
|
50
52
|
async loadSiblings(e) {
|
|
51
|
-
if (!(e instanceof
|
|
53
|
+
if (!(e instanceof a)) throw Error("Sibling node should be a CadTreeNode");
|
|
52
54
|
let t = e.parent;
|
|
53
|
-
if (!(t instanceof
|
|
55
|
+
if (!(t instanceof a)) throw Error("Parent of sibling node should be a CadTreeNode");
|
|
54
56
|
let n = await this._sdk.list3DNodes(this._revisionId.modelId, this._revisionId.revisionId, {
|
|
55
57
|
depth: 1,
|
|
56
58
|
limit: this._listNodesLimit,
|
|
@@ -58,12 +60,12 @@ var s = class {
|
|
|
58
60
|
cursor: e.loadSiblingCursor
|
|
59
61
|
}), r = await this.getNodeIdToInstanceMappingMap(n.items);
|
|
60
62
|
n.items = n.items.filter((e) => e.id !== t.nodeId);
|
|
61
|
-
let
|
|
63
|
+
let i = n.items.map((e) => this.createCadTreeNode(e, r));
|
|
62
64
|
if (n.nextCursor !== void 0) {
|
|
63
|
-
let e =
|
|
65
|
+
let e = i[i.length - 1];
|
|
64
66
|
e.loadSiblingCursor = n.nextCursor;
|
|
65
67
|
}
|
|
66
|
-
return
|
|
68
|
+
return i;
|
|
67
69
|
}
|
|
68
70
|
async forceNodeInTree(e) {
|
|
69
71
|
let t = this._root;
|
|
@@ -76,23 +78,23 @@ var s = class {
|
|
|
76
78
|
}) : (n.expandAllAncestors(), n);
|
|
77
79
|
}
|
|
78
80
|
createCadTreeNode(e, t) {
|
|
79
|
-
let
|
|
81
|
+
let n = new a(e, { instanceMappingOptions: this._showInstanceMappings ? {
|
|
80
82
|
instanceMappings: t?.get(e.id) ?? [],
|
|
81
83
|
deleteInstanceMapping: (e) => this.deleteInstanceMapping(e)
|
|
82
84
|
} : void 0 }), c = this._domainObject;
|
|
83
|
-
return c !== void 0 && (
|
|
84
|
-
n
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
}),
|
|
85
|
+
return c !== void 0 && (n.onSelect = () => {
|
|
86
|
+
r(n, !1, !1) && (s(c, n.getRoot()), this._zoomOnSelect && n.isSelected && l(c, n));
|
|
87
|
+
}, n.toggleVisible = () => {
|
|
88
|
+
i(n) && o(c, n.getRoot());
|
|
89
|
+
}), n;
|
|
88
90
|
}
|
|
89
91
|
deleteInstanceMapping(e) {
|
|
90
92
|
return this._sdk.deleteInstanceMapping(this._revisionId.modelId, this._revisionId.revisionId, e);
|
|
91
93
|
}
|
|
92
94
|
async getNodeIdToInstanceMappingMap(e) {
|
|
93
95
|
if (this._showInstanceMappings === !1) return;
|
|
94
|
-
let
|
|
95
|
-
return t
|
|
96
|
+
let t = await this._sdk.filterInstanceMappings(this._revisionId.modelId, this._revisionId.revisionId, e);
|
|
97
|
+
return n(t.items.map((e) => [e.node.nodeId, e]));
|
|
96
98
|
}
|
|
97
99
|
async list3DNodeAncestors(e) {
|
|
98
100
|
return (await this._sdk.list3DNodeAncestors(this._revisionId.modelId, this._revisionId.revisionId, e)).items;
|
|
@@ -113,5 +115,14 @@ var s = class {
|
|
|
113
115
|
return r;
|
|
114
116
|
}
|
|
115
117
|
};
|
|
118
|
+
async function l(e, n) {
|
|
119
|
+
let r = t(e);
|
|
120
|
+
if (r !== void 0) try {
|
|
121
|
+
let t = await e.model.getBoundingBoxByNodeId(n.nodeId);
|
|
122
|
+
r.cameraManager.fitCameraToBoundingBox(t);
|
|
123
|
+
} catch (e) {
|
|
124
|
+
console.error(`Failed to get bounding box for node Id ${JSON.stringify(n.id)}: ${JSON.stringify(e)}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
116
127
|
//#endregion
|
|
117
|
-
export {
|
|
128
|
+
export { c as CadLazyLoader };
|
|
@@ -6,9 +6,9 @@ var o = Symbol("hiddenNodes"), s = Symbol("selectedNodes");
|
|
|
6
6
|
function c(e, t) {
|
|
7
7
|
let s = new r(), c = !1;
|
|
8
8
|
for (let e of u(t)) c = !0, s.addRange(new i(e.treeIndex, e.subtreeSize));
|
|
9
|
-
let l = e.getStyledNodeCollections(o);
|
|
10
|
-
if (l !== void 0 && l
|
|
11
|
-
d(l
|
|
9
|
+
let l = e.getStyledNodeCollections(o)?.[0]?.collection;
|
|
10
|
+
if (l !== void 0 && e.isCollectionAttached(l)) {
|
|
11
|
+
d(l, s, c);
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
if (!c) return;
|
|
@@ -21,9 +21,9 @@ function c(e, t) {
|
|
|
21
21
|
function l(e, o) {
|
|
22
22
|
let c = new r(), l = !1;
|
|
23
23
|
for (let e of o.getThisAndDescendantsByType(t)) e.isSelected && (l = !0, c.addRange(new i(e.treeIndex, e.subtreeSize)));
|
|
24
|
-
let u = e.getStyledNodeCollections(s);
|
|
25
|
-
if (u !== void 0 && u
|
|
26
|
-
d(u
|
|
24
|
+
let u = e.getStyledNodeCollections(s)?.[0]?.collection;
|
|
25
|
+
if (u !== void 0 && e.isCollectionAttached(u)) {
|
|
26
|
+
d(u, c, l);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
if (!l) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isClassicInstanceId as e } from "../../../../utilities/instanceIds/typeGuards.js";
|
|
2
|
-
import { isDefined as t } from "../../../../utilities/isDefined.js";
|
|
3
2
|
import "../../../../utilities/index.js";
|
|
3
|
+
import { isDefined as t } from "../../../../utilities/isDefined.js";
|
|
4
4
|
//#region libs/shared/reveal-components/src/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.ts
|
|
5
5
|
var n = class {
|
|
6
6
|
_sdk;
|
|
@@ -1,37 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createInstanceReferenceKey as e } from "../../../utilities/instanceIds/toKey.js";
|
|
2
2
|
import "../../../utilities/instanceIds/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Tooltip as l, TooltipContent as u, TooltipProvider as d, TooltipTrigger as f } from "@cognite/aura/components/tooltip";
|
|
10
|
-
import { IconHexagon as p } from "@tabler/icons-react";
|
|
11
|
-
import { InputGroup as m, InputGroupAddon as h, InputGroupInput as g } from "@cognite/aura/components/input-group";
|
|
3
|
+
import { useInstanceNames as t } from "../../query/useInstanceNames.js";
|
|
4
|
+
import { useMemo as n } from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { Tooltip as a, TooltipContent as o, TooltipProvider as s, TooltipTrigger as c } from "@cognite/aura/components/tooltip";
|
|
7
|
+
import { IconHexagon as l } from "@tabler/icons-react";
|
|
8
|
+
import { InputGroup as u, InputGroupAddon as d, InputGroupInput as f } from "@cognite/aura/components/input-group";
|
|
12
9
|
//#region libs/shared/reveal-components/src/ui/components/InstanceLabel/InstanceLabel.tsx
|
|
13
|
-
var
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let e = `${n.externalId}/${n.version}`;
|
|
19
|
-
return C[0].properties.cdf_cdm?.[e]?.name ?? C[0].externalId;
|
|
20
|
-
}
|
|
21
|
-
return "Unknown";
|
|
22
|
-
}
|
|
23
|
-
}, [S, C])?.toString(), T = w?.length !== void 0 && w.length > v, E = T ? `${w?.slice(0, v)}...` : w;
|
|
24
|
-
return /* @__PURE__ */ s(d, { children: /* @__PURE__ */ c(l, {
|
|
25
|
-
open: T ? void 0 : !1,
|
|
26
|
-
children: [/* @__PURE__ */ s(f, { render: /* @__PURE__ */ c(m, { children: [/* @__PURE__ */ s(h, {
|
|
10
|
+
var p = 20, m = ({ instance: m }) => {
|
|
11
|
+
let { data: h } = t(n(() => [m], [m])), g = (h?.get(e(m)))?.toString(), _ = g?.length !== void 0 && g.length > p, v = _ ? `${g?.slice(0, p)}...` : g;
|
|
12
|
+
return /* @__PURE__ */ r(s, { children: /* @__PURE__ */ i(a, {
|
|
13
|
+
open: _ ? void 0 : !1,
|
|
14
|
+
children: [/* @__PURE__ */ r(c, { render: /* @__PURE__ */ i(u, { children: [/* @__PURE__ */ r(d, {
|
|
27
15
|
align: "inline-start",
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
}), /* @__PURE__ */
|
|
30
|
-
value:
|
|
16
|
+
children: /* @__PURE__ */ r(l, {})
|
|
17
|
+
}), /* @__PURE__ */ r(f, {
|
|
18
|
+
value: v,
|
|
31
19
|
disabled: !0,
|
|
32
20
|
readOnly: !0
|
|
33
|
-
})] }) }), /* @__PURE__ */
|
|
34
|
-
},
|
|
21
|
+
})] }) }), /* @__PURE__ */ r(o, { children: g })]
|
|
22
|
+
}, g) });
|
|
35
23
|
};
|
|
36
24
|
//#endregion
|
|
37
|
-
export {
|
|
25
|
+
export { m as InstanceLabel };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { is360ImageEventsAddOptions as e, isDM3DModelIdentifier as t } from "../../../utilities/modelIds/typeGuards.js";
|
|
2
|
+
import { convertAndSeparateResources as n, convertAndSeparateToNewResources as r } from "../../../data-providers/types/typeAdapters.js";
|
|
3
|
+
import { getModelKeys as i } from "../../../utilities/getModelKeys.js";
|
|
4
|
+
import { EMPTY_ARRAY as a } from "../../../utilities/constants.js";
|
|
5
5
|
import { use3DResourcesViewModel as o } from "./Reveal3DResources.viewmodel.js";
|
|
6
6
|
import { useEffect as s, useMemo as c } from "react";
|
|
7
7
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region libs/shared/reveal-components/src/ui/components/Reveal3DResources/Reveal3DResources.tsx
|
|
9
9
|
var f = ({ resources: f, defaultResourceStyling: p, instanceStyling: m, mappedCadStylingMode: h = "base", onResourcesAdded: g, onResourceLoadError: _, onResourceIsLoaded: v, image360Settings: y }) => {
|
|
10
|
-
let { CadModelContainer: b, Image360CollectionContainer: x, PointCloudContainer: S, ...C } = o(), w = C.useRenderTarget(), T = C.useReveal(), { modelResources: E, image360Resources: D } = c(() =>
|
|
10
|
+
let { CadModelContainer: b, Image360CollectionContainer: x, PointCloudContainer: S, ...C } = o(), w = C.useRenderTarget(), T = C.useReveal(), { modelResources: E, image360Resources: D } = c(() => r(f), [f]), O = c(() => [...E, ...D], [E, D]), { image360Resources: k } = c(() => n(f), [f]), { data: A } = C.useTypedModels(T, O, _), j = c(() => k.map((e) => ({
|
|
11
11
|
...y,
|
|
12
12
|
...e
|
|
13
13
|
})), [k, y]);
|
|
14
|
-
C.useRemoveNonReferencedModels(A ??
|
|
15
|
-
let M = c(() => A === void 0 ?
|
|
14
|
+
C.useRemoveNonReferencedModels(A ?? a, k, w), C.useSetExpectedLoadCount(O), C.useCallCallbackOnFinishedLoading(O, g);
|
|
15
|
+
let M = c(() => A === void 0 ? a : A.filter((e) => e.type === "cad"), [A]), { styledModels: N, isModelMappingsLoading: P } = C.useCalculateCadStyling(M, m ?? a, p, h), F = C.useReveal3DResourcesStylingLoadingSetter();
|
|
16
16
|
s(() => {
|
|
17
17
|
F(P);
|
|
18
18
|
}, [P, F]);
|
|
19
|
-
let I = C.useCalculatePointCloudStyling(A ??
|
|
19
|
+
let I = C.useCalculatePointCloudStyling(A ?? a, m ?? a, p), L = C.useCalculateImage360Styling(m);
|
|
20
20
|
return /* @__PURE__ */ d(l, { children: [
|
|
21
|
-
N.map(({ styleGroups: e, model:
|
|
21
|
+
N.map(({ styleGroups: e, model: n }, r) => {
|
|
22
22
|
let i = {
|
|
23
|
-
defaultStyle:
|
|
23
|
+
defaultStyle: n.styling?.default ?? p?.cad?.default,
|
|
24
24
|
groups: e
|
|
25
|
-
}, a = n
|
|
25
|
+
}, a = t(n) ? `${n.revisionExternalId}/${n.revisionSpace}/${r}` : `${n.modelId}/${n.revisionId}/${r}`;
|
|
26
26
|
return /* @__PURE__ */ u(b, {
|
|
27
|
-
addModelOptions:
|
|
27
|
+
addModelOptions: n,
|
|
28
28
|
styling: i,
|
|
29
|
-
transform:
|
|
30
|
-
defaultVisible:
|
|
29
|
+
transform: n.transform,
|
|
30
|
+
defaultVisible: n.defaultVisible,
|
|
31
31
|
onLoad: v,
|
|
32
32
|
onLoadError: _
|
|
33
33
|
}, a);
|
|
@@ -36,7 +36,7 @@ var f = ({ resources: f, defaultResourceStyling: p, instanceStyling: m, mappedCa
|
|
|
36
36
|
let r = {
|
|
37
37
|
defaultStyle: t.styling?.default ?? p?.pointcloud?.default,
|
|
38
38
|
groups: e
|
|
39
|
-
},
|
|
39
|
+
}, a = i([t])[0] + `/${n}`;
|
|
40
40
|
return /* @__PURE__ */ u(S, {
|
|
41
41
|
addModelOptions: t,
|
|
42
42
|
styling: r,
|
|
@@ -44,17 +44,17 @@ var f = ({ resources: f, defaultResourceStyling: p, instanceStyling: m, mappedCa
|
|
|
44
44
|
transform: t.transform,
|
|
45
45
|
onLoad: v,
|
|
46
46
|
onLoadError: _
|
|
47
|
-
},
|
|
47
|
+
}, a);
|
|
48
48
|
}),
|
|
49
|
-
j.map((
|
|
49
|
+
j.map((t) => {
|
|
50
50
|
let n = {
|
|
51
51
|
defaultStyle: p?.image360?.default,
|
|
52
52
|
groups: L
|
|
53
|
-
}, r = t
|
|
53
|
+
}, r = e(t) ? t.siteId : `${t.externalId}/${t.space}`;
|
|
54
54
|
return /* @__PURE__ */ u(x, {
|
|
55
|
-
addImage360CollectionOptions:
|
|
55
|
+
addImage360CollectionOptions: t,
|
|
56
56
|
styling: n,
|
|
57
|
-
defaultVisible:
|
|
57
|
+
defaultVisible: t.defaultVisible,
|
|
58
58
|
onLoad: v,
|
|
59
59
|
onLoadError: _
|
|
60
60
|
}, r);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { FdmSDK as e } from "../../../data-providers/FdmSDK.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FeatureDataLoadPerformanceMetricsContext as t } from "./FeatureDataLoadPerformanceMetricsContext.js";
|
|
3
|
+
import { FdmSdkContext as n } from "./FdmDataProviderContext.js";
|
|
4
4
|
import { createContext as r, useContext as i, useMemo as a } from "react";
|
|
5
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
6
|
//#region libs/shared/reveal-components/src/ui/components/RevealCanvas/SDKProvider.tsx
|
|
7
7
|
var s = r(null);
|
|
8
|
-
s.displayName = "CogniteSdkProvider",
|
|
8
|
+
s.displayName = "CogniteSdkProvider", n.displayName = "FdmSdkProvider";
|
|
9
9
|
function c({ sdk: r, children: c }) {
|
|
10
|
-
let l = i(
|
|
10
|
+
let l = i(t), u = a(() => ({ fdmSdk: new e(r, { featureDataLoadPerformanceMetrics: l }) }), [r, l]);
|
|
11
11
|
return /* @__PURE__ */ o(s.Provider, {
|
|
12
12
|
value: r,
|
|
13
|
-
children: /* @__PURE__ */ o(
|
|
13
|
+
children: /* @__PURE__ */ o(n.Provider, {
|
|
14
14
|
value: u,
|
|
15
15
|
children: c
|
|
16
16
|
})
|
|
@@ -24,7 +24,7 @@ var l = (e) => {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
}, u = () => {
|
|
27
|
-
let e = i(
|
|
27
|
+
let e = i(n);
|
|
28
28
|
if (e === null) throw Error("FdmSdkContext not found, add '<SDKProvider value={sdk}>' around your component/app");
|
|
29
29
|
return e.fdmSdk;
|
|
30
30
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { noopUsageMetricsTracker as e } from "../../../utilities/usageMetricsTracker.js";
|
|
2
|
+
import { createContext as t } from "react";
|
|
3
|
+
//#region libs/shared/reveal-components/src/ui/components/RevealCanvas/UsageMetricsTrackerContext.tsx
|
|
4
|
+
var n = t(e);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { n as UsageMetricsTrackerContext };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Context, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { DataSourceType, Cognite3DViewer } from '@cognite/reveal';
|
|
3
|
+
import { CdfCaches } from '../../../foundation/renderTarget/CdfCaches';
|
|
3
4
|
import { RevealRenderTarget } from '../../../foundation/renderTarget/RevealRenderTarget';
|
|
4
5
|
export declare const ViewerContext: Context<RevealRenderTarget | undefined>;
|
|
5
6
|
export type ViewerContextProviderProps = {
|
|
@@ -8,4 +9,5 @@ export type ViewerContextProviderProps = {
|
|
|
8
9
|
};
|
|
9
10
|
export declare const ViewerContextProvider: ({ renderTarget: value, children, }: ViewerContextProviderProps) => ReactElement;
|
|
10
11
|
export declare const useReveal: () => Cognite3DViewer<DataSourceType>;
|
|
12
|
+
export declare const useCdfCaches: () => CdfCaches;
|
|
11
13
|
export declare const useRenderTarget: () => RevealRenderTarget;
|
|
@@ -2,22 +2,22 @@ import { createContext as e, useContext as t, useEffect as n } from "react";
|
|
|
2
2
|
import { remove as r } from "lodash-es";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
//#region libs/shared/reveal-components/src/ui/components/RevealCanvas/ViewerContext.tsx
|
|
5
|
-
var a = e(void 0), o = ({ renderTarget: e, children: t }) => (
|
|
5
|
+
var a = e(void 0), o = ({ renderTarget: e, children: t }) => (d(e ?? void 0), u(e ?? void 0), /* @__PURE__ */ i(a.Provider, {
|
|
6
6
|
value: e,
|
|
7
7
|
children: t
|
|
8
|
-
})), s = () =>
|
|
8
|
+
})), s = () => l().viewer, c = () => l().cdfCaches, l = () => {
|
|
9
9
|
let e = t(a);
|
|
10
10
|
if (e === void 0) throw Error("useRenderTarget must be used within a ViewerProvider");
|
|
11
11
|
return e;
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function u(e) {
|
|
14
14
|
n(() => {
|
|
15
15
|
if (e !== void 0) return window.renderTargets === void 0 ? window.renderTargets = [e] : window.renderTargets.push(e), () => {
|
|
16
16
|
window.renderTargets !== void 0 && r(window.renderTargets, (t) => t === e);
|
|
17
17
|
};
|
|
18
18
|
}, [e]);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function d(e) {
|
|
21
21
|
n(() => {
|
|
22
22
|
if (e !== void 0 && window.renderTarget === void 0 && window.viewer === void 0) return window.renderTarget = e, window.viewer = e.viewer, () => {
|
|
23
23
|
window.renderTarget?.viewer === e.viewer && (window.viewer = void 0), window.renderTarget === e && (window.renderTarget = void 0);
|
|
@@ -25,4 +25,4 @@ function u(e) {
|
|
|
25
25
|
}, [e]);
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
|
-
export { a as ViewerContext, o as ViewerContextProvider, c as useRenderTarget, s as useReveal };
|
|
28
|
+
export { a as ViewerContext, o as ViewerContextProvider, c as useCdfCaches, l as useRenderTarget, s as useReveal };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ViewerContextProvider as e } from "../RevealCanvas/ViewerContext.js";
|
|
2
2
|
import { I18nContextProvider as t } from "../i18n/I18n.js";
|
|
3
3
|
import { Reveal3DResourcesInfoContextProvider as n } from "../Reveal3DResources/Reveal3DResourcesInfoContext.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { ComponentFactoryContextProvider as r } from "../RevealCanvas/ComponentFactoryContext.js";
|
|
5
|
+
import { FeatureDataLoadPerformanceMetricsContext as i } from "../RevealCanvas/FeatureDataLoadPerformanceMetricsContext.js";
|
|
6
|
+
import { SDKProvider as a } from "../RevealCanvas/SDKProvider.js";
|
|
7
7
|
import { useRevealKeepAlive as o } from "../RevealKeepAlive/RevealKeepAliveContext.js";
|
|
8
8
|
import { LoadedSceneProvider as s } from "../SceneContainer/LoadedSceneContext.js";
|
|
9
9
|
import { RevealContextDepsContext as c } from "./RevealContext.context.js";
|
|
@@ -13,15 +13,15 @@ import { QueryClient as g, QueryClientProvider as _ } from "@tanstack/react-quer
|
|
|
13
13
|
//#region libs/shared/reveal-components/src/ui/components/RevealContext/RevealContext.tsx
|
|
14
14
|
var v = (o) => {
|
|
15
15
|
let c = b(o), l = d(() => new g({ defaultOptions: { queries: { refetchOnWindowFocus: !1 } } }), []);
|
|
16
|
-
return c === null ? /* @__PURE__ */ m(p, {}) : /* @__PURE__ */ m(
|
|
16
|
+
return c === null ? /* @__PURE__ */ m(p, {}) : /* @__PURE__ */ m(i.Provider, {
|
|
17
17
|
value: o.featureDataLoadPerformanceMetrics,
|
|
18
|
-
children: /* @__PURE__ */ m(
|
|
18
|
+
children: /* @__PURE__ */ m(a, {
|
|
19
19
|
sdk: o.sdk,
|
|
20
20
|
children: /* @__PURE__ */ m(_, {
|
|
21
21
|
client: l,
|
|
22
22
|
children: /* @__PURE__ */ m(t, {
|
|
23
23
|
appLanguage: o.appLanguage,
|
|
24
|
-
children: /* @__PURE__ */ m(s, { children: /* @__PURE__ */ m(
|
|
24
|
+
children: /* @__PURE__ */ m(s, { children: /* @__PURE__ */ m(r, { children: /* @__PURE__ */ h(e, {
|
|
25
25
|
renderTarget: c,
|
|
26
26
|
children: [/* @__PURE__ */ m(y, {
|
|
27
27
|
cameraState: o.cameraState,
|