@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.5 → 1.0.3-alpha.7

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/es/LcdpUeditor.js CHANGED
@@ -318,12 +318,12 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
318
318
  case 0:
319
319
  UeditorResourceLoader.onReady(function () {
320
320
  _this3.initConfig();
321
- var target = document.getElementById(_this3.containerId);
322
- if (!window.UE || !target) {
323
- return;
324
- }
325
- _this3.ueditorInst = window.UE.getEditor(target, _this3.editorConfig);
321
+ _this3.ueditorInst = window.UE.getEditor(_this3.containerId, _this3.editorConfig);
326
322
  _this3.ueditorInst.ready(function () {
323
+ var nextValue = filterHtmlNode(_this3.props.value || '').str;
324
+ if (nextValue) {
325
+ _this3.ueditorInst.setContent(nextValue);
326
+ }
327
327
  _this3.isReady = true;
328
328
  // 禁用状态设置
329
329
  if (_this3.props.disabled) {
@@ -344,8 +344,8 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
344
344
  editorBody.addEventListener('compositionend', _this3.compositionEndHandler);
345
345
  }
346
346
  _this3.initStyle();
347
+ _this3.mountRef();
347
348
  });
348
- _this3.mountRef();
349
349
  });
350
350
  // 默认配置 语言包 统一打包到 ueditor-all.js中
351
351
  jsList = ["".concat(this.ueditorPath, "/").concat(DEFAULT_UEDITOR_CONFIG.UEDITOR_ALL)];
@@ -241,12 +241,12 @@ var LcdpUeditor = class extends import_react.default.Component {
241
241
  async initUeditor() {
242
242
  import_UeditorResourceLoader.default.onReady(() => {
243
243
  this.initConfig();
244
- const target = document.getElementById(this.containerId);
245
- if (!window.UE || !target) {
246
- return;
247
- }
248
- this.ueditorInst = window.UE.getEditor(target, this.editorConfig);
244
+ this.ueditorInst = window.UE.getEditor(this.containerId, this.editorConfig);
249
245
  this.ueditorInst.ready(() => {
246
+ const nextValue = (0, import_filterHtmlNode.filterHtmlNode)(this.props.value || "").str;
247
+ if (nextValue) {
248
+ this.ueditorInst.setContent(nextValue);
249
+ }
250
250
  this.isReady = true;
251
251
  if (this.props.disabled) {
252
252
  this.ueditorInst.setDisabled();
@@ -264,8 +264,8 @@ var LcdpUeditor = class extends import_react.default.Component {
264
264
  editorBody.addEventListener("compositionend", this.compositionEndHandler);
265
265
  }
266
266
  this.initStyle();
267
+ this.mountRef();
267
268
  });
268
- this.mountRef();
269
269
  });
270
270
  const jsList = [
271
271
  `${this.ueditorPath}/${import_const.DEFAULT_UEDITOR_CONFIG.UEDITOR_ALL}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/lcdp-ueditor-react",
3
- "version": "1.0.3-alpha.5",
3
+ "version": "1.0.3-alpha.7",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",