@dreamcommerce/aurora 2.12.1-47 → 2.12.1-48

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);
@@ -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,7 +24,8 @@ 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
@@ -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,15 @@
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
+ declare const useColorPicker: ({ color, setColor, onChange, onCancel, onSave }: ColorPickerHookProps) => {
10
11
  color: string;
11
- setColor: import("react").Dispatch<import("react").SetStateAction<string>>;
12
+ setColor: Dispatch<SetStateAction<string>>;
12
13
  hex: string;
13
14
  hslArr: number[];
14
15
  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);
@@ -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,7 +16,8 @@ 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
@@ -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-48",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",