@lingxiteam/lcdp-ueditor-react 1.0.2 → 1.0.3-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.
- package/es/LcdpUeditor.js +3 -1
- package/es/tools/UeditorResourceLoader.d.ts +1 -1
- package/es/tools/UeditorResourceLoader.js +18 -7
- package/lib/LcdpUeditor.js +1 -3
- package/lib/tools/UeditorResourceLoader.d.ts +1 -1
- package/lib/tools/UeditorResourceLoader.js +15 -7
- package/package.json +1 -1
- package/ueditor-resource/dialogs/anchor/anchor.html +1 -1
- package/ueditor-resource/dialogs/attachment/attachment.css +2 -715
- package/ueditor-resource/dialogs/attachment/attachment.html +6 -6
- package/ueditor-resource/dialogs/attachment/attachment.js +2 -803
- package/ueditor-resource/dialogs/audio/audio.css +2 -878
- package/ueditor-resource/dialogs/audio/audio.js +2 -815
- package/ueditor-resource/dialogs/background/background.css +2 -192
- package/ueditor-resource/dialogs/background/background.html +3 -3
- package/ueditor-resource/dialogs/background/background.js +2 -370
- package/ueditor-resource/dialogs/contentimport/contentimport.html +3 -3
- package/ueditor-resource/dialogs/contentimport/contentimport.js +2 -91
- package/ueditor-resource/dialogs/emotion/emotion.css +2 -128
- package/ueditor-resource/dialogs/emotion/emotion.html +3 -3
- package/ueditor-resource/dialogs/emotion/emotion.js +2 -186
- package/ueditor-resource/dialogs/formula/formula.html +4 -4
- package/ueditor-resource/dialogs/formula/formula.js +2 -147
- package/ueditor-resource/dialogs/help/help.css +2 -36
- package/ueditor-resource/dialogs/help/help.html +3 -3
- package/ueditor-resource/dialogs/help/help.js +2 -57
- package/ueditor-resource/dialogs/image/image.css +2 -767
- package/ueditor-resource/dialogs/image/image.js +2 -1060
- package/ueditor-resource/dialogs/insertframe/insertframe.html +2 -2
- package/ueditor-resource/dialogs/internal.js +2 -81
- package/ueditor-resource/dialogs/preview/preview.html +2 -2
- package/ueditor-resource/dialogs/scrawl/scrawl.css +2 -323
- package/ueditor-resource/dialogs/scrawl/scrawl.html +3 -3
- package/ueditor-resource/dialogs/scrawl/scrawl.js +2 -682
- package/ueditor-resource/dialogs/searchreplace/searchreplace.html +2 -2
- package/ueditor-resource/dialogs/searchreplace/searchreplace.js +2 -174
- package/ueditor-resource/dialogs/spechars/spechars.html +2 -2
- package/ueditor-resource/dialogs/spechars/spechars.js +2 -86
- package/ueditor-resource/dialogs/table/edittable.css +2 -84
- package/ueditor-resource/dialogs/table/edittable.html +3 -3
- package/ueditor-resource/dialogs/table/edittable.js +2 -241
- package/ueditor-resource/dialogs/table/edittd.html +1 -1
- package/ueditor-resource/dialogs/table/edittip.html +1 -1
- package/ueditor-resource/dialogs/template/config.js +2 -42
- package/ueditor-resource/dialogs/template/template.css +2 -98
- package/ueditor-resource/dialogs/template/template.html +4 -4
- package/ueditor-resource/dialogs/template/template.js +2 -53
- package/ueditor-resource/dialogs/video/video.css +2 -908
- package/ueditor-resource/dialogs/video/video.js +2 -867
- package/ueditor-resource/dialogs/wordimage/wordimage.html +5 -5
- package/ueditor-resource/dialogs/wordimage/wordimage.js +2 -93
- package/ueditor-resource/lang/en/en.js +2 -686
- package/ueditor-resource/lang/zh-cn/zh-cn.js +2 -748
- package/ueditor-resource/lang/zh-tw/zh-tw.js +2 -748
- package/ueditor-resource/plugins/demo/demo.js +1 -3
- package/ueditor-resource/themes/default/css/ueditor.css +2 -2148
- package/ueditor-resource/themes/default/dialog.css +2 -16
- package/ueditor-resource/themes/default/dialogbase.css +2 -131
- package/ueditor-resource/themes/iframe.css +2 -62
- package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +4 -3655
- package/ueditor-resource/third-party/SyntaxHighlighter/shCoreDefault.css +3 -1
- package/ueditor-resource/third-party/clipboard/clipboard.js +2 -753
- package/ueditor-resource/third-party/codemirror/codemirror.css +2 -105
- package/ueditor-resource/third-party/codemirror/codemirror.js +3 -3581
- package/ueditor-resource/third-party/jquery-3.5.1.js +4 -2
- package/ueditor-resource/third-party/jquery-3.5.1_1.js +4 -4314
- package/ueditor-resource/third-party/webuploader/webuploader.css +2 -87
- package/ueditor-resource/third-party/webuploader/webuploader.js +5 -4
- package/ueditor-resource/ueditor.all.js +20 -32644
- package/ueditor-resource/ueditor.config.js +2 -655
- package/ueditor-resource/ueditor.parse.js +2 -639
- package/es/LcdpUeditor.d.ts.map +0 -1
- package/es/const.d.ts.map +0 -1
- package/es/index.d.ts.map +0 -1
- package/es/tools/UeditorResourceLoader.d.ts.map +0 -1
- package/es/tools/filterHtmlNode.d.ts.map +0 -1
- package/es/tools/loadScript.d.ts.map +0 -1
- package/es/type.d.ts.map +0 -1
    
        package/es/LcdpUeditor.js
    CHANGED
    
    | @@ -324,7 +324,9 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) { | |
| 324 324 | 
             
                            });
         | 
