@panneau/field-html 3.0.307 → 4.0.0
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 +64 -86
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import { CKEditor } from '@ckeditor/ckeditor5-react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
7
6
|
import InputGroup from '@panneau/field-input-group';
|
|
8
7
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
@@ -40,89 +39,70 @@ var useCKEditorBuilds = function useCKEditorBuilds() {
|
|
|
40
39
|
|
|
41
40
|
var styles = {"container":"panneau-field-html-container"};
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
feedback
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
// rel: 'noopener noreferrer',
|
|
102
|
-
// },
|
|
103
|
-
// },
|
|
42
|
+
function HtmlField(_ref) {
|
|
43
|
+
var _ref$feedback = _ref.feedback,
|
|
44
|
+
feedback = _ref$feedback === void 0 ? null : _ref$feedback,
|
|
45
|
+
_ref$errors = _ref.errors,
|
|
46
|
+
errors = _ref$errors === void 0 ? null : _ref$errors,
|
|
47
|
+
_ref$value = _ref.value,
|
|
48
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
49
|
+
_ref$inline = _ref.inline,
|
|
50
|
+
inline = _ref$inline === void 0 ? false : _ref$inline,
|
|
51
|
+
_ref$disabled = _ref.disabled,
|
|
52
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
53
|
+
_ref$onChange = _ref.onChange,
|
|
54
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
55
|
+
_ref$onFocus = _ref.onFocus,
|
|
56
|
+
onFocus = _ref$onFocus === void 0 ? null : _ref$onFocus,
|
|
57
|
+
_ref$onBlur = _ref.onBlur,
|
|
58
|
+
onBlur = _ref$onBlur === void 0 ? null : _ref$onBlur,
|
|
59
|
+
_ref$ckConfig = _ref.ckConfig,
|
|
60
|
+
ckConfig = _ref$ckConfig === void 0 ? {
|
|
61
|
+
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList'
|
|
62
|
+
// 'blockQuote',
|
|
63
|
+
// 'mediaEmbed',
|
|
64
|
+
],
|
|
65
|
+
heading: {
|
|
66
|
+
options: [{
|
|
67
|
+
model: 'paragraph',
|
|
68
|
+
title: 'Paragraph'
|
|
69
|
+
}, {
|
|
70
|
+
model: 'heading1',
|
|
71
|
+
view: 'h1',
|
|
72
|
+
title: 'Heading 1'
|
|
73
|
+
}, {
|
|
74
|
+
model: 'heading2',
|
|
75
|
+
view: 'h2',
|
|
76
|
+
title: 'Heading 2'
|
|
77
|
+
}, {
|
|
78
|
+
model: 'heading3',
|
|
79
|
+
view: 'h3',
|
|
80
|
+
title: 'Heading 3'
|
|
81
|
+
}]
|
|
82
|
+
},
|
|
83
|
+
link: {
|
|
84
|
+
addTargetToExternalLinks: true
|
|
85
|
+
// TODO: test this
|
|
86
|
+
// decorators: {
|
|
87
|
+
// openInSamePage: {
|
|
88
|
+
// mode: 'manual',
|
|
89
|
+
// label: 'Open in same page',
|
|
90
|
+
// attributes: {
|
|
91
|
+
// target: '_self',
|
|
92
|
+
// rel: 'noopener noreferrer',
|
|
93
|
+
// },
|
|
94
|
+
// },
|
|
95
|
+
// },
|
|
96
|
+
// allowedProtocols: [ 'https?', 'tel', 'sms', 'mailto' ],
|
|
97
|
+
}
|
|
98
|
+
// mediaEmbed: {
|
|
99
|
+
// previewsInData: true,
|
|
104
100
|
// },
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
ckOptions: null,
|
|
112
|
-
className: null
|
|
113
|
-
};
|
|
114
|
-
var HtmlField = function HtmlField(_ref) {
|
|
115
|
-
var feedback = _ref.feedback,
|
|
116
|
-
errors = _ref.errors,
|
|
117
|
-
value = _ref.value,
|
|
118
|
-
inline = _ref.inline,
|
|
119
|
-
disabled = _ref.disabled,
|
|
120
|
-
onChange = _ref.onChange,
|
|
121
|
-
onFocus = _ref.onFocus,
|
|
122
|
-
onBlur = _ref.onBlur,
|
|
123
|
-
ckConfig = _ref.ckConfig,
|
|
124
|
-
ckOptions = _ref.ckOptions,
|
|
125
|
-
className = _ref.className;
|
|
101
|
+
} : _ref$ckConfig,
|
|
102
|
+
_ref$ckOptions = _ref.ckOptions,
|
|
103
|
+
ckOptions = _ref$ckOptions === void 0 ? null : _ref$ckOptions,
|
|
104
|
+
_ref$className = _ref.className,
|
|
105
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
126
106
|
var _ref2 = useCKEditorBuilds() || {},
|
|
127
107
|
_ref2$Editor = _ref2.Editor,
|
|
128
108
|
Editor = _ref2$Editor === void 0 ? null : _ref2$Editor,
|
|
@@ -155,9 +135,7 @@ var HtmlField = function HtmlField(_ref) {
|
|
|
155
135
|
disabled: disabled
|
|
156
136
|
}))) : null;
|
|
157
137
|
return inline ? /*#__PURE__*/React.createElement(InputGroup, null, ckElement) : ckElement;
|
|
158
|
-
}
|
|
159
|
-
HtmlField.propTypes = propTypes;
|
|
160
|
-
HtmlField.defaultProps = defaultProps;
|
|
138
|
+
}
|
|
161
139
|
|
|
162
140
|
var definition = {
|
|
163
141
|
id: 'html',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-html",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A HTML field, using either Quill or CK Editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@babel/runtime": "^7.12.5",
|
|
62
62
|
"@ckeditor/ckeditor5-editor-multi-root": "^47.1.0",
|
|
63
63
|
"@ckeditor/ckeditor5-react": "^11.0.0",
|
|
64
|
-
"@panneau/ckeditor": "^
|
|
65
|
-
"@panneau/core": "^
|
|
66
|
-
"@panneau/field-input-group": "^
|
|
67
|
-
"@panneau/themes": "^
|
|
64
|
+
"@panneau/ckeditor": "^4.0.0",
|
|
65
|
+
"@panneau/core": "^4.0.0",
|
|
66
|
+
"@panneau/field-input-group": "^4.0.0",
|
|
67
|
+
"@panneau/themes": "^4.0.0",
|
|
68
68
|
"classnames": "^2.5.1",
|
|
69
69
|
"prop-types": "^15.7.2"
|
|
70
70
|
},
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "2cca874e0388b4a20c39aadb205c0e67d5a946fc"
|
|
78
78
|
}
|