@rubin-epo/epo-widget-lib 1.2.3 → 1.3.0

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.
Files changed (46) hide show
  1. package/dist/OrbitalSim.cjs +1 -1
  2. package/dist/OrbitalSim.d.ts +0 -2
  3. package/dist/OrbitalSim.js +6 -144
  4. package/dist/atomic/PlaybackControl/PlaybackControl.cjs +1 -1
  5. package/dist/atomic/PlaybackControl/PlaybackControl.js +5 -5
  6. package/dist/atomic/PlaybackControl/styles.cjs +8 -5
  7. package/dist/atomic/PlaybackControl/styles.d.ts +4 -0
  8. package/dist/atomic/PlaybackControl/styles.js +12 -8
  9. package/dist/localeStrings/es/epo-widget-lib.json +1 -1
  10. package/dist/style.css +1 -1
  11. package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.d.ts +0 -0
  12. package/dist/widgets/OrbitalSim/Context/index.cjs +1 -0
  13. package/dist/widgets/OrbitalSim/Context/index.d.ts +66 -0
  14. package/dist/widgets/OrbitalSim/Context/index.js +61 -0
  15. package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.cjs +1 -1
  16. package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.js +1 -1
  17. package/dist/widgets/OrbitalSim/Observation.cjs +1 -1
  18. package/dist/widgets/OrbitalSim/Observation.d.ts +1 -5
  19. package/dist/widgets/OrbitalSim/Observation.js +29 -39
  20. package/dist/widgets/OrbitalSim/Observations.cjs +1 -1
  21. package/dist/widgets/OrbitalSim/Observations.d.ts +1 -5
  22. package/dist/widgets/OrbitalSim/Observations.js +19 -23
  23. package/dist/widgets/OrbitalSim/Orbital.cjs +1 -1
  24. package/dist/widgets/OrbitalSim/Orbital.d.ts +1 -4
  25. package/dist/widgets/OrbitalSim/Orbital.js +69 -70
  26. package/dist/widgets/OrbitalSim/OrbitalDetails.cjs +1 -1
  27. package/dist/widgets/OrbitalSim/OrbitalDetails.d.ts +1 -13
  28. package/dist/widgets/OrbitalSim/OrbitalDetails.js +12 -15
  29. package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -0
  30. package/dist/widgets/OrbitalSim/OrbitalSim.d.ts +2 -0
  31. package/dist/widgets/OrbitalSim/OrbitalSim.js +108 -0
  32. package/dist/widgets/OrbitalSim/OrbitalSim.module.css.cjs +1 -1
  33. package/dist/widgets/OrbitalSim/OrbitalSim.module.css.js +42 -42
  34. package/dist/widgets/OrbitalSim/Orbitals.cjs +1 -1
  35. package/dist/widgets/OrbitalSim/Orbitals.d.ts +1 -16
  36. package/dist/widgets/OrbitalSim/Orbitals.js +85 -104
  37. package/dist/widgets/OrbitalSim/PlaybackSpeed.cjs +1 -1
  38. package/dist/widgets/OrbitalSim/PlaybackSpeed.js +35 -36
  39. package/dist/widgets/OrbitalSim/PotentialOrbits.cjs +1 -1
  40. package/dist/widgets/OrbitalSim/PotentialOrbits.d.ts +1 -9
  41. package/dist/widgets/OrbitalSim/PotentialOrbits.js +27 -35
  42. package/dist/widgets/OrbitalSim/index.d.ts +2 -23
  43. package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
  44. package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +2 -0
  45. package/dist/widgets/OrbitalSim/orbitalUtilities.js +37 -34
  46. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),e=require("./node_modules/prop-types/index.cjs"),H=require("@react-three/fiber"),J=require("react-i18next"),K=require("./widgets/OrbitalSim/OrbitalDetails.cjs"),Q=require("./widgets/OrbitalSim/CameraController.cjs"),U=require("./widgets/OrbitalSim/Camera.cjs"),W=require("./widgets/OrbitalSim/Orbitals.cjs"),X=require("./widgets/OrbitalSim/Sun.cjs"),Y=require("./widgets/OrbitalSim/PlaybackSpeed.cjs"),$=require("./widgets/OrbitalSim/Controls/PlaybackControls.cjs"),q=require("./widgets/OrbitalSim/OrbitalSim.module.css.cjs");function h({neos:g,activeNeo:C,activeObs:O,selectionCallback:D,paused:n,pov:P,defaultZoom:u,potentialOrbits:m,observations:k,noDetails:T,detailsSet:V,detailsRows:L,refObjs:N,noLabels:R,noControls:z=!1}){const c={min:1157e-8,max:365.25,initial:11.574,step:1},[o,l]=a.useState(!n),[Z,_]=a.useState(null),[w,r]=a.useState(1),[E,S]=a.useState(0),[v,y]=a.useState(n?0:c.initial),[p,d]=a.useState(0),[i,f]=a.useState(0),[j,F]=a.useState(1),{t:x}=J.useTranslation();a.useEffect(()=>{i>0?(y(c.initial),r(1),d(0),f(-1)):i<0&&(d(0),l(!0),f(0))},[i]);const M=s=>{y(+s)},A=()=>{o||r(1),l(!o)},I=()=>{l(s=>!1),f(s=>s+1)},B=s=>{l(!1),r(1),S(b=>b+1)},G=s=>{l(!1),r(-1),S(b=>b+1)};return t.jsx(t.Fragment,{children:t.jsxs("div",{className:q.default.container,children:[!m&&!T&&t.jsx(K.default,{type:V,velocity:Z,rows:L}),!n&&t.jsx(Y.default,{elapsedTime:p,dayPerVizSec:v,speeds:c,sliderOnChangeCallback:M}),!z&&t.jsx($.default,{playing:o,handleStartStop:A,handleNext:B,handlePrevious:G,isDisabled:!1,handleReset:I}),t.jsxs(H.Canvas,{className:q.default["orbital-canvas"],children:[t.jsx(Q.default,{pov:P,reset:i}),t.jsx(U.default,{left:5e3,right:15e3,top:15e3,bottom:-15e3,near:.1,far:3e4,position:[0,0,8e3],defaultZoom:u||1}),t.jsx("ambientLight",{intensity:.9}),t.jsx(W.default,{activeVelocityCallback:_,defaultZoom:u||1,refObjs:N,neos:g,activeNeo:C,activeObs:O,playing:o,stepDirection:w,dayPerVizSec:v,frameOverride:E,potentialOrbits:m,observations:k,selectionCallback:D,elapsedTime:p,setElapsedTime:d,noLabels:R,reset:i,zoomLevel:j,setZoomLevel:F,t:x}),t.jsx(X.default,{zoomLevel:j,defaultZoom:u||1,t:x})]})]})})}h.propTypes={neos:e.default.array,activeNeo:e.default.object,activeObs:e.default.object,selectionCallback:e.default.func,paused:e.default.bool,pov:e.default.string,defaultZoom:e.default.number,potentialOrbits:e.default.bool,observations:e.default.array,noDetails:e.default.bool,noLabels:e.default.bool,detailsSet:e.default.string,detailsRows:e.default.array,refObjs:e.default.array,noControls:e.default.bool};exports.default=h;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./widgets/OrbitalSim/OrbitalSim.cjs"),t=require("./widgets/OrbitalSim/Context/index.cjs");exports.OrbitalSim=i.default;exports.OrbitalSimContext=t.OrbitalSimContext;exports.OrbitalSimProvider=t.OrbitalSimProvider;exports.useOrbitalSimContext=t.useOrbitalSimContext;
