@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,75 +1,94 @@
1
1
  import { useCommand as e } from "../hooks/useCommand.js";
2
2
  import { useCommandProps as t, useCommandVisible as n } from "../hooks/useCommandProps.js";
3
- import { mapButtonType as r } from "../utils/utilities.js";
4
- import { BaseOptionCommand as i, OptionType as a } from "../../../../foundation/commands/BaseOptionCommand.js";
5
- import { useState as o } from "react";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import { Button as u } from "@cognite/aura/components/button";
8
- import { IconChevronDown as d, IconChevronUp as f } from "@tabler/icons-react";
9
- import { DropdownMenu as p, DropdownMenuCheckboxItem as m, DropdownMenuContent as h, DropdownMenuTrigger as g } from "@cognite/aura/components/dropdown-menu";
3
+ import { LabelWithShortcut as r } from "../utils/LabelWithShortcut.js";
4
+ import { mapButtonType as i } from "../utils/utilities.js";
5
+ import { BaseOptionCommand as a, OptionType as o } from "../../../../foundation/commands/BaseOptionCommand.js";
6
+ import { useState as s } from "react";
7
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { Tooltip as d, TooltipContent as f, TooltipProvider as p, TooltipTrigger as m } from "@cognite/aura/components/tooltip";
9
+ import { Button as h } from "@cognite/aura/components/button";
10
+ import { IconChevronDown as g, IconChevronUp as _ } from "@tabler/icons-react";
11
+ import { DropdownMenu as v, DropdownMenuCheckboxItem as y, DropdownMenuContent as b, DropdownMenuTrigger as x } from "@cognite/aura/components/dropdown-menu";
10
12
  //#region libs/shared/reveal-components/src/ui/components/commandBased/buttons/DropdownButton.tsx
