@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.
Files changed (122) hide show
  1. package/dist/assets/poi-markers/poi-create-cursor.js +4 -0
  2. package/dist/data-providers/FdmSDK.d.ts +8 -0
  3. package/dist/data-providers/FdmSDK.js +34 -21
  4. package/dist/data-providers/assets/createClassicAssetsCache.d.ts +7 -0
  5. package/dist/data-providers/assets/createClassicAssetsCache.js +18 -0
  6. package/dist/data-providers/assets/createDmsDescribableNodesCache.d.ts +23 -0
  7. package/dist/data-providers/assets/createDmsDescribableNodesCache.js +19 -0
  8. package/dist/data-providers/cache/PointCloudAnnotationCache.js +10 -10
  9. package/dist/data-providers/cache/annotationModelUtils.js +8 -6
  10. package/dist/data-providers/cache/cad/CadInstanceMappingsCacheImpl.js +6 -6
  11. package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.js +11 -11
  12. package/dist/data-providers/core-dm-provider/filterNodesByMappedTo3d.js +13 -13
  13. package/dist/data-providers/core-dm-provider/getCadConnectionsForInstances.js +18 -18
  14. package/dist/data-providers/core-dm-provider/getCadConnectionsForRevisions.js +11 -11
  15. package/dist/data-providers/core-dm-provider/getCadModelsForInstance.js +3 -3
  16. package/dist/data-providers/core-dm-provider/getDMSModels.js +6 -6
  17. package/dist/data-providers/core-dm-provider/getEdgeConnected3dInstances.js +8 -8
  18. package/dist/data-providers/core-dm-provider/getFdmConnectionsForNodes.js +19 -19
  19. package/dist/data-providers/core-dm-provider/listMappedFdmNodes.js +14 -14
  20. package/dist/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.js +3 -3
  21. package/dist/data-providers/network/cad/searchClassicAssetsForCadModels.js +5 -5
  22. package/dist/data-providers/network/cad/searchHybridDmAssetsForCadModels.js +3 -3
  23. package/dist/data-providers/network/common/getDMAssetsForAnnotationReference.js +3 -3
  24. package/dist/data-providers/utils/getDMSModelRevisionRefs.js +3 -3
  25. package/dist/domains/annotation360/image360SceneCollectionTransform.d.ts +18 -0
  26. package/dist/domains/annotation360/image360SceneCollectionTransform.js +37 -0
  27. package/dist/domains/index.d.ts +2 -1
  28. package/dist/domains/index.js +3 -2
  29. package/dist/domains/pointsOfInterest/PointsOfInterestTool.d.ts +5 -0
  30. package/dist/domains/pointsOfInterest/PointsOfInterestTool.js +36 -17
  31. package/dist/domains/reveal/RevealDomainObjectUtils.d.ts +1 -0
  32. package/dist/domains/reveal/RevealDomainObjectUtils.js +1 -1
  33. package/dist/domains/reveal/cad/CadDomainObject.d.ts +18 -1
  34. package/dist/domains/reveal/cad/CadDomainObject.js +31 -15
  35. package/dist/foundation/renderTarget/CdfCaches.d.ts +9 -1
  36. package/dist/foundation/renderTarget/CdfCaches.js +24 -14
  37. package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.d.ts +3 -1
  38. package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.js +33 -22
  39. package/dist/foundation/treeNodes/cad-tree-node/cad-node-update-styling.js +6 -6
  40. package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.js +1 -1
  41. package/dist/ui/components/InstanceLabel/InstanceLabel.js +18 -30
  42. package/dist/ui/components/Reveal3DResources/Reveal3DResources.js +20 -20
  43. package/dist/ui/components/RevealCanvas/SDKProvider.js +6 -6
  44. package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.d.ts +3 -0
  45. package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.js +6 -0
  46. package/dist/ui/components/RevealCanvas/ViewerContext.d.ts +2 -0
  47. package/dist/ui/components/RevealCanvas/ViewerContext.js +5 -5
  48. package/dist/ui/components/RevealContext/RevealContext.js +6 -6
  49. package/dist/ui/components/RevealToolbar/AssetContextualizedButton.js +1 -1
  50. package/dist/ui/components/RuleBasedOutputs/hooks/useGetDMConnectionWithNodeFromHybridMappingsQuery.js +11 -11
  51. package/dist/ui/components/Widget/RevealWidget.context.d.ts +2 -1
  52. package/dist/ui/components/Widget/RevealWidget.context.js +1 -1
  53. package/dist/ui/components/Widget/RevealWidget.d.ts +11 -2
  54. package/dist/ui/components/Widget/RevealWidget.js +35 -20
  55. package/dist/ui/components/Widget/RevealWidgetCameraController.d.ts +3 -1
  56. package/dist/ui/components/Widget/RevealWidgetCameraController.js +12 -10
  57. package/dist/ui/components/Widget/RevealWidgetController.d.ts +3 -1
  58. package/dist/ui/components/Widget/RevealWidgetController.js +40 -33
  59. package/dist/ui/components/Widget/index.d.ts +1 -1
  60. package/dist/ui/components/Widget/styling/applyPointCloudInstanceStyling.js +5 -5
  61. package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.d.ts +21 -0
  62. package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.js +33 -0
  63. package/dist/ui/components/commandBased/Factories/DefaultIcons.js +31 -31
  64. package/dist/ui/components/commandBased/buttons/DropdownButton.d.ts +2 -0
  65. package/dist/ui/components/commandBased/buttons/DropdownButton.js +67 -48
  66. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.d.ts +13 -2
  67. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.js +17 -9
  68. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.js +21 -20
  69. package/dist/ui/components/commandBased/treeView/TreeView/components/tree-view-info.js +2 -2
  70. package/dist/ui/components/commandBased/treeView/TreeView/extraComponents/CadTreeAssetMappingDropdown.js +34 -33
  71. package/dist/ui/components/commandBased/treeView/TreeView/tree-view-node.js +1 -0
  72. package/dist/ui/components/commandBased/treeView/TreeView/tree-view-props.d.ts +1 -0
  73. package/dist/ui/components/commandBased/treeView/TreeView/tree-view.js +27 -25
  74. package/dist/ui/components/i18n/I18n.js +3 -3
  75. package/dist/ui/components/index.d.ts +1 -1
  76. package/dist/ui/hooks/network/fetchLinkFromRelationshipsByTimeseries.js +4 -4
  77. package/dist/ui/hooks/network/getImage360CollectionsForDmInstance.js +7 -7
  78. package/dist/ui/hooks/network/getTimeseriesLatestDatapoints.js +3 -3
  79. package/dist/ui/hooks/pointClouds/fetchAnnotationsForModel.js +4 -4
  80. package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingForIntersection.js +11 -11
  81. package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingsForAssetInstances.js +4 -4
  82. package/dist/ui/hooks/scenes/use3dScenes.js +4 -4
  83. package/dist/ui/query/core-dm/usePointCloudDMVolumeMappingForIntersection.js +9 -9
  84. package/dist/ui/query/core-dm/usePointCloudDMVolumes.js +10 -10
  85. package/dist/ui/query/index.d.ts +1 -0
  86. package/dist/ui/query/index.js +17 -16
  87. package/dist/ui/query/useAll3dDirectConnectionsWithProperties.js +6 -6
  88. package/dist/ui/query/useAssetsAndTimeseriesLinkageDataQuery.js +24 -24
  89. package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.d.ts +3 -2
  90. package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.js +4 -4
  91. package/dist/ui/query/useAssetsAndTimeseriesLinkages.js +13 -13
  92. package/dist/ui/query/useAssetsByIdsQuery.js +10 -11
  93. package/dist/ui/query/useFetchClassicAssetsByIds.js +5 -5
  94. package/dist/ui/query/useFilterOnClassicAssetsInScene.js +6 -6
  95. package/dist/ui/query/useHybridMappingsForAssetInstances.js +9 -9
  96. package/dist/ui/query/useInstanceNames.d.ts +11 -0
  97. package/dist/ui/query/useInstanceNames.js +17 -0
  98. package/dist/ui/query/useInstancesByIdsQuery.context.d.ts +3 -5
  99. package/dist/ui/query/useInstancesByIdsQuery.context.js +4 -8
  100. package/dist/ui/query/useInstancesByIdsQuery.d.ts +9 -6
  101. package/dist/ui/query/useInstancesByIdsQuery.js +14 -23
  102. package/dist/ui/query/useNamedDmInstancesByIds.d.ts +12 -0
  103. package/dist/utilities/cache/ReadonlyEntityCache.d.ts +4 -0
  104. package/dist/utilities/cache/ReadonlyEntityCache.js +27 -0
  105. package/dist/utilities/createMixpanelUsageMetricsTracker.d.ts +23 -0
  106. package/dist/utilities/createMixpanelUsageMetricsTracker.js +23 -0
  107. package/dist/utilities/externalIndex.d.ts +2 -0
  108. package/dist/utilities/externalIndex.js +3 -1
  109. package/dist/utilities/getInstancesFromClick.js +9 -9
  110. package/dist/utilities/index.d.ts +2 -1
  111. package/dist/utilities/index.js +12 -9
  112. package/dist/utilities/signal/useCombinedUpdateSignal.d.ts +9 -0
  113. package/dist/utilities/signal/useCombinedUpdateSignal.js +14 -0
  114. package/dist/utilities/signal/useMemoWithUpdateSignal.d.ts +3 -0
  115. package/dist/utilities/signal/useMemoWithUpdateSignal.js +13 -0
  116. package/dist/utilities/usageMetricsTracker.d.ts +4 -0
  117. package/dist/utilities/usageMetricsTracker.js +4 -0
  118. package/package.json +6 -3
  119. package/dist/ui/hooks/network/getAssetsByIds.d.ts +0 -2
  120. package/dist/ui/hooks/network/getAssetsByIds.js +0 -4
  121. package/dist/ui/query/useDmsInstanceByIdsQuery.d.ts +0 -3
  122. package/dist/ui/query/useDmsInstanceByIdsQuery.js +0 -18
