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.
- package/dist/index.cjs +25 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +25 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +28 -5
- 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/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
|
@@ -3715,6 +3716,22 @@
|
|
3715
3716
|
});
|
3716
3717
|
};
|
3717
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
|
+
width: ""
|
3732
|
+
}));
|
3733
|
+
};
|
3734
|
+
|
3718
3735
|
/**
|
3719
3736
|
* Content Editor
|
3720
3737
|
*/
|
@@ -4071,6 +4088,12 @@
|
|
4071
4088
|
|
4072
4089
|
function renderFormat(format, options) {
|
4073
4090
|
switch (format) {
|
4091
|
+
case FORMATS.COLOR:
|
4092
|
+
return /*#__PURE__*/React__default["default"].createElement(ColorField, {
|
4093
|
+
id: id,
|
4094
|
+
onChange: change
|
4095
|
+
});
|
4096
|
+
|
4074
4097
|
case FORMATS.HTML:
|
4075
4098
|
return /*#__PURE__*/React__default["default"].createElement(Editor, {
|
4076
4099
|
id: id,
|