@lingxiteam/lcdp-ueditor-react 1.0.0-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.d.ts +74 -0
- package/es/LcdpUeditor.js +335 -0
- package/es/const.d.ts +12 -0
- package/es/const.js +19 -0
- package/es/defaultConfig.json +77 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +3 -0
- package/es/tools/UeditorResourceLoader.d.ts +21 -0
- package/es/tools/UeditorResourceLoader.js +114 -0
- package/es/tools/loadScript.d.ts +5 -0
- package/es/tools/loadScript.js +54 -0
- package/es/type.d.ts +142 -0
- package/es/type.js +1 -0
- package/package.json +32 -0
- package/ueditor-resource/dialogs/anchor/anchor.html +62 -0
- package/ueditor-resource/dialogs/attachment/attachment.css +716 -0
- package/ueditor-resource/dialogs/attachment/attachment.html +61 -0
- package/ueditor-resource/dialogs/attachment/attachment.js +803 -0
- package/ueditor-resource/dialogs/attachment/images/alignicon.gif +0 -0
- package/ueditor-resource/dialogs/attachment/images/alignicon.png +0 -0
- package/ueditor-resource/dialogs/attachment/images/bg.png +0 -0
- package/ueditor-resource/dialogs/attachment/images/file-icons.gif +0 -0
- package/ueditor-resource/dialogs/attachment/images/file-icons.png +0 -0
- package/ueditor-resource/dialogs/attachment/images/icons.gif +0 -0
- package/ueditor-resource/dialogs/attachment/images/icons.png +0 -0
- package/ueditor-resource/dialogs/attachment/images/image.png +0 -0
- package/ueditor-resource/dialogs/attachment/images/progress.png +0 -0
- package/ueditor-resource/dialogs/attachment/images/success.gif +0 -0
- package/ueditor-resource/dialogs/attachment/images/success.png +0 -0
- package/ueditor-resource/dialogs/audio/audio.css +879 -0
- package/ueditor-resource/dialogs/audio/audio.html +94 -0
- package/ueditor-resource/dialogs/audio/audio.js +815 -0
- package/ueditor-resource/dialogs/audio/icon/center-active.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/center.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/img.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/left-active.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/left.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/none-active.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/none.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/right-active.png +0 -0
- package/ueditor-resource/dialogs/audio/icon/right.png +0 -0
- package/ueditor-resource/dialogs/audio/images/bg.png +0 -0
- package/ueditor-resource/dialogs/audio/images/center_focus.jpg +0 -0
- package/ueditor-resource/dialogs/audio/images/file-icons.gif +0 -0
- package/ueditor-resource/dialogs/audio/images/file-icons.png +0 -0
- package/ueditor-resource/dialogs/audio/images/icons.gif +0 -0
- package/ueditor-resource/dialogs/audio/images/icons.png +0 -0
- package/ueditor-resource/dialogs/audio/images/image.png +0 -0
- package/ueditor-resource/dialogs/audio/images/left_focus.jpg +0 -0
- package/ueditor-resource/dialogs/audio/images/none_focus.jpg +0 -0
- package/ueditor-resource/dialogs/audio/images/progress.png +0 -0
- package/ueditor-resource/dialogs/audio/images/right_focus.jpg +0 -0
- package/ueditor-resource/dialogs/audio/images/success.gif +0 -0
- package/ueditor-resource/dialogs/audio/images/success.png +0 -0
- package/ueditor-resource/dialogs/background/background.css +193 -0
- package/ueditor-resource/dialogs/background/background.html +59 -0
- package/ueditor-resource/dialogs/background/background.js +370 -0
- package/ueditor-resource/dialogs/background/images/bg.png +0 -0
- package/ueditor-resource/dialogs/background/images/success.png +0 -0
- package/ueditor-resource/dialogs/contentimport/contentimport.html +176 -0
- package/ueditor-resource/dialogs/contentimport/contentimport.js +91 -0
- package/ueditor-resource/dialogs/emotion/emotion.css +129 -0
- package/ueditor-resource/dialogs/emotion/emotion.html +70 -0
- package/ueditor-resource/dialogs/emotion/emotion.js +186 -0
- package/ueditor-resource/dialogs/emotion/images/0.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/bface.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/cface.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/fface.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/jxface2.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
- package/ueditor-resource/dialogs/emotion/images/tface.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/wface.gif +0 -0
- package/ueditor-resource/dialogs/emotion/images/yface.gif +0 -0
- package/ueditor-resource/dialogs/formula/formula.html +98 -0
- package/ueditor-resource/dialogs/formula/formula.js +147 -0
- package/ueditor-resource/dialogs/help/help.css +37 -0
- package/ueditor-resource/dialogs/help/help.html +82 -0
- package/ueditor-resource/dialogs/help/help.js +57 -0
- package/ueditor-resource/dialogs/image/icon/center-active.png +0 -0
- package/ueditor-resource/dialogs/image/icon/center.png +0 -0
- package/ueditor-resource/dialogs/image/icon/img.png +0 -0
- package/ueditor-resource/dialogs/image/icon/left-active.png +0 -0
- package/ueditor-resource/dialogs/image/icon/left.png +0 -0
- package/ueditor-resource/dialogs/image/icon/none-active.png +0 -0
- package/ueditor-resource/dialogs/image/icon/none.png +0 -0
- package/ueditor-resource/dialogs/image/icon/right-active.png +0 -0
- package/ueditor-resource/dialogs/image/icon/right.png +0 -0
- package/ueditor-resource/dialogs/image/image.css +768 -0
- package/ueditor-resource/dialogs/image/image.html +145 -0
- package/ueditor-resource/dialogs/image/image.js +1060 -0
- package/ueditor-resource/dialogs/image/images/alignicon.jpg +0 -0
- package/ueditor-resource/dialogs/image/images/bg.png +0 -0
- package/ueditor-resource/dialogs/image/images/icons.gif +0 -0
- package/ueditor-resource/dialogs/image/images/icons.png +0 -0
- package/ueditor-resource/dialogs/image/images/image.png +0 -0
- package/ueditor-resource/dialogs/image/images/progress.png +0 -0
- package/ueditor-resource/dialogs/image/images/success.gif +0 -0
- package/ueditor-resource/dialogs/image/images/success.png +0 -0
- package/ueditor-resource/dialogs/insertframe/insertframe.html +135 -0
- package/ueditor-resource/dialogs/internal.js +81 -0
- package/ueditor-resource/dialogs/link/link.html +148 -0
- package/ueditor-resource/dialogs/preview/preview.html +45 -0
- package/ueditor-resource/dialogs/scrawl/images/addimg.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/brush.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/delimg.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/delimgH.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/empty.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/emptyH.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/eraser.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/redo.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/redoH.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/scale.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/scaleH.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/size.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/undo.png +0 -0
- package/ueditor-resource/dialogs/scrawl/images/undoH.png +0 -0
- package/ueditor-resource/dialogs/scrawl/scrawl.css +324 -0
- package/ueditor-resource/dialogs/scrawl/scrawl.html +95 -0
- package/ueditor-resource/dialogs/scrawl/scrawl.js +682 -0
- package/ueditor-resource/dialogs/searchreplace/searchreplace.html +144 -0
- package/ueditor-resource/dialogs/searchreplace/searchreplace.js +174 -0
- package/ueditor-resource/dialogs/spechars/spechars.html +42 -0
- package/ueditor-resource/dialogs/spechars/spechars.js +86 -0
- package/ueditor-resource/dialogs/table/dragicon.png +0 -0
- package/ueditor-resource/dialogs/table/edittable.css +85 -0
- package/ueditor-resource/dialogs/table/edittable.html +69 -0
- package/ueditor-resource/dialogs/table/edittable.js +241 -0
- package/ueditor-resource/dialogs/table/edittd.html +62 -0
- package/ueditor-resource/dialogs/table/edittip.html +33 -0
- package/ueditor-resource/dialogs/template/config.js +42 -0
- package/ueditor-resource/dialogs/template/images/bg.gif +0 -0
- package/ueditor-resource/dialogs/template/images/pre0.png +0 -0
- package/ueditor-resource/dialogs/template/images/pre1.png +0 -0
- package/ueditor-resource/dialogs/template/images/pre2.png +0 -0
- package/ueditor-resource/dialogs/template/images/pre3.png +0 -0
- package/ueditor-resource/dialogs/template/images/pre4.png +0 -0
- package/ueditor-resource/dialogs/template/template.css +99 -0
- package/ueditor-resource/dialogs/template/template.html +26 -0
- package/ueditor-resource/dialogs/template/template.js +53 -0
- package/ueditor-resource/dialogs/video/icon/center-active.png +0 -0
- package/ueditor-resource/dialogs/video/icon/center.png +0 -0
- package/ueditor-resource/dialogs/video/icon/img.png +0 -0
- package/ueditor-resource/dialogs/video/icon/left-active.png +0 -0
- package/ueditor-resource/dialogs/video/icon/left.png +0 -0
- package/ueditor-resource/dialogs/video/icon/none-active.png +0 -0
- package/ueditor-resource/dialogs/video/icon/none.png +0 -0
- package/ueditor-resource/dialogs/video/icon/right-active.png +0 -0
- package/ueditor-resource/dialogs/video/icon/right.png +0 -0
- package/ueditor-resource/dialogs/video/images/bg.png +0 -0
- package/ueditor-resource/dialogs/video/images/center_focus.jpg +0 -0
- package/ueditor-resource/dialogs/video/images/file-icons.gif +0 -0
- package/ueditor-resource/dialogs/video/images/file-icons.png +0 -0
- package/ueditor-resource/dialogs/video/images/icons.gif +0 -0
- package/ueditor-resource/dialogs/video/images/icons.png +0 -0
- package/ueditor-resource/dialogs/video/images/image.png +0 -0
- package/ueditor-resource/dialogs/video/images/left_focus.jpg +0 -0
- package/ueditor-resource/dialogs/video/images/none_focus.jpg +0 -0
- package/ueditor-resource/dialogs/video/images/progress.png +0 -0
- package/ueditor-resource/dialogs/video/images/right_focus.jpg +0 -0
- package/ueditor-resource/dialogs/video/images/success.gif +0 -0
- package/ueditor-resource/dialogs/video/images/success.png +0 -0
- package/ueditor-resource/dialogs/video/video.css +909 -0
- package/ueditor-resource/dialogs/video/video.html +115 -0
- package/ueditor-resource/dialogs/video/video.js +867 -0
- package/ueditor-resource/dialogs/wordimage/wordimage.html +221 -0
- package/ueditor-resource/dialogs/wordimage/wordimage.js +93 -0
- package/ueditor-resource/index.html +146 -0
- package/ueditor-resource/lang/en/en.js +686 -0
- package/ueditor-resource/lang/en/images/addimage.png +0 -0
- package/ueditor-resource/lang/en/images/alldeletebtnhoverskin.png +0 -0
- package/ueditor-resource/lang/en/images/alldeletebtnupskin.png +0 -0
- package/ueditor-resource/lang/en/images/background.png +0 -0
- package/ueditor-resource/lang/en/images/button.png +0 -0
- package/ueditor-resource/lang/en/images/copy.png +0 -0
- package/ueditor-resource/lang/en/images/deletedisable.png +0 -0
- package/ueditor-resource/lang/en/images/deleteenable.png +0 -0
- package/ueditor-resource/lang/en/images/listbackground.png +0 -0
- package/ueditor-resource/lang/en/images/localimage.png +0 -0
- package/ueditor-resource/lang/en/images/music.png +0 -0
- package/ueditor-resource/lang/en/images/rotateleftdisable.png +0 -0
- package/ueditor-resource/lang/en/images/rotateleftenable.png +0 -0
- package/ueditor-resource/lang/en/images/rotaterightdisable.png +0 -0
- package/ueditor-resource/lang/en/images/rotaterightenable.png +0 -0
- package/ueditor-resource/lang/en/images/upload.png +0 -0
- package/ueditor-resource/lang/zh-cn/images/copy.png +0 -0
- package/ueditor-resource/lang/zh-cn/images/localimage.png +0 -0
- package/ueditor-resource/lang/zh-cn/images/music.png +0 -0
- package/ueditor-resource/lang/zh-cn/images/upload.png +0 -0
- package/ueditor-resource/lang/zh-cn/zh-cn.js +748 -0
- package/ueditor-resource/plugins/demo/demo.js +3 -0
- package/ueditor-resource/themes/default/css/ueditor.css +2148 -0
- package/ueditor-resource/themes/default/dialog.css +17 -0
- package/ueditor-resource/themes/default/dialogbase.css +132 -0
- package/ueditor-resource/themes/default/exts/ai.svg +12 -0
- package/ueditor-resource/themes/default/exts/apk.svg +12 -0
- package/ueditor-resource/themes/default/exts/chm.svg +12 -0
- package/ueditor-resource/themes/default/exts/css.svg +12 -0
- package/ueditor-resource/themes/default/exts/doc.svg +22 -0
- package/ueditor-resource/themes/default/exts/docx.svg +22 -0
- package/ueditor-resource/themes/default/exts/dwg.svg +16 -0
- package/ueditor-resource/themes/default/exts/folder.svg +3 -0
- package/ueditor-resource/themes/default/exts/gif.svg +14 -0
- package/ueditor-resource/themes/default/exts/html.svg +12 -0
- package/ueditor-resource/themes/default/exts/jpeg.svg +14 -0
- package/ueditor-resource/themes/default/exts/jpg.svg +14 -0
- package/ueditor-resource/themes/default/exts/log.svg +12 -0
- package/ueditor-resource/themes/default/exts/mp3.svg +14 -0
- package/ueditor-resource/themes/default/exts/mp4.svg +12 -0
- package/ueditor-resource/themes/default/exts/pdf.svg +14 -0
- package/ueditor-resource/themes/default/exts/png.svg +14 -0
- package/ueditor-resource/themes/default/exts/ppt.svg +24 -0
- package/ueditor-resource/themes/default/exts/pptx.svg +24 -0
- package/ueditor-resource/themes/default/exts/psd.svg +12 -0
- package/ueditor-resource/themes/default/exts/rar.svg +12 -0
- package/ueditor-resource/themes/default/exts/svg.svg +12 -0
- package/ueditor-resource/themes/default/exts/torrent.svg +14 -0
- package/ueditor-resource/themes/default/exts/txt.svg +14 -0
- package/ueditor-resource/themes/default/exts/unknown.svg +12 -0
- package/ueditor-resource/themes/default/exts/xls.svg +25 -0
- package/ueditor-resource/themes/default/exts/xlsx.svg +25 -0
- package/ueditor-resource/themes/default/exts/zip.svg +12 -0
- package/ueditor-resource/themes/default/images/anchor.gif +0 -0
- package/ueditor-resource/themes/default/images/arrow.png +0 -0
- package/ueditor-resource/themes/default/images/arrow_down.png +0 -0
- package/ueditor-resource/themes/default/images/arrow_up.png +0 -0
- package/ueditor-resource/themes/default/images/button-bg.gif +0 -0
- package/ueditor-resource/themes/default/images/cancelbutton.gif +0 -0
- package/ueditor-resource/themes/default/images/charts.png +0 -0
- package/ueditor-resource/themes/default/images/cursor_h.gif +0 -0
- package/ueditor-resource/themes/default/images/cursor_h.png +0 -0
- package/ueditor-resource/themes/default/images/cursor_v.gif +0 -0
- package/ueditor-resource/themes/default/images/cursor_v.png +0 -0
- package/ueditor-resource/themes/default/images/dialog-title-bg.png +0 -0
- package/ueditor-resource/themes/default/images/filescan.png +0 -0
- package/ueditor-resource/themes/default/images/highlighted.gif +0 -0
- package/ueditor-resource/themes/default/images/icons-all.gif +0 -0
- package/ueditor-resource/themes/default/images/icons.gif +0 -0
- package/ueditor-resource/themes/default/images/icons.png +0 -0
- package/ueditor-resource/themes/default/images/img-cracked.png +0 -0
- package/ueditor-resource/themes/default/images/loaderror.png +0 -0
- package/ueditor-resource/themes/default/images/loading.gif +0 -0
- package/ueditor-resource/themes/default/images/lock.gif +0 -0
- package/ueditor-resource/themes/default/images/neweditor-tab-bg.png +0 -0
- package/ueditor-resource/themes/default/images/pagebreak.gif +0 -0
- package/ueditor-resource/themes/default/images/scale.png +0 -0
- package/ueditor-resource/themes/default/images/sortable.png +0 -0
- package/ueditor-resource/themes/default/images/spacer.gif +0 -0
- package/ueditor-resource/themes/default/images/sparator_v.png +0 -0
- package/ueditor-resource/themes/default/images/table-cell-align.png +0 -0
- package/ueditor-resource/themes/default/images/tangram-colorpicker.png +0 -0
- package/ueditor-resource/themes/default/images/toolbar_bg.png +0 -0
- package/ueditor-resource/themes/default/images/unhighlighted.gif +0 -0
- package/ueditor-resource/themes/default/images/upload.png +0 -0
- package/ueditor-resource/themes/default/images/videologo.gif +0 -0
- package/ueditor-resource/themes/default/images/word.gif +0 -0
- package/ueditor-resource/themes/default/images/wordpaste.png +0 -0
- package/ueditor-resource/themes/iframe.css +63 -0
- package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +3655 -0
- package/ueditor-resource/third-party/SyntaxHighlighter/shCoreDefault.css +1 -0
- package/ueditor-resource/third-party/clipboard/clipboard.js +753 -0
- package/ueditor-resource/third-party/clipboard/clipboard.swf +0 -0
- package/ueditor-resource/third-party/codemirror/codemirror.css +106 -0
- package/ueditor-resource/third-party/codemirror/codemirror.js +3581 -0
- package/ueditor-resource/third-party/jquery-3.5.1.js +2 -0
- package/ueditor-resource/third-party/jquery-3.5.1_1.js +4314 -0
- package/ueditor-resource/third-party/webuploader/webuploader.css +88 -0
- package/ueditor-resource/third-party/webuploader/webuploader.js +4 -0
- package/ueditor-resource/third-party/zeroclipboard/ZeroClipboard.js +1256 -0
- package/ueditor-resource/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
- package/ueditor-resource/ueditor.all.js +32643 -0
- package/ueditor-resource/ueditor.config.js +656 -0
- package/ueditor-resource/ueditor.parse.js +639 -0
| @@ -0,0 +1,114 @@ | |
| 1 | 
            +
            function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
         | 
