@easy-editor/react-renderer 0.0.12 → 0.0.14

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/dist/cjs/index.js CHANGED
@@ -1759,6 +1759,12 @@ function baseRendererFactory() {
1759
1759
  * execute method in schema.lifeCycles
1760
1760
  */
1761
1761
  __executeLifeCycleMethod = (method, args) => {
1762
+ const {
1763
+ engine
1764
+ } = this.context;
1765
+ if (!engine.props.enableStrictNotFoundMode) {
1766
+ return;
1767
+ }
1762
1768
  executeLifeCycleMethod(this, this.props.__schema, method, args);
1763
1769
  };
1764
1770
 
@@ -1912,7 +1918,7 @@ function baseRendererFactory() {
1912
1918
  engine
1913
1919
  } = this.context;
1914
1920
  if (engine) {
1915
- engine.props.onCompGetCtx(schema, this);
1921
+ engine.props?.onCompGetCtx?.(schema, this);
1916
1922
  // 画布场景才需要每次渲染bind自定义方法
1917
1923
  if (this.__designModeIsDesign) {
1918
1924
  this.__bindCustomMethods(this.props);
@@ -1929,7 +1935,7 @@ function baseRendererFactory() {
1929
1935
  } = this.props;
1930
1936
  // ref && engine?.props?.onCompGetRef(__schema, ref)
1931
1937
  // TODO: 只在 ref 存在执行,会影响 documentInstance 的卸载
1932
- engine?.props?.onCompGetRef(__schema, ref);
1938
+ engine.props?.onCompGetRef?.(__schema, ref);
1933
1939
  this.__ref = ref;
1934
1940
  };
1935
1941
  __createDom = () => {
@@ -2026,7 +2032,7 @@ function baseRendererFactory() {
2026
2032
  componentId: schema.id,
2027
2033
  enableStrictNotFoundMode: engine.props.enableStrictNotFoundMode,
2028
2034
  ref: ref => {
2029
- ref && engine.props?.onCompGetRef(schema, ref);
2035
+ ref && engine.props?.onCompGetRef?.(schema, ref);
2030
2036
  }
2031
2037
  }, this.__getSchemaChildrenVirtualDom(schema, scope, Comp));
2032
2038
  }
@@ -2101,7 +2107,7 @@ function baseRendererFactory() {
2101
2107
  if (refProps && typeof refProps === 'string') {
2102
2108
  this[refProps] = ref;
2103
2109
  }
2104
- ref && engine.props?.onCompGetRef(schema, ref);
2110
+ ref && engine.props?.onCompGetRef?.(schema, ref);
2105
2111
  };
2106
2112
 
2107
2113
  // scope需要传入到组件上
@@ -2110,7 +2116,7 @@ function baseRendererFactory() {
2110
2116
  // }
2111
2117
  if (schema?.__ctx?.lceKey) {
2112
2118
  if (!isSchema(schema)) {
2113
- engine.props?.onCompGetCtx(schema, scope);
2119
+ engine.props?.onCompGetCtx?.(schema, scope);
2114
2120
  }
2115
2121
  props.key = props.key || `${schema.__ctx.lceKey}_${schema.__ctx.idx || 0}_${idx !== undefined ? idx : ''}`;
2116
2122
  } else if ((typeof idx === 'number' || typeof idx === 'string') && !props.key) {
@@ -2595,7 +2601,8 @@ function rendererFactory() {
2595
2601
  suspended: false,
2596
2602
  schema: {},
2597
2603
  onCompGetRef: () => {},
2598
- onCompGetCtx: () => {}
2604
+ onCompGetCtx: () => {},
2605
+ excuteLifeCycleInDesignMode: false
2599
2606
  };
2600
2607
  constructor(props) {
2601
2608
  super(props);