@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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 1.4.19
4
+
5
+ ### Patch Changes
6
+
7
+ - @fe-free/tool@1.4.19
8
+
9
+ ## 1.4.18
10
+
11
+ ### Patch Changes
12
+
13
+ - feat: modify Editor
14
+ - @fe-free/tool@1.4.18
15
+
3
16
  ## 1.4.17
4
17
 
5
18
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "1.4.17",
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.17"
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
  };
@@ -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'] = [EditorView.lineWrapping];
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);