@rhc-shared-components/rich-text-editor 2.0.5 → 3.0.1
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/README.md +11 -1
- package/dist/RichTextEditor.d.ts +16 -13
- package/dist/RichTextEditorFormComponent.d.ts +11 -11
- package/dist/assets/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3857 -4189
- package/package.json +61 -64
package/README.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# @rhc-shared-components/rich-text-editor
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> WYSIWYG Editor for Red Hat Certified Apps
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install --save @rhc-shared-components/rich-text-editor
|
|
9
9
|
```
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn dev # start dev server
|
|
15
|
+
yarn build # production build
|
|
16
|
+
yarn lint # check with Biome
|
|
17
|
+
yarn lint-fix # auto-fix with Biome
|
|
18
|
+
yarn format # format with Biome
|
|
19
|
+
```
|
package/dist/RichTextEditor.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
type RichTextEditorFunctionType = (value: string, event?:
|
|
1
|
+
import { FC } from '../node_modules/@types/react';
|
|
2
|
+
type RichTextEditorFunctionType = (value: string, event?: Event, editor?: CKEditorInstance) => void;
|
|
3
3
|
export interface RichTextEditorProps {
|
|
4
4
|
value: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
onReady?: (editor:
|
|
7
|
-
onChange?: RichTextEditorFunctionType;
|
|
8
|
-
onBlur?: RichTextEditorFunctionType;
|
|
9
|
-
onFocus?: RichTextEditorFunctionType;
|
|
10
|
-
onError?: (error:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
onReady?: ((editor: CKEditorInstance) => void) | undefined;
|
|
7
|
+
onChange?: RichTextEditorFunctionType | undefined;
|
|
8
|
+
onBlur?: RichTextEditorFunctionType | undefined;
|
|
9
|
+
onFocus?: RichTextEditorFunctionType | undefined;
|
|
10
|
+
onError?: ((error: Error, details?: {
|
|
11
|
+
phase: string;
|
|
12
|
+
willEditorRestart: boolean;
|
|
13
|
+
}) => void) | undefined;
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
showCodeBlock?: boolean | undefined;
|
|
17
|
+
ariaLabel?: string | undefined;
|
|
18
|
+
placeholder?: string | undefined;
|
|
16
19
|
}
|
|
17
20
|
declare const RichTextEditor: FC<RichTextEditorProps>;
|
|
18
21
|
export default RichTextEditor;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
1
|
+
import { FC, ReactNode } from '../node_modules/@types/react';
|
|
2
2
|
declare global {
|
|
3
3
|
interface Window {
|
|
4
|
-
ckeditorObj:
|
|
4
|
+
ckeditorObj: Record<string, CKEditorInstance>;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export interface RichTextEditorFormComponentProps {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
isRequired?: boolean;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
ariaLabel?: string;
|
|
14
|
-
helperText?: string;
|
|
15
|
-
showMaxLengthText?: boolean;
|
|
16
|
-
maxLength?: number;
|
|
17
|
-
showCodeBlock?: boolean;
|
|
18
|
-
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
isRequired?: boolean | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
ariaLabel?: string | undefined;
|
|
14
|
+
helperText?: string | undefined;
|
|
15
|
+
showMaxLengthText?: boolean | undefined;
|
|
16
|
+
maxLength?: number | undefined;
|
|
17
|
+
showCodeBlock?: boolean | undefined;
|
|
18
|
+
labelHelp?: ReactNode | undefined;
|
|
19
19
|
}
|
|
20
20
|
declare const RichTextEditorFormComponent: FC<RichTextEditorFormComponentProps>;
|
|
21
21
|
export default RichTextEditorFormComponent;
|
package/dist/assets/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rich-text-editor-custom{--rte-h1-internal-LineHeight: var(--pf-
|
|
1
|
+
.rich-text-editor-custom{--rte-h1-internal-LineHeight: var(--pf-v6-global--LineHeight--sm);--rte-h1-internal-FontSize: var(--pf-v6-global--FontSize--2xl);--rte-h1-internal-FontWeight: var(--pf-v6-global--FontWeight--normal);--rte-h2-internal-LineHeight: var(--pf-v6-global--LineHeight--md);--rte-h2-internal-FontSize: var(--pf-v6-global--FontSize--xl);--rte-h2-internal-FontWeight: var(--pf-v6-global--FontWeight--normal);--rte-h3-internal-LineHeight: var(--pf-v6-global--LineHeight--md);--rte-h3-internal-FontSize: var(--pf-v6-global--FontSize--lg);--rte-h3-internal-FontWeight: var(--pf-v6-global--FontWeight--normal);--rte-h4-internal-LineHeight: var(--pf-v6-global--LineHeight--md);--rte-h4-internal-FontSize: var(--pf-v6-global--FontSize--md);--rte-h4-internal-FontWeight: var(--pf-v6-global--FontWeight--normal)}.rich-text-editor-custom .ck-editor__main{word-break:break-all}.rich-text-editor-custom .ck-code-block-dropdown .ck-splitbutton__arrow{display:none}.rich-text-editor-custom h1{font-size:var(--rte-h1-internal-FontSize);font-weight:var(--rte-h1-internal-FontWeight);line-height:var(--rte-h1-internal-LineHeight)}.rich-text-editor-custom h2{font-size:var(--rte-h2-internal-FontSize);font-weight:var(--rte-h2-internal-FontWeight);line-height:var(--rte-h2-internal-LineHeight)}.rich-text-editor-custom h3{font-size:var(--rte-h3-internal-FontSize);font-weight:var(--rte-h3-internal-FontWeight);line-height:var(--rte-h3-internal-LineHeight)}.rich-text-editor-custom h4{font-size:var(--rte-h4-internal-FontSize);font-weight:var(--rte-h4-internal-FontWeight);line-height:var(--rte-h4-internal-LineHeight)}.rich-text-editor-custom ul{display:block;list-style-type:disc;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding-inline-start:40px}.rich-text-editor-custom ul li{display:list-item}.rich-text-editor-custom ul ul{list-style-type:circle;margin-block-start:0;margin-block-end:0}.rich-text-editor-custom--disabled{opacity:.6;pointer-events:none}.rich-text-editor-custom ol{display:block;list-style-type:decimal;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding-inline-start:40px}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { default as RichTextEditor } from './RichTextEditor';
|
|
2
2
|
import { default as RichTextEditorFormComponent } from './RichTextEditorFormComponent';
|
|
3
|
+
export type { RichTextEditorProps } from './RichTextEditor';
|
|
4
|
+
export type { RichTextEditorFormComponentProps } from './RichTextEditorFormComponent';
|
|
3
5
|
export { RichTextEditor, RichTextEditorFormComponent };
|