11
- function _(e, t) {
12
- if (e instanceof i && e.optionType === a.Dropdown) return /* @__PURE__ */ c(v, {
13
+ function S(e, { reason: t, event: n }) {
14
+ return !e && t === "trigger-press" && n instanceof MouseEvent && n.type === "click" && n.detail > 0;
15
+ }
16
+ function C(e, t) {
17
+ if (e instanceof a && e.optionType === o.Dropdown) return /* @__PURE__ */ l(w, {
13
18
  inputCommand: e,
14
19
  placement: t
15
20
  }, e.uniqueId);
16
21
  }
17
- var v = ({ inputCommand: t, placement: r, usedInSettings: i = !1 }) => {
22
+ var w = ({ inputCommand: t, placement: r, usedInSettings: i = !1 }) => {
18
23
  let a = e(t);
19
- return n(a) ? i ? /* @__PURE__ */ c(b, { command: a }) : /* @__PURE__ */ c(y, {
24
+ return n(a) ? i ? /* @__PURE__ */ l(E, { command: a }) : /* @__PURE__ */ l(T, {
20
25
  command: a,
21
26
  placement: r
22
- }) : /* @__PURE__ */ c(s, {});
23
- }, y = ({ command: e, placement: n }) => {
24
- let { uniqueId: i, isEnabled: a } = t(e), [m, _] = o(!1);
25
- if (!e.children?.length) return /* @__PURE__ */ c(s, {});
26
- let v = e.selectedChild?.label, y = r(e.buttonType);
27
+ }) : /* @__PURE__ */ l(c, {});
28
+ }, T = ({ command: e, placement: n }) => {
29
+ let { uniqueId: a, isEnabled: o } = t(e), [y, C] = s(!1);
30
+ if (!e.children?.length) return /* @__PURE__ */ l(c, {});
31
+ let w = e.selectedChild?.label, T = i(e.buttonType), E = e.label;
27
32
  return /* @__PURE__ */ l(p, {
28
- open: m,
29
- onOpenChange: _,
30
- children: [/* @__PURE__ */ c(g, { render: /* @__PURE__ */ l(u, {
31
- variant: y,
32
- size: "sm",
33
- disabled: !a,
34
- "aria-label": e.label,
35
- className: `pl-1 pr-2 py-1 ${m ? "bg-accent-background" : ""}`,
36
- children: [c(m ? f : d, {}), v]
37
- }, i) }), /* @__PURE__ */ c(h, {
38
- side: n,
39
- align: "start",
40
- children: e.children.map((e) => /* @__PURE__ */ c(x, {
41
- command: e,
42
- setOpen: _
43
- }, e.uniqueId))
44
- })]
33
+ delayDuration: 500,
34
+ children: /* @__PURE__ */ u(d, {
35
+ disabled: E === void 0 || y,
36
+ children: [/* @__PURE__ */ u(v, {
37
+ open: y,
38
+ onOpenChange: (e, t) => {
39
+ S(e, t) || C(e);
40
+ },
41
+ children: [/* @__PURE__ */ l(m, { render: /* @__PURE__ */ l(x, { render: /* @__PURE__ */ u(h, {
42
+ variant: T,
43
+ size: "sm",
44
+ disabled: !o,
45
+ "aria-label": E,
46
+ className: `pl-1 pr-2 py-1 ${y ? "bg-accent-background" : ""}`,
47
+ children: [l(y ? _ : g, {}), w]
48
+ }, a) }) }), /* @__PURE__ */ l(b, {
49
+ side: n,
50
+ align: "start",
51
+ children: e.children.map((e) => /* @__PURE__ */ l(D, {
52
+ command: e,
53
+ setOpen: C
54
+ }, e.uniqueId))
55
+ })]
56
+ }), /* @__PURE__ */ l(f, {
57
+ side: n,
58
+ children: /* @__PURE__ */ l(r, {
59
+ label: E,
60
+ command: e
61
+ })
62
+ })]
63
+ })
45
64
  });
46
- }, b = ({ command: e }) => {
47
- let [t, n] = o(!1);
48
- if (!e.children?.length) return /* @__PURE__ */ c(s, {});
65
+ }, E = ({ command: e }) => {
66
+ let [t, n] = s(!1);
67
+ if (!e.children?.length) return /* @__PURE__ */ l(c, {});
49
68
  let r = e.label, i = e.selectedChild?.label;
50
- return /* @__PURE__ */ l("div", {
69
+ return /* @__PURE__ */ u("div", {
51
70
  className: "flex flex-row self-stretch items-center gap-3",
52
- children: [/* @__PURE__ */ c("p", {
71
+ children: [/* @__PURE__ */ l("p", {
53
72
  title: r,
54
73
  className: "w-[80px] truncate text-sm",
55
74
  children: r
56
- }), /* @__PURE__ */ c("div", {
75
+ }), /* @__PURE__ */ l("div", {
57
76
  className: "flex-1",
58
- children: /* @__PURE__ */ l(p, {
77
+ children: /* @__PURE__ */ u(v, {
59
78
  open: t,
60
79
  onOpenChange: n,
61
- children: [/* @__PURE__ */ c(g, { render: /* @__PURE__ */ l(u, {
80
+ children: [/* @__PURE__ */ l(x, { render: /* @__PURE__ */ u(h, {
62
81
  variant: "ghost",
63
82
  "aria-label": r,
64
83
  className: `w-full justify-between border border-transparent rounded-lg bg-background py-2 pl-2 pr-1 text-sm hover:bg-accent-background hover:border-border-emphasized${t ? " bg-accent-background" : ""}`,
65
- children: [/* @__PURE__ */ c("span", {
84
+ children: [/* @__PURE__ */ l("span", {
66
85
  className: "font-normal",
67
86
  children: i
68
- }), c(t ? f : d, {})]
69
- }) }), /* @__PURE__ */ c(h, {
87
+ }), l(t ? _ : g, {})]
88
+ }) }), /* @__PURE__ */ l(b, {
70
89
  side: "bottom",
71
90
  align: "start",
72
- children: e.children.map((e) => /* @__PURE__ */ c(x, {
91
+ children: e.children.map((e) => /* @__PURE__ */ l(D, {
73
92
  command: e,
74
93
  setOpen: n
75
94
  }, e.uniqueId))
@@ -77,9 +96,9 @@ var v = ({ inputCommand: t, placement: r, usedInSettings: i = !1 }) => {
77
96
  })
78
97
  })]
79
98
  });
80
- }, x = ({ command: e, setOpen: n }) => {
99
+ }, D = ({ command: e, setOpen: n }) => {
81
100
  let { isEnabled: r, isChecked: i } = t(e);
82
- return /* @__PURE__ */ c(m, {
101
+ return /* @__PURE__ */ l(y, {
83
102
  disabled: !r,
84
103
  checked: i,
85
104
  onCheckedChange: () => {
@@ -89,4 +108,4 @@ var v = ({ inputCommand: t, placement: r, usedInSettings: i = !1 }) => {
89
108
  });
90
109
  };
91
110
  //#endregion
92
- export { v as DropdownButton, _ as createDropdownButton };
111
+ export { w as DropdownButton, C as createDropdownButton, S as isSpuriousTriggerClickClose };
@@ -1,9 +1,20 @@
1
- import { BaseCommand } from '../../../../../domains';
1
+ import { BaseCommand, DomainObject } from '../../../../../domains';
2
2
  import { TreeNodeType } from '../../../../../foundation/treeNodes/tree-node-type/tree-node-type';
3
3
  /**
4
4
  * Handles the selection of a domain object node.
5
5
  * @param node - The tree node to be selected or deselected.
6
+ * @param root - The root of the domain object tree, used to clear other selections.
6
7
  */
7
- export declare function onSelectDomainObject(node: TreeNodeType): void;
8
+ export declare function onSelectDomainObject(node: TreeNodeType, root: DomainObject): void;
9
+ /**
10
+ * Clears the highlight/selection of the node currently selected in any CAD node hierarchy
11
+ * @param root - The root of the domain object tree to search for CAD models.
12
+ */
13
+ export declare function clearAllCadNodeSelections(root: DomainObject): void;
8
14
  export declare function onToggleDomainObject(node: TreeNodeType): void;
15
+ /**
16
+ * Clears all selection/highlight state in the tree
17
+ * @param root - The root of the domain object tree.
18
+ */
19
+ export declare function onClickTreeViewBackground(root: DomainObject): void;
9
20
  export declare function getContextMenu(node: TreeNodeType): BaseCommand[] | undefined;
@@ -1,21 +1,29 @@
1
1
  import { DomainObject as e } from "../../../../../foundation/domainObjects/DomainObject.js";
2
+ import { CadDomainObject as t } from "../../../../../domains/reveal/cad/CadDomainObject.js";
2
3
  import "../../../../../domains/index.js";
3
4
  //#region libs/shared/reveal-components/src/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.tsx
4
- function t(t) {
5
- if (t.onSelect !== void 0) {
5
+ function n(t, n) {
6
+ if (r(n), t.onSelect !== void 0) {
6
7
  t.onSelect();
7
8
  return;
8
9
  }
9
- if (!(t instanceof e)) return;
10
- let n = t.root;
11
- for (let e of n.getThisAndDescendants()) e !== t && e.setSelected(!1);
12
- t.setSelected(!t.isSelected);
10
+ if (t instanceof e) {
11
+ for (let e of n.getThisAndDescendants()) e !== t && e.setSelected(!1);
12
+ t.setSelected(!t.isSelected);
13
+ }
14
+ }
15
+ function r(e) {
16
+ for (let n of e.getDescendantsByType(t)) n.clearNodeSelection();
13
17
  }
14
- function n(e) {
18
+ function i(e) {
15
19
  e.toggleVisible?.();
16
20
  }
17
- function r(t) {
21
+ function a(e) {
22
+ r(e);
23
+ for (let t of e.getThisAndDescendants()) t.setSelected(!1);
24
+ }
25
+ function o(t) {
18
26
  if (t instanceof e) return t.getContextMenu();
19
27
  }
20
28
  //#endregion
21
- export { r as getContextMenu, t as onSelectDomainObject, n as onToggleDomainObject };
29
+ export { r as clearAllCadNodeSelections, o as getContextMenu, a as onClickTreeViewBackground, n as onSelectDomainObject, i as onToggleDomainObject };
@@ -4,29 +4,30 @@ import { CadTreeNodeViewAdapter as n } from "../../../../../foundation/treeNodes
4
4
  import { useCadNode3DInfo as r } from "../../../../query/useCadNode3DInfo.js";
5
5
  import { TreeView as i } from "../TreeView/tree-view.js";
6
6
  import { CadNodeInfoDialog as a } from "./CadNodeInfoDialog.js";
7
- import { getContextMenu as o, onSelectDomainObject as s, onToggleDomainObject as c } from "./DomainObjectTreeView.function.js";
8
- import { useState as l } from "react";
9
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { getContextMenu as o, onClickTreeViewBackground as s, onSelectDomainObject as c, onToggleDomainObject as l } from "./DomainObjectTreeView.function.js";
8
+ import { useState as u } from "react";
9
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
10
10
  //#region libs/shared/reveal-components/src/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.tsx
11
- var p = 20, m = () => {
12
- let m = e(), [h, g] = l(void 0), [_, v] = l(!1), y = (e) => {
13
- e instanceof n && (g(e), v(!0));
14
- }, { data: b, isLoading: x, isError: S } = r(m.root.sdk, h?.revisionId, h?.node.nodeId);
15
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(i, {
16
- maxLabelLength: p,
17
- root: m.root,
18
- onSelectNode: s,
19
- onToggleNode: c,
20
- onClickInfo: y,
11
+ var m = 20, h = () => {
12
+ let h = e(), [g, _] = u(void 0), [v, y] = u(!1), b = (e) => {
13
+ e instanceof n && (_(e), y(!0));
14
+ }, { data: x, isLoading: S, isError: C } = r(h.root.sdk, g?.revisionId, g?.node.nodeId);
15
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(i, {
16
+ maxLabelLength: m,
17
+ root: h.root,
18
+ onSelectNode: (e) => c(e, h.root),
19
+ onToggleNode: l,
20
+ onClickInfo: b,
21
+ onClickBackground: () => s(h.root),
21
22
  getContextMenu: o,
22
23
  getIconFromIconName: t.getIcon
23
- }), /* @__PURE__ */ d(a, {
24
- open: _,
25
- onOpenChange: v,
26
- node: b,
27
- isLoading: x,
28
- isError: S
24
+ }), /* @__PURE__ */ f(a, {
25
+ open: v,
26
+ onOpenChange: y,
27
+ node: x,
28
+ isLoading: S,
29
+ isError: C
29
30
  })] });
30
31
  };
31
32
  //#endregion
32
- export { m as DomainObjectTreeView };
33
+ export { h as DomainObjectTreeView };
@@ -14,8 +14,8 @@ var c = ({ node: c, onClick: l }) => {
14
14
  size: "icon-sm",
15
15
  "aria-label": "Info",
16
16
  className: "tree-view-info text-medium-foreground",
17
- onClick: () => {
18
- d(c);
17
+ onClick: (e) => {
18
+ e.stopPropagation(), d(c);
19
19
  },
20
20
  children: /* @__PURE__ */ e(o, {})
21
21
  }) }), /* @__PURE__ */ e(r, {
@@ -1,69 +1,70 @@
1
1
  import { createInstanceKey as e, instanceIdToInstanceReference as t } from "../../../../../../data-providers/cache/idAndKeyTranslation.js";
2
2
  import { createInstanceReferenceKey as n } from "../../../../../../utilities/instanceIds/toKey.js";
3
+ import { useMemoWithUpdateSignal as r } from "../../../../../../utilities/signal/useMemoWithUpdateSignal.js";
3
4
  import "../../../../../../utilities/index.js";
4
- import { CadTreeAssetMappingDropdownContext as r } from "./CadTreeAssetMappingDropdown.context.js";
5
- import { useContext as i } from "react";
6
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { Tooltip as c, TooltipContent as l, TooltipProvider as u, TooltipTrigger as d } from "@cognite/aura/components/tooltip";
8
- import { IconLink as f, IconTrash as p } from "@tabler/icons-react";
9
- import { Label as m } from "@cognite/aura/components/label";
10
- import { Popover as h, PopoverContent as g, PopoverTrigger as _ } from "@cognite/aura/components/popover";
11
- import { cn as v } from "@cognite/aura/utils";
5
+ import { CadTreeAssetMappingDropdownContext as i } from "./CadTreeAssetMappingDropdown.context.js";
6
+ import { useContext as a, useMemo as o } from "react";
7
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { Tooltip as u, TooltipContent as d, TooltipProvider as f, TooltipTrigger as p } from "@cognite/aura/components/tooltip";
9
+ import { IconLink as m, IconTrash as h } from "@tabler/icons-react";
10
+ import { Label as g } from "@cognite/aura/components/label";
11
+ import { Popover as _, PopoverContent as v, PopoverTrigger as y } from "@cognite/aura/components/popover";
12
+ import { cn as b } from "@cognite/aura/utils";
12
13
  //#region libs/shared/reveal-components/src/ui/components/commandBased/treeView/TreeView/extraComponents/CadTreeAssetMappingDropdown.tsx
13
- var y = 28;
14
- function b({ cadTreeNode: p }) {
15
- let { useInstancesByIdsQuery: m } = i(r), y = p.getInstanceMappings(), { data: b } = m(y.map((e) => t(e.instance)));
16
- if (y === void 0 || b === void 0 || b.size === 0) return /* @__PURE__ */ o(a, {});
17
- let S = async (e) => {
14
+ var x = 28;
15
+ function S({ cadTreeNode: h }) {
16
+ let { useInstancesByIdsQuery: g } = a(i), x = r(() => h.getInstanceMappings(), h.updateSignal, [h]), { data: S } = g(o(() => x.map((e) => t(e.instance)), [x]));
17
+ if (S === void 0 || S.size === 0) return /* @__PURE__ */ c(s, {});
18
+ let w = async (e) => {
18
19
  try {
19
- await p.deleteInstanceMapping(e);
20
+ await h.deleteInstanceMapping(e);
20
21
  } catch (e) {
21
22
  console.error("CAD Instance mapping deletion failed: ", e);
22
23
  }
23
24
  };
24
- return /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o(u, {
25
+ return /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c(f, {
25
26
  delayDuration: 500,
26
- children: /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, { children: /* @__PURE__ */ s(h, { children: [/* @__PURE__ */ o(_, { render: /* @__PURE__ */ o("div", {
27
+ children: /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(p, { children: /* @__PURE__ */ l(_, { children: [/* @__PURE__ */ c(y, { render: /* @__PURE__ */ c("div", {
27
28
  role: "button",
28
29
  tabIndex: 0,
29
- className: v("flex shrink-0 items-center justify-center rounded-lg", "hover:bg-accent-background", "cursor-pointer transition-all"),
30
- children: /* @__PURE__ */ o(f, { className: "size-4" })
31
- }) }), /* @__PURE__ */ o(g, {
30
+ className: b("flex shrink-0 items-center justify-center rounded-lg", "hover:bg-accent-background", "cursor-pointer transition-all"),
31
+ children: /* @__PURE__ */ c(m, { className: "size-4" })
32
+ }) }), /* @__PURE__ */ c(v, {
32
33
  side: "right",
33
34
  align: "start",
34
35
  sideOffset: 2,
35
36
  className: "p-0 flex justify-between",
36
- children: /* @__PURE__ */ o("div", {
37
+ children: /* @__PURE__ */ c("div", {
37
38
  className: "max-h-[600px] w-full overflow-x-hidden overflow-y-auto flex p-1.5 flex-col gap-1.5 rounded-lg bg-white shadow-[0px_1px_16px_4px_rgba(79,82,104,0.1),0px_1px_8px_0px_rgba(79,82,104,0.08),0px_1px_2px_0px_rgba(79,82,104,0.24)]",
38
- children: y.map((r) => {
39
- let i = n(t(r.instance)), a = b.get(i);
40
- return /* @__PURE__ */ o(x, {
39
+ children: x.map((r) => {
40
+ let i = n(t(r.instance)), a = S.get(i);
41
+ return /* @__PURE__ */ c(C, {
41
42
  name: a?.name ?? `${i}`,
42
- deleteDelegate: p.canDelete ? () => S(r) : void 0
43
+ deleteDelegate: h.canDelete ? () => w(r) : void 0
43
44
  }, e(r.instance));
44
45
  })
45
46
  })
46
- })] }) }), /* @__PURE__ */ o(l, {
47
+ })] }) }), /* @__PURE__ */ c(d, {
47
48
  side: "right",
48
49
  children: "Show asset mappings"
49
50
  })] })
50
51
  }) });
51
52
  }
52
- function x({ name: e, deleteDelegate: t }) {
53
- let n = e.length !== void 0 && e.length > y ? `${e.slice(0, y)}...` : e;
54
- return /* @__PURE__ */ s("div", {
53
+ function C({ name: e, deleteDelegate: t }) {
54
+ let n = e.length !== void 0 && e.length > x ? `${e.slice(0, x)}...` : e;
55
+ return /* @__PURE__ */ l("div", {
55
56
  className: "flex flex-row justify-between",
56
- children: [/* @__PURE__ */ o(u, { children: /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, { render: /* @__PURE__ */ o(m, {
57
+ children: [/* @__PURE__ */ c(f, { children: /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(p, { render: /* @__PURE__ */ c(g, {
57
58
  className: "p-0",
58
59
  children: n
59
- }) }), /* @__PURE__ */ o(l, { children: e })] }) }), t !== void 0 && /* @__PURE__ */ o("div", {
60
+ }) }), /* @__PURE__ */ c(d, { children: e })] }) }), t !== void 0 && /* @__PURE__ */ c("div", {
60
61
  role: "button",
61
62
  tabIndex: 0,
62
- className: v("inline-flex size-5 shrink-0 items-center justify-center rounded-sm", "text-destructive-foreground-on-critical", "hover:bg-destructive-background-hover", "cursor-pointer transition-all"),
63
+ className: b("inline-flex size-5 shrink-0 items-center justify-center rounded-sm", "text-destructive-foreground-on-critical", "hover:bg-destructive-background-hover", "cursor-pointer transition-all"),
63
64
  onClick: t,
64
- children: /* @__PURE__ */ o(p, {})
65
+ children: /* @__PURE__ */ c(h, {})
65
66
  })]
66
67
  });
67
68
  }
68
69
  //#endregion
69
- export { b as CadTreeAssetMappingDropdown };
70
+ export { S as CadTreeAssetMappingDropdown };
@@ -32,6 +32,7 @@ var u = ({ node: r, level: u, props: d, openContextMenu: p }) => {
32
32
  /* @__PURE__ */ c("div", {
33
33
  className: "flex flex-row items-center tree-view-node-row gap-1.5",
34
34
  role: "row",
35
+ onClick: (e) => e.stopPropagation(),
35
36
  children: [
36
37
  /* @__PURE__ */ s(_, { node: r }),
37
38
  E && /* @__PURE__ */ s(v, {
@@ -13,6 +13,7 @@ export type TreeViewProps = {
13
13
  maxLabelLength?: number;
14
14
  onSelectNode?: TreeNodeSelectAction;
15
15
  onToggleNode?: TreeNodeAction;
16
+ onClickBackground?: () => void;
16
17
  onClickInfo?: TreeNodeAction;
17
18
  getContextMenu?: GetTreeNodeContextMenu;
18
19
  onKeyDown?: (root: TreeNodeType, event: KeyboardEvent) => boolean;
@@ -4,50 +4,52 @@ import { forwardRef as n, useCallback as r, useContext as i, useState as a } fro
4
4
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
5
5
  //#region libs/shared/reveal-components/src/ui/components/commandBased/treeView/TreeView/tree-view.tsx
6
6
  var l = n((n, l) => {
7
- let { loader: u, onKeyDown: d, getContextMenu: f, showRoot: p, className: m } = n, h = u?.root ?? n.root, { Loader: g, TreeViewNode: _, TreeViewContextMenu: v } = i(t), [y, b] = a(0), [x, S] = a(void 0);
8
- h === void 0 && u?.loadInitialRoot !== void 0 && u.loadInitialRoot().then(() => {
9
- b((e) => e + 1);
7
+ let { loader: u, onKeyDown: d, onClickBackground: f, getContextMenu: p, showRoot: m, className: h } = n, g = u?.root ?? n.root, { Loader: _, TreeViewNode: v, TreeViewContextMenu: y } = i(t), [b, x] = a(0), [S, C] = a(void 0);
8
+ g === void 0 && u?.loadInitialRoot !== void 0 && u.loadInitialRoot().then(() => {
9
+ x((e) => e + 1);
10
10
  });
11
- let C = r((e, t) => {
12
- if (f !== void 0) {
13
- let n = f(e);
14
- n !== void 0 && n.length > 0 && S({
11
+ let w = r((e, t) => {
12
+ if (p !== void 0) {
13
+ let n = p(e);
14
+ n !== void 0 && n.length > 0 && C({
15
15
  commands: n,
16
16
  position: t
17
17
  });
18
18
  }
19
- }, [f]), w = r((e) => {
20
- h !== void 0 && d !== void 0 && d(h, e.nativeEvent) && e.preventDefault();
21
- }, [d, h]);
22
- if (h === void 0) return /* @__PURE__ */ s(g, {});
23
- let T = p === !1 ? /* @__PURE__ */ s("div", {
19
+ }, [p]), T = r((e) => {
20
+ g !== void 0 && d !== void 0 && d(g, e.nativeEvent) && e.preventDefault();
21
+ }, [d, g]);
22
+ if (g === void 0) return /* @__PURE__ */ s(_, {});
23
+ let E = m === !1 ? /* @__PURE__ */ s("div", {
24
24
  ref: l,
25
- className: `overflow-auto m-2 outline-none w-auto h-auto whitespace-nowrap pb-1${m === void 0 ? "" : ` ${m}`}`,
26
- onKeyDown: w,
25
+ className: `overflow-auto m-2 outline-none w-auto h-auto whitespace-nowrap pb-1${h === void 0 ? "" : ` ${h}`}`,
26
+ onKeyDown: T,
27
+ onClick: f,
27
28
  tabIndex: 0,
28
29
  role: "tree",
29
- children: e(h, u, !1)?.map((e) => /* @__PURE__ */ s(_, {
30
+ children: e(g, u, !1)?.map((e) => /* @__PURE__ */ s(v, {
30
31
  node: e,
31
32
  level: 0,
32
33
  props: n,
33
- openContextMenu: C
34
+ openContextMenu: w
34
35
  }, e.id))
35
36
  }) : /* @__PURE__ */ s("div", {
36
37
  ref: l,
37
- className: `overflow-auto m-2 outline-none w-auto h-auto whitespace-nowrap pb-1${m === void 0 ? "" : ` ${m}`}`,
38
- onKeyDown: w,
38
+ className: `overflow-auto m-2 outline-none w-auto h-auto whitespace-nowrap pb-1${h === void 0 ? "" : ` ${h}`}`,
39
+ onKeyDown: T,
40
+ onClick: f,
39
41
  tabIndex: 0,
40
42
  role: "tree",
41
- children: /* @__PURE__ */ s(_, {
42
- node: h,
43
+ children: /* @__PURE__ */ s(v, {
44
+ node: g,
43
45
  level: 0,
44
46
  props: n,
45
- openContextMenu: C
46
- }, h.id)
47
+ openContextMenu: w
48
+ }, g.id)
47
49
  });
48
- return /* @__PURE__ */ c(o, { children: [T, x !== void 0 && /* @__PURE__ */ s(v, {
49
- state: x,
50
- onClose: () => S(void 0)
50
+ return /* @__PURE__ */ c(o, { children: [E, S !== void 0 && /* @__PURE__ */ s(y, {
51
+ state: S,
52
+ onClose: () => C(void 0)
51
53
  })] });
52
54
  });
53
55
  //#endregion
@@ -7,7 +7,7 @@ import { createContext as a, useContext as o, useEffect as s, useState as c } fr
7
7
  import { jsx as l } from "react/jsx-runtime";
8
8
  //#region libs/shared/reveal-components/src/ui/components/i18n/I18n.tsx
9
9
  var u = a(null), d = (i, a = !0) => {
10
- let o = i ?? r() ?? "en", [l, u] = c(o), [d, f] = c({});
10
+ let o = i ?? r() ?? "en", [l, u] = c(o), [d, f] = c({}), p = l === "en" ? t : d;
11
11
  return s(() => {
12
12
  if (!a) return;
13
13
  let e = () => {
@@ -18,7 +18,7 @@ var u = a(null), d = (i, a = !0) => {
18
18
  window.removeEventListener("languagechange", e);
19
19
  };
20
20
  }, [a, l]), s(() => {
21
- a && (async () => {
21
+ !a || l === "en" || (async () => {
22
22
  try {
23
23
  let t = await e(/* #__PURE__ */ Object.assign({
24
24
  "../../../common/i18n/de/reveal-components.json": () => import("../../../common/i18n/de/reveal-components.js"),
@@ -44,7 +44,7 @@ var u = a(null), d = (i, a = !0) => {
44
44
  });
45
45
  }, [l, a]), {
46
46
  currentLanguage: l,
47
- t: (e) => n(e) ? d[e.key] === void 0 ? t[e.key] : d[e.key] : e.untranslated
47
+ t: (e) => n(e) ? p[e.key] === void 0 ? t[e.key] : p[e.key] : e.untranslated
48
48
  };
49
49
  }, f = (e) => {
50
50
  let t = o(u), n = r() ?? "en", i = d(e ?? n, t === null);
@@ -15,4 +15,4 @@ export { RevealContext, type RevealContextProps } from './RevealContext';
15
15
  export { RevealToolbar } from './RevealToolbar';
16
16
  export { SceneContainer, type SceneContainerProps, type SceneIdentifiers, useLoadedScene, } from './SceneContainer';
17
17
  export { type BooleanCondition, type BooleanConditionTypes, type BooleanExpression, type ColorRuleOutput, type ConcreteExpression, type CriteriaTypes, type DatetimeBetweenConditionType, type DatetimeCondition, type DatetimeConditionTypes, type DatetimeExpression, type DatetimeUniqueConditionTypes, type Expression, type ExpressionOperator, type ExpressionOperatorsTypes, type FdmInstanceNodeDataKey, type FdmKeyRuleTriggerTyping, type FdmRuleTrigger, type FdmRuleTriggerTyping, getRuleTriggerTypes, type MetadataRuleTrigger, type NumericCondition, type NumericConditionTypes, type NumericExpression, type NumericOutsideConditionType, type NumericUniqueConditionTypes, type NumericWithinConditionType, type Rule, type RuleAndEnabled, RuleBasedOutputsPanel, type RuleOutput, type RuleOutputSet, type RuleWithOutputs, type StringCondition, type StringConditionTypes, type StringExpression, type TimeseriesRuleTrigger, type TriggerType, useCreateRuleInstance, useDeleteRuleInstance, useEditRuleInstance, useFetchRuleInstances, useSearchRuleInstance, } from './RuleBasedOutputs';
18
- export { RevealWidget, RevealWidgetCameraController, RevealWidgetController, type RevealWidgetProps, Default3DStyles, } from './Widget';
18
+ export { RevealWidget, RevealWidgetCameraController, RevealWidgetController, type RevealWidgetProps, type RevealWidgetTrackingProps, Default3DStyles, } from './Widget';
@@ -1,14 +1,14 @@
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 { getRelationships as n } from "./getRelationships.js";
4
4
  import { chunk as r } from "lodash-es";
5
5
  //#region libs/shared/reveal-components/src/ui/hooks/network/fetchLinkFromRelationshipsByTimeseries.ts
6
6
  var i = 1e3, a = async (a, o, s) => {
7
7
  let c = r(o, i);
8
- return (await e(c.map((e) => async () => await n(a, {
8
+ return (await t(c.map((e) => async () => await n(a, {
9
9
  resourceExternalIds: e,
10
10
  relationshipResourceTypes: s
11
- })), 2)).filter(t).flat()?.map((e) => {
11
+ })), 2)).filter(e).flat()?.map((e) => {
12
12
  let t = {
13
13
  assetIds: { externalId: "" },
14
14
  timeseriesIds: { externalId: "" }
@@ -1,11 +1,11 @@
1
1
  import { restrictToDmsId as e } from "../../../utilities/restrictToDmsId.js";
2
- import { createDmsQueryDataAccumulator as t } from "../../../utilities/dms-cursoring/dmsAccumulator.js";
3
- import { COGNITE_IMAGE_360_SOURCE as n, COGNITE_VISUALIZABLE_SOURCE as r } from "../../../data-providers/core-dm-provider/dataModels.js";
2
+ import { COGNITE_IMAGE_360_SOURCE as t, COGNITE_VISUALIZABLE_SOURCE as n } from "../../../data-providers/core-dm-provider/dataModels.js";
3
+ import { createDmsQueryDataAccumulator as r } from "../../../utilities/dms-cursoring/dmsAccumulator.js";
4
4
  import { hasDataImage360AnnotationContainerFilter as i, hasDataImage360ContainerFilter as a, hasDataObject3DContainerFilter as o, hasDataVisualizableContainerFilter as s, isCoreDmImage360CollectionFilter as c } from "../../../data-providers/core-dm-provider/utils/filters.js";
5
5
  //#region libs/shared/reveal-components/src/ui/hooks/network/getImage360CollectionsForDmInstance.ts
6
- async function l(n, r) {
7
- let i = u(n);
8
- return (await t(r, i, { serial: [
6
+ async function l(t, n) {
7
+ let i = u(t);
8
+ return (await r(n, i, { serial: [
9
9
  "image_360_annotations",
10
10
  "image_360s",
11
11
  "image_360_collections"
@@ -22,7 +22,7 @@ function u(e) {
22
22
  object_3ds: { nodes: {
23
23
  from: "asset",
24
24
  through: {
25
- view: r,
25
+ view: n,
26
26
  identifier: "object3D"
27
27
  },
28
28
  direction: "outwards",
@@ -41,7 +41,7 @@ function u(e) {
41
41
  image_360_collections: { nodes: {
42
42
  from: "image_360s",
43
43
  through: {
44
- view: n,
44
+ view: t,
45
45
  identifier: "collection360"
46
46
  },
47
47
  direction: "outwards",
@@ -1,10 +1,10 @@
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 { chunk as n } from "lodash-es";
4
4
  //#region libs/shared/reveal-components/src/ui/hooks/network/getTimeseriesLatestDatapoints.ts
5
5
  var r = 100, i = async (i, a) => {
6
6
  let o = n(a, r);
7
- return (await e(o.map((e) => async () => await i.datapoints.retrieveLatest(e)), 2)).filter(t).flat();
7
+ return (await t(o.map((e) => async () => await i.datapoints.retrieveLatest(e)), 2)).filter(e).flat();
8
8
  };
9
9
  //#endregion
10
10
  export { i as getTimeseriesLatestDatapoints };
@@ -1,10 +1,10 @@
1
- import { isDefined as e } from "../../../utilities/isDefined.js";
2
- import { isDmAsset as t } from "../../../utilities/instances/typeGuards.js";
1
+ import { isDmAsset as e } from "../../../utilities/instances/typeGuards.js";
3
2
  import "../../../utilities/instances/index.js";
3
+ import { isDefined as t } from "../../../utilities/isDefined.js";
4
4
  //#region libs/shared/reveal-components/src/ui/hooks/pointClouds/fetchAnnotationsForModel.ts
5
5
  var n = async (n, r, i, a) => {
6
- if (n !== void 0 && r !== void 0 && i !== void 0) return (await Promise.all(i.map(async (e) => await a.matchPointCloudAnnotationsForModel(n, r, e)))).filter(e).flatMap((e) => Array.from(e.entries()).flatMap(([e, n]) => n.map((n) => (t(n), {
7
- annotationId: e,
6
+ if (n !== void 0 && r !== void 0 && i !== void 0) return (await Promise.all(i.map(async (e) => await a.matchPointCloudAnnotationsForModel(n, r, e)))).filter(t).flatMap((t) => Array.from(t.entries()).flatMap(([t, n]) => n.map((n) => (e(n), {
7
+ annotationId: t,
8
8
  asset: n
9
9
  }))));
10
10
  };