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