ywana-core8 0.0.388 → 0.0.391

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.
@@ -6,6 +6,7 @@ import { extendMoment } from 'moment-range';
6
6
  import ResumableJS from 'resumablejs';
7
7
  import { ReactNotifications, Store } from 'react-notifications-component';
8
8
  import 'react-notifications-component/dist/theme.css';
9
+ import { CirclePicker } from 'react-color';
9
10
  import equal from 'deep-equal';
10
11
 
11
12
  function _catch$2(body, recover) {
@@ -1196,7 +1197,8 @@ var FORMATS = {
1196
1197
  EMAIL: 'email',
1197
1198
  HTML: 'HTML',
1198
1199
  URL: 'URL',
1199
- IMG: 'IMG'
1200
+ IMG: 'IMG',
1201
+ COLOR: 'COLOR'
1200
1202
  };
1201
1203
  /**
1202
1204
  * CHECK
@@ -3712,6 +3714,22 @@ var NumberField = function NumberField(_ref3) {
3712
3714
  });
3713
3715
  };
3714
3716
 
3717
+ var ColorField = function ColorField(props) {
3718
+ var id = props.id,
3719
+ onChange = props.onChange;
3720
+
3721
+ function change(color) {
3722
+ if (onChange) onChange(id, color.hex);
3723
+ }
3724
+
3725
+ return /*#__PURE__*/React.createElement("div", {
3726
+ className: "color-field"
3727
+ }, /*#__PURE__*/React.createElement(CirclePicker, {
3728
+ onChangeComplete: change,
3729
+ width: ""
3730
+ }));
3731
+ };
3732
+
3715
3733
  /**
3716
3734
  * Content Editor
3717
3735
  */
@@ -4068,6 +4086,12 @@ var StringEditor = function StringEditor(_ref6) {
4068
4086
 
4069
4087
  function renderFormat(format, options) {
4070
4088
  switch (format) {
4089
+ case FORMATS.COLOR:
4090
+ return /*#__PURE__*/React.createElement(ColorField, {
4091
+ id: id,
4092
+ onChange: change
4093
+ });
4094
+
4071
4095
  case FORMATS.HTML:
4072
4096
  return /*#__PURE__*/React.createElement(Editor, {
4073
4097
  id: id,