@dreamcommerce/aurora 2.12.1-47 → 2.12.1-49

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.
@@ -3,12 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var constants = require('../constants.js');
7
6
  var useColorPicker$1 = require('../../../../../../external/react-best-gradient-color-picker/dist/esm/hooks/useColorPicker.js');
8
7
  var utilities = require('../utilities.js');
9
8
 
10
- const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
11
- const [color, setColor] = React.useState(initialColor ? initialColor : constants.COLOR_PICKER_INITIAL_STATE);
9
+ const useColorPicker = ({ color, setColor, onChange, onCancel, onSave }) => {
12
10
  const [choosenColor, setChoosenColor] = React.useState(color);
13
11
  const { hslArr, rgbaArr, setR, setG, setB, setA } = useColorPicker$1.useColorPicker(color, setColor);
14
12
  const tinyColor = utilities.getTinyColorInstance(color);
@@ -42,8 +40,8 @@ const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
42
40
  setColor(color);
43
41
  };
44
42
  return {
45
- color,
46
- setColor,
43
+ // color,
44
+ // setColor,
47
45
  hex,
48
46
  hslArr,
49
47
  handleOnChangeAlpha,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8FAAkG;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+BAA+B,8FAAkG;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -24,12 +24,13 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  const ColorPickerNewWithContext = ({ id, name, initialColor, onChange, onCancel, onSave }) => {
25
25
  const [color, setColor] = React.useState(initialColor ? initialColor : constants.COLOR_PICKER_INITIAL_STATE);
26
26
  const contextValue = use_color_picker['default']({
27
- initialColor,
27
+ color,
28
+ setColor,
28
29
  onChange,
29
30
  onCancel,
30
31
  onSave
31
32
  });
32
- return (React__default['default'].createElement(context.ColorPickerNewContext.Provider, { value: contextValue },
33
+ return (React__default['default'].createElement(context.ColorPickerNewContext.Provider, { value: { ...contextValue, color, setColor } },
33
34
  React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPicker]}` },
34
35
  React__default['default'].createElement(index['default'], null,
35
36
  React__default['default'].createElement(index['default'].CustomLabel, null,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uFAA2F;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA,sBAAsB,uFAA2F;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,14 +1,13 @@
1
- /// <reference types="react" />
2
1
  import { ColorPickerColorTypes, IColorPickerColor } from '../types';
2
+ import { Dispatch, SetStateAction } from 'react';
3
3
  export declare type ColorPickerHookProps = {
4
- initialColor?: ColorPickerColorTypes['hex'];
4
+ color: string;
5
+ setColor: Dispatch<SetStateAction<string>>;
5
6
  onChange?: (color: IColorPickerColor) => void;
6
7
  onCancel?: () => void;
7
8
  onSave?: (color: IColorPickerColor) => void;
8
9
  };
9
- declare const useColorPicker: ({ initialColor, onChange, onCancel, onSave }: ColorPickerHookProps) => {
10
- color: string;
11
- setColor: import("react").Dispatch<import("react").SetStateAction<string>>;
10
+ declare const useColorPicker: ({ color, setColor, onChange, onCancel, onSave }: ColorPickerHookProps) => {
12
11
  hex: string;
13
12
  hslArr: number[];
14
13
  handleOnChangeAlpha: (event: React.ChangeEvent<HTMLInputElement>) => void;
@@ -1,10 +1,8 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { COLOR_PICKER_INITIAL_STATE } from '../constants.js';
3
2
  import { useColorPicker as useColorPicker$1 } from '../../../../../../external/react-best-gradient-color-picker/dist/esm/hooks/useColorPicker.js';
4
3
  import { getTinyColorInstance, getHexValue, getAllColorTypes } from '../utilities.js';
5
4
 
6
- const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
7
- const [color, setColor] = useState(initialColor ? initialColor : COLOR_PICKER_INITIAL_STATE);
5
+ const useColorPicker = ({ color, setColor, onChange, onCancel, onSave }) => {
8
6
  const [choosenColor, setChoosenColor] = useState(color);
9
7
  const { hslArr, rgbaArr, setR, setG, setB, setA } = useColorPicker$1(color, setColor);
10
8
  const tinyColor = getTinyColorInstance(color);
@@ -38,8 +36,8 @@ const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
38
36
  setColor(color);
39
37
  };
40
38
  return {
41
- color,
42
- setColor,
39
+ // color,
40
+ // setColor,
43
41
  hex,
44
42
  hslArr,
45
43
  handleOnChangeAlpha,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA,mDAAmD,8FAAkG;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,mDAAmD,8FAAkG;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -16,12 +16,13 @@ import useColorPicker from './hooks/use_color_picker.js';
16
16
  const ColorPickerNewWithContext = ({ id, name, initialColor, onChange, onCancel, onSave }) => {
17
17
  const [color, setColor] = useState(initialColor ? initialColor : COLOR_PICKER_INITIAL_STATE);
18
18
  const contextValue = useColorPicker({
19
- initialColor,
19
+ color,
20
+ setColor,
20
21
  onChange,
21
22
  onCancel,
22
23
  onSave
23
24
  });
24
- return (React.createElement(ColorPickerNewContext.Provider, { value: contextValue },
25
+ return (React.createElement(ColorPickerNewContext.Provider, { value: { ...contextValue, color, setColor } },
25
26
  React.createElement("div", { className: `${styles[cssColorPicker]}` },
26
27
  React.createElement(Dropdown, null,
27
28
  React.createElement(Dropdown.CustomLabel, null,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,4BAA4B,uFAA2F;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,4BAA4B,uFAA2F;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.12.1-47",
5
+ "version": "2.12.1-49",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",