@@ -1,12 +1,12 @@
1
- import { createDmsQueryDataAccumulator as e } from "../../utilities/dms-cursoring/dmsAccumulator.js";
2
- import { COGNITE_VISUALIZABLE_SOURCE as t } from "./dataModels.js";
1
+ import { COGNITE_VISUALIZABLE_SOURCE as e } from "./dataModels.js";
2
+ import { createDmsQueryDataAccumulator as t } from "../../utilities/dms-cursoring/dmsAccumulator.js";
3
3
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getEdgeConnected3dInstances.ts
4
- async function n(t, n, i = e) {
4
+ async function n(e, n, i = t) {
5
5
  return (await i(n, {
6
6
  ...r,
7
7
  parameters: {
8
- instanceExternalId: t.externalId,
9
- instanceSpace: t.space
8
+ instanceExternalId: e.externalId,
9
+ instanceSpace: e.space
10
10
  }
11
11
  }, { serial: [
12
12
  "start_instance",
@@ -39,8 +39,8 @@ var r = {
39
39
  from: "start_to_object_edges",
40
40
  chainTo: "destination",
41
41
  filter: { exists: { property: [
42
- t.space,
43
- t.externalId,
42
+ e.space,
43
+ e.externalId,
44
44
  "object3D"
45
45
  ] } }
46
46
  } },
@@ -48,7 +48,7 @@ var r = {
48
48
  nodes: {
49
49
  from: "objects_connected_with_3d",
50
50
  through: {
51
- view: t,
51
+ view: e,
52
52
  identifier: "object3D"
53
53
  }
54
54
  },
@@ -3,39 +3,39 @@ import { isSameDmsId as t } from "../../utilities/instanceIds/equality.js";
3
3
  import { createFdmKey as n } from "../cache/idAndKeyTranslation.js";
4
4
  import "../../utilities/instanceIds/index.js";
5
5
  import { restrictToDmsId as r } from "../../utilities/restrictToDmsId.js";
6
- import { createDmsQueryDataAccumulator as i } from "../../utilities/dms-cursoring/dmsAccumulator.js";
7
- import { COGNITE_ASSET_SOURCE as a, COGNITE_CAD_NODE_SOURCE as o, COGNITE_CAD_NODE_VIEW_VERSION_KEY as s, COGNITE_VISUALIZABLE_SOURCE as c, COGNITE_VISUALIZABLE_VIEW_VERSION_KEY as l, CORE_DM_3D_CONTAINER_SPACE as u, CORE_DM_SPACE as d } from "./dataModels.js";
6
+ import { COGNITE_ASSET_SOURCE as i, COGNITE_CAD_NODE_SOURCE as a, COGNITE_CAD_NODE_VIEW_VERSION_KEY as o, COGNITE_VISUALIZABLE_SOURCE as s, COGNITE_VISUALIZABLE_VIEW_VERSION_KEY as c, CORE_DM_3D_CONTAINER_SPACE as l, CORE_DM_SPACE as u } from "./dataModels.js";
7
+ import { createDmsQueryDataAccumulator as d } from "../../utilities/dms-cursoring/dmsAccumulator.js";
8
8
  import { cadNodeHasObject3DFilter as f } from "./utils/filters.js";
9
9
  import { getCadConnectionFieldsForRevision as p } from "../utils/cadNodeConnectionFields.js";
10
10
  import { getModelIdFromExternalId as m } from "./getCdfIdFromExternalId.js";
11
11
  import { cogniteCadNodeSourceWithProperties as h } from "./cogniteCadNodeSourceWithProperties.js";
12
12
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getFdmConnectionsForNodes.ts
13
- async function g(a, o, c, u, f, h = i) {
14
- let g = u.map((e) => e.treeIndex), v = new Set(g), y = /* @__PURE__ */ new Map(), b = {
13
+ async function g(i, a, s, l, f, h = d) {
14
+ let g = l.map((e) => e.treeIndex), v = new Set(g), y = /* @__PURE__ */ new Map(), b = {
15
15
  ..._,
16
16
  parameters: {
17
- modelReference: r(a),
17
+ modelReference: r(i),
18
18
  treeIndexes: g,
19
- revisionRefs: [r(o)]
19
+ revisionRefs: [r(a)]
20
20
  }
21
- }, x = m(a.externalId), S = await h(f, b, { serial: [
21
+ }, x = m(i.externalId), S = await h(f, b, { serial: [
22
22
  "cad_nodes",
23
23
  "objects_3d",
24
24
  "assets"
25
25
  ] }).accumulateAllData();
26
26
  S.items.cad_nodes.filter((t) => e(t.properties.cdf_cdm["CogniteCADNode/v1"].object3D)).forEach((e) => {
27
- let n = e.properties[d][s], r = n.revisions.findIndex((e) => t(e, o)), i = n.treeIndexes[r];
27
+ let n = e.properties[u][o], r = n.revisions.findIndex((e) => t(e, a)), i = n.treeIndexes[r];
28
28
  v.has(i) && y.set(i, {
29
29
  props: n,
30
30
  revisionIndex: r
31
31
  });
32
32
  });
33
- let C = new Map(S.items.assets.map((e) => [n(e.properties[d][l].object3D), e])), w = [];
33
+ let C = new Map(S.items.assets.map((e) => [n(e.properties[u][c].object3D), e])), w = [];
34
34
  return [...y.entries()].forEach(([e, { props: t, revisionIndex: r }]) => {
35
35
  let i = n(t.object3D), a = C.get(i);
36
36
  a !== void 0 && w.push({
37
37
  modelId: x,
38
- revisionId: c,
38
+ revisionId: s,
39
39
  treeIndex: e,
40
40
  instance: a,
41
41
  ...p(t, r)
@@ -47,24 +47,24 @@ var _ = {
47
47
  cad_nodes: { nodes: { filter: { and: [
48
48
  { equals: {
49
49
  property: [
50
- u,
51
- o.externalId,
50
+ l,
51
+ a.externalId,
52
52
  "model3D"
53
53
  ],
54
54
  value: { parameter: "modelReference" }
55
55
  } },
56
56
  { containsAny: {
57
57
  property: [
58
- u,
59
- o.externalId,
58
+ l,
59
+ a.externalId,
60
60
  "treeIndexes"
61
61
  ],
62
62
  values: { parameter: "treeIndexes" }
63
63
  } },
64
64
  { containsAny: {
65
65
  property: [
66
- u,
67
- o.externalId,
66
+ l,
67
+ a.externalId,
68
68
  "revisions"
69
69
  ],
70
70
  values: { parameter: "revisionRefs" }
@@ -74,7 +74,7 @@ var _ = {
74
74
  objects_3d: { nodes: {
75
75
  from: "cad_nodes",
76
76
  through: {
77
- view: o,
77
+ view: a,
78
78
  identifier: "object3D"
79
79
  },
80
80
  direction: "outwards"
@@ -82,7 +82,7 @@ var _ = {
82
82
  assets: { nodes: {
83
83
  from: "objects_3d",
84
84
  through: {
85
- view: a,
85
+ view: i,
86
86
  identifier: "object3D"
87
87
  },
88
88
  direction: "inwards"
@@ -91,7 +91,7 @@ var _ = {
91
91
  select: {
92
92
  cad_nodes: { sources: h },
93
93
  assets: { sources: [{
94
- source: c,
94
+ source: s,
95
95
  properties: ["object3D"]
96
96
  }] },
97
97
  objects_3d: {}
@@ -1,8 +1,8 @@
1
1
  import { isDmsInstance as e } from "../../utilities/instanceIds/typeGuards.js";
2
2
  import "../../utilities/instanceIds/index.js";
3
3
  import { makeSureNonEmptyFilterForRequest as t } from "../FdmSDK.js";
4
- import { createDmsQueryDataAccumulator as n } from "../../utilities/dms-cursoring/dmsAccumulator.js";
5
- import { COGNITE_CAD_NODE_SOURCE as r } from "./dataModels.js";
4
+ import { COGNITE_CAD_NODE_SOURCE as n } from "./dataModels.js";
5
+ import { createDmsQueryDataAccumulator as r } from "../../utilities/dms-cursoring/dmsAccumulator.js";
6
6
  import { cadVisualizableQueryPayload as i, image360VisualizableQueryPayload as a, pointCloudsVisualizablesQueryPayload as o } from "./cadAndPointCloudAndImage360VisualizableQuery.js";
7
7
  import { uniqBy as s } from "lodash-es";
8
8
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/listMappedFdmNodes.ts
@@ -23,32 +23,32 @@ async function u(e, n, r, i, a) {
23
23
  let o = t(r), s = e.cad.length > 0 ? await d(n, e.cad, o, i, a) : [], c = e.pointCloud.length > 0 ? await f(n, e.pointCloud, o, i, a) : [], l = e.image360.length > 0 ? await p(n, e.image360, o, i, a) : [];
24
24
  return s.concat(c).concat(l);
25
25
  }
26
- async function d(e, t, r, a, o) {
26
+ async function d(e, t, n, a, o) {
27
27
  let s = {
28
- ...i(e, r, o.pageSize),
28
+ ...i(e, n, o.pageSize),
29
29
  parameters: { revisionRefs: t }
30
- }, c = n(a, s, { serial: ["cad_nodes", "cad_visualizables"] }), l = o.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext();
30
+ }, c = r(a, s, { serial: ["cad_nodes", "cad_visualizables"] }), l = o.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext();
31
31
  return m(e, l.items.cad_visualizables, l.items.cad_nodes);
32
32
  }
33
- async function f(e, t, r, i, a) {
33
+ async function f(e, t, n, i, a) {
34
34
  let s = {
35
- ...o(e, r, a.pageSize),
35
+ ...o(e, n, a.pageSize),
36
36
  parameters: { revisionRefs: t }
37
- }, c = n(i, s, { serial: ["pointcloud_volumes", "pointcloud_visualizables"] });
37
+ }, c = r(i, s, { serial: ["pointcloud_volumes", "pointcloud_visualizables"] });
38
38
  return (a.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext()).items.pointcloud_visualizables;
39
39
  }
40
- async function p(e, t, r, i, o) {
40
+ async function p(e, t, n, i, o) {
41
41
  let s = {
42
- ...a(e, t, r, o.pageSize),
42
+ ...a(e, t, n, o.pageSize),
43
43
  parameters: { revisionRefs: t }
44
- }, c = n(i, s, { serial: ["image360_collections", "image360_visualizables"] });
44
+ }, c = r(i, s, { serial: ["image360_collections", "image360_visualizables"] });
45
45
  return (o.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext()).items.image360_visualizables;
46
46
  }
47
- function m(t, n, i) {
47
+ function m(t, r, i) {
48
48
  let a = [];
49
49
  return i.forEach((i) => {
50
- let o = i.properties[r.space][`${r.externalId}/${r.version}`]?.object3D;
51
- e(o) && n.forEach((n) => {
50
+ let o = i.properties[n.space][`${n.externalId}/${n.version}`]?.object3D;
51
+ e(o) && r.forEach((n) => {
52
52
  t.forEach((t) => {
53
53
  let r = n.properties[t.space][`${t.externalId}/${t.version}`], i = e(r?.object3D) ? r?.object3D : void 0;
54
54
  i !== void 0 && o.externalId === i.externalId && o.space === i.space && a.push(n);
@@ -1,13 +1,13 @@
1
1
  import { createModelRevisionKey as e, revisionKeyToIds as t } from "../cache/idAndKeyTranslation.js";
2
- import { executeParallel as n } from "../../utilities/executeParallel.js";
3
- import { isDefined as r } from "../../utilities/isDefined.js";
2
+ import { isDefined as n } from "../../utilities/isDefined.js";
3
+ import { executeParallel as r } from "../../utilities/executeParallel.js";
4
4
  import { nodeIdsToTreeIndices as i } from "../cache/requests.js";
5
5
  import { chunk as a } from "lodash-es";
6
6
  //#region libs/shared/reveal-components/src/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.ts
7
7
  var o = 2;
8
8
  async function s(e, t) {
9
9
  let i = c(e);
10
- return (await n([...i.entries()].map(([e, n]) => async () => await l(e, n, t)), o)).flat().filter(r);
10
+ return (await r([...i.entries()].map(([e, n]) => async () => await l(e, n, t)), o)).flat().filter(n);
11
11
  }
12
12
  function c(t) {
13
13
  return t.reduce((t, n) => {
@@ -1,6 +1,6 @@
1
1
  import { createModelRevisionKey as e } from "../../cache/idAndKeyTranslation.js";
2
- import { executeParallel as t } from "../../../utilities/executeParallel.js";
3
- import { isDefined as n } from "../../../utilities/isDefined.js";
2
+ import { isDefined as t } from "../../../utilities/isDefined.js";
3
+ import { executeParallel as n } from "../../../utilities/executeParallel.js";
4
4
  import { isClassicCadAssetMapping as r } from "../../cache/cad/assetMappingTypes.js";
5
5
  import { fetchAssetPage as i } from "./fetchAllAssetsForCadModels.js";
6
6
  //#region libs/shared/reveal-components/src/data-providers/network/cad/searchClassicAssetsForCadModels.ts
@@ -45,7 +45,7 @@ async function l(e, t, n, r, i, a, o, s = 10, c = 20) {
45
45
  };
46
46
  }
47
47
  async function u(i, o, s) {
48
- let c = (await t(i.map((t) => async () => {
48
+ let c = (await n(i.map((t) => async () => {
49
49
  let n = e(t.modelId, t.revisionId), r = s?.find((e) => e.modelRevisionKey === n);
50
50
  if (s !== void 0 && r === void 0) return;
51
51
  let { mappings: i, nextCursor: a } = await o.getAssetMappingsForModelPage(t.modelId, t.revisionId, r?.cursor);
@@ -56,7 +56,7 @@ async function u(i, o, s) {
56
56
  cursor: a
57
57
  }
58
58
  };
59
- }), a)).filter(n), l = c.map((e) => e.nextCursorEntry).filter(n);
59
+ }), a)).filter(t), l = c.map((e) => e.nextCursorEntry).filter(t);
60
60
  return {
61
61
  assetIds: c.flatMap((e) => e.mappings.filter(r).map((e) => e.assetId)),
62
62
  modelKeyWithCursors: l.length > 0 ? l : void 0
@@ -79,7 +79,7 @@ async function d(e, t, n, r) {
79
79
  }
80
80
  async function f(e, r, i) {
81
81
  let o = await p(i, r);
82
- return (await t(e.map((e) => async () => m(i, e.modelId, e.revisionId)), a)).filter(n).reduce((e, t) => e + t, 0) <= o ? "scanFromAssetMappings" : "scanFromAsset";
82
+ return (await n(e.map((e) => async () => m(i, e.modelId, e.revisionId)), a)).filter(t).reduce((e, t) => e + t, 0) <= o ? "scanFromAssetMappings" : "scanFromAsset";
83
83
  }
84
84
  async function p(e, t) {
85
85
  return (await e.post(`/api/v1/projects/${e.project}/assets/aggregate`, { data: {
@@ -9,11 +9,11 @@ async function a(e, t, n, r, a, s, c = i) {
9
9
  return (n.query === void 0 || n.query === "") && n.filter === void 0 ? await o(e, n.limit ?? 1e3, t, r) : await l(e, a, s);
10
10
  }
11
11
  async function o(r, i, a, o) {
12
- let s = await n("dm", r, i, void 0, o), c = new e(o), l = s.items.flatMap((e) => e.mappings.items.map((e) => e.instanceId));
13
- return (await c.getByExternalIds(l.map((e) => ({
12
+ let s = await n("dm", r, i, void 0, o), c = new e(o), l = s.items.flatMap((e) => e.mappings.items.map((e) => e.instanceId)), { items: u } = await c.getByExternalIds(l.map((e) => ({
14
13
  ...e,
15
14
  instanceType: "node"
16
- })), [t(a)])).items;
15
+ })), [t(a)]);
16
+ return u;
17
17
  }
18
18
  //#endregion
19
19
  export { a as searchHybridDmAssetsForCadModels };
@@ -4,12 +4,12 @@ import { uniqBy as i } from "lodash-es";
4
4
  //#region libs/shared/reveal-components/src/data-providers/network/common/getDMAssetsForAnnotationReference.ts
5
5
  async function a(a, o) {
6
6
  if (a.length === 0) return [];
7
- let s = i(a, e);
8
- return (await o.getByExternalIds(s.filter((e) => e.sources.some((e) => e.externalId === t.externalId && e.space === t.space && e.version === t.version)).map((e) => ({
7
+ let s = i(a, e), { items: c } = await o.getByExternalIds(s.filter((e) => e.sources.some((e) => e.externalId === t.externalId && e.space === t.space && e.version === t.version)).map((e) => ({
9
8
  externalId: e.externalId,
10
9
  space: e.space,
11
10
  instanceType: e.instanceType
12
- })), [t])).items.map((e) => ({
11
+ })), [t]);
12
+ return c.map((e) => ({
13
13
  ...e,
14
14
  properties: e.properties[r][n]
15
15
  }));
@@ -1,9 +1,9 @@
1
- import { executeParallel as e } from "../../utilities/executeParallel.js";
2
- import { isDefined as t } from "../../utilities/isDefined.js";
1
+ import { isDefined as e } from "../../utilities/isDefined.js";
2
+ import { executeParallel as t } from "../../utilities/executeParallel.js";
3
3
  import { getDMSModels as n } from "../core-dm-provider/getDMSModels.js";
4
4
  import { getDMSRevision as r } from "../core-dm-provider/getDMSRevision.js";
5
5
  async function i(n, i, a) {
6
- return (await e(i.map((e, t) => async () => n[t] === void 0 ? void 0 : await r(n[t], e, a)), 2)).filter(t);
6
+ return (await t(i.map((e, t) => async () => n[t] === void 0 ? void 0 : await r(n[t], e, a)), 2)).filter(e);
7
7
  }
8
8
  async function a(e, t) {
9
9
  return await n(e, t);
@@ -0,0 +1,18 @@
1
+ import { Matrix4, Vector3 } from 'three';
2
+ import { DataSourceType, Image360, Image360Collection } from '@cognite/reveal';
3
+ export declare function getPlausibleEntityAnchorViewer(entity: Image360<DataSourceType> | undefined, referenceCenterCdf: Vector3): Vector3 | undefined;
4
+ export declare function applySceneCollectionTransformToCdfPoint(point: Vector3, collectionTransform: Matrix4, target?: Vector3): Vector3;
5
+ type ApplySceneCollectionTransformToCdfAnnotationWorldPointParams = {
6
+ rawCenterCdf: Vector3;
7
+ unitDirectionFromCenterCdf: Vector3;
8
+ vectorLength: number;
9
+ collectionTransform: Matrix4;
10
+ sceneAlignedImageCenterViewer: Vector3;
11
+ target?: Vector3;
12
+ };
13
+ export declare function applySceneCollectionTransformToCdfAnnotationWorldPoint({ rawCenterCdf, unitDirectionFromCenterCdf, vectorLength, collectionTransform, sceneAlignedImageCenterViewer, target, }: ApplySceneCollectionTransformToCdfAnnotationWorldPointParams): Vector3;
14
+ export declare function convertSceneAlignedImage360AnnotationGeometryToRawCdf(center: Vector3, polygon: Vector3[], collection: Image360Collection<DataSourceType>, vectorLength: number, entity?: Image360<DataSourceType>): {
15
+ center: Vector3;
16
+ polygon: Vector3[];
17
+ };
18
+ export {};
@@ -0,0 +1,37 @@
1
+ import { VIEWER_TO_CDF_TRANSFORMATION as e, convertFromViewerCoordinates as t, convertToViewerCoordinates as n } from "../../foundation/renderTarget/convertCoordinates.js";
2
+ import { Matrix4 as r, Vector3 as i } from "three";
3
+ import { CDF_TO_VIEWER_TRANSFORMATION as a } from "@cognite/reveal";
4
+ //#region libs/shared/reveal-components/src/domains/annotation360/image360SceneCollectionTransform.ts
5
+ var o = .05;
6
+ function s(e, t) {
7
+ if (e === void 0) return;
8
+ let r = new i().setFromMatrixPosition(e.transform);
9
+ if (!(r.distanceTo(n(t)) > o)) return r;
10
+ }
11
+ function c(t, n, r = new i()) {
12
+ return r.copy(t).applyMatrix4(a).applyMatrix4(n).applyMatrix4(e);
13
+ }
14
+ new r(), new i(), new i();
15
+ function l(e, i, a, o, l) {
16
+ let d = a.getModelTransformation(), f = new r().copy(d).invert(), p = s(l, e);
17
+ if (p !== void 0) {
18
+ let e = p.clone().applyMatrix4(f), r = u(d).invert(), a = t(e);
19
+ return {
20
+ center: a,
21
+ polygon: i.map((i) => {
22
+ let s = n(i.clone().multiplyScalar(o)).applyMatrix4(r);
23
+ return t(e.clone().add(s)).sub(a).normalize();
24
+ })
25
+ };
26
+ }
27
+ let m = c(e, f);
28
+ return {
29
+ center: m,
30
+ polygon: i.map((t) => c(e.clone().addScaledVector(t, o), f).sub(m).normalize())
31
+ };
32
+ }
33
+ function u(e) {
34
+ return new r().copy(e).setPosition(0, 0, 0);
35
+ }
36
+ //#endregion
37
+ export { c as applySceneCollectionTransformToCdfPoint, l as convertSceneAlignedImage360AnnotationGeometryToRawCdf, s as getPlausibleEntityAnchorViewer };
@@ -94,6 +94,7 @@ export { Image360AnnotationFolder } from './annotation360/Image360AnnotationFold
94
94
  export { Image360AnnotationSelectTool } from './annotation360/Image360AnnotationSelectTool';
95
95
  export { Image360AnnotationCreateTool } from './annotation360/Image360AnnotationCreateTool';
96
96
  export { DeleteSelectedImage360AnnotationCommand } from './annotation360/DeleteSelectedImage360AnnotationCommand';
97
+ export { convertSceneAlignedImage360AnnotationGeometryToRawCdf } from './annotation360/image360SceneCollectionTransform';
97
98
  export { isPointsOfInterestIntersection, type PointOfInterest, PointsOfInterestDomainObject, PointsOfInterestView, } from './pointsOfInterest';
98
99
  export type { LegacyIdentifier } from './annotation360/types';
99
100
  export type { FdmIdentifier } from './annotation360/types';
@@ -109,6 +110,6 @@ export { CadLazyLoader } from '../foundation/treeNodes/cad-tree-node/cad-lazy-lo
109
110
  export type { CadLazyLoaderOptions } from '../foundation/treeNodes/cad-tree-node/cad-lazy-loader';
110
111
  export { CadTreeNode } from '../foundation/treeNodes/cad-tree-node/cad-tree-node';
111
112
  export { TreeNode } from '../foundation/treeNodes/tree-node/tree-node';
112
- export type { TreeNodeAction } from '../foundation/treeNodes/tree-node-type/tree-node-actions';
113
+ export type { TreeNodeAction, TreeNodeSelectAction, } from '../foundation/treeNodes/tree-node-type/tree-node-actions';
113
114
  export type { RevisionId } from '../foundation/treeNodes/cad-tree-node/cad-types';
114
115
  export { DEFAULT_POLYGON_OFFSET, updatePolygonOffset, } from '../foundation/utilities/misc/defaultPolygonOffset';
@@ -98,7 +98,8 @@ import { Image360AnnotationFolder as Ge } from "./annotation360/Image360Annotati
98
98
  import { Image360AnnotationSelectTool as Ke } from "./annotation360/Image360AnnotationSelectTool.js";
99
99
  import { Image360AnnotationCreateTool as qe } from "./annotation360/Image360AnnotationCreateTool.js";
100
100
  import { DeleteSelectedImage360AnnotationCommand as Je } from "./annotation360/DeleteSelectedImage360AnnotationCommand.js";
101
- import { CoreDmInstanceMappingsSdk as Ye } from "../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.js";
101
+ import { convertSceneAlignedImage360AnnotationGeometryToRawCdf as Ye } from "./annotation360/image360SceneCollectionTransform.js";
102
+ import { CoreDmInstanceMappingsSdk as Xe } from "../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.js";
102
103
  he(), Te();
103
104
  //#endregion
104
- export { I as Annotation, L as AnnotationChangedDescription, R as AnnotationUtils, xe as AnnotationsCreateTool, z as AnnotationsDomainObject, j as AnnotationsRenderStyle, be as AnnotationsSelectTool, Ie as BaseBannerCommand, e as BaseCommand, ve as BaseCreator, N as BaseDragger, ye as BaseEditTool, r as BaseFilterCommand, i as BaseFilterItemCommand, n as BaseOptionCommand, ie as BaseRevealConfig, De as BaseSettingsCommand, Ee as BaseSliderCommand, ne as BaseTool, u as BaseView, me as CadDomainObject, de as CadLazyLoader, ue as CadTreeNode, g as ChangedDescription, a as Changes, fe as ClassicInstanceMappingsSdk, _ as ColorType, Q as CommandChanges, X as CommandsController, k as CommonRenderStyle, f as CopyToClipboardCommand, Ye as CoreDmInstanceMappingsSdk, h as CycleLengthUnitsCommand, H as DEFAULT_POLYGON_OFFSET, ae as DefaultRevealConfig, m as DeleteDomainObjectCommand, Je as DeleteSelectedImage360AnnotationCommand, C as DomainObject, v as DomainObjectChange, p as DomainObjectCommand, D as DomainObjectTransaction, ke as FitViewCommand, o as FocusType, Se as FolderDomainObject, Le as GeneralBannerCommand, Oe as GroupCommand, B as GroupThreeView, qe as Image360AnnotationCreateTool, We as Image360AnnotationDomainObject, Ge as Image360AnnotationFolder, Ke as Image360AnnotationSelectTool, G as Image360CollectionDomainObject, He as Index2, _e as InstanceCommand, Ae as KeyboardSpeedCommand, re as NavigationTool, pe as NodesAndInstanceMappingsSdk, M as PanelInfo, K as PointCloudDomainObject, je as PointCloudFilterCommand, se as PointsOfInterestDomainObject, ce as PointsOfInterestView, y as PopupStyle, T as PrimitiveType, c as Quantity, P as Range1, F as Range3, O as RenderStyle, t as RenderTargetCommand, W as RevealDomainObject, oe as RevealRenderTarget, q as RevealSettingsController, J as RootDomainObject, Ve as SceneDomainObject, Be as SetAxisVisibleCommand, Me as SetPointColorTypeCommand, Ne as SetPointShapeCommand, Pe as SetPointSizeCommand, Fe as SetQualityCommand, Re as SetQualitySliderCommand, ze as SettingsCommand, we as ShowAllDomainObjectsCommand, Ce as ShowDomainObjectsOnTopCommand, A as Status, d as ThreeView, E as Transaction, le as TreeNode, V as TrianglesBuffers, ge as UndoCommand, te as UndoManager, l as UnitSystem, b as Views, s as VisibleState, w as VisualDomainObject, Ue as getGlobalMatrix, x as getNextColor, S as getNextColorByIndex, Y as getResizeCursor, $ as isCustomObjectIntersection, ee as isDomainObjectIntersection, Z as isPointsOfInterestIntersection, U as updatePolygonOffset };
105
+ export { I as Annotation, L as AnnotationChangedDescription, R as AnnotationUtils, xe as AnnotationsCreateTool, z as AnnotationsDomainObject, j as AnnotationsRenderStyle, be as AnnotationsSelectTool, Ie as BaseBannerCommand, e as BaseCommand, ve as BaseCreator, N as BaseDragger, ye as BaseEditTool, r as BaseFilterCommand, i as BaseFilterItemCommand, n as BaseOptionCommand, ie as BaseRevealConfig, De as BaseSettingsCommand, Ee as BaseSliderCommand, ne as BaseTool, u as BaseView, me as CadDomainObject, de as CadLazyLoader, ue as CadTreeNode, g as ChangedDescription, a as Changes, fe as ClassicInstanceMappingsSdk, _ as ColorType, Q as CommandChanges, X as CommandsController, k as CommonRenderStyle, f as CopyToClipboardCommand, Xe as CoreDmInstanceMappingsSdk, h as CycleLengthUnitsCommand, H as DEFAULT_POLYGON_OFFSET, ae as DefaultRevealConfig, m as DeleteDomainObjectCommand, Je as DeleteSelectedImage360AnnotationCommand, C as DomainObject, v as DomainObjectChange, p as DomainObjectCommand, D as DomainObjectTransaction, ke as FitViewCommand, o as FocusType, Se as FolderDomainObject, Le as GeneralBannerCommand, Oe as GroupCommand, B as GroupThreeView, qe as Image360AnnotationCreateTool, We as Image360AnnotationDomainObject, Ge as Image360AnnotationFolder, Ke as Image360AnnotationSelectTool, G as Image360CollectionDomainObject, He as Index2, _e as InstanceCommand, Ae as KeyboardSpeedCommand, re as NavigationTool, pe as NodesAndInstanceMappingsSdk, M as PanelInfo, K as PointCloudDomainObject, je as PointCloudFilterCommand, se as PointsOfInterestDomainObject, ce as PointsOfInterestView, y as PopupStyle, T as PrimitiveType, c as Quantity, P as Range1, F as Range3, O as RenderStyle, t as RenderTargetCommand, W as RevealDomainObject, oe as RevealRenderTarget, q as RevealSettingsController, J as RootDomainObject, Ve as SceneDomainObject, Be as SetAxisVisibleCommand, Me as SetPointColorTypeCommand, Ne as SetPointShapeCommand, Pe as SetPointSizeCommand, Fe as SetQualityCommand, Re as SetQualitySliderCommand, ze as SettingsCommand, we as ShowAllDomainObjectsCommand, Ce as ShowDomainObjectsOnTopCommand, A as Status, d as ThreeView, E as Transaction, le as TreeNode, V as TrianglesBuffers, ge as UndoCommand, te as UndoManager, l as UnitSystem, b as Views, s as VisibleState, w as VisualDomainObject, Ye as convertSceneAlignedImage360AnnotationGeometryToRawCdf, Ue as getGlobalMatrix, x as getNextColor, S as getNextColorByIndex, Y as getResizeCursor, $ as isCustomObjectIntersection, ee as isDomainObjectIntersection, Z as isPointsOfInterestIntersection, U as updatePolygonOffset };
@@ -14,6 +14,7 @@ export type PointsOfInterestToolDeps = {
14
14
  export declare const defaultPointsOfInterestToolDeps: PointsOfInterestToolDeps;
15
15
  export declare class PointsOfInterestTool<PoiIdType> extends BaseEditTool {
16
16
  private _isCreating;
17
+ private _createCursor;
17
18
  private _scene;
18
19
  /** Invalidates in-flight instance lookups for a cancelled/replaced draft. */
19
20
  private _pendingCreateRequestId;
@@ -29,6 +30,7 @@ export declare class PointsOfInterestTool<PoiIdType> extends BaseEditTool {
29
30
  get isEnabled(): boolean;
30
31
  onActivate(): void;
31
32
  onDeactivate(): void;
33
+ onHover(event: PointerEvent): void;
32
34
  onClick(event: PointerEvent): Promise<void>;
33
35
  get lastCreatedPointOfInterest(): Signal<PointOfInterest<PoiIdType> | undefined>;
34
36
  clearLastCreatedPointOfInterest(): void;
@@ -42,7 +44,10 @@ export declare class PointsOfInterestTool<PoiIdType> extends BaseEditTool {
42
44
  getOrCreatePointsOfInterestDomainObject(): PointsOfInterestDomainObject<PoiIdType>;
43
45
  get isCreating(): boolean;
44
46
  setIsCreating(value: boolean): void;
47
+ dispose(): void;
45
48
  setScene(scene: DmsUniqueIdentifier | undefined): void;
49
+ private appendCreateCursor;
50
+ private readonly removeCreateCursor;
46
51
  private setAssignedInstance;
47
52
  /**
48
53
  * Starts POI creation by adding a pending draft at the given position and
@@ -3,20 +3,22 @@ import { createInstanceStyleGroup as r } from "../../ui/components/Reveal3DResou
3
3
  import { PointsOfInterestDomainObject as i } from "./PointsOfInterestDomainObject.js";
4
4
  import { isImage360ClusterIntersection as a } from "../../foundation/utilities/misc/typeGuards.js";
5
5
  import { BaseEditTool as o } from "../../foundation/commands/BaseEditTool.js";
6
- import { getInstancesFromClick as s } from "../../utilities/getInstancesFromClick.js";
7
- import { PointsOfInterestAdsProvider as c } from "./ads/PointsOfInterestAdsProvider.js";
8
- import { signal as l } from "@cognite/signal-utils";
9
- import { DefaultNodeAppearance as u } from "@cognite/reveal";
6
+ import s from "../../assets/poi-markers/poi-create-cursor.js";
7
+ import { getInstancesFromClick as c } from "../../utilities/getInstancesFromClick.js";
8
+ import { PointsOfInterestAdsProvider as l } from "./ads/PointsOfInterestAdsProvider.js";
9
+ import { signal as u } from "@cognite/signal-utils";
10
+ import { DefaultNodeAppearance as d } from "@cognite/reveal";
10
11
  //#region libs/shared/reveal-components/src/domains/pointsOfInterest/PointsOfInterestTool.ts
11
- var d = Symbol("poi3d-assigned-instance-styling"), f = { getInstancesFromClick: s }, p = class extends o {
12
+ var f = Symbol("poi3d-assigned-instance-styling"), p = { getInstancesFromClick: c }, m = class extends o {
12
13
  _isCreating = !1;
14
+ _createCursor;
13
15
  _scene;
14
16
  _pendingCreateRequestId = 0;
15
- _lastCreatedPointOfInterest = l(void 0);
16
- _pendingAssociatedInstance = l(void 0);
17
- _isSaving = l(!1);
17
+ _lastCreatedPointOfInterest = u(void 0);
18
+ _pendingAssociatedInstance = u(void 0);
19
+ _isSaving = u(!1);
18
20
  _deps;
19
- constructor(e = f) {
21
+ constructor(e = p) {
20
22
  super(), this._deps = e;
21
23
  }
22
24
  get icon() {
@@ -35,12 +37,19 @@ var d = Symbol("poi3d-assigned-instance-styling"), f = { getInstancesFromClick:
35
37
  return !this.renderTarget.isInside360Image && this._scene !== void 0;
36
38
  }
37
39
  onActivate() {
38
- super.onActivate(), this.getOrCreatePointsOfInterestDomainObject().setVisible(!0, this.renderTarget), this.setIsCreating(!0), this.setCursor("copy");
40
+ super.onActivate(), this.getOrCreatePointsOfInterestDomainObject().setVisible(!0, this.renderTarget), this.setIsCreating(!0);
39
41
  }
40
42
  onDeactivate() {
41
43
  super.onDeactivate();
42
44
  let t = this.getPointsOfInterestDomainObject(), n = t?.selectedPointsOfInterest;
43
- n?.status !== e.PendingCreation && n?.status !== e.PendingEditing && t?.setSelectedPointOfInterest(void 0), this.setIsCreating(!1), this.setCursor("default"), this.setAssignedInstance(void 0);
45
+ n?.status !== e.PendingCreation && n?.status !== e.PendingEditing && t?.setSelectedPointOfInterest(void 0), this.setIsCreating(!1), this.setAssignedInstance(void 0);
46
+ }
47
+ onHover(e) {
48
+ if (!this._isCreating) {
49
+ super.onHover(e);
50
+ return;
51
+ }
52
+ this.renderTarget.cursor = "none", this._createCursor === void 0 && (this._createCursor = this.appendCreateCursor()), this._createCursor.style.left = `${e.clientX}px`, this._createCursor.style.top = `${e.clientY}px`;
44
53
  }
45
54
  async onClick(e) {
46
55
  if (this._isCreating) {
@@ -82,25 +91,35 @@ var d = Symbol("poi3d-assigned-instance-styling"), f = { getInstancesFromClick:
82
91
  getOrCreatePointsOfInterestDomainObject() {
83
92
  let e = this.getPointsOfInterestDomainObject();
84
93
  if (e !== void 0) return e;
85
- let t = new i(new c(this.root.sdk));
94
+ let t = new i(new l(this.root.sdk));
86
95
  return this.root.addChild(t), t;
87
96
  }
88
97
  get isCreating() {
89
98
  return this._isCreating;
90
99
  }
91
100
  setIsCreating(e) {
92
- this._isCreating = e, e ? this.renderTarget.setCrosshairCursor() : this.renderTarget.setNavigateCursor();
101
+ this._isCreating = e, e || (this.removeCreateCursor(), this.renderTarget.setNavigateCursor());
102
+ }
103
+ dispose() {
104
+ this.removeCreateCursor(), super.dispose();
93
105
  }
94
106
  setScene(e) {
95
107
  this._scene = e;
96
108
  }
109
+ appendCreateCursor() {
110
+ let e = new Image(48, 48);
111
+ return e.src = s, e.style.position = "fixed", e.style.margin = "-24px 0 0 -24px", e.style.pointerEvents = "none", document.body.append(e), this.renderTarget.domElement.addEventListener("pointerleave", this.removeCreateCursor), e;
112
+ }
113
+ removeCreateCursor = () => {
114
+ this._renderTarget?.domElement.removeEventListener("pointerleave", this.removeCreateCursor), this._createCursor?.remove(), this._createCursor = void 0;
115
+ };
97
116
  setAssignedInstance(e) {
98
117
  if (e === void 0) {
99
- this.renderTarget.instanceStylingController.setStylingGroup(d, void 0);
118
+ this.renderTarget.instanceStylingController.setStylingGroup(f, void 0);
100
119
  return;
101
120
  }
102
- let t = r([e], u.Highlighted);
103
- this.renderTarget.instanceStylingController.setStylingGroup(d, t);
121
+ let t = r([e], d.Highlighted);
122
+ this.renderTarget.instanceStylingController.setStylingGroup(f, t);
104
123
  }
105
124
  async beginCreatePointOfInterest(e, n) {
106
125
  if (this._scene === void 0 || this._isSaving()) return;
@@ -145,4 +164,4 @@ var d = Symbol("poi3d-assigned-instance-styling"), f = { getInstancesFromClick:
145
164
  }
146
165
  };
147
166
  //#endregion
148
- export { p as PointsOfInterestTool, f as defaultPointsOfInterestToolDeps };
167
+ export { m as PointsOfInterestTool, p as defaultPointsOfInterestToolDeps };
@@ -18,6 +18,7 @@ export declare class RevealDomainObjectUtils {
18
18
  static addCadDomainObject(renderTarget: RevealRenderTarget, identifier: AddModelOptions<DataSourceType>, options?: {
19
19
  parent?: DomainObject;
20
20
  defaultVisible?: boolean;
21
+ zoomOnNodeSelect?: boolean;
21
22
  }): Promise<CadDomainObject>;
22
23
  static addPointCloudDomainObject(renderTarget: RevealRenderTarget, identifier: AddModelOptions<DataSourceType>, options?: {
23
24
  parent?: DomainObject;
@@ -36,7 +36,7 @@ var f = class f {
36
36
  static async addCadDomainObject(e, t, r) {
37
37
  let a = await e.viewer.addCadModel(t);
38
38
  a.visible = r?.defaultVisible ?? !0;
39
- let o = new n(a);
39
+ let o = new n(a, { zoomOnNodeSelect: r?.zoomOnNodeSelect });
40
40
  s(r?.parent ?? e.root, i).addChild(o), o.setVisible(a.visible);
41
41
  try {
42
42
  o.name = await f.getName(e.root.sdk, a, e.root.fdmSdk);
@@ -10,13 +10,17 @@ export type StylingWithNodeCollection = {
10
10
  appearance: NodeAppearance;
11
11
  importance?: number;
12
12
  };
13
+ export type CadDomainObjectOptions = {
14
+ zoomOnNodeSelect?: boolean;
15
+ };
13
16
  export declare class CadDomainObject extends RevealDomainObject {
14
17
  private readonly _model;
15
18
  private readonly _collections;
19
+ private readonly _zoomOnNodeSelect;
16
20
  private _cadLazyLoader;
17
21
  private _cadRootLoadState;
18
22
  get model(): CogniteCadModel;
19
- constructor(model: CogniteCadModel);
23
+ constructor(model: CogniteCadModel, options?: CadDomainObjectOptions);
20
24
  get typeName(): TranslationInput;
21
25
  get icon(): IconName;
22
26
  get hasIconColor(): boolean;
@@ -31,6 +35,19 @@ export declare class CadDomainObject extends RevealDomainObject {
31
35
  getStyledNodeCollections(key: Symbol): StylingWithNodeCollection[] | undefined;
32
36
  addStyledNodeCollections(key: Symbol, value: StylingWithNodeCollection[]): void;
33
37
  removeStyledNodeCollections(key: Symbol): void;
38
+ /**
39
+ * Whether `collection` is still actually registered on the model.
40
+ * Makes sure other styled operation from 3D has not updated styling to the model
41
+ */
42
+ isCollectionAttached(collection: NodeCollection): boolean;
43
+ /**
44
+ * Guards against CogniteCadModel.unassignStyledNodeCollection from other operation
45
+ */
46
+ private unassignIfAttached;
47
+ /**
48
+ * Deselects any selected node in the CAD node tree and clears its highlight in the 3D view.
49
+ */
50
+ clearNodeSelection(): void;
34
51
  /**
35
52
  * Lazily creates the `CadLazyLoader` for model's CAD node hierarchy
36
53
  */