@webiny/ui 5.26.0-beta.2 → 5.27.0-beta.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/ImageUpload/styled.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ export declare const AddImageWrapperRound: import("@emotion/styled-base").Styled
|
|
|
4
4
|
theme?: object | undefined;
|
|
5
5
|
} & {
|
|
6
6
|
children?: import("react").ReactNode;
|
|
7
|
-
}, "
|
|
7
|
+
}, "theme" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
9
9
|
}, Pick<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Pick<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
10
|
theme?: object | undefined;
|
|
11
11
|
} & {
|
|
12
12
|
children?: import("react").ReactNode;
|
|
13
|
-
}, "
|
|
13
|
+
}, "theme" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
14
14
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
15
15
|
}, "theme" | keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
16
16
|
export declare const RemoveImage: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OutputBlockData, OutputData, SanitizerConfig, ToolSettings } from "@editorjs/editorjs
|
|
2
|
+
import { OutputBlockData, OutputData, SanitizerConfig, ToolSettings } from "@editorjs/editorjs";
|
|
3
3
|
import { FormComponentProps } from "@webiny/form";
|
|
4
4
|
export interface OnReadyParams {
|
|
5
5
|
editor: any;
|
|
6
6
|
initialData: OutputData;
|
|
7
7
|
}
|
|
8
|
+
export declare type RichTextEditorValue = OutputBlockData[];
|
|
8
9
|
export interface RichTextEditorProps {
|
|
9
10
|
autofocus?: boolean;
|
|
10
11
|
context?: {
|
|
@@ -12,7 +13,7 @@ export interface RichTextEditorProps {
|
|
|
12
13
|
};
|
|
13
14
|
logLevel?: string;
|
|
14
15
|
minHeight?: number;
|
|
15
|
-
onChange?: (data:
|
|
16
|
+
onChange?: (data: RichTextEditorValue) => void;
|
|
16
17
|
onReady?: (params: OnReadyParams) => void;
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
readOnly?: boolean;
|
|
@@ -20,7 +21,7 @@ export interface RichTextEditorProps {
|
|
|
20
21
|
tools?: {
|
|
21
22
|
[toolName: string]: ToolSettings;
|
|
22
23
|
};
|
|
23
|
-
value?:
|
|
24
|
+
value?: RichTextEditorValue;
|
|
24
25
|
label?: string;
|
|
25
26
|
description?: string;
|
|
26
27
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RichTextEditor.tsx"],"names":["React","Fragment","useEffect","useRef","shortid","EditorJS","FormElementMessage","css","classNames","classes","wrapper","backgroundColor","padding","label","marginBottom","disable","opacity","pointerEvents","RichTextEditor","props","elementId","generate","editorRef","value","context","onReady","nativeProps","initialData","blocks","current","holder","logLevel","data","onChange","save","editor","tools","Object","keys","reduce","name","tool","config","destroy","description","disabled","validation","className","isValid","message"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,OAAOC,OAAP,MAAoB,SAApB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AAQA,SAASC,kBAAT;AACA,SAASC,GAAT,QAAoB,SAApB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAGA,IAAMC,OAAO,GAAG;AACZC,EAAAA,OAAO,eAAEH,GAAG,CAAC;AACTI,IAAAA,eAAe,EAAE,6BADR;AAETC,IAAAA,OAAO,EAAE;AAFA,GAAD,mBADA;AAKZC,EAAAA,KAAK,eAAEN,GAAG,CAAC;AACPO,IAAAA,YAAY,EAAE;AADP,GAAD,iBALE;AAQZC,EAAAA,OAAO,eAAER,GAAG,CAAC;AACTS,IAAAA,OAAO,EAAE,GADA;AAETC,IAAAA,aAAa,EAAE;AAFN,GAAD;AARA,CAAhB;
|
|
1
|
+
{"version":3,"sources":["RichTextEditor.tsx"],"names":["React","Fragment","useEffect","useRef","shortid","EditorJS","FormElementMessage","css","classNames","classes","wrapper","backgroundColor","padding","label","marginBottom","disable","opacity","pointerEvents","RichTextEditor","props","elementId","generate","editorRef","value","context","onReady","nativeProps","initialData","blocks","current","holder","logLevel","data","onChange","save","editor","tools","Object","keys","reduce","name","tool","config","destroy","description","disabled","validation","className","isValid","message"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,OAAOC,OAAP,MAAoB,SAApB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AAQA,SAASC,kBAAT;AACA,SAASC,GAAT,QAAoB,SAApB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAGA,IAAMC,OAAO,GAAG;AACZC,EAAAA,OAAO,eAAEH,GAAG,CAAC;AACTI,IAAAA,eAAe,EAAE,6BADR;AAETC,IAAAA,OAAO,EAAE;AAFA,GAAD,mBADA;AAKZC,EAAAA,KAAK,eAAEN,GAAG,CAAC;AACPO,IAAAA,YAAY,EAAE;AADP,GAAD,iBALE;AAQZC,EAAAA,OAAO,eAAER,GAAG,CAAC;AACTS,IAAAA,OAAO,EAAE,GADA;AAETC,IAAAA,aAAa,EAAE;AAFN,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R;AAAA,MAAe+B,WAAf,GAAgEzB,KAAhE,CAAeyB,WAAf;AAAA,MAA4BC,QAA5B,GAAgE1B,KAAhE,CAA4B0B,QAA5B;AAAA,MAAsCC,UAAtC,GAAgE3B,KAAhE,CAAsC2B,UAAtC;AAAA,MAAkDC,SAAlD,GAAgE5B,KAAhE,CAAkD4B,SAAlD;AAEA,sBACI,oBAAC,QAAD,qBACI;AACI,IAAA,SAAS,EAAEvC,UAAU,CAACC,OAAO,CAACC,OAAT,EAAkBqC,SAAlB,sBAAgCtC,OAAO,CAACM,OAAxC,EAAkD8B,QAAlD;AADzB,KAGKhC,KAAK,iBACF;AACI,IAAA,SAAS,EAAEL,UAAU,CACjB,mEADiB,EAEjBC,OAAO,CAACI,KAFS;AADzB,KAMKA,KANL,CAJR,eAaI;AAAK,IAAA,EAAE,EAAEO,SAAS,CAACS;AAAnB,IAbJ,CADJ,EAgBKiB,UAAU,IAAIA,UAAU,CAACE,OAAX,KAAuB,KAArC,iBACG,oBAAC,kBAAD;AAAoB,IAAA,KAAK;AAAzB,KAA2BF,UAAU,CAACG,OAAtC,CAjBR,EAmBKH,UAAU,IAAIA,UAAU,CAACE,OAAX,KAAuB,KAArC,IAA8CJ,WAA9C,iBACG,oBAAC,kBAAD,QAAqBA,WAArB,CApBR,CADJ;AAyBH,CAlFM","sourcesContent":["import React, { Fragment, useEffect, useRef } from \"react\";\nimport shortid from \"shortid\";\nimport EditorJS from \"@editorjs/editorjs\";\nimport {\n LogLevels,\n OutputBlockData,\n OutputData,\n SanitizerConfig,\n ToolSettings\n} from \"@editorjs/editorjs\";\nimport { FormElementMessage } from \"~/FormElementMessage\";\nimport { css } from \"emotion\";\nimport classNames from \"classnames\";\nimport { FormComponentProps } from \"@webiny/form\";\n\nconst classes = {\n wrapper: css({\n backgroundColor: \"var(--mdc-theme-background)\",\n padding: \"20px 16px 6px\"\n }),\n label: css({\n marginBottom: \"10px !important\"\n }),\n disable: css({\n opacity: 0.7,\n pointerEvents: \"none\"\n })\n};\n\ninterface EditorJSType {\n destroy?: () => void;\n save: () => Promise<any>;\n}\n\nexport interface OnReadyParams {\n editor: any;\n initialData: OutputData;\n}\n\nexport type RichTextEditorValue = OutputBlockData[];\n\nexport interface RichTextEditorProps {\n autofocus?: boolean;\n context?: { [key: string]: any };\n logLevel?: string;\n minHeight?: number;\n onChange?: (data: RichTextEditorValue) => void;\n onReady?: (params: OnReadyParams) => void;\n placeholder?: string;\n readOnly?: boolean;\n sanitizer?: SanitizerConfig;\n tools?: {\n [toolName: string]: ToolSettings;\n };\n value?: RichTextEditorValue;\n label?: string;\n description?: string;\n disabled?: boolean;\n validation?: FormComponentProps[\"validation\"];\n className?: string;\n}\n\nexport const RichTextEditor: React.FC<RichTextEditorProps> = props => {\n const elementId = useRef(\"rte-\" + shortid.generate());\n const editorRef = useRef<EditorJSType>();\n\n useEffect(() => {\n const { value, context, onReady, ...nativeProps } = props;\n const initialData = value ? { blocks: value } : { blocks: [] };\n\n editorRef.current = new EditorJS({\n ...nativeProps,\n holder: elementId.current,\n logLevel: \"ERROR\" as LogLevels.ERROR,\n data: initialData,\n onChange: async () => {\n if (!editorRef.current) {\n return;\n }\n const { blocks: data } = await editorRef.current.save();\n if (!props.onChange) {\n return;\n }\n props.onChange(data);\n },\n onReady() {\n if (typeof onReady !== \"function\") {\n return;\n }\n onReady({ editor: editorRef.current, initialData });\n },\n tools: Object.keys(props.tools || {}).reduce((tools, name) => {\n const tool = props.tools ? props.tools[name] : null;\n if (!tool) {\n return tools;\n }\n tools[name] = tool;\n if (!tool.config) {\n tool.config = { context };\n } else if (typeof tool.config === \"function\") {\n tool.config = tool.config();\n } else {\n tool.config = { ...tool.config, context };\n }\n return tools;\n }, {} as Record<string, ToolSettings>)\n });\n\n return () => {\n if (!editorRef.current || typeof editorRef.current.destroy !== \"function\") {\n return;\n }\n\n editorRef.current.destroy();\n };\n }, []);\n\n const { label, description, disabled, validation, className } = props;\n\n return (\n <Fragment>\n <div\n className={classNames(classes.wrapper, className, { [classes.disable]: disabled })}\n >\n {label && (\n <div\n className={classNames(\n \"mdc-text-field-helper-text mdc-text-field-helper-text--persistent\",\n classes.label\n )}\n >\n {label}\n </div>\n )}\n <div id={elementId.current} />\n </div>\n {validation && validation.isValid === false && (\n <FormElementMessage error>{validation.message}</FormElementMessage>\n )}\n {validation && validation.isValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </Fragment>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["createPropsFromConfig"],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["createPropsFromConfig"],"mappings":"AAAA;AAEA,SAASA,qBAAT","sourcesContent":["export * from \"./RichTextEditor\";\nexport type { RichTextEditorProps, OnReadyParams, RichTextEditorValue } from \"./RichTextEditor\";\nexport { createPropsFromConfig } from \"./createPropsFromConfig\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.27.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "7.16.7",
|
|
18
|
-
"@editorjs/editorjs": "2.
|
|
18
|
+
"@editorjs/editorjs": "2.24.3",
|
|
19
19
|
"@emotion/core": "10.3.1",
|
|
20
20
|
"@emotion/styled": "10.3.0",
|
|
21
21
|
"@material/base": "3.1.0",
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"@types/react-custom-scrollbars": "^4.0.10",
|
|
92
92
|
"@types/react-transition-group": "^4.4.4",
|
|
93
93
|
"@types/shortid": "^0.0.29",
|
|
94
|
-
"@webiny/cli": "^5.
|
|
95
|
-
"@webiny/form": "^5.
|
|
96
|
-
"@webiny/project-utils": "^5.
|
|
97
|
-
"@webiny/storybook-utils": "^5.
|
|
98
|
-
"@webiny/validation": "^5.
|
|
94
|
+
"@webiny/cli": "^5.27.0-beta.0",
|
|
95
|
+
"@webiny/form": "^5.27.0-beta.0",
|
|
96
|
+
"@webiny/project-utils": "^5.27.0-beta.0",
|
|
97
|
+
"@webiny/storybook-utils": "^5.27.0-beta.0",
|
|
98
|
+
"@webiny/validation": "^5.27.0-beta.0",
|
|
99
99
|
"babel-loader": "^8.0.0-beta.6",
|
|
100
100
|
"babel-plugin-emotion": "^9.2.8",
|
|
101
101
|
"execa": "^5.0.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "9e557dd294ae37cf84f17e0e8158c2ed16e2d415"
|
|
146
146
|
}
|