@dreamcommerce/aurora 2.1.15-8 → 2.1.15-9
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/build/cjs/packages/aurora/src/components/color_picker/index.js +2 -8
- package/build/cjs/packages/aurora/src/components/color_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/utilities/colors/color_converter.js +6 -2
- package/build/cjs/packages/aurora/src/utilities/colors/color_converter.js.map +1 -1
- package/build/esm/packages/aurora/src/components/color_picker/index.js +2 -8
- package/build/esm/packages/aurora/src/components/color_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/utilities/colors/color_converter.js +6 -2
- package/build/esm/packages/aurora/src/utilities/colors/color_converter.js.map +1 -1
- package/package.json +1 -1
|
@@ -43,13 +43,7 @@ const useStyles = reactJss_esm.createUseStyles({
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
const PureColorPicker = ({ hideChooseCancelButtons }) => {
|
|
46
|
-
|
|
47
|
-
const { color = {
|
|
48
|
-
hue: 0,
|
|
49
|
-
saturation: 0,
|
|
50
|
-
lightness: 100,
|
|
51
|
-
hex: '#ffffff'
|
|
52
|
-
}, setColor, initialColor, hueSliderPointer, saturationLightnessPointer, setHueSliderPointer, setSaturationLightnessPointer, screenName } = React.useContext(context.ColorPickerContext);
|
|
46
|
+
const { color, setColor, initialColor, hueSliderPointer, saturationLightnessPointer, setHueSliderPointer, setSaturationLightnessPointer, screenName } = React.useContext(context.ColorPickerContext);
|
|
53
47
|
const saturationLightnessPanelRef = React.useRef(null);
|
|
54
48
|
const hueSliderRef = React.useRef(null);
|
|
55
49
|
const classes = useStyles({ color, saturationLightnessPointer, hueSliderPointer, screenName });
|
|
@@ -92,7 +86,7 @@ const PureColorPicker = ({ hideChooseCancelButtons }) => {
|
|
|
92
86
|
React__default['default'].createElement("div", { className: `${classes.preview} ${main_module['default'][css_classes.cssColorPickerPreview]}` }),
|
|
93
87
|
React__default['default'].createElement("div", { className: main_module['default'][css_classes.cssColorPickerInputContainer] },
|
|
94
88
|
React__default['default'].createElement("span", null, "#"),
|
|
95
|
-
React__default['default'].createElement(input['default'], { id: "color-picker-id", value: (
|
|
89
|
+
React__default['default'].createElement(input['default'], { id: "color-picker-id", value: (color.hex || '').replace(/#/g, ''), onChange: inputOnChange }))),
|
|
96
90
|
!hideChooseCancelButtons && React__default['default'].createElement(buttons['default'], { restoreInitialColor: restoreInitialColor })));
|
|
97
91
|
};
|
|
98
92
|
const ColorPickerWithContext = ({ initialColor, onChange, hideChooseCancelButtons, name }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAA6D;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAA6D;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var index = require('../../../../../external/color-convert/index.js');
|
|
6
6
|
|
|
7
7
|
class ColorConverter {
|
|
8
|
-
static hex2hsl(hex
|
|
8
|
+
static hex2hsl(hex) {
|
|
9
|
+
if (!hex)
|
|
10
|
+
return { hue: 0, saturation: 0, lightness: 100 };
|
|
9
11
|
const hexToConvert = hex.startsWith('#') ? hex.substring(1) : hex;
|
|
10
12
|
const [hue, saturation, lightness] = index['default'].hex.hsl(hexToConvert);
|
|
11
13
|
return { hue, saturation, lightness };
|
|
@@ -13,7 +15,9 @@ class ColorConverter {
|
|
|
13
15
|
static hsl2hex({ hue, saturation, lightness }) {
|
|
14
16
|
return `#${index['default'].hsl.hex([hue, saturation, lightness])}`;
|
|
15
17
|
}
|
|
16
|
-
static hex2hsv(hex
|
|
18
|
+
static hex2hsv(hex) {
|
|
19
|
+
if (!hex)
|
|
20
|
+
return { hue: 0, saturation: 0, value: 100 };
|
|
17
21
|
const hexToConvert = hex.startsWith('#') ? hex.substring(1) : hex;
|
|
18
22
|
const [hue, saturation, value] = index['default'].hex.hsv(hexToConvert);
|
|
19
23
|
return { hue, saturation, value };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,oBAAoB,gDAAoD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,oBAAoB,gDAAoD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -35,13 +35,7 @@ const useStyles = createUseStyles({
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const PureColorPicker = ({ hideChooseCancelButtons }) => {
|
|
38
|
-
|
|
39
|
-
const { color = {
|
|
40
|
-
hue: 0,
|
|
41
|
-
saturation: 0,
|
|
42
|
-
lightness: 100,
|
|
43
|
-
hex: '#ffffff'
|
|
44
|
-
}, setColor, initialColor, hueSliderPointer, saturationLightnessPointer, setHueSliderPointer, setSaturationLightnessPointer, screenName } = useContext(ColorPickerContext);
|
|
38
|
+
const { color, setColor, initialColor, hueSliderPointer, saturationLightnessPointer, setHueSliderPointer, setSaturationLightnessPointer, screenName } = useContext(ColorPickerContext);
|
|
45
39
|
const saturationLightnessPanelRef = useRef(null);
|
|
46
40
|
const hueSliderRef = useRef(null);
|
|
47
41
|
const classes = useStyles({ color, saturationLightnessPointer, hueSliderPointer, screenName });
|
|
@@ -84,7 +78,7 @@ const PureColorPicker = ({ hideChooseCancelButtons }) => {
|
|
|
84
78
|
React.createElement("div", { className: `${classes.preview} ${styles[cssColorPickerPreview]}` }),
|
|
85
79
|
React.createElement("div", { className: styles[cssColorPickerInputContainer] },
|
|
86
80
|
React.createElement("span", null, "#"),
|
|
87
|
-
React.createElement(Input, { id: "color-picker-id", value: (
|
|
81
|
+
React.createElement(Input, { id: "color-picker-id", value: (color.hex || '').replace(/#/g, ''), onChange: inputOnChange }))),
|
|
88
82
|
!hideChooseCancelButtons && React.createElement(ColorPickerButtons, { restoreInitialColor: restoreInitialColor })));
|
|
89
83
|
};
|
|
90
84
|
const ColorPickerWithContext = ({ initialColor, onChange, hideChooseCancelButtons, name }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,gCAAgC,yDAA6D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,gCAAgC,yDAA6D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import colorConvert from '../../../../../external/color-convert/index.js';
|
|
2
2
|
|
|
3
3
|
class ColorConverter {
|
|
4
|
-
static hex2hsl(hex
|
|
4
|
+
static hex2hsl(hex) {
|
|
5
|
+
if (!hex)
|
|
6
|
+
return { hue: 0, saturation: 0, lightness: 100 };
|
|
5
7
|
const hexToConvert = hex.startsWith('#') ? hex.substring(1) : hex;
|
|
6
8
|
const [hue, saturation, lightness] = colorConvert.hex.hsl(hexToConvert);
|
|
7
9
|
return { hue, saturation, lightness };
|
|
@@ -9,7 +11,9 @@ class ColorConverter {
|
|
|
9
11
|
static hsl2hex({ hue, saturation, lightness }) {
|
|
10
12
|
return `#${colorConvert.hsl.hex([hue, saturation, lightness])}`;
|
|
11
13
|
}
|
|
12
|
-
static hex2hsv(hex
|
|
14
|
+
static hex2hsv(hex) {
|
|
15
|
+
if (!hex)
|
|
16
|
+
return { hue: 0, saturation: 0, value: 100 };
|
|
13
17
|
const hexToConvert = hex.startsWith('#') ? hex.substring(1) : hex;
|
|
14
18
|
const [hue, saturation, value] = colorConvert.hex.hsv(hexToConvert);
|
|
15
19
|
return { hue, saturation, value };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,yBAAyB,gDAAoD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,yBAAyB,gDAAoD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|