@panneau/field-html 3.0.194 → 3.0.215

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/es/index.js CHANGED
@@ -20,14 +20,15 @@ var useCKEditorBuild = function useCKEditorBuild() {
20
20
  };
21
21
  }
22
22
  import('@panneau/ckeditor/build').then(function (_ref) {
23
- var _ref$default = _ref["default"],
24
- Editor = _ref$default === void 0 ? null : _ref$default;
25
- // console.log('my ed', Editor);
23
+ var _ref$Editor = _ref.Editor,
24
+ Editor = _ref$Editor === void 0 ? null : _ref$Editor;
26
25
  if (!canceled) {
27
26
  ref.current = Editor;
28
27
  setLoaded(true);
29
28
  }
30
- })["catch"](function (e) {
29
+ })
30
+ // eslint-disable-next-line no-console
31
+ ["catch"](function (e) {
31
32
  return console.log('err loading editor', e);
32
33
  });
33
34
  return function () {
@@ -114,8 +115,8 @@ var HtmlField = function HtmlField(_ref) {
114
115
  var CKValue = value !== null ? value : '';
115
116
  var finalClassName = inline ? classNames([styles.container, 'form-control', _defineProperty(_defineProperty(_defineProperty({}, className, className !== null), 'is-valid', feedback === 'valid'), 'is-invalid', feedback === 'invalid' || errors !== null && errors.length > 0)]) : classNames([styles.container, _defineProperty({}, className, className !== null)]);
116
117
  var onCkEditorChange = useCallback(function (event, editor) {
117
- var data = editor.getData();
118
- if (onChange !== null) {
118
+ var data = editor !== null ? editor.getData() : null;
119
+ if (editor !== null && onChange !== null) {
119
120
  onChange(data === '' ? null : data);
120
121
  }
121
122
  }, [onChange]);
package/lib/index.js CHANGED
@@ -24,14 +24,15 @@ var useCKEditorBuild = function useCKEditorBuild() {
24
24
  };
25
25
  }
26
26
  import('@panneau/ckeditor/build').then(function (_ref) {
27
- var _ref$default = _ref["default"],
28
- Editor = _ref$default === void 0 ? null : _ref$default;
29
- // console.log('my ed', Editor);
27
+ var _ref$Editor = _ref.Editor,
28
+ Editor = _ref$Editor === void 0 ? null : _ref$Editor;
30
29
  if (!canceled) {
31
30
  ref.current = Editor;
32
31
  setLoaded(true);
33
32
  }
34
- })["catch"](function (e) {
33
+ })
34
+ // eslint-disable-next-line no-console
35
+ ["catch"](function (e) {
35
36
  return console.log('err loading editor', e);
36
37
  });
37
38
  return function () {
@@ -118,8 +119,8 @@ var HtmlField = function HtmlField(_ref) {
118
119
  var CKValue = value !== null ? value : '';
119
120
  var finalClassName = inline ? classNames([styles.container, 'form-control', _defineProperty(_defineProperty(_defineProperty({}, className, className !== null), 'is-valid', feedback === 'valid'), 'is-invalid', feedback === 'invalid' || errors !== null && errors.length > 0)]) : classNames([styles.container, _defineProperty({}, className, className !== null)]);
120
121
  var onCkEditorChange = React.useCallback(function (event, editor) {
121
- var data = editor.getData();
122
- if (onChange !== null) {
122
+ var data = editor !== null ? editor.getData() : null;
123
+ if (editor !== null && onChange !== null) {
123
124
  onChange(data === '' ? null : data);
124
125
  }
125
126
  }, [onChange]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/field-html",
3
- "version": "3.0.194",
3
+ "version": "3.0.215",
4
4
  "description": "A HTML field, using either Quill or CK Editor",
5
5
  "keywords": [
6
6
  "javascript"
@@ -56,10 +56,10 @@
56
56
  "@babel/runtime": "^7.12.5",
57
57
  "@ckeditor/ckeditor5-editor-multi-root": "^41.3.1",
58
58
  "@ckeditor/ckeditor5-react": "^6.2.0",
59
- "@panneau/ckeditor": "^3.0.170",
60
- "@panneau/core": "^3.0.194",
61
- "@panneau/field-input-group": "^3.0.194",
62
- "@panneau/themes": "^3.0.194",
59
+ "@panneau/ckeditor": "^3.0.207",
60
+ "@panneau/core": "^3.0.215",
61
+ "@panneau/field-input-group": "^3.0.215",
62
+ "@panneau/themes": "^3.0.215",
63
63
  "classnames": "^2.5.1",
64
64
  "prop-types": "^15.7.2"
65
65
  },
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "6d49da8ecbe43b3a5c11dc9ddb9553ef64e58c83"
72
+ "gitHead": "c7bcfdc9627d4b224ac1d046966e0ec3985db229"
73
73
  }