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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebta-workflow-prod",
3
3
  "private": false,
4
- "version": "4.0.21",
4
+ "version": "4.0.22",
5
5
  "description": "",
6
6
  "license": "UNLICENSED",
7
7
  "author": "",
@@ -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 , 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 }))
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
- <Pannellum.Hotspot
93
- type="custom"
94
- pitch={-10}
95
- yaw={130}
96
- handleClick={handleHotspotClick}
97
- handleClickArg={{ id: "btn-1", pitch: -10, yaw: 130 }}
98
- tooltip={(hotSpotDiv: HTMLElement) => {
99
- hotSpotDiv.style.cssText = `
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
- hotSpotDiv.textContent = "📍 View Detail";
111
- }}
112
- tooltipArg={{}}
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
  </>