1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory();
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define([], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["wangEditor"] = factory();
|
8 | else
|
9 | root["wangEditor"] = factory();
|
10 | })(window, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50 | }
|
51 | };
|
52 |
|
53 |
|
54 | __webpack_require__.r = function(exports) {
|
55 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57 | }
|
58 | Object.defineProperty(exports, '__esModule', { value: true });
|
59 | };
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | __webpack_require__.t = function(value, mode) {
|
67 | if(mode & 1) value = __webpack_require__(value);
|
68 | if(mode & 8) return value;
|
69 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70 | var ns = Object.create(null);
|
71 | __webpack_require__.r(ns);
|
72 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74 | return ns;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.n = function(module) {
|
79 | var getter = module && module.__esModule ?
|
80 | function getDefault() { return module['default']; } :
|
81 | function getModuleExports() { return module; };
|
82 | __webpack_require__.d(getter, 'a', getter);
|
83 | return getter;
|
84 | };
|
85 |
|
86 |
|
87 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88 |
|
89 |
|
90 | __webpack_require__.p = "";
|
91 |
|
92 |
|
93 |
|
94 | return __webpack_require__(__webpack_require__.s = 129);
|
95 | })
|
96 |
|
97 | ([
|
98 |
|
99 | (function(module, exports) {
|
100 |
|
101 | function _interopRequireDefault(obj) {
|
102 | return obj && obj.__esModule ? obj : {
|
103 | "default": obj
|
104 | };
|
105 | }
|
106 |
|
107 | module.exports = _interopRequireDefault;
|
108 |
|
109 | }),
|
110 |
|
111 | (function(module, exports, __webpack_require__) {
|
112 |
|
113 | module.exports = __webpack_require__(130);
|
114 |
|
115 | }),
|
116 |
|
117 | (function(module, exports, __webpack_require__) {
|
118 |
|
119 | "use strict";
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | var _interopRequireDefault = __webpack_require__(0);
|
127 |
|
128 | var _bind = _interopRequireDefault(__webpack_require__(88));
|
129 |
|
130 | var _includes = _interopRequireDefault(__webpack_require__(89));
|
131 |
|
132 | var _filter = _interopRequireDefault(__webpack_require__(66));
|
133 |
|
134 | var _splice = _interopRequireDefault(__webpack_require__(90));
|
135 |
|
136 | var _indexOf = _interopRequireDefault(__webpack_require__(54));
|
137 |
|
138 | var _map = _interopRequireDefault(__webpack_require__(114));
|
139 |
|
140 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
141 |
|
142 | var _map2 = _interopRequireDefault(__webpack_require__(29));
|
143 |
|
144 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
145 |
|
146 | var _isArray = _interopRequireDefault(__webpack_require__(93));
|
147 |
|
148 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
149 |
|
150 | var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
151 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
152 | s += arguments[i].length;
|
153 | }
|
154 |
|
155 | for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
156 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
157 | r[k] = a[j];
|
158 | }
|
159 | }
|
160 |
|
161 | return r;
|
162 | };
|
163 |
|
164 | (0, _defineProperty["default"])(exports, "__esModule", {
|
165 | value: true
|
166 | });
|
167 | exports.DomElement = void 0;
|
168 |
|
169 | var util_1 = __webpack_require__(7);
|
170 |
|
171 | var AGENT_EVENTS = [];
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 | function _createElemByHTML(html) {
|
178 | var div = document.createElement('div');
|
179 | div.innerHTML = html;
|
180 | var elems = div.children;
|
181 | return util_1.toArray(elems);
|
182 | }
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 | function _isDOMList(selector) {
|
190 | if (!selector) {
|
191 | return false;
|
192 | }
|
193 |
|
194 | if (selector instanceof HTMLCollection || selector instanceof NodeList) {
|
195 | return true;
|
196 | }
|
197 |
|
198 | return false;
|
199 | }
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 | function _querySelectorAll(selector) {
|
207 | var elems = document.querySelectorAll(selector);
|
208 | return util_1.toArray(elems);
|
209 | }
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | function _styleArrTrim(style) {
|
217 | var styleArr = [];
|
218 | var resultArr = [];
|
219 |
|
220 | if (!(0, _isArray["default"])(style)) {
|
221 |
|
222 | styleArr = style.split(';');
|
223 | } else {
|
224 | styleArr = style;
|
225 | }
|
226 |
|
227 | (0, _forEach["default"])(styleArr).call(styleArr, function (item) {
|
228 | var _context;
|
229 |
|
230 |
|
231 | var arr = (0, _map2["default"])(_context = item.split(':')).call(_context, function (i) {
|
232 | return (0, _trim["default"])(i).call(i);
|
233 | });
|
234 |
|
235 | if (arr.length === 2) {
|
236 | resultArr.push(arr[0] + ':' + arr[1]);
|
237 | }
|
238 | });
|
239 | return resultArr;
|
240 | }
|
241 |
|
242 |
|
243 | var DomElement =
|
244 |
|
245 | function () {
|
246 | |
247 |
|
248 |
|
249 |
|
250 | function DomElement(selector) {
|
251 |
|
252 | this.elems = [];
|
253 | this.length = this.elems.length;
|
254 | this.dataSource = new _map["default"]();
|
255 |
|
256 | if (!selector) {
|
257 | return;
|
258 | }
|
259 |
|
260 |
|
261 | if (selector instanceof DomElement) {
|
262 | return selector;
|
263 | }
|
264 |
|
265 | var selectorResult = [];
|
266 |
|
267 | var nodeType = selector instanceof Node ? selector.nodeType : -1;
|
268 | this.selector = selector;
|
269 |
|
270 | if (nodeType === 1 || nodeType === 9) {
|
271 | selectorResult = [selector];
|
272 | } else if (_isDOMList(selector)) {
|
273 |
|
274 | selectorResult = util_1.toArray(selector);
|
275 | } else if (selector instanceof Array) {
|
276 |
|
277 | selectorResult = selector;
|
278 | } else if (typeof selector === 'string') {
|
279 | var _context2;
|
280 |
|
281 |
|
282 | var tmpSelector = (0, _trim["default"])(_context2 = selector.replace('/\n/mg', '')).call(_context2);
|
283 |
|
284 | if ((0, _indexOf["default"])(tmpSelector).call(tmpSelector, '<') === 0) {
|
285 |
|
286 | selectorResult = _createElemByHTML(tmpSelector);
|
287 | } else {
|
288 |
|
289 | selectorResult = _querySelectorAll(tmpSelector);
|
290 | }
|
291 | }
|
292 |
|
293 | var length = selectorResult.length;
|
294 |
|
295 | if (!length) {
|
296 |
|
297 | return this;
|
298 | }
|
299 |
|
300 |
|
301 | var i = 0;
|
302 |
|
303 | for (; i < length; i++) {
|
304 | this.elems.push(selectorResult[i]);
|
305 | }
|
306 |
|
307 | this.length = length;
|
308 | }
|
309 |
|
310 | (0, _defineProperty["default"])(DomElement.prototype, "id", {
|
311 | |
312 |
|
313 |
|
314 | get: function get() {
|
315 | return this.elems[0].id;
|
316 | },
|
317 | enumerable: false,
|
318 | configurable: true
|
319 | });
|
320 | |
321 |
|
322 |
|
323 |
|
324 |
|
325 | DomElement.prototype.forEach = function (fn) {
|
326 | for (var i = 0; i < this.length; i++) {
|
327 | var elem = this.elems[i];
|
328 | var result = fn.call(elem, elem, i);
|
329 |
|
330 | if (result === false) {
|
331 | break;
|
332 | }
|
333 | }
|
334 |
|
335 | return this;
|
336 | };
|
337 | |
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 | DomElement.prototype.clone = function (deep) {
|
344 | var _context3;
|
345 |
|
346 | if (deep === void 0) {
|
347 | deep = false;
|
348 | }
|
349 |
|
350 | var cloneList = [];
|
351 | (0, _forEach["default"])(_context3 = this.elems).call(_context3, function (elem) {
|
352 | cloneList.push(elem.cloneNode(!!deep));
|
353 | });
|
354 | return $(cloneList);
|
355 | };
|
356 | |
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 | DomElement.prototype.get = function (index) {
|
363 | if (index === void 0) {
|
364 | index = 0;
|
365 | }
|
366 |
|
367 | var length = this.length;
|
368 |
|
369 | if (index >= length) {
|
370 | index = index % length;
|
371 | }
|
372 |
|
373 | return $(this.elems[index]);
|
374 | };
|
375 | |
376 |
|
377 |
|
378 |
|
379 |
|
380 | DomElement.prototype.first = function () {
|
381 | return this.get(0);
|
382 | };
|
383 | |
384 |
|
385 |
|
386 |
|
387 |
|
388 | DomElement.prototype.last = function () {
|
389 | var length = this.length;
|
390 | return this.get(length - 1);
|
391 | };
|
392 |
|
393 | DomElement.prototype.on = function (type, selector, fn) {
|
394 | var _context4;
|
395 |
|
396 | if (!type) return this;
|
397 |
|
398 | if (typeof selector === 'function') {
|
399 | fn = selector;
|
400 | selector = '';
|
401 | }
|
402 |
|
403 | return (0, _forEach["default"])(_context4 = this).call(_context4, function (elem) {
|
404 |
|
405 | if (!selector) {
|
406 |
|
407 | elem.addEventListener(type, fn);
|
408 | return;
|
409 | }
|
410 |
|
411 |
|
412 | var agentFn = function agentFn(e) {
|
413 | var target = e.target;
|
414 |
|
415 | if (target.matches(selector)) {
|
416 | ;
|
417 | fn.call(target, e);
|
418 | }
|
419 | };
|
420 |
|
421 | elem.addEventListener(type, agentFn);
|
422 |
|
423 | AGENT_EVENTS.push({
|
424 | elem: elem,
|
425 | selector: selector,
|
426 | fn: fn,
|
427 | agentFn: agentFn
|
428 | });
|
429 | });
|
430 | };
|
431 |
|
432 | DomElement.prototype.off = function (type, selector, fn) {
|
433 | var _context5;
|
434 |
|
435 | if (!type) return this;
|
436 |
|
437 | if (typeof selector === 'function') {
|
438 | fn = selector;
|
439 | selector = '';
|
440 | }
|
441 |
|
442 | return (0, _forEach["default"])(_context5 = this).call(_context5, function (elem) {
|
443 |
|
444 | if (selector) {
|
445 | var idx = -1;
|
446 |
|
447 | for (var i = 0; i < AGENT_EVENTS.length; i++) {
|
448 | var item = AGENT_EVENTS[i];
|
449 |
|
450 | if (item.selector === selector && item.fn === fn && item.elem === elem) {
|
451 | idx = i;
|
452 | break;
|
453 | }
|
454 | }
|
455 |
|
456 | if (idx !== -1) {
|
457 | var agentFn = (0, _splice["default"])(AGENT_EVENTS).call(AGENT_EVENTS, idx, 1)[0].agentFn;
|
458 | elem.removeEventListener(type, agentFn);
|
459 | }
|
460 | } else {
|
461 |
|
462 | elem.removeEventListener(type, fn);
|
463 | }
|
464 | });
|
465 | };
|
466 |
|
467 | DomElement.prototype.attr = function (key, val) {
|
468 | var _context6;
|
469 |
|
470 | if (val == null) {
|
471 |
|
472 | return this.elems[0].getAttribute(key) || '';
|
473 | }
|
474 |
|
475 |
|
476 | return (0, _forEach["default"])(_context6 = this).call(_context6, function (elem) {
|
477 | elem.setAttribute(key, val);
|
478 | });
|
479 | };
|
480 | |
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 | DomElement.prototype.removeAttr = function (key) {
|
487 | var _context7;
|
488 |
|
489 | (0, _forEach["default"])(_context7 = this).call(_context7, function (elem) {
|
490 | elem.removeAttribute(key);
|
491 | });
|
492 | };
|
493 | |
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 | DomElement.prototype.addClass = function (className) {
|
500 | var _context8;
|
501 |
|
502 | if (!className) {
|
503 | return this;
|
504 | }
|
505 |
|
506 | return (0, _forEach["default"])(_context8 = this).call(_context8, function (elem) {
|
507 | if (elem.className) {
|
508 |
|
509 | var arr = elem.className.split(/\s/);
|
510 | arr = (0, _filter["default"])(arr).call(arr, function (item) {
|
511 | return !!(0, _trim["default"])(item).call(item);
|
512 | });
|
513 |
|
514 | if ((0, _indexOf["default"])(arr).call(arr, className) < 0) {
|
515 | arr.push(className);
|
516 | }
|
517 |
|
518 |
|
519 | elem.className = arr.join(' ');
|
520 | } else {
|
521 |
|
522 | elem.className = className;
|
523 | }
|
524 | });
|
525 | };
|
526 | |
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 | DomElement.prototype.removeClass = function (className) {
|
533 | var _context9;
|
534 |
|
535 | if (!className) {
|
536 | return this;
|
537 | }
|
538 |
|
539 | return (0, _forEach["default"])(_context9 = this).call(_context9, function (elem) {
|
540 | if (!elem.className) {
|
541 |
|
542 | return;
|
543 | }
|
544 |
|
545 | var arr = elem.className.split(/\s/);
|
546 | arr = (0, _filter["default"])(arr).call(arr, function (item) {
|
547 | item = (0, _trim["default"])(item).call(item);
|
548 |
|
549 | if (!item || item === className) {
|
550 | return false;
|
551 | }
|
552 |
|
553 | return true;
|
554 | });
|
555 |
|
556 | elem.className = arr.join(' ');
|
557 | });
|
558 | };
|
559 | |
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 | DomElement.prototype.hasClass = function (className) {
|
566 | if (!className) {
|
567 | return false;
|
568 | }
|
569 |
|
570 | var elem = this.elems[0];
|
571 |
|
572 | if (!elem.className) {
|
573 |
|
574 | return false;
|
575 | }
|
576 |
|
577 | var arr = elem.className.split(/\s/);
|
578 | return (0, _includes["default"])(arr).call(arr, className);
|
579 | };
|
580 | |
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 | DomElement.prototype.css = function (key, val) {
|
589 | var _context10;
|
590 |
|
591 | var currentStyle;
|
592 |
|
593 | if (val == '') {
|
594 | currentStyle = '';
|
595 | } else {
|
596 | currentStyle = key + ":" + val + ";";
|
597 | }
|
598 |
|
599 | return (0, _forEach["default"])(_context10 = this).call(_context10, function (elem) {
|
600 | var _context11;
|
601 |
|
602 | var style = (0, _trim["default"])(_context11 = elem.getAttribute('style') || '').call(_context11);
|
603 |
|
604 | if (style) {
|
605 |
|
606 | var resultArr = _styleArrTrim(style);
|
607 |
|
608 |
|
609 | resultArr = (0, _map2["default"])(resultArr).call(resultArr, function (item) {
|
610 | if ((0, _indexOf["default"])(item).call(item, key) === 0) {
|
611 | return currentStyle;
|
612 | } else {
|
613 | return item;
|
614 | }
|
615 | });
|
616 |
|
617 | if (currentStyle != '' && (0, _indexOf["default"])(resultArr).call(resultArr, currentStyle) < 0) {
|
618 | resultArr.push(currentStyle);
|
619 | }
|
620 |
|
621 |
|
622 | if (currentStyle == '') {
|
623 | resultArr = _styleArrTrim(resultArr);
|
624 | }
|
625 |
|
626 |
|
627 | elem.setAttribute('style', resultArr.join('; '));
|
628 | } else {
|
629 |
|
630 | elem.setAttribute('style', currentStyle);
|
631 | }
|
632 | });
|
633 | };
|
634 | |
635 |
|
636 |
|
637 |
|
638 |
|
639 | DomElement.prototype.getBoundingClientRect = function () {
|
640 | var elem = this.elems[0];
|
641 | return elem.getBoundingClientRect();
|
642 | };
|
643 | |
644 |
|
645 |
|
646 |
|
647 |
|
648 | DomElement.prototype.show = function () {
|
649 | return this.css('display', 'block');
|
650 | };
|
651 | |
652 |
|
653 |
|
654 |
|
655 |
|
656 | DomElement.prototype.hide = function () {
|
657 | return this.css('display', 'none');
|
658 | };
|
659 | |
660 |
|
661 |
|
662 |
|
663 |
|
664 | DomElement.prototype.children = function () {
|
665 | var elem = this.elems[0];
|
666 |
|
667 | if (!elem) {
|
668 | return null;
|
669 | }
|
670 |
|
671 | return $(elem.children);
|
672 | };
|
673 | |
674 |
|
675 |
|
676 |
|
677 |
|
678 | DomElement.prototype.childNodes = function () {
|
679 | var elem = this.elems[0];
|
680 |
|
681 | if (!elem) {
|
682 | return null;
|
683 | }
|
684 |
|
685 | return $(elem.childNodes);
|
686 | };
|
687 | |
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 | DomElement.prototype.replaceChildAll = function ($children) {
|
694 | var parent = this.getNode();
|
695 | var elem = this.elems[0];
|
696 |
|
697 | while (elem.hasChildNodes()) {
|
698 | parent.firstChild && elem.removeChild(parent.firstChild);
|
699 | }
|
700 |
|
701 | this.append($children);
|
702 | };
|
703 | |
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 | DomElement.prototype.append = function ($children) {
|
710 | var _context12;
|
711 |
|
712 | return (0, _forEach["default"])(_context12 = this).call(_context12, function (elem) {
|
713 | (0, _forEach["default"])($children).call($children, function (child) {
|
714 | elem.appendChild(child);
|
715 | });
|
716 | });
|
717 | };
|
718 | |
719 |
|
720 |
|
721 |
|
722 |
|
723 | DomElement.prototype.remove = function () {
|
724 | var _context13;
|
725 |
|
726 | return (0, _forEach["default"])(_context13 = this).call(_context13, function (elem) {
|
727 | if (elem.remove) {
|
728 | elem.remove();
|
729 | } else {
|
730 | var parent_1 = elem.parentElement;
|
731 | parent_1 && parent_1.removeChild(elem);
|
732 | }
|
733 | });
|
734 | };
|
735 | |
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 | DomElement.prototype.isContain = function ($child) {
|
742 | var elem = this.elems[0];
|
743 | var child = $child.elems[0];
|
744 | return elem.contains(child);
|
745 | };
|
746 | |
747 |
|
748 |
|
749 |
|
750 |
|
751 | DomElement.prototype.getSizeData = function () {
|
752 | var elem = this.elems[0];
|
753 |
|
754 | return elem.getBoundingClientRect();
|
755 | };
|
756 | |
757 |
|
758 |
|
759 |
|
760 |
|
761 | DomElement.prototype.getNodeName = function () {
|
762 | var elem = this.elems[0];
|
763 | return elem.nodeName;
|
764 | };
|
765 | |
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 | DomElement.prototype.getNode = function (n) {
|
772 | if (n === void 0) {
|
773 | n = 0;
|
774 | }
|
775 |
|
776 | var elem;
|
777 | elem = this.elems[n];
|
778 | return elem;
|
779 | };
|
780 | |
781 |
|
782 |
|
783 |
|
784 |
|
785 | DomElement.prototype.getClientHeight = function () {
|
786 | var elem = this.elems[0];
|
787 | return elem.clientHeight;
|
788 | };
|
789 | |
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 | |
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 | DomElement.prototype.find = function (selector) {
|
804 | var elem = this.elems[0];
|
805 | return $(elem.querySelectorAll(selector));
|
806 | };
|
807 |
|
808 | DomElement.prototype.text = function (val) {
|
809 | if (!val) {
|
810 |
|
811 | var elem = this.elems[0];
|
812 | return elem.innerHTML.replace(/<[^>]+>/g, function () {
|
813 | return '';
|
814 | });
|
815 | } else {
|
816 | var _context14;
|
817 |
|
818 |
|
819 | return (0, _forEach["default"])(_context14 = this).call(_context14, function (elem) {
|
820 | elem.innerHTML = val;
|
821 | });
|
822 | }
|
823 | };
|
824 |
|
825 | DomElement.prototype.html = function (val) {
|
826 | var elem = this.elems[0];
|
827 |
|
828 | if (!val) {
|
829 |
|
830 | return elem.innerHTML;
|
831 | } else {
|
832 |
|
833 | elem.innerHTML = val;
|
834 | return this;
|
835 | }
|
836 | };
|
837 | |
838 |
|
839 |
|
840 |
|
841 |
|
842 | DomElement.prototype.val = function () {
|
843 | var _context15;
|
844 |
|
845 | var elem = this.elems[0];
|
846 | return (0, _trim["default"])(_context15 = elem.value).call(_context15);
|
847 | };
|
848 | |
849 |
|
850 |
|
851 |
|
852 |
|
853 | DomElement.prototype.focus = function () {
|
854 | var _context16;
|
855 |
|
856 | return (0, _forEach["default"])(_context16 = this).call(_context16, function (elem) {
|
857 | elem.focus();
|
858 | });
|
859 | };
|
860 | |
861 |
|
862 |
|
863 |
|
864 |
|
865 | DomElement.prototype.prev = function () {
|
866 | var elem = this.elems[0];
|
867 | return $(elem.previousElementSibling);
|
868 | };
|
869 | |
870 |
|
871 |
|
872 |
|
873 |
|
874 | DomElement.prototype.next = function () {
|
875 | var elem = this.elems[0];
|
876 | return $(elem.nextElementSibling);
|
877 | };
|
878 | |
879 |
|
880 |
|
881 |
|
882 |
|
883 | DomElement.prototype.parent = function () {
|
884 | var elem = this.elems[0];
|
885 | return $(elem.parentElement);
|
886 | };
|
887 | |
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 | DomElement.prototype.parentUntil = function (selector, curElem) {
|
895 | var elem = curElem || this.elems[0];
|
896 |
|
897 | if (elem.nodeName === 'BODY') {
|
898 | return null;
|
899 | }
|
900 |
|
901 | var parent = elem.parentElement;
|
902 |
|
903 | if (parent === null) {
|
904 | return null;
|
905 | }
|
906 |
|
907 | if (parent.matches(selector)) {
|
908 |
|
909 | return $(parent);
|
910 | }
|
911 |
|
912 |
|
913 | return this.parentUntil(selector, parent);
|
914 | };
|
915 | |
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 | DomElement.prototype.parentUntilEditor = function (selector, editor, curElem) {
|
923 | var elem = curElem || this.elems[0];
|
924 |
|
925 | if ($(elem).equal(editor.$textContainerElem) || $(elem).equal(editor.$toolbarElem)) {
|
926 | return null;
|
927 | }
|
928 |
|
929 | var parent = elem.parentElement;
|
930 |
|
931 | if (parent === null) {
|
932 | return null;
|
933 | }
|
934 |
|
935 | if (parent.matches(selector)) {
|
936 |
|
937 | return $(parent);
|
938 | }
|
939 |
|
940 |
|
941 | return this.parentUntilEditor(selector, editor, parent);
|
942 | };
|
943 | |
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 | DomElement.prototype.equal = function ($elem) {
|
950 | if ($elem instanceof DomElement) {
|
951 | return this.elems[0] === $elem.elems[0];
|
952 | } else if ($elem instanceof HTMLElement) {
|
953 | return this.elems[0] === $elem;
|
954 | } else {
|
955 | return false;
|
956 | }
|
957 | };
|
958 | |
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 | DomElement.prototype.insertBefore = function (selector) {
|
965 | var _context17;
|
966 |
|
967 | var $referenceNode = $(selector);
|
968 | var referenceNode = $referenceNode.elems[0];
|
969 |
|
970 | if (!referenceNode) {
|
971 | return this;
|
972 | }
|
973 |
|
974 | return (0, _forEach["default"])(_context17 = this).call(_context17, function (elem) {
|
975 | var parent = referenceNode.parentNode;
|
976 | parent.insertBefore(elem, referenceNode);
|
977 | });
|
978 | };
|
979 | |
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 | DomElement.prototype.insertAfter = function (selector) {
|
986 | var _context18;
|
987 |
|
988 | var $referenceNode = $(selector);
|
989 | var referenceNode = $referenceNode.elems[0];
|
990 | var anchorNode = referenceNode && referenceNode.nextSibling;
|
991 |
|
992 | if (!referenceNode) {
|
993 | return this;
|
994 | }
|
995 |
|
996 | return (0, _forEach["default"])(_context18 = this).call(_context18, function (elem) {
|
997 | var parent = referenceNode.parentNode;
|
998 |
|
999 | if (anchorNode) {
|
1000 | parent.insertBefore(elem, anchorNode);
|
1001 | } else {
|
1002 | parent.appendChild(elem);
|
1003 | }
|
1004 | });
|
1005 | };
|
1006 | |
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 | DomElement.prototype.data = function (key, value) {
|
1014 | if (value != null) {
|
1015 |
|
1016 | this.dataSource.set(key, value);
|
1017 | } else {
|
1018 |
|
1019 | return this.dataSource.get(key);
|
1020 | }
|
1021 | };
|
1022 | |
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 | DomElement.prototype.getNodeTop = function (editor) {
|
1029 | if (this.length < 1) {
|
1030 | return this;
|
1031 | }
|
1032 |
|
1033 | var $parent = this.parent();
|
1034 |
|
1035 | if (editor.$textElem.equal($parent)) {
|
1036 | return this;
|
1037 | }
|
1038 |
|
1039 | return $parent.getNodeTop(editor);
|
1040 | };
|
1041 | |
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 | DomElement.prototype.getOffsetData = function () {
|
1048 | var $node = this.elems[0];
|
1049 | return {
|
1050 | top: $node.offsetTop,
|
1051 | left: $node.offsetLeft,
|
1052 | width: $node.offsetWidth,
|
1053 | height: $node.offsetHeight,
|
1054 | parent: $node.offsetParent
|
1055 | };
|
1056 | };
|
1057 | |
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 | DomElement.prototype.scrollTop = function (top) {
|
1064 | var $node = this.elems[0];
|
1065 | $node.scrollTo({
|
1066 | top: top
|
1067 | });
|
1068 | };
|
1069 |
|
1070 | return DomElement;
|
1071 | }();
|
1072 |
|
1073 | exports.DomElement = DomElement;
|
1074 |
|
1075 | function $() {
|
1076 | var arg = [];
|
1077 |
|
1078 | for (var _i = 0; _i < arguments.length; _i++) {
|
1079 | arg[_i] = arguments[_i];
|
1080 | }
|
1081 |
|
1082 | return new ((0, _bind["default"])(DomElement).apply(DomElement, __spreadArrays([void 0], arg)))();
|
1083 | }
|
1084 |
|
1085 | exports["default"] = $;
|
1086 |
|
1087 | }),
|
1088 |
|
1089 | (function(module, exports, __webpack_require__) {
|
1090 |
|
1091 | module.exports = __webpack_require__(134);
|
1092 |
|
1093 | }),
|
1094 |
|
1095 | (function(module, exports, __webpack_require__) {
|
1096 |
|
1097 | "use strict";
|
1098 |
|
1099 | var global = __webpack_require__(8);
|
1100 | var getOwnPropertyDescriptor = __webpack_require__(68).f;
|
1101 | var isForced = __webpack_require__(101);
|
1102 | var path = __webpack_require__(10);
|
1103 | var bind = __webpack_require__(47);
|
1104 | var createNonEnumerableProperty = __webpack_require__(17);
|
1105 | var has = __webpack_require__(15);
|
1106 |
|
1107 | var wrapConstructor = function (NativeConstructor) {
|
1108 | var Wrapper = function (a, b, c) {
|
1109 | if (this instanceof NativeConstructor) {
|
1110 | switch (arguments.length) {
|
1111 | case 0: return new NativeConstructor();
|
1112 | case 1: return new NativeConstructor(a);
|
1113 | case 2: return new NativeConstructor(a, b);
|
1114 | } return new NativeConstructor(a, b, c);
|
1115 | } return NativeConstructor.apply(this, arguments);
|
1116 | };
|
1117 | Wrapper.prototype = NativeConstructor.prototype;
|
1118 | return Wrapper;
|
1119 | };
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 | module.exports = function (options, source) {
|
1136 | var TARGET = options.target;
|
1137 | var GLOBAL = options.global;
|
1138 | var STATIC = options.stat;
|
1139 | var PROTO = options.proto;
|
1140 |
|
1141 | var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
|
1142 |
|
1143 | var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});
|
1144 | var targetPrototype = target.prototype;
|
1145 |
|
1146 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
1147 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
1148 |
|
1149 | for (key in source) {
|
1150 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
1151 |
|
1152 | USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);
|
1153 |
|
1154 | targetProperty = target[key];
|
1155 |
|
1156 | if (USE_NATIVE) if (options.noTargetGet) {
|
1157 | descriptor = getOwnPropertyDescriptor(nativeSource, key);
|
1158 | nativeProperty = descriptor && descriptor.value;
|
1159 | } else nativeProperty = nativeSource[key];
|
1160 |
|
1161 |
|
1162 | sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
|
1163 |
|
1164 | if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;
|
1165 |
|
1166 |
|
1167 | if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
|
1168 |
|
1169 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
1170 |
|
1171 | else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);
|
1172 |
|
1173 | else resultProperty = sourceProperty;
|
1174 |
|
1175 |
|
1176 | if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
|
1177 | createNonEnumerableProperty(resultProperty, 'sham', true);
|
1178 | }
|
1179 |
|
1180 | target[key] = resultProperty;
|
1181 |
|
1182 | if (PROTO) {
|
1183 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
1184 | if (!has(path, VIRTUAL_PROTOTYPE)) {
|
1185 | createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
|
1186 | }
|
1187 |
|
1188 | path[VIRTUAL_PROTOTYPE][key] = sourceProperty;
|
1189 |
|
1190 | if (options.real && targetPrototype && !targetPrototype[key]) {
|
1191 | createNonEnumerableProperty(targetPrototype, key, sourceProperty);
|
1192 | }
|
1193 | }
|
1194 | }
|
1195 | };
|
1196 |
|
1197 |
|
1198 | }),
|
1199 |
|
1200 | (function(module, exports, __webpack_require__) {
|
1201 |
|
1202 | module.exports = __webpack_require__(178);
|
1203 |
|
1204 | }),
|
1205 |
|
1206 | (function(module, exports, __webpack_require__) {
|
1207 |
|
1208 | module.exports = __webpack_require__(306);
|
1209 |
|
1210 | }),
|
1211 |
|
1212 | (function(module, exports, __webpack_require__) {
|
1213 |
|
1214 | "use strict";
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 | var _interopRequireDefault = __webpack_require__(0);
|
1222 |
|
1223 | var _map = _interopRequireDefault(__webpack_require__(29));
|
1224 |
|
1225 | var _isArray = _interopRequireDefault(__webpack_require__(93));
|
1226 |
|
1227 | var _typeof2 = _interopRequireDefault(__webpack_require__(94));
|
1228 |
|
1229 | var _setTimeout2 = _interopRequireDefault(__webpack_require__(121));
|
1230 |
|
1231 | var _slice = _interopRequireDefault(__webpack_require__(43));
|
1232 |
|
1233 | var _parseInt2 = _interopRequireDefault(__webpack_require__(261));
|
1234 |
|
1235 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
1236 |
|
1237 | var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
1238 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
1239 | s += arguments[i].length;
|
1240 | }
|
1241 |
|
1242 | for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
1243 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
1244 | r[k] = a[j];
|
1245 | }
|
1246 | }
|
1247 |
|
1248 | return r;
|
1249 | };
|
1250 |
|
1251 | (0, _defineProperty["default"])(exports, "__esModule", {
|
1252 | value: true
|
1253 | });
|
1254 | exports.hexToRgb = exports.getRandomCode = exports.toArray = exports.deepClone = exports.isFunction = exports.debounce = exports.throttle = exports.arrForEach = exports.forEach = exports.replaceSpecialSymbol = exports.replaceHtmlSymbol = exports.getRandom = exports.UA = void 0;
|
1255 |
|
1256 | var NavUA =
|
1257 |
|
1258 | function () {
|
1259 | function NavUA() {
|
1260 | this._ua = navigator.userAgent;
|
1261 |
|
1262 | var math = this._ua.match(/(Edge?)\/(\d+)/);
|
1263 |
|
1264 | this.isOldEdge = math && math[1] == 'Edge' && (0, _parseInt2["default"])(math[2]) < 19 ? true : false;
|
1265 | this.isFirefox = /Firefox\/\d+/.test(this._ua) && !/Seamonkey\/\d+/.test(this._ua) ? true : false;
|
1266 | }
|
1267 |
|
1268 |
|
1269 | NavUA.prototype.isIE = function () {
|
1270 | return 'ActiveXObject' in window;
|
1271 | };
|
1272 |
|
1273 |
|
1274 | NavUA.prototype.isWebkit = function () {
|
1275 | return /webkit/i.test(this._ua);
|
1276 | };
|
1277 |
|
1278 | return NavUA;
|
1279 | }();
|
1280 |
|
1281 |
|
1282 | exports.UA = new NavUA();
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 | function getRandom(prefix) {
|
1289 | var _context;
|
1290 |
|
1291 | if (prefix === void 0) {
|
1292 | prefix = '';
|
1293 | }
|
1294 |
|
1295 | return prefix + (0, _slice["default"])(_context = Math.random().toString()).call(_context, 2);
|
1296 | }
|
1297 |
|
1298 | exports.getRandom = getRandom;
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 | function replaceHtmlSymbol(html) {
|
1305 | return html.replace(/</gm, '<').replace(/>/gm, '>').replace(/"/gm, '"').replace(/(\r\n|\r|\n)/g, '<br/>');
|
1306 | }
|
1307 |
|
1308 | exports.replaceHtmlSymbol = replaceHtmlSymbol;
|
1309 |
|
1310 | function replaceSpecialSymbol(value) {
|
1311 | return value.replace(/</gm, '<').replace(/>/gm, '>').replace(/"/gm, '"');
|
1312 | }
|
1313 |
|
1314 | exports.replaceSpecialSymbol = replaceSpecialSymbol;
|
1315 |
|
1316 | function forEach(obj, fn) {
|
1317 | for (var key in obj) {
|
1318 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
1319 | var result = fn(key, obj[key]);
|
1320 |
|
1321 | if (result === false) {
|
1322 |
|
1323 | break;
|
1324 | }
|
1325 | }
|
1326 | }
|
1327 | }
|
1328 |
|
1329 | exports.forEach = forEach;
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 | function arrForEach(fakeArr, fn) {
|
1337 | var i, item, result;
|
1338 | var length = fakeArr.length || 0;
|
1339 |
|
1340 | for (i = 0; i < length; i++) {
|
1341 | item = fakeArr[i];
|
1342 | result = fn.call(fakeArr, item, i);
|
1343 |
|
1344 | if (result === false) {
|
1345 | break;
|
1346 | }
|
1347 | }
|
1348 | }
|
1349 |
|
1350 | exports.arrForEach = arrForEach;
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 | function throttle(fn, interval) {
|
1358 | if (interval === void 0) {
|
1359 | interval = 200;
|
1360 | }
|
1361 |
|
1362 | var flag = false;
|
1363 | return function () {
|
1364 | var _this = this;
|
1365 |
|
1366 | var args = [];
|
1367 |
|
1368 | for (var _i = 0; _i < arguments.length; _i++) {
|
1369 | args[_i] = arguments[_i];
|
1370 | }
|
1371 |
|
1372 | if (!flag) {
|
1373 | flag = true;
|
1374 | (0, _setTimeout2["default"])(function () {
|
1375 | flag = false;
|
1376 | fn.call.apply(fn, __spreadArrays([_this], args));
|
1377 | }, interval);
|
1378 | }
|
1379 | };
|
1380 | }
|
1381 |
|
1382 | exports.throttle = throttle;
|
1383 |
|
1384 |
|
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 | function debounce(fn, delay) {
|
1390 | if (delay === void 0) {
|
1391 | delay = 200;
|
1392 | }
|
1393 |
|
1394 | var lastFn = 0;
|
1395 | return function () {
|
1396 | var _this = this;
|
1397 |
|
1398 | var args = [];
|
1399 |
|
1400 | for (var _i = 0; _i < arguments.length; _i++) {
|
1401 | args[_i] = arguments[_i];
|
1402 | }
|
1403 |
|
1404 | if (lastFn) {
|
1405 | window.clearTimeout(lastFn);
|
1406 | }
|
1407 |
|
1408 | lastFn = window.setTimeout(function () {
|
1409 | lastFn = 0;
|
1410 | fn.call.apply(fn, __spreadArrays([_this], args));
|
1411 | }, delay);
|
1412 | };
|
1413 | }
|
1414 |
|
1415 | exports.debounce = debounce;
|
1416 |
|
1417 |
|
1418 |
|
1419 |
|
1420 |
|
1421 | function isFunction(fn) {
|
1422 | return typeof fn === 'function';
|
1423 | }
|
1424 |
|
1425 | exports.isFunction = isFunction;
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 | function deepClone(data) {
|
1432 | if ((0, _typeof2["default"])(data) !== 'object' || typeof data == 'function' || data === null) {
|
1433 | return data;
|
1434 | }
|
1435 |
|
1436 | var item;
|
1437 |
|
1438 | if ((0, _isArray["default"])(data)) {
|
1439 | item = [];
|
1440 | }
|
1441 |
|
1442 | if (!(0, _isArray["default"])(data)) {
|
1443 | item = {};
|
1444 | }
|
1445 |
|
1446 | for (var i in data) {
|
1447 | if (Object.prototype.hasOwnProperty.call(data, i)) {
|
1448 | item[i] = deepClone(data[i]);
|
1449 | }
|
1450 | }
|
1451 |
|
1452 | return item;
|
1453 | }
|
1454 |
|
1455 | exports.deepClone = deepClone;
|
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 |
|
1461 | function toArray(data) {
|
1462 | return (0, _slice["default"])(Array.prototype).call(data);
|
1463 | }
|
1464 |
|
1465 | exports.toArray = toArray;
|
1466 |
|
1467 |
|
1468 |
|
1469 |
|
1470 |
|
1471 | function getRandomCode() {
|
1472 | var _context2;
|
1473 |
|
1474 | return (0, _slice["default"])(_context2 = Math.random().toString(36)).call(_context2, -5);
|
1475 | }
|
1476 |
|
1477 | exports.getRandomCode = getRandomCode;
|
1478 |
|
1479 |
|
1480 |
|
1481 |
|
1482 |
|
1483 | function hexToRgb(hex) {
|
1484 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
1485 | if (result == null) return null;
|
1486 | var colors = (0, _map["default"])(result).call(result, function (i) {
|
1487 | return (0, _parseInt2["default"])(i, 16);
|
1488 | });
|
1489 | var r = colors[1];
|
1490 | var g = colors[2];
|
1491 | var b = colors[3];
|
1492 | return "rgb(" + r + ", " + g + ", " + b + ")";
|
1493 | }
|
1494 |
|
1495 | exports.hexToRgb = hexToRgb;
|
1496 |
|
1497 | }),
|
1498 |
|
1499 | (function(module, exports, __webpack_require__) {
|
1500 |
|
1501 | (function(global) {var check = function (it) {
|
1502 | return it && it.Math == Math && it;
|
1503 | };
|
1504 |
|
1505 |
|
1506 | module.exports =
|
1507 |
|
1508 | check(typeof globalThis == 'object' && globalThis) ||
|
1509 | check(typeof window == 'object' && window) ||
|
1510 | check(typeof self == 'object' && self) ||
|
1511 | check(typeof global == 'object' && global) ||
|
1512 |
|
1513 | (function () { return this; })() || Function('return this')();
|
1514 |
|
1515 | }.call(this, __webpack_require__(133)))
|
1516 |
|
1517 | }),
|
1518 |
|
1519 | (function(module, exports, __webpack_require__) {
|
1520 |
|
1521 | var global = __webpack_require__(8);
|
1522 | var shared = __webpack_require__(74);
|
1523 | var has = __webpack_require__(15);
|
1524 | var uid = __webpack_require__(60);
|
1525 | var NATIVE_SYMBOL = __webpack_require__(78);
|
1526 | var USE_SYMBOL_AS_UID = __webpack_require__(104);
|
1527 |
|
1528 | var WellKnownSymbolsStore = shared('wks');
|
1529 | var Symbol = global.Symbol;
|
1530 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
|
1531 |
|
1532 | module.exports = function (name) {
|
1533 | if (!has(WellKnownSymbolsStore, name)) {
|
1534 | if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
|
1535 | else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
1536 | } return WellKnownSymbolsStore[name];
|
1537 | };
|
1538 |
|
1539 |
|
1540 | }),
|
1541 |
|
1542 | (function(module, exports) {
|
1543 |
|
1544 | module.exports = {};
|
1545 |
|
1546 |
|
1547 | }),
|
1548 |
|
1549 | (function(module, exports, __webpack_require__) {
|
1550 |
|
1551 | var path = __webpack_require__(10);
|
1552 | var has = __webpack_require__(15);
|
1553 | var wrappedWellKnownSymbolModule = __webpack_require__(95);
|
1554 | var defineProperty = __webpack_require__(18).f;
|
1555 |
|
1556 | module.exports = function (NAME) {
|
1557 | var Symbol = path.Symbol || (path.Symbol = {});
|
1558 | if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
|
1559 | value: wrappedWellKnownSymbolModule.f(NAME)
|
1560 | });
|
1561 | };
|
1562 |
|
1563 |
|
1564 | }),
|
1565 |
|
1566 | (function(module, exports) {
|
1567 |
|
1568 | module.exports = function (exec) {
|
1569 | try {
|
1570 | return !!exec();
|
1571 | } catch (error) {
|
1572 | return true;
|
1573 | }
|
1574 | };
|
1575 |
|
1576 |
|
1577 | }),
|
1578 |
|
1579 | (function(module, exports) {
|
1580 |
|
1581 | module.exports = function (it) {
|
1582 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
1583 | };
|
1584 |
|
1585 |
|
1586 | }),
|
1587 |
|
1588 | (function(module, exports, __webpack_require__) {
|
1589 |
|
1590 | var fails = __webpack_require__(12);
|
1591 |
|
1592 |
|
1593 | module.exports = !fails(function () {
|
1594 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
1595 | });
|
1596 |
|
1597 |
|
1598 | }),
|
1599 |
|
1600 | (function(module, exports) {
|
1601 |
|
1602 | var hasOwnProperty = {}.hasOwnProperty;
|
1603 |
|
1604 | module.exports = function (it, key) {
|
1605 | return hasOwnProperty.call(it, key);
|
1606 | };
|
1607 |
|
1608 |
|
1609 | }),
|
1610 |
|
1611 | (function(module, exports, __webpack_require__) {
|
1612 |
|
1613 | var path = __webpack_require__(10);
|
1614 |
|
1615 | module.exports = function (CONSTRUCTOR) {
|
1616 | return path[CONSTRUCTOR + 'Prototype'];
|
1617 | };
|
1618 |
|
1619 |
|
1620 | }),
|
1621 |
|
1622 | (function(module, exports, __webpack_require__) {
|
1623 |
|
1624 | var DESCRIPTORS = __webpack_require__(14);
|
1625 | var definePropertyModule = __webpack_require__(18);
|
1626 | var createPropertyDescriptor = __webpack_require__(35);
|
1627 |
|
1628 | module.exports = DESCRIPTORS ? function (object, key, value) {
|
1629 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
1630 | } : function (object, key, value) {
|
1631 | object[key] = value;
|
1632 | return object;
|
1633 | };
|
1634 |
|
1635 |
|
1636 | }),
|
1637 |
|
1638 | (function(module, exports, __webpack_require__) {
|
1639 |
|
1640 | var DESCRIPTORS = __webpack_require__(14);
|
1641 | var IE8_DOM_DEFINE = __webpack_require__(100);
|
1642 | var anObject = __webpack_require__(24);
|
1643 | var toPrimitive = __webpack_require__(56);
|
1644 |
|
1645 | var nativeDefineProperty = Object.defineProperty;
|
1646 |
|
1647 |
|
1648 |
|
1649 | exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
1650 | anObject(O);
|
1651 | P = toPrimitive(P, true);
|
1652 | anObject(Attributes);
|
1653 | if (IE8_DOM_DEFINE) try {
|
1654 | return nativeDefineProperty(O, P, Attributes);
|
1655 | } catch (error) { }
|
1656 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
1657 | if ('value' in Attributes) O[P] = Attributes.value;
|
1658 | return O;
|
1659 | };
|
1660 |
|
1661 |
|
1662 | }),
|
1663 |
|
1664 | (function(module, exports, __webpack_require__) {
|
1665 |
|
1666 | module.exports = __webpack_require__(213);
|
1667 |
|
1668 | }),
|
1669 |
|
1670 | (function(module, exports, __webpack_require__) {
|
1671 |
|
1672 | "use strict";
|
1673 |
|
1674 |
|
1675 | var isOldIE = function isOldIE() {
|
1676 | var memo;
|
1677 | return function memorize() {
|
1678 | if (typeof memo === 'undefined') {
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 | memo = Boolean(window && document && document.all && !window.atob);
|
1685 | }
|
1686 |
|
1687 | return memo;
|
1688 | };
|
1689 | }();
|
1690 |
|
1691 | var getTarget = function getTarget() {
|
1692 | var memo = {};
|
1693 | return function memorize(target) {
|
1694 | if (typeof memo[target] === 'undefined') {
|
1695 | var styleTarget = document.querySelector(target);
|
1696 |
|
1697 | if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
1698 | try {
|
1699 |
|
1700 |
|
1701 | styleTarget = styleTarget.contentDocument.head;
|
1702 | } catch (e) {
|
1703 |
|
1704 | styleTarget = null;
|
1705 | }
|
1706 | }
|
1707 |
|
1708 | memo[target] = styleTarget;
|
1709 | }
|
1710 |
|
1711 | return memo[target];
|
1712 | };
|
1713 | }();
|
1714 |
|
1715 | var stylesInDom = [];
|
1716 |
|
1717 | function getIndexByIdentifier(identifier) {
|
1718 | var result = -1;
|
1719 |
|
1720 | for (var i = 0; i < stylesInDom.length; i++) {
|
1721 | if (stylesInDom[i].identifier === identifier) {
|
1722 | result = i;
|
1723 | break;
|
1724 | }
|
1725 | }
|
1726 |
|
1727 | return result;
|
1728 | }
|
1729 |
|
1730 | function modulesToDom(list, options) {
|
1731 | var idCountMap = {};
|
1732 | var identifiers = [];
|
1733 |
|
1734 | for (var i = 0; i < list.length; i++) {
|
1735 | var item = list[i];
|
1736 | var id = options.base ? item[0] + options.base : item[0];
|
1737 | var count = idCountMap[id] || 0;
|
1738 | var identifier = "".concat(id, " ").concat(count);
|
1739 | idCountMap[id] = count + 1;
|
1740 | var index = getIndexByIdentifier(identifier);
|
1741 | var obj = {
|
1742 | css: item[1],
|
1743 | media: item[2],
|
1744 | sourceMap: item[3]
|
1745 | };
|
1746 |
|
1747 | if (index !== -1) {
|
1748 | stylesInDom[index].references++;
|
1749 | stylesInDom[index].updater(obj);
|
1750 | } else {
|
1751 | stylesInDom.push({
|
1752 | identifier: identifier,
|
1753 | updater: addStyle(obj, options),
|
1754 | references: 1
|
1755 | });
|
1756 | }
|
1757 |
|
1758 | identifiers.push(identifier);
|
1759 | }
|
1760 |
|
1761 | return identifiers;
|
1762 | }
|
1763 |
|
1764 | function insertStyleElement(options) {
|
1765 | var style = document.createElement('style');
|
1766 | var attributes = options.attributes || {};
|
1767 |
|
1768 | if (typeof attributes.nonce === 'undefined') {
|
1769 | var nonce = true ? __webpack_require__.nc : undefined;
|
1770 |
|
1771 | if (nonce) {
|
1772 | attributes.nonce = nonce;
|
1773 | }
|
1774 | }
|
1775 |
|
1776 | Object.keys(attributes).forEach(function (key) {
|
1777 | style.setAttribute(key, attributes[key]);
|
1778 | });
|
1779 |
|
1780 | if (typeof options.insert === 'function') {
|
1781 | options.insert(style);
|
1782 | } else {
|
1783 | var target = getTarget(options.insert || 'head');
|
1784 |
|
1785 | if (!target) {
|
1786 | throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
1787 | }
|
1788 |
|
1789 | target.appendChild(style);
|
1790 | }
|
1791 |
|
1792 | return style;
|
1793 | }
|
1794 |
|
1795 | function removeStyleElement(style) {
|
1796 |
|
1797 | if (style.parentNode === null) {
|
1798 | return false;
|
1799 | }
|
1800 |
|
1801 | style.parentNode.removeChild(style);
|
1802 | }
|
1803 |
|
1804 |
|
1805 |
|
1806 | var replaceText = function replaceText() {
|
1807 | var textStore = [];
|
1808 | return function replace(index, replacement) {
|
1809 | textStore[index] = replacement;
|
1810 | return textStore.filter(Boolean).join('\n');
|
1811 | };
|
1812 | }();
|
1813 |
|
1814 | function applyToSingletonTag(style, index, remove, obj) {
|
1815 | var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css;
|
1816 |
|
1817 |
|
1818 |
|
1819 | if (style.styleSheet) {
|
1820 | style.styleSheet.cssText = replaceText(index, css);
|
1821 | } else {
|
1822 | var cssNode = document.createTextNode(css);
|
1823 | var childNodes = style.childNodes;
|
1824 |
|
1825 | if (childNodes[index]) {
|
1826 | style.removeChild(childNodes[index]);
|
1827 | }
|
1828 |
|
1829 | if (childNodes.length) {
|
1830 | style.insertBefore(cssNode, childNodes[index]);
|
1831 | } else {
|
1832 | style.appendChild(cssNode);
|
1833 | }
|
1834 | }
|
1835 | }
|
1836 |
|
1837 | function applyToTag(style, options, obj) {
|
1838 | var css = obj.css;
|
1839 | var media = obj.media;
|
1840 | var sourceMap = obj.sourceMap;
|
1841 |
|
1842 | if (media) {
|
1843 | style.setAttribute('media', media);
|
1844 | } else {
|
1845 | style.removeAttribute('media');
|
1846 | }
|
1847 |
|
1848 | if (sourceMap && typeof btoa !== 'undefined') {
|
1849 | css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
1850 | }
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 | if (style.styleSheet) {
|
1856 | style.styleSheet.cssText = css;
|
1857 | } else {
|
1858 | while (style.firstChild) {
|
1859 | style.removeChild(style.firstChild);
|
1860 | }
|
1861 |
|
1862 | style.appendChild(document.createTextNode(css));
|
1863 | }
|
1864 | }
|
1865 |
|
1866 | var singleton = null;
|
1867 | var singletonCounter = 0;
|
1868 |
|
1869 | function addStyle(obj, options) {
|
1870 | var style;
|
1871 | var update;
|
1872 | var remove;
|
1873 |
|
1874 | if (options.singleton) {
|
1875 | var styleIndex = singletonCounter++;
|
1876 | style = singleton || (singleton = insertStyleElement(options));
|
1877 | update = applyToSingletonTag.bind(null, style, styleIndex, false);
|
1878 | remove = applyToSingletonTag.bind(null, style, styleIndex, true);
|
1879 | } else {
|
1880 | style = insertStyleElement(options);
|
1881 | update = applyToTag.bind(null, style, options);
|
1882 |
|
1883 | remove = function remove() {
|
1884 | removeStyleElement(style);
|
1885 | };
|
1886 | }
|
1887 |
|
1888 | update(obj);
|
1889 | return function updateStyle(newObj) {
|
1890 | if (newObj) {
|
1891 | if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
|
1892 | return;
|
1893 | }
|
1894 |
|
1895 | update(obj = newObj);
|
1896 | } else {
|
1897 | remove();
|
1898 | }
|
1899 | };
|
1900 | }
|
1901 |
|
1902 | module.exports = function (list, options) {
|
1903 | options = options || {};
|
1904 |
|
1905 |
|
1906 | if (!options.singleton && typeof options.singleton !== 'boolean') {
|
1907 | options.singleton = isOldIE();
|
1908 | }
|
1909 |
|
1910 | list = list || [];
|
1911 | var lastIdentifiers = modulesToDom(list, options);
|
1912 | return function update(newList) {
|
1913 | newList = newList || [];
|
1914 |
|
1915 | if (Object.prototype.toString.call(newList) !== '[object Array]') {
|
1916 | return;
|
1917 | }
|
1918 |
|
1919 | for (var i = 0; i < lastIdentifiers.length; i++) {
|
1920 | var identifier = lastIdentifiers[i];
|
1921 | var index = getIndexByIdentifier(identifier);
|
1922 | stylesInDom[index].references--;
|
1923 | }
|
1924 |
|
1925 | var newLastIdentifiers = modulesToDom(newList, options);
|
1926 |
|
1927 | for (var _i = 0; _i < lastIdentifiers.length; _i++) {
|
1928 | var _identifier = lastIdentifiers[_i];
|
1929 |
|
1930 | var _index = getIndexByIdentifier(_identifier);
|
1931 |
|
1932 | if (stylesInDom[_index].references === 0) {
|
1933 | stylesInDom[_index].updater();
|
1934 |
|
1935 | stylesInDom.splice(_index, 1);
|
1936 | }
|
1937 | }
|
1938 |
|
1939 | lastIdentifiers = newLastIdentifiers;
|
1940 | };
|
1941 | };
|
1942 |
|
1943 | }),
|
1944 |
|
1945 | (function(module, exports, __webpack_require__) {
|
1946 |
|
1947 | "use strict";
|
1948 |
|
1949 |
|
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 | module.exports = function (useSourceMap) {
|
1957 | var list = [];
|
1958 |
|
1959 | list.toString = function toString() {
|
1960 | return this.map(function (item) {
|
1961 | var content = cssWithMappingToString(item, useSourceMap);
|
1962 |
|
1963 | if (item[2]) {
|
1964 | return "@media ".concat(item[2], " {").concat(content, "}");
|
1965 | }
|
1966 |
|
1967 | return content;
|
1968 | }).join('');
|
1969 | };
|
1970 |
|
1971 |
|
1972 |
|
1973 | list.i = function (modules, mediaQuery, dedupe) {
|
1974 | if (typeof modules === 'string') {
|
1975 |
|
1976 | modules = [[null, modules, '']];
|
1977 | }
|
1978 |
|
1979 | var alreadyImportedModules = {};
|
1980 |
|
1981 | if (dedupe) {
|
1982 | for (var i = 0; i < this.length; i++) {
|
1983 |
|
1984 | var id = this[i][0];
|
1985 |
|
1986 | if (id != null) {
|
1987 | alreadyImportedModules[id] = true;
|
1988 | }
|
1989 | }
|
1990 | }
|
1991 |
|
1992 | for (var _i = 0; _i < modules.length; _i++) {
|
1993 | var item = [].concat(modules[_i]);
|
1994 |
|
1995 | if (dedupe && alreadyImportedModules[item[0]]) {
|
1996 |
|
1997 | continue;
|
1998 | }
|
1999 |
|
2000 | if (mediaQuery) {
|
2001 | if (!item[2]) {
|
2002 | item[2] = mediaQuery;
|
2003 | } else {
|
2004 | item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
|
2005 | }
|
2006 | }
|
2007 |
|
2008 | list.push(item);
|
2009 | }
|
2010 | };
|
2011 |
|
2012 | return list;
|
2013 | };
|
2014 |
|
2015 | function cssWithMappingToString(item, useSourceMap) {
|
2016 | var content = item[1] || '';
|
2017 |
|
2018 | var cssMapping = item[3];
|
2019 |
|
2020 | if (!cssMapping) {
|
2021 | return content;
|
2022 | }
|
2023 |
|
2024 | if (useSourceMap && typeof btoa === 'function') {
|
2025 | var sourceMapping = toComment(cssMapping);
|
2026 | var sourceURLs = cssMapping.sources.map(function (source) {
|
2027 | return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
|
2028 | });
|
2029 | return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
|
2030 | }
|
2031 |
|
2032 | return [content].join('\n');
|
2033 | }
|
2034 |
|
2035 |
|
2036 | function toComment(sourceMap) {
|
2037 |
|
2038 | var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
|
2039 | var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
|
2040 | return "/*# ".concat(data, " */");
|
2041 | }
|
2042 |
|
2043 | }),
|
2044 |
|
2045 | (function(module, exports, __webpack_require__) {
|
2046 |
|
2047 | "use strict";
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 | var _interopRequireDefault = __webpack_require__(0);
|
2055 |
|
2056 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
2057 |
|
2058 | var _create = _interopRequireDefault(__webpack_require__(3));
|
2059 |
|
2060 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
2061 |
|
2062 | var __extends = void 0 && (void 0).__extends || function () {
|
2063 | var _extendStatics = function extendStatics(d, b) {
|
2064 | _extendStatics = _setPrototypeOf["default"] || {
|
2065 | __proto__: []
|
2066 | } instanceof Array && function (d, b) {
|
2067 | d.__proto__ = b;
|
2068 | } || function (d, b) {
|
2069 | for (var p in b) {
|
2070 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
2071 | }
|
2072 | };
|
2073 |
|
2074 | return _extendStatics(d, b);
|
2075 | };
|
2076 |
|
2077 | return function (d, b) {
|
2078 | _extendStatics(d, b);
|
2079 |
|
2080 | function __() {
|
2081 | this.constructor = d;
|
2082 | }
|
2083 |
|
2084 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
2085 | };
|
2086 | }();
|
2087 |
|
2088 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
2089 | return mod && mod.__esModule ? mod : {
|
2090 | "default": mod
|
2091 | };
|
2092 | };
|
2093 |
|
2094 | (0, _defineProperty["default"])(exports, "__esModule", {
|
2095 | value: true
|
2096 | });
|
2097 |
|
2098 | var Menu_1 = __importDefault(__webpack_require__(96));
|
2099 |
|
2100 | var BtnMenu =
|
2101 |
|
2102 | function (_super) {
|
2103 | __extends(BtnMenu, _super);
|
2104 |
|
2105 | function BtnMenu($elem, editor) {
|
2106 | return _super.call(this, $elem, editor) || this;
|
2107 | }
|
2108 |
|
2109 | return BtnMenu;
|
2110 | }(Menu_1["default"]);
|
2111 |
|
2112 | exports["default"] = BtnMenu;
|
2113 |
|
2114 | }),
|
2115 |
|
2116 | (function(module, exports, __webpack_require__) {
|
2117 |
|
2118 | "use strict";
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 | var _interopRequireDefault = __webpack_require__(0);
|
2126 |
|
2127 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
2128 |
|
2129 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
2130 |
|
2131 | var _create = _interopRequireDefault(__webpack_require__(3));
|
2132 |
|
2133 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
2134 |
|
2135 | var __extends = void 0 && (void 0).__extends || function () {
|
2136 | var _extendStatics = function extendStatics(d, b) {
|
2137 | _extendStatics = _setPrototypeOf["default"] || {
|
2138 | __proto__: []
|
2139 | } instanceof Array && function (d, b) {
|
2140 | d.__proto__ = b;
|
2141 | } || function (d, b) {
|
2142 | for (var p in b) {
|
2143 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
2144 | }
|
2145 | };
|
2146 |
|
2147 | return _extendStatics(d, b);
|
2148 | };
|
2149 |
|
2150 | return function (d, b) {
|
2151 | _extendStatics(d, b);
|
2152 |
|
2153 | function __() {
|
2154 | this.constructor = d;
|
2155 | }
|
2156 |
|
2157 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
2158 | };
|
2159 | }();
|
2160 |
|
2161 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
2162 | return mod && mod.__esModule ? mod : {
|
2163 | "default": mod
|
2164 | };
|
2165 | };
|
2166 |
|
2167 | (0, _defineProperty["default"])(exports, "__esModule", {
|
2168 | value: true
|
2169 | });
|
2170 |
|
2171 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
2172 |
|
2173 | var Menu_1 = __importDefault(__webpack_require__(96));
|
2174 |
|
2175 | var DropList_1 = __importDefault(__webpack_require__(125));
|
2176 |
|
2177 | var DropListMenu =
|
2178 |
|
2179 | function (_super) {
|
2180 | __extends(DropListMenu, _super);
|
2181 |
|
2182 | function DropListMenu($elem, editor, conf) {
|
2183 | var _this = _super.call(this, $elem, editor) || this;
|
2184 |
|
2185 |
|
2186 | conf.title = editor.i18next.t("menus.dropListMenu." + conf.title);
|
2187 |
|
2188 | var className = editor.config.lang === 'zh-CN' ? '' : 'w-e-drop-list-tl';
|
2189 |
|
2190 | if (className !== '' && conf.type === 'list') {
|
2191 | var _context;
|
2192 |
|
2193 | (0, _forEach["default"])(_context = conf.list).call(_context, function (item) {
|
2194 | var $elem = item.$elem;
|
2195 | var $children = dom_core_1["default"]($elem.children());
|
2196 |
|
2197 | if ($children.length > 0) {
|
2198 | var nodeName = $children === null || $children === void 0 ? void 0 : $children.getNodeName();
|
2199 |
|
2200 | if (nodeName && nodeName === 'I') {
|
2201 | $elem.addClass(className);
|
2202 | }
|
2203 | }
|
2204 | });
|
2205 | }
|
2206 |
|
2207 |
|
2208 | var dropList = new DropList_1["default"](_this, conf);
|
2209 | _this.dropList = dropList;
|
2210 |
|
2211 | $elem.on('mouseenter', function () {
|
2212 | var _context2;
|
2213 |
|
2214 | if (editor.selection.getRange() == null) {
|
2215 | return;
|
2216 | }
|
2217 |
|
2218 | $elem.css('z-index', editor.zIndex.get('menu'));
|
2219 |
|
2220 | (0, _forEach["default"])(_context2 = editor.txt.eventHooks.dropListMenuHoverEvents).call(_context2, function (fn) {
|
2221 | return fn();
|
2222 | });
|
2223 |
|
2224 | dropList.showTimeoutId = window.setTimeout(function () {
|
2225 | dropList.show();
|
2226 | }, 200);
|
2227 | }).on('mouseleave', function () {
|
2228 | $elem.css('z-index', 'auto');
|
2229 |
|
2230 | dropList.hideTimeoutId = window.setTimeout(function () {
|
2231 | dropList.hide();
|
2232 | });
|
2233 | });
|
2234 | return _this;
|
2235 | }
|
2236 |
|
2237 | return DropListMenu;
|
2238 | }(Menu_1["default"]);
|
2239 |
|
2240 | exports["default"] = DropListMenu;
|
2241 |
|
2242 | }),
|
2243 |
|
2244 | (function(module, exports, __webpack_require__) {
|
2245 |
|
2246 | var isObject = __webpack_require__(13);
|
2247 |
|
2248 | module.exports = function (it) {
|
2249 | if (!isObject(it)) {
|
2250 | throw TypeError(String(it) + ' is not an object');
|
2251 | } return it;
|
2252 | };
|
2253 |
|
2254 |
|
2255 | }),
|
2256 |
|
2257 | (function(module, exports, __webpack_require__) {
|
2258 |
|
2259 | var DESCRIPTORS = __webpack_require__(14);
|
2260 | var fails = __webpack_require__(12);
|
2261 | var has = __webpack_require__(15);
|
2262 |
|
2263 | var defineProperty = Object.defineProperty;
|
2264 | var cache = {};
|
2265 |
|
2266 | var thrower = function (it) { throw it; };
|
2267 |
|
2268 | module.exports = function (METHOD_NAME, options) {
|
2269 | if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
|
2270 | if (!options) options = {};
|
2271 | var method = [][METHOD_NAME];
|
2272 | var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
|
2273 | var argument0 = has(options, 0) ? options[0] : thrower;
|
2274 | var argument1 = has(options, 1) ? options[1] : undefined;
|
2275 |
|
2276 | return cache[METHOD_NAME] = !!method && !fails(function () {
|
2277 | if (ACCESSORS && !DESCRIPTORS) return true;
|
2278 | var O = { length: -1 };
|
2279 |
|
2280 | if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
|
2281 | else O[1] = 1;
|
2282 |
|
2283 | method.call(O, argument0, argument1);
|
2284 | });
|
2285 | };
|
2286 |
|
2287 |
|
2288 | }),
|
2289 |
|
2290 | (function(module, exports, __webpack_require__) {
|
2291 |
|
2292 | "use strict";
|
2293 |
|
2294 |
|
2295 |
|
2296 |
|
2297 |
|
2298 |
|
2299 | var _interopRequireDefault = __webpack_require__(0);
|
2300 |
|
2301 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
2302 |
|
2303 | (0, _defineProperty["default"])(exports, "__esModule", {
|
2304 | value: true
|
2305 | });
|
2306 | exports.videoRegex = exports.urlRegex = exports.imgRegex = exports.EMPTY_FN = void 0;
|
2307 |
|
2308 | function EMPTY_FN() {}
|
2309 |
|
2310 | exports.EMPTY_FN = EMPTY_FN;
|
2311 |
|
2312 | exports.imgRegex = /\.(gif|jpg|jpeg|png)$/i;
|
2313 |
|
2314 | exports.urlRegex = /^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-.,@?^=%&:/~+#]*[\w\-@?^=%&/~+#])?/;
|
2315 |
|
2316 | exports.videoRegex = /((<iframe|video|embed|object)\s+[\s\S]*<\/(iframe|video|embed|object))>|<(iframe|video|embed|object)\s+[\s\S]*\/?>/;
|
2317 |
|
2318 | }),
|
2319 |
|
2320 | (function(module, exports, __webpack_require__) {
|
2321 |
|
2322 |
|
2323 | var IndexedObject = __webpack_require__(69);
|
2324 | var requireObjectCoercible = __webpack_require__(46);
|
2325 |
|
2326 | module.exports = function (it) {
|
2327 | return IndexedObject(requireObjectCoercible(it));
|
2328 | };
|
2329 |
|
2330 |
|
2331 | }),
|
2332 |
|
2333 | (function(module, exports, __webpack_require__) {
|
2334 |
|
2335 | var path = __webpack_require__(10);
|
2336 | var global = __webpack_require__(8);
|
2337 |
|
2338 | var aFunction = function (variable) {
|
2339 | return typeof variable == 'function' ? variable : undefined;
|
2340 | };
|
2341 |
|
2342 | module.exports = function (namespace, method) {
|
2343 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
|
2344 | : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
|
2345 | };
|
2346 |
|
2347 |
|
2348 | }),
|
2349 |
|
2350 | (function(module, exports, __webpack_require__) {
|
2351 |
|
2352 | module.exports = __webpack_require__(218);
|
2353 |
|
2354 | }),
|
2355 |
|
2356 | (function(module, exports, __webpack_require__) {
|
2357 |
|
2358 | module.exports = __webpack_require__(285);
|
2359 |
|
2360 | }),
|
2361 |
|
2362 | (function(module, exports, __webpack_require__) {
|
2363 |
|
2364 | "use strict";
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 | var _interopRequireDefault = __webpack_require__(0);
|
2372 |
|
2373 | var _set = _interopRequireDefault(__webpack_require__(124));
|
2374 |
|
2375 | var _find = _interopRequireDefault(__webpack_require__(30));
|
2376 |
|
2377 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
2378 |
|
2379 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
2380 |
|
2381 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
2382 | return mod && mod.__esModule ? mod : {
|
2383 | "default": mod
|
2384 | };
|
2385 | };
|
2386 |
|
2387 | (0, _defineProperty["default"])(exports, "__esModule", {
|
2388 | value: true
|
2389 | });
|
2390 |
|
2391 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
2392 |
|
2393 | var const_1 = __webpack_require__(26);
|
2394 |
|
2395 | var Panel =
|
2396 |
|
2397 | function () {
|
2398 | function Panel(menu, conf) {
|
2399 | this.menu = menu;
|
2400 | this.conf = conf;
|
2401 | this.$container = dom_core_1["default"]('<div class="w-e-panel-container"></div>');
|
2402 |
|
2403 | var editor = menu.editor;
|
2404 | editor.txt.eventHooks.clickEvents.push(Panel.hideCurAllPanels);
|
2405 | editor.txt.eventHooks.toolbarClickEvents.push(Panel.hideCurAllPanels);
|
2406 | editor.txt.eventHooks.dropListMenuHoverEvents.push(Panel.hideCurAllPanels);
|
2407 | }
|
2408 | |
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 | Panel.prototype.create = function () {
|
2414 | var _this = this;
|
2415 |
|
2416 | var menu = this.menu;
|
2417 |
|
2418 | if (Panel.createdMenus.has(menu)) {
|
2419 |
|
2420 | return;
|
2421 | }
|
2422 |
|
2423 | var conf = this.conf;
|
2424 |
|
2425 | var $container = this.$container;
|
2426 | var width = conf.width || 300;
|
2427 |
|
2428 | var rect = menu.editor.$toolbarElem.getBoundingClientRect();
|
2429 | var menuRect = menu.$elem.getBoundingClientRect();
|
2430 | var top = rect.height + rect.top - menuRect.top;
|
2431 | var left = (rect.width - width) / 2 + rect.left - menuRect.left;
|
2432 | $container.css('width', width + 'px').css('margin-top', top + "px").css('margin-left', left + "px").css('z-index', menu.editor.zIndex.get('panel'));
|
2433 |
|
2434 | var $closeBtn = dom_core_1["default"]('<i class="w-e-icon-close w-e-panel-close"></i>');
|
2435 | $container.append($closeBtn);
|
2436 | $closeBtn.on('click', function () {
|
2437 | _this.remove();
|
2438 | });
|
2439 |
|
2440 | var $tabTitleContainer = dom_core_1["default"]('<ul class="w-e-panel-tab-title"></ul>');
|
2441 | var $tabContentContainer = dom_core_1["default"]('<div class="w-e-panel-tab-content"></div>');
|
2442 | $container.append($tabTitleContainer).append($tabContentContainer);
|
2443 |
|
2444 | var height = conf.height;
|
2445 |
|
2446 | if (height) {
|
2447 | $tabContentContainer.css('height', height + 'px').css('overflow-y', 'auto');
|
2448 | }
|
2449 |
|
2450 |
|
2451 | var tabs = conf.tabs || [];
|
2452 | var tabTitleArr = [];
|
2453 | var tabContentArr = [];
|
2454 | (0, _forEach["default"])(tabs).call(tabs, function (tab, tabIndex) {
|
2455 | if (!tab) {
|
2456 | return;
|
2457 | }
|
2458 |
|
2459 | var title = tab.title || '';
|
2460 | var tpl = tab.tpl || '';
|
2461 |
|
2462 | var $title = dom_core_1["default"]("<li class=\"w-e-item\">" + title + "</li>");
|
2463 | $tabTitleContainer.append($title);
|
2464 | var $content = dom_core_1["default"](tpl);
|
2465 | $tabContentContainer.append($content);
|
2466 |
|
2467 | tabTitleArr.push($title);
|
2468 | tabContentArr.push($content);
|
2469 |
|
2470 | if (tabIndex === 0) {
|
2471 | $title.data('active', true);
|
2472 | $title.addClass('w-e-active');
|
2473 | } else {
|
2474 | $content.hide();
|
2475 | }
|
2476 |
|
2477 |
|
2478 | $title.on('click', function () {
|
2479 | if ($title.data('active')) {
|
2480 | return;
|
2481 | }
|
2482 |
|
2483 |
|
2484 | (0, _forEach["default"])(tabTitleArr).call(tabTitleArr, function ($title) {
|
2485 | $title.data('active', false);
|
2486 | $title.removeClass('w-e-active');
|
2487 | });
|
2488 | (0, _forEach["default"])(tabContentArr).call(tabContentArr, function ($content) {
|
2489 | $content.hide();
|
2490 | });
|
2491 |
|
2492 | $title.data('active', true);
|
2493 | $title.addClass('w-e-active');
|
2494 | $content.show();
|
2495 | });
|
2496 | });
|
2497 |
|
2498 | $container.on('click', function (e) {
|
2499 |
|
2500 | e.stopPropagation();
|
2501 | });
|
2502 |
|
2503 | menu.$elem.append($container);
|
2504 |
|
2505 | (0, _forEach["default"])(tabs).call(tabs, function (tab, index) {
|
2506 | if (!tab) {
|
2507 | return;
|
2508 | }
|
2509 |
|
2510 | var events = tab.events || [];
|
2511 | (0, _forEach["default"])(events).call(events, function (event) {
|
2512 | var selector = event.selector;
|
2513 | var type = event.type;
|
2514 | var fn = event.fn || const_1.EMPTY_FN;
|
2515 | var $content = tabContentArr[index];
|
2516 | (0, _find["default"])($content).call($content, selector).on(type, function (e) {
|
2517 | e.stopPropagation();
|
2518 | var needToHide = fn(e);
|
2519 |
|
2520 | if (needToHide) {
|
2521 | _this.remove();
|
2522 | }
|
2523 | });
|
2524 | });
|
2525 | });
|
2526 |
|
2527 | var $inputs = (0, _find["default"])($container).call($container, 'input[type=text],textarea');
|
2528 |
|
2529 | if ($inputs.length) {
|
2530 | $inputs.get(0).focus();
|
2531 | }
|
2532 |
|
2533 |
|
2534 | Panel.hideCurAllPanels();
|
2535 |
|
2536 | menu.setPanel(this);
|
2537 | Panel.createdMenus.add(menu);
|
2538 | };
|
2539 | |
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 | Panel.prototype.remove = function () {
|
2545 | var menu = this.menu;
|
2546 | var $container = this.$container;
|
2547 |
|
2548 | if ($container) {
|
2549 | $container.remove();
|
2550 | }
|
2551 |
|
2552 |
|
2553 | Panel.createdMenus["delete"](menu);
|
2554 | };
|
2555 | |
2556 |
|
2557 |
|
2558 |
|
2559 |
|
2560 | Panel.hideCurAllPanels = function () {
|
2561 | var _context;
|
2562 |
|
2563 | if (Panel.createdMenus.size === 0) {
|
2564 | return;
|
2565 | }
|
2566 |
|
2567 | (0, _forEach["default"])(_context = Panel.createdMenus).call(_context, function (menu) {
|
2568 | var panel = menu.panel;
|
2569 | panel && panel.remove();
|
2570 | });
|
2571 | };
|
2572 |
|
2573 |
|
2574 | Panel.createdMenus = new _set["default"]();
|
2575 | return Panel;
|
2576 | }();
|
2577 |
|
2578 | exports["default"] = Panel;
|
2579 |
|
2580 | }),
|
2581 |
|
2582 | (function(module, exports) {
|
2583 |
|
2584 | module.exports = function (it) {
|
2585 | if (typeof it != 'function') {
|
2586 | throw TypeError(String(it) + ' is not a function');
|
2587 | } return it;
|
2588 | };
|
2589 |
|
2590 |
|
2591 | }),
|
2592 |
|
2593 | (function(module, exports, __webpack_require__) {
|
2594 |
|
2595 | var bind = __webpack_require__(47);
|
2596 | var IndexedObject = __webpack_require__(69);
|
2597 | var toObject = __webpack_require__(38);
|
2598 | var toLength = __webpack_require__(36);
|
2599 | var arraySpeciesCreate = __webpack_require__(86);
|
2600 |
|
2601 | var push = [].push;
|
2602 |
|
2603 |
|
2604 | var createMethod = function (TYPE) {
|
2605 | var IS_MAP = TYPE == 1;
|
2606 | var IS_FILTER = TYPE == 2;
|
2607 | var IS_SOME = TYPE == 3;
|
2608 | var IS_EVERY = TYPE == 4;
|
2609 | var IS_FIND_INDEX = TYPE == 6;
|
2610 | var IS_FILTER_OUT = TYPE == 7;
|
2611 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
2612 | return function ($this, callbackfn, that, specificCreate) {
|
2613 | var O = toObject($this);
|
2614 | var self = IndexedObject(O);
|
2615 | var boundFunction = bind(callbackfn, that, 3);
|
2616 | var length = toLength(self.length);
|
2617 | var index = 0;
|
2618 | var create = specificCreate || arraySpeciesCreate;
|
2619 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
|
2620 | var value, result;
|
2621 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
2622 | value = self[index];
|
2623 | result = boundFunction(value, index, O);
|
2624 | if (TYPE) {
|
2625 | if (IS_MAP) target[index] = result;
|
2626 | else if (result) switch (TYPE) {
|
2627 | case 3: return true;
|
2628 | case 5: return value;
|
2629 | case 6: return index;
|
2630 | case 2: push.call(target, value);
|
2631 | } else switch (TYPE) {
|
2632 | case 4: return false;
|
2633 | case 7: push.call(target, value);
|
2634 | }
|
2635 | }
|
2636 | }
|
2637 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
2638 | };
|
2639 | };
|
2640 |
|
2641 | module.exports = {
|
2642 |
|
2643 |
|
2644 | forEach: createMethod(0),
|
2645 |
|
2646 |
|
2647 | map: createMethod(1),
|
2648 |
|
2649 |
|
2650 | filter: createMethod(2),
|
2651 |
|
2652 |
|
2653 | some: createMethod(3),
|
2654 |
|
2655 |
|
2656 | every: createMethod(4),
|
2657 |
|
2658 |
|
2659 | find: createMethod(5),
|
2660 |
|
2661 |
|
2662 | findIndex: createMethod(6),
|
2663 |
|
2664 |
|
2665 | filterOut: createMethod(7)
|
2666 | };
|
2667 |
|
2668 |
|
2669 | }),
|
2670 |
|
2671 | (function(module, exports, __webpack_require__) {
|
2672 |
|
2673 | "use strict";
|
2674 |
|
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 | var _interopRequireDefault = __webpack_require__(0);
|
2681 |
|
2682 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
2683 |
|
2684 | var _create = _interopRequireDefault(__webpack_require__(3));
|
2685 |
|
2686 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
2687 |
|
2688 | var __extends = void 0 && (void 0).__extends || function () {
|
2689 | var _extendStatics = function extendStatics(d, b) {
|
2690 | _extendStatics = _setPrototypeOf["default"] || {
|
2691 | __proto__: []
|
2692 | } instanceof Array && function (d, b) {
|
2693 | d.__proto__ = b;
|
2694 | } || function (d, b) {
|
2695 | for (var p in b) {
|
2696 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
2697 | }
|
2698 | };
|
2699 |
|
2700 | return _extendStatics(d, b);
|
2701 | };
|
2702 |
|
2703 | return function (d, b) {
|
2704 | _extendStatics(d, b);
|
2705 |
|
2706 | function __() {
|
2707 | this.constructor = d;
|
2708 | }
|
2709 |
|
2710 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
2711 | };
|
2712 | }();
|
2713 |
|
2714 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
2715 | return mod && mod.__esModule ? mod : {
|
2716 | "default": mod
|
2717 | };
|
2718 | };
|
2719 |
|
2720 | (0, _defineProperty["default"])(exports, "__esModule", {
|
2721 | value: true
|
2722 | });
|
2723 |
|
2724 | var Menu_1 = __importDefault(__webpack_require__(96));
|
2725 |
|
2726 | var PanelMenu =
|
2727 |
|
2728 | function (_super) {
|
2729 | __extends(PanelMenu, _super);
|
2730 |
|
2731 | function PanelMenu($elem, editor) {
|
2732 | return _super.call(this, $elem, editor) || this;
|
2733 | }
|
2734 | |
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 | PanelMenu.prototype.setPanel = function (panel) {
|
2741 | this.panel = panel;
|
2742 | };
|
2743 |
|
2744 | return PanelMenu;
|
2745 | }(Menu_1["default"]);
|
2746 |
|
2747 | exports["default"] = PanelMenu;
|
2748 |
|
2749 | }),
|
2750 |
|
2751 | (function(module, exports) {
|
2752 |
|
2753 | module.exports = function (bitmap, value) {
|
2754 | return {
|
2755 | enumerable: !(bitmap & 1),
|
2756 | configurable: !(bitmap & 2),
|
2757 | writable: !(bitmap & 4),
|
2758 | value: value
|
2759 | };
|
2760 | };
|
2761 |
|
2762 |
|
2763 | }),
|
2764 |
|
2765 | (function(module, exports, __webpack_require__) {
|
2766 |
|
2767 | var toInteger = __webpack_require__(58);
|
2768 |
|
2769 | var min = Math.min;
|
2770 |
|
2771 |
|
2772 |
|
2773 | module.exports = function (argument) {
|
2774 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
2775 | };
|
2776 |
|
2777 |
|
2778 | }),
|
2779 |
|
2780 | (function(module, exports) {
|
2781 |
|
2782 | module.exports = true;
|
2783 |
|
2784 |
|
2785 | }),
|
2786 |
|
2787 | (function(module, exports, __webpack_require__) {
|
2788 |
|
2789 | var requireObjectCoercible = __webpack_require__(46);
|
2790 |
|
2791 |
|
2792 |
|
2793 | module.exports = function (argument) {
|
2794 | return Object(requireObjectCoercible(argument));
|
2795 | };
|
2796 |
|
2797 |
|
2798 | }),
|
2799 |
|
2800 | (function(module, exports, __webpack_require__) {
|
2801 |
|
2802 | var anObject = __webpack_require__(24);
|
2803 | var isArrayIteratorMethod = __webpack_require__(160);
|
2804 | var toLength = __webpack_require__(36);
|
2805 | var bind = __webpack_require__(47);
|
2806 | var getIteratorMethod = __webpack_require__(161);
|
2807 | var iteratorClose = __webpack_require__(162);
|
2808 |
|
2809 | var Result = function (stopped, result) {
|
2810 | this.stopped = stopped;
|
2811 | this.result = result;
|
2812 | };
|
2813 |
|
2814 | module.exports = function (iterable, unboundFunction, options) {
|
2815 | var that = options && options.that;
|
2816 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
2817 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
2818 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
2819 | var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
|
2820 | var iterator, iterFn, index, length, result, next, step;
|
2821 |
|
2822 | var stop = function (condition) {
|
2823 | if (iterator) iteratorClose(iterator);
|
2824 | return new Result(true, condition);
|
2825 | };
|
2826 |
|
2827 | var callFn = function (value) {
|
2828 | if (AS_ENTRIES) {
|
2829 | anObject(value);
|
2830 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
2831 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
2832 | };
|
2833 |
|
2834 | if (IS_ITERATOR) {
|
2835 | iterator = iterable;
|
2836 | } else {
|
2837 | iterFn = getIteratorMethod(iterable);
|
2838 | if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
|
2839 |
|
2840 | if (isArrayIteratorMethod(iterFn)) {
|
2841 | for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
2842 | result = callFn(iterable[index]);
|
2843 | if (result && result instanceof Result) return result;
|
2844 | } return new Result(false);
|
2845 | }
|
2846 | iterator = iterFn.call(iterable);
|
2847 | }
|
2848 |
|
2849 | next = iterator.next;
|
2850 | while (!(step = next.call(iterator)).done) {
|
2851 | try {
|
2852 | result = callFn(step.value);
|
2853 | } catch (error) {
|
2854 | iteratorClose(iterator);
|
2855 | throw error;
|
2856 | }
|
2857 | if (typeof result == 'object' && result && result instanceof Result) return result;
|
2858 | } return new Result(false);
|
2859 | };
|
2860 |
|
2861 |
|
2862 | }),
|
2863 |
|
2864 | (function(module, exports) {
|
2865 |
|
2866 | module.exports = {};
|
2867 |
|
2868 |
|
2869 | }),
|
2870 |
|
2871 | (function(module, exports, __webpack_require__) {
|
2872 |
|
2873 | var TO_STRING_TAG_SUPPORT = __webpack_require__(79);
|
2874 | var defineProperty = __webpack_require__(18).f;
|
2875 | var createNonEnumerableProperty = __webpack_require__(17);
|
2876 | var has = __webpack_require__(15);
|
2877 | var toString = __webpack_require__(164);
|
2878 | var wellKnownSymbol = __webpack_require__(9);
|
2879 |
|
2880 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2881 |
|
2882 | module.exports = function (it, TAG, STATIC, SET_METHOD) {
|
2883 | if (it) {
|
2884 | var target = STATIC ? it : it.prototype;
|
2885 | if (!has(target, TO_STRING_TAG)) {
|
2886 | defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
2887 | }
|
2888 | if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
|
2889 | createNonEnumerableProperty(target, 'toString', toString);
|
2890 | }
|
2891 | }
|
2892 | };
|
2893 |
|
2894 |
|
2895 | }),
|
2896 |
|
2897 | (function(module, exports, __webpack_require__) {
|
2898 |
|
2899 | var NATIVE_WEAK_MAP = __webpack_require__(169);
|
2900 | var global = __webpack_require__(8);
|
2901 | var isObject = __webpack_require__(13);
|
2902 | var createNonEnumerableProperty = __webpack_require__(17);
|
2903 | var objectHas = __webpack_require__(15);
|
2904 | var shared = __webpack_require__(75);
|
2905 | var sharedKey = __webpack_require__(59);
|
2906 | var hiddenKeys = __webpack_require__(49);
|
2907 |
|
2908 | var WeakMap = global.WeakMap;
|
2909 | var set, get, has;
|
2910 |
|
2911 | var enforce = function (it) {
|
2912 | return has(it) ? get(it) : set(it, {});
|
2913 | };
|
2914 |
|
2915 | var getterFor = function (TYPE) {
|
2916 | return function (it) {
|
2917 | var state;
|
2918 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
2919 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
2920 | } return state;
|
2921 | };
|
2922 | };
|
2923 |
|
2924 | if (NATIVE_WEAK_MAP) {
|
2925 | var store = shared.state || (shared.state = new WeakMap());
|
2926 | var wmget = store.get;
|
2927 | var wmhas = store.has;
|
2928 | var wmset = store.set;
|
2929 | set = function (it, metadata) {
|
2930 | metadata.facade = it;
|
2931 | wmset.call(store, it, metadata);
|
2932 | return metadata;
|
2933 | };
|
2934 | get = function (it) {
|
2935 | return wmget.call(store, it) || {};
|
2936 | };
|
2937 | has = function (it) {
|
2938 | return wmhas.call(store, it);
|
2939 | };
|
2940 | } else {
|
2941 | var STATE = sharedKey('state');
|
2942 | hiddenKeys[STATE] = true;
|
2943 | set = function (it, metadata) {
|
2944 | metadata.facade = it;
|
2945 | createNonEnumerableProperty(it, STATE, metadata);
|
2946 | return metadata;
|
2947 | };
|
2948 | get = function (it) {
|
2949 | return objectHas(it, STATE) ? it[STATE] : {};
|
2950 | };
|
2951 | has = function (it) {
|
2952 | return objectHas(it, STATE);
|
2953 | };
|
2954 | }
|
2955 |
|
2956 | module.exports = {
|
2957 | set: set,
|
2958 | get: get,
|
2959 | has: has,
|
2960 | enforce: enforce,
|
2961 | getterFor: getterFor
|
2962 | };
|
2963 |
|
2964 |
|
2965 | /***/ }),
|
2966 | /* 43 */
|
2967 | /***/ (function(module, exports, __webpack_require__) {
|
2968 |
|
2969 | module.exports = __webpack_require__(257);
|
2970 |
|
2971 | }),
|
2972 |
|
2973 | (function(module, exports, __webpack_require__) {
|
2974 |
|
2975 | "use strict";
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 |
|
2982 | var _interopRequireDefault = __webpack_require__(0);
|
2983 |
|
2984 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
2985 |
|
2986 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
2987 |
|
2988 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
2989 | return mod && mod.__esModule ? mod : {
|
2990 | "default": mod
|
2991 | };
|
2992 | };
|
2993 |
|
2994 | (0, _defineProperty["default"])(exports, "__esModule", {
|
2995 | value: true
|
2996 | });
|
2997 |
|
2998 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
2999 |
|
3000 | var Tooltip =
|
3001 |
|
3002 | function () {
|
3003 | function Tooltip(editor, $elem, conf) {
|
3004 | this.editor = editor;
|
3005 | this.$targetElem = $elem;
|
3006 | this.conf = conf;
|
3007 | this._show = false;
|
3008 | this._isInsertTextContainer = false;
|
3009 |
|
3010 | var $container = dom_core_1["default"]('<div></div>');
|
3011 | $container.addClass('w-e-tooltip');
|
3012 | this.$container = $container;
|
3013 | }
|
3014 | |
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 | Tooltip.prototype.getPositionData = function () {
|
3020 | var $container = this.$container;
|
3021 | var top = 0;
|
3022 | var left = 0;
|
3023 |
|
3024 | var tooltipHeight = 20;
|
3025 |
|
3026 | var pageScrollTop = document.documentElement.scrollTop;
|
3027 |
|
3028 | var targetElemRect = this.$targetElem.getBoundingClientRect();
|
3029 |
|
3030 | var textElemRect = this.editor.$textElem.getBoundingClientRect();
|
3031 |
|
3032 | var targetOffset = this.$targetElem.getOffsetData();
|
3033 | var targetParentElem = dom_core_1["default"](targetOffset.parent);
|
3034 |
|
3035 | var scrollTop = this.editor.$textElem.elems[0].scrollTop;
|
3036 |
|
3037 | this._isInsertTextContainer = targetParentElem.equal(this.editor.$textContainerElem);
|
3038 |
|
3039 | if (this._isInsertTextContainer) {
|
3040 |
|
3041 | var targetParentElemHeight = targetParentElem.getClientHeight();
|
3042 |
|
3043 | var offsetTop = targetOffset.top,
|
3044 | offsetLeft = targetOffset.left,
|
3045 | offsetHeight = targetOffset.height;
|
3046 |
|
3047 | var absoluteTop = offsetTop - scrollTop;
|
3048 |
|
3049 | if (absoluteTop > tooltipHeight + 5) {
|
3050 |
|
3051 | top = absoluteTop - tooltipHeight - 15;
|
3052 | $container.addClass('w-e-tooltip-up');
|
3053 | } else if (absoluteTop + offsetHeight + tooltipHeight < targetParentElemHeight) {
|
3054 |
|
3055 | top = absoluteTop + offsetHeight + 10;
|
3056 | $container.addClass('w-e-tooltip-down');
|
3057 | } else {
|
3058 |
|
3059 | top = (absoluteTop > 0 ? absoluteTop : 0) + tooltipHeight + 10;
|
3060 | $container.addClass('w-e-tooltip-down');
|
3061 | }
|
3062 |
|
3063 |
|
3064 | if (offsetLeft < 0) {
|
3065 | left = 0;
|
3066 | } else {
|
3067 | left = offsetLeft;
|
3068 | }
|
3069 | } else {
|
3070 | if (targetElemRect.top < tooltipHeight) {
|
3071 |
|
3072 | top = targetElemRect.bottom + pageScrollTop + 5;
|
3073 |
|
3074 | $container.addClass('w-e-tooltip-down');
|
3075 | } else if (targetElemRect.top - textElemRect.top < tooltipHeight) {
|
3076 |
|
3077 | top = targetElemRect.bottom + pageScrollTop + 5;
|
3078 |
|
3079 | $container.addClass('w-e-tooltip-down');
|
3080 | } else {
|
3081 |
|
3082 | top = targetElemRect.top + pageScrollTop - tooltipHeight - 15;
|
3083 |
|
3084 | $container.addClass('w-e-tooltip-up');
|
3085 | }
|
3086 |
|
3087 |
|
3088 | if (targetElemRect.left < 0) {
|
3089 | left = 0;
|
3090 | } else {
|
3091 | left = targetElemRect.left;
|
3092 | }
|
3093 | }
|
3094 |
|
3095 |
|
3096 | return {
|
3097 | top: top,
|
3098 | left: left
|
3099 | };
|
3100 | };
|
3101 | |
3102 |
|
3103 |
|
3104 |
|
3105 |
|
3106 | Tooltip.prototype.appendMenus = function () {
|
3107 | var _this = this;
|
3108 |
|
3109 | var conf = this.conf;
|
3110 | var editor = this.editor;
|
3111 | var $targetElem = this.$targetElem;
|
3112 | var $container = this.$container;
|
3113 | (0, _forEach["default"])(conf).call(conf, function (item, index) {
|
3114 |
|
3115 | var $elem = item.$elem;
|
3116 | var $wrapper = dom_core_1["default"]('<div></div>');
|
3117 | $wrapper.addClass('w-e-tooltip-item-wrapper ');
|
3118 | $wrapper.append($elem);
|
3119 | $container.append($wrapper);
|
3120 |
|
3121 | $elem.on('click', function (e) {
|
3122 | e.preventDefault();
|
3123 | var res = item.onClick(editor, $targetElem);
|
3124 | if (res) _this.remove();
|
3125 | });
|
3126 | });
|
3127 | };
|
3128 | |
3129 |
|
3130 |
|
3131 |
|
3132 |
|
3133 | Tooltip.prototype.create = function () {
|
3134 | var editor = this.editor;
|
3135 | var $container = this.$container;
|
3136 |
|
3137 | this.appendMenus();
|
3138 |
|
3139 | var _a = this.getPositionData(),
|
3140 | top = _a.top,
|
3141 | left = _a.left;
|
3142 |
|
3143 | $container.css('top', top + "px");
|
3144 | $container.css('left', left + "px");
|
3145 |
|
3146 | $container.css('z-index', editor.zIndex.get('tooltip'));
|
3147 |
|
3148 | if (this._isInsertTextContainer) {
|
3149 | this.editor.$textContainerElem.append($container);
|
3150 | } else {
|
3151 | dom_core_1["default"]('body').append($container);
|
3152 | }
|
3153 |
|
3154 | this._show = true;
|
3155 | };
|
3156 | |
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 | Tooltip.prototype.remove = function () {
|
3162 | this.$container.remove();
|
3163 | this._show = false;
|
3164 | };
|
3165 |
|
3166 | (0, _defineProperty["default"])(Tooltip.prototype, "isShow", {
|
3167 | |
3168 |
|
3169 |
|
3170 | get: function get() {
|
3171 | return this._show;
|
3172 | },
|
3173 | enumerable: false,
|
3174 | configurable: true
|
3175 | });
|
3176 | return Tooltip;
|
3177 | }();
|
3178 |
|
3179 | exports["default"] = Tooltip;
|
3180 |
|
3181 | }),
|
3182 |
|
3183 | (function(module, exports) {
|
3184 |
|
3185 | var toString = {}.toString;
|
3186 |
|
3187 | module.exports = function (it) {
|
3188 | return toString.call(it).slice(8, -1);
|
3189 | };
|
3190 |
|
3191 |
|
3192 | }),
|
3193 |
|
3194 | (function(module, exports) {
|
3195 |
|
3196 |
|
3197 |
|
3198 | module.exports = function (it) {
|
3199 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
3200 | return it;
|
3201 | };
|
3202 |
|
3203 |
|
3204 | }),
|
3205 |
|
3206 | (function(module, exports, __webpack_require__) {
|
3207 |
|
3208 | var aFunction = __webpack_require__(32);
|
3209 |
|
3210 |
|
3211 | module.exports = function (fn, that, length) {
|
3212 | aFunction(fn);
|
3213 | if (that === undefined) return fn;
|
3214 | switch (length) {
|
3215 | case 0: return function () {
|
3216 | return fn.call(that);
|
3217 | };
|
3218 | case 1: return function (a) {
|
3219 | return fn.call(that, a);
|
3220 | };
|
3221 | case 2: return function (a, b) {
|
3222 | return fn.call(that, a, b);
|
3223 | };
|
3224 | case 3: return function (a, b, c) {
|
3225 | return fn.call(that, a, b, c);
|
3226 | };
|
3227 | }
|
3228 | return function (/* ...args */) {
|
3229 | return fn.apply(that, arguments);
|
3230 | };
|
3231 | };
|
3232 |
|
3233 |
|
3234 | }),
|
3235 |
|
3236 | (function(module, exports, __webpack_require__) {
|
3237 |
|
3238 | var anObject = __webpack_require__(24);
|
3239 | var defineProperties = __webpack_require__(137);
|
3240 | var enumBugKeys = __webpack_require__(73);
|
3241 | var hiddenKeys = __webpack_require__(49);
|
3242 | var html = __webpack_require__(103);
|
3243 | var documentCreateElement = __webpack_require__(70);
|
3244 | var sharedKey = __webpack_require__(59);
|
3245 |
|
3246 | var GT = '>';
|
3247 | var LT = '<';
|
3248 | var PROTOTYPE = 'prototype';
|
3249 | var SCRIPT = 'script';
|
3250 | var IE_PROTO = sharedKey('IE_PROTO');
|
3251 |
|
3252 | var EmptyConstructor = function () { };
|
3253 |
|
3254 | var scriptTag = function (content) {
|
3255 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
3256 | };
|
3257 |
|
3258 |
|
3259 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
3260 | activeXDocument.write(scriptTag(''));
|
3261 | activeXDocument.close();
|
3262 | var temp = activeXDocument.parentWindow.Object;
|
3263 | activeXDocument = null;
|
3264 | return temp;
|
3265 | };
|
3266 |
|
3267 |
|
3268 | var NullProtoObjectViaIFrame = function () {
|
3269 |
|
3270 | var iframe = documentCreateElement('iframe');
|
3271 | var JS = 'java' + SCRIPT + ':';
|
3272 | var iframeDocument;
|
3273 | iframe.style.display = 'none';
|
3274 | html.appendChild(iframe);
|
3275 |
|
3276 | iframe.src = String(JS);
|
3277 | iframeDocument = iframe.contentWindow.document;
|
3278 | iframeDocument.open();
|
3279 | iframeDocument.write(scriptTag('document.F=Object'));
|
3280 | iframeDocument.close();
|
3281 | return iframeDocument.F;
|
3282 | };
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 | var activeXDocument;
|
3290 | var NullProtoObject = function () {
|
3291 | try {
|
3292 |
|
3293 | activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
3294 | } catch (error) { }
|
3295 | NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
3296 | var length = enumBugKeys.length;
|
3297 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
3298 | return NullProtoObject();
|
3299 | };
|
3300 |
|
3301 | hiddenKeys[IE_PROTO] = true;
|
3302 |
|
3303 |
|
3304 |
|
3305 | module.exports = Object.create || function create(O, Properties) {
|
3306 | var result;
|
3307 | if (O !== null) {
|
3308 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
3309 | result = new EmptyConstructor();
|
3310 | EmptyConstructor[PROTOTYPE] = null;
|
3311 |
|
3312 | result[IE_PROTO] = O;
|
3313 | } else result = NullProtoObject();
|
3314 | return Properties === undefined ? result : defineProperties(result, Properties);
|
3315 | };
|
3316 |
|
3317 |
|
3318 | }),
|
3319 |
|
3320 | (function(module, exports) {
|
3321 |
|
3322 | module.exports = {};
|
3323 |
|
3324 |
|
3325 | }),
|
3326 |
|
3327 | (function(module, exports, __webpack_require__) {
|
3328 |
|
3329 | var createNonEnumerableProperty = __webpack_require__(17);
|
3330 |
|
3331 | module.exports = function (target, key, value, options) {
|
3332 | if (options && options.enumerable) target[key] = value;
|
3333 | else createNonEnumerableProperty(target, key, value);
|
3334 | };
|
3335 |
|
3336 |
|
3337 | }),
|
3338 |
|
3339 | (function(module, exports, __webpack_require__) {
|
3340 |
|
3341 | __webpack_require__(175);
|
3342 | var DOMIterables = __webpack_require__(176);
|
3343 | var global = __webpack_require__(8);
|
3344 | var classof = __webpack_require__(61);
|
3345 | var createNonEnumerableProperty = __webpack_require__(17);
|
3346 | var Iterators = __webpack_require__(40);
|
3347 | var wellKnownSymbol = __webpack_require__(9);
|
3348 |
|
3349 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
3350 |
|
3351 | for (var COLLECTION_NAME in DOMIterables) {
|
3352 | var Collection = global[COLLECTION_NAME];
|
3353 | var CollectionPrototype = Collection && Collection.prototype;
|
3354 | if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
|
3355 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
3356 | }
|
3357 | Iterators[COLLECTION_NAME] = Iterators.Array;
|
3358 | }
|
3359 |
|
3360 |
|
3361 | }),
|
3362 |
|
3363 | (function(module, exports, __webpack_require__) {
|
3364 |
|
3365 | var classof = __webpack_require__(45);
|
3366 |
|
3367 |
|
3368 |
|
3369 | module.exports = Array.isArray || function isArray(arg) {
|
3370 | return classof(arg) == 'Array';
|
3371 | };
|
3372 |
|
3373 |
|
3374 | }),
|
3375 |
|
3376 | (function(module, exports, __webpack_require__) {
|
3377 |
|
3378 | var fails = __webpack_require__(12);
|
3379 | var wellKnownSymbol = __webpack_require__(9);
|
3380 | var V8_VERSION = __webpack_require__(83);
|
3381 |
|
3382 | var SPECIES = wellKnownSymbol('species');
|
3383 |
|
3384 | module.exports = function (METHOD_NAME) {
|
3385 |
|
3386 |
|
3387 |
|
3388 | return V8_VERSION >= 51 || !fails(function () {
|
3389 | var array = [];
|
3390 | var constructor = array.constructor = {};
|
3391 | constructor[SPECIES] = function () {
|
3392 | return { foo: 1 };
|
3393 | };
|
3394 | return array[METHOD_NAME](Boolean).foo !== 1;
|
3395 | });
|
3396 | };
|
3397 |
|
3398 |
|
3399 | }),
|
3400 |
|
3401 | (function(module, exports, __webpack_require__) {
|
3402 |
|
3403 | module.exports = __webpack_require__(205);
|
3404 |
|
3405 | }),
|
3406 |
|
3407 | (function(module, exports, __webpack_require__) {
|
3408 |
|
3409 | "use strict";
|
3410 |
|
3411 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
3412 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
3413 |
|
3414 |
|
3415 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
3416 |
|
3417 |
|
3418 |
|
3419 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
3420 | var descriptor = getOwnPropertyDescriptor(this, V);
|
3421 | return !!descriptor && descriptor.enumerable;
|
3422 | } : nativePropertyIsEnumerable;
|
3423 |
|
3424 |
|
3425 | }),
|
3426 |
|
3427 | (function(module, exports, __webpack_require__) {
|
3428 |
|
3429 | var isObject = __webpack_require__(13);
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 | module.exports = function (input, PREFERRED_STRING) {
|
3436 | if (!isObject(input)) return input;
|
3437 | var fn, val;
|
3438 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
3439 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
3440 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
3441 | throw TypeError("Can't convert object to primitive value");
|
3442 | };
|
3443 |
|
3444 |
|
3445 | }),
|
3446 |
|
3447 | (function(module, exports, __webpack_require__) {
|
3448 |
|
3449 | var internalObjectKeys = __webpack_require__(102);
|
3450 | var enumBugKeys = __webpack_require__(73);
|
3451 |
|
3452 |
|
3453 |
|
3454 | module.exports = Object.keys || function keys(O) {
|
3455 | return internalObjectKeys(O, enumBugKeys);
|
3456 | };
|
3457 |
|
3458 |
|
3459 | }),
|
3460 |
|
3461 | (function(module, exports) {
|
3462 |
|
3463 | var ceil = Math.ceil;
|
3464 | var floor = Math.floor;
|
3465 |
|
3466 |
|
3467 |
|
3468 | module.exports = function (argument) {
|
3469 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
3470 | };
|
3471 |
|
3472 |
|
3473 | }),
|
3474 |
|
3475 | (function(module, exports, __webpack_require__) {
|
3476 |
|
3477 | var shared = __webpack_require__(74);
|
3478 | var uid = __webpack_require__(60);
|
3479 |
|
3480 | var keys = shared('keys');
|
3481 |
|
3482 | module.exports = function (key) {
|
3483 | return keys[key] || (keys[key] = uid(key));
|
3484 | };
|
3485 |
|
3486 |
|
3487 | }),
|
3488 |
|
3489 | (function(module, exports) {
|
3490 |
|
3491 | var id = 0;
|
3492 | var postfix = Math.random();
|
3493 |
|
3494 | module.exports = function (key) {
|
3495 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
3496 | };
|
3497 |
|
3498 |
|
3499 | }),
|
3500 |
|
3501 | (function(module, exports, __webpack_require__) {
|
3502 |
|
3503 | var TO_STRING_TAG_SUPPORT = __webpack_require__(79);
|
3504 | var classofRaw = __webpack_require__(45);
|
3505 | var wellKnownSymbol = __webpack_require__(9);
|
3506 |
|
3507 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
3508 |
|
3509 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
3510 |
|
3511 |
|
3512 | var tryGet = function (it, key) {
|
3513 | try {
|
3514 | return it[key];
|
3515 | } catch (error) { }
|
3516 | };
|
3517 |
|
3518 |
|
3519 | module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
3520 | var O, tag, result;
|
3521 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
3522 |
|
3523 | : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
|
3524 |
|
3525 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
3526 |
|
3527 | : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
3528 | };
|
3529 |
|
3530 |
|
3531 | }),
|
3532 |
|
3533 | (function(module, exports) {
|
3534 |
|
3535 |
|
3536 |
|
3537 |
|
3538 | }),
|
3539 |
|
3540 | (function(module, exports, __webpack_require__) {
|
3541 |
|
3542 | var getBuiltIn = __webpack_require__(28);
|
3543 |
|
3544 | module.exports = getBuiltIn('navigator', 'userAgent') || '';
|
3545 |
|
3546 |
|
3547 | }),
|
3548 |
|
3549 | (function(module, exports, __webpack_require__) {
|
3550 |
|
3551 | "use strict";
|
3552 |
|
3553 | var aFunction = __webpack_require__(32);
|
3554 |
|
3555 | var PromiseCapability = function (C) {
|
3556 | var resolve, reject;
|
3557 | this.promise = new C(function ($$resolve, $$reject) {
|
3558 | if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
3559 | resolve = $$resolve;
|
3560 | reject = $$reject;
|
3561 | });
|
3562 | this.resolve = aFunction(resolve);
|
3563 | this.reject = aFunction(reject);
|
3564 | };
|
3565 |
|
3566 |
|
3567 | module.exports.f = function (C) {
|
3568 | return new PromiseCapability(C);
|
3569 | };
|
3570 |
|
3571 |
|
3572 | }),
|
3573 |
|
3574 | (function(module, exports, __webpack_require__) {
|
3575 |
|
3576 | "use strict";
|
3577 |
|
3578 | var charAt = __webpack_require__(173).charAt;
|
3579 | var InternalStateModule = __webpack_require__(42);
|
3580 | var defineIterator = __webpack_require__(84);
|
3581 |
|
3582 | var STRING_ITERATOR = 'String Iterator';
|
3583 | var setInternalState = InternalStateModule.set;
|
3584 | var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
|
3585 |
|
3586 |
|
3587 |
|
3588 | defineIterator(String, 'String', function (iterated) {
|
3589 | setInternalState(this, {
|
3590 | type: STRING_ITERATOR,
|
3591 | string: String(iterated),
|
3592 | index: 0
|
3593 | });
|
3594 |
|
3595 |
|
3596 | }, function next() {
|
3597 | var state = getInternalState(this);
|
3598 | var string = state.string;
|
3599 | var index = state.index;
|
3600 | var point;
|
3601 | if (index >= string.length) return { value: undefined, done: true };
|
3602 | point = charAt(string, index);
|
3603 | state.index += point.length;
|
3604 | return { value: point, done: false };
|
3605 | });
|
3606 |
|
3607 |
|
3608 | }),
|
3609 |
|
3610 | (function(module, exports, __webpack_require__) {
|
3611 |
|
3612 | module.exports = __webpack_require__(197);
|
3613 |
|
3614 | }),
|
3615 |
|
3616 | (function(module, exports) {
|
3617 |
|
3618 |
|
3619 |
|
3620 | module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
3621 |
|
3622 |
|
3623 | }),
|
3624 |
|
3625 | (function(module, exports, __webpack_require__) {
|
3626 |
|
3627 | var DESCRIPTORS = __webpack_require__(14);
|
3628 | var propertyIsEnumerableModule = __webpack_require__(55);
|
3629 | var createPropertyDescriptor = __webpack_require__(35);
|
3630 | var toIndexedObject = __webpack_require__(27);
|
3631 | var toPrimitive = __webpack_require__(56);
|
3632 | var has = __webpack_require__(15);
|
3633 | var IE8_DOM_DEFINE = __webpack_require__(100);
|
3634 |
|
3635 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
3636 |
|
3637 |
|
3638 |
|
3639 | exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
3640 | O = toIndexedObject(O);
|
3641 | P = toPrimitive(P, true);
|
3642 | if (IE8_DOM_DEFINE) try {
|
3643 | return nativeGetOwnPropertyDescriptor(O, P);
|
3644 | } catch (error) { }
|
3645 | if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
|
3646 | };
|
3647 |
|
3648 |
|
3649 | }),
|
3650 |
|
3651 | (function(module, exports, __webpack_require__) {
|
3652 |
|
3653 | var fails = __webpack_require__(12);
|
3654 | var classof = __webpack_require__(45);
|
3655 |
|
3656 | var split = ''.split;
|
3657 |
|
3658 |
|
3659 | module.exports = fails(function () {
|
3660 |
|
3661 |
|
3662 | return !Object('z').propertyIsEnumerable(0);
|
3663 | }) ? function (it) {
|
3664 | return classof(it) == 'String' ? split.call(it, '') : Object(it);
|
3665 | } : Object;
|
3666 |
|
3667 |
|
3668 | }),
|
3669 |
|
3670 | (function(module, exports, __webpack_require__) {
|
3671 |
|
3672 | var global = __webpack_require__(8);
|
3673 | var isObject = __webpack_require__(13);
|
3674 |
|
3675 | var document = global.document;
|
3676 |
|
3677 | var EXISTS = isObject(document) && isObject(document.createElement);
|
3678 |
|
3679 | module.exports = function (it) {
|
3680 | return EXISTS ? document.createElement(it) : {};
|
3681 | };
|
3682 |
|
3683 |
|
3684 | }),
|
3685 |
|
3686 | (function(module, exports, __webpack_require__) {
|
3687 |
|
3688 | var toIndexedObject = __webpack_require__(27);
|
3689 | var toLength = __webpack_require__(36);
|
3690 | var toAbsoluteIndex = __webpack_require__(72);
|
3691 |
|
3692 |
|
3693 | var createMethod = function (IS_INCLUDES) {
|
3694 | return function ($this, el, fromIndex) {
|
3695 | var O = toIndexedObject($this);
|
3696 | var length = toLength(O.length);
|
3697 | var index = toAbsoluteIndex(fromIndex, length);
|
3698 | var value;
|
3699 |
|
3700 |
|
3701 | if (IS_INCLUDES && el != el) while (length > index) {
|
3702 | value = O[index++];
|
3703 |
|
3704 | if (value != value) return true;
|
3705 |
|
3706 | } else for (;length > index; index++) {
|
3707 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
3708 | } return !IS_INCLUDES && -1;
|
3709 | };
|
3710 | };
|
3711 |
|
3712 | module.exports = {
|
3713 |
|
3714 |
|
3715 | includes: createMethod(true),
|
3716 |
|
3717 |
|
3718 | indexOf: createMethod(false)
|
3719 | };
|
3720 |
|
3721 |
|
3722 | }),
|
3723 |
|
3724 | (function(module, exports, __webpack_require__) {
|
3725 |
|
3726 | var toInteger = __webpack_require__(58);
|
3727 |
|
3728 | var max = Math.max;
|
3729 | var min = Math.min;
|
3730 |
|
3731 |
|
3732 |
|
3733 |
|
3734 | module.exports = function (index, length) {
|
3735 | var integer = toInteger(index);
|
3736 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
3737 | };
|
3738 |
|
3739 |
|
3740 | }),
|
3741 |
|
3742 | (function(module, exports) {
|
3743 |
|
3744 |
|
3745 | module.exports = [
|
3746 | 'constructor',
|
3747 | 'hasOwnProperty',
|
3748 | 'isPrototypeOf',
|
3749 | 'propertyIsEnumerable',
|
3750 | 'toLocaleString',
|
3751 | 'toString',
|
3752 | 'valueOf'
|
3753 | ];
|
3754 |
|
3755 |
|
3756 | }),
|
3757 |
|
3758 | (function(module, exports, __webpack_require__) {
|
3759 |
|
3760 | var IS_PURE = __webpack_require__(37);
|
3761 | var store = __webpack_require__(75);
|
3762 |
|
3763 | (module.exports = function (key, value) {
|
3764 | return store[key] || (store[key] = value !== undefined ? value : {});
|
3765 | })('versions', []).push({
|
3766 | version: '3.8.2',
|
3767 | mode: IS_PURE ? 'pure' : 'global',
|
3768 | copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
3769 | });
|
3770 |
|
3771 |
|
3772 | }),
|
3773 |
|
3774 | (function(module, exports, __webpack_require__) {
|
3775 |
|
3776 | var global = __webpack_require__(8);
|
3777 | var setGlobal = __webpack_require__(138);
|
3778 |
|
3779 | var SHARED = '__core-js_shared__';
|
3780 | var store = global[SHARED] || setGlobal(SHARED, {});
|
3781 |
|
3782 | module.exports = store;
|
3783 |
|
3784 |
|
3785 | }),
|
3786 |
|
3787 | (function(module, exports, __webpack_require__) {
|
3788 |
|
3789 | var has = __webpack_require__(15);
|
3790 | var toObject = __webpack_require__(38);
|
3791 | var sharedKey = __webpack_require__(59);
|
3792 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(158);
|
3793 |
|
3794 | var IE_PROTO = sharedKey('IE_PROTO');
|
3795 | var ObjectPrototype = Object.prototype;
|
3796 |
|
3797 |
|
3798 |
|
3799 | module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
3800 | O = toObject(O);
|
3801 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
3802 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
3803 | return O.constructor.prototype;
|
3804 | } return O instanceof Object ? ObjectPrototype : null;
|
3805 | };
|
3806 |
|
3807 |
|
3808 | }),
|
3809 |
|
3810 | (function(module, exports, __webpack_require__) {
|
3811 |
|
3812 | var anObject = __webpack_require__(24);
|
3813 | var aPossiblePrototype = __webpack_require__(159);
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 | module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
3820 | var CORRECT_SETTER = false;
|
3821 | var test = {};
|
3822 | var setter;
|
3823 | try {
|
3824 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
3825 | setter.call(test, []);
|
3826 | CORRECT_SETTER = test instanceof Array;
|
3827 | } catch (error) { }
|
3828 | return function setPrototypeOf(O, proto) {
|
3829 | anObject(O);
|
3830 | aPossiblePrototype(proto);
|
3831 | if (CORRECT_SETTER) setter.call(O, proto);
|
3832 | else O.__proto__ = proto;
|
3833 | return O;
|
3834 | };
|
3835 | }() : undefined);
|
3836 |
|
3837 |
|
3838 | }),
|
3839 |
|
3840 | (function(module, exports, __webpack_require__) {
|
3841 |
|
3842 | var fails = __webpack_require__(12);
|
3843 |
|
3844 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
3845 |
|
3846 |
|
3847 | return !String(Symbol());
|
3848 | });
|
3849 |
|
3850 |
|
3851 | }),
|
3852 |
|
3853 | (function(module, exports, __webpack_require__) {
|
3854 |
|
3855 | var wellKnownSymbol = __webpack_require__(9);
|
3856 |
|
3857 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
3858 | var test = {};
|
3859 |
|
3860 | test[TO_STRING_TAG] = 'z';
|
3861 |
|
3862 | module.exports = String(test) === '[object z]';
|
3863 |
|
3864 |
|
3865 | }),
|
3866 |
|
3867 | (function(module, exports) {
|
3868 |
|
3869 | module.exports = function (it, Constructor, name) {
|
3870 | if (!(it instanceof Constructor)) {
|
3871 | throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
|
3872 | } return it;
|
3873 | };
|
3874 |
|
3875 |
|
3876 | }),
|
3877 |
|
3878 | (function(module, exports, __webpack_require__) {
|
3879 |
|
3880 | var classof = __webpack_require__(45);
|
3881 | var global = __webpack_require__(8);
|
3882 |
|
3883 | module.exports = classof(global.process) == 'process';
|
3884 |
|
3885 |
|
3886 | }),
|
3887 |
|
3888 | (function(module, exports) {
|
3889 |
|
3890 | module.exports = function (exec) {
|
3891 | try {
|
3892 | return { error: false, value: exec() };
|
3893 | } catch (error) {
|
3894 | return { error: true, value: error };
|
3895 | }
|
3896 | };
|
3897 |
|
3898 |
|
3899 | }),
|
3900 |
|
3901 | (function(module, exports, __webpack_require__) {
|
3902 |
|
3903 | var global = __webpack_require__(8);
|
3904 | var userAgent = __webpack_require__(63);
|
3905 |
|
3906 | var process = global.process;
|
3907 | var versions = process && process.versions;
|
3908 | var v8 = versions && versions.v8;
|
3909 | var match, version;
|
3910 |
|
3911 | if (v8) {
|
3912 | match = v8.split('.');
|
3913 | version = match[0] + match[1];
|
3914 | } else if (userAgent) {
|
3915 | match = userAgent.match(/Edge\/(\d+)/);
|
3916 | if (!match || match[1] >= 74) {
|
3917 | match = userAgent.match(/Chrome\/(\d+)/);
|
3918 | if (match) version = match[1];
|
3919 | }
|
3920 | }
|
3921 |
|
3922 | module.exports = version && +version;
|
3923 |
|
3924 |
|
3925 | }),
|
3926 |
|
3927 | (function(module, exports, __webpack_require__) {
|
3928 |
|
3929 | "use strict";
|
3930 |
|
3931 | var $ = __webpack_require__(4);
|
3932 | var createIteratorConstructor = __webpack_require__(174);
|
3933 | var getPrototypeOf = __webpack_require__(76);
|
3934 | var setPrototypeOf = __webpack_require__(77);
|
3935 | var setToStringTag = __webpack_require__(41);
|
3936 | var createNonEnumerableProperty = __webpack_require__(17);
|
3937 | var redefine = __webpack_require__(50);
|
3938 | var wellKnownSymbol = __webpack_require__(9);
|
3939 | var IS_PURE = __webpack_require__(37);
|
3940 | var Iterators = __webpack_require__(40);
|
3941 | var IteratorsCore = __webpack_require__(113);
|
3942 |
|
3943 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
3944 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
3945 | var ITERATOR = wellKnownSymbol('iterator');
|
3946 | var KEYS = 'keys';
|
3947 | var VALUES = 'values';
|
3948 | var ENTRIES = 'entries';
|
3949 |
|
3950 | var returnThis = function () { return this; };
|
3951 |
|
3952 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
3953 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
3954 |
|
3955 | var getIterationMethod = function (KIND) {
|
3956 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
3957 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
3958 | switch (KIND) {
|
3959 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
3960 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
3961 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
3962 | } return function () { return new IteratorConstructor(this); };
|
3963 | };
|
3964 |
|
3965 | var TO_STRING_TAG = NAME + ' Iterator';
|
3966 | var INCORRECT_VALUES_NAME = false;
|
3967 | var IterablePrototype = Iterable.prototype;
|
3968 | var nativeIterator = IterablePrototype[ITERATOR]
|
3969 | || IterablePrototype['@@iterator']
|
3970 | || DEFAULT && IterablePrototype[DEFAULT];
|
3971 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
3972 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
3973 | var CurrentIteratorPrototype, methods, KEY;
|
3974 |
|
3975 |
|
3976 | if (anyNativeIterator) {
|
3977 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
3978 | if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
3979 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
3980 | if (setPrototypeOf) {
|
3981 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
3982 | } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
|
3983 | createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
|
3984 | }
|
3985 | }
|
3986 |
|
3987 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
3988 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
|
3989 | }
|
3990 | }
|
3991 |
|
3992 |
|
3993 | if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
3994 | INCORRECT_VALUES_NAME = true;
|
3995 | defaultIterator = function values() { return nativeIterator.call(this); };
|
3996 | }
|
3997 |
|
3998 |
|
3999 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
4000 | createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
|
4001 | }
|
4002 | Iterators[NAME] = defaultIterator;
|
4003 |
|
4004 |
|
4005 | if (DEFAULT) {
|
4006 | methods = {
|
4007 | values: getIterationMethod(VALUES),
|
4008 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
4009 | entries: getIterationMethod(ENTRIES)
|
4010 | };
|
4011 | if (FORCED) for (KEY in methods) {
|
4012 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
4013 | redefine(IterablePrototype, KEY, methods[KEY]);
|
4014 | }
|
4015 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
4016 | }
|
4017 |
|
4018 | return methods;
|
4019 | };
|
4020 |
|
4021 |
|
4022 | }),
|
4023 |
|
4024 | (function(module, exports) {
|
4025 |
|
4026 | module.exports = function () { };
|
4027 |
|
4028 |
|
4029 | }),
|
4030 |
|
4031 | (function(module, exports, __webpack_require__) {
|
4032 |
|
4033 | var isObject = __webpack_require__(13);
|
4034 | var isArray = __webpack_require__(52);
|
4035 | var wellKnownSymbol = __webpack_require__(9);
|
4036 |
|
4037 | var SPECIES = wellKnownSymbol('species');
|
4038 |
|
4039 |
|
4040 |
|
4041 | module.exports = function (originalArray, length) {
|
4042 | var C;
|
4043 | if (isArray(originalArray)) {
|
4044 | C = originalArray.constructor;
|
4045 |
|
4046 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
4047 | else if (isObject(C)) {
|
4048 | C = C[SPECIES];
|
4049 | if (C === null) C = undefined;
|
4050 | }
|
4051 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
4052 | };
|
4053 |
|
4054 |
|
4055 | }),
|
4056 |
|
4057 | (function(module, exports, __webpack_require__) {
|
4058 |
|
4059 | "use strict";
|
4060 |
|
4061 | var fails = __webpack_require__(12);
|
4062 |
|
4063 | module.exports = function (METHOD_NAME, argument) {
|
4064 | var method = [][METHOD_NAME];
|
4065 | return !!method && fails(function () {
|
4066 |
|
4067 | method.call(null, argument || function () { throw 1; }, 1);
|
4068 | });
|
4069 | };
|
4070 |
|
4071 |
|
4072 | }),
|
4073 |
|
4074 | (function(module, exports, __webpack_require__) {
|
4075 |
|
4076 | module.exports = __webpack_require__(183);
|
4077 |
|
4078 | }),
|
4079 |
|
4080 | (function(module, exports, __webpack_require__) {
|
4081 |
|
4082 | module.exports = __webpack_require__(188);
|
4083 |
|
4084 | }),
|
4085 |
|
4086 | (function(module, exports, __webpack_require__) {
|
4087 |
|
4088 | module.exports = __webpack_require__(201);
|
4089 |
|
4090 | }),
|
4091 |
|
4092 | (function(module, exports, __webpack_require__) {
|
4093 |
|
4094 | "use strict";
|
4095 |
|
4096 | var toPrimitive = __webpack_require__(56);
|
4097 | var definePropertyModule = __webpack_require__(18);
|
4098 | var createPropertyDescriptor = __webpack_require__(35);
|
4099 |
|
4100 | module.exports = function (object, key, value) {
|
4101 | var propertyKey = toPrimitive(key);
|
4102 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
4103 | else object[propertyKey] = value;
|
4104 | };
|
4105 |
|
4106 |
|
4107 | }),
|
4108 |
|
4109 | (function(module, exports, __webpack_require__) {
|
4110 |
|
4111 | var requireObjectCoercible = __webpack_require__(46);
|
4112 | var whitespaces = __webpack_require__(67);
|
4113 |
|
4114 | var whitespace = '[' + whitespaces + ']';
|
4115 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
4116 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
4117 |
|
4118 |
|
4119 | var createMethod = function (TYPE) {
|
4120 | return function ($this) {
|
4121 | var string = String(requireObjectCoercible($this));
|
4122 | if (TYPE & 1) string = string.replace(ltrim, '');
|
4123 | if (TYPE & 2) string = string.replace(rtrim, '');
|
4124 | return string;
|
4125 | };
|
4126 | };
|
4127 |
|
4128 | module.exports = {
|
4129 |
|
4130 |
|
4131 | start: createMethod(1),
|
4132 |
|
4133 |
|
4134 | end: createMethod(2),
|
4135 |
|
4136 |
|
4137 | trim: createMethod(3)
|
4138 | };
|
4139 |
|
4140 |
|
4141 | }),
|
4142 |
|
4143 | (function(module, exports, __webpack_require__) {
|
4144 |
|
4145 | module.exports = __webpack_require__(222);
|
4146 |
|
4147 | }),
|
4148 |
|
4149 | (function(module, exports, __webpack_require__) {
|
4150 |
|
4151 | var _Symbol$iterator = __webpack_require__(225);
|
4152 |
|
4153 | var _Symbol = __webpack_require__(228);
|
4154 |
|
4155 | function _typeof(obj) {
|
4156 | "@babel/helpers - typeof";
|
4157 |
|
4158 | if (typeof _Symbol === "function" && typeof _Symbol$iterator === "symbol") {
|
4159 | module.exports = _typeof = function _typeof(obj) {
|
4160 | return typeof obj;
|
4161 | };
|
4162 | } else {
|
4163 | module.exports = _typeof = function _typeof(obj) {
|
4164 | return obj && typeof _Symbol === "function" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
|
4165 | };
|
4166 | }
|
4167 |
|
4168 | return _typeof(obj);
|
4169 | }
|
4170 |
|
4171 | module.exports = _typeof;
|
4172 |
|
4173 | }),
|
4174 |
|
4175 | (function(module, exports, __webpack_require__) {
|
4176 |
|
4177 | var wellKnownSymbol = __webpack_require__(9);
|
4178 |
|
4179 | exports.f = wellKnownSymbol;
|
4180 |
|
4181 |
|
4182 | }),
|
4183 |
|
4184 | (function(module, exports, __webpack_require__) {
|
4185 |
|
4186 | "use strict";
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 |
|
4192 |
|
4193 | var _interopRequireDefault = __webpack_require__(0);
|
4194 |
|
4195 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
4196 |
|
4197 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
4198 |
|
4199 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
4200 | return mod && mod.__esModule ? mod : {
|
4201 | "default": mod
|
4202 | };
|
4203 | };
|
4204 |
|
4205 | (0, _defineProperty["default"])(exports, "__esModule", {
|
4206 | value: true
|
4207 | });
|
4208 |
|
4209 | var Panel_1 = __importDefault(__webpack_require__(31));
|
4210 |
|
4211 | var Menu =
|
4212 |
|
4213 | function () {
|
4214 | function Menu($elem, editor) {
|
4215 | var _this = this;
|
4216 |
|
4217 | this.$elem = $elem;
|
4218 | this.editor = editor;
|
4219 | this._active = false;
|
4220 |
|
4221 | $elem.on('click', function (e) {
|
4222 | var _context;
|
4223 |
|
4224 | Panel_1["default"].hideCurAllPanels();
|
4225 |
|
4226 |
|
4227 | (0, _forEach["default"])(_context = editor.txt.eventHooks.menuClickEvents).call(_context, function (fn) {
|
4228 | return fn();
|
4229 | });
|
4230 | e.stopPropagation();
|
4231 |
|
4232 | if (editor.selection.getRange() == null) {
|
4233 | return;
|
4234 | }
|
4235 |
|
4236 | _this.clickHandler(e);
|
4237 | });
|
4238 | }
|
4239 | |
4240 |
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 | Menu.prototype.clickHandler = function (e) {};
|
4246 | |
4247 |
|
4248 |
|
4249 |
|
4250 |
|
4251 | Menu.prototype.active = function () {
|
4252 | this._active = true;
|
4253 | this.$elem.addClass('w-e-active');
|
4254 | };
|
4255 | |
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 | Menu.prototype.unActive = function () {
|
4261 | this._active = false;
|
4262 | this.$elem.removeClass('w-e-active');
|
4263 | };
|
4264 |
|
4265 | (0, _defineProperty["default"])(Menu.prototype, "isActive", {
|
4266 | |
4267 |
|
4268 |
|
4269 | get: function get() {
|
4270 | return this._active;
|
4271 | },
|
4272 | enumerable: false,
|
4273 | configurable: true
|
4274 | });
|
4275 | return Menu;
|
4276 | }();
|
4277 |
|
4278 | exports["default"] = Menu;
|
4279 |
|
4280 | }),
|
4281 |
|
4282 | (function(module, exports, __webpack_require__) {
|
4283 |
|
4284 | "use strict";
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 | var _interopRequireDefault = __webpack_require__(0);
|
4292 |
|
4293 | var _indexOf = _interopRequireDefault(__webpack_require__(54));
|
4294 |
|
4295 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
4296 |
|
4297 | var _bind = _interopRequireDefault(__webpack_require__(88));
|
4298 |
|
4299 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
4300 |
|
4301 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
4302 | return mod && mod.__esModule ? mod : {
|
4303 | "default": mod
|
4304 | };
|
4305 | };
|
4306 |
|
4307 | (0, _defineProperty["default"])(exports, "__esModule", {
|
4308 | value: true
|
4309 | });
|
4310 |
|
4311 | var util_1 = __webpack_require__(7);
|
4312 |
|
4313 | var upload_core_1 = __importDefault(__webpack_require__(335));
|
4314 |
|
4315 | var progress_1 = __importDefault(__webpack_require__(336));
|
4316 |
|
4317 | var UploadImg =
|
4318 |
|
4319 | function () {
|
4320 | function UploadImg(editor) {
|
4321 | this.editor = editor;
|
4322 | }
|
4323 | |
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 |
|
4329 | UploadImg.prototype.insertImg = function (src) {
|
4330 | var editor = this.editor;
|
4331 | var config = editor.config;
|
4332 | var i18nPrefix = 'validate.';
|
4333 |
|
4334 | var t = function t(text, prefix) {
|
4335 | if (prefix === void 0) {
|
4336 | prefix = i18nPrefix;
|
4337 | }
|
4338 |
|
4339 | return editor.i18next.t(prefix + text);
|
4340 | };
|
4341 |
|
4342 |
|
4343 | editor.cmd["do"]('insertHTML', "<img src=\"" + src + "\" style=\"max-width:100%;\"/>");
|
4344 |
|
4345 | config.linkImgCallback(src);
|
4346 |
|
4347 | var img = document.createElement('img');
|
4348 |
|
4349 | img.onload = function () {
|
4350 | img = null;
|
4351 | };
|
4352 |
|
4353 | img.onerror = function () {
|
4354 | config.customAlert(t('插入图片错误'), 'error', "wangEditor: " + t('插入图片错误') + "\uFF0C" + t('图片链接') + " \"" + src + "\"\uFF0C" + t('下载链接失败'));
|
4355 | img = null;
|
4356 | };
|
4357 |
|
4358 | img.onabort = function () {
|
4359 | return img = null;
|
4360 | };
|
4361 |
|
4362 | img.src = src;
|
4363 | };
|
4364 | |
4365 |
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 | UploadImg.prototype.uploadImg = function (files) {
|
4371 | var _this_1 = this;
|
4372 |
|
4373 | if (!files.length) {
|
4374 | return;
|
4375 | }
|
4376 |
|
4377 | var editor = this.editor;
|
4378 | var config = editor.config;
|
4379 |
|
4380 | var i18nPrefix = 'validate.';
|
4381 |
|
4382 | var t = function t(text) {
|
4383 | return editor.i18next.t(i18nPrefix + text);
|
4384 | };
|
4385 |
|
4386 |
|
4387 |
|
4388 | var uploadImgServer = config.uploadImgServer;
|
4389 |
|
4390 | var uploadImgShowBase64 = config.uploadImgShowBase64;
|
4391 |
|
4392 | var maxSize = config.uploadImgMaxSize;
|
4393 | var maxSizeM = maxSize / 1024 / 1024;
|
4394 |
|
4395 | var maxLength = config.uploadImgMaxLength;
|
4396 |
|
4397 | var uploadFileName = config.uploadFileName;
|
4398 |
|
4399 | var uploadImgParams = config.uploadImgParams;
|
4400 |
|
4401 | var uploadImgParamsWithUrl = config.uploadImgParamsWithUrl;
|
4402 |
|
4403 | var uploadImgHeaders = config.uploadImgHeaders;
|
4404 |
|
4405 | var hooks = config.uploadImgHooks;
|
4406 |
|
4407 | var timeout = config.uploadImgTimeout;
|
4408 |
|
4409 | var withCredentials = config.withCredentials;
|
4410 |
|
4411 | var customUploadImg = config.customUploadImg;
|
4412 |
|
4413 | if (!customUploadImg) {
|
4414 |
|
4415 | if (!uploadImgServer && !uploadImgShowBase64) {
|
4416 | return;
|
4417 | }
|
4418 | }
|
4419 |
|
4420 |
|
4421 | var resultFiles = [];
|
4422 | var errInfos = [];
|
4423 | util_1.arrForEach(files, function (file) {
|
4424 | var name = file.name;
|
4425 | var size = file.size;
|
4426 |
|
4427 | if (!name || !size) {
|
4428 | return;
|
4429 | }
|
4430 |
|
4431 | if (/\.(jpg|jpeg|png|bmp|gif|webp)$/i.test(name) === false) {
|
4432 |
|
4433 | errInfos.push("\u3010" + name + "\u3011" + t('不是图片'));
|
4434 | return;
|
4435 | }
|
4436 |
|
4437 | if (maxSize < size) {
|
4438 |
|
4439 | errInfos.push("\u3010" + name + "\u3011" + t('大于') + " " + maxSizeM + "M");
|
4440 | return;
|
4441 | }
|
4442 |
|
4443 |
|
4444 | resultFiles.push(file);
|
4445 | });
|
4446 |
|
4447 | if (errInfos.length) {
|
4448 | config.customAlert(t('图片验证未通过') + ": \n" + errInfos.join('\n'), 'warning');
|
4449 | return;
|
4450 | }
|
4451 |
|
4452 |
|
4453 | if (resultFiles.length === 0) {
|
4454 | config.customAlert(t('传入的文件不合法'), 'warning');
|
4455 | return;
|
4456 | }
|
4457 |
|
4458 | if (resultFiles.length > maxLength) {
|
4459 | config.customAlert(t('一次最多上传') + maxLength + t('张图片'), 'warning');
|
4460 | return;
|
4461 | }
|
4462 |
|
4463 |
|
4464 | if (customUploadImg && typeof customUploadImg === 'function') {
|
4465 | var _context;
|
4466 |
|
4467 | customUploadImg(resultFiles, (0, _bind["default"])(_context = this.insertImg).call(_context, this));
|
4468 |
|
4469 | return;
|
4470 | }
|
4471 |
|
4472 |
|
4473 |
|
4474 | var formData = new FormData();
|
4475 | (0, _forEach["default"])(resultFiles).call(resultFiles, function (file, index) {
|
4476 | var name = uploadFileName || file.name;
|
4477 |
|
4478 | if (resultFiles.length > 1) {
|
4479 |
|
4480 | name = name + (index + 1);
|
4481 | }
|
4482 |
|
4483 | formData.append(name, file);
|
4484 | });
|
4485 |
|
4486 | if (uploadImgServer) {
|
4487 |
|
4488 | var uploadImgServerArr = uploadImgServer.split('#');
|
4489 | uploadImgServer = uploadImgServerArr[0];
|
4490 | var uploadImgServerHash = uploadImgServerArr[1] || '';
|
4491 | (0, _forEach["default"])(util_1).call(util_1, uploadImgParams, function (key, val) {
|
4492 |
|
4493 |
|
4494 |
|
4495 | if (uploadImgParamsWithUrl) {
|
4496 | if ((0, _indexOf["default"])(uploadImgServer).call(uploadImgServer, '?') > 0) {
|
4497 | uploadImgServer += '&';
|
4498 | } else {
|
4499 | uploadImgServer += '?';
|
4500 | }
|
4501 |
|
4502 | uploadImgServer = uploadImgServer + key + '=' + val;
|
4503 | }
|
4504 |
|
4505 |
|
4506 | formData.append(key, val);
|
4507 | });
|
4508 |
|
4509 | if (uploadImgServerHash) {
|
4510 | uploadImgServer += '#' + uploadImgServerHash;
|
4511 | }
|
4512 |
|
4513 |
|
4514 | var xhr = upload_core_1["default"](uploadImgServer, {
|
4515 | timeout: timeout,
|
4516 | formData: formData,
|
4517 | headers: uploadImgHeaders,
|
4518 | withCredentials: !!withCredentials,
|
4519 | beforeSend: function beforeSend(xhr) {
|
4520 | if (hooks.before) return hooks.before(xhr, editor, resultFiles);
|
4521 | },
|
4522 | onTimeout: function onTimeout(xhr) {
|
4523 | config.customAlert(t('上传图片超时'), 'error');
|
4524 | if (hooks.timeout) hooks.timeout(xhr, editor);
|
4525 | },
|
4526 | onProgress: function onProgress(percent, e) {
|
4527 | var progressBar = new progress_1["default"](editor);
|
4528 |
|
4529 | if (e.lengthComputable) {
|
4530 | percent = e.loaded / e.total;
|
4531 | progressBar.show(percent);
|
4532 | }
|
4533 | },
|
4534 | onError: function onError(xhr) {
|
4535 | config.customAlert(t('上传图片错误'), 'error', t('上传图片错误') + "\uFF0C" + t('服务器返回状态') + ": " + xhr.status);
|
4536 | if (hooks.error) hooks.error(xhr, editor);
|
4537 | },
|
4538 | onFail: function onFail(xhr, resultStr) {
|
4539 | config.customAlert(t('上传图片失败'), 'error', t('上传图片返回结果错误') + ("\uFF0C" + t('返回结果') + ": ") + resultStr);
|
4540 | if (hooks.fail) hooks.fail(xhr, editor, resultStr);
|
4541 | },
|
4542 | onSuccess: function onSuccess(xhr, result) {
|
4543 | if (hooks.customInsert) {
|
4544 | var _context2;
|
4545 |
|
4546 |
|
4547 | hooks.customInsert((0, _bind["default"])(_context2 = _this_1.insertImg).call(_context2, _this_1), result, editor);
|
4548 | return;
|
4549 | }
|
4550 |
|
4551 | if (result.errno != '0') {
|
4552 |
|
4553 | config.customAlert(t('上传图片失败'), 'error', t('上传图片返回结果错误') + "\uFF0C" + t('返回结果') + " errno=" + result.errno);
|
4554 | if (hooks.fail) hooks.fail(xhr, editor, result);
|
4555 | return;
|
4556 | }
|
4557 |
|
4558 |
|
4559 | var data = result.data;
|
4560 | (0, _forEach["default"])(data).call(data, function (link) {
|
4561 | _this_1.insertImg(link);
|
4562 | });
|
4563 |
|
4564 | if (hooks.success) hooks.success(xhr, editor, result);
|
4565 | }
|
4566 | });
|
4567 |
|
4568 | if (typeof xhr === 'string') {
|
4569 |
|
4570 | config.customAlert(xhr, 'error');
|
4571 | }
|
4572 |
|
4573 |
|
4574 | return;
|
4575 | }
|
4576 |
|
4577 |
|
4578 | if (uploadImgShowBase64) {
|
4579 | util_1.arrForEach(files, function (file) {
|
4580 | var _this = _this_1;
|
4581 | var reader = new FileReader();
|
4582 | reader.readAsDataURL(file);
|
4583 |
|
4584 | reader.onload = function () {
|
4585 | if (!this.result) return;
|
4586 |
|
4587 | _this.insertImg(this.result.toString());
|
4588 | };
|
4589 | });
|
4590 | }
|
4591 | };
|
4592 |
|
4593 | return UploadImg;
|
4594 | }();
|
4595 |
|
4596 | exports["default"] = UploadImg;
|
4597 |
|
4598 | }),
|
4599 |
|
4600 | (function(module, exports, __webpack_require__) {
|
4601 |
|
4602 | "use strict";
|
4603 |
|
4604 |
|
4605 | var _interopRequireDefault = __webpack_require__(0);
|
4606 |
|
4607 | var _slice = _interopRequireDefault(__webpack_require__(43));
|
4608 |
|
4609 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
4610 |
|
4611 | var _every = _interopRequireDefault(__webpack_require__(381));
|
4612 |
|
4613 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
4614 |
|
4615 | (0, _defineProperty["default"])(exports, "__esModule", {
|
4616 | value: true
|
4617 | });
|
4618 | exports.dealTextNode = exports.isAllTodo = exports.isTodo = exports.getCursorNextNode = void 0;
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 |
|
4624 | function isTodo($topSelectElem) {
|
4625 | return $topSelectElem.attr('class') === 'w-e-todo';
|
4626 | }
|
4627 |
|
4628 | exports.isTodo = isTodo;
|
4629 |
|
4630 |
|
4631 |
|
4632 |
|
4633 |
|
4634 | function isAllTodo(editor) {
|
4635 | var $topSelectElems = editor.selection.getSelectionRangeTopNodes(editor);
|
4636 |
|
4637 | if ($topSelectElems.length === 0) return;
|
4638 | return (0, _every["default"])($topSelectElems).call($topSelectElems, function ($topSelectElem) {
|
4639 | return isTodo($topSelectElem);
|
4640 | });
|
4641 | }
|
4642 |
|
4643 | exports.isAllTodo = isAllTodo;
|
4644 |
|
4645 |
|
4646 |
|
4647 |
|
4648 |
|
4649 |
|
4650 |
|
4651 | function getCursorNextNode(node, textNode, pos) {
|
4652 | var _context;
|
4653 |
|
4654 | if (!node.hasChildNodes()) return;
|
4655 | var newNode = node.cloneNode();
|
4656 |
|
4657 | var end = false;
|
4658 |
|
4659 | if (textNode.nodeValue === '') {
|
4660 | end = true;
|
4661 | }
|
4662 |
|
4663 | var delArr = [];
|
4664 | (0, _forEach["default"])(_context = node.childNodes).call(_context, function (v) {
|
4665 |
|
4666 | if (!isContains(v, textNode) && end) {
|
4667 | newNode.appendChild(v.cloneNode(true));
|
4668 |
|
4669 | if (v.nodeName !== 'BR') {
|
4670 | delArr.push(v);
|
4671 | }
|
4672 | }
|
4673 |
|
4674 |
|
4675 | if (isContains(v, textNode)) {
|
4676 | if (v.nodeType === 1) {
|
4677 | var childNode = getCursorNextNode(v, textNode, pos);
|
4678 | if (childNode && childNode.textContent !== '') newNode === null || newNode === void 0 ? void 0 : newNode.appendChild(childNode);
|
4679 | }
|
4680 |
|
4681 | if (v.nodeType === 3) {
|
4682 | if (textNode.isEqualNode(v)) {
|
4683 | var textContent = dealTextNode(v, pos);
|
4684 | newNode.textContent = textContent;
|
4685 | }
|
4686 | }
|
4687 |
|
4688 | end = true;
|
4689 | }
|
4690 | });
|
4691 |
|
4692 | (0, _forEach["default"])(delArr).call(delArr, function (v) {
|
4693 | var node = v;
|
4694 | node.remove();
|
4695 | });
|
4696 | return newNode;
|
4697 | }
|
4698 |
|
4699 | exports.getCursorNextNode = getCursorNextNode;
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 |
|
4705 |
|
4706 | function isContains(node, otherNode) {
|
4707 |
|
4708 | if (node.nodeType === 3) {
|
4709 | return node.nodeValue === otherNode.nodeValue;
|
4710 | }
|
4711 |
|
4712 | return node.contains(otherNode);
|
4713 | }
|
4714 |
|
4715 |
|
4716 |
|
4717 |
|
4718 |
|
4719 |
|
4720 |
|
4721 |
|
4722 | function dealTextNode(node, pos, start) {
|
4723 | if (start === void 0) {
|
4724 | start = true;
|
4725 | }
|
4726 |
|
4727 | var content = node.nodeValue;
|
4728 | var oldContent = content === null || content === void 0 ? void 0 : (0, _slice["default"])(content).call(content, 0, pos);
|
4729 | content = content === null || content === void 0 ? void 0 : (0, _slice["default"])(content).call(content, pos);
|
4730 |
|
4731 | if (!start) {
|
4732 | var temp = content;
|
4733 | content = oldContent;
|
4734 | oldContent = temp;
|
4735 | }
|
4736 |
|
4737 | node.nodeValue = oldContent;
|
4738 | return content;
|
4739 | }
|
4740 |
|
4741 | exports.dealTextNode = dealTextNode;
|
4742 |
|
4743 | }),
|
4744 |
|
4745 | (function(module, exports, __webpack_require__) {
|
4746 |
|
4747 | "use strict";
|
4748 |
|
4749 |
|
4750 |
|
4751 |
|
4752 |
|
4753 |
|
4754 | var _interopRequireDefault = __webpack_require__(0);
|
4755 |
|
4756 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
4757 |
|
4758 | (0, _defineProperty["default"])(exports, "__esModule", {
|
4759 | value: true
|
4760 | });
|
4761 |
|
4762 | var stack_1 = __webpack_require__(401);
|
4763 |
|
4764 | var Cache =
|
4765 |
|
4766 | function () {
|
4767 | function Cache(maxSize) {
|
4768 | this.maxSize = maxSize;
|
4769 | |
4770 |
|
4771 |
|
4772 |
|
4773 | this.isRe = false;
|
4774 | this.data = new stack_1.CeilStack(maxSize);
|
4775 | this.revokeData = new stack_1.CeilStack(maxSize);
|
4776 | }
|
4777 |
|
4778 | (0, _defineProperty["default"])(Cache.prototype, "size", {
|
4779 | |
4780 |
|
4781 |
|
4782 | get: function get() {
|
4783 | return [this.data.size, this.revokeData.size];
|
4784 | },
|
4785 | enumerable: false,
|
4786 | configurable: true
|
4787 | });
|
4788 | |
4789 |
|
4790 |
|
4791 |
|
4792 | Cache.prototype.resetMaxSize = function (maxSize) {
|
4793 | this.data.resetMax(maxSize);
|
4794 | this.revokeData.resetMax(maxSize);
|
4795 | };
|
4796 | |
4797 |
|
4798 |
|
4799 |
|
4800 |
|
4801 | Cache.prototype.save = function (data) {
|
4802 | if (this.isRe) {
|
4803 | this.revokeData.clear();
|
4804 | this.isRe = false;
|
4805 | }
|
4806 |
|
4807 | this.data.instack(data);
|
4808 | return this;
|
4809 | };
|
4810 | |
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 |
|
4816 | Cache.prototype.revoke = function (fn) {
|
4817 | !this.isRe && (this.isRe = true);
|
4818 | var data = this.data.outstack();
|
4819 |
|
4820 | if (data) {
|
4821 | this.revokeData.instack(data);
|
4822 | fn(data);
|
4823 | return true;
|
4824 | }
|
4825 |
|
4826 | return false;
|
4827 | };
|
4828 | |
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 |
|
4834 | Cache.prototype.restore = function (fn) {
|
4835 | !this.isRe && (this.isRe = true);
|
4836 | var data = this.revokeData.outstack();
|
4837 |
|
4838 | if (data) {
|
4839 | this.data.instack(data);
|
4840 | fn(data);
|
4841 | return true;
|
4842 | }
|
4843 |
|
4844 | return false;
|
4845 | };
|
4846 |
|
4847 | return Cache;
|
4848 | }();
|
4849 |
|
4850 | exports["default"] = Cache;
|
4851 |
|
4852 | }),
|
4853 |
|
4854 | (function(module, exports, __webpack_require__) {
|
4855 |
|
4856 | var DESCRIPTORS = __webpack_require__(14);
|
4857 | var fails = __webpack_require__(12);
|
4858 | var createElement = __webpack_require__(70);
|
4859 |
|
4860 |
|
4861 | module.exports = !DESCRIPTORS && !fails(function () {
|
4862 | return Object.defineProperty(createElement('div'), 'a', {
|
4863 | get: function () { return 7; }
|
4864 | }).a != 7;
|
4865 | });
|
4866 |
|
4867 |
|
4868 | }),
|
4869 |
|
4870 | (function(module, exports, __webpack_require__) {
|
4871 |
|
4872 | var fails = __webpack_require__(12);
|
4873 |
|
4874 | var replacement = /#|\.prototype\./;
|
4875 |
|
4876 | var isForced = function (feature, detection) {
|
4877 | var value = data[normalize(feature)];
|
4878 | return value == POLYFILL ? true
|
4879 | : value == NATIVE ? false
|
4880 | : typeof detection == 'function' ? fails(detection)
|
4881 | : !!detection;
|
4882 | };
|
4883 |
|
4884 | var normalize = isForced.normalize = function (string) {
|
4885 | return String(string).replace(replacement, '.').toLowerCase();
|
4886 | };
|
4887 |
|
4888 | var data = isForced.data = {};
|
4889 | var NATIVE = isForced.NATIVE = 'N';
|
4890 | var POLYFILL = isForced.POLYFILL = 'P';
|
4891 |
|
4892 | module.exports = isForced;
|
4893 |
|
4894 |
|
4895 | }),
|
4896 |
|
4897 | (function(module, exports, __webpack_require__) {
|
4898 |
|
4899 | var has = __webpack_require__(15);
|
4900 | var toIndexedObject = __webpack_require__(27);
|
4901 | var indexOf = __webpack_require__(71).indexOf;
|
4902 | var hiddenKeys = __webpack_require__(49);
|
4903 |
|
4904 | module.exports = function (object, names) {
|
4905 | var O = toIndexedObject(object);
|
4906 | var i = 0;
|
4907 | var result = [];
|
4908 | var key;
|
4909 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
4910 |
|
4911 | while (names.length > i) if (has(O, key = names[i++])) {
|
4912 | ~indexOf(result, key) || result.push(key);
|
4913 | }
|
4914 | return result;
|
4915 | };
|
4916 |
|
4917 |
|
4918 | }),
|
4919 |
|
4920 | (function(module, exports, __webpack_require__) {
|
4921 |
|
4922 | var getBuiltIn = __webpack_require__(28);
|
4923 |
|
4924 | module.exports = getBuiltIn('document', 'documentElement');
|
4925 |
|
4926 |
|
4927 | }),
|
4928 |
|
4929 | (function(module, exports, __webpack_require__) {
|
4930 |
|
4931 | var NATIVE_SYMBOL = __webpack_require__(78);
|
4932 |
|
4933 | module.exports = NATIVE_SYMBOL
|
4934 |
|
4935 | && !Symbol.sham
|
4936 |
|
4937 | && typeof Symbol.iterator == 'symbol';
|
4938 |
|
4939 |
|
4940 | }),
|
4941 |
|
4942 | (function(module, exports, __webpack_require__) {
|
4943 |
|
4944 | var global = __webpack_require__(8);
|
4945 |
|
4946 | module.exports = global.Promise;
|
4947 |
|
4948 |
|
4949 | }),
|
4950 |
|
4951 | (function(module, exports, __webpack_require__) {
|
4952 |
|
4953 | var redefine = __webpack_require__(50);
|
4954 |
|
4955 | module.exports = function (target, src, options) {
|
4956 | for (var key in src) {
|
4957 | if (options && options.unsafe && target[key]) target[key] = src[key];
|
4958 | else redefine(target, key, src[key], options);
|
4959 | } return target;
|
4960 | };
|
4961 |
|
4962 |
|
4963 | }),
|
4964 |
|
4965 | (function(module, exports, __webpack_require__) {
|
4966 |
|
4967 | "use strict";
|
4968 |
|
4969 | var getBuiltIn = __webpack_require__(28);
|
4970 | var definePropertyModule = __webpack_require__(18);
|
4971 | var wellKnownSymbol = __webpack_require__(9);
|
4972 | var DESCRIPTORS = __webpack_require__(14);
|
4973 |
|
4974 | var SPECIES = wellKnownSymbol('species');
|
4975 |
|
4976 | module.exports = function (CONSTRUCTOR_NAME) {
|
4977 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
4978 | var defineProperty = definePropertyModule.f;
|
4979 |
|
4980 | if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
4981 | defineProperty(Constructor, SPECIES, {
|
4982 | configurable: true,
|
4983 | get: function () { return this; }
|
4984 | });
|
4985 | }
|
4986 | };
|
4987 |
|
4988 |
|
4989 | }),
|
4990 |
|
4991 | (function(module, exports, __webpack_require__) {
|
4992 |
|
4993 | var store = __webpack_require__(75);
|
4994 |
|
4995 | var functionToString = Function.toString;
|
4996 |
|
4997 |
|
4998 | if (typeof store.inspectSource != 'function') {
|
4999 | store.inspectSource = function (it) {
|
5000 | return functionToString.call(it);
|
5001 | };
|
5002 | }
|
5003 |
|
5004 | module.exports = store.inspectSource;
|
5005 |
|
5006 |
|
5007 | }),
|
5008 |
|
5009 | (function(module, exports, __webpack_require__) {
|
5010 |
|
5011 | var anObject = __webpack_require__(24);
|
5012 | var aFunction = __webpack_require__(32);
|
5013 | var wellKnownSymbol = __webpack_require__(9);
|
5014 |
|
5015 | var SPECIES = wellKnownSymbol('species');
|
5016 |
|
5017 |
|
5018 |
|
5019 | module.exports = function (O, defaultConstructor) {
|
5020 | var C = anObject(O).constructor;
|
5021 | var S;
|
5022 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
|
5023 | };
|
5024 |
|
5025 |
|
5026 | }),
|
5027 |
|
5028 | (function(module, exports, __webpack_require__) {
|
5029 |
|
5030 | var global = __webpack_require__(8);
|
5031 | var fails = __webpack_require__(12);
|
5032 | var bind = __webpack_require__(47);
|
5033 | var html = __webpack_require__(103);
|
5034 | var createElement = __webpack_require__(70);
|
5035 | var IS_IOS = __webpack_require__(111);
|
5036 | var IS_NODE = __webpack_require__(81);
|
5037 |
|
5038 | var location = global.location;
|
5039 | var set = global.setImmediate;
|
5040 | var clear = global.clearImmediate;
|
5041 | var process = global.process;
|
5042 | var MessageChannel = global.MessageChannel;
|
5043 | var Dispatch = global.Dispatch;
|
5044 | var counter = 0;
|
5045 | var queue = {};
|
5046 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
5047 | var defer, channel, port;
|
5048 |
|
5049 | var run = function (id) {
|
5050 |
|
5051 | if (queue.hasOwnProperty(id)) {
|
5052 | var fn = queue[id];
|
5053 | delete queue[id];
|
5054 | fn();
|
5055 | }
|
5056 | };
|
5057 |
|
5058 | var runner = function (id) {
|
5059 | return function () {
|
5060 | run(id);
|
5061 | };
|
5062 | };
|
5063 |
|
5064 | var listener = function (event) {
|
5065 | run(event.data);
|
5066 | };
|
5067 |
|
5068 | var post = function (id) {
|
5069 |
|
5070 | global.postMessage(id + '', location.protocol + '//' + location.host);
|
5071 | };
|
5072 |
|
5073 |
|
5074 | if (!set || !clear) {
|
5075 | set = function setImmediate(fn) {
|
5076 | var args = [];
|
5077 | var i = 1;
|
5078 | while (arguments.length > i) args.push(arguments[i++]);
|
5079 | queue[++counter] = function () {
|
5080 |
|
5081 | (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
|
5082 | };
|
5083 | defer(counter);
|
5084 | return counter;
|
5085 | };
|
5086 | clear = function clearImmediate(id) {
|
5087 | delete queue[id];
|
5088 | };
|
5089 |
|
5090 | if (IS_NODE) {
|
5091 | defer = function (id) {
|
5092 | process.nextTick(runner(id));
|
5093 | };
|
5094 |
|
5095 | } else if (Dispatch && Dispatch.now) {
|
5096 | defer = function (id) {
|
5097 | Dispatch.now(runner(id));
|
5098 | };
|
5099 |
|
5100 |
|
5101 | } else if (MessageChannel && !IS_IOS) {
|
5102 | channel = new MessageChannel();
|
5103 | port = channel.port2;
|
5104 | channel.port1.onmessage = listener;
|
5105 | defer = bind(port.postMessage, port, 1);
|
5106 |
|
5107 |
|
5108 | } else if (
|
5109 | global.addEventListener &&
|
5110 | typeof postMessage == 'function' &&
|
5111 | !global.importScripts &&
|
5112 | location && location.protocol !== 'file:' &&
|
5113 | !fails(post)
|
5114 | ) {
|
5115 | defer = post;
|
5116 | global.addEventListener('message', listener, false);
|
5117 |
|
5118 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
5119 | defer = function (id) {
|
5120 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
5121 | html.removeChild(this);
|
5122 | run(id);
|
5123 | };
|
5124 | };
|
5125 |
|
5126 | } else {
|
5127 | defer = function (id) {
|
5128 | setTimeout(runner(id), 0);
|
5129 | };
|
5130 | }
|
5131 | }
|
5132 |
|
5133 | module.exports = {
|
5134 | set: set,
|
5135 | clear: clear
|
5136 | };
|
5137 |
|
5138 |
|
5139 | /***/ }),
|
5140 | /* 111 */
|
5141 | /***/ (function(module, exports, __webpack_require__) {
|
5142 |
|
5143 | var userAgent = __webpack_require__(63);
|
5144 |
|
5145 | module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
|
5146 |
|
5147 |
|
5148 | }),
|
5149 |
|
5150 | (function(module, exports, __webpack_require__) {
|
5151 |
|
5152 | var anObject = __webpack_require__(24);
|
5153 | var isObject = __webpack_require__(13);
|
5154 | var newPromiseCapability = __webpack_require__(64);
|
5155 |
|
5156 | module.exports = function (C, x) {
|
5157 | anObject(C);
|
5158 | if (isObject(x) && x.constructor === C) return x;
|
5159 | var promiseCapability = newPromiseCapability.f(C);
|
5160 | var resolve = promiseCapability.resolve;
|
5161 | resolve(x);
|
5162 | return promiseCapability.promise;
|
5163 | };
|
5164 |
|
5165 |
|
5166 | }),
|
5167 |
|
5168 | (function(module, exports, __webpack_require__) {
|
5169 |
|
5170 | "use strict";
|
5171 |
|
5172 | var getPrototypeOf = __webpack_require__(76);
|
5173 | var createNonEnumerableProperty = __webpack_require__(17);
|
5174 | var has = __webpack_require__(15);
|
5175 | var wellKnownSymbol = __webpack_require__(9);
|
5176 | var IS_PURE = __webpack_require__(37);
|
5177 |
|
5178 | var ITERATOR = wellKnownSymbol('iterator');
|
5179 | var BUGGY_SAFARI_ITERATORS = false;
|
5180 |
|
5181 | var returnThis = function () { return this; };
|
5182 |
|
5183 |
|
5184 |
|
5185 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
5186 |
|
5187 | if ([].keys) {
|
5188 | arrayIterator = [].keys();
|
5189 |
|
5190 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
5191 | else {
|
5192 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
5193 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
5194 | }
|
5195 | }
|
5196 |
|
5197 | if (IteratorPrototype == undefined) IteratorPrototype = {};
|
5198 |
|
5199 |
|
5200 | if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
|
5201 | createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
5202 | }
|
5203 |
|
5204 | module.exports = {
|
5205 | IteratorPrototype: IteratorPrototype,
|
5206 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
5207 | };
|
5208 |
|
5209 |
|
5210 | }),
|
5211 |
|
5212 | (function(module, exports, __webpack_require__) {
|
5213 |
|
5214 | module.exports = __webpack_require__(209);
|
5215 |
|
5216 | }),
|
5217 |
|
5218 | (function(module, exports, __webpack_require__) {
|
5219 |
|
5220 | "use strict";
|
5221 |
|
5222 | var $ = __webpack_require__(4);
|
5223 | var global = __webpack_require__(8);
|
5224 | var InternalMetadataModule = __webpack_require__(116);
|
5225 | var fails = __webpack_require__(12);
|
5226 | var createNonEnumerableProperty = __webpack_require__(17);
|
5227 | var iterate = __webpack_require__(39);
|
5228 | var anInstance = __webpack_require__(80);
|
5229 | var isObject = __webpack_require__(13);
|
5230 | var setToStringTag = __webpack_require__(41);
|
5231 | var defineProperty = __webpack_require__(18).f;
|
5232 | var forEach = __webpack_require__(33).forEach;
|
5233 | var DESCRIPTORS = __webpack_require__(14);
|
5234 | var InternalStateModule = __webpack_require__(42);
|
5235 |
|
5236 | var setInternalState = InternalStateModule.set;
|
5237 | var internalStateGetterFor = InternalStateModule.getterFor;
|
5238 |
|
5239 | module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
5240 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
5241 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
5242 | var ADDER = IS_MAP ? 'set' : 'add';
|
5243 | var NativeConstructor = global[CONSTRUCTOR_NAME];
|
5244 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
5245 | var exported = {};
|
5246 | var Constructor;
|
5247 |
|
5248 | if (!DESCRIPTORS || typeof NativeConstructor != 'function'
|
5249 | || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
|
5250 | ) {
|
5251 |
|
5252 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
5253 | InternalMetadataModule.REQUIRED = true;
|
5254 | } else {
|
5255 | Constructor = wrapper(function (target, iterable) {
|
5256 | setInternalState(anInstance(target, Constructor, CONSTRUCTOR_NAME), {
|
5257 | type: CONSTRUCTOR_NAME,
|
5258 | collection: new NativeConstructor()
|
5259 | });
|
5260 | if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
|
5261 | });
|
5262 |
|
5263 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
5264 |
|
5265 | forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
5266 | var IS_ADDER = KEY == 'add' || KEY == 'set';
|
5267 | if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
|
5268 | createNonEnumerableProperty(Constructor.prototype, KEY, function (a, b) {
|
5269 | var collection = getInternalState(this).collection;
|
5270 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
|
5271 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
5272 | return IS_ADDER ? this : result;
|
5273 | });
|
5274 | }
|
5275 | });
|
5276 |
|
5277 | IS_WEAK || defineProperty(Constructor.prototype, 'size', {
|
5278 | configurable: true,
|
5279 | get: function () {
|
5280 | return getInternalState(this).collection.size;
|
5281 | }
|
5282 | });
|
5283 | }
|
5284 |
|
5285 | setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
|
5286 |
|
5287 | exported[CONSTRUCTOR_NAME] = Constructor;
|
5288 | $({ global: true, forced: true }, exported);
|
5289 |
|
5290 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
5291 |
|
5292 | return Constructor;
|
5293 | };
|
5294 |
|
5295 |
|
5296 | }),
|
5297 |
|
5298 | (function(module, exports, __webpack_require__) {
|
5299 |
|
5300 | var hiddenKeys = __webpack_require__(49);
|
5301 | var isObject = __webpack_require__(13);
|
5302 | var has = __webpack_require__(15);
|
5303 | var defineProperty = __webpack_require__(18).f;
|
5304 | var uid = __webpack_require__(60);
|
5305 | var FREEZING = __webpack_require__(212);
|
5306 |
|
5307 | var METADATA = uid('meta');
|
5308 | var id = 0;
|
5309 |
|
5310 | var isExtensible = Object.isExtensible || function () {
|
5311 | return true;
|
5312 | };
|
5313 |
|
5314 | var setMetadata = function (it) {
|
5315 | defineProperty(it, METADATA, { value: {
|
5316 | objectID: 'O' + ++id,
|
5317 | weakData: {}
|
5318 | } });
|
5319 | };
|
5320 |
|
5321 | var fastKey = function (it, create) {
|
5322 |
|
5323 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
5324 | if (!has(it, METADATA)) {
|
5325 |
|
5326 | if (!isExtensible(it)) return 'F';
|
5327 |
|
5328 | if (!create) return 'E';
|
5329 |
|
5330 | setMetadata(it);
|
5331 |
|
5332 | } return it[METADATA].objectID;
|
5333 | };
|
5334 |
|
5335 | var getWeakData = function (it, create) {
|
5336 | if (!has(it, METADATA)) {
|
5337 |
|
5338 | if (!isExtensible(it)) return true;
|
5339 |
|
5340 | if (!create) return false;
|
5341 |
|
5342 | setMetadata(it);
|
5343 |
|
5344 | } return it[METADATA].weakData;
|
5345 | };
|
5346 |
|
5347 |
|
5348 | var onFreeze = function (it) {
|
5349 | if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
|
5350 | return it;
|
5351 | };
|
5352 |
|
5353 | var meta = module.exports = {
|
5354 | REQUIRED: false,
|
5355 | fastKey: fastKey,
|
5356 | getWeakData: getWeakData,
|
5357 | onFreeze: onFreeze
|
5358 | };
|
5359 |
|
5360 | hiddenKeys[METADATA] = true;
|
5361 |
|
5362 |
|
5363 | }),
|
5364 |
|
5365 | (function(module, exports, __webpack_require__) {
|
5366 |
|
5367 | "use strict";
|
5368 |
|
5369 | var defineProperty = __webpack_require__(18).f;
|
5370 | var create = __webpack_require__(48);
|
5371 | var redefineAll = __webpack_require__(106);
|
5372 | var bind = __webpack_require__(47);
|
5373 | var anInstance = __webpack_require__(80);
|
5374 | var iterate = __webpack_require__(39);
|
5375 | var defineIterator = __webpack_require__(84);
|
5376 | var setSpecies = __webpack_require__(107);
|
5377 | var DESCRIPTORS = __webpack_require__(14);
|
5378 | var fastKey = __webpack_require__(116).fastKey;
|
5379 | var InternalStateModule = __webpack_require__(42);
|
5380 |
|
5381 | var setInternalState = InternalStateModule.set;
|
5382 | var internalStateGetterFor = InternalStateModule.getterFor;
|
5383 |
|
5384 | module.exports = {
|
5385 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
5386 | var C = wrapper(function (that, iterable) {
|
5387 | anInstance(that, C, CONSTRUCTOR_NAME);
|
5388 | setInternalState(that, {
|
5389 | type: CONSTRUCTOR_NAME,
|
5390 | index: create(null),
|
5391 | first: undefined,
|
5392 | last: undefined,
|
5393 | size: 0
|
5394 | });
|
5395 | if (!DESCRIPTORS) that.size = 0;
|
5396 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
5397 | });
|
5398 |
|
5399 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
5400 |
|
5401 | var define = function (that, key, value) {
|
5402 | var state = getInternalState(that);
|
5403 | var entry = getEntry(that, key);
|
5404 | var previous, index;
|
5405 |
|
5406 | if (entry) {
|
5407 | entry.value = value;
|
5408 |
|
5409 | } else {
|
5410 | state.last = entry = {
|
5411 | index: index = fastKey(key, true),
|
5412 | key: key,
|
5413 | value: value,
|
5414 | previous: previous = state.last,
|
5415 | next: undefined,
|
5416 | removed: false
|
5417 | };
|
5418 | if (!state.first) state.first = entry;
|
5419 | if (previous) previous.next = entry;
|
5420 | if (DESCRIPTORS) state.size++;
|
5421 | else that.size++;
|
5422 |
|
5423 | if (index !== 'F') state.index[index] = entry;
|
5424 | } return that;
|
5425 | };
|
5426 |
|
5427 | var getEntry = function (that, key) {
|
5428 | var state = getInternalState(that);
|
5429 |
|
5430 | var index = fastKey(key);
|
5431 | var entry;
|
5432 | if (index !== 'F') return state.index[index];
|
5433 |
|
5434 | for (entry = state.first; entry; entry = entry.next) {
|
5435 | if (entry.key == key) return entry;
|
5436 | }
|
5437 | };
|
5438 |
|
5439 | redefineAll(C.prototype, {
|
5440 |
|
5441 |
|
5442 | clear: function clear() {
|
5443 | var that = this;
|
5444 | var state = getInternalState(that);
|
5445 | var data = state.index;
|
5446 | var entry = state.first;
|
5447 | while (entry) {
|
5448 | entry.removed = true;
|
5449 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
5450 | delete data[entry.index];
|
5451 | entry = entry.next;
|
5452 | }
|
5453 | state.first = state.last = undefined;
|
5454 | if (DESCRIPTORS) state.size = 0;
|
5455 | else that.size = 0;
|
5456 | },
|
5457 |
|
5458 |
|
5459 | 'delete': function (key) {
|
5460 | var that = this;
|
5461 | var state = getInternalState(that);
|
5462 | var entry = getEntry(that, key);
|
5463 | if (entry) {
|
5464 | var next = entry.next;
|
5465 | var prev = entry.previous;
|
5466 | delete state.index[entry.index];
|
5467 | entry.removed = true;
|
5468 | if (prev) prev.next = next;
|
5469 | if (next) next.previous = prev;
|
5470 | if (state.first == entry) state.first = next;
|
5471 | if (state.last == entry) state.last = prev;
|
5472 | if (DESCRIPTORS) state.size--;
|
5473 | else that.size--;
|
5474 | } return !!entry;
|
5475 | },
|
5476 |
|
5477 |
|
5478 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
5479 | var state = getInternalState(this);
|
5480 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
|
5481 | var entry;
|
5482 | while (entry = entry ? entry.next : state.first) {
|
5483 | boundFunction(entry.value, entry.key, this);
|
5484 |
|
5485 | while (entry && entry.removed) entry = entry.previous;
|
5486 | }
|
5487 | },
|
5488 |
|
5489 |
|
5490 | has: function has(key) {
|
5491 | return !!getEntry(this, key);
|
5492 | }
|
5493 | });
|
5494 |
|
5495 | redefineAll(C.prototype, IS_MAP ? {
|
5496 |
|
5497 | get: function get(key) {
|
5498 | var entry = getEntry(this, key);
|
5499 | return entry && entry.value;
|
5500 | },
|
5501 |
|
5502 | set: function set(key, value) {
|
5503 | return define(this, key === 0 ? 0 : key, value);
|
5504 | }
|
5505 | } : {
|
5506 |
|
5507 | add: function add(value) {
|
5508 | return define(this, value = value === 0 ? 0 : value, value);
|
5509 | }
|
5510 | });
|
5511 | if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
|
5512 | get: function () {
|
5513 | return getInternalState(this).size;
|
5514 | }
|
5515 | });
|
5516 | return C;
|
5517 | },
|
5518 | setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
|
5519 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
5520 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
5521 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
5522 |
|
5523 |
|
5524 | defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
|
5525 | setInternalState(this, {
|
5526 | type: ITERATOR_NAME,
|
5527 | target: iterated,
|
5528 | state: getInternalCollectionState(iterated),
|
5529 | kind: kind,
|
5530 | last: undefined
|
5531 | });
|
5532 | }, function () {
|
5533 | var state = getInternalIteratorState(this);
|
5534 | var kind = state.kind;
|
5535 | var entry = state.last;
|
5536 |
|
5537 | while (entry && entry.removed) entry = entry.previous;
|
5538 |
|
5539 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
5540 |
|
5541 | state.target = undefined;
|
5542 | return { value: undefined, done: true };
|
5543 | }
|
5544 |
|
5545 | if (kind == 'keys') return { value: entry.key, done: false };
|
5546 | if (kind == 'values') return { value: entry.value, done: false };
|
5547 | return { value: [entry.key, entry.value], done: false };
|
5548 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
5549 |
|
5550 |
|
5551 | setSpecies(CONSTRUCTOR_NAME);
|
5552 | }
|
5553 | };
|
5554 |
|
5555 |
|
5556 | }),
|
5557 |
|
5558 | (function(module, exports, __webpack_require__) {
|
5559 |
|
5560 | var defineWellKnownSymbol = __webpack_require__(11);
|
5561 |
|
5562 |
|
5563 |
|
5564 | defineWellKnownSymbol('iterator');
|
5565 |
|
5566 |
|
5567 | }),
|
5568 |
|
5569 | (function(module, exports, __webpack_require__) {
|
5570 |
|
5571 | var internalObjectKeys = __webpack_require__(102);
|
5572 | var enumBugKeys = __webpack_require__(73);
|
5573 |
|
5574 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
5575 |
|
5576 |
|
5577 |
|
5578 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
5579 | return internalObjectKeys(O, hiddenKeys);
|
5580 | };
|
5581 |
|
5582 |
|
5583 | }),
|
5584 |
|
5585 | (function(module, exports) {
|
5586 |
|
5587 | exports.f = Object.getOwnPropertySymbols;
|
5588 |
|
5589 |
|
5590 | }),
|
5591 |
|
5592 | (function(module, exports, __webpack_require__) {
|
5593 |
|
5594 | module.exports = __webpack_require__(255);
|
5595 |
|
5596 | }),
|
5597 |
|
5598 | (function(module, exports, __webpack_require__) {
|
5599 |
|
5600 | "use strict";
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 |
|
5607 | var _interopRequireDefault = __webpack_require__(0);
|
5608 |
|
5609 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
5610 |
|
5611 | (0, _defineProperty["default"])(exports, "__esModule", {
|
5612 | value: true
|
5613 | });
|
5614 | exports["default"] = {
|
5615 | zIndex: 10000
|
5616 | };
|
5617 |
|
5618 | }),
|
5619 |
|
5620 | (function(module, exports, __webpack_require__) {
|
5621 |
|
5622 | "use strict";
|
5623 |
|
5624 |
|
5625 |
|
5626 |
|
5627 |
|
5628 |
|
5629 | var _interopRequireDefault = __webpack_require__(0);
|
5630 |
|
5631 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
5632 |
|
5633 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
5634 |
|
5635 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
5636 | return mod && mod.__esModule ? mod : {
|
5637 | "default": mod
|
5638 | };
|
5639 | };
|
5640 |
|
5641 | (0, _defineProperty["default"])(exports, "__esModule", {
|
5642 | value: true
|
5643 | });
|
5644 | exports.getPasteImgs = exports.getPasteHtml = exports.getPasteText = void 0;
|
5645 |
|
5646 | var util_1 = __webpack_require__(7);
|
5647 |
|
5648 | var parse_html_1 = __importDefault(__webpack_require__(294));
|
5649 |
|
5650 |
|
5651 |
|
5652 |
|
5653 |
|
5654 |
|
5655 | function getPasteText(e) {
|
5656 |
|
5657 | var clipboardData = e.clipboardData;
|
5658 |
|
5659 | var pasteText = '';
|
5660 |
|
5661 | if (clipboardData == null) {
|
5662 | pasteText = window.clipboardData && window.clipboardData.getData('text');
|
5663 | } else {
|
5664 | pasteText = clipboardData.getData('text/plain');
|
5665 | }
|
5666 |
|
5667 | return util_1.replaceHtmlSymbol(pasteText);
|
5668 | }
|
5669 |
|
5670 | exports.getPasteText = getPasteText;
|
5671 |
|
5672 |
|
5673 |
|
5674 |
|
5675 |
|
5676 |
|
5677 |
|
5678 | function getPasteHtml(e, filterStyle, ignoreImg) {
|
5679 | if (filterStyle === void 0) {
|
5680 | filterStyle = true;
|
5681 | }
|
5682 |
|
5683 | if (ignoreImg === void 0) {
|
5684 | ignoreImg = false;
|
5685 | }
|
5686 |
|
5687 | var clipboardData = e.clipboardData;
|
5688 |
|
5689 | var pasteHtml = '';
|
5690 |
|
5691 | if (clipboardData) {
|
5692 | pasteHtml = clipboardData.getData('text/html');
|
5693 | }
|
5694 |
|
5695 |
|
5696 | if (!pasteHtml) {
|
5697 | var text = getPasteText(e);
|
5698 |
|
5699 | if (!text) {
|
5700 | return '';
|
5701 | }
|
5702 |
|
5703 | pasteHtml = "<p>" + text + "</p>";
|
5704 | }
|
5705 |
|
5706 |
|
5707 | pasteHtml = parse_html_1["default"](pasteHtml, filterStyle, ignoreImg);
|
5708 | return pasteHtml;
|
5709 | }
|
5710 |
|
5711 | exports.getPasteHtml = getPasteHtml;
|
5712 |
|
5713 |
|
5714 |
|
5715 |
|
5716 |
|
5717 | function getPasteImgs(e) {
|
5718 | var _a;
|
5719 |
|
5720 | var result = [];
|
5721 | var txt = getPasteText(e);
|
5722 |
|
5723 | if (txt) {
|
5724 |
|
5725 | return result;
|
5726 | }
|
5727 |
|
5728 | var items = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.items;
|
5729 | if (!items) return result;
|
5730 | (0, _forEach["default"])(util_1).call(util_1, items, function (key, value) {
|
5731 | var type = value.type;
|
5732 |
|
5733 | if (/image/i.test(type)) {
|
5734 | result.push(value.getAsFile());
|
5735 | }
|
5736 | });
|
5737 | return result;
|
5738 | }
|
5739 |
|
5740 | exports.getPasteImgs = getPasteImgs;
|
5741 |
|
5742 | }),
|
5743 |
|
5744 | (function(module, exports, __webpack_require__) {
|
5745 |
|
5746 | module.exports = __webpack_require__(296);
|
5747 |
|
5748 | }),
|
5749 |
|
5750 | (function(module, exports, __webpack_require__) {
|
5751 |
|
5752 | "use strict";
|
5753 |
|
5754 |
|
5755 |
|
5756 |
|
5757 |
|
5758 | var _interopRequireDefault = __webpack_require__(0);
|
5759 |
|
5760 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
5761 |
|
5762 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
5763 |
|
5764 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
5765 | return mod && mod.__esModule ? mod : {
|
5766 | "default": mod
|
5767 | };
|
5768 | };
|
5769 |
|
5770 | (0, _defineProperty["default"])(exports, "__esModule", {
|
5771 | value: true
|
5772 | });
|
5773 |
|
5774 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
5775 |
|
5776 | var const_1 = __webpack_require__(26);
|
5777 |
|
5778 | var DropList =
|
5779 |
|
5780 | function () {
|
5781 | function DropList(menu, conf) {
|
5782 | var _this = this;
|
5783 |
|
5784 | this.hideTimeoutId = 0;
|
5785 | this.showTimeoutId = 0;
|
5786 | this.menu = menu;
|
5787 | this.conf = conf;
|
5788 |
|
5789 | var $container = dom_core_1["default"]('<div class="w-e-droplist"></div>');
|
5790 |
|
5791 | var $title = dom_core_1["default"]("<p>" + conf.title + "</p>");
|
5792 | $title.addClass('w-e-dp-title');
|
5793 | $container.append($title);
|
5794 |
|
5795 | var list = conf.list || [];
|
5796 | var type = conf.type || 'list';
|
5797 |
|
5798 | var clickHandler = conf.clickHandler || const_1.EMPTY_FN;
|
5799 |
|
5800 | var $list = dom_core_1["default"]('<ul class="' + (type === 'list' ? 'w-e-list' : 'w-e-block') + '"></ul>');
|
5801 | (0, _forEach["default"])(list).call(list, function (item) {
|
5802 | var $elem = item.$elem;
|
5803 | var value = item.value;
|
5804 | var $li = dom_core_1["default"]('<li class="w-e-item"></li>');
|
5805 |
|
5806 | if ($elem) {
|
5807 | $li.append($elem);
|
5808 | $list.append($li);
|
5809 | $li.on('click', function () {
|
5810 | clickHandler(value);
|
5811 |
|
5812 | _this.hideTimeoutId = window.setTimeout(function () {
|
5813 | _this.hide();
|
5814 | });
|
5815 | });
|
5816 | }
|
5817 | });
|
5818 | $container.append($list);
|
5819 |
|
5820 | $container.on('mouseleave', function () {
|
5821 | _this.hideTimeoutId = window.setTimeout(function () {
|
5822 | _this.hide();
|
5823 | });
|
5824 | });
|
5825 |
|
5826 | this.$container = $container;
|
5827 | this.rendered = false;
|
5828 | this._show = false;
|
5829 | }
|
5830 | |
5831 |
|
5832 |
|
5833 |
|
5834 |
|
5835 | DropList.prototype.show = function () {
|
5836 | if (this.hideTimeoutId) {
|
5837 |
|
5838 | clearTimeout(this.hideTimeoutId);
|
5839 | }
|
5840 |
|
5841 | var menu = this.menu;
|
5842 | var $menuELem = menu.$elem;
|
5843 | var $container = this.$container;
|
5844 |
|
5845 | if (this._show) {
|
5846 | return;
|
5847 | }
|
5848 |
|
5849 | if (this.rendered) {
|
5850 |
|
5851 | $container.show();
|
5852 | } else {
|
5853 |
|
5854 | var menuHeight = $menuELem.getSizeData().height || 0;
|
5855 | var width = this.conf.width || 100;
|
5856 |
|
5857 | $container.css('margin-top', menuHeight + 'px').css('width', width + 'px');
|
5858 |
|
5859 | $menuELem.append($container);
|
5860 | this.rendered = true;
|
5861 | }
|
5862 |
|
5863 |
|
5864 | this._show = true;
|
5865 | };
|
5866 | |
5867 |
|
5868 |
|
5869 |
|
5870 |
|
5871 | DropList.prototype.hide = function () {
|
5872 | if (this.showTimeoutId) {
|
5873 |
|
5874 | clearTimeout(this.showTimeoutId);
|
5875 | }
|
5876 |
|
5877 | var $container = this.$container;
|
5878 |
|
5879 | if (!this._show) {
|
5880 | return;
|
5881 | }
|
5882 |
|
5883 |
|
5884 | $container.hide();
|
5885 | this._show = false;
|
5886 | };
|
5887 |
|
5888 | (0, _defineProperty["default"])(DropList.prototype, "isShow", {
|
5889 | get: function get() {
|
5890 | return this._show;
|
5891 | },
|
5892 | enumerable: false,
|
5893 | configurable: true
|
5894 | });
|
5895 | return DropList;
|
5896 | }();
|
5897 |
|
5898 | exports["default"] = DropList;
|
5899 |
|
5900 | }),
|
5901 |
|
5902 | (function(module, exports, __webpack_require__) {
|
5903 |
|
5904 | "use strict";
|
5905 |
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 | var _interopRequireDefault = __webpack_require__(0);
|
5912 |
|
5913 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
5914 |
|
5915 | (0, _defineProperty["default"])(exports, "__esModule", {
|
5916 | value: true
|
5917 | });
|
5918 |
|
5919 | function isActive(editor) {
|
5920 | var $selectionELem = editor.selection.getSelectionContainerElem();
|
5921 |
|
5922 | if (!$selectionELem) {
|
5923 | return false;
|
5924 | }
|
5925 |
|
5926 | if ($selectionELem.getNodeName() === 'A') {
|
5927 | return true;
|
5928 | } else {
|
5929 | return false;
|
5930 | }
|
5931 | }
|
5932 |
|
5933 | exports["default"] = isActive;
|
5934 |
|
5935 | }),
|
5936 |
|
5937 | (function(module, exports, __webpack_require__) {
|
5938 |
|
5939 | "use strict";
|
5940 |
|
5941 |
|
5942 |
|
5943 |
|
5944 |
|
5945 |
|
5946 | var _interopRequireDefault = __webpack_require__(0);
|
5947 |
|
5948 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
5949 |
|
5950 | (0, _defineProperty["default"])(exports, "__esModule", {
|
5951 | value: true
|
5952 | });
|
5953 |
|
5954 | function isActive(editor) {
|
5955 | var $selectionELem = editor.selection.getSelectionContainerElem();
|
5956 |
|
5957 | if (!$selectionELem) {
|
5958 | return false;
|
5959 | }
|
5960 |
|
5961 | if ($selectionELem.getNodeName() == 'CODE' || $selectionELem.getNodeName() == 'PRE' || $selectionELem.parent().getNodeName() == 'CODE' || $selectionELem.parent().getNodeName() == 'PRE' || /hljs/.test($selectionELem.parent().attr('class'))) {
|
5962 | return true;
|
5963 | } else {
|
5964 | return false;
|
5965 | }
|
5966 | }
|
5967 |
|
5968 | exports["default"] = isActive;
|
5969 |
|
5970 | }),
|
5971 |
|
5972 | (function(module, exports, __webpack_require__) {
|
5973 |
|
5974 | "use strict";
|
5975 |
|
5976 |
|
5977 | var _interopRequireDefault = __webpack_require__(0);
|
5978 |
|
5979 | var _find = _interopRequireDefault(__webpack_require__(30));
|
5980 |
|
5981 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
5982 |
|
5983 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
5984 | return mod && mod.__esModule ? mod : {
|
5985 | "default": mod
|
5986 | };
|
5987 | };
|
5988 |
|
5989 | (0, _defineProperty["default"])(exports, "__esModule", {
|
5990 | value: true
|
5991 | });
|
5992 | exports.todo = void 0;
|
5993 |
|
5994 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
5995 |
|
5996 | var todo =
|
5997 |
|
5998 | function () {
|
5999 | function todo($orginElem) {
|
6000 | var _a;
|
6001 |
|
6002 | this.template = "<ul class=\"w-e-todo\"><li><span contenteditable=\"false\"><input type=\"checkbox\"></span></li></ul>";
|
6003 | this.checked = false;
|
6004 | this.$todo = dom_core_1["default"](this.template);
|
6005 | this.$child = (_a = $orginElem === null || $orginElem === void 0 ? void 0 : $orginElem.childNodes()) === null || _a === void 0 ? void 0 : _a.clone(true);
|
6006 | }
|
6007 |
|
6008 | todo.prototype.init = function () {
|
6009 | var _this = this;
|
6010 |
|
6011 | var $input = this.getInput();
|
6012 | var $child = this.$child;
|
6013 | var $inputContainer = this.getInputContainer();
|
6014 |
|
6015 | if ($child) {
|
6016 | $child.insertAfter($inputContainer);
|
6017 | }
|
6018 |
|
6019 | $input.on('click', function () {
|
6020 | if (_this.checked) {
|
6021 | $input === null || $input === void 0 ? void 0 : $input.removeAttr('checked');
|
6022 | } else {
|
6023 | $input === null || $input === void 0 ? void 0 : $input.attr('checked', '');
|
6024 | }
|
6025 |
|
6026 | _this.checked = !_this.checked;
|
6027 | });
|
6028 | };
|
6029 |
|
6030 | todo.prototype.getInput = function () {
|
6031 | var $todo = this.$todo;
|
6032 | var $input = (0, _find["default"])($todo).call($todo, 'input');
|
6033 | return $input;
|
6034 | };
|
6035 |
|
6036 | todo.prototype.getInputContainer = function () {
|
6037 | var $inputContainer = this.getInput().parent();
|
6038 | return $inputContainer;
|
6039 | };
|
6040 |
|
6041 | todo.prototype.getTodo = function () {
|
6042 | return this.$todo;
|
6043 | };
|
6044 |
|
6045 | return todo;
|
6046 | }();
|
6047 |
|
6048 | exports.todo = todo;
|
6049 |
|
6050 | function createTodo($orginElem) {
|
6051 | var t = new todo($orginElem);
|
6052 | t.init();
|
6053 | return t;
|
6054 | }
|
6055 |
|
6056 | exports["default"] = createTodo;
|
6057 |
|
6058 | }),
|
6059 |
|
6060 | (function(module, exports, __webpack_require__) {
|
6061 |
|
6062 | "use strict";
|
6063 |
|
6064 |
|
6065 |
|
6066 |
|
6067 |
|
6068 |
|
6069 | var _interopRequireDefault = __webpack_require__(0);
|
6070 |
|
6071 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
6072 |
|
6073 | var _create = _interopRequireDefault(__webpack_require__(3));
|
6074 |
|
6075 | var __createBinding = void 0 && (void 0).__createBinding || (_create["default"] ? function (o, m, k, k2) {
|
6076 | if (k2 === undefined) k2 = k;
|
6077 | (0, _defineProperty["default"])(o, k2, {
|
6078 | enumerable: true,
|
6079 | get: function get() {
|
6080 | return m[k];
|
6081 | }
|
6082 | });
|
6083 | } : function (o, m, k, k2) {
|
6084 | if (k2 === undefined) k2 = k;
|
6085 | o[k2] = m[k];
|
6086 | });
|
6087 |
|
6088 | var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
6089 | for (var p in m) {
|
6090 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
6091 | }
|
6092 | };
|
6093 |
|
6094 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
6095 | return mod && mod.__esModule ? mod : {
|
6096 | "default": mod
|
6097 | };
|
6098 | };
|
6099 |
|
6100 | (0, _defineProperty["default"])(exports, "__esModule", {
|
6101 | value: true
|
6102 | });
|
6103 |
|
6104 | __webpack_require__(139);
|
6105 |
|
6106 | __webpack_require__(141);
|
6107 |
|
6108 | __webpack_require__(145);
|
6109 |
|
6110 | __webpack_require__(147);
|
6111 |
|
6112 | __webpack_require__(149);
|
6113 |
|
6114 | __webpack_require__(151);
|
6115 |
|
6116 | __webpack_require__(153);
|
6117 |
|
6118 | var index_1 = __importDefault(__webpack_require__(177));
|
6119 |
|
6120 | __exportStar(__webpack_require__(416), exports);
|
6121 |
|
6122 |
|
6123 | try {
|
6124 | document;
|
6125 | } catch (ex) {
|
6126 | throw new Error('请在浏览器环境下运行');
|
6127 | }
|
6128 |
|
6129 | exports["default"] = index_1["default"];
|
6130 |
|
6131 | }),
|
6132 |
|
6133 | (function(module, exports, __webpack_require__) {
|
6134 |
|
6135 | var parent = __webpack_require__(131);
|
6136 |
|
6137 | module.exports = parent;
|
6138 |
|
6139 |
|
6140 | }),
|
6141 |
|
6142 | (function(module, exports, __webpack_require__) {
|
6143 |
|
6144 | __webpack_require__(132);
|
6145 | var path = __webpack_require__(10);
|
6146 |
|
6147 | var Object = path.Object;
|
6148 |
|
6149 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
6150 | return Object.defineProperty(it, key, desc);
|
6151 | };
|
6152 |
|
6153 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
6154 |
|
6155 |
|
6156 | }),
|
6157 |
|
6158 | (function(module, exports, __webpack_require__) {
|
6159 |
|
6160 | var $ = __webpack_require__(4);
|
6161 | var DESCRIPTORS = __webpack_require__(14);
|
6162 | var objectDefinePropertyModile = __webpack_require__(18);
|
6163 |
|
6164 |
|
6165 |
|
6166 | $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {
|
6167 | defineProperty: objectDefinePropertyModile.f
|
6168 | });
|
6169 |
|
6170 |
|
6171 | }),
|
6172 |
|
6173 | (function(module, exports) {
|
6174 |
|
6175 | var g;
|
6176 |
|
6177 |
|
6178 | g = (function() {
|
6179 | return this;
|
6180 | })();
|
6181 |
|
6182 | try {
|
6183 |
|
6184 | g = g || new Function("return this")();
|
6185 | } catch (e) {
|
6186 |
|
6187 | if (typeof window === "object") g = window;
|
6188 | }
|
6189 |
|
6190 |
|
6191 |
|
6192 |
|
6193 |
|
6194 | module.exports = g;
|
6195 |
|
6196 |
|
6197 | }),
|
6198 |
|
6199 | (function(module, exports, __webpack_require__) {
|
6200 |
|
6201 | var parent = __webpack_require__(135);
|
6202 |
|
6203 | module.exports = parent;
|
6204 |
|
6205 |
|
6206 | }),
|
6207 |
|
6208 | (function(module, exports, __webpack_require__) {
|
6209 |
|
6210 | __webpack_require__(136);
|
6211 | var path = __webpack_require__(10);
|
6212 |
|
6213 | var Object = path.Object;
|
6214 |
|
6215 | module.exports = function create(P, D) {
|
6216 | return Object.create(P, D);
|
6217 | };
|
6218 |
|
6219 |
|
6220 | }),
|
6221 |
|
6222 | (function(module, exports, __webpack_require__) {
|
6223 |
|
6224 | var $ = __webpack_require__(4);
|
6225 | var DESCRIPTORS = __webpack_require__(14);
|
6226 | var create = __webpack_require__(48);
|
6227 |
|
6228 |
|
6229 |
|
6230 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
6231 | create: create
|
6232 | });
|
6233 |
|
6234 |
|
6235 | }),
|
6236 |
|
6237 | (function(module, exports, __webpack_require__) {
|
6238 |
|
6239 | var DESCRIPTORS = __webpack_require__(14);
|
6240 | var definePropertyModule = __webpack_require__(18);
|
6241 | var anObject = __webpack_require__(24);
|
6242 | var objectKeys = __webpack_require__(57);
|
6243 |
|
6244 |
|
6245 |
|
6246 | module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
|
6247 | anObject(O);
|
6248 | var keys = objectKeys(Properties);
|
6249 | var length = keys.length;
|
6250 | var index = 0;
|
6251 | var key;
|
6252 | while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
|
6253 | return O;
|
6254 | };
|
6255 |
|
6256 |
|
6257 | }),
|
6258 |
|
6259 | (function(module, exports, __webpack_require__) {
|
6260 |
|
6261 | var global = __webpack_require__(8);
|
6262 | var createNonEnumerableProperty = __webpack_require__(17);
|
6263 |
|
6264 | module.exports = function (key, value) {
|
6265 | try {
|
6266 | createNonEnumerableProperty(global, key, value);
|
6267 | } catch (error) {
|
6268 | global[key] = value;
|
6269 | } return value;
|
6270 | };
|
6271 |
|
6272 |
|
6273 | }),
|
6274 |
|
6275 | (function(module, exports, __webpack_require__) {
|
6276 |
|
6277 | var api = __webpack_require__(20);
|
6278 | var content = __webpack_require__(140);
|
6279 |
|
6280 | content = content.__esModule ? content.default : content;
|
6281 |
|
6282 | if (typeof content === 'string') {
|
6283 | content = [[module.i, content, '']];
|
6284 | }
|
6285 |
|
6286 | var options = {};
|
6287 |
|
6288 | options.insert = "head";
|
6289 | options.singleton = false;
|
6290 |
|
6291 | var update = api(content, options);
|
6292 |
|
6293 |
|
6294 |
|
6295 | module.exports = content.locals || {};
|
6296 |
|
6297 | }),
|
6298 |
|
6299 | (function(module, exports, __webpack_require__) {
|
6300 |
|
6301 |
|
6302 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
6303 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
6304 |
|
6305 | exports.push([module.i, ".w-e-toolbar,\n.w-e-text-container,\n.w-e-menu-panel {\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n background-color: #fff;\n /*表情菜单样式*/\n /*分割线样式*/\n}\n.w-e-toolbar h1,\n.w-e-text-container h1,\n.w-e-menu-panel h1 {\n font-size: 2em !important;\n}\n.w-e-toolbar h2,\n.w-e-text-container h2,\n.w-e-menu-panel h2 {\n font-size: 1.5em !important;\n}\n.w-e-toolbar h3,\n.w-e-text-container h3,\n.w-e-menu-panel h3 {\n font-size: 1.17em !important;\n}\n.w-e-toolbar h4,\n.w-e-text-container h4,\n.w-e-menu-panel h4 {\n font-size: 1em !important;\n}\n.w-e-toolbar h5,\n.w-e-text-container h5,\n.w-e-menu-panel h5 {\n font-size: 0.83em !important;\n}\n.w-e-toolbar p,\n.w-e-text-container p,\n.w-e-menu-panel p {\n font-size: 1em !important;\n}\n.w-e-toolbar .eleImg,\n.w-e-text-container .eleImg,\n.w-e-menu-panel .eleImg {\n cursor: pointer;\n display: inline-block;\n font-size: 18px;\n padding: 0 3px;\n}\n.w-e-toolbar *,\n.w-e-text-container *,\n.w-e-menu-panel * {\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n.w-e-toolbar hr,\n.w-e-text-container hr,\n.w-e-menu-panel hr {\n cursor: pointer;\n display: block;\n height: 0px;\n border: 0;\n border-top: 3px solid #ccc;\n margin: 20px 0;\n}\n.w-e-clear-fix:after {\n content: \"\";\n display: table;\n clear: both;\n}\n.w-e-drop-list-item {\n position: relative;\n top: 1px;\n padding-right: 7px;\n color: #333 !important;\n}\n.w-e-drop-list-tl {\n padding-left: 10px;\n text-align: left;\n}\n", ""]);
|
6306 |
|
6307 | module.exports = exports;
|
6308 |
|
6309 |
|
6310 | }),
|
6311 |
|
6312 | (function(module, exports, __webpack_require__) {
|
6313 |
|
6314 | var api = __webpack_require__(20);
|
6315 | var content = __webpack_require__(142);
|
6316 |
|
6317 | content = content.__esModule ? content.default : content;
|
6318 |
|
6319 | if (typeof content === 'string') {
|
6320 | content = [[module.i, content, '']];
|
6321 | }
|
6322 |
|
6323 | var options = {};
|
6324 |
|
6325 | options.insert = "head";
|
6326 | options.singleton = false;
|
6327 |
|
6328 | var update = api(content, options);
|
6329 |
|
6330 |
|
6331 |
|
6332 | module.exports = content.locals || {};
|
6333 |
|
6334 | }),
|
6335 |
|
6336 | (function(module, exports, __webpack_require__) {
|
6337 |
|
6338 |
|
6339 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
6340 | var ___CSS_LOADER_GET_URL_IMPORT___ = __webpack_require__(143);
|
6341 | var ___CSS_LOADER_URL_IMPORT_0___ = __webpack_require__(144);
|
6342 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
6343 | var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
|
6344 |
|
6345 | exports.push([module.i, "@font-face {\n font-family: 'w-e-icon';\n src: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") format('truetype');\n font-weight: normal;\n font-style: normal;\n}\n[class^=\"w-e-icon-\"],\n[class*=\" w-e-icon-\"] {\n /* use !important to prevent issues with browser extensions that change fonts */\n font-family: 'w-e-icon' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.w-e-icon-close:before {\n content: \"\\f00d\";\n}\n.w-e-icon-upload2:before {\n content: \"\\e9c6\";\n}\n.w-e-icon-trash-o:before {\n content: \"\\f014\";\n}\n.w-e-icon-header:before {\n content: \"\\f1dc\";\n}\n.w-e-icon-pencil2:before {\n content: \"\\e906\";\n}\n.w-e-icon-paint-brush:before {\n content: \"\\f1fc\";\n}\n.w-e-icon-image:before {\n content: \"\\e90d\";\n}\n.w-e-icon-play:before {\n content: \"\\e912\";\n}\n.w-e-icon-location:before {\n content: \"\\e947\";\n}\n.w-e-icon-undo:before {\n content: \"\\e965\";\n}\n.w-e-icon-redo:before {\n content: \"\\e966\";\n}\n.w-e-icon-quotes-left:before {\n content: \"\\e977\";\n}\n.w-e-icon-list-numbered:before {\n content: \"\\e9b9\";\n}\n.w-e-icon-list2:before {\n content: \"\\e9bb\";\n}\n.w-e-icon-link:before {\n content: \"\\e9cb\";\n}\n.w-e-icon-happy:before {\n content: \"\\e9df\";\n}\n.w-e-icon-bold:before {\n content: \"\\ea62\";\n}\n.w-e-icon-underline:before {\n content: \"\\ea63\";\n}\n.w-e-icon-italic:before {\n content: \"\\ea64\";\n}\n.w-e-icon-strikethrough:before {\n content: \"\\ea65\";\n}\n.w-e-icon-table2:before {\n content: \"\\ea71\";\n}\n.w-e-icon-paragraph-left:before {\n content: \"\\ea77\";\n}\n.w-e-icon-paragraph-center:before {\n content: \"\\ea78\";\n}\n.w-e-icon-paragraph-right:before {\n content: \"\\ea79\";\n}\n.w-e-icon-paragraph-justify:before {\n content: \"\\ea7a\";\n}\n.w-e-icon-terminal:before {\n content: \"\\f120\";\n}\n.w-e-icon-page-break:before {\n content: \"\\ea68\";\n}\n.w-e-icon-cancel-circle:before {\n content: \"\\ea0d\";\n}\n.w-e-icon-font:before {\n content: \"\\ea5c\";\n}\n.w-e-icon-text-heigh:before {\n content: \"\\ea5f\";\n}\n.w-e-icon-paint-format:before {\n content: \"\\e90c\";\n}\n.w-e-icon-indent-increase:before {\n content: \"\\ea7b\";\n}\n.w-e-icon-indent-decrease:before {\n content: \"\\ea7c\";\n}\n.w-e-icon-row-height:before {\n content: \"\\e9be\";\n}\n.w-e-icon-fullscreen_exit:before {\n content: \"\\e900\";\n}\n.w-e-icon-fullscreen:before {\n content: \"\\e901\";\n}\n.w-e-icon-split-line:before {\n content: \"\\ea0b\";\n}\n.w-e-icon-checkbox-checked:before {\n content: \"\\ea52\";\n}\n", ""]);
|
6346 |
|
6347 | module.exports = exports;
|
6348 |
|
6349 |
|
6350 | }),
|
6351 |
|
6352 | (function(module, exports, __webpack_require__) {
|
6353 |
|
6354 | "use strict";
|
6355 |
|
6356 |
|
6357 | module.exports = function (url, options) {
|
6358 | if (!options) {
|
6359 |
|
6360 | options = {};
|
6361 | }
|
6362 |
|
6363 |
|
6364 | url = url && url.__esModule ? url.default : url;
|
6365 |
|
6366 | if (typeof url !== 'string') {
|
6367 | return url;
|
6368 | }
|
6369 |
|
6370 |
|
6371 | if (/^['"].*['"]$/.test(url)) {
|
6372 |
|
6373 | url = url.slice(1, -1);
|
6374 | }
|
6375 |
|
6376 | if (options.hash) {
|
6377 |
|
6378 | url += options.hash;
|
6379 | }
|
6380 |
|
6381 |
|
6382 |
|
6383 | if (/["'() \t\n]/.test(url) || options.needQuotes) {
|
6384 | return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, '\\n'), "\"");
|
6385 | }
|
6386 |
|
6387 | return url;
|
6388 | };
|
6389 |
|
6390 | }),
|
6391 |
|
6392 | (function(module, __webpack_exports__, __webpack_require__) {
|
6393 |
|
6394 | "use strict";
|
6395 | __webpack_require__.r(__webpack_exports__);
|
6396 | __webpack_exports__["default"] = ("data:font/woff;base64,d09GRgABAAAAABskAAsAAAAAGtgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIPFWNtYXAAAAFoAAABHAAAARz2mfAgZ2FzcAAAAoQAAAAIAAAACAAAABBnbHlmAAACjAAAFXwAABV8IH7+mGhlYWQAABgIAAAANgAAADYb6gumaGhlYQAAGEAAAAAkAAAAJAkjBWlobXR4AAAYZAAAAKQAAACkmYcEbmxvY2EAABkIAAAAVAAAAFReAmKYbWF4cAAAGVwAAAAgAAAAIAA0ALZuYW1lAAAZfAAAAYYAAAGGmUoJ+3Bvc3QAABsEAAAAIAAAACAAAwAAAAMD7wGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8fwDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAQAAAAA8ACAABAAcAAEAIOkB6QbpDekS6UfpZul36bnpu+m+6cbpy+nf6gvqDepS6lzqX+pl6nHqfPAN8BTxIPHc8fz//f//AAAAAAAg6QDpBukM6RLpR+ll6Xfpuem76b7pxunL6d/qC+oN6lLqXOpf6mLqcep38A3wFPEg8dzx/P/9//8AAf/jFwQXABb7FvcWwxamFpYWVRZUFlIWSxZHFjQWCRYIFcQVuxW5FbcVrBWnEBcQEQ8GDksOLAADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAAEAEEAAQO/A38ABQALABEAFwAAATMVIREzAxEhFSMVATUzESE1ETUhESM1Av/A/sJ+fgE+wP4Cfv7CAT5+Ar9+AT78ggE+fsACvsD+wn7+An7+wsAAAAAABABBAAEDvwN/AAUACwARABcAAAEhESM1IxM1MxEhNQERIRUjFREVMxUhEQKBAT5+wMB+/sL9wAE+wMD+wgN//sLA/X7A/sJ+AcIBPn7A/v7AfgE+AAAAAAIAAP/ABAADwAAEABMAAAE3AScBAy4BJxM3ASMBAyUBNQEHAYCAAcBA/kCfFzsyY4ABgMD+gMACgAGA/oBOAUBAAcBA/kD+nTI7FwERTgGA/oD9gMABgMD+gIAAAgAA/8AEAAOAACkALQAAAREjNTQmIyEiBh0BFBYzITI2PQEzESEVIyIGFREUFjsBMjY1ETQmKwE1ASE1IQQAwCYa/UAaJiYaAsAaJoD9wCANExMNgA0TEw0gAUD9QALAAYABgEAaJiYawBomJhpA/wCAEw3+wA0TEw0BQA0TQAGAQAAABAAAAAAEAAOAABAAIQAtADQAAAE4ATEROAExITgBMRE4ATEhNSEiBhURFBYzITI2NRE0JiMHFAYjIiY1NDYzMhYTITUTATM3A8D8gAOA/IAaJiYaA4AaJiYagDgoKDg4KCg4QP0A4AEAQOADQP0AAwBAJhr9ABomJhoDABom4Cg4OCgoODj9uIABgP7AwAAAAgAAAEAEAANAADgAPAAAASYnLgEnJiMiBw4BBwYHBgcOAQcGFRQXHgEXFhcWFx4BFxYzMjc+ATc2NzY3PgE3NjU0Jy4BJyYnARENAQPVNjg5djw9Pz89PHY5ODYLBwgLAwMDAwsIBws2ODl2PD0/Pz08djk4NgsHCAsDAwMDCwgHC/2rAUD+wAMgCAYGCAICAgIIBgYIKSoqWS0uLy8uLVkqKikIBgYIAgICAggGBggpKipZLS4vLy4tWSoqKf3gAYDAwAAAAAACAMD/wANAA8AAGwAnAAABIgcOAQcGFRQXHgEXFjEwNz4BNzY1NCcuAScmAyImNTQ2MzIWFRQGAgBCOzpXGRkyMngyMjIyeDIyGRlXOjtCUHBwUFBwcAPAGRlXOjtCeH19zEFBQUHMfX14Qjs6VxkZ/gBwUFBwcFBQcAAAAQAAAAAEAAOAACsAAAEiBw4BBwYHJxEhJz4BMzIXHgEXFhUUBw4BBwYHFzY3PgE3NjU0Jy4BJyYjAgA1MjJcKSkjlgGAkDWLUFBFRmkeHgkJIhgYHlUoICAtDAwoKIteXWoDgAoLJxscI5b+gJA0PB4eaUZFUCsoKUkgIRpgIysrYjY2OWpdXosoKAABAAAAAAQAA4AAKgAAExQXHgEXFhc3JicuAScmNTQ3PgE3NjMyFhcHIREHJicuAScmIyIHDgEHBgAMDC0gIChVHhgYIgkJHh5pRkVQUIs1kAGAliMpKVwyMjVqXV6LKCgBgDk2NmIrKyNgGiEgSSkoK1BFRmkeHjw0kAGAliMcGycLCigoi15dAAAAAAIAAABABAEDAAAmAE0AABMyFx4BFxYVFAcOAQcGIyInLgEnJjUnNDc+ATc2MxUiBgcOAQc+ASEyFx4BFxYVFAcOAQcGIyInLgEnJjUnNDc+ATc2MxUiBgcOAQc+AeEuKSk9ERISET0pKS4uKSk9ERIBIyN6UlFdQHUtCRAHCBICSS4pKT0REhIRPSkpLi4pKT0REgEjI3pSUV1AdS0JEAcIEgIAEhE9KSkuLikpPRESEhE9KSkuIF1RUnojI4AwLggTCgIBEhE9KSkuLikpPRESEhE9KSkuIF1RUnojI4AwLggTCgIBAAAGAED/wAQAA8AAAwAHAAsAEQAdACkAACUhFSERIRUhESEVIScRIzUjNRMVMxUjNTc1IzUzFRURIzUzNSM1MzUjNQGAAoD9gAKA/YACgP2AwEBAQIDAgIDAwICAgICAgAIAgAIAgMD/AMBA/fIyQJI8MkCS7v7AQEBAQEAABgAA/8AEAAPAAAMABwALABcAIwAvAAABIRUhESEVIREhFSEBNDYzMhYVFAYjIiYRNDYzMhYVFAYjIiYRNDYzMhYVFAYjIiYBgAKA/YACgP2AAoD9gP6ASzU1S0s1NUtLNTVLSzU1S0s1NUtLNTVLA4CA/wCA/wCAA0A1S0s1NUtL/rU1S0s1NUtL/rU1S0s1NUtLAAUAAABABWADAAADAAcACwAOABEAABMhFSEVIRUhFSEVIQEXNzUnBwADgPyAA4D8gAOA/IAD4MDAwMADAMBAwEDAAUDAwEDAwAAAAAADAAAAAAQAA6AAAwANABQAADchFSElFSE1EyEVITUhJQkBIxEjEQAEAPwABAD8AIABAAEAAQD9YAEgASDggEBAwEBAAQCAgMABIP7g/wABAAAAAAACAB7/zAPiA7QAMwBkAAABIiYnJicmNDc2PwE+ATMyFhcWFxYUBwYPAQYiJyY0PwE2NCcuASMiBg8BBhQXFhQHDgEjAyImJyYnJjQ3Nj8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFxYUBwYPAQ4BIwG4ChMIIxISEhIjwCNZMTFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PCBMKuDFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PDysQIxISEhIjwCNZMQFECAckLS1eLS0kwCIlJSIkLS1eLS0kVxAQDysPWCl0KRQVFRTAKXQpDysQBwj+iCUiJC0tXi0tJFcQEA8rD1gpdCkUFRUUwCl0KQ8rEA8PJC0tXi0tJMAiJQAAAAAFAAD/wAQAA8AAGwA3AFMAXwBrAAAFMjc+ATc2NTQnLgEnJiMiBw4BBwYVFBceARcWEzIXHgEXFhUUBw4BBwYjIicuAScmNTQ3PgE3NhMyNz4BNzY3BgcOAQcGIyInLgEnJicWFx4BFxYnNDYzMhYVFAYjIiYlNDYzMhYVFAYjIiYCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMVisrKlEmJiMFHBtWODc/Pzc4VhscBSMmJlEqK9UlGxslJRsbJQGAJRsbJSUbGyVAKCiLXl1qal1eiygoKCiLXl1qal1eiygoA6AhIHFMTFZWTExxICEhIHFMTFZWTExxICH+CQYGFRAQFEM6OlYYGRkYVjo6QxQQEBUGBvcoODgoKDg4KCg4OCgoODgAAAEAAAFABAACQAAPAAATFRQWMyEyNj0BNCYjISIGABMNA8ANExMN/EANEwIgwA0TEw3ADRMTAAAAAwAA/8AEAAPAABsANwBDAAABIgcOAQcGFRQXHgEXFjMyNz4BNzY1NCcuAScmAyInLgEnJjU0Nz4BNzYzMhceARcWFRQHDgEHBhMHJwcXBxc3FzcnNwIAal1eiygoKCiLXl1qal1eiygoKCiLXl1qVkxMcSAhISBxTExWVkxMcSAhISBxTExKoKBgoKBgoKBgoKADwCgoi15dampdXosoKCgoi15dampdXosoKPxgISBxTExWVkxMcSAhISBxTExWVkxMcSAhAqCgoGCgoGCgoGCgoAACAAD/wAQAA8AADwAVAAABISIGFREUFjMhMjY1ETQmASc3FwEXA4D9ADVLSzUDADVLS/4L7VqTATNaA8BLNf0ANUtLNQMANUv85e5akgEyWgAAAAABAGX/wAObA8AAKQAAASImIyIHDgEHBhUUFjMuATU0NjcwBwYCBwYHFSETMzcjNx4BMzI2Nw4BAyBEaEZxU1RtGhtJSAYNZUoQEEs8PFkBPWzGLNc0LVUmLlAYHT0DsBAeHWE+P0FNOwsmN5lvA31+/sWPkCMZAgCA9gkPN2sJBwAAAAACAAAAAAQAA4AACQAXAAAlMwcnMxEjNxcjJREnIxEzFSE1MxEjBxEDgICgoICAoKCA/wBAwID+gIDAQMDAwAIAwMDA/wCA/UBAQALAgAEAAAMAwAAAA0ADgAAWAB8AKAAAAT4BNTQnLgEnJiMhESEyNz4BNzY1NCYBMzIWFRQGKwETIxEzMhYVFAYCxBwgFBRGLi81/sABgDUvLkYUFET+hGUqPDwpZp+fnyw+PgHbIlQvNS8uRhQU/IAUFEYuLzVGdAFGSzU1S/6AAQBLNTVLAAAAAAIAwAAAA0ADgAAfACMAAAEzERQHDgEHBiMiJy4BJyY1ETMRFBYXHgEzMjY3PgE1ASEVIQLAgBkZVzo7QkI7OlcZGYAbGBxJKChJHBgb/gACgP2AA4D+YDw0NU4WFxcWTjU0PAGg/mAeOBcYGxsYFzge/qCAAAAAAAEAgAAAA4ADgAALAAABFSMBMxUhNTMBIzUDgID+wID+QIABQIADgED9AEBAAwBAAAEAAAAABAADgAA9AAABFSMeARUUBgcOASMiJicuATUzFBYzMjY1NCYjITUhLgEnLgE1NDY3PgEzMhYXHgEVIzQmIyIGFRQWMzIWFwQA6xUWNTAscT4+cSwwNYByTk5yck7+AAEsAgQBMDU1MCxxPj5xLDA1gHJOTnJyTjtuKwHAQB1BIjViJCEkJCEkYjU0TEw0NExAAQMBJGI1NWIkISQkISRiNTRMTDQ0TCEfAAAACgAAAAAEAAOAAAMABwALAA8AEwAXABsAHwAjACcAABMRIREBNSEVHQEhNQEVITUjFSE1ESEVISUhFSERNSEVASEVISE1IRUABAD9gAEA/wABAP8AQP8AAQD/AAKAAQD/AAEA/IABAP8AAoABAAOA/IADgP3AwMBAwMACAMDAwMD/AMDAwAEAwMD+wMDAwAAABQAAAAAEAAOAAAMABwALAA8AEwAAEyEVIRUhFSERIRUhESEVIREhFSEABAD8AAKA/YACgP2ABAD8AAQA/AADgIBAgP8AgAFAgP8AgAAAAAAFAAAAAAQAA4AAAwAHAAsADwATAAATIRUhFyEVIREhFSEDIRUhESEVIQAEAPwAwAKA/YACgP2AwAQA/AAEAPwAA4CAQID/AIABQID/AIAAAAUAAAAABAADgAADAAcACwAPABMAABMhFSEFIRUhESEVIQEhFSERIRUhAAQA/AABgAKA/YACgP2A/oAEAPwABAD8AAOAgECA/wCAAUCA/wCAAAAAAAUAAAAABAADgAADAAcACwAPABMAABMhFSEVIRUhFSEVIRUhFSEVIRUhAAQA/AAEAPwABAD8AAQA/AAEAPwAA4CAQIBAgECAQIAAAAAGAAAAAAQAA4AAAwAHAAsADwATABYAABMhFSEFIRUhFSEVIRUhFSEFIRUhGQEFAAQA/AABgAKA/YACgP2AAoD9gP6ABAD8AAEAA4CAQIBAgECAQIABAAGAwAAAAAYAAAAABAADgAADAAcACwAPABMAFgAAEyEVIQUhFSEVIRUhFSEVIQUhFSEBESUABAD8AAGAAoD9gAKA/YACgP2A/oAEAPwAAQD/AAOAgECAQIBAgECAAoD+gMAAAQA/AD8C5gLmACwAACUUDwEGIyIvAQcGIyIvASY1ND8BJyY1ND8BNjMyHwE3NjMyHwEWFRQPARcWFQLmEE4QFxcQqKgQFxYQThAQqKgQEE4QFhcQqKgQFxcQThAQqKgQwxYQThAQqKgQEE4QFhcQqKgQFxcQThAQqKgQEE4QFxcQqKgQFwAAAAYAAAAAAyUDbgAUACgAPABNAFUAggAAAREUBwYrASInJjURNDc2OwEyFxYVMxEUBwYrASInJjURNDc2OwEyFxYXERQHBisBIicmNRE0NzY7ATIXFhMRIREUFxYXFjMhMjc2NzY1ASEnJicjBgcFFRQHBisBERQHBiMhIicmNREjIicmPQE0NzY7ATc2NzY7ATIXFh8BMzIXFhUBJQYFCCQIBQYGBQgkCAUGkgUFCCUIBQUFBQglCAUFkgUFCCUIBQUFBQglCAUFSf4ABAQFBAIB2wIEBAQE/oABABsEBrUGBAH3BgUINxobJv4lJhsbNwgFBQUFCLEoCBcWF7cXFhYJKLAIBQYCEv63CAUFBQUIAUkIBQYGBQj+twgFBQUFCAFJCAUGBgUI/rcIBQUFBQgBSQgFBgYF/lsCHf3jDQsKBQUFBQoLDQJmQwUCAgVVJAgGBf3jMCIjISIvAiAFBggkCAUFYBUPDw8PFWAFBQgAAgAHAEkDtwKvABoALgAACQEGIyIvASY1ND8BJyY1ND8BNjMyFwEWFRQHARUUBwYjISInJj0BNDc2MyEyFxYBTv72BgcIBR0GBuHhBgYdBQgHBgEKBgYCaQUFCP3bCAUFBQUIAiUIBQUBhf72BgYcBggHBuDhBgcHBh0FBf71BQgHBv77JQgFBQUFCCUIBQUFBQAAAAEAIwAAA90DbgCzAAAlIicmIyIHBiMiJyY1NDc2NzY3Njc2PQE0JyYjISIHBh0BFBcWFxYzFhcWFRQHBiMiJyYjIgcGIyInJjU0NzY3Njc2NzY9ARE0NTQ1NCc0JyYnJicmJyYnJiMiJyY1NDc2MzIXFjMyNzYzMhcWFRQHBiMGBwYHBh0BFBcWMyEyNzY9ATQnJicmJyY1NDc2MzIXFjMyNzYzMhcWFRQHBgciBwYHBhURFBcWFxYXMhcWFRQHBiMDwRkzMhoZMjMZDQgHCQoNDBEQChIBBxX+fhYHARUJEhMODgwLBwcOGzU1GhgxMRgNBwcJCQsMEA8JEgECAQIDBAQFCBIRDQ0KCwcHDho1NRoYMDEYDgcHCQoMDRAQCBQBBw8BkA4HARQKFxcPDgcHDhkzMhkZMTEZDgcHCgoNDRARCBQUCRERDg0KCwcHDgACAgICDAsPEQkJAQEDAwUMROAMBQMDBQzUUQ0GAQIBCAgSDwwNAgICAgwMDhEICQECAwMFDUUhAdACDQ0ICA4OCgoLCwcHAwYBAQgIEg8MDQICAgINDA8RCAgBAgEGDFC2DAcBAQcMtlAMBgEBBgcWDwwNAgICAg0MDxEICAEBAgYNT/3mRAwGAgIBCQgRDwwNAAACAAD/twP/A7cAEwA5AAABMhcWFRQHAgcGIyInJjU0NwE2MwEWFxYfARYHBiMiJyYnJicmNRYXFhcWFxYzMjc2NzY3Njc2NzY3A5soHh4avkw3RUg0NDUBbSEp/fgXJicvAQJMTHtHNjYhIRARBBMUEBASEQkXCA8SExUVHR0eHikDtxsaKCQz/plGNDU0SUkwAUsf/bErHx8NKHpNTBobLi86OkQDDw4LCwoKFiUbGhERCgsEBAIAAQAAAAAAAIWwaoFfDzz1AAsEAAAAAADbteOZAAAAANu145kAAP+3BWADwAAAAAgAAgAAAAAAAAABAAADwP/AAAAFgAAA//8FYAABAAAAAAAAAAAAAAAAAAAAKQQAAAAAAAAAAAAAAAIAAAAEAABBBAAAQQQAAAAEAAAABAAAAAQAAAAEAADABAAAAAQAAAAEAAAABAAAQAQAAAAFgAAABAAAAAQAAB4EAAAABAAAAAQAAAAEAAAABAAAZQQAAAAEAADABAAAwAQAAIAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAMlAD8DJQAAA74ABwQAACMD/wAAAAAAAAAKABQAHgBKAHYApADmAS4BkgHQAhYCXALQAw4DWAN+A6gEPgTeBPoFZAWOBdAF+AY6BnYGjgbmBy4HVgd+B6gHzgf8CCoIbgkmCXAKYgq+AAEAAAApALQACgAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAHAAAAAQAAAAAAAgAHAGAAAQAAAAAAAwAHADYAAQAAAAAABAAHAHUAAQAAAAAABQALABUAAQAAAAAABgAHAEsAAQAAAAAACgAaAIoAAwABBAkAAQAOAAcAAwABBAkAAgAOAGcAAwABBAkAAwAOAD0AAwABBAkABAAOAHwAAwABBAkABQAWACAAAwABBAkABgAOAFIAAwABBAkACgA0AKRpY29tb29uAGkAYwBvAG0AbwBvAG5WZXJzaW9uIDEuMABWAGUAcgBzAGkAbwBuACAAMQAuADBpY29tb29uAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG5SZWd1bGFyAFIAZQBnAHUAbABhAHJpY29tb29uAGkAYwBvAG0AbwBvAG5Gb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
|
6397 |
|
6398 | }),
|
6399 |
|
6400 | (function(module, exports, __webpack_require__) {
|
6401 |
|
6402 | var api = __webpack_require__(20);
|
6403 | var content = __webpack_require__(146);
|
6404 |
|
6405 | content = content.__esModule ? content.default : content;
|
6406 |
|
6407 | if (typeof content === 'string') {
|
6408 | content = [[module.i, content, '']];
|
6409 | }
|
6410 |
|
6411 | var options = {};
|
6412 |
|
6413 | options.insert = "head";
|
6414 | options.singleton = false;
|
6415 |
|
6416 | var update = api(content, options);
|
6417 |
|
6418 |
|
6419 |
|
6420 | module.exports = content.locals || {};
|
6421 |
|
6422 | }),
|
6423 |
|
6424 | (function(module, exports, __webpack_require__) {
|
6425 |
|
6426 |
|
6427 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
6428 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
6429 |
|
6430 | exports.push([module.i, ".w-e-toolbar {\n display: flex;\n padding: 0 6px;\n flex-wrap: wrap;\n position: relative;\n /* 单个菜单 */\n}\n.w-e-toolbar .w-e-menu {\n position: relative;\n display: flex;\n width: 40px;\n height: 40px;\n align-items: center;\n justify-content: center;\n text-align: center;\n cursor: pointer;\n}\n.w-e-toolbar .w-e-menu i {\n color: #999;\n}\n.w-e-toolbar .w-e-menu:hover {\n background-color: #F6F6F6;\n}\n.w-e-toolbar .w-e-menu:hover i {\n color: #333;\n}\n.w-e-toolbar .w-e-active i {\n color: #1e88e5;\n}\n.w-e-toolbar .w-e-active:hover i {\n color: #1e88e5;\n}\n", ""]);
|
6431 |
|
6432 | module.exports = exports;
|
6433 |
|
6434 |
|
6435 | }),
|
6436 |
|
6437 | (function(module, exports, __webpack_require__) {
|
6438 |
|
6439 | var api = __webpack_require__(20);
|
6440 | var content = __webpack_require__(148);
|
6441 |
|
6442 | content = content.__esModule ? content.default : content;
|
6443 |
|
6444 | if (typeof content === 'string') {
|
6445 | content = [[module.i, content, '']];
|
6446 | }
|
6447 |
|
6448 | var options = {};
|
6449 |
|
6450 | options.insert = "head";
|
6451 | options.singleton = false;
|
6452 |
|
6453 | var update = api(content, options);
|
6454 |
|
6455 |
|
6456 |
|
6457 | module.exports = content.locals || {};
|
6458 |
|
6459 | }),
|
6460 |
|
6461 | (function(module, exports, __webpack_require__) {
|
6462 |
|
6463 |
|
6464 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
6465 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
6466 |
|
6467 | exports.push([module.i, ".w-e-text-container {\n position: relative;\n}\n.w-e-text-container .w-e-progress {\n position: absolute;\n background-color: #1e88e5;\n top: 0;\n left: 0;\n height: 1px;\n}\n.w-e-text-container .placeholder {\n color: #D4D4D4;\n position: absolute;\n font-size: 11pt;\n line-height: 22px;\n left: 10px;\n top: 10px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n z-index: -1;\n}\n.w-e-text {\n padding: 0 10px;\n overflow-y: auto;\n}\n.w-e-text p,\n.w-e-text h1,\n.w-e-text h2,\n.w-e-text h3,\n.w-e-text h4,\n.w-e-text h5,\n.w-e-text table,\n.w-e-text pre {\n margin: 10px 0;\n line-height: 1.5;\n}\n.w-e-text ul,\n.w-e-text ol {\n margin: 10px 0 10px 20px;\n}\n.w-e-text blockquote {\n display: block;\n border-left: 8px solid #d0e5f2;\n padding: 5px 10px;\n margin: 10px 0;\n line-height: 1.4;\n font-size: 100%;\n background-color: #f1f1f1;\n}\n.w-e-text code {\n display: inline-block;\n background-color: #f1f1f1;\n border-radius: 3px;\n padding: 3px 5px;\n margin: 0 3px;\n}\n.w-e-text pre code {\n display: block;\n}\n.w-e-text table {\n border-top: 1px solid #ccc;\n border-left: 1px solid #ccc;\n}\n.w-e-text table td,\n.w-e-text table th {\n border-bottom: 1px solid #ccc;\n border-right: 1px solid #ccc;\n padding: 3px 5px;\n min-height: 30px;\n}\n.w-e-text table th {\n border-bottom: 2px solid #ccc;\n text-align: center;\n background-color: #f1f1f1;\n}\n.w-e-text:focus {\n outline: none;\n}\n.w-e-text img {\n cursor: pointer;\n}\n.w-e-text img:hover {\n box-shadow: 0 0 5px #333;\n}\n.w-e-text .w-e-todo {\n margin: 0 0 0 20px;\n}\n.w-e-text .w-e-todo li {\n list-style: none;\n font-size: 1em;\n}\n.w-e-text .w-e-todo li span:nth-child(1) {\n position: relative;\n left: -18px;\n}\n.w-e-text .w-e-todo li span:nth-child(1) input {\n position: absolute;\n top: 0.3em;\n margin-right: 3px;\n}\n.w-e-tooltip {\n position: absolute;\n display: flex;\n color: #f1f1f1;\n background-color: rgba(0, 0, 0, 0.75);\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n padding: 4px 5px 6px;\n justify-content: center;\n align-items: center;\n}\n.w-e-tooltip-up::after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: 50%;\n margin-left: -5px;\n border: 5px solid rgba(0, 0, 0, 0);\n border-top-color: rgba(0, 0, 0, 0.73);\n}\n.w-e-tooltip-down::after {\n content: \"\";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border: 5px solid rgba(0, 0, 0, 0);\n border-bottom-color: rgba(0, 0, 0, 0.73);\n}\n.w-e-tooltip-item-wrapper {\n cursor: pointer;\n font-size: 14px;\n margin: 0 5px;\n}\n.w-e-tooltip-item-wrapper:hover {\n color: #ccc;\n text-decoration: underline;\n}\n.w-e-menu-tooltip {\n position: absolute;\n display: flex;\n color: #f1f1f1;\n background-color: rgba(0, 0, 0, 0.75);\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n padding: 4px 5px 6px;\n justify-content: center;\n align-items: center;\n}\n.w-e-menu-tooltip-up::after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: 50%;\n margin-left: -5px;\n border: 5px solid rgba(0, 0, 0, 0);\n border-top-color: rgba(0, 0, 0, 0.73);\n}\n.w-e-menu-tooltip-item-wrapper {\n font-size: 14px;\n margin: 0 5px;\n}\n", ""]);
|
6468 |
|
6469 | module.exports = exports;
|
6470 |
|
6471 |
|
6472 | }),
|
6473 |
|
6474 | (function(module, exports, __webpack_require__) {
|
6475 |
|
6476 | var api = __webpack_require__(20);
|
6477 | var content = __webpack_require__(150);
|
6478 |
|
6479 | content = content.__esModule ? content.default : content;
|
6480 |
|
6481 | if (typeof content === 'string') {
|
6482 | content = [[module.i, content, '']];
|
6483 | }
|
6484 |
|
6485 | var options = {};
|
6486 |
|
6487 | options.insert = "head";
|
6488 | options.singleton = false;
|
6489 |
|
6490 | var update = api(content, options);
|
6491 |
|
6492 |
|
6493 |
|
6494 | module.exports = content.locals || {};
|
6495 |
|
6496 | }),
|
6497 |
|
6498 | (function(module, exports, __webpack_require__) {
|
6499 |
|
6500 |
|
6501 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
6502 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
6503 |
|
6504 | exports.push([module.i, ".w-e-menu .w-e-panel-container {\n position: absolute;\n top: 0;\n left: 50%;\n border: 1px solid #ccc;\n border-top: 0;\n box-shadow: 1px 1px 2px #ccc;\n color: #333;\n background-color: #fff;\n text-align: left;\n /* 为 emotion panel 定制的样式 */\n /* 上传图片的 panel 定制样式 */\n}\n.w-e-menu .w-e-panel-container .w-e-panel-close {\n position: absolute;\n right: 0;\n top: 0;\n padding: 5px;\n margin: 2px 5px 0 0;\n cursor: pointer;\n color: #999;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-close:hover {\n color: #333;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-title {\n list-style: none;\n display: flex;\n font-size: 14px;\n margin: 2px 10px 0 10px;\n border-bottom: 1px solid #f1f1f1;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-title .w-e-item {\n padding: 3px 5px;\n color: #999;\n cursor: pointer;\n margin: 0 3px;\n position: relative;\n top: 1px;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-title .w-e-active {\n color: #333;\n border-bottom: 1px solid #333;\n cursor: default;\n font-weight: 700;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content {\n padding: 10px 15px 10px 15px;\n font-size: 16px;\n /* 输入框的样式 */\n /* 按钮的样式 */\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content input:focus,\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content textarea:focus,\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content button:focus {\n outline: none;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content textarea {\n width: 100%;\n border: 1px solid #ccc;\n padding: 5px;\n margin-top: 10px;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content textarea:focus {\n border-color: #1e88e5;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content input[type=text] {\n border: none;\n border-bottom: 1px solid #ccc;\n font-size: 14px;\n height: 20px;\n color: #333;\n text-align: left;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content input[type=text].small {\n width: 30px;\n text-align: center;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content input[type=text].block {\n display: block;\n width: 100%;\n margin: 10px 0;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content input[type=text]:focus {\n border-bottom: 2px solid #1e88e5;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button {\n font-size: 14px;\n color: #1e88e5;\n border: none;\n padding: 5px 10px;\n background-color: #fff;\n cursor: pointer;\n border-radius: 3px;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.left {\n float: left;\n margin-right: 10px;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.right {\n float: right;\n margin-left: 10px;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.gray {\n color: #999;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.red {\n color: #c24f4a;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button:hover {\n background-color: #f1f1f1;\n}\n.w-e-menu .w-e-panel-container .w-e-panel-tab-content .w-e-button-container:after {\n content: \"\";\n display: table;\n clear: both;\n}\n.w-e-menu .w-e-panel-container .w-e-emoticon-container .w-e-item {\n cursor: pointer;\n font-size: 18px;\n padding: 0 3px;\n display: inline-block;\n}\n.w-e-menu .w-e-panel-container .w-e-up-img-container {\n text-align: center;\n}\n.w-e-menu .w-e-panel-container .w-e-up-img-container .w-e-up-btn {\n display: inline-block;\n color: #999;\n cursor: pointer;\n font-size: 60px;\n line-height: 1;\n}\n.w-e-menu .w-e-panel-container .w-e-up-img-container .w-e-up-btn:hover {\n color: #333;\n}\n", ""]);
|
6505 |
|
6506 | module.exports = exports;
|
6507 |
|
6508 |
|
6509 | }),
|
6510 |
|
6511 | (function(module, exports, __webpack_require__) {
|
6512 |
|
6513 | var api = __webpack_require__(20);
|
6514 | var content = __webpack_require__(152);
|
6515 |
|
6516 | content = content.__esModule ? content.default : content;
|
6517 |
|
6518 | if (typeof content === 'string') {
|
6519 | content = [[module.i, content, '']];
|
6520 | }
|
6521 |
|
6522 | var options = {};
|
6523 |
|
6524 | options.insert = "head";
|
6525 | options.singleton = false;
|
6526 |
|
6527 | var update = api(content, options);
|
6528 |
|
6529 |
|
6530 |
|
6531 | module.exports = content.locals || {};
|
6532 |
|
6533 | }),
|
6534 |
|
6535 | (function(module, exports, __webpack_require__) {
|
6536 |
|
6537 |
|
6538 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
6539 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
6540 |
|
6541 | exports.push([module.i, ".w-e-toolbar .w-e-droplist {\n position: absolute;\n left: 0;\n top: 0;\n background-color: #fff;\n border: 1px solid #f1f1f1;\n border-right-color: #ccc;\n border-bottom-color: #ccc;\n}\n.w-e-toolbar .w-e-droplist .w-e-dp-title {\n text-align: center;\n color: #999;\n line-height: 2;\n border-bottom: 1px solid #f1f1f1;\n font-size: 13px;\n}\n.w-e-toolbar .w-e-droplist ul.w-e-list {\n list-style: none;\n line-height: 1;\n}\n.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item {\n color: #333;\n padding: 5px 0;\n}\n.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item:hover {\n background-color: #f1f1f1;\n}\n.w-e-toolbar .w-e-droplist ul.w-e-block {\n list-style: none;\n text-align: left;\n padding: 5px;\n}\n.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item {\n display: inline-block;\n padding: 3px 5px;\n}\n.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item:hover {\n background-color: #f1f1f1;\n}\n", ""]);
|
6542 |
|
6543 | module.exports = exports;
|
6544 |
|
6545 |
|
6546 | }),
|
6547 |
|
6548 | (function(module, exports, __webpack_require__) {
|
6549 |
|
6550 | "use strict";
|
6551 |
|
6552 |
|
6553 |
|
6554 |
|
6555 |
|
6556 |
|
6557 | var _interopRequireDefault = __webpack_require__(0);
|
6558 |
|
6559 | var _promise = _interopRequireDefault(__webpack_require__(154));
|
6560 |
|
6561 | if (!Element.prototype.matches) {
|
6562 | Element.prototype.matches = function (s) {
|
6563 | var matches = this.ownerDocument.querySelectorAll(s);
|
6564 | var i = matches.length;
|
6565 |
|
6566 | for (i; i >= 0; i--) {
|
6567 | if (matches.item(i) === this) break;
|
6568 | }
|
6569 |
|
6570 | return i > -1;
|
6571 | };
|
6572 | }
|
6573 |
|
6574 |
|
6575 | if (!window.Promise) {
|
6576 | window.Promise = _promise["default"];
|
6577 | }
|
6578 |
|
6579 | }),
|
6580 |
|
6581 | (function(module, exports, __webpack_require__) {
|
6582 |
|
6583 | module.exports = __webpack_require__(155);
|
6584 |
|
6585 | }),
|
6586 |
|
6587 | (function(module, exports, __webpack_require__) {
|
6588 |
|
6589 | var parent = __webpack_require__(156);
|
6590 |
|
6591 | module.exports = parent;
|
6592 |
|
6593 |
|
6594 | }),
|
6595 |
|
6596 | (function(module, exports, __webpack_require__) {
|
6597 |
|
6598 | __webpack_require__(157);
|
6599 | __webpack_require__(62);
|
6600 | __webpack_require__(163);
|
6601 | __webpack_require__(170);
|
6602 | __webpack_require__(171);
|
6603 | __webpack_require__(172);
|
6604 | __webpack_require__(65);
|
6605 | __webpack_require__(51);
|
6606 | var path = __webpack_require__(10);
|
6607 |
|
6608 | module.exports = path.Promise;
|
6609 |
|
6610 |
|
6611 | }),
|
6612 |
|
6613 | (function(module, exports, __webpack_require__) {
|
6614 |
|
6615 | "use strict";
|
6616 |
|
6617 | var $ = __webpack_require__(4);
|
6618 | var getPrototypeOf = __webpack_require__(76);
|
6619 | var setPrototypeOf = __webpack_require__(77);
|
6620 | var create = __webpack_require__(48);
|
6621 | var createNonEnumerableProperty = __webpack_require__(17);
|
6622 | var createPropertyDescriptor = __webpack_require__(35);
|
6623 | var iterate = __webpack_require__(39);
|
6624 |
|
6625 | var $AggregateError = function AggregateError(errors, message) {
|
6626 | var that = this;
|
6627 | if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
|
6628 | if (setPrototypeOf) {
|
6629 |
|
6630 | that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));
|
6631 | }
|
6632 | if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
|
6633 | var errorsArray = [];
|
6634 | iterate(errors, errorsArray.push, { that: errorsArray });
|
6635 | createNonEnumerableProperty(that, 'errors', errorsArray);
|
6636 | return that;
|
6637 | };
|
6638 |
|
6639 | $AggregateError.prototype = create(Error.prototype, {
|
6640 | constructor: createPropertyDescriptor(5, $AggregateError),
|
6641 | message: createPropertyDescriptor(5, ''),
|
6642 | name: createPropertyDescriptor(5, 'AggregateError')
|
6643 | });
|
6644 |
|
6645 | // `AggregateError` constructor
|
6646 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
6647 | $({ global: true }, {
|
6648 | AggregateError: $AggregateError
|
6649 | });
|
6650 |
|
6651 |
|
6652 | }),
|
6653 |
|
6654 | (function(module, exports, __webpack_require__) {
|
6655 |
|
6656 | var fails = __webpack_require__(12);
|
6657 |
|
6658 | module.exports = !fails(function () {
|
6659 | function F() { }
|
6660 | F.prototype.constructor = null;
|
6661 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
6662 | });
|
6663 |
|
6664 |
|
6665 | }),
|
6666 |
|
6667 | (function(module, exports, __webpack_require__) {
|
6668 |
|
6669 | var isObject = __webpack_require__(13);
|
6670 |
|
6671 | module.exports = function (it) {
|
6672 | if (!isObject(it) && it !== null) {
|
6673 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
6674 | } return it;
|
6675 | };
|
6676 |
|
6677 |
|
6678 | }),
|
6679 |
|
6680 | (function(module, exports, __webpack_require__) {
|
6681 |
|
6682 | var wellKnownSymbol = __webpack_require__(9);
|
6683 | var Iterators = __webpack_require__(40);
|
6684 |
|
6685 | var ITERATOR = wellKnownSymbol('iterator');
|
6686 | var ArrayPrototype = Array.prototype;
|
6687 |
|
6688 |
|
6689 | module.exports = function (it) {
|
6690 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
6691 | };
|
6692 |
|
6693 |
|
6694 | }),
|
6695 |
|
6696 | (function(module, exports, __webpack_require__) {
|
6697 |
|
6698 | var classof = __webpack_require__(61);
|
6699 | var Iterators = __webpack_require__(40);
|
6700 | var wellKnownSymbol = __webpack_require__(9);
|
6701 |
|
6702 | var ITERATOR = wellKnownSymbol('iterator');
|
6703 |
|
6704 | module.exports = function (it) {
|
6705 | if (it != undefined) return it[ITERATOR]
|
6706 | || it['@@iterator']
|
6707 | || Iterators[classof(it)];
|
6708 | };
|
6709 |
|
6710 |
|
6711 | }),
|
6712 |
|
6713 | (function(module, exports, __webpack_require__) {
|
6714 |
|
6715 | var anObject = __webpack_require__(24);
|
6716 |
|
6717 | module.exports = function (iterator) {
|
6718 | var returnMethod = iterator['return'];
|
6719 | if (returnMethod !== undefined) {
|
6720 | return anObject(returnMethod.call(iterator)).value;
|
6721 | }
|
6722 | };
|
6723 |
|
6724 |
|
6725 | }),
|
6726 |
|
6727 | (function(module, exports, __webpack_require__) {
|
6728 |
|
6729 | "use strict";
|
6730 |
|
6731 | var $ = __webpack_require__(4);
|
6732 | var IS_PURE = __webpack_require__(37);
|
6733 | var global = __webpack_require__(8);
|
6734 | var getBuiltIn = __webpack_require__(28);
|
6735 | var NativePromise = __webpack_require__(105);
|
6736 | var redefine = __webpack_require__(50);
|
6737 | var redefineAll = __webpack_require__(106);
|
6738 | var setToStringTag = __webpack_require__(41);
|
6739 | var setSpecies = __webpack_require__(107);
|
6740 | var isObject = __webpack_require__(13);
|
6741 | var aFunction = __webpack_require__(32);
|
6742 | var anInstance = __webpack_require__(80);
|
6743 | var inspectSource = __webpack_require__(108);
|
6744 | var iterate = __webpack_require__(39);
|
6745 | var checkCorrectnessOfIteration = __webpack_require__(165);
|
6746 | var speciesConstructor = __webpack_require__(109);
|
6747 | var task = __webpack_require__(110).set;
|
6748 | var microtask = __webpack_require__(166);
|
6749 | var promiseResolve = __webpack_require__(112);
|
6750 | var hostReportErrors = __webpack_require__(168);
|
6751 | var newPromiseCapabilityModule = __webpack_require__(64);
|
6752 | var perform = __webpack_require__(82);
|
6753 | var InternalStateModule = __webpack_require__(42);
|
6754 | var isForced = __webpack_require__(101);
|
6755 | var wellKnownSymbol = __webpack_require__(9);
|
6756 | var IS_NODE = __webpack_require__(81);
|
6757 | var V8_VERSION = __webpack_require__(83);
|
6758 |
|
6759 | var SPECIES = wellKnownSymbol('species');
|
6760 | var PROMISE = 'Promise';
|
6761 | var getInternalState = InternalStateModule.get;
|
6762 | var setInternalState = InternalStateModule.set;
|
6763 | var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
6764 | var PromiseConstructor = NativePromise;
|
6765 | var TypeError = global.TypeError;
|
6766 | var document = global.document;
|
6767 | var process = global.process;
|
6768 | var $fetch = getBuiltIn('fetch');
|
6769 | var newPromiseCapability = newPromiseCapabilityModule.f;
|
6770 | var newGenericPromiseCapability = newPromiseCapability;
|
6771 | var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
|
6772 | var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
|
6773 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
6774 | var REJECTION_HANDLED = 'rejectionhandled';
|
6775 | var PENDING = 0;
|
6776 | var FULFILLED = 1;
|
6777 | var REJECTED = 2;
|
6778 | var HANDLED = 1;
|
6779 | var UNHANDLED = 2;
|
6780 | var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
6781 |
|
6782 | var FORCED = isForced(PROMISE, function () {
|
6783 | var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
|
6784 | if (!GLOBAL_CORE_JS_PROMISE) {
|
6785 |
|
6786 |
|
6787 |
|
6788 | if (V8_VERSION === 66) return true;
|
6789 |
|
6790 | if (!IS_NODE && !NATIVE_REJECTION_EVENT) return true;
|
6791 | }
|
6792 |
|
6793 | if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
|
6794 |
|
6795 |
|
6796 |
|
6797 | if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
|
6798 |
|
6799 | var promise = PromiseConstructor.resolve(1);
|
6800 | var FakePromise = function (exec) {
|
6801 | exec(function () { }, function () { });
|
6802 | };
|
6803 | var constructor = promise.constructor = {};
|
6804 | constructor[SPECIES] = FakePromise;
|
6805 | return !(promise.then(function () { }) instanceof FakePromise);
|
6806 | });
|
6807 |
|
6808 | var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
6809 | PromiseConstructor.all(iterable)['catch'](function () { });
|
6810 | });
|
6811 |
|
6812 |
|
6813 | var isThenable = function (it) {
|
6814 | var then;
|
6815 | return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
6816 | };
|
6817 |
|
6818 | var notify = function (state, isReject) {
|
6819 | if (state.notified) return;
|
6820 | state.notified = true;
|
6821 | var chain = state.reactions;
|
6822 | microtask(function () {
|
6823 | var value = state.value;
|
6824 | var ok = state.state == FULFILLED;
|
6825 | var index = 0;
|
6826 |
|
6827 | while (chain.length > index) {
|
6828 | var reaction = chain[index++];
|
6829 | var handler = ok ? reaction.ok : reaction.fail;
|
6830 | var resolve = reaction.resolve;
|
6831 | var reject = reaction.reject;
|
6832 | var domain = reaction.domain;
|
6833 | var result, then, exited;
|
6834 | try {
|
6835 | if (handler) {
|
6836 | if (!ok) {
|
6837 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
6838 | state.rejection = HANDLED;
|
6839 | }
|
6840 | if (handler === true) result = value;
|
6841 | else {
|
6842 | if (domain) domain.enter();
|
6843 | result = handler(value);
|
6844 | if (domain) {
|
6845 | domain.exit();
|
6846 | exited = true;
|
6847 | }
|
6848 | }
|
6849 | if (result === reaction.promise) {
|
6850 | reject(TypeError('Promise-chain cycle'));
|
6851 | } else if (then = isThenable(result)) {
|
6852 | then.call(result, resolve, reject);
|
6853 | } else resolve(result);
|
6854 | } else reject(value);
|
6855 | } catch (error) {
|
6856 | if (domain && !exited) domain.exit();
|
6857 | reject(error);
|
6858 | }
|
6859 | }
|
6860 | state.reactions = [];
|
6861 | state.notified = false;
|
6862 | if (isReject && !state.rejection) onUnhandled(state);
|
6863 | });
|
6864 | };
|
6865 |
|
6866 | var dispatchEvent = function (name, promise, reason) {
|
6867 | var event, handler;
|
6868 | if (DISPATCH_EVENT) {
|
6869 | event = document.createEvent('Event');
|
6870 | event.promise = promise;
|
6871 | event.reason = reason;
|
6872 | event.initEvent(name, false, true);
|
6873 | global.dispatchEvent(event);
|
6874 | } else event = { promise: promise, reason: reason };
|
6875 | if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
|
6876 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
6877 | };
|
6878 |
|
6879 | var onUnhandled = function (state) {
|
6880 | task.call(global, function () {
|
6881 | var promise = state.facade;
|
6882 | var value = state.value;
|
6883 | var IS_UNHANDLED = isUnhandled(state);
|
6884 | var result;
|
6885 | if (IS_UNHANDLED) {
|
6886 | result = perform(function () {
|
6887 | if (IS_NODE) {
|
6888 | process.emit('unhandledRejection', value, promise);
|
6889 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
6890 | });
|
6891 |
|
6892 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
6893 | if (result.error) throw result.value;
|
6894 | }
|
6895 | });
|
6896 | };
|
6897 |
|
6898 | var isUnhandled = function (state) {
|
6899 | return state.rejection !== HANDLED && !state.parent;
|
6900 | };
|
6901 |
|
6902 | var onHandleUnhandled = function (state) {
|
6903 | task.call(global, function () {
|
6904 | var promise = state.facade;
|
6905 | if (IS_NODE) {
|
6906 | process.emit('rejectionHandled', promise);
|
6907 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
6908 | });
|
6909 | };
|
6910 |
|
6911 | var bind = function (fn, state, unwrap) {
|
6912 | return function (value) {
|
6913 | fn(state, value, unwrap);
|
6914 | };
|
6915 | };
|
6916 |
|
6917 | var internalReject = function (state, value, unwrap) {
|
6918 | if (state.done) return;
|
6919 | state.done = true;
|
6920 | if (unwrap) state = unwrap;
|
6921 | state.value = value;
|
6922 | state.state = REJECTED;
|
6923 | notify(state, true);
|
6924 | };
|
6925 |
|
6926 | var internalResolve = function (state, value, unwrap) {
|
6927 | if (state.done) return;
|
6928 | state.done = true;
|
6929 | if (unwrap) state = unwrap;
|
6930 | try {
|
6931 | if (state.facade === value) throw TypeError("Promise can't be resolved itself");
|
6932 | var then = isThenable(value);
|
6933 | if (then) {
|
6934 | microtask(function () {
|
6935 | var wrapper = { done: false };
|
6936 | try {
|
6937 | then.call(value,
|
6938 | bind(internalResolve, wrapper, state),
|
6939 | bind(internalReject, wrapper, state)
|
6940 | );
|
6941 | } catch (error) {
|
6942 | internalReject(wrapper, error, state);
|
6943 | }
|
6944 | });
|
6945 | } else {
|
6946 | state.value = value;
|
6947 | state.state = FULFILLED;
|
6948 | notify(state, false);
|
6949 | }
|
6950 | } catch (error) {
|
6951 | internalReject({ done: false }, error, state);
|
6952 | }
|
6953 | };
|
6954 |
|
6955 |
|
6956 | if (FORCED) {
|
6957 |
|
6958 | PromiseConstructor = function Promise(executor) {
|
6959 | anInstance(this, PromiseConstructor, PROMISE);
|
6960 | aFunction(executor);
|
6961 | Internal.call(this);
|
6962 | var state = getInternalState(this);
|
6963 | try {
|
6964 | executor(bind(internalResolve, state), bind(internalReject, state));
|
6965 | } catch (error) {
|
6966 | internalReject(state, error);
|
6967 | }
|
6968 | };
|
6969 |
|
6970 | Internal = function Promise(executor) {
|
6971 | setInternalState(this, {
|
6972 | type: PROMISE,
|
6973 | done: false,
|
6974 | notified: false,
|
6975 | parent: false,
|
6976 | reactions: [],
|
6977 | rejection: false,
|
6978 | state: PENDING,
|
6979 | value: undefined
|
6980 | });
|
6981 | };
|
6982 | Internal.prototype = redefineAll(PromiseConstructor.prototype, {
|
6983 |
|
6984 |
|
6985 | then: function then(onFulfilled, onRejected) {
|
6986 | var state = getInternalPromiseState(this);
|
6987 | var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
6988 | reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
6989 | reaction.fail = typeof onRejected == 'function' && onRejected;
|
6990 | reaction.domain = IS_NODE ? process.domain : undefined;
|
6991 | state.parent = true;
|
6992 | state.reactions.push(reaction);
|
6993 | if (state.state != PENDING) notify(state, false);
|
6994 | return reaction.promise;
|
6995 | },
|
6996 |
|
6997 |
|
6998 | 'catch': function (onRejected) {
|
6999 | return this.then(undefined, onRejected);
|
7000 | }
|
7001 | });
|
7002 | OwnPromiseCapability = function () {
|
7003 | var promise = new Internal();
|
7004 | var state = getInternalState(promise);
|
7005 | this.promise = promise;
|
7006 | this.resolve = bind(internalResolve, state);
|
7007 | this.reject = bind(internalReject, state);
|
7008 | };
|
7009 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
7010 | return C === PromiseConstructor || C === PromiseWrapper
|
7011 | ? new OwnPromiseCapability(C)
|
7012 | : newGenericPromiseCapability(C);
|
7013 | };
|
7014 |
|
7015 | if (!IS_PURE && typeof NativePromise == 'function') {
|
7016 | nativeThen = NativePromise.prototype.then;
|
7017 |
|
7018 |
|
7019 | redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
|
7020 | var that = this;
|
7021 | return new PromiseConstructor(function (resolve, reject) {
|
7022 | nativeThen.call(that, resolve, reject);
|
7023 | }).then(onFulfilled, onRejected);
|
7024 |
|
7025 | }, { unsafe: true });
|
7026 |
|
7027 |
|
7028 | if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
|
7029 |
|
7030 | fetch: function fetch(input /* , init */) {
|
7031 | return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
|
7032 | }
|
7033 | });
|
7034 | }
|
7035 | }
|
7036 |
|
7037 | $({ global: true, wrap: true, forced: FORCED }, {
|
7038 | Promise: PromiseConstructor
|
7039 | });
|
7040 |
|
7041 | setToStringTag(PromiseConstructor, PROMISE, false, true);
|
7042 | setSpecies(PROMISE);
|
7043 |
|
7044 | PromiseWrapper = getBuiltIn(PROMISE);
|
7045 |
|
7046 |
|
7047 | $({ target: PROMISE, stat: true, forced: FORCED }, {
|
7048 |
|
7049 |
|
7050 | reject: function reject(r) {
|
7051 | var capability = newPromiseCapability(this);
|
7052 | capability.reject.call(undefined, r);
|
7053 | return capability.promise;
|
7054 | }
|
7055 | });
|
7056 |
|
7057 | $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
|
7058 |
|
7059 |
|
7060 | resolve: function resolve(x) {
|
7061 | return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
|
7062 | }
|
7063 | });
|
7064 |
|
7065 | $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
7066 |
|
7067 |
|
7068 | all: function all(iterable) {
|
7069 | var C = this;
|
7070 | var capability = newPromiseCapability(C);
|
7071 | var resolve = capability.resolve;
|
7072 | var reject = capability.reject;
|
7073 | var result = perform(function () {
|
7074 | var $promiseResolve = aFunction(C.resolve);
|
7075 | var values = [];
|
7076 | var counter = 0;
|
7077 | var remaining = 1;
|
7078 | iterate(iterable, function (promise) {
|
7079 | var index = counter++;
|
7080 | var alreadyCalled = false;
|
7081 | values.push(undefined);
|
7082 | remaining++;
|
7083 | $promiseResolve.call(C, promise).then(function (value) {
|
7084 | if (alreadyCalled) return;
|
7085 | alreadyCalled = true;
|
7086 | values[index] = value;
|
7087 | --remaining || resolve(values);
|
7088 | }, reject);
|
7089 | });
|
7090 | --remaining || resolve(values);
|
7091 | });
|
7092 | if (result.error) reject(result.value);
|
7093 | return capability.promise;
|
7094 | },
|
7095 |
|
7096 |
|
7097 | race: function race(iterable) {
|
7098 | var C = this;
|
7099 | var capability = newPromiseCapability(C);
|
7100 | var reject = capability.reject;
|
7101 | var result = perform(function () {
|
7102 | var $promiseResolve = aFunction(C.resolve);
|
7103 | iterate(iterable, function (promise) {
|
7104 | $promiseResolve.call(C, promise).then(capability.resolve, reject);
|
7105 | });
|
7106 | });
|
7107 | if (result.error) reject(result.value);
|
7108 | return capability.promise;
|
7109 | }
|
7110 | });
|
7111 |
|
7112 |
|
7113 | }),
|
7114 |
|
7115 | (function(module, exports, __webpack_require__) {
|
7116 |
|
7117 | "use strict";
|
7118 |
|
7119 | var TO_STRING_TAG_SUPPORT = __webpack_require__(79);
|
7120 | var classof = __webpack_require__(61);
|
7121 |
|
7122 |
|
7123 |
|
7124 | module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
7125 | return '[object ' + classof(this) + ']';
|
7126 | };
|
7127 |
|
7128 |
|
7129 | }),
|
7130 |
|
7131 | (function(module, exports, __webpack_require__) {
|
7132 |
|
7133 | var wellKnownSymbol = __webpack_require__(9);
|
7134 |
|
7135 | var ITERATOR = wellKnownSymbol('iterator');
|
7136 | var SAFE_CLOSING = false;
|
7137 |
|
7138 | try {
|
7139 | var called = 0;
|
7140 | var iteratorWithReturn = {
|
7141 | next: function () {
|
7142 | return { done: !!called++ };
|
7143 | },
|
7144 | 'return': function () {
|
7145 | SAFE_CLOSING = true;
|
7146 | }
|
7147 | };
|
7148 | iteratorWithReturn[ITERATOR] = function () {
|
7149 | return this;
|
7150 | };
|
7151 |
|
7152 | Array.from(iteratorWithReturn, function () { throw 2; });
|
7153 | } catch (error) { }
|
7154 |
|
7155 | module.exports = function (exec, SKIP_CLOSING) {
|
7156 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
7157 | var ITERATION_SUPPORT = false;
|
7158 | try {
|
7159 | var object = {};
|
7160 | object[ITERATOR] = function () {
|
7161 | return {
|
7162 | next: function () {
|
7163 | return { done: ITERATION_SUPPORT = true };
|
7164 | }
|
7165 | };
|
7166 | };
|
7167 | exec(object);
|
7168 | } catch (error) { }
|
7169 | return ITERATION_SUPPORT;
|
7170 | };
|
7171 |
|
7172 |
|
7173 | }),
|
7174 |
|
7175 | (function(module, exports, __webpack_require__) {
|
7176 |
|
7177 | var global = __webpack_require__(8);
|
7178 | var getOwnPropertyDescriptor = __webpack_require__(68).f;
|
7179 | var macrotask = __webpack_require__(110).set;
|
7180 | var IS_IOS = __webpack_require__(111);
|
7181 | var IS_WEBOS_WEBKIT = __webpack_require__(167);
|
7182 | var IS_NODE = __webpack_require__(81);
|
7183 |
|
7184 | var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
7185 | var document = global.document;
|
7186 | var process = global.process;
|
7187 | var Promise = global.Promise;
|
7188 |
|
7189 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
7190 | var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
7191 |
|
7192 | var flush, head, last, notify, toggle, node, promise, then;
|
7193 |
|
7194 |
|
7195 | if (!queueMicrotask) {
|
7196 | flush = function () {
|
7197 | var parent, fn;
|
7198 | if (IS_NODE && (parent = process.domain)) parent.exit();
|
7199 | while (head) {
|
7200 | fn = head.fn;
|
7201 | head = head.next;
|
7202 | try {
|
7203 | fn();
|
7204 | } catch (error) {
|
7205 | if (head) notify();
|
7206 | else last = undefined;
|
7207 | throw error;
|
7208 | }
|
7209 | } last = undefined;
|
7210 | if (parent) parent.enter();
|
7211 | };
|
7212 |
|
7213 |
|
7214 |
|
7215 | if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
7216 | toggle = true;
|
7217 | node = document.createTextNode('');
|
7218 | new MutationObserver(flush).observe(node, { characterData: true });
|
7219 | notify = function () {
|
7220 | node.data = toggle = !toggle;
|
7221 | };
|
7222 |
|
7223 | } else if (Promise && Promise.resolve) {
|
7224 |
|
7225 | promise = Promise.resolve(undefined);
|
7226 | then = promise.then;
|
7227 | notify = function () {
|
7228 | then.call(promise, flush);
|
7229 | };
|
7230 |
|
7231 | } else if (IS_NODE) {
|
7232 | notify = function () {
|
7233 | process.nextTick(flush);
|
7234 | };
|
7235 |
|
7236 |
|
7237 |
|
7238 |
|
7239 |
|
7240 |
|
7241 | } else {
|
7242 | notify = function () {
|
7243 |
|
7244 | macrotask.call(global, flush);
|
7245 | };
|
7246 | }
|
7247 | }
|
7248 |
|
7249 | module.exports = queueMicrotask || function (fn) {
|
7250 | var task = { fn: fn, next: undefined };
|
7251 | if (last) last.next = task;
|
7252 | if (!head) {
|
7253 | head = task;
|
7254 | notify();
|
7255 | } last = task;
|
7256 | };
|
7257 |
|
7258 |
|
7259 | }),
|
7260 |
|
7261 | (function(module, exports, __webpack_require__) {
|
7262 |
|
7263 | var userAgent = __webpack_require__(63);
|
7264 |
|
7265 | module.exports = /web0s(?!.*chrome)/i.test(userAgent);
|
7266 |
|
7267 |
|
7268 | }),
|
7269 |
|
7270 | (function(module, exports, __webpack_require__) {
|
7271 |
|
7272 | var global = __webpack_require__(8);
|
7273 |
|
7274 | module.exports = function (a, b) {
|
7275 | var console = global.console;
|
7276 | if (console && console.error) {
|
7277 | arguments.length === 1 ? console.error(a) : console.error(a, b);
|
7278 | }
|
7279 | };
|
7280 |
|
7281 |
|
7282 | }),
|
7283 |
|
7284 | (function(module, exports, __webpack_require__) {
|
7285 |
|
7286 | var global = __webpack_require__(8);
|
7287 | var inspectSource = __webpack_require__(108);
|
7288 |
|
7289 | var WeakMap = global.WeakMap;
|
7290 |
|
7291 | module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
7292 |
|
7293 |
|
7294 | }),
|
7295 |
|
7296 | (function(module, exports, __webpack_require__) {
|
7297 |
|
7298 | "use strict";
|
7299 |
|
7300 | var $ = __webpack_require__(4);
|
7301 | var aFunction = __webpack_require__(32);
|
7302 | var newPromiseCapabilityModule = __webpack_require__(64);
|
7303 | var perform = __webpack_require__(82);
|
7304 | var iterate = __webpack_require__(39);
|
7305 |
|
7306 |
|
7307 |
|
7308 | $({ target: 'Promise', stat: true }, {
|
7309 | allSettled: function allSettled(iterable) {
|
7310 | var C = this;
|
7311 | var capability = newPromiseCapabilityModule.f(C);
|
7312 | var resolve = capability.resolve;
|
7313 | var reject = capability.reject;
|
7314 | var result = perform(function () {
|
7315 | var promiseResolve = aFunction(C.resolve);
|
7316 | var values = [];
|
7317 | var counter = 0;
|
7318 | var remaining = 1;
|
7319 | iterate(iterable, function (promise) {
|
7320 | var index = counter++;
|
7321 | var alreadyCalled = false;
|
7322 | values.push(undefined);
|
7323 | remaining++;
|
7324 | promiseResolve.call(C, promise).then(function (value) {
|
7325 | if (alreadyCalled) return;
|
7326 | alreadyCalled = true;
|
7327 | values[index] = { status: 'fulfilled', value: value };
|
7328 | --remaining || resolve(values);
|
7329 | }, function (error) {
|
7330 | if (alreadyCalled) return;
|
7331 | alreadyCalled = true;
|
7332 | values[index] = { status: 'rejected', reason: error };
|
7333 | --remaining || resolve(values);
|
7334 | });
|
7335 | });
|
7336 | --remaining || resolve(values);
|
7337 | });
|
7338 | if (result.error) reject(result.value);
|
7339 | return capability.promise;
|
7340 | }
|
7341 | });
|
7342 |
|
7343 |
|
7344 | }),
|
7345 |
|
7346 | (function(module, exports, __webpack_require__) {
|
7347 |
|
7348 | "use strict";
|
7349 |
|
7350 | var $ = __webpack_require__(4);
|
7351 | var aFunction = __webpack_require__(32);
|
7352 | var getBuiltIn = __webpack_require__(28);
|
7353 | var newPromiseCapabilityModule = __webpack_require__(64);
|
7354 | var perform = __webpack_require__(82);
|
7355 | var iterate = __webpack_require__(39);
|
7356 |
|
7357 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
7358 |
|
7359 |
|
7360 |
|
7361 | $({ target: 'Promise', stat: true }, {
|
7362 | any: function any(iterable) {
|
7363 | var C = this;
|
7364 | var capability = newPromiseCapabilityModule.f(C);
|
7365 | var resolve = capability.resolve;
|
7366 | var reject = capability.reject;
|
7367 | var result = perform(function () {
|
7368 | var promiseResolve = aFunction(C.resolve);
|
7369 | var errors = [];
|
7370 | var counter = 0;
|
7371 | var remaining = 1;
|
7372 | var alreadyResolved = false;
|
7373 | iterate(iterable, function (promise) {
|
7374 | var index = counter++;
|
7375 | var alreadyRejected = false;
|
7376 | errors.push(undefined);
|
7377 | remaining++;
|
7378 | promiseResolve.call(C, promise).then(function (value) {
|
7379 | if (alreadyRejected || alreadyResolved) return;
|
7380 | alreadyResolved = true;
|
7381 | resolve(value);
|
7382 | }, function (error) {
|
7383 | if (alreadyRejected || alreadyResolved) return;
|
7384 | alreadyRejected = true;
|
7385 | errors[index] = error;
|
7386 | --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));
|
7387 | });
|
7388 | });
|
7389 | --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));
|
7390 | });
|
7391 | if (result.error) reject(result.value);
|
7392 | return capability.promise;
|
7393 | }
|
7394 | });
|
7395 |
|
7396 |
|
7397 | }),
|
7398 |
|
7399 | (function(module, exports, __webpack_require__) {
|
7400 |
|
7401 | "use strict";
|
7402 |
|
7403 | var $ = __webpack_require__(4);
|
7404 | var IS_PURE = __webpack_require__(37);
|
7405 | var NativePromise = __webpack_require__(105);
|
7406 | var fails = __webpack_require__(12);
|
7407 | var getBuiltIn = __webpack_require__(28);
|
7408 | var speciesConstructor = __webpack_require__(109);
|
7409 | var promiseResolve = __webpack_require__(112);
|
7410 | var redefine = __webpack_require__(50);
|
7411 |
|
7412 |
|
7413 | var NON_GENERIC = !!NativePromise && fails(function () {
|
7414 | NativePromise.prototype['finally'].call({ then: function () { } }, function () { });
|
7415 | });
|
7416 |
|
7417 |
|
7418 |
|
7419 | $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
7420 | 'finally': function (onFinally) {
|
7421 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
7422 | var isFunction = typeof onFinally == 'function';
|
7423 | return this.then(
|
7424 | isFunction ? function (x) {
|
7425 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
7426 | } : onFinally,
|
7427 | isFunction ? function (e) {
|
7428 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
7429 | } : onFinally
|
7430 | );
|
7431 | }
|
7432 | });
|
7433 |
|
7434 |
|
7435 | if (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {
|
7436 | redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);
|
7437 | }
|
7438 |
|
7439 |
|
7440 | }),
|
7441 |
|
7442 | (function(module, exports, __webpack_require__) {
|
7443 |
|
7444 | var toInteger = __webpack_require__(58);
|
7445 | var requireObjectCoercible = __webpack_require__(46);
|
7446 |
|
7447 |
|
7448 | var createMethod = function (CONVERT_TO_STRING) {
|
7449 | return function ($this, pos) {
|
7450 | var S = String(requireObjectCoercible($this));
|
7451 | var position = toInteger(pos);
|
7452 | var size = S.length;
|
7453 | var first, second;
|
7454 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
7455 | first = S.charCodeAt(position);
|
7456 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
7457 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
7458 | ? CONVERT_TO_STRING ? S.charAt(position) : first
|
7459 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
7460 | };
|
7461 | };
|
7462 |
|
7463 | module.exports = {
|
7464 |
|
7465 |
|
7466 | codeAt: createMethod(false),
|
7467 |
|
7468 |
|
7469 | charAt: createMethod(true)
|
7470 | };
|
7471 |
|
7472 |
|
7473 | }),
|
7474 |
|
7475 | (function(module, exports, __webpack_require__) {
|
7476 |
|
7477 | "use strict";
|
7478 |
|
7479 | var IteratorPrototype = __webpack_require__(113).IteratorPrototype;
|
7480 | var create = __webpack_require__(48);
|
7481 | var createPropertyDescriptor = __webpack_require__(35);
|
7482 | var setToStringTag = __webpack_require__(41);
|
7483 | var Iterators = __webpack_require__(40);
|
7484 |
|
7485 | var returnThis = function () { return this; };
|
7486 |
|
7487 | module.exports = function (IteratorConstructor, NAME, next) {
|
7488 | var TO_STRING_TAG = NAME + ' Iterator';
|
7489 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
|
7490 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
7491 | Iterators[TO_STRING_TAG] = returnThis;
|
7492 | return IteratorConstructor;
|
7493 | };
|
7494 |
|
7495 |
|
7496 | }),
|
7497 |
|
7498 | (function(module, exports, __webpack_require__) {
|
7499 |
|
7500 | "use strict";
|
7501 |
|
7502 | var toIndexedObject = __webpack_require__(27);
|
7503 | var addToUnscopables = __webpack_require__(85);
|
7504 | var Iterators = __webpack_require__(40);
|
7505 | var InternalStateModule = __webpack_require__(42);
|
7506 | var defineIterator = __webpack_require__(84);
|
7507 |
|
7508 | var ARRAY_ITERATOR = 'Array Iterator';
|
7509 | var setInternalState = InternalStateModule.set;
|
7510 | var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
7511 |
|
7512 |
|
7513 |
|
7514 |
|
7515 |
|
7516 |
|
7517 |
|
7518 |
|
7519 |
|
7520 |
|
7521 |
|
7522 | module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
|
7523 | setInternalState(this, {
|
7524 | type: ARRAY_ITERATOR,
|
7525 | target: toIndexedObject(iterated),
|
7526 | index: 0,
|
7527 | kind: kind
|
7528 | });
|
7529 |
|
7530 |
|
7531 | }, function () {
|
7532 | var state = getInternalState(this);
|
7533 | var target = state.target;
|
7534 | var kind = state.kind;
|
7535 | var index = state.index++;
|
7536 | if (!target || index >= target.length) {
|
7537 | state.target = undefined;
|
7538 | return { value: undefined, done: true };
|
7539 | }
|
7540 | if (kind == 'keys') return { value: index, done: false };
|
7541 | if (kind == 'values') return { value: target[index], done: false };
|
7542 | return { value: [index, target[index]], done: false };
|
7543 | }, 'values');
|
7544 |
|
7545 |
|
7546 |
|
7547 |
|
7548 | Iterators.Arguments = Iterators.Array;
|
7549 |
|
7550 |
|
7551 | addToUnscopables('keys');
|
7552 | addToUnscopables('values');
|
7553 | addToUnscopables('entries');
|
7554 |
|
7555 |
|
7556 | }),
|
7557 |
|
7558 | (function(module, exports) {
|
7559 |
|
7560 |
|
7561 |
|
7562 | module.exports = {
|
7563 | CSSRuleList: 0,
|
7564 | CSSStyleDeclaration: 0,
|
7565 | CSSValueList: 0,
|
7566 | ClientRectList: 0,
|
7567 | DOMRectList: 0,
|
7568 | DOMStringList: 0,
|
7569 | DOMTokenList: 1,
|
7570 | DataTransferItemList: 0,
|
7571 | FileList: 0,
|
7572 | HTMLAllCollection: 0,
|
7573 | HTMLCollection: 0,
|
7574 | HTMLFormElement: 0,
|
7575 | HTMLSelectElement: 0,
|
7576 | MediaList: 0,
|
7577 | MimeTypeArray: 0,
|
7578 | NamedNodeMap: 0,
|
7579 | NodeList: 1,
|
7580 | PaintRequestList: 0,
|
7581 | Plugin: 0,
|
7582 | PluginArray: 0,
|
7583 | SVGLengthList: 0,
|
7584 | SVGNumberList: 0,
|
7585 | SVGPathSegList: 0,
|
7586 | SVGPointList: 0,
|
7587 | SVGStringList: 0,
|
7588 | SVGTransformList: 0,
|
7589 | SourceBufferList: 0,
|
7590 | StyleSheetList: 0,
|
7591 | TextTrackCueList: 0,
|
7592 | TextTrackList: 0,
|
7593 | TouchList: 0
|
7594 | };
|
7595 |
|
7596 |
|
7597 | }),
|
7598 |
|
7599 | (function(module, exports, __webpack_require__) {
|
7600 |
|
7601 | "use strict";
|
7602 |
|
7603 |
|
7604 |
|
7605 |
|
7606 |
|
7607 |
|
7608 | var _interopRequireDefault = __webpack_require__(0);
|
7609 |
|
7610 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
7611 |
|
7612 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
7613 |
|
7614 | var _create = _interopRequireDefault(__webpack_require__(3));
|
7615 |
|
7616 | var __createBinding = void 0 && (void 0).__createBinding || (_create["default"] ? function (o, m, k, k2) {
|
7617 | if (k2 === undefined) k2 = k;
|
7618 | (0, _defineProperty["default"])(o, k2, {
|
7619 | enumerable: true,
|
7620 | get: function get() {
|
7621 | return m[k];
|
7622 | }
|
7623 | });
|
7624 | } : function (o, m, k, k2) {
|
7625 | if (k2 === undefined) k2 = k;
|
7626 | o[k2] = m[k];
|
7627 | });
|
7628 |
|
7629 | var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (_create["default"] ? function (o, v) {
|
7630 | (0, _defineProperty["default"])(o, "default", {
|
7631 | enumerable: true,
|
7632 | value: v
|
7633 | });
|
7634 | } : function (o, v) {
|
7635 | o["default"] = v;
|
7636 | });
|
7637 |
|
7638 | var __importStar = void 0 && (void 0).__importStar || function (mod) {
|
7639 | if (mod && mod.__esModule) return mod;
|
7640 | var result = {};
|
7641 | if (mod != null) for (var k in mod) {
|
7642 | if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
7643 | }
|
7644 |
|
7645 | __setModuleDefault(result, mod);
|
7646 |
|
7647 | return result;
|
7648 | };
|
7649 |
|
7650 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
7651 | return mod && mod.__esModule ? mod : {
|
7652 | "default": mod
|
7653 | };
|
7654 | };
|
7655 |
|
7656 | (0, _defineProperty["default"])(exports, "__esModule", {
|
7657 | value: true
|
7658 | });
|
7659 |
|
7660 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
7661 |
|
7662 | var util_1 = __webpack_require__(7);
|
7663 |
|
7664 | var config_1 = __importDefault(__webpack_require__(266));
|
7665 |
|
7666 | var selection_1 = __importDefault(__webpack_require__(281));
|
7667 |
|
7668 | var command_1 = __importDefault(__webpack_require__(283));
|
7669 |
|
7670 | var index_1 = __importDefault(__webpack_require__(284));
|
7671 |
|
7672 | var index_2 = __importDefault(__webpack_require__(303));
|
7673 |
|
7674 | var init_dom_1 = __importDefault(__webpack_require__(387));
|
7675 |
|
7676 | var init_selection_1 = __importDefault(__webpack_require__(388));
|
7677 |
|
7678 | var bind_event_1 = __importDefault(__webpack_require__(389));
|
7679 |
|
7680 | var i18next_init_1 = __importDefault(__webpack_require__(390));
|
7681 |
|
7682 | var set_full_screen_1 = __importStar(__webpack_require__(391));
|
7683 |
|
7684 | var scroll_to_head_1 = __importDefault(__webpack_require__(394));
|
7685 |
|
7686 | var z_index_1 = __importDefault(__webpack_require__(395));
|
7687 |
|
7688 | var index_3 = __importDefault(__webpack_require__(396));
|
7689 |
|
7690 | var index_4 = __importDefault(__webpack_require__(398));
|
7691 |
|
7692 | var disable_1 = __importDefault(__webpack_require__(413));
|
7693 |
|
7694 |
|
7695 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
7696 |
|
7697 | var DropList_1 = __importDefault(__webpack_require__(125));
|
7698 |
|
7699 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
7700 |
|
7701 | var Panel_1 = __importDefault(__webpack_require__(31));
|
7702 |
|
7703 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
7704 |
|
7705 | var Tooltip_1 = __importDefault(__webpack_require__(44));
|
7706 |
|
7707 | var EDITOR_ID = 1;
|
7708 |
|
7709 | var Editor =
|
7710 |
|
7711 | function () {
|
7712 | |
7713 |
|
7714 |
|
7715 |
|
7716 |
|
7717 | function Editor(toolbarSelector, textSelector) {
|
7718 |
|
7719 | this.beforeDestroyHooks = [];
|
7720 |
|
7721 | this.id = "wangEditor-" + EDITOR_ID++;
|
7722 | this.toolbarSelector = toolbarSelector;
|
7723 | this.textSelector = textSelector;
|
7724 |
|
7725 | if (toolbarSelector == null) {
|
7726 | throw new Error('错误:初始化编辑器时候未传入任何参数,请查阅文档');
|
7727 | }
|
7728 |
|
7729 |
|
7730 |
|
7731 | this.config = util_1.deepClone(config_1["default"]);
|
7732 | this.$toolbarElem = dom_core_1["default"]('<div></div>');
|
7733 | this.$textContainerElem = dom_core_1["default"]('<div></div>');
|
7734 | this.$textElem = dom_core_1["default"]('<div></div>');
|
7735 | this.toolbarElemId = '';
|
7736 | this.textElemId = '';
|
7737 | this.isFocus = false;
|
7738 | this.isComposing = false;
|
7739 | this.isCompatibleMode = false;
|
7740 | this.selection = new selection_1["default"](this);
|
7741 | this.cmd = new command_1["default"](this);
|
7742 | this.txt = new index_1["default"](this);
|
7743 | this.menus = new index_2["default"](this);
|
7744 | this.zIndex = new z_index_1["default"]();
|
7745 | this.change = new index_3["default"](this);
|
7746 | this.history = new index_4["default"](this);
|
7747 |
|
7748 | var _a = disable_1["default"](this),
|
7749 | disable = _a.disable,
|
7750 | enable = _a.enable;
|
7751 |
|
7752 | this.disable = disable;
|
7753 | this.enable = enable;
|
7754 | }
|
7755 | |
7756 |
|
7757 |
|
7758 |
|
7759 |
|
7760 |
|
7761 | Editor.prototype.initSelection = function (newLine) {
|
7762 | init_selection_1["default"](this, newLine);
|
7763 | };
|
7764 | |
7765 |
|
7766 |
|
7767 |
|
7768 |
|
7769 | Editor.prototype.create = function () {
|
7770 |
|
7771 | this.zIndex.init(this);
|
7772 |
|
7773 | this.isCompatibleMode = this.config.compatibleMode();
|
7774 |
|
7775 | if (!this.isCompatibleMode) {
|
7776 | this.config.onchangeTimeout = 30;
|
7777 | }
|
7778 |
|
7779 |
|
7780 | i18next_init_1["default"](this);
|
7781 |
|
7782 | init_dom_1["default"](this);
|
7783 |
|
7784 | this.txt.init();
|
7785 |
|
7786 | this.menus.init();
|
7787 |
|
7788 | set_full_screen_1["default"](this);
|
7789 |
|
7790 | this.initSelection(true);
|
7791 |
|
7792 | bind_event_1["default"](this);
|
7793 |
|
7794 | this.change.observe();
|
7795 | this.history.observe();
|
7796 | };
|
7797 | |
7798 |
|
7799 |
|
7800 |
|
7801 |
|
7802 |
|
7803 | Editor.prototype.beforeDestroy = function (fn) {
|
7804 | this.beforeDestroyHooks.push(fn);
|
7805 | return this;
|
7806 | };
|
7807 | |
7808 |
|
7809 |
|
7810 |
|
7811 |
|
7812 | Editor.prototype.destroy = function () {
|
7813 | var _context;
|
7814 |
|
7815 | var _this = this;
|
7816 |
|
7817 |
|
7818 | (0, _forEach["default"])(_context = this.beforeDestroyHooks).call(_context, function (fn) {
|
7819 | return fn.call(_this);
|
7820 | });
|
7821 |
|
7822 | this.$toolbarElem.remove();
|
7823 | this.$textContainerElem.remove();
|
7824 | };
|
7825 | |
7826 |
|
7827 |
|
7828 |
|
7829 |
|
7830 | Editor.prototype.fullScreen = function () {
|
7831 | set_full_screen_1.setFullScreen(this);
|
7832 | };
|
7833 | |
7834 |
|
7835 |
|
7836 |
|
7837 |
|
7838 | Editor.prototype.unFullScreen = function () {
|
7839 | set_full_screen_1.setUnFullScreen(this);
|
7840 | };
|
7841 | |
7842 |
|
7843 |
|
7844 |
|
7845 |
|
7846 |
|
7847 | Editor.prototype.scrollToHead = function (id) {
|
7848 | scroll_to_head_1["default"](this, id);
|
7849 | };
|
7850 |
|
7851 |
|
7852 | Editor.$ = dom_core_1["default"];
|
7853 | Editor.BtnMenu = BtnMenu_1["default"];
|
7854 | Editor.DropList = DropList_1["default"];
|
7855 | Editor.DropListMenu = DropListMenu_1["default"];
|
7856 | Editor.Panel = Panel_1["default"];
|
7857 | Editor.PanelMenu = PanelMenu_1["default"];
|
7858 | Editor.Tooltip = Tooltip_1["default"];
|
7859 | return Editor;
|
7860 | }();
|
7861 |
|
7862 | exports["default"] = Editor;
|
7863 |
|
7864 | }),
|
7865 |
|
7866 | (function(module, exports, __webpack_require__) {
|
7867 |
|
7868 | __webpack_require__(51);
|
7869 | var forEach = __webpack_require__(179);
|
7870 | var classof = __webpack_require__(61);
|
7871 | var ArrayPrototype = Array.prototype;
|
7872 |
|
7873 | var DOMIterables = {
|
7874 | DOMTokenList: true,
|
7875 | NodeList: true
|
7876 | };
|
7877 |
|
7878 | module.exports = function (it) {
|
7879 | var own = it.forEach;
|
7880 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach)
|
7881 |
|
7882 | || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;
|
7883 | };
|
7884 |
|
7885 |
|
7886 | }),
|
7887 |
|
7888 | (function(module, exports, __webpack_require__) {
|
7889 |
|
7890 | var parent = __webpack_require__(180);
|
7891 |
|
7892 | module.exports = parent;
|
7893 |
|
7894 |
|
7895 | }),
|
7896 |
|
7897 | (function(module, exports, __webpack_require__) {
|
7898 |
|
7899 | __webpack_require__(181);
|
7900 | var entryVirtual = __webpack_require__(16);
|
7901 |
|
7902 | module.exports = entryVirtual('Array').forEach;
|
7903 |
|
7904 |
|
7905 | }),
|
7906 |
|
7907 | (function(module, exports, __webpack_require__) {
|
7908 |
|
7909 | "use strict";
|
7910 |
|
7911 | var $ = __webpack_require__(4);
|
7912 | var forEach = __webpack_require__(182);
|
7913 |
|
7914 |
|
7915 |
|
7916 | $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
|
7917 | forEach: forEach
|
7918 | });
|
7919 |
|
7920 |
|
7921 | }),
|
7922 |
|
7923 | (function(module, exports, __webpack_require__) {
|
7924 |
|
7925 | "use strict";
|
7926 |
|
7927 | var $forEach = __webpack_require__(33).forEach;
|
7928 | var arrayMethodIsStrict = __webpack_require__(87);
|
7929 | var arrayMethodUsesToLength = __webpack_require__(25);
|
7930 |
|
7931 | var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
7932 | var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
|
7933 |
|
7934 |
|
7935 |
|
7936 | module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
|
7937 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
7938 | } : [].forEach;
|
7939 |
|
7940 |
|
7941 | }),
|
7942 |
|
7943 | (function(module, exports, __webpack_require__) {
|
7944 |
|
7945 | var parent = __webpack_require__(184);
|
7946 |
|
7947 | module.exports = parent;
|
7948 |
|
7949 |
|
7950 | }),
|
7951 |
|
7952 | (function(module, exports, __webpack_require__) {
|
7953 |
|
7954 | var bind = __webpack_require__(185);
|
7955 |
|
7956 | var FunctionPrototype = Function.prototype;
|
7957 |
|
7958 | module.exports = function (it) {
|
7959 | var own = it.bind;
|
7960 | return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own;
|
7961 | };
|
7962 |
|
7963 |
|
7964 | }),
|
7965 |
|
7966 | (function(module, exports, __webpack_require__) {
|
7967 |
|
7968 | __webpack_require__(186);
|
7969 | var entryVirtual = __webpack_require__(16);
|
7970 |
|
7971 | module.exports = entryVirtual('Function').bind;
|
7972 |
|
7973 |
|
7974 | }),
|
7975 |
|
7976 | (function(module, exports, __webpack_require__) {
|
7977 |
|
7978 | var $ = __webpack_require__(4);
|
7979 | var bind = __webpack_require__(187);
|
7980 |
|
7981 |
|
7982 |
|
7983 | $({ target: 'Function', proto: true }, {
|
7984 | bind: bind
|
7985 | });
|
7986 |
|
7987 |
|
7988 | }),
|
7989 |
|
7990 | (function(module, exports, __webpack_require__) {
|
7991 |
|
7992 | "use strict";
|
7993 |
|
7994 | var aFunction = __webpack_require__(32);
|
7995 | var isObject = __webpack_require__(13);
|
7996 |
|
7997 | var slice = [].slice;
|
7998 | var factories = {};
|
7999 |
|
8000 | var construct = function (C, argsLength, args) {
|
8001 | if (!(argsLength in factories)) {
|
8002 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
8003 |
|
8004 | factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
|
8005 | } return factories[argsLength](C, args);
|
8006 | };
|
8007 |
|
8008 |
|
8009 |
|
8010 | module.exports = Function.bind || function bind(that /* , ...args */) {
|
8011 | var fn = aFunction(this);
|
8012 | var partArgs = slice.call(arguments, 1);
|
8013 | var boundFunction = function bound(/* args... */) {
|
8014 | var args = partArgs.concat(slice.call(arguments));
|
8015 | return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
|
8016 | };
|
8017 | if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;
|
8018 | return boundFunction;
|
8019 | };
|
8020 |
|
8021 |
|
8022 | }),
|
8023 |
|
8024 | (function(module, exports, __webpack_require__) {
|
8025 |
|
8026 | var parent = __webpack_require__(189);
|
8027 |
|
8028 | module.exports = parent;
|
8029 |
|
8030 |
|
8031 | }),
|
8032 |
|
8033 | (function(module, exports, __webpack_require__) {
|
8034 |
|
8035 | var arrayIncludes = __webpack_require__(190);
|
8036 | var stringIncludes = __webpack_require__(192);
|
8037 |
|
8038 | var ArrayPrototype = Array.prototype;
|
8039 | var StringPrototype = String.prototype;
|
8040 |
|
8041 | module.exports = function (it) {
|
8042 | var own = it.includes;
|
8043 | if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.includes)) return arrayIncludes;
|
8044 | if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) {
|
8045 | return stringIncludes;
|
8046 | } return own;
|
8047 | };
|
8048 |
|
8049 |
|
8050 | }),
|
8051 |
|
8052 | (function(module, exports, __webpack_require__) {
|
8053 |
|
8054 | __webpack_require__(191);
|
8055 | var entryVirtual = __webpack_require__(16);
|
8056 |
|
8057 | module.exports = entryVirtual('Array').includes;
|
8058 |
|
8059 |
|
8060 | }),
|
8061 |
|
8062 | (function(module, exports, __webpack_require__) {
|
8063 |
|
8064 | "use strict";
|
8065 |
|
8066 | var $ = __webpack_require__(4);
|
8067 | var $includes = __webpack_require__(71).includes;
|
8068 | var addToUnscopables = __webpack_require__(85);
|
8069 | var arrayMethodUsesToLength = __webpack_require__(25);
|
8070 |
|
8071 | var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
|
8072 |
|
8073 |
|
8074 |
|
8075 | $({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
|
8076 | includes: function includes(el /* , fromIndex = 0 */) {
|
8077 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
8078 | }
|
8079 | });
|
8080 |
|
8081 |
|
8082 | addToUnscopables('includes');
|
8083 |
|
8084 |
|
8085 | }),
|
8086 |
|
8087 | (function(module, exports, __webpack_require__) {
|
8088 |
|
8089 | __webpack_require__(193);
|
8090 | var entryVirtual = __webpack_require__(16);
|
8091 |
|
8092 | module.exports = entryVirtual('String').includes;
|
8093 |
|
8094 |
|
8095 | }),
|
8096 |
|
8097 | (function(module, exports, __webpack_require__) {
|
8098 |
|
8099 | "use strict";
|
8100 |
|
8101 | var $ = __webpack_require__(4);
|
8102 | var notARegExp = __webpack_require__(194);
|
8103 | var requireObjectCoercible = __webpack_require__(46);
|
8104 | var correctIsRegExpLogic = __webpack_require__(196);
|
8105 |
|
8106 |
|
8107 |
|
8108 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
8109 | includes: function includes(searchString /* , position = 0 */) {
|
8110 | return !!~String(requireObjectCoercible(this))
|
8111 | .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
|
8112 | }
|
8113 | });
|
8114 |
|
8115 |
|
8116 | }),
|
8117 |
|
8118 | (function(module, exports, __webpack_require__) {
|
8119 |
|
8120 | var isRegExp = __webpack_require__(195);
|
8121 |
|
8122 | module.exports = function (it) {
|
8123 | if (isRegExp(it)) {
|
8124 | throw TypeError("The method doesn't accept regular expressions");
|
8125 | } return it;
|
8126 | };
|
8127 |
|
8128 |
|
8129 | }),
|
8130 |
|
8131 | (function(module, exports, __webpack_require__) {
|
8132 |
|
8133 | var isObject = __webpack_require__(13);
|
8134 | var classof = __webpack_require__(45);
|
8135 | var wellKnownSymbol = __webpack_require__(9);
|
8136 |
|
8137 | var MATCH = wellKnownSymbol('match');
|
8138 |
|
8139 |
|
8140 |
|
8141 | module.exports = function (it) {
|
8142 | var isRegExp;
|
8143 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
8144 | };
|
8145 |
|
8146 |
|
8147 | }),
|
8148 |
|
8149 | (function(module, exports, __webpack_require__) {
|
8150 |
|
8151 | var wellKnownSymbol = __webpack_require__(9);
|
8152 |
|
8153 | var MATCH = wellKnownSymbol('match');
|
8154 |
|
8155 | module.exports = function (METHOD_NAME) {
|
8156 | var regexp = /./;
|
8157 | try {
|
8158 | '/./'[METHOD_NAME](regexp);
|
8159 | } catch (error1) {
|
8160 | try {
|
8161 | regexp[MATCH] = false;
|
8162 | return '/./'[METHOD_NAME](regexp);
|
8163 | } catch (error2) { }
|
8164 | } return false;
|
8165 | };
|
8166 |
|
8167 |
|
8168 | }),
|
8169 |
|
8170 | (function(module, exports, __webpack_require__) {
|
8171 |
|
8172 | var parent = __webpack_require__(198);
|
8173 |
|
8174 | module.exports = parent;
|
8175 |
|
8176 |
|
8177 | }),
|
8178 |
|
8179 | (function(module, exports, __webpack_require__) {
|
8180 |
|
8181 | var filter = __webpack_require__(199);
|
8182 |
|
8183 | var ArrayPrototype = Array.prototype;
|
8184 |
|
8185 | module.exports = function (it) {
|
8186 | var own = it.filter;
|
8187 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filter) ? filter : own;
|
8188 | };
|
8189 |
|
8190 |
|
8191 | }),
|
8192 |
|
8193 | (function(module, exports, __webpack_require__) {
|
8194 |
|
8195 | __webpack_require__(200);
|
8196 | var entryVirtual = __webpack_require__(16);
|
8197 |
|
8198 | module.exports = entryVirtual('Array').filter;
|
8199 |
|
8200 |
|
8201 | }),
|
8202 |
|
8203 | (function(module, exports, __webpack_require__) {
|
8204 |
|
8205 | "use strict";
|
8206 |
|
8207 | var $ = __webpack_require__(4);
|
8208 | var $filter = __webpack_require__(33).filter;
|
8209 | var arrayMethodHasSpeciesSupport = __webpack_require__(53);
|
8210 | var arrayMethodUsesToLength = __webpack_require__(25);
|
8211 |
|
8212 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
8213 |
|
8214 | var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
|
8215 |
|
8216 |
|
8217 |
|
8218 |
|
8219 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
8220 | filter: function filter(callbackfn /* , thisArg */) {
|
8221 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
8222 | }
|
8223 | });
|
8224 |
|
8225 |
|
8226 | }),
|
8227 |
|
8228 | (function(module, exports, __webpack_require__) {
|
8229 |
|
8230 | var parent = __webpack_require__(202);
|
8231 |
|
8232 | module.exports = parent;
|
8233 |
|
8234 |
|
8235 | }),
|
8236 |
|
8237 | (function(module, exports, __webpack_require__) {
|
8238 |
|
8239 | var splice = __webpack_require__(203);
|
8240 |
|
8241 | var ArrayPrototype = Array.prototype;
|
8242 |
|
8243 | module.exports = function (it) {
|
8244 | var own = it.splice;
|
8245 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.splice) ? splice : own;
|
8246 | };
|
8247 |
|
8248 |
|
8249 | }),
|
8250 |
|
8251 | (function(module, exports, __webpack_require__) {
|
8252 |
|
8253 | __webpack_require__(204);
|
8254 | var entryVirtual = __webpack_require__(16);
|
8255 |
|
8256 | module.exports = entryVirtual('Array').splice;
|
8257 |
|
8258 |
|
8259 | }),
|
8260 |
|
8261 | (function(module, exports, __webpack_require__) {
|
8262 |
|
8263 | "use strict";
|
8264 |
|
8265 | var $ = __webpack_require__(4);
|
8266 | var toAbsoluteIndex = __webpack_require__(72);
|
8267 | var toInteger = __webpack_require__(58);
|
8268 | var toLength = __webpack_require__(36);
|
8269 | var toObject = __webpack_require__(38);
|
8270 | var arraySpeciesCreate = __webpack_require__(86);
|
8271 | var createProperty = __webpack_require__(91);
|
8272 | var arrayMethodHasSpeciesSupport = __webpack_require__(53);
|
8273 | var arrayMethodUsesToLength = __webpack_require__(25);
|
8274 |
|
8275 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
|
8276 | var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
|
8277 |
|
8278 | var max = Math.max;
|
8279 | var min = Math.min;
|
8280 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
8281 | var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
|
8282 |
|
8283 |
|
8284 |
|
8285 |
|
8286 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
8287 | splice: function splice(start, deleteCount /* , ...items */) {
|
8288 | var O = toObject(this);
|
8289 | var len = toLength(O.length);
|
8290 | var actualStart = toAbsoluteIndex(start, len);
|
8291 | var argumentsLength = arguments.length;
|
8292 | var insertCount, actualDeleteCount, A, k, from, to;
|
8293 | if (argumentsLength === 0) {
|
8294 | insertCount = actualDeleteCount = 0;
|
8295 | } else if (argumentsLength === 1) {
|
8296 | insertCount = 0;
|
8297 | actualDeleteCount = len - actualStart;
|
8298 | } else {
|
8299 | insertCount = argumentsLength - 2;
|
8300 | actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
|
8301 | }
|
8302 | if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
|
8303 | throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
|
8304 | }
|
8305 | A = arraySpeciesCreate(O, actualDeleteCount);
|
8306 | for (k = 0; k < actualDeleteCount; k++) {
|
8307 | from = actualStart + k;
|
8308 | if (from in O) createProperty(A, k, O[from]);
|
8309 | }
|
8310 | A.length = actualDeleteCount;
|
8311 | if (insertCount < actualDeleteCount) {
|
8312 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
8313 | from = k + actualDeleteCount;
|
8314 | to = k + insertCount;
|
8315 | if (from in O) O[to] = O[from];
|
8316 | else delete O[to];
|
8317 | }
|
8318 | for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
|
8319 | } else if (insertCount > actualDeleteCount) {
|
8320 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
8321 | from = k + actualDeleteCount - 1;
|
8322 | to = k + insertCount - 1;
|
8323 | if (from in O) O[to] = O[from];
|
8324 | else delete O[to];
|
8325 | }
|
8326 | }
|
8327 | for (k = 0; k < insertCount; k++) {
|
8328 | O[k + actualStart] = arguments[k + 2];
|
8329 | }
|
8330 | O.length = len - actualDeleteCount + insertCount;
|
8331 | return A;
|
8332 | }
|
8333 | });
|
8334 |
|
8335 |
|
8336 | }),
|
8337 |
|
8338 | (function(module, exports, __webpack_require__) {
|
8339 |
|
8340 | var parent = __webpack_require__(206);
|
8341 |
|
8342 | module.exports = parent;
|
8343 |
|
8344 |
|
8345 | }),
|
8346 |
|
8347 | (function(module, exports, __webpack_require__) {
|
8348 |
|
8349 | var indexOf = __webpack_require__(207);
|
8350 |
|
8351 | var ArrayPrototype = Array.prototype;
|
8352 |
|
8353 | module.exports = function (it) {
|
8354 | var own = it.indexOf;
|
8355 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.indexOf) ? indexOf : own;
|
8356 | };
|
8357 |
|
8358 |
|
8359 | }),
|
8360 |
|
8361 | (function(module, exports, __webpack_require__) {
|
8362 |
|
8363 | __webpack_require__(208);
|
8364 | var entryVirtual = __webpack_require__(16);
|
8365 |
|
8366 | module.exports = entryVirtual('Array').indexOf;
|
8367 |
|
8368 |
|
8369 | }),
|
8370 |
|
8371 | (function(module, exports, __webpack_require__) {
|
8372 |
|
8373 | "use strict";
|
8374 |
|
8375 | var $ = __webpack_require__(4);
|
8376 | var $indexOf = __webpack_require__(71).indexOf;
|
8377 | var arrayMethodIsStrict = __webpack_require__(87);
|
8378 | var arrayMethodUsesToLength = __webpack_require__(25);
|
8379 |
|
8380 | var nativeIndexOf = [].indexOf;
|
8381 |
|
8382 | var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
|
8383 | var STRICT_METHOD = arrayMethodIsStrict('indexOf');
|
8384 | var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
|
8385 |
|
8386 |
|
8387 |
|
8388 | $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
|
8389 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
8390 | return NEGATIVE_ZERO
|
8391 |
|
8392 | ? nativeIndexOf.apply(this, arguments) || 0
|
8393 | : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
8394 | }
|
8395 | });
|
8396 |
|
8397 |
|
8398 | }),
|
8399 |
|
8400 | (function(module, exports, __webpack_require__) {
|
8401 |
|
8402 | var parent = __webpack_require__(210);
|
8403 |
|
8404 | module.exports = parent;
|
8405 |
|
8406 |
|
8407 | }),
|
8408 |
|
8409 | (function(module, exports, __webpack_require__) {
|
8410 |
|
8411 | __webpack_require__(211);
|
8412 | __webpack_require__(62);
|
8413 | __webpack_require__(65);
|
8414 | __webpack_require__(51);
|
8415 | var path = __webpack_require__(10);
|
8416 |
|
8417 | module.exports = path.Map;
|
8418 |
|
8419 |
|
8420 | }),
|
8421 |
|
8422 | (function(module, exports, __webpack_require__) {
|
8423 |
|
8424 | "use strict";
|
8425 |
|
8426 | var collection = __webpack_require__(115);
|
8427 | var collectionStrong = __webpack_require__(117);
|
8428 |
|
8429 |
|
8430 |
|
8431 | module.exports = collection('Map', function (init) {
|
8432 | return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
|
8433 | }, collectionStrong);
|
8434 |
|
8435 |
|
8436 | }),
|
8437 |
|
8438 | (function(module, exports, __webpack_require__) {
|
8439 |
|
8440 | var fails = __webpack_require__(12);
|
8441 |
|
8442 | module.exports = !fails(function () {
|
8443 | return Object.isExtensible(Object.preventExtensions({}));
|
8444 | });
|
8445 |
|
8446 |
|
8447 | }),
|
8448 |
|
8449 | (function(module, exports, __webpack_require__) {
|
8450 |
|
8451 | var parent = __webpack_require__(214);
|
8452 |
|
8453 | module.exports = parent;
|
8454 |
|
8455 |
|
8456 | }),
|
8457 |
|
8458 | (function(module, exports, __webpack_require__) {
|
8459 |
|
8460 | var trim = __webpack_require__(215);
|
8461 |
|
8462 | var StringPrototype = String.prototype;
|
8463 |
|
8464 | module.exports = function (it) {
|
8465 | var own = it.trim;
|
8466 | return typeof it === 'string' || it === StringPrototype
|
8467 | || (it instanceof String && own === StringPrototype.trim) ? trim : own;
|
8468 | };
|
8469 |
|
8470 |
|
8471 | }),
|
8472 |
|
8473 | (function(module, exports, __webpack_require__) {
|
8474 |
|
8475 | __webpack_require__(216);
|
8476 | var entryVirtual = __webpack_require__(16);
|
8477 |
|
8478 | module.exports = entryVirtual('String').trim;
|
8479 |
|
8480 |
|
8481 | }),
|
8482 |
|
8483 | (function(module, exports, __webpack_require__) {
|
8484 |
|
8485 | "use strict";
|
8486 |
|
8487 | var $ = __webpack_require__(4);
|
8488 | var $trim = __webpack_require__(92).trim;
|
8489 | var forcedStringTrimMethod = __webpack_require__(217);
|
8490 |
|
8491 |
|
8492 |
|
8493 | $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
8494 | trim: function trim() {
|
8495 | return $trim(this);
|
8496 | }
|
8497 | });
|
8498 |
|
8499 |
|
8500 | }),
|
8501 |
|
8502 | (function(module, exports, __webpack_require__) {
|
8503 |
|
8504 | var fails = __webpack_require__(12);
|
8505 | var whitespaces = __webpack_require__(67);
|
8506 |
|
8507 | var non = '\u200B\u0085\u180E';
|
8508 |
|
8509 |
|
8510 |
|
8511 | module.exports = function (METHOD_NAME) {
|
8512 | return fails(function () {
|
8513 | return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
8514 | });
|
8515 | };
|
8516 |
|
8517 |
|
8518 | }),
|
8519 |
|
8520 | (function(module, exports, __webpack_require__) {
|
8521 |
|
8522 | var parent = __webpack_require__(219);
|
8523 |
|
8524 | module.exports = parent;
|
8525 |
|
8526 |
|
8527 | }),
|
8528 |
|
8529 | (function(module, exports, __webpack_require__) {
|
8530 |
|
8531 | var map = __webpack_require__(220);
|
8532 |
|
8533 | var ArrayPrototype = Array.prototype;
|
8534 |
|
8535 | module.exports = function (it) {
|
8536 | var own = it.map;
|
8537 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.map) ? map : own;
|
8538 | };
|
8539 |
|
8540 |
|
8541 | }),
|
8542 |
|
8543 | (function(module, exports, __webpack_require__) {
|
8544 |
|
8545 | __webpack_require__(221);
|
8546 | var entryVirtual = __webpack_require__(16);
|
8547 |
|
8548 | module.exports = entryVirtual('Array').map;
|
8549 |
|
8550 |
|
8551 | }),
|
8552 |
|
8553 | (function(module, exports, __webpack_require__) {
|
8554 |
|
8555 | "use strict";
|
8556 |
|
8557 | var $ = __webpack_require__(4);
|
8558 | var $map = __webpack_require__(33).map;
|
8559 | var arrayMethodHasSpeciesSupport = __webpack_require__(53);
|
8560 | var arrayMethodUsesToLength = __webpack_require__(25);
|
8561 |
|
8562 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
8563 |
|
8564 | var USES_TO_LENGTH = arrayMethodUsesToLength('map');
|
8565 |
|
8566 |
|
8567 |
|
8568 |
|
8569 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
8570 | map: function map(callbackfn /* , thisArg */) {
|
8571 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
8572 | }
|
8573 | });
|
8574 |
|
8575 |
|
8576 | }),
|
8577 |
|
8578 | (function(module, exports, __webpack_require__) {
|
8579 |
|
8580 | var parent = __webpack_require__(223);
|
8581 |
|
8582 | module.exports = parent;
|
8583 |
|
8584 |
|
8585 | }),
|
8586 |
|
8587 | (function(module, exports, __webpack_require__) {
|
8588 |
|
8589 | __webpack_require__(224);
|
8590 | var path = __webpack_require__(10);
|
8591 |
|
8592 | module.exports = path.Array.isArray;
|
8593 |
|
8594 |
|
8595 | }),
|
8596 |
|
8597 | (function(module, exports, __webpack_require__) {
|
8598 |
|
8599 | var $ = __webpack_require__(4);
|
8600 | var isArray = __webpack_require__(52);
|
8601 |
|
8602 |
|
8603 |
|
8604 | $({ target: 'Array', stat: true }, {
|
8605 | isArray: isArray
|
8606 | });
|
8607 |
|
8608 |
|
8609 | }),
|
8610 |
|
8611 | (function(module, exports, __webpack_require__) {
|
8612 |
|
8613 | module.exports = __webpack_require__(226);
|
8614 |
|
8615 | }),
|
8616 |
|
8617 | (function(module, exports, __webpack_require__) {
|
8618 |
|
8619 | var parent = __webpack_require__(227);
|
8620 |
|
8621 | module.exports = parent;
|
8622 |
|
8623 |
|
8624 | }),
|
8625 |
|
8626 | (function(module, exports, __webpack_require__) {
|
8627 |
|
8628 | __webpack_require__(118);
|
8629 | __webpack_require__(65);
|
8630 | __webpack_require__(51);
|
8631 | var WrappedWellKnownSymbolModule = __webpack_require__(95);
|
8632 |
|
8633 | module.exports = WrappedWellKnownSymbolModule.f('iterator');
|
8634 |
|
8635 |
|
8636 | }),
|
8637 |
|
8638 | (function(module, exports, __webpack_require__) {
|
8639 |
|
8640 | module.exports = __webpack_require__(229);
|
8641 |
|
8642 | }),
|
8643 |
|
8644 | (function(module, exports, __webpack_require__) {
|
8645 |
|
8646 | var parent = __webpack_require__(230);
|
8647 | __webpack_require__(250);
|
8648 | __webpack_require__(251);
|
8649 | __webpack_require__(252);
|
8650 | __webpack_require__(253);
|
8651 |
|
8652 | __webpack_require__(254);
|
8653 |
|
8654 | module.exports = parent;
|
8655 |
|
8656 |
|
8657 | }),
|
8658 |
|
8659 | (function(module, exports, __webpack_require__) {
|
8660 |
|
8661 | __webpack_require__(231);
|
8662 | __webpack_require__(62);
|
8663 | __webpack_require__(232);
|
8664 | __webpack_require__(234);
|
8665 | __webpack_require__(235);
|
8666 | __webpack_require__(236);
|
8667 | __webpack_require__(237);
|
8668 | __webpack_require__(118);
|
8669 | __webpack_require__(238);
|
8670 | __webpack_require__(239);
|
8671 | __webpack_require__(240);
|
8672 | __webpack_require__(241);
|
8673 | __webpack_require__(242);
|
8674 | __webpack_require__(243);
|
8675 | __webpack_require__(244);
|
8676 | __webpack_require__(245);
|
8677 | __webpack_require__(246);
|
8678 | __webpack_require__(247);
|
8679 | __webpack_require__(248);
|
8680 | __webpack_require__(249);
|
8681 | var path = __webpack_require__(10);
|
8682 |
|
8683 | module.exports = path.Symbol;
|
8684 |
|
8685 |
|
8686 | }),
|
8687 |
|
8688 | (function(module, exports, __webpack_require__) {
|
8689 |
|
8690 | "use strict";
|
8691 |
|
8692 | var $ = __webpack_require__(4);
|
8693 | var fails = __webpack_require__(12);
|
8694 | var isArray = __webpack_require__(52);
|
8695 | var isObject = __webpack_require__(13);
|
8696 | var toObject = __webpack_require__(38);
|
8697 | var toLength = __webpack_require__(36);
|
8698 | var createProperty = __webpack_require__(91);
|
8699 | var arraySpeciesCreate = __webpack_require__(86);
|
8700 | var arrayMethodHasSpeciesSupport = __webpack_require__(53);
|
8701 | var wellKnownSymbol = __webpack_require__(9);
|
8702 | var V8_VERSION = __webpack_require__(83);
|
8703 |
|
8704 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
8705 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
8706 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
8707 |
|
8708 |
|
8709 |
|
8710 |
|
8711 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
8712 | var array = [];
|
8713 | array[IS_CONCAT_SPREADABLE] = false;
|
8714 | return array.concat()[0] !== array;
|
8715 | });
|
8716 |
|
8717 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
8718 |
|
8719 | var isConcatSpreadable = function (O) {
|
8720 | if (!isObject(O)) return false;
|
8721 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
8722 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
8723 | };
|
8724 |
|
8725 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
8726 |
|
8727 |
|
8728 |
|
8729 |
|
8730 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
8731 | concat: function concat(arg) {
|
8732 | var O = toObject(this);
|
8733 | var A = arraySpeciesCreate(O, 0);
|
8734 | var n = 0;
|
8735 | var i, k, length, len, E;
|
8736 | for (i = -1, length = arguments.length; i < length; i++) {
|
8737 | E = i === -1 ? O : arguments[i];
|
8738 | if (isConcatSpreadable(E)) {
|
8739 | len = toLength(E.length);
|
8740 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
8741 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
8742 | } else {
|
8743 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
8744 | createProperty(A, n++, E);
|
8745 | }
|
8746 | }
|
8747 | A.length = n;
|
8748 | return A;
|
8749 | }
|
8750 | });
|
8751 |
|
8752 |
|
8753 | }),
|
8754 |
|
8755 | (function(module, exports, __webpack_require__) {
|
8756 |
|
8757 | "use strict";
|
8758 |
|
8759 | var $ = __webpack_require__(4);
|
8760 | var global = __webpack_require__(8);
|
8761 | var getBuiltIn = __webpack_require__(28);
|
8762 | var IS_PURE = __webpack_require__(37);
|
8763 | var DESCRIPTORS = __webpack_require__(14);
|
8764 | var NATIVE_SYMBOL = __webpack_require__(78);
|
8765 | var USE_SYMBOL_AS_UID = __webpack_require__(104);
|
8766 | var fails = __webpack_require__(12);
|
8767 | var has = __webpack_require__(15);
|
8768 | var isArray = __webpack_require__(52);
|
8769 | var isObject = __webpack_require__(13);
|
8770 | var anObject = __webpack_require__(24);
|
8771 | var toObject = __webpack_require__(38);
|
8772 | var toIndexedObject = __webpack_require__(27);
|
8773 | var toPrimitive = __webpack_require__(56);
|
8774 | var createPropertyDescriptor = __webpack_require__(35);
|
8775 | var nativeObjectCreate = __webpack_require__(48);
|
8776 | var objectKeys = __webpack_require__(57);
|
8777 | var getOwnPropertyNamesModule = __webpack_require__(119);
|
8778 | var getOwnPropertyNamesExternal = __webpack_require__(233);
|
8779 | var getOwnPropertySymbolsModule = __webpack_require__(120);
|
8780 | var getOwnPropertyDescriptorModule = __webpack_require__(68);
|
8781 | var definePropertyModule = __webpack_require__(18);
|
8782 | var propertyIsEnumerableModule = __webpack_require__(55);
|
8783 | var createNonEnumerableProperty = __webpack_require__(17);
|
8784 | var redefine = __webpack_require__(50);
|
8785 | var shared = __webpack_require__(74);
|
8786 | var sharedKey = __webpack_require__(59);
|
8787 | var hiddenKeys = __webpack_require__(49);
|
8788 | var uid = __webpack_require__(60);
|
8789 | var wellKnownSymbol = __webpack_require__(9);
|
8790 | var wrappedWellKnownSymbolModule = __webpack_require__(95);
|
8791 | var defineWellKnownSymbol = __webpack_require__(11);
|
8792 | var setToStringTag = __webpack_require__(41);
|
8793 | var InternalStateModule = __webpack_require__(42);
|
8794 | var $forEach = __webpack_require__(33).forEach;
|
8795 |
|
8796 | var HIDDEN = sharedKey('hidden');
|
8797 | var SYMBOL = 'Symbol';
|
8798 | var PROTOTYPE = 'prototype';
|
8799 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
8800 | var setInternalState = InternalStateModule.set;
|
8801 | var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
8802 | var ObjectPrototype = Object[PROTOTYPE];
|
8803 | var $Symbol = global.Symbol;
|
8804 | var $stringify = getBuiltIn('JSON', 'stringify');
|
8805 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
8806 | var nativeDefineProperty = definePropertyModule.f;
|
8807 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
8808 | var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
8809 | var AllSymbols = shared('symbols');
|
8810 | var ObjectPrototypeSymbols = shared('op-symbols');
|
8811 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
8812 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
8813 | var WellKnownSymbolsStore = shared('wks');
|
8814 | var QObject = global.QObject;
|
8815 |
|
8816 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
8817 |
|
8818 |
|
8819 | var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
8820 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
8821 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
8822 | })).a != 7;
|
8823 | }) ? function (O, P, Attributes) {
|
8824 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
8825 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
8826 | nativeDefineProperty(O, P, Attributes);
|
8827 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
8828 | nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
8829 | }
|
8830 | } : nativeDefineProperty;
|
8831 |
|
8832 | var wrap = function (tag, description) {
|
8833 | var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
|
8834 | setInternalState(symbol, {
|
8835 | type: SYMBOL,
|
8836 | tag: tag,
|
8837 | description: description
|
8838 | });
|
8839 | if (!DESCRIPTORS) symbol.description = description;
|
8840 | return symbol;
|
8841 | };
|
8842 |
|
8843 | var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
|
8844 | return typeof it == 'symbol';
|
8845 | } : function (it) {
|
8846 | return Object(it) instanceof $Symbol;
|
8847 | };
|
8848 |
|
8849 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
8850 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
8851 | anObject(O);
|
8852 | var key = toPrimitive(P, true);
|
8853 | anObject(Attributes);
|
8854 | if (has(AllSymbols, key)) {
|
8855 | if (!Attributes.enumerable) {
|
8856 | if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
|
8857 | O[HIDDEN][key] = true;
|
8858 | } else {
|
8859 | if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
8860 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
8861 | } return setSymbolDescriptor(O, key, Attributes);
|
8862 | } return nativeDefineProperty(O, key, Attributes);
|
8863 | };
|
8864 |
|
8865 | var $defineProperties = function defineProperties(O, Properties) {
|
8866 | anObject(O);
|
8867 | var properties = toIndexedObject(Properties);
|
8868 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
8869 | $forEach(keys, function (key) {
|
8870 | if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
|
8871 | });
|
8872 | return O;
|
8873 | };
|
8874 |
|
8875 | var $create = function create(O, Properties) {
|
8876 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
8877 | };
|
8878 |
|
8879 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
8880 | var P = toPrimitive(V, true);
|
8881 | var enumerable = nativePropertyIsEnumerable.call(this, P);
|
8882 | if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
|
8883 | return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
|
8884 | };
|
8885 |
|
8886 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
8887 | var it = toIndexedObject(O);
|
8888 | var key = toPrimitive(P, true);
|
8889 | if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
|
8890 | var descriptor = nativeGetOwnPropertyDescriptor(it, key);
|
8891 | if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
|
8892 | descriptor.enumerable = true;
|
8893 | }
|
8894 | return descriptor;
|
8895 | };
|
8896 |
|
8897 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
8898 | var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
8899 | var result = [];
|
8900 | $forEach(names, function (key) {
|
8901 | if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
|
8902 | });
|
8903 | return result;
|
8904 | };
|
8905 |
|
8906 | var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
8907 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
8908 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
8909 | var result = [];
|
8910 | $forEach(names, function (key) {
|
8911 | if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
|
8912 | result.push(AllSymbols[key]);
|
8913 | }
|
8914 | });
|
8915 | return result;
|
8916 | };
|
8917 |
|
8918 |
|
8919 |
|
8920 | if (!NATIVE_SYMBOL) {
|
8921 | $Symbol = function Symbol() {
|
8922 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
|
8923 | var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
8924 | var tag = uid(description);
|
8925 | var setter = function (value) {
|
8926 | if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
|
8927 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
8928 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
8929 | };
|
8930 | if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
8931 | return wrap(tag, description);
|
8932 | };
|
8933 |
|
8934 | redefine($Symbol[PROTOTYPE], 'toString', function toString() {
|
8935 | return getInternalState(this).tag;
|
8936 | });
|
8937 |
|
8938 | redefine($Symbol, 'withoutSetter', function (description) {
|
8939 | return wrap(uid(description), description);
|
8940 | });
|
8941 |
|
8942 | propertyIsEnumerableModule.f = $propertyIsEnumerable;
|
8943 | definePropertyModule.f = $defineProperty;
|
8944 | getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
|
8945 | getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
8946 | getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
|
8947 |
|
8948 | wrappedWellKnownSymbolModule.f = function (name) {
|
8949 | return wrap(wellKnownSymbol(name), name);
|
8950 | };
|
8951 |
|
8952 | if (DESCRIPTORS) {
|
8953 |
|
8954 | nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
|
8955 | configurable: true,
|
8956 | get: function description() {
|
8957 | return getInternalState(this).description;
|
8958 | }
|
8959 | });
|
8960 | if (!IS_PURE) {
|
8961 | redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
8962 | }
|
8963 | }
|
8964 | }
|
8965 |
|
8966 | $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
8967 | Symbol: $Symbol
|
8968 | });
|
8969 |
|
8970 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
8971 | defineWellKnownSymbol(name);
|
8972 | });
|
8973 |
|
8974 | $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
8975 |
|
8976 |
|
8977 | 'for': function (key) {
|
8978 | var string = String(key);
|
8979 | if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
8980 | var symbol = $Symbol(string);
|
8981 | StringToSymbolRegistry[string] = symbol;
|
8982 | SymbolToStringRegistry[symbol] = string;
|
8983 | return symbol;
|
8984 | },
|
8985 |
|
8986 |
|
8987 | keyFor: function keyFor(sym) {
|
8988 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
8989 | if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
8990 | },
|
8991 | useSetter: function () { USE_SETTER = true; },
|
8992 | useSimple: function () { USE_SETTER = false; }
|
8993 | });
|
8994 |
|
8995 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
8996 |
|
8997 |
|
8998 | create: $create,
|
8999 |
|
9000 |
|
9001 | defineProperty: $defineProperty,
|
9002 |
|
9003 |
|
9004 | defineProperties: $defineProperties,
|
9005 |
|
9006 |
|
9007 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
9008 | });
|
9009 |
|
9010 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
9011 |
|
9012 |
|
9013 | getOwnPropertyNames: $getOwnPropertyNames,
|
9014 |
|
9015 |
|
9016 | getOwnPropertySymbols: $getOwnPropertySymbols
|
9017 | });
|
9018 |
|
9019 |
|
9020 |
|
9021 | $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
|
9022 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
9023 | return getOwnPropertySymbolsModule.f(toObject(it));
|
9024 | }
|
9025 | });
|
9026 |
|
9027 |
|
9028 |
|
9029 | if ($stringify) {
|
9030 | var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
|
9031 | var symbol = $Symbol();
|
9032 |
|
9033 | return $stringify([symbol]) != '[null]'
|
9034 |
|
9035 | || $stringify({ a: symbol }) != '{}'
|
9036 |
|
9037 | || $stringify(Object(symbol)) != '{}';
|
9038 | });
|
9039 |
|
9040 | $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
|
9041 |
|
9042 | stringify: function stringify(it, replacer, space) {
|
9043 | var args = [it];
|
9044 | var index = 1;
|
9045 | var $replacer;
|
9046 | while (arguments.length > index) args.push(arguments[index++]);
|
9047 | $replacer = replacer;
|
9048 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
9049 | if (!isArray(replacer)) replacer = function (key, value) {
|
9050 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
9051 | if (!isSymbol(value)) return value;
|
9052 | };
|
9053 | args[1] = replacer;
|
9054 | return $stringify.apply(null, args);
|
9055 | }
|
9056 | });
|
9057 | }
|
9058 |
|
9059 |
|
9060 |
|
9061 | if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
|
9062 | createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
9063 | }
|
9064 |
|
9065 |
|
9066 | setToStringTag($Symbol, SYMBOL);
|
9067 |
|
9068 | hiddenKeys[HIDDEN] = true;
|
9069 |
|
9070 |
|
9071 | }),
|
9072 |
|
9073 | (function(module, exports, __webpack_require__) {
|
9074 |
|
9075 | var toIndexedObject = __webpack_require__(27);
|
9076 | var nativeGetOwnPropertyNames = __webpack_require__(119).f;
|
9077 |
|
9078 | var toString = {}.toString;
|
9079 |
|
9080 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
9081 | ? Object.getOwnPropertyNames(window) : [];
|
9082 |
|
9083 | var getWindowNames = function (it) {
|
9084 | try {
|
9085 | return nativeGetOwnPropertyNames(it);
|
9086 | } catch (error) {
|
9087 | return windowNames.slice();
|
9088 | }
|
9089 | };
|
9090 |
|
9091 |
|
9092 | module.exports.f = function getOwnPropertyNames(it) {
|
9093 | return windowNames && toString.call(it) == '[object Window]'
|
9094 | ? getWindowNames(it)
|
9095 | : nativeGetOwnPropertyNames(toIndexedObject(it));
|
9096 | };
|
9097 |
|
9098 |
|
9099 | }),
|
9100 |
|
9101 | (function(module, exports, __webpack_require__) {
|
9102 |
|
9103 | var defineWellKnownSymbol = __webpack_require__(11);
|
9104 |
|
9105 |
|
9106 |
|
9107 | defineWellKnownSymbol('asyncIterator');
|
9108 |
|
9109 |
|
9110 | }),
|
9111 |
|
9112 | (function(module, exports) {
|
9113 |
|
9114 |
|
9115 |
|
9116 |
|
9117 | }),
|
9118 |
|
9119 | (function(module, exports, __webpack_require__) {
|
9120 |
|
9121 | var defineWellKnownSymbol = __webpack_require__(11);
|
9122 |
|
9123 |
|
9124 |
|
9125 | defineWellKnownSymbol('hasInstance');
|
9126 |
|
9127 |
|
9128 | }),
|
9129 |
|
9130 | (function(module, exports, __webpack_require__) {
|
9131 |
|
9132 | var defineWellKnownSymbol = __webpack_require__(11);
|
9133 |
|
9134 |
|
9135 |
|
9136 | defineWellKnownSymbol('isConcatSpreadable');
|
9137 |
|
9138 |
|
9139 | }),
|
9140 |
|
9141 | (function(module, exports, __webpack_require__) {
|
9142 |
|
9143 | var defineWellKnownSymbol = __webpack_require__(11);
|
9144 |
|
9145 |
|
9146 |
|
9147 | defineWellKnownSymbol('match');
|
9148 |
|
9149 |
|
9150 | }),
|
9151 |
|
9152 | (function(module, exports, __webpack_require__) {
|
9153 |
|
9154 | var defineWellKnownSymbol = __webpack_require__(11);
|
9155 |
|
9156 |
|
9157 |
|
9158 | defineWellKnownSymbol('matchAll');
|
9159 |
|
9160 |
|
9161 | }),
|
9162 |
|
9163 | (function(module, exports, __webpack_require__) {
|
9164 |
|
9165 | var defineWellKnownSymbol = __webpack_require__(11);
|
9166 |
|
9167 |
|
9168 |
|
9169 | defineWellKnownSymbol('replace');
|
9170 |
|
9171 |
|
9172 | }),
|
9173 |
|
9174 | (function(module, exports, __webpack_require__) {
|
9175 |
|
9176 | var defineWellKnownSymbol = __webpack_require__(11);
|
9177 |
|
9178 |
|
9179 |
|
9180 | defineWellKnownSymbol('search');
|
9181 |
|
9182 |
|
9183 | }),
|
9184 |
|
9185 | (function(module, exports, __webpack_require__) {
|
9186 |
|
9187 | var defineWellKnownSymbol = __webpack_require__(11);
|
9188 |
|
9189 |
|
9190 |
|
9191 | defineWellKnownSymbol('species');
|
9192 |
|
9193 |
|
9194 | }),
|
9195 |
|
9196 | (function(module, exports, __webpack_require__) {
|
9197 |
|
9198 | var defineWellKnownSymbol = __webpack_require__(11);
|
9199 |
|
9200 |
|
9201 |
|
9202 | defineWellKnownSymbol('split');
|
9203 |
|
9204 |
|
9205 | }),
|
9206 |
|
9207 | (function(module, exports, __webpack_require__) {
|
9208 |
|
9209 | var defineWellKnownSymbol = __webpack_require__(11);
|
9210 |
|
9211 |
|
9212 |
|
9213 | defineWellKnownSymbol('toPrimitive');
|
9214 |
|
9215 |
|
9216 | }),
|
9217 |
|
9218 | (function(module, exports, __webpack_require__) {
|
9219 |
|
9220 | var defineWellKnownSymbol = __webpack_require__(11);
|
9221 |
|
9222 |
|
9223 |
|
9224 | defineWellKnownSymbol('toStringTag');
|
9225 |
|
9226 |
|
9227 | }),
|
9228 |
|
9229 | (function(module, exports, __webpack_require__) {
|
9230 |
|
9231 | var defineWellKnownSymbol = __webpack_require__(11);
|
9232 |
|
9233 |
|
9234 |
|
9235 | defineWellKnownSymbol('unscopables');
|
9236 |
|
9237 |
|
9238 | }),
|
9239 |
|
9240 | (function(module, exports, __webpack_require__) {
|
9241 |
|
9242 | var global = __webpack_require__(8);
|
9243 | var setToStringTag = __webpack_require__(41);
|
9244 |
|
9245 |
|
9246 |
|
9247 | setToStringTag(global.JSON, 'JSON', true);
|
9248 |
|
9249 |
|
9250 | }),
|
9251 |
|
9252 | (function(module, exports) {
|
9253 |
|
9254 |
|
9255 |
|
9256 |
|
9257 | }),
|
9258 |
|
9259 | (function(module, exports) {
|
9260 |
|
9261 |
|
9262 |
|
9263 |
|
9264 | }),
|
9265 |
|
9266 | (function(module, exports, __webpack_require__) {
|
9267 |
|
9268 | var defineWellKnownSymbol = __webpack_require__(11);
|
9269 |
|
9270 |
|
9271 |
|
9272 | defineWellKnownSymbol('asyncDispose');
|
9273 |
|
9274 |
|
9275 | }),
|
9276 |
|
9277 | (function(module, exports, __webpack_require__) {
|
9278 |
|
9279 | var defineWellKnownSymbol = __webpack_require__(11);
|
9280 |
|
9281 |
|
9282 |
|
9283 | defineWellKnownSymbol('dispose');
|
9284 |
|
9285 |
|
9286 | }),
|
9287 |
|
9288 | (function(module, exports, __webpack_require__) {
|
9289 |
|
9290 | var defineWellKnownSymbol = __webpack_require__(11);
|
9291 |
|
9292 |
|
9293 |
|
9294 | defineWellKnownSymbol('observable');
|
9295 |
|
9296 |
|
9297 | }),
|
9298 |
|
9299 | (function(module, exports, __webpack_require__) {
|
9300 |
|
9301 | var defineWellKnownSymbol = __webpack_require__(11);
|
9302 |
|
9303 |
|
9304 |
|
9305 | defineWellKnownSymbol('patternMatch');
|
9306 |
|
9307 |
|
9308 | }),
|
9309 |
|
9310 | (function(module, exports, __webpack_require__) {
|
9311 |
|
9312 |
|
9313 | var defineWellKnownSymbol = __webpack_require__(11);
|
9314 |
|
9315 | defineWellKnownSymbol('replaceAll');
|
9316 |
|
9317 |
|
9318 | }),
|
9319 |
|
9320 | (function(module, exports, __webpack_require__) {
|
9321 |
|
9322 | __webpack_require__(256);
|
9323 | var path = __webpack_require__(10);
|
9324 |
|
9325 | module.exports = path.setTimeout;
|
9326 |
|
9327 |
|
9328 | }),
|
9329 |
|
9330 | (function(module, exports, __webpack_require__) {
|
9331 |
|
9332 | var $ = __webpack_require__(4);
|
9333 | var global = __webpack_require__(8);
|
9334 | var userAgent = __webpack_require__(63);
|
9335 |
|
9336 | var slice = [].slice;
|
9337 | var MSIE = /MSIE .\./.test(userAgent);
|
9338 |
|
9339 | var wrap = function (scheduler) {
|
9340 | return function (handler, timeout /* , ...arguments */) {
|
9341 | var boundArgs = arguments.length > 2;
|
9342 | var args = boundArgs ? slice.call(arguments, 2) : undefined;
|
9343 | return scheduler(boundArgs ? function () {
|
9344 |
|
9345 | (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);
|
9346 | } : handler, timeout);
|
9347 | };
|
9348 | };
|
9349 |
|
9350 |
|
9351 |
|
9352 | $({ global: true, bind: true, forced: MSIE }, {
|
9353 |
|
9354 |
|
9355 | setTimeout: wrap(global.setTimeout),
|
9356 |
|
9357 |
|
9358 | setInterval: wrap(global.setInterval)
|
9359 | });
|
9360 |
|
9361 |
|
9362 | }),
|
9363 |
|
9364 | (function(module, exports, __webpack_require__) {
|
9365 |
|
9366 | var parent = __webpack_require__(258);
|
9367 |
|
9368 | module.exports = parent;
|
9369 |
|
9370 |
|
9371 | }),
|
9372 |
|
9373 | (function(module, exports, __webpack_require__) {
|
9374 |
|
9375 | var slice = __webpack_require__(259);
|
9376 |
|
9377 | var ArrayPrototype = Array.prototype;
|
9378 |
|
9379 | module.exports = function (it) {
|
9380 | var own = it.slice;
|
9381 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.slice) ? slice : own;
|
9382 | };
|
9383 |
|
9384 |
|
9385 | }),
|
9386 |
|
9387 | (function(module, exports, __webpack_require__) {
|
9388 |
|
9389 | __webpack_require__(260);
|
9390 | var entryVirtual = __webpack_require__(16);
|
9391 |
|
9392 | module.exports = entryVirtual('Array').slice;
|
9393 |
|
9394 |
|
9395 | }),
|
9396 |
|
9397 | (function(module, exports, __webpack_require__) {
|
9398 |
|
9399 | "use strict";
|
9400 |
|
9401 | var $ = __webpack_require__(4);
|
9402 | var isObject = __webpack_require__(13);
|
9403 | var isArray = __webpack_require__(52);
|
9404 | var toAbsoluteIndex = __webpack_require__(72);
|
9405 | var toLength = __webpack_require__(36);
|
9406 | var toIndexedObject = __webpack_require__(27);
|
9407 | var createProperty = __webpack_require__(91);
|
9408 | var wellKnownSymbol = __webpack_require__(9);
|
9409 | var arrayMethodHasSpeciesSupport = __webpack_require__(53);
|
9410 | var arrayMethodUsesToLength = __webpack_require__(25);
|
9411 |
|
9412 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
9413 | var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
|
9414 |
|
9415 | var SPECIES = wellKnownSymbol('species');
|
9416 | var nativeSlice = [].slice;
|
9417 | var max = Math.max;
|
9418 |
|
9419 |
|
9420 |
|
9421 |
|
9422 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
9423 | slice: function slice(start, end) {
|
9424 | var O = toIndexedObject(this);
|
9425 | var length = toLength(O.length);
|
9426 | var k = toAbsoluteIndex(start, length);
|
9427 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
9428 |
|
9429 | var Constructor, result, n;
|
9430 | if (isArray(O)) {
|
9431 | Constructor = O.constructor;
|
9432 |
|
9433 | if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
|
9434 | Constructor = undefined;
|
9435 | } else if (isObject(Constructor)) {
|
9436 | Constructor = Constructor[SPECIES];
|
9437 | if (Constructor === null) Constructor = undefined;
|
9438 | }
|
9439 | if (Constructor === Array || Constructor === undefined) {
|
9440 | return nativeSlice.call(O, k, fin);
|
9441 | }
|
9442 | }
|
9443 | result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
|
9444 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
9445 | result.length = n;
|
9446 | return result;
|
9447 | }
|
9448 | });
|
9449 |
|
9450 |
|
9451 | }),
|
9452 |
|
9453 | (function(module, exports, __webpack_require__) {
|
9454 |
|
9455 | module.exports = __webpack_require__(262);
|
9456 |
|
9457 | }),
|
9458 |
|
9459 | (function(module, exports, __webpack_require__) {
|
9460 |
|
9461 | var parent = __webpack_require__(263);
|
9462 |
|
9463 | module.exports = parent;
|
9464 |
|
9465 |
|
9466 | }),
|
9467 |
|
9468 | (function(module, exports, __webpack_require__) {
|
9469 |
|
9470 | __webpack_require__(264);
|
9471 | var path = __webpack_require__(10);
|
9472 |
|
9473 | module.exports = path.parseInt;
|
9474 |
|
9475 |
|
9476 | }),
|
9477 |
|
9478 | (function(module, exports, __webpack_require__) {
|
9479 |
|
9480 | var $ = __webpack_require__(4);
|
9481 | var parseIntImplementation = __webpack_require__(265);
|
9482 |
|
9483 |
|
9484 |
|
9485 | $({ global: true, forced: parseInt != parseIntImplementation }, {
|
9486 | parseInt: parseIntImplementation
|
9487 | });
|
9488 |
|
9489 |
|
9490 | }),
|
9491 |
|
9492 | (function(module, exports, __webpack_require__) {
|
9493 |
|
9494 | var global = __webpack_require__(8);
|
9495 | var trim = __webpack_require__(92).trim;
|
9496 | var whitespaces = __webpack_require__(67);
|
9497 |
|
9498 | var $parseInt = global.parseInt;
|
9499 | var hex = /^[+-]?0[Xx]/;
|
9500 | var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
|
9501 |
|
9502 |
|
9503 |
|
9504 | module.exports = FORCED ? function parseInt(string, radix) {
|
9505 | var S = trim(String(string));
|
9506 | return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
|
9507 | } : $parseInt;
|
9508 |
|
9509 |
|
9510 | }),
|
9511 |
|
9512 | (function(module, exports, __webpack_require__) {
|
9513 |
|
9514 | "use strict";
|
9515 |
|
9516 |
|
9517 |
|
9518 |
|
9519 |
|
9520 |
|
9521 | var _interopRequireDefault = __webpack_require__(0);
|
9522 |
|
9523 | var _assign = _interopRequireDefault(__webpack_require__(267));
|
9524 |
|
9525 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9526 |
|
9527 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
9528 | return mod && mod.__esModule ? mod : {
|
9529 | "default": mod
|
9530 | };
|
9531 | };
|
9532 |
|
9533 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9534 | value: true
|
9535 | });
|
9536 |
|
9537 | var menus_1 = __importDefault(__webpack_require__(272));
|
9538 |
|
9539 | var events_1 = __importDefault(__webpack_require__(273));
|
9540 |
|
9541 | var style_1 = __importDefault(__webpack_require__(122));
|
9542 |
|
9543 | var paste_1 = __importDefault(__webpack_require__(274));
|
9544 |
|
9545 | var cmd_1 = __importDefault(__webpack_require__(275));
|
9546 |
|
9547 | var image_1 = __importDefault(__webpack_require__(276));
|
9548 |
|
9549 | var text_1 = __importDefault(__webpack_require__(277));
|
9550 |
|
9551 | var lang_1 = __importDefault(__webpack_require__(278));
|
9552 |
|
9553 | var history_1 = __importDefault(__webpack_require__(279));
|
9554 |
|
9555 | var video_1 = __importDefault(__webpack_require__(280));
|
9556 |
|
9557 |
|
9558 | var defaultConfig = (0, _assign["default"])({}, menus_1["default"], events_1["default"], style_1["default"], cmd_1["default"], paste_1["default"], image_1["default"], text_1["default"], lang_1["default"], history_1["default"], video_1["default"],
|
9559 | {
|
9560 | linkCheck: function linkCheck(text, link) {
|
9561 | return true;
|
9562 | }
|
9563 | },
|
9564 | {
|
9565 | linkImgCheck: function linkImgCheck(src) {
|
9566 | return true;
|
9567 | }
|
9568 | });
|
9569 | exports["default"] = defaultConfig;
|
9570 |
|
9571 | }),
|
9572 |
|
9573 | (function(module, exports, __webpack_require__) {
|
9574 |
|
9575 | module.exports = __webpack_require__(268);
|
9576 |
|
9577 | }),
|
9578 |
|
9579 | (function(module, exports, __webpack_require__) {
|
9580 |
|
9581 | var parent = __webpack_require__(269);
|
9582 |
|
9583 | module.exports = parent;
|
9584 |
|
9585 |
|
9586 | }),
|
9587 |
|
9588 | (function(module, exports, __webpack_require__) {
|
9589 |
|
9590 | __webpack_require__(270);
|
9591 | var path = __webpack_require__(10);
|
9592 |
|
9593 | module.exports = path.Object.assign;
|
9594 |
|
9595 |
|
9596 | }),
|
9597 |
|
9598 | (function(module, exports, __webpack_require__) {
|
9599 |
|
9600 | var $ = __webpack_require__(4);
|
9601 | var assign = __webpack_require__(271);
|
9602 |
|
9603 |
|
9604 |
|
9605 | $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
9606 | assign: assign
|
9607 | });
|
9608 |
|
9609 |
|
9610 | }),
|
9611 |
|
9612 | (function(module, exports, __webpack_require__) {
|
9613 |
|
9614 | "use strict";
|
9615 |
|
9616 | var DESCRIPTORS = __webpack_require__(14);
|
9617 | var fails = __webpack_require__(12);
|
9618 | var objectKeys = __webpack_require__(57);
|
9619 | var getOwnPropertySymbolsModule = __webpack_require__(120);
|
9620 | var propertyIsEnumerableModule = __webpack_require__(55);
|
9621 | var toObject = __webpack_require__(38);
|
9622 | var IndexedObject = __webpack_require__(69);
|
9623 |
|
9624 | var nativeAssign = Object.assign;
|
9625 | var defineProperty = Object.defineProperty;
|
9626 |
|
9627 |
|
9628 |
|
9629 | module.exports = !nativeAssign || fails(function () {
|
9630 |
|
9631 | if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
|
9632 | enumerable: true,
|
9633 | get: function () {
|
9634 | defineProperty(this, 'b', {
|
9635 | value: 3,
|
9636 | enumerable: false
|
9637 | });
|
9638 | }
|
9639 | }), { b: 2 })).b !== 1) return true;
|
9640 |
|
9641 | var A = {};
|
9642 | var B = {};
|
9643 |
|
9644 | var symbol = Symbol();
|
9645 | var alphabet = 'abcdefghijklmnopqrst';
|
9646 | A[symbol] = 7;
|
9647 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
9648 | return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
9649 | }) ? function assign(target, source) {
|
9650 | var T = toObject(target);
|
9651 | var argumentsLength = arguments.length;
|
9652 | var index = 1;
|
9653 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
9654 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
9655 | while (argumentsLength > index) {
|
9656 | var S = IndexedObject(arguments[index++]);
|
9657 | var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
9658 | var length = keys.length;
|
9659 | var j = 0;
|
9660 | var key;
|
9661 | while (length > j) {
|
9662 | key = keys[j++];
|
9663 | if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
9664 | }
|
9665 | } return T;
|
9666 | } : nativeAssign;
|
9667 |
|
9668 |
|
9669 | }),
|
9670 |
|
9671 | (function(module, exports, __webpack_require__) {
|
9672 |
|
9673 | "use strict";
|
9674 |
|
9675 |
|
9676 |
|
9677 |
|
9678 |
|
9679 |
|
9680 | var _interopRequireDefault = __webpack_require__(0);
|
9681 |
|
9682 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9683 |
|
9684 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9685 | value: true
|
9686 | });
|
9687 | var SINA_PATH1 = 'http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal';
|
9688 | var SINA_PATH2 = 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal';
|
9689 |
|
9690 |
|
9691 | exports["default"] = {
|
9692 | menus: ['head', 'bold', 'fontSize',
|
9693 | 'fontName', 'italic', 'underline', 'strikeThrough', 'indent', 'lineHeight', 'foreColor', 'backColor', 'link', 'list', 'todo', 'justify', 'quote', 'emoticon', 'image', 'video', 'table', 'code', 'splitLine', 'undo', 'redo'],
|
9694 | fontNames: ['黑体', '仿宋', '楷体', '标楷体', '华文仿宋', '华文楷体', '宋体', '微软雅黑', 'Arial', 'Tahoma', 'Verdana', 'Times New Roman', 'Courier New'],
|
9695 | fontSizes: {
|
9696 | 'x-small': {
|
9697 | name: '10px',
|
9698 | value: '1'
|
9699 | },
|
9700 | small: {
|
9701 | name: '13px',
|
9702 | value: '2'
|
9703 | },
|
9704 | normal: {
|
9705 | name: '16px',
|
9706 | value: '3'
|
9707 | },
|
9708 | large: {
|
9709 | name: '18px',
|
9710 | value: '4'
|
9711 | },
|
9712 | 'x-large': {
|
9713 | name: '24px',
|
9714 | value: '5'
|
9715 | },
|
9716 | 'xx-large': {
|
9717 | name: '32px',
|
9718 | value: '6'
|
9719 | },
|
9720 | 'xxx-large': {
|
9721 | name: '48px',
|
9722 | value: '7'
|
9723 | }
|
9724 | },
|
9725 |
|
9726 |
|
9727 |
|
9728 |
|
9729 |
|
9730 |
|
9731 |
|
9732 |
|
9733 |
|
9734 |
|
9735 | colors: ['#000000', '#eeece0', '#1c487f', '#4d80bf', '#c24f4a', '#8baa4a', '#7b5ba1', '#46acc8', '#f9963b', '#ffffff'],
|
9736 |
|
9737 | languageType: ['Bash', 'C', 'C#', 'C++', 'CSS', 'Java', 'JavaScript', 'JSON', 'TypeScript', 'Plain text', 'Html', 'XML', 'SQL', 'Go', 'Kotlin', 'Lua', 'Markdown', 'PHP', 'Python', 'Shell Session', 'Ruby'],
|
9738 | languageTab: ' ',
|
9739 |
|
9740 | |
9741 |
|
9742 |
|
9743 |
|
9744 |
|
9745 | emotions: [{
|
9746 |
|
9747 | title: '默认',
|
9748 |
|
9749 | type: 'image',
|
9750 |
|
9751 | content: [{
|
9752 | alt: '[坏笑]',
|
9753 | src: SINA_PATH1 + "/50/pcmoren_huaixiao_org.png"
|
9754 | }, {
|
9755 | alt: '[舔屏]',
|
9756 | src: SINA_PATH1 + "/40/pcmoren_tian_org.png"
|
9757 | }, {
|
9758 | alt: '[污]',
|
9759 | src: SINA_PATH1 + "/3c/pcmoren_wu_org.png"
|
9760 | }]
|
9761 | }, {
|
9762 |
|
9763 | title: '新浪',
|
9764 |
|
9765 | type: 'image',
|
9766 |
|
9767 | content: [{
|
9768 | src: SINA_PATH2 + "/7a/shenshou_thumb.gif",
|
9769 | alt: '[草泥马]'
|
9770 | }, {
|
9771 | src: SINA_PATH2 + "/60/horse2_thumb.gif",
|
9772 | alt: '[神马]'
|
9773 | }, {
|
9774 | src: SINA_PATH2 + "/bc/fuyun_thumb.gif",
|
9775 | alt: '[浮云]'
|
9776 | }]
|
9777 | }, {
|
9778 |
|
9779 | title: 'emoji',
|
9780 |
|
9781 | type: 'emoji',
|
9782 |
|
9783 | content: '😀 😃 😄 😁 😆 😅 😂 😊 😇 🙂 🙃 😉 😓 😪 😴 🙄 🤔 😬 🤐'.split(/\s/)
|
9784 | }, {
|
9785 |
|
9786 | title: '手势',
|
9787 |
|
9788 | type: 'emoji',
|
9789 |
|
9790 | content: ['🙌', '👏', '👋', '👍', '👎', '👊', '✊', '️👌', '✋', '👐', '💪', '🙏', '️👆', '👇', '👈', '👉', '🖕', '🖐', '🤘']
|
9791 | }],
|
9792 | lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3'],
|
9793 | undoLimit: 20,
|
9794 | indentation: '2em'
|
9795 | };
|
9796 |
|
9797 | }),
|
9798 |
|
9799 | (function(module, exports, __webpack_require__) {
|
9800 |
|
9801 | "use strict";
|
9802 |
|
9803 |
|
9804 |
|
9805 |
|
9806 |
|
9807 |
|
9808 | var _interopRequireDefault = __webpack_require__(0);
|
9809 |
|
9810 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9811 |
|
9812 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9813 | value: true
|
9814 | });
|
9815 |
|
9816 | var const_1 = __webpack_require__(26);
|
9817 |
|
9818 |
|
9819 |
|
9820 |
|
9821 |
|
9822 |
|
9823 |
|
9824 |
|
9825 | function customAlert(alertInfo, alertType, debugInfo) {
|
9826 | window.alert(alertInfo);
|
9827 |
|
9828 | if (debugInfo) {
|
9829 | console.error('wangEditor: ' + debugInfo);
|
9830 | }
|
9831 | }
|
9832 |
|
9833 | exports["default"] = {
|
9834 | onchangeTimeout: 200,
|
9835 | onchange: const_1.EMPTY_FN,
|
9836 | onfocus: const_1.EMPTY_FN,
|
9837 | onblur: const_1.EMPTY_FN,
|
9838 | onCatalogChange: null,
|
9839 | customAlert: customAlert
|
9840 | };
|
9841 |
|
9842 | }),
|
9843 |
|
9844 | (function(module, exports, __webpack_require__) {
|
9845 |
|
9846 | "use strict";
|
9847 |
|
9848 |
|
9849 |
|
9850 |
|
9851 |
|
9852 |
|
9853 | var _interopRequireDefault = __webpack_require__(0);
|
9854 |
|
9855 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9856 |
|
9857 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9858 | value: true
|
9859 | });
|
9860 | exports["default"] = {
|
9861 |
|
9862 | pasteFilterStyle: true,
|
9863 |
|
9864 | pasteIgnoreImg: false,
|
9865 |
|
9866 |
|
9867 | pasteTextHandle: function pasteTextHandle(content) {
|
9868 |
|
9869 | return content;
|
9870 | }
|
9871 | };
|
9872 |
|
9873 | }),
|
9874 |
|
9875 | (function(module, exports, __webpack_require__) {
|
9876 |
|
9877 | "use strict";
|
9878 |
|
9879 |
|
9880 |
|
9881 |
|
9882 |
|
9883 |
|
9884 | var _interopRequireDefault = __webpack_require__(0);
|
9885 |
|
9886 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9887 |
|
9888 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9889 | value: true
|
9890 | });
|
9891 | exports["default"] = {
|
9892 | styleWithCSS: false
|
9893 | };
|
9894 |
|
9895 | }),
|
9896 |
|
9897 | (function(module, exports, __webpack_require__) {
|
9898 |
|
9899 | "use strict";
|
9900 |
|
9901 |
|
9902 |
|
9903 |
|
9904 |
|
9905 |
|
9906 | var _interopRequireDefault = __webpack_require__(0);
|
9907 |
|
9908 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9909 |
|
9910 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9911 | value: true
|
9912 | });
|
9913 |
|
9914 | var const_1 = __webpack_require__(26);
|
9915 |
|
9916 | exports["default"] = {
|
9917 |
|
9918 | showLinkImg: true,
|
9919 |
|
9920 | linkImgCallback: const_1.EMPTY_FN,
|
9921 |
|
9922 | uploadImgAccept: ['jpg', 'jpeg', 'png', 'gif', 'bmp'],
|
9923 |
|
9924 | uploadImgServer: '',
|
9925 |
|
9926 | uploadImgShowBase64: false,
|
9927 |
|
9928 | uploadImgMaxSize: 5 * 1024 * 1024,
|
9929 |
|
9930 | uploadImgMaxLength: 100,
|
9931 |
|
9932 | uploadFileName: '',
|
9933 |
|
9934 | uploadImgParams: {},
|
9935 |
|
9936 | uploadImgParamsWithUrl: false,
|
9937 |
|
9938 | uploadImgHeaders: {},
|
9939 |
|
9940 | uploadImgHooks: {},
|
9941 |
|
9942 | uploadImgTimeout: 10 * 1000,
|
9943 |
|
9944 | withCredentials: false,
|
9945 |
|
9946 | customUploadImg: null
|
9947 | };
|
9948 |
|
9949 | }),
|
9950 |
|
9951 | (function(module, exports, __webpack_require__) {
|
9952 |
|
9953 | "use strict";
|
9954 |
|
9955 |
|
9956 |
|
9957 |
|
9958 |
|
9959 |
|
9960 | var _interopRequireDefault = __webpack_require__(0);
|
9961 |
|
9962 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9963 |
|
9964 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9965 | value: true
|
9966 | });
|
9967 | exports["default"] = {
|
9968 | focus: true,
|
9969 | height: 300,
|
9970 | placeholder: '请输入正文',
|
9971 | zIndexFullScreen: 10002,
|
9972 | showFullScreen: true
|
9973 | };
|
9974 |
|
9975 | }),
|
9976 |
|
9977 | (function(module, exports, __webpack_require__) {
|
9978 |
|
9979 | "use strict";
|
9980 |
|
9981 |
|
9982 | var _interopRequireDefault = __webpack_require__(0);
|
9983 |
|
9984 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
9985 |
|
9986 | (0, _defineProperty["default"])(exports, "__esModule", {
|
9987 | value: true
|
9988 | });
|
9989 | exports["default"] = {
|
9990 | lang: 'zh-CN',
|
9991 | languages: {
|
9992 | 'zh-CN': {
|
9993 | wangEditor: {
|
9994 | 重置: '重置',
|
9995 | 插入: '插入',
|
9996 | 默认: '默认',
|
9997 | 创建: '创建',
|
9998 | 修改: '修改',
|
9999 | 如: '如',
|
10000 | 请输入正文: '请输入正文',
|
10001 | menus: {
|
10002 | title: {
|
10003 | 标题: '标题',
|
10004 | 加粗: '加粗',
|
10005 | 字号: '字号',
|
10006 | 字体: '字体',
|
10007 | 斜体: '斜体',
|
10008 | 下划线: '下划线',
|
10009 | 删除线: '删除线',
|
10010 | 缩进: '缩进',
|
10011 | 行高: '行高',
|
10012 | 文字颜色: '文字颜色',
|
10013 | 背景色: '背景色',
|
10014 | 链接: '链接',
|
10015 | 序列: '序列',
|
10016 | 对齐: '对齐',
|
10017 | 引用: '引用',
|
10018 | 表情: '表情',
|
10019 | 图片: '图片',
|
10020 | 视频: '视频',
|
10021 | 表格: '表格',
|
10022 | 代码: '代码',
|
10023 | 分割线: '分割线',
|
10024 | 恢复: '恢复',
|
10025 | 撤销: '撤销',
|
10026 | 全屏: '全屏',
|
10027 | 代办事项: '代办事项'
|
10028 | },
|
10029 | dropListMenu: {
|
10030 | 设置标题: '设置标题',
|
10031 | 背景颜色: '背景颜色',
|
10032 | 文字颜色: '文字颜色',
|
10033 | 设置字号: '设置字号',
|
10034 | 设置字体: '设置字体',
|
10035 | 设置缩进: '设置缩进',
|
10036 | 对齐方式: '对齐方式',
|
10037 | 设置行高: '设置行高',
|
10038 | 序列: '序列',
|
10039 | head: {
|
10040 | 正文: '正文'
|
10041 | },
|
10042 | indent: {
|
10043 | 增加缩进: '增加缩进',
|
10044 | 减少缩进: '减少缩进'
|
10045 | },
|
10046 | justify: {
|
10047 | 靠左: '靠左',
|
10048 | 居中: '居中',
|
10049 | 靠右: '靠右',
|
10050 | 两端: '两端'
|
10051 | },
|
10052 | list: {
|
10053 | 无序列表: '无序列表',
|
10054 | 有序列表: '有序列表'
|
10055 | }
|
10056 | },
|
10057 | panelMenus: {
|
10058 | emoticon: {
|
10059 | 默认: '默认',
|
10060 | 新浪: '新浪',
|
10061 | emoji: 'emoji',
|
10062 | 手势: '手势'
|
10063 | },
|
10064 | image: {
|
10065 | 图片链接: '图片链接',
|
10066 | 上传图片: '上传图片',
|
10067 | 网络图片: '网络图片'
|
10068 | },
|
10069 | link: {
|
10070 | 链接: '链接',
|
10071 | 链接文字: '链接文字',
|
10072 | 取消链接: '取消链接',
|
10073 | 查看链接: '查看链接'
|
10074 | },
|
10075 | video: {
|
10076 | 插入视频: '插入视频'
|
10077 | },
|
10078 | table: {
|
10079 | 行: '行',
|
10080 | 列: '列',
|
10081 | 的: '的',
|
10082 | 表格: '表格',
|
10083 | 添加行: '添加行',
|
10084 | 删除行: '删除行',
|
10085 | 添加列: '添加列',
|
10086 | 删除列: '删除列',
|
10087 | 设置表头: '设置表头',
|
10088 | 取消表头: '取消表头',
|
10089 | 插入表格: '插入表格',
|
10090 | 删除表格: '删除表格'
|
10091 | },
|
10092 | code: {
|
10093 | 删除代码: '删除代码',
|
10094 | 修改代码: '修改代码',
|
10095 | 插入代码: '插入代码'
|
10096 | }
|
10097 | }
|
10098 | },
|
10099 | validate: {
|
10100 | 张图片: '张图片',
|
10101 | 大于: '大于',
|
10102 | 图片链接: '图片链接',
|
10103 | 不是图片: '不是图片',
|
10104 | 返回结果: '返回结果',
|
10105 | 上传图片超时: '上传图片超时',
|
10106 | 上传图片错误: '上传图片错误',
|
10107 | 上传图片失败: '上传图片失败',
|
10108 | 插入图片错误: '插入图片错误',
|
10109 | 一次最多上传: '一次最多上传',
|
10110 | 下载链接失败: '下载链接失败',
|
10111 | 图片验证未通过: '图片验证未通过',
|
10112 | 服务器返回状态: '服务器返回状态',
|
10113 | 上传图片返回结果错误: '上传图片返回结果错误',
|
10114 | 请替换为支持的图片类型: '请替换为支持的图片类型',
|
10115 | 您插入的网络图片无法识别: '您插入的网络图片无法识别',
|
10116 | 您刚才插入的图片链接未通过编辑器校验: '您刚才插入的图片链接未通过编辑器校验'
|
10117 | }
|
10118 | }
|
10119 | },
|
10120 | en: {
|
10121 | wangEditor: {
|
10122 | 重置: 'reset',
|
10123 | 插入: 'insert',
|
10124 | 默认: 'default',
|
10125 | 创建: 'create',
|
10126 | 修改: 'edit',
|
10127 | 如: 'like',
|
10128 | 请输入正文: 'please enter the text',
|
10129 | menus: {
|
10130 | title: {
|
10131 | 标题: 'head',
|
10132 | 加粗: 'bold',
|
10133 | 字号: 'font size',
|
10134 | 字体: 'font family',
|
10135 | 斜体: 'italic',
|
10136 | 下划线: 'underline',
|
10137 | 删除线: 'strikethrough',
|
10138 | 缩进: 'indent',
|
10139 | 行高: 'line heihgt',
|
10140 | 文字颜色: 'font color',
|
10141 | 背景色: 'background',
|
10142 | 链接: 'link',
|
10143 | 序列: 'numbered list',
|
10144 | 对齐: 'align',
|
10145 | 引用: 'quote',
|
10146 | 表情: 'emoticons',
|
10147 | 图片: 'image',
|
10148 | 视频: 'media',
|
10149 | 表格: 'table',
|
10150 | 代码: 'code',
|
10151 | 分割线: 'split line',
|
10152 | 恢复: 'undo',
|
10153 | 撤销: 'redo',
|
10154 | 全屏: 'fullscreen',
|
10155 | 代办事项: 'todo'
|
10156 | },
|
10157 | dropListMenu: {
|
10158 | 设置标题: 'title',
|
10159 | 背景颜色: 'background',
|
10160 | 文字颜色: 'font color',
|
10161 | 设置字号: 'font size',
|
10162 | 设置字体: 'font family',
|
10163 | 设置缩进: 'indent',
|
10164 | 对齐方式: 'align',
|
10165 | 设置行高: 'line heihgt',
|
10166 | 序列: 'list',
|
10167 | head: {
|
10168 | 正文: 'text'
|
10169 | },
|
10170 | indent: {
|
10171 | 增加缩进: 'indent',
|
10172 | 减少缩进: 'outdent'
|
10173 | },
|
10174 | justify: {
|
10175 | 靠左: 'left',
|
10176 | 居中: 'center',
|
10177 | 靠右: 'right',
|
10178 | 两端: 'justify'
|
10179 | },
|
10180 | list: {
|
10181 | 无序列表: 'unordered',
|
10182 | 有序列表: 'ordered'
|
10183 | }
|
10184 | },
|
10185 | panelMenus: {
|
10186 | emoticon: {
|
10187 | 默认: 'default',
|
10188 | 新浪: 'sina',
|
10189 | emoji: 'emoji',
|
10190 | 手势: 'gesture'
|
10191 | },
|
10192 | image: {
|
10193 | 图片链接: 'image link',
|
10194 | 上传图片: 'upload image',
|
10195 | 网络图片: 'network image'
|
10196 | },
|
10197 | link: {
|
10198 | 链接: 'link',
|
10199 | 链接文字: 'link text',
|
10200 | 取消链接: 'unlink',
|
10201 | 查看链接: 'view links'
|
10202 | },
|
10203 | video: {
|
10204 | 插入视频: 'insert video'
|
10205 | },
|
10206 | table: {
|
10207 | 行: 'rows',
|
10208 | 列: 'columns',
|
10209 | 的: ' ',
|
10210 | 表格: 'table',
|
10211 | 添加行: 'insert row',
|
10212 | 删除行: 'delete row',
|
10213 | 添加列: 'insert column',
|
10214 | 删除列: 'delete column',
|
10215 | 设置表头: 'set header',
|
10216 | 取消表头: 'cancel header',
|
10217 | 插入表格: 'insert table',
|
10218 | 删除表格: 'delete table'
|
10219 | },
|
10220 | code: {
|
10221 | 删除代码: 'delete code',
|
10222 | 修改代码: 'edit code',
|
10223 | 插入代码: 'insert code'
|
10224 | }
|
10225 | }
|
10226 | },
|
10227 | validate: {
|
10228 | 张图片: 'images',
|
10229 | 大于: 'greater than',
|
10230 | 图片链接: 'image link',
|
10231 | 不是图片: 'is not image',
|
10232 | 返回结果: 'return results',
|
10233 | 上传图片超时: 'upload image timeout',
|
10234 | 上传图片错误: 'upload image error',
|
10235 | 上传图片失败: 'upload image failed',
|
10236 | 插入图片错误: 'insert image error',
|
10237 | 一次最多上传: 'once most at upload',
|
10238 | 下载链接失败: 'download link failed',
|
10239 | 图片验证未通过: 'image validate failed',
|
10240 | 服务器返回状态: 'server return status',
|
10241 | 上传图片返回结果错误: 'upload image return results error',
|
10242 | 请替换为支持的图片类型: 'please replace with a supported image type',
|
10243 | 您插入的网络图片无法识别: 'the network picture you inserted is not recognized',
|
10244 | 您刚才插入的图片链接未通过编辑器校验: 'the image link you just inserted did not pass the editor verification'
|
10245 | }
|
10246 | }
|
10247 | }
|
10248 | }
|
10249 | };
|
10250 |
|
10251 | }),
|
10252 |
|
10253 | (function(module, exports, __webpack_require__) {
|
10254 |
|
10255 | "use strict";
|
10256 |
|
10257 |
|
10258 |
|
10259 |
|
10260 |
|
10261 |
|
10262 | var _interopRequireDefault = __webpack_require__(0);
|
10263 |
|
10264 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
10265 |
|
10266 | (0, _defineProperty["default"])(exports, "__esModule", {
|
10267 | value: true
|
10268 | });
|
10269 |
|
10270 | var util_1 = __webpack_require__(7);
|
10271 |
|
10272 |
|
10273 |
|
10274 |
|
10275 |
|
10276 | function compatibleMode() {
|
10277 | if (util_1.UA.isIE() || util_1.UA.isOldEdge) {
|
10278 | return true;
|
10279 | }
|
10280 |
|
10281 | return false;
|
10282 | }
|
10283 |
|
10284 | exports["default"] = {
|
10285 | compatibleMode: compatibleMode,
|
10286 | historyMaxSize: 30
|
10287 | };
|
10288 |
|
10289 | }),
|
10290 |
|
10291 | (function(module, exports, __webpack_require__) {
|
10292 |
|
10293 | "use strict";
|
10294 |
|
10295 |
|
10296 |
|
10297 |
|
10298 |
|
10299 |
|
10300 | var _interopRequireDefault = __webpack_require__(0);
|
10301 |
|
10302 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
10303 |
|
10304 | (0, _defineProperty["default"])(exports, "__esModule", {
|
10305 | value: true
|
10306 | });
|
10307 |
|
10308 | var const_1 = __webpack_require__(26);
|
10309 |
|
10310 | exports["default"] = {
|
10311 |
|
10312 | onlineVideoCheck: function onlineVideoCheck(video) {
|
10313 | return true;
|
10314 | },
|
10315 |
|
10316 | onlineVideoCallback: const_1.EMPTY_FN
|
10317 | };
|
10318 |
|
10319 | }),
|
10320 |
|
10321 | (function(module, exports, __webpack_require__) {
|
10322 |
|
10323 | "use strict";
|
10324 |
|
10325 |
|
10326 | var _interopRequireDefault = __webpack_require__(0);
|
10327 |
|
10328 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
10329 |
|
10330 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
10331 |
|
10332 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
10333 | return mod && mod.__esModule ? mod : {
|
10334 | "default": mod
|
10335 | };
|
10336 | };
|
10337 |
|
10338 | (0, _defineProperty["default"])(exports, "__esModule", {
|
10339 | value: true
|
10340 | });
|
10341 |
|
10342 |
|
10343 |
|
10344 |
|
10345 |
|
10346 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
10347 |
|
10348 | var util_1 = __webpack_require__(7);
|
10349 |
|
10350 | var index_1 = __importDefault(__webpack_require__(282));
|
10351 |
|
10352 | var SelectionAndRange =
|
10353 |
|
10354 | function () {
|
10355 | function SelectionAndRange(editor) {
|
10356 | this._currentRange = null;
|
10357 | this.editor = editor;
|
10358 | }
|
10359 | |
10360 |
|
10361 |
|
10362 |
|
10363 |
|
10364 | SelectionAndRange.prototype.getRange = function () {
|
10365 | return this._currentRange;
|
10366 | };
|
10367 | |
10368 |
|
10369 |
|
10370 |
|
10371 |
|
10372 |
|
10373 | SelectionAndRange.prototype.saveRange = function (_range) {
|
10374 | if (_range) {
|
10375 |
|
10376 | this._currentRange = _range;
|
10377 | return;
|
10378 | }
|
10379 |
|
10380 |
|
10381 | var selection = window.getSelection();
|
10382 |
|
10383 | if (selection.rangeCount === 0) {
|
10384 | return;
|
10385 | }
|
10386 |
|
10387 | var range = selection.getRangeAt(0);
|
10388 |
|
10389 | var $containerElem = this.getSelectionContainerElem(range);
|
10390 |
|
10391 | if (!$containerElem) {
|
10392 |
|
10393 | return;
|
10394 | }
|
10395 |
|
10396 | if ($containerElem.attr('contenteditable') === 'false' || $containerElem.parentUntil('[contenteditable=false]')) {
|
10397 |
|
10398 |
|
10399 | return;
|
10400 | }
|
10401 |
|
10402 | var editor = this.editor;
|
10403 | var $textElem = editor.$textElem;
|
10404 |
|
10405 | if ($textElem.isContain($containerElem)) {
|
10406 | if ($textElem.elems[0] === $containerElem.elems[0]) {
|
10407 | var _context;
|
10408 |
|
10409 | if ((0, _trim["default"])(_context = $textElem.html()).call(_context) === '<p><br></p>') {
|
10410 | var $children = $textElem.children();
|
10411 | var $last = $children === null || $children === void 0 ? void 0 : $children.last();
|
10412 | editor.selection.createRangeByElem($last, true, true);
|
10413 | editor.selection.restoreSelection();
|
10414 | }
|
10415 | }
|
10416 |
|
10417 |
|
10418 | this._currentRange = range;
|
10419 | }
|
10420 | };
|
10421 | |
10422 |
|
10423 |
|
10424 |
|
10425 |
|
10426 |
|
10427 | SelectionAndRange.prototype.collapseRange = function (toStart) {
|
10428 | if (toStart === void 0) {
|
10429 | toStart = false;
|
10430 | }
|
10431 |
|
10432 | var range = this._currentRange;
|
10433 |
|
10434 | if (range) {
|
10435 | range.collapse(toStart);
|
10436 | }
|
10437 | };
|
10438 | |
10439 |
|
10440 |
|
10441 |
|
10442 |
|
10443 | SelectionAndRange.prototype.getSelectionText = function () {
|
10444 | var range = this._currentRange;
|
10445 |
|
10446 | if (range) {
|
10447 | return range.toString();
|
10448 | } else {
|
10449 | return '';
|
10450 | }
|
10451 | };
|
10452 | |
10453 |
|
10454 |
|
10455 |
|
10456 |
|
10457 |
|
10458 | SelectionAndRange.prototype.getSelectionContainerElem = function (range) {
|
10459 | var r;
|
10460 | r = range || this._currentRange;
|
10461 | var elem;
|
10462 |
|
10463 | if (r) {
|
10464 | elem = r.commonAncestorContainer;
|
10465 | return dom_core_1["default"](elem.nodeType === 1 ? elem : elem.parentNode);
|
10466 | }
|
10467 | };
|
10468 | |
10469 |
|
10470 |
|
10471 |
|
10472 |
|
10473 |
|
10474 | SelectionAndRange.prototype.getSelectionStartElem = function (range) {
|
10475 | var r;
|
10476 | r = range || this._currentRange;
|
10477 | var elem;
|
10478 |
|
10479 | if (r) {
|
10480 | elem = r.startContainer;
|
10481 | return dom_core_1["default"](elem.nodeType === 1 ? elem : elem.parentNode);
|
10482 | }
|
10483 | };
|
10484 | |
10485 |
|
10486 |
|
10487 |
|
10488 |
|
10489 |
|
10490 | SelectionAndRange.prototype.getSelectionEndElem = function (range) {
|
10491 | var r;
|
10492 | r = range || this._currentRange;
|
10493 | var elem;
|
10494 |
|
10495 | if (r) {
|
10496 | elem = r.endContainer;
|
10497 | return dom_core_1["default"](elem.nodeType === 1 ? elem : elem.parentNode);
|
10498 | }
|
10499 | };
|
10500 | |
10501 |
|
10502 |
|
10503 |
|
10504 |
|
10505 | SelectionAndRange.prototype.isSelectionEmpty = function () {
|
10506 | var range = this._currentRange;
|
10507 |
|
10508 | if (range && range.startContainer) {
|
10509 | if (range.startContainer === range.endContainer) {
|
10510 | if (range.startOffset === range.endOffset) {
|
10511 | return true;
|
10512 | }
|
10513 | }
|
10514 | }
|
10515 |
|
10516 | return false;
|
10517 | };
|
10518 | |
10519 |
|
10520 |
|
10521 |
|
10522 |
|
10523 | SelectionAndRange.prototype.restoreSelection = function () {
|
10524 | var selection = window.getSelection();
|
10525 | var r = this._currentRange;
|
10526 |
|
10527 | if (selection && r) {
|
10528 | selection.removeAllRanges();
|
10529 | selection.addRange(r);
|
10530 | }
|
10531 | };
|
10532 | |
10533 |
|
10534 |
|
10535 |
|
10536 |
|
10537 | SelectionAndRange.prototype.createEmptyRange = function () {
|
10538 | var editor = this.editor;
|
10539 | var range = this.getRange();
|
10540 | var $elem;
|
10541 |
|
10542 | if (!range) {
|
10543 |
|
10544 | return;
|
10545 | }
|
10546 |
|
10547 | if (!this.isSelectionEmpty()) {
|
10548 |
|
10549 | return;
|
10550 | }
|
10551 |
|
10552 | try {
|
10553 |
|
10554 | if (util_1.UA.isWebkit()) {
|
10555 |
|
10556 | editor.cmd["do"]('insertHTML', '​');
|
10557 |
|
10558 | range.setEnd(range.endContainer, range.endOffset + 1);
|
10559 |
|
10560 | this.saveRange(range);
|
10561 | } else {
|
10562 | $elem = dom_core_1["default"]('<strong>​</strong>');
|
10563 | editor.cmd["do"]('insertElem', $elem);
|
10564 | this.createRangeByElem($elem, true);
|
10565 | }
|
10566 | } catch (ex) {
|
10567 | }
|
10568 | };
|
10569 | |
10570 |
|
10571 |
|
10572 |
|
10573 |
|
10574 |
|
10575 |
|
10576 |
|
10577 | SelectionAndRange.prototype.createRangeByElem = function ($elem, toStart, isContent) {
|
10578 | if (!$elem.length) {
|
10579 | return;
|
10580 | }
|
10581 |
|
10582 | var elem = $elem.elems[0];
|
10583 | var range = document.createRange();
|
10584 |
|
10585 | if (isContent) {
|
10586 | range.selectNodeContents(elem);
|
10587 | } else {
|
10588 |
|
10589 | range.selectNode(elem);
|
10590 | }
|
10591 |
|
10592 | if (toStart != null) {
|
10593 |
|
10594 | range.collapse(toStart);
|
10595 | }
|
10596 |
|
10597 |
|
10598 | this.saveRange(range);
|
10599 | };
|
10600 | |
10601 |
|
10602 |
|
10603 |
|
10604 |
|
10605 |
|
10606 | SelectionAndRange.prototype.getSelectionRangeTopNodes = function (editor) {
|
10607 | var item = new index_1["default"](editor);
|
10608 | item.init();
|
10609 | return item.getSelectionNodes();
|
10610 | };
|
10611 | |
10612 |
|
10613 |
|
10614 |
|
10615 |
|
10616 |
|
10617 |
|
10618 |
|
10619 |
|
10620 | SelectionAndRange.prototype.moveCursor = function (node, position) {
|
10621 | var _a;
|
10622 |
|
10623 | var range = this.getRange();
|
10624 |
|
10625 | var len = node.nodeType === 3 ? (_a = node.nodeValue) === null || _a === void 0 ? void 0 : _a.length : node.childNodes.length;
|
10626 |
|
10627 | if ((util_1.UA.isFirefox || util_1.UA.isIE()) && len !== 0) {
|
10628 |
|
10629 | if (node.nodeType === 3 || node.childNodes[len - 1].nodeName === 'BR') {
|
10630 | len = len - 1;
|
10631 | }
|
10632 | }
|
10633 |
|
10634 | var pos = position !== null && position !== void 0 ? position : len;
|
10635 |
|
10636 | if (!range) {
|
10637 | return;
|
10638 | }
|
10639 |
|
10640 | if (node) {
|
10641 | range.setStart(node, pos);
|
10642 | range.setEnd(node, pos);
|
10643 | this.restoreSelection();
|
10644 | }
|
10645 | };
|
10646 | |
10647 |
|
10648 |
|
10649 |
|
10650 |
|
10651 | SelectionAndRange.prototype.getCursorPos = function () {
|
10652 | var selection = window.getSelection();
|
10653 | return selection === null || selection === void 0 ? void 0 : selection.anchorOffset;
|
10654 | };
|
10655 |
|
10656 | return SelectionAndRange;
|
10657 | }();
|
10658 |
|
10659 | exports["default"] = SelectionAndRange;
|
10660 |
|
10661 | }),
|
10662 |
|
10663 | (function(module, exports, __webpack_require__) {
|
10664 |
|
10665 | "use strict";
|
10666 |
|
10667 |
|
10668 |
|
10669 |
|
10670 |
|
10671 |
|
10672 | var _interopRequireDefault = __webpack_require__(0);
|
10673 |
|
10674 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
10675 |
|
10676 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
10677 | return mod && mod.__esModule ? mod : {
|
10678 | "default": mod
|
10679 | };
|
10680 | };
|
10681 |
|
10682 | (0, _defineProperty["default"])(exports, "__esModule", {
|
10683 | value: true
|
10684 | });
|
10685 |
|
10686 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
10687 |
|
10688 |
|
10689 | var SelectionRangeTopNodes =
|
10690 |
|
10691 | function () {
|
10692 | |
10693 |
|
10694 |
|
10695 |
|
10696 | function SelectionRangeTopNodes(editor) {
|
10697 |
|
10698 | this.editor = editor;
|
10699 | this.$nodeList = [];
|
10700 | this.$startElem = dom_core_1["default"](editor.selection.getSelectionStartElem()).getNodeTop(this.editor);
|
10701 | this.$endElem = dom_core_1["default"](editor.selection.getSelectionEndElem()).getNodeTop(this.editor);
|
10702 | }
|
10703 | |
10704 |
|
10705 |
|
10706 |
|
10707 |
|
10708 | SelectionRangeTopNodes.prototype.init = function () {
|
10709 | this.recordSelectionNodes(dom_core_1["default"](this.$startElem));
|
10710 | };
|
10711 | |
10712 |
|
10713 |
|
10714 |
|
10715 |
|
10716 |
|
10717 | SelectionRangeTopNodes.prototype.addNodeList = function ($node) {
|
10718 | this.$nodeList.push(dom_core_1["default"]($node));
|
10719 | };
|
10720 | |
10721 |
|
10722 |
|
10723 |
|
10724 |
|
10725 |
|
10726 | SelectionRangeTopNodes.prototype.isEndElem = function ($node) {
|
10727 | var _a;
|
10728 |
|
10729 | return (_a = this.$endElem) === null || _a === void 0 ? void 0 : _a.equal($node);
|
10730 | };
|
10731 | |
10732 |
|
10733 |
|
10734 |
|
10735 |
|
10736 |
|
10737 | SelectionRangeTopNodes.prototype.getNextSibling = function ($node) {
|
10738 | return dom_core_1["default"]($node.elems[0].nextSibling);
|
10739 | };
|
10740 | |
10741 |
|
10742 |
|
10743 |
|
10744 |
|
10745 |
|
10746 | SelectionRangeTopNodes.prototype.recordSelectionNodes = function ($node) {
|
10747 | var $elem = $node.getNodeTop(this.editor);
|
10748 |
|
10749 | if ($elem.length > 0) {
|
10750 | this.addNodeList($elem);
|
10751 |
|
10752 | if (!this.isEndElem($elem)) {
|
10753 | this.recordSelectionNodes(this.getNextSibling($elem));
|
10754 | }
|
10755 | }
|
10756 | };
|
10757 | |
10758 |
|
10759 |
|
10760 |
|
10761 |
|
10762 | SelectionRangeTopNodes.prototype.getSelectionNodes = function () {
|
10763 | return this.$nodeList;
|
10764 | };
|
10765 |
|
10766 | return SelectionRangeTopNodes;
|
10767 | }();
|
10768 |
|
10769 |
|
10770 |
|
10771 |
|
10772 |
|
10773 | exports["default"] = SelectionRangeTopNodes;
|
10774 |
|
10775 | }),
|
10776 |
|
10777 | (function(module, exports, __webpack_require__) {
|
10778 |
|
10779 | "use strict";
|
10780 |
|
10781 |
|
10782 |
|
10783 |
|
10784 |
|
10785 |
|
10786 | var _interopRequireDefault = __webpack_require__(0);
|
10787 |
|
10788 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
10789 |
|
10790 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
10791 | return mod && mod.__esModule ? mod : {
|
10792 | "default": mod
|
10793 | };
|
10794 | };
|
10795 |
|
10796 | (0, _defineProperty["default"])(exports, "__esModule", {
|
10797 | value: true
|
10798 | });
|
10799 |
|
10800 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
10801 |
|
10802 | var Command =
|
10803 |
|
10804 | function () {
|
10805 | function Command(editor) {
|
10806 | this.editor = editor;
|
10807 | }
|
10808 | |
10809 |
|
10810 |
|
10811 |
|
10812 |
|
10813 |
|
10814 |
|
10815 | Command.prototype["do"] = function (name, value) {
|
10816 | var editor = this.editor;
|
10817 |
|
10818 | if (editor.config.styleWithCSS) {
|
10819 | document.execCommand('styleWithCSS', false, 'true');
|
10820 | }
|
10821 |
|
10822 | var selection = editor.selection;
|
10823 |
|
10824 | if (!selection.getRange()) {
|
10825 | return;
|
10826 | }
|
10827 |
|
10828 |
|
10829 | selection.restoreSelection();
|
10830 |
|
10831 | switch (name) {
|
10832 | case 'insertHTML':
|
10833 | this.insertHTML(value);
|
10834 | break;
|
10835 |
|
10836 | case 'insertElem':
|
10837 | this.insertElem(value);
|
10838 | break;
|
10839 |
|
10840 | default:
|
10841 |
|
10842 | this.execCommand(name, value);
|
10843 | break;
|
10844 | }
|
10845 |
|
10846 |
|
10847 | editor.menus.changeActive();
|
10848 |
|
10849 | selection.saveRange();
|
10850 | selection.restoreSelection();
|
10851 | };
|
10852 | |
10853 |
|
10854 |
|
10855 |
|
10856 |
|
10857 |
|
10858 | Command.prototype.insertHTML = function (html) {
|
10859 | var editor = this.editor;
|
10860 | var range = editor.selection.getRange();
|
10861 | if (range == null) return;
|
10862 |
|
10863 | if (this.queryCommandSupported('insertHTML')) {
|
10864 |
|
10865 | this.execCommand('insertHTML', html);
|
10866 | } else if (range.insertNode) {
|
10867 |
|
10868 | range.deleteContents();
|
10869 | range.insertNode(dom_core_1["default"](html).elems[0]);
|
10870 | editor.selection.collapseRange();
|
10871 | }
|
10872 |
|
10873 |
|
10874 |
|
10875 |
|
10876 | };
|
10877 | |
10878 |
|
10879 |
|
10880 |
|
10881 |
|
10882 |
|
10883 | Command.prototype.insertElem = function ($elem) {
|
10884 | var editor = this.editor;
|
10885 | var range = editor.selection.getRange();
|
10886 | if (range == null) return;
|
10887 |
|
10888 | if (range.insertNode) {
|
10889 | range.deleteContents();
|
10890 | range.insertNode($elem.elems[0]);
|
10891 | }
|
10892 | };
|
10893 | |
10894 |
|
10895 |
|
10896 |
|
10897 |
|
10898 |
|
10899 |
|
10900 | Command.prototype.execCommand = function (name, value) {
|
10901 | document.execCommand(name, false, value);
|
10902 | };
|
10903 | |
10904 |
|
10905 |
|
10906 |
|
10907 |
|
10908 |
|
10909 | Command.prototype.queryCommandValue = function (name) {
|
10910 | return document.queryCommandValue(name);
|
10911 | };
|
10912 | |
10913 |
|
10914 |
|
10915 |
|
10916 |
|
10917 |
|
10918 | Command.prototype.queryCommandState = function (name) {
|
10919 | return document.queryCommandState(name);
|
10920 | };
|
10921 | |
10922 |
|
10923 |
|
10924 |
|
10925 |
|
10926 |
|
10927 | Command.prototype.queryCommandSupported = function (name) {
|
10928 | return document.queryCommandSupported(name);
|
10929 | };
|
10930 |
|
10931 | return Command;
|
10932 | }();
|
10933 |
|
10934 | exports["default"] = Command;
|
10935 |
|
10936 | }),
|
10937 |
|
10938 | (function(module, exports, __webpack_require__) {
|
10939 |
|
10940 | "use strict";
|
10941 |
|
10942 |
|
10943 |
|
10944 |
|
10945 |
|
10946 |
|
10947 | var _interopRequireDefault = __webpack_require__(0);
|
10948 |
|
10949 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
10950 |
|
10951 | var _indexOf = _interopRequireDefault(__webpack_require__(54));
|
10952 |
|
10953 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
10954 |
|
10955 | var _find = _interopRequireDefault(__webpack_require__(30));
|
10956 |
|
10957 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
10958 |
|
10959 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
10960 | return mod && mod.__esModule ? mod : {
|
10961 | "default": mod
|
10962 | };
|
10963 | };
|
10964 |
|
10965 | (0, _defineProperty["default"])(exports, "__esModule", {
|
10966 | value: true
|
10967 | });
|
10968 |
|
10969 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
10970 |
|
10971 | var index_1 = __importDefault(__webpack_require__(289));
|
10972 |
|
10973 | var util_1 = __webpack_require__(7);
|
10974 |
|
10975 | var getChildrenJSON_1 = __importDefault(__webpack_require__(301));
|
10976 |
|
10977 | var getHtmlByNodeList_1 = __importDefault(__webpack_require__(302));
|
10978 |
|
10979 | var Text =
|
10980 |
|
10981 | function () {
|
10982 | function Text(editor) {
|
10983 | this.editor = editor;
|
10984 | this.eventHooks = {
|
10985 | changeEvents: [],
|
10986 | dropEvents: [],
|
10987 | clickEvents: [],
|
10988 | keyupEvents: [],
|
10989 | tabUpEvents: [],
|
10990 | tabDownEvents: [],
|
10991 | enterUpEvents: [],
|
10992 | enterDownEvents: [],
|
10993 | deleteUpEvents: [],
|
10994 | deleteDownEvents: [],
|
10995 | pasteEvents: [],
|
10996 | linkClickEvents: [],
|
10997 | codeClickEvents: [],
|
10998 | textScrollEvents: [],
|
10999 | toolbarClickEvents: [],
|
11000 | imgClickEvents: [],
|
11001 | imgDragBarMouseDownEvents: [],
|
11002 | tableClickEvents: [],
|
11003 | menuClickEvents: [],
|
11004 | dropListMenuHoverEvents: [],
|
11005 | splitLineEvents: []
|
11006 | };
|
11007 | }
|
11008 | |
11009 |
|
11010 |
|
11011 |
|
11012 |
|
11013 | Text.prototype.init = function () {
|
11014 |
|
11015 | this._saveRange();
|
11016 |
|
11017 |
|
11018 | this._bindEventHooks();
|
11019 |
|
11020 |
|
11021 | index_1["default"](this);
|
11022 | };
|
11023 | |
11024 |
|
11025 |
|
11026 |
|
11027 |
|
11028 | Text.prototype.togglePlaceholder = function () {
|
11029 | var _context;
|
11030 |
|
11031 | var html = this.html();
|
11032 | var $placeholder = (0, _find["default"])(_context = this.editor.$textContainerElem).call(_context, '.placeholder');
|
11033 | $placeholder.hide();
|
11034 | if (!html || html === ' ') $placeholder.show();
|
11035 | };
|
11036 | |
11037 |
|
11038 |
|
11039 |
|
11040 |
|
11041 | Text.prototype.clear = function () {
|
11042 | this.html('<p><br></p>');
|
11043 | };
|
11044 | |
11045 |
|
11046 |
|
11047 |
|
11048 |
|
11049 |
|
11050 | Text.prototype.html = function (val) {
|
11051 | var editor = this.editor;
|
11052 | var $textElem = editor.$textElem;
|
11053 |
|
11054 | if (val == null) {
|
11055 | var html = $textElem.html();
|
11056 |
|
11057 | html = html.replace(/\u200b/gm, '');
|
11058 | html = html.replace(/<p><\/p>/gim, '');
|
11059 |
|
11060 | html = html.replace(/<p><br\/?><\/p>$/gim, '');
|
11061 |
|
11062 | |
11063 |
|
11064 |
|
11065 |
|
11066 |
|
11067 |
|
11068 |
|
11069 |
|
11070 |
|
11071 | |
11072 |
|
11073 |
|
11074 |
|
11075 |
|
11076 |
|
11077 |
|
11078 |
|
11079 | return html;
|
11080 | }
|
11081 |
|
11082 |
|
11083 | val = (0, _trim["default"])(val).call(val);
|
11084 |
|
11085 | if (val === '') {
|
11086 | val = "<p><br></p>";
|
11087 | }
|
11088 |
|
11089 | if ((0, _indexOf["default"])(val).call(val, '<') !== 0) {
|
11090 |
|
11091 | val = "<p>" + val + "</p>";
|
11092 | }
|
11093 |
|
11094 | $textElem.html(val);
|
11095 |
|
11096 | editor.initSelection();
|
11097 | };
|
11098 | |
11099 |
|
11100 |
|
11101 |
|
11102 |
|
11103 |
|
11104 | Text.prototype.setJSON = function (nodeList) {
|
11105 | var html = getHtmlByNodeList_1["default"](nodeList).children();
|
11106 | var editor = this.editor;
|
11107 | var $textElem = editor.$textElem;
|
11108 |
|
11109 | if (!html) return;
|
11110 |
|
11111 | $textElem.replaceChildAll(html);
|
11112 | };
|
11113 | |
11114 |
|
11115 |
|
11116 |
|
11117 |
|
11118 | Text.prototype.getJSON = function () {
|
11119 | var editor = this.editor;
|
11120 | var $textElem = editor.$textElem;
|
11121 | return getChildrenJSON_1["default"]($textElem);
|
11122 | };
|
11123 |
|
11124 | Text.prototype.text = function (val) {
|
11125 | var editor = this.editor;
|
11126 | var $textElem = editor.$textElem;
|
11127 |
|
11128 | if (val == null) {
|
11129 | var text = $textElem.text();
|
11130 |
|
11131 | text = text.replace(/\u200b/gm, '');
|
11132 | return text;
|
11133 | }
|
11134 |
|
11135 |
|
11136 | $textElem.text("<p>" + val + "</p>");
|
11137 |
|
11138 | editor.initSelection();
|
11139 | };
|
11140 | |
11141 |
|
11142 |
|
11143 |
|
11144 |
|
11145 |
|
11146 | Text.prototype.append = function (html) {
|
11147 | var editor = this.editor;
|
11148 | var $textElem = editor.$textElem;
|
11149 |
|
11150 | if ((0, _indexOf["default"])(html).call(html, '<') !== 0) {
|
11151 |
|
11152 | html = "<p>" + html + "</p>";
|
11153 | }
|
11154 |
|
11155 | $textElem.append(dom_core_1["default"](html));
|
11156 |
|
11157 | editor.initSelection();
|
11158 | };
|
11159 | |
11160 |
|
11161 |
|
11162 |
|
11163 |
|
11164 | Text.prototype._saveRange = function () {
|
11165 | var editor = this.editor;
|
11166 | var $textElem = editor.$textElem;
|
11167 |
|
11168 | function saveRange() {
|
11169 |
|
11170 | editor.selection.saveRange();
|
11171 |
|
11172 | editor.menus.changeActive();
|
11173 | }
|
11174 |
|
11175 |
|
11176 | $textElem.on('keyup', saveRange);
|
11177 |
|
11178 | function onceClickSaveRange() {
|
11179 | saveRange();
|
11180 | $textElem.off('click', onceClickSaveRange);
|
11181 | }
|
11182 |
|
11183 | $textElem.on('click', onceClickSaveRange);
|
11184 | $textElem.on('mousedown', function () {
|
11185 |
|
11186 | $textElem.on('mouseleave', saveRange);
|
11187 | });
|
11188 | $textElem.on('mouseup', function () {
|
11189 | var selection = editor.selection;
|
11190 | var range = selection.getRange();
|
11191 | if (range == null) return;
|
11192 | var startOffset = range.startOffset,
|
11193 | endOffset = range.endOffset;
|
11194 | var endContainer = range === null || range === void 0 ? void 0 : range.endContainer;
|
11195 |
|
11196 | if (startOffset !== endOffset && endContainer != null) {
|
11197 | range === null || range === void 0 ? void 0 : range.setStart(endContainer, endOffset);
|
11198 | }
|
11199 |
|
11200 | saveRange();
|
11201 |
|
11202 | $textElem.off('mouseleave', saveRange);
|
11203 | });
|
11204 | };
|
11205 | |
11206 |
|
11207 |
|
11208 |
|
11209 |
|
11210 | Text.prototype._bindEventHooks = function () {
|
11211 | var editor = this.editor;
|
11212 | var $textElem = editor.$textElem;
|
11213 | var eventHooks = this.eventHooks;
|
11214 |
|
11215 | $textElem.on('click', function (e) {
|
11216 | var clickEvents = eventHooks.clickEvents;
|
11217 | (0, _forEach["default"])(clickEvents).call(clickEvents, function (fn) {
|
11218 | return fn(e);
|
11219 | });
|
11220 | });
|
11221 |
|
11222 | $textElem.on('keyup', function (e) {
|
11223 | if (e.keyCode !== 13) return;
|
11224 | var enterUpEvents = eventHooks.enterUpEvents;
|
11225 | (0, _forEach["default"])(enterUpEvents).call(enterUpEvents, function (fn) {
|
11226 | return fn(e);
|
11227 | });
|
11228 | });
|
11229 |
|
11230 | $textElem.on('keyup', function (e) {
|
11231 | var keyupEvents = eventHooks.keyupEvents;
|
11232 | (0, _forEach["default"])(keyupEvents).call(keyupEvents, function (fn) {
|
11233 | return fn(e);
|
11234 | });
|
11235 | });
|
11236 |
|
11237 | $textElem.on('keyup', function (e) {
|
11238 | if (e.keyCode !== 8) return;
|
11239 | var deleteUpEvents = eventHooks.deleteUpEvents;
|
11240 | (0, _forEach["default"])(deleteUpEvents).call(deleteUpEvents, function (fn) {
|
11241 | return fn(e);
|
11242 | });
|
11243 | });
|
11244 |
|
11245 | $textElem.on('keydown', function (e) {
|
11246 | if (e.keyCode !== 8) return;
|
11247 | var deleteDownEvents = eventHooks.deleteDownEvents;
|
11248 | (0, _forEach["default"])(deleteDownEvents).call(deleteDownEvents, function (fn) {
|
11249 | return fn(e);
|
11250 | });
|
11251 | });
|
11252 |
|
11253 | $textElem.on('paste', function (e) {
|
11254 | if (util_1.UA.isIE()) return;
|
11255 |
|
11256 |
|
11257 | e.preventDefault();
|
11258 | var pasteEvents = eventHooks.pasteEvents;
|
11259 | (0, _forEach["default"])(pasteEvents).call(pasteEvents, function (fn) {
|
11260 | return fn(e);
|
11261 | });
|
11262 | });
|
11263 |
|
11264 | $textElem.on('keydown', function (e) {
|
11265 | if (
|
11266 | (editor.isFocus || editor.isCompatibleMode) && (e.ctrlKey || e.metaKey) && e.keyCode === 90) {
|
11267 |
|
11268 | e.preventDefault();
|
11269 |
|
11270 | if (e.shiftKey) {
|
11271 |
|
11272 | editor.history.restore();
|
11273 | } else {
|
11274 |
|
11275 | editor.history.revoke();
|
11276 | }
|
11277 | }
|
11278 | });
|
11279 |
|
11280 | $textElem.on('keyup', function (e) {
|
11281 | if (e.keyCode !== 9) return;
|
11282 | e.preventDefault();
|
11283 | var tabUpEvents = eventHooks.tabUpEvents;
|
11284 | (0, _forEach["default"])(tabUpEvents).call(tabUpEvents, function (fn) {
|
11285 | return fn(e);
|
11286 | });
|
11287 | });
|
11288 |
|
11289 | $textElem.on('keydown', function (e) {
|
11290 | if (e.keyCode !== 9) return;
|
11291 | e.preventDefault();
|
11292 | var tabDownEvents = eventHooks.tabDownEvents;
|
11293 | (0, _forEach["default"])(tabDownEvents).call(tabDownEvents, function (fn) {
|
11294 | return fn(e);
|
11295 | });
|
11296 | });
|
11297 |
|
11298 | $textElem.on('scroll',
|
11299 | util_1.throttle(function (e) {
|
11300 | var textScrollEvents = eventHooks.textScrollEvents;
|
11301 | (0, _forEach["default"])(textScrollEvents).call(textScrollEvents, function (fn) {
|
11302 | return fn(e);
|
11303 | });
|
11304 | }, 100));
|
11305 |
|
11306 | function preventDefault(e) {
|
11307 |
|
11308 | e.preventDefault();
|
11309 | }
|
11310 |
|
11311 | dom_core_1["default"](document).on('dragleave', preventDefault).on('drop', preventDefault).on('dragenter', preventDefault).on('dragover', preventDefault);
|
11312 |
|
11313 | editor.beforeDestroy(function () {
|
11314 | dom_core_1["default"](document).off('dragleave', preventDefault).off('drop', preventDefault).off('dragenter', preventDefault).off('dragover', preventDefault);
|
11315 | });
|
11316 | $textElem.on('drop', function (e) {
|
11317 | e.preventDefault();
|
11318 | var events = eventHooks.dropEvents;
|
11319 | (0, _forEach["default"])(events).call(events, function (fn) {
|
11320 | return fn(e);
|
11321 | });
|
11322 | });
|
11323 |
|
11324 | $textElem.on('click', function (e) {
|
11325 |
|
11326 | var $link = null;
|
11327 | var target = e.target;
|
11328 | var $target = dom_core_1["default"](target);
|
11329 |
|
11330 | if ($target.getNodeName() === 'A') {
|
11331 |
|
11332 | $link = $target;
|
11333 | } else {
|
11334 |
|
11335 | var $parent = $target.parentUntil('a');
|
11336 |
|
11337 | if ($parent != null) {
|
11338 |
|
11339 | $link = $parent;
|
11340 | }
|
11341 | }
|
11342 |
|
11343 | if (!$link) return;
|
11344 |
|
11345 | var linkClickEvents = eventHooks.linkClickEvents;
|
11346 | (0, _forEach["default"])(linkClickEvents).call(linkClickEvents, function (fn) {
|
11347 | return fn($link);
|
11348 | });
|
11349 | });
|
11350 |
|
11351 | $textElem.on('click', function (e) {
|
11352 |
|
11353 | var $img = null;
|
11354 | var target = e.target;
|
11355 | var $target = dom_core_1["default"](target);
|
11356 |
|
11357 | if ($target.getNodeName() === 'IMG' && (!$target.elems[0].getAttribute('class') || $target.elems[0].getAttribute('class') !== 'eleImg') && !$target.elems[0].getAttribute('alt')) {
|
11358 |
|
11359 | e.stopPropagation();
|
11360 | $img = $target;
|
11361 | }
|
11362 |
|
11363 | if (!$img) return;
|
11364 |
|
11365 | var imgClickEvents = eventHooks.imgClickEvents;
|
11366 | (0, _forEach["default"])(imgClickEvents).call(imgClickEvents, function (fn) {
|
11367 | return fn($img);
|
11368 | });
|
11369 | });
|
11370 |
|
11371 | $textElem.on('click', function (e) {
|
11372 |
|
11373 | var $code = null;
|
11374 | var target = e.target;
|
11375 | var $target = dom_core_1["default"](target);
|
11376 |
|
11377 | if ($target.getNodeName() === 'PRE') {
|
11378 |
|
11379 | $code = $target;
|
11380 | } else {
|
11381 |
|
11382 | var $parent = $target.parentUntil('pre');
|
11383 |
|
11384 | if ($parent !== null) {
|
11385 |
|
11386 | $code = $parent;
|
11387 | }
|
11388 | }
|
11389 |
|
11390 | if (!$code) return;
|
11391 | var codeClickEvents = eventHooks.codeClickEvents;
|
11392 | (0, _forEach["default"])(codeClickEvents).call(codeClickEvents, function (fn) {
|
11393 | return fn($code);
|
11394 | });
|
11395 | });
|
11396 |
|
11397 | $textElem.on('click', function (e) {
|
11398 |
|
11399 | var $splitLine = null;
|
11400 | var target = e.target;
|
11401 | var $target = dom_core_1["default"](target);
|
11402 |
|
11403 | if ($target.getNodeName() === 'HR') {
|
11404 | $splitLine = $target;
|
11405 | } else {
|
11406 | $target == null;
|
11407 | }
|
11408 |
|
11409 | if (!$splitLine) return;
|
11410 |
|
11411 |
|
11412 | editor.selection.createRangeByElem($splitLine);
|
11413 | editor.selection.restoreSelection();
|
11414 | var splitLineClickEvents = eventHooks.splitLineEvents;
|
11415 | (0, _forEach["default"])(splitLineClickEvents).call(splitLineClickEvents, function (fn) {
|
11416 | return fn($splitLine);
|
11417 | });
|
11418 | });
|
11419 |
|
11420 | editor.$toolbarElem.on('click', function (e) {
|
11421 | var toolbarClickEvents = eventHooks.toolbarClickEvents;
|
11422 | (0, _forEach["default"])(toolbarClickEvents).call(toolbarClickEvents, function (fn) {
|
11423 | return fn(e);
|
11424 | });
|
11425 | });
|
11426 |
|
11427 | editor.$textContainerElem.on('mousedown', function (e) {
|
11428 | var target = e.target;
|
11429 | var $target = dom_core_1["default"](target);
|
11430 |
|
11431 | if ($target.hasClass('w-e-img-drag-rb')) {
|
11432 |
|
11433 | var imgDragBarMouseDownEvents = eventHooks.imgDragBarMouseDownEvents;
|
11434 | (0, _forEach["default"])(imgDragBarMouseDownEvents).call(imgDragBarMouseDownEvents, function (fn) {
|
11435 | return fn();
|
11436 | });
|
11437 | }
|
11438 | });
|
11439 |
|
11440 | $textElem.on('click', function (e) {
|
11441 |
|
11442 | var $dom = null;
|
11443 | var target = e.target;
|
11444 |
|
11445 | $dom = dom_core_1["default"](target).parentUntilEditor('TABLE', editor, target);
|
11446 |
|
11447 | if (!$dom) return;
|
11448 | var tableClickEvents = eventHooks.tableClickEvents;
|
11449 | (0, _forEach["default"])(tableClickEvents).call(tableClickEvents, function (fn) {
|
11450 | return fn($dom);
|
11451 | });
|
11452 | });
|
11453 |
|
11454 | $textElem.on('keydown', function (e) {
|
11455 | if (e.keyCode !== 13) return;
|
11456 | var enterDownEvents = eventHooks.enterDownEvents;
|
11457 | (0, _forEach["default"])(enterDownEvents).call(enterDownEvents, function (fn) {
|
11458 | return fn(e);
|
11459 | });
|
11460 | });
|
11461 | };
|
11462 |
|
11463 | return Text;
|
11464 | }();
|
11465 |
|
11466 | exports["default"] = Text;
|
11467 |
|
11468 | }),
|
11469 |
|
11470 | (function(module, exports, __webpack_require__) {
|
11471 |
|
11472 | var parent = __webpack_require__(286);
|
11473 |
|
11474 | module.exports = parent;
|
11475 |
|
11476 |
|
11477 | }),
|
11478 |
|
11479 | (function(module, exports, __webpack_require__) {
|
11480 |
|
11481 | var find = __webpack_require__(287);
|
11482 |
|
11483 | var ArrayPrototype = Array.prototype;
|
11484 |
|
11485 | module.exports = function (it) {
|
11486 | var own = it.find;
|
11487 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.find) ? find : own;
|
11488 | };
|
11489 |
|
11490 |
|
11491 | }),
|
11492 |
|
11493 | (function(module, exports, __webpack_require__) {
|
11494 |
|
11495 | __webpack_require__(288);
|
11496 | var entryVirtual = __webpack_require__(16);
|
11497 |
|
11498 | module.exports = entryVirtual('Array').find;
|
11499 |
|
11500 |
|
11501 | }),
|
11502 |
|
11503 | (function(module, exports, __webpack_require__) {
|
11504 |
|
11505 | "use strict";
|
11506 |
|
11507 | var $ = __webpack_require__(4);
|
11508 | var $find = __webpack_require__(33).find;
|
11509 | var addToUnscopables = __webpack_require__(85);
|
11510 | var arrayMethodUsesToLength = __webpack_require__(25);
|
11511 |
|
11512 | var FIND = 'find';
|
11513 | var SKIPS_HOLES = true;
|
11514 |
|
11515 | var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
|
11516 |
|
11517 |
|
11518 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
11519 |
|
11520 |
|
11521 |
|
11522 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
|
11523 | find: function find(callbackfn /* , that = undefined */) {
|
11524 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
11525 | }
|
11526 | });
|
11527 |
|
11528 |
|
11529 | addToUnscopables(FIND);
|
11530 |
|
11531 |
|
11532 | }),
|
11533 |
|
11534 | (function(module, exports, __webpack_require__) {
|
11535 |
|
11536 | "use strict";
|
11537 |
|
11538 |
|
11539 |
|
11540 |
|
11541 |
|
11542 |
|
11543 | var _interopRequireDefault = __webpack_require__(0);
|
11544 |
|
11545 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
11546 |
|
11547 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
11548 | return mod && mod.__esModule ? mod : {
|
11549 | "default": mod
|
11550 | };
|
11551 | };
|
11552 |
|
11553 | (0, _defineProperty["default"])(exports, "__esModule", {
|
11554 | value: true
|
11555 | });
|
11556 |
|
11557 | var enter_to_create_p_1 = __importDefault(__webpack_require__(290));
|
11558 |
|
11559 | var del_to_keep_p_1 = __importDefault(__webpack_require__(291));
|
11560 |
|
11561 | var tab_to_space_1 = __importDefault(__webpack_require__(292));
|
11562 |
|
11563 | var paste_text_html_1 = __importDefault(__webpack_require__(293));
|
11564 |
|
11565 | var img_click_active_1 = __importDefault(__webpack_require__(300));
|
11566 |
|
11567 |
|
11568 |
|
11569 |
|
11570 |
|
11571 |
|
11572 | function initTextHooks(text) {
|
11573 | var editor = text.editor;
|
11574 | var eventHooks = text.eventHooks;
|
11575 |
|
11576 | enter_to_create_p_1["default"](editor, eventHooks.enterUpEvents, eventHooks.enterDownEvents);
|
11577 |
|
11578 | del_to_keep_p_1["default"](editor, eventHooks.deleteUpEvents, eventHooks.deleteDownEvents);
|
11579 |
|
11580 | tab_to_space_1["default"](editor, eventHooks.tabDownEvents);
|
11581 |
|
11582 | paste_text_html_1["default"](editor, eventHooks.pasteEvents);
|
11583 |
|
11584 | img_click_active_1["default"](editor, eventHooks.imgClickEvents);
|
11585 | }
|
11586 |
|
11587 | exports["default"] = initTextHooks;
|
11588 |
|
11589 | }),
|
11590 |
|
11591 | (function(module, exports, __webpack_require__) {
|
11592 |
|
11593 | "use strict";
|
11594 |
|
11595 |
|
11596 |
|
11597 |
|
11598 |
|
11599 |
|
11600 | var _interopRequireDefault = __webpack_require__(0);
|
11601 |
|
11602 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
11603 |
|
11604 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
11605 | return mod && mod.__esModule ? mod : {
|
11606 | "default": mod
|
11607 | };
|
11608 | };
|
11609 |
|
11610 | (0, _defineProperty["default"])(exports, "__esModule", {
|
11611 | value: true
|
11612 | });
|
11613 |
|
11614 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
11615 |
|
11616 |
|
11617 |
|
11618 |
|
11619 |
|
11620 |
|
11621 |
|
11622 |
|
11623 | function enterToCreateP(editor, enterUpEvents, enterDownEvents) {
|
11624 | function insertEmptyP($selectionElem) {
|
11625 | var $p = dom_core_1["default"]('<p><br></p>');
|
11626 | $p.insertBefore($selectionElem);
|
11627 | editor.selection.createRangeByElem($p, true, true);
|
11628 | editor.selection.restoreSelection();
|
11629 | $selectionElem.remove();
|
11630 | }
|
11631 |
|
11632 |
|
11633 | function fn() {
|
11634 | var $textElem = editor.$textElem;
|
11635 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
11636 | var $parentElem = $selectionElem.parent();
|
11637 |
|
11638 | if ($parentElem.html() === '<code><br></code>') {
|
11639 |
|
11640 |
|
11641 | insertEmptyP($selectionElem);
|
11642 | return;
|
11643 | }
|
11644 |
|
11645 | if (!$parentElem.equal($textElem)) {
|
11646 |
|
11647 | return;
|
11648 | }
|
11649 |
|
11650 | var nodeName = $selectionElem.getNodeName();
|
11651 |
|
11652 | if (nodeName === 'P') {
|
11653 |
|
11654 | return;
|
11655 | }
|
11656 |
|
11657 | if ($selectionElem.text()) {
|
11658 |
|
11659 | return;
|
11660 | }
|
11661 |
|
11662 |
|
11663 | insertEmptyP($selectionElem);
|
11664 | }
|
11665 |
|
11666 | enterUpEvents.push(fn);
|
11667 |
|
11668 | function createPWhenEnterText(e) {
|
11669 | var _a;
|
11670 |
|
11671 |
|
11672 | editor.selection.saveRange((_a = getSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0));
|
11673 | var $selectElem = editor.selection.getSelectionContainerElem();
|
11674 |
|
11675 | if ($selectElem.id === editor.textElemId) {
|
11676 |
|
11677 |
|
11678 | e.preventDefault();
|
11679 | editor.cmd["do"]('insertHTML', '<p><br></p>');
|
11680 | }
|
11681 | }
|
11682 |
|
11683 | enterDownEvents.push(createPWhenEnterText);
|
11684 | }
|
11685 |
|
11686 | exports["default"] = enterToCreateP;
|
11687 |
|
11688 | }),
|
11689 |
|
11690 | (function(module, exports, __webpack_require__) {
|
11691 |
|
11692 | "use strict";
|
11693 |
|
11694 |
|
11695 |
|
11696 |
|
11697 |
|
11698 |
|
11699 | var _interopRequireDefault = __webpack_require__(0);
|
11700 |
|
11701 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
11702 |
|
11703 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
11704 |
|
11705 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
11706 | return mod && mod.__esModule ? mod : {
|
11707 | "default": mod
|
11708 | };
|
11709 | };
|
11710 |
|
11711 | (0, _defineProperty["default"])(exports, "__esModule", {
|
11712 | value: true
|
11713 | });
|
11714 |
|
11715 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
11716 |
|
11717 |
|
11718 |
|
11719 |
|
11720 |
|
11721 |
|
11722 |
|
11723 |
|
11724 | function deleteToKeepP(editor, deleteUpEvents, deleteDownEvents) {
|
11725 | function upFn() {
|
11726 | var _context;
|
11727 |
|
11728 | var $textElem = editor.$textElem;
|
11729 | var txtHtml = (0, _trim["default"])(_context = $textElem.html().toLowerCase()).call(_context);
|
11730 |
|
11731 | if (!txtHtml || txtHtml === '<br>') {
|
11732 |
|
11733 | var $p = dom_core_1["default"]('<p><br/></p>');
|
11734 | $textElem.html(' ');
|
11735 |
|
11736 | $textElem.append($p);
|
11737 | editor.selection.createRangeByElem($p, false, true);
|
11738 | editor.selection.restoreSelection();
|
11739 |
|
11740 |
|
11741 | editor.selection.moveCursor($p.getNode(), 0);
|
11742 | }
|
11743 | }
|
11744 |
|
11745 | deleteUpEvents.push(upFn);
|
11746 |
|
11747 | function downFn(e) {
|
11748 | var _context2;
|
11749 |
|
11750 | var $textElem = editor.$textElem;
|
11751 | var txtHtml = (0, _trim["default"])(_context2 = $textElem.html().toLowerCase()).call(_context2);
|
11752 |
|
11753 | if (txtHtml === '<p><br></p>') {
|
11754 |
|
11755 | e.preventDefault();
|
11756 | return;
|
11757 | }
|
11758 | }
|
11759 |
|
11760 | deleteDownEvents.push(downFn);
|
11761 | }
|
11762 |
|
11763 | exports["default"] = deleteToKeepP;
|
11764 |
|
11765 | }),
|
11766 |
|
11767 | (function(module, exports, __webpack_require__) {
|
11768 |
|
11769 | "use strict";
|
11770 |
|
11771 |
|
11772 |
|
11773 |
|
11774 |
|
11775 |
|
11776 | var _interopRequireDefault = __webpack_require__(0);
|
11777 |
|
11778 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
11779 |
|
11780 | (0, _defineProperty["default"])(exports, "__esModule", {
|
11781 | value: true
|
11782 | });
|
11783 |
|
11784 |
|
11785 |
|
11786 |
|
11787 |
|
11788 |
|
11789 | function tabHandler(editor, tabDownEvents) {
|
11790 |
|
11791 | function fn() {
|
11792 | if (!editor.cmd.queryCommandSupported('insertHTML')) {
|
11793 |
|
11794 | return;
|
11795 | }
|
11796 |
|
11797 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
11798 |
|
11799 | if (!$selectionElem) {
|
11800 | return;
|
11801 | }
|
11802 |
|
11803 | var $parentElem = $selectionElem.parent();
|
11804 | var selectionNodeName = $selectionElem.getNodeName();
|
11805 | var parentNodeName = $parentElem.getNodeName();
|
11806 |
|
11807 | if (selectionNodeName == 'CODE' || parentNodeName === 'CODE' || parentNodeName === 'PRE' || /hljs/.test(parentNodeName)) {
|
11808 |
|
11809 | editor.cmd["do"]('insertHTML', editor.config.languageTab);
|
11810 | } else {
|
11811 |
|
11812 | editor.cmd["do"]('insertHTML', ' ');
|
11813 | }
|
11814 | }
|
11815 |
|
11816 |
|
11817 | tabDownEvents.push(fn);
|
11818 | }
|
11819 |
|
11820 | exports["default"] = tabHandler;
|
11821 |
|
11822 | }),
|
11823 |
|
11824 | (function(module, exports, __webpack_require__) {
|
11825 |
|
11826 | "use strict";
|
11827 |
|
11828 |
|
11829 |
|
11830 |
|
11831 |
|
11832 |
|
11833 | var _interopRequireDefault = __webpack_require__(0);
|
11834 |
|
11835 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
11836 |
|
11837 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
11838 |
|
11839 | (0, _defineProperty["default"])(exports, "__esModule", {
|
11840 | value: true
|
11841 | });
|
11842 |
|
11843 | var paste_event_1 = __webpack_require__(123);
|
11844 |
|
11845 | var util_1 = __webpack_require__(7);
|
11846 |
|
11847 | var const_1 = __webpack_require__(26);
|
11848 |
|
11849 |
|
11850 |
|
11851 |
|
11852 |
|
11853 |
|
11854 |
|
11855 | function formatHtml(val) {
|
11856 | var pasteText = val;
|
11857 |
|
11858 | pasteText = pasteText.replace(/<div>/gim, '<p>').replace(/<\/div>/gim, '</p>');
|
11859 |
|
11860 | pasteText = pasteText.replace(/<p><\/p>/gim, '<p><br></p>');
|
11861 |
|
11862 | return (0, _trim["default"])(pasteText).call(pasteText);
|
11863 | }
|
11864 |
|
11865 |
|
11866 |
|
11867 |
|
11868 |
|
11869 |
|
11870 |
|
11871 | function formatCode(val) {
|
11872 | var pasteText = val.replace(/<br>|<br\/>/gm, '\n').replace(/<[^>]+>/gm, '');
|
11873 | return pasteText;
|
11874 | }
|
11875 |
|
11876 |
|
11877 |
|
11878 |
|
11879 |
|
11880 |
|
11881 |
|
11882 | function pasteTextHtml(editor, pasteEvents) {
|
11883 | function fn(e) {
|
11884 |
|
11885 | var config = editor.config;
|
11886 | var pasteFilterStyle = config.pasteFilterStyle;
|
11887 | var pasteIgnoreImg = config.pasteIgnoreImg;
|
11888 | var pasteTextHandle = config.pasteTextHandle;
|
11889 |
|
11890 | var pasteHtml = paste_event_1.getPasteHtml(e, pasteFilterStyle, pasteIgnoreImg);
|
11891 | var pasteText = paste_event_1.getPasteText(e);
|
11892 | pasteText = pasteText.replace(/\n/gm, '<br>');
|
11893 |
|
11894 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
11895 |
|
11896 | if (!$selectionElem) {
|
11897 | return;
|
11898 | }
|
11899 |
|
11900 | var nodeName = $selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.getNodeName();
|
11901 | var $topElem = $selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.getNodeTop(editor);
|
11902 |
|
11903 | var topNodeName = '';
|
11904 |
|
11905 | if ($topElem.elems[0]) {
|
11906 | topNodeName = $topElem === null || $topElem === void 0 ? void 0 : $topElem.getNodeName();
|
11907 | }
|
11908 |
|
11909 |
|
11910 | if (nodeName === 'CODE' || topNodeName === 'PRE') {
|
11911 | if (pasteTextHandle && util_1.isFunction(pasteTextHandle)) {
|
11912 |
|
11913 | pasteText = '' + (pasteTextHandle(pasteText) || '');
|
11914 | }
|
11915 |
|
11916 | editor.cmd["do"]('insertHTML', formatCode(pasteText));
|
11917 | return;
|
11918 | }
|
11919 |
|
11920 |
|
11921 |
|
11922 | if (const_1.urlRegex.test(pasteText) && pasteFilterStyle) {
|
11923 | return editor.cmd["do"]('insertHTML', "<a href=\"" + pasteText + "\" target=\"_blank\">" + pasteText + "</a>");
|
11924 | }
|
11925 |
|
11926 |
|
11927 | if (!pasteHtml) {
|
11928 | return;
|
11929 | }
|
11930 |
|
11931 | try {
|
11932 |
|
11933 |
|
11934 | if (pasteTextHandle && util_1.isFunction(pasteTextHandle)) {
|
11935 |
|
11936 | pasteHtml = '' + (pasteTextHandle(pasteHtml) || '');
|
11937 | }
|
11938 |
|
11939 |
|
11940 | var isCssStyle = /[\.\#\@]?\w+[^{]+\{[^}]*\}/.test(pasteHtml);
|
11941 |
|
11942 |
|
11943 | if (isCssStyle) {
|
11944 | editor.cmd["do"]('insertHTML', "" + formatHtml(pasteText));
|
11945 | } else {
|
11946 | editor.cmd["do"]('insertHTML', "" + formatHtml(pasteHtml));
|
11947 | }
|
11948 | } catch (ex) {
|
11949 |
|
11950 | if (pasteTextHandle && util_1.isFunction(pasteTextHandle)) {
|
11951 |
|
11952 | pasteText = '' + (pasteTextHandle(pasteText) || '');
|
11953 | }
|
11954 |
|
11955 | editor.cmd["do"]('insertHTML', "" + formatHtml(pasteText));
|
11956 | }
|
11957 | }
|
11958 |
|
11959 | pasteEvents.push(fn);
|
11960 | }
|
11961 |
|
11962 | exports["default"] = pasteTextHtml;
|
11963 |
|
11964 | }),
|
11965 |
|
11966 | (function(module, exports, __webpack_require__) {
|
11967 |
|
11968 | "use strict";
|
11969 |
|
11970 |
|
11971 |
|
11972 |
|
11973 |
|
11974 |
|
11975 | var _interopRequireDefault = __webpack_require__(0);
|
11976 |
|
11977 | var _includes = _interopRequireDefault(__webpack_require__(89));
|
11978 |
|
11979 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
11980 |
|
11981 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
11982 |
|
11983 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
11984 |
|
11985 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
11986 | return mod && mod.__esModule ? mod : {
|
11987 | "default": mod
|
11988 | };
|
11989 | };
|
11990 |
|
11991 | (0, _defineProperty["default"])(exports, "__esModule", {
|
11992 | value: true
|
11993 | });
|
11994 |
|
11995 | var tags_1 = __webpack_require__(295);
|
11996 |
|
11997 | var simplehtmlparser_js_1 = __importDefault(__webpack_require__(299));
|
11998 |
|
11999 |
|
12000 |
|
12001 |
|
12002 |
|
12003 |
|
12004 | function filterEmptySpan(html) {
|
12005 | var regForReplace = /<span>.*?<\/span>/gi;
|
12006 | var regForMatch = /<span>(.*?)<\/span>/;
|
12007 | return html.replace(regForReplace, function (s) {
|
12008 |
|
12009 | var result = s.match(regForMatch);
|
12010 | if (result == null) return '';
|
12011 | return result[1];
|
12012 | });
|
12013 | }
|
12014 |
|
12015 |
|
12016 |
|
12017 |
|
12018 |
|
12019 |
|
12020 |
|
12021 | function isIgnoreTag(tag, ignoreImg) {
|
12022 | var _context;
|
12023 |
|
12024 | tag = (0, _trim["default"])(_context = tag.toLowerCase()).call(_context);
|
12025 |
|
12026 | if (tags_1.IGNORE_TAGS.has(tag)) {
|
12027 | return true;
|
12028 | }
|
12029 |
|
12030 |
|
12031 | if (ignoreImg) {
|
12032 | if (tag === 'img') {
|
12033 | return true;
|
12034 | }
|
12035 | }
|
12036 |
|
12037 | return false;
|
12038 | }
|
12039 |
|
12040 |
|
12041 |
|
12042 |
|
12043 |
|
12044 |
|
12045 |
|
12046 | function genStartHtml(tag, attrs) {
|
12047 | var result = '';
|
12048 |
|
12049 | result = "<" + tag;
|
12050 |
|
12051 | var attrStrArr = [];
|
12052 | (0, _forEach["default"])(attrs).call(attrs, function (attr) {
|
12053 | attrStrArr.push(attr.name + "=\"" + attr.value + "\"");
|
12054 | });
|
12055 |
|
12056 | if (attrStrArr.length > 0) {
|
12057 | result = result + ' ' + attrStrArr.join(' ');
|
12058 | }
|
12059 |
|
12060 |
|
12061 | var isEmpty = tags_1.EMPTY_TAGS.has(tag);
|
12062 |
|
12063 | result = result + (isEmpty ? '/' : '') + '>';
|
12064 | return result;
|
12065 | }
|
12066 |
|
12067 |
|
12068 |
|
12069 |
|
12070 |
|
12071 |
|
12072 | function genEndHtml(tag) {
|
12073 | return "</" + tag + ">";
|
12074 | }
|
12075 |
|
12076 |
|
12077 |
|
12078 |
|
12079 |
|
12080 |
|
12081 |
|
12082 |
|
12083 | function parseHtml(html, filterStyle, ignoreImg) {
|
12084 | if (filterStyle === void 0) {
|
12085 | filterStyle = true;
|
12086 | }
|
12087 |
|
12088 | if (ignoreImg === void 0) {
|
12089 | ignoreImg = false;
|
12090 | }
|
12091 |
|
12092 | var resultArr = [];
|
12093 |
|
12094 |
|
12095 | var CUR_TAG = '';
|
12096 |
|
12097 | function markTagStart(tag) {
|
12098 | tag = (0, _trim["default"])(tag).call(tag);
|
12099 | if (!tag) return;
|
12100 | if (tags_1.EMPTY_TAGS.has(tag)) return;
|
12101 |
|
12102 | CUR_TAG = tag;
|
12103 | }
|
12104 |
|
12105 | function markTagEnd() {
|
12106 | CUR_TAG = '';
|
12107 | }
|
12108 |
|
12109 |
|
12110 | var htmlParser = new simplehtmlparser_js_1["default"]();
|
12111 | htmlParser.parse(html, {
|
12112 | startElement: function startElement(tag, attrs) {
|
12113 |
|
12114 | markTagStart(tag);
|
12115 |
|
12116 | if (isIgnoreTag(tag, ignoreImg)) {
|
12117 | return;
|
12118 | }
|
12119 |
|
12120 |
|
12121 | var necessaryAttrKeys = tags_1.NECESSARY_ATTRS.get(tag) || [];
|
12122 | var attrsForTag = [];
|
12123 | (0, _forEach["default"])(attrs).call(attrs, function (attr) {
|
12124 |
|
12125 | var name = attr.name;
|
12126 |
|
12127 | if (name === 'style') {
|
12128 |
|
12129 | if (!filterStyle) {
|
12130 | attrsForTag.push(attr);
|
12131 | }
|
12132 |
|
12133 | return;
|
12134 | }
|
12135 |
|
12136 |
|
12137 | if ((0, _includes["default"])(necessaryAttrKeys).call(necessaryAttrKeys, name) === false) {
|
12138 |
|
12139 | return;
|
12140 | }
|
12141 |
|
12142 | attrsForTag.push(attr);
|
12143 | });
|
12144 |
|
12145 | var html = genStartHtml(tag, attrsForTag);
|
12146 | resultArr.push(html);
|
12147 | },
|
12148 | characters: function characters(str) {
|
12149 | if (!str) {
|
12150 | return;
|
12151 | }
|
12152 |
|
12153 |
|
12154 |
|
12155 | if (isIgnoreTag(CUR_TAG, ignoreImg) && /^</.test(str)) {
|
12156 | return;
|
12157 | }
|
12158 |
|
12159 | resultArr.push(str);
|
12160 | },
|
12161 | endElement: function endElement(tag) {
|
12162 |
|
12163 | if (isIgnoreTag(tag, ignoreImg)) {
|
12164 | return;
|
12165 | }
|
12166 |
|
12167 |
|
12168 | var html = genEndHtml(tag);
|
12169 | resultArr.push(html);
|
12170 |
|
12171 | markTagEnd();
|
12172 | },
|
12173 | comment: function comment(str) {
|
12174 |
|
12175 | }
|
12176 | });
|
12177 | var result = resultArr.join('');
|
12178 |
|
12179 |
|
12180 | result = filterEmptySpan(result);
|
12181 | return result;
|
12182 | }
|
12183 |
|
12184 | exports["default"] = parseHtml;
|
12185 |
|
12186 | }),
|
12187 |
|
12188 | (function(module, exports, __webpack_require__) {
|
12189 |
|
12190 | "use strict";
|
12191 |
|
12192 |
|
12193 |
|
12194 |
|
12195 |
|
12196 |
|
12197 | var _interopRequireDefault = __webpack_require__(0);
|
12198 |
|
12199 | var _map = _interopRequireDefault(__webpack_require__(114));
|
12200 |
|
12201 | var _set = _interopRequireDefault(__webpack_require__(124));
|
12202 |
|
12203 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12204 |
|
12205 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12206 | value: true
|
12207 | });
|
12208 | exports.TOP_LEVEL_TAGS = exports.EMPTY_TAGS = exports.NECESSARY_ATTRS = exports.IGNORE_TAGS = void 0;
|
12209 |
|
12210 | exports.IGNORE_TAGS = new _set["default"](['doctype', '!doctype', 'html', 'head', 'meta', 'body', 'script', 'style', 'link', 'frame', 'iframe', 'title', 'svg', 'center']);
|
12211 |
|
12212 | exports.NECESSARY_ATTRS = new _map["default"]([['img', ['src', 'alt']], ['a', ['href', 'target']], ['td', ['colspan', 'rowspan']], ['th', ['colspan', 'rowspan']]]);
|
12213 |
|
12214 | exports.EMPTY_TAGS = new _set["default"](['area', 'base', 'basefont', 'br', 'col', 'hr', 'img', 'input', 'isindex', 'embed']);
|
12215 |
|
12216 | exports.TOP_LEVEL_TAGS = new _set["default"](['h1', 'h2', 'h3', 'h4', 'h5', 'p', 'ul', 'ol', 'table', 'blockquote', 'pre', 'hr', 'form']);
|
12217 |
|
12218 | }),
|
12219 |
|
12220 | (function(module, exports, __webpack_require__) {
|
12221 |
|
12222 | var parent = __webpack_require__(297);
|
12223 |
|
12224 | module.exports = parent;
|
12225 |
|
12226 |
|
12227 | }),
|
12228 |
|
12229 | (function(module, exports, __webpack_require__) {
|
12230 |
|
12231 | __webpack_require__(298);
|
12232 | __webpack_require__(62);
|
12233 | __webpack_require__(65);
|
12234 | __webpack_require__(51);
|
12235 | var path = __webpack_require__(10);
|
12236 |
|
12237 | module.exports = path.Set;
|
12238 |
|
12239 |
|
12240 | }),
|
12241 |
|
12242 | (function(module, exports, __webpack_require__) {
|
12243 |
|
12244 | "use strict";
|
12245 |
|
12246 | var collection = __webpack_require__(115);
|
12247 | var collectionStrong = __webpack_require__(117);
|
12248 |
|
12249 |
|
12250 |
|
12251 | module.exports = collection('Set', function (init) {
|
12252 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
12253 | }, collectionStrong);
|
12254 |
|
12255 |
|
12256 | }),
|
12257 |
|
12258 | (function(module, exports) {
|
12259 |
|
12260 |
|
12261 |
|
12262 |
|
12263 |
|
12264 |
|
12265 |
|
12266 |
|
12267 |
|
12268 |
|
12269 |
|
12270 |
|
12271 |
|
12272 |
|
12273 |
|
12274 |
|
12275 |
|
12276 |
|
12277 |
|
12278 |
|
12279 |
|
12280 |
|
12281 |
|
12282 |
|
12283 |
|
12284 |
|
12285 |
|
12286 |
|
12287 |
|
12288 |
|
12289 |
|
12290 |
|
12291 |
|
12292 |
|
12293 |
|
12294 |
|
12295 |
|
12296 |
|
12297 |
|
12298 |
|
12299 |
|
12300 |
|
12301 |
|
12302 |
|
12303 |
|
12304 |
|
12305 |
|
12306 |
|
12307 |
|
12308 |
|
12309 |
|
12310 |
|
12311 |
|
12312 |
|
12313 |
|
12314 |
|
12315 |
|
12316 | function SimpleHtmlParser() {}
|
12317 |
|
12318 | SimpleHtmlParser.prototype = {
|
12319 | handler: null,
|
12320 |
|
12321 |
|
12322 |
|
12323 | startTagRe: /^<([^>\s\/]+)((\s+[^=>\s]+(\s*=\s*((\"[^"]*\")|(\'[^']*\')|[^>\s]+))?)*)\s*\/?\s*>/m,
|
12324 | endTagRe: /^<\/([^>\s]+)[^>]*>/m,
|
12325 | attrRe: /([^=\s]+)(\s*=\s*((\"([^"]*)\")|(\'([^']*)\')|[^>\s]+))?/gm,
|
12326 |
|
12327 | parse: function (s, oHandler) {
|
12328 | if (oHandler) this.contentHandler = oHandler
|
12329 |
|
12330 | var i = 0
|
12331 | var res, lc, lm, rc, index
|
12332 | var treatAsChars = false
|
12333 | var oThis = this
|
12334 | while (s.length > 0) {
|
12335 |
|
12336 | if (s.substring(0, 4) == '<!--') {
|
12337 | index = s.indexOf('-->')
|
12338 | if (index != -1) {
|
12339 | this.contentHandler.comment(s.substring(4, index))
|
12340 | s = s.substring(index + 3)
|
12341 | treatAsChars = false
|
12342 | } else {
|
12343 | treatAsChars = true
|
12344 | }
|
12345 | }
|
12346 |
|
12347 |
|
12348 | else if (s.substring(0, 2) == '</') {
|
12349 | if (this.endTagRe.test(s)) {
|
12350 | lc = RegExp.leftContext
|
12351 | lm = RegExp.lastMatch
|
12352 | rc = RegExp.rightContext
|
12353 |
|
12354 | lm.replace(this.endTagRe, function () {
|
12355 | return oThis.parseEndTag.apply(oThis, arguments)
|
12356 | })
|
12357 |
|
12358 | s = rc
|
12359 | treatAsChars = false
|
12360 | } else {
|
12361 | treatAsChars = true
|
12362 | }
|
12363 | }
|
12364 |
|
12365 | else if (s.charAt(0) == '<') {
|
12366 | if (this.startTagRe.test(s)) {
|
12367 | lc = RegExp.leftContext
|
12368 | lm = RegExp.lastMatch
|
12369 | rc = RegExp.rightContext
|
12370 |
|
12371 | lm.replace(this.startTagRe, function () {
|
12372 | return oThis.parseStartTag.apply(oThis, arguments)
|
12373 | })
|
12374 |
|
12375 | s = rc
|
12376 | treatAsChars = false
|
12377 | } else {
|
12378 | treatAsChars = true
|
12379 | }
|
12380 | }
|
12381 |
|
12382 | if (treatAsChars) {
|
12383 | index = s.indexOf('<')
|
12384 | if (index == -1) {
|
12385 | this.contentHandler.characters(s)
|
12386 | s = ''
|
12387 | } else {
|
12388 | this.contentHandler.characters(s.substring(0, index))
|
12389 | s = s.substring(index)
|
12390 | }
|
12391 | }
|
12392 |
|
12393 | treatAsChars = true
|
12394 | }
|
12395 | },
|
12396 |
|
12397 | parseStartTag: function (sTag, sTagName, sRest) {
|
12398 | var attrs = this.parseAttributes(sTagName, sRest)
|
12399 | this.contentHandler.startElement(sTagName, attrs)
|
12400 | },
|
12401 |
|
12402 | parseEndTag: function (sTag, sTagName) {
|
12403 | this.contentHandler.endElement(sTagName)
|
12404 | },
|
12405 |
|
12406 | parseAttributes: function (sTagName, s) {
|
12407 | var oThis = this
|
12408 | var attrs = []
|
12409 | s.replace(this.attrRe, function (a0, a1, a2, a3, a4, a5, a6) {
|
12410 | attrs.push(oThis.parseAttribute(sTagName, a0, a1, a2, a3, a4, a5, a6))
|
12411 | })
|
12412 | return attrs
|
12413 | },
|
12414 |
|
12415 | parseAttribute: function (sTagName, sAttribute, sName) {
|
12416 | var value = ''
|
12417 | if (arguments[7]) value = arguments[8]
|
12418 | else if (arguments[5]) value = arguments[6]
|
12419 | else if (arguments[3]) value = arguments[4]
|
12420 |
|
12421 | var empty = !value && !arguments[3]
|
12422 | return { name: sName, value: empty ? null : value }
|
12423 | },
|
12424 | }
|
12425 |
|
12426 |
|
12427 | module.exports = SimpleHtmlParser
|
12428 |
|
12429 |
|
12430 | }),
|
12431 |
|
12432 | (function(module, exports, __webpack_require__) {
|
12433 |
|
12434 | "use strict";
|
12435 |
|
12436 |
|
12437 |
|
12438 |
|
12439 |
|
12440 |
|
12441 | var _interopRequireDefault = __webpack_require__(0);
|
12442 |
|
12443 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12444 |
|
12445 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12446 | value: true
|
12447 | });
|
12448 |
|
12449 |
|
12450 |
|
12451 |
|
12452 |
|
12453 |
|
12454 | function imgClickActive(editor, imgClickEvents) {
|
12455 | function clickFn($img) {
|
12456 | editor.selection.createRangeByElem($img);
|
12457 | editor.selection.restoreSelection();
|
12458 | }
|
12459 |
|
12460 | imgClickEvents.push(clickFn);
|
12461 | }
|
12462 |
|
12463 | exports["default"] = imgClickActive;
|
12464 |
|
12465 | }),
|
12466 |
|
12467 | (function(module, exports, __webpack_require__) {
|
12468 |
|
12469 | "use strict";
|
12470 |
|
12471 |
|
12472 |
|
12473 |
|
12474 |
|
12475 |
|
12476 | var _interopRequireDefault = __webpack_require__(0);
|
12477 |
|
12478 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
12479 |
|
12480 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12481 |
|
12482 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
12483 | return mod && mod.__esModule ? mod : {
|
12484 | "default": mod
|
12485 | };
|
12486 | };
|
12487 |
|
12488 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12489 | value: true
|
12490 | });
|
12491 |
|
12492 | var util_1 = __webpack_require__(7);
|
12493 |
|
12494 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
12495 |
|
12496 |
|
12497 |
|
12498 |
|
12499 |
|
12500 |
|
12501 | function getChildrenJSON($elem) {
|
12502 | var result = [];
|
12503 |
|
12504 | var $children = $elem.childNodes() || [];
|
12505 |
|
12506 | (0, _forEach["default"])($children).call($children, function (curElem) {
|
12507 | var elemResult;
|
12508 | var nodeType = curElem.nodeType;
|
12509 |
|
12510 | if (nodeType === 3) {
|
12511 | elemResult = curElem.textContent || '';
|
12512 | elemResult = util_1.replaceHtmlSymbol(elemResult);
|
12513 | }
|
12514 |
|
12515 |
|
12516 | if (nodeType === 1) {
|
12517 | elemResult = {};
|
12518 | elemResult = elemResult;
|
12519 |
|
12520 | elemResult.tag = curElem.nodeName.toLowerCase();
|
12521 |
|
12522 | var attrData = [];
|
12523 | var attrList = curElem.attributes;
|
12524 | var attrListLength = attrList.length || 0;
|
12525 |
|
12526 | for (var i = 0; i < attrListLength; i++) {
|
12527 | var attr = attrList[i];
|
12528 | attrData.push({
|
12529 | name: attr.name,
|
12530 | value: attr.value
|
12531 | });
|
12532 | }
|
12533 |
|
12534 | elemResult.attrs = attrData;
|
12535 |
|
12536 | elemResult.children = getChildrenJSON(dom_core_1["default"](curElem));
|
12537 | }
|
12538 |
|
12539 | if (elemResult) {
|
12540 | result.push(elemResult);
|
12541 | }
|
12542 | });
|
12543 | return result;
|
12544 | }
|
12545 |
|
12546 | exports["default"] = getChildrenJSON;
|
12547 |
|
12548 | }),
|
12549 |
|
12550 | (function(module, exports, __webpack_require__) {
|
12551 |
|
12552 | "use strict";
|
12553 |
|
12554 |
|
12555 |
|
12556 |
|
12557 |
|
12558 |
|
12559 | var _interopRequireDefault = __webpack_require__(0);
|
12560 |
|
12561 | var _typeof2 = _interopRequireDefault(__webpack_require__(94));
|
12562 |
|
12563 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
12564 |
|
12565 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12566 |
|
12567 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
12568 | return mod && mod.__esModule ? mod : {
|
12569 | "default": mod
|
12570 | };
|
12571 | };
|
12572 |
|
12573 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12574 | value: true
|
12575 | });
|
12576 |
|
12577 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
12578 |
|
12579 | function getHtmlByNodeList(nodeList, parent) {
|
12580 | if (parent === void 0) {
|
12581 | parent = document.createElement('div');
|
12582 | }
|
12583 |
|
12584 |
|
12585 | var root = parent;
|
12586 |
|
12587 | (0, _forEach["default"])(nodeList).call(nodeList, function (item) {
|
12588 | var elem;
|
12589 |
|
12590 | if (typeof item === 'string') {
|
12591 | elem = document.createTextNode(item);
|
12592 | }
|
12593 |
|
12594 |
|
12595 | if ((0, _typeof2["default"])(item) === 'object') {
|
12596 | var _context;
|
12597 |
|
12598 | elem = document.createElement(item.tag);
|
12599 | (0, _forEach["default"])(_context = item.attrs).call(_context, function (attr) {
|
12600 | dom_core_1["default"](elem).attr(attr.name, attr.value);
|
12601 | });
|
12602 |
|
12603 | if (item.children && item.children.length > 0) {
|
12604 | getHtmlByNodeList(item.children, elem.getRootNode());
|
12605 | }
|
12606 | }
|
12607 |
|
12608 | elem && root.appendChild(elem);
|
12609 | });
|
12610 | return dom_core_1["default"](root);
|
12611 | }
|
12612 |
|
12613 | exports["default"] = getHtmlByNodeList;
|
12614 |
|
12615 | }),
|
12616 |
|
12617 | (function(module, exports, __webpack_require__) {
|
12618 |
|
12619 | "use strict";
|
12620 |
|
12621 |
|
12622 |
|
12623 |
|
12624 |
|
12625 |
|
12626 | var _interopRequireDefault = __webpack_require__(0);
|
12627 |
|
12628 | var _bind = _interopRequireDefault(__webpack_require__(88));
|
12629 |
|
12630 | var _setTimeout2 = _interopRequireDefault(__webpack_require__(121));
|
12631 |
|
12632 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
12633 |
|
12634 | var _includes = _interopRequireDefault(__webpack_require__(89));
|
12635 |
|
12636 | var _filter = _interopRequireDefault(__webpack_require__(66));
|
12637 |
|
12638 | var _isArray = _interopRequireDefault(__webpack_require__(93));
|
12639 |
|
12640 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12641 |
|
12642 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
12643 | return mod && mod.__esModule ? mod : {
|
12644 | "default": mod
|
12645 | };
|
12646 | };
|
12647 |
|
12648 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12649 | value: true
|
12650 | });
|
12651 |
|
12652 | var menu_list_1 = __importDefault(__webpack_require__(304));
|
12653 |
|
12654 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
12655 |
|
12656 |
|
12657 | var Menus =
|
12658 |
|
12659 | function () {
|
12660 | function Menus(editor) {
|
12661 | this.editor = editor;
|
12662 | this.menuList = [];
|
12663 | this.constructorList = menu_list_1["default"];
|
12664 | }
|
12665 | |
12666 |
|
12667 |
|
12668 |
|
12669 |
|
12670 |
|
12671 |
|
12672 | Menus.prototype.extend = function (key, Menu) {
|
12673 | if (!Menu || typeof Menu !== 'function') return;
|
12674 | this.constructorList[key] = Menu;
|
12675 | };
|
12676 |
|
12677 |
|
12678 | Menus.prototype.init = function () {
|
12679 | var _context, _context2;
|
12680 |
|
12681 | var _this = this;
|
12682 |
|
12683 |
|
12684 | var config = this.editor.config;
|
12685 |
|
12686 | var excludeMenus = config.excludeMenus;
|
12687 | if ((0, _isArray["default"])(excludeMenus) === false) excludeMenus = [];
|
12688 | config.menus = (0, _filter["default"])(_context = config.menus).call(_context, function (key) {
|
12689 | return (0, _includes["default"])(excludeMenus).call(excludeMenus, key) === false;
|
12690 | });
|
12691 | (0, _forEach["default"])(_context2 = config.menus).call(_context2, function (menuKey) {
|
12692 | var MenuConstructor = _this.constructorList[menuKey];
|
12693 |
|
12694 | if (MenuConstructor == null || typeof MenuConstructor !== 'function') {
|
12695 |
|
12696 | return;
|
12697 | }
|
12698 |
|
12699 |
|
12700 | var m = new MenuConstructor(_this.editor);
|
12701 | m.key = menuKey;
|
12702 |
|
12703 | _this.menuList.push(m);
|
12704 | });
|
12705 |
|
12706 | this._addToToolbar();
|
12707 |
|
12708 |
|
12709 | this._bindMenuTooltips();
|
12710 | };
|
12711 |
|
12712 |
|
12713 | Menus.prototype._bindMenuTooltips = function () {
|
12714 | var editor = this.editor;
|
12715 | var $toolbarElem = editor.$toolbarElem;
|
12716 | var $tooltipEl = dom_core_1["default"]("<div class=\"w-e-menu-tooltip w-e-menu-tooltip-up\">\n <div class=\"w-e-menu-tooltip-item-wrapper\">\n <div></div>\n </div>\n </div>");
|
12717 | $tooltipEl.css('visibility', 'hidden');
|
12718 | $toolbarElem.append($tooltipEl);
|
12719 |
|
12720 | $tooltipEl.css('z-index', editor.zIndex.get('tooltip'));
|
12721 | var showTimeoutId = 0;
|
12722 |
|
12723 |
|
12724 | function clearShowTimeoutId() {
|
12725 | if (showTimeoutId) {
|
12726 | clearTimeout(showTimeoutId);
|
12727 | }
|
12728 | }
|
12729 |
|
12730 |
|
12731 | function hide() {
|
12732 | clearShowTimeoutId();
|
12733 | $tooltipEl.css('visibility', 'hidden');
|
12734 | }
|
12735 |
|
12736 |
|
12737 | $toolbarElem.on('mouseover', function (e) {
|
12738 | var target = e.target;
|
12739 | var $target = dom_core_1["default"](target);
|
12740 | var title;
|
12741 | var $menuEl;
|
12742 |
|
12743 | if ($target.isContain($toolbarElem)) {
|
12744 | hide();
|
12745 | return;
|
12746 | }
|
12747 |
|
12748 | if ($target.parentUntil('.w-e-droplist') != null) {
|
12749 |
|
12750 | hide();
|
12751 | } else {
|
12752 | if ($target.attr('data-title')) {
|
12753 | title = $target.attr('data-title');
|
12754 | $menuEl = $target;
|
12755 | } else {
|
12756 | var $parent = $target.parentUntil('.w-e-menu');
|
12757 |
|
12758 | if ($parent != null) {
|
12759 | title = $parent.attr('data-title');
|
12760 | $menuEl = $parent;
|
12761 | }
|
12762 | }
|
12763 | }
|
12764 |
|
12765 | if (title && $menuEl) {
|
12766 | clearShowTimeoutId();
|
12767 | var targetOffset = $menuEl.getOffsetData();
|
12768 | $tooltipEl.text(editor.i18next.t('menus.title.' + title));
|
12769 | var tooltipOffset = $tooltipEl.getOffsetData();
|
12770 | var left = targetOffset.left + targetOffset.width / 2 - tooltipOffset.width / 2;
|
12771 | $tooltipEl.css('left', left + "px");
|
12772 | $tooltipEl.css('top', targetOffset.height * -1 + "px");
|
12773 | showTimeoutId = window.setTimeout(function () {
|
12774 | $tooltipEl.css('visibility', 'visible');
|
12775 | }, 200);
|
12776 | } else {
|
12777 | hide();
|
12778 | }
|
12779 | }).on('mouseleave', function () {
|
12780 | hide();
|
12781 | });
|
12782 | };
|
12783 |
|
12784 |
|
12785 | Menus.prototype._addToToolbar = function () {
|
12786 | var _context3;
|
12787 |
|
12788 | var editor = this.editor;
|
12789 | var $toolbarElem = editor.$toolbarElem;
|
12790 |
|
12791 | (0, _forEach["default"])(_context3 = this.menuList).call(_context3, function (menu) {
|
12792 | var $elem = menu.$elem;
|
12793 |
|
12794 | if ($elem) {
|
12795 | $toolbarElem.append($elem);
|
12796 | }
|
12797 | });
|
12798 | };
|
12799 | |
12800 |
|
12801 |
|
12802 |
|
12803 |
|
12804 |
|
12805 |
|
12806 | Menus.prototype.menuFind = function (key) {
|
12807 | var menuList = this.menuList;
|
12808 |
|
12809 | for (var i = 0, l = menuList.length; i < l; i++) {
|
12810 | if (menuList[i].key === key) return menuList[i];
|
12811 | }
|
12812 |
|
12813 | return menuList[0];
|
12814 | };
|
12815 | |
12816 |
|
12817 |
|
12818 |
|
12819 |
|
12820 | Menus.prototype.changeActive = function () {
|
12821 | var _context4;
|
12822 |
|
12823 | (0, _forEach["default"])(_context4 = this.menuList).call(_context4, function (menu) {
|
12824 | var _context5;
|
12825 |
|
12826 | (0, _setTimeout2["default"])((0, _bind["default"])(_context5 = menu.tryChangeActive).call(_context5, menu), 100);
|
12827 | });
|
12828 | };
|
12829 |
|
12830 | return Menus;
|
12831 | }();
|
12832 |
|
12833 | exports["default"] = Menus;
|
12834 |
|
12835 | }),
|
12836 |
|
12837 | (function(module, exports, __webpack_require__) {
|
12838 |
|
12839 | "use strict";
|
12840 |
|
12841 |
|
12842 |
|
12843 |
|
12844 |
|
12845 |
|
12846 | var _interopRequireDefault = __webpack_require__(0);
|
12847 |
|
12848 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12849 |
|
12850 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
12851 | return mod && mod.__esModule ? mod : {
|
12852 | "default": mod
|
12853 | };
|
12854 | };
|
12855 |
|
12856 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12857 | value: true
|
12858 | });
|
12859 |
|
12860 | var index_1 = __importDefault(__webpack_require__(305));
|
12861 |
|
12862 | var index_2 = __importDefault(__webpack_require__(309));
|
12863 |
|
12864 | var index_3 = __importDefault(__webpack_require__(314));
|
12865 |
|
12866 | var index_4 = __importDefault(__webpack_require__(318));
|
12867 |
|
12868 | var index_5 = __importDefault(__webpack_require__(319));
|
12869 |
|
12870 | var index_6 = __importDefault(__webpack_require__(320));
|
12871 |
|
12872 | var index_7 = __importDefault(__webpack_require__(321));
|
12873 |
|
12874 | var font_size_1 = __importDefault(__webpack_require__(323));
|
12875 |
|
12876 | var index_8 = __importDefault(__webpack_require__(325));
|
12877 |
|
12878 | var index_9 = __importDefault(__webpack_require__(326));
|
12879 |
|
12880 | var index_10 = __importDefault(__webpack_require__(329));
|
12881 |
|
12882 | var index_11 = __importDefault(__webpack_require__(330));
|
12883 |
|
12884 | var index_12 = __importDefault(__webpack_require__(331));
|
12885 |
|
12886 | var index_13 = __importDefault(__webpack_require__(333));
|
12887 |
|
12888 | var index_14 = __importDefault(__webpack_require__(353));
|
12889 |
|
12890 | var index_15 = __importDefault(__webpack_require__(357));
|
12891 |
|
12892 | var index_16 = __importDefault(__webpack_require__(359));
|
12893 |
|
12894 | var index_17 = __importDefault(__webpack_require__(360));
|
12895 |
|
12896 | var index_18 = __importDefault(__webpack_require__(362));
|
12897 |
|
12898 | var index_19 = __importDefault(__webpack_require__(363));
|
12899 |
|
12900 | var index_20 = __importDefault(__webpack_require__(364));
|
12901 |
|
12902 | var code_1 = __importDefault(__webpack_require__(373));
|
12903 |
|
12904 | var index_21 = __importDefault(__webpack_require__(377));
|
12905 |
|
12906 | var todo_1 = __importDefault(__webpack_require__(380));
|
12907 |
|
12908 | exports["default"] = {
|
12909 | bold: index_1["default"],
|
12910 | head: index_2["default"],
|
12911 | italic: index_4["default"],
|
12912 | link: index_3["default"],
|
12913 | underline: index_5["default"],
|
12914 | strikeThrough: index_6["default"],
|
12915 | fontName: index_7["default"],
|
12916 | fontSize: font_size_1["default"],
|
12917 | justify: index_8["default"],
|
12918 | quote: index_9["default"],
|
12919 | backColor: index_10["default"],
|
12920 | foreColor: index_11["default"],
|
12921 | video: index_12["default"],
|
12922 | image: index_13["default"],
|
12923 | indent: index_14["default"],
|
12924 | emoticon: index_15["default"],
|
12925 | list: index_16["default"],
|
12926 | lineHeight: index_17["default"],
|
12927 | undo: index_18["default"],
|
12928 | redo: index_19["default"],
|
12929 | table: index_20["default"],
|
12930 | code: code_1["default"],
|
12931 | splitLine: index_21["default"],
|
12932 | todo: todo_1["default"]
|
12933 | };
|
12934 |
|
12935 | }),
|
12936 |
|
12937 | (function(module, exports, __webpack_require__) {
|
12938 |
|
12939 | "use strict";
|
12940 |
|
12941 |
|
12942 |
|
12943 |
|
12944 |
|
12945 |
|
12946 | var _interopRequireDefault = __webpack_require__(0);
|
12947 |
|
12948 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
12949 |
|
12950 | var _create = _interopRequireDefault(__webpack_require__(3));
|
12951 |
|
12952 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
12953 |
|
12954 | var __extends = void 0 && (void 0).__extends || function () {
|
12955 | var _extendStatics = function extendStatics(d, b) {
|
12956 | _extendStatics = _setPrototypeOf["default"] || {
|
12957 | __proto__: []
|
12958 | } instanceof Array && function (d, b) {
|
12959 | d.__proto__ = b;
|
12960 | } || function (d, b) {
|
12961 | for (var p in b) {
|
12962 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
12963 | }
|
12964 | };
|
12965 |
|
12966 | return _extendStatics(d, b);
|
12967 | };
|
12968 |
|
12969 | return function (d, b) {
|
12970 | _extendStatics(d, b);
|
12971 |
|
12972 | function __() {
|
12973 | this.constructor = d;
|
12974 | }
|
12975 |
|
12976 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
12977 | };
|
12978 | }();
|
12979 |
|
12980 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
12981 | return mod && mod.__esModule ? mod : {
|
12982 | "default": mod
|
12983 | };
|
12984 | };
|
12985 |
|
12986 | (0, _defineProperty["default"])(exports, "__esModule", {
|
12987 | value: true
|
12988 | });
|
12989 |
|
12990 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
12991 |
|
12992 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
12993 |
|
12994 | var Bold =
|
12995 |
|
12996 | function (_super) {
|
12997 | __extends(Bold, _super);
|
12998 |
|
12999 | function Bold(editor) {
|
13000 | var _this = this;
|
13001 |
|
13002 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u52A0\u7C97\">\n <i class=\"w-e-icon-bold\"></i>\n </div>");
|
13003 | _this = _super.call(this, $elem, editor) || this;
|
13004 | return _this;
|
13005 | }
|
13006 | |
13007 |
|
13008 |
|
13009 |
|
13010 |
|
13011 | Bold.prototype.clickHandler = function () {
|
13012 | var editor = this.editor;
|
13013 | var isSelectEmpty = editor.selection.isSelectionEmpty();
|
13014 |
|
13015 | if (isSelectEmpty) {
|
13016 |
|
13017 | editor.selection.createEmptyRange();
|
13018 | }
|
13019 |
|
13020 |
|
13021 | editor.cmd["do"]('bold');
|
13022 |
|
13023 | if (isSelectEmpty) {
|
13024 |
|
13025 | editor.selection.collapseRange();
|
13026 | editor.selection.restoreSelection();
|
13027 | }
|
13028 | };
|
13029 | |
13030 |
|
13031 |
|
13032 |
|
13033 |
|
13034 | Bold.prototype.tryChangeActive = function () {
|
13035 | var editor = this.editor;
|
13036 |
|
13037 | if (editor.cmd.queryCommandState('bold')) {
|
13038 | this.active();
|
13039 | } else {
|
13040 | this.unActive();
|
13041 | }
|
13042 | };
|
13043 |
|
13044 | return Bold;
|
13045 | }(BtnMenu_1["default"]);
|
13046 |
|
13047 | exports["default"] = Bold;
|
13048 |
|
13049 | }),
|
13050 |
|
13051 | (function(module, exports, __webpack_require__) {
|
13052 |
|
13053 | var parent = __webpack_require__(307);
|
13054 |
|
13055 | module.exports = parent;
|
13056 |
|
13057 |
|
13058 | }),
|
13059 |
|
13060 | (function(module, exports, __webpack_require__) {
|
13061 |
|
13062 | __webpack_require__(308);
|
13063 | var path = __webpack_require__(10);
|
13064 |
|
13065 | module.exports = path.Object.setPrototypeOf;
|
13066 |
|
13067 |
|
13068 | }),
|
13069 |
|
13070 | (function(module, exports, __webpack_require__) {
|
13071 |
|
13072 | var $ = __webpack_require__(4);
|
13073 | var setPrototypeOf = __webpack_require__(77);
|
13074 |
|
13075 |
|
13076 |
|
13077 | $({ target: 'Object', stat: true }, {
|
13078 | setPrototypeOf: setPrototypeOf
|
13079 | });
|
13080 |
|
13081 |
|
13082 | }),
|
13083 |
|
13084 | (function(module, exports, __webpack_require__) {
|
13085 |
|
13086 | "use strict";
|
13087 |
|
13088 |
|
13089 |
|
13090 |
|
13091 |
|
13092 |
|
13093 | var _interopRequireDefault = __webpack_require__(0);
|
13094 |
|
13095 | var _stringify = _interopRequireDefault(__webpack_require__(310));
|
13096 |
|
13097 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
13098 |
|
13099 | var _find = _interopRequireDefault(__webpack_require__(30));
|
13100 |
|
13101 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13102 |
|
13103 | var _create = _interopRequireDefault(__webpack_require__(3));
|
13104 |
|
13105 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
13106 |
|
13107 | var __extends = void 0 && (void 0).__extends || function () {
|
13108 | var _extendStatics = function extendStatics(d, b) {
|
13109 | _extendStatics = _setPrototypeOf["default"] || {
|
13110 | __proto__: []
|
13111 | } instanceof Array && function (d, b) {
|
13112 | d.__proto__ = b;
|
13113 | } || function (d, b) {
|
13114 | for (var p in b) {
|
13115 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
13116 | }
|
13117 | };
|
13118 |
|
13119 | return _extendStatics(d, b);
|
13120 | };
|
13121 |
|
13122 | return function (d, b) {
|
13123 | _extendStatics(d, b);
|
13124 |
|
13125 | function __() {
|
13126 | this.constructor = d;
|
13127 | }
|
13128 |
|
13129 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
13130 | };
|
13131 | }();
|
13132 |
|
13133 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13134 | return mod && mod.__esModule ? mod : {
|
13135 | "default": mod
|
13136 | };
|
13137 | };
|
13138 |
|
13139 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13140 | value: true
|
13141 | });
|
13142 |
|
13143 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
13144 |
|
13145 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
13146 |
|
13147 | var util_1 = __webpack_require__(7);
|
13148 |
|
13149 | var Head =
|
13150 |
|
13151 | function (_super) {
|
13152 | __extends(Head, _super);
|
13153 |
|
13154 | function Head(editor) {
|
13155 | var _this = this;
|
13156 |
|
13157 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="标题"><i class="w-e-icon-header"></i></div>');
|
13158 | var dropListConf = {
|
13159 | width: 100,
|
13160 | title: '设置标题',
|
13161 | type: 'list',
|
13162 | list: [{
|
13163 | $elem: dom_core_1["default"]('<h1>H1</h1>'),
|
13164 | value: '<h1>'
|
13165 | }, {
|
13166 | $elem: dom_core_1["default"]('<h2>H2</h2>'),
|
13167 | value: '<h2>'
|
13168 | }, {
|
13169 | $elem: dom_core_1["default"]('<h3>H3</h3>'),
|
13170 | value: '<h3>'
|
13171 | }, {
|
13172 | $elem: dom_core_1["default"]('<h4>H4</h4>'),
|
13173 | value: '<h4>'
|
13174 | }, {
|
13175 | $elem: dom_core_1["default"]('<h5>H5</h5>'),
|
13176 | value: '<h5>'
|
13177 | }, {
|
13178 | $elem: dom_core_1["default"]("<p>" + editor.i18next.t('menus.dropListMenu.head.正文') + "</p>"),
|
13179 | value: '<p>'
|
13180 | }],
|
13181 | clickHandler: function clickHandler(value) {
|
13182 |
|
13183 | _this.command(value);
|
13184 | }
|
13185 | };
|
13186 | _this = _super.call(this, $elem, editor, dropListConf) || this;
|
13187 | var onCatalogChange = editor.config.onCatalogChange;
|
13188 |
|
13189 | if (onCatalogChange) {
|
13190 | _this.oldCatalogs = [];
|
13191 |
|
13192 | _this.addListenerCatalog();
|
13193 |
|
13194 |
|
13195 | _this.getCatalogs();
|
13196 |
|
13197 | }
|
13198 |
|
13199 | return _this;
|
13200 | }
|
13201 | |
13202 |
|
13203 |
|
13204 |
|
13205 |
|
13206 |
|
13207 | Head.prototype.command = function (value) {
|
13208 | var editor = this.editor;
|
13209 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
13210 |
|
13211 | if ($selectionElem && editor.$textElem.equal($selectionElem)) {
|
13212 |
|
13213 |
|
13214 | return;
|
13215 | }
|
13216 |
|
13217 | editor.cmd["do"]('formatBlock', value);
|
13218 |
|
13219 | value !== '<p>' && this.addUidForSelectionElem();
|
13220 | };
|
13221 | |
13222 |
|
13223 |
|
13224 |
|
13225 |
|
13226 | Head.prototype.addUidForSelectionElem = function () {
|
13227 | var editor = this.editor;
|
13228 | var tag = editor.selection.getSelectionContainerElem();
|
13229 | var id = util_1.getRandomCode();
|
13230 |
|
13231 | dom_core_1["default"](tag).attr('id', id);
|
13232 | };
|
13233 | |
13234 |
|
13235 |
|
13236 |
|
13237 |
|
13238 | Head.prototype.addListenerCatalog = function () {
|
13239 | var _this = this;
|
13240 |
|
13241 | var editor = this.editor;
|
13242 | editor.txt.eventHooks.changeEvents.push(function () {
|
13243 | _this.getCatalogs();
|
13244 | });
|
13245 | };
|
13246 | |
13247 |
|
13248 |
|
13249 |
|
13250 |
|
13251 | Head.prototype.getCatalogs = function () {
|
13252 | var editor = this.editor;
|
13253 | var $textElem = this.editor.$textElem;
|
13254 | var onCatalogChange = editor.config.onCatalogChange;
|
13255 | var elems = (0, _find["default"])($textElem).call($textElem, 'h1,h2,h3,h4,h5');
|
13256 | var catalogs = [];
|
13257 | (0, _forEach["default"])(elems).call(elems, function (elem, index) {
|
13258 | var $elem = dom_core_1["default"](elem);
|
13259 | var id = $elem.attr('id');
|
13260 | var tag = $elem.getNodeName();
|
13261 | var text = $elem.text();
|
13262 |
|
13263 | if (!id) {
|
13264 | id = util_1.getRandomCode();
|
13265 | $elem.attr('id', id);
|
13266 | }
|
13267 |
|
13268 |
|
13269 | if (!text) return;
|
13270 | catalogs.push({
|
13271 | tag: tag,
|
13272 | id: id,
|
13273 | text: text
|
13274 | });
|
13275 | });
|
13276 |
|
13277 | if ((0, _stringify["default"])(this.oldCatalogs) !== (0, _stringify["default"])(catalogs)) {
|
13278 | this.oldCatalogs = catalogs;
|
13279 | onCatalogChange && onCatalogChange(catalogs);
|
13280 | }
|
13281 | };
|
13282 | |
13283 |
|
13284 |
|
13285 |
|
13286 |
|
13287 | Head.prototype.tryChangeActive = function () {
|
13288 | var editor = this.editor;
|
13289 | var reg = /^h/i;
|
13290 | var cmdValue = editor.cmd.queryCommandValue('formatBlock');
|
13291 |
|
13292 | if (reg.test(cmdValue)) {
|
13293 | this.active();
|
13294 | } else {
|
13295 | this.unActive();
|
13296 | }
|
13297 | };
|
13298 |
|
13299 | return Head;
|
13300 | }(DropListMenu_1["default"]);
|
13301 |
|
13302 | exports["default"] = Head;
|
13303 |
|
13304 | }),
|
13305 |
|
13306 | (function(module, exports, __webpack_require__) {
|
13307 |
|
13308 | module.exports = __webpack_require__(311);
|
13309 |
|
13310 | }),
|
13311 |
|
13312 | (function(module, exports, __webpack_require__) {
|
13313 |
|
13314 | var parent = __webpack_require__(312);
|
13315 |
|
13316 | module.exports = parent;
|
13317 |
|
13318 |
|
13319 | }),
|
13320 |
|
13321 | (function(module, exports, __webpack_require__) {
|
13322 |
|
13323 | __webpack_require__(313);
|
13324 | var core = __webpack_require__(10);
|
13325 |
|
13326 | if (!core.JSON) core.JSON = { stringify: JSON.stringify };
|
13327 |
|
13328 |
|
13329 | module.exports = function stringify(it, replacer, space) {
|
13330 | return core.JSON.stringify.apply(null, arguments);
|
13331 | };
|
13332 |
|
13333 |
|
13334 | }),
|
13335 |
|
13336 | (function(module, exports, __webpack_require__) {
|
13337 |
|
13338 | var $ = __webpack_require__(4);
|
13339 | var getBuiltIn = __webpack_require__(28);
|
13340 | var fails = __webpack_require__(12);
|
13341 |
|
13342 | var $stringify = getBuiltIn('JSON', 'stringify');
|
13343 | var re = /[\uD800-\uDFFF]/g;
|
13344 | var low = /^[\uD800-\uDBFF]$/;
|
13345 | var hi = /^[\uDC00-\uDFFF]$/;
|
13346 |
|
13347 | var fix = function (match, offset, string) {
|
13348 | var prev = string.charAt(offset - 1);
|
13349 | var next = string.charAt(offset + 1);
|
13350 | if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) {
|
13351 | return '\\u' + match.charCodeAt(0).toString(16);
|
13352 | } return match;
|
13353 | };
|
13354 |
|
13355 | var FORCED = fails(function () {
|
13356 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
13357 | || $stringify('\uDEAD') !== '"\\udead"';
|
13358 | });
|
13359 |
|
13360 | if ($stringify) {
|
13361 |
|
13362 |
|
13363 |
|
13364 | $({ target: 'JSON', stat: true, forced: FORCED }, {
|
13365 |
|
13366 | stringify: function stringify(it, replacer, space) {
|
13367 | var result = $stringify.apply(null, arguments);
|
13368 | return typeof result == 'string' ? result.replace(re, fix) : result;
|
13369 | }
|
13370 | });
|
13371 | }
|
13372 |
|
13373 |
|
13374 | }),
|
13375 |
|
13376 | (function(module, exports, __webpack_require__) {
|
13377 |
|
13378 | "use strict";
|
13379 |
|
13380 |
|
13381 |
|
13382 |
|
13383 |
|
13384 |
|
13385 | var _interopRequireDefault = __webpack_require__(0);
|
13386 |
|
13387 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13388 |
|
13389 | var _create = _interopRequireDefault(__webpack_require__(3));
|
13390 |
|
13391 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
13392 |
|
13393 | var __extends = void 0 && (void 0).__extends || function () {
|
13394 | var _extendStatics = function extendStatics(d, b) {
|
13395 | _extendStatics = _setPrototypeOf["default"] || {
|
13396 | __proto__: []
|
13397 | } instanceof Array && function (d, b) {
|
13398 | d.__proto__ = b;
|
13399 | } || function (d, b) {
|
13400 | for (var p in b) {
|
13401 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
13402 | }
|
13403 | };
|
13404 |
|
13405 | return _extendStatics(d, b);
|
13406 | };
|
13407 |
|
13408 | return function (d, b) {
|
13409 | _extendStatics(d, b);
|
13410 |
|
13411 | function __() {
|
13412 | this.constructor = d;
|
13413 | }
|
13414 |
|
13415 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
13416 | };
|
13417 | }();
|
13418 |
|
13419 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13420 | return mod && mod.__esModule ? mod : {
|
13421 | "default": mod
|
13422 | };
|
13423 | };
|
13424 |
|
13425 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13426 | value: true
|
13427 | });
|
13428 |
|
13429 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
13430 |
|
13431 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
13432 |
|
13433 | var create_panel_conf_1 = __importDefault(__webpack_require__(315));
|
13434 |
|
13435 | var is_active_1 = __importDefault(__webpack_require__(126));
|
13436 |
|
13437 | var Panel_1 = __importDefault(__webpack_require__(31));
|
13438 |
|
13439 | var index_1 = __importDefault(__webpack_require__(316));
|
13440 |
|
13441 | var Link =
|
13442 |
|
13443 | function (_super) {
|
13444 | __extends(Link, _super);
|
13445 |
|
13446 | function Link(editor) {
|
13447 | var _this = this;
|
13448 |
|
13449 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="链接"><i class="w-e-icon-link"></i></div>');
|
13450 | _this = _super.call(this, $elem, editor) || this;
|
13451 |
|
13452 | index_1["default"](editor);
|
13453 | return _this;
|
13454 | }
|
13455 | |
13456 |
|
13457 |
|
13458 |
|
13459 |
|
13460 | Link.prototype.clickHandler = function () {
|
13461 | var editor = this.editor;
|
13462 | var $linkElem;
|
13463 |
|
13464 | if (this.isActive) {
|
13465 |
|
13466 | $linkElem = editor.selection.getSelectionContainerElem();
|
13467 |
|
13468 | if (!$linkElem) {
|
13469 | return;
|
13470 | }
|
13471 |
|
13472 |
|
13473 | this.createPanel($linkElem.text(), $linkElem.attr('href'));
|
13474 | } else {
|
13475 |
|
13476 | if (editor.selection.isSelectionEmpty()) {
|
13477 |
|
13478 | this.createPanel('', '');
|
13479 | } else {
|
13480 |
|
13481 | this.createPanel(editor.selection.getSelectionText(), '');
|
13482 | }
|
13483 | }
|
13484 | };
|
13485 | |
13486 |
|
13487 |
|
13488 |
|
13489 |
|
13490 |
|
13491 |
|
13492 | Link.prototype.createPanel = function (text, link) {
|
13493 | var conf = create_panel_conf_1["default"](this.editor, text, link);
|
13494 | var panel = new Panel_1["default"](this, conf);
|
13495 | panel.create();
|
13496 | };
|
13497 | |
13498 |
|
13499 |
|
13500 |
|
13501 |
|
13502 | Link.prototype.tryChangeActive = function () {
|
13503 | var editor = this.editor;
|
13504 |
|
13505 | if (is_active_1["default"](editor)) {
|
13506 | this.active();
|
13507 | } else {
|
13508 | this.unActive();
|
13509 | }
|
13510 | };
|
13511 |
|
13512 | return Link;
|
13513 | }(PanelMenu_1["default"]);
|
13514 |
|
13515 | exports["default"] = Link;
|
13516 |
|
13517 | }),
|
13518 |
|
13519 | (function(module, exports, __webpack_require__) {
|
13520 |
|
13521 | "use strict";
|
13522 |
|
13523 |
|
13524 |
|
13525 |
|
13526 |
|
13527 |
|
13528 | var _interopRequireDefault = __webpack_require__(0);
|
13529 |
|
13530 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
13531 |
|
13532 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13533 |
|
13534 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13535 | return mod && mod.__esModule ? mod : {
|
13536 | "default": mod
|
13537 | };
|
13538 | };
|
13539 |
|
13540 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13541 | value: true
|
13542 | });
|
13543 |
|
13544 | var util_1 = __webpack_require__(7);
|
13545 |
|
13546 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
13547 |
|
13548 | var is_active_1 = __importDefault(__webpack_require__(126));
|
13549 |
|
13550 | function default_1(editor, text, link) {
|
13551 |
|
13552 | var inputLinkId = util_1.getRandom('input-link');
|
13553 | var inputTextId = util_1.getRandom('input-text');
|
13554 | var btnOkId = util_1.getRandom('btn-ok');
|
13555 | var btnDelId = util_1.getRandom('btn-del');
|
13556 |
|
13557 | var delBtnDisplay = is_active_1["default"](editor) ? 'inline-block' : 'none';
|
13558 | var $selectedLink;
|
13559 | |
13560 |
|
13561 |
|
13562 |
|
13563 | function selectLinkElem() {
|
13564 | if (!is_active_1["default"](editor)) return;
|
13565 | var $linkElem = editor.selection.getSelectionContainerElem();
|
13566 | if (!$linkElem) return;
|
13567 | editor.selection.createRangeByElem($linkElem);
|
13568 | editor.selection.restoreSelection();
|
13569 | $selectedLink = $linkElem;
|
13570 | }
|
13571 | |
13572 |
|
13573 |
|
13574 |
|
13575 |
|
13576 |
|
13577 |
|
13578 | function insertLink(text, link) {
|
13579 | if (is_active_1["default"](editor)) {
|
13580 |
|
13581 | selectLinkElem();
|
13582 | editor.cmd["do"]('insertHTML', "<a href=\"" + link + "\" target=\"_blank\">" + text + "</a>");
|
13583 | } else {
|
13584 |
|
13585 | editor.cmd["do"]('insertHTML', "<a href=\"" + link + "\" target=\"_blank\">" + text + "</a>");
|
13586 | }
|
13587 | }
|
13588 | |
13589 |
|
13590 |
|
13591 |
|
13592 |
|
13593 | function delLink() {
|
13594 | if (!is_active_1["default"](editor)) {
|
13595 | return;
|
13596 | }
|
13597 |
|
13598 |
|
13599 | selectLinkElem();
|
13600 |
|
13601 | var selectionText = $selectedLink.text();
|
13602 | editor.cmd["do"]('insertHTML', '<span>' + selectionText + '</span>');
|
13603 | }
|
13604 | |
13605 |
|
13606 |
|
13607 |
|
13608 |
|
13609 |
|
13610 | function checkLink(text, link) {
|
13611 |
|
13612 | var check = editor.config.linkCheck(text, link);
|
13613 |
|
13614 | if (check === undefined) {
|
13615 | } else if (check === true) {
|
13616 |
|
13617 | return true;
|
13618 | } else {
|
13619 |
|
13620 | editor.config.customAlert(check, 'warning');
|
13621 | }
|
13622 |
|
13623 | return false;
|
13624 | }
|
13625 |
|
13626 | var conf = {
|
13627 | width: 300,
|
13628 | height: 0,
|
13629 |
|
13630 | tabs: [{
|
13631 |
|
13632 | title: editor.i18next.t('menus.panelMenus.link.链接'),
|
13633 |
|
13634 | tpl: "<div>\n <input\n id=\"" + inputTextId + "\"\n type=\"text\"\n class=\"block\"\n value=\"" + text + "\"\n placeholder=\"" + editor.i18next.t('menus.panelMenus.link.链接文字') + "\"/>\n </td>\n <input\n id=\"" + inputLinkId + "\"\n type=\"text\"\n class=\"block\"\n value=\"" + link + "\"\n placeholder=\"" + editor.i18next.t('如') + " https://...\"/>\n </td>\n <div class=\"w-e-button-container\">\n <button type=\"button\" id=\"" + btnOkId + "\" class=\"right\">\n " + editor.i18next.t('插入') + "\n </button>\n <button type=\"button\" id=\"" + btnDelId + "\" class=\"gray right\" style=\"display:" + delBtnDisplay + "\">\n " + editor.i18next.t('menus.panelMenus.link.取消链接') + "\n </button>\n </div>\n </div>",
|
13635 |
|
13636 | events: [
|
13637 | {
|
13638 | selector: '#' + btnOkId,
|
13639 | type: 'click',
|
13640 | fn: function fn() {
|
13641 | var _context, _context2;
|
13642 |
|
13643 |
|
13644 | var $link = dom_core_1["default"]('#' + inputLinkId);
|
13645 | var $text = dom_core_1["default"]('#' + inputTextId);
|
13646 | var link = (0, _trim["default"])(_context = $link.val()).call(_context);
|
13647 | var text = (0, _trim["default"])(_context2 = $text.val()).call(_context2);
|
13648 |
|
13649 | if (!link) return;
|
13650 |
|
13651 | if (!text) text = link;
|
13652 |
|
13653 | if (!checkLink(text, link)) return;
|
13654 | insertLink(text, link);
|
13655 |
|
13656 | return true;
|
13657 | }
|
13658 | },
|
13659 | {
|
13660 | selector: '#' + btnDelId,
|
13661 | type: 'click',
|
13662 | fn: function fn() {
|
13663 |
|
13664 | delLink();
|
13665 |
|
13666 | return true;
|
13667 | }
|
13668 | }]
|
13669 | }]
|
13670 | };
|
13671 | return conf;
|
13672 | }
|
13673 |
|
13674 | exports["default"] = default_1;
|
13675 |
|
13676 | }),
|
13677 |
|
13678 | (function(module, exports, __webpack_require__) {
|
13679 |
|
13680 | "use strict";
|
13681 |
|
13682 |
|
13683 |
|
13684 |
|
13685 |
|
13686 |
|
13687 | var _interopRequireDefault = __webpack_require__(0);
|
13688 |
|
13689 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13690 |
|
13691 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13692 | return mod && mod.__esModule ? mod : {
|
13693 | "default": mod
|
13694 | };
|
13695 | };
|
13696 |
|
13697 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13698 | value: true
|
13699 | });
|
13700 |
|
13701 | var tooltip_event_1 = __importDefault(__webpack_require__(317));
|
13702 |
|
13703 |
|
13704 |
|
13705 |
|
13706 |
|
13707 |
|
13708 | function bindEvent(editor) {
|
13709 |
|
13710 | tooltip_event_1["default"](editor);
|
13711 | }
|
13712 |
|
13713 | exports["default"] = bindEvent;
|
13714 |
|
13715 | }),
|
13716 |
|
13717 | (function(module, exports, __webpack_require__) {
|
13718 |
|
13719 | "use strict";
|
13720 |
|
13721 |
|
13722 |
|
13723 |
|
13724 |
|
13725 |
|
13726 | var _interopRequireDefault = __webpack_require__(0);
|
13727 |
|
13728 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13729 |
|
13730 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13731 | return mod && mod.__esModule ? mod : {
|
13732 | "default": mod
|
13733 | };
|
13734 | };
|
13735 |
|
13736 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13737 | value: true
|
13738 | });
|
13739 |
|
13740 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
13741 |
|
13742 | var Tooltip_1 = __importDefault(__webpack_require__(44));
|
13743 |
|
13744 |
|
13745 |
|
13746 |
|
13747 |
|
13748 | function createShowHideFn(editor) {
|
13749 | var tooltip;
|
13750 | |
13751 |
|
13752 |
|
13753 |
|
13754 |
|
13755 | function showLinkTooltip($link) {
|
13756 | var conf = [{
|
13757 | $elem: dom_core_1["default"]("<span>" + editor.i18next.t('menus.panelMenus.link.查看链接') + "</span>"),
|
13758 | onClick: function onClick(editor, $link) {
|
13759 | var link = $link.attr('href');
|
13760 | window.open(link, '_target');
|
13761 |
|
13762 | return true;
|
13763 | }
|
13764 | }, {
|
13765 | $elem: dom_core_1["default"]("<span>" + editor.i18next.t('menus.panelMenus.link.取消链接') + "</span>"),
|
13766 | onClick: function onClick(editor, $link) {
|
13767 |
|
13768 | editor.selection.createRangeByElem($link);
|
13769 | editor.selection.restoreSelection();
|
13770 |
|
13771 | var selectionText = $link.text();
|
13772 | editor.cmd["do"]('insertHTML', '<span>' + selectionText + '</span>');
|
13773 |
|
13774 | return true;
|
13775 | }
|
13776 | }];
|
13777 |
|
13778 | tooltip = new Tooltip_1["default"](editor, $link, conf);
|
13779 | tooltip.create();
|
13780 | }
|
13781 | |
13782 |
|
13783 |
|
13784 |
|
13785 |
|
13786 | function hideLinkTooltip() {
|
13787 |
|
13788 | if (tooltip) {
|
13789 | tooltip.remove();
|
13790 | tooltip = null;
|
13791 | }
|
13792 | }
|
13793 |
|
13794 | return {
|
13795 | showLinkTooltip: showLinkTooltip,
|
13796 | hideLinkTooltip: hideLinkTooltip
|
13797 | };
|
13798 | }
|
13799 |
|
13800 |
|
13801 |
|
13802 |
|
13803 |
|
13804 |
|
13805 | function bindTooltipEvent(editor) {
|
13806 | var _a = createShowHideFn(editor),
|
13807 | showLinkTooltip = _a.showLinkTooltip,
|
13808 | hideLinkTooltip = _a.hideLinkTooltip;
|
13809 |
|
13810 |
|
13811 | editor.txt.eventHooks.linkClickEvents.push(showLinkTooltip);
|
13812 |
|
13813 | editor.txt.eventHooks.clickEvents.push(hideLinkTooltip);
|
13814 | editor.txt.eventHooks.keyupEvents.push(hideLinkTooltip);
|
13815 | editor.txt.eventHooks.toolbarClickEvents.push(hideLinkTooltip);
|
13816 | editor.txt.eventHooks.menuClickEvents.push(hideLinkTooltip);
|
13817 | editor.txt.eventHooks.textScrollEvents.push(hideLinkTooltip);
|
13818 | }
|
13819 |
|
13820 | exports["default"] = bindTooltipEvent;
|
13821 |
|
13822 | }),
|
13823 |
|
13824 | (function(module, exports, __webpack_require__) {
|
13825 |
|
13826 | "use strict";
|
13827 |
|
13828 |
|
13829 |
|
13830 |
|
13831 |
|
13832 |
|
13833 | var _interopRequireDefault = __webpack_require__(0);
|
13834 |
|
13835 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13836 |
|
13837 | var _create = _interopRequireDefault(__webpack_require__(3));
|
13838 |
|
13839 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
13840 |
|
13841 | var __extends = void 0 && (void 0).__extends || function () {
|
13842 | var _extendStatics = function extendStatics(d, b) {
|
13843 | _extendStatics = _setPrototypeOf["default"] || {
|
13844 | __proto__: []
|
13845 | } instanceof Array && function (d, b) {
|
13846 | d.__proto__ = b;
|
13847 | } || function (d, b) {
|
13848 | for (var p in b) {
|
13849 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
13850 | }
|
13851 | };
|
13852 |
|
13853 | return _extendStatics(d, b);
|
13854 | };
|
13855 |
|
13856 | return function (d, b) {
|
13857 | _extendStatics(d, b);
|
13858 |
|
13859 | function __() {
|
13860 | this.constructor = d;
|
13861 | }
|
13862 |
|
13863 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
13864 | };
|
13865 | }();
|
13866 |
|
13867 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13868 | return mod && mod.__esModule ? mod : {
|
13869 | "default": mod
|
13870 | };
|
13871 | };
|
13872 |
|
13873 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13874 | value: true
|
13875 | });
|
13876 |
|
13877 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
13878 |
|
13879 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
13880 |
|
13881 | var Italic =
|
13882 |
|
13883 | function (_super) {
|
13884 | __extends(Italic, _super);
|
13885 |
|
13886 | function Italic(editor) {
|
13887 | var _this = this;
|
13888 |
|
13889 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u659C\u4F53\">\n <i class=\"w-e-icon-italic\"></i>\n </div>");
|
13890 | _this = _super.call(this, $elem, editor) || this;
|
13891 | return _this;
|
13892 | }
|
13893 | |
13894 |
|
13895 |
|
13896 |
|
13897 |
|
13898 | Italic.prototype.clickHandler = function () {
|
13899 | var editor = this.editor;
|
13900 | var isSelectEmpty = editor.selection.isSelectionEmpty();
|
13901 |
|
13902 | if (isSelectEmpty) {
|
13903 |
|
13904 | editor.selection.createEmptyRange();
|
13905 | }
|
13906 |
|
13907 |
|
13908 | editor.cmd["do"]('italic');
|
13909 |
|
13910 | if (isSelectEmpty) {
|
13911 |
|
13912 | editor.selection.collapseRange();
|
13913 | editor.selection.restoreSelection();
|
13914 | }
|
13915 | };
|
13916 | |
13917 |
|
13918 |
|
13919 |
|
13920 |
|
13921 | Italic.prototype.tryChangeActive = function () {
|
13922 | var editor = this.editor;
|
13923 |
|
13924 | if (editor.cmd.queryCommandState('italic')) {
|
13925 | this.active();
|
13926 | } else {
|
13927 | this.unActive();
|
13928 | }
|
13929 | };
|
13930 |
|
13931 | return Italic;
|
13932 | }(BtnMenu_1["default"]);
|
13933 |
|
13934 | exports["default"] = Italic;
|
13935 |
|
13936 | }),
|
13937 |
|
13938 | (function(module, exports, __webpack_require__) {
|
13939 |
|
13940 | "use strict";
|
13941 |
|
13942 |
|
13943 |
|
13944 |
|
13945 |
|
13946 |
|
13947 |
|
13948 | var _interopRequireDefault = __webpack_require__(0);
|
13949 |
|
13950 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
13951 |
|
13952 | var _create = _interopRequireDefault(__webpack_require__(3));
|
13953 |
|
13954 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
13955 |
|
13956 | var __extends = void 0 && (void 0).__extends || function () {
|
13957 | var _extendStatics = function extendStatics(d, b) {
|
13958 | _extendStatics = _setPrototypeOf["default"] || {
|
13959 | __proto__: []
|
13960 | } instanceof Array && function (d, b) {
|
13961 | d.__proto__ = b;
|
13962 | } || function (d, b) {
|
13963 | for (var p in b) {
|
13964 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
13965 | }
|
13966 | };
|
13967 |
|
13968 | return _extendStatics(d, b);
|
13969 | };
|
13970 |
|
13971 | return function (d, b) {
|
13972 | _extendStatics(d, b);
|
13973 |
|
13974 | function __() {
|
13975 | this.constructor = d;
|
13976 | }
|
13977 |
|
13978 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
13979 | };
|
13980 | }();
|
13981 |
|
13982 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
13983 | return mod && mod.__esModule ? mod : {
|
13984 | "default": mod
|
13985 | };
|
13986 | };
|
13987 |
|
13988 | (0, _defineProperty["default"])(exports, "__esModule", {
|
13989 | value: true
|
13990 | });
|
13991 |
|
13992 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
13993 |
|
13994 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
13995 |
|
13996 | var Underline =
|
13997 |
|
13998 | function (_super) {
|
13999 | __extends(Underline, _super);
|
14000 |
|
14001 | function Underline(editor) {
|
14002 | var _this = this;
|
14003 |
|
14004 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u4E0B\u5212\u7EBF\">\n <i class=\"w-e-icon-underline\"></i>\n </div>");
|
14005 | _this = _super.call(this, $elem, editor) || this;
|
14006 | return _this;
|
14007 | }
|
14008 | |
14009 |
|
14010 |
|
14011 |
|
14012 |
|
14013 | Underline.prototype.clickHandler = function () {
|
14014 | var editor = this.editor;
|
14015 | var isSelectEmpty = editor.selection.isSelectionEmpty();
|
14016 |
|
14017 | if (isSelectEmpty) {
|
14018 |
|
14019 | editor.selection.createEmptyRange();
|
14020 | }
|
14021 |
|
14022 |
|
14023 | editor.cmd["do"]('underline');
|
14024 |
|
14025 | if (isSelectEmpty) {
|
14026 |
|
14027 | editor.selection.collapseRange();
|
14028 | editor.selection.restoreSelection();
|
14029 | }
|
14030 | };
|
14031 | |
14032 |
|
14033 |
|
14034 |
|
14035 |
|
14036 | Underline.prototype.tryChangeActive = function () {
|
14037 | var editor = this.editor;
|
14038 |
|
14039 | if (editor.cmd.queryCommandState('underline')) {
|
14040 | this.active();
|
14041 | } else {
|
14042 | this.unActive();
|
14043 | }
|
14044 | };
|
14045 |
|
14046 | return Underline;
|
14047 | }(BtnMenu_1["default"]);
|
14048 |
|
14049 | exports["default"] = Underline;
|
14050 |
|
14051 | }),
|
14052 |
|
14053 | (function(module, exports, __webpack_require__) {
|
14054 |
|
14055 | "use strict";
|
14056 |
|
14057 |
|
14058 |
|
14059 |
|
14060 |
|
14061 |
|
14062 | var _interopRequireDefault = __webpack_require__(0);
|
14063 |
|
14064 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14065 |
|
14066 | var _create = _interopRequireDefault(__webpack_require__(3));
|
14067 |
|
14068 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
14069 |
|
14070 | var __extends = void 0 && (void 0).__extends || function () {
|
14071 | var _extendStatics = function extendStatics(d, b) {
|
14072 | _extendStatics = _setPrototypeOf["default"] || {
|
14073 | __proto__: []
|
14074 | } instanceof Array && function (d, b) {
|
14075 | d.__proto__ = b;
|
14076 | } || function (d, b) {
|
14077 | for (var p in b) {
|
14078 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
14079 | }
|
14080 | };
|
14081 |
|
14082 | return _extendStatics(d, b);
|
14083 | };
|
14084 |
|
14085 | return function (d, b) {
|
14086 | _extendStatics(d, b);
|
14087 |
|
14088 | function __() {
|
14089 | this.constructor = d;
|
14090 | }
|
14091 |
|
14092 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
14093 | };
|
14094 | }();
|
14095 |
|
14096 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14097 | return mod && mod.__esModule ? mod : {
|
14098 | "default": mod
|
14099 | };
|
14100 | };
|
14101 |
|
14102 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14103 | value: true
|
14104 | });
|
14105 |
|
14106 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
14107 |
|
14108 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14109 |
|
14110 | var StrikeThrough =
|
14111 |
|
14112 | function (_super) {
|
14113 | __extends(StrikeThrough, _super);
|
14114 |
|
14115 | function StrikeThrough(editor) {
|
14116 | var _this = this;
|
14117 |
|
14118 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u5220\u9664\u7EBF\">\n <i class=\"w-e-icon-strikethrough\"></i>\n </div>");
|
14119 | _this = _super.call(this, $elem, editor) || this;
|
14120 | return _this;
|
14121 | }
|
14122 | |
14123 |
|
14124 |
|
14125 |
|
14126 |
|
14127 | StrikeThrough.prototype.clickHandler = function () {
|
14128 | var editor = this.editor;
|
14129 | var isSelectEmpty = editor.selection.isSelectionEmpty();
|
14130 |
|
14131 | if (isSelectEmpty) {
|
14132 |
|
14133 | editor.selection.createEmptyRange();
|
14134 | }
|
14135 |
|
14136 |
|
14137 | editor.cmd["do"]('strikeThrough');
|
14138 |
|
14139 | if (isSelectEmpty) {
|
14140 |
|
14141 | editor.selection.collapseRange();
|
14142 | editor.selection.restoreSelection();
|
14143 | }
|
14144 | };
|
14145 | |
14146 |
|
14147 |
|
14148 |
|
14149 |
|
14150 | StrikeThrough.prototype.tryChangeActive = function () {
|
14151 | var editor = this.editor;
|
14152 |
|
14153 | if (editor.cmd.queryCommandState('strikeThrough')) {
|
14154 | this.active();
|
14155 | } else {
|
14156 | this.unActive();
|
14157 | }
|
14158 | };
|
14159 |
|
14160 | return StrikeThrough;
|
14161 | }(BtnMenu_1["default"]);
|
14162 |
|
14163 | exports["default"] = StrikeThrough;
|
14164 |
|
14165 | }),
|
14166 |
|
14167 | (function(module, exports, __webpack_require__) {
|
14168 |
|
14169 | "use strict";
|
14170 |
|
14171 |
|
14172 |
|
14173 |
|
14174 |
|
14175 |
|
14176 |
|
14177 | var _interopRequireDefault = __webpack_require__(0);
|
14178 |
|
14179 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14180 |
|
14181 | var _create = _interopRequireDefault(__webpack_require__(3));
|
14182 |
|
14183 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
14184 |
|
14185 | var __extends = void 0 && (void 0).__extends || function () {
|
14186 | var _extendStatics = function extendStatics(d, b) {
|
14187 | _extendStatics = _setPrototypeOf["default"] || {
|
14188 | __proto__: []
|
14189 | } instanceof Array && function (d, b) {
|
14190 | d.__proto__ = b;
|
14191 | } || function (d, b) {
|
14192 | for (var p in b) {
|
14193 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
14194 | }
|
14195 | };
|
14196 |
|
14197 | return _extendStatics(d, b);
|
14198 | };
|
14199 |
|
14200 | return function (d, b) {
|
14201 | _extendStatics(d, b);
|
14202 |
|
14203 | function __() {
|
14204 | this.constructor = d;
|
14205 | }
|
14206 |
|
14207 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
14208 | };
|
14209 | }();
|
14210 |
|
14211 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14212 | return mod && mod.__esModule ? mod : {
|
14213 | "default": mod
|
14214 | };
|
14215 | };
|
14216 |
|
14217 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14218 | value: true
|
14219 | });
|
14220 |
|
14221 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
14222 |
|
14223 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14224 |
|
14225 | var FontStyleList_1 = __importDefault(__webpack_require__(322));
|
14226 |
|
14227 | var FontStyle =
|
14228 |
|
14229 | function (_super) {
|
14230 | __extends(FontStyle, _super);
|
14231 |
|
14232 | function FontStyle(editor) {
|
14233 | var _this = this;
|
14234 |
|
14235 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u5B57\u4F53\">\n <i class=\"w-e-icon-font\"></i>\n </div>");
|
14236 | var fontStyleList = new FontStyleList_1["default"](editor.config.fontNames);
|
14237 | var fontListConf = {
|
14238 | width: 100,
|
14239 | title: '设置字体',
|
14240 | type: 'list',
|
14241 | list: fontStyleList.getItemList(),
|
14242 | clickHandler: function clickHandler(value) {
|
14243 |
|
14244 | _this.command(value);
|
14245 | }
|
14246 | };
|
14247 | _this = _super.call(this, $elem, editor, fontListConf) || this;
|
14248 | return _this;
|
14249 | }
|
14250 | |
14251 |
|
14252 |
|
14253 |
|
14254 |
|
14255 |
|
14256 | FontStyle.prototype.command = function (value) {
|
14257 | var _a;
|
14258 |
|
14259 | var editor = this.editor;
|
14260 | var isEmptySelection = editor.selection.isSelectionEmpty();
|
14261 | var $selectionElem = (_a = editor.selection.getSelectionContainerElem()) === null || _a === void 0 ? void 0 : _a.elems[0];
|
14262 | var isFont = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.nodeName.toLowerCase()) !== 'p';
|
14263 | var isSameValue = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.getAttribute('face')) === value;
|
14264 |
|
14265 | if (isEmptySelection) {
|
14266 | if (isFont && !isSameValue) {
|
14267 | var $elems = editor.selection.getSelectionRangeTopNodes(editor);
|
14268 | editor.selection.createRangeByElem($elems[0]);
|
14269 | editor.selection.moveCursor($elems[0].elems[0]);
|
14270 | }
|
14271 |
|
14272 |
|
14273 | editor.selection.createEmptyRange();
|
14274 | }
|
14275 |
|
14276 | editor.cmd["do"]('fontName', value);
|
14277 |
|
14278 | if (isEmptySelection) {
|
14279 |
|
14280 | editor.selection.collapseRange();
|
14281 | editor.selection.restoreSelection();
|
14282 | }
|
14283 | };
|
14284 | |
14285 |
|
14286 |
|
14287 |
|
14288 |
|
14289 |
|
14290 | FontStyle.prototype.tryChangeActive = function () {
|
14291 |
|
14292 |
|
14293 |
|
14294 |
|
14295 |
|
14296 |
|
14297 | };
|
14298 |
|
14299 | return FontStyle;
|
14300 | }(DropListMenu_1["default"]);
|
14301 |
|
14302 | exports["default"] = FontStyle;
|
14303 |
|
14304 | }),
|
14305 |
|
14306 | (function(module, exports, __webpack_require__) {
|
14307 |
|
14308 | "use strict";
|
14309 |
|
14310 |
|
14311 | var _interopRequireDefault = __webpack_require__(0);
|
14312 |
|
14313 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
14314 |
|
14315 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14316 |
|
14317 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14318 | return mod && mod.__esModule ? mod : {
|
14319 | "default": mod
|
14320 | };
|
14321 | };
|
14322 |
|
14323 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14324 | value: true
|
14325 | });
|
14326 |
|
14327 |
|
14328 |
|
14329 |
|
14330 |
|
14331 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14332 |
|
14333 |
|
14334 |
|
14335 |
|
14336 |
|
14337 |
|
14338 |
|
14339 |
|
14340 | var FontStyleList =
|
14341 |
|
14342 | function () {
|
14343 | function FontStyleList(list) {
|
14344 | var _this = this;
|
14345 |
|
14346 | this.itemList = [];
|
14347 | (0, _forEach["default"])(list).call(list, function (fontValue) {
|
14348 | _this.itemList.push({
|
14349 | $elem: dom_core_1["default"]("<p style=\"font-family:'" + fontValue + "'\">" + fontValue + "</p>"),
|
14350 | value: fontValue
|
14351 | });
|
14352 | });
|
14353 | }
|
14354 |
|
14355 | FontStyleList.prototype.getItemList = function () {
|
14356 | return this.itemList;
|
14357 | };
|
14358 |
|
14359 | return FontStyleList;
|
14360 | }();
|
14361 |
|
14362 | exports["default"] = FontStyleList;
|
14363 |
|
14364 | }),
|
14365 |
|
14366 | (function(module, exports, __webpack_require__) {
|
14367 |
|
14368 | "use strict";
|
14369 |
|
14370 |
|
14371 |
|
14372 |
|
14373 |
|
14374 |
|
14375 |
|
14376 | var _interopRequireDefault = __webpack_require__(0);
|
14377 |
|
14378 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14379 |
|
14380 | var _create = _interopRequireDefault(__webpack_require__(3));
|
14381 |
|
14382 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
14383 |
|
14384 | var __extends = void 0 && (void 0).__extends || function () {
|
14385 | var _extendStatics = function extendStatics(d, b) {
|
14386 | _extendStatics = _setPrototypeOf["default"] || {
|
14387 | __proto__: []
|
14388 | } instanceof Array && function (d, b) {
|
14389 | d.__proto__ = b;
|
14390 | } || function (d, b) {
|
14391 | for (var p in b) {
|
14392 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
14393 | }
|
14394 | };
|
14395 |
|
14396 | return _extendStatics(d, b);
|
14397 | };
|
14398 |
|
14399 | return function (d, b) {
|
14400 | _extendStatics(d, b);
|
14401 |
|
14402 | function __() {
|
14403 | this.constructor = d;
|
14404 | }
|
14405 |
|
14406 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
14407 | };
|
14408 | }();
|
14409 |
|
14410 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14411 | return mod && mod.__esModule ? mod : {
|
14412 | "default": mod
|
14413 | };
|
14414 | };
|
14415 |
|
14416 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14417 | value: true
|
14418 | });
|
14419 |
|
14420 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
14421 |
|
14422 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14423 |
|
14424 | var FontSizeList_1 = __importDefault(__webpack_require__(324));
|
14425 |
|
14426 | var FontSize =
|
14427 |
|
14428 | function (_super) {
|
14429 | __extends(FontSize, _super);
|
14430 |
|
14431 | function FontSize(editor) {
|
14432 | var _this = this;
|
14433 |
|
14434 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u5B57\u53F7\">\n <i class=\"w-e-icon-text-heigh\"></i>\n </div>");
|
14435 | var fontStyleList = new FontSizeList_1["default"](editor.config.fontSizes);
|
14436 | var fontListConf = {
|
14437 | width: 160,
|
14438 | title: '设置字号',
|
14439 | type: 'list',
|
14440 | list: fontStyleList.getItemList(),
|
14441 | clickHandler: function clickHandler(value) {
|
14442 |
|
14443 | _this.command(value);
|
14444 | }
|
14445 | };
|
14446 | _this = _super.call(this, $elem, editor, fontListConf) || this;
|
14447 | return _this;
|
14448 | }
|
14449 | |
14450 |
|
14451 |
|
14452 |
|
14453 |
|
14454 |
|
14455 | FontSize.prototype.command = function (value) {
|
14456 | var _a;
|
14457 |
|
14458 | var editor = this.editor;
|
14459 | var isEmptySelection = editor.selection.isSelectionEmpty();
|
14460 | var $selectionElem = (_a = editor.selection.getSelectionContainerElem()) === null || _a === void 0 ? void 0 : _a.elems[0];
|
14461 | var isFont = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.nodeName.toLowerCase()) !== 'p';
|
14462 | var isSameSize = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.getAttribute('size')) === value;
|
14463 |
|
14464 | if (isEmptySelection) {
|
14465 | if (isFont && !isSameSize) {
|
14466 | var $elems = editor.selection.getSelectionRangeTopNodes(editor);
|
14467 | editor.selection.createRangeByElem($elems[0]);
|
14468 | editor.selection.moveCursor($elems[0].elems[0]);
|
14469 | }
|
14470 |
|
14471 |
|
14472 | editor.selection.createEmptyRange();
|
14473 | }
|
14474 |
|
14475 | editor.cmd["do"]('fontSize', value);
|
14476 |
|
14477 | if (isEmptySelection) {
|
14478 |
|
14479 | editor.selection.collapseRange();
|
14480 | editor.selection.restoreSelection();
|
14481 | }
|
14482 | };
|
14483 | |
14484 |
|
14485 |
|
14486 |
|
14487 |
|
14488 |
|
14489 | FontSize.prototype.tryChangeActive = function () {};
|
14490 |
|
14491 | return FontSize;
|
14492 | }(DropListMenu_1["default"]);
|
14493 |
|
14494 | exports["default"] = FontSize;
|
14495 |
|
14496 | }),
|
14497 |
|
14498 | (function(module, exports, __webpack_require__) {
|
14499 |
|
14500 | "use strict";
|
14501 |
|
14502 |
|
14503 | var _interopRequireDefault = __webpack_require__(0);
|
14504 |
|
14505 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14506 |
|
14507 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14508 | return mod && mod.__esModule ? mod : {
|
14509 | "default": mod
|
14510 | };
|
14511 | };
|
14512 |
|
14513 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14514 | value: true
|
14515 | });
|
14516 |
|
14517 |
|
14518 |
|
14519 |
|
14520 |
|
14521 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14522 |
|
14523 |
|
14524 |
|
14525 |
|
14526 |
|
14527 | var FontSizeList =
|
14528 |
|
14529 | function () {
|
14530 | function FontSizeList(list) {
|
14531 | this.itemList = [];
|
14532 |
|
14533 | for (var key in list) {
|
14534 | var item = list[key];
|
14535 | this.itemList.push({
|
14536 | $elem: dom_core_1["default"]("<p style=\"font-size:" + key + "\">" + item.name + "</p>"),
|
14537 | value: item.value
|
14538 | });
|
14539 | }
|
14540 | }
|
14541 |
|
14542 | FontSizeList.prototype.getItemList = function () {
|
14543 | return this.itemList;
|
14544 | };
|
14545 |
|
14546 | return FontSizeList;
|
14547 | }();
|
14548 |
|
14549 | exports["default"] = FontSizeList;
|
14550 |
|
14551 | }),
|
14552 |
|
14553 | (function(module, exports, __webpack_require__) {
|
14554 |
|
14555 | "use strict";
|
14556 |
|
14557 |
|
14558 |
|
14559 |
|
14560 |
|
14561 |
|
14562 | var _interopRequireDefault = __webpack_require__(0);
|
14563 |
|
14564 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
14565 |
|
14566 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14567 |
|
14568 | var _create = _interopRequireDefault(__webpack_require__(3));
|
14569 |
|
14570 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
14571 |
|
14572 | var __extends = void 0 && (void 0).__extends || function () {
|
14573 | var _extendStatics = function extendStatics(d, b) {
|
14574 | _extendStatics = _setPrototypeOf["default"] || {
|
14575 | __proto__: []
|
14576 | } instanceof Array && function (d, b) {
|
14577 | d.__proto__ = b;
|
14578 | } || function (d, b) {
|
14579 | for (var p in b) {
|
14580 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
14581 | }
|
14582 | };
|
14583 |
|
14584 | return _extendStatics(d, b);
|
14585 | };
|
14586 |
|
14587 | return function (d, b) {
|
14588 | _extendStatics(d, b);
|
14589 |
|
14590 | function __() {
|
14591 | this.constructor = d;
|
14592 | }
|
14593 |
|
14594 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
14595 | };
|
14596 | }();
|
14597 |
|
14598 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14599 | return mod && mod.__esModule ? mod : {
|
14600 | "default": mod
|
14601 | };
|
14602 | };
|
14603 |
|
14604 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14605 | value: true
|
14606 | });
|
14607 |
|
14608 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
14609 |
|
14610 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14611 |
|
14612 | var Justify =
|
14613 |
|
14614 | function (_super) {
|
14615 | __extends(Justify, _super);
|
14616 |
|
14617 | function Justify(editor) {
|
14618 | var _this = this;
|
14619 |
|
14620 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="对齐"><i class="w-e-icon-paragraph-left"></i></div>');
|
14621 | var dropListConf = {
|
14622 | width: 100,
|
14623 | title: '对齐方式',
|
14624 | type: 'list',
|
14625 | list: [{
|
14626 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-paragraph-left w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.justify.靠左') + "\n </p>"),
|
14627 | value: 'justifyLeft'
|
14628 | }, {
|
14629 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-paragraph-center w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.justify.居中') + "\n </p>"),
|
14630 | value: 'justifyCenter'
|
14631 | }, {
|
14632 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-paragraph-right w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.justify.靠右') + "\n </p>"),
|
14633 | value: 'justifyRight'
|
14634 | }, {
|
14635 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-paragraph-justify w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.justify.两端') + "\n </p>"),
|
14636 | value: 'justifyFull'
|
14637 | }],
|
14638 | clickHandler: function clickHandler(value) {
|
14639 |
|
14640 | _this.command(value);
|
14641 | }
|
14642 | };
|
14643 | _this = _super.call(this, $elem, editor, dropListConf) || this;
|
14644 | return _this;
|
14645 | }
|
14646 | |
14647 |
|
14648 |
|
14649 |
|
14650 |
|
14651 |
|
14652 | Justify.prototype.command = function (value) {
|
14653 | var editor = this.editor;
|
14654 | var selection = editor.selection;
|
14655 | var $selectionElem = selection.getSelectionContainerElem();
|
14656 |
|
14657 | selection.saveRange();
|
14658 |
|
14659 | var justifyClass = {
|
14660 | justifyLeft: 'left',
|
14661 | justifyCenter: 'center',
|
14662 | justifyRight: 'right',
|
14663 | justifyFull: 'justify'
|
14664 | };
|
14665 |
|
14666 | var $elems = editor.selection.getSelectionRangeTopNodes(editor);
|
14667 |
|
14668 | if ($selectionElem) {
|
14669 |
|
14670 | var justifyValue_1 = justifyClass[value];
|
14671 | (0, _forEach["default"])($elems).call($elems, function (el) {
|
14672 | el.css('text-align', justifyValue_1);
|
14673 | });
|
14674 | }
|
14675 |
|
14676 |
|
14677 | selection.restoreSelection();
|
14678 | };
|
14679 | |
14680 |
|
14681 |
|
14682 |
|
14683 |
|
14684 |
|
14685 |
|
14686 | Justify.prototype.tryChangeActive = function () {
|
14687 |
|
14688 |
|
14689 |
|
14690 |
|
14691 |
|
14692 |
|
14693 | };
|
14694 |
|
14695 | return Justify;
|
14696 | }(DropListMenu_1["default"]);
|
14697 |
|
14698 | exports["default"] = Justify;
|
14699 |
|
14700 | }),
|
14701 |
|
14702 | (function(module, exports, __webpack_require__) {
|
14703 |
|
14704 | "use strict";
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 | var _interopRequireDefault = __webpack_require__(0);
|
14712 |
|
14713 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
14714 |
|
14715 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14716 |
|
14717 | var _create = _interopRequireDefault(__webpack_require__(3));
|
14718 |
|
14719 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
14720 |
|
14721 | var __extends = void 0 && (void 0).__extends || function () {
|
14722 | var _extendStatics = function extendStatics(d, b) {
|
14723 | _extendStatics = _setPrototypeOf["default"] || {
|
14724 | __proto__: []
|
14725 | } instanceof Array && function (d, b) {
|
14726 | d.__proto__ = b;
|
14727 | } || function (d, b) {
|
14728 | for (var p in b) {
|
14729 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
14730 | }
|
14731 | };
|
14732 |
|
14733 | return _extendStatics(d, b);
|
14734 | };
|
14735 |
|
14736 | return function (d, b) {
|
14737 | _extendStatics(d, b);
|
14738 |
|
14739 | function __() {
|
14740 | this.constructor = d;
|
14741 | }
|
14742 |
|
14743 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
14744 | };
|
14745 | }();
|
14746 |
|
14747 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14748 | return mod && mod.__esModule ? mod : {
|
14749 | "default": mod
|
14750 | };
|
14751 | };
|
14752 |
|
14753 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14754 | value: true
|
14755 | });
|
14756 |
|
14757 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14758 |
|
14759 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
14760 |
|
14761 | var bind_event_1 = __importDefault(__webpack_require__(327));
|
14762 |
|
14763 | var create_quote_node_1 = __importDefault(__webpack_require__(328));
|
14764 |
|
14765 | var Quote =
|
14766 |
|
14767 | function (_super) {
|
14768 | __extends(Quote, _super);
|
14769 |
|
14770 | function Quote(editor) {
|
14771 | var _this = this;
|
14772 |
|
14773 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u5F15\u7528\">\n <i class=\"w-e-icon-quotes-left\"></i>\n </div>");
|
14774 | _this = _super.call(this, $elem, editor) || this;
|
14775 | bind_event_1["default"](editor);
|
14776 | return _this;
|
14777 | }
|
14778 | |
14779 |
|
14780 |
|
14781 |
|
14782 |
|
14783 | Quote.prototype.clickHandler = function () {
|
14784 | var _a;
|
14785 |
|
14786 | var editor = this.editor;
|
14787 | var isSelectEmpty = editor.selection.isSelectionEmpty();
|
14788 | var topNodeElem = editor.selection.getSelectionRangeTopNodes(editor);
|
14789 | var $topNodeElem = topNodeElem[topNodeElem.length - 1];
|
14790 | var nodeName = this.getTopNodeName();
|
14791 |
|
14792 |
|
14793 | if (nodeName === 'BLOCKQUOTE') {
|
14794 |
|
14795 | var $targetELem = dom_core_1["default"]($topNodeElem.childNodes());
|
14796 | var len = $targetELem.length;
|
14797 | var $middle_1 = $topNodeElem;
|
14798 | (0, _forEach["default"])($targetELem).call($targetELem, function (elem) {
|
14799 | var $elem = dom_core_1["default"](elem);
|
14800 | $elem.insertAfter($middle_1);
|
14801 | $middle_1 = $elem;
|
14802 | });
|
14803 | $topNodeElem.remove();
|
14804 | editor.selection.moveCursor($targetELem.elems[len - 1]);
|
14805 |
|
14806 | this.tryChangeActive();
|
14807 | } else {
|
14808 |
|
14809 | var $quote = create_quote_node_1["default"](topNodeElem);
|
14810 | $quote.insertAfter($topNodeElem);
|
14811 | this.delSelectNode(topNodeElem);
|
14812 | var moveNode = (_a = $quote.childNodes()) === null || _a === void 0 ? void 0 : _a.last().getNode();
|
14813 |
|
14814 | moveNode.textContent ? editor.selection.moveCursor(moveNode) : editor.selection.moveCursor(moveNode, 0);
|
14815 |
|
14816 | this.tryChangeActive();
|
14817 |
|
14818 | dom_core_1["default"]("<p><br></p>").insertAfter($quote);
|
14819 | return;
|
14820 | }
|
14821 |
|
14822 | if (isSelectEmpty) {
|
14823 |
|
14824 | editor.selection.collapseRange();
|
14825 | editor.selection.restoreSelection();
|
14826 | }
|
14827 | };
|
14828 | |
14829 |
|
14830 |
|
14831 |
|
14832 |
|
14833 | Quote.prototype.tryChangeActive = function () {
|
14834 | var _a;
|
14835 |
|
14836 | var editor = this.editor;
|
14837 | var cmdValue = (_a = editor.selection.getSelectionRangeTopNodes(editor)[0]) === null || _a === void 0 ? void 0 : _a.getNodeName();
|
14838 |
|
14839 | if (cmdValue === 'BLOCKQUOTE') {
|
14840 | this.active();
|
14841 | } else {
|
14842 | this.unActive();
|
14843 | }
|
14844 | };
|
14845 | |
14846 |
|
14847 |
|
14848 |
|
14849 |
|
14850 |
|
14851 |
|
14852 | Quote.prototype.getTopNodeName = function () {
|
14853 | var editor = this.editor;
|
14854 | var $topNodeElem = editor.selection.getSelectionRangeTopNodes(editor)[0];
|
14855 | var nodeName = $topNodeElem === null || $topNodeElem === void 0 ? void 0 : $topNodeElem.getNodeName();
|
14856 | return nodeName;
|
14857 | };
|
14858 | |
14859 |
|
14860 |
|
14861 |
|
14862 |
|
14863 |
|
14864 | Quote.prototype.delSelectNode = function (selectElem) {
|
14865 | (0, _forEach["default"])(selectElem).call(selectElem, function (node) {
|
14866 | node.remove();
|
14867 | });
|
14868 | };
|
14869 |
|
14870 | return Quote;
|
14871 | }(BtnMenu_1["default"]);
|
14872 |
|
14873 | exports["default"] = Quote;
|
14874 |
|
14875 | }),
|
14876 |
|
14877 | (function(module, exports, __webpack_require__) {
|
14878 |
|
14879 | "use strict";
|
14880 |
|
14881 |
|
14882 | var _interopRequireDefault = __webpack_require__(0);
|
14883 |
|
14884 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14885 |
|
14886 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14887 | return mod && mod.__esModule ? mod : {
|
14888 | "default": mod
|
14889 | };
|
14890 | };
|
14891 |
|
14892 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14893 | value: true
|
14894 | });
|
14895 |
|
14896 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14897 |
|
14898 | function bindEvent(editor) {
|
14899 | function quoteEnter(e) {
|
14900 | var _a;
|
14901 |
|
14902 | var $selectElem = editor.selection.getSelectionContainerElem();
|
14903 | var $topSelectElem = editor.selection.getSelectionRangeTopNodes(editor)[0];
|
14904 |
|
14905 |
|
14906 | if (($topSelectElem === null || $topSelectElem === void 0 ? void 0 : $topSelectElem.getNodeName()) === 'BLOCKQUOTE') {
|
14907 |
|
14908 | if ($selectElem.getNodeName() === 'BLOCKQUOTE') {
|
14909 | var selectNode = (_a = $selectElem.childNodes()) === null || _a === void 0 ? void 0 : _a.getNode();
|
14910 | editor.selection.moveCursor(selectNode);
|
14911 | }
|
14912 |
|
14913 | if ($selectElem.text() === '') {
|
14914 | e.preventDefault();
|
14915 | $selectElem.remove();
|
14916 | var $newLine = dom_core_1["default"]('<p><br></p>');
|
14917 | $newLine.insertAfter($topSelectElem);
|
14918 |
|
14919 | editor.selection.moveCursor($newLine.getNode(), 0);
|
14920 | }
|
14921 |
|
14922 |
|
14923 | if ($topSelectElem.text() === '') {
|
14924 | $topSelectElem.remove();
|
14925 | }
|
14926 | }
|
14927 | }
|
14928 |
|
14929 | editor.txt.eventHooks.enterDownEvents.push(quoteEnter);
|
14930 | }
|
14931 |
|
14932 | exports["default"] = bindEvent;
|
14933 |
|
14934 | }),
|
14935 |
|
14936 | (function(module, exports, __webpack_require__) {
|
14937 |
|
14938 | "use strict";
|
14939 |
|
14940 |
|
14941 | var _interopRequireDefault = __webpack_require__(0);
|
14942 |
|
14943 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
14944 |
|
14945 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14946 |
|
14947 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
14948 | return mod && mod.__esModule ? mod : {
|
14949 | "default": mod
|
14950 | };
|
14951 | };
|
14952 |
|
14953 | (0, _defineProperty["default"])(exports, "__esModule", {
|
14954 | value: true
|
14955 | });
|
14956 |
|
14957 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
14958 |
|
14959 |
|
14960 |
|
14961 |
|
14962 |
|
14963 |
|
14964 | function createQuote($childElem) {
|
14965 | var $targetElem = dom_core_1["default"]("<blockquote></blockquote>");
|
14966 | (0, _forEach["default"])($childElem).call($childElem, function (node) {
|
14967 | $targetElem.append(node.clone(true));
|
14968 | });
|
14969 | return $targetElem;
|
14970 | }
|
14971 |
|
14972 | exports["default"] = createQuote;
|
14973 |
|
14974 | }),
|
14975 |
|
14976 | (function(module, exports, __webpack_require__) {
|
14977 |
|
14978 | "use strict";
|
14979 |
|
14980 |
|
14981 |
|
14982 |
|
14983 |
|
14984 |
|
14985 |
|
14986 | var _interopRequireDefault = __webpack_require__(0);
|
14987 |
|
14988 | var _map = _interopRequireDefault(__webpack_require__(29));
|
14989 |
|
14990 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
14991 |
|
14992 | var _create = _interopRequireDefault(__webpack_require__(3));
|
14993 |
|
14994 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
14995 |
|
14996 | var __extends = void 0 && (void 0).__extends || function () {
|
14997 | var _extendStatics = function extendStatics(d, b) {
|
14998 | _extendStatics = _setPrototypeOf["default"] || {
|
14999 | __proto__: []
|
15000 | } instanceof Array && function (d, b) {
|
15001 | d.__proto__ = b;
|
15002 | } || function (d, b) {
|
15003 | for (var p in b) {
|
15004 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
15005 | }
|
15006 | };
|
15007 |
|
15008 | return _extendStatics(d, b);
|
15009 | };
|
15010 |
|
15011 | return function (d, b) {
|
15012 | _extendStatics(d, b);
|
15013 |
|
15014 | function __() {
|
15015 | this.constructor = d;
|
15016 | }
|
15017 |
|
15018 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
15019 | };
|
15020 | }();
|
15021 |
|
15022 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15023 | return mod && mod.__esModule ? mod : {
|
15024 | "default": mod
|
15025 | };
|
15026 | };
|
15027 |
|
15028 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15029 | value: true
|
15030 | });
|
15031 |
|
15032 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
15033 |
|
15034 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15035 |
|
15036 | var util_1 = __webpack_require__(7);
|
15037 |
|
15038 | var BackColor =
|
15039 |
|
15040 | function (_super) {
|
15041 | __extends(BackColor, _super);
|
15042 |
|
15043 | function BackColor(editor) {
|
15044 | var _context;
|
15045 |
|
15046 | var _this = this;
|
15047 |
|
15048 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u80CC\u666F\u8272\">\n <i class=\"w-e-icon-paint-brush\"></i>\n </div>");
|
15049 | var colorListConf = {
|
15050 | width: 120,
|
15051 | title: '背景颜色',
|
15052 |
|
15053 | type: 'inline-block',
|
15054 | list: (0, _map["default"])(_context = editor.config.colors).call(_context, function (color) {
|
15055 | return {
|
15056 | $elem: dom_core_1["default"]("<i style=\"color:" + color + ";\" class=\"w-e-icon-paint-brush\"></i>"),
|
15057 | value: color
|
15058 | };
|
15059 | }),
|
15060 | clickHandler: function clickHandler(value) {
|
15061 |
|
15062 | _this.command(value);
|
15063 | }
|
15064 | };
|
15065 | _this = _super.call(this, $elem, editor, colorListConf) || this;
|
15066 | return _this;
|
15067 | }
|
15068 | |
15069 |
|
15070 |
|
15071 |
|
15072 |
|
15073 |
|
15074 | BackColor.prototype.command = function (value) {
|
15075 | var _a;
|
15076 |
|
15077 | var editor = this.editor;
|
15078 | var isEmptySelection = editor.selection.isSelectionEmpty();
|
15079 | var $selectionElem = (_a = editor.selection.getSelectionContainerElem()) === null || _a === void 0 ? void 0 : _a.elems[0];
|
15080 | var isSpan = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.nodeName.toLowerCase()) !== 'p';
|
15081 | var bgColor = $selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.style.backgroundColor;
|
15082 | var isSameColor = util_1.hexToRgb(value) === bgColor;
|
15083 |
|
15084 | if (isEmptySelection) {
|
15085 | if (isSpan && !isSameColor) {
|
15086 | var $elems = editor.selection.getSelectionRangeTopNodes(editor);
|
15087 | editor.selection.createRangeByElem($elems[0]);
|
15088 | editor.selection.moveCursor($elems[0].elems[0]);
|
15089 | }
|
15090 |
|
15091 |
|
15092 | editor.selection.createEmptyRange();
|
15093 | }
|
15094 |
|
15095 | editor.cmd["do"]('backColor', value);
|
15096 |
|
15097 | if (isEmptySelection) {
|
15098 |
|
15099 | editor.selection.collapseRange();
|
15100 | editor.selection.restoreSelection();
|
15101 | }
|
15102 | };
|
15103 | |
15104 |
|
15105 |
|
15106 |
|
15107 |
|
15108 | BackColor.prototype.tryChangeActive = function () {};
|
15109 |
|
15110 | return BackColor;
|
15111 | }(DropListMenu_1["default"]);
|
15112 |
|
15113 | exports["default"] = BackColor;
|
15114 |
|
15115 | }),
|
15116 |
|
15117 | (function(module, exports, __webpack_require__) {
|
15118 |
|
15119 | "use strict";
|
15120 |
|
15121 |
|
15122 |
|
15123 |
|
15124 |
|
15125 |
|
15126 |
|
15127 | var _interopRequireDefault = __webpack_require__(0);
|
15128 |
|
15129 | var _map = _interopRequireDefault(__webpack_require__(29));
|
15130 |
|
15131 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15132 |
|
15133 | var _create = _interopRequireDefault(__webpack_require__(3));
|
15134 |
|
15135 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
15136 |
|
15137 | var __extends = void 0 && (void 0).__extends || function () {
|
15138 | var _extendStatics = function extendStatics(d, b) {
|
15139 | _extendStatics = _setPrototypeOf["default"] || {
|
15140 | __proto__: []
|
15141 | } instanceof Array && function (d, b) {
|
15142 | d.__proto__ = b;
|
15143 | } || function (d, b) {
|
15144 | for (var p in b) {
|
15145 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
15146 | }
|
15147 | };
|
15148 |
|
15149 | return _extendStatics(d, b);
|
15150 | };
|
15151 |
|
15152 | return function (d, b) {
|
15153 | _extendStatics(d, b);
|
15154 |
|
15155 | function __() {
|
15156 | this.constructor = d;
|
15157 | }
|
15158 |
|
15159 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
15160 | };
|
15161 | }();
|
15162 |
|
15163 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15164 | return mod && mod.__esModule ? mod : {
|
15165 | "default": mod
|
15166 | };
|
15167 | };
|
15168 |
|
15169 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15170 | value: true
|
15171 | });
|
15172 |
|
15173 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
15174 |
|
15175 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15176 |
|
15177 | var FontColor =
|
15178 |
|
15179 | function (_super) {
|
15180 | __extends(FontColor, _super);
|
15181 |
|
15182 | function FontColor(editor) {
|
15183 | var _context;
|
15184 |
|
15185 | var _this = this;
|
15186 |
|
15187 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u6587\u5B57\u989C\u8272\">\n <i class=\"w-e-icon-pencil2\"></i>\n </div>");
|
15188 | var colorListConf = {
|
15189 | width: 120,
|
15190 | title: '文字颜色',
|
15191 |
|
15192 | type: 'inline-block',
|
15193 | list: (0, _map["default"])(_context = editor.config.colors).call(_context, function (color) {
|
15194 | return {
|
15195 | $elem: dom_core_1["default"]("<i style=\"color:" + color + ";\" class=\"w-e-icon-pencil2\"></i>"),
|
15196 | value: color
|
15197 | };
|
15198 | }),
|
15199 | clickHandler: function clickHandler(value) {
|
15200 |
|
15201 | _this.command(value);
|
15202 | }
|
15203 | };
|
15204 | _this = _super.call(this, $elem, editor, colorListConf) || this;
|
15205 | return _this;
|
15206 | }
|
15207 | |
15208 |
|
15209 |
|
15210 |
|
15211 |
|
15212 |
|
15213 | FontColor.prototype.command = function (value) {
|
15214 | var _a;
|
15215 |
|
15216 | var editor = this.editor;
|
15217 | var isEmptySelection = editor.selection.isSelectionEmpty();
|
15218 | var $selectionElem = (_a = editor.selection.getSelectionContainerElem()) === null || _a === void 0 ? void 0 : _a.elems[0];
|
15219 | var isFont = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.nodeName.toLowerCase()) !== 'p';
|
15220 | var isSameColor = ($selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.getAttribute('color')) === value;
|
15221 |
|
15222 | if (isEmptySelection) {
|
15223 | if (isFont && !isSameColor) {
|
15224 | var $elems = editor.selection.getSelectionRangeTopNodes(editor);
|
15225 | editor.selection.createRangeByElem($elems[0]);
|
15226 | editor.selection.moveCursor($elems[0].elems[0]);
|
15227 | }
|
15228 |
|
15229 |
|
15230 | editor.selection.createEmptyRange();
|
15231 | }
|
15232 |
|
15233 | editor.cmd["do"]('foreColor', value);
|
15234 |
|
15235 | if (isEmptySelection) {
|
15236 |
|
15237 | editor.selection.collapseRange();
|
15238 | editor.selection.restoreSelection();
|
15239 | }
|
15240 | };
|
15241 | |
15242 |
|
15243 |
|
15244 |
|
15245 |
|
15246 | FontColor.prototype.tryChangeActive = function () {};
|
15247 |
|
15248 | return FontColor;
|
15249 | }(DropListMenu_1["default"]);
|
15250 |
|
15251 | exports["default"] = FontColor;
|
15252 |
|
15253 | }),
|
15254 |
|
15255 | (function(module, exports, __webpack_require__) {
|
15256 |
|
15257 | "use strict";
|
15258 |
|
15259 |
|
15260 |
|
15261 |
|
15262 |
|
15263 |
|
15264 | var _interopRequireDefault = __webpack_require__(0);
|
15265 |
|
15266 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15267 |
|
15268 | var _create = _interopRequireDefault(__webpack_require__(3));
|
15269 |
|
15270 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
15271 |
|
15272 | var __extends = void 0 && (void 0).__extends || function () {
|
15273 | var _extendStatics = function extendStatics(d, b) {
|
15274 | _extendStatics = _setPrototypeOf["default"] || {
|
15275 | __proto__: []
|
15276 | } instanceof Array && function (d, b) {
|
15277 | d.__proto__ = b;
|
15278 | } || function (d, b) {
|
15279 | for (var p in b) {
|
15280 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
15281 | }
|
15282 | };
|
15283 |
|
15284 | return _extendStatics(d, b);
|
15285 | };
|
15286 |
|
15287 | return function (d, b) {
|
15288 | _extendStatics(d, b);
|
15289 |
|
15290 | function __() {
|
15291 | this.constructor = d;
|
15292 | }
|
15293 |
|
15294 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
15295 | };
|
15296 | }();
|
15297 |
|
15298 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15299 | return mod && mod.__esModule ? mod : {
|
15300 | "default": mod
|
15301 | };
|
15302 | };
|
15303 |
|
15304 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15305 | value: true
|
15306 | });
|
15307 |
|
15308 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15309 |
|
15310 | var Panel_1 = __importDefault(__webpack_require__(31));
|
15311 |
|
15312 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
15313 |
|
15314 | var create_panel_conf_1 = __importDefault(__webpack_require__(332));
|
15315 |
|
15316 | var Video =
|
15317 |
|
15318 | function (_super) {
|
15319 | __extends(Video, _super);
|
15320 |
|
15321 | function Video(editor) {
|
15322 | var _this = this;
|
15323 |
|
15324 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u89C6\u9891\">\n <i class=\"w-e-icon-play\"></i>\n </div>");
|
15325 | _this = _super.call(this, $elem, editor) || this;
|
15326 | return _this;
|
15327 | }
|
15328 | |
15329 |
|
15330 |
|
15331 |
|
15332 |
|
15333 | Video.prototype.clickHandler = function () {
|
15334 |
|
15335 | this.createPanel('');
|
15336 | };
|
15337 | |
15338 |
|
15339 |
|
15340 |
|
15341 |
|
15342 |
|
15343 | Video.prototype.createPanel = function (iframe) {
|
15344 | var conf = create_panel_conf_1["default"](this.editor, iframe);
|
15345 | var panel = new Panel_1["default"](this, conf);
|
15346 | panel.create();
|
15347 | };
|
15348 | |
15349 |
|
15350 |
|
15351 |
|
15352 |
|
15353 | Video.prototype.tryChangeActive = function () {};
|
15354 |
|
15355 | return Video;
|
15356 | }(PanelMenu_1["default"]);
|
15357 |
|
15358 | exports["default"] = Video;
|
15359 |
|
15360 | }),
|
15361 |
|
15362 | (function(module, exports, __webpack_require__) {
|
15363 |
|
15364 | "use strict";
|
15365 |
|
15366 |
|
15367 |
|
15368 |
|
15369 |
|
15370 |
|
15371 | var _interopRequireDefault = __webpack_require__(0);
|
15372 |
|
15373 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
15374 |
|
15375 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15376 |
|
15377 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15378 | return mod && mod.__esModule ? mod : {
|
15379 | "default": mod
|
15380 | };
|
15381 | };
|
15382 |
|
15383 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15384 | value: true
|
15385 | });
|
15386 |
|
15387 | var util_1 = __webpack_require__(7);
|
15388 |
|
15389 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15390 |
|
15391 | var const_1 = __webpack_require__(26);
|
15392 |
|
15393 | function default_1(editor, video) {
|
15394 |
|
15395 | var inputIFrameId = util_1.getRandom('input-iframe');
|
15396 | var btnOkId = util_1.getRandom('btn-ok');
|
15397 | var i18nPrefix = 'menus.panelMenus.video.';
|
15398 |
|
15399 | var t = function t(text, prefix) {
|
15400 | if (prefix === void 0) {
|
15401 | prefix = i18nPrefix;
|
15402 | }
|
15403 |
|
15404 | return editor.i18next.t(prefix + text);
|
15405 | };
|
15406 | |
15407 |
|
15408 |
|
15409 |
|
15410 |
|
15411 |
|
15412 | function insertVideo(video) {
|
15413 | editor.cmd["do"]('insertHTML', video + '<p><br></p>');
|
15414 |
|
15415 | editor.config.onlineVideoCallback(video);
|
15416 | }
|
15417 | |
15418 |
|
15419 |
|
15420 |
|
15421 |
|
15422 |
|
15423 | function checkOnlineVideo(video) {
|
15424 |
|
15425 | var flag = true;
|
15426 |
|
15427 | if (!const_1.videoRegex.test(video)) {
|
15428 | flag = false;
|
15429 | }
|
15430 |
|
15431 |
|
15432 | var check = editor.config.onlineVideoCheck(video);
|
15433 |
|
15434 | if (check === undefined) {
|
15435 | if (flag === false) console.log(t('您刚才插入的视频链接未通过编辑器校验', 'validate.'));
|
15436 | } else if (check === true) {
|
15437 |
|
15438 | if (flag === false) {
|
15439 | editor.config.customAlert(t('您插入的网络视频无法识别', 'validate.') + "\uFF0C" + t('请替换为正确的网络视频格式', 'validate.') + "\uFF1A\u5982<iframe src=...></iframe>", 'warning');
|
15440 | } else {
|
15441 | return true;
|
15442 | }
|
15443 | } else {
|
15444 |
|
15445 | editor.config.customAlert(check, 'error');
|
15446 | }
|
15447 |
|
15448 | return false;
|
15449 | }
|
15450 |
|
15451 | var conf = {
|
15452 | width: 300,
|
15453 | height: 0,
|
15454 |
|
15455 | tabs: [{
|
15456 |
|
15457 | title: editor.i18next.t('menus.panelMenus.video.插入视频'),
|
15458 |
|
15459 | tpl: "<div>\n <input \n id=\"" + inputIFrameId + "\" \n type=\"text\" \n class=\"block\" \n placeholder=\"" + editor.i18next.t('如') + "\uFF1A<iframe src=... ></iframe>\"/>\n </td>\n <div class=\"w-e-button-container\">\n <button type=\"button\" id=\"" + btnOkId + "\" class=\"right\">\n " + editor.i18next.t('插入') + "\n </button>\n </div>\n </div>",
|
15460 |
|
15461 | events: [
|
15462 | {
|
15463 | selector: '#' + btnOkId,
|
15464 | type: 'click',
|
15465 | fn: function fn() {
|
15466 | var _context;
|
15467 |
|
15468 |
|
15469 | var $video = dom_core_1["default"]('#' + inputIFrameId);
|
15470 | var video = (0, _trim["default"])(_context = $video.val()).call(_context);
|
15471 |
|
15472 | if (!video) return;
|
15473 |
|
15474 | if (!checkOnlineVideo(video)) return;
|
15475 | insertVideo(video);
|
15476 |
|
15477 | return true;
|
15478 | }
|
15479 | }]
|
15480 | }]
|
15481 | };
|
15482 | return conf;
|
15483 | }
|
15484 |
|
15485 | exports["default"] = default_1;
|
15486 |
|
15487 | }),
|
15488 |
|
15489 | (function(module, exports, __webpack_require__) {
|
15490 |
|
15491 | "use strict";
|
15492 |
|
15493 |
|
15494 |
|
15495 |
|
15496 |
|
15497 |
|
15498 | var _interopRequireDefault = __webpack_require__(0);
|
15499 |
|
15500 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15501 |
|
15502 | var _create = _interopRequireDefault(__webpack_require__(3));
|
15503 |
|
15504 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
15505 |
|
15506 | var __extends = void 0 && (void 0).__extends || function () {
|
15507 | var _extendStatics = function extendStatics(d, b) {
|
15508 | _extendStatics = _setPrototypeOf["default"] || {
|
15509 | __proto__: []
|
15510 | } instanceof Array && function (d, b) {
|
15511 | d.__proto__ = b;
|
15512 | } || function (d, b) {
|
15513 | for (var p in b) {
|
15514 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
15515 | }
|
15516 | };
|
15517 |
|
15518 | return _extendStatics(d, b);
|
15519 | };
|
15520 |
|
15521 | return function (d, b) {
|
15522 | _extendStatics(d, b);
|
15523 |
|
15524 | function __() {
|
15525 | this.constructor = d;
|
15526 | }
|
15527 |
|
15528 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
15529 | };
|
15530 | }();
|
15531 |
|
15532 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15533 | return mod && mod.__esModule ? mod : {
|
15534 | "default": mod
|
15535 | };
|
15536 | };
|
15537 |
|
15538 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15539 | value: true
|
15540 | });
|
15541 |
|
15542 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
15543 |
|
15544 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15545 |
|
15546 | var create_panel_conf_1 = __importDefault(__webpack_require__(334));
|
15547 |
|
15548 | var Panel_1 = __importDefault(__webpack_require__(31));
|
15549 |
|
15550 | var index_1 = __importDefault(__webpack_require__(341));
|
15551 |
|
15552 | var Image =
|
15553 |
|
15554 | function (_super) {
|
15555 | __extends(Image, _super);
|
15556 |
|
15557 | function Image(editor) {
|
15558 | var _this = this;
|
15559 |
|
15560 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="图片"><i class="w-e-icon-image"></i></div>');
|
15561 | _this = _super.call(this, $elem, editor) || this;
|
15562 |
|
15563 | index_1["default"](editor);
|
15564 | return _this;
|
15565 | }
|
15566 | |
15567 |
|
15568 |
|
15569 |
|
15570 |
|
15571 | Image.prototype.clickHandler = function () {
|
15572 | this.createPanel();
|
15573 | };
|
15574 | |
15575 |
|
15576 |
|
15577 |
|
15578 |
|
15579 | Image.prototype.createPanel = function () {
|
15580 | var conf = create_panel_conf_1["default"](this.editor);
|
15581 | var panel = new Panel_1["default"](this, conf);
|
15582 | panel.create();
|
15583 | };
|
15584 | |
15585 |
|
15586 |
|
15587 |
|
15588 |
|
15589 | Image.prototype.tryChangeActive = function () {};
|
15590 |
|
15591 | return Image;
|
15592 | }(PanelMenu_1["default"]);
|
15593 |
|
15594 | exports["default"] = Image;
|
15595 |
|
15596 | }),
|
15597 |
|
15598 | (function(module, exports, __webpack_require__) {
|
15599 |
|
15600 | "use strict";
|
15601 |
|
15602 |
|
15603 |
|
15604 |
|
15605 |
|
15606 |
|
15607 | var _interopRequireDefault = __webpack_require__(0);
|
15608 |
|
15609 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
15610 |
|
15611 | var _map = _interopRequireDefault(__webpack_require__(29));
|
15612 |
|
15613 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15614 |
|
15615 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15616 | return mod && mod.__esModule ? mod : {
|
15617 | "default": mod
|
15618 | };
|
15619 | };
|
15620 |
|
15621 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15622 | value: true
|
15623 | });
|
15624 |
|
15625 | var util_1 = __webpack_require__(7);
|
15626 |
|
15627 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15628 |
|
15629 | var upload_img_1 = __importDefault(__webpack_require__(97));
|
15630 |
|
15631 | var const_1 = __webpack_require__(26);
|
15632 |
|
15633 | function default_1(editor) {
|
15634 | var _context;
|
15635 |
|
15636 | var config = editor.config;
|
15637 | var uploadImg = new upload_img_1["default"](editor);
|
15638 |
|
15639 | var upTriggerId = util_1.getRandom('up-trigger-id');
|
15640 | var upFileId = util_1.getRandom('up-file-id');
|
15641 | var linkUrlId = util_1.getRandom('input-link-url');
|
15642 | var linkBtnId = util_1.getRandom('btn-link');
|
15643 | var i18nPrefix = 'menus.panelMenus.image.';
|
15644 |
|
15645 | var t = function t(text, prefix) {
|
15646 | if (prefix === void 0) {
|
15647 | prefix = i18nPrefix;
|
15648 | }
|
15649 |
|
15650 | return editor.i18next.t(prefix + text);
|
15651 | };
|
15652 | |
15653 |
|
15654 |
|
15655 |
|
15656 |
|
15657 |
|
15658 | function checkLinkImg(src) {
|
15659 |
|
15660 | var flag = true;
|
15661 |
|
15662 | if (!const_1.imgRegex.test(src)) {
|
15663 | flag = false;
|
15664 | }
|
15665 |
|
15666 |
|
15667 | var check = config.linkImgCheck(src);
|
15668 |
|
15669 | if (check === undefined) {
|
15670 |
|
15671 | if (flag === false) console.log(t('您刚才插入的图片链接未通过编辑器校验', 'validate.'));
|
15672 | } else if (check === true) {
|
15673 |
|
15674 | if (flag === false) {
|
15675 | config.customAlert(t('您插入的网络图片无法识别', 'validate.') + "\uFF0C" + t('请替换为支持的图片类型', 'validate.') + "\uFF1Ajpg | png | gif ...", 'warning');
|
15676 | } else return true;
|
15677 | } else {
|
15678 |
|
15679 | config.customAlert(check, 'error');
|
15680 | }
|
15681 |
|
15682 | return false;
|
15683 | }
|
15684 |
|
15685 |
|
15686 | var fileMultipleAttr = config.uploadImgMaxLength === 1 ? '' : 'multiple="multiple"';
|
15687 | var accepts = (0, _map["default"])(_context = config.uploadImgAccept).call(_context, function (item) {
|
15688 | return "image/" + item;
|
15689 | }).join(',');
|
15690 | var tabsConf = [
|
15691 | {
|
15692 |
|
15693 | title: t('上传图片'),
|
15694 |
|
15695 | tpl: "<div class=\"w-e-up-img-container\">\n <div id=\"" + upTriggerId + "\" class=\"w-e-up-btn\">\n <i class=\"w-e-icon-upload2\"></i>\n </div>\n <div style=\"display:none;\">\n <input id=\"" + upFileId + "\" type=\"file\" " + fileMultipleAttr + " accept=\"" + accepts + "\"/>\n </div>\n </div>",
|
15696 |
|
15697 | events: [
|
15698 | {
|
15699 | selector: '#' + upTriggerId,
|
15700 | type: 'click',
|
15701 | fn: function fn() {
|
15702 | var $file = dom_core_1["default"]('#' + upFileId);
|
15703 | var fileElem = $file.elems[0];
|
15704 |
|
15705 | if (fileElem) {
|
15706 | fileElem.click();
|
15707 | } else {
|
15708 |
|
15709 | return true;
|
15710 | }
|
15711 | }
|
15712 | },
|
15713 | {
|
15714 | selector: '#' + upFileId,
|
15715 | type: 'change',
|
15716 | fn: function fn() {
|
15717 | var $file = dom_core_1["default"]('#' + upFileId);
|
15718 | var fileElem = $file.elems[0];
|
15719 |
|
15720 | if (!fileElem) {
|
15721 |
|
15722 | return true;
|
15723 | }
|
15724 |
|
15725 |
|
15726 | var fileList = fileElem.files;
|
15727 |
|
15728 | if (fileList.length) {
|
15729 | uploadImg.uploadImg(fileList);
|
15730 | }
|
15731 |
|
15732 |
|
15733 | return true;
|
15734 | }
|
15735 | }]
|
15736 | },
|
15737 | {
|
15738 | title: t('网络图片'),
|
15739 | tpl: "<div>\n <input\n id=\"" + linkUrlId + "\"\n type=\"text\"\n class=\"block\"\n placeholder=\"" + t('图片链接') + "\"/>\n </td>\n <div class=\"w-e-button-container\">\n <button type=\"button\" id=\"" + linkBtnId + "\" class=\"right\">" + t('插入', '') + "</button>\n </div>\n </div>",
|
15740 | events: [{
|
15741 | selector: '#' + linkBtnId,
|
15742 | type: 'click',
|
15743 | fn: function fn() {
|
15744 | var _context2;
|
15745 |
|
15746 | var $linkUrl = dom_core_1["default"]('#' + linkUrlId);
|
15747 | var url = (0, _trim["default"])(_context2 = $linkUrl.val()).call(_context2);
|
15748 |
|
15749 | if (!url) return;
|
15750 |
|
15751 | if (!checkLinkImg(url)) return;
|
15752 |
|
15753 | uploadImg.insertImg(url);
|
15754 |
|
15755 | return true;
|
15756 | }
|
15757 | }]
|
15758 | }];
|
15759 |
|
15760 |
|
15761 | var conf = {
|
15762 | width: 300,
|
15763 | height: 0,
|
15764 | tabs: []
|
15765 | };
|
15766 |
|
15767 | if (window.FileReader && (config.uploadImgShowBase64 || config.uploadImgServer || config.customUploadImg)) {
|
15768 | conf.tabs.push(tabsConf[0]);
|
15769 | }
|
15770 |
|
15771 |
|
15772 | if (config.showLinkImg) {
|
15773 | conf.tabs.push(tabsConf[1]);
|
15774 | }
|
15775 |
|
15776 | return conf;
|
15777 | }
|
15778 |
|
15779 | exports["default"] = default_1;
|
15780 |
|
15781 | }),
|
15782 |
|
15783 | (function(module, exports, __webpack_require__) {
|
15784 |
|
15785 | "use strict";
|
15786 |
|
15787 |
|
15788 |
|
15789 |
|
15790 |
|
15791 |
|
15792 | var _interopRequireDefault = __webpack_require__(0);
|
15793 |
|
15794 | var _typeof2 = _interopRequireDefault(__webpack_require__(94));
|
15795 |
|
15796 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
15797 |
|
15798 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15799 |
|
15800 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15801 | value: true
|
15802 | });
|
15803 |
|
15804 | var util_1 = __webpack_require__(7);
|
15805 |
|
15806 |
|
15807 |
|
15808 |
|
15809 |
|
15810 |
|
15811 |
|
15812 | function post(url, option) {
|
15813 | var xhr = new XMLHttpRequest();
|
15814 | xhr.open('POST', url);
|
15815 |
|
15816 | xhr.timeout = option.timeout || 10 * 1000;
|
15817 |
|
15818 | xhr.ontimeout = function () {
|
15819 | console.error('wangEditor - 请求超时');
|
15820 | option.onTimeout && option.onTimeout(xhr);
|
15821 | };
|
15822 |
|
15823 |
|
15824 | if (xhr.upload) {
|
15825 | xhr.upload.onprogress = function (e) {
|
15826 | var percent = e.loaded / e.total;
|
15827 | option.onProgress && option.onProgress(percent, e);
|
15828 | };
|
15829 | }
|
15830 |
|
15831 |
|
15832 | if (option.headers) {
|
15833 | (0, _forEach["default"])(util_1).call(util_1, option.headers, function (key, val) {
|
15834 | xhr.setRequestHeader(key, val);
|
15835 | });
|
15836 | }
|
15837 |
|
15838 |
|
15839 | xhr.withCredentials = !!option.withCredentials;
|
15840 |
|
15841 | if (option.beforeSend) {
|
15842 | var beforeResult = option.beforeSend(xhr);
|
15843 |
|
15844 | if (beforeResult && (0, _typeof2["default"])(beforeResult) === 'object') {
|
15845 | if (beforeResult.prevent) {
|
15846 |
|
15847 | return beforeResult.msg;
|
15848 | }
|
15849 | }
|
15850 | }
|
15851 |
|
15852 |
|
15853 | xhr.onreadystatechange = function () {
|
15854 | if (xhr.readyState !== 4) return;
|
15855 | var status = xhr.status;
|
15856 | if (status < 200) return;
|
15857 |
|
15858 | if (status >= 300 && status < 400) return;
|
15859 |
|
15860 | if (status >= 400) {
|
15861 |
|
15862 | console.error('wangEditor - XHR 报错,状态码 ' + status);
|
15863 | if (option.onError) option.onError(xhr);
|
15864 |
|
15865 | return;
|
15866 | }
|
15867 |
|
15868 |
|
15869 | var resultStr = xhr.responseText;
|
15870 | var result;
|
15871 |
|
15872 | if ((0, _typeof2["default"])(resultStr) !== 'object') {
|
15873 | try {
|
15874 | result = JSON.parse(resultStr);
|
15875 | } catch (ex) {
|
15876 | console.error('wangEditor - 返回结果不是 JSON 格式', resultStr);
|
15877 | if (option.onFail) option.onFail(xhr, resultStr);
|
15878 | return;
|
15879 | }
|
15880 | } else {
|
15881 | result = resultStr;
|
15882 | }
|
15883 |
|
15884 | option.onSuccess(xhr, result);
|
15885 | };
|
15886 |
|
15887 |
|
15888 | xhr.send(option.formData || null);
|
15889 | return xhr;
|
15890 | }
|
15891 |
|
15892 | exports["default"] = post;
|
15893 |
|
15894 | }),
|
15895 |
|
15896 | (function(module, exports, __webpack_require__) {
|
15897 |
|
15898 | "use strict";
|
15899 |
|
15900 |
|
15901 |
|
15902 |
|
15903 |
|
15904 |
|
15905 | var _interopRequireDefault = __webpack_require__(0);
|
15906 |
|
15907 | var _now = _interopRequireDefault(__webpack_require__(337));
|
15908 |
|
15909 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
15910 |
|
15911 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
15912 | return mod && mod.__esModule ? mod : {
|
15913 | "default": mod
|
15914 | };
|
15915 | };
|
15916 |
|
15917 | (0, _defineProperty["default"])(exports, "__esModule", {
|
15918 | value: true
|
15919 | });
|
15920 |
|
15921 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
15922 |
|
15923 | var Progress =
|
15924 |
|
15925 | function () {
|
15926 | function Progress(editor) {
|
15927 | this.editor = editor;
|
15928 | this.$textContainer = editor.$textContainerElem;
|
15929 | this.$bar = dom_core_1["default"]('<div class="w-e-progress"></div>');
|
15930 | this.isShow = false;
|
15931 | this.time = 0;
|
15932 | this.timeoutId = 0;
|
15933 | }
|
15934 | |
15935 |
|
15936 |
|
15937 |
|
15938 |
|
15939 |
|
15940 | Progress.prototype.show = function (progress) {
|
15941 | var _this = this;
|
15942 |
|
15943 |
|
15944 | if (this.isShow) {
|
15945 | return;
|
15946 | }
|
15947 |
|
15948 | this.isShow = true;
|
15949 |
|
15950 | var $bar = this.$bar;
|
15951 | var $textContainer = this.$textContainer;
|
15952 | $textContainer.append($bar);
|
15953 |
|
15954 | if ((0, _now["default"])() - this.time > 100) {
|
15955 | if (progress <= 1) {
|
15956 | $bar.css('width', progress * 100 + '%');
|
15957 | this.time = (0, _now["default"])();
|
15958 | }
|
15959 | }
|
15960 |
|
15961 |
|
15962 | var timeoutId = this.timeoutId;
|
15963 |
|
15964 | if (timeoutId) {
|
15965 | clearTimeout(timeoutId);
|
15966 | }
|
15967 |
|
15968 | this.timeoutId = window.setTimeout(function () {
|
15969 | _this.hide();
|
15970 | }, 500);
|
15971 | };
|
15972 | |
15973 |
|
15974 |
|
15975 |
|
15976 |
|
15977 | Progress.prototype.hide = function () {
|
15978 | var $bar = this.$bar;
|
15979 | $bar.remove();
|
15980 | this.isShow = false;
|
15981 | this.time = 0;
|
15982 | this.timeoutId = 0;
|
15983 | };
|
15984 |
|
15985 | return Progress;
|
15986 | }();
|
15987 |
|
15988 | exports["default"] = Progress;
|
15989 |
|
15990 | }),
|
15991 |
|
15992 | (function(module, exports, __webpack_require__) {
|
15993 |
|
15994 | module.exports = __webpack_require__(338);
|
15995 |
|
15996 | }),
|
15997 |
|
15998 | (function(module, exports, __webpack_require__) {
|
15999 |
|
16000 | var parent = __webpack_require__(339);
|
16001 |
|
16002 | module.exports = parent;
|
16003 |
|
16004 |
|
16005 | }),
|
16006 |
|
16007 | (function(module, exports, __webpack_require__) {
|
16008 |
|
16009 | __webpack_require__(340);
|
16010 | var path = __webpack_require__(10);
|
16011 |
|
16012 | module.exports = path.Date.now;
|
16013 |
|
16014 |
|
16015 | }),
|
16016 |
|
16017 | (function(module, exports, __webpack_require__) {
|
16018 |
|
16019 | var $ = __webpack_require__(4);
|
16020 |
|
16021 |
|
16022 |
|
16023 | $({ target: 'Date', stat: true }, {
|
16024 | now: function now() {
|
16025 | return new Date().getTime();
|
16026 | }
|
16027 | });
|
16028 |
|
16029 |
|
16030 | }),
|
16031 |
|
16032 | (function(module, exports, __webpack_require__) {
|
16033 |
|
16034 | "use strict";
|
16035 |
|
16036 |
|
16037 |
|
16038 |
|
16039 |
|
16040 |
|
16041 | var _interopRequireDefault = __webpack_require__(0);
|
16042 |
|
16043 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16044 |
|
16045 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16046 | return mod && mod.__esModule ? mod : {
|
16047 | "default": mod
|
16048 | };
|
16049 | };
|
16050 |
|
16051 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16052 | value: true
|
16053 | });
|
16054 |
|
16055 | var paste_img_1 = __importDefault(__webpack_require__(342));
|
16056 |
|
16057 | var drop_img_1 = __importDefault(__webpack_require__(343));
|
16058 |
|
16059 | var drag_size_1 = __importDefault(__webpack_require__(344));
|
16060 |
|
16061 | var tooltip_event_1 = __importDefault(__webpack_require__(352));
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 |
|
16067 |
|
16068 | function bindEvent(editor) {
|
16069 |
|
16070 | paste_img_1["default"](editor);
|
16071 |
|
16072 | drop_img_1["default"](editor);
|
16073 |
|
16074 |
|
16075 | drag_size_1["default"](editor);
|
16076 |
|
16077 | tooltip_event_1["default"](editor);
|
16078 | }
|
16079 |
|
16080 | exports["default"] = bindEvent;
|
16081 |
|
16082 | }),
|
16083 |
|
16084 | (function(module, exports, __webpack_require__) {
|
16085 |
|
16086 | "use strict";
|
16087 |
|
16088 |
|
16089 |
|
16090 |
|
16091 |
|
16092 |
|
16093 | var _interopRequireDefault = __webpack_require__(0);
|
16094 |
|
16095 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16096 |
|
16097 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16098 | return mod && mod.__esModule ? mod : {
|
16099 | "default": mod
|
16100 | };
|
16101 | };
|
16102 |
|
16103 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16104 | value: true
|
16105 | });
|
16106 |
|
16107 | var paste_event_1 = __webpack_require__(123);
|
16108 |
|
16109 | var upload_img_1 = __importDefault(__webpack_require__(97));
|
16110 |
|
16111 |
|
16112 |
|
16113 |
|
16114 |
|
16115 |
|
16116 |
|
16117 | function _haveTextOrHtml(editor, e) {
|
16118 | var config = editor.config;
|
16119 | var pasteFilterStyle = config.pasteFilterStyle;
|
16120 | var pasteIgnoreImg = config.pasteIgnoreImg;
|
16121 | var pasteHtml = paste_event_1.getPasteHtml(e, pasteFilterStyle, pasteIgnoreImg);
|
16122 | if (pasteHtml) return true;
|
16123 | var pasteText = paste_event_1.getPasteText(e);
|
16124 | if (pasteText) return true;
|
16125 | return false;
|
16126 | }
|
16127 |
|
16128 |
|
16129 |
|
16130 |
|
16131 |
|
16132 |
|
16133 | function pasteImgHandler(e, editor) {
|
16134 | if (_haveTextOrHtml(editor, e)) {
|
16135 |
|
16136 | return;
|
16137 | }
|
16138 |
|
16139 |
|
16140 | var pastedFiles = paste_event_1.getPasteImgs(e);
|
16141 |
|
16142 | if (!pastedFiles.length) {
|
16143 | return;
|
16144 | }
|
16145 |
|
16146 |
|
16147 |
|
16148 | var uploadImg = new upload_img_1["default"](editor);
|
16149 | uploadImg.uploadImg(pastedFiles);
|
16150 | }
|
16151 |
|
16152 |
|
16153 |
|
16154 |
|
16155 |
|
16156 |
|
16157 |
|
16158 | function bindPasteImg(editor) {
|
16159 |
|
16160 | editor.txt.eventHooks.pasteEvents.push(function (e) {
|
16161 | pasteImgHandler(e, editor);
|
16162 | });
|
16163 | }
|
16164 |
|
16165 | exports["default"] = bindPasteImg;
|
16166 |
|
16167 | }),
|
16168 |
|
16169 | (function(module, exports, __webpack_require__) {
|
16170 |
|
16171 | "use strict";
|
16172 |
|
16173 |
|
16174 |
|
16175 |
|
16176 |
|
16177 |
|
16178 | var _interopRequireDefault = __webpack_require__(0);
|
16179 |
|
16180 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16181 |
|
16182 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16183 | return mod && mod.__esModule ? mod : {
|
16184 | "default": mod
|
16185 | };
|
16186 | };
|
16187 |
|
16188 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16189 | value: true
|
16190 | });
|
16191 |
|
16192 | var upload_img_1 = __importDefault(__webpack_require__(97));
|
16193 |
|
16194 | function bindDropImg(editor) {
|
16195 | |
16196 |
|
16197 |
|
16198 |
|
16199 | function dropImgHandler(e) {
|
16200 | var files = e.dataTransfer && e.dataTransfer.files;
|
16201 |
|
16202 | if (!files || !files.length) {
|
16203 | return;
|
16204 | }
|
16205 |
|
16206 |
|
16207 | var uploadImg = new upload_img_1["default"](editor);
|
16208 | uploadImg.uploadImg(files);
|
16209 | }
|
16210 |
|
16211 |
|
16212 | editor.txt.eventHooks.dropEvents.push(dropImgHandler);
|
16213 | }
|
16214 |
|
16215 | exports["default"] = bindDropImg;
|
16216 |
|
16217 | }),
|
16218 |
|
16219 | (function(module, exports, __webpack_require__) {
|
16220 |
|
16221 | "use strict";
|
16222 |
|
16223 |
|
16224 |
|
16225 |
|
16226 |
|
16227 |
|
16228 | var _interopRequireDefault = __webpack_require__(0);
|
16229 |
|
16230 | var _parseFloat2 = _interopRequireDefault(__webpack_require__(345));
|
16231 |
|
16232 | var _find = _interopRequireDefault(__webpack_require__(30));
|
16233 |
|
16234 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16235 |
|
16236 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16237 | return mod && mod.__esModule ? mod : {
|
16238 | "default": mod
|
16239 | };
|
16240 | };
|
16241 |
|
16242 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16243 | value: true
|
16244 | });
|
16245 | exports.createShowHideFn = void 0;
|
16246 |
|
16247 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
16248 |
|
16249 | __webpack_require__(350);
|
16250 |
|
16251 | var util_1 = __webpack_require__(7);
|
16252 |
|
16253 |
|
16254 |
|
16255 |
|
16256 |
|
16257 |
|
16258 |
|
16259 |
|
16260 |
|
16261 |
|
16262 | function setDragStyle($drag, width, height, left, top) {
|
16263 | $drag.attr('style', "width:" + width + "px; height:" + height + "px; left:" + left + "px; top:" + top + "px;");
|
16264 | }
|
16265 |
|
16266 |
|
16267 |
|
16268 |
|
16269 |
|
16270 |
|
16271 |
|
16272 | function createDragBox(editor, $textContainerElem) {
|
16273 | var $drag = dom_core_1["default"]("<div class=\"w-e-img-drag-mask\">\n <div class=\"w-e-img-drag-show-size\"></div>\n <div class=\"w-e-img-drag-rb\"></div>\n </div>");
|
16274 | $drag.hide();
|
16275 | $textContainerElem.append($drag);
|
16276 | return $drag;
|
16277 | }
|
16278 |
|
16279 |
|
16280 |
|
16281 |
|
16282 |
|
16283 |
|
16284 |
|
16285 | function showDargBox($textContainerElem, $drag, $img) {
|
16286 | var boxRect = $textContainerElem.getBoundingClientRect();
|
16287 | var rect = $img.getBoundingClientRect();
|
16288 | var rectW = rect.width.toFixed(2);
|
16289 | var rectH = rect.height.toFixed(2);
|
16290 | (0, _find["default"])($drag).call($drag, '.w-e-img-drag-show-size').text(rectW + "px * " + rectH + "px");
|
16291 | setDragStyle($drag, (0, _parseFloat2["default"])(rectW), (0, _parseFloat2["default"])(rectH), rect.left - boxRect.left, rect.top - boxRect.top);
|
16292 | $drag.show();
|
16293 | }
|
16294 |
|
16295 |
|
16296 |
|
16297 |
|
16298 |
|
16299 | function createShowHideFn(editor) {
|
16300 | var $textContainerElem = editor.$textContainerElem;
|
16301 | var $imgTarget;
|
16302 |
|
16303 | var $drag = createDragBox(editor, $textContainerElem);
|
16304 | |
16305 |
|
16306 |
|
16307 |
|
16308 |
|
16309 |
|
16310 | function bindDragEvents($drag, $container) {
|
16311 | $drag.on('click', function (e) {
|
16312 | e.stopPropagation();
|
16313 | });
|
16314 | $drag.on('mousedown', '.w-e-img-drag-rb', function (e) {
|
16315 |
|
16316 | e.preventDefault();
|
16317 | if (!$imgTarget) return;
|
16318 | var firstX = e.clientX;
|
16319 | var firstY = e.clientY;
|
16320 | var boxRect = $container.getBoundingClientRect();
|
16321 | var imgRect = $imgTarget.getBoundingClientRect();
|
16322 | var width = imgRect.width;
|
16323 | var height = imgRect.height;
|
16324 | var left = imgRect.left - boxRect.left;
|
16325 | var top = imgRect.top - boxRect.top;
|
16326 | var ratio = width / height;
|
16327 | var setW = width;
|
16328 | var setH = height;
|
16329 | var $document = dom_core_1["default"](document);
|
16330 |
|
16331 | function offEvents() {
|
16332 | $document.off('mousemove', mouseMoveHandler);
|
16333 | $document.off('mouseup', mouseUpHandler);
|
16334 | }
|
16335 |
|
16336 | function mouseMoveHandler(ev) {
|
16337 | ev.stopPropagation();
|
16338 | ev.preventDefault();
|
16339 | setW = width + (ev.clientX - firstX);
|
16340 | setH = height + (ev.clientY - firstY);
|
16341 |
|
16342 | if (setW / setH != ratio) {
|
16343 | setH = setW / ratio;
|
16344 | }
|
16345 |
|
16346 | setW = (0, _parseFloat2["default"])(setW.toFixed(2));
|
16347 | setH = (0, _parseFloat2["default"])(setH.toFixed(2));
|
16348 | (0, _find["default"])($drag).call($drag, '.w-e-img-drag-show-size').text(setW.toFixed(2).replace('.00', '') + "px * " + setH.toFixed(2).replace('.00', '') + "px");
|
16349 | setDragStyle($drag, setW, setH, left, top);
|
16350 | }
|
16351 |
|
16352 | $document.on('mousemove', mouseMoveHandler);
|
16353 |
|
16354 | function mouseUpHandler() {
|
16355 | $imgTarget.attr('width', setW + '');
|
16356 | $imgTarget.attr('height', setH + '');
|
16357 | var newImgRect = $imgTarget.getBoundingClientRect();
|
16358 | setDragStyle($drag, setW, setH, newImgRect.left - boxRect.left, newImgRect.top - boxRect.top);
|
16359 |
|
16360 | offEvents();
|
16361 | }
|
16362 |
|
16363 | $document.on('mouseup', mouseUpHandler);
|
16364 |
|
16365 | $document.on('mouseleave', offEvents);
|
16366 | });
|
16367 | }
|
16368 |
|
16369 |
|
16370 | function showDrag($target) {
|
16371 | if (util_1.UA.isIE()) return false;
|
16372 |
|
16373 | if ($target) {
|
16374 | $imgTarget = $target;
|
16375 | showDargBox($textContainerElem, $drag, $imgTarget);
|
16376 | }
|
16377 | }
|
16378 |
|
16379 |
|
16380 | function hideDrag() {
|
16381 | (0, _find["default"])($textContainerElem).call($textContainerElem, '.w-e-img-drag-mask').hide();
|
16382 | }
|
16383 |
|
16384 |
|
16385 | bindDragEvents($drag, $textContainerElem);
|
16386 |
|
16387 | dom_core_1["default"](document).on('click', hideDrag);
|
16388 | editor.beforeDestroy(function () {
|
16389 | dom_core_1["default"](document).off('click', hideDrag);
|
16390 | });
|
16391 | return {
|
16392 | showDrag: showDrag,
|
16393 | hideDrag: hideDrag
|
16394 | };
|
16395 | }
|
16396 |
|
16397 | exports.createShowHideFn = createShowHideFn;
|
16398 |
|
16399 |
|
16400 |
|
16401 |
|
16402 |
|
16403 | function bindDragImgSize(editor) {
|
16404 | var _a = createShowHideFn(editor),
|
16405 | showDrag = _a.showDrag,
|
16406 | hideDrag = _a.hideDrag;
|
16407 |
|
16408 |
|
16409 | editor.txt.eventHooks.imgClickEvents.push(showDrag);
|
16410 |
|
16411 | editor.txt.eventHooks.textScrollEvents.push(hideDrag);
|
16412 | editor.txt.eventHooks.keyupEvents.push(hideDrag);
|
16413 | editor.txt.eventHooks.toolbarClickEvents.push(hideDrag);
|
16414 | editor.txt.eventHooks.menuClickEvents.push(hideDrag);
|
16415 | editor.txt.eventHooks.changeEvents.push(hideDrag);
|
16416 | }
|
16417 |
|
16418 | exports["default"] = bindDragImgSize;
|
16419 |
|
16420 | }),
|
16421 |
|
16422 | (function(module, exports, __webpack_require__) {
|
16423 |
|
16424 | module.exports = __webpack_require__(346);
|
16425 |
|
16426 | }),
|
16427 |
|
16428 | (function(module, exports, __webpack_require__) {
|
16429 |
|
16430 | var parent = __webpack_require__(347);
|
16431 |
|
16432 | module.exports = parent;
|
16433 |
|
16434 |
|
16435 | }),
|
16436 |
|
16437 | (function(module, exports, __webpack_require__) {
|
16438 |
|
16439 | __webpack_require__(348);
|
16440 | var path = __webpack_require__(10);
|
16441 |
|
16442 | module.exports = path.parseFloat;
|
16443 |
|
16444 |
|
16445 | }),
|
16446 |
|
16447 | (function(module, exports, __webpack_require__) {
|
16448 |
|
16449 | var $ = __webpack_require__(4);
|
16450 | var parseFloatImplementation = __webpack_require__(349);
|
16451 |
|
16452 |
|
16453 |
|
16454 | $({ global: true, forced: parseFloat != parseFloatImplementation }, {
|
16455 | parseFloat: parseFloatImplementation
|
16456 | });
|
16457 |
|
16458 |
|
16459 | }),
|
16460 |
|
16461 | (function(module, exports, __webpack_require__) {
|
16462 |
|
16463 | var global = __webpack_require__(8);
|
16464 | var trim = __webpack_require__(92).trim;
|
16465 | var whitespaces = __webpack_require__(67);
|
16466 |
|
16467 | var $parseFloat = global.parseFloat;
|
16468 | var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
|
16469 |
|
16470 |
|
16471 |
|
16472 | module.exports = FORCED ? function parseFloat(string) {
|
16473 | var trimmedString = trim(String(string));
|
16474 | var result = $parseFloat(trimmedString);
|
16475 | return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
|
16476 | } : $parseFloat;
|
16477 |
|
16478 |
|
16479 | }),
|
16480 |
|
16481 | (function(module, exports, __webpack_require__) {
|
16482 |
|
16483 | var api = __webpack_require__(20);
|
16484 | var content = __webpack_require__(351);
|
16485 |
|
16486 | content = content.__esModule ? content.default : content;
|
16487 |
|
16488 | if (typeof content === 'string') {
|
16489 | content = [[module.i, content, '']];
|
16490 | }
|
16491 |
|
16492 | var options = {};
|
16493 |
|
16494 | options.insert = "head";
|
16495 | options.singleton = false;
|
16496 |
|
16497 | var update = api(content, options);
|
16498 |
|
16499 |
|
16500 |
|
16501 | module.exports = content.locals || {};
|
16502 |
|
16503 | }),
|
16504 |
|
16505 | (function(module, exports, __webpack_require__) {
|
16506 |
|
16507 |
|
16508 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
16509 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
16510 |
|
16511 | exports.push([module.i, ".w-e-text-container {\n overflow: hidden;\n}\n.w-e-img-drag-mask {\n position: absolute;\n z-index: 1;\n border: 1px dashed #ccc;\n box-sizing: border-box;\n}\n.w-e-img-drag-mask .w-e-img-drag-rb {\n position: absolute;\n right: -5px;\n bottom: -5px;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: #ccc;\n cursor: se-resize;\n}\n.w-e-img-drag-mask .w-e-img-drag-show-size {\n min-width: 110px;\n height: 22px;\n line-height: 22px;\n font-size: 14px;\n color: #999;\n position: absolute;\n left: 0;\n top: 0;\n background-color: #999;\n color: #fff;\n border-radius: 2px;\n padding: 0 5px;\n}\n", ""]);
|
16512 |
|
16513 | module.exports = exports;
|
16514 |
|
16515 |
|
16516 | }),
|
16517 |
|
16518 | (function(module, exports, __webpack_require__) {
|
16519 |
|
16520 | "use strict";
|
16521 |
|
16522 |
|
16523 |
|
16524 |
|
16525 |
|
16526 |
|
16527 | var _interopRequireDefault = __webpack_require__(0);
|
16528 |
|
16529 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16530 |
|
16531 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16532 | return mod && mod.__esModule ? mod : {
|
16533 | "default": mod
|
16534 | };
|
16535 | };
|
16536 |
|
16537 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16538 | value: true
|
16539 | });
|
16540 | exports.createShowHideFn = void 0;
|
16541 |
|
16542 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
16543 |
|
16544 | var Tooltip_1 = __importDefault(__webpack_require__(44));
|
16545 |
|
16546 |
|
16547 |
|
16548 |
|
16549 |
|
16550 | function createShowHideFn(editor) {
|
16551 | var tooltip;
|
16552 |
|
16553 | var t = function t(text, prefix) {
|
16554 | if (prefix === void 0) {
|
16555 | prefix = '';
|
16556 | }
|
16557 |
|
16558 | return editor.i18next.t(prefix + text);
|
16559 | };
|
16560 | |
16561 |
|
16562 |
|
16563 |
|
16564 |
|
16565 |
|
16566 | function showImgTooltip($node) {
|
16567 | var conf = [{
|
16568 | $elem: dom_core_1["default"]("<span class='w-e-icon-trash-o'></span>"),
|
16569 | onClick: function onClick(editor, $node) {
|
16570 |
|
16571 | editor.selection.createRangeByElem($node);
|
16572 | editor.selection.restoreSelection();
|
16573 | editor.cmd["do"]('delete');
|
16574 |
|
16575 | return true;
|
16576 | }
|
16577 | }, {
|
16578 | $elem: dom_core_1["default"]('<span>30%</span>'),
|
16579 | onClick: function onClick(editor, $node) {
|
16580 | $node.attr('width', '30%');
|
16581 | $node.removeAttr('height');
|
16582 |
|
16583 | return true;
|
16584 | }
|
16585 | }, {
|
16586 | $elem: dom_core_1["default"]('<span>50%</span>'),
|
16587 | onClick: function onClick(editor, $node) {
|
16588 | $node.attr('width', '50%');
|
16589 | $node.removeAttr('height');
|
16590 |
|
16591 | return true;
|
16592 | }
|
16593 | }, {
|
16594 | $elem: dom_core_1["default"]('<span>100%</span>'),
|
16595 | onClick: function onClick(editor, $node) {
|
16596 | $node.attr('width', '100%');
|
16597 | $node.removeAttr('height');
|
16598 |
|
16599 | return true;
|
16600 | }
|
16601 | }, {
|
16602 | $elem: dom_core_1["default"]("<span>" + t('重置') + "</span>"),
|
16603 | onClick: function onClick(editor, $node) {
|
16604 | $node.removeAttr('width');
|
16605 | $node.removeAttr('height');
|
16606 |
|
16607 | return true;
|
16608 | }
|
16609 | }];
|
16610 | tooltip = new Tooltip_1["default"](editor, $node, conf);
|
16611 | tooltip.create();
|
16612 | }
|
16613 | |
16614 |
|
16615 |
|
16616 |
|
16617 |
|
16618 | function hideImgTooltip() {
|
16619 |
|
16620 | if (tooltip) {
|
16621 | tooltip.remove();
|
16622 | tooltip = null;
|
16623 | }
|
16624 | }
|
16625 |
|
16626 | return {
|
16627 | showImgTooltip: showImgTooltip,
|
16628 | hideImgTooltip: hideImgTooltip
|
16629 | };
|
16630 | }
|
16631 |
|
16632 | exports.createShowHideFn = createShowHideFn;
|
16633 |
|
16634 |
|
16635 |
|
16636 |
|
16637 |
|
16638 | function bindTooltipEvent(editor) {
|
16639 | var _a = createShowHideFn(editor),
|
16640 | showImgTooltip = _a.showImgTooltip,
|
16641 | hideImgTooltip = _a.hideImgTooltip;
|
16642 |
|
16643 |
|
16644 | editor.txt.eventHooks.imgClickEvents.push(showImgTooltip);
|
16645 |
|
16646 | editor.txt.eventHooks.clickEvents.push(hideImgTooltip);
|
16647 | editor.txt.eventHooks.keyupEvents.push(hideImgTooltip);
|
16648 | editor.txt.eventHooks.toolbarClickEvents.push(hideImgTooltip);
|
16649 | editor.txt.eventHooks.menuClickEvents.push(hideImgTooltip);
|
16650 | editor.txt.eventHooks.textScrollEvents.push(hideImgTooltip);
|
16651 | editor.txt.eventHooks.imgDragBarMouseDownEvents.push(hideImgTooltip);
|
16652 |
|
16653 | editor.txt.eventHooks.changeEvents.push(hideImgTooltip);
|
16654 | }
|
16655 |
|
16656 | exports["default"] = bindTooltipEvent;
|
16657 |
|
16658 | }),
|
16659 |
|
16660 | (function(module, exports, __webpack_require__) {
|
16661 |
|
16662 | "use strict";
|
16663 |
|
16664 |
|
16665 |
|
16666 |
|
16667 |
|
16668 |
|
16669 | var _interopRequireDefault = __webpack_require__(0);
|
16670 |
|
16671 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
16672 |
|
16673 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16674 |
|
16675 | var _create = _interopRequireDefault(__webpack_require__(3));
|
16676 |
|
16677 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
16678 |
|
16679 | var __extends = void 0 && (void 0).__extends || function () {
|
16680 | var _extendStatics = function extendStatics(d, b) {
|
16681 | _extendStatics = _setPrototypeOf["default"] || {
|
16682 | __proto__: []
|
16683 | } instanceof Array && function (d, b) {
|
16684 | d.__proto__ = b;
|
16685 | } || function (d, b) {
|
16686 | for (var p in b) {
|
16687 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
16688 | }
|
16689 | };
|
16690 |
|
16691 | return _extendStatics(d, b);
|
16692 | };
|
16693 |
|
16694 | return function (d, b) {
|
16695 | _extendStatics(d, b);
|
16696 |
|
16697 | function __() {
|
16698 | this.constructor = d;
|
16699 | }
|
16700 |
|
16701 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
16702 | };
|
16703 | }();
|
16704 |
|
16705 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16706 | return mod && mod.__esModule ? mod : {
|
16707 | "default": mod
|
16708 | };
|
16709 | };
|
16710 |
|
16711 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16712 | value: true
|
16713 | });
|
16714 |
|
16715 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
16716 |
|
16717 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
16718 |
|
16719 | var operate_element_1 = __importDefault(__webpack_require__(354));
|
16720 |
|
16721 | var Indent =
|
16722 |
|
16723 | function (_super) {
|
16724 | __extends(Indent, _super);
|
16725 |
|
16726 | function Indent(editor) {
|
16727 | var _this = this;
|
16728 |
|
16729 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u7F29\u8FDB\">\n <i class=\"w-e-icon-indent-increase\"></i>\n </div>");
|
16730 | var dropListConf = {
|
16731 | width: 130,
|
16732 | title: '设置缩进',
|
16733 | type: 'list',
|
16734 | list: [{
|
16735 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-indent-increase w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.indent.增加缩进') + "\n <p>"),
|
16736 | value: 'increase'
|
16737 | }, {
|
16738 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-indent-decrease w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.indent.减少缩进') + "\n <p>"),
|
16739 | value: 'decrease'
|
16740 | }],
|
16741 | clickHandler: function clickHandler(value) {
|
16742 |
|
16743 | _this.command(value);
|
16744 | }
|
16745 | };
|
16746 | _this = _super.call(this, $elem, editor, dropListConf) || this;
|
16747 | return _this;
|
16748 | }
|
16749 | |
16750 |
|
16751 |
|
16752 |
|
16753 |
|
16754 |
|
16755 | Indent.prototype.command = function (value) {
|
16756 | var editor = this.editor;
|
16757 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
16758 |
|
16759 | if ($selectionElem && editor.$textElem.equal($selectionElem)) {
|
16760 |
|
16761 |
|
16762 | var $elems = editor.selection.getSelectionRangeTopNodes(editor);
|
16763 |
|
16764 | if ($elems.length > 0) {
|
16765 | (0, _forEach["default"])($elems).call($elems, function (item) {
|
16766 | operate_element_1["default"](dom_core_1["default"](item), value, editor);
|
16767 | });
|
16768 | }
|
16769 | } else {
|
16770 |
|
16771 |
|
16772 | if ($selectionElem && $selectionElem.length > 0) {
|
16773 | (0, _forEach["default"])($selectionElem).call($selectionElem, function (item) {
|
16774 | operate_element_1["default"](dom_core_1["default"](item), value, editor);
|
16775 | });
|
16776 | }
|
16777 | }
|
16778 |
|
16779 |
|
16780 | editor.selection.restoreSelection();
|
16781 | this.tryChangeActive();
|
16782 | };
|
16783 | |
16784 |
|
16785 |
|
16786 |
|
16787 |
|
16788 | Indent.prototype.tryChangeActive = function () {
|
16789 | var editor = this.editor;
|
16790 | var $selectionElem = editor.selection.getSelectionStartElem();
|
16791 | var $selectionStartElem = dom_core_1["default"]($selectionElem).getNodeTop(editor);
|
16792 | if ($selectionStartElem.length <= 0) return;
|
16793 |
|
16794 | if ($selectionStartElem.elems[0].style['paddingLeft'] != '') {
|
16795 | this.active();
|
16796 | } else {
|
16797 | this.unActive();
|
16798 | }
|
16799 | };
|
16800 |
|
16801 | return Indent;
|
16802 | }(DropListMenu_1["default"]);
|
16803 |
|
16804 | exports["default"] = Indent;
|
16805 |
|
16806 | }),
|
16807 |
|
16808 | (function(module, exports, __webpack_require__) {
|
16809 |
|
16810 | "use strict";
|
16811 |
|
16812 |
|
16813 |
|
16814 |
|
16815 |
|
16816 |
|
16817 |
|
16818 |
|
16819 | var _interopRequireDefault = __webpack_require__(0);
|
16820 |
|
16821 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
16822 |
|
16823 | var _slice = _interopRequireDefault(__webpack_require__(43));
|
16824 |
|
16825 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16826 |
|
16827 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
16828 | return mod && mod.__esModule ? mod : {
|
16829 | "default": mod
|
16830 | };
|
16831 | };
|
16832 |
|
16833 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16834 | value: true
|
16835 | });
|
16836 |
|
16837 | var increase_indent_style_1 = __importDefault(__webpack_require__(355));
|
16838 |
|
16839 | var decrease_indent_style_1 = __importDefault(__webpack_require__(356));
|
16840 |
|
16841 | var lengthRegex = /^(\d+)(\w+)$/;
|
16842 | var percentRegex = /^(\d+)%$/;
|
16843 |
|
16844 | function parseIndentation(editor) {
|
16845 | var indentation = editor.config.indentation;
|
16846 |
|
16847 | if (typeof indentation === 'string') {
|
16848 | if (lengthRegex.test(indentation)) {
|
16849 | var _context;
|
16850 |
|
16851 | var _a = (0, _slice["default"])(_context = (0, _trim["default"])(indentation).call(indentation).match(lengthRegex)).call(_context, 1, 3),
|
16852 | value = _a[0],
|
16853 | unit = _a[1];
|
16854 |
|
16855 | return {
|
16856 | value: Number(value),
|
16857 | unit: unit
|
16858 | };
|
16859 | } else if (percentRegex.test(indentation)) {
|
16860 | return {
|
16861 | value: Number((0, _trim["default"])(indentation).call(indentation).match(percentRegex)[1]),
|
16862 | unit: '%'
|
16863 | };
|
16864 | }
|
16865 | } else if (indentation.value !== void 0 && indentation.unit) {
|
16866 | return indentation;
|
16867 | }
|
16868 |
|
16869 | return {
|
16870 | value: 2,
|
16871 | unit: 'em'
|
16872 | };
|
16873 | }
|
16874 |
|
16875 | function operateElement($node, type, editor) {
|
16876 | var $elem = $node.getNodeTop(editor);
|
16877 | var reg = /^P$/i;
|
16878 |
|
16879 | if (reg.test($elem.getNodeName())) {
|
16880 | if (type === 'increase') increase_indent_style_1["default"]($elem, parseIndentation(editor));else if (type === 'decrease') decrease_indent_style_1["default"]($elem, parseIndentation(editor));
|
16881 | }
|
16882 | }
|
16883 |
|
16884 | exports["default"] = operateElement;
|
16885 |
|
16886 | }),
|
16887 |
|
16888 | (function(module, exports, __webpack_require__) {
|
16889 |
|
16890 | "use strict";
|
16891 |
|
16892 |
|
16893 |
|
16894 |
|
16895 |
|
16896 |
|
16897 | var _interopRequireDefault = __webpack_require__(0);
|
16898 |
|
16899 | var _slice = _interopRequireDefault(__webpack_require__(43));
|
16900 |
|
16901 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16902 |
|
16903 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16904 | value: true
|
16905 | });
|
16906 |
|
16907 | function increaseIndentStyle($node, options) {
|
16908 | var $elem = $node.elems[0];
|
16909 |
|
16910 | if ($elem.style['paddingLeft'] === '') {
|
16911 | $node.css('padding-left', options.value + options.unit);
|
16912 | } else {
|
16913 | var oldPL = $elem.style['paddingLeft'];
|
16914 | var oldVal = (0, _slice["default"])(oldPL).call(oldPL, 0, oldPL.length - options.unit.length);
|
16915 | var newVal = Number(oldVal) + options.value;
|
16916 | $node.css('padding-left', "" + newVal + options.unit);
|
16917 | }
|
16918 | }
|
16919 |
|
16920 | exports["default"] = increaseIndentStyle;
|
16921 |
|
16922 | }),
|
16923 |
|
16924 | (function(module, exports, __webpack_require__) {
|
16925 |
|
16926 | "use strict";
|
16927 |
|
16928 |
|
16929 |
|
16930 |
|
16931 |
|
16932 |
|
16933 | var _interopRequireDefault = __webpack_require__(0);
|
16934 |
|
16935 | var _slice = _interopRequireDefault(__webpack_require__(43));
|
16936 |
|
16937 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16938 |
|
16939 | (0, _defineProperty["default"])(exports, "__esModule", {
|
16940 | value: true
|
16941 | });
|
16942 |
|
16943 | function decreaseIndentStyle($node, options) {
|
16944 | var $elem = $node.elems[0];
|
16945 |
|
16946 | if ($elem.style['paddingLeft'] !== '') {
|
16947 | var oldPL = $elem.style['paddingLeft'];
|
16948 | var oldVal = (0, _slice["default"])(oldPL).call(oldPL, 0, oldPL.length - options.unit.length);
|
16949 | var newVal = Number(oldVal) - options.value;
|
16950 |
|
16951 | if (newVal > 0) {
|
16952 | $node.css('padding-left', "" + newVal + options.unit);
|
16953 | } else {
|
16954 | $node.css('padding-left', '');
|
16955 | }
|
16956 | }
|
16957 | }
|
16958 |
|
16959 | exports["default"] = decreaseIndentStyle;
|
16960 |
|
16961 | }),
|
16962 |
|
16963 | (function(module, exports, __webpack_require__) {
|
16964 |
|
16965 | "use strict";
|
16966 |
|
16967 |
|
16968 | var _interopRequireDefault = __webpack_require__(0);
|
16969 |
|
16970 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
16971 |
|
16972 | var _create = _interopRequireDefault(__webpack_require__(3));
|
16973 |
|
16974 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
16975 |
|
16976 | var __extends = void 0 && (void 0).__extends || function () {
|
16977 | var _extendStatics = function extendStatics(d, b) {
|
16978 | _extendStatics = _setPrototypeOf["default"] || {
|
16979 | __proto__: []
|
16980 | } instanceof Array && function (d, b) {
|
16981 | d.__proto__ = b;
|
16982 | } || function (d, b) {
|
16983 | for (var p in b) {
|
16984 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
16985 | }
|
16986 | };
|
16987 |
|
16988 | return _extendStatics(d, b);
|
16989 | };
|
16990 |
|
16991 | return function (d, b) {
|
16992 | _extendStatics(d, b);
|
16993 |
|
16994 | function __() {
|
16995 | this.constructor = d;
|
16996 | }
|
16997 |
|
16998 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
16999 | };
|
17000 | }();
|
17001 |
|
17002 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17003 | return mod && mod.__esModule ? mod : {
|
17004 | "default": mod
|
17005 | };
|
17006 | };
|
17007 |
|
17008 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17009 | value: true
|
17010 | });
|
17011 |
|
17012 |
|
17013 |
|
17014 |
|
17015 |
|
17016 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17017 |
|
17018 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
17019 |
|
17020 | var Panel_1 = __importDefault(__webpack_require__(31));
|
17021 |
|
17022 | var create_panel_conf_1 = __importDefault(__webpack_require__(358));
|
17023 |
|
17024 | var Emoticon =
|
17025 |
|
17026 | function (_super) {
|
17027 | __extends(Emoticon, _super);
|
17028 |
|
17029 | function Emoticon(editor) {
|
17030 | var _this = this;
|
17031 |
|
17032 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u8868\u60C5\">\n <i class=\"w-e-icon-happy\"></i>\n </div>");
|
17033 | _this = _super.call(this, $elem, editor) || this;
|
17034 | return _this;
|
17035 | }
|
17036 | |
17037 |
|
17038 |
|
17039 |
|
17040 |
|
17041 | Emoticon.prototype.createPanel = function () {
|
17042 | var conf = create_panel_conf_1["default"](this.editor);
|
17043 | var panel = new Panel_1["default"](this, conf);
|
17044 | panel.create();
|
17045 | };
|
17046 | |
17047 |
|
17048 |
|
17049 |
|
17050 |
|
17051 | Emoticon.prototype.clickHandler = function () {
|
17052 | this.createPanel();
|
17053 | };
|
17054 |
|
17055 | Emoticon.prototype.tryChangeActive = function () {};
|
17056 |
|
17057 | return Emoticon;
|
17058 | }(PanelMenu_1["default"]);
|
17059 |
|
17060 | exports["default"] = Emoticon;
|
17061 |
|
17062 | }),
|
17063 |
|
17064 | (function(module, exports, __webpack_require__) {
|
17065 |
|
17066 | "use strict";
|
17067 |
|
17068 |
|
17069 |
|
17070 |
|
17071 |
|
17072 |
|
17073 | var _interopRequireDefault = __webpack_require__(0);
|
17074 |
|
17075 | var _trim = _interopRequireDefault(__webpack_require__(19));
|
17076 |
|
17077 | var _filter = _interopRequireDefault(__webpack_require__(66));
|
17078 |
|
17079 | var _map = _interopRequireDefault(__webpack_require__(29));
|
17080 |
|
17081 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17082 |
|
17083 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17084 | return mod && mod.__esModule ? mod : {
|
17085 | "default": mod
|
17086 | };
|
17087 | };
|
17088 |
|
17089 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17090 | value: true
|
17091 | });
|
17092 |
|
17093 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17094 |
|
17095 | function default_1(editor) {
|
17096 |
|
17097 | var emotions = editor.config.emotions;
|
17098 |
|
17099 |
|
17100 |
|
17101 | function GenerateExpressionStructure(ele) {
|
17102 |
|
17103 | var res = [];
|
17104 |
|
17105 | if (ele.type == 'image') {
|
17106 | var _context;
|
17107 |
|
17108 | res = (0, _map["default"])(_context = ele.content).call(_context, function (con) {
|
17109 | if (typeof con == 'string') return '';
|
17110 | return "<span title=\"" + con.alt + "\">\n <img class=\"eleImg\" style src=\"" + con.src + "\" alt=\"[" + con.alt + "]\">\n </span>";
|
17111 | });
|
17112 | res = (0, _filter["default"])(res).call(res, function (s) {
|
17113 | return s !== '';
|
17114 | });
|
17115 | }
|
17116 | else {
|
17117 | var _context2;
|
17118 |
|
17119 | res = (0, _map["default"])(_context2 = ele.content).call(_context2, function (con) {
|
17120 | return "<span class=\"eleImg\" title=\"" + con + "\">" + con + "</span>";
|
17121 | });
|
17122 | }
|
17123 |
|
17124 | return res.join('').replace(/ /g, '');
|
17125 | }
|
17126 |
|
17127 | var tabsConf = (0, _map["default"])(emotions).call(emotions, function (ele) {
|
17128 | return {
|
17129 | title: editor.i18next.t("menus.panelMenus.emoticon." + ele.title),
|
17130 |
|
17131 | tpl: "<div>" + GenerateExpressionStructure(ele) + "</div>",
|
17132 | events: [{
|
17133 | selector: '.eleImg',
|
17134 | type: 'click',
|
17135 | fn: function fn(e) {
|
17136 |
|
17137 | var $target = dom_core_1["default"](e.target);
|
17138 | var nodeName = $target.getNodeName();
|
17139 | var insertHtml;
|
17140 |
|
17141 | if (nodeName === 'IMG') {
|
17142 | var _context3;
|
17143 |
|
17144 |
|
17145 | insertHtml = (0, _trim["default"])(_context3 = $target.parent().html()).call(_context3);
|
17146 | } else {
|
17147 |
|
17148 | insertHtml = '<span>' + $target.html() + '</span>';
|
17149 | }
|
17150 |
|
17151 | editor.cmd["do"]('insertHTML', insertHtml);
|
17152 |
|
17153 | return true;
|
17154 | }
|
17155 | }]
|
17156 | };
|
17157 | });
|
17158 |
|
17159 |
|
17160 |
|
17161 | var conf = {
|
17162 | width: 300,
|
17163 | height: 230,
|
17164 | tabs: tabsConf
|
17165 | };
|
17166 | return conf;
|
17167 | }
|
17168 |
|
17169 | exports["default"] = default_1;
|
17170 |
|
17171 | }),
|
17172 |
|
17173 | (function(module, exports, __webpack_require__) {
|
17174 |
|
17175 | "use strict";
|
17176 |
|
17177 |
|
17178 |
|
17179 |
|
17180 |
|
17181 |
|
17182 | var _interopRequireDefault = __webpack_require__(0);
|
17183 |
|
17184 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17185 |
|
17186 | var _create = _interopRequireDefault(__webpack_require__(3));
|
17187 |
|
17188 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
17189 |
|
17190 | var __extends = void 0 && (void 0).__extends || function () {
|
17191 | var _extendStatics = function extendStatics(d, b) {
|
17192 | _extendStatics = _setPrototypeOf["default"] || {
|
17193 | __proto__: []
|
17194 | } instanceof Array && function (d, b) {
|
17195 | d.__proto__ = b;
|
17196 | } || function (d, b) {
|
17197 | for (var p in b) {
|
17198 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
17199 | }
|
17200 | };
|
17201 |
|
17202 | return _extendStatics(d, b);
|
17203 | };
|
17204 |
|
17205 | return function (d, b) {
|
17206 | _extendStatics(d, b);
|
17207 |
|
17208 | function __() {
|
17209 | this.constructor = d;
|
17210 | }
|
17211 |
|
17212 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
17213 | };
|
17214 | }();
|
17215 |
|
17216 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17217 | return mod && mod.__esModule ? mod : {
|
17218 | "default": mod
|
17219 | };
|
17220 | };
|
17221 |
|
17222 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17223 | value: true
|
17224 | });
|
17225 |
|
17226 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17227 |
|
17228 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
17229 |
|
17230 | var List =
|
17231 |
|
17232 | function (_super) {
|
17233 | __extends(List, _super);
|
17234 |
|
17235 | function List(editor) {
|
17236 | var _this = this;
|
17237 |
|
17238 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u5E8F\u5217\">\n <i class=\"w-e-icon-list2\"></i>\n </div>");
|
17239 | var dropListConf = {
|
17240 | width: 130,
|
17241 | title: '序列',
|
17242 | type: 'list',
|
17243 | list: [{
|
17244 | $elem: dom_core_1["default"]("\n <p>\n <i class=\"w-e-icon-list2 w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.list.无序列表') + "\n <p>"),
|
17245 | value: 'insertUnorderedList'
|
17246 | }, {
|
17247 | $elem: dom_core_1["default"]("<p>\n <i class=\"w-e-icon-list-numbered w-e-drop-list-item\"></i>\n " + editor.i18next.t('menus.dropListMenu.list.有序列表') + "\n <p>"),
|
17248 | value: 'insertOrderedList'
|
17249 | }],
|
17250 | clickHandler: function clickHandler(value) {
|
17251 |
|
17252 | _this.command(value);
|
17253 | }
|
17254 | };
|
17255 | _this = _super.call(this, $elem, editor, dropListConf) || this;
|
17256 | return _this;
|
17257 | }
|
17258 |
|
17259 | List.prototype.command = function (value) {
|
17260 | var editor = this.editor;
|
17261 | var $textElem = editor.$textElem;
|
17262 | editor.selection.restoreSelection();
|
17263 |
|
17264 | if (editor.cmd.queryCommandState(value)) {
|
17265 | return;
|
17266 | }
|
17267 |
|
17268 |
|
17269 | var $selectionElem = dom_core_1["default"](editor.selection.getSelectionContainerElem());
|
17270 | var $dom = dom_core_1["default"]($selectionElem.elems[0]).parentUntil('TABLE', $selectionElem.elems[0]);
|
17271 |
|
17272 | if ($dom && dom_core_1["default"]($dom.elems[0]).getNodeName() === 'TABLE') {
|
17273 | return;
|
17274 | }
|
17275 |
|
17276 | editor.cmd["do"](value);
|
17277 |
|
17278 | if ($selectionElem.getNodeName() === 'LI') {
|
17279 | $selectionElem = $selectionElem.parent();
|
17280 | }
|
17281 |
|
17282 | if (/^ol|ul$/i.test($selectionElem.getNodeName()) === false) {
|
17283 | return;
|
17284 | }
|
17285 |
|
17286 | if ($selectionElem.equal($textElem)) {
|
17287 |
|
17288 | return;
|
17289 | }
|
17290 |
|
17291 | var $parent = $selectionElem.parent();
|
17292 |
|
17293 | if ($parent.equal($textElem)) {
|
17294 |
|
17295 | return;
|
17296 | }
|
17297 |
|
17298 | $selectionElem.insertAfter($parent);
|
17299 | $parent.remove();
|
17300 |
|
17301 | editor.selection.restoreSelection();
|
17302 | this.tryChangeActive();
|
17303 | };
|
17304 |
|
17305 | List.prototype.tryChangeActive = function () {};
|
17306 |
|
17307 | return List;
|
17308 | }(DropListMenu_1["default"]);
|
17309 |
|
17310 | exports["default"] = List;
|
17311 |
|
17312 | }),
|
17313 |
|
17314 | (function(module, exports, __webpack_require__) {
|
17315 |
|
17316 | "use strict";
|
17317 |
|
17318 |
|
17319 |
|
17320 |
|
17321 |
|
17322 |
|
17323 |
|
17324 | var _interopRequireDefault = __webpack_require__(0);
|
17325 |
|
17326 | var _indexOf = _interopRequireDefault(__webpack_require__(54));
|
17327 |
|
17328 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
17329 |
|
17330 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17331 |
|
17332 | var _create = _interopRequireDefault(__webpack_require__(3));
|
17333 |
|
17334 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
17335 |
|
17336 | var __extends = void 0 && (void 0).__extends || function () {
|
17337 | var _extendStatics = function extendStatics(d, b) {
|
17338 | _extendStatics = _setPrototypeOf["default"] || {
|
17339 | __proto__: []
|
17340 | } instanceof Array && function (d, b) {
|
17341 | d.__proto__ = b;
|
17342 | } || function (d, b) {
|
17343 | for (var p in b) {
|
17344 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
17345 | }
|
17346 | };
|
17347 |
|
17348 | return _extendStatics(d, b);
|
17349 | };
|
17350 |
|
17351 | return function (d, b) {
|
17352 | _extendStatics(d, b);
|
17353 |
|
17354 | function __() {
|
17355 | this.constructor = d;
|
17356 | }
|
17357 |
|
17358 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
17359 | };
|
17360 | }();
|
17361 |
|
17362 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17363 | return mod && mod.__esModule ? mod : {
|
17364 | "default": mod
|
17365 | };
|
17366 | };
|
17367 |
|
17368 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17369 | value: true
|
17370 | });
|
17371 |
|
17372 | var DropListMenu_1 = __importDefault(__webpack_require__(23));
|
17373 |
|
17374 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17375 |
|
17376 | var lineHeightList_1 = __importDefault(__webpack_require__(361));
|
17377 |
|
17378 | var util_1 = __webpack_require__(7);
|
17379 |
|
17380 | var LineHeight =
|
17381 |
|
17382 | function (_super) {
|
17383 | __extends(LineHeight, _super);
|
17384 |
|
17385 | function LineHeight(editor) {
|
17386 | var _this = this;
|
17387 |
|
17388 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u884C\u9AD8\">\n <i class=\"w-e-icon-row-height\"></i>\n </div>");
|
17389 | var lineHeightMenu = new lineHeightList_1["default"](editor, editor.config.lineHeights);
|
17390 | var DropListMenu = {
|
17391 | width: 100,
|
17392 | title: '设置行高',
|
17393 | type: 'list',
|
17394 | list: lineHeightMenu.getItemList(),
|
17395 | clickHandler: function clickHandler(value) {
|
17396 |
|
17397 | editor.selection.saveRange();
|
17398 |
|
17399 | _this.command(value);
|
17400 | }
|
17401 | };
|
17402 | _this = _super.call(this, $elem, editor, DropListMenu) || this;
|
17403 | return _this;
|
17404 | }
|
17405 | |
17406 |
|
17407 |
|
17408 |
|
17409 |
|
17410 |
|
17411 | LineHeight.prototype.command = function (value) {
|
17412 | var _this = this;
|
17413 |
|
17414 | var _a;
|
17415 |
|
17416 | var selection = window.getSelection ? window.getSelection() : document.getSelection();
|
17417 |
|
17418 | var allowArray = ['P'];
|
17419 | var editor = this.editor;
|
17420 | var st = '';
|
17421 |
|
17422 | editor.selection.restoreSelection();
|
17423 | var $selectionElem = dom_core_1["default"](editor.selection.getSelectionContainerElem());
|
17424 | var $selectionAll = dom_core_1["default"](editor.selection.getSelectionContainerElem());
|
17425 |
|
17426 | var dom = dom_core_1["default"](editor.selection.getSelectionStartElem()).elems[0];
|
17427 |
|
17428 | var style = '';
|
17429 | var styleList = [];
|
17430 |
|
17431 | var styleStr = '';
|
17432 |
|
17433 | if ($selectionElem && editor.$textElem.equal($selectionElem)) {
|
17434 | var isIE = util_1.UA.isIE();
|
17435 |
|
17436 | if (isIE) {
|
17437 |
|
17438 | return;
|
17439 | }
|
17440 |
|
17441 |
|
17442 | var indexStore_1 = [];
|
17443 | var arrayDom_a = [];
|
17444 | var arrayDom_b = [];
|
17445 |
|
17446 | var StartElem_1 = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
17447 | var EndElem_1 = dom_core_1["default"](editor.selection.getSelectionEndElem());
|
17448 | var childList = (_a = editor.selection.getRange()) === null || _a === void 0 ? void 0 : _a.commonAncestorContainer.childNodes;
|
17449 | arrayDom_a.push(this.getDom(StartElem_1.elems[0]));
|
17450 | childList === null || childList === void 0 ? void 0 : (0, _forEach["default"])(childList).call(childList, function (item, index) {
|
17451 | if (item === _this.getDom(StartElem_1.elems[0])) {
|
17452 | indexStore_1.push(index);
|
17453 | }
|
17454 |
|
17455 | if (item === _this.getDom(EndElem_1.elems[0])) {
|
17456 | indexStore_1.push(index);
|
17457 | }
|
17458 | });
|
17459 |
|
17460 | var i = 0;
|
17461 | var d = void 0;
|
17462 | arrayDom_b.push(this.getDom(StartElem_1.elems[0]));
|
17463 |
|
17464 | while (arrayDom_a[i] !== this.getDom(EndElem_1.elems[0])) {
|
17465 | d = dom_core_1["default"](arrayDom_a[i].nextElementSibling).elems[0];
|
17466 |
|
17467 | if ((0, _indexOf["default"])(allowArray).call(allowArray, dom_core_1["default"](d).getNodeName()) !== -1) {
|
17468 | arrayDom_b.push(d);
|
17469 | arrayDom_a.push(d);
|
17470 | } else {
|
17471 | arrayDom_a.push(d);
|
17472 | }
|
17473 |
|
17474 | i++;
|
17475 | }
|
17476 |
|
17477 |
|
17478 | if (dom_core_1["default"](arrayDom_a[0]).getNodeName() !== 'P') {
|
17479 | i = 0;
|
17480 |
|
17481 | for (var k = 0; k < arrayDom_a.length; k++) {
|
17482 | if (dom_core_1["default"](arrayDom_a[k]).getNodeName() === 'P') {
|
17483 | i = k;
|
17484 | break;
|
17485 | }
|
17486 | }
|
17487 |
|
17488 |
|
17489 | if (i === 0) {
|
17490 | return;
|
17491 | }
|
17492 |
|
17493 | var _i = 0;
|
17494 |
|
17495 | while (_i !== i) {
|
17496 | arrayDom_a.shift();
|
17497 | _i++;
|
17498 | }
|
17499 | }
|
17500 |
|
17501 |
|
17502 | this.setRange(arrayDom_a[0], arrayDom_a[arrayDom_a.length - 1]);
|
17503 |
|
17504 | (0, _forEach["default"])(arrayDom_a).call(arrayDom_a, function (item) {
|
17505 | style = item.getAttribute('style');
|
17506 | styleList = style ? style.split(';') : [];
|
17507 | styleStr = '';
|
17508 |
|
17509 | if (dom_core_1["default"](item).getNodeName() === 'P') {
|
17510 |
|
17511 | value ? styleStr = _this.styleProcessing(styleList) + ("line-height:" + value + ";") : styleStr = _this.styleProcessing(styleList);
|
17512 | st = st + ("<" + dom_core_1["default"](item).getNodeName().toLowerCase() + " style=\"" + styleStr + "\">" + item.innerHTML + "</" + dom_core_1["default"](item).getNodeName().toLowerCase() + ">");
|
17513 | } else {
|
17514 | styleStr = _this.styleProcessing(styleList);
|
17515 | st = st + ("<" + dom_core_1["default"](item).getNodeName().toLowerCase() + " style=\"" + styleStr + "\">" + item.innerHTML + "</" + dom_core_1["default"](item).getNodeName().toLowerCase() + ">");
|
17516 | }
|
17517 | });
|
17518 | this.action(st, editor);
|
17519 |
|
17520 | dom = $selectionAll.elems[0];
|
17521 | this.setRange(dom.children[indexStore_1[0]], dom.children[indexStore_1[1]]);
|
17522 | return;
|
17523 | }
|
17524 |
|
17525 |
|
17526 | dom = this.getDom(dom);
|
17527 |
|
17528 | if ((0, _indexOf["default"])(allowArray).call(allowArray, dom_core_1["default"](dom).getNodeName()) === -1) {
|
17529 | return;
|
17530 | }
|
17531 |
|
17532 | style = dom.getAttribute('style');
|
17533 | styleList = style ? style.split(';') : [];
|
17534 |
|
17535 | selection === null || selection === void 0 ? void 0 : selection.selectAllChildren(dom);
|
17536 |
|
17537 | editor.selection.saveRange();
|
17538 |
|
17539 | if (!value) {
|
17540 | if (style) {
|
17541 | styleStr = this.styleProcessing(styleList);
|
17542 |
|
17543 | if (styleStr === '') {
|
17544 | st = "<" + dom_core_1["default"](dom).getNodeName().toLowerCase() + ">" + dom.innerHTML + "</" + dom_core_1["default"](dom).getNodeName().toLowerCase() + ">";
|
17545 | } else {
|
17546 | st = "<" + dom_core_1["default"](dom).getNodeName().toLowerCase() + " style=\"" + styleStr + "\">" + dom.innerHTML + "</" + dom_core_1["default"](dom).getNodeName().toLowerCase() + ">";
|
17547 | }
|
17548 |
|
17549 | this.action(st, editor);
|
17550 | }
|
17551 |
|
17552 | return;
|
17553 | }
|
17554 |
|
17555 | if (style) {
|
17556 |
|
17557 | styleStr = this.styleProcessing(styleList) + ("line-height:" + value + ";");
|
17558 | } else {
|
17559 | styleStr = "line-height:" + value + ";";
|
17560 | }
|
17561 |
|
17562 | st = "<" + dom_core_1["default"](dom).getNodeName().toLowerCase() + " style=\"" + styleStr + "\">" + dom.innerHTML + "</" + dom_core_1["default"](dom).getNodeName().toLowerCase() + ">";
|
17563 |
|
17564 | if (dom_core_1["default"](dom).getNodeName() === 'BLOCKQUOTE') {
|
17565 | dom_core_1["default"](dom).css('line-height', value);
|
17566 | } else {
|
17567 | this.action(st, editor);
|
17568 | }
|
17569 | };
|
17570 | |
17571 |
|
17572 |
|
17573 |
|
17574 |
|
17575 |
|
17576 | LineHeight.prototype.getDom = function (dom) {
|
17577 | var DOM = dom_core_1["default"](dom).elems[0];
|
17578 |
|
17579 | if (!DOM.parentNode) {
|
17580 | return DOM;
|
17581 | }
|
17582 |
|
17583 | function getParentNode($node, editor) {
|
17584 | var $parent = dom_core_1["default"]($node.parentNode);
|
17585 |
|
17586 | if (editor.$textElem.equal($parent)) {
|
17587 | return $node;
|
17588 | } else {
|
17589 | return getParentNode($parent.elems[0], editor);
|
17590 | }
|
17591 | }
|
17592 |
|
17593 | DOM = getParentNode(DOM, this.editor);
|
17594 | return DOM;
|
17595 | };
|
17596 | |
17597 |
|
17598 |
|
17599 |
|
17600 |
|
17601 |
|
17602 | LineHeight.prototype.action = function (html_str, editor) {
|
17603 | editor.cmd["do"]('insertHTML', html_str);
|
17604 | };
|
17605 | |
17606 |
|
17607 |
|
17608 |
|
17609 |
|
17610 | LineHeight.prototype.styleProcessing = function (styleList) {
|
17611 | var styleStr = '';
|
17612 | (0, _forEach["default"])(styleList).call(styleList, function (item) {
|
17613 | item !== '' && (0, _indexOf["default"])(item).call(item, 'line-height') === -1 ? styleStr = styleStr + item + ';' : '';
|
17614 | });
|
17615 | return styleStr;
|
17616 | };
|
17617 | |
17618 |
|
17619 |
|
17620 |
|
17621 |
|
17622 | LineHeight.prototype.setRange = function (startDom, endDom) {
|
17623 | var editor = this.editor;
|
17624 | var selection = window.getSelection ? window.getSelection() : document.getSelection();
|
17625 |
|
17626 | selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
17627 | var range = document.createRange();
|
17628 | var star = startDom;
|
17629 | var end = endDom;
|
17630 | range.setStart(star, 0);
|
17631 | range.setEnd(end, 1);
|
17632 | selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
17633 |
|
17634 | editor.selection.saveRange();
|
17635 |
|
17636 | selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
17637 |
|
17638 | editor.selection.restoreSelection();
|
17639 | };
|
17640 | |
17641 |
|
17642 |
|
17643 |
|
17644 |
|
17645 | LineHeight.prototype.tryChangeActive = function () {
|
17646 | var editor = this.editor;
|
17647 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
17648 |
|
17649 | if ($selectionElem && editor.$textElem.equal($selectionElem)) {
|
17650 |
|
17651 | return;
|
17652 | }
|
17653 |
|
17654 | var dom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
17655 | dom = this.getDom(dom.elems[0]);
|
17656 | var style = dom.getAttribute('style') ? dom.getAttribute('style') : '';
|
17657 |
|
17658 | if (style && (0, _indexOf["default"])(style).call(style, 'line-height') !== -1) {
|
17659 | this.active();
|
17660 | } else {
|
17661 | this.unActive();
|
17662 | }
|
17663 | };
|
17664 |
|
17665 | return LineHeight;
|
17666 | }(DropListMenu_1["default"]);
|
17667 |
|
17668 | exports["default"] = LineHeight;
|
17669 |
|
17670 | }),
|
17671 |
|
17672 | (function(module, exports, __webpack_require__) {
|
17673 |
|
17674 | "use strict";
|
17675 |
|
17676 |
|
17677 | var _interopRequireDefault = __webpack_require__(0);
|
17678 |
|
17679 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
17680 |
|
17681 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17682 |
|
17683 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17684 | return mod && mod.__esModule ? mod : {
|
17685 | "default": mod
|
17686 | };
|
17687 | };
|
17688 |
|
17689 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17690 | value: true
|
17691 | });
|
17692 |
|
17693 |
|
17694 |
|
17695 |
|
17696 |
|
17697 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17698 |
|
17699 | var lineHeightList =
|
17700 |
|
17701 | function () {
|
17702 | function lineHeightList(editor, list) {
|
17703 | var _this = this;
|
17704 |
|
17705 | this.itemList = [{
|
17706 | $elem: dom_core_1["default"]("<span>" + editor.i18next.t('默认') + "</span>"),
|
17707 | value: ''
|
17708 | }];
|
17709 | (0, _forEach["default"])(list).call(list, function (item) {
|
17710 | _this.itemList.push({
|
17711 | $elem: dom_core_1["default"]("<span>" + item + "</span>"),
|
17712 | value: item
|
17713 | });
|
17714 | });
|
17715 | }
|
17716 |
|
17717 | lineHeightList.prototype.getItemList = function () {
|
17718 | return this.itemList;
|
17719 | };
|
17720 |
|
17721 | return lineHeightList;
|
17722 | }();
|
17723 |
|
17724 | exports["default"] = lineHeightList;
|
17725 |
|
17726 | }),
|
17727 |
|
17728 | (function(module, exports, __webpack_require__) {
|
17729 |
|
17730 | "use strict";
|
17731 |
|
17732 |
|
17733 |
|
17734 |
|
17735 |
|
17736 |
|
17737 | var _interopRequireDefault = __webpack_require__(0);
|
17738 |
|
17739 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17740 |
|
17741 | var _create = _interopRequireDefault(__webpack_require__(3));
|
17742 |
|
17743 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
17744 |
|
17745 | var __extends = void 0 && (void 0).__extends || function () {
|
17746 | var _extendStatics = function extendStatics(d, b) {
|
17747 | _extendStatics = _setPrototypeOf["default"] || {
|
17748 | __proto__: []
|
17749 | } instanceof Array && function (d, b) {
|
17750 | d.__proto__ = b;
|
17751 | } || function (d, b) {
|
17752 | for (var p in b) {
|
17753 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
17754 | }
|
17755 | };
|
17756 |
|
17757 | return _extendStatics(d, b);
|
17758 | };
|
17759 |
|
17760 | return function (d, b) {
|
17761 | _extendStatics(d, b);
|
17762 |
|
17763 | function __() {
|
17764 | this.constructor = d;
|
17765 | }
|
17766 |
|
17767 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
17768 | };
|
17769 | }();
|
17770 |
|
17771 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17772 | return mod && mod.__esModule ? mod : {
|
17773 | "default": mod
|
17774 | };
|
17775 | };
|
17776 |
|
17777 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17778 | value: true
|
17779 | });
|
17780 |
|
17781 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17782 |
|
17783 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
17784 |
|
17785 | var Undo =
|
17786 |
|
17787 | function (_super) {
|
17788 | __extends(Undo, _super);
|
17789 |
|
17790 | function Undo(editor) {
|
17791 | var _this = this;
|
17792 |
|
17793 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u6062\u590D\">\n <i class=\"w-e-icon-undo\"></i>\n </div>");
|
17794 | _this = _super.call(this, $elem, editor) || this;
|
17795 | return _this;
|
17796 | }
|
17797 | |
17798 |
|
17799 |
|
17800 |
|
17801 |
|
17802 | Undo.prototype.clickHandler = function () {
|
17803 | this.editor.history.revoke();
|
17804 | };
|
17805 | |
17806 |
|
17807 |
|
17808 |
|
17809 |
|
17810 | Undo.prototype.tryChangeActive = function () {
|
17811 |
|
17812 | if (!this.editor.isCompatibleMode) {
|
17813 | if (this.editor.history.size[0]) {
|
17814 | this.active();
|
17815 | } else {
|
17816 | this.unActive();
|
17817 | }
|
17818 | }
|
17819 | };
|
17820 |
|
17821 | return Undo;
|
17822 | }(BtnMenu_1["default"]);
|
17823 |
|
17824 | exports["default"] = Undo;
|
17825 |
|
17826 | }),
|
17827 |
|
17828 | (function(module, exports, __webpack_require__) {
|
17829 |
|
17830 | "use strict";
|
17831 |
|
17832 |
|
17833 |
|
17834 |
|
17835 |
|
17836 |
|
17837 | var _interopRequireDefault = __webpack_require__(0);
|
17838 |
|
17839 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17840 |
|
17841 | var _create = _interopRequireDefault(__webpack_require__(3));
|
17842 |
|
17843 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
17844 |
|
17845 | var __extends = void 0 && (void 0).__extends || function () {
|
17846 | var _extendStatics = function extendStatics(d, b) {
|
17847 | _extendStatics = _setPrototypeOf["default"] || {
|
17848 | __proto__: []
|
17849 | } instanceof Array && function (d, b) {
|
17850 | d.__proto__ = b;
|
17851 | } || function (d, b) {
|
17852 | for (var p in b) {
|
17853 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
17854 | }
|
17855 | };
|
17856 |
|
17857 | return _extendStatics(d, b);
|
17858 | };
|
17859 |
|
17860 | return function (d, b) {
|
17861 | _extendStatics(d, b);
|
17862 |
|
17863 | function __() {
|
17864 | this.constructor = d;
|
17865 | }
|
17866 |
|
17867 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
17868 | };
|
17869 | }();
|
17870 |
|
17871 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17872 | return mod && mod.__esModule ? mod : {
|
17873 | "default": mod
|
17874 | };
|
17875 | };
|
17876 |
|
17877 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17878 | value: true
|
17879 | });
|
17880 |
|
17881 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17882 |
|
17883 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
17884 |
|
17885 | var Redo =
|
17886 |
|
17887 | function (_super) {
|
17888 | __extends(Redo, _super);
|
17889 |
|
17890 | function Redo(editor) {
|
17891 | var _this = this;
|
17892 |
|
17893 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u64A4\u9500\">\n <i class=\"w-e-icon-redo\"></i>\n </div>");
|
17894 | _this = _super.call(this, $elem, editor) || this;
|
17895 | return _this;
|
17896 | }
|
17897 | |
17898 |
|
17899 |
|
17900 |
|
17901 |
|
17902 | Redo.prototype.clickHandler = function () {
|
17903 | this.editor.history.restore();
|
17904 | };
|
17905 | |
17906 |
|
17907 |
|
17908 |
|
17909 |
|
17910 | Redo.prototype.tryChangeActive = function () {
|
17911 |
|
17912 | if (!this.editor.isCompatibleMode) {
|
17913 | if (this.editor.history.size[1]) {
|
17914 | this.active();
|
17915 | } else {
|
17916 | this.unActive();
|
17917 | }
|
17918 | }
|
17919 | };
|
17920 |
|
17921 | return Redo;
|
17922 | }(BtnMenu_1["default"]);
|
17923 |
|
17924 | exports["default"] = Redo;
|
17925 |
|
17926 | }),
|
17927 |
|
17928 | (function(module, exports, __webpack_require__) {
|
17929 |
|
17930 | "use strict";
|
17931 |
|
17932 |
|
17933 |
|
17934 |
|
17935 |
|
17936 |
|
17937 | var _interopRequireDefault = __webpack_require__(0);
|
17938 |
|
17939 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
17940 |
|
17941 | var _create = _interopRequireDefault(__webpack_require__(3));
|
17942 |
|
17943 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
17944 |
|
17945 | var __extends = void 0 && (void 0).__extends || function () {
|
17946 | var _extendStatics = function extendStatics(d, b) {
|
17947 | _extendStatics = _setPrototypeOf["default"] || {
|
17948 | __proto__: []
|
17949 | } instanceof Array && function (d, b) {
|
17950 | d.__proto__ = b;
|
17951 | } || function (d, b) {
|
17952 | for (var p in b) {
|
17953 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
17954 | }
|
17955 | };
|
17956 |
|
17957 | return _extendStatics(d, b);
|
17958 | };
|
17959 |
|
17960 | return function (d, b) {
|
17961 | _extendStatics(d, b);
|
17962 |
|
17963 | function __() {
|
17964 | this.constructor = d;
|
17965 | }
|
17966 |
|
17967 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
17968 | };
|
17969 | }();
|
17970 |
|
17971 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
17972 | return mod && mod.__esModule ? mod : {
|
17973 | "default": mod
|
17974 | };
|
17975 | };
|
17976 |
|
17977 | (0, _defineProperty["default"])(exports, "__esModule", {
|
17978 | value: true
|
17979 | });
|
17980 |
|
17981 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
17982 |
|
17983 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
17984 |
|
17985 | var create_panel_conf_1 = __importDefault(__webpack_require__(365));
|
17986 |
|
17987 | var Panel_1 = __importDefault(__webpack_require__(31));
|
17988 |
|
17989 | var index_1 = __importDefault(__webpack_require__(369));
|
17990 |
|
17991 | var Table =
|
17992 |
|
17993 | function (_super) {
|
17994 | __extends(Table, _super);
|
17995 |
|
17996 | function Table(editor) {
|
17997 | var _this = this;
|
17998 |
|
17999 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="表格"><i class="w-e-icon-table2"></i></div>');
|
18000 | _this = _super.call(this, $elem, editor) || this;
|
18001 |
|
18002 | index_1["default"](editor);
|
18003 | return _this;
|
18004 | }
|
18005 | |
18006 |
|
18007 |
|
18008 |
|
18009 |
|
18010 | Table.prototype.clickHandler = function () {
|
18011 | this.createPanel();
|
18012 | };
|
18013 | |
18014 |
|
18015 |
|
18016 |
|
18017 |
|
18018 | Table.prototype.createPanel = function () {
|
18019 | var conf = create_panel_conf_1["default"](this.editor);
|
18020 | var panel = new Panel_1["default"](this, conf);
|
18021 | panel.create();
|
18022 | };
|
18023 | |
18024 |
|
18025 |
|
18026 |
|
18027 |
|
18028 | Table.prototype.tryChangeActive = function () {};
|
18029 |
|
18030 | return Table;
|
18031 | }(PanelMenu_1["default"]);
|
18032 |
|
18033 | exports["default"] = Table;
|
18034 |
|
18035 | }),
|
18036 |
|
18037 | (function(module, exports, __webpack_require__) {
|
18038 |
|
18039 | "use strict";
|
18040 |
|
18041 |
|
18042 |
|
18043 |
|
18044 |
|
18045 |
|
18046 | var _interopRequireDefault = __webpack_require__(0);
|
18047 |
|
18048 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18049 |
|
18050 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
18051 | return mod && mod.__esModule ? mod : {
|
18052 | "default": mod
|
18053 | };
|
18054 | };
|
18055 |
|
18056 | (0, _defineProperty["default"])(exports, "__esModule", {
|
18057 | value: true
|
18058 | });
|
18059 |
|
18060 | var util_1 = __webpack_require__(7);
|
18061 |
|
18062 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
18063 |
|
18064 | __webpack_require__(366);
|
18065 |
|
18066 | var create_table_1 = __importDefault(__webpack_require__(368));
|
18067 |
|
18068 | function default_1(editor) {
|
18069 | var createTable = new create_table_1["default"](editor);
|
18070 |
|
18071 | var colId = util_1.getRandom('w-col-id');
|
18072 | var rowId = util_1.getRandom('w-row-id');
|
18073 | var insertBtnId = util_1.getRandom('btn-link');
|
18074 | var i18nPrefix = 'menus.panelMenus.table.';
|
18075 |
|
18076 | var t = function t(text) {
|
18077 | return editor.i18next.t(text);
|
18078 | };
|
18079 |
|
18080 |
|
18081 | var tabsConf = [{
|
18082 | title: t(i18nPrefix + "\u63D2\u5165\u8868\u683C"),
|
18083 | tpl: "<div>\n <div class=\"w-e-table\">\n <span>" + t('创建') + "</span>\n <input id=\"" + rowId + "\" type=\"text\" class=\"w-e-table-input\" value=\"5\"/></td>\n <span>" + t(i18nPrefix + "\u884C") + "</span>\n <input id=\"" + colId + "\" type=\"text\" class=\"w-e-table-input\" value=\"5\"/></td>\n <span>" + (t(i18nPrefix + "\u5217") + t(i18nPrefix + "\u7684") + t(i18nPrefix + "\u8868\u683C")) + "</span>\n </div>\n <div class=\"w-e-button-container\">\n <button type=\"button\" id=\"" + insertBtnId + "\" class=\"right\">" + t('插入') + "</button>\n </div>\n </div>",
|
18084 | events: [{
|
18085 | selector: '#' + insertBtnId,
|
18086 | type: 'click',
|
18087 | fn: function fn() {
|
18088 | var colValue = Number(dom_core_1["default"]('#' + colId).val());
|
18089 | var rowValue = Number(dom_core_1["default"]('#' + rowId).val());
|
18090 |
|
18091 | if (colValue && rowValue) {
|
18092 | createTable.createAction(rowValue, colValue);
|
18093 | }
|
18094 |
|
18095 |
|
18096 | return true;
|
18097 | }
|
18098 | }]
|
18099 | }];
|
18100 |
|
18101 |
|
18102 | var conf = {
|
18103 | width: 330,
|
18104 | height: 0,
|
18105 | tabs: []
|
18106 | };
|
18107 | conf.tabs.push(tabsConf[0]);
|
18108 | return conf;
|
18109 | }
|
18110 |
|
18111 | exports["default"] = default_1;
|
18112 |
|
18113 | }),
|
18114 |
|
18115 | (function(module, exports, __webpack_require__) {
|
18116 |
|
18117 | var api = __webpack_require__(20);
|
18118 | var content = __webpack_require__(367);
|
18119 |
|
18120 | content = content.__esModule ? content.default : content;
|
18121 |
|
18122 | if (typeof content === 'string') {
|
18123 | content = [[module.i, content, '']];
|
18124 | }
|
18125 |
|
18126 | var options = {};
|
18127 |
|
18128 | options.insert = "head";
|
18129 | options.singleton = false;
|
18130 |
|
18131 | var update = api(content, options);
|
18132 |
|
18133 |
|
18134 |
|
18135 | module.exports = content.locals || {};
|
18136 |
|
18137 | }),
|
18138 |
|
18139 | (function(module, exports, __webpack_require__) {
|
18140 |
|
18141 |
|
18142 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
18143 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
18144 |
|
18145 | exports.push([module.i, ".w-e-table {\n display: flex;\n}\n.w-e-table .w-e-table-input {\n width: 40px;\n text-align: center!important;\n margin: 0 5px;\n}\n", ""]);
|
18146 |
|
18147 | module.exports = exports;
|
18148 |
|
18149 |
|
18150 | }),
|
18151 |
|
18152 | (function(module, exports, __webpack_require__) {
|
18153 |
|
18154 | "use strict";
|
18155 |
|
18156 |
|
18157 |
|
18158 |
|
18159 |
|
18160 |
|
18161 | var _interopRequireDefault = __webpack_require__(0);
|
18162 |
|
18163 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18164 |
|
18165 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
18166 | return mod && mod.__esModule ? mod : {
|
18167 | "default": mod
|
18168 | };
|
18169 | };
|
18170 |
|
18171 | (0, _defineProperty["default"])(exports, "__esModule", {
|
18172 | value: true
|
18173 | });
|
18174 |
|
18175 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
18176 |
|
18177 | var CreateTable =
|
18178 |
|
18179 | function () {
|
18180 | function CreateTable(editor) {
|
18181 | this.editor = editor;
|
18182 | }
|
18183 | |
18184 |
|
18185 |
|
18186 |
|
18187 |
|
18188 |
|
18189 |
|
18190 | CreateTable.prototype.createAction = function (rowValue, colValue) {
|
18191 | var editor = this.editor;
|
18192 |
|
18193 | var $selectionElem = dom_core_1["default"](editor.selection.getSelectionContainerElem());
|
18194 | var $ul = dom_core_1["default"]($selectionElem.elems[0]).parentUntil('UL', $selectionElem.elems[0]);
|
18195 | var $ol = dom_core_1["default"]($selectionElem.elems[0]).parentUntil('OL', $selectionElem.elems[0]);
|
18196 |
|
18197 | if ($ul || $ol) {
|
18198 | return;
|
18199 | }
|
18200 |
|
18201 | var tableDom = this.createTableHtml(rowValue, colValue);
|
18202 | editor.cmd["do"]('insertHTML', tableDom);
|
18203 | };
|
18204 | |
18205 |
|
18206 |
|
18207 |
|
18208 |
|
18209 |
|
18210 |
|
18211 | CreateTable.prototype.createTableHtml = function (rowValue, colValue) {
|
18212 | var rowStr = '';
|
18213 | var colStr = '';
|
18214 |
|
18215 | for (var i = 0; i < rowValue; i++) {
|
18216 | colStr = '';
|
18217 |
|
18218 | for (var j = 0; j < colValue; j++) {
|
18219 | if (i === 0) {
|
18220 | colStr = colStr + '<th></th>';
|
18221 | } else {
|
18222 | colStr = colStr + '<td></td>';
|
18223 | }
|
18224 | }
|
18225 |
|
18226 | rowStr = rowStr + '<tr>' + colStr + '</tr>';
|
18227 | }
|
18228 |
|
18229 | var tableDom = "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tbody>" + rowStr + '</tbody></table><p><br></p>';
|
18230 | return tableDom;
|
18231 | };
|
18232 |
|
18233 | return CreateTable;
|
18234 | }();
|
18235 |
|
18236 | exports["default"] = CreateTable;
|
18237 |
|
18238 | }),
|
18239 |
|
18240 | (function(module, exports, __webpack_require__) {
|
18241 |
|
18242 | "use strict";
|
18243 |
|
18244 |
|
18245 |
|
18246 |
|
18247 |
|
18248 |
|
18249 | var _interopRequireDefault = __webpack_require__(0);
|
18250 |
|
18251 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18252 |
|
18253 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
18254 | return mod && mod.__esModule ? mod : {
|
18255 | "default": mod
|
18256 | };
|
18257 | };
|
18258 |
|
18259 | (0, _defineProperty["default"])(exports, "__esModule", {
|
18260 | value: true
|
18261 | });
|
18262 |
|
18263 | var tooltip_event_1 = __importDefault(__webpack_require__(370));
|
18264 |
|
18265 |
|
18266 |
|
18267 |
|
18268 |
|
18269 |
|
18270 | function bindEvent(editor) {
|
18271 |
|
18272 | tooltip_event_1["default"](editor);
|
18273 | }
|
18274 |
|
18275 | exports["default"] = bindEvent;
|
18276 |
|
18277 | }),
|
18278 |
|
18279 | (function(module, exports, __webpack_require__) {
|
18280 |
|
18281 | "use strict";
|
18282 |
|
18283 |
|
18284 |
|
18285 |
|
18286 |
|
18287 |
|
18288 | var _interopRequireDefault = __webpack_require__(0);
|
18289 |
|
18290 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18291 |
|
18292 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
18293 | return mod && mod.__esModule ? mod : {
|
18294 | "default": mod
|
18295 | };
|
18296 | };
|
18297 |
|
18298 | (0, _defineProperty["default"])(exports, "__esModule", {
|
18299 | value: true
|
18300 | });
|
18301 |
|
18302 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
18303 |
|
18304 | var Tooltip_1 = __importDefault(__webpack_require__(44));
|
18305 |
|
18306 |
|
18307 | var operating_event_1 = __importDefault(__webpack_require__(371));
|
18308 |
|
18309 | var getNode_1 = __importDefault(__webpack_require__(372));
|
18310 |
|
18311 |
|
18312 |
|
18313 |
|
18314 |
|
18315 | function createShowHideFn(editor) {
|
18316 | var tooltip;
|
18317 | |
18318 |
|
18319 |
|
18320 |
|
18321 |
|
18322 | function showTableTooltip($node) {
|
18323 | var getnode = new getNode_1["default"](editor);
|
18324 | var i18nPrefix = 'menus.panelMenus.table.';
|
18325 |
|
18326 | var t = function t(text, prefix) {
|
18327 | if (prefix === void 0) {
|
18328 | prefix = i18nPrefix;
|
18329 | }
|
18330 |
|
18331 | return editor.i18next.t(prefix + text);
|
18332 | };
|
18333 |
|
18334 | var conf = [{
|
18335 |
|
18336 | $elem: dom_core_1["default"]("<span>" + t('删除表格') + "</span>"),
|
18337 | onClick: function onClick(editor, $node) {
|
18338 |
|
18339 | editor.selection.createRangeByElem($node);
|
18340 | editor.selection.restoreSelection();
|
18341 | editor.cmd["do"]('insertHTML', '<p><br></p>');
|
18342 |
|
18343 | return true;
|
18344 | }
|
18345 | }, {
|
18346 | $elem: dom_core_1["default"]("<span>" + t('添加行') + "</span>"),
|
18347 | onClick: function onClick(editor, $node) {
|
18348 |
|
18349 | var isMore = isMoreRowAction(editor);
|
18350 |
|
18351 | if (isMore) {
|
18352 | return true;
|
18353 | }
|
18354 |
|
18355 |
|
18356 | var selectDom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
18357 |
|
18358 | var $currentRow = getnode.getRowNode(selectDom.elems[0]);
|
18359 |
|
18360 | if (!$currentRow) {
|
18361 | return true;
|
18362 | }
|
18363 |
|
18364 |
|
18365 | var index = Number(getnode.getCurrentRowIndex($node.elems[0], $currentRow));
|
18366 |
|
18367 | var htmlStr = getnode.getTableHtml($node.elems[0]);
|
18368 |
|
18369 | var newdom = getnode.getTableHtml(operating_event_1["default"].ProcessingRow(dom_core_1["default"](htmlStr), index).elems[0]);
|
18370 |
|
18371 | editor.selection.createRangeByElem($node);
|
18372 | editor.selection.restoreSelection();
|
18373 | editor.cmd["do"]('insertHTML', newdom);
|
18374 | return true;
|
18375 | }
|
18376 | }, {
|
18377 | $elem: dom_core_1["default"]("<span>" + t('删除行') + "</span>"),
|
18378 | onClick: function onClick(editor, $node) {
|
18379 |
|
18380 | var isMore = isMoreRowAction(editor);
|
18381 |
|
18382 | if (isMore) {
|
18383 | return true;
|
18384 | }
|
18385 |
|
18386 |
|
18387 | var selectDom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
18388 |
|
18389 | var $currentRow = getnode.getRowNode(selectDom.elems[0]);
|
18390 |
|
18391 | if (!$currentRow) {
|
18392 | return true;
|
18393 | }
|
18394 |
|
18395 |
|
18396 | var index = Number(getnode.getCurrentRowIndex($node.elems[0], $currentRow));
|
18397 |
|
18398 | var htmlStr = getnode.getTableHtml($node.elems[0]);
|
18399 |
|
18400 | var trLength = operating_event_1["default"].DeleteRow(dom_core_1["default"](htmlStr), index).elems[0].childNodes[0].childNodes.length;
|
18401 |
|
18402 | var newdom = '';
|
18403 |
|
18404 | editor.selection.createRangeByElem($node);
|
18405 | editor.selection.restoreSelection();
|
18406 |
|
18407 | if (trLength === 0) {
|
18408 | newdom = '<p><br></p>';
|
18409 | } else {
|
18410 | newdom = getnode.getTableHtml(operating_event_1["default"].DeleteRow(dom_core_1["default"](htmlStr), index).elems[0]);
|
18411 | }
|
18412 |
|
18413 | editor.cmd["do"]('insertHTML', newdom);
|
18414 | return true;
|
18415 | }
|
18416 | }, {
|
18417 | $elem: dom_core_1["default"]("<span>" + t('添加列') + "</span>"),
|
18418 | onClick: function onClick(editor, $node) {
|
18419 |
|
18420 | var isMore = isMoreRowAction(editor);
|
18421 |
|
18422 | if (isMore) {
|
18423 | return true;
|
18424 | }
|
18425 |
|
18426 |
|
18427 | var selectDom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
18428 |
|
18429 | var index = getnode.getCurrentColIndex(selectDom.elems[0]);
|
18430 |
|
18431 | var htmlStr = getnode.getTableHtml($node.elems[0]);
|
18432 |
|
18433 | var newdom = getnode.getTableHtml(operating_event_1["default"].ProcessingCol(dom_core_1["default"](htmlStr), index).elems[0]);
|
18434 |
|
18435 | editor.selection.createRangeByElem($node);
|
18436 | editor.selection.restoreSelection();
|
18437 | editor.cmd["do"]('insertHTML', newdom);
|
18438 | return true;
|
18439 | }
|
18440 | }, {
|
18441 | $elem: dom_core_1["default"]("<span>" + t('删除列') + "</span>"),
|
18442 | onClick: function onClick(editor, $node) {
|
18443 |
|
18444 | var isMore = isMoreRowAction(editor);
|
18445 |
|
18446 | if (isMore) {
|
18447 | return true;
|
18448 | }
|
18449 |
|
18450 |
|
18451 | var selectDom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
18452 |
|
18453 | var index = getnode.getCurrentColIndex(selectDom.elems[0]);
|
18454 |
|
18455 | var htmlStr = getnode.getTableHtml($node.elems[0]);
|
18456 |
|
18457 | var tdLength = operating_event_1["default"].DeleteCol(dom_core_1["default"](htmlStr), index).elems[0].childNodes[0].childNodes[0].childNodes.length;
|
18458 |
|
18459 | var newdom = '';
|
18460 |
|
18461 | editor.selection.createRangeByElem($node);
|
18462 | editor.selection.restoreSelection();
|
18463 |
|
18464 | if (tdLength === 1) {
|
18465 | newdom = '<p><br></p>';
|
18466 | } else {
|
18467 | newdom = getnode.getTableHtml(operating_event_1["default"].DeleteCol(dom_core_1["default"](htmlStr), index).elems[0]);
|
18468 | }
|
18469 |
|
18470 | editor.cmd["do"]('insertHTML', newdom);
|
18471 | return true;
|
18472 | }
|
18473 | }, {
|
18474 | $elem: dom_core_1["default"]("<span>" + t('设置表头') + "</span>"),
|
18475 | onClick: function onClick(editor, $node) {
|
18476 |
|
18477 | var isMore = isMoreRowAction(editor);
|
18478 |
|
18479 | if (isMore) {
|
18480 | return true;
|
18481 | }
|
18482 |
|
18483 |
|
18484 | var selectDom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
18485 |
|
18486 | var $currentRow = getnode.getRowNode(selectDom.elems[0]);
|
18487 |
|
18488 | if (!$currentRow) {
|
18489 | return true;
|
18490 | }
|
18491 |
|
18492 |
|
18493 | var index = Number(getnode.getCurrentRowIndex($node.elems[0], $currentRow));
|
18494 |
|
18495 | if (index !== 0) {
|
18496 |
|
18497 | index = 0;
|
18498 | }
|
18499 |
|
18500 |
|
18501 | var htmlStr = getnode.getTableHtml($node.elems[0]);
|
18502 |
|
18503 | var newdom = getnode.getTableHtml(operating_event_1["default"].setTheHeader(dom_core_1["default"](htmlStr), index, 'th').elems[0]);
|
18504 |
|
18505 | editor.selection.createRangeByElem($node);
|
18506 | editor.selection.restoreSelection();
|
18507 | editor.cmd["do"]('insertHTML', newdom);
|
18508 | return true;
|
18509 | }
|
18510 | }, {
|
18511 | $elem: dom_core_1["default"]("<span>" + t('取消表头') + "</span>"),
|
18512 | onClick: function onClick(editor, $node) {
|
18513 |
|
18514 | var selectDom = dom_core_1["default"](editor.selection.getSelectionStartElem());
|
18515 |
|
18516 | var $currentRow = getnode.getRowNode(selectDom.elems[0]);
|
18517 |
|
18518 | if (!$currentRow) {
|
18519 | return true;
|
18520 | }
|
18521 |
|
18522 |
|
18523 | var index = Number(getnode.getCurrentRowIndex($node.elems[0], $currentRow));
|
18524 |
|
18525 | if (index !== 0) {
|
18526 |
|
18527 | index = 0;
|
18528 | }
|
18529 |
|
18530 |
|
18531 | var htmlStr = getnode.getTableHtml($node.elems[0]);
|
18532 |
|
18533 | var newdom = getnode.getTableHtml(operating_event_1["default"].setTheHeader(dom_core_1["default"](htmlStr), index, 'td').elems[0]);
|
18534 |
|
18535 | editor.selection.createRangeByElem($node);
|
18536 | editor.selection.restoreSelection();
|
18537 | editor.cmd["do"]('insertHTML', newdom);
|
18538 | return true;
|
18539 | }
|
18540 | }];
|
18541 | tooltip = new Tooltip_1["default"](editor, $node, conf);
|
18542 | tooltip.create();
|
18543 | }
|
18544 | |
18545 |
|
18546 |
|
18547 |
|
18548 |
|
18549 | function hideTableTooltip() {
|
18550 |
|
18551 | if (tooltip) {
|
18552 | tooltip.remove();
|
18553 | tooltip = null;
|
18554 | }
|
18555 | }
|
18556 |
|
18557 | return {
|
18558 | showTableTooltip: showTableTooltip,
|
18559 | hideTableTooltip: hideTableTooltip
|
18560 | };
|
18561 | }
|
18562 |
|
18563 |
|
18564 |
|
18565 |
|
18566 |
|
18567 | function isMoreRowAction(editor) {
|
18568 | var $startElem = editor.selection.getSelectionStartElem();
|
18569 | var $endElem = editor.selection.getSelectionEndElem();
|
18570 |
|
18571 | if (($startElem === null || $startElem === void 0 ? void 0 : $startElem.elems[0]) !== ($endElem === null || $endElem === void 0 ? void 0 : $endElem.elems[0])) {
|
18572 | return true;
|
18573 | } else {
|
18574 | return false;
|
18575 | }
|
18576 | }
|
18577 |
|
18578 |
|
18579 |
|
18580 |
|
18581 |
|
18582 |
|
18583 | function bindTooltipEvent(editor) {
|
18584 | var _a = createShowHideFn(editor),
|
18585 | showTableTooltip = _a.showTableTooltip,
|
18586 | hideTableTooltip = _a.hideTableTooltip;
|
18587 |
|
18588 |
|
18589 | editor.txt.eventHooks.tableClickEvents.push(showTableTooltip);
|
18590 |
|
18591 | editor.txt.eventHooks.clickEvents.push(hideTableTooltip);
|
18592 | editor.txt.eventHooks.keyupEvents.push(hideTableTooltip);
|
18593 | editor.txt.eventHooks.toolbarClickEvents.push(hideTableTooltip);
|
18594 | editor.txt.eventHooks.menuClickEvents.push(hideTableTooltip);
|
18595 | editor.txt.eventHooks.textScrollEvents.push(hideTableTooltip);
|
18596 | }
|
18597 |
|
18598 | exports["default"] = bindTooltipEvent;
|
18599 |
|
18600 | }),
|
18601 |
|
18602 | (function(module, exports, __webpack_require__) {
|
18603 |
|
18604 | "use strict";
|
18605 |
|
18606 |
|
18607 | var _interopRequireDefault = __webpack_require__(0);
|
18608 |
|
18609 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
18610 |
|
18611 | var _splice = _interopRequireDefault(__webpack_require__(90));
|
18612 |
|
18613 | var _slice = _interopRequireDefault(__webpack_require__(43));
|
18614 |
|
18615 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18616 |
|
18617 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
18618 | return mod && mod.__esModule ? mod : {
|
18619 | "default": mod
|
18620 | };
|
18621 | };
|
18622 |
|
18623 | (0, _defineProperty["default"])(exports, "__esModule", {
|
18624 | value: true
|
18625 | });
|
18626 |
|
18627 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
18628 |
|
18629 |
|
18630 |
|
18631 |
|
18632 |
|
18633 |
|
18634 |
|
18635 | function ProcessingRow($node, _index) {
|
18636 |
|
18637 | var $dom = generateDomAction($node);
|
18638 |
|
18639 | var domArray = (0, _slice["default"])(Array.prototype).apply($dom.childNodes);
|
18640 |
|
18641 | var childNodesLenght = domArray[0].childNodes.length;
|
18642 |
|
18643 | var tr = document.createElement('tr');
|
18644 |
|
18645 | for (var i = 0; i < childNodesLenght; i++) {
|
18646 | var td = document.createElement('td');
|
18647 | tr.appendChild(td);
|
18648 | }
|
18649 |
|
18650 |
|
18651 | (0, _splice["default"])(domArray).call(domArray, _index + 1, 0, tr);
|
18652 |
|
18653 | removeAndInsertAction($dom, domArray);
|
18654 | return dom_core_1["default"]($dom.parentNode);
|
18655 | }
|
18656 |
|
18657 |
|
18658 |
|
18659 |
|
18660 |
|
18661 |
|
18662 |
|
18663 | function ProcessingCol($node, _index) {
|
18664 |
|
18665 | var $dom = generateDomAction($node);
|
18666 |
|
18667 | var domArray = (0, _slice["default"])(Array.prototype).apply($dom.childNodes);
|
18668 |
|
18669 | var _loop_1 = function _loop_1(i) {
|
18670 | var _context;
|
18671 |
|
18672 | var cArray = [];
|
18673 |
|
18674 | (0, _forEach["default"])(_context = domArray[i].childNodes).call(_context, function (item) {
|
18675 | cArray.push(item);
|
18676 | });
|
18677 |
|
18678 | while (domArray[i].childNodes.length !== 0) {
|
18679 | domArray[i].removeChild(domArray[i].childNodes[0]);
|
18680 | }
|
18681 |
|
18682 |
|
18683 | var td = dom_core_1["default"](cArray[0]).getNodeName() !== 'TH' ? document.createElement('td') : document.createElement('th');
|
18684 |
|
18685 | (0, _splice["default"])(cArray).call(cArray, _index + 1, 0, td);
|
18686 |
|
18687 | for (var j = 0; j < cArray.length; j++) {
|
18688 | domArray[i].appendChild(cArray[j]);
|
18689 | }
|
18690 | };
|
18691 |
|
18692 |
|
18693 | for (var i = 0; i < domArray.length; i++) {
|
18694 | _loop_1(i);
|
18695 | }
|
18696 |
|
18697 |
|
18698 | removeAndInsertAction($dom, domArray);
|
18699 | return dom_core_1["default"]($dom.parentNode);
|
18700 | }
|
18701 |
|
18702 |
|
18703 |
|
18704 |
|
18705 |
|
18706 |
|
18707 |
|
18708 | function DeleteRow($node, _index) {
|
18709 |
|
18710 | var $dom = generateDomAction($node);
|
18711 |
|
18712 | var domArray = (0, _slice["default"])(Array.prototype).apply($dom.childNodes);
|
18713 |
|
18714 | (0, _splice["default"])(domArray).call(domArray, _index, 1);
|
18715 |
|
18716 | removeAndInsertAction($dom, domArray);
|
18717 | return dom_core_1["default"]($dom.parentNode);
|
18718 | }
|
18719 |
|
18720 |
|
18721 |
|
18722 |
|
18723 |
|
18724 |
|
18725 |
|
18726 | function DeleteCol($node, _index) {
|
18727 |
|
18728 | var $dom = generateDomAction($node);
|
18729 |
|
18730 | var domArray = (0, _slice["default"])(Array.prototype).apply($dom.childNodes);
|
18731 |
|
18732 | var _loop_2 = function _loop_2(i) {
|
18733 | var _context2;
|
18734 |
|
18735 | var cArray = [];
|
18736 |
|
18737 | (0, _forEach["default"])(_context2 = domArray[i].childNodes).call(_context2, function (item) {
|
18738 | cArray.push(item);
|
18739 | });
|
18740 |
|
18741 | while (domArray[i].childNodes.length !== 0) {
|
18742 | domArray[i].removeChild(domArray[i].childNodes[0]);
|
18743 | }
|
18744 |
|
18745 | (0, _splice["default"])(cArray).call(cArray, _index, 1);
|
18746 |
|
18747 | for (var j = 0; j < cArray.length; j++) {
|
18748 | domArray[i].appendChild(cArray[j]);
|
18749 | }
|
18750 | };
|
18751 |
|
18752 |
|
18753 | for (var i = 0; i < domArray.length; i++) {
|
18754 | _loop_2(i);
|
18755 | }
|
18756 |
|
18757 |
|
18758 | removeAndInsertAction($dom, domArray);
|
18759 | return dom_core_1["default"]($dom.parentNode);
|
18760 | }
|
18761 |
|
18762 |
|
18763 |
|
18764 |
|
18765 |
|
18766 |
|
18767 |
|
18768 |
|
18769 | function setTheHeader($node, _index, type) {
|
18770 |
|
18771 | var $dom = generateDomAction($node);
|
18772 |
|
18773 | var domArray = (0, _slice["default"])(Array.prototype).apply($dom.childNodes);
|
18774 |
|
18775 | var childNodesLenght = domArray[_index].childNodes;
|
18776 |
|
18777 | var tr = document.createElement('tr');
|
18778 |
|
18779 | var _loop_3 = function _loop_3(i) {
|
18780 | var _context3;
|
18781 |
|
18782 |
|
18783 | var th = document.createElement(type);
|
18784 | (0, _forEach["default"])(_context3 = childNodesLenght[i].childNodes).call(_context3, function (item) {
|
18785 | th.appendChild(item);
|
18786 | });
|
18787 | tr.appendChild(th);
|
18788 | };
|
18789 |
|
18790 | for (var i = 0; i < childNodesLenght.length; i++) {
|
18791 | _loop_3(i);
|
18792 | }
|
18793 |
|
18794 |
|
18795 | (0, _splice["default"])(domArray).call(domArray, _index, 1, tr);
|
18796 |
|
18797 | removeAndInsertAction($dom, domArray);
|
18798 | return dom_core_1["default"]($dom.parentNode);
|
18799 | }
|
18800 |
|
18801 |
|
18802 |
|
18803 |
|
18804 |
|
18805 |
|
18806 |
|
18807 | function removeAndInsertAction($dom, domArray) {
|
18808 |
|
18809 | while ($dom.childNodes.length !== 0) {
|
18810 | $dom.removeChild($dom.childNodes[0]);
|
18811 | }
|
18812 |
|
18813 |
|
18814 | for (var i = 0; i < domArray.length; i++) {
|
18815 | $dom.appendChild(domArray[i]);
|
18816 | }
|
18817 | }
|
18818 |
|
18819 |
|
18820 |
|
18821 |
|
18822 |
|
18823 |
|
18824 |
|
18825 | function generateDomAction($node) {
|
18826 | var $dom = $node.elems[0].childNodes[0];
|
18827 |
|
18828 | if ($dom.nodeName === 'COLGROUP') {
|
18829 | $dom = $node.elems[0].childNodes[$node.elems[0].childNodes.length - 1];
|
18830 | }
|
18831 |
|
18832 | return $dom;
|
18833 | }
|
18834 |
|
18835 | exports["default"] = {
|
18836 | ProcessingRow: ProcessingRow,
|
18837 | ProcessingCol: ProcessingCol,
|
18838 | DeleteRow: DeleteRow,
|
18839 | DeleteCol: DeleteCol,
|
18840 | setTheHeader: setTheHeader
|
18841 | };
|
18842 |
|
18843 | }),
|
18844 |
|
18845 | (function(module, exports, __webpack_require__) {
|
18846 |
|
18847 | "use strict";
|
18848 |
|
18849 |
|
18850 |
|
18851 |
|
18852 |
|
18853 |
|
18854 | var _interopRequireDefault = __webpack_require__(0);
|
18855 |
|
18856 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
18857 |
|
18858 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18859 |
|
18860 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
18861 | return mod && mod.__esModule ? mod : {
|
18862 | "default": mod
|
18863 | };
|
18864 | };
|
18865 |
|
18866 | (0, _defineProperty["default"])(exports, "__esModule", {
|
18867 | value: true
|
18868 | });
|
18869 |
|
18870 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
18871 |
|
18872 | var getNode =
|
18873 |
|
18874 | function () {
|
18875 | function getNode(editor) {
|
18876 | this.editor = editor;
|
18877 | }
|
18878 | |
18879 |
|
18880 |
|
18881 |
|
18882 |
|
18883 |
|
18884 | getNode.prototype.getRowNode = function ($node) {
|
18885 | var _a;
|
18886 |
|
18887 | var DOM = dom_core_1["default"]($node).elems[0];
|
18888 |
|
18889 | if (!DOM.parentNode) {
|
18890 | return DOM;
|
18891 | }
|
18892 |
|
18893 | DOM = (_a = dom_core_1["default"](DOM).parentUntil('TR', DOM)) === null || _a === void 0 ? void 0 : _a.elems[0];
|
18894 | return DOM;
|
18895 | };
|
18896 | |
18897 |
|
18898 |
|
18899 |
|
18900 |
|
18901 |
|
18902 |
|
18903 | getNode.prototype.getCurrentRowIndex = function ($node, $dom) {
|
18904 | var _context;
|
18905 |
|
18906 | var _index = 0;
|
18907 | var $nodeChild = $node.childNodes[0];
|
18908 |
|
18909 | if ($nodeChild.nodeName === 'COLGROUP') {
|
18910 | $nodeChild = $node.childNodes[$node.childNodes.length - 1];
|
18911 | }
|
18912 |
|
18913 | (0, _forEach["default"])(_context = $nodeChild.childNodes).call(_context, function (item, index) {
|
18914 | item === $dom ? _index = index : '';
|
18915 | });
|
18916 | return _index;
|
18917 | };
|
18918 | |
18919 |
|
18920 |
|
18921 |
|
18922 |
|
18923 |
|
18924 | getNode.prototype.getCurrentColIndex = function ($node) {
|
18925 | var _context2;
|
18926 |
|
18927 | var _a;
|
18928 |
|
18929 |
|
18930 | var _index = 0;
|
18931 |
|
18932 | var rowDom = dom_core_1["default"]($node).getNodeName() === 'TD' || dom_core_1["default"]($node).getNodeName() === 'TH' ? $node : (_a = dom_core_1["default"]($node).parentUntil('TD', $node)) === null || _a === void 0 ? void 0 : _a.elems[0];
|
18933 | var colDom = dom_core_1["default"](rowDom).parent();
|
18934 | (0, _forEach["default"])(_context2 = colDom.elems[0].childNodes).call(_context2, function (item, index) {
|
18935 | item === rowDom ? _index = index : '';
|
18936 | });
|
18937 | return _index;
|
18938 | };
|
18939 | |
18940 |
|
18941 |
|
18942 |
|
18943 |
|
18944 |
|
18945 | getNode.prototype.getTableHtml = function ($node) {
|
18946 | var htmlStr = "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">" + dom_core_1["default"]($node).html() + "</table>";
|
18947 | return htmlStr;
|
18948 | };
|
18949 |
|
18950 | return getNode;
|
18951 | }();
|
18952 |
|
18953 | exports["default"] = getNode;
|
18954 |
|
18955 | }),
|
18956 |
|
18957 | (function(module, exports, __webpack_require__) {
|
18958 |
|
18959 | "use strict";
|
18960 |
|
18961 |
|
18962 |
|
18963 |
|
18964 |
|
18965 |
|
18966 | var _interopRequireDefault = __webpack_require__(0);
|
18967 |
|
18968 | var _map = _interopRequireDefault(__webpack_require__(29));
|
18969 |
|
18970 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
18971 |
|
18972 | var _create = _interopRequireDefault(__webpack_require__(3));
|
18973 |
|
18974 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
18975 |
|
18976 | var __extends = void 0 && (void 0).__extends || function () {
|
18977 | var _extendStatics = function extendStatics(d, b) {
|
18978 | _extendStatics = _setPrototypeOf["default"] || {
|
18979 | __proto__: []
|
18980 | } instanceof Array && function (d, b) {
|
18981 | d.__proto__ = b;
|
18982 | } || function (d, b) {
|
18983 | for (var p in b) {
|
18984 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
18985 | }
|
18986 | };
|
18987 |
|
18988 | return _extendStatics(d, b);
|
18989 | };
|
18990 |
|
18991 | return function (d, b) {
|
18992 | _extendStatics(d, b);
|
18993 |
|
18994 | function __() {
|
18995 | this.constructor = d;
|
18996 | }
|
18997 |
|
18998 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
18999 | };
|
19000 | }();
|
19001 |
|
19002 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19003 | return mod && mod.__esModule ? mod : {
|
19004 | "default": mod
|
19005 | };
|
19006 | };
|
19007 |
|
19008 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19009 | value: true
|
19010 | });
|
19011 | exports.formatCodeHtml = void 0;
|
19012 |
|
19013 | var PanelMenu_1 = __importDefault(__webpack_require__(34));
|
19014 |
|
19015 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19016 |
|
19017 | var util_1 = __webpack_require__(7);
|
19018 |
|
19019 | var create_panel_conf_1 = __importDefault(__webpack_require__(374));
|
19020 |
|
19021 | var is_active_1 = __importDefault(__webpack_require__(127));
|
19022 |
|
19023 | var Panel_1 = __importDefault(__webpack_require__(31));
|
19024 |
|
19025 | var index_1 = __importDefault(__webpack_require__(375));
|
19026 |
|
19027 | function formatCodeHtml(editor, html) {
|
19028 | if (!html) return html;
|
19029 | html = deleteHighlightCode(html);
|
19030 | html = formatEnterCode(html);
|
19031 | html = util_1.replaceSpecialSymbol(html);
|
19032 | return html;
|
19033 |
|
19034 | function formatEnterCode(html) {
|
19035 | var preArr = html.match(/<pre[\s|\S]+?\/pre>/g);
|
19036 | if (preArr === null) return html;
|
19037 | (0, _map["default"])(preArr).call(preArr, function (item) {
|
19038 |
|
19039 | html = html.replace(item, item.replace(/<\/code><code>/g, '\n').replace(/<br>/g, ''));
|
19040 | });
|
19041 | return html;
|
19042 | }
|
19043 |
|
19044 |
|
19045 | function deleteHighlightCode(html) {
|
19046 | var _context;
|
19047 |
|
19048 |
|
19049 | var m = html.match(/<span\sclass="hljs[\s|\S]+?\/span>/gm);
|
19050 |
|
19051 |
|
19052 | if (!m || !m.length) return html;
|
19053 |
|
19054 | var r = (0, _map["default"])(_context = util_1.deepClone(m)).call(_context, function (i) {
|
19055 | i = i.replace(/<span\sclass="hljs[^>]+>/, '');
|
19056 | return i.replace(/<\/span>/, '');
|
19057 | });
|
19058 |
|
19059 | for (var i = 0; i < m.length; i++) {
|
19060 | html = html.replace(m[i], r[i]);
|
19061 | }
|
19062 |
|
19063 | return deleteHighlightCode(html);
|
19064 | }
|
19065 | }
|
19066 |
|
19067 | exports.formatCodeHtml = formatCodeHtml;
|
19068 |
|
19069 | var Code =
|
19070 |
|
19071 | function (_super) {
|
19072 | __extends(Code, _super);
|
19073 |
|
19074 | function Code(editor) {
|
19075 | var _this = this;
|
19076 |
|
19077 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="代码"><i class="w-e-icon-terminal"></i></div>');
|
19078 | _this = _super.call(this, $elem, editor) || this;
|
19079 |
|
19080 | index_1["default"](editor);
|
19081 | return _this;
|
19082 | }
|
19083 | |
19084 |
|
19085 |
|
19086 |
|
19087 |
|
19088 |
|
19089 |
|
19090 | Code.prototype.insertLineCode = function (text) {
|
19091 | var editor = this.editor;
|
19092 |
|
19093 | var $code = dom_core_1["default"]("<code>" + text + "</code>");
|
19094 | editor.cmd["do"]('insertElem', $code);
|
19095 | editor.selection.createRangeByElem($code, false);
|
19096 | editor.selection.restoreSelection();
|
19097 | };
|
19098 | |
19099 |
|
19100 |
|
19101 |
|
19102 |
|
19103 | Code.prototype.clickHandler = function () {
|
19104 | var editor = this.editor;
|
19105 | var selectionText = editor.selection.getSelectionText();
|
19106 |
|
19107 | if (this.isActive) {
|
19108 | return;
|
19109 | } else {
|
19110 |
|
19111 | if (editor.selection.isSelectionEmpty()) {
|
19112 |
|
19113 | this.createPanel('', '');
|
19114 | } else {
|
19115 |
|
19116 | this.insertLineCode(selectionText);
|
19117 | }
|
19118 | }
|
19119 | };
|
19120 | |
19121 |
|
19122 |
|
19123 |
|
19124 |
|
19125 |
|
19126 |
|
19127 | Code.prototype.createPanel = function (text, languageType) {
|
19128 | var conf = create_panel_conf_1["default"](this.editor, text, languageType);
|
19129 | var panel = new Panel_1["default"](this, conf);
|
19130 | panel.create();
|
19131 | };
|
19132 | |
19133 |
|
19134 |
|
19135 |
|
19136 |
|
19137 | Code.prototype.tryChangeActive = function () {
|
19138 | var editor = this.editor;
|
19139 |
|
19140 | if (is_active_1["default"](editor)) {
|
19141 | this.active();
|
19142 | } else {
|
19143 | this.unActive();
|
19144 | }
|
19145 | };
|
19146 |
|
19147 | return Code;
|
19148 | }(PanelMenu_1["default"]);
|
19149 |
|
19150 | exports["default"] = Code;
|
19151 |
|
19152 | }),
|
19153 |
|
19154 | (function(module, exports, __webpack_require__) {
|
19155 |
|
19156 | "use strict";
|
19157 |
|
19158 |
|
19159 |
|
19160 |
|
19161 |
|
19162 |
|
19163 | var _interopRequireDefault = __webpack_require__(0);
|
19164 |
|
19165 | var _map = _interopRequireDefault(__webpack_require__(29));
|
19166 |
|
19167 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19168 |
|
19169 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19170 | return mod && mod.__esModule ? mod : {
|
19171 | "default": mod
|
19172 | };
|
19173 | };
|
19174 |
|
19175 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19176 | value: true
|
19177 | });
|
19178 |
|
19179 | var util_1 = __webpack_require__(7);
|
19180 |
|
19181 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19182 |
|
19183 | var is_active_1 = __importDefault(__webpack_require__(127));
|
19184 |
|
19185 | function default_1(editor, text, languageType) {
|
19186 | var _context;
|
19187 |
|
19188 |
|
19189 | var inputIFrameId = util_1.getRandom('input-iframe');
|
19190 | var languageId = util_1.getRandom('select');
|
19191 | var btnOkId = util_1.getRandom('btn-ok');
|
19192 | |
19193 |
|
19194 |
|
19195 |
|
19196 |
|
19197 |
|
19198 | function insertCode(text) {
|
19199 |
|
19200 | var active = is_active_1["default"](editor);
|
19201 |
|
19202 | if (active) {
|
19203 | selectCodeElem();
|
19204 | }
|
19205 |
|
19206 | editor.cmd["do"]('insertHTML', text);
|
19207 | var $code = editor.selection.getSelectionStartElem();
|
19208 | var $codeElem = $code === null || $code === void 0 ? void 0 : $code.getNodeTop(editor);
|
19209 |
|
19210 |
|
19211 | dom_core_1["default"]('<p><br></p>').insertAfter($codeElem);
|
19212 | }
|
19213 | |
19214 |
|
19215 |
|
19216 |
|
19217 |
|
19218 | function selectCodeElem() {
|
19219 | if (!is_active_1["default"](editor)) return;
|
19220 |
|
19221 | var $selectedCode;
|
19222 | var $code = editor.selection.getSelectionStartElem();
|
19223 | var $codeElem = $code === null || $code === void 0 ? void 0 : $code.getNodeTop(editor);
|
19224 | if (!$codeElem) return;
|
19225 | editor.selection.createRangeByElem($codeElem);
|
19226 | editor.selection.restoreSelection();
|
19227 | $selectedCode = $codeElem;
|
19228 | }
|
19229 |
|
19230 | var t = function t(text) {
|
19231 | return editor.i18next.t(text);
|
19232 | };
|
19233 |
|
19234 |
|
19235 | var conf = {
|
19236 | width: 500,
|
19237 | height: 0,
|
19238 |
|
19239 | tabs: [{
|
19240 |
|
19241 | title: t('menus.panelMenus.code.插入代码'),
|
19242 |
|
19243 | tpl: "<div>\n <select name=\"\" id=\"" + languageId + "\">\n " + (0, _map["default"])(_context = editor.config.languageType).call(_context, function (language) {
|
19244 | return '<option ' + (languageType == language ? 'selected' : '') + ' value ="' + language + '">' + language + '</option>';
|
19245 | }) + "\n </select>\n <textarea id=\"" + inputIFrameId + "\" type=\"text\" class=\"wang-code-textarea\" placeholder=\"\" style=\"height: 160px\">" + text.replace(/"/g, '"') + "</textarea>\n <div class=\"w-e-button-container\">\n <button type=\"button\" id=\"" + btnOkId + "\" class=\"right\">" + (is_active_1["default"](editor) ? t('修改') : t('插入')) + "</button>\n </div>\n </div>",
|
19246 |
|
19247 | events: [
|
19248 | {
|
19249 | selector: '#' + btnOkId,
|
19250 | type: 'click',
|
19251 | fn: function fn() {
|
19252 | var formatCode, codeDom;
|
19253 | var $code = document.getElementById(inputIFrameId);
|
19254 | var $select = dom_core_1["default"]('#' + languageId);
|
19255 | var languageType = $select.val();
|
19256 |
|
19257 | var code = $code.value;
|
19258 |
|
19259 | if (editor.highlight) {
|
19260 | formatCode = editor.highlight.highlightAuto(code).value;
|
19261 | } else {
|
19262 | formatCode = "<xmp>" + code + "</xmp>";
|
19263 | }
|
19264 |
|
19265 |
|
19266 | if (!code) return;
|
19267 |
|
19268 | if (is_active_1["default"](editor)) {
|
19269 | return false;
|
19270 | } else {
|
19271 |
|
19272 | codeDom = "<pre type=\"" + languageType + "\"><code>" + formatCode + "</code></pre>";
|
19273 |
|
19274 | insertCode(codeDom);
|
19275 | }
|
19276 |
|
19277 |
|
19278 | return true;
|
19279 | }
|
19280 | }]
|
19281 | }]
|
19282 | };
|
19283 | return conf;
|
19284 | }
|
19285 |
|
19286 | exports["default"] = default_1;
|
19287 |
|
19288 | }),
|
19289 |
|
19290 | (function(module, exports, __webpack_require__) {
|
19291 |
|
19292 | "use strict";
|
19293 |
|
19294 |
|
19295 |
|
19296 |
|
19297 |
|
19298 |
|
19299 | var _interopRequireDefault = __webpack_require__(0);
|
19300 |
|
19301 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19302 |
|
19303 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19304 | return mod && mod.__esModule ? mod : {
|
19305 | "default": mod
|
19306 | };
|
19307 | };
|
19308 |
|
19309 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19310 | value: true
|
19311 | });
|
19312 |
|
19313 | var tooltip_event_1 = __importDefault(__webpack_require__(376));
|
19314 |
|
19315 |
|
19316 |
|
19317 |
|
19318 |
|
19319 |
|
19320 | function bindEvent(editor) {
|
19321 |
|
19322 | tooltip_event_1["default"](editor);
|
19323 | }
|
19324 |
|
19325 | exports["default"] = bindEvent;
|
19326 |
|
19327 | }),
|
19328 |
|
19329 | (function(module, exports, __webpack_require__) {
|
19330 |
|
19331 | "use strict";
|
19332 |
|
19333 |
|
19334 |
|
19335 |
|
19336 |
|
19337 |
|
19338 | var _interopRequireDefault = __webpack_require__(0);
|
19339 |
|
19340 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19341 |
|
19342 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19343 | return mod && mod.__esModule ? mod : {
|
19344 | "default": mod
|
19345 | };
|
19346 | };
|
19347 |
|
19348 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19349 | value: true
|
19350 | });
|
19351 | exports.createShowHideFn = void 0;
|
19352 |
|
19353 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19354 |
|
19355 | var Tooltip_1 = __importDefault(__webpack_require__(44));
|
19356 |
|
19357 |
|
19358 |
|
19359 |
|
19360 |
|
19361 | function createShowHideFn(editor) {
|
19362 | var tooltip;
|
19363 | |
19364 |
|
19365 |
|
19366 |
|
19367 |
|
19368 | function showCodeTooltip($code) {
|
19369 | var i18nPrefix = 'menus.panelMenus.code.';
|
19370 |
|
19371 | var t = function t(text, prefix) {
|
19372 | if (prefix === void 0) {
|
19373 | prefix = i18nPrefix;
|
19374 | }
|
19375 |
|
19376 | return editor.i18next.t(prefix + text);
|
19377 | };
|
19378 |
|
19379 | var conf = [{
|
19380 | $elem: dom_core_1["default"]("<span>" + t('删除代码') + "</span>"),
|
19381 | onClick: function onClick(editor, $code) {
|
19382 |
|
19383 | $code.remove();
|
19384 |
|
19385 | return true;
|
19386 | }
|
19387 | }];
|
19388 |
|
19389 | tooltip = new Tooltip_1["default"](editor, $code, conf);
|
19390 | tooltip.create();
|
19391 | }
|
19392 | |
19393 |
|
19394 |
|
19395 |
|
19396 |
|
19397 | function hideCodeTooltip() {
|
19398 |
|
19399 | if (tooltip) {
|
19400 | tooltip.remove();
|
19401 | tooltip = null;
|
19402 | }
|
19403 | }
|
19404 |
|
19405 | return {
|
19406 | showCodeTooltip: showCodeTooltip,
|
19407 | hideCodeTooltip: hideCodeTooltip
|
19408 | };
|
19409 | }
|
19410 |
|
19411 | exports.createShowHideFn = createShowHideFn;
|
19412 |
|
19413 |
|
19414 |
|
19415 |
|
19416 |
|
19417 |
|
19418 |
|
19419 |
|
19420 |
|
19421 |
|
19422 |
|
19423 | function preEnterListener(e, editor) {
|
19424 |
|
19425 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
19426 |
|
19427 | var $topElem = $selectionElem === null || $selectionElem === void 0 ? void 0 : $selectionElem.getNodeTop(editor);
|
19428 |
|
19429 | var topNodeName = $topElem === null || $topElem === void 0 ? void 0 : $topElem.getNodeName();
|
19430 |
|
19431 | if (topNodeName !== 'PRE') return;
|
19432 |
|
19433 | e.preventDefault();
|
19434 |
|
19435 | editor.cmd["do"]('insertHTML', '\n\r');
|
19436 | }
|
19437 |
|
19438 |
|
19439 |
|
19440 |
|
19441 |
|
19442 |
|
19443 | function bindTooltipEvent(editor) {
|
19444 | var _a = createShowHideFn(editor),
|
19445 | showCodeTooltip = _a.showCodeTooltip,
|
19446 | hideCodeTooltip = _a.hideCodeTooltip;
|
19447 |
|
19448 |
|
19449 | editor.txt.eventHooks.codeClickEvents.push(showCodeTooltip);
|
19450 |
|
19451 | editor.txt.eventHooks.clickEvents.push(hideCodeTooltip);
|
19452 | editor.txt.eventHooks.toolbarClickEvents.push(hideCodeTooltip);
|
19453 | editor.txt.eventHooks.menuClickEvents.push(hideCodeTooltip);
|
19454 | editor.txt.eventHooks.textScrollEvents.push(hideCodeTooltip);
|
19455 | }
|
19456 |
|
19457 | exports["default"] = bindTooltipEvent;
|
19458 |
|
19459 | }),
|
19460 |
|
19461 | (function(module, exports, __webpack_require__) {
|
19462 |
|
19463 | "use strict";
|
19464 |
|
19465 |
|
19466 | var _interopRequireDefault = __webpack_require__(0);
|
19467 |
|
19468 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19469 |
|
19470 | var _create = _interopRequireDefault(__webpack_require__(3));
|
19471 |
|
19472 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
19473 |
|
19474 | var __extends = void 0 && (void 0).__extends || function () {
|
19475 | var _extendStatics = function extendStatics(d, b) {
|
19476 | _extendStatics = _setPrototypeOf["default"] || {
|
19477 | __proto__: []
|
19478 | } instanceof Array && function (d, b) {
|
19479 | d.__proto__ = b;
|
19480 | } || function (d, b) {
|
19481 | for (var p in b) {
|
19482 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
19483 | }
|
19484 | };
|
19485 |
|
19486 | return _extendStatics(d, b);
|
19487 | };
|
19488 |
|
19489 | return function (d, b) {
|
19490 | _extendStatics(d, b);
|
19491 |
|
19492 | function __() {
|
19493 | this.constructor = d;
|
19494 | }
|
19495 |
|
19496 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
19497 | };
|
19498 | }();
|
19499 |
|
19500 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19501 | return mod && mod.__esModule ? mod : {
|
19502 | "default": mod
|
19503 | };
|
19504 | };
|
19505 |
|
19506 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19507 | value: true
|
19508 | });
|
19509 |
|
19510 |
|
19511 |
|
19512 |
|
19513 |
|
19514 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
19515 |
|
19516 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19517 |
|
19518 | var index_1 = __importDefault(__webpack_require__(378));
|
19519 |
|
19520 | var splitLine =
|
19521 |
|
19522 | function (_super) {
|
19523 | __extends(splitLine, _super);
|
19524 |
|
19525 | function splitLine(editor) {
|
19526 | var _this = this;
|
19527 |
|
19528 | var $elem = dom_core_1["default"]('<div class="w-e-menu" data-title="分割线"><i class="w-e-icon-split-line"></i></div>');
|
19529 | _this = _super.call(this, $elem, editor) || this;
|
19530 |
|
19531 | index_1["default"](editor);
|
19532 | return _this;
|
19533 | }
|
19534 | |
19535 |
|
19536 |
|
19537 |
|
19538 |
|
19539 | splitLine.prototype.clickHandler = function () {
|
19540 | var editor = this.editor;
|
19541 | var range = editor.selection.getRange();
|
19542 | var $selectionElem = editor.selection.getSelectionContainerElem();
|
19543 | if (!$selectionElem) return;
|
19544 | var $DomElement = dom_core_1["default"]($selectionElem.elems[0]);
|
19545 | var $tableDOM = $DomElement.parentUntil('TABLE', $selectionElem.elems[0]);
|
19546 | var $imgDOM = $DomElement.children();
|
19547 |
|
19548 | if ($DomElement.getNodeName() === 'CODE') return;
|
19549 |
|
19550 | if ($tableDOM && dom_core_1["default"]($tableDOM.elems[0]).getNodeName() === 'TABLE') return;
|
19551 |
|
19552 | if ($imgDOM && $imgDOM.length !== 0 && dom_core_1["default"]($imgDOM.elems[0]).getNodeName() === 'IMG' && !(range === null || range === void 0 ? void 0 : range.collapsed)
|
19553 | ) {
|
19554 | return;
|
19555 | }
|
19556 |
|
19557 | this.createSplitLine();
|
19558 | };
|
19559 | |
19560 |
|
19561 |
|
19562 |
|
19563 |
|
19564 | splitLine.prototype.createSplitLine = function () {
|
19565 | var splitLineDOM = '<hr/>';
|
19566 | this.editor.cmd["do"]('insertHTML', splitLineDOM);
|
19567 | };
|
19568 | |
19569 |
|
19570 |
|
19571 |
|
19572 |
|
19573 | splitLine.prototype.tryChangeActive = function () {};
|
19574 |
|
19575 | return splitLine;
|
19576 | }(BtnMenu_1["default"]);
|
19577 |
|
19578 | exports["default"] = splitLine;
|
19579 |
|
19580 | }),
|
19581 |
|
19582 | (function(module, exports, __webpack_require__) {
|
19583 |
|
19584 | "use strict";
|
19585 |
|
19586 |
|
19587 | var _interopRequireDefault = __webpack_require__(0);
|
19588 |
|
19589 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19590 |
|
19591 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19592 | return mod && mod.__esModule ? mod : {
|
19593 | "default": mod
|
19594 | };
|
19595 | };
|
19596 |
|
19597 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19598 | value: true
|
19599 | });
|
19600 |
|
19601 | var tooltip_event_1 = __importDefault(__webpack_require__(379));
|
19602 |
|
19603 |
|
19604 |
|
19605 |
|
19606 |
|
19607 |
|
19608 | function bindEvent(editor) {
|
19609 |
|
19610 | tooltip_event_1["default"](editor);
|
19611 | }
|
19612 |
|
19613 | exports["default"] = bindEvent;
|
19614 |
|
19615 | }),
|
19616 |
|
19617 | (function(module, exports, __webpack_require__) {
|
19618 |
|
19619 | "use strict";
|
19620 |
|
19621 |
|
19622 | var _interopRequireDefault = __webpack_require__(0);
|
19623 |
|
19624 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19625 |
|
19626 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19627 | return mod && mod.__esModule ? mod : {
|
19628 | "default": mod
|
19629 | };
|
19630 | };
|
19631 |
|
19632 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19633 | value: true
|
19634 | });
|
19635 |
|
19636 |
|
19637 |
|
19638 |
|
19639 |
|
19640 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19641 |
|
19642 | var Tooltip_1 = __importDefault(__webpack_require__(44));
|
19643 |
|
19644 |
|
19645 |
|
19646 |
|
19647 |
|
19648 | function createShowHideFn(editor) {
|
19649 | var tooltip;
|
19650 | |
19651 |
|
19652 |
|
19653 |
|
19654 |
|
19655 | function showSplitLineTooltip($splitLine) {
|
19656 |
|
19657 | var conf = [{
|
19658 | $elem: dom_core_1["default"]("<span>" + editor.i18next.t('menus.panelMenus.删除') + "</span>"),
|
19659 | onClick: function onClick(editor, $splitLine) {
|
19660 |
|
19661 | editor.selection.createRangeByElem($splitLine);
|
19662 | editor.selection.restoreSelection();
|
19663 | editor.cmd["do"]('delete');
|
19664 |
|
19665 | return true;
|
19666 | }
|
19667 | }];
|
19668 |
|
19669 | tooltip = new Tooltip_1["default"](editor, $splitLine, conf);
|
19670 |
|
19671 | tooltip.create();
|
19672 | }
|
19673 | |
19674 |
|
19675 |
|
19676 |
|
19677 |
|
19678 | function hideSplitLineTooltip() {
|
19679 | if (tooltip) {
|
19680 | tooltip.remove();
|
19681 | tooltip = null;
|
19682 | }
|
19683 | }
|
19684 |
|
19685 | return {
|
19686 | showSplitLineTooltip: showSplitLineTooltip,
|
19687 | hideSplitLineTooltip: hideSplitLineTooltip
|
19688 | };
|
19689 | }
|
19690 |
|
19691 | function bindTooltipEvent(editor) {
|
19692 | var _a = createShowHideFn(editor),
|
19693 | showSplitLineTooltip = _a.showSplitLineTooltip,
|
19694 | hideSplitLineTooltip = _a.hideSplitLineTooltip;
|
19695 |
|
19696 |
|
19697 | editor.txt.eventHooks.splitLineEvents.push(showSplitLineTooltip);
|
19698 |
|
19699 | editor.txt.eventHooks.clickEvents.push(hideSplitLineTooltip);
|
19700 | editor.txt.eventHooks.keyupEvents.push(hideSplitLineTooltip);
|
19701 | editor.txt.eventHooks.toolbarClickEvents.push(hideSplitLineTooltip);
|
19702 | editor.txt.eventHooks.menuClickEvents.push(hideSplitLineTooltip);
|
19703 | editor.txt.eventHooks.textScrollEvents.push(hideSplitLineTooltip);
|
19704 | }
|
19705 |
|
19706 | exports["default"] = bindTooltipEvent;
|
19707 |
|
19708 | }),
|
19709 |
|
19710 | (function(module, exports, __webpack_require__) {
|
19711 |
|
19712 | "use strict";
|
19713 |
|
19714 |
|
19715 | var _interopRequireDefault = __webpack_require__(0);
|
19716 |
|
19717 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
19718 |
|
19719 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19720 |
|
19721 | var _create = _interopRequireDefault(__webpack_require__(3));
|
19722 |
|
19723 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
19724 |
|
19725 | var __extends = void 0 && (void 0).__extends || function () {
|
19726 | var _extendStatics = function extendStatics(d, b) {
|
19727 | _extendStatics = _setPrototypeOf["default"] || {
|
19728 | __proto__: []
|
19729 | } instanceof Array && function (d, b) {
|
19730 | d.__proto__ = b;
|
19731 | } || function (d, b) {
|
19732 | for (var p in b) {
|
19733 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
19734 | }
|
19735 | };
|
19736 |
|
19737 | return _extendStatics(d, b);
|
19738 | };
|
19739 |
|
19740 | return function (d, b) {
|
19741 | _extendStatics(d, b);
|
19742 |
|
19743 | function __() {
|
19744 | this.constructor = d;
|
19745 | }
|
19746 |
|
19747 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
19748 | };
|
19749 | }();
|
19750 |
|
19751 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19752 | return mod && mod.__esModule ? mod : {
|
19753 | "default": mod
|
19754 | };
|
19755 | };
|
19756 |
|
19757 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19758 | value: true
|
19759 | });
|
19760 |
|
19761 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19762 |
|
19763 | var BtnMenu_1 = __importDefault(__webpack_require__(22));
|
19764 |
|
19765 | var util_1 = __webpack_require__(98);
|
19766 |
|
19767 | var bind_event_1 = __importDefault(__webpack_require__(386));
|
19768 |
|
19769 | var todo_1 = __importDefault(__webpack_require__(128));
|
19770 |
|
19771 | var Todo =
|
19772 |
|
19773 | function (_super) {
|
19774 | __extends(Todo, _super);
|
19775 |
|
19776 | function Todo(editor) {
|
19777 | var _this = this;
|
19778 |
|
19779 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u4EE3\u529E\u4E8B\u9879\">\n <i class=\"w-e-icon-checkbox-checked\"></i>\n </div>");
|
19780 | _this = _super.call(this, $elem, editor) || this;
|
19781 | bind_event_1["default"](editor);
|
19782 | return _this;
|
19783 | }
|
19784 | |
19785 |
|
19786 |
|
19787 |
|
19788 |
|
19789 | Todo.prototype.clickHandler = function () {
|
19790 | var editor = this.editor;
|
19791 |
|
19792 | if (!util_1.isAllTodo(editor)) {
|
19793 |
|
19794 | this.setTodo();
|
19795 | } else {
|
19796 |
|
19797 | this.cancelTodo();
|
19798 | this.tryChangeActive();
|
19799 | }
|
19800 | };
|
19801 |
|
19802 | Todo.prototype.tryChangeActive = function () {
|
19803 | if (util_1.isAllTodo(this.editor)) {
|
19804 | this.active();
|
19805 | } else {
|
19806 | this.unActive();
|
19807 | }
|
19808 | };
|
19809 | |
19810 |
|
19811 |
|
19812 |
|
19813 |
|
19814 | Todo.prototype.setTodo = function () {
|
19815 | var editor = this.editor;
|
19816 | var topNodeElem = editor.selection.getSelectionRangeTopNodes(editor);
|
19817 | (0, _forEach["default"])(topNodeElem).call(topNodeElem, function ($node) {
|
19818 | var _a;
|
19819 |
|
19820 | var nodeName = $node === null || $node === void 0 ? void 0 : $node.getNodeName();
|
19821 |
|
19822 | if (nodeName === 'P') {
|
19823 | var todo = todo_1["default"]($node);
|
19824 | var todoNode = todo.getTodo();
|
19825 | var child = (_a = todoNode.children()) === null || _a === void 0 ? void 0 : _a.getNode();
|
19826 | todoNode.insertAfter($node);
|
19827 | editor.selection.moveCursor(child);
|
19828 | $node.remove();
|
19829 | }
|
19830 | });
|
19831 | this.tryChangeActive();
|
19832 | };
|
19833 | |
19834 |
|
19835 |
|
19836 |
|
19837 |
|
19838 | Todo.prototype.cancelTodo = function () {
|
19839 | var editor = this.editor;
|
19840 | var $topNodeElems = editor.selection.getSelectionRangeTopNodes(editor);
|
19841 | (0, _forEach["default"])($topNodeElems).call($topNodeElems, function ($topNodeElem) {
|
19842 | var _a, _b, _c;
|
19843 |
|
19844 | var content = (_b = (_a = $topNodeElem.childNodes()) === null || _a === void 0 ? void 0 : _a.childNodes()) === null || _b === void 0 ? void 0 : _b.clone(true);
|
19845 | var $p = dom_core_1["default"]("<p></p>");
|
19846 | $p.append(content);
|
19847 | $p.insertAfter($topNodeElem);
|
19848 |
|
19849 | (_c = $p.childNodes()) === null || _c === void 0 ? void 0 : _c.get(0).remove();
|
19850 | editor.selection.moveCursor($p.getNode());
|
19851 | $topNodeElem.remove();
|
19852 | });
|
19853 | };
|
19854 |
|
19855 | return Todo;
|
19856 | }(BtnMenu_1["default"]);
|
19857 |
|
19858 | exports["default"] = Todo;
|
19859 |
|
19860 | }),
|
19861 |
|
19862 | (function(module, exports, __webpack_require__) {
|
19863 |
|
19864 | module.exports = __webpack_require__(382);
|
19865 |
|
19866 | }),
|
19867 |
|
19868 | (function(module, exports, __webpack_require__) {
|
19869 |
|
19870 | var parent = __webpack_require__(383);
|
19871 |
|
19872 | module.exports = parent;
|
19873 |
|
19874 |
|
19875 | }),
|
19876 |
|
19877 | (function(module, exports, __webpack_require__) {
|
19878 |
|
19879 | var every = __webpack_require__(384);
|
19880 |
|
19881 | var ArrayPrototype = Array.prototype;
|
19882 |
|
19883 | module.exports = function (it) {
|
19884 | var own = it.every;
|
19885 | return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.every) ? every : own;
|
19886 | };
|
19887 |
|
19888 |
|
19889 | }),
|
19890 |
|
19891 | (function(module, exports, __webpack_require__) {
|
19892 |
|
19893 | __webpack_require__(385);
|
19894 | var entryVirtual = __webpack_require__(16);
|
19895 |
|
19896 | module.exports = entryVirtual('Array').every;
|
19897 |
|
19898 |
|
19899 | }),
|
19900 |
|
19901 | (function(module, exports, __webpack_require__) {
|
19902 |
|
19903 | "use strict";
|
19904 |
|
19905 | var $ = __webpack_require__(4);
|
19906 | var $every = __webpack_require__(33).every;
|
19907 | var arrayMethodIsStrict = __webpack_require__(87);
|
19908 | var arrayMethodUsesToLength = __webpack_require__(25);
|
19909 |
|
19910 | var STRICT_METHOD = arrayMethodIsStrict('every');
|
19911 | var USES_TO_LENGTH = arrayMethodUsesToLength('every');
|
19912 |
|
19913 |
|
19914 |
|
19915 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
|
19916 | every: function every(callbackfn /* , thisArg */) {
|
19917 | return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
19918 | }
|
19919 | });
|
19920 |
|
19921 |
|
19922 | }),
|
19923 |
|
19924 | (function(module, exports, __webpack_require__) {
|
19925 |
|
19926 | "use strict";
|
19927 |
|
19928 |
|
19929 | var _interopRequireDefault = __webpack_require__(0);
|
19930 |
|
19931 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
19932 |
|
19933 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
19934 |
|
19935 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
19936 | return mod && mod.__esModule ? mod : {
|
19937 | "default": mod
|
19938 | };
|
19939 | };
|
19940 |
|
19941 | (0, _defineProperty["default"])(exports, "__esModule", {
|
19942 | value: true
|
19943 | });
|
19944 |
|
19945 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
19946 |
|
19947 | var util_1 = __webpack_require__(98);
|
19948 |
|
19949 | var todo_1 = __importDefault(__webpack_require__(128));
|
19950 |
|
19951 | var util_2 = __webpack_require__(98);
|
19952 |
|
19953 |
|
19954 |
|
19955 |
|
19956 |
|
19957 |
|
19958 | function bindEvent(editor) {
|
19959 | |
19960 |
|
19961 |
|
19962 |
|
19963 | function todoEnter(e) {
|
19964 | var _a, _b;
|
19965 |
|
19966 |
|
19967 | if (util_1.isAllTodo(editor)) {
|
19968 | e.preventDefault();
|
19969 | var selection = editor.selection;
|
19970 | var $topSelectElem = selection.getSelectionRangeTopNodes(editor)[0];
|
19971 | var $li = (_a = $topSelectElem.childNodes()) === null || _a === void 0 ? void 0 : _a.get(0);
|
19972 | var selectionNode = (_b = window.getSelection()) === null || _b === void 0 ? void 0 : _b.anchorNode;
|
19973 | var range = selection.getRange();
|
19974 |
|
19975 | if (!(range === null || range === void 0 ? void 0 : range.collapsed)) {
|
19976 | var rangeChildNodes = range === null || range === void 0 ? void 0 : range.commonAncestorContainer.childNodes;
|
19977 | var startContainer_1 = range === null || range === void 0 ? void 0 : range.startContainer;
|
19978 | var endContainer_1 = range === null || range === void 0 ? void 0 : range.endContainer;
|
19979 | var startPos = range === null || range === void 0 ? void 0 : range.startOffset;
|
19980 | var endPos = range === null || range === void 0 ? void 0 : range.endOffset;
|
19981 | var startElemIndex_1 = 0;
|
19982 | var endElemIndex_1 = 0;
|
19983 | var delList_1 = [];
|
19984 |
|
19985 | rangeChildNodes === null || rangeChildNodes === void 0 ? void 0 : (0, _forEach["default"])(rangeChildNodes).call(rangeChildNodes, function (v, i) {
|
19986 | if (v.contains(startContainer_1)) startElemIndex_1 = i;
|
19987 | if (v.contains(endContainer_1)) endElemIndex_1 = i;
|
19988 | });
|
19989 |
|
19990 | if (endElemIndex_1 - startElemIndex_1 > 1) {
|
19991 | rangeChildNodes === null || rangeChildNodes === void 0 ? void 0 : (0, _forEach["default"])(rangeChildNodes).call(rangeChildNodes, function (v, i) {
|
19992 | if (i <= startElemIndex_1) return;
|
19993 | if (i >= endElemIndex_1) return;
|
19994 | delList_1.push(v);
|
19995 | });
|
19996 | (0, _forEach["default"])(delList_1).call(delList_1, function (v) {
|
19997 | v.remove();
|
19998 | });
|
19999 | }
|
20000 |
|
20001 |
|
20002 | util_2.dealTextNode(startContainer_1, startPos);
|
20003 | util_2.dealTextNode(endContainer_1, endPos, false);
|
20004 | editor.selection.moveCursor(endContainer_1, 0);
|
20005 | }
|
20006 |
|
20007 |
|
20008 | if ($topSelectElem.text() === '') {
|
20009 | var $p = dom_core_1["default"]("<p><br></p>");
|
20010 | $p.insertAfter($topSelectElem);
|
20011 | selection.moveCursor($p.getNode());
|
20012 | $topSelectElem.remove();
|
20013 | return;
|
20014 | }
|
20015 |
|
20016 | var pos = selection.getCursorPos();
|
20017 | var CursorNextNode = util_1.getCursorNextNode($li === null || $li === void 0 ? void 0 : $li.getNode(), selectionNode, pos);
|
20018 | var todo = todo_1["default"](dom_core_1["default"](CursorNextNode));
|
20019 | var $inputcontainer = todo.getInputContainer();
|
20020 | var todoLiElem = $inputcontainer.parent().getNode();
|
20021 | var $newTodo = todo.getTodo();
|
20022 | var contentSection = $inputcontainer.getNode().nextSibling;
|
20023 |
|
20024 | if (($li === null || $li === void 0 ? void 0 : $li.text()) === '') {
|
20025 | $li === null || $li === void 0 ? void 0 : $li.append(dom_core_1["default"]("<br>"));
|
20026 | }
|
20027 |
|
20028 | $newTodo.insertAfter($topSelectElem);
|
20029 |
|
20030 | if (!contentSection || (contentSection === null || contentSection === void 0 ? void 0 : contentSection.textContent) === '') {
|
20031 |
|
20032 | if ((contentSection === null || contentSection === void 0 ? void 0 : contentSection.nodeName) !== 'BR') {
|
20033 | var $br = dom_core_1["default"]("<br>");
|
20034 | $br.insertAfter($inputcontainer);
|
20035 | }
|
20036 |
|
20037 | selection.moveCursor(todoLiElem, 1);
|
20038 | } else {
|
20039 | selection.moveCursor(todoLiElem);
|
20040 | }
|
20041 | }
|
20042 | }
|
20043 | |
20044 |
|
20045 |
|
20046 |
|
20047 |
|
20048 | function delDown(e) {
|
20049 | var _a, _b;
|
20050 |
|
20051 | if (util_1.isAllTodo(editor)) {
|
20052 | var selection = editor.selection;
|
20053 | var $topSelectElem = selection.getSelectionRangeTopNodes(editor)[0];
|
20054 | var $li = (_a = $topSelectElem.childNodes()) === null || _a === void 0 ? void 0 : _a.getNode();
|
20055 | var $p = dom_core_1["default"]("<p></p>");
|
20056 | var p_1 = $p.getNode();
|
20057 | var selectionNode = (_b = window.getSelection()) === null || _b === void 0 ? void 0 : _b.anchorNode;
|
20058 | var pos = selection.getCursorPos();
|
20059 | var prevNode = selectionNode.previousSibling;
|
20060 |
|
20061 | if ($topSelectElem.text() === '') {
|
20062 | e.preventDefault();
|
20063 | var $newP = dom_core_1["default"]("<p><br></p>");
|
20064 | $newP.insertAfter($topSelectElem);
|
20065 | $topSelectElem.remove();
|
20066 | selection.moveCursor($newP.getNode(), 0);
|
20067 | return;
|
20068 | }
|
20069 |
|
20070 |
|
20071 | if ((prevNode === null || prevNode === void 0 ? void 0 : prevNode.nodeName) === 'SPAN' && prevNode.childNodes[0].nodeName === 'INPUT' && pos === 0) {
|
20072 | var _context;
|
20073 |
|
20074 | e.preventDefault();
|
20075 | $li === null || $li === void 0 ? void 0 : (0, _forEach["default"])(_context = $li.childNodes).call(_context, function (v, index) {
|
20076 | if (index === 0) return;
|
20077 | p_1.appendChild(v.cloneNode(true));
|
20078 | });
|
20079 | $p.insertAfter($topSelectElem);
|
20080 | $topSelectElem.remove();
|
20081 | }
|
20082 | }
|
20083 | }
|
20084 | |
20085 |
|
20086 |
|
20087 |
|
20088 |
|
20089 | function deleteUp() {
|
20090 | var selection = editor.selection;
|
20091 | var $topSelectElem = selection.getSelectionRangeTopNodes(editor)[0];
|
20092 |
|
20093 | if (util_2.isTodo($topSelectElem)) {
|
20094 | if ($topSelectElem.text() === '') {
|
20095 | dom_core_1["default"]("<p><br></p>").insertAfter($topSelectElem);
|
20096 | $topSelectElem.remove();
|
20097 | }
|
20098 | }
|
20099 | }
|
20100 |
|
20101 | editor.txt.eventHooks.enterDownEvents.push(todoEnter);
|
20102 | editor.txt.eventHooks.deleteUpEvents.push(deleteUp);
|
20103 | editor.txt.eventHooks.deleteDownEvents.push(delDown);
|
20104 | }
|
20105 |
|
20106 | exports["default"] = bindEvent;
|
20107 |
|
20108 | }),
|
20109 |
|
20110 | (function(module, exports, __webpack_require__) {
|
20111 |
|
20112 | "use strict";
|
20113 |
|
20114 |
|
20115 |
|
20116 |
|
20117 |
|
20118 |
|
20119 | var _interopRequireDefault = __webpack_require__(0);
|
20120 |
|
20121 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20122 |
|
20123 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
20124 | return mod && mod.__esModule ? mod : {
|
20125 | "default": mod
|
20126 | };
|
20127 | };
|
20128 |
|
20129 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20130 | value: true
|
20131 | });
|
20132 |
|
20133 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
20134 |
|
20135 | var util_1 = __webpack_require__(7);
|
20136 |
|
20137 | var styleSettings = {
|
20138 | border: '1px solid #c9d8db',
|
20139 | toolbarBgColor: '#FFF',
|
20140 | toolbarBottomBorder: '1px solid #EEE'
|
20141 | };
|
20142 |
|
20143 | function default_1(editor) {
|
20144 | var toolbarSelector = editor.toolbarSelector;
|
20145 | var $toolbarSelector = dom_core_1["default"](toolbarSelector);
|
20146 | var textSelector = editor.textSelector;
|
20147 | var config = editor.config;
|
20148 | var height = config.height;
|
20149 | var i18next = editor.i18next;
|
20150 | var $toolbarElem;
|
20151 | var $textContainerElem;
|
20152 | var $textElem;
|
20153 | var $children;
|
20154 | var toolbarElemId;
|
20155 |
|
20156 | if (textSelector == null) {
|
20157 |
|
20158 | $toolbarElem = dom_core_1["default"]('<div></div>');
|
20159 | $textContainerElem = dom_core_1["default"]('<div></div>');
|
20160 |
|
20161 | $children = $toolbarSelector.children();
|
20162 |
|
20163 | $toolbarSelector.append($toolbarElem).append($textContainerElem);
|
20164 |
|
20165 | $toolbarElem.css('background-color', styleSettings.toolbarBgColor).css('border', styleSettings.border).css('border-bottom', styleSettings.toolbarBottomBorder);
|
20166 | $textContainerElem.css('border', styleSettings.border).css('border-top', 'none').css('height', height + "px");
|
20167 |
|
20168 | toolbarElemId = util_1.getRandom('toolbar-elem');
|
20169 | } else {
|
20170 |
|
20171 | $toolbarElem = $toolbarSelector;
|
20172 | $textContainerElem = dom_core_1["default"](textSelector);
|
20173 |
|
20174 | $children = $textContainerElem.children();
|
20175 |
|
20176 | toolbarElemId = $toolbarSelector.attr('id') || util_1.getRandom('toolbar-elem');
|
20177 | }
|
20178 |
|
20179 |
|
20180 | $textElem = dom_core_1["default"]('<div></div>');
|
20181 | $textElem.attr('contenteditable', 'true').css('width', '100%').css('height', '100%');
|
20182 |
|
20183 | var $placeholder = dom_core_1["default"]("<div>" + i18next.t(editor.config.placeholder) + "</div>");
|
20184 | $placeholder.addClass('placeholder');
|
20185 |
|
20186 | if ($children && $children.length) {
|
20187 | $textElem.append($children);
|
20188 |
|
20189 | $placeholder.hide();
|
20190 | } else {
|
20191 | $textElem.append(dom_core_1["default"]('<p><br></p>'));
|
20192 | }
|
20193 |
|
20194 |
|
20195 | $textContainerElem.append($textElem);
|
20196 |
|
20197 | $textContainerElem.append($placeholder);
|
20198 |
|
20199 | $toolbarElem.addClass('w-e-toolbar').css('z-index', editor.zIndex.get('toolbar'));
|
20200 | $textContainerElem.addClass('w-e-text-container');
|
20201 | $textContainerElem.css('z-index', editor.zIndex.get());
|
20202 | $textElem.addClass('w-e-text');
|
20203 |
|
20204 | $toolbarElem.attr('id', toolbarElemId);
|
20205 | var textElemId = util_1.getRandom('text-elem');
|
20206 | $textElem.attr('id', textElemId);
|
20207 |
|
20208 | var textContainerCliheight = $textContainerElem.getClientHeight();
|
20209 | var textElemClientHeight = $textElem.getClientHeight();
|
20210 |
|
20211 | if (textContainerCliheight !== textElemClientHeight) {
|
20212 | $textElem.css('min-height', textContainerCliheight + 'px');
|
20213 | }
|
20214 |
|
20215 |
|
20216 | editor.$toolbarElem = $toolbarElem;
|
20217 | editor.$textContainerElem = $textContainerElem;
|
20218 | editor.$textElem = $textElem;
|
20219 | editor.toolbarElemId = toolbarElemId;
|
20220 | editor.textElemId = textElemId;
|
20221 | }
|
20222 |
|
20223 | exports["default"] = default_1;
|
20224 |
|
20225 | }),
|
20226 |
|
20227 | (function(module, exports, __webpack_require__) {
|
20228 |
|
20229 | "use strict";
|
20230 |
|
20231 |
|
20232 |
|
20233 |
|
20234 |
|
20235 |
|
20236 | var _interopRequireDefault = __webpack_require__(0);
|
20237 |
|
20238 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20239 |
|
20240 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
20241 | return mod && mod.__esModule ? mod : {
|
20242 | "default": mod
|
20243 | };
|
20244 | };
|
20245 |
|
20246 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20247 | value: true
|
20248 | });
|
20249 |
|
20250 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
20251 |
|
20252 |
|
20253 |
|
20254 |
|
20255 |
|
20256 |
|
20257 |
|
20258 | function initSelection(editor, newLine) {
|
20259 | var $textElem = editor.$textElem;
|
20260 | var $children = $textElem.children();
|
20261 |
|
20262 | if (!$children || !$children.length) {
|
20263 |
|
20264 | $textElem.append(dom_core_1["default"]('<p><br></p>'));
|
20265 | initSelection(editor);
|
20266 | return;
|
20267 | }
|
20268 |
|
20269 | var $last = $children.last();
|
20270 |
|
20271 | if (newLine) {
|
20272 |
|
20273 | var html = $last.html().toLowerCase();
|
20274 | var nodeName = $last.getNodeName();
|
20275 |
|
20276 | if (html !== '<br>' && html !== '<br/>' || nodeName !== 'P') {
|
20277 |
|
20278 | $textElem.append(dom_core_1["default"]('<p><br></p>'));
|
20279 | initSelection(editor);
|
20280 | return;
|
20281 | }
|
20282 | }
|
20283 |
|
20284 | editor.selection.createRangeByElem($last, true, true);
|
20285 |
|
20286 | if (editor.config.focus) {
|
20287 | editor.selection.restoreSelection();
|
20288 | }
|
20289 | }
|
20290 |
|
20291 | exports["default"] = initSelection;
|
20292 |
|
20293 | }),
|
20294 |
|
20295 | (function(module, exports, __webpack_require__) {
|
20296 |
|
20297 | "use strict";
|
20298 |
|
20299 |
|
20300 |
|
20301 |
|
20302 |
|
20303 |
|
20304 | var _interopRequireDefault = __webpack_require__(0);
|
20305 |
|
20306 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20307 |
|
20308 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
20309 | return mod && mod.__esModule ? mod : {
|
20310 | "default": mod
|
20311 | };
|
20312 | };
|
20313 |
|
20314 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20315 | value: true
|
20316 | });
|
20317 |
|
20318 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
20319 |
|
20320 | function bindEvent(editor) {
|
20321 |
|
20322 | _bindChange(editor);
|
20323 |
|
20324 |
|
20325 | _bindFocusAndBlur(editor);
|
20326 |
|
20327 |
|
20328 | _bindInput(editor);
|
20329 | }
|
20330 |
|
20331 |
|
20332 |
|
20333 |
|
20334 |
|
20335 |
|
20336 | function _bindChange(editor) {
|
20337 | var onchange = editor.config.onchange;
|
20338 | editor.txt.eventHooks.changeEvents.push(function () {
|
20339 | var html = editor.txt.html() || '';
|
20340 | onchange(html);
|
20341 | editor.txt.togglePlaceholder();
|
20342 | });
|
20343 | }
|
20344 |
|
20345 |
|
20346 |
|
20347 |
|
20348 |
|
20349 |
|
20350 | function _bindFocusAndBlur(editor) {
|
20351 |
|
20352 | editor.isFocus = false;
|
20353 |
|
20354 | function listener(e) {
|
20355 | var target = e.target;
|
20356 | var $target = dom_core_1["default"](target);
|
20357 | var $textElem = editor.$textElem;
|
20358 | var $toolbarElem = editor.$toolbarElem;
|
20359 |
|
20360 | var isChild = $textElem.isContain($target);
|
20361 |
|
20362 | var isToolbar = $toolbarElem.isContain($target);
|
20363 | var isMenu = $toolbarElem.elems[0] == e.target ? true : false;
|
20364 |
|
20365 | if (!isChild) {
|
20366 |
|
20367 | if (isToolbar && !isMenu) {
|
20368 | return;
|
20369 | }
|
20370 |
|
20371 | if (editor.isFocus) {
|
20372 | _blurHandler(editor);
|
20373 | }
|
20374 |
|
20375 | editor.isFocus = false;
|
20376 | } else {
|
20377 | if (!editor.isFocus) {
|
20378 | _focusHandler(editor);
|
20379 | }
|
20380 |
|
20381 | editor.isFocus = true;
|
20382 | }
|
20383 | }
|
20384 |
|
20385 | if (document.activeElement === editor.$textElem.elems[0]) {
|
20386 | _focusHandler(editor);
|
20387 |
|
20388 | editor.isFocus = true;
|
20389 | }
|
20390 |
|
20391 | dom_core_1["default"](document).on('click', listener);
|
20392 |
|
20393 | editor.beforeDestroy(function () {
|
20394 | dom_core_1["default"](document).off('click', listener);
|
20395 | });
|
20396 | }
|
20397 |
|
20398 |
|
20399 |
|
20400 |
|
20401 |
|
20402 |
|
20403 | function _bindInput(editor) {
|
20404 |
|
20405 | editor.$textElem.on('compositionstart', function () {
|
20406 | editor.isComposing = true;
|
20407 | }).on('compositionend', function () {
|
20408 | editor.isComposing = false;
|
20409 | });
|
20410 | }
|
20411 |
|
20412 |
|
20413 |
|
20414 |
|
20415 |
|
20416 |
|
20417 | function _blurHandler(editor) {
|
20418 | var config = editor.config;
|
20419 | var onblur = config.onblur;
|
20420 | var currentHtml = editor.txt.html() || '';
|
20421 | onblur(currentHtml);
|
20422 | }
|
20423 |
|
20424 |
|
20425 |
|
20426 |
|
20427 |
|
20428 |
|
20429 | function _focusHandler(editor) {
|
20430 | var config = editor.config;
|
20431 | var onfocus = config.onfocus;
|
20432 | var currentHtml = editor.txt.html() || '';
|
20433 | onfocus(currentHtml);
|
20434 | }
|
20435 |
|
20436 | exports["default"] = bindEvent;
|
20437 |
|
20438 | }),
|
20439 |
|
20440 | (function(module, exports, __webpack_require__) {
|
20441 |
|
20442 | "use strict";
|
20443 |
|
20444 |
|
20445 |
|
20446 |
|
20447 |
|
20448 |
|
20449 |
|
20450 |
|
20451 |
|
20452 | var _interopRequireDefault = __webpack_require__(0);
|
20453 |
|
20454 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20455 |
|
20456 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20457 | value: true
|
20458 | });
|
20459 |
|
20460 | function i18nextInit(editor) {
|
20461 | var _a = editor.config,
|
20462 | lang = _a.lang,
|
20463 | languages = _a.languages;
|
20464 |
|
20465 | if (editor.i18next != null) {
|
20466 | try {
|
20467 | editor.i18next.init({
|
20468 | ns: 'wangEditor',
|
20469 | lng: lang,
|
20470 | defaultNS: 'wangEditor',
|
20471 | resources: languages
|
20472 | });
|
20473 | } catch (error) {
|
20474 | throw new Error('i18next:' + error);
|
20475 | }
|
20476 |
|
20477 | return;
|
20478 | }
|
20479 |
|
20480 |
|
20481 | editor.i18next = {
|
20482 | t: function t(str) {
|
20483 | var strArr = str.split('.');
|
20484 | return strArr[strArr.length - 1];
|
20485 | }
|
20486 | };
|
20487 | }
|
20488 |
|
20489 | exports["default"] = i18nextInit;
|
20490 |
|
20491 | }),
|
20492 |
|
20493 | (function(module, exports, __webpack_require__) {
|
20494 |
|
20495 | "use strict";
|
20496 |
|
20497 |
|
20498 |
|
20499 |
|
20500 |
|
20501 |
|
20502 | var _interopRequireDefault = __webpack_require__(0);
|
20503 |
|
20504 | var _find = _interopRequireDefault(__webpack_require__(30));
|
20505 |
|
20506 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20507 |
|
20508 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
20509 | return mod && mod.__esModule ? mod : {
|
20510 | "default": mod
|
20511 | };
|
20512 | };
|
20513 |
|
20514 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20515 | value: true
|
20516 | });
|
20517 | exports.setUnFullScreen = exports.setFullScreen = void 0;
|
20518 |
|
20519 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
20520 |
|
20521 | __webpack_require__(392);
|
20522 |
|
20523 | var iconFullScreenText = 'w-e-icon-fullscreen';
|
20524 |
|
20525 | var iconExitFullScreenText = 'w-e-icon-fullscreen_exit';
|
20526 |
|
20527 | var classfullScreenEditor = 'w-e-full-screen-editor';
|
20528 |
|
20529 |
|
20530 |
|
20531 |
|
20532 |
|
20533 |
|
20534 | var setFullScreen = function setFullScreen(editor) {
|
20535 | var $editorParent = dom_core_1["default"](editor.toolbarSelector);
|
20536 | var $textContainerElem = editor.$textContainerElem;
|
20537 | var $toolbarElem = editor.$toolbarElem;
|
20538 | var $iconElem = (0, _find["default"])($toolbarElem).call($toolbarElem, "i." + iconFullScreenText);
|
20539 | var config = editor.config;
|
20540 | $iconElem.removeClass(iconFullScreenText);
|
20541 | $iconElem.addClass(iconExitFullScreenText);
|
20542 | $editorParent.addClass(classfullScreenEditor);
|
20543 | $editorParent.css('z-index', config.zIndexFullScreen);
|
20544 | var bar = $toolbarElem.getBoundingClientRect();
|
20545 | var h = window.innerHeight - bar.height;
|
20546 | $textContainerElem.css('height', h + "px");
|
20547 | };
|
20548 |
|
20549 | exports.setFullScreen = setFullScreen;
|
20550 |
|
20551 |
|
20552 |
|
20553 |
|
20554 |
|
20555 | var setUnFullScreen = function setUnFullScreen(editor) {
|
20556 | var $editorParent = dom_core_1["default"](editor.toolbarSelector);
|
20557 | var $textContainerElem = editor.$textContainerElem;
|
20558 | var $toolbarElem = editor.$toolbarElem;
|
20559 | var $iconElem = (0, _find["default"])($toolbarElem).call($toolbarElem, "i." + iconExitFullScreenText);
|
20560 | var config = editor.config;
|
20561 | $iconElem.removeClass(iconExitFullScreenText);
|
20562 | $iconElem.addClass(iconFullScreenText);
|
20563 | $editorParent.removeClass(classfullScreenEditor);
|
20564 | $editorParent.css('z-index', 'auto');
|
20565 | $textContainerElem.css('height', config.height + 'px');
|
20566 | };
|
20567 |
|
20568 | exports.setUnFullScreen = setUnFullScreen;
|
20569 |
|
20570 |
|
20571 |
|
20572 |
|
20573 |
|
20574 | var initFullScreen = function initFullScreen(editor) {
|
20575 |
|
20576 | if (editor.textSelector) return;
|
20577 | if (!editor.config.showFullScreen) return;
|
20578 | var $toolbarElem = editor.$toolbarElem;
|
20579 | var $elem = dom_core_1["default"]("<div class=\"w-e-menu\" data-title=\"\u5168\u5C4F\">\n <i class=\"" + iconFullScreenText + "\"></i>\n </div>");
|
20580 | $elem.on('click', function (e) {
|
20581 | var _context;
|
20582 |
|
20583 | var $elemIcon = (0, _find["default"])(_context = dom_core_1["default"](e.currentTarget)).call(_context, 'i');
|
20584 |
|
20585 | if ($elemIcon.hasClass(iconFullScreenText)) {
|
20586 | exports.setFullScreen(editor);
|
20587 | } else {
|
20588 | exports.setUnFullScreen(editor);
|
20589 | }
|
20590 | });
|
20591 | $toolbarElem.append($elem);
|
20592 | };
|
20593 |
|
20594 | exports["default"] = initFullScreen;
|
20595 |
|
20596 | }),
|
20597 |
|
20598 | (function(module, exports, __webpack_require__) {
|
20599 |
|
20600 | var api = __webpack_require__(20);
|
20601 | var content = __webpack_require__(393);
|
20602 |
|
20603 | content = content.__esModule ? content.default : content;
|
20604 |
|
20605 | if (typeof content === 'string') {
|
20606 | content = [[module.i, content, '']];
|
20607 | }
|
20608 |
|
20609 | var options = {};
|
20610 |
|
20611 | options.insert = "head";
|
20612 | options.singleton = false;
|
20613 |
|
20614 | var update = api(content, options);
|
20615 |
|
20616 |
|
20617 |
|
20618 | module.exports = content.locals || {};
|
20619 |
|
20620 | }),
|
20621 |
|
20622 | (function(module, exports, __webpack_require__) {
|
20623 |
|
20624 |
|
20625 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
20626 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
20627 |
|
20628 | exports.push([module.i, ".w-e-full-screen-editor {\n position: fixed;\n width: 100%!important;\n height: 100%!important;\n left: 0;\n top: 0;\n}\n", ""]);
|
20629 |
|
20630 | module.exports = exports;
|
20631 |
|
20632 |
|
20633 | }),
|
20634 |
|
20635 | (function(module, exports, __webpack_require__) {
|
20636 |
|
20637 | "use strict";
|
20638 |
|
20639 |
|
20640 |
|
20641 |
|
20642 |
|
20643 |
|
20644 | var _interopRequireDefault = __webpack_require__(0);
|
20645 |
|
20646 | var _find = _interopRequireDefault(__webpack_require__(30));
|
20647 |
|
20648 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20649 |
|
20650 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20651 | value: true
|
20652 | });
|
20653 |
|
20654 |
|
20655 |
|
20656 |
|
20657 |
|
20658 |
|
20659 | var scrollToHead = function scrollToHead(editor, id) {
|
20660 | var $textElem = editor.$textElem;
|
20661 | var $targetHead = (0, _find["default"])($textElem).call($textElem, "[id='" + id + "']");
|
20662 | var targetTop = $targetHead.getOffsetData().top;
|
20663 | $textElem.scrollTop(targetTop);
|
20664 | };
|
20665 |
|
20666 | exports["default"] = scrollToHead;
|
20667 |
|
20668 | }),
|
20669 |
|
20670 | (function(module, exports, __webpack_require__) {
|
20671 |
|
20672 | "use strict";
|
20673 |
|
20674 |
|
20675 | var _interopRequireDefault = __webpack_require__(0);
|
20676 |
|
20677 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20678 |
|
20679 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
20680 | return mod && mod.__esModule ? mod : {
|
20681 | "default": mod
|
20682 | };
|
20683 | };
|
20684 |
|
20685 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20686 | value: true
|
20687 | });
|
20688 |
|
20689 | var style_1 = __importDefault(__webpack_require__(122));
|
20690 |
|
20691 | var tier = {
|
20692 | menu: 2,
|
20693 | panel: 2,
|
20694 | toolbar: 1,
|
20695 | tooltip: 1,
|
20696 | textContainer: 1
|
20697 | };
|
20698 |
|
20699 | var ZIndex =
|
20700 |
|
20701 | function () {
|
20702 | function ZIndex() {
|
20703 |
|
20704 | this.tier = tier;
|
20705 |
|
20706 | this.baseZIndex = style_1["default"].zIndex;
|
20707 | }
|
20708 |
|
20709 |
|
20710 | ZIndex.prototype.get = function (tierName) {
|
20711 | if (tierName && this.tier[tierName]) {
|
20712 | return this.baseZIndex + this.tier[tierName];
|
20713 | }
|
20714 |
|
20715 | return this.baseZIndex;
|
20716 | };
|
20717 |
|
20718 |
|
20719 | ZIndex.prototype.init = function (editor) {
|
20720 | if (this.baseZIndex == style_1["default"].zIndex) {
|
20721 | this.baseZIndex = editor.config.zIndex;
|
20722 | }
|
20723 | };
|
20724 |
|
20725 | return ZIndex;
|
20726 | }();
|
20727 |
|
20728 | exports["default"] = ZIndex;
|
20729 |
|
20730 | }),
|
20731 |
|
20732 | (function(module, exports, __webpack_require__) {
|
20733 |
|
20734 | "use strict";
|
20735 |
|
20736 |
|
20737 |
|
20738 |
|
20739 |
|
20740 |
|
20741 | var _interopRequireDefault = __webpack_require__(0);
|
20742 |
|
20743 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
20744 |
|
20745 | var _filter = _interopRequireDefault(__webpack_require__(66));
|
20746 |
|
20747 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20748 |
|
20749 | var _create = _interopRequireDefault(__webpack_require__(3));
|
20750 |
|
20751 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
20752 |
|
20753 | var __extends = void 0 && (void 0).__extends || function () {
|
20754 | var _extendStatics = function extendStatics(d, b) {
|
20755 | _extendStatics = _setPrototypeOf["default"] || {
|
20756 | __proto__: []
|
20757 | } instanceof Array && function (d, b) {
|
20758 | d.__proto__ = b;
|
20759 | } || function (d, b) {
|
20760 | for (var p in b) {
|
20761 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
20762 | }
|
20763 | };
|
20764 |
|
20765 | return _extendStatics(d, b);
|
20766 | };
|
20767 |
|
20768 | return function (d, b) {
|
20769 | _extendStatics(d, b);
|
20770 |
|
20771 | function __() {
|
20772 | this.constructor = d;
|
20773 | }
|
20774 |
|
20775 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
20776 | };
|
20777 | }();
|
20778 |
|
20779 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
20780 | return mod && mod.__esModule ? mod : {
|
20781 | "default": mod
|
20782 | };
|
20783 | };
|
20784 |
|
20785 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20786 | value: true
|
20787 | });
|
20788 |
|
20789 | var mutation_1 = __importDefault(__webpack_require__(397));
|
20790 |
|
20791 | var util_1 = __webpack_require__(7);
|
20792 |
|
20793 | var const_1 = __webpack_require__(26);
|
20794 |
|
20795 |
|
20796 |
|
20797 |
|
20798 |
|
20799 |
|
20800 |
|
20801 | function mutationsFilter(mutations, tar) {
|
20802 |
|
20803 | return (0, _filter["default"])(mutations).call(mutations, function (_a) {
|
20804 | var type = _a.type,
|
20805 | target = _a.target,
|
20806 | attributeName = _a.attributeName;
|
20807 | return type != 'attributes' || type == 'attributes' && (attributeName == 'contenteditable' || target != tar);
|
20808 | });
|
20809 | }
|
20810 |
|
20811 |
|
20812 |
|
20813 |
|
20814 |
|
20815 | var Change =
|
20816 |
|
20817 | function (_super) {
|
20818 | __extends(Change, _super);
|
20819 |
|
20820 | function Change(editor) {
|
20821 | var _this = _super.call(this, function (mutations, observer) {
|
20822 | var _a;
|
20823 |
|
20824 |
|
20825 | mutations = mutationsFilter(mutations, observer.target);
|
20826 |
|
20827 | (_a = _this.data).push.apply(_a, mutations);
|
20828 |
|
20829 |
|
20830 | if (!editor.isCompatibleMode) {
|
20831 |
|
20832 | if (!editor.isComposing) {
|
20833 | return _this.asyncSave();
|
20834 | }
|
20835 | }
|
20836 | else {
|
20837 | _this.asyncSave();
|
20838 | }
|
20839 | }) || this;
|
20840 |
|
20841 | _this.editor = editor;
|
20842 | |
20843 |
|
20844 |
|
20845 |
|
20846 | _this.data = [];
|
20847 | |
20848 |
|
20849 |
|
20850 |
|
20851 | _this.asyncSave = const_1.EMPTY_FN;
|
20852 | return _this;
|
20853 | }
|
20854 | |
20855 |
|
20856 |
|
20857 |
|
20858 |
|
20859 | Change.prototype.save = function () {
|
20860 |
|
20861 | if (this.data.length) {
|
20862 |
|
20863 | this.editor.history.save(this.data);
|
20864 |
|
20865 | this.data.length = 0;
|
20866 | this.emit();
|
20867 | }
|
20868 | };
|
20869 | |
20870 |
|
20871 |
|
20872 |
|
20873 |
|
20874 | Change.prototype.emit = function () {
|
20875 | var _context;
|
20876 |
|
20877 |
|
20878 | (0, _forEach["default"])(_context = this.editor.txt.eventHooks.changeEvents).call(_context, function (fn) {
|
20879 | return fn();
|
20880 | });
|
20881 | };
|
20882 |
|
20883 |
|
20884 | Change.prototype.observe = function () {
|
20885 | var _this = this;
|
20886 |
|
20887 | _super.prototype.observe.call(this, this.editor.$textElem.elems[0]);
|
20888 |
|
20889 | var timeout = this.editor.config.onchangeTimeout;
|
20890 | this.asyncSave = util_1.debounce(function () {
|
20891 | _this.save();
|
20892 | }, timeout);
|
20893 |
|
20894 | if (!this.editor.isCompatibleMode) {
|
20895 | this.editor.$textElem.on('compositionend', function () {
|
20896 | _this.asyncSave();
|
20897 | });
|
20898 | }
|
20899 | };
|
20900 |
|
20901 | return Change;
|
20902 | }(mutation_1["default"]);
|
20903 |
|
20904 | exports["default"] = Change;
|
20905 |
|
20906 | }),
|
20907 |
|
20908 | (function(module, exports, __webpack_require__) {
|
20909 |
|
20910 | "use strict";
|
20911 |
|
20912 |
|
20913 |
|
20914 |
|
20915 |
|
20916 |
|
20917 | var _interopRequireDefault = __webpack_require__(0);
|
20918 |
|
20919 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
20920 |
|
20921 | (0, _defineProperty["default"])(exports, "__esModule", {
|
20922 | value: true
|
20923 | });
|
20924 |
|
20925 |
|
20926 |
|
20927 |
|
20928 | var Mutation =
|
20929 |
|
20930 | function () {
|
20931 | |
20932 |
|
20933 |
|
20934 |
|
20935 |
|
20936 | function Mutation(fn, options) {
|
20937 | var _this = this;
|
20938 | |
20939 |
|
20940 |
|
20941 |
|
20942 |
|
20943 | this.options = {
|
20944 | subtree: true,
|
20945 | childList: true,
|
20946 | attributes: true,
|
20947 | attributeOldValue: true,
|
20948 | characterData: true,
|
20949 | characterDataOldValue: true
|
20950 | };
|
20951 |
|
20952 | this.callback = function (mutations) {
|
20953 | fn(mutations, _this);
|
20954 | };
|
20955 |
|
20956 | this.observer = new MutationObserver(this.callback);
|
20957 | options && (this.options = options);
|
20958 | }
|
20959 |
|
20960 | (0, _defineProperty["default"])(Mutation.prototype, "target", {
|
20961 | get: function get() {
|
20962 | return this.node;
|
20963 | },
|
20964 | enumerable: false,
|
20965 | configurable: true
|
20966 | });
|
20967 | |
20968 |
|
20969 |
|
20970 |
|
20971 |
|
20972 | Mutation.prototype.observe = function (node) {
|
20973 | if (!(this.node instanceof Node)) {
|
20974 | this.node = node;
|
20975 | this.connect();
|
20976 | }
|
20977 | };
|
20978 | |
20979 |
|
20980 |
|
20981 |
|
20982 |
|
20983 | Mutation.prototype.connect = function () {
|
20984 | if (this.node) {
|
20985 | this.observer.observe(this.node, this.options);
|
20986 | return this;
|
20987 | }
|
20988 |
|
20989 | throw new Error('还未初始化绑定,请您先绑定有效的 Node 节点');
|
20990 | };
|
20991 | |
20992 |
|
20993 |
|
20994 |
|
20995 |
|
20996 | Mutation.prototype.disconnect = function () {
|
20997 | var list = this.observer.takeRecords();
|
20998 | list.length && this.callback(list);
|
20999 | this.observer.disconnect();
|
21000 | };
|
21001 |
|
21002 | return Mutation;
|
21003 | }();
|
21004 |
|
21005 | exports["default"] = Mutation;
|
21006 |
|
21007 | }),
|
21008 |
|
21009 | (function(module, exports, __webpack_require__) {
|
21010 |
|
21011 | "use strict";
|
21012 |
|
21013 |
|
21014 |
|
21015 |
|
21016 |
|
21017 |
|
21018 | var _interopRequireDefault = __webpack_require__(0);
|
21019 |
|
21020 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21021 |
|
21022 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
21023 | return mod && mod.__esModule ? mod : {
|
21024 | "default": mod
|
21025 | };
|
21026 | };
|
21027 |
|
21028 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21029 | value: true
|
21030 | });
|
21031 |
|
21032 | var content_1 = __importDefault(__webpack_require__(399));
|
21033 |
|
21034 | var scroll_1 = __importDefault(__webpack_require__(411));
|
21035 |
|
21036 | var range_1 = __importDefault(__webpack_require__(412));
|
21037 |
|
21038 |
|
21039 |
|
21040 |
|
21041 |
|
21042 | var History =
|
21043 |
|
21044 | function () {
|
21045 | function History(editor) {
|
21046 | this.editor = editor;
|
21047 | this.content = new content_1["default"](editor);
|
21048 | this.scroll = new scroll_1["default"](editor);
|
21049 | this.range = new range_1["default"](editor);
|
21050 | }
|
21051 |
|
21052 | (0, _defineProperty["default"])(History.prototype, "size", {
|
21053 | |
21054 |
|
21055 |
|
21056 | get: function get() {
|
21057 | return this.scroll.size;
|
21058 | },
|
21059 | enumerable: false,
|
21060 | configurable: true
|
21061 | });
|
21062 | |
21063 |
|
21064 |
|
21065 |
|
21066 | History.prototype.observe = function () {
|
21067 | this.content.observe();
|
21068 | this.scroll.observe();
|
21069 |
|
21070 | !this.editor.isCompatibleMode && this.range.observe();
|
21071 | };
|
21072 | |
21073 |
|
21074 |
|
21075 |
|
21076 |
|
21077 | History.prototype.save = function (mutations) {
|
21078 | if (mutations.length) {
|
21079 | this.content.save(mutations);
|
21080 | this.scroll.save();
|
21081 |
|
21082 | !this.editor.isCompatibleMode && this.range.save();
|
21083 | }
|
21084 | };
|
21085 | |
21086 |
|
21087 |
|
21088 |
|
21089 |
|
21090 | History.prototype.revoke = function () {
|
21091 | this.editor.change.disconnect();
|
21092 | var res = this.content.revoke();
|
21093 |
|
21094 | if (res) {
|
21095 | this.scroll.revoke();
|
21096 |
|
21097 | if (!this.editor.isCompatibleMode) {
|
21098 | this.range.revoke();
|
21099 | this.editor.$textElem.focus();
|
21100 | }
|
21101 | }
|
21102 |
|
21103 | this.editor.change.connect();
|
21104 |
|
21105 | res && this.editor.change.emit();
|
21106 | };
|
21107 | |
21108 |
|
21109 |
|
21110 |
|
21111 |
|
21112 | History.prototype.restore = function () {
|
21113 | this.editor.change.disconnect();
|
21114 | var res = this.content.restore();
|
21115 |
|
21116 | if (res) {
|
21117 | this.scroll.restore();
|
21118 |
|
21119 | if (!this.editor.isCompatibleMode) {
|
21120 | this.range.restore();
|
21121 | this.editor.$textElem.focus();
|
21122 | }
|
21123 | }
|
21124 |
|
21125 | this.editor.change.connect();
|
21126 |
|
21127 | res && this.editor.change.emit();
|
21128 | };
|
21129 |
|
21130 | return History;
|
21131 | }();
|
21132 |
|
21133 | exports["default"] = History;
|
21134 |
|
21135 | }),
|
21136 |
|
21137 | (function(module, exports, __webpack_require__) {
|
21138 |
|
21139 | "use strict";
|
21140 |
|
21141 |
|
21142 |
|
21143 |
|
21144 |
|
21145 |
|
21146 | var _interopRequireDefault = __webpack_require__(0);
|
21147 |
|
21148 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21149 |
|
21150 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
21151 | return mod && mod.__esModule ? mod : {
|
21152 | "default": mod
|
21153 | };
|
21154 | };
|
21155 |
|
21156 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21157 | value: true
|
21158 | });
|
21159 |
|
21160 | var node_1 = __importDefault(__webpack_require__(400));
|
21161 |
|
21162 | var html_1 = __importDefault(__webpack_require__(409));
|
21163 |
|
21164 | var ContentCache =
|
21165 |
|
21166 | function () {
|
21167 | function ContentCache(editor) {
|
21168 | this.editor = editor;
|
21169 | }
|
21170 | |
21171 |
|
21172 |
|
21173 |
|
21174 |
|
21175 | ContentCache.prototype.observe = function () {
|
21176 | if (this.editor.isCompatibleMode) {
|
21177 |
|
21178 | this.cache = new html_1["default"](this.editor);
|
21179 | } else {
|
21180 |
|
21181 | this.cache = new node_1["default"](this.editor);
|
21182 | }
|
21183 |
|
21184 | this.cache.observe();
|
21185 | };
|
21186 | |
21187 |
|
21188 |
|
21189 |
|
21190 |
|
21191 | ContentCache.prototype.save = function (mutations) {
|
21192 | if (this.editor.isCompatibleMode) {
|
21193 | ;
|
21194 | this.cache.save();
|
21195 | } else {
|
21196 | ;
|
21197 | this.cache.compile(mutations);
|
21198 | }
|
21199 | };
|
21200 | |
21201 |
|
21202 |
|
21203 |
|
21204 |
|
21205 | ContentCache.prototype.revoke = function () {
|
21206 | var _a;
|
21207 |
|
21208 | return (_a = this.cache) === null || _a === void 0 ? void 0 : _a.revoke();
|
21209 | };
|
21210 | |
21211 |
|
21212 |
|
21213 |
|
21214 |
|
21215 | ContentCache.prototype.restore = function () {
|
21216 | var _a;
|
21217 |
|
21218 | return (_a = this.cache) === null || _a === void 0 ? void 0 : _a.restore();
|
21219 | };
|
21220 |
|
21221 | return ContentCache;
|
21222 | }();
|
21223 |
|
21224 | exports["default"] = ContentCache;
|
21225 |
|
21226 | }),
|
21227 |
|
21228 | (function(module, exports, __webpack_require__) {
|
21229 |
|
21230 | "use strict";
|
21231 |
|
21232 |
|
21233 |
|
21234 |
|
21235 |
|
21236 |
|
21237 | var _interopRequireDefault = __webpack_require__(0);
|
21238 |
|
21239 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21240 |
|
21241 | var _create = _interopRequireDefault(__webpack_require__(3));
|
21242 |
|
21243 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
21244 |
|
21245 | var __extends = void 0 && (void 0).__extends || function () {
|
21246 | var _extendStatics = function extendStatics(d, b) {
|
21247 | _extendStatics = _setPrototypeOf["default"] || {
|
21248 | __proto__: []
|
21249 | } instanceof Array && function (d, b) {
|
21250 | d.__proto__ = b;
|
21251 | } || function (d, b) {
|
21252 | for (var p in b) {
|
21253 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
21254 | }
|
21255 | };
|
21256 |
|
21257 | return _extendStatics(d, b);
|
21258 | };
|
21259 |
|
21260 | return function (d, b) {
|
21261 | _extendStatics(d, b);
|
21262 |
|
21263 | function __() {
|
21264 | this.constructor = d;
|
21265 | }
|
21266 |
|
21267 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
21268 | };
|
21269 | }();
|
21270 |
|
21271 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
21272 | return mod && mod.__esModule ? mod : {
|
21273 | "default": mod
|
21274 | };
|
21275 | };
|
21276 |
|
21277 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21278 | value: true
|
21279 | });
|
21280 |
|
21281 | var cache_1 = __importDefault(__webpack_require__(99));
|
21282 |
|
21283 | var compile_1 = __importDefault(__webpack_require__(402));
|
21284 |
|
21285 | var decompilation_1 = __webpack_require__(403);
|
21286 |
|
21287 | var NodeCache =
|
21288 |
|
21289 | function (_super) {
|
21290 | __extends(NodeCache, _super);
|
21291 |
|
21292 | function NodeCache(editor) {
|
21293 | var _this = _super.call(this, editor.config.historyMaxSize) || this;
|
21294 |
|
21295 | _this.editor = editor;
|
21296 | return _this;
|
21297 | }
|
21298 |
|
21299 | NodeCache.prototype.observe = function () {
|
21300 | this.resetMaxSize(this.editor.config.historyMaxSize);
|
21301 | };
|
21302 | |
21303 |
|
21304 |
|
21305 |
|
21306 |
|
21307 | NodeCache.prototype.compile = function (data) {
|
21308 | this.save(compile_1["default"](data));
|
21309 | return this;
|
21310 | };
|
21311 | |
21312 |
|
21313 |
|
21314 |
|
21315 |
|
21316 | NodeCache.prototype.revoke = function () {
|
21317 | return _super.prototype.revoke.call(this, function (data) {
|
21318 | decompilation_1.revoke(data);
|
21319 | });
|
21320 | };
|
21321 | |
21322 |
|
21323 |
|
21324 |
|
21325 |
|
21326 | NodeCache.prototype.restore = function () {
|
21327 | return _super.prototype.restore.call(this, function (data) {
|
21328 | decompilation_1.restore(data);
|
21329 | });
|
21330 | };
|
21331 |
|
21332 | return NodeCache;
|
21333 | }(cache_1["default"]);
|
21334 |
|
21335 | exports["default"] = NodeCache;
|
21336 |
|
21337 | }),
|
21338 |
|
21339 | (function(module, exports, __webpack_require__) {
|
21340 |
|
21341 | "use strict";
|
21342 |
|
21343 |
|
21344 |
|
21345 |
|
21346 |
|
21347 |
|
21348 | var _interopRequireDefault = __webpack_require__(0);
|
21349 |
|
21350 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21351 |
|
21352 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21353 | value: true
|
21354 | });
|
21355 | exports.CeilStack = void 0;
|
21356 |
|
21357 |
|
21358 |
|
21359 |
|
21360 |
|
21361 | var CeilStack =
|
21362 |
|
21363 | function () {
|
21364 | function CeilStack(max) {
|
21365 | if (max === void 0) {
|
21366 | max = 0;
|
21367 | }
|
21368 | |
21369 |
|
21370 |
|
21371 |
|
21372 |
|
21373 | this.data = [];
|
21374 | |
21375 |
|
21376 |
|
21377 |
|
21378 | this.max = 0;
|
21379 | |
21380 |
|
21381 |
|
21382 |
|
21383 | this.reset = false;
|
21384 | max = Math.abs(max);
|
21385 | max && (this.max = max);
|
21386 | }
|
21387 | |
21388 |
|
21389 |
|
21390 |
|
21391 |
|
21392 | CeilStack.prototype.resetMax = function (maxSize) {
|
21393 | maxSize = Math.abs(maxSize);
|
21394 |
|
21395 | if (!this.reset && !isNaN(maxSize)) {
|
21396 | this.max = maxSize;
|
21397 | this.reset = true;
|
21398 | }
|
21399 | };
|
21400 |
|
21401 | (0, _defineProperty["default"])(CeilStack.prototype, "size", {
|
21402 | |
21403 |
|
21404 |
|
21405 | get: function get() {
|
21406 | return this.data.length;
|
21407 | },
|
21408 | enumerable: false,
|
21409 | configurable: true
|
21410 | });
|
21411 | |
21412 |
|
21413 |
|
21414 |
|
21415 |
|
21416 | CeilStack.prototype.instack = function (data) {
|
21417 | this.data.unshift(data);
|
21418 |
|
21419 | if (this.max && this.size > this.max) {
|
21420 | this.data.length = this.max;
|
21421 | }
|
21422 |
|
21423 | return this;
|
21424 | };
|
21425 | |
21426 |
|
21427 |
|
21428 |
|
21429 |
|
21430 | CeilStack.prototype.outstack = function () {
|
21431 | return this.data.shift();
|
21432 | };
|
21433 | |
21434 |
|
21435 |
|
21436 |
|
21437 |
|
21438 | CeilStack.prototype.clear = function () {
|
21439 | this.data.length = 0;
|
21440 | return this;
|
21441 | };
|
21442 |
|
21443 | return CeilStack;
|
21444 | }();
|
21445 |
|
21446 | exports.CeilStack = CeilStack;
|
21447 |
|
21448 | }),
|
21449 |
|
21450 | (function(module, exports, __webpack_require__) {
|
21451 |
|
21452 | "use strict";
|
21453 |
|
21454 |
|
21455 |
|
21456 |
|
21457 |
|
21458 |
|
21459 | var _interopRequireDefault = __webpack_require__(0);
|
21460 |
|
21461 | var _indexOf = _interopRequireDefault(__webpack_require__(54));
|
21462 |
|
21463 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
21464 |
|
21465 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21466 |
|
21467 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21468 | value: true
|
21469 | });
|
21470 | exports.compliePosition = exports.complieNodes = exports.compileValue = exports.compileType = void 0;
|
21471 |
|
21472 | var util_1 = __webpack_require__(7);
|
21473 |
|
21474 |
|
21475 |
|
21476 |
|
21477 |
|
21478 | function compileType(data) {
|
21479 | switch (data) {
|
21480 | case 'childList':
|
21481 | return 'node';
|
21482 |
|
21483 | case 'attributes':
|
21484 | return 'attr';
|
21485 |
|
21486 | default:
|
21487 | return 'text';
|
21488 | }
|
21489 | }
|
21490 |
|
21491 | exports.compileType = compileType;
|
21492 |
|
21493 |
|
21494 |
|
21495 |
|
21496 | function compileValue(data) {
|
21497 | switch (data.type) {
|
21498 | case 'attributes':
|
21499 | return data.target.getAttribute(data.attributeName) || '';
|
21500 |
|
21501 | case 'characterData':
|
21502 | return data.target.textContent;
|
21503 |
|
21504 | default:
|
21505 | return '';
|
21506 | }
|
21507 | }
|
21508 |
|
21509 | exports.compileValue = compileValue;
|
21510 |
|
21511 |
|
21512 |
|
21513 |
|
21514 | function complieNodes(data) {
|
21515 | var temp = {};
|
21516 |
|
21517 | if (data.addedNodes.length) {
|
21518 | temp.add = util_1.toArray(data.addedNodes);
|
21519 | }
|
21520 |
|
21521 | if (data.removedNodes.length) {
|
21522 | temp.remove = util_1.toArray(data.removedNodes);
|
21523 | }
|
21524 |
|
21525 | return temp;
|
21526 | }
|
21527 |
|
21528 | exports.complieNodes = complieNodes;
|
21529 |
|
21530 |
|
21531 |
|
21532 |
|
21533 | function compliePosition(data) {
|
21534 | var temp;
|
21535 |
|
21536 | if (data.previousSibling) {
|
21537 | temp = {
|
21538 | type: 'before',
|
21539 | target: data.previousSibling
|
21540 | };
|
21541 | } else if (data.nextSibling) {
|
21542 | temp = {
|
21543 | type: 'after',
|
21544 | target: data.nextSibling
|
21545 | };
|
21546 | } else {
|
21547 | temp = {
|
21548 | type: 'parent',
|
21549 | target: data.target
|
21550 | };
|
21551 | }
|
21552 |
|
21553 | return temp;
|
21554 | }
|
21555 |
|
21556 | exports.compliePosition = compliePosition;
|
21557 |
|
21558 |
|
21559 |
|
21560 |
|
21561 | var tag = ['UL', 'OL', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6'];
|
21562 |
|
21563 |
|
21564 |
|
21565 |
|
21566 | function compile(data) {
|
21567 | var temp = [];
|
21568 |
|
21569 |
|
21570 | var removeNode = false;
|
21571 |
|
21572 | var removeCache = [];
|
21573 | (0, _forEach["default"])(data).call(data, function (record, index) {
|
21574 | var item = {
|
21575 | type: compileType(record.type),
|
21576 | target: record.target,
|
21577 | attr: record.attributeName || '',
|
21578 | value: compileValue(record) || '',
|
21579 | oldValue: record.oldValue || '',
|
21580 | nodes: complieNodes(record),
|
21581 | position: compliePosition(record)
|
21582 | };
|
21583 | temp.push(item);
|
21584 |
|
21585 | if (!util_1.UA.isFirefox) {
|
21586 | return;
|
21587 | }
|
21588 |
|
21589 |
|
21590 |
|
21591 |
|
21592 | if (removeNode && record.addedNodes.length && record.addedNodes[0].nodeType == 1) {
|
21593 |
|
21594 | var replenishNode = record.addedNodes[0];
|
21595 | var replenishData = {
|
21596 | type: 'node',
|
21597 | target: replenishNode,
|
21598 | attr: '',
|
21599 | value: '',
|
21600 | oldValue: '',
|
21601 | nodes: {
|
21602 | add: [removeNode]
|
21603 | },
|
21604 | position: {
|
21605 | type: 'parent',
|
21606 | target: replenishNode
|
21607 | }
|
21608 | };
|
21609 |
|
21610 | if ((0, _indexOf["default"])(tag).call(tag, replenishNode.nodeName) != -1) {
|
21611 | replenishData.nodes.add = util_1.toArray(replenishNode.childNodes);
|
21612 | temp.push(replenishData);
|
21613 | }
|
21614 | else if (removeNode.nodeType == 3) {
|
21615 | if (contains(replenishNode, removeCache)) {
|
21616 | replenishData.nodes.add = util_1.toArray(replenishNode.childNodes);
|
21617 | }
|
21618 |
|
21619 | temp.push(replenishData);
|
21620 | }
|
21621 | else if ((0, _indexOf["default"])(tag).call(tag, record.target.nodeName) == -1 && contains(replenishNode, removeCache)) {
|
21622 | replenishData.nodes.add = util_1.toArray(replenishNode.childNodes);
|
21623 | temp.push(replenishData);
|
21624 | }
|
21625 | }
|
21626 |
|
21627 |
|
21628 | if (item.type == 'node' && record.removedNodes.length == 1) {
|
21629 | removeNode = record.removedNodes[0];
|
21630 | removeCache.push(removeNode);
|
21631 | } else {
|
21632 | removeNode = false;
|
21633 | removeCache.length = 0;
|
21634 | }
|
21635 | });
|
21636 | return temp;
|
21637 | }
|
21638 |
|
21639 | exports["default"] = compile;
|
21640 |
|
21641 | function contains(tar, childs) {
|
21642 | var count = 0;
|
21643 |
|
21644 | for (var i = childs.length - 1; i > 0; i--) {
|
21645 | if (tar.contains(childs[i])) {
|
21646 | count++;
|
21647 | } else {
|
21648 | break;
|
21649 | }
|
21650 | }
|
21651 |
|
21652 | return count;
|
21653 | }
|
21654 |
|
21655 | }),
|
21656 |
|
21657 | (function(module, exports, __webpack_require__) {
|
21658 |
|
21659 | "use strict";
|
21660 |
|
21661 |
|
21662 | var _interopRequireDefault = __webpack_require__(0);
|
21663 |
|
21664 | var _entries = _interopRequireDefault(__webpack_require__(404));
|
21665 |
|
21666 | var _forEach = _interopRequireDefault(__webpack_require__(5));
|
21667 |
|
21668 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21669 |
|
21670 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21671 | value: true
|
21672 | });
|
21673 | exports.restore = exports.revoke = void 0;
|
21674 |
|
21675 |
|
21676 |
|
21677 |
|
21678 |
|
21679 |
|
21680 | function insertNode(data, list) {
|
21681 | var reference = data.position.target;
|
21682 |
|
21683 | switch (data.position.type) {
|
21684 |
|
21685 | case 'before':
|
21686 | if (reference.nextSibling) {
|
21687 | reference = reference.nextSibling;
|
21688 | (0, _forEach["default"])(list).call(list, function (item) {
|
21689 | data.target.insertBefore(item, reference);
|
21690 | });
|
21691 | } else {
|
21692 | (0, _forEach["default"])(list).call(list, function (item) {
|
21693 | data.target.appendChild(item);
|
21694 | });
|
21695 | }
|
21696 |
|
21697 | break;
|
21698 |
|
21699 |
|
21700 | case 'after':
|
21701 | (0, _forEach["default"])(list).call(list, function (item) {
|
21702 | data.target.insertBefore(item, reference);
|
21703 | });
|
21704 | break;
|
21705 |
|
21706 |
|
21707 |
|
21708 | default:
|
21709 | (0, _forEach["default"])(list).call(list, function (item) {
|
21710 | reference.appendChild(item);
|
21711 | });
|
21712 | break;
|
21713 | }
|
21714 | }
|
21715 |
|
21716 |
|
21717 |
|
21718 | function revokeNode(data) {
|
21719 | for (var _i = 0, _a = (0, _entries["default"])(data.nodes); _i < _a.length; _i++) {
|
21720 | var _b = _a[_i],
|
21721 | relative = _b[0],
|
21722 | list = _b[1];
|
21723 |
|
21724 | switch (relative) {
|
21725 |
|
21726 | case 'add':
|
21727 | (0, _forEach["default"])(list).call(list, function (item) {
|
21728 | data.target.removeChild(item);
|
21729 | });
|
21730 | break;
|
21731 |
|
21732 |
|
21733 | default:
|
21734 | {
|
21735 | insertNode(data, list);
|
21736 | break;
|
21737 | }
|
21738 | }
|
21739 | }
|
21740 | }
|
21741 |
|
21742 |
|
21743 |
|
21744 |
|
21745 |
|
21746 | function revokeAttr(data) {
|
21747 | var target = data.target;
|
21748 |
|
21749 | if (data.oldValue == null) {
|
21750 | target.removeAttribute(data.attr);
|
21751 | } else {
|
21752 | target.setAttribute(data.attr, data.oldValue);
|
21753 | }
|
21754 | }
|
21755 |
|
21756 |
|
21757 |
|
21758 |
|
21759 |
|
21760 | function revokeText(data) {
|
21761 | data.target.textContent = data.oldValue;
|
21762 | }
|
21763 |
|
21764 | var revokeFns = {
|
21765 | node: revokeNode,
|
21766 | text: revokeText,
|
21767 | attr: revokeAttr
|
21768 | };
|
21769 |
|
21770 | function revoke(data) {
|
21771 | for (var i = data.length - 1; i > -1; i--) {
|
21772 | var item = data[i];
|
21773 | revokeFns[item.type](item);
|
21774 | }
|
21775 | }
|
21776 |
|
21777 | exports.revoke = revoke;
|
21778 |
|
21779 |
|
21780 | function restoreNode(data) {
|
21781 | for (var _i = 0, _a = (0, _entries["default"])(data.nodes); _i < _a.length; _i++) {
|
21782 | var _b = _a[_i],
|
21783 | relative = _b[0],
|
21784 | list = _b[1];
|
21785 |
|
21786 | switch (relative) {
|
21787 | case 'add':
|
21788 | {
|
21789 | insertNode(data, list);
|
21790 | break;
|
21791 | }
|
21792 |
|
21793 |
|
21794 | default:
|
21795 | {
|
21796 | (0, _forEach["default"])(list).call(list, function (item) {
|
21797 | ;
|
21798 | item.parentNode.removeChild(item);
|
21799 | });
|
21800 | break;
|
21801 | }
|
21802 | }
|
21803 | }
|
21804 | }
|
21805 |
|
21806 | function restoreText(data) {
|
21807 | data.target.textContent = data.value;
|
21808 | }
|
21809 |
|
21810 | function restoreAttr(data) {
|
21811 | ;
|
21812 | data.target.setAttribute(data.attr, data.value);
|
21813 | }
|
21814 |
|
21815 | var restoreFns = {
|
21816 | node: restoreNode,
|
21817 | text: restoreText,
|
21818 | attr: restoreAttr
|
21819 | };
|
21820 |
|
21821 | function restore(data) {
|
21822 | for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
21823 | var item = data_1[_i];
|
21824 | restoreFns[item.type](item);
|
21825 | }
|
21826 | }
|
21827 |
|
21828 | exports.restore = restore;
|
21829 |
|
21830 | }),
|
21831 |
|
21832 | (function(module, exports, __webpack_require__) {
|
21833 |
|
21834 | module.exports = __webpack_require__(405);
|
21835 |
|
21836 | }),
|
21837 |
|
21838 | (function(module, exports, __webpack_require__) {
|
21839 |
|
21840 | var parent = __webpack_require__(406);
|
21841 |
|
21842 | module.exports = parent;
|
21843 |
|
21844 |
|
21845 | }),
|
21846 |
|
21847 | (function(module, exports, __webpack_require__) {
|
21848 |
|
21849 | __webpack_require__(407);
|
21850 | var path = __webpack_require__(10);
|
21851 |
|
21852 | module.exports = path.Object.entries;
|
21853 |
|
21854 |
|
21855 | }),
|
21856 |
|
21857 | (function(module, exports, __webpack_require__) {
|
21858 |
|
21859 | var $ = __webpack_require__(4);
|
21860 | var $entries = __webpack_require__(408).entries;
|
21861 |
|
21862 |
|
21863 |
|
21864 | $({ target: 'Object', stat: true }, {
|
21865 | entries: function entries(O) {
|
21866 | return $entries(O);
|
21867 | }
|
21868 | });
|
21869 |
|
21870 |
|
21871 | }),
|
21872 |
|
21873 | (function(module, exports, __webpack_require__) {
|
21874 |
|
21875 | var DESCRIPTORS = __webpack_require__(14);
|
21876 | var objectKeys = __webpack_require__(57);
|
21877 | var toIndexedObject = __webpack_require__(27);
|
21878 | var propertyIsEnumerable = __webpack_require__(55).f;
|
21879 |
|
21880 |
|
21881 | var createMethod = function (TO_ENTRIES) {
|
21882 | return function (it) {
|
21883 | var O = toIndexedObject(it);
|
21884 | var keys = objectKeys(O);
|
21885 | var length = keys.length;
|
21886 | var i = 0;
|
21887 | var result = [];
|
21888 | var key;
|
21889 | while (length > i) {
|
21890 | key = keys[i++];
|
21891 | if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {
|
21892 | result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
|
21893 | }
|
21894 | }
|
21895 | return result;
|
21896 | };
|
21897 | };
|
21898 |
|
21899 | module.exports = {
|
21900 |
|
21901 |
|
21902 | entries: createMethod(true),
|
21903 |
|
21904 |
|
21905 | values: createMethod(false)
|
21906 | };
|
21907 |
|
21908 |
|
21909 | }),
|
21910 |
|
21911 | (function(module, exports, __webpack_require__) {
|
21912 |
|
21913 | "use strict";
|
21914 |
|
21915 |
|
21916 | var _interopRequireDefault = __webpack_require__(0);
|
21917 |
|
21918 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
21919 |
|
21920 | (0, _defineProperty["default"])(exports, "__esModule", {
|
21921 | value: true
|
21922 | });
|
21923 |
|
21924 | var chain_1 = __webpack_require__(410);
|
21925 |
|
21926 | var HtmlCache =
|
21927 |
|
21928 | function () {
|
21929 | function HtmlCache(editor) {
|
21930 | this.editor = editor;
|
21931 | this.data = new chain_1.TailChain();
|
21932 | }
|
21933 | |
21934 |
|
21935 |
|
21936 |
|
21937 |
|
21938 | HtmlCache.prototype.observe = function () {
|
21939 | this.data.resetMax(this.editor.config.historyMaxSize);
|
21940 |
|
21941 | this.data.insertLast(this.editor.$textElem.html());
|
21942 | };
|
21943 | |
21944 |
|
21945 |
|
21946 |
|
21947 |
|
21948 | HtmlCache.prototype.save = function () {
|
21949 | this.data.insertLast(this.editor.$textElem.html());
|
21950 | return this;
|
21951 | };
|
21952 | |
21953 |
|
21954 |
|
21955 |
|
21956 |
|
21957 | HtmlCache.prototype.revoke = function () {
|
21958 | var data = this.data.prev();
|
21959 |
|
21960 | if (data) {
|
21961 | this.editor.$textElem.html(data);
|
21962 | return true;
|
21963 | }
|
21964 |
|
21965 | return false;
|
21966 | };
|
21967 | |
21968 |
|
21969 |
|
21970 |
|
21971 |
|
21972 | HtmlCache.prototype.restore = function () {
|
21973 | var data = this.data.next();
|
21974 |
|
21975 | if (data) {
|
21976 | this.editor.$textElem.html(data);
|
21977 | return true;
|
21978 | }
|
21979 |
|
21980 | return false;
|
21981 | };
|
21982 |
|
21983 | return HtmlCache;
|
21984 | }();
|
21985 |
|
21986 | exports["default"] = HtmlCache;
|
21987 |
|
21988 | }),
|
21989 |
|
21990 | (function(module, exports, __webpack_require__) {
|
21991 |
|
21992 | "use strict";
|
21993 |
|
21994 |
|
21995 |
|
21996 |
|
21997 |
|
21998 |
|
21999 | var _interopRequireDefault = __webpack_require__(0);
|
22000 |
|
22001 | var _splice = _interopRequireDefault(__webpack_require__(90));
|
22002 |
|
22003 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
22004 |
|
22005 | (0, _defineProperty["default"])(exports, "__esModule", {
|
22006 | value: true
|
22007 | });
|
22008 | exports.TailChain = void 0;
|
22009 |
|
22010 |
|
22011 |
|
22012 |
|
22013 | var TailChain =
|
22014 |
|
22015 | function () {
|
22016 | function TailChain() {
|
22017 | |
22018 |
|
22019 |
|
22020 | this.data = [];
|
22021 | |
22022 |
|
22023 |
|
22024 |
|
22025 | this.max = 0;
|
22026 | |
22027 |
|
22028 |
|
22029 |
|
22030 | this.point = 0;
|
22031 |
|
22032 | this.isRe = false;
|
22033 | }
|
22034 | |
22035 |
|
22036 |
|
22037 |
|
22038 |
|
22039 | TailChain.prototype.resetMax = function (maxSize) {
|
22040 | maxSize = Math.abs(maxSize);
|
22041 | maxSize && (this.max = maxSize);
|
22042 | };
|
22043 |
|
22044 | (0, _defineProperty["default"])(TailChain.prototype, "size", {
|
22045 | |
22046 |
|
22047 |
|
22048 | get: function get() {
|
22049 | return this.data.length;
|
22050 | },
|
22051 | enumerable: false,
|
22052 | configurable: true
|
22053 | });
|
22054 | |
22055 |
|
22056 |
|
22057 |
|
22058 |
|
22059 | TailChain.prototype.insertLast = function (data) {
|
22060 |
|
22061 | if (this.isRe) {
|
22062 | var _context;
|
22063 |
|
22064 | (0, _splice["default"])(_context = this.data).call(_context, this.point + 1);
|
22065 | this.isRe = false;
|
22066 | }
|
22067 |
|
22068 | this.data.push(data);
|
22069 |
|
22070 | while (this.max && this.size > this.max) {
|
22071 | this.data.shift();
|
22072 | }
|
22073 |
|
22074 |
|
22075 | this.point = this.size - 1;
|
22076 | return this;
|
22077 | };
|
22078 | |
22079 |
|
22080 |
|
22081 |
|
22082 |
|
22083 | TailChain.prototype.current = function () {
|
22084 | return this.data[this.point];
|
22085 | };
|
22086 | |
22087 |
|
22088 |
|
22089 |
|
22090 |
|
22091 | TailChain.prototype.prev = function () {
|
22092 | !this.isRe && (this.isRe = true);
|
22093 | this.point--;
|
22094 |
|
22095 | if (this.point < 0) {
|
22096 | this.point = 0;
|
22097 | return undefined;
|
22098 | }
|
22099 |
|
22100 | return this.current();
|
22101 | };
|
22102 | |
22103 |
|
22104 |
|
22105 |
|
22106 |
|
22107 | TailChain.prototype.next = function () {
|
22108 | !this.isRe && (this.isRe = true);
|
22109 | this.point++;
|
22110 |
|
22111 | if (this.point >= this.size) {
|
22112 | this.point = this.size - 1;
|
22113 | return undefined;
|
22114 | }
|
22115 |
|
22116 | return this.current();
|
22117 | };
|
22118 |
|
22119 | return TailChain;
|
22120 | }();
|
22121 |
|
22122 | exports.TailChain = TailChain;
|
22123 |
|
22124 | }),
|
22125 |
|
22126 | (function(module, exports, __webpack_require__) {
|
22127 |
|
22128 | "use strict";
|
22129 |
|
22130 |
|
22131 |
|
22132 |
|
22133 |
|
22134 |
|
22135 | var _interopRequireDefault = __webpack_require__(0);
|
22136 |
|
22137 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
22138 |
|
22139 | var _create = _interopRequireDefault(__webpack_require__(3));
|
22140 |
|
22141 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
22142 |
|
22143 | var __extends = void 0 && (void 0).__extends || function () {
|
22144 | var _extendStatics = function extendStatics(d, b) {
|
22145 | _extendStatics = _setPrototypeOf["default"] || {
|
22146 | __proto__: []
|
22147 | } instanceof Array && function (d, b) {
|
22148 | d.__proto__ = b;
|
22149 | } || function (d, b) {
|
22150 | for (var p in b) {
|
22151 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
22152 | }
|
22153 | };
|
22154 |
|
22155 | return _extendStatics(d, b);
|
22156 | };
|
22157 |
|
22158 | return function (d, b) {
|
22159 | _extendStatics(d, b);
|
22160 |
|
22161 | function __() {
|
22162 | this.constructor = d;
|
22163 | }
|
22164 |
|
22165 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
22166 | };
|
22167 | }();
|
22168 |
|
22169 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
22170 | return mod && mod.__esModule ? mod : {
|
22171 | "default": mod
|
22172 | };
|
22173 | };
|
22174 |
|
22175 | (0, _defineProperty["default"])(exports, "__esModule", {
|
22176 | value: true
|
22177 | });
|
22178 |
|
22179 | var cache_1 = __importDefault(__webpack_require__(99));
|
22180 |
|
22181 | var ScrollCache =
|
22182 |
|
22183 | function (_super) {
|
22184 | __extends(ScrollCache, _super);
|
22185 |
|
22186 | function ScrollCache(editor) {
|
22187 | var _this = _super.call(this, editor.config.historyMaxSize) || this;
|
22188 |
|
22189 | _this.editor = editor;
|
22190 | |
22191 |
|
22192 |
|
22193 |
|
22194 | _this.last = 0;
|
22195 | _this.target = editor.$textElem.elems[0];
|
22196 | return _this;
|
22197 | }
|
22198 | |
22199 |
|
22200 |
|
22201 |
|
22202 |
|
22203 | ScrollCache.prototype.observe = function () {
|
22204 | var _this = this;
|
22205 |
|
22206 | this.target = this.editor.$textElem.elems[0];
|
22207 | this.editor.$textElem.on('scroll', function () {
|
22208 | _this.last = _this.target.scrollTop;
|
22209 | });
|
22210 | this.resetMaxSize(this.editor.config.historyMaxSize);
|
22211 | };
|
22212 | |
22213 |
|
22214 |
|
22215 |
|
22216 |
|
22217 | ScrollCache.prototype.save = function () {
|
22218 | _super.prototype.save.call(this, [this.last, this.target.scrollTop]);
|
22219 |
|
22220 | return this;
|
22221 | };
|
22222 | |
22223 |
|
22224 |
|
22225 |
|
22226 |
|
22227 | ScrollCache.prototype.revoke = function () {
|
22228 | var _this = this;
|
22229 |
|
22230 | return _super.prototype.revoke.call(this, function (data) {
|
22231 | _this.target.scrollTop = data[0];
|
22232 | });
|
22233 | };
|
22234 | |
22235 |
|
22236 |
|
22237 |
|
22238 |
|
22239 | ScrollCache.prototype.restore = function () {
|
22240 | var _this = this;
|
22241 |
|
22242 | return _super.prototype.restore.call(this, function (data) {
|
22243 | _this.target.scrollTop = data[1];
|
22244 | });
|
22245 | };
|
22246 |
|
22247 | return ScrollCache;
|
22248 | }(cache_1["default"]);
|
22249 |
|
22250 | exports["default"] = ScrollCache;
|
22251 |
|
22252 | }),
|
22253 |
|
22254 | (function(module, exports, __webpack_require__) {
|
22255 |
|
22256 | "use strict";
|
22257 |
|
22258 |
|
22259 |
|
22260 |
|
22261 |
|
22262 |
|
22263 | var _interopRequireDefault = __webpack_require__(0);
|
22264 |
|
22265 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
22266 |
|
22267 | var _create = _interopRequireDefault(__webpack_require__(3));
|
22268 |
|
22269 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(6));
|
22270 |
|
22271 | var __extends = void 0 && (void 0).__extends || function () {
|
22272 | var _extendStatics = function extendStatics(d, b) {
|
22273 | _extendStatics = _setPrototypeOf["default"] || {
|
22274 | __proto__: []
|
22275 | } instanceof Array && function (d, b) {
|
22276 | d.__proto__ = b;
|
22277 | } || function (d, b) {
|
22278 | for (var p in b) {
|
22279 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
22280 | }
|
22281 | };
|
22282 |
|
22283 | return _extendStatics(d, b);
|
22284 | };
|
22285 |
|
22286 | return function (d, b) {
|
22287 | _extendStatics(d, b);
|
22288 |
|
22289 | function __() {
|
22290 | this.constructor = d;
|
22291 | }
|
22292 |
|
22293 | d.prototype = b === null ? (0, _create["default"])(b) : (__.prototype = b.prototype, new __());
|
22294 | };
|
22295 | }();
|
22296 |
|
22297 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
22298 | return mod && mod.__esModule ? mod : {
|
22299 | "default": mod
|
22300 | };
|
22301 | };
|
22302 |
|
22303 | (0, _defineProperty["default"])(exports, "__esModule", {
|
22304 | value: true
|
22305 | });
|
22306 |
|
22307 | var cache_1 = __importDefault(__webpack_require__(99));
|
22308 |
|
22309 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
22310 |
|
22311 | var util_1 = __webpack_require__(7);
|
22312 |
|
22313 |
|
22314 |
|
22315 |
|
22316 |
|
22317 |
|
22318 | function rangeToObject(range) {
|
22319 | return {
|
22320 | start: [range.startContainer, range.startOffset],
|
22321 | end: [range.endContainer, range.endOffset],
|
22322 | root: range.commonAncestorContainer,
|
22323 | collapsed: range.collapsed
|
22324 | };
|
22325 | }
|
22326 |
|
22327 |
|
22328 |
|
22329 |
|
22330 |
|
22331 | var RangeCache =
|
22332 |
|
22333 | function (_super) {
|
22334 | __extends(RangeCache, _super);
|
22335 |
|
22336 | function RangeCache(editor) {
|
22337 | var _this = _super.call(this, editor.config.historyMaxSize) || this;
|
22338 |
|
22339 | _this.editor = editor;
|
22340 | _this.lastRange = rangeToObject(document.createRange());
|
22341 | _this.root = editor.$textElem.elems[0];
|
22342 | _this.updateLastRange = util_1.debounce(function () {
|
22343 | _this.lastRange = rangeToObject(_this.rangeHandle);
|
22344 | }, editor.config.onchangeTimeout);
|
22345 | return _this;
|
22346 | }
|
22347 |
|
22348 | (0, _defineProperty["default"])(RangeCache.prototype, "rangeHandle", {
|
22349 | |
22350 |
|
22351 |
|
22352 | get: function get() {
|
22353 | var selection = document.getSelection();
|
22354 | return selection && selection.rangeCount ? selection.getRangeAt(0) : document.createRange();
|
22355 | },
|
22356 | enumerable: false,
|
22357 | configurable: true
|
22358 | });
|
22359 | |
22360 |
|
22361 |
|
22362 |
|
22363 | RangeCache.prototype.observe = function () {
|
22364 | var self = this;
|
22365 |
|
22366 | this.root = this.editor.$textElem.elems[0];
|
22367 | this.resetMaxSize(this.editor.config.historyMaxSize);
|
22368 |
|
22369 | function selectionchange() {
|
22370 | var handle = self.rangeHandle;
|
22371 |
|
22372 | if (self.root === handle.commonAncestorContainer || self.root.contains(handle.commonAncestorContainer)) {
|
22373 |
|
22374 | if (!self.editor.isComposing) {
|
22375 | self.updateLastRange();
|
22376 | }
|
22377 | }
|
22378 | }
|
22379 |
|
22380 |
|
22381 | function deletecallback(e) {
|
22382 | if (e.key == 'Backspace' || e.key == 'Delete') {
|
22383 |
|
22384 | self.updateLastRange();
|
22385 | }
|
22386 | }
|
22387 |
|
22388 |
|
22389 | dom_core_1["default"](document).on('selectionchange', selectionchange);
|
22390 |
|
22391 | this.editor.beforeDestroy(function () {
|
22392 | dom_core_1["default"](document).off('selectionchange', selectionchange);
|
22393 | });
|
22394 |
|
22395 | self.editor.$textElem.on('keydown', deletecallback);
|
22396 | };
|
22397 | |
22398 |
|
22399 |
|
22400 |
|
22401 |
|
22402 | RangeCache.prototype.save = function () {
|
22403 | var current = rangeToObject(this.rangeHandle);
|
22404 |
|
22405 | _super.prototype.save.call(this, [this.lastRange, current]);
|
22406 |
|
22407 | this.lastRange = current;
|
22408 | return this;
|
22409 | };
|
22410 | |
22411 |
|
22412 |
|
22413 |
|
22414 |
|
22415 |
|
22416 | RangeCache.prototype.set = function (range) {
|
22417 | if (range) {
|
22418 | var handle = this.rangeHandle;
|
22419 | handle.setStart.apply(handle, range.start);
|
22420 | handle.setEnd.apply(handle, range.end);
|
22421 | this.editor.menus.changeActive();
|
22422 | return true;
|
22423 | }
|
22424 |
|
22425 | return false;
|
22426 | };
|
22427 | |
22428 |
|
22429 |
|
22430 |
|
22431 |
|
22432 | RangeCache.prototype.revoke = function () {
|
22433 | var _this = this;
|
22434 |
|
22435 | return _super.prototype.revoke.call(this, function (data) {
|
22436 | _this.set(data[0]);
|
22437 | });
|
22438 | };
|
22439 | |
22440 |
|
22441 |
|
22442 |
|
22443 |
|
22444 | RangeCache.prototype.restore = function () {
|
22445 | var _this = this;
|
22446 |
|
22447 | return _super.prototype.restore.call(this, function (data) {
|
22448 | _this.set(data[1]);
|
22449 | });
|
22450 | };
|
22451 |
|
22452 | return RangeCache;
|
22453 | }(cache_1["default"]);
|
22454 |
|
22455 | exports["default"] = RangeCache;
|
22456 |
|
22457 | }),
|
22458 |
|
22459 | (function(module, exports, __webpack_require__) {
|
22460 |
|
22461 | "use strict";
|
22462 |
|
22463 |
|
22464 | var _interopRequireDefault = __webpack_require__(0);
|
22465 |
|
22466 | var _find = _interopRequireDefault(__webpack_require__(30));
|
22467 |
|
22468 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
22469 |
|
22470 | var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
22471 | return mod && mod.__esModule ? mod : {
|
22472 | "default": mod
|
22473 | };
|
22474 | };
|
22475 |
|
22476 | (0, _defineProperty["default"])(exports, "__esModule", {
|
22477 | value: true
|
22478 | });
|
22479 |
|
22480 | var dom_core_1 = __importDefault(__webpack_require__(2));
|
22481 |
|
22482 | __webpack_require__(414);
|
22483 |
|
22484 | function disableInit(editor) {
|
22485 | var isCurtain = false;
|
22486 |
|
22487 | var $contentDom;
|
22488 | var $menuDom;
|
22489 |
|
22490 | editor.txt.eventHooks.changeEvents.push(function () {
|
22491 | if (isCurtain) {
|
22492 | (0, _find["default"])($contentDom).call($contentDom, '.w-e-content-preview').html(editor.$textElem.html());
|
22493 | }
|
22494 | });
|
22495 |
|
22496 | function disable() {
|
22497 | if (isCurtain) return;
|
22498 |
|
22499 | editor.$textElem.hide();
|
22500 |
|
22501 | var textContainerZindexValue = editor.zIndex.get('textContainer');
|
22502 | var content = editor.txt.html();
|
22503 | $contentDom = dom_core_1["default"]("<div class=\"w-e-content-mantle\" style=\"z-index:" + textContainerZindexValue + "\">\n <div class=\"w-e-content-preview w-e-text\">" + content + "</div>\n </div>");
|
22504 | editor.$textContainerElem.append($contentDom);
|
22505 |
|
22506 | var menuZindexValue = editor.zIndex.get('menu');
|
22507 | $menuDom = dom_core_1["default"]("<div class=\"w-e-menue-mantle\" style=\"z-index:" + menuZindexValue + "\"></div>");
|
22508 | editor.$toolbarElem.append($menuDom);
|
22509 | isCurtain = true;
|
22510 | }
|
22511 |
|
22512 |
|
22513 | function enable() {
|
22514 | if (!isCurtain) return;
|
22515 | $contentDom.remove();
|
22516 | $menuDom.remove();
|
22517 | editor.$textElem.show();
|
22518 | isCurtain = false;
|
22519 | }
|
22520 |
|
22521 | return {
|
22522 | disable: disable,
|
22523 | enable: enable
|
22524 | };
|
22525 | }
|
22526 |
|
22527 | exports["default"] = disableInit;
|
22528 |
|
22529 | }),
|
22530 |
|
22531 | (function(module, exports, __webpack_require__) {
|
22532 |
|
22533 | var api = __webpack_require__(20);
|
22534 | var content = __webpack_require__(415);
|
22535 |
|
22536 | content = content.__esModule ? content.default : content;
|
22537 |
|
22538 | if (typeof content === 'string') {
|
22539 | content = [[module.i, content, '']];
|
22540 | }
|
22541 |
|
22542 | var options = {};
|
22543 |
|
22544 | options.insert = "head";
|
22545 | options.singleton = false;
|
22546 |
|
22547 | var update = api(content, options);
|
22548 |
|
22549 |
|
22550 |
|
22551 | module.exports = content.locals || {};
|
22552 |
|
22553 | }),
|
22554 |
|
22555 | (function(module, exports, __webpack_require__) {
|
22556 |
|
22557 |
|
22558 | var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(21);
|
22559 | exports = ___CSS_LOADER_API_IMPORT___(false);
|
22560 |
|
22561 | exports.push([module.i, ".w-e-content-mantle {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n}\n.w-e-content-mantle .w-e-content-preview {\n width: 100%;\n min-height: 100%;\n padding: 0 10px;\n line-height: 1.5;\n}\n.w-e-content-mantle .w-e-content-preview img {\n cursor: default;\n}\n.w-e-content-mantle .w-e-content-preview img:hover {\n box-shadow: none;\n}\n.w-e-menue-mantle {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n}\n", ""]);
|
22562 |
|
22563 | module.exports = exports;
|
22564 |
|
22565 |
|
22566 | }),
|
22567 |
|
22568 | (function(module, exports, __webpack_require__) {
|
22569 |
|
22570 | "use strict";
|
22571 |
|
22572 |
|
22573 | var _interopRequireDefault = __webpack_require__(0);
|
22574 |
|
22575 | var _defineProperty = _interopRequireDefault(__webpack_require__(1));
|
22576 |
|
22577 | (0, _defineProperty["default"])(exports, "__esModule", {
|
22578 | value: true
|
22579 | });
|
22580 |
|
22581 | })
|
22582 | ])["default"];
|
22583 | });
|
22584 |
|
\ | No newline at end of file |