@@ -1,3 +1 @@
1
1
  export * from './widgets/OrbitalSim/index'
2
- import _default from './widgets/OrbitalSim/index'
3
- export default _default
@@ -1,147 +1,9 @@
1
1
  "use client";
2
- import { jsx as t, Fragment as K, jsxs as g } from "react/jsx-runtime";
3
- import { useState as o, useEffect as M } from "react";
4
- import e from "./node_modules/prop-types/index.js";
5
- import { Canvas as Q } from "@react-three/fiber";
6
- import { useTranslation as U } from "react-i18next";
7
- import W from "./widgets/OrbitalSim/OrbitalDetails.js";
8
- import X from "./widgets/OrbitalSim/CameraController.js";
9
- import Y from "./widgets/OrbitalSim/Camera.js";
10
- import _ from "./widgets/OrbitalSim/Orbitals.js";
11
- import $ from "./widgets/OrbitalSim/Sun.js";
12
- import ee from "./widgets/OrbitalSim/PlaybackSpeed.js";
13
- import te from "./widgets/OrbitalSim/Controls/PlaybackControls.js";
14
- import O from "./widgets/OrbitalSim/OrbitalSim.module.css.js";
15
- function oe({
16
- neos: D,
17
- activeNeo: P,
18
- activeObs: j,
19
- selectionCallback: k,
20
- paused: n,
21
- pov: x,
22
- defaultZoom: c,
23
- potentialOrbits: d,
24
- observations: T,
25
- noDetails: V,
26
- detailsSet: L,
27
- detailsRows: N,
28
- refObjs: z,
29
- noLabels: R,
30
- noControls: Z = !1
31
- }) {
32
- const m = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [r, a] = o(!n), [w, E] = o(null), [F, l] = o(1), [A, y] = o(0), [v, u] = o(n ? 0 : m.initial), [S, f] = o(0), [i, p] = o(0), [h, q] = o(1), { t: C } = U();
33
- M(() => {
34
- i > 0 ? (u(m.initial), l(1), f(0), p(-1)) : i < 0 && (f(0), a(!0), p(0));
35
- }, [i]);
36
- const B = (s) => {
37
- u(+s);
38
- }, G = () => {
39
- r || l(1), a(!r);
40
- }, H = () => {
41
- a((s) => !1), p((s) => s + 1);
42
- }, I = (s) => {
43
- a(!1), l(1), y((b) => b + 1);
44
- }, J = (s) => {
45
- a(!1), l(-1), y((b) => b + 1);
46
- };
47
- return /* @__PURE__ */ t(K, { children: /* @__PURE__ */ g("div", { className: O.container, children: [
48
- !d && !V && /* @__PURE__ */ t(
49
- W,
50
- {
51
- type: L,
52
- velocity: w,
53
- rows: N
54
- }
55
- ),
56
- !n && /* @__PURE__ */ t(
57
- ee,
58
- {
59
- elapsedTime: S,
60
- dayPerVizSec: v,
61
- speeds: m,
62
- sliderOnChangeCallback: B
63
- }
64
- ),
65
- !Z && /* @__PURE__ */ t(
66
- te,
67
- {
68
- playing: r,
69
- handleStartStop: G,
70
- handleNext: I,
71
- handlePrevious: J,
72
- isDisabled: !1,
73
- handleReset: H
74
- }
75
- ),
76
- /* @__PURE__ */ g(Q, { className: O["orbital-canvas"], children: [
77
- /* @__PURE__ */ t(X, { pov: x, reset: i }),
78
- /* @__PURE__ */ t(
79
- Y,
80
- {
81
- left: 5e3,
82
- right: 15e3,
83
- top: 15e3,
84
- bottom: -15e3,
85
- near: 0.1,
86
- far: 3e4,
87
- position: [0, 0, 8e3],
88
- defaultZoom: c || 1
89
- }
90
- ),
91
- /* @__PURE__ */ t("ambientLight", { intensity: 0.9 }),
92
- /* @__PURE__ */ t(
93
- _,
94
- {
95
- activeVelocityCallback: E,
96
- defaultZoom: c || 1,
97
- refObjs: z,
98
- neos: D,
99
- activeNeo: P,
100
- activeObs: j,
101
- playing: r,
102
- stepDirection: F,
103
- dayPerVizSec: v,
104
- frameOverride: A,
105
- potentialOrbits: d,
106
- observations: T,
107
- selectionCallback: k,
108
- elapsedTime: S,
109
- setElapsedTime: f,
110
- noLabels: R,
111
- reset: i,
112
- zoomLevel: h,
113
- setZoomLevel: q,
114
- t: C
115
- }
116
- ),
117
- /* @__PURE__ */ t(
118
- $,
119
- {
120
- zoomLevel: h,
121
- defaultZoom: c || 1,
122
- t: C
123
- }
124
- )
125
- ] })
126
- ] }) });
127
- }
128
- oe.propTypes = {
129
- neos: e.array,
130
- activeNeo: e.object,
131
- activeObs: e.object,
132
- selectionCallback: e.func,
133
- paused: e.bool,
134
- pov: e.string,
135
- defaultZoom: e.number,
136
- potentialOrbits: e.bool,
137
- observations: e.array,
138
- noDetails: e.bool,
139
- noLabels: e.bool,
140
- detailsSet: e.string,
141
- detailsRows: e.array,
142
- refObjs: e.array,
143
- noControls: e.bool
144
- };
2
+ import { default as r } from "./widgets/OrbitalSim/OrbitalSim.js";
3
+ import { OrbitalSimContext as o, OrbitalSimProvider as a, useOrbitalSimContext as l } from "./widgets/OrbitalSim/Context/index.js";
145
4
  export {
146
- oe as default
5
+ r as OrbitalSim,
6
+ o as OrbitalSimContext,
7
+ a as OrbitalSimProvider,
8
+ l as useOrbitalSimContext
147
9
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),r=require("@rubin-epo/epo-react-lib/IconComposer"),t=require("./styles.cjs"),i=e=>e&&e.__esModule?e:{default:e},a=i(r),n=({icon:e,label:s,handleClick:c,...l})=>o.jsxs(t.PlaybackButton,{...l,onClick:c,children:[o.jsx(t.IconContainer,{children:o.jsx(a.default,{icon:e,size:15})}),o.jsx("span",{children:s})]});n.displayName="Atomic.PlaybackControl";const u=n;exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),r=require("@rubin-epo/epo-react-lib/IconComposer"),t=require("./styles.cjs"),a=e=>e&&e.__esModule?e:{default:e},i=a(r),n=({icon:e,label:l,handleClick:s,...c})=>o.jsxs(t.PlaybackButton,{...c,onClick:s,children:[o.jsx(t.IconContainer,{children:o.jsx(i.default,{icon:e,size:15})}),o.jsx(t.SpanLabel,{children:l})]});n.displayName="Atomic.PlaybackControl";const u=n;exports.default=u;
@@ -1,14 +1,14 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import l from "@rubin-epo/epo-react-lib/IconComposer";
3
- import { PlaybackButton as e, IconContainer as s } from "./styles.js";
3
+ import { PlaybackButton as e, IconContainer as s, SpanLabel as m } from "./styles.js";
4
4
  const n = ({
5
5
  icon: r,
6
6
  label: c,
7
7
  handleClick: t,
8
- ...i
9
- }) => /* @__PURE__ */ a(e, { ...i, onClick: t, children: [
8
+ ...a
9
+ }) => /* @__PURE__ */ i(e, { ...a, onClick: t, children: [
10
10
  /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(l, { icon: r, size: 15 }) }),
11
- /* @__PURE__ */ o("span", { children: c })
11
+ /* @__PURE__ */ o(m, { children: c })
12
12
  ] });