| 2 | 
            +
            function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
         | 
| 3 | 
            +
            function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
         | 
| 4 | 
            +
            function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
         | 
| 5 | 
            +
            function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
         | 
| 6 | 
            +
            function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
         | 
| 7 | 
            +
            function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
         | 
| 8 | 
            +
            function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         | 
| 9 | 
            +
            function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
         | 
| 10 | 
            +
            function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
         | 
| 11 | 
            +
            import { loadScriptSync } from "./loadScript";
         | 
| 12 | 
            +
            var UeditorResourceLoader = /*#__PURE__*/function () {
         | 
| 13 | 
            +
              function UeditorResourceLoader() {
         | 
| 14 | 
            +
                _classCallCheck(this, UeditorResourceLoader);
         | 
| 15 | 
            +
                _defineProperty(this, "callbackList", []);
         | 
| 16 | 
            +
                _defineProperty(this, "errorCallbackList", []);
         | 
| 17 | 
            +
                _defineProperty(this, "isReady", false);
         | 
| 18 | 
            +
                _defineProperty(this, "loading", false);
         | 
| 19 | 
            +
                _defineProperty(this, "initError", false);
         | 
| 20 | 
            +
              }
         | 
| 21 | 
            +
              _createClass(UeditorResourceLoader, null, [{
         | 
| 22 | 
            +
                key: "startLoad",
         | 
| 23 | 
            +
                value: function () {
         | 
| 24 | 
            +
                  var _startLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(jsList) {
         | 
| 25 | 
            +
                    var inst, cb, _cb;
         | 
| 26 | 
            +
                    return _regeneratorRuntime().wrap(function _callee$(_context) {
         | 
| 27 | 
            +
                      while (1) switch (_context.prev = _context.next) {
         | 
| 28 | 
            +
                        case 0:
         | 
| 29 | 
            +
                          inst = this.getInstance();
         | 
| 30 | 
            +
                          if (!(!inst.loading && !inst.isReady || inst.initError)) {
         | 
| 31 | 
            +
                            _context.next = 14;
         | 
| 32 | 
            +
                            break;
         | 
| 33 | 
            +
                          }
         | 
| 34 | 
            +
                          inst.loading = true;
         | 
| 35 | 
            +
                          inst.initError = false;
         | 
| 36 | 
            +
                          _context.prev = 4;
         | 
| 37 | 
            +
                          _context.next = 7;
         | 
| 38 | 
            +
                          return loadScriptSync(jsList);
         | 
| 39 | 
            +
                        case 7:
         | 
| 40 | 
            +
                          if (window.UE) {
         | 
| 41 | 
            +
                            inst.isReady = true;
         | 
| 42 | 
            +
                            inst.loading = false;
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                            // 执行callback中的回调函数
         | 
| 45 | 
            +
                            while (inst.callbackList.length) {
         | 
| 46 | 
            +
                              cb = inst.callbackList.pop();
         | 
| 47 | 
            +
                              cb && cb();
         | 
| 48 | 
            +
                            }
         | 
| 49 | 
            +
                          } else {
         | 
| 50 | 
            +
                            inst.loading = false;
         | 
| 51 | 
            +
                            inst.isReady = false;
         | 
| 52 | 
            +
                            inst.initError = true;
         | 
| 53 | 
            +
                            while (inst.errorCallbackList.length) {
         | 
| 54 | 
            +
                              _cb = inst.errorCallbackList.pop();
         | 
| 55 | 
            +
                              _cb && _cb();
         | 
| 56 | 
            +
                            }
         | 
| 57 | 
            +
                          }
         | 
| 58 | 
            +
                          _context.next = 14;
         | 
| 59 | 
            +
                          break;
         | 
| 60 | 
            +
                        case 10:
         | 
| 61 | 
            +
                          _context.prev = 10;
         | 
| 62 | 
            +
                          _context.t0 = _context["catch"](4);
         | 
| 63 | 
            +
                          inst.loading = false;
         | 
| 64 | 
            +
                          inst.isReady = false;
         | 
| 65 | 
            +
                        case 14:
         | 
| 66 | 
            +
                        case "end":
         | 
| 67 | 
            +
                          return _context.stop();
         | 
| 68 | 
            +
                      }
         | 
| 69 | 
            +
                    }, _callee, this, [[4, 10]]);
         | 
| 70 | 
            +
                  }));
         | 
| 71 | 
            +
                  function startLoad(_x) {
         | 
| 72 | 
            +
                    return _startLoad.apply(this, arguments);
         | 
| 73 | 
            +
                  }
         | 
| 74 | 
            +
                  return startLoad;
         | 
| 75 | 
            +
                }()
         | 
| 76 | 
            +
              }, {
         | 
| 77 | 
            +
                key: "getInstance",
         | 
| 78 | 
            +
                value: function getInstance() {
         | 
| 79 | 
            +
                  if (!this.instance) {
         | 
| 80 | 
            +
                    this.instance = new UeditorResourceLoader();
         | 
| 81 | 
            +
                  }
         | 
| 82 | 
            +
                  return this.instance;
         | 
| 83 | 
            +
                }
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                /**
         | 
| 86 | 
            +
                 * 加载完成执行
         | 
| 87 | 
            +
                 * @param callback 回调函数
         | 
| 88 | 
            +
                 */
         | 
| 89 | 
            +
              }, {
         | 
| 90 | 
            +
                key: "onReady",
         | 
| 91 | 
            +
                value: function onReady(callback) {
         | 
| 92 | 
            +
                  var inst = this.getInstance();
         | 
| 93 | 
            +
                  if (inst.isReady) {
         | 
| 94 | 
            +
                    callback();
         | 
| 95 | 
            +
                  } else {
         | 
| 96 | 
            +
                    inst.callbackList.push(callback);
         | 
| 97 | 
            +
                  }
         | 
| 98 | 
            +
                }
         | 
| 99 | 
            +
             | 
| 100 | 
            +
                /**
         | 
| 101 | 
            +
                 * 资源加载失败执行
         | 
| 102 | 
            +
                 * @param callback
         | 
| 103 | 
            +
                 */
         | 
| 104 | 
            +
              }, {
         | 
| 105 | 
            +
                key: "onLoadError",
         | 
| 106 | 
            +
                value: function onLoadError(callback) {
         | 
| 107 | 
            +
                  var inst = this.getInstance();
         | 
| 108 | 
            +
                  inst.errorCallbackList.push(callback);
         | 
| 109 | 
            +
                }
         | 
| 110 | 
            +
              }]);
         | 
