@rubin-epo/epo-widget-lib 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IsochronePlot.js +7 -7
- package/dist/SourceSelector.cjs +1 -1
- package/dist/SourceSelector.js +4 -6
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.d.ts +7 -3
- package/dist/atomic/Blinker/Blinker.js +65 -55
- package/dist/atomic/Blinker/_mocks/index.d.ts +5 -3
- package/dist/atomic/Blinker/styles.cjs +9 -4
- package/dist/atomic/Blinker/styles.d.ts +0 -8
- package/dist/atomic/Blinker/styles.js +11 -8
- package/dist/atomic/ImageStack/index.d.ts +5 -2
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +5 -6
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +50 -49
- package/dist/localeStrings/es/epo-widget-lib.json +82 -0
- package/dist/widgets/SourceSelector/SelectionList/index.cjs +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.d.ts +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.js +27 -21
- package/dist/widgets/SourceSelector/SelectionList/styles.cjs +10 -41
- package/dist/widgets/SourceSelector/SelectionList/styles.d.ts +492 -503
- package/dist/widgets/SourceSelector/SelectionList/styles.js +12 -43
- package/dist/widgets/SourceSelector/SourceMap/index.cjs +1 -0
- package/dist/widgets/SourceSelector/SourceMap/index.d.ts +10 -0
- package/dist/widgets/SourceSelector/SourceMap/index.js +38 -0
- package/dist/widgets/SourceSelector/SourceMap/styles.cjs +14 -0
- package/dist/widgets/SourceSelector/{Point → SourceMap}/styles.d.ts +482 -0
- package/dist/widgets/SourceSelector/{Point → SourceMap}/styles.js +9 -3
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +100 -78
- package/dist/widgets/SourceSelector/index.d.ts +0 -1
- package/dist/widgets/SourceSelector/styles.cjs +2 -6
- package/dist/widgets/SourceSelector/styles.d.ts +6 -484
- package/dist/widgets/SourceSelector/styles.js +3 -8
- package/dist/widgets/SourceSelector/utils.cjs +1 -0
- package/dist/widgets/SourceSelector/utils.d.ts +2 -0
- package/dist/widgets/SourceSelector/utils.js +14 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +2 -3
- package/package.json +1 -1
- package/dist/widgets/SourceSelector/Point/Point.cjs +0 -1
- package/dist/widgets/SourceSelector/Point/Point.d.ts +0 -11
- package/dist/widgets/SourceSelector/Point/Point.js +0 -48
- package/dist/widgets/SourceSelector/Point/index.d.ts +0 -1
- package/dist/widgets/SourceSelector/Point/styles.cjs +0 -9
- package/dist/widgets/SourceSelector/PointSelector/index.cjs +0 -1
- package/dist/widgets/SourceSelector/PointSelector/index.d.ts +0 -13
- package/dist/widgets/SourceSelector/PointSelector/index.js +0 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),h=require("react"),z=require("react-i18next"),E=require("../../layout/AspectRatio/index.cjs"),H=require("../../atomic/Loader/index.cjs"),X=require("@rubin-epo/epo-react-lib/IconComposer"),Y=require("./SourceMap/index.cjs"),m=require("./utils.cjs"),G=require("./styles.cjs"),J=require("./Message/Message.cjs"),K=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),Q=e=>e&&e.__esModule?e:{default:e},U=Q(X),Z=(e,t)=>{var c;const s={day:0,hour:0},n=e[t];if(!n)return s;const o=(n==null?void 0:n.date)-((c=e[0])==null?void 0:c.date);return o?{day:Math.round(o)||0,hour:Math.round(24/o%24)||0}:s},A=(e,t,s)=>Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(s,2),O=(e,t,s,n)=>{var o;return(o=n.find(({x:c,y:u,radius:i,type:l})=>A(e,{x:m.toDecimalPercent(c)*t,y:m.toDecimalPercent(u)*s},m.getRadius(l,i)*t)))==null?void 0:o.id},ee=(e,t,s)=>s?e[t]?[e[t].image]:[]:e.map(({image:n})=>n),q=({width:e=600,height:t=600,selectedSource:s=[],sources:n,alerts:o=[],activeAlertIndex:c=0,alertChangeCallback:u,selectionCallback:i,blinkConfig:l,isDisplayOnly:a=!1,isLoading:b,className:j})=>{const[p,_]=h.useState(!0),[y,x]=h.useState(),[I,d]=h.useState(!1),{t:C}=z.useTranslation(),M=!p&&!b,w=()=>{x(C("source_selector.messages.failure")),d(!0)},L=()=>{x(r.jsxs(r.Fragment,{children:[r.jsx(U.default,{icon:"checkmark"}),C("source_selector.messages.success")]})),d(!0)},P=({clientX:f,clientY:$,target:S})=>{if(!M||a)return;const{tagName:D,clientWidth:N,clientHeight:k}=S;if(D.toLowerCase()!=="img")return;const{left:W,top:v}=S.getBoundingClientRect(),g=O({x:f-W,y:k-$+v},N,k,n);if(g){if(s.includes(g))return;i&&i(s.concat(g)),L()}else w()},T=()=>{d(!1)},{day:B,hour:F}=Z(o,c),R=ee(o,c,a),V=n.filter(({id:f})=>s.includes(f));return r.jsxs(E.default,{ratio:1,className:j,children:[!a&&r.jsx(J.default,{onMessageChangeCallback:T,isVisible:I,children:y}),r.jsx(G.BackgroundBlinker,{images:R,activeIndex:c,blinkCallback:u,loadedCallback:()=>_(!1),onClickCallback:P,extraControls:o.length>0&&!a&&r.jsx(K.default,{day:B,hour:F}),interval:400,...l,children:r.jsx(Y.default,{sources:V,width:e,height:t})}),!M&&r.jsx(H.default,{})]})};q.displayName="Widgets.SourceSelector";const te=q;exports.default=te;
|
|
@@ -1,93 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
2
|
+
import { jsxs as S, jsx as i, Fragment as $ } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g } from "react";
|
|
4
|
+
import { useTranslation as q } from "react-i18next";
|
|
5
|
+
import A from "../../layout/AspectRatio/index.js";
|
|
6
|
+
import D from "../../atomic/Loader/index.js";
|
|
7
|
+
import G from "@rubin-epo/epo-react-lib/IconComposer";
|
|
8
|
+
import J from "./SourceMap/index.js";
|
|
9
|
+
import { getRadius as K, toDecimalPercent as b } from "./utils.js";
|
|
10
|
+
import { BackgroundBlinker as Q } from "./styles.js";
|
|
11
|
+
import U from "./Message/Message.js";
|
|
12
|
+
import Z from "../../atomic/ElapsedTime/ElapsedTime.js";
|
|
13
|
+
const v = (e, o) => {
|
|
14
|
+
var n;
|
|
15
|
+
const t = { day: 0, hour: 0 }, s = e[o];
|
|
16
|
+
if (!s)
|
|
17
|
+
return t;
|
|
18
|
+
const r = (s == null ? void 0 : s.date) - ((n = e[0]) == null ? void 0 : n.date);
|
|
19
|
+
return r ? {
|
|
20
|
+
day: Math.round(r) || 0,
|
|
21
|
+
hour: Math.round(24 / r % 24) || 0
|
|
22
|
+
} : t;
|
|
23
|
+
}, O = (e, o, t) => Math.pow(e.x - o.x, 2) + Math.pow(e.y - o.y, 2) <= Math.pow(t, 2), ee = (e, o, t, s) => {
|
|
24
|
+
var r;
|
|
25
|
+
return (r = s.find(({ x: n, y: l, radius: c, type: d }) => O(
|
|
26
|
+
e,
|
|
27
|
+
{
|
|
28
|
+
x: b(n) * o,
|
|
29
|
+
y: b(l) * t
|
|
30
|
+
},
|
|
31
|
+
K(d, c) * o
|
|
32
|
+
))) == null ? void 0 : r.id;
|
|
33
|
+
}, oe = (e, o, t) => t ? e[o] ? [e[o].image] : [] : e.map(({ image: s }) => s), x = ({
|
|
34
|
+
width: e = 600,
|
|
35
|
+
height: o = 600,
|
|
36
|
+
selectedSource: t = [],
|
|
37
|
+
sources: s,
|
|
38
|
+
alerts: r = [],
|
|
39
|
+
activeAlertIndex: n = 0,
|
|
40
|
+
alertChangeCallback: l,
|
|
41
|
+
selectionCallback: c,
|
|
42
|
+
blinkConfig: d,
|
|
43
|
+
isDisplayOnly: a = !1,
|
|
44
|
+
isLoading: w,
|
|
45
|
+
className: y
|
|
35
46
|
}) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
d(u("source_selector.messages.failure")), m(!0);
|
|
39
|
-
}, P = (r) => {
|
|
40
|
-
if (!(!h || i))
|
|
41
|
-
if (r) {
|
|
42
|
-
const E = !!o.find(({ id: R }) => R === r), N = !s.includes(r);
|
|
43
|
-
E && N ? (l && l(s.concat(r)), d(
|
|
44
|
-
/* @__PURE__ */ C(U, { children: [
|
|
45
|
-
/* @__PURE__ */ a(q, { icon: "checkmark" }),
|
|
46
|
-
u("source_selector.messages.success")
|
|
47
|
-
] })
|
|
48
|
-
), m(!0)) : p();
|
|
49
|
-
} else
|
|
50
|
-
p();
|
|
47
|
+
const [L, I] = g(!0), [B, h] = g(), [F, u] = g(!1), { t: p } = q(), C = !L && !w, R = () => {
|
|
48
|
+
h(p("source_selector.messages.failure")), u(!0);
|
|
51
49
|
}, T = () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
h(
|
|
51
|
+
/* @__PURE__ */ S($, { children: [
|
|
52
|
+
/* @__PURE__ */ i(G, { icon: "checkmark" }),
|
|
53
|
+
p("source_selector.messages.success")
|
|
54
|
+
] })
|
|
55
|
+
), u(!0);
|
|
56
|
+
}, V = ({
|
|
57
|
+
clientX: m,
|
|
58
|
+
clientY: z,
|
|
59
|
+
target: k
|
|
60
|
+
}) => {
|
|
61
|
+
if (!C || a)
|
|
62
|
+
return;
|
|
63
|
+
const {
|
|
64
|
+
tagName: E,
|
|
65
|
+
clientWidth: H,
|
|
66
|
+
clientHeight: M
|
|
67
|
+
} = k;
|
|
68
|
+
if (E.toLowerCase() !== "img")
|
|
69
|
+
return;
|
|
70
|
+
const { left: X, top: Y } = k.getBoundingClientRect(), f = ee(
|
|
71
|
+
{ x: m - X, y: M - z + Y },
|
|
72
|
+
H,
|
|
73
|
+
M,
|
|
74
|
+
s
|
|
75
|
+
);
|
|
76
|
+
if (f) {
|
|
77
|
+
if (t.includes(f))
|
|
78
|
+
return;
|
|
79
|
+
c && c(t.concat(f)), T();
|
|
80
|
+
} else
|
|
81
|
+
R();
|
|
82
|
+
}, j = () => {
|
|
83
|
+
u(!1);
|
|
84
|
+
}, { day: N, hour: P } = v(r, n), W = oe(r, n, a), _ = s.filter(({ id: m }) => t.includes(m));
|
|
85
|
+
return /* @__PURE__ */ S(A, { ratio: 1, className: y, children: [
|
|
86
|
+
!a && /* @__PURE__ */ i(
|
|
87
|
+
U,
|
|
57
88
|
{
|
|
58
|
-
onMessageChangeCallback:
|
|
89
|
+
onMessageChangeCallback: j,
|
|
59
90
|
isVisible: F,
|
|
60
|
-
forIds: [g],
|
|
61
91
|
children: B
|
|
62
92
|
}
|
|
63
93
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
94
|
+
/* @__PURE__ */ i(
|
|
95
|
+
Q,
|
|
66
96
|
{
|
|
67
|
-
images:
|
|
68
|
-
activeIndex:
|
|
69
|
-
blinkCallback:
|
|
70
|
-
loadedCallback: () =>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
id: g,
|
|
77
|
-
onSelectCallback: P,
|
|
78
|
-
width: n,
|
|
79
|
-
height: c,
|
|
80
|
-
sources: o,
|
|
81
|
-
selectedSource: s
|
|
82
|
-
}
|
|
83
|
-
)
|
|
97
|
+
images: W,
|
|
98
|
+
activeIndex: n,
|
|
99
|
+
blinkCallback: l,
|
|
100
|
+
loadedCallback: () => I(!1),
|
|
101
|
+
onClickCallback: V,
|
|
102
|
+
extraControls: r.length > 0 && !a && /* @__PURE__ */ i(Z, { day: N, hour: P }),
|
|
103
|
+
interval: 400,
|
|
104
|
+
...d,
|
|
105
|
+
children: /* @__PURE__ */ i(J, { sources: _, width: e, height: o })
|
|
84
106
|
}
|
|
85
107
|
),
|
|
86
|
-
!
|
|
108
|
+
!C && /* @__PURE__ */ i(D, {})
|
|
87
109
|
] });
|
|
88
110
|
};
|
|
89
|
-
|
|
90
|
-
const
|
|
111
|
+
x.displayName = "Widgets.SourceSelector";
|
|
112
|
+
const ge = x;
|
|
91
113
|
export {
|
|
92
|
-
|
|
114
|
+
ge as default
|
|
93
115
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as SourceSelector } from './SourceSelector';
|
|
2
2
|
|
|
3
|
-
export { default as PointSelector } from './PointSelector';
|
|
4
3
|
export { default as Message } from './Message';
|
|
5
4
|
export { default as SelectionList } from './SelectionList';
|
|
6
5
|
export default SourceSelector;
|
|
@@ -1,10 +1,6 @@
|
|
|
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 t=require("styled-components"),o=require("../../atomic/Blinker/Blinker.cjs"),r=e=>e&&e.__esModule?e:{default:e},l=r(t),n=l.default(o.default)`
|
|
2
2
|
cursor: pointer;
|
|
3
|
-
position: absolute;
|
|
4
|
-
bottom: 0;
|
|
5
|
-
left: 0;
|
|
6
|
-
`,u=e.default(l.default)`
|
|
7
3
|
position: absolute;
|
|
8
4
|
width: 100%;
|
|
9
5
|
height: 100%;
|
|
10
|
-
`;exports.BackgroundBlinker=
|
|
6
|
+
`;exports.BackgroundBlinker=n;
|