@rubin-epo/epo-widget-lib 2.0.6 → 2.0.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),M=require("./Orbitals/OrbitalDetails.cjs"),V=require("./Camera/CameraController.cjs"),W=require("./Camera/Camera.cjs"),B=require("./Orbitals/Orbitals.cjs"),G=require("./Sun.cjs"),N=require("./Controls/PlaybackSpeed.cjs"),A=require("./Controls/PlaybackControls.cjs"),l=require("./styles.cjs"),H=require("./Context/index.cjs");function I(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x}=H.useOrbitalSimContext(),{paused:h,pov:y,defaultZoom:c,potentialOrbits:w,detailsRows:P}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=s.useState(!h),[D,o]=s.useState(1),[R,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,k]=s.useState(1),[f,T]=s.useState({neos:[{Principal_desig:""}]});s.useEffect(()=>{m||(a(!1),d(0)),r>0?(d(u.initial),o(1),p(0),b(-1)):r<0&&(p(0),a(!0),b(0))},[r]);const Z=t=>{d(+t)},_=()=>{n||o(1),a(!n)},F=()=>{a(t=>!1),b(t=>t+1)},z=t=>{a(!1),o(1),j(S=>S+1)},L=t=>{a(!1),o(-1),j(S=>S+1)},E=t=>{T({neos:[t]})};return e.jsxs(e.Fragment,{children:[e.jsx(l.GlobalStyles,{}),e.jsxs(l.OrbitalSimWrapper,{children:[x?e.jsx(l.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(l.SwappableOrbitButton,{onClick:()=>E(t),"data-active":Object.keys(f).length?t.Principal_desig===f.neos[0].Principal_desig:!1,children:t.Ref}))}):e.jsxs(e.Fragment,{children:[P&&q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(N.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(A.default,{playing:n,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(l.CanvasWrapper,{orthographic:!0,children:[e.jsx(V.default,{pov:v?null:y??"top",reset:r}),e.jsx(W.default,{
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),M=require("./Orbitals/OrbitalDetails.cjs"),V=require("./Camera/CameraController.cjs"),W=require("./Camera/Camera.cjs"),B=require("./Orbitals/Orbitals.cjs"),G=require("./Sun.cjs"),N=require("./Controls/PlaybackSpeed.cjs"),A=require("./Controls/PlaybackControls.cjs"),l=require("./styles.cjs"),H=require("./Context/index.cjs");function I(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x}=H.useOrbitalSimContext(),{paused:h,pov:y,defaultZoom:c,potentialOrbits:w,detailsRows:P}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=s.useState(!h),[D,o]=s.useState(1),[R,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,k]=s.useState(1),[f,T]=s.useState({neos:[{Principal_desig:""}]});s.useEffect(()=>{m||(a(!1),d(0)),r>0?(d(u.initial),o(1),p(0),b(-1)):r<0&&(p(0),a(!0),b(0))},[r]);const Z=t=>{d(+t)},_=()=>{n||o(1),a(!n)},F=()=>{a(t=>!1),b(t=>t+1)},z=t=>{a(!1),o(1),j(S=>S+1)},L=t=>{a(!1),o(-1),j(S=>S+1)},E=t=>{T({neos:[t]})};return e.jsxs(e.Fragment,{children:[e.jsx(l.GlobalStyles,{}),e.jsxs(l.OrbitalSimWrapper,{children:[x?e.jsx(l.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(l.SwappableOrbitButton,{onClick:()=>E(t),"data-active":Object.keys(f).length?t.Principal_desig===f.neos[0].Principal_desig:!1,children:t.Ref}))}):e.jsxs(e.Fragment,{children:[P&&q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(N.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(A.default,{playing:n,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(l.CanvasWrapper,{orthographic:!0,children:[e.jsx(V.default,{pov:v?null:y??"top",reset:r}),e.jsx(W.default,{near:-1e3,far:1e3,position:[0,0,10],defaultZoom:c||3}),e.jsx("ambientLight",{intensity:.9}),e.jsx(B.default,{defaultZoom:c||1,playing:n,stepDirection:D,dayPerVizSec:O,frameOverride:R,potentialOrbits:w,elapsedTime:g,setElapsedTime:p,reset:r,zoomLevel:C,setZoomLevel:k,orbits:x?f:i}),e.jsx(G.default,{zoomLevel:C,defaultZoom:c||1})]})]})]})}exports.default=I;
|
|
@@ -10,27 +10,27 @@ import I from "./Controls/PlaybackSpeed.js";
|
|
|
10
10
|
import J from "./Controls/PlaybackControls.js";
|
|
11
11
|
import { GlobalStyles as K, OrbitalSimWrapper as M, SwappableOrbitsContainer as Q, SwappableOrbitButton as U, CanvasWrapper as X } from "./styles.js";
|
|
12
12
|
import { useOrbitalSimContext as Y } from "./Context/index.js";
|
|
13
|
-
function
|
|
14
|
-
const { orbits:
|
|
13
|
+
function me() {
|
|
14
|
+
const { orbits: o, showDetailsTable: P, allowOrbitRotation: D, showTimeControls: S, swappableOrbits: O } = Y(), {
|
|
15
15
|
paused: C,
|
|
16
16
|
pov: x,
|
|
17
17
|
defaultZoom: p,
|
|
18
18
|
potentialOrbits: k,
|
|
19
19
|
detailsRows: R
|
|
20
|
-
} =
|
|
20
|
+
} = o, c = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [l, a] = i(!C), [Z, n] = i(1), [T, g] = i(0), [w, m] = i(C ? 0 : c.initial), [v, d] = i(0), [r, f] = i(0), [y, j] = i(1), [b, z] = i({ neos: [{ Principal_desig: "" }] });
|
|
21
21
|
B(() => {
|
|
22
|
-
S || (
|
|
22
|
+
S || (a(!1), m(0)), r > 0 ? (m(c.initial), n(1), d(0), f(-1)) : r < 0 && (d(0), a(!0), f(0));
|
|
23
23
|
}, [r]);
|
|
24
24
|
const L = (e) => {
|
|
25
|
-
|
|
25
|
+
m(+e);
|
|
26
26
|
}, _ = () => {
|
|
27
|
-
l || n(1),
|
|
27
|
+
l || n(1), a(!l);
|
|
28
28
|
}, E = () => {
|
|
29
|
-
|
|
29
|
+
a((e) => !1), f((e) => e + 1);
|
|
30
30
|
}, F = (e) => {
|
|
31
|
-
|
|
31
|
+
a(!1), n(1), g((u) => u + 1);
|
|
32
32
|
}, V = (e) => {
|
|
33
|
-
|
|
33
|
+
a(!1), n(-1), g((u) => u + 1);
|
|
34
34
|
}, W = (e) => {
|
|
35
35
|
z({
|
|
36
36
|
neos: [e]
|
|
@@ -39,7 +39,7 @@ function ce() {
|
|
|
39
39
|
return /* @__PURE__ */ s(h, { children: [
|
|
40
40
|
/* @__PURE__ */ t(K, {}),
|
|
41
41
|
/* @__PURE__ */ s(M, { children: [
|
|
42
|
-
O ? /* @__PURE__ */ t(Q, { children:
|
|
42
|
+
O ? /* @__PURE__ */ t(Q, { children: o && o.neos && o.neos.map((e) => /* @__PURE__ */ t(
|
|
43
43
|
U,
|
|
44
44
|
{
|
|
45
45
|
onClick: () => W(e),
|
|
@@ -54,7 +54,7 @@ function ce() {
|
|
|
54
54
|
{
|
|
55
55
|
elapsedTime: v,
|
|
56
56
|
dayPerVizSec: w,
|
|
57
|
-
speeds:
|
|
57
|
+
speeds: c,
|
|
58
58
|
sliderOnChangeCallback: L
|
|
59
59
|
}
|
|
60
60
|
),
|
|
@@ -76,10 +76,6 @@ function ce() {
|
|
|
76
76
|
/* @__PURE__ */ t(
|
|
77
77
|
q,
|
|
78
78
|
{
|
|
79
|
-
left: -2e3,
|
|
80
|
-
right: 2e3,
|
|
81
|
-
top: 1e3,
|
|
82
|
-
bottom: -1e3,
|
|
83
79
|
near: -1e3,
|
|
84
80
|
far: 1e3,
|
|
85
81
|
position: [0, 0, 10],
|
|
@@ -101,7 +97,7 @@ function ce() {
|
|
|
101
97
|
reset: r,
|
|
102
98
|
zoomLevel: y,
|
|
103
99
|
setZoomLevel: j,
|
|
104
|
-
orbits: O ? b :
|
|
100
|
+
orbits: O ? b : o
|
|
105
101
|
}
|
|
106
102
|
),
|
|
107
103
|
/* @__PURE__ */ t(
|
|
@@ -116,5 +112,5 @@ function ce() {
|
|
|
116
112
|
] });
|
|
117
113
|
}
|
|
118
114
|
export {
|
|
119
|
-
|
|
115
|
+
me as default
|
|
120
116
|
};
|
package/package.json
CHANGED