| 111 | 
            +
              return UeditorResourceLoader;
         | 
| 112 | 
            +
            }();
         | 
| 113 | 
            +
            _defineProperty(UeditorResourceLoader, "instance", void 0);
         | 
| 114 | 
            +
            export default UeditorResourceLoader;
         | 
| @@ -0,0 +1,54 @@ | |
| 1 | 
            +
            function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
         | 
| 2 | 
            +
            function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
         | 
| 3 | 
            +
            function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
         | 
| 4 | 
            +
            function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
         | 
| 5 | 
            +
            /**
         | 
| 6 | 
            +
             * 同步加载js
         | 
| 7 | 
            +
             * @param strs 路径地址
         | 
| 8 | 
            +
             */
         | 
| 9 | 
            +
            export var loadScriptSync = /*#__PURE__*/function () {
         | 
| 10 | 
            +
              var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(strs) {
         | 
| 11 | 
            +
                var _loop, i;
         | 
| 12 | 
            +
                return _regeneratorRuntime().wrap(function _callee$(_context2) {
         | 
| 13 | 
            +
                  while (1) switch (_context2.prev = _context2.next) {
         | 
| 14 | 
            +
                    case 0:
         | 
| 15 | 
            +
                      _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
         | 
| 16 | 
            +
                        var script;
         | 
| 17 | 
            +
                        return _regeneratorRuntime().wrap(function _loop$(_context) {
         | 
| 18 | 
            +
                          while (1) switch (_context.prev = _context.next) {
         | 
| 19 | 
            +
                            case 0:
         | 
| 20 | 
            +
                              script = document.createElement('script');
         | 
| 21 | 
            +
                              script.src = strs[i];
         | 
| 22 | 
            +
                              script.async = false;
         | 
| 23 | 
            +
                              document.body.appendChild(script);
         | 
| 24 | 
            +
                              _context.next = 6;
         | 
| 25 | 
            +
                              return new Promise(function (resolve) {
         | 
| 26 | 
            +
                                script.onload = resolve;
         | 
| 27 | 
            +
                              });
         | 
| 28 | 
            +
                            case 6:
         | 
| 29 | 
            +
                            case "end":
         | 
| 30 | 
            +
                              return _context.stop();
         | 
| 31 | 
            +
                          }
         | 
| 32 | 
            +
                        }, _loop);
         | 
| 33 | 
            +
                      });
         | 
| 34 | 
            +
                      i = 0;
         | 
| 35 | 
            +
                    case 2:
         | 
| 36 | 
            +
                      if (!(i < strs.length)) {
         | 
| 37 | 
            +
                        _context2.next = 7;
         | 
| 38 | 
            +
                        break;
         | 
| 39 | 
            +
                      }
         | 
| 40 | 
            +
                      return _context2.delegateYield(_loop(), "t0", 4);
         | 
| 41 | 
            +
                    case 4:
         | 
| 42 | 
            +
                      i += 1;
         | 
| 43 | 
            +
                      _context2.next = 2;
         | 
| 44 | 
            +
                      break;
         | 
| 45 | 
            +
                    case 7:
         | 
| 46 | 
            +
                    case "end":
         | 
| 47 | 
            +
                      return _context2.stop();
         | 
| 48 | 
            +
                  }
         | 
| 49 | 
            +
                }, _callee);
         | 
