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.cjs +27 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +27 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +30 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/domain/ContentEditor.js +2 -0
- package/src/domain/ContentEditor.test.js +6 -5
- package/src/domain/ContentType.js +1 -0
- package/src/html/color.js +17 -0
- package/src/html/color.test.js +19 -0
- package/src/html/color1.css +3 -0
- package/src/widgets/login/LoginBox.js +2 -1
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) {
|
@@ -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
|
@@ -2105,6 +2107,8 @@ var LoginBox = function LoginBox(_ref) {
|
|
2105
2107
|
title = _ref.title,
|
2106
2108
|
_ref$userLabel = _ref.userLabel,
|
2107
2109
|
userLabel = _ref$userLabel === void 0 ? "User" : _ref$userLabel,
|
2110
|
+
_ref$userValue = _ref.userValue,
|
2111
|
+
userValue = _ref$userValue === void 0 ? "" : _ref$userValue,
|
2108
2112
|
_ref$passwordLabel = _ref.passwordLabel,
|
2109
2113
|
passwordLabel = _ref$passwordLabel === void 0 ? "Password" : _ref$passwordLabel,
|
2110
2114
|
_ref$passwordValue = _ref.passwordValue,
|
@@ -2118,7 +2122,7 @@ var LoginBox = function LoginBox(_ref) {
|
|
2118
2122
|
message = _ref.message,
|
2119
2123
|
loading = _ref.loading;
|
2120
2124
|
|
2121
|
-
var _useState = useState(
|
2125
|
+
var _useState = useState(userValue),
|
2122
2126
|
user = _useState[0],
|
2123
2127
|
setUser = _useState[1];
|
2124
2128
|
|
@@ -3710,6 +3714,21 @@ var NumberField = function NumberField(_ref3) {
|
|
3710
3714
|
});
|
3711
3715
|
};
|
3712
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
|
+
|
3713
3732
|
/**
|
3714
3733
|
* Content Editor
|
3715
3734
|
*/
|
@@ -4066,6 +4085,12 @@ var StringEditor = function StringEditor(_ref6) {
|
|
4066
4085
|
|
4067
4086
|
function renderFormat(format, options) {
|
4068
4087
|
switch (format) {
|
4088
|
+
case FORMATS.COLOR:
|
4089
|
+
return /*#__PURE__*/React.createElement(ColorField, {
|
4090
|
+
id: id,
|
4091
|
+
onChange: change
|
4092
|
+
});
|
4093
|
+
|
4069
4094
|
case FORMATS.HTML:
|
4070
4095
|
return /*#__PURE__*/React.createElement(Editor, {
|
4071
4096
|
id: id,
|