@rhc-shared-components/rich-text-editor 0.6.5 → 1.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/dist/index.js CHANGED
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
27
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
28
  var ClassicEditor__default = /*#__PURE__*/_interopDefaultLegacy(ClassicEditor);
29
29
 
30
- var css_248z$1 = ".rich-text-editor-custom {\n --pf-c-title--m-2xl--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-title--m-2xl--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-title--m-2xl--FontWeight: var(--pf-global--FontWeight--normal);\n --pf-c-title--m-xl--LineHeight: var(--pf-global--LineHeight--md);\n --pf-c-title--m-xl--FontSize: var(--pf-global--FontSize--xl);\n --pf-c-title--m-xl--FontWeight: var(--pf-global--FontWeight--normal);\n --pf-c-title--m-lg--LineHeight: var(--pf-global--LineHeight--md);\n --pf-c-title--m-lg--FontSize: var(--pf-global--FontSize--lg);\n --pf-c-title--m-lg--FontWeight: var(--pf-global--FontWeight--normal);\n --pf-c-title--m-md--LineHeight: var(--pf-global--LineHeight--md);\n --pf-c-title--m-md--FontSize: var(--pf-global--FontSize--md);\n --pf-c-title--m-md--FontWeight: var(--pf-global--FontWeight--normal);\n}\n.rich-text-editor-custom .ck-editor__main {\n word-break: break-all;\n}\n.rich-text-editor-custom .ck-code-block-dropdown .ck-splitbutton__arrow {\n display: none;\n}\n.rich-text-editor-custom h1 {\n font-size: var(--pf-c-title--m-2xl--FontSize);\n font-weight: var(--pf-c-title--m-2xl--FontWeight);\n line-height: var(--pf-c-title--m-2xl--LineHeight);\n}\n.rich-text-editor-custom h2 {\n font-size: var(--pf-c-title--m-xl--FontSize);\n font-weight: var(--pf-c-title--m-xl--FontWeight);\n line-height: var(--pf-c-title--m-xl--LineHeight);\n}\n.rich-text-editor-custom h3 {\n font-size: var(--pf-c-title--m-lg--FontSize);\n font-weight: var(--pf-c-title--m-lg--FontWeight);\n line-height: var(--pf-c-title--m-lg--LineHeight);\n}\n.rich-text-editor-custom h4 {\n font-size: var(--pf-c-title--m-md--FontSize);\n font-weight: var(--pf-c-title--m-md--FontWeight);\n line-height: var(--pf-c-title--m-md--LineHeight);\n}\n.rich-text-editor-custom ul {\n display: block;\n list-style-type: disc;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0px;\n margin-inline-start: 0px;\n -webkit-margin-end: 0px;\n margin-inline-end: 0px;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}\n.rich-text-editor-custom ul li {\n display: list-item;\n}\n.rich-text-editor-custom ul ul {\n list-style-type: circle;\n -webkit-margin-before: 0px;\n margin-block-start: 0px;\n -webkit-margin-after: 0px;\n margin-block-end: 0px;\n}\n.rich-text-editor-custom ol {\n display: block;\n list-style-type: decimal;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0px;\n margin-inline-start: 0px;\n -webkit-margin-end: 0px;\n margin-inline-end: 0px;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}";
30
+ var css_248z$1 = ".rich-text-editor-custom {\n --rte-h1-internal-LineHeight: var(--pf-v5-global--LineHeight--sm, --pf-global--LineHeight--sm);\n --rte-h1-internal-FontSize: var(--pf-v5-global--FontSize--2xl, --pf-global--FontSize--2xl);\n --rte-h1-internal-FontWeight: var(--pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n --rte-h2-internal-LineHeight: var(--pf-v5-global--LineHeight--md, -pf-global--LineHeight--mD);\n --rte-h2-internal-FontSize: var(--pf-v5-global--FontSize--xl, --pf-global--FontSize--xl);\n --rte-h2-internal-FontWeight: var(--pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n --rte-h3-internal-LineHeight: var(--pf-v5-global--LineHeight--md, -pf-global--LineHeight--md);\n --rte-h3-internal-FontSize: var(--pf-v5-global--FontSize--lg, --pf-global--FontSize--lg);\n --rte-h3-internal-FontWeight: var(--pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n --rte-h4-internal-LineHeight: var(--pf-v5-global--LineHeight--md, --pf-global--LineHeight--md);\n --rte-h4-internal-FontSize: var(--pf-v5-global--FontSize--md, --pf-global--FontSize--md);\n --rte-h4-internal-FontWeight: var( --pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n}\n.rich-text-editor-custom .ck-editor__main {\n word-break: break-all;\n}\n.rich-text-editor-custom .ck-code-block-dropdown .ck-splitbutton__arrow {\n display: none;\n}\n.rich-text-editor-custom h1 {\n font-size: var(--rte-h1-internal-FontSize);\n font-weight: var(--rte-h1-internal-FontWeight);\n line-height: var(--rte-h1-internal-LineHeight);\n}\n.rich-text-editor-custom h2 {\n font-size: var(--rte-h2-internal-FontSize);\n font-weight: var(--rte-h2-internal-FontWeight);\n line-height: var(--rte-h2-internal-LineHeight);\n}\n.rich-text-editor-custom h3 {\n font-size: var(--rte-h3-internal-FontSize);\n font-weight: var(--rte-h3-internal-FontWeight);\n line-height: var(--rte-h3-internal-LineHeight);\n}\n.rich-text-editor-custom h4 {\n font-size: var(--rte-h4-internal-FontSize);\n font-weight: var(--rte-h4-internal-FontWeight);\n line-height: var(--rte-h4-internal-LineHeight);\n}\n.rich-text-editor-custom ul {\n display: block;\n list-style-type: disc;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n -webkit-margin-end: 0;\n margin-inline-end: 0;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}\n.rich-text-editor-custom ul li {\n display: list-item;\n}\n.rich-text-editor-custom ul ul {\n list-style-type: circle;\n -webkit-margin-before: 0;\n margin-block-start: 0;\n -webkit-margin-after: 0;\n margin-block-end: 0;\n}\n.rich-text-editor-custom ol {\n display: block;\n list-style-type: decimal;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n -webkit-margin-end: 0;\n margin-inline-end: 0;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}";
31
31
 