| 50 | 
            +
              }));
         | 
| 51 | 
            +
              return function loadScriptSync(_x) {
         | 
| 52 | 
            +
                return _ref.apply(this, arguments);
         | 
| 53 | 
            +
              };
         | 
| 54 | 
            +
            }();
         | 
    
        package/es/type.d.ts
    ADDED
    
    | @@ -0,0 +1,142 @@ | |
| 1 | 
            +
            import React from 'react';
         | 
| 2 | 
            +
            interface IUeditorStype extends React.CSSProperties {
         | 
| 3 | 
            +
                toolbarColor?: string;
         | 
| 4 | 
            +
            }
         | 
| 5 | 
            +
            export interface ILcdpUeditorProps {
         | 
| 6 | 
            +
                /**
         | 
| 7 | 
            +
                 * ueditor产物路径 默认 ./ueditor-resource
         | 
| 8 | 
            +
                 */
         | 
| 9 | 
            +
                ueditorPath?: string;
         | 
| 10 | 
            +
                /**
         | 
| 11 | 
            +
                 * 样式类名
         | 
| 12 | 
            +
                 */
         | 
| 13 | 
            +
                className?: string;
         | 
| 14 | 
            +
                /**
         | 
| 15 | 
            +
                 * 编辑器样式
         | 
| 16 | 
            +
                 */
         | 
| 17 | 
            +
                style?: IUeditorStype;
         | 
| 18 | 
            +
                /**
         | 
| 19 | 
            +
                 * 禁用
         | 
| 20 | 
            +
                 */
         | 
| 21 | 
            +
                disabled?: boolean;
         | 
| 22 | 
            +
                /**
         | 
| 23 | 
            +
                 * 富文本配置
         | 
| 24 | 
            +
                 */
         | 
| 25 | 
            +
                config?: {
         | 
| 26 | 
            +
                    /**
         | 
| 27 | 
            +
                     * 编辑器高度 默认300px
         | 
| 28 | 
            +
                     */
         | 
| 29 | 
            +
                    height?: number;
         | 
| 30 | 
            +
                    /**
         | 
| 31 | 
            +
                     * 图片类型
         | 
| 32 | 
            +
                     */
         | 
| 33 | 
            +
                    imageType: 'file' | 'base64';
         | 
| 34 | 
            +
                    /**
         | 
| 35 | 
            +
                     * 上传大小限制,单位B,默认值:10485760
         | 
| 36 | 
            +
                     */
         | 
| 37 | 
            +
                    imageMaxSize?: number;
         | 
| 38 | 
            +
                    /**
         | 
| 39 | 
            +
                     * 上传图片格式显示 [".png", ".jpg", ".jpeg", ".gif", ".bmp"]
         | 
| 40 | 
            +
                     */
         | 
| 41 | 
            +
                    imageAllowFiles?: string[];
         | 
| 42 | 
            +
                    /**
         | 
| 43 | 
            +
                     * 上传大小限制,单位B,默认值:104857600
         | 
| 44 | 
            +
                     */
         | 
| 45 | 
            +
                    fileMaxSize?: number;
         | 
| 46 | 
            +
                    /**
         | 
| 47 | 
            +
                     * 上传文件格式限制
         | 
| 48 | 
            +
                     */
         | 
| 49 | 
            +
                    fileAllowFiles?: string[];
         | 
| 50 | 
            +
                    /**
         | 
| 51 | 
            +
                     * 上传音频大小限制,单位B,默认值:104857600
         | 
| 52 | 
            +
                     */
         | 
| 53 | 
            +
                    audioMaxSize?: number;
         | 
| 54 | 
            +
                    /**
         | 
| 55 | 
            +
                     * 上传音频格式限制
         | 
| 56 | 
            +
                     */
         | 
| 57 | 
            +
                    audioAllowFiles?: string[];
         | 
| 58 | 
            +
                    /**
         | 
| 59 | 
            +
                     * 上传视频大小限制,单位B,默认值:104857600
         | 
| 60 | 
            +
                     */
         | 
| 61 | 
            +
                    videoMaxSize?: number;
         | 
| 62 | 
            +
                    /**
         | 
| 63 | 
            +
                     * 上传视频格式限制
         | 
| 64 | 
            +
                     */
         | 
| 65 | 
            +
                    videoAllowFiles?: string[];
         | 
| 66 | 
            +
                };
         | 
| 67 | 
            +
                /**
         | 
| 68 | 
            +
                 * 语言 默认 zh-cn
         | 
| 69 | 
            +
                 * zh-cn 中文 en 英文
         | 
| 70 | 
            +
                 */
         | 
| 71 | 
            +
                lang?: 'zh-cn' | 'en';
         | 
| 72 | 
            +
                /**
         | 
| 73 | 
            +
                 * 上传方法
         | 
| 74 | 
            +
                 * @param file 文件
         | 
| 75 | 
            +
                 * @param fileType 文件类型
         | 
| 76 | 
            +
                 */
         | 
| 77 | 
            +
                uploadFunction(file: File): Promise<{
         | 
| 78 | 
            +
                    state: 'SUCCESS' | 'FAIL';
         | 
| 79 | 
            +
                    url?: string;
         | 
| 80 | 
            +
                    title?: string;
         | 
| 81 | 
            +
                    original?: string;
         | 
| 82 | 
            +
                }>;
         | 
| 83 | 
            +
                /**
         | 
| 84 | 
            +
                 *  编辑器挂载
         | 
| 85 | 
            +
                 * @param inst
         | 
| 86 | 
            +
                 */
         | 
| 87 | 
            +
                onMount?(inst: ILcdpUeditorInst): void;
         | 
| 88 | 
            +
                /**
         | 
| 89 | 
            +
                 * 内容
         | 
| 90 | 
            +
                 */
         | 
| 91 | 
            +
                value?: string;
         | 
| 92 | 
            +
                /**
         | 
| 93 | 
            +
                 * 内容改变事件
         | 
| 94 | 
            +
                 * @param val 编辑器内容
         | 
| 95 | 
            +
                 */
         | 
| 96 | 
            +
                onChange?(val: string): void;
         | 
| 97 | 
            +
            }
         | 
