@rubin-epo/epo-widget-lib 2.0.3 → 2.0.5

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 (68) hide show
  1. package/dist/SortableTable.cjs +1 -0
  2. package/dist/SortableTable.d.ts +3 -0
  3. package/dist/SortableTable.js +5 -0
  4. package/dist/SourceSelector.cjs +1 -1
  5. package/dist/SourceSelector.js +6 -4
  6. package/dist/atomic/Blinker/Blinker.cjs +1 -1
  7. package/dist/atomic/Blinker/Blinker.d.ts +1 -0
  8. package/dist/atomic/Blinker/Blinker.js +27 -25
  9. package/dist/atomic/SelectionList/index.cjs +1 -0
  10. package/dist/{widgets/SourceSelector → atomic}/SelectionList/index.d.ts +1 -1
  11. package/dist/atomic/SelectionList/index.js +31 -0
  12. package/dist/charts/Readout/index.cjs +1 -1
  13. package/dist/charts/Readout/index.js +18 -25
  14. package/dist/charts/ScatterPlot/index.cjs +1 -1
  15. package/dist/charts/ScatterPlot/index.js +50 -53
  16. package/dist/localeStrings/en/epo-widget-lib.json +11 -3
  17. package/dist/localeStrings/es/epo-widget-lib.json +8 -5
  18. package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
  19. package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -1
  20. package/dist/widgets/OrbitalSim/Camera/Camera.js +9 -8
  21. package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
  22. package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
  23. package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
  24. package/dist/widgets/OrbitalSim/Context/index.js +58 -32
  25. package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
  26. package/dist/widgets/OrbitalSim/OrbitalSim.js +95 -78
  27. package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
  28. package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
  29. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
  30. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
  31. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
  32. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
  33. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
  34. package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
  35. package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
  36. package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
  37. package/dist/widgets/OrbitalSim/styles.cjs +33 -5
  38. package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
  39. package/dist/widgets/OrbitalSim/styles.js +36 -6
  40. package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
  41. package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
  42. package/dist/widgets/SortableTable/SortableTable.js +41 -0
  43. package/dist/widgets/SortableTable/index.d.ts +1 -0
  44. package/dist/widgets/SortableTable/styles.cjs +8 -0
  45. package/dist/widgets/SortableTable/styles.d.ts +1 -0
  46. package/dist/widgets/SortableTable/styles.js +13 -0
  47. package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
  48. package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
  49. package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
  50. package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
  51. package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
  52. package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
  53. package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
  54. package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
  55. package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
  56. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  57. package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
  58. package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
  59. package/dist/widgets/SourceSelector/index.d.ts +2 -1
  60. package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
  61. package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
  62. package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
  63. package/package.json +1 -1
  64. package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
  65. package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
  66. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
  67. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
  68. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.js +0 -0