32
32
  var RichTextEditor = function RichTextEditor(_ref) {
33
33
  var value = _ref.value,
@@ -128,36 +128,38 @@ function _objectWithoutPropertiesLoose(source, excluded) {
128
128
  return target;
129
129
  }
130
130
 
131
- var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-c-form__helper-text--FontSize);\n margin-top: var(--pf-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-c-form--m-error--Color);\n}";
132
- var _excluded$1 = ["children", "helperTextInvalid", "isValid", "helperText", "labelIcon", "onClick"];
131
+ var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-v5-c-form__helper-text--FontSize);\n margin-top: var(--pf-v5-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-v5-c-form--m-error--Color);\n}";
133
132
 
134
- var FormGroupContainer = function FormGroupContainer(_ref) {
135
- var children = _ref.children,
136
- helperTextInvalid = _ref.helperTextInvalid,
137
- isValid = _ref.isValid,
138
- helperText = _ref.helperText,
139
- labelIcon = _ref.labelIcon,
140
- onClick = _ref.onClick,
133
+ const _excluded$1 = ["children", "helperTextInvalid", "validated", "helperText", "labelIcon", "onClick"];
134
+
135
+ const FormGroupContainer = _ref => {
136
+ let {
137
+ children,
138
+ helperTextInvalid,
139
+ validated,
140
+ helperText,
141
+ labelIcon,
142
+ onClick
143
+ } = _ref,
141
144
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
142
145
 
143
146
  InsertCss();
144
147
  return React__namespace.createElement(reactCore.FormGroup, Object.assign({
145
- className: 'form-group',
146
- helperTextInvalid: helperTextInvalid,
147
- helperText: helperText,
148
- validated: isValid ? reactCore.ValidatedOptions["default"] : reactCore.ValidatedOptions.error
148
+ className: 'form-group'
149
149
  }, labelIcon && {
150
150
  labelIcon: labelIcon
151
151
  }, onClick && {
152
- onClick: onClick
153
- }, rest), children);
152
+ onClick
153
+ }, rest), children, React__namespace.createElement(reactCore.FormHelperText, null, React__namespace.createElement(reactCore.HelperText, null, React__namespace.createElement(reactCore.HelperTextItem, {
154
+ variant: validated
155
+ }, validated === reactCore.ValidatedOptions.error ? helperTextInvalid : helperText))));
154
156
  };
155
157
 