| 98 | 
            +
            export interface ILcdpUeditorInst {
         | 
| 99 | 
            +
                /**
         | 
| 100 | 
            +
                 * 获取整个html内容
         | 
| 101 | 
            +
                 */
         | 
| 102 | 
            +
                getAllHtml(): string;
         | 
| 103 | 
            +
                /**
         | 
| 104 | 
            +
                 * 获取内容
         | 
| 105 | 
            +
                 */
         | 
| 106 | 
            +
                getContent(): string;
         | 
| 107 | 
            +
                /**
         | 
| 108 | 
            +
                 * 设置内容
         | 
| 109 | 
            +
                 * @param content 内容
         | 
| 110 | 
            +
                 * @param isAppend 是否追加
         | 
| 111 | 
            +
                 */
         | 
| 112 | 
            +
                setContent(content: string, isAppend?: boolean): void;
         | 
| 113 | 
            +
                /**
         | 
| 114 | 
            +
                 * 获取纯文本内容
         | 
| 115 | 
            +
                 */
         | 
| 116 | 
            +
                getContentTxt(): string;
         | 
| 117 | 
            +
                /**
         | 
| 118 | 
            +
                 * 获得带格式的纯文本
         | 
| 119 | 
            +
                 */
         | 
| 120 | 
            +
                getPlainTxt(): string;
         | 
| 121 | 
            +
                /**
         | 
| 122 | 
            +
                 * 判断是否有内容
         | 
| 123 | 
            +
                 */
         | 
| 124 | 
            +
                hasContents(): boolean;
         | 
| 125 | 
            +
                /**
         | 
| 126 | 
            +
                 * 使编辑器获得焦点
         | 
| 127 | 
            +
                 */
         | 
| 128 | 
            +
                focus(): void;
         | 
| 129 | 
            +
                /**
         | 
| 130 | 
            +
                 * 编辑器是否获得焦点
         | 
| 131 | 
            +
                 */
         | 
| 132 | 
            +
                isFocus(): boolean;
         | 
| 133 | 
            +
                /**
         | 
| 134 | 
            +
                 * 编辑器失去焦点
         | 
| 135 | 
            +
                 */
         | 
| 136 | 
            +
                setBlur(): void;
         | 
| 137 | 
            +
                /**
         | 
| 138 | 
            +
                 * 获得当前选中的文本
         | 
| 139 | 
            +
                 */
         | 
| 140 | 
            +
                getSelectText(): string;
         | 
| 141 | 
            +
            }
         | 
