@geode/opengeodeweb-front 10.44.0-rc.8 → 10.44.0-rc.9
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.
|
@@ -17,8 +17,10 @@ export function useHoverhighlight(): {
|
|
|
17
17
|
const viewerStore = useViewerStore();
|
|
18
18
|
const dataStore = useDataStore();
|
|
19
19
|
let timer: ReturnType<typeof setTimeout> | undefined = undefined;
|
|
20
|
+
// Item hovered last, whose highlight may still be pending
|
|
20
21
|
let currentId: string | undefined = undefined;
|
|
21
|
-
|
|
22
|
+
// Item the viewer was asked to highlight, the only one to unhighlight
|
|
23
|
+
let highlighted: { id: string; type: HighlightType } | undefined = undefined;
|
|
22
24
|
|
|
23
25
|
function onHoverEnter(
|
|
24
26
|
id: string,
|
|
@@ -34,7 +36,6 @@ export function useHoverhighlight(): {
|
|
|
34
36
|
|
|
35
37
|
async function highlightAction(): Promise<void> {
|
|
36
38
|
currentId = id;
|
|
37
|
-
currentType = type;
|
|
38
39
|
|
|
39
40
|
if (!(await dataStore.isItemViewable(id))) {
|
|
40
41
|
return;
|
|
@@ -55,6 +56,7 @@ export function useHoverhighlight(): {
|
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
highlighted = { id, type };
|
|
58
60
|
const params = {
|
|
59
61
|
id,
|
|
60
62
|
visibility: true,
|
|
@@ -107,22 +109,20 @@ export function useHoverhighlight(): {
|
|
|
107
109
|
clearTimeout(timer);
|
|
108
110
|
timer = undefined;
|
|
109
111
|
}
|
|
110
|
-
if (currentId === id
|
|
111
|
-
|
|
112
|
+
if (currentId === id) {
|
|
113
|
+
currentId = undefined;
|
|
114
|
+
}
|
|
115
|
+
if (highlighted?.id === id) {
|
|
116
|
+
const { type } = highlighted;
|
|
117
|
+
const schema = vtk_schemas.opengeodeweb_viewer[type].highlight;
|
|
112
118
|
const params = {
|
|
113
119
|
id,
|
|
114
120
|
visibility: false,
|
|
115
|
-
...(
|
|
121
|
+
...(type === "model" && { block_ids: [] }),
|
|
116
122
|
};
|
|
117
123
|
// oxlint-disable-next-line typescript/no-floating-promises -- unhighlightAction catches its own errors internally.
|
|
118
|
-
unhighlightAction(
|
|
119
|
-
|
|
120
|
-
currentType = undefined;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (currentId === undefined) {
|
|
124
|
-
currentId = undefined;
|
|
125
|
-
currentType = undefined;
|
|
124
|
+
unhighlightAction(type, id, { schema, params });
|
|
125
|
+
highlighted = undefined;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
package/package.json
CHANGED