156
- var InsertCss = function InsertCss() {
157
- var styleId = 'form-group-component-style';
158
+ const InsertCss = () => {
159
+ const styleId = 'form-group-component-style';
158
160
 
159
161
  if (!document.getElementById(styleId)) {
160
- var styleTag = document.createElement('style');
162
+ const styleTag = document.createElement('style');
161
163
  styleTag.id = styleId;
162
164
  styleTag.type = 'text/css';
163
165
  styleTag.innerHTML = css_248z;
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { CKEditor } from '@ckeditor/ckeditor5-react';
3
3
  import ClassicEditor from '@rhc-shared-components/rhc-ckeditor';
4
- import { FormGroup, ValidatedOptions } from '@patternfly/react-core';
4
+ import { FormGroup, FormHelperText, HelperText, HelperTextItem, ValidatedOptions } from '@patternfly/react-core';
5
5
  import { useField, useFormikContext } from 'formik';
6
6
 
7
- var css_248z$1 = ".rich-text-editor-custom {\n --pf-c-title--m-2xl--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-title--m-2xl--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-title--m-2xl--FontWeight: var(--pf-global--FontWeight--normal);\n --pf-c-title--m-xl--LineHeight: var(--pf-global--LineHeight--md);\n --pf-c-title--m-xl--FontSize: var(--pf-global--FontSize--xl);\n --pf-c-title--m-xl--FontWeight: var(--pf-global--FontWeight--normal);\n --pf-c-title--m-lg--LineHeight: var(--pf-global--LineHeight--md);\n --pf-c-title--m-lg--FontSize: var(--pf-global--FontSize--lg);\n --pf-c-title--m-lg--FontWeight: var(--pf-global--FontWeight--normal);\n --pf-c-title--m-md--LineHeight: var(--pf-global--LineHeight--md);\n --pf-c-title--m-md--FontSize: var(--pf-global--FontSize--md);\n --pf-c-title--m-md--FontWeight: var(--pf-global--FontWeight--normal);\n}\n.rich-text-editor-custom .ck-editor__main {\n word-break: break-all;\n}\n.rich-text-editor-custom .ck-code-block-dropdown .ck-splitbutton__arrow {\n display: none;\n}\n.rich-text-editor-custom h1 {\n font-size: var(--pf-c-title--m-2xl--FontSize);\n font-weight: var(--pf-c-title--m-2xl--FontWeight);\n line-height: var(--pf-c-title--m-2xl--LineHeight);\n}\n.rich-text-editor-custom h2 {\n font-size: var(--pf-c-title--m-xl--FontSize);\n font-weight: var(--pf-c-title--m-xl--FontWeight);\n line-height: var(--pf-c-title--m-xl--LineHeight);\n}\n.rich-text-editor-custom h3 {\n font-size: var(--pf-c-title--m-lg--FontSize);\n font-weight: var(--pf-c-title--m-lg--FontWeight);\n line-height: var(--pf-c-title--m-lg--LineHeight);\n}\n.rich-text-editor-custom h4 {\n font-size: var(--pf-c-title--m-md--FontSize);\n font-weight: var(--pf-c-title--m-md--FontWeight);\n line-height: var(--pf-c-title--m-md--LineHeight);\n}\n.rich-text-editor-custom ul {\n display: block;\n list-style-type: disc;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0px;\n margin-inline-start: 0px;\n -webkit-margin-end: 0px;\n margin-inline-end: 0px;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}\n.rich-text-editor-custom ul li {\n display: list-item;\n}\n.rich-text-editor-custom ul ul {\n list-style-type: circle;\n -webkit-margin-before: 0px;\n margin-block-start: 0px;\n -webkit-margin-after: 0px;\n margin-block-end: 0px;\n}\n.rich-text-editor-custom ol {\n display: block;\n list-style-type: decimal;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0px;\n margin-inline-start: 0px;\n -webkit-margin-end: 0px;\n margin-inline-end: 0px;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}";
7
+ var css_248z$1 = ".rich-text-editor-custom {\n --rte-h1-internal-LineHeight: var(--pf-v5-global--LineHeight--sm, --pf-global--LineHeight--sm);\n --rte-h1-internal-FontSize: var(--pf-v5-global--FontSize--2xl, --pf-global--FontSize--2xl);\n --rte-h1-internal-FontWeight: var(--pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n --rte-h2-internal-LineHeight: var(--pf-v5-global--LineHeight--md, -pf-global--LineHeight--mD);\n --rte-h2-internal-FontSize: var(--pf-v5-global--FontSize--xl, --pf-global--FontSize--xl);\n --rte-h2-internal-FontWeight: var(--pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n --rte-h3-internal-LineHeight: var(--pf-v5-global--LineHeight--md, -pf-global--LineHeight--md);\n --rte-h3-internal-FontSize: var(--pf-v5-global--FontSize--lg, --pf-global--FontSize--lg);\n --rte-h3-internal-FontWeight: var(--pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n --rte-h4-internal-LineHeight: var(--pf-v5-global--LineHeight--md, --pf-global--LineHeight--md);\n --rte-h4-internal-FontSize: var(--pf-v5-global--FontSize--md, --pf-global--FontSize--md);\n --rte-h4-internal-FontWeight: var( --pf-v5-global--FontWeight--normal, --pf-global--FontWeight--normal);\n}\n.rich-text-editor-custom .ck-editor__main {\n word-break: break-all;\n}\n.rich-text-editor-custom .ck-code-block-dropdown .ck-splitbutton__arrow {\n display: none;\n}\n.rich-text-editor-custom h1 {\n font-size: var(--rte-h1-internal-FontSize);\n font-weight: var(--rte-h1-internal-FontWeight);\n line-height: var(--rte-h1-internal-LineHeight);\n}\n.rich-text-editor-custom h2 {\n font-size: var(--rte-h2-internal-FontSize);\n font-weight: var(--rte-h2-internal-FontWeight);\n line-height: var(--rte-h2-internal-LineHeight);\n}\n.rich-text-editor-custom h3 {\n font-size: var(--rte-h3-internal-FontSize);\n font-weight: var(--rte-h3-internal-FontWeight);\n line-height: var(--rte-h3-internal-LineHeight);\n}\n.rich-text-editor-custom h4 {\n font-size: var(--rte-h4-internal-FontSize);\n font-weight: var(--rte-h4-internal-FontWeight);\n line-height: var(--rte-h4-internal-LineHeight);\n}\n.rich-text-editor-custom ul {\n display: block;\n list-style-type: disc;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n -webkit-margin-end: 0;\n margin-inline-end: 0;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}\n.rich-text-editor-custom ul li {\n display: list-item;\n}\n.rich-text-editor-custom ul ul {\n list-style-type: circle;\n -webkit-margin-before: 0;\n margin-block-start: 0;\n -webkit-margin-after: 0;\n margin-block-end: 0;\n}\n.rich-text-editor-custom ol {\n display: block;\n list-style-type: decimal;\n -webkit-margin-before: 1em;\n margin-block-start: 1em;\n -webkit-margin-after: 1em;\n margin-block-end: 1em;\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n -webkit-margin-end: 0;\n margin-inline-end: 0;\n -webkit-padding-start: 40px;\n padding-inline-start: 40px;\n}";
8
8
 
9
9
  const RichTextEditor = ({
10
10
  value,
@@ -105,14 +105,15 @@ function _objectWithoutPropertiesLoose(source, excluded) {
105
105
  return target;
106
106
  }
107
107
 
108
- var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-c-form__helper-text--FontSize);\n margin-top: var(--pf-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-c-form--m-error--Color);\n}";
109
- const _excluded$1 = ["children", "helperTextInvalid", "isValid", "helperText", "labelIcon", "onClick"];
108
+ var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-v5-c-form__helper-text--FontSize);\n margin-top: var(--pf-v5-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-v5-c-form--m-error--Color);\n}";
109
+
110
+ const _excluded$1 = ["children", "helperTextInvalid", "validated", "helperText", "labelIcon", "onClick"];
110
111
 
111
112
  const FormGroupContainer = _ref => {
112
113
  let {
113
114
  children,
114
115
  helperTextInvalid,
115
- isValid,
116
+ validated,
116
117
  helperText,
117
118
  labelIcon,
118
119
  onClick
@@ -121,15 +122,14 @@ const FormGroupContainer = _ref => {
121
122
 
122
123
  InsertCss();
123
124
  return React.createElement(FormGroup, Object.assign({
124
- className: 'form-group',
125
- helperTextInvalid: helperTextInvalid,
126
- helperText: helperText,
127
- validated: isValid ? ValidatedOptions.default : ValidatedOptions.error
125
+ className: 'form-group'
128
126
  }, labelIcon && {
129
127
  labelIcon: labelIcon
130
128
  }, onClick && {
131
129
  onClick
132
- }, rest), children);
130
+ }, rest), children, React.createElement(FormHelperText, null, React.createElement(HelperText, null, React.createElement(HelperTextItem, {
131
+ variant: validated
132
+ }, validated === ValidatedOptions.error ? helperTextInvalid : helperText))));
133
133
  };