| 142 | 
            +
            export {};
         | 
    
        package/es/type.js
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            export {};
         | 
    
        package/package.json
    ADDED
    
    | @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
              "name": "@lingxiteam/lcdp-ueditor-react",
         | 
| 3 | 
            +
              "version": "1.0.0-alpha.1",
         | 
| 4 | 
            +
              "module": "es/index.js",
         | 
| 5 | 
            +
              "license": "MIT",
         | 
| 6 | 
            +
              "files": [
         | 
| 7 | 
            +
                "ueditor-resource",
         | 
| 8 | 
            +
                "es"
         | 
| 9 | 
            +
              ],
         | 
| 10 | 
            +
              "publishConfig": {
         | 
| 11 | 
            +
                "access": "public",
         | 
| 12 | 
            +
                "registry": "https://registry.npmjs.org/"
         | 
| 13 | 
            +
              },
         | 
| 14 | 
            +
              "types": "es/index.d.ts",
         | 
| 15 | 
            +
              "typings": "es/index.d.ts",
         | 
| 16 | 
            +
              "scripts": {
         | 
| 17 | 
            +
                "build": "father build",
         | 
| 18 | 
            +
                "dev": "father dev",
         | 
| 19 | 
            +
                "prepublishOnly": "npm run build"
         | 
| 20 | 
            +
              },
         | 
