ebta-workflow-prod 4.0.2 → 4.0.3
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/build/main.js +1 -1
- package/package.json +1 -1
- package/src/elements/Viewer360.tsx +39 -5
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
|
|
3
3
|
import { Pannellum } from "pannellum-react-update";
|
|
4
|
-
|
|
5
|
-
import "pannellum-react-update/lib/pannellum/css/img/
|
|
6
|
-
import "pannellum-react-update/lib/pannellum/css/img/
|
|
7
|
-
import "pannellum-react-update/lib/pannellum/css/img/
|
|
8
|
-
import "pannellum-react-update/lib/pannellum/css/img/
|
|
4
|
+
|
|
5
|
+
// import "pannellum-react-update/lib/pannellum/css/img/background.svg";
|
|
6
|
+
// import "pannellum-react-update/lib/pannellum/css/img/compass.svg";
|
|
7
|
+
// import "pannellum-react-update/lib/pannellum/css/img/grab.svg";
|
|
8
|
+
// import "pannellum-react-update/lib/pannellum/css/img/grabbing.svg";
|
|
9
|
+
// import "pannellum-react-update/lib/pannellum/css/img/sprites.svg";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The generic type argument provided to `FormElementProps<T>` controls the type
|
|
@@ -39,6 +40,39 @@ interface Viewer360Props extends FormElementProps<string> {
|
|
|
39
40
|
*/
|
|
40
41
|
function Viewer360(props: Viewer360Props): React.ReactElement {
|
|
41
42
|
const { setting, value , pitch ,yaw, hfov, minHfov , haov, vaov, raiseEvent } = props;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// Copy SVG assets to consumer's public folder and reference them
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
// Ensure pannellum CSS has correct asset paths
|
|
48
|
+
const customCSS = `
|
|
49
|
+
.pnlm-container {
|
|
50
|
+
background-image: url('/img/background.svg');
|
|
51
|
+
}
|
|
52
|
+
.pnlm-compass {
|
|
53
|
+
background-image: url ('/img/compass.svg');
|
|
54
|
+
}
|
|
55
|
+
.pnlm-grab {
|
|
56
|
+
cursor: url( '/img/grab.svg'), grab;
|
|
57
|
+
}
|
|
58
|
+
.pnlm-grabbing {
|
|
59
|
+
cursor: url( '/img/grabbing.svg'), grabbing;
|
|
60
|
+
}
|
|
61
|
+
.pnlm-sprite {
|
|
62
|
+
background-image: url( '/img/sprites.svg');
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
const styleElement = document.createElement('style');
|
|
67
|
+
styleElement.textContent = customCSS;
|
|
68
|
+
document.head.appendChild(styleElement);
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
document.head.removeChild(styleElement);
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
|
|
75
|
+
|
|
42
76
|
console.log("rendering 360VIEWER")
|
|
43
77
|
return (
|
|
44
78
|
<>
|