134
134
 
135
135
  const InsertCss = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/rich-text-editor",
3
- "version": "0.6.5",
3
+ "version": "1.0.0",
4
4
  "description": "WYSWYG Editor for Red Hat Certified Apps",
5
5
  "author": "gautamkrishnar",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "react-dom": ">=16.13.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@rhc-shared-components/form-group-container": "^0.3.2",
35
+ "@rhc-shared-components/form-group-container": "^1.0.1",
36
36
  "@testing-library/jest-dom": "^4.2.4",
37
37
  "@testing-library/react": "^9.5.0",
38
38
  "@testing-library/user-event": "^7.2.1",
@@ -70,11 +70,10 @@
70
70
  ],
71
71
  "dependencies": {
72
72
  "@ckeditor/ckeditor5-react": "^3.0.2",
73
- "@patternfly/react-core": "^4.276.6",
73
+ "@patternfly/react-core": "^5.3.3",
74
74
  "@rhc-shared-components/rhc-ckeditor": "^1.0.2",
75
75
  "formik": "^2.1.4",
76
76
  "react": "^16.13.1",
77
77
  "react-dom": "^16.13.1"
78
- },
79
- "gitHead": "67ea9dbf7065a51b8b3f4058f7820c109670f2a2"
78
+ }
80
79
  }