| 21 | 
            +
              "peerDependencies": {
         | 
| 22 | 
            +
                "react": "^16.12.0 || ^17.0.0"
         | 
| 23 | 
            +
              },
         | 
| 24 | 
            +
              "dependencies": {
         | 
| 25 | 
            +
                "lodash": "^4.0.0"
         | 
| 26 | 
            +
              },
         | 
| 27 | 
            +
              "devDependencies": {
         | 
| 28 | 
            +
                "father": "^4.1.9",
         | 
| 29 | 
            +
                "@types/lodash": "^4.14.180"
         | 
| 30 | 
            +
              },
         | 
| 31 | 
            +
              "gitHead": "be7b48f706ff0186d2f2f42d59a25b4973f935d4"
         | 
| 32 | 
            +
            }
         | 
| @@ -0,0 +1,62 @@ | |
| 1 | 
            +
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
         | 
| 2 | 
            +
                "http://www.w3.org/TR/html4/loose.dtd">
         | 
| 3 | 
            +
            <html>
         | 
| 4 | 
            +
            <head>
         | 
| 5 | 
            +
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
         | 
| 6 | 
            +
                <title></title>
         | 
| 7 | 
            +
                <style type="text/css">
         | 
| 8 | 
            +
                    * {
         | 
| 9 | 
            +
                        color: #838383;
         | 
| 10 | 
            +
                        margin: 0;
         | 
| 11 | 
            +
                        padding: 0
         | 
| 12 | 
            +
                    }
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    html, body {
         | 
| 15 | 
            +
                        font-size: 12px;
         | 
| 16 | 
            +
                        overflow: hidden;
         | 
| 17 | 
            +
                    }
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                    .content {
         | 
| 20 | 
            +
                        padding: 5px 0 0 15px;
         | 
| 21 | 
            +
                    }
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                    input {
         | 
| 24 | 
            +
                        margin-left: 4px;
         | 
| 25 | 
            +
                        box-sizing: border-box;
         | 
| 26 | 
            +
                        width: 210px;
         | 
| 27 | 
            +
                        height: 30px;
         | 
| 28 | 
            +
                        line-height: 30px;
         | 
| 29 | 
            +
                        border: 1px solid #d7d7d7;
         | 
| 30 | 
            +
                        border-radius: 3px;
         | 
| 31 | 
            +
                        padding: 0 5px;
         | 
| 32 | 
            +
                        outline: none;
         | 
| 33 | 
            +
                    }
         | 
