ywana-core8 0.0.387 → 0.0.390

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/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('material-design-icons-iconfont/dist/material-design-icons.css'), require('react'), require('react-switch'), require('moment'), require('moment-range'), require('resumablejs'), require('react-notifications-component'), require('react-notifications-component/dist/theme.css'), require('deep-equal')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'material-design-icons-iconfont/dist/material-design-icons.css', 'react', 'react-switch', 'moment', 'moment-range', 'resumablejs', 'react-notifications-component', 'react-notifications-component/dist/theme.css', 'deep-equal'], factory) :
4
- (global = global || self, factory(global.ywanaCore8 = {}, null, global.react, global.reactSwitch, global.moment, global.momentRange, global.resumablejs, global.reactNotificationsComponent, null, global.deepEqual));
5
- })(this, (function (exports, materialDesignIcons_css, React, RSwitch, moment, momentRange, ResumableJS, reactNotificationsComponent, theme_css, equal) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('material-design-icons-iconfont/dist/material-design-icons.css'), require('react'), require('react-switch'), require('moment'), require('moment-range'), require('resumablejs'), require('react-notifications-component'), require('react-notifications-component/dist/theme.css'), require('react-color'), require('deep-equal')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'material-design-icons-iconfont/dist/material-design-icons.css', 'react', 'react-switch', 'moment', 'moment-range', 'resumablejs', 'react-notifications-component', 'react-notifications-component/dist/theme.css', 'react-color', 'deep-equal'], factory) :
4
+ (global = global || self, factory(global.ywanaCore8 = {}, null, global.react, global.reactSwitch, global.moment, global.momentRange, global.resumablejs, global.reactNotificationsComponent, null, global.reactColor, global.deepEqual));
5
+ })(this, (function (exports, materialDesignIcons_css, React, RSwitch, moment, momentRange, ResumableJS, reactNotificationsComponent, theme_css, reactColor, equal) {
6
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
7
 
8
8
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
@@ -1199,7 +1199,8 @@
1199
1199
  EMAIL: 'email',
1200
1200
  HTML: 'HTML',
1201
1201
  URL: 'URL',
1202
- IMG: 'IMG'
1202
+ IMG: 'IMG',
1203
+ COLOR: 'COLOR'
1203
1204
  };
1204
1205
  /**
1205
1206
  * CHECK
@@ -2108,6 +2109,8 @@
2108
2109
  title = _ref.title,
2109
2110
  _ref$userLabel = _ref.userLabel,
2110
2111
  userLabel = _ref$userLabel === void 0 ? "User" : _ref$userLabel,
2112
+ _ref$userValue = _ref.userValue,
2113
+ userValue = _ref$userValue === void 0 ? "" : _ref$userValue,
2111
2114
  _ref$passwordLabel = _ref.passwordLabel,
2112
2115
  passwordLabel = _ref$passwordLabel === void 0 ? "Password" : _ref$passwordLabel,
2113
2116
  _ref$passwordValue = _ref.passwordValue,
@@ -2121,7 +2124,7 @@
2121
2124
  message = _ref.message,
2122
2125
  loading = _ref.loading;
2123
2126
 
2124
- var _useState = React.useState(''),
2127
+ var _useState = React.useState(userValue),
2125
2128
  user = _useState[0],
2126
2129
  setUser = _useState[1];
2127
2130
 
@@ -3713,6 +3716,21 @@
3713
3716
  });
3714
3717
  };
3715
3718
 
3719
+ var ColorField = function ColorField(props) {
3720
+ var id = props.id,
3721
+ onChange = props.onChange;
3722
+
3723
+ function change(color) {
3724
+ if (onChange) onChange(id, color.hex);
3725
+ }
3726
+
3727
+ return /*#__PURE__*/React__default["default"].createElement("div", {
3728
+ className: "color-field"
3729
+ }, /*#__PURE__*/React__default["default"].createElement(reactColor.CirclePicker, {
3730
+ onChangeComplete: change
3731
+ }));
3732
+ };
3733
+
3716
3734
  /**
3717
3735
  * Content Editor
3718
3736
  */
@@ -4069,6 +4087,12 @@
4069
4087
 
4070
4088
  function renderFormat(format, options) {
4071
4089
  switch (format) {
4090
+ case FORMATS.COLOR:
4091
+ return /*#__PURE__*/React__default["default"].createElement(ColorField, {
4092
+ id: id,
4093
+ onChange: change
4094
+ });
4095
+
4072
4096
  case FORMATS.HTML:
4073
4097
  return /*#__PURE__*/React__default["default"].createElement(Editor, {
4074
4098
  id: id,