@easy-editor/react-renderer 0.0.1 → 0.0.2-alpha.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.
@@ -359,7 +359,7 @@ const parseData = (schema, self, options = {}) => {
359
359
  return parseExpression({
360
360
  str: schema,
361
361
  self,
362
- thisRequired: options.thisRequiredInJSE,
362
+ thisRequired: true,
363
363
  logScope: options.logScope
364
364
  });
365
365
  }
@@ -1038,7 +1038,7 @@ const leafWrapper = (Comp, {
1038
1038
  /**
1039
1039
  * execute method in schema.lifeCycles with context
1040
1040
  */
1041
- function executeLifeCycleMethod(context, schema, method, args, thisRequiredInJSE) {
1041
+ function executeLifeCycleMethod(context, schema, method, args) {
1042
1042
  if (!context || !isSchema(schema) || !method) {
1043
1043
  return;
1044
1044
  }
@@ -1050,7 +1050,7 @@ function executeLifeCycleMethod(context, schema, method, args, thisRequiredInJSE
1050
1050
 
1051
1051
  // TODO: cache
1052
1052
  if (core.isJSExpression(fn) || core.isJSFunction(fn)) {
1053
- fn = thisRequiredInJSE ? parseThisRequiredExpression(fn, context) : parseExpression(fn, context);
1053
+ fn = parseExpression(fn, context, true);
1054
1054
  }
1055
1055
  if (typeof fn !== 'function') {
1056
1056
  logger.error(`生命周期${method}类型不符`, fn);
@@ -1116,7 +1116,6 @@ function baseRendererFactory() {
1116
1116
  return parseExpression({
1117
1117
  str,
1118
1118
  self,
1119
- thisRequired: props?.thisRequiredInJSE,
1120
1119
  logScope: props.componentName
1121
1120
  });
1122
1121
  };
@@ -1133,7 +1132,7 @@ function baseRendererFactory() {
1133
1132
  }
1134
1133
  __afterInit(props) {}
1135
1134
  static getDerivedStateFromProps(props, state) {
1136
- const result = executeLifeCycleMethod(this, props?.__schema, 'getDerivedStateFromProps', [props, state], props.thisRequiredInJSE);
1135
+ const result = executeLifeCycleMethod(this, props?.__schema, 'getDerivedStateFromProps', [props, state]);
1137
1136
  return result === undefined ? null : result;
1138
1137
  }
1139
1138
  async getSnapshotBeforeUpdate(...args) {
@@ -1189,7 +1188,7 @@ function baseRendererFactory() {
1189
1188
  * execute method in schema.lifeCycles
1190
1189
  */
1191
1190
  __executeLifeCycleMethod = (method, args) => {
1192
- executeLifeCycleMethod(this, this.props.__schema, method, args, this.props.thisRequiredInJSE);
1191
+ executeLifeCycleMethod(this, this.props.__schema, method, args);
1193
1192
  };
1194
1193
 
1195
1194
  /**
@@ -1245,11 +1244,9 @@ function baseRendererFactory() {
1245
1244
  __parseData = (data, ctx) => {
1246
1245
  const {
1247
1246
  __ctx,
1248
- thisRequiredInJSE,
1249
1247
  componentName
1250
1248
  } = this.props;
1251
1249
  return parseData(data, ctx || __ctx || this, {
1252
- thisRequiredInJSE,
1253
1250
  logScope: componentName
1254
1251
  });
1255
1252
  };
@@ -2019,8 +2016,7 @@ function rendererFactory() {
2019
2016
  suspended: false,
2020
2017
  schema: {},
2021
2018
  onCompGetRef: () => {},
2022
- onCompGetCtx: () => {},
2023
- thisRequiredInJSE: true
2019
+ onCompGetCtx: () => {}
2024
2020
  };
2025
2021
  constructor(props) {
2026
2022
  super(props);