| 325 325 | 
             
                            _this3.mountRef();
         | 
| 326 326 | 
             
                          });
         | 
| 327 | 
            -
             | 
| 327 | 
            +
             | 
| 328 | 
            +
                          // 默认配置 语言包 统一打包到 ueditor-all.js中
         | 
| 329 | 
            +
                          jsList = ["".concat(this.ueditorPath, "/").concat(DEFAULT_UEDITOR_CONFIG.UEDITOR_ALL)];
         | 
| 328 330 | 
             
                          UeditorResourceLoader.onLoadError(function () {
         | 
| 329 331 | 
             
                            _this3.setState({
         | 
| 330 332 | 
             
                              initError: true
         | 
| @@ -1,9 +1,9 @@ | |
| 1 1 | 
             
            declare class UeditorResourceLoader {
         | 
| 2 2 | 
             
                private static instance;
         | 
| 3 | 
            +
                private static ueditorIsLoad;
         | 
| 3 4 | 
             
                private callbackList;
         | 
| 4 5 | 
             
                private errorCallbackList;
         | 
| 5 6 | 
             
                private isReady;
         | 
| 6 | 
            -
                private loading;
         | 
| 7 7 | 
             
                private initError;
         | 
| 8 8 | 
             
                static startLoad(jsList: string[]): Promise<void>;
         | 
| 9 9 | 
             
                static getInstance(): UeditorResourceLoader;
         | 
| @@ -10,10 +10,17 @@ var UeditorResourceLoader = /*#__PURE__*/function () { | |
| 10 10 | 
             
                _defineProperty(this, "callbackList", []);
         | 
| 11 11 | 
             
                _defineProperty(this, "errorCallbackList", []);
         | 
| 12 12 | 
             
                _defineProperty(this, "isReady", false);
         | 
| 13 | 
            -
                _defineProperty(this, "loading", false);
         | 
| 14 13 | 
             
                _defineProperty(this, "initError", false);
         | 
| 15 14 | 
             
              }
         | 
| 16 15 | 
             
              _createClass(UeditorResourceLoader, null, [{
         | 
| 16 | 
            +
                key: "ueditorIsLoad",
         | 
| 17 | 
            +
                value:
         | 
| 18 | 
            +
                // 编辑器已经加载
         | 
| 19 | 
            +
                function ueditorIsLoad() {
         | 
| 20 | 
            +
                  var _window;
         | 
| 21 | 
            +
                  return !!((_window = window) !== null && _window !== void 0 && (_window = _window.UE) !== null && _window !== void 0 && _window.getEditor);
         | 
| 22 | 
            +
                }
         | 
| 23 | 
            +
              }, {
         | 
| 17 24 | 
             
                key: "startLoad",
         | 
| 18 25 | 
             
                value: function () {
         | 
| 19 26 | 
             
                  var _startLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(jsList) {
         | 
| @@ -22,19 +29,19 @@ var UeditorResourceLoader = /*#__PURE__*/function () { | |
| 22 29 | 
             
                      while (1) switch (_context.prev = _context.next) {
         | 
| 23 30 | 
             
                        case 0:
         | 
| 24 31 | 
             
                          inst = this.getInstance();
         | 
| 25 | 
            -
                          if (!(! | 
| 32 | 
            +
                          if (!(!window.loadingUE && !inst.isReady || inst.initError)) {
         | 
| 26 33 | 
             
                            _context.next = 14;
         | 
| 27 34 | 
             
                            break;
         | 
| 28 35 | 
             
                          }
         | 
| 29 | 
            -
                           | 
| 36 | 
            +
                          window.loadingUE = true;
         | 
| 30 37 | 
             
                          inst.initError = false;
         | 
| 31 38 | 
             
                          _context.prev = 4;
         | 
| 32 39 | 
             
                          _context.next = 7;
         | 
| 33 40 | 
             
                          return loadScriptSync(jsList);
         | 
| 34 41 | 
             
                        case 7:
         | 
| 35 | 
            -
                          if ( | 
| 42 | 
            +
                          if (UeditorResourceLoader.ueditorIsLoad()) {
         | 
| 36 43 | 
             
                            inst.isReady = true;
         | 
| 37 | 
            -
                             | 
| 44 | 
            +
                            window.loadingUE = false;
         | 
| 38 45 |  | 
| 39 46 | 
             
                            // 执行callback中的回调函数
         | 
| 40 47 | 
             
                            while (inst.callbackList.length) {
         | 
| @@ -42,7 +49,7 @@ var UeditorResourceLoader = /*#__PURE__*/function () { | |
| 42 49 | 
             
                              cb && cb();
         | 
| 43 50 | 
             
                            }
         | 
| 44 51 | 
             
                          } else {
         | 
| 45 | 
            -
                             | 
| 52 | 
            +
                            window.loadingUE = false;
         | 
| 46 53 | 
             
                            inst.isReady = false;
         | 
| 47 54 | 
             
                            inst.initError = true;
         | 
| 48 55 | 
             
                            while (inst.errorCallbackList.length) {
         | 
| @@ -55,7 +62,7 @@ var UeditorResourceLoader = /*#__PURE__*/function () { | |
| 55 62 | 
             
                        case 10:
         | 
| 56 63 | 
             
                          _context.prev = 10;
         | 
| 57 64 | 
             
                          _context.t0 = _context["catch"](4);
         | 
| 58 | 
            -
                           | 
| 65 | 
            +
                          window.loadingUE = false;
         | 
| 59 66 | 
             
                          inst.isReady = false;
         | 
| 60 67 | 
             
                        case 14:
         | 
| 61 68 | 
             
                        case "end":
         | 
| @@ -74,6 +81,10 @@ var UeditorResourceLoader = /*#__PURE__*/function () { | |
| 74 81 | 
             
                  if (!this.instance) {
         | 
| 75 82 | 
             
                    this.instance = new UeditorResourceLoader();
         | 
| 76 83 | 
             
                  }
         | 
| 84 | 
            +
                  if (UeditorResourceLoader.ueditorIsLoad()) {
         | 
| 85 | 
            +
                    this.instance.isReady = true;
         | 
| 86 | 
            +
                    window.loadingUE = false;
         | 
| 87 | 
            +
                  }
         | 
| 77 88 | 
             
                  return this.instance;
         | 
| 78 89 | 
             
                }
         | 
| 79 90 |  | 
    
        package/lib/LcdpUeditor.js
    CHANGED
    
    | @@ -252,9 +252,7 @@ var LcdpUeditor = class extends import_react.default.Component { | |
| 252 252 | 
             
                  this.mountRef();
         | 
| 253 253 | 
             
                });
         | 
| 254 254 | 
             
                const jsList = [
         | 
| 255 | 
            -
                  `${this.ueditorPath}/${import_const.DEFAULT_UEDITOR_CONFIG. | 
| 256 | 
            -
                  `${this.ueditorPath}/${import_const.DEFAULT_UEDITOR_CONFIG.UEDITOR_ALL}`,
         | 
| 257 | 
            -
                  `${this.ueditorPath}/${import_const.DEFAULT_UEDITOR_CONFIG.GET_UEDITOR_LANG(this.props.lang || "zh-cn")}`
         | 
| 255 | 
            +
                  `${this.ueditorPath}/${import_const.DEFAULT_UEDITOR_CONFIG.UEDITOR_ALL}`
         | 
| 258 256 | 
             
                ];
         | 
| 259 257 | 
             
                import_UeditorResourceLoader.default.onLoadError(() => {
         | 
| 260 258 | 
             
                  this.setState({
         | 
| @@ -1,9 +1,9 @@ | |
| 1 1 | 
             
            declare class UeditorResourceLoader {
         | 
| 2 2 | 
             
                private static instance;
         | 
| 3 | 
            +
                private static ueditorIsLoad;
         | 
| 3 4 | 
             
                private callbackList;
         | 
| 4 5 | 
             
                private errorCallbackList;
         | 
| 5 6 | 
             
                private isReady;
         | 
| 6 | 
            -
                private loading;
         | 
| 7 7 | 
             
                private initError;
         | 
| 8 8 | 
             
                static startLoad(jsList: string[]): Promise<void>;
         | 
| 9 9 | 
             
                static getInstance(): UeditorResourceLoader;
         | 
| @@ -28,25 +28,29 @@ var UeditorResourceLoader = class { | |
| 28 28 | 
             
                this.callbackList = [];
         | 
| 29 29 | 
             
                this.errorCallbackList = [];
         | 
| 30 30 | 
             
                this.isReady = false;
         | 
| 31 | 
            -
                this.loading = false;
         | 
| 32 31 | 
             
                this.initError = false;
         | 
| 33 32 | 
             
              }
         | 
| 33 | 
            +
              // 编辑器已经加载
         | 
| 34 | 
            +
              static ueditorIsLoad() {
         | 
| 35 | 
            +
                var _a;
         | 
| 36 | 
            +
                return !!((_a = window == null ? void 0 : window.UE) == null ? void 0 : _a.getEditor);
         | 
| 37 | 
            +
              }
         | 
| 34 38 | 
             
              static async startLoad(jsList) {
         | 
| 35 39 | 
             
                const inst = this.getInstance();
         | 
| 36 | 
            -
                if (! | 
| 37 | 
            -
                   | 
| 40 | 
            +
                if (!window.loadingUE && !inst.isReady || inst.initError) {
         | 
| 41 | 
            +
                  window.loadingUE = true;
         | 
| 38 42 | 
             
                  inst.initError = false;
         | 
| 39 43 | 
             
                  try {
         | 
| 40 44 | 
             
                    await (0, import_loadScript.loadScriptSync)(jsList);
         | 
| 41 | 
            -
                    if ( | 
| 45 | 
            +
                    if (UeditorResourceLoader.ueditorIsLoad()) {
         | 
| 42 46 | 
             
                      inst.isReady = true;
         | 
| 43 | 
            -
                       | 
| 47 | 
            +
                      window.loadingUE = false;
         | 
| 44 48 | 
             
                      while (inst.callbackList.length) {
         | 
| 45 49 | 
             
                        const cb = inst.callbackList.pop();
         | 
| 46 50 | 
             
                        cb && cb();
         | 
| 47 51 | 
             
                      }
         | 
| 48 52 | 
             
                    } else {
         | 
| 49 | 
            -
                       | 
| 53 | 
            +
                      window.loadingUE = false;
         | 
| 50 54 | 
             
                      inst.isReady = false;
         | 
| 51 55 | 
             
                      inst.initError = true;
         | 
| 52 56 | 
             
                      while (inst.errorCallbackList.length) {
         | 
| @@ -55,7 +59,7 @@ var UeditorResourceLoader = class { | |
| 55 59 | 
             
                      }
         | 
| 56 60 | 
             
                    }
         | 
| 57 61 | 
             
                  } catch (error) {
         | 
| 58 | 
            -
                     | 
| 62 | 
            +
                    window.loadingUE = false;
         | 
| 59 63 | 
             
                    inst.isReady = false;
         | 
| 60 64 | 
             
                  }
         | 
| 61 65 | 
             
                }
         | 
| @@ -64,6 +68,10 @@ var UeditorResourceLoader = class { | |
| 64 68 | 
             
                if (!this.instance) {
         | 
| 65 69 | 
             
                  this.instance = new UeditorResourceLoader();
         | 
| 66 70 | 
             
                }
         | 
| 71 | 
            +
                if (UeditorResourceLoader.ueditorIsLoad()) {
         | 
| 72 | 
            +
                  this.instance.isReady = true;
         | 
| 73 | 
            +
                  window.loadingUE = false;
         | 
| 74 | 
            +
                }
         | 
| 67 75 | 
             
                return this.instance;
         | 
| 68 76 | 
             
              }
         | 
| 69 77 | 
             
              /**
         | 
    
        package/package.json
    CHANGED
    
    
| @@ -37,7 +37,7 @@ | |
| 37 37 | 
             
            <div class="content">
         | 
| 38 38 | 
             
                <span><var id="lang_input_anchorName"></var></span><input id="anchorName" value=""/>
         | 
| 39 39 | 
             
            </div>
         | 
| 40 | 
            -
            <script type="text/javascript" src="../internal.js? | 
| 40 | 
            +
            <script type="text/javascript" src="../internal.js?04dbe7f0"></script>
         | 
| 41 41 | 
             
            <script type="text/javascript">
         | 
| 42 42 | 
             
                var anchorInput = $G('anchorName'),
         | 
| 43 43 | 
             
                    node = editor.selection.getRange().getClosedNode();
         |