@rubin-epo/epo-widget-lib 0.6.4 → 0.6.6
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/ColorTool.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),y=require("react"),W=require("react-i18next"),H=require("./widgets/ColorTool/utilities.cjs"),l=require("./widgets/ColorTool/styles.cjs"),N=require("@rubin-epo/epo-react-lib/SelectListbox"),R=require("./widgets/ColorTool/Actions/index.cjs"),T=require("./widgets/ColorTool/ImageComposite/ImageComposite.cjs"),$=require("./widgets/ColorTool/FilterControls/FilterControls.cjs"),v=o=>o&&o.__esModule?o:{default:o},E=v(N),p=({data:o,objectOptions:L=[],selectedData:d,colorOptions:C=[],selectionCallback:i,isDisabled:u=!1,isDisplayOnly:S=!1,className:g,config:_={actions:["reset"],width:600,height:600,hideSubtitle:!1}})=>{var j;const q={actions:["reset"],width:600,height:600,hideSubtitle:!1},h=y.useRef(null),{t:n}=W.useTranslation(),{filters:a,name:c}=d,{actions:F,width:r,height:s,hideSubtitle:w}={...q,..._};if(S)return e.jsx(T.default,{ref:h,filters:a,width:r,height:s,selectedObjectName:c,className:g});const B=t=>{const{label:f}=t,{filters:b}=d,O=b.map(m=>m.label===f?t:m);return i&&i({...d,filters:O})},I=t=>{if(t
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),y=require("react"),W=require("react-i18next"),H=require("./widgets/ColorTool/utilities.cjs"),l=require("./widgets/ColorTool/styles.cjs"),N=require("@rubin-epo/epo-react-lib/SelectListbox"),R=require("./widgets/ColorTool/Actions/index.cjs"),T=require("./widgets/ColorTool/ImageComposite/ImageComposite.cjs"),$=require("./widgets/ColorTool/FilterControls/FilterControls.cjs"),v=o=>o&&o.__esModule?o:{default:o},E=v(N),p=({data:o,objectOptions:L=[],selectedData:d,colorOptions:C=[],selectionCallback:i,isDisabled:u=!1,isDisplayOnly:S=!1,className:g,config:_={actions:["reset"],width:600,height:600,hideSubtitle:!1}})=>{var j;const q={actions:["reset"],width:600,height:600,hideSubtitle:!1},h=y.useRef(null),{t:n}=W.useTranslation(),{filters:a,name:c}=d,{actions:F,width:r,height:s,hideSubtitle:w}={...q,..._};if(S)return e.jsx(T.default,{ref:h,filters:a,width:r,height:s,selectedObjectName:c,className:g});const B=t=>{const{label:f}=t,{filters:b}=d,O=b.map(m=>m.label===f?t:m);return i&&i({...d,filters:O})},I=t=>{if(t)return i&&i({name:t,filters:H.getDataFiltersByName(o,t)})},x=o.length>1,M=n("colorTool.actions.select_an_object");return e.jsx(l.WidgetContainer,{className:g,children:e.jsxs(l.WidgetLayout,{style:{"--image-width":typeof r=="number"?`${r}px`:r,"--image-height":typeof s=="number"?`${s}px`:s},children:[c&&x&&e.jsx(l.Title,{children:!w&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:n("colorTool.labels.object")}),e.jsx("dd",{children:c})]})}),e.jsxs(l.ControlsContainer,{children:[a&&e.jsxs(e.Fragment,{children:[e.jsx(l.ToolsHeader,{id:"filterLabel",children:n("colorTool.labels.filter")}),e.jsx(l.ToolsHeader,{id:"colorLabel",children:n("colorTool.labels.color")}),e.jsx(l.ToolsHeader,{id:"intensityLabel",children:n("colorTool.labels.color_intensity")})]}),a&&a.map(t=>{const{label:f,isDisabled:b}=t;return y.createElement($.default,{filter:t,colorOptions:C,key:`filter-${f}`,isDisabled:u||b,onChangeFilterCallback:B,buttonLabelledById:"filterLabel",selectLabelledById:"colorLabel",sliderLabelledById:"intensityLabel"})})]}),e.jsx(T.default,{ref:h,filters:a,width:r,height:s,selectedObjectName:c,children:x&&e.jsx(l.SelectionContainer,{children:e.jsx(E.default,{id:"astroObjectSelector",placeholder:M,options:L,onChangeCallback:I,value:c,isDisabled:u,width:"100%",maxWidth:"100%"})})}),e.jsx(R.default,{actions:F,images:(j=h.current)==null?void 0:j.getElementsByTagName("canvas"),selectedData:d,width:r,height:s,isDisabled:u,selectionCallback:i})]})})};p.displayName="Widgets.ColorTool";exports.default=p;
|
package/dist/ColorTool.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),q=require("@rubin-epo/epo-react-lib/SelectListbox"),S=require("../utilities.cjs"),T=require("react-i18next"),l=require("./styles.cjs"),f=e=>e&&e.__esModule?e:{default:e},I=f(q),d=({filter:e,colorOptions:a,isDisabled:i,onChangeFilterCallback:t,buttonLabelledById:u,selectLabelledById:h,sliderLabelledById:x})=>{const{t:b}=T.useTranslation(),{label:r,color:c="",value:g,active:n,min:m,max:j}=e,_=()=>t&&t({...e,active:!n}),p=o=>o&&t&&t({...e,color:o}),y=o=>t&&t({...e,brightness:S.getBrightnessValue(m,j,o),value:o}),v=b("colorTool.actions.select_filter");return s.jsxs(l.FilterContainer,{disabled:i,children:[s.jsxs(l.FilterLabel,{children:[s.jsx(l.HiddenCheckbox,{checked:n,type:"checkbox",onChange:_,"aria-describedby":u}),s.jsx(l.FilterToggle,{as:"span",children:r})]}),s.jsx(I.default,{placeholder:v,value:c,options:a,onChangeCallback:p,width:"100%",maxWidth:"100%",labelledById:h}),s.jsx(l.Slider,{min:1,max:100,onChangeCallback:y,isDisabled:!n||i,labelledbyId:x,value:g,label:r,color:c})]})};d.displayName="Widgets.ColorTool.FilterControls";const B=d;exports.default=B;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),q=require("@rubin-epo/epo-react-lib/SelectListbox"),S=require("../utilities.cjs"),T=require("react-i18next"),l=require("./styles.cjs"),f=e=>e&&e.__esModule?e:{default:e},I=f(q),d=({filter:e,colorOptions:a,isDisabled:i,onChangeFilterCallback:t,buttonLabelledById:u,selectLabelledById:h,sliderLabelledById:x})=>{const{t:b}=T.useTranslation(),{label:r,color:c="",value:g,active:n,min:m,max:j}=e,_=()=>t&&t({...e,active:!n}),p=o=>o&&t&&t({...e,color:o}),y=o=>t&&t({...e,brightness:S.getBrightnessValue(m,j,o),value:o}),v=b("colorTool.actions.select_filter");return s.jsxs(l.FilterContainer,{disabled:i,children:[s.jsxs(l.FilterLabel,{children:[s.jsx(l.HiddenCheckbox,{checked:n,type:"checkbox",onChange:_,"aria-describedby":u}),s.jsx(l.FilterToggle,{as:"span",children:r})]}),s.jsx(I.default,{placeholder:v,value:c,options:a,onChangeCallback:p,width:"100%",maxWidth:"100%",labelledById:h,isDisabled:!n||i}),s.jsx(l.Slider,{min:1,max:100,onChangeCallback:y,isDisabled:!n||i,labelledbyId:x,value:g,label:r,color:c})]})};d.displayName="Widgets.ColorTool.FilterControls";const B=d;exports.default=B;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
1
|
+
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import B from "@rubin-epo/epo-react-lib/SelectListbox";
|
|
3
3
|
import { getBrightnessValue as C } from "../utilities.js";
|
|
4
4
|
import { useTranslation as I } from "react-i18next";
|
|
@@ -12,25 +12,25 @@ const a = ({
|
|
|
12
12
|
selectLabelledById: h,
|
|
13
13
|
sliderLabelledById: p
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: b } = I(), { label: i, color: n = "", value: x, active:
|
|
15
|
+
const { t: b } = I(), { label: i, color: n = "", value: x, active: s, min: g, max: u } = t, y = () => e && e({ ...t, active: !s }), f = (o) => o && e && e({ ...t, color: o }), v = (o) => e && e({
|
|
16
16
|
...t,
|
|
17
17
|
brightness: C(g, u, o),
|
|
18
18
|
value: o
|
|
19
19
|
}), T = b("colorTool.actions.select_filter");
|
|
20
20
|
return /* @__PURE__ */ d(j, { disabled: r, children: [
|
|
21
21
|
/* @__PURE__ */ d(L, { children: [
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ l(
|
|
23
23
|
S,
|
|
24
24
|
{
|
|
25
|
-
checked:
|
|
25
|
+
checked: s,
|
|
26
26
|
type: "checkbox",
|
|
27
27
|
onChange: y,
|
|
28
28
|
"aria-describedby": m
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ l(W, { as: "span", children: i })
|
|
32
32
|
] }),
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ l(
|
|
34
34
|
B,
|
|
35
35
|
{
|
|
36
36
|
placeholder: T,
|
|
@@ -39,16 +39,17 @@ const a = ({
|
|
|
39
39
|
onChangeCallback: f,
|
|
40
40
|
width: "100%",
|
|
41
41
|
maxWidth: "100%",
|
|
42
|
-
labelledById: h
|
|
42
|
+
labelledById: h,
|
|
43
|
+
isDisabled: !s || r
|
|
43
44
|
}
|
|
44
45
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ l(
|
|
46
47
|
w,
|
|
47
48
|
{
|
|
48
49
|
min: 1,
|
|
49
50
|
max: 100,
|
|
50
51
|
onChangeCallback: v,
|
|
51
|
-
isDisabled: !
|
|
52
|
+
isDisabled: !s || r,
|
|
52
53
|
labelledbyId: p,
|
|
53
54
|
value: x,
|
|
54
55
|
label: i,
|
|
@@ -856,7 +856,7 @@ export declare const FilterToggle: import("styled-components").IStyledComponent<
|
|
|
856
856
|
default?: boolean | undefined;
|
|
857
857
|
wrap?: string | undefined;
|
|
858
858
|
open?: boolean | undefined;
|
|
859
|
-
icon?: "Account" | "ArrowUpFromBracket" | "Backward" | "BackwardStep" | "Calendar" | "Cancel" | "CaretDown" | "CheckeredFlag" | "Checkmark" | "CheckmarkCircle" | "CircularLoader" | "Chevron" | "ChevronLeftElongated" | "ChevronRightElongated" | "ChevronThin" | "Close" | "CloseCircle" | "Cloud" | "Doc" | "Email" | "Expand" | "Eye" | "Facebook" | "FloppyDisk" | "Forward" | "ForwardStep" | "Globe" | "Google" | "Hamburger" | "Info" | "Instagram" | "Lightbulb" | "LinkedIn" | "LockClosed" | "LockOpen" | "LogOut" | "Mail" | "Minus" | "Page" | "Pause" | "Phone" | "Pin" | "Play" | "Plus" | "QuestionCircle" | "RotateLeft" | "RotateLeftWithCenter" | "Search" | "ShareCopyUrl" | "ShareEmail" | "ShareFacebook" | "ShareToggle" | "ShareTwitter" | "Team" | "Temp" | "Thumbtack" | "Time" | "Timer" | "Twitter" | "User" | "UserInverted" | "Video" | "YouTube" | "Pdf" | "Word" | undefined;
|
|
859
|
+
icon?: "Account" | "ArrowUpFromBracket" | "Backward" | "BackwardStep" | "Calendar" | "Cancel" | "CaretDown" | "CheckeredFlag" | "Checkmark" | "CheckmarkCircle" | "CircularLoader" | "Chevron" | "ChevronLeftElongated" | "ChevronRightElongated" | "ChevronThin" | "Close" | "CloseCircle" | "Cloud" | "Doc" | "Email" | "Expand" | "Eye" | "Facebook" | "FloppyDisk" | "Forward" | "ForwardStep" | "Globe" | "Google" | "Hamburger" | "Info" | "InfoCircle" | "Instagram" | "Lightbulb" | "LinkedIn" | "LockClosed" | "LockOpen" | "LogOut" | "Mail" | "Minus" | "Page" | "Pause" | "Phone" | "Pin" | "Play" | "Plus" | "QuestionCircle" | "RotateLeft" | "RotateLeftWithCenter" | "Search" | "ShareCopyUrl" | "ShareEmail" | "ShareFacebook" | "ShareToggle" | "ShareTwitter" | "Team" | "Temp" | "Thumbtack" | "Time" | "Timer" | "Twitter" | "User" | "UserInverted" | "Video" | "YouTube" | "Pdf" | "Word" | undefined;
|
|
860
860
|
multiple?: boolean | undefined;
|
|
861
861
|
disabled?: boolean | undefined;
|
|
862
862
|
height?: string | number | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubin-epo/epo-widget-lib",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Rubin Observatory Education & Public Outreach team React scientific and educational widgets.",
|
|
5
5
|
"author": "Rubin EPO",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-i18next": "^12.2.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@rubin-epo/epo-react-lib": "^2.0.
|
|
41
|
+
"@rubin-epo/epo-react-lib": "^2.0.12",
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"styled-components": "^6.1.1",
|
|
44
44
|
"use-resize-observer": "^9.1.0"
|