@lingxiteam/ebe-utils 0.3.25 → 0.3.26

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.
@@ -8,17 +8,20 @@ import React, { useMemo, useRef } from 'react';
8
8
  import { DEFAULT_TOOLBARS, DEFAULT_TOOLBARS_GROUP } from './const';
9
9
  import IdleContainer from '../utils/IdleContainer';
10
10
 
11
- const LcdpUeditorMain: LingXiFC <{[key: string]: any}> = (props => {
11
+ const LcdpUeditorMain: LingXiFC<{ [key: string]: any }> = (props) => {
12
12
  const { value, onChange, style, className, rootRef: ref, funcTypes, pasteplain = false, name } = props;
13
13
  const editorRef = useRef<ILcdpUeditorInst | null>(null);
14
14
 
15
15
  const engineApis = props.getEngineApis();
16
16
  const { getLocale, lang } = useLocale(engineApis);
17
+ const { onlySyncValue } = engineApis;
17
18
 
18
19
  const { disabled, required, readOnly, formFieldsRef } = useCommonImperativeHandle(ref, props, {
19
- setValue: (val:string) => {
20
+ setValue: (val: string) => {
20
21
  if (editorRef.current) {
21
22
  editorRef.current.setContent(val);
23
+ // 同步 hoc vlaue使用,解决值不同步问题
24
+ onlySyncValue(val);
22
25
  } else {
23
26
  // 编辑器未挂载先设置到value
24
27
  onChange(val);
@@ -75,7 +78,7 @@ const LcdpUeditorMain: LingXiFC <{[key: string]: any}> = (props => {
75
78
  return 'zh-cn';
76
79
  }
77
80
  }, [lang]);
78
-
81
+
79
82
  return (
80
83
  <IdleContainer>
81
84
  <FormFields
@@ -131,6 +134,6 @@ const LcdpUeditorMain: LingXiFC <{[key: string]: any}> = (props => {
131
134
  </FormFields>
132
135
  </IdleContainer>
133
136
  );
134
- });
137
+ };
135
138
 
136
139
  export default LcdpUeditorMain;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/ebe-utils",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -19,7 +19,7 @@
19
19
  "@babel/types": "^7.12.12",
20
20
  "cac": "^6.7.14",
21
21
  "fs-extra": "9.x",
22
- "@lingxiteam/ebe": "0.3.25"
22
+ "@lingxiteam/ebe": "0.3.26"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public"