@lingxiteam/lcdp-ueditor-react 1.0.0-alpha.13 → 1.0.0-alpha.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.
@@ -1 +1 @@
1
- {"version":3,"file":"LcdpUeditor.d.ts","sourceRoot":"","sources":["LcdpUeditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAQhD,cAAM,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC;IAC9D;;OAEG;IACH,WAAW,EAAE,MAAM,CAAwB;IAE3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAwD;IAExE;;OAEG;IACH,OAAO,CAAC,YAAY,CAAwD;IAE5E;;OAEG;IACH,OAAO,CAAC,WAAW,CAAS;IAE5B;;OAEG;IACH,OAAO,CAAC,WAAW,CAAa;IAEhC;;OAEG;IACH,OAAO,CAAC,YAAY,CAAiB;IAErC;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAW;IAExC;;OAEG;IACH,OAAO,CAAC,cAAc,CAAc;IAEpC;;OAEG;IACH,OAAO,CAAC,cAAc,CAAM;IAE5B;;OAEG;IACH,OAAO,CAAC,OAAO,CAAkB;IAEjC;;OAEG;IACH,KAAK,EAAE,QAAQ,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAC,CAAC,CAEnC;IAEF;;OAEG;IACH,YAAY,EAAE,GAAG,CAAM;gBAEX,KAAK,EAAE,iBAAiB;IA0CpC,iBAAiB,IAAI,IAAI;IAIzB,yBAAyB,CAAC,SAAS,EAAE,iBAAiB;IAiBtD,oBAAoB,IAAI,IAAI;IAM5B,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,YAAY;IAOpB;;;;OAIG;YACW,UAAU;IAqCxB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAMhB;;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S;IAcjB;;OAEG;IACG,WAAW;IAiCjB,MAAM,IAAI,KAAK,CAAC,SAAS;CAY1B;AAED,eAAe,WAAW,CAAC"}
package/es/LcdpUeditor.js CHANGED
@@ -85,7 +85,8 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
85
85
  if (_this.props.ueditorPath) {
86
86
  _this.ueditorPath = _this.props.ueditorPath;
87
87
  }
88
- _this.currentContent = _this.props.value;
88
+ var nextValue = filterHtmlNode(_this.props.value || '');
89
+ _this.currentContent = nextValue;
89
90
  _this.uploadFunction = function (file, type) {
90
91
  var _this$props$config;
91
92
  // TODO 内置上传 图片base64
@@ -116,7 +117,7 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
116
117
  _this.fileSelect(cb, type);
117
118
  },
118
119
  uploadFunction: _this.uploadFunction,
119
- initialContent: _this.props.value || ''
120
+ initialContent: nextValue || ''
120
121
  });
121
122
  _this.debounceContentChange = debounce(_this.onContentChange.bind(_assertThisInitialized(_this)), 300);
122
123
  return _this;
@@ -132,7 +133,7 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
132
133
  if (this.isReady) {
133
134
  if ('value' in nextProps && this.currentContent !== nextProps.value) {
134
135
  this.isReportFlag = false;
135
- this.ueditorInst.setContent(nextProps.value || '');
136
+ this.ueditorInst.setContent(filterHtmlNode(nextProps.value || ''));
136
137
  }
137
138
  // 禁用操作需要调用指定的api进行操作
138
139
  if (nextProps.disabled !== this.props.disabled) {
@@ -158,8 +159,8 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
158
159
  if (!this.isReportFlag) {
159
160
  this.isReportFlag = true;
160
161
  } else if (this.props.onChange) {
161
- this.currentContent = this.ueditorInst.getContent();
162
- this.props.onChange(filterHtmlNode(this.currentContent));
162
+ this.currentContent = filterHtmlNode(this.ueditorInst.getContent() || '');
163
+ this.props.onChange(this.currentContent);
163
164
  }
164
165
  }
165
166
  }, {
@@ -84,7 +84,8 @@ var LcdpUeditor = class extends import_react.default.Component {
84
84
  if (this.props.ueditorPath) {
85
85
  this.ueditorPath = this.props.ueditorPath;
86
86
  }
87
- this.currentContent = this.props.value;
87
+ const nextValue = (0, import_filterHtmlNode.filterHtmlNode)(this.props.value || "");
88
+ this.currentContent = nextValue;
88
89
  this.uploadFunction = (file, type) => {
89
90
  var _a;
90
91
  if (type === "image" && ((_a = this.props.config) == null ? void 0 : _a.imageType) === "base64") {
@@ -112,7 +113,7 @@ var LcdpUeditor = class extends import_react.default.Component {
112
113
  this.fileSelect(cb, type);
113
114
  },
114
115
  uploadFunction: this.uploadFunction,
115
- initialContent: this.props.value || ""
116
+ initialContent: nextValue || ""
116
117
  };
117
118
  this.debounceContentChange = (0, import_lodash.debounce)(this.onContentChange.bind(this), 300);
118
119
  }
@@ -123,7 +124,7 @@ var LcdpUeditor = class extends import_react.default.Component {
123
124
  if (this.isReady) {
124
125
  if ("value" in nextProps && this.currentContent !== nextProps.value) {
125
126
  this.isReportFlag = false;
126
- this.ueditorInst.setContent(nextProps.value || "");
127
+ this.ueditorInst.setContent((0, import_filterHtmlNode.filterHtmlNode)(nextProps.value || ""));
127
128
  }
128
129
  if (nextProps.disabled !== this.props.disabled) {
129
130
  if (nextProps.disabled) {
@@ -144,8 +145,8 @@ var LcdpUeditor = class extends import_react.default.Component {
144
145
  if (!this.isReportFlag) {
145
146
  this.isReportFlag = true;
146
147
  } else if (this.props.onChange) {
147
- this.currentContent = this.ueditorInst.getContent();
148
- this.props.onChange((0, import_filterHtmlNode.filterHtmlNode)(this.currentContent));
148
+ this.currentContent = (0, import_filterHtmlNode.filterHtmlNode)(this.ueditorInst.getContent() || "");
149
+ this.props.onChange(this.currentContent);
149
150
  }
150
151
  }
151
152
  getExtString(str) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/lcdp-ueditor-react",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.14",
4
4
  "module": "es/index.js",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",