@cognite/reveal-components 1.0.0 → 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/README.md +1 -1
- package/dist/assets/poi-markers/poi-create-cursor.js +4 -0
- package/dist/common/i18n/en/reveal-components.js +183 -178
- package/dist/data-providers/Fdm3dDataProvider.d.ts +3 -3
- 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/RevisionFdmNodeCache.d.ts +3 -2
- package/dist/data-providers/cache/RevisionFdmNodeCache.js +65 -39
- package/dist/data-providers/cache/annotationModelUtils.js +8 -6
- package/dist/data-providers/cache/cad/CadInstanceMappingsCache.d.ts +5 -2
- package/dist/data-providers/cache/cad/CadInstanceMappingsCacheImpl.js +9 -6
- package/dist/data-providers/cache/cad/FdmCadNodeCache.d.ts +3 -1
- package/dist/data-providers/cache/cad/FdmCadNodeCacheImpl.d.ts +5 -0
- package/dist/data-providers/cache/cad/FdmCadNodeCacheImpl.js +8 -3
- package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.d.ts +3 -3
- 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.d.ts +2 -3
- 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/index.d.ts +2 -1
- package/dist/data-providers/index.js +2 -0
- package/dist/data-providers/legacy-fdm-provider/LegacyFdm3dDataProvider.d.ts +3 -3
- package/dist/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.js +3 -3
- package/dist/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.d.ts +3 -3
- package/dist/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.js +1 -1
- 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 +4 -2
- package/dist/domains/index.js +3 -1
- 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/cad-tree-node.d.ts +1 -0
- package/dist/foundation/treeNodes/cad-tree-node/cad-tree-node.js +4 -1
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.js +2 -5
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.d.ts +14 -0
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.js +23 -0
- 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/pointsOfInterest/PoiCommentSection.js +6 -6
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.context.d.ts +16 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.context.js +6 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.d.ts +15 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.function.d.ts +5 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.function.js +14 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.js +105 -0
- 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 +27 -13
- 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/useCadNode3DInfo.d.ts +8 -0
- package/dist/ui/query/useCadNode3DInfo.js +24 -0
- 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/queryKeys.d.ts +2 -0
- package/dist/utilities/queryKeys.js +7 -0
- 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 +7 -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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useTranslation as e } from "../../../i18n/I18n.js";
|
|
2
|
+
import { CadNodeInfoDialogContext as t } from "./CadNodeInfoDialog.context.js";
|
|
3
|
+
import { PRIORITY_CATEGORY as n, formatPropertyValue as r, getCdfMetadataEntries as i, getOtherCategories as a } from "./CadNodeInfoDialog.function.js";
|
|
4
|
+
import { useContext as o, useMemo as s } from "react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { Dialog as u, DialogContent as d, DialogHeader as f, DialogTitle as p } from "@cognite/aura/components/dialog";
|
|
7
|
+
import { EmptyState as m, EmptyStateIcon as h, EmptyStateTitle as g } from "@cognite/aura/components/empty-state";
|
|
8
|
+
import { Loader as _ } from "@cognite/aura/components/loader";
|
|
9
|
+
import { Tabs as v, TabsLabel as y, TabsList as b, TabsPanel as x, TabsTrigger as S } from "@cognite/aura/components/tabs";
|
|
10
|
+
//#region libs/shared/reveal-components/src/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.tsx
|
|
11
|
+
var C = "cdf-metadata", w = ({ open: t, onOpenChange: r, node: o, isLoading: s, isError: w }) => {
|
|
12
|
+
let { t: T } = e(), D = Object.keys(o?.properties ?? {}).includes(n), O = a(o), k = D ? n : C;
|
|
13
|
+
return /* @__PURE__ */ c(u, {
|
|
14
|
+
open: t,
|
|
15
|
+
onOpenChange: r,
|
|
16
|
+
children: /* @__PURE__ */ l(d, {
|
|
17
|
+
className: "flex h-[560px] max-w-2xl flex-col sm:max-w-2xl",
|
|
18
|
+
children: [/* @__PURE__ */ c(f, { children: /* @__PURE__ */ c(p, { children: T({ key: "NODE_PROPERTIES" }) }) }), s ? /* @__PURE__ */ c(_, {}) : w ? /* @__PURE__ */ c("div", {
|
|
19
|
+
className: "flex min-h-full flex-1 flex-col items-center justify-center",
|
|
20
|
+
children: /* @__PURE__ */ l(m, {
|
|
21
|
+
variant: "compact",
|
|
22
|
+
type: "error-generic",
|
|
23
|
+
children: [/* @__PURE__ */ c(h, {}), /* @__PURE__ */ c(g, {
|
|
24
|
+
as: "p",
|
|
25
|
+
children: T({ key: "NODE_PROPERTIES_LOAD_ERROR" })
|
|
26
|
+
})]
|
|
27
|
+
})
|
|
28
|
+
}) : o === void 0 ? /* @__PURE__ */ c(_, {}) : /* @__PURE__ */ l(v, {
|
|
29
|
+
defaultValue: k,
|
|
30
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
31
|
+
children: [/* @__PURE__ */ l(b, {
|
|
32
|
+
size: "small",
|
|
33
|
+
children: [
|
|
34
|
+
D && /* @__PURE__ */ c(S, {
|
|
35
|
+
value: "Item",
|
|
36
|
+
size: "small",
|
|
37
|
+
children: /* @__PURE__ */ c(y, { children: "Item" })
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ c(S, {
|
|
40
|
+
value: C,
|
|
41
|
+
size: "small",
|
|
42
|
+
children: /* @__PURE__ */ c(y, { children: T({ key: "CDF_METADATA" }) })
|
|
43
|
+
}),
|
|
44
|
+
O.map((e) => /* @__PURE__ */ c(S, {
|
|
45
|
+
value: e,
|
|
46
|
+
size: "small",
|
|
47
|
+
children: /* @__PURE__ */ c(y, { children: e })
|
|
48
|
+
}, e))
|
|
49
|
+
]
|
|
50
|
+
}), /* @__PURE__ */ l("div", {
|
|
51
|
+
className: "min-h-0 flex-1 pt-2",
|
|
52
|
+
children: [
|
|
53
|
+
D && /* @__PURE__ */ c(x, {
|
|
54
|
+
value: "Item",
|
|
55
|
+
className: "h-full",
|
|
56
|
+
children: /* @__PURE__ */ c(E, { entries: Object.entries(o.properties?.Item ?? {}) })
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ c(x, {
|
|
59
|
+
value: C,
|
|
60
|
+
className: "h-full",
|
|
61
|
+
children: /* @__PURE__ */ c(E, { entries: i(o) })
|
|
62
|
+
}),
|
|
63
|
+
O.map((e) => /* @__PURE__ */ c(x, {
|
|
64
|
+
value: e,
|
|
65
|
+
className: "h-full",
|
|
66
|
+
children: /* @__PURE__ */ c(E, { entries: Object.entries(o.properties?.[e] ?? {}) })
|
|
67
|
+
}, e))
|
|
68
|
+
]
|
|
69
|
+
})]
|
|
70
|
+
}, o.id)]
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}, T = 64;
|
|
74
|
+
function E({ entries: n }) {
|
|
75
|
+
let { DataGrid: i } = o(t), { t: a } = e(), l = n.map(([e, t]) => ({
|
|
76
|
+
id: e,
|
|
77
|
+
key: e,
|
|
78
|
+
value: r(t)
|
|
79
|
+
})), u = s(() => [{
|
|
80
|
+
accessorKey: "key",
|
|
81
|
+
header: a({ key: "PROPERTY" }),
|
|
82
|
+
size: 200
|
|
83
|
+
}, {
|
|
84
|
+
accessorKey: "value",
|
|
85
|
+
header: a({ key: "VALUE" }),
|
|
86
|
+
cell: ({ row: e }) => /* @__PURE__ */ c("span", {
|
|
87
|
+
className: "line-clamp-3 whitespace-normal break-words",
|
|
88
|
+
title: e.original.value,
|
|
89
|
+
children: e.original.value
|
|
90
|
+
})
|
|
91
|
+
}], [a]);
|
|
92
|
+
return /* @__PURE__ */ c("div", {
|
|
93
|
+
className: "h-full",
|
|
94
|
+
children: /* @__PURE__ */ c(i, {
|
|
95
|
+
data: l,
|
|
96
|
+
columns: u,
|
|
97
|
+
rowHeight: T,
|
|
98
|
+
getRowId: (e) => e.id,
|
|
99
|
+
"aria-label": "Node properties",
|
|
100
|
+
className: "bg-background"
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { w as CadNodeInfoDialog };
|
|
@@ -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
|
|
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 (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
18
|
+
function i(e) {
|
|
15
19
|
e.toggleVisible?.();
|
|
16
20
|
}
|
|
17
|
-
function
|
|
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,
|
|
29
|
+
export { r as clearAllCadNodeSelections, o as getContextMenu, a as onClickTreeViewBackground, n as onSelectDomainObject, i as onToggleDomainObject };
|
package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.js
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import { useRenderTarget as e } from "../../../RevealCanvas/ViewerContext.js";
|
|
2
2
|
import { IconFactory as t } from "../../Factories/IconFactory.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { CadTreeNodeViewAdapter as n } from "../../../../../foundation/treeNodes/cad-tree-node/cad-tree-node-view-adapter.js";
|
|
4
|
+
import { useCadNode3DInfo as r } from "../../../../query/useCadNode3DInfo.js";
|
|
5
|
+
import { TreeView as i } from "../TreeView/tree-view.js";
|
|
6
|
+
import { CadNodeInfoDialog as a } from "./CadNodeInfoDialog.js";
|
|
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";
|
|
6
10
|
//#region libs/shared/reveal-components/src/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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),
|
|
22
|
+
getContextMenu: o,
|
|
15
23
|
getIconFromIconName: t.getIcon
|
|
16
|
-
})
|
|
24
|
+
}), /* @__PURE__ */ f(a, {
|
|
25
|
+
open: v,
|
|
26
|
+
onOpenChange: y,
|
|
27
|
+
node: x,
|
|
28
|
+
isLoading: S,
|
|
29
|
+
isError: C
|
|
30
|
+
})] });
|
|
17
31
|
};
|
|
18
32
|
//#endregion
|
|
19
|
-
export {
|
|
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
|
|
5
|
-
import { useContext as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { IconLink as
|
|
9
|
-
import { Label as
|
|
10
|
-
import { Popover as
|
|
11
|
-
import { cn as
|
|
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
|
|
14
|
-
function
|
|
15
|
-
let { useInstancesByIdsQuery:
|
|
16
|
-
if (
|
|
17
|
-
let
|
|
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
|
|
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__ */
|
|
25
|
+
return /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c(f, {
|
|
25
26
|
delayDuration: 500,
|
|
26
|
-
children: /* @__PURE__ */
|
|
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:
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
}) }), /* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
39
|
-
let i = n(t(r.instance)), a =
|
|
40
|
-
return /* @__PURE__ */
|
|
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: () =>
|
|
43
|
+
deleteDelegate: h.canDelete ? () => w(r) : void 0
|
|
43
44
|
}, e(r.instance));
|
|
44
45
|
})
|
|
45
46
|
})
|
|
46
|
-
})] }) }), /* @__PURE__ */
|
|
47
|
+
})] }) }), /* @__PURE__ */ c(d, {
|
|
47
48
|
side: "right",
|
|
48
49
|
children: "Show asset mappings"
|
|
49
50
|
})] })
|
|
50
51
|
}) });
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
let n = e.length !== void 0 && e.length >
|
|
54
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
60
|
+
}) }), /* @__PURE__ */ c(d, { children: e })] }) }), t !== void 0 && /* @__PURE__ */ c("div", {
|
|
60
61
|
role: "button",
|
|
61
62
|
tabIndex: 0,
|
|
62
|
-
className:
|
|
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__ */
|
|
65
|
+
children: /* @__PURE__ */ c(h, {})
|
|
65
66
|
})]
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
//#endregion
|
|
69
|
-
export {
|
|
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,
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
12
|
-
if (
|
|
13
|
-
let n =
|
|
14
|
-
n !== void 0 && n.length > 0 &&
|
|
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
|
-
}, [
|
|
20
|
-
|
|
21
|
-
}, [d,
|
|
22
|
-
if (
|
|
23
|
-
let
|
|
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${
|
|
26
|
-
onKeyDown:
|
|
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(
|
|
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:
|
|
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${
|
|
38
|
-
onKeyDown:
|
|
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:
|
|
43
|
+
children: /* @__PURE__ */ s(v, {
|
|
44
|
+
node: g,
|
|
43
45
|
level: 0,
|
|
44
46
|
props: n,
|
|
45
|
-
openContextMenu:
|
|
46
|
-
},
|
|
47
|
+
openContextMenu: w
|
|
48
|
+
}, g.id)
|
|
47
49
|
});
|
|
48
|
-
return /* @__PURE__ */ c(o, { children: [
|
|
49
|
-
state:
|
|
50
|
-
onClose: () =>
|
|
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
|
|
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) ?
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
8
|
+
return (await t(c.map((e) => async () => await n(a, {
|
|
9
9
|
resourceExternalIds: e,
|
|
10
10
|
relationshipResourceTypes: s
|
|
11
|
-
})), 2)).filter(
|
|
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 {
|
|
3
|
-
import {
|
|
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(
|
|
7
|
-
let i = u(
|
|
8
|
-
return (await
|
|
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:
|
|
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:
|
|
44
|
+
view: t,
|
|
45
45
|
identifier: "collection360"
|
|
46
46
|
},
|
|
47
47
|
direction: "outwards",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
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 {
|
|
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(
|
|
7
|
-
annotationId:
|
|
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
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { isDmsInstance as e, isExternalId as t, isInternalId as n } from "../../../utilities/instanceIds/typeGuards.js";
|
|
2
2
|
import "../../../utilities/instanceIds/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { isDmAsset as i } from "../../../utilities/instances/typeGuards.js";
|
|
3
|
+
import { isDmAsset as r } from "../../../utilities/instances/typeGuards.js";
|
|
5
4
|
import "../../../utilities/instances/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { queryKeys as i } from "../../../utilities/queryKeys.js";
|
|
6
|
+
import { inspectNodes as a } from "../../../data-providers/cache/requests.js";
|
|
7
|
+
import { EMPTY_ARRAY as o } from "../../../utilities/constants.js";
|
|
8
8
|
import { getPointCloudInstanceFromIntersection as s } from "./getPointCloudInstanceFromIntersection.js";
|
|
9
9
|
import { UsePointCloudAnnotationMappingForIntersectionContext as c } from "./usePointCloudAnnotationMappingForIntersection.context.js";
|
|
10
10
|
import { useContext as l } from "react";
|
|
11
11
|
import { useQuery as u } from "@tanstack/react-query";
|
|
12
12
|
//#region libs/shared/reveal-components/src/ui/hooks/pointClouds/usePointCloudAnnotationMappingForIntersection.ts
|
|
13
13
|
var d = (e) => {
|
|
14
|
-
let { useFdmSdk: t, usePointCloudAnnotationCache: n, fetchAnnotationsForModel:
|
|
14
|
+
let { useFdmSdk: t, usePointCloudAnnotationCache: n, fetchAnnotationsForModel: a } = l(c), d = t(), m = n(), h = e?.type === "pointcloud", g = s(e), _ = g?.classicModelIdentifier, v = g?.instanceReference, y = _ === void 0 ? "" : `${_.modelId}/${_.revisionId}`, b = f(v);
|
|
15
15
|
return u({
|
|
16
|
-
queryKey: [
|
|
16
|
+
queryKey: [i.pointCloudAnnotationForAssetId(y, b)],
|
|
17
17
|
queryFn: async () => {
|
|
18
|
-
if (_ === void 0 || v === void 0) return
|
|
19
|
-
let e = await
|
|
20
|
-
if (e === void 0 || e.length === 0) return
|
|
18
|
+
if (_ === void 0 || v === void 0) return o;
|
|
19
|
+
let e = await a(_.modelId, _.revisionId, [v], m);
|
|
20
|
+
if (e === void 0 || e.length === 0) return o;
|
|
21
21
|
let t = await p(v, d);
|
|
22
|
-
return t === void 0 || t.length === 0 ? e : e.map((e) =>
|
|
22
|
+
return t === void 0 || t.length === 0 ? e : e.map((e) => r(e.asset) ? {
|
|
23
23
|
...e,
|
|
24
24
|
views: t
|
|
25
25
|
} : e);
|
|
@@ -33,7 +33,7 @@ function f(r) {
|
|
|
33
33
|
}
|
|
34
34
|
async function p(t, n) {
|
|
35
35
|
if (e(t)) try {
|
|
36
|
-
return (await
|
|
36
|
+
return (await a(n, [t])).items[0]?.inspectionResults.involvedViews;
|
|
37
37
|
} catch {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createInstanceReferenceKey as e } from "../../../utilities/instanceIds/toKey.js";
|
|
2
2
|
import "../../../utilities/instanceIds/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { queryKeys as t } from "../../../utilities/queryKeys.js";
|
|
4
|
+
import { EMPTY_ARRAY as n } from "../../../utilities/constants.js";
|
|
5
5
|
import { fetchAnnotationsForModel as r } from "./fetchAnnotationsForModel.js";
|
|
6
6
|
import { UsePointCloudAnnotationMappingsForAssetInstancesContext as i } from "./usePointCloudAnnotationMappingsForAssetInstances.context.js";
|
|
7
7
|
import { useContext as a } from "react";
|
|
@@ -10,8 +10,8 @@ import { useQuery as o } from "@tanstack/react-query";
|
|
|
10
10
|
var s = (s, c) => {
|
|
11
11
|
let { usePointCloudAnnotationCache: l, useModelIdRevisionIdFromModelOptions: u } = a(i), d = l(), f = u(s);
|
|
12
12
|
return o({
|
|
13
|
-
queryKey: [
|
|
14
|
-
queryFn: async () => (await Promise.all(f.map(async (e) => await r(e.modelId, e.revisionId, c, d) ??
|
|
13
|
+
queryKey: [t.pointCloudAnnotationForAssetInstances(f.map((e) => `${e.modelId}/${e.revisionId}`).sort(), c?.map((t) => String(e(t))).sort() ?? [])],
|
|
14
|
+
queryFn: async () => (await Promise.all(f.map(async (e) => await r(e.modelId, e.revisionId, c, d) ?? n))).flat(),
|
|
15
15
|
staleTime: Infinity,
|
|
16
16
|
enabled: c !== void 0 && c.length > 0
|
|
17
17
|
});
|