ebta-workflow-prod 4.0.21 → 4.0.22
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.
|
Binary file
|
package/package.json
CHANGED
|
@@ -33,16 +33,23 @@ interface Viewer360Props extends FormElementProps<string> {
|
|
|
33
33
|
* @param props The props that will be provided by the Workflow runtime.
|
|
34
34
|
*/
|
|
35
35
|
function Viewer360(props: Viewer360Props): React.ReactElement {
|
|
36
|
-
const { setting, value
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
raiseEvent("clicked", JSON.stringify({ args }))
|
|
36
|
+
const { setting, value, pitch, yaw, hfov, minHfov, haov, vaov, raiseEvent } = props;
|
|
37
|
+
|
|
38
|
+
const handleHotspotClick = (evt: MouseEvent, args: { id: string; pitch: number; yaw: number }) => {
|
|
39
|
+
raiseEvent("clicked", JSON.stringify({ args }))
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
// Copy SVG assets to consumer's public folder and reference them
|
|
43
43
|
React.useEffect(() => {
|
|
44
44
|
// Ensure pannellum CSS has correct asset paths
|
|
45
45
|
const customCSS = `
|
|
46
|
+
.pnlm-hotspot.custom-hotspot {
|
|
47
|
+
width: auto;
|
|
48
|
+
height: auto;
|
|
49
|
+
overflow: visible;
|
|
50
|
+
background: none;
|
|
51
|
+
border: none;
|
|
52
|
+
}
|
|
46
53
|
.pnlm-container {
|
|
47
54
|
background-image: url('/img/background.svg');
|
|
48
55
|
}
|
|
@@ -59,17 +66,17 @@ raiseEvent("clicked", JSON.stringify({ args }))
|
|
|
59
66
|
background-image: url( '/img/sprites.svg');
|
|
60
67
|
}
|
|
61
68
|
`;
|
|
62
|
-
|
|
69
|
+
|
|
63
70
|
const styleElement = document.createElement('style');
|
|
64
71
|
styleElement.textContent = customCSS;
|
|
65
72
|
document.head.appendChild(styleElement);
|
|
66
|
-
|
|
73
|
+
|
|
67
74
|
return () => {
|
|
68
75
|
document.head.removeChild(styleElement);
|
|
69
76
|
};
|
|
70
77
|
}, []);
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
|
|
79
|
+
|
|
73
80
|
console.log("rendering 360VIEWER")
|
|
74
81
|
return (
|
|
75
82
|
<>
|
|
@@ -89,28 +96,31 @@ raiseEvent("clicked", JSON.stringify({ args }))
|
|
|
89
96
|
console.log("panorama loaded");
|
|
90
97
|
}}
|
|
91
98
|
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
hotSpotDiv
|
|
99
|
+
<Pannellum.Hotspot
|
|
100
|
+
type="custom"
|
|
101
|
+
pitch={-10}
|
|
102
|
+
yaw={130}
|
|
103
|
+
handleClick={handleHotspotClick}
|
|
104
|
+
handleClickArg={{ id: "btn-1", pitch: -10, yaw: 130 }}
|
|
105
|
+
cssClass="custom-hotspot"
|
|
106
|
+
tooltip={(hotSpotDiv: HTMLElement) => {
|
|
107
|
+
const btn = document.createElement("div");
|
|
108
|
+
btn.style.cssText = `
|
|
100
109
|
background: #0078d4;
|
|
101
110
|
color: white;
|
|
102
|
-
border: none;
|
|
103
111
|
border-radius: 6px;
|
|
104
112
|
padding: 6px 12px;
|
|
105
113
|
cursor: pointer;
|
|
106
114
|
font-size: 13px;
|
|
107
115
|
white-space: nowrap;
|
|
108
116
|
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
|
|
117
|
+
transform: translate(-50%, -100%);
|
|
109
118
|
`;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
119
|
+
btn.textContent = "📍 View Detail";
|
|
120
|
+
hotSpotDiv.appendChild(btn); // append a child, don't style the host div
|
|
121
|
+
}}
|
|
122
|
+
tooltipArg={{}}
|
|
123
|
+
/>
|
|
114
124
|
|
|
115
125
|
</Pannellum>
|
|
116
126
|
</>
|