easy-email-pro-theme 1.6.2 → 1.7.1

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.
Files changed (2) hide show
  1. package/lib/index.js +9 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2273,8 +2273,9 @@ const SlateField$2 = (props) => {
2273
2273
  type: get(source, "type", null)
2274
2274
  });
2275
2275
  let fallbackValue = propsFallbackValue;
2276
+ const currentValue = get(source, props.name);
2276
2277
  if (isUndefined$1(fallbackValue)) {
2277
- fallbackValue = props.name ? get(source, props.name, get(defaultElement, props.name)) : source || defaultElement;
2278
+ fallbackValue = props.name ? currentValue || get(defaultElement, props.name) : source || defaultElement;
2278
2279
  }
2279
2280
  const { setFieldValue } = useEditorContext();
2280
2281
  const onChangeHandle = useRefState((value, ...args) => {
@@ -2296,6 +2297,13 @@ const SlateField$2 = (props) => {
2296
2297
  }
2297
2298
  initedRef.current = true;
2298
2299
  }, [fallbackValue, fieldName, form, formItemFieldValue]);
2300
+ useEffect(() => {
2301
+ if (!initedRef.current)
2302
+ return;
2303
+ if (!isEqual$3(currentValue, formItemFieldValue)) {
2304
+ form.setFieldValue(fieldName, currentValue);
2305
+ }
2306
+ }, [currentValue, fieldName, form, formItemFieldValue]);
2299
2307
  return /* @__PURE__ */ React__default.createElement(
2300
2308
  Form.Item,
2301
2309
  __spreadProps(__spreadValues({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.6.2",
3
+ "version": "1.7.1",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"