@@ -1,5 +1,5 @@
1
- import * as i from "three";
2
- const c = 100, g = 1, s = {
1
+ import * as s from "three";
2
+ const l = 100, m = 1, t = {
3
3
  sun: {
4
4
  objectColor: "#f8da86"
5
5
  },
@@ -24,8 +24,46 @@ const c = 100, g = 1, s = {
24
24
  orbitColor: "#6a6e6e",
25
25
  objectHighlight: "#00ffff",
26
26
  orbitHighlight: "#ffffff"
27
+ },
28
+ neos: {
29
+ objectColor: "#0ff",
30
+ orbitColor: "#b2ffff"
27
31
  }
28
- }, b = {
32
+ }, u = {
33
+ a: 1.4700451,
34
+ e: 0.5598234,
35
+ i: 6.35515,
36
+ H: 16.25,
37
+ Ref: "Apollo",
38
+ name: "Apollo",
39
+ Principal_desig: "1932 HA",
40
+ Translated_desig_key: "neo.apollo",
41
+ orbitColor: t.neos.orbitColor,
42
+ objectColor: t.neos.objectColor,
43
+ objectRadius: 5
44
+ }, C = {
45
+ a: 0.740919,
46
+ e: 0.3221221,
47
+ i: 25.62023,
48
+ H: 16.3,
49
+ Ref: "Atira",
50
+ Principal_desig: "2003 CP20",
51
+ Translated_desig_key: "neo.atira",
52
+ orbitColor: t.neos.orbitColor,
53
+ objectColor: t.neos.objectColor,
54
+ objectRadius: 5
55
+ }, d = {
56
+ a: 1.9194158,
57
+ e: 0.4353207,
58
+ i: 11.87658,
59
+ H: 17.7,
60
+ Ref: "Amor",
61
+ Principal_desig: "1932 EA1",
62
+ Translated_desig_key: "neo.amor",
63
+ orbitColor: t.neos.orbitColor,
64
+ objectColor: t.neos.objectColor,
65
+ objectRadius: 5
66
+ }, f = {
29
67
  a: 1,
30
68
  e: 0.01671022,
31
69
  i: 0,
@@ -33,9 +71,8 @@ const c = 100, g = 1, s = {
33
71
  Ref: "Earth",
34
72
  Principal_desig: "Earth",
35
73
  Translated_desig_key: "planets.earth",
36
- orbitColor: s.earth.orbitColor,
37
- objectColor: s.earth.objectColor,
38
- // objectRadius: 6371000,
74
+ orbitColor: t.earth.orbitColor,
75
+ objectColor: t.earth.objectColor,
39
76
  objectRadius: 5
40
77
  }, p = {
41
78
  a: 1.52366231,
@@ -45,10 +82,10 @@ const c = 100, g = 1, s = {
45
82
  Ref: "Mars",
46
83
  Principal_desig: "Mars",
47
84
  Translated_desig_key: "planets.mars",
48
- orbitColor: s.mars.orbitColor,
49
- objectColor: s.mars.objectColor,
85
+ orbitColor: t.mars.orbitColor,
86
+ objectColor: t.mars.objectColor,
50
87
  objectRadius: 4
51
- }, f = {
88
+ }, g = {
52
89
  a: 5.2028,
53
90
  e: 0.048,
54
91
  i: 1.31,
@@ -56,11 +93,11 @@ const c = 100, g = 1, s = {
56
93
  Ref: "Jupiter",
57
94
  Principal_desig: "Jupiter",
58
95
  Translated_desig_key: "planets.jupiter",
59
- orbitColor: s.jupiter.orbitColor,
60
- objectColor: s.jupiter.objectColor,
96
+ orbitColor: t.jupiter.orbitColor,
97
+ objectColor: t.jupiter.objectColor,
61
98
  // objectRadius: 69911000,
62
99
  objectRadius: 7
63
- }, C = {
100
+ }, j = {
64
101
  a: 30.06896348,
65
102
  e: 858587e-8,
66
103
  i: 1.76917,
@@ -68,25 +105,28 @@ const c = 100, g = 1, s = {
68
105
  Ref: "Neptune",
69
106
  Principal_desig: "Neptune",
70
107
  Translated_desig_key: "planets.neptune",
71
- orbitColor: s.neptune.orbitColor,
72
- objectColor: s.neptune.objectColor,
108
+ orbitColor: t.neptune.orbitColor,
109
+ objectColor: t.neptune.objectColor,
73
110
  // objectRadius: 24622000,
74
111
  objectRadius: 6
75
- }, j = (e) => ({
76
- neptune: C,
77
- earth: b,
112
+ }, R = (o) => ({
113
+ neptune: j,
114
+ earth: f,
78
115
  mars: p,
79
- jupiter: f
80
- })[e] || null, m = function(e, t) {
81
- return Number.parseFloat(Number.parseFloat(e).toFixed(t));
82
- }, h = (e, t, o = 0, r = 0) => new i.EllipseCurve(
83
- o,
84
- // aX
116
+ jupiter: g,
117
+ atira: C,
118
+ apollo: u,
119
+ amor: d
120
+ })[o] || null, A = function(o, e) {
121
+ return Number.parseFloat(Number.parseFloat(o).toFixed(e));
122
+ }, h = (o, e, r = 0, n = 0) => new s.EllipseCurve(
85
123
  r,
124
+ // aX
125
+ n,
86
126
  // aY
87
- e,
127
+ o,
88
128
  // xRadius
89
- t,
129
+ e,
90
130
  // yRadius
91
131
  0,
92
132
  // aStartAngle
@@ -96,42 +136,45 @@ const c = 100, g = 1, s = {
96
136
  // aClockwise
97
137
  0
98
138
  // aRotation
99
- ), _ = (e) => new i.BufferGeometry().setFromPoints(e), R = (e, t) => {
100
- const o = e.distanceTo(t), { x: r, y: n } = e;
101
- return Math.acos((o ** 2 + r ** 2 - n ** 2) / (2 * o * r)) * 180 / Math.PI;
102
- }, A = (e, t) => {
103
- const { x: o, y: r } = t.getPoint(e);
104
- return new i.Vector3(o, r, 0);
105
- }, d = (e) => e * c, x = (e) => e / c, y = (e, t) => d(e * Math.sqrt(1 - t ** 2)), P = (e) => 1496e8 * e, a = (e) => e * (Math.PI / 180), T = (e, t) => {
106
- const o = 296005155e-12 * c ** 3;
107
- return Math.sqrt(o * (2 / e - 1 / t));
108
- }, M = (e, t) => Math.sqrt(e ** 2 - t ** 2), S = (e, t) => {
109
- const { i: o, Peri: r, Node: n } = t, l = new i.Vector3(0, 1, 0), u = new i.Vector3(0, 0, 1);
110
- return new i.Vector3(e.x, e.y, 0).applyAxisAngle(u, r ? a(r + 90) : 0).applyAxisAngle(l, a(o)).applyAxisAngle(
111
- u,
112
- n ? a(n) : 0
139
+ ), P = (o) => new s.BufferGeometry().setFromPoints(o), y = (o, e) => {
140
+ const r = o.distanceTo(e), { x: n, y: i } = o;
141
+ return Math.acos((r ** 2 + n ** 2 - i ** 2) / (2 * r * n)) * 180 / Math.PI;
142
+ }, T = (o, e) => {
143
+ const { x: r, y: n } = e.getPoint(o);
144
+ return new s.Vector3(r, n, 0);
145
+ }, _ = (o) => o * l, x = (o) => o / l, M = (o, e) => _(o * Math.sqrt(1 - e ** 2)), S = (o) => 1496e8 * o, a = (o) => o * (Math.PI / 180), z = (o, e) => {
146
+ const r = 296005155e-12 * l ** 3;
147
+ return Math.sqrt(r * (2 / o - 1 / e));
148
+ }, H = (o, e) => Math.sqrt(o ** 2 - e ** 2), E = (o, e) => {
149
+ const { i: r, Peri: n, Node: i } = e, c = new s.Vector3(0, 1, 0), b = new s.Vector3(0, 0, 1);
150
+ return new s.Vector3(o.x, o.y, 0).applyAxisAngle(b, n ? a(n + 90) : 0).applyAxisAngle(c, a(r)).applyAxisAngle(
151
+ b,
152
+ i ? a(i) : 0
113
153
  );
114
- }, z = (e, t) => {
115
- const n = 15 * (e / t);
116
- return n <= 4 ? 4 : n >= 15 ? 15 : n;
154
+ }, V = (o, e) => {
155
+ const i = 15 * (o / e);
156
+ return i <= 4 ? 4 : i >= 15 ? 15 : i;
117
157
  };
118
158
  export {
119
- c as AU_TO_VIZ_SCALER,
120
- g as DAY_PER_VIZ_SEC,
121
- s as ORBITAL_COLORS,
122
- P as auToMeters,
123
- d as auToUnit,
124
- S as convert2dTo3d,
159
+ l as AU_TO_VIZ_SCALER,
160
+ m as DAY_PER_VIZ_SEC,
161
+ t as ORBITAL_COLORS,
162
+ d as amor,
163
+ u as apollo,
164
+ C as atira,
165
+ S as auToMeters,
166
+ _ as auToUnit,
167
+ E as convert2dTo3d,
125
168
  a as degsToRads,
126
- m as formatValue,
127
- R as getAngleFromPos,
169
+ A as formatValue,
170
+ y as getAngleFromPos,
128
171
  h as getCurve,
129
- M as getFocus,
130
- z as getLabelSize,
131
- _ as getLineGeometry,
132
- y as getMinorAxis,
133
- A as getPosFromArcLength,
134
- j as getRefObjProps,
135
- T as getVelocity,
172
+ H as getFocus,
173
+ V as getLabelSize,
174
+ P as getLineGeometry,
175
+ M as getMinorAxis,
176
+ T as getPosFromArcLength,
177
+ R as getRefObjProps,
178
+ z as getVelocity,
136
179
  x as unitToAu
137
180
  };
@@ -1,4 +1,4 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),r=require("@react-three/fiber"),i=e=>e&&e.__esModule?e:{default:e},a=i(t),o=t.createGlobalStyle`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("styled-components"),r=require("@react-three/fiber"),i=t=>t&&t.__esModule?t:{default:t},e=i(a),o=a.createGlobalStyle`
2
2
  :root {
3
3
  --white: #ffffff;
4
4
  --black: #000000;
@@ -32,16 +32,16 @@
32
32
  --headingWithSpaceHeight: 90px;
33
33
  --tallestSquareWidget: calc(100vh - var(--pageNavHeight) - var(--siteHeaderHeight) - var(--headingWithSpaceHeight) - var(--minPadding));
34
34
  }
35
- `,l=a.default.div`
35
+ `,l=e.default.div`
36
36
  position: relative;
37
37
  height: var(--tallestSquareWidget);
38
38
  min-height: 500px;
39
39
  background-color: #000000;
40
40
  color-adjust: exact;
41
- `,n=a.default(r.Canvas)`
41
+ `,n=e.default(r.Canvas)`
42
42
  position: relative;
43
43
  z-index: 1;
44
- `,s=a.default.div`
44
+ `,d=e.default.div`
45
45
  padding: 2px 4px;
46
46
  margin-top: 4px;
47
47
  font-weight: var(--medium);
@@ -52,4 +52,32 @@
52
52
  color-adjust: exact;
53
53
  z-index: 10000;
54
54
  height: fit-content;
55
- `;exports.CanvasWrapper=n;exports.GlobalStyles=o;exports.OrbitalSimWrapper=l;exports.SunLabel=s;
55
+ `,s=e.default.aside`
56
+ position: absolute;
57
+ top: 0px;
58
+ left: 0px;
59
+ bottom: 0px;
60
+ z-index: 10;
61
+ background-color: #fff;
62
+ width: 10%;
63
+ height: 100%;
64
+ display: flex;
65
+ flex-direction: column;
66
+ `,p=e.default.button`
67
+ width: 100%;
68
+ padding: 12px 16px;
69
+ text-align: left;
70
+ background-color: #F3F3F3;
71
+ color: #017F80;
72
+ text-align: center;
73
+
74
+ &:hover {
75
+ background-color: #017F80;
76
+ color: #fff;
77
+ }
78
+
79
+ &[data-active="true"] {
80
+ background-color: #017F80;
81
+ color: #fff;
82
+ }
83
+ `;exports.CanvasWrapper=n;exports.GlobalStyles=o;exports.OrbitalSimWrapper=l;exports.SunLabel=d;exports.SwappableOrbitButton=p;exports.SwappableOrbitsContainer=s;
@@ -4,3 +4,5 @@ export declare const GlobalStyles: import('react').NamedExoticComponent<import('
4
4
  export declare const OrbitalSimWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
5
  export declare const CanvasWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('@react-three/fiber').CanvasProps, never>> & string & Omit<typeof Canvas, keyof import('react').Component<any, {}, any>>;
6
6
  export declare const SunLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const SwappableOrbitsContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
8
+ export declare const SwappableOrbitButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import e, { createGlobalStyle as a } from "styled-components";
3
- import { Canvas as r } from "@react-three/fiber";
4
- const o = a`
2
+ import e, { createGlobalStyle as t } from "styled-components";
3
+ import { Canvas as a } from "@react-three/fiber";
4
+ const o = t`
5
5
  :root {
6
6
  --white: #ffffff;
7
7
  --black: #000000;
@@ -41,10 +41,10 @@ const o = a`
41
41
  min-height: 500px;
42
42
  background-color: #000000;
43
43
  color-adjust: exact;
44
- `, n = e(r)`
44
+ `, n = e(a)`
45
45
  position: relative;
46
46
  z-index: 1;
47
- `, s = e.div`
47
+ `, d = e.div`
48
48
  padding: 2px 4px;
49
49
  margin-top: 4px;
50
50
  font-weight: var(--medium);
@@ -55,10 +55,40 @@ const o = a`
55
55
  color-adjust: exact;
56
56
  z-index: 10000;
57
57
  height: fit-content;
58
+ `, c = e.aside`
59
+ position: absolute;
60
+ top: 0px;
61
+ left: 0px;
62
+ bottom: 0px;
63
+ z-index: 10;
64
+ background-color: #fff;
65
+ width: 10%;
66
+ height: 100%;
67
+ display: flex;
68
+ flex-direction: column;
69
+ `, p = e.button`
70
+ width: 100%;
71
+ padding: 12px 16px;
72
+ text-align: left;
73
+ background-color: #F3F3F3;
74
+ color: #017F80;
75
+ text-align: center;
76
+
77
+ &:hover {
78
+ background-color: #017F80;
79
+ color: #fff;
80
+ }
81
+
82
+ &[data-active="true"] {
83
+ background-color: #017F80;
84
+ color: #fff;
85
+ }
58
86
  `;
59
87
  export {
60
88
  n as CanvasWrapper,
61
89
  o as GlobalStyles,
62
90
  l as OrbitalSimWrapper,
63
- s as SunLabel
91
+ d as SunLabel,
92
+ p as SwappableOrbitButton,
93
+ c as SwappableOrbitsContainer
64
94
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),C=require("./styles.cjs"),r="asc",w="desc",j=({tableData:a})=>{const[i]=d.useState(a),o=a?Object.keys(i[0]):null,[s,f]=d.useState(o?o[0]:""),[c,S]=d.useState(r);function p(e){if(s===e){S(n=>n===r?w:r);return}f(e),S(r)}const m=d.useMemo(()=>{if(i)return[...i].sort((n,g)=>{const u=n[s],l=g[s];if(typeof u=="number"&&typeof l=="number")return c===r?u-l:l-u;const b=String(u).toLowerCase(),h=String(l).toLowerCase();return c===r?b.localeCompare(h):h.localeCompare(b)})},[i,s,c]);function x(e){return s!==e?"":c===r?"↑":"↓"}return t.jsx(t.Fragment,{children:a&&t.jsxs(C.Table,{children:[t.jsx("thead",{children:t.jsx("tr",{children:o&&o.map(e=>t.jsx("th",{scope:"col","aria-sort":s===e?c===r?"ascending":"descending":"none",children:t.jsxs("button",{type:"button",onClick:()=>p(e),children:[e," ",x(e)]})},e))})}),t.jsx("tbody",{children:m&&m.map(e=>t.jsx("tr",{children:o&&o.map(n=>t.jsx("td",{children:e[n]},n))}))})]})})};j.displayName="Widgets.SortableTable";exports.default=j;
@@ -0,0 +1,19 @@
1
+ type TableDataProps<T extends Record<string, string | number | null>> = {
2
+ tableData: T[];
3
+ };
4
+ /**
5
+ * This widget will take an array of uniform (same properties across all elements)
6
+ * objects and render a table from the values. The table headers will be created
7
+ * based on the property names. The table can be sorted ascending or descending
8
+ * by one column at a time. If non-uniform objects are contained in the array,
9
+ * the widget will only build out the columns specific by the properties on the
10
+ * first element of the array.
11
+ *
12
+ * @param tabledata: an array of objects that will be used to build the table
13
+ * @returns the sortable table
14
+ */
15
+ declare const SortableTable: {
16
+ <T extends Record<string, string | number | null>>({ tableData }: TableDataProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ };
19
+ export default SortableTable;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx as o, Fragment as j, jsxs as h } from "react/jsx-runtime";
3
+ import { useState as u, useMemo as x } from "react";
4
+ import { Table as N } from "./styles.js";
5
+ const r = "asc", T = "desc", y = ({
6
+ tableData: a
7
+ }) => {
8
+ const [i] = u(a), e = a ? Object.keys(i[0]) : null, [n, b] = u(e ? e[0] : ""), [c, m] = u(r);
9
+ function g(t) {
10
+ if (n === t) {
11
+ m((s) => s === r ? T : r);
12
+ return;
13
+ }
14
+ b(t), m(r);
15
+ }
16
+ const p = x(() => {
17
+ if (i)
18
+ return [...i].sort((s, w) => {
19
+ const l = s[n], d = w[n];
20
+ if (typeof l == "number" && typeof d == "number")
21
+ return c === r ? l - d : d - l;
22
+ const f = String(l).toLowerCase(), S = String(d).toLowerCase();
23
+ return c === r ? f.localeCompare(S) : S.localeCompare(f);
24
+ });
25
+ }, [i, n, c]);
26
+ function C(t) {
27
+ return n !== t ? "" : c === r ? "↑" : "↓";
28
+ }
29
+ return /* @__PURE__ */ o(j, { children: a && /* @__PURE__ */ h(N, { children: [
30
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ o("tr", { children: e && e.map((t) => /* @__PURE__ */ o("th", { scope: "col", "aria-sort": n === t ? c === r ? "ascending" : "descending" : "none", children: /* @__PURE__ */ h("button", { type: "button", onClick: () => g(t), children: [
31
+ t,
32
+ " ",
33
+ C(t)
34
+ ] }) }, t)) }) }),
35
+ /* @__PURE__ */ o("tbody", { children: p && p.map((t) => /* @__PURE__ */ o("tr", { children: e && e.map((s) => /* @__PURE__ */ o("td", { children: t[s] }, s)) })) })
36
+ ] }) });
37
+ };
38
+ y.displayName = "Widgets.SortableTable";
39
+ export {
40
+ y as default
41
+ };
@@ -0,0 +1 @@
1
+ export { default, default as SortableTable } from './SortableTable';
@@ -0,0 +1,8 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),l=e=>e&&e.__esModule?e:{default:e},d=l(t),o=d.default.table`
2
+ border: 1px solid #000000;
3
+ text-align: center;
4
+ border-spacing: 0px;
5
+ & > th, td, thead, thead > tr > th{
6
+ border: 1px solid #000000;
7
+ }
8
+ `;exports.Table=o;
@@ -0,0 +1 @@
1
+ export declare const Table: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import t from "styled-components";
3
+ const r = t.table`
4
+ border: 1px solid #000000;
5
+ text-align: center;
6
+ border-spacing: 0px;
7
+ & > th, td, thead, thead > tr > th{
8
+ border: 1px solid #000000;
9
+ }
10
+ `;
11
+ export {
12
+ r as Table
13
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),o=require("../utils.cjs"),n=require("./styles.cjs"),p=(e,r)=>typeof e=="string"?e.includes("%")?`${100-parseFloat(e)}%`:r-parseFloat(e):r-e,a=({width:e,height:r,movingSources:i,selectedSource:d,currentIndex:c})=>s.jsxs(s.Fragment,{children:[" ",i&&i.map((t,u)=>{let l=t.sources[c];if(d.includes(t.id))return s.jsx(n.SVG,{preserveAspectRatio:"xMidYMid meet",viewBox:`0 0 ${e} ${r}`,children:s.jsx("g",{role:"list",children:s.jsx(n.Point,{cx:l.x,cy:p(l.y,r),fill:"transparent",stroke:t.color??"#fed828",strokeWidth:3,tabIndex:0,role:"listitem",r:`${o.getRadius(t.type,NaN)*100}%`,id:`${t.id}`},`${t.id}-${u}`)})})})]});a.displayName="Widgets.MovingSourceMap";exports.default=a;
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { MovingSources } from '../../../types/astro';
3
+
4
+ export interface MovingSourceMapProps {
5
+ width: number;
6
+ height: number;
7
+ isPlaying: boolean;
8
+ movingSources: MovingSources[];
9
+ selectedSource: string[];
10
+ currentIndex: number;
11
+ }
12
+ declare const MovingSourceMap: FunctionComponent<MovingSourceMapProps>;
13
+ export default MovingSourceMap;
@@ -0,0 +1,42 @@
1
+ import { jsxs as o, Fragment as p, jsx as s } from "react/jsx-runtime";
2
+ import { getRadius as c } from "../utils.js";
3
+ import { SVG as f, Point as x } from "./styles.js";
4
+ const $ = (e, r) => typeof e == "string" ? e.includes("%") ? `${100 - parseFloat(e)}%` : r - parseFloat(e) : r - e, m = ({
5
+ width: e,
6
+ height: r,
7
+ movingSources: i,
8
+ selectedSource: d,
9
+ currentIndex: n
10
+ }) => /* @__PURE__ */ o(p, { children: [
11
+ " ",
12
+ i && i.map((t, l) => {
13
+ let a = t.sources[n];
14
+ if (d.includes(t.id))
15
+ return /* @__PURE__ */ s(
16
+ f,
17
+ {
18
+ preserveAspectRatio: "xMidYMid meet",
19
+ viewBox: `0 0 ${e} ${r}`,
20
+ children: /* @__PURE__ */ s("g", { role: "list", children: /* @__PURE__ */ s(
21
+ x,
22
+ {
23
+ cx: a.x,
24
+ cy: $(a.y, r),
25
+ fill: "transparent",
26
+ stroke: t.color ?? "#fed828",
27
+ strokeWidth: 3,
28
+ tabIndex: 0,
29
+ role: "listitem",
30
+ r: `${c(t.type, NaN) * 100}%`,
31
+ id: `${t.id}`
32
+ },
33
+ `${t.id}-${l}`
34
+ ) })
35
+ }
36
+ );
37
+ })
38
+ ] });
39
+ m.displayName = "Widgets.MovingSourceMap";
40
+ export {
41
+ m as default
42
+ };
@@ -0,0 +1,14 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),n=t=>t&&t.__esModule?t:{default:t},e=n(o),s=e.default.svg`
2
+ pointer-events: none;
3
+ position: absolute;
4
+ bottom: 0;
5
+ left: 0;
6
+ `,r=e.default.circle`
7
+ cursor: pointer;
8
+ transition: transform ease var(--DURATION, 0.2s);
9
+ transform-origin: center;
10
+
11
+ &:focus {
12
+ outline: none;
13
+ }
14
+ `;exports.Point=r;exports.SVG=s;
@@ -0,0 +1,2 @@
1
+ export declare const SVG: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').SVGProps<SVGSVGElement>, never>> & string;
2
+ export declare const Point: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').SVGProps<SVGCircleElement>, never>> & string;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import o from "styled-components";
3
+ const n = o.svg`
4
+ pointer-events: none;
5
+ position: absolute;
6
+ bottom: 0;
7
+ left: 0;
8
+ `, e = o.circle`
9
+ cursor: pointer;
10
+ transition: transform ease var(--DURATION, 0.2s);
11
+ transform-origin: center;
12
+
13
+ &:focus {
14
+ outline: none;
15
+ }
16
+ `;
17
+ export {
18
+ e as Point,
19
+ n as SVG
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),u=require("react"),G=require("react-i18next"),J=require("../../layout/AspectRatio/index.cjs"),K=require("../../atomic/Loader/index.cjs"),Q=require("@rubin-epo/epo-react-lib/IconComposer"),U=require("./MovingSourceMap/index.cjs"),k=require("./utils.cjs"),Z=require("./styles.cjs"),O=require("../../hooks/useInterval.cjs"),ee=require("./Message/Message.cjs"),te=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),se=e=>e&&e.__esModule?e:{default:e},ne=se(Q),oe=(e,n)=>{var l;const t={day:0,hour:0},s=e[n];if(!s)return t;const c=(s==null?void 0:s.date)-((l=e[0])==null?void 0:l.date);return c?{day:Math.round(c)||0,hour:Math.round(24/c%24)||0}:t},re=(e,n,t)=>Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)<=Math.pow(t,2),ce=(e,n,t)=>t?e[n]?[e[n].image]:[]:e.map(({image:s})=>s),j=({width:e=600,height:n=600,selectedSource:t=[],alerts:s=[],activeAlertIndex:c=0,alertChangeCallback:l,selectionCallback:p,blinkConfig:_,isDisplayOnly:d=!1,isLoading:P,className:w,movingSources:i=[]})=>{const[f,q]=u.useState(0),[B,F]=u.useState(!0),[b,L]=u.useState(!0),[R,y]=u.useState(),[T,m]=u.useState(!1),{t:I}=G.useTranslation(),S=!B&&!P,V=(r,g,h)=>{if(i)for(let a of i){const x=a.sources[f];if(re(r,{x:k.toDecimalPercent(x.x)*g,y:k.toDecimalPercent(x.y)*h},k.getRadius(a.type,a.radius)*g))return a.id}},v=()=>{y(I("source_selector.messages.failure")),m(!0)},D=()=>{L(r=>!r)},N=()=>{y(o.jsxs(o.Fragment,{children:[o.jsx(ne.default,{icon:"checkmark"}),I("source_selector.messages.success")]})),m(!0)},W=({clientX:r,clientY:g,target:h})=>{if(!S||d)return;const{tagName:a,clientWidth:x,clientHeight:C}=h;if(a.toLowerCase()!=="img")return;const{left:Y,top:A}=h.getBoundingClientRect(),M=V({x:r-Y,y:C-g+A},x,C);if(M){if(t.includes(M))return;p&&p(t.concat(M)),N()}else v()},$=()=>{m(!1)},{day:z,hour:E}=oe(s,c),H=ce(s,c,d),X=()=>{b&&(f>i[0].sources.length-2?q(0):q(r=>r+1))};return O.default(X,500),o.jsxs(J.default,{ratio:1,className:w,children:[!d&&o.jsx(ee.default,{onMessageChangeCallback:$,isVisible:T,children:R}),i&&o.jsx(Z.BackgroundBlinker,{images:H,activeIndex:f,blinkCallback:l,loadedCallback:()=>F(!1),onClickCallback:W,extraControls:s.length>0&&!d&&o.jsx(te.default,{day:z,hour:E}),interval:400,pauseCallback:D,..._,children:o.jsx(U.default,{width:e,height:n,isPlaying:b,currentIndex:f,movingSources:i,selectedSource:t})}),!S&&o.jsx(K.default,{})]})};j.displayName="Widgets.MovingSourceSelector";exports.default=j;
@@ -0,0 +1,24 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { Alert, MovingSources } from '../../types/astro';
3
+
4
+ interface BlinkConfig {
5
+ autoplay?: boolean;
6
+ loop?: boolean;
7
+ duration?: number;
8
+ }
9
+ interface SourceSelectorProps {
10
+ width?: number;
11
+ height?: number;
12
+ alerts: Alert[];
13
+ selectedSource?: string[];
14
+ activeAlertIndex?: number;
15
+ alertChangeCallback?: (index: number) => void;
16
+ selectionCallback?: (data: string[]) => void;
17
+ blinkConfig?: BlinkConfig;
18
+ isDisplayOnly?: boolean;
19
+ isLoading?: boolean;
20
+ className?: string;
21
+ movingSources: MovingSources[];
22
+ }
23
+ declare const MovingSourceSelector: FunctionComponent<SourceSelectorProps>;
24
+ export default MovingSourceSelector;