ywana-core8 0.0.389 → 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.cjs +20 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +20 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +23 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/domain/ContentEditor.js +2 -1
- package/src/domain/ContentEditor.test.js +6 -5
- package/src/html/color.js +17 -0
- package/src/html/color.test.js +19 -0
- package/src/html/color1.css +3 -0
package/dist/index.modern.js
CHANGED
@@ -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) {
|
@@ -3713,6 +3714,21 @@ var NumberField = function NumberField(_ref3) {
|
|
3713
3714
|
});
|
3714
3715
|
};
|
3715
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
|
+
}));
|
3730
|
+
};
|
3731
|
+
|
3716
3732
|
/**
|
3717
3733
|
* Content Editor
|
3718
3734
|
*/
|
@@ -4070,7 +4086,10 @@ var StringEditor = function StringEditor(_ref6) {
|
|
4070
4086
|
function renderFormat(format, options) {
|
4071
4087
|
switch (format) {
|
4072
4088
|
case FORMATS.COLOR:
|
4073
|
-
return /*#__PURE__*/React.createElement(
|
4089
|
+
return /*#__PURE__*/React.createElement(ColorField, {
|
4090
|
+
id: id,
|
4091
|
+
onChange: change
|
4092
|
+
});
|
4074
4093
|
|
4075
4094
|
case FORMATS.HTML:
|
4076
4095
|
return /*#__PURE__*/React.createElement(Editor, {
|