@hailin-zheng/editor-core 1.1.27 → 1.1.28

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/index-cjs.js CHANGED
@@ -5992,11 +5992,14 @@ class ElementSerialize {
5992
5992
  * @param viewOptions
5993
5993
  */
5994
5994
  static serialize(element, viewOptions) {
5995
+ const result = element.serialize(viewOptions);
5996
+ if (!result) {
5997
+ return null;
5998
+ }
5999
+ if (result.complete) {
6000
+ return result;
6001
+ }
5995
6002
  if (element instanceof BranchElement) {
5996
- const result = element.serialize(viewOptions);
5997
- if (!result || result.complete) {
5998
- return result;
5999
- }
6000
6003
  result.children = [];
6001
6004
  let prevEle = null;
6002
6005
  for (let i = 0; i < element.length; i++) {
@@ -6011,9 +6014,6 @@ class ElementSerialize {
6011
6014
  if (serializeChild) {
6012
6015
  delete serializeChild.complete;
6013
6016
  serializeChild.props = serializeChild.props || {};
6014
- if (child.props && child.props['__attachedProperty']) {
6015
- serializeChild.props['__attachedProperty'] = CommonUtil.cloneValue(child.props['__attachedProperty']);
6016
- }
6017
6017
  if (Object.keys(serializeChild.props).length === 0) {
6018
6018
  delete serializeChild.props;
6019
6019
  }
@@ -6026,9 +6026,10 @@ class ElementSerialize {
6026
6026
  }
6027
6027
  return result;
6028
6028
  }
6029
- else {
6030
- return element.serialize(viewOptions);
6029
+ if (element.props && element.props['__attachedProperty'] && !result.props['__attachedProperty']) {
6030
+ result.props['__attachedProperty'] = CommonUtil.cloneValue(element.props['__attachedProperty']);
6031
6031
  }
6032
+ return result;
6032
6033
  }
6033
6034
  static serializeString(element, options = { all: false }) {
6034
6035
  if (!options.all && element instanceof TrackRunElement && element.type === exports.TrackRunTypeEnum.Deleted) {