ebta-workflow-prod 4.0.1 → 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/activitypack.json +1 -1
- package/build/main.js +2 -2
- package/package.json +1 -1
- package/src/elements/SampleInput.tsx +38 -0
- package/src/elements/Viewer360.tsx +39 -5
- package/src/index.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The generic type argument provided to `FormElementProps<T>` controls the type
|
|
6
|
+
* of `props.value` and `props.setValue(value)`. If your element doesn't need a
|
|
7
|
+
* `value`, you can omit the type argument.
|
|
8
|
+
*
|
|
9
|
+
* You can also declare additional public properties of your element by adding
|
|
10
|
+
* properties to this interface. The properties will be managed by the Workflow
|
|
11
|
+
* runtime, and passed in as `props`. You can update the properties by using
|
|
12
|
+
* `props.setProperty(key, value)`.
|
|
13
|
+
*/
|
|
14
|
+
interface SampleInputProps extends FormElementProps<string> {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Workflow element built using React.
|
|
18
|
+
* @displayName SampleInput
|
|
19
|
+
* @description sampleInput
|
|
20
|
+
* @param props The props that will be provided by the Workflow runtime.
|
|
21
|
+
*/
|
|
22
|
+
function SampleInput(props: SampleInputProps): React.ReactElement {
|
|
23
|
+
const { setValue, value } = props;
|
|
24
|
+
return (
|
|
25
|
+
<input
|
|
26
|
+
onChange={(event) => setValue(event.currentTarget.value)}
|
|
27
|
+
value={value}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const SampleInputElementRegistration: FormElementRegistration<SampleInputProps> = {
|
|
33
|
+
component: SampleInput,
|
|
34
|
+
getInitialProperties: () => ({ value: "Hello World" }),
|
|
35
|
+
id: "SampleInput",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default SampleInputElementRegistration;
|
|
@@ -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
|
<>
|
package/src/index.ts
CHANGED
|
@@ -39,3 +39,5 @@ export { default as GetTaskStatusActivity } from "./activities/GetTaskStatus";
|
|
|
39
39
|
export { default as DrapGeometryActivity } from "./activities/DrapGeometry";
|
|
40
40
|
|
|
41
41
|
export { default as SampleActivity } from "./activities/Sample";
|
|
42
|
+
|
|
43
|
+
export { default as SampleInputRegistration } from "./elements/SampleInput";
|