@fe-free/core 1.4.17 → 1.4.19
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/CHANGELOG.md +13 -0
- package/package.json +2 -2
- package/src/editor/editor.stories.tsx +1 -0
- package/src/editor/index.tsx +7 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-syntax-highlighter": "^15.5.0",
|
|
37
37
|
"vanilla-jsoneditor": "^0.23.1",
|
|
38
38
|
"zustand": "^4.5.4",
|
|
39
|
-
"@fe-free/tool": "1.4.
|
|
39
|
+
"@fe-free/tool": "1.4.19"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@ant-design/pro-components": "^2.8.7",
|
|
@@ -43,6 +43,7 @@ export const Wrap: Story = {
|
|
|
43
43
|
args: {
|
|
44
44
|
value:
|
|
45
45
|
'hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!',
|
|
46
|
+
lineWrapping: true,
|
|
46
47
|
},
|
|
47
48
|
render: (props) => <BasicDemo {...props} />,
|
|
48
49
|
};
|
package/src/editor/index.tsx
CHANGED
|
@@ -19,6 +19,7 @@ interface EditorProps {
|
|
|
19
19
|
|
|
20
20
|
height?: string;
|
|
21
21
|
width?: string;
|
|
22
|
+
lineWrapping?: boolean;
|
|
22
23
|
|
|
23
24
|
// 不对外
|
|
24
25
|
theme?: ReactCodeMirrorProps['theme'];
|
|
@@ -43,12 +44,17 @@ function Editor(props: EditorProps) {
|
|
|
43
44
|
placeholder,
|
|
44
45
|
height,
|
|
45
46
|
width,
|
|
47
|
+
lineWrapping,
|
|
46
48
|
theme = defaultTheme,
|
|
47
49
|
extensions: originExtensions,
|
|
48
50
|
} = props;
|
|
49
51
|
|
|
50
52
|
const extensions = useMemo(() => {
|
|
51
|
-
const result: ReactCodeMirrorProps['extensions'] = [
|
|
53
|
+
const result: ReactCodeMirrorProps['extensions'] = [];
|
|
54
|
+
|
|
55
|
+
if (lineWrapping) {
|
|
56
|
+
result.push(EditorView.lineWrapping);
|
|
57
|
+
}
|
|
52
58
|
|
|
53
59
|
if (originExtensions) {
|
|
54
60
|
result.push(...originExtensions);
|