13
13
  n.displayName = "Atomic.PlaybackControl";
14
14
  const k = n;
@@ -1,4 +1,4 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),r=t=>t&&t.__esModule?t:{default:t},e=r(n),o=e.default.div`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),a=e=>e&&e.__esModule?e:{default:e},t=a(n),o=t.default.div`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
@@ -7,11 +7,10 @@
7
7
  border-radius: 22px;
8
8
  background-color: var(--button-background-color);
9
9
  color: var(--neutral95, #1f2121);
10
- `,a=e.default.button`
10
+ `,r=t.default.button`
11
11
  --button-color: var(--white, #fff);
12
12
  --button-background-color: var(--neutral15, #e6e6e6);
13
13
 
14
- background: transparent;
15
14
  border: none;
16
15
  color: var(--button-color);
17
16
  cursor: pointer;
@@ -21,7 +20,7 @@
21
20
  gap: 0.75em;
22
21
  text-align: center;
23
22
  padding: 0;
24
- margin: 0;
23
+ margin: 0px 10px 0px 10px;
25
24
 
26
25
  &:not(:disabled):not([aria-disabled="true"]):hover,
27
26
  &:not(:disabled):not([aria-disabled="true"]):focus-visible,
@@ -36,4 +35,8 @@
36
35
  &:not(:disabled):not([aria-disabled="true"]):focus {
37
36
  outline: none;
38
37
  }
39
- `;exports.IconContainer=o;exports.PlaybackButton=a;
38
+ `,i=t.default.span`
39
+ background: rgba(0, 0, 0, .7);
40
+ padding: 3px 10px 3px 10px;
41
+ border-radius: 10px;
42
+ `;exports.IconContainer=o;exports.PlaybackButton=r;exports.SpanLabel=i;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * todo: convert this to a CSS module
3
+ */
1
4
  /// <reference types="react" />
2
5
  export declare const IconContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
6
  export declare const PlaybackButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
7
+ export declare const SpanLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import e from "styled-components";
3
- const o = e.div`
2
+ import o from "styled-components";
3
+ const e = o.div`
4
4
  display: flex;
5
5
  justify-content: center;
6
6
  align-items: center;
@@ -9,11 +9,10 @@ const o = e.div`
9
9
  border-radius: 22px;
10
10
  background-color: var(--button-background-color);
11
11
  color: var(--neutral95, #1f2121);
12
- `, n = e.button`
12
+ `, n = o.button`
13
13
  --button-color: var(--white, #fff);
14
14
  --button-background-color: var(--neutral15, #e6e6e6);
15
15
 
16
- background: transparent;
17
16
  border: none;
18
17
  color: var(--button-color);
19
18
  cursor: pointer;
@@ -23,14 +22,14 @@ const o = e.div`
23
22
  gap: 0.75em;
24
23
  text-align: center;
25
24
  padding: 0;
26
- margin: 0;
25
+ margin: 0px 10px 0px 10px;
27
26
 
28
27
  &:not(:disabled):not([aria-disabled="true"]):hover,
29
28
  &:not(:disabled):not([aria-disabled="true"]):focus-visible,
30
29
  &:not(:disabled):not([aria-disabled="true"]).focus-visible {
31
30
  text-decoration: underline;
32
31
 
33
- ${o} {
32
+ ${e} {
34
33
  outline: 1px solid var(--white, #fff);
35
34
  outline-offset: 1px;
36
35
  }
@@ -38,8 +37,13 @@ const o = e.div`
38
37
  &:not(:disabled):not([aria-disabled="true"]):focus {
39
38
  outline: none;
40
39
  }
40
+ `, r = o.span`
41
+ background: rgba(0, 0, 0, .7);
42
+ padding: 3px 10px 3px 10px;
43
+ border-radius: 10px;
41
44
  `;
42
45
  export {
43
- o as IconContainer,
44
- n as PlaybackButton
46
+ e as IconContainer,
47
+ n as PlaybackButton,
48
+ r as SpanLabel
45
49
  };
@@ -78,7 +78,7 @@
78
78
  "forward": "Adelantar",
79
79
  "pause": "Pausar",
80
80
  "play": "Reproducir",
81
- "reset": "Reset",
81
+ "reset": "Reset"
82
82
  }
83
83
  },
84
84
  "isochrone_plot": {
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- :root{--white: #ffffff;--black: #000000;--lightBlue: #bee7f5;--boldRed: #df0039;--ral5018HR: #087f80;--neutral10: #f3f3f3;--neutral20: #737373;--basePrimary: var(--ral5018HR);--error: var(--boldRed);--break40: 420px;--break100: 1284px;--minPadding: 20px;--containerMaxWidth: var(--break100);--offset: 300px;--regular: 400;--medium: 500;--duration: .2s;--durationSlow: .4s;--timing: ease;--siteProgressHeight: 26px;--siteToolbarHeight: 64px;--siteHeaderHeight: var(--siteProgressHeight) + var(--siteToolbarHeight);--pageNavHeight: 64px;--headingWithSpaceHeight: 90px;--tallestSquareWidget: calc(100vh - var(--pageNavHeight) - var(--siteHeaderHeight) - var(--headingWithSpaceHeight) - var(--minPadding))}._container_13gyh_35{position:relative;height:var(--tallestSquareWidget);min-height:var(--break40);background-color:var(--black);color-adjust:exact}._orbital-canvas_13gyh_43{position:relative;z-index:1}._playback-speed-slider-header_13gyh_48{position:absolute;top:34px;right:10px;z-index:2;width:110px;padding:5px;text-align:center;background-color:#fffc;border:1px solid --black;border-radius:10px}._playback-speed-title_13gyh_61{font-family:Roboto;font-size:18px;font-weight:var(--regular);line-height:1.5;color:var(--black);margin:0}._playback-speed-slider-label_13gyh_72{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black);font-size:12.5px}._playback-speed-slider-label-bottom_13gyh_83,._playback-speed-slider-label-top_13gyh_84{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black);position:absolute;right:var(--minPadding) / 2;z-index:2;width:70px;padding:5px;color:var(--white);text-align:center;background-color:rgb(from var(--basePrimary) r g b / 80%);border:1px solid var(--black);border-radius:10px}._playback-speed-slider-label-bottom_13gyh_83{top:calc(40px + (var(--minPadding) + var(--tallestSquareWidget) - var(--offset)));right:10px}._playback-speed-slider-label-top_13gyh_84{right:10px;top:calc(80px + var(--minPadding))}._playback-speed-slider_13gyh_48{position:absolute;z-index:2;height:50px;top:25%;right:5rem;width:fit-content}._elapsed-time-container_13gyh_126{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;position:absolute;right:10px;bottom:100px;z-index:2;color:var(--black);text-align:center;background-color:rgb(from var(--white) r g b / 80%);border:1px solid var(--black);border-radius:10px}._elapsed-time-container_13gyh_126 ._elapsed-time-title_13gyh_145{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black);padding-top:5px}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156{display:flex;flex-flow:nowrap;align-items:center;justify-content:space-evenly;margin-top:5px;border-top:1px solid var(--black)}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-divider_13gyh_165{display:block;width:1px;height:50px;background-color:var(--black)}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-block_13gyh_172{width:50px}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-block_13gyh_172 ._elapsed-val_13gyh_176{font-family:Roboto;font-size:18px;font-weight:var(--regular);line-height:1.5;color:var(--black)}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-block_13gyh_172 ._elapsed-label_13gyh_187{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black)}._padded-drawer-inner_13gyh_198{width:(var(--containerMaxWidth) - var(--minPadding) / 2);padding:0 0 0 72px;outline:none}@media all and (max-width: 1284px){._padded-drawer-inner_13gyh_198{width:calc((100vw - 40px)/2)}}._nav-item_13gyh_209 ._md-list-tile_13gyh_209{background-color:var(--neutral10);transition:background-color var(--timing) var(--duration)}._nav-item_13gyh_209 ._md-list-tile_13gyh_209 ._md-tile-addon_13gyh_214{color:var(--basePrimary);transition:color var(--timing) var(--duration)}._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover{background-color:var(--basePrimary)}._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-tile-addon_13gyh_214,._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-tile-text--primary_13gyh_227,._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-tile-text--primary_13gyh_227._md-text--theme-primary_13gyh_228,._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-text_13gyh_228{color:var(--white)}._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209{background-color:var(--basePrimary)}._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-tile-addon_13gyh_214{color:var(--white)}._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-tile-text--primary_13gyh_227,._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-tile-text--primary_13gyh_227._md-text--theme-primary_13gyh_228,._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-text_13gyh_228{color:var(--white)!important}._label_13gyh_249{padding:2px 4px;margin-top:4px;font-weight:var(--medium);color:var(--black);background-color:color-mix(in srgb,var(--white) 40%,transparent);border:1px solid color-mix(in srgb,var(--white) 40%,transparent);border-radius:5px;color-adjust:exact}._obs-mesh_13gyh_260{cursor:pointer}._obs-label_13gyh_264{padding-top:-8px;font-size:16px;color:var(--white);cursor:pointer}._obs-label_13gyh_264._obs-answer_13gyh_271,._obs-label_13gyh_264._obs-hover_13gyh_272{font-size:18px;color:"blue"}._obs-label_13gyh_264._obs-active_13gyh_277{font-size:18px;color:"red"}._details_13gyh_288{position:absolute;top:0;right:0;left:0;z-index:2;max-width:0;overflow:hidden;transition:max-width var(--timing) var(--durationSlow)}._details_13gyh_288 ._details-table_13gyh_299{margin-top:calc(var(--minPadding) * 2 + 36px);background-color:var(--white)}._details_13gyh_288 ._details-table_13gyh_299 ._md-text_13gyh_228{overflow:hidden;white-space:nowrap}._details_13gyh_288._active-details_13gyh_309{width:100%;max-width:350px}._details_13gyh_288._active-details_13gyh_309 ._details-table_13gyh_299 ._md-text_13gyh_228{overflow:auto;white-space:normal}._details-toggle_13gyh_319{position:absolute;top:0;left:0;z-index:3;margin:var(--minPadding);color:var(--white)!important;background-color:var(--error)}._details-toggle_13gyh_319._disabled_13gyh_330{background-color:var(--neutral20)}._slideoutPanel_13gyh_334{background-color:var(--neutral10);display:flex;flex-direction:column;gap:1em;padding:1em;font-size:.75rem}._slideoutPanel_13gyh_334>*+*{margin-block-start:1em}._slideoutRow_13gyh_347{display:flex;gap:20px}._slideoutCol_13gyh_352{flex:1;padding:0 15px;border:1px solid #ccc;background-color:#ccc;border-radius:15px}._slideoutCol_13gyh_352[data-align=right]{text-align:right}._slideoutCol_13gyh_352[data-align=left]{font-weight:700}._slideout_13gyh_334 [data-testid=slideoutBackdrop]{display:none;opacity:0;pointer-events:none}._slideoutPanel_13gyh_334>h3{margin:0;text-align:center}:root{--black: #000000;--turquoise70: #058b8c;--brightGreen: #01bbbc;--mediumGreen: var(--turquoise70);--awRed: #ed4c4c;--awOrange: #fab364;--awYellow: #ffe266;--acPurple: #583671;--acGreen: #3cae3f;--acBlue: #1c81a4}:root :export{--chart0: var(--black);--chart1: var(--acBlue);--chart2: var(--awYellow);--chart3: var(--awRed);--chart4: var(--acGreen);--chart5: var(--awOrange);--chart6: var(--acPurple);--chart7: var(--mediumGreen);--chart8: var(--brightGreen)}._playbackControlsContainer_1f1sq_1{width:auto;display:flex;position:absolute;bottom:0;left:50%;transform:translate(-50%);z-index:2}
1
+ :root{--white: #ffffff;--black: #000000;--lightBlue: #bee7f5;--boldRed: #df0039;--ral5018HR: #087f80;--neutral10: #f3f3f3;--neutral20: #737373;--basePrimary: var(--ral5018HR);--error: var(--boldRed);--break40: 420px;--break100: 1284px;--minPadding: 20px;--containerMaxWidth: var(--break100);--offset: 300px;--regular: 400;--medium: 500;--duration: .2s;--durationSlow: .4s;--timing: ease;--siteProgressHeight: 26px;--siteToolbarHeight: 64px;--siteHeaderHeight: var(--siteProgressHeight) + var(--siteToolbarHeight);--pageNavHeight: 64px;--headingWithSpaceHeight: 90px;--tallestSquareWidget: calc(100vh - var(--pageNavHeight) - var(--siteHeaderHeight) - var(--headingWithSpaceHeight) - var(--minPadding))}._container_8ubzd_35{position:relative;height:var(--tallestSquareWidget);min-height:var(--break40);background-color:var(--black);color-adjust:exact}._orbital-canvas_8ubzd_43{position:relative;z-index:1}._playback-speed-slider-header_8ubzd_48{position:absolute;top:34px;right:10px;z-index:2;width:110px;padding:5px;text-align:center;background-color:#fffc;border:1px solid --black;border-radius:10px}._playback-speed-title_8ubzd_61{font-size:18px;font-weight:var(--regular);line-height:1.5;color:var(--black);margin:0}._playback-speed-slider-label_8ubzd_70{font-size:13px;line-height:1.333;color:var(--black);font-size:12.5px}._playback-speed-slider-label-bottom_8ubzd_78,._playback-speed-slider-label-top_8ubzd_79{font-size:13px;line-height:1.333;color:var(--black);position:absolute;right:var(--minPadding) / 2;z-index:2;width:70px;padding:5px;color:var(--white);text-align:center;background-color:rgb(from var(--basePrimary) r g b / 80%);border:1px solid var(--black);border-radius:10px}._playback-speed-slider-label-bottom_8ubzd_78{top:calc(40px + (var(--minPadding) + var(--tallestSquareWidget) - var(--offset)));right:10px}._playback-speed-slider-label-top_8ubzd_79{right:10px;top:calc(80px + var(--minPadding))}._playback-speed-slider_8ubzd_48{position:absolute;z-index:2;height:50px;top:25%;right:5rem;width:fit-content}._elapsed-time-container_8ubzd_115{font-size:13px;line-height:1.333;position:absolute;right:10px;bottom:100px;z-index:2;color:var(--black);text-align:center;background-color:rgb(from var(--white) r g b / 80%);border:1px solid var(--black);border-radius:10px}._elapsed-time-container_8ubzd_115 ._elapsed-time-title_8ubzd_131{font-size:13px;line-height:1.333;color:var(--black);padding-top:5px}._elapsed-time-container_8ubzd_115 ._elapsed-time-inner_8ubzd_139{display:flex;flex-flow:nowrap;align-items:center;justify-content:space-evenly;margin-top:5px;border-top:1px solid var(--black)}._elapsed-time-container_8ubzd_115 ._elapsed-time-inner_8ubzd_139 ._elapsed-time-divider_8ubzd_148{display:block;width:1px;height:50px;background-color:var(--black)}._elapsed-time-container_8ubzd_115 ._elapsed-time-inner_8ubzd_139 ._elapsed-time-block_8ubzd_155{width:50px}._elapsed-time-container_8ubzd_115 ._elapsed-time-inner_8ubzd_139 ._elapsed-time-block_8ubzd_155 ._elapsed-val_8ubzd_159{font-size:18px;font-weight:var(--regular);line-height:1.5;color:var(--black)}._elapsed-time-container_8ubzd_115 ._elapsed-time-inner_8ubzd_139 ._elapsed-time-block_8ubzd_155 ._elapsed-label_8ubzd_168{font-size:13px;line-height:1.333;color:var(--black)}._padded-drawer-inner_8ubzd_176{width:(var(--containerMaxWidth) - var(--minPadding) / 2);padding:0 0 0 72px;outline:none}@media all and (max-width: 1284px){._padded-drawer-inner_8ubzd_176{width:calc((100vw - 40px)/2)}}._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187{background-color:var(--neutral10);transition:background-color var(--timing) var(--duration)}._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187 ._md-tile-addon_8ubzd_192{color:var(--basePrimary);transition:color var(--timing) var(--duration)}._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187:hover{background-color:var(--basePrimary)}._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187:hover ._md-tile-addon_8ubzd_192,._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187:hover ._md-tile-text--primary_8ubzd_205,._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187:hover ._md-tile-text--primary_8ubzd_205._md-text--theme-primary_8ubzd_206,._nav-item_8ubzd_187 ._md-list-tile_8ubzd_187:hover ._md-text_8ubzd_206{color:var(--white)}._nav-item_8ubzd_187._active-item_8ubzd_211 ._md-list-tile_8ubzd_187{background-color:var(--basePrimary)}._nav-item_8ubzd_187._active-item_8ubzd_211 ._md-list-tile_8ubzd_187 ._md-tile-addon_8ubzd_192{color:var(--white)}._nav-item_8ubzd_187._active-item_8ubzd_211 ._md-list-tile_8ubzd_187 ._md-tile-text--primary_8ubzd_205,._nav-item_8ubzd_187._active-item_8ubzd_211 ._md-list-tile_8ubzd_187 ._md-tile-text--primary_8ubzd_205._md-text--theme-primary_8ubzd_206,._nav-item_8ubzd_187._active-item_8ubzd_211 ._md-list-tile_8ubzd_187 ._md-text_8ubzd_206{color:var(--white)!important}._label_8ubzd_227{padding:2px 4px;margin-top:4px;font-weight:var(--medium);color:var(--black);background-color:color-mix(in srgb,var(--white) 40%,transparent);border:1px solid color-mix(in srgb,var(--white) 40%,transparent);border-radius:5px;color-adjust:exact}._obs-mesh_8ubzd_238{cursor:pointer}._obs-label_8ubzd_242{padding-top:-8px;font-size:16px;color:var(--white);cursor:pointer}._obs-label_8ubzd_242._obs-answer_8ubzd_249,._obs-label_8ubzd_242._obs-hover_8ubzd_250{font-size:18px;color:"yellow"}._obs-label_8ubzd_242._obs-active_8ubzd_255{font-size:18px;color:"red"}._details_8ubzd_266{position:absolute;top:0;right:0;left:0;z-index:2;max-width:0;overflow:hidden;transition:max-width var(--timing) var(--durationSlow)}._details_8ubzd_266 ._details-table_8ubzd_277{margin-top:calc(var(--minPadding) * 2 + 36px);background-color:var(--white)}._details_8ubzd_266 ._details-table_8ubzd_277 ._md-text_8ubzd_206{overflow:hidden;white-space:nowrap}._details_8ubzd_266._active-details_8ubzd_287{width:100%;max-width:350px}._details_8ubzd_266._active-details_8ubzd_287 ._details-table_8ubzd_277 ._md-text_8ubzd_206{overflow:auto;white-space:normal}._details-toggle_8ubzd_297{position:absolute;top:0;left:0;z-index:3;margin:var(--minPadding);color:var(--white)!important;background-color:var(--error)}._details-toggle_8ubzd_297._disabled_8ubzd_308{background-color:var(--neutral20)}._slideoutPanel_8ubzd_312{background-color:var(--neutral10);display:flex;flex-direction:column;gap:1em;padding:1em;font-size:.75rem}._slideoutPanel_8ubzd_312>*+*{margin-block-start:1em}._slideoutRow_8ubzd_325{display:flex;gap:20px}._slideoutCol_8ubzd_330{flex:1;padding:0 15px;border:1px solid #ccc;background-color:#ccc;border-radius:15px}._slideoutCol_8ubzd_330[data-align=right]{text-align:right}._slideoutCol_8ubzd_330[data-align=left]{font-weight:700}._slideout_8ubzd_312 [data-testid=slideoutBackdrop]{display:none;opacity:0;pointer-events:none}._slideoutPanel_8ubzd_312>h3{margin:0;text-align:center}:root{--black: #000000;--turquoise70: #058b8c;--brightGreen: #01bbbc;--mediumGreen: var(--turquoise70);--awRed: #ed4c4c;--awOrange: #fab364;--awYellow: #ffe266;--acPurple: #583671;--acGreen: #3cae3f;--acBlue: #1c81a4}:root :export{--chart0: var(--black);--chart1: var(--acBlue);--chart2: var(--awYellow);--chart3: var(--awRed);--chart4: var(--acGreen);--chart5: var(--awOrange);--chart6: var(--acPurple);--chart7: var(--mediumGreen);--chart8: var(--brightGreen)}._playbackControlsContainer_1m020_1{width:auto;display:flex;position:absolute;bottom:0;left:50%;transform:translate(-50%);z-index:2;font-size:17px}
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),e=require("react"),o=e.createContext(null);function O(){const n=e.useContext(o);if(!n)throw new Error("OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component.");return n}function m({children:n,orbitData:s}){const[i,r]=e.useState({neos:null,activeNeo:null,observations:[],activeObs:null,selectionCallback:null,paused:null,pov:null,defaultZoom:null,potentialOrbits:null,noDetails:null,detailsSet:null,detailsRows:null,refObjs:null,noLabels:null,noControls:!1}),[t,l]=e.useState(()=>i.observations??[]);e.useEffect(()=>{r(s),l(s.observations)},[s]);const a=b=>{if(t&&t.length>0){let v=t.map(u=>u.id==b?{...u,isActive:!0}:{...u,isActive:!1});l(v)}},c=e.useMemo(()=>({orbits:i,setOrbits:r,observations:t,setObservations:l,updateActiveObservation:a}),[i,r,t,l,a]);return d.jsx(o.Provider,{value:c,children:n})}exports.OrbitalSimContext=o;exports.OrbitalSimProvider=m;exports.default=o;exports.useOrbitalSimContext=O;
@@ -0,0 +1,66 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface OrbitalSimProviderProps {
4
+ children: ReactNode;
5
+ orbitData: Orbits;
6
+ }
7
+ type OrbitalSimContextValues = {
8
+ orbits: Orbits;
9
+ setOrbits: React.Dispatch<React.SetStateAction<Orbits>>;
10
+ observations: Observation[];
11
+ setObservations: React.Dispatch<React.SetStateAction<Observation[]>>;
12
+ updateActiveObservation: (activeId: string) => void;
13
+ };
14
+ type Observation = {
15
+ id: string;
16
+ label: string;
17
+ interactable: boolean;
18
+ isActive: boolean;
19
+ position: number;
20
+ isAnswer?: boolean;
21
+ };
22
+ type Orbits = {
23
+ neos: any;
24
+ activeNeo: any;
25
+ observations: Observation[];
26
+ activeObs: any;
27
+ selectionCallback: any;
28
+ paused: any;
29
+ pov: any;
30
+ defaultZoom: any;
31
+ potentialOrbits: any;
32
+ noDetails: any;
33
+ detailsSet: any;
34
+ detailsRows: any;
35
+ refObjs: any;
36
+ noLabels: any;
37
+ noControls: boolean;
38
+ };
39
+ export declare const OrbitalSimContext: import('react').Context<OrbitalSimContextValues | null>;
40
+ export default OrbitalSimContext;
41
+ /**
42
+ * This custom hooks returns a reference to the `OrbitalSimContext` which will
43
+ * expose orbital and observation data, and a callback that can be passed to
44
+ * update the selected observation - if applicable - in the web client. The
45
+ * data for this context provider must be passed to `<OrbitalSimProvider>` as
46
+ * the `orbitData` prop.
47
+ *
48
+ * @returns a reference to the context provider
49
+ */
50
+ export declare function useOrbitalSimContext(): OrbitalSimContextValues;
51
+ /**
52
+ * The context provider that must wrap the implementation of the `<OrbitalSim>`,
53
+ * and this is all that is necessary to populate the `OrbitalSim` with data. The
54
+ * context provider expects a prop called `orbitData` consisting of the object
55
+ * that represents the monolithic orbits of visualized in the `OrbitalSim`. The
56
+ * context provider will parse out the `observations` and expose a callback function
57
+ * named `updateActiveObservation()` which can be passed to the `observation`
58
+ * components.
59
+ *
60
+ * @param children - a React.Node if necessary, but it shouldn't be
61
+ * @param orbitData - the monolithic object containing orbit, observation and detailed
62
+ * information data
63
+ *
64
+ * @returns
65
+ */
66
+ export declare function OrbitalSimProvider({ children, orbitData }: OrbitalSimProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { createContext as d, useContext as f, useState as u, useEffect as O, useMemo as p } from "react";
4
+ const a = d(null);
5
+ function S() {
6
+ const t = f(a);
7
+ if (!t)
8
+ throw new Error(
9
+ "OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component."
10
+ );
11
+ return t;
12
+ }
13
+ function w({ children: t, orbitData: o }) {
14
+ const [l, s] = u({
15
+ neos: null,
16
+ activeNeo: null,
17
+ observations: [],
18
+ activeObs: null,
19
+ selectionCallback: null,
20
+ paused: null,
21
+ pov: null,
22
+ defaultZoom: null,
23
+ potentialOrbits: null,
24
+ noDetails: null,
25
+ detailsSet: null,
26
+ detailsRows: null,
27
+ refObjs: null,
28
+ noLabels: null,
29
+ noControls: !1
30
+ }), [e, n] = u(
31
+ () => l.observations ?? []
32
+ );
33
+ O(() => {
34
+ s(o), n(o.observations);
35
+ }, [o]);
36
+ const r = (b) => {
37
+ if (e && e.length > 0) {
38
+ let v = e.map((i) => i.id == b ? { ...i, isActive: !0 } : { ...i, isActive: !1 });
39
+ n(v);
40
+ }
41
+ }, c = p(() => ({
42
+ orbits: l,
43
+ setOrbits: s,
44
+ observations: e,
45
+ setObservations: n,
46
+ updateActiveObservation: r
47
+ }), [
48
+ l,
49
+ s,
50
+ e,
51
+ n,
52
+ r
53
+ ]);
54
+ return /* @__PURE__ */ m(a.Provider, { value: c, children: t });
55
+ }
56
+ export {
57
+ a as OrbitalSimContext,
58
+ w as OrbitalSimProvider,
59
+ a as default,
60
+ S as useOrbitalSimContext
61
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="_playbackControlsContainer_1f1sq_1",t={playbackControlsContainer:o};exports.default=t;exports.playbackControlsContainer=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="_playbackControlsContainer_1m020_1",t={playbackControlsContainer:o};exports.default=t;exports.playbackControlsContainer=o;
@@ -1,4 +1,4 @@
1
- const o = "_playbackControlsContainer_1f1sq_1", a = {
1
+ const o = "_playbackControlsContainer_1m020_1", a = {
2
2
  playbackControlsContainer: o
3
3
  };
4
4
  export {
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),r=require("../../node_modules/prop-types/index.cjs"),g=require("../../node_modules/classnames/index.cjs"),O=require("@react-three/drei"),t=require("./OrbitalSim.module.css.cjs");function b({data:a,activeObs:o,vector:v,selectionCallback:m}){const{id:u,label:h,interactable:i,isActive:c}=a,[d,f]=n.useState(!1),[s,j]=n.useState(()=>{const{id:l}=o||{};return l===u});n.useEffect(()=>{const{id:l}=o||{};j(l===u)},[o]);function x(){return c&&s?"green":s||d?"blue":"gray"}return e.jsxs("mesh",{className:t.default["obs-mesh"],position:v,onClick:i?()=>m(a,"obs"):null,onPointerOver:i?()=>f(!0):null,onPointerOut:i?()=>f(!1):null,children:[e.jsx(O.Html,{children:e.jsx("div",{className:g.default(t.default["obs-label"],{[t.default["obs-answer"]]:c&&s,[t.default["obs-hover"]]:d,[t.default["obs-active"]]:s}),children:h})}),e.jsx("octahedronGeometry",{attach:"geometry",args:[20]}),e.jsx("meshBasicMaterial",{attach:"material",color:x()})]})}b.propTypes={data:r.default.object,selectionCallback:r.default.func,activeObs:r.default.object,vector:r.default.object};exports.default=b;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),f=require("react"),n=require("../../node_modules/prop-types/index.cjs"),v=require("../../node_modules/classnames/index.cjs"),x=require("@react-three/drei"),o=require("./OrbitalSim.module.css.cjs"),h=require("./Context/index.cjs");function l({data:r,vector:a}){const{updateActiveObservation:u}=h.useOrbitalSimContext(),{label:c,interactable:t,isActive:s,isAnswer:d}=r,[b,i]=f.useState(!1);function m(){return s&&d?"green":s||b?"blue":"gray"}return e.jsxs("mesh",{className:o.default["obs-mesh"],position:a,onClick:t?()=>{u(r.id)}:null,onPointerOver:t?()=>i(!0):null,onPointerOut:t?()=>i(!1):null,children:[e.jsx(x.Html,{children:e.jsx("div",{className:v.default(o.default["obs-label"]),children:c})}),e.jsx("octahedronGeometry",{attach:"geometry",args:[20]}),e.jsx("meshBasicMaterial",{attach:"material",color:m()})]})}l.propTypes={data:n.default.object,vector:n.default.object};exports.default=l;
@@ -1,16 +1,12 @@
1
1
  import { default as PropTypes } from 'prop-types';
2
2
  export default Observation;
3
- declare function Observation({ data, activeObs, vector, selectionCallback }: {
3
+ declare function Observation({ data, vector }: {
4
4
  data: any;
5
- activeObs: any;
6
5
  vector: any;
7
- selectionCallback: any;
8
6
  }): import("react/jsx-runtime").JSX.Element;
9
7
  declare namespace Observation {
10
8
  namespace propTypes {
11
9
  let data: PropTypes.Requireable<object>;
12
- let selectionCallback: PropTypes.Requireable<(...args: any[]) => any>;
13
- let activeObs: PropTypes.Requireable<object>;
14
10
  let vector: PropTypes.Requireable<object>;
15
11
  }
16
12
  }
@@ -1,60 +1,50 @@
1
1
  "use client";
2
- import { jsxs as y, jsx as o } from "react/jsx-runtime";
3
- import { useState as b, useEffect as g } from "react";
4
- import r from "../../node_modules/prop-types/index.js";
5
- import j from "../../node_modules/classnames/index.js";
6
- import { Html as A } from "@react-three/drei";
7
- import e from "./OrbitalSim.module.css.js";
8
- function O({ data: c, activeObs: s, vector: f, selectionCallback: p }) {
9
- const { id: a, label: v, interactable: i, isActive: l } = c, [m, u] = b(!1), [t, d] = b(() => {
10
- const { id: n } = s || {};
11
- return n === a;
12
- });
13
- g(() => {
14
- const { id: n } = s || {};
15
- d(n === a);
16
- }, [s]);
17
- function h() {
18
- return l && t ? "green" : t || m ? "blue" : "gray";
2
+ import { jsxs as f, jsx as e } from "react/jsx-runtime";
3
+ import { useState as b } from "react";
4
+ import i from "../../node_modules/prop-types/index.js";
5
+ import h from "../../node_modules/classnames/index.js";
6
+ import { Html as v } from "@react-three/drei";
7
+ import n from "./OrbitalSim.module.css.js";
8
+ import { useOrbitalSimContext as d } from "./Context/index.js";
9
+ function y({ data: r, vector: a }) {
10
+ const { updateActiveObservation: l } = d(), { label: m, interactable: t, isActive: o, isAnswer: c } = r, [u, s] = b(!1);
11
+ function p() {
12
+ return o && c ? "green" : o || u ? "blue" : "gray";
19
13
  }
20
- return /* @__PURE__ */ y(
14
+ return /* @__PURE__ */ f(
21
15
  "mesh",
22
16
  {
23
- className: e["obs-mesh"],
24
- position: f,
25
- onClick: i ? () => p(c, "obs") : null,
26
- onPointerOver: i ? () => u(!0) : null,
27
- onPointerOut: i ? () => u(!1) : null,
17
+ className: n["obs-mesh"],
18
+ position: a,
19
+ onClick: t ? () => {
20
+ l(r.id);
21
+ } : null,
22
+ onPointerOver: t ? () => s(!0) : null,
23
+ onPointerOut: t ? () => s(!1) : null,
28
24
  children: [
29
- /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(
25
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(
30
26
  "div",
31
27
  {
32
- className: j(e["obs-label"], {
33
- [e["obs-answer"]]: l && t,
34
- [e["obs-hover"]]: m,
35
- [e["obs-active"]]: t
36
- }),
37
- children: v
28
+ className: h(n["obs-label"]),
29
+ children: m
38
30
  }
39
31
  ) }),
40
- /* @__PURE__ */ o("octahedronGeometry", { attach: "geometry", args: [20] }),
41
- /* @__PURE__ */ o(
32
+ /* @__PURE__ */ e("octahedronGeometry", { attach: "geometry", args: [20] }),
33
+ /* @__PURE__ */ e(
42
34
  "meshBasicMaterial",
43
35
  {
44
36
  attach: "material",
45
- color: h()
37
+ color: p()
46
38
  }
47
39
  )
48
40
  ]
49
41
  }
50
42
  );
51
43
  }
52
- O.propTypes = {
53
- data: r.object,
54
- selectionCallback: r.func,
55
- activeObs: r.object,
56
- vector: r.object
44
+ y.propTypes = {
45
+ data: i.object,
46
+ vector: i.object
57
47
  };
58
48
  export {
59
- O as default
49
+ y as default
60
50
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),v=require("react"),a=require("../../node_modules/prop-types/index.cjs"),x=require("three"),O=require("./Observation.cjs"),s=require("./orbitalUtilities.cjs");function y(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const T=y(x),b=({data:e,observations:t,activeObs:r,selectionCallback:c})=>{const[d]=v.useState(()=>{const{a:i,e:l}=e,n=s.auToUnit(i),u=s.getMinorAxis(i,l),g=s.getFocus(n,u),f=new T.Vector3(g,0,0),p=s.getCurve(n,u,f.x,f.y);return(t||[]).map(j=>{const{position:m}=j;return s.convert2dTo3d(p.getPoint(m),e)})});return o.jsx(o.Fragment,{children:d&&o.jsx(o.Fragment,{children:d.map((i,l)=>{const n=t[l],{id:u}=n;return o.jsx(O.default,{data:n,vector:i,selectionCallback:c,activeObs:r},u)})})})};b.propTypes={data:a.default.object,observations:a.default.array,selectionCallback:a.default.func,activeObs:a.default.object};exports.default=b;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),m=require("react"),l=require("../../node_modules/prop-types/index.cjs"),j=require("three"),v=require("./Observation.cjs"),c=require("./orbitalUtilities.cjs");function x(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const O=x(j),d=({data:e,observations:n})=>{const[t]=m.useState(()=>{const{a:r,e:u}=e,o=c.auToUnit(r),i=c.getMinorAxis(r,u),f=c.getFocus(o,i),a=new O.Vector3(f,0,0),b=c.getCurve(o,i,a.x,a.y);return(n||[]).map(g=>{const{position:p}=g;return c.convert2dTo3d(b.getPoint(p),e)})});return s.jsx(s.Fragment,{children:t&&s.jsx(s.Fragment,{children:t.map((r,u)=>{const o=n[u],{id:i}=o;return s.jsx(v.default,{data:o,vector:r},i)})})})};d.propTypes={data:l.default.object,observations:l.default.array};exports.default=d;
@@ -1,16 +1,12 @@
1
1
  import { default as PropTypes } from 'prop-types';
2
2
  export default Observations;
3
- declare function Observations({ data, observations, activeObs, selectionCallback }: {
3
+ declare function Observations({ data, observations }: {
4
4
  data: any;
5
5
  observations: any;
6
- activeObs: any;
7
- selectionCallback: any;
8
6
  }): import("react/jsx-runtime").JSX.Element;
9
7
  declare namespace Observations {
10
8
  namespace propTypes {
11
9
  let data: PropTypes.Requireable<object>;
12
10
  let observations: PropTypes.Requireable<any[]>;
13
- let selectionCallback: PropTypes.Requireable<(...args: any[]) => any>;
14
- let activeObs: PropTypes.Requireable<object>;
15
11
  }
16
12
  }