@blocklet/editor 2.0.191 → 2.0.192
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.
|
@@ -14,4 +14,4 @@ export interface MarkdownEditorProps extends Omit<React.DetailedHTMLProps<React.
|
|
|
14
14
|
enableHeadingsIdPlugin?: boolean;
|
|
15
15
|
mediaUrlPrefix?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare function MarkdownEditor(
|
|
17
|
+
export declare function MarkdownEditor(props: MarkdownEditorProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from '@emotion/css';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
|
@@ -10,7 +10,10 @@ import nodes from './nodes';
|
|
|
10
10
|
import { useCustomTheme } from '../themes/customTheme';
|
|
11
11
|
import { MarkdownEditorThemeProvider } from './theme';
|
|
12
12
|
import { TRANSFORMERS } from './transformers';
|
|
13
|
-
export function MarkdownEditor(
|
|
13
|
+
export function MarkdownEditor(props) {
|
|
14
|
+
return (_jsxs(MarkdownEditorThemeProvider, { children: [_jsx(InnerMarkdownEditor, { ...props }), ";"] }));
|
|
15
|
+
}
|
|
16
|
+
function InnerMarkdownEditor({ editorState, editable = true, ...props }) {
|
|
14
17
|
const theme = useCustomTheme();
|
|
15
18
|
const initialConfig = {
|
|
16
19
|
namespace: 'MarkdownEditor',
|
|
@@ -35,7 +38,7 @@ function EditorShell({ placeholder, children, editable, onChange, autoFocus, sho
|
|
|
35
38
|
editor.focus();
|
|
36
39
|
}
|
|
37
40
|
}, []);
|
|
38
|
-
return (_jsx(
|
|
41
|
+
return (_jsx(EditorRoot, { ...props, className: cx(props.className, 'be-shell'), ref: shellRef, onClick: onShellClick, children: _jsx(Editor, { onChange: onChange, placeholder: placeholder, autoFocus: autoFocus, showToolbar: showToolbar, editorRef: editorRef, onReady: onReady, enableHeadingsIdPlugin: enableHeadingsIdPlugin, mediaUrlPrefix: mediaUrlPrefix, children: children }) }));
|
|
39
42
|
}
|
|
40
43
|
const EditorRoot = styled.div `
|
|
41
44
|
margin: 0 auto;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.192",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react-popper": "^2.3.0",
|
|
65
65
|
"ufo": "^1.5.4",
|
|
66
66
|
"url-join": "^4.0.1",
|
|
67
|
-
"@blocklet/pdf": "^2.0.
|
|
67
|
+
"@blocklet/pdf": "^2.0.192"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/core": "^7.25.2",
|