@rubin-epo/epo-widget-lib 0.2.1 → 0.4.1
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/README.MD +21 -15
- package/dist/CameraFilter.cjs +1 -0
- package/dist/CameraFilter.d.ts +3 -0
- package/dist/CameraFilter.js +99 -0
- package/dist/ColorTool.cjs +1 -0
- package/dist/ColorTool.d.ts +3 -0
- package/dist/ColorTool.js +116 -0
- package/dist/FilterTool.cjs +1 -0
- package/dist/FilterTool.d.ts +3 -0
- package/dist/FilterTool.js +253 -0
- package/dist/SourceSelector.cjs +1 -0
- package/dist/SourceSelector.d.ts +3 -0
- package/dist/SourceSelector.js +97 -0
- package/dist/atomic/Blinker/Blinker.cjs +1 -0
- package/dist/atomic/Blinker/Blinker.d.ts +2 -2
- package/dist/atomic/Blinker/Blinker.js +68 -0
- package/dist/atomic/Blinker/Controls/Controls.cjs +1 -0
- package/dist/atomic/Blinker/Controls/Controls.js +58 -0
- package/dist/atomic/Blinker/Controls/styles.cjs +13 -0
- package/dist/atomic/Blinker/Controls/styles.d.ts +2 -1
- package/dist/atomic/Blinker/Controls/styles.js +17 -0
- package/dist/atomic/Blinker/Image/Image.cjs +1 -0
- package/dist/atomic/Blinker/Image/Image.d.ts +2 -2
- package/dist/atomic/Blinker/Image/Image.js +23 -0
- package/dist/atomic/Blinker/Image/styles.cjs +22 -0
- package/dist/atomic/Blinker/Image/styles.d.ts +4 -3
- package/dist/atomic/Blinker/Image/styles.js +26 -0
- package/dist/atomic/Blinker/Images/Images.cjs +1 -0
- package/dist/atomic/Blinker/Images/Images.js +37 -0
- package/dist/atomic/Blinker/Images/styles.cjs +15 -0
- package/dist/atomic/Blinker/Images/styles.d.ts +5 -4
- package/dist/atomic/Blinker/Images/styles.js +20 -0
- package/dist/atomic/Blinker/_mocks/index.d.ts +2 -0
- package/dist/atomic/Blinker/styles.cjs +26 -0
- package/dist/atomic/Blinker/styles.d.ts +7 -9
- package/dist/atomic/Blinker/styles.js +34 -0
- package/dist/atomic/ElapsedTime/ElapsedTime.cjs +1 -0
- package/dist/atomic/ElapsedTime/ElapsedTime.js +34 -0
- package/dist/atomic/ElapsedTime/styles.cjs +40 -0
- package/dist/atomic/ElapsedTime/styles.d.ts +7 -6
- package/dist/atomic/ElapsedTime/styles.js +49 -0
- package/dist/atomic/PlaybackControl/PlaybackControl.cjs +1 -0
- package/dist/atomic/PlaybackControl/PlaybackControl.d.ts +1 -1
- package/dist/atomic/PlaybackControl/PlaybackControl.js +17 -0
- package/dist/atomic/PlaybackControl/styles.cjs +39 -0
- package/dist/atomic/PlaybackControl/styles.d.ts +3 -2
- package/dist/atomic/PlaybackControl/styles.js +44 -0
- package/dist/hooks/useInterval.cjs +1 -0
- package/dist/hooks/useInterval.js +18 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/lib/utils.js +18 -0
- package/dist/lib/utils.test.d.ts +1 -0
- package/dist/localeStrings/en/epo-widget-lib.json +77 -0
- package/dist/localeStrings/es/epo-widget-lib.json +33 -0
- package/dist/styles/svg.cjs +8 -0
- package/dist/styles/svg.d.ts +2 -1
- package/dist/styles/svg.js +12 -0
- package/dist/widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.cjs +1 -0
- package/dist/widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.js +61 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/ColorLabels/ColorLabels.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/ColorLabels/ColorLabels.js +95 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js +98 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumLabels/SpectrumLabels.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumLabels/SpectrumLabels.js +58 -0
- package/dist/widgets/CameraFilter/data.cjs +1 -0
- package/dist/widgets/CameraFilter/data.js +85 -0
- package/dist/widgets/CameraFilter/styles.cjs +64 -0
- package/dist/widgets/CameraFilter/styles.d.ts +19 -18
- package/dist/widgets/CameraFilter/styles.js +82 -0
- package/dist/widgets/ColorTool/ColorTool.d.ts +1 -2
- package/dist/widgets/ColorTool/FilterControls/FilterControls.cjs +1 -0
- package/dist/widgets/ColorTool/FilterControls/FilterControls.d.ts +1 -1
- package/dist/widgets/ColorTool/FilterControls/FilterControls.js +63 -0
- package/dist/widgets/ColorTool/FilterImage/FilterImage.cjs +1 -0
- package/dist/widgets/ColorTool/FilterImage/FilterImage.js +41 -0
- package/dist/widgets/ColorTool/ImageComposite/ImageComposite.cjs +1 -0
- package/dist/widgets/ColorTool/ImageComposite/ImageComposite.js +33 -0
- package/dist/widgets/ColorTool/styles.cjs +129 -0
- package/dist/widgets/ColorTool/styles.d.ts +21 -21
- package/dist/widgets/ColorTool/styles.js +149 -0
- package/dist/widgets/ColorTool/utilities.cjs +1 -0
- package/dist/widgets/ColorTool/utilities.js +38 -0
- package/dist/widgets/FilterTool/FilterTool.d.ts +3 -1
- package/dist/widgets/FilterTool/styles.cjs +36 -0
- package/dist/widgets/FilterTool/styles.d.ts +10 -15
- package/dist/widgets/FilterTool/styles.js +49 -0
- package/dist/widgets/SourceSelector/Message/Message.cjs +1 -0
- package/dist/widgets/SourceSelector/Message/Message.js +21 -0
- package/dist/widgets/SourceSelector/Message/styles.cjs +23 -0
- package/dist/widgets/SourceSelector/Message/styles.d.ts +5 -0
- package/dist/widgets/SourceSelector/Message/styles.js +28 -0
- package/dist/widgets/SourceSelector/Point/Point.cjs +1 -0
- package/dist/widgets/SourceSelector/Point/Point.js +45 -0
- package/dist/widgets/SourceSelector/Point/styles.cjs +11 -0
- package/dist/widgets/SourceSelector/Point/styles.d.ts +4 -3
- package/dist/widgets/SourceSelector/Point/styles.js +15 -0
- package/dist/widgets/SourceSelector/Points/Points.cjs +1 -0
- package/dist/widgets/SourceSelector/Points/Points.js +35 -0
- package/dist/widgets/SourceSelector/SourceSelector.d.ts +2 -2
- package/dist/widgets/SourceSelector/mocks/index.d.ts +7 -0
- package/dist/widgets/SourceSelector/styles.cjs +20 -0
- package/dist/widgets/SourceSelector/styles.d.ts +9 -7
- package/dist/widgets/SourceSelector/styles.js +30 -0
- package/dist/widgets/SourceSelector/utilities.cjs +1 -0
- package/dist/widgets/SourceSelector/utilities.js +7 -0
- package/dist/widgets/SourceSelector/utilities.test.d.ts +1 -0
- package/package.json +12 -11
- package/dist/assets/locales/index.d.ts +0 -115
- package/dist/epo-widget-lib.es.js +0 -3427
- package/dist/epo-widget-lib.umd.js +0 -459
- package/dist/index.d.ts +0 -6
- package/dist/types/astro.d.ts +0 -35
- package/dist/vite-env.d.ts +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const WidgetContainer: import("styled-components").
|
|
3
|
-
isCondensed: boolean;
|
|
4
|
-
hideControls: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare const Title: import("styled-components").
|
|
7
|
-
export declare const Subtitle: import("styled-components").
|
|
8
|
-
export declare const ControlsContainer: import("styled-components").
|
|
9
|
-
export declare const Slider: import("styled-components").
|
|
10
|
-
export declare const ImageContainer: import("styled-components").
|
|
11
|
-
export declare const BackgroundImage: import("styled-components").
|
|
12
|
-
filtersActive: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const FilteredImage: import("styled-components").
|
|
2
|
+
export declare const WidgetContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
|
|
3
|
+
$isCondensed: boolean;
|
|
4
|
+
$hideControls: boolean;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const Title: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>>;
|
|
7
|
+
export declare const Subtitle: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDListElement>, HTMLDListElement>, never>>;
|
|
8
|
+
export declare const ControlsContainer: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
9
|
+
export declare const Slider: import("styled-components").IStyledComponent<"web", Omit<import("@rubin-epo/epo-react-lib/HorizontalSlider").HorizontalSliderProps, never>>;
|
|
10
|
+
export declare const ImageContainer: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
11
|
+
export declare const BackgroundImage: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {
|
|
12
|
+
$filtersActive: boolean;
|
|
13
|
+
}>>;
|
|
14
|
+
export declare const FilteredImage: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("./FilterImage/FilterImage").FilterImageProps, {
|
|
15
15
|
active: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare const SelectionContainer: import("styled-components").
|
|
18
|
-
export declare const ToolsHeader: import("styled-components").
|
|
19
|
-
export declare const Caption: import("styled-components").
|
|
20
|
-
export declare const ResetButton: import("styled-components").
|
|
21
|
-
export declare const FilterToggleButton: import("styled-components").
|
|
22
|
-
active: boolean;
|
|
23
|
-
}
|
|
16
|
+
}>>;
|
|
17
|
+
export declare const SelectionContainer: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
18
|
+
export declare const ToolsHeader: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
19
|
+
export declare const Caption: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>;
|
|
20
|
+
export declare const ResetButton: import("styled-components").IStyledComponent<"web", Omit<Omit<import("react").PropsWithChildren<import("@rubin-epo/epo-react-lib/Button").ButtonProps>, "ref"> & import("react").RefAttributes<HTMLButtonElement>, never>>;
|
|
21
|
+
export declare const FilterToggleButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<Omit<import("react").PropsWithChildren<import("@rubin-epo/epo-react-lib/Button").ButtonProps>, "ref"> & import("react").RefAttributes<HTMLButtonElement>, {
|
|
22
|
+
$active: boolean;
|
|
23
|
+
}>>;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import t, { css as i } from "styled-components";
|
|
2
|
+
import o from "@rubin-epo/epo-react-lib/Button";
|
|
3
|
+
import a from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
4
|
+
import n from "./FilterImage/FilterImage.js";
|
|
5
|
+
const g = t.section`
|
|
6
|
+
display: grid;
|
|
7
|
+
gap: var(--PADDING_SMALL, 20px);
|
|
8
|
+
|
|
9
|
+
${({ $isCondensed: e, $hideControls: r }) => e ? i`
|
|
10
|
+
grid-template-areas:
|
|
11
|
+
"title"
|
|
12
|
+
"subtitle"
|
|
13
|
+
"image"
|
|
14
|
+
"caption"
|
|
15
|
+
"controls"
|
|
16
|
+
"reset";
|
|
17
|
+
` : i`
|
|
18
|
+
grid-template-areas:
|
|
19
|
+
"title title"
|
|
20
|
+
"subtitle subtitle"
|
|
21
|
+
${r ? "'image image'" : "'controls image'"}
|
|
22
|
+
"reset reset"
|
|
23
|
+
"caption caption";
|
|
24
|
+
`}
|
|
25
|
+
`;
|
|
26
|
+
t.h2`
|
|
27
|
+
grid-area: title;
|
|
28
|
+
margin: 0;
|
|
29
|
+
`;
|
|
30
|
+
const p = t.dl`
|
|
31
|
+
grid-area: subtitle;
|
|
32
|
+
margin: 0;
|
|
33
|
+
font-size: 18px;
|
|
34
|
+
font-weight: var(--FONT_WEIGHT_NORMAL, 400);
|
|
35
|
+
|
|
36
|
+
> dt,
|
|
37
|
+
dd {
|
|
38
|
+
margin: 0;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
> dt {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
> dd {
|
|
47
|
+
display: inline;
|
|
48
|
+
margin-left: 1ch;
|
|
49
|
+
|
|
50
|
+
&::after {
|
|
51
|
+
content: "\\A";
|
|
52
|
+
white-space: pre;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`, m = t.div`
|
|
56
|
+
display: grid;
|
|
57
|
+
grid-template-columns: max-content minmax(100px, 1fr) minmax(100px, 2fr);
|
|
58
|
+
grid-auto-rows: max-content;
|
|
59
|
+
grid-area: controls;
|
|
60
|
+
gap: 10px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
`, f = t(a)`
|
|
63
|
+
padding: 0;
|
|
64
|
+
width: 100%;
|
|
65
|
+
`, u = t.div`
|
|
66
|
+
position: relative;
|
|
67
|
+
aspect-ratio: 1 / 1;
|
|
68
|
+
grid-area: image;
|
|
69
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
70
|
+
`, b = t.img`
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 0;
|
|
73
|
+
right: 0;
|
|
74
|
+
bottom: 0;
|
|
75
|
+
left: 0;
|
|
76
|
+
display: ${({ $filtersActive: e }) => e ? "block" : "none"};
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
`, h = t(n)`
|
|
80
|
+
user-select: none;
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: 0;
|
|
83
|
+
right: 0;
|
|
84
|
+
bottom: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
mix-blend-mode: screen;
|
|
89
|
+
|
|
90
|
+
${({ active: e }) => e ? i`
|
|
91
|
+
visibility: visible;
|
|
92
|
+
opacity: 1;
|
|
93
|
+
` : i`
|
|
94
|
+
visibility: hidden;
|
|
95
|
+
opacity: 0;
|
|
96
|
+
`}
|
|
97
|
+
`, x = t.div`
|
|
98
|
+
grid-column: span 3;
|
|
99
|
+
`, v = t.div`
|
|
100
|
+
font-weight: var(--FONT_WEIGHT_BOLD, 600);
|
|
101
|
+
`, w = t.footer`
|
|
102
|
+
grid-area: caption;
|
|
103
|
+
`, y = t(o)`
|
|
104
|
+
grid-area: reset;
|
|
105
|
+
text-align: left;
|
|
106
|
+
|
|
107
|
+
span {
|
|
108
|
+
text-align: left;
|
|
109
|
+
}
|
|
110
|
+
`, I = t(o)`
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
font-weight: var(--FONT_WEIGHT_MEDIUM, 500);
|
|
113
|
+
font-size: 22px;
|
|
114
|
+
text-transform: lowercase;
|
|
115
|
+
display: flex;
|
|
116
|
+
width: 38px;
|
|
117
|
+
height: 38px;
|
|
118
|
+
padding: 0;
|
|
119
|
+
|
|
120
|
+
${({ $active: e }) => e ? i`
|
|
121
|
+
background-color: var(--turquoise85, #12726c);
|
|
122
|
+
&:not(:disabled):not([aria-disabled="true"]):hover {
|
|
123
|
+
outline: 1px solid var(--white, #fff);
|
|
124
|
+
outline-offset: -3px;
|
|
125
|
+
}
|
|
126
|
+
` : i`
|
|
127
|
+
background-color: #f7f7f7;
|
|
128
|
+
border-color: #6c6e6e;
|
|
129
|
+
color: #6c6e6e !important;
|
|
130
|
+
&:not(:disabled):not([aria-disabled="true"]):hover {
|
|
131
|
+
outline: 2px solid #6c6e6e;
|
|
132
|
+
outline-offset: -2px;
|
|
133
|
+
}
|
|
134
|
+
`}
|
|
135
|
+
`;
|
|
136
|
+
export {
|
|
137
|
+
b as BackgroundImage,
|
|
138
|
+
w as Caption,
|
|
139
|
+
m as ControlsContainer,
|
|
140
|
+
I as FilterToggleButton,
|
|
141
|
+
h as FilteredImage,
|
|
142
|
+
u as ImageContainer,
|
|
143
|
+
y as ResetButton,
|
|
144
|
+
x as SelectionContainer,
|
|
145
|
+
f as Slider,
|
|
146
|
+
p as Subtitle,
|
|
147
|
+
v as ToolsHeader,
|
|
148
|
+
g as WidgetContainer
|
|
149
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("lodash/flattenDeep"),D=require("lodash/find"),v=require("lodash/isEmpty"),o=e=>e&&e.__esModule?e:{default:e},y=o(g),_=o(D),c=o(v),l=(e,t,r)=>(t-e)*(r/100)+e,i=e=>e.some(t=>t.active),F=e=>c.default(e)?!1:i(e.filters),u=e=>e.filters.map(t=>{const{value:r,defaultValue:s,defaultColor:a,min:n,max:p,color:f}=t,d=r||s||1,m=a||f;return{...t,brightness:l(n,p,d),color:m}}),b=e=>c.default(e)?e:{...e,filters:u(e)},B=(e,t)=>y.default(e.map(s=>s.objects.filter(a=>a.name===t).map(u))),V=(e,t)=>{const r=_.default(e,{objects:[{name:t}]}),{type:s=null}=r||{};return s},h=e=>e.map(t=>{const{defaultValue:r,min:s,max:a}=t,n=r||1;return{...t,active:!1,color:"",brightness:l(n,s,a),value:n}});exports.getBrightnessValue=l;exports.getCategoryName=V;exports.getDataFiltersByName=B;exports.isFilterActive=i;exports.isResetButtonActive=F;exports.prepareData=b;exports.resetFilters=h;exports.updateFilters=u;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import f from "lodash/flattenDeep";
|
|
2
|
+
import d from "lodash/find";
|
|
3
|
+
import a from "lodash/isEmpty";
|
|
4
|
+
const c = (e, t, r) => (t - e) * (r / 100) + e, g = (e) => e.some((t) => t.active), y = (e) => a(e) ? !1 : g(e.filters), l = (e) => e.filters.map((t) => {
|
|
5
|
+
const { value: r, defaultValue: s, defaultColor: o, min: n, max: i, color: p } = t, u = r || s || 1, m = o || p;
|
|
6
|
+
return {
|
|
7
|
+
...t,
|
|
8
|
+
brightness: c(n, i, u),
|
|
9
|
+
color: m
|
|
10
|
+
};
|
|
11
|
+
}), F = (e) => a(e) ? e : {
|
|
12
|
+
...e,
|
|
13
|
+
filters: l(e)
|
|
14
|
+
}, V = (e, t) => f(
|
|
15
|
+
e.map((s) => s.objects.filter((o) => o.name === t).map(l))
|
|
16
|
+
), h = (e, t) => {
|
|
17
|
+
const r = d(e, { objects: [{ name: t }] }), { type: s = null } = r || {};
|
|
18
|
+
return s;
|
|
19
|
+
}, j = (e) => e.map((t) => {
|
|
20
|
+
const { defaultValue: r, min: s, max: o } = t, n = r || 1;
|
|
21
|
+
return {
|
|
22
|
+
...t,
|
|
23
|
+
active: !1,
|
|
24
|
+
color: "",
|
|
25
|
+
brightness: c(n, s, o),
|
|
26
|
+
value: n
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
c as getBrightnessValue,
|
|
31
|
+
h as getCategoryName,
|
|
32
|
+
V as getDataFiltersByName,
|
|
33
|
+
g as isFilterActive,
|
|
34
|
+
y as isResetButtonActive,
|
|
35
|
+
F as prepareData,
|
|
36
|
+
j as resetFilters,
|
|
37
|
+
l as updateFilters
|
|
38
|
+
};
|
|
@@ -2,7 +2,9 @@ import { FunctionComponent } from "react";
|
|
|
2
2
|
interface FilterToolProps {
|
|
3
3
|
selectionCallback?: (color: FilterColor) => void;
|
|
4
4
|
selectedColor?: FilterColor;
|
|
5
|
-
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
id?: string;
|
|
7
|
+
labelledById?: string;
|
|
6
8
|
}
|
|
7
9
|
type FilterColor = "violet" | "blue" | "green" | "yellow" | "orange" | "red" | "none";
|
|
8
10
|
declare const FilterTool: FunctionComponent<FilterToolProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),i=e=>e&&e.__esModule?e:{default:e},t=i(r),l=t.default.div`
|
|
2
|
+
background-color: var(--black, #000);
|
|
3
|
+
`,o=t.default.div`
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0 var(--PADDING_SMALL, 20px) var(--PADDING_SMALL, 20px);
|
|
10
|
+
background-color: var(--black, #000);
|
|
11
|
+
width: 100%;
|
|
12
|
+
`;t.default.label`
|
|
13
|
+
color: var(--white, #fff);
|
|
14
|
+
`;const n=t.default.svg`
|
|
15
|
+
font-size: 42px;
|
|
16
|
+
`,a=t.default.line`
|
|
17
|
+
fill: none;
|
|
18
|
+
stroke: #ffffff;
|
|
19
|
+
stroke-miterlimit: 10;
|
|
20
|
+
stroke-width: 7;
|
|
21
|
+
`,f=t.default.path`
|
|
22
|
+
fill: var(--ray-fill);
|
|
23
|
+
`,s=t.default.polygon`
|
|
24
|
+
opacity: var(--arrow-opacity, 1);
|
|
25
|
+
fill: var(--arrow-fill);
|
|
26
|
+
`,d=t.default.polygon`
|
|
27
|
+
fill: none;
|
|
28
|
+
stroke: #ffffff;
|
|
29
|
+
stroke-miterlimit: 10;
|
|
30
|
+
stroke-width: 12;
|
|
31
|
+
`,c=t.default.line`
|
|
32
|
+
fill: none;
|
|
33
|
+
stroke-linecap: round;
|
|
34
|
+
stroke-miterlimit: 10;
|
|
35
|
+
stroke-width: 27.27;
|
|
36
|
+
`;exports.Arrow=s;exports.Filter=c;exports.PrismOutline=d;exports.PrismSVG=n;exports.Ray=f;exports.SelectContainer=o;exports.WhiteLine=a;exports.Wrapper=l;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
arrowColor: string;
|
|
12
|
-
isHidden: boolean;
|
|
13
|
-
}, never>;
|
|
14
|
-
export declare const PrismOutline: import("styled-components").StyledComponent<"polygon", any, {}, never>;
|
|
15
|
-
export declare const Filter: import("styled-components").StyledComponent<"line", any, {}, never>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
3
|
+
export declare const SelectContainer: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
4
|
+
export declare const SelectLabel: import("styled-components").IStyledComponent<"web", Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>>;
|
|
5
|
+
export declare const PrismSVG: import("styled-components").IStyledComponent<"web", Omit<import("react").SVGProps<SVGSVGElement>, never>>;
|
|
6
|
+
export declare const WhiteLine: import("styled-components").IStyledComponent<"web", Omit<import("react").SVGLineElementAttributes<SVGLineElement>, never>>;
|
|
7
|
+
export declare const Ray: import("styled-components").IStyledComponent<"web", Omit<import("react").SVGProps<SVGPathElement>, never>>;
|
|
8
|
+
export declare const Arrow: import("styled-components").IStyledComponent<"web", Omit<import("react").SVGProps<SVGPolygonElement>, never>>;
|
|
9
|
+
export declare const PrismOutline: import("styled-components").IStyledComponent<"web", Omit<import("react").SVGProps<SVGPolygonElement>, never>>;
|
|
10
|
+
export declare const Filter: import("styled-components").IStyledComponent<"web", Omit<import("react").SVGLineElementAttributes<SVGLineElement>, never>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
const t = o.div`
|
|
3
|
+
background-color: var(--black, #000);
|
|
4
|
+
`, i = o.div`
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0 var(--PADDING_SMALL, 20px) var(--PADDING_SMALL, 20px);
|
|
11
|
+
background-color: var(--black, #000);
|
|
12
|
+
width: 100%;
|
|
13
|
+
`;
|
|
14
|
+
o.label`
|
|
15
|
+
color: var(--white, #fff);
|
|
16
|
+
`;
|
|
17
|
+
const e = o.svg`
|
|
18
|
+
font-size: 42px;
|
|
19
|
+
`, l = o.line`
|
|
20
|
+
fill: none;
|
|
21
|
+
stroke: #ffffff;
|
|
22
|
+
stroke-miterlimit: 10;
|
|
23
|
+
stroke-width: 7;
|
|
24
|
+
`, n = o.path`
|
|
25
|
+
fill: var(--ray-fill);
|
|
26
|
+
`, a = o.polygon`
|
|
27
|
+
opacity: var(--arrow-opacity, 1);
|
|
28
|
+
fill: var(--arrow-fill);
|
|
29
|
+
`, f = o.polygon`
|
|
30
|
+
fill: none;
|
|
31
|
+
stroke: #ffffff;
|
|
32
|
+
stroke-miterlimit: 10;
|
|
33
|
+
stroke-width: 12;
|
|
34
|
+
`, s = o.line`
|
|
35
|
+
fill: none;
|
|
36
|
+
stroke-linecap: round;
|
|
37
|
+
stroke-miterlimit: 10;
|
|
38
|
+
stroke-width: 27.27;
|
|
39
|
+
`;
|
|
40
|
+
export {
|
|
41
|
+
a as Arrow,
|
|
42
|
+
s as Filter,
|
|
43
|
+
f as PrismOutline,
|
|
44
|
+
e as PrismSVG,
|
|
45
|
+
n as Ray,
|
|
46
|
+
i as SelectContainer,
|
|
47
|
+
l as WhiteLine,
|
|
48
|
+
t as Wrapper
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),a=require("react"),n=require("./styles.cjs"),r=({children:t,isVisible:e=!1,onMessageChangeCallback:s,forIds:u})=>(a.useEffect(()=>{if(e){const o=setTimeout(()=>{s&&s()},1800);return()=>clearTimeout(o)}},[t,e]),c.jsx(n.Message,{forIds:u,$isOpen:e,children:t}));r.displayName="Widgets.SourceSelector.Message";const i=r;exports.default=i;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as f } from "react";
|
|
3
|
+
import { Message as u } from "./styles.js";
|
|
4
|
+
const r = ({
|
|
5
|
+
children: t,
|
|
6
|
+
isVisible: e = !1,
|
|
7
|
+
onMessageChangeCallback: s,
|
|
8
|
+
forIds: o
|
|
9
|
+
}) => (f(() => {
|
|
10
|
+
if (e) {
|
|
11
|
+
const m = setTimeout(() => {
|
|
12
|
+
s && s();
|
|
13
|
+
}, 1800);
|
|
14
|
+
return () => clearTimeout(m);
|
|
15
|
+
}
|
|
16
|
+
}, [t, e]), /* @__PURE__ */ a(u, { forIds: o, $isOpen: e, children: t }));
|
|
17
|
+
r.displayName = "Widgets.SourceSelector.Message";
|
|
18
|
+
const M = r;
|
|
19
|
+
export {
|
|
20
|
+
M as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),s=require("@rubin-epo/epo-react-lib/Toast"),t=e=>e&&e.__esModule?e:{default:e},n=t(o),a=t(s),i=n.default(a.default)`
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
z-index: 1;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
gap: 1ch;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: ${({$isOpen:e})=>e?24:0}px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
background-color: var(--black, #000);
|
|
14
|
+
color: #30e0e3;
|
|
15
|
+
font-size: 1rem;
|
|
16
|
+
font-weight: var(--FONT_WEIGHT_BOLD, 600);
|
|
17
|
+
text-align: center;
|
|
18
|
+
transition: height ease var(--DURATION_SLOW, 0.4s);
|
|
19
|
+
|
|
20
|
+
@media (prefers-reduced-motion) {
|
|
21
|
+
transition: unset;
|
|
22
|
+
}
|
|
23
|
+
`;exports.Message=i;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import o from "@rubin-epo/epo-react-lib/Toast";
|
|
3
|
+
const n = t(o)`
|
|
4
|
+
position: absolute;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
z-index: 1;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
gap: 1ch;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: ${({ $isOpen: e }) => e ? 24 : 0}px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
background-color: var(--black, #000);
|
|
16
|
+
color: #30e0e3;
|
|
17
|
+
font-size: 1rem;
|
|
18
|
+
font-weight: var(--FONT_WEIGHT_BOLD, 600);
|
|
19
|
+
text-align: center;
|
|
20
|
+
transition: height ease var(--DURATION_SLOW, 0.4s);
|
|
21
|
+
|
|
22
|
+
@media (prefers-reduced-motion) {
|
|
23
|
+
transition: unset;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export {
|
|
27
|
+
n as Message
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react/jsx-runtime"),P=require("./styles.cjs"),i=({type:a,id:u,isActive:n,isSelected:s,x:l,y:c,radius:d,className:f,color:g})=>{const x={supernova:20,galaxy:60,galaxyFilter:25},y=(e,t)=>{if(t)return Math.abs(t);const{[e]:r=8}=x;return r},b=(e,t,r)=>e?"#fed828":t?r:"transparent",o=y(a,d),m=Math.max(10,o*1.2);return p.jsx(P.Point,{"data-id":u,"data-type":a,cx:l,cy:c,r:n?m:o,fill:"transparent",stroke:b(n,s,g),tabIndex:0,role:"listitem",$isSelected:s,className:f})};i.displayName="Widgets.SourceSelector.Point";const R=i;exports.default=R;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { Point as R } from "./styles.js";
|
|
3
|
+
const i = ({
|
|
4
|
+
type: e,
|
|
5
|
+
id: c,
|
|
6
|
+
isActive: n,
|
|
7
|
+
isSelected: o,
|
|
8
|
+
x: d,
|
|
9
|
+
y: u,
|
|
10
|
+
radius: l,
|
|
11
|
+
className: f,
|
|
12
|
+
color: m
|
|
13
|
+
}) => {
|
|
14
|
+
const p = {
|
|
15
|
+
supernova: 20,
|
|
16
|
+
galaxy: 60,
|
|
17
|
+
galaxyFilter: 25
|
|
18
|
+
}, x = (a, t) => {
|
|
19
|
+
if (t)
|
|
20
|
+
return Math.abs(t);
|
|
21
|
+
const { [a]: r = 8 } = p;
|
|
22
|
+
return r;
|
|
23
|
+
}, g = (a, t, r) => a ? "#fed828" : t ? r : "transparent", s = x(e, l), P = Math.max(10, s * 1.2);
|
|
24
|
+
return /* @__PURE__ */ y(
|
|
25
|
+
R,
|
|
26
|
+
{
|
|
27
|
+
"data-id": c,
|
|
28
|
+
"data-type": e,
|
|
29
|
+
cx: d,
|
|
30
|
+
cy: u,
|
|
31
|
+
r: n ? P : s,
|
|
32
|
+
fill: "transparent",
|
|
33
|
+
stroke: g(n, o, m),
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
role: "listitem",
|
|
36
|
+
$isSelected: o,
|
|
37
|
+
className: f
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
i.displayName = "Widgets.SourceSelector.Point";
|
|
42
|
+
const $ = i;
|
|
43
|
+
export {
|
|
44
|
+
$ as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("styled-components"),o=t=>t&&t.__esModule?t:{default:t},s=o(e),n=s.default.circle`
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
transition: fill ease var(--DURATION, 0.2s), r ease-out 400ms;
|
|
4
|
+
${({$isSelected:t})=>t&&e.css`
|
|
5
|
+
stroke-width: 3;
|
|
6
|
+
`}
|
|
7
|
+
|
|
8
|
+
&:focus {
|
|
9
|
+
outline: none;
|
|
10
|
+
}
|
|
11
|
+
`;exports.Point=n;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Point: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGCircleElement>, {
|
|
3
|
+
$isSelected: boolean;
|
|
4
|
+
}>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import s, { css as t } from "styled-components";
|
|
2
|
+
const r = s.circle`
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
transition: fill ease var(--DURATION, 0.2s), r ease-out 400ms;
|
|
5
|
+
${({ $isSelected: o }) => o && t`
|
|
6
|
+
stroke-width: 3;
|
|
7
|
+
`}
|
|
8
|
+
|
|
9
|
+
&:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
export {
|
|
14
|
+
r as Point
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),S=require("../Point/Point.cjs"),d=({sources:l=[],selectedSource:a=[],activeType:i,className:r,xScale:t,yScale:m,color:p})=>c.jsx("g",{className:r,role:"list",children:l.map(y=>{const{type:e,id:o,color:P,radius:f=NaN,x:s,y:g}=y,n=.6*f,j=a.some(u=>u.id===o&&u.type===e),x=i?i===e:!1;return c.jsx(S.default,{id:o,type:e,isActive:x,isSelected:j,className:r,radius:t(s-n)-t(s+n),x:t(s),y:m(g),color:p||P},`point-${e}-${o}`)})});d.displayName="Widgets.SourceSelector.Points";const $=d;exports.default=$;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import x from "../Point/Point.js";
|
|
3
|
+
const l = ({
|
|
4
|
+
sources: m = [],
|
|
5
|
+
selectedSource: p = [],
|
|
6
|
+
activeType: s,
|
|
7
|
+
className: e,
|
|
8
|
+
xScale: t,
|
|
9
|
+
yScale: u,
|
|
10
|
+
color: a
|
|
11
|
+
}) => /* @__PURE__ */ d("g", { className: e, role: "list", children: m.map((f) => {
|
|
12
|
+
const { type: o, id: i, color: y, radius: P = NaN, x: r, y: $ } = f, n = 0.6 * P, g = p.some(
|
|
13
|
+
(c) => c.id === i && c.type === o
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ d(
|
|
16
|
+
x,
|
|
17
|
+
{
|
|
18
|
+
id: i,
|
|
19
|
+
type: o,
|
|
20
|
+
isActive: s ? s === o : !1,
|
|
21
|
+
isSelected: g,
|
|
22
|
+
className: e,
|
|
23
|
+
radius: t(r - n) - t(r + n),
|
|
24
|
+
x: t(r),
|
|
25
|
+
y: u($),
|
|
26
|
+
color: a || y
|
|
27
|
+
},
|
|
28
|
+
`point-${o}-${i}`
|
|
29
|
+
);
|
|
30
|
+
}) });
|
|
31
|
+
l.displayName = "Widgets.SourceSelector.Points";
|
|
32
|
+
const j = l;
|
|
33
|
+
export {
|
|
34
|
+
j as default
|
|
35
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
2
|
import { Alert, Source } from '../../types/astro';
|
|
3
|
-
import {
|
|
3
|
+
import { ImageShape } from "@rubin-epo/epo-react-lib";
|
|
4
4
|
interface BlinkConfig {
|
|
5
5
|
autoplay?: boolean;
|
|
6
6
|
loop?: boolean;
|
|
@@ -12,7 +12,7 @@ interface SourceSelectorProps {
|
|
|
12
12
|
sources: Source[];
|
|
13
13
|
alerts?: Alert[];
|
|
14
14
|
selectedSource?: Source[];
|
|
15
|
-
images:
|
|
15
|
+
images: ImageShape[];
|
|
16
16
|
selectionCallback?: (data: Source[]) => void;
|
|
17
17
|
blinkConfig?: BlinkConfig;
|
|
18
18
|
color?: string;
|