@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.
Files changed (2) hide show
  1. package/es/index.js +64 -86
  2. 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
- var propTypes = {
44
- feedback: PropTypes.oneOf(['valid', 'invalid', 'loading']),
45
- errors: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
46
- value: PropTypes.string,
47
- placeholder: PropTypes.string,
48
- inline: PropTypes.bool,
49
- disabled: PropTypes.bool,
50
- onChange: PropTypes.func,
51
- onFocus: PropTypes.func,
52
- onBlur: PropTypes.func,
53
- ckConfig: PropTypes.object,
54
- // eslint-disable-line react/forbid-prop-types
55
- ckOptions: PropTypes.object,
56
- // eslint-disable-line react/forbid-prop-types
57
- className: PropTypes.string
58
- };
59
- var defaultProps = {
60
- feedback: null,
61
- errors: null,
62
- value: null,
63
- placeholder: null,
64
- inline: false,
65
- disabled: false,
66
- onChange: null,
67
- onFocus: null,
68
- onBlur: null,
69
- ckConfig: {
70
- toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList'
71
- // 'blockQuote',
72
- // 'mediaEmbed',
73
- ],
74
- heading: {
75
- options: [{
76
- model: 'paragraph',
77
- title: 'Paragraph'
78
- }, {
79
- model: 'heading1',
80
- view: 'h1',
81
- title: 'Heading 1'
82
- }, {
83
- model: 'heading2',
84
- view: 'h2',
85
- title: 'Heading 2'
86
- }, {
87
- model: 'heading3',
88
- view: 'h3',
89
- title: 'Heading 3'
90
- }]
91
- },
92
- link: {
93
- addTargetToExternalLinks: true
94
- // TODO: test this
95
- // decorators: {
96
- // openInSamePage: {
97
- // mode: 'manual',
98
- // label: 'Open in same page',
99
- // attributes: {
100
- // target: '_self',
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
- // allowedProtocols: [ 'https?', 'tel', 'sms', 'mailto' ],
106
- }
107
- // mediaEmbed: {
108
- // previewsInData: true,
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.0.307",
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": "^3.0.299",
65
- "@panneau/core": "^3.0.307",
66
- "@panneau/field-input-group": "^3.0.307",
67
- "@panneau/themes": "^3.0.307",
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": "cbe5e8b1705d01c5653a4df617a06243344310d3"
77
+ "gitHead": "2cca874e0388b4a20c39aadb205c0e67d5a946fc"
78
78
  }