@lingxiteam/lcdp-ueditor-react 1.0.0-alpha.17 → 1.0.0-alpha.18
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 +5 -5
- package/es/type.d.ts +1 -1
- package/lib/LcdpUeditor.js +5 -3
- package/lib/type.d.ts +1 -1
- package/package.json +1 -1
    
        package/es/LcdpUeditor.js
    CHANGED
    
    | @@ -80,9 +80,7 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) { | |
| 80 80 | 
             
                 * 编辑器配置项
         | 
| 81 81 | 
             
                 */
         | 
| 82 82 | 
             
                _defineProperty(_assertThisInitialized(_this), "editorConfig", {});
         | 
| 83 | 
            -
                var config = props.config | 
| 84 | 
            -
                  _props$toolbars = props.toolbars,
         | 
| 85 | 
            -
                  toolbars = _props$toolbars === void 0 ? [] : _props$toolbars;
         | 
| 83 | 
            +
                var config = props.config;
         | 
| 86 84 | 
             
                _this.containerId = "ueditor_".concat(Date.now(), "_").concat(String(Math.random()).slice(2, 6));
         | 
| 87 85 | 
             
                if (_this.props.ueditorPath) {
         | 
| 88 86 | 
             
                  _this.ueditorPath = _this.props.ueditorPath;
         | 
| @@ -119,8 +117,7 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) { | |
| 119 117 | 
             
                    _this.fileSelect(cb, type);
         | 
| 120 118 | 
             
                  },
         | 
| 121 119 | 
             
                  uploadFunction: _this.uploadFunction,
         | 
| 122 | 
            -
                  initialContent: nextValue || '' | 
| 123 | 
            -
                  toolbars: toolbars
         | 
| 120 | 
            +
                  initialContent: nextValue || ''
         | 
| 124 121 | 
             
                });
         | 
| 125 122 | 
             
                _this.debounceContentChange = debounce(_this.onContentChange.bind(_assertThisInitialized(_this)), 300);
         | 
| 126 123 | 
             
                return _this;
         | 
| @@ -308,6 +305,9 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) { | |
| 308 305 | 
             
                      while (1) switch (_context3.prev = _context3.next) {
         | 
| 309 306 | 
             
                        case 0:
         | 
| 310 307 | 
             
                          UeditorResourceLoader.onReady(function () {
         | 
| 308 | 
            +
                            if (_this3.props.toolbars) {
         | 
| 309 | 
            +
                              _this3.editorConfig.toolbars = _this3.props.toolbars;
         | 
| 310 | 
            +
                            }
         | 
| 311 311 | 
             
                            _this3.ueditorInst = window.UE.getEditor(_this3.containerId, _this3.editorConfig);
         | 
| 312 312 | 
             
                            _this3.ueditorInst.ready(function () {
         | 
| 313 313 | 
             
                              _this3.isReady = true;
         | 
    
        package/es/type.d.ts
    CHANGED
    
    
    
        package/lib/LcdpUeditor.js
    CHANGED
    
    | @@ -79,7 +79,7 @@ var LcdpUeditor = class extends import_react.default.Component { | |
| 79 79 | 
             
                 * 编辑器配置项
         | 
| 80 80 | 
             
                 */
         | 
| 81 81 | 
             
                this.editorConfig = {};
         | 
| 82 | 
            -
                const { config | 
| 82 | 
            +
                const { config } = props;
         | 
| 83 83 | 
             
                this.containerId = `ueditor_${Date.now()}_${String(Math.random()).slice(2, 6)}`;
         | 
| 84 84 | 
             
                if (this.props.ueditorPath) {
         | 
| 85 85 | 
             
                  this.ueditorPath = this.props.ueditorPath;
         | 
| @@ -113,8 +113,7 @@ var LcdpUeditor = class extends import_react.default.Component { | |
| 113 113 | 
             
                    this.fileSelect(cb, type);
         | 
| 114 114 | 
             
                  },
         | 
| 115 115 | 
             
                  uploadFunction: this.uploadFunction,
         | 
| 116 | 
            -
                  initialContent: nextValue || "" | 
| 117 | 
            -
                  toolbars
         | 
| 116 | 
            +
                  initialContent: nextValue || ""
         | 
| 118 117 | 
             
                };
         | 
| 119 118 | 
             
                this.debounceContentChange = (0, import_lodash.debounce)(this.onContentChange.bind(this), 300);
         | 
| 120 119 | 
             
              }
         | 
| @@ -226,6 +225,9 @@ var LcdpUeditor = class extends import_react.default.Component { | |
| 226 225 | 
             
               */
         | 
| 227 226 | 
             
              async initUeditor() {
         | 
| 228 227 | 
             
                import_UeditorResourceLoader.default.onReady(() => {
         | 
| 228 | 
            +
                  if (this.props.toolbars) {
         | 
| 229 | 
            +
                    this.editorConfig.toolbars = this.props.toolbars;
         | 
| 230 | 
            +
                  }
         | 
| 229 231 | 
             
                  this.ueditorInst = window.UE.getEditor(this.containerId, this.editorConfig);
         | 
| 230 232 | 
             
                  this.ueditorInst.ready(() => {
         | 
| 231 233 | 
             
                    this.isReady = true;
         | 
    
        package/lib/type.d.ts
    CHANGED