| 34 | 
            +
                </style>
         | 
| 35 | 
            +
            </head>
         | 
| 36 | 
            +
            <body>
         | 
| 37 | 
            +
            <div class="content">
         | 
| 38 | 
            +
                <span><var id="lang_input_anchorName"></var></span><input id="anchorName" value=""/>
         | 
| 39 | 
            +
            </div>
         | 
| 40 | 
            +
            <script type="text/javascript" src="../internal.js?32939b8e"></script>
         | 
| 41 | 
            +
            <script type="text/javascript">
         | 
| 42 | 
            +
                var anchorInput = $G('anchorName'),
         | 
| 43 | 
            +
                    node = editor.selection.getRange().getClosedNode();
         | 
| 44 | 
            +
                if (node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))) {
         | 
| 45 | 
            +
                    anchorInput.value = node;
         | 
| 46 | 
            +
                }
         | 
| 47 | 
            +
                anchorInput.onkeydown = function (evt) {
         | 
| 48 | 
            +
                    evt = evt || window.event;
         | 
| 49 | 
            +
                    if (evt.keyCode == 13) {
         | 
| 50 | 
            +
                        editor.execCommand('anchor', anchorInput.value);
         | 
| 51 | 
            +
                        dialog.close();
         | 
| 52 | 
            +
                        domUtils.preventDefault(evt)
         | 
| 53 | 
            +
                    }
         | 
| 54 | 
            +
                };
         | 
| 55 | 
            +
                dialog.onok = function () {
         | 
| 56 | 
            +
                    editor.execCommand('anchor', anchorInput.value);
         | 
| 57 | 
            +
                    dialog.close();
         | 
| 58 | 
            +
                };
         | 
| 59 | 
            +
                $focus(anchorInput);
         | 
| 60 | 
            +
            </script>
         | 
| 61 | 
            +
            </body>
         | 
| 62 | 
            +
            </html>
         |