@rubin-epo/epo-widget-lib 2.0.3 → 2.0.4
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/dist/SortableTable.cjs +1 -0
- package/dist/SortableTable.d.ts +3 -0
- package/dist/SortableTable.js +5 -0
- package/dist/SourceSelector.cjs +1 -1
- package/dist/SourceSelector.js +6 -4
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.d.ts +1 -0
- package/dist/atomic/Blinker/Blinker.js +27 -25
- package/dist/atomic/SelectionList/index.cjs +1 -0
- package/dist/{widgets/SourceSelector → atomic}/SelectionList/index.d.ts +1 -1
- package/dist/atomic/SelectionList/index.js +31 -0
- package/dist/localeStrings/en/epo-widget-lib.json +11 -3
- package/dist/localeStrings/es/epo-widget-lib.json +8 -5
- package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
- package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
- package/dist/widgets/OrbitalSim/Context/index.js +58 -32
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +94 -77
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
- package/dist/widgets/OrbitalSim/styles.cjs +33 -5
- package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
- package/dist/widgets/OrbitalSim/styles.js +36 -6
- package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
- package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
- package/dist/widgets/SortableTable/SortableTable.js +41 -0
- package/dist/widgets/SortableTable/index.d.ts +1 -0
- package/dist/widgets/SortableTable/styles.cjs +8 -0
- package/dist/widgets/SortableTable/styles.d.ts +1 -0
- package/dist/widgets/SortableTable/styles.js +13 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
- package/dist/widgets/SourceSelector/index.d.ts +2 -1
- package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
- package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/SortableTable/SortableTable.cjs");exports.SortableTable=e.default;exports.default=e.default;
|
package/dist/SourceSelector.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/SourceSelector/SourceSelector.cjs"),t=require("./widgets/SourceSelector/SelectionList/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/SourceSelector/SourceSelector.cjs"),t=require("./widgets/SourceSelector/MovingSourceSelector.cjs"),r=require("./atomic/SelectionList/index.cjs"),o=require("./widgets/SourceSelector/Message/Message.cjs");exports.default=e.default;exports.MovingSourceSelector=t.default;exports.SelectionList=r.default;exports.Message=o.default;
|
package/dist/SourceSelector.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import o from "./widgets/SourceSelector/SourceSelector.js";
|
|
2
|
-
import { default as a } from "./widgets/SourceSelector/
|
|
3
|
-
import { default as
|
|
2
|
+
import { default as a } from "./widgets/SourceSelector/MovingSourceSelector.js";
|
|
3
|
+
import { default as l } from "./atomic/SelectionList/index.js";
|
|
4
|
+
import { default as u } from "./widgets/SourceSelector/Message/Message.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
a as
|
|
6
|
+
u as Message,
|
|
7
|
+
a as MovingSourceSelector,
|
|
8
|
+
l as SelectionList,
|
|
7
9
|
o as default
|
|
8
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),k=require("../../lib/utils.cjs"),C=require("../../hooks/useInterval.cjs"),D=require("../ImageStack/index.cjs"),F=require("./Controls/Controls.cjs"),g=require("./styles.cjs"),j=({images:n=[],activeIndex:i=0,autoplay:q=!0,loop:B=!0,interval:p=200,blinkCallback:s,onClickCallback:l,loadedCallback:u,className:y,showControls:S=!0,children:v,extraControls:m,pauseCallback:I=()=>{}})=>{const[c,d]=h.useState(q),[a,P]=h.useState(!1),r=n.length>1,x=(e=0)=>{const _=n.length-1;return k.getClampedArrayIndex(i+e,_)},f=()=>{if(r){const e=x(1);B===!1&&e===n.length-1&&o(),s&&s(e)}},o=()=>{d(!1)},A=()=>{I(),d(e=>!e)},M=()=>{o(),f()},N=()=>{o(),s&&s(x(-1))};return C.default(f,r&&a&&c?p:null),t.jsxs(g.BlinkerContainer,{"data-testid":"blinker-container",onClick:e=>l&&l(e),className:y,children:[t.jsx(D.default,{loadCallback:()=>{P(!0),u&&u()},visible:i,images:n}),v,t.jsx(g.ControlsContainer,{children:r&&S&&t.jsxs(t.Fragment,{children:[t.jsx(F.default,{isDisabled:!a,playing:c,handleStartStop:A,handleNext:M,handlePrevious:N}),m]})})]})};j.displayName="Atomic.Blinker";exports.default=j;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as u, jsx as s, Fragment as
|
|
2
|
+
import { jsxs as u, jsx as s, Fragment as D } from "react/jsx-runtime";
|
|
3
3
|
import { useState as h } from "react";
|
|
4
|
-
import { getClampedArrayIndex as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { BlinkerContainer as
|
|
9
|
-
const
|
|
4
|
+
import { getClampedArrayIndex as F } from "../../lib/utils.js";
|
|
5
|
+
import L from "../../hooks/useInterval.js";
|
|
6
|
+
import q from "../ImageStack/index.js";
|
|
7
|
+
import w from "./Controls/Controls.js";
|
|
8
|
+
import { BlinkerContainer as z, ControlsContainer as E } from "./styles.js";
|
|
9
|
+
const G = ({
|
|
10
10
|
images: e = [],
|
|
11
11
|
activeIndex: i = 0,
|
|
12
12
|
autoplay: x = !0,
|
|
@@ -18,11 +18,13 @@ const E = ({
|
|
|
18
18
|
className: y,
|
|
19
19
|
showControls: I = !0,
|
|
20
20
|
children: S,
|
|
21
|
-
extraControls: j
|
|
21
|
+
extraControls: j,
|
|
22
|
+
pauseCallback: k = () => {
|
|
23
|
+
}
|
|
22
24
|
}) => {
|
|
23
|
-
const [d, m] = h(x), [c,
|
|
24
|
-
const
|
|
25
|
-
return
|
|
25
|
+
const [d, m] = h(x), [c, v] = h(!1), r = e.length > 1, f = (t = 0) => {
|
|
26
|
+
const C = e.length - 1;
|
|
27
|
+
return F(i + t, C);
|
|
26
28
|
}, p = () => {
|
|
27
29
|
if (r) {
|
|
28
30
|
const t = f(1);
|
|
@@ -30,40 +32,40 @@ const E = ({
|
|
|
30
32
|
}
|
|
31
33
|
}, o = () => {
|
|
32
34
|
m(!1);
|
|
33
|
-
}, v = () => {
|
|
34
|
-
m((t) => !t);
|
|
35
35
|
}, A = () => {
|
|
36
|
-
|
|
36
|
+
k(), m((t) => !t);
|
|
37
37
|
}, N = () => {
|
|
38
|
+
o(), p();
|
|
39
|
+
}, P = () => {
|
|
38
40
|
o(), n && n(f(-1));
|
|
39
41
|
};
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
+
return L(p, r && c && d ? g : null), /* @__PURE__ */ u(
|
|
43
|
+
z,
|
|
42
44
|
{
|
|
43
45
|
"data-testid": "blinker-container",
|
|
44
46
|
onClick: (t) => l && l(t),
|
|
45
47
|
className: y,
|
|
46
48
|
children: [
|
|
47
49
|
/* @__PURE__ */ s(
|
|
48
|
-
|
|
50
|
+
q,
|
|
49
51
|
{
|
|
50
52
|
loadCallback: () => {
|
|
51
|
-
|
|
53
|
+
v(!0), a && a();
|
|
52
54
|
},
|
|
53
55
|
visible: i,
|
|
54
56
|
images: e
|
|
55
57
|
}
|
|
56
58
|
),
|
|
57
59
|
S,
|
|
58
|
-
/* @__PURE__ */ s(
|
|
60
|
+
/* @__PURE__ */ s(E, { children: r && I && /* @__PURE__ */ u(D, { children: [
|
|
59
61
|
/* @__PURE__ */ s(
|
|
60
|
-
|
|
62
|
+
w,
|
|
61
63
|
{
|
|
62
64
|
isDisabled: !c,
|
|
63
65
|
playing: d,
|
|
64
|
-
handleStartStop:
|
|
65
|
-
handleNext:
|
|
66
|
-
handlePrevious:
|
|
66
|
+
handleStartStop: A,
|
|
67
|
+
handleNext: N,
|
|
68
|
+
handlePrevious: P
|
|
67
69
|
}
|
|
68
70
|
),
|
|
69
71
|
j
|
|
@@ -72,7 +74,7 @@ const E = ({
|
|
|
72
74
|
}
|
|
73
75
|
);
|
|
74
76
|
};
|
|
75
|
-
|
|
77
|
+
G.displayName = "Atomic.Blinker";
|
|
76
78
|
export {
|
|
77
|
-
|
|
79
|
+
G as default
|
|
78
80
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("react-i18next"),s=require("./styles.cjs"),a=require("../Button/patterns/Reset.cjs"),n=({className:r,onRemoveCallback:c,sources:t=[]})=>{const{t:i}=u.useTranslation();return e.jsxs(s.SelectionWrapper,{children:[t.length>0&&e.jsx(s.SelectionList,{className:r,children:t.map(({type:o,id:l})=>e.jsxs(s.DescriptionWrapper,{children:[e.jsx("dt",{children:i("selection_list.selected_source",{type:i(`selection_list.sources.${o}`)})}),e.jsx("dd",{children:l})]},l))}),e.jsx(a.default,{isDisabled:t.length<1,onResetCallback:c})]})};n.displayName="Widgets.SelectionList";exports.default=n;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as c } from "react-i18next";
|
|
4
|
+
import { SelectionWrapper as a, SelectionList as p, DescriptionWrapper as d } from "./styles.js";
|
|
5
|
+
import m from "../Button/patterns/Reset.js";
|
|
6
|
+
const h = ({
|
|
7
|
+
className: n,
|
|
8
|
+
onRemoveCallback: r,
|
|
9
|
+
sources: t = []
|
|
10
|
+
}) => {
|
|
11
|
+
const { t: i } = c();
|
|
12
|
+
return /* @__PURE__ */ l(a, { children: [
|
|
13
|
+
t.length > 0 && /* @__PURE__ */ e(p, { className: n, children: t.map(({ type: o, id: s }) => /* @__PURE__ */ l(d, { children: [
|
|
14
|
+
/* @__PURE__ */ e("dt", { children: i("selection_list.selected_source", {
|
|
15
|
+
type: i(`selection_list.sources.${o}`)
|
|
16
|
+
}) }),
|
|
17
|
+
/* @__PURE__ */ e("dd", { children: s })
|
|
18
|
+
] }, s)) }),
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
|
+
m,
|
|
21
|
+
{
|
|
22
|
+
isDisabled: t.length < 1,
|
|
23
|
+
onResetCallback: r
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
27
|
+
};
|
|
28
|
+
h.displayName = "Widgets.SelectionList";
|
|
29
|
+
export {
|
|
30
|
+
h as default
|
|
31
|
+
};
|
|
@@ -61,12 +61,15 @@
|
|
|
61
61
|
"export": "Export"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
"
|
|
64
|
+
"selection_list": {
|
|
65
65
|
"selected_source": "Selected {{type}}:",
|
|
66
66
|
"sources": {
|
|
67
67
|
"galaxy": "Galaxy",
|
|
68
|
-
"supernova": "Supernova"
|
|
69
|
-
|
|
68
|
+
"supernova": "Supernova",
|
|
69
|
+
"observation": "Observation"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"source_selector": {
|
|
70
73
|
"messages": {
|
|
71
74
|
"success": "You found it!",
|
|
72
75
|
"failure": "Try again."
|
|
@@ -172,5 +175,10 @@
|
|
|
172
175
|
"earth": "Earth",
|
|
173
176
|
"mars": "Mars",
|
|
174
177
|
"neptune": "Neptune"
|
|
178
|
+
},
|
|
179
|
+
"neo": {
|
|
180
|
+
"apollo": "Apollo",
|
|
181
|
+
"amor": "Amor",
|
|
182
|
+
"atira": "Atira"
|
|
175
183
|
}
|
|
176
184
|
}
|
|
@@ -48,15 +48,18 @@
|
|
|
48
48
|
"export": "Exportar"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
"selection_list": {
|
|
52
|
+
"selected_source": "{{type}} Seleccionada:",
|
|
53
|
+
"sources": {
|
|
54
|
+
"galaxy": "Galaxia",
|
|
55
|
+
"supernova": "Supernova",
|
|
56
|
+
"observation": "Observación"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
51
59
|
"source_selector": {
|
|
52
60
|
"messages": {
|
|
53
61
|
"success": "¡Muy bien!",
|
|
54
62
|
"failure": "Inténtalo de nuevo."
|
|
55
|
-
},
|
|
56
|
-
"selected_source": "Seleccionada {{type}}:",
|
|
57
|
-
"sources": {
|
|
58
|
-
"galaxy": "Galaxia",
|
|
59
|
-
"supernova": "Supernova"
|
|
60
63
|
}
|
|
61
64
|
},
|
|
62
65
|
"camera_filter": {
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export declare const SwappableOrbitsData: {
|
|
2
|
+
orbits: {
|
|
3
|
+
neos: {
|
|
4
|
+
a: number;
|
|
5
|
+
e: number;
|
|
6
|
+
i: number;
|
|
7
|
+
H: number;
|
|
8
|
+
Ref: string;
|
|
9
|
+
Principal_desig: string;
|
|
10
|
+
Translated_desig_key: string;
|
|
11
|
+
orbitColor: string;
|
|
12
|
+
objectColor: string;
|
|
13
|
+
objectRadius: number;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
swappableOrbits: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const PrimaryData: {
|
|
19
|
+
orbits: {
|
|
20
|
+
neos: {
|
|
21
|
+
NEO_flag: number;
|
|
22
|
+
One_km_NEO_flag: number;
|
|
23
|
+
H: number;
|
|
24
|
+
G: number;
|
|
25
|
+
Num_obs: number;
|
|
26
|
+
rms: number;
|
|
27
|
+
U: string;
|
|
28
|
+
Arc_years: string;
|
|
29
|
+
Perturbers: string;
|
|
30
|
+
Perturbers_2: string;
|
|
31
|
+
Number: string;
|
|
32
|
+
Name: string;
|
|
33
|
+
Principal_desig: string;
|
|
34
|
+
Epoch: number;
|
|
35
|
+
M: number;
|
|
36
|
+
Peri: number;
|
|
37
|
+
Node: number;
|
|
38
|
+
i: number;
|
|
39
|
+
e: number;
|
|
40
|
+
n: number;
|
|
41
|
+
a: number;
|
|
42
|
+
Ref: string;
|
|
43
|
+
Num_opps: number;
|
|
44
|
+
Computer: string;
|
|
45
|
+
Hex_flags: string;
|
|
46
|
+
Last_obs: string;
|
|
47
|
+
Tp: number;
|
|
48
|
+
Orbital_period: number;
|
|
49
|
+
Perihelion_dist: number;
|
|
50
|
+
Aphelion_dist: number;
|
|
51
|
+
Semilatus_rectum: number;
|
|
52
|
+
Synodic_period: number;
|
|
53
|
+
Orbit_type: string;
|
|
54
|
+
}[];
|
|
55
|
+
detailsRows: null;
|
|
56
|
+
};
|
|
57
|
+
activeObs: undefined;
|
|
58
|
+
selectionCallback: () => void;
|
|
59
|
+
paused: boolean;
|
|
60
|
+
pov: string;
|
|
61
|
+
defaultZoom: number;
|
|
62
|
+
potentialOrbits: null;
|
|
63
|
+
observations: null;
|
|
64
|
+
noDetails: boolean;
|
|
65
|
+
noControls: boolean;
|
|
66
|
+
detailsSet: null;
|
|
67
|
+
refObjs: string[];
|
|
68
|
+
noLabels: null;
|
|
69
|
+
};
|
|
70
|
+
export declare const PotentialOrbitsData: {
|
|
71
|
+
orbits: {
|
|
72
|
+
neos: ({
|
|
73
|
+
Node: number;
|
|
74
|
+
a: number;
|
|
75
|
+
e: number;
|
|
76
|
+
i: number;
|
|
77
|
+
Peri: number;
|
|
78
|
+
M: number;
|
|
79
|
+
Principal_desig: string;
|
|
80
|
+
Name: string;
|
|
81
|
+
Ref: string;
|
|
82
|
+
Epoch?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
Node: number;
|
|
85
|
+
a: number;
|
|
86
|
+
e: number;
|
|
87
|
+
i: number;
|
|
88
|
+
Peri: number;
|
|
89
|
+
M: number;
|
|
90
|
+
Epoch: string;
|
|
91
|
+
Principal_desig?: undefined;
|
|
92
|
+
Name?: undefined;
|
|
93
|
+
Ref?: undefined;
|
|
94
|
+
})[];
|
|
95
|
+
activeNeo: null;
|
|
96
|
+
activeObs: undefined;
|
|
97
|
+
selectionCallback: () => void;
|
|
98
|
+
paused: null;
|
|
99
|
+
pov: null;
|
|
100
|
+
defaultZoom: number;
|
|
101
|
+
potentialOrbits: boolean;
|
|
102
|
+
observations: ({
|
|
103
|
+
id: string;
|
|
104
|
+
label: string;
|
|
105
|
+
interactable: boolean;
|
|
106
|
+
isActive: boolean;
|
|
107
|
+
position: number;
|
|
108
|
+
isAnswer?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
id: string;
|
|
111
|
+
label: string;
|
|
112
|
+
interactable: boolean;
|
|
113
|
+
isActive: boolean;
|
|
114
|
+
position: number;
|
|
115
|
+
isAnswer: boolean;
|
|
116
|
+
})[];
|
|
117
|
+
detailsRows: null;
|
|
118
|
+
};
|
|
119
|
+
showTimeControls: boolean;
|
|
120
|
+
allowOrbitRotation: boolean;
|
|
121
|
+
noDetails: null;
|
|
122
|
+
detailsSet: null;
|
|
123
|
+
refObjs: null;
|
|
124
|
+
noLabels: null;
|
|
125
|
+
};
|
|
126
|
+
export declare const ObjectDetailsData: {
|
|
127
|
+
orbits: {
|
|
128
|
+
neos: {
|
|
129
|
+
H: number;
|
|
130
|
+
Principal_desig: string;
|
|
131
|
+
M: number;
|
|
132
|
+
Peri: number;
|
|
133
|
+
Node: number;
|
|
134
|
+
i: number;
|
|
135
|
+
e: number;
|
|
136
|
+
n: number;
|
|
137
|
+
a: number;
|
|
138
|
+
Ref: string;
|
|
139
|
+
Orbit_type: string;
|
|
140
|
+
diameter: number;
|
|
141
|
+
Earth_moid: number;
|
|
142
|
+
Jupiter_moid: number;
|
|
143
|
+
}[];
|
|
144
|
+
detailsRows: {
|
|
145
|
+
rowColor: string;
|
|
146
|
+
rowTitle: string;
|
|
147
|
+
rowContent: string;
|
|
148
|
+
}[];
|
|
149
|
+
};
|
|
150
|
+
showTimeControls: boolean;
|
|
151
|
+
showDetailsTable: boolean;
|
|
152
|
+
activeObs: undefined;
|
|
153
|
+
selectionCallback: () => void;
|
|
154
|
+
paused: null;
|
|
155
|
+
pov: null;
|
|
156
|
+
defaultZoom: null;
|
|
157
|
+
potentialOrbits: null;
|
|
158
|
+
observations: null;
|
|
159
|
+
detailsSet: string;
|
|
160
|
+
refObjs: null;
|
|
161
|
+
noLabels: null;
|
|
162
|
+
};
|
|
@@ -3,13 +3,23 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
export interface OrbitalSimProviderProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
orbitData: Orbits;
|
|
6
|
+
showDetailsTable?: boolean;
|
|
7
|
+
allowOrbitRotation?: boolean;
|
|
8
|
+
showTimeControls?: boolean;
|
|
9
|
+
selectedAnswer: string | null;
|
|
10
|
+
updateSelectedAnswer: (newSelectedAnswer: string | null) => void;
|
|
11
|
+
swappableOrbits?: boolean;
|
|
6
12
|
}
|
|
7
13
|
export type OrbitalSimContextValues = {
|
|
8
14
|
orbits: Orbits;
|
|
15
|
+
showDetailsTable?: boolean;
|
|
16
|
+
allowOrbitRotation?: boolean;
|
|
17
|
+
showTimeControls?: boolean;
|
|
9
18
|
setOrbits: React.Dispatch<React.SetStateAction<Orbits>>;
|
|
10
19
|
observations: Observation[];
|
|
11
20
|
setObservations: React.Dispatch<React.SetStateAction<Observation[]>>;
|
|
12
21
|
updateActiveObservation: (activeId: string) => void;
|
|
22
|
+
swappableOrbits: boolean;
|
|
13
23
|
};
|
|
14
24
|
export type Observation = {
|
|
15
25
|
id: string;
|
|
@@ -25,6 +35,8 @@ export type Neo = {
|
|
|
25
35
|
i: number;
|
|
26
36
|
Peri: number;
|
|
27
37
|
Node: number;
|
|
38
|
+
Ref: string;
|
|
39
|
+
Principal_desig: string;
|
|
28
40
|
};
|
|
29
41
|
export type DetailsRow = {
|
|
30
42
|
rowTitle: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),t=require("react"),b=t.createContext(null);function P(){const o=t.useContext(b);if(!o)throw new Error("OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component.");return o}function g({children:o,orbitData:u,showDetailsTable:v=!1,allowOrbitRotation:m=!1,showTimeControls:d=!1,selectedAnswer:i,updateSelectedAnswer:x,swappableOrbits:O=!1}){const[a,c]=t.useState({neos:null,activeNeo:null,observations:[],paused:!1,pov:null,defaultZoom:null,potentialOrbits:!1,noDetails:!1,detailsRows:null,refObjs:null,noControls:!1}),[e,n]=t.useState(()=>a.observations??[]);t.useEffect(()=>{c(u),n(u.observations)},[u]),t.useEffect(()=>{if(e&&e.length>0){let l=e.map(r=>({...r,isActive:r.id===i}));n(l)}},[i]);const S=l=>{if(e&&e.length>0){let r=e.map(s=>s.id==l?{...s,isActive:!0}:{...s,isActive:!1});n(r);const f=e.find(s=>s.id===l);x((f==null?void 0:f.label)||null)}},p=t.useMemo(()=>({orbits:a,showDetailsTable:v,allowOrbitRotation:m,showTimeControls:d,setOrbits:c,observations:e,setObservations:n,updateActiveObservation:S,selectedAnswer:i,swappableOrbits:O}),[a,v,m,d,c,e,n,S,i,O]);return C.jsx(b.Provider,{value:p,children:o})}exports.OrbitalSimContext=b;exports.OrbitalSimProvider=g;exports.useOrbitalSimContext=P;
|
|
@@ -27,4 +27,4 @@ export declare function useOrbitalSimContext(): OrbitalSimContextValues;
|
|
|
27
27
|
*
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
export declare function OrbitalSimProvider({ children, orbitData }: OrbitalSimProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function OrbitalSimProvider({ children, orbitData, showDetailsTable, allowOrbitRotation, showTimeControls, selectedAnswer, updateSelectedAnswer, swappableOrbits }: OrbitalSimProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { createContext as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
2
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as g, useState as p, useEffect as O, useMemo as h, useContext as j } from "react";
|
|
4
|
+
const x = g(null);
|
|
5
|
+
function M() {
|
|
6
|
+
const o = j(x);
|
|
7
|
+
if (!o)
|
|
8
8
|
throw new Error(
|
|
9
9
|
"OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component."
|
|
10
10
|
);
|
|
11
|
-
return
|
|
11
|
+
return o;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
13
|
+
function N({
|
|
14
|
+
children: o,
|
|
15
|
+
orbitData: r,
|
|
16
|
+
showDetailsTable: c = !1,
|
|
17
|
+
allowOrbitRotation: m = !1,
|
|
18
|
+
showTimeControls: v = !1,
|
|
19
|
+
selectedAnswer: s,
|
|
20
|
+
updateSelectedAnswer: S,
|
|
21
|
+
swappableOrbits: b = !1
|
|
22
|
+
}) {
|
|
23
|
+
const [u, a] = p({
|
|
15
24
|
neos: null,
|
|
16
25
|
activeNeo: null,
|
|
17
26
|
observations: [],
|
|
@@ -23,34 +32,51 @@ function w({ children: t, orbitData: n }) {
|
|
|
23
32
|
detailsRows: null,
|
|
24
33
|
refObjs: null,
|
|
25
34
|
noControls: !1
|
|
26
|
-
}), [
|
|
27
|
-
() =>
|
|
35
|
+
}), [t, e] = p(
|
|
36
|
+
() => u.observations ?? []
|
|
28
37
|
);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
o(b);
|
|
38
|
+
O(() => {
|
|
39
|
+
a(r), e(r.observations);
|
|
40
|
+
}, [r]), O(() => {
|
|
41
|
+
if (t && t.length > 0) {
|
|
42
|
+
let i = t.map((l) => ({ ...l, isActive: l.id === s }));
|
|
43
|
+
e(i);
|
|
36
44
|
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
}, [s]);
|
|
46
|
+
const d = (i) => {
|
|
47
|
+
if (t && t.length > 0) {
|
|
48
|
+
let l = t.map((n) => n.id == i ? { ...n, isActive: !0 } : { ...n, isActive: !1 });
|
|
49
|
+
e(l);
|
|
50
|
+
const f = t.find((n) => n.id === i);
|
|
51
|
+
S((f == null ? void 0 : f.label) || null);
|
|
52
|
+
}
|
|
53
|
+
}, C = h(() => ({
|
|
54
|
+
orbits: u,
|
|
55
|
+
showDetailsTable: c,
|
|
56
|
+
allowOrbitRotation: m,
|
|
57
|
+
showTimeControls: v,
|
|
58
|
+
setOrbits: a,
|
|
59
|
+
observations: t,
|
|
60
|
+
setObservations: e,
|
|
61
|
+
updateActiveObservation: d,
|
|
62
|
+
selectedAnswer: s,
|
|
63
|
+
swappableOrbits: b
|
|
43
64
|
}), [
|
|
44
|
-
|
|
45
|
-
|
|
65
|
+
u,
|
|
66
|
+
c,
|
|
67
|
+
m,
|
|
68
|
+
v,
|
|
69
|
+
a,
|
|
70
|
+
t,
|
|
46
71
|
e,
|
|
47
|
-
|
|
48
|
-
|
|
72
|
+
d,
|
|
73
|
+
s,
|
|
74
|
+
b
|
|
49
75
|
]);
|
|
50
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ P(x.Provider, { value: C, children: o });
|
|
51
77
|
}
|
|
52
78
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
79
|
+
x as OrbitalSimContext,
|
|
80
|
+
N as OrbitalSimProvider,
|
|
81
|
+
M as useOrbitalSimContext
|
|
56
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
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,{left:5e3,right:15e3,top:15e3,bottom:-15e3,near:.1,far:3e4,position:[0,0,8e3],defaultZoom:c||1}),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;
|