@evolvere/sgp-ui 1.6.9 → 1.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/lib/alert.js +2 -2
  2. package/lib/aside.js +2 -2
  3. package/lib/autocomplete.js +4 -4
  4. package/lib/avatar.js +2 -2
  5. package/lib/backtop.js +4 -4
  6. package/lib/badge.js +2 -2
  7. package/lib/breadcrumb-item.js +2 -2
  8. package/lib/breadcrumb.js +2 -2
  9. package/lib/button-group.js +2 -2
  10. package/lib/button.js +2 -2
  11. package/lib/calendar.js +6 -6
  12. package/lib/card.js +2 -2
  13. package/lib/carousel-item.js +2 -2
  14. package/lib/carousel.js +4 -4
  15. package/lib/cascader-panel.js +12 -12
  16. package/lib/cascader.js +13 -13
  17. package/lib/checkbox-button.js +9 -9
  18. package/lib/checkbox-group.js +9 -9
  19. package/lib/checkbox.js +2 -2
  20. package/lib/col.js +2 -2
  21. package/lib/collapse-item.js +7 -7
  22. package/lib/collapse.js +2 -2
  23. package/lib/color-picker.js +2 -2
  24. package/lib/container.js +2 -2
  25. package/lib/date-picker.js +10 -10
  26. package/lib/descriptions-item.js +2 -2
  27. package/lib/descriptions.js +2 -2
  28. package/lib/dialog.js +2 -2
  29. package/lib/divider.js +2 -2
  30. package/lib/drawer.js +2 -2
  31. package/lib/dropdown-item.js +2 -2
  32. package/lib/dropdown-menu.js +2 -2
  33. package/lib/dropdown.js +4 -4
  34. package/lib/editor.js +258 -32
  35. package/lib/empty.js +2 -2
  36. package/lib/footer.js +2 -2
  37. package/lib/form-item.js +4 -4
  38. package/lib/form.js +2 -2
  39. package/lib/header.js +2 -2
  40. package/lib/icon.js +2 -2
  41. package/lib/image.js +4 -4
  42. package/lib/index.js +1 -1
  43. package/lib/infinite-scroll.js +2 -2
  44. package/lib/input-number.js +6 -6
  45. package/lib/input.js +4 -4
  46. package/lib/link.js +2 -2
  47. package/lib/loading.js +4 -4
  48. package/lib/main.js +2 -2
  49. package/lib/menu-item-group.js +2 -2
  50. package/lib/menu-item.js +6 -6
  51. package/lib/menu.js +2 -2
  52. package/lib/message-box.js +6 -6
  53. package/lib/message.js +4 -4
  54. package/lib/notification.js +4 -4
  55. package/lib/option-group.js +2 -2
  56. package/lib/option.js +4 -4
  57. package/lib/page-header.js +2 -2
  58. package/lib/pagination.js +6 -6
  59. package/lib/popconfirm.js +4 -4
  60. package/lib/popover.js +2 -2
  61. package/lib/progress.js +2 -2
  62. package/lib/radio-button.js +2 -2
  63. package/lib/radio-group.js +2 -2
  64. package/lib/radio.js +2 -2
  65. package/lib/rate.js +2 -2
  66. package/lib/rdc-sgp-ui.common.js +321 -97
  67. package/lib/result.js +2 -2
  68. package/lib/row.js +2 -2
  69. package/lib/scrollbar.js +4 -4
  70. package/lib/select.js +15 -15
  71. package/lib/skeleton-item.js +2 -2
  72. package/lib/skeleton.js +2 -2
  73. package/lib/slider.js +6 -6
  74. package/lib/spinner.js +2 -2
  75. package/lib/step.js +2 -2
  76. package/lib/steps.js +2 -2
  77. package/lib/submenu.js +6 -6
  78. package/lib/switch.js +4 -4
  79. package/lib/tab-pane.js +2 -2
  80. package/lib/table-column.js +2 -2
  81. package/lib/table.js +19 -17
  82. package/lib/tabs.js +2 -2
  83. package/lib/tag.js +2 -2
  84. package/lib/time-picker.js +11 -11
  85. package/lib/time-select.js +6 -6
  86. package/lib/timeline-item.js +2 -2
  87. package/lib/timeline.js +2 -2
  88. package/lib/tooltip.js +2 -2
  89. package/lib/transfer.js +4 -4
  90. package/lib/tree.js +7 -7
  91. package/lib/upload.js +10 -10
  92. package/package.json +3 -1
  93. package/packages/editor/src/html-security.js +180 -0
  94. package/packages/editor/src/index.vue +68 -15
  95. package/packages/editor/src/video-security.js +1 -0
  96. package/packages/theme-chalk/package.json +1 -1
  97. package/src/index.js +1 -1
package/lib/editor.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 135);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 137);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,14 +192,14 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 135:
195
+ /***/ 137:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
199
199
  // ESM COMPAT FLAG
200
200
  __webpack_require__.r(__webpack_exports__);
201
201
 
202
- // CONCATENATED MODULE: ./node_modules/_vue-loader@15.10.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/editor/src/index.vue?vue&type=template&id=a1662642&scoped=true&
202
+ // CONCATENATED MODULE: ./node_modules/_vue-loader@15.10.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/editor/src/index.vue?vue&type=template&id=492dadf0&scoped=true&
203
203
  var render = function () {
204
204
  var _vm = this
205
205
  var _h = _vm.$createElement
@@ -210,10 +210,10 @@ var staticRenderFns = []
210
210
  render._withStripped = true
211
211
 
212
212
 
213
- // CONCATENATED MODULE: ./packages/editor/src/index.vue?vue&type=template&id=a1662642&scoped=true&
213
+ // CONCATENATED MODULE: ./packages/editor/src/index.vue?vue&type=template&id=492dadf0&scoped=true&
214
214
 
215
215
  // EXTERNAL MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/editor/src/index.vue?vue&type=script&lang=js&
216
- var srcvue_type_script_lang_js_ = __webpack_require__(44);
216
+ var srcvue_type_script_lang_js_ = __webpack_require__(45);
217
217
 
218
218
  // CONCATENATED MODULE: ./packages/editor/src/index.vue?vue&type=script&lang=js&
219
219
  /* harmony default export */ var editor_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_["a" /* default */]);
@@ -234,7 +234,7 @@ var component = Object(componentNormalizer["a" /* default */])(
234
234
  staticRenderFns,
235
235
  false,
236
236
  null,
237
- "a1662642",
237
+ "492dadf0",
238
238
  null
239
239
 
240
240
  )
@@ -252,7 +252,7 @@ src.install = function (Vue) {
252
252
 
253
253
  /***/ }),
254
254
 
255
- /***/ 142:
255
+ /***/ 144:
256
256
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
257
257
 
258
258
  "use strict";
@@ -500,11 +500,189 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
500
500
 
501
501
  /***/ }),
502
502
 
503
- /***/ 44:
503
+ /***/ 22:
504
504
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
505
505
 
506
506
  "use strict";
507
- /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _video_security__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
507
+ /* unused harmony export MAX_EDITOR_HTML_LENGTH */
508
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_IMAGE_SIZE; });
509
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MAX_IMAGE_COUNT; });
510
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isSafeLink; });
511
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isSafeMediaSource; });
512
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return sanitizeEditorHtml; });
513
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return validateImageFiles; });
514
+ /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49);
515
+ /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_0__);
516
+
517
+
518
+ var MAX_EDITOR_HTML_LENGTH = 1024 * 1024;
519
+ var MAX_IMAGE_SIZE = 5 * 1024 * 1024;
520
+ var MAX_IMAGE_COUNT = 10;
521
+
522
+ var SAFE_PROTOCOLS = ['http:', 'https:'];
523
+ var SAFE_LINK_PROTOCOLS = SAFE_PROTOCOLS.concat(['mailto:', 'tel:']);
524
+ var SAFE_URI_PATTERN = /^(?:(?:https?|mailto|tel):|(?:\.{0,2}\/|#))/i;
525
+
526
+ var PURIFY_OPTIONS = {
527
+ ALLOWED_TAGS: ['a', 'b', 'blockquote', 'br', 'code', 'del', 'div', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'iframe', 'img', 'li', 'ol', 'p', 'pre', 's', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'u', 'ul', 'video', 'source'],
528
+ ALLOWED_ATTR: ['allow', 'allowfullscreen', 'alt', 'colspan', 'controls', 'frameborder', 'height', 'href', 'loading', 'loop', 'muted', 'playsinline', 'poster', 'preload', 'referrerpolicy', 'rel', 'rowspan', 'sandbox', 'src', 'style', 'target', 'title', 'webkitallowfullscreen', 'width'],
529
+ // These attributes carry fixed policy tokens rather than URLs. DOMPurify
530
+ // otherwise applies its URI value check and removes the security settings.
531
+ ADD_URI_SAFE_ATTR: ['loading', 'referrerpolicy', 'rel', 'sandbox', 'target'],
532
+ ALLOW_ARIA_ATTR: false,
533
+ ALLOW_DATA_ATTR: false,
534
+ ALLOW_UNKNOWN_PROTOCOLS: false,
535
+ ALLOWED_URI_REGEXP: SAFE_URI_PATTERN,
536
+ FORBID_TAGS: ['base', 'button', 'embed', 'form', 'input', 'link', 'math', 'meta', 'noscript', 'object', 'option', 'script', 'select', 'style', 'svg', 'template', 'textarea'],
537
+ FORBID_ATTR: ['formaction', 'id', 'name', 'srcdoc', 'xlink:href'],
538
+ KEEP_CONTENT: true,
539
+ RETURN_TRUSTED_TYPE: false,
540
+ SANITIZE_DOM: true,
541
+ SANITIZE_NAMED_PROPS: true
542
+ };
543
+
544
+ var COLOR_VALUE = /^(?:#[0-9a-f]{3,8}|[a-z]{1,20}|rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\))$/i;
545
+ var LENGTH_VALUE = /^\d+(?:\.\d+)?(?:px|em|rem|%)?$/i;
546
+ var FONT_FAMILY_VALUE = /^[a-z0-9\u4e00-\u9fff ,'-]{1,120}$/i;
547
+
548
+ var SAFE_STYLE_RULES = {
549
+ 'background-color': COLOR_VALUE,
550
+ color: COLOR_VALUE,
551
+ 'font-family': FONT_FAMILY_VALUE,
552
+ 'font-size': LENGTH_VALUE,
553
+ 'font-style': /^(?:normal|italic|oblique)$/i,
554
+ 'font-weight': /^(?:normal|bold|bolder|lighter|[1-9]00)$/i,
555
+ 'line-height': LENGTH_VALUE,
556
+ 'list-style-type': /^(?:disc|circle|square|decimal|lower-alpha|upper-alpha|lower-roman|upper-roman|none)$/i,
557
+ 'margin-left': LENGTH_VALUE,
558
+ 'max-width': LENGTH_VALUE,
559
+ 'padding-left': LENGTH_VALUE,
560
+ 'text-align': /^(?:left|right|center|justify)$/i,
561
+ 'text-decoration': /^(?:none|underline|line-through)(?:\s+(?:underline|line-through))*$/i,
562
+ 'text-indent': LENGTH_VALUE,
563
+ 'vertical-align': /^(?:baseline|sub|super|top|text-top|middle|bottom|text-bottom)$/i,
564
+ 'white-space': /^(?:normal|nowrap|pre|pre-wrap|pre-line)$/i
565
+ };
566
+
567
+ function parseUrl(value) {
568
+ var url = (value || '').trim();
569
+ if (!url || /[\u0000-\u001f\u007f]/.test(url)) return null;
570
+
571
+ var parser = document.createElement('a');
572
+ parser.href = url;
573
+ return parser;
574
+ }
575
+
576
+ function hasSafeProtocol(value, protocols) {
577
+ var parser = parseUrl(value);
578
+ return !!parser && protocols.indexOf(parser.protocol.toLowerCase()) !== -1;
579
+ }
580
+
581
+ function isSafeLink(link) {
582
+ return hasSafeProtocol(link, SAFE_LINK_PROTOCOLS);
583
+ }
584
+
585
+ function isSafeMediaSource(source) {
586
+ return hasSafeProtocol(source, SAFE_PROTOCOLS);
587
+ }
588
+
589
+ function sanitizeStyle(styleText) {
590
+ if (!styleText || styleText.length > 500 || /[\\<>{}]|url\s*\(|expression\s*\(|@import|javascript\s*:|data\s*:|-moz-binding|behavior\s*:/i.test(styleText)) {
591
+ return '';
592
+ }
593
+
594
+ return styleText.split(';').reduce(function (rules, declaration) {
595
+ var separator = declaration.indexOf(':');
596
+ if (separator === -1) return rules;
597
+
598
+ var property = declaration.slice(0, separator).trim().toLowerCase();
599
+ var value = declaration.slice(separator + 1).trim();
600
+ var rule = SAFE_STYLE_RULES[property];
601
+ if (rule && rule.test(value)) rules.push(property + ': ' + value);
602
+ return rules;
603
+ }, []).join('; ');
604
+ }
605
+
606
+ function normalizeDimension(element, attribute) {
607
+ if (!element.hasAttribute(attribute)) return;
608
+ var value = Number(element.getAttribute(attribute));
609
+ if (!Number.isInteger(value) || value < 1 || value > 10000) {
610
+ element.removeAttribute(attribute);
611
+ }
612
+ }
613
+
614
+ function normalizeRichText(html) {
615
+ var template = document.createElement('template');
616
+ template.innerHTML = html;
617
+ var elements = Array.prototype.slice.call(template.content.querySelectorAll('*'));
618
+
619
+ elements.forEach(function (element) {
620
+ var style = sanitizeStyle(element.getAttribute('style'));
621
+ if (style) element.setAttribute('style', style);else element.removeAttribute('style');
622
+
623
+ normalizeDimension(element, 'width');
624
+ normalizeDimension(element, 'height');
625
+
626
+ if (element.tagName === 'A') {
627
+ if (!isSafeLink(element.getAttribute('href'))) element.removeAttribute('href');
628
+ if (element.getAttribute('target') === '_blank') {
629
+ element.setAttribute('rel', 'noopener noreferrer');
630
+ } else {
631
+ element.removeAttribute('target');
632
+ element.removeAttribute('rel');
633
+ }
634
+ }
635
+
636
+ if (element.tagName === 'IMG') {
637
+ if (!isSafeMediaSource(element.getAttribute('src'))) {
638
+ element.parentNode.removeChild(element);
639
+ return;
640
+ }
641
+ element.setAttribute('loading', 'lazy');
642
+ element.setAttribute('referrerpolicy', 'no-referrer');
643
+ }
644
+
645
+ if (element.tagName === 'IFRAME') {
646
+ if (!isSafeMediaSource(element.getAttribute('src'))) {
647
+ element.parentNode.removeChild(element);
648
+ return;
649
+ }
650
+ element.setAttribute('sandbox', 'allow-scripts allow-presentation allow-popups');
651
+ element.setAttribute('referrerpolicy', 'no-referrer');
652
+ element.setAttribute('loading', 'lazy');
653
+ }
654
+
655
+ if ((element.tagName === 'VIDEO' || element.tagName === 'SOURCE') && !isSafeMediaSource(element.getAttribute('src'))) {
656
+ element.parentNode.removeChild(element);
657
+ }
658
+ });
659
+
660
+ return template.innerHTML;
661
+ }
662
+
663
+ function sanitizeEditorHtml(html) {
664
+ if (typeof html !== 'string' || html.length > MAX_EDITOR_HTML_LENGTH) return '';
665
+
666
+ var sanitized = dompurify__WEBPACK_IMPORTED_MODULE_0___default.a.sanitize(html, PURIFY_OPTIONS);
667
+ var normalized = normalizeRichText(sanitized);
668
+ return dompurify__WEBPACK_IMPORTED_MODULE_0___default.a.sanitize(normalized, PURIFY_OPTIONS);
669
+ }
670
+
671
+ function validateImageFiles(files) {
672
+ if (!files || files.length < 1 || files.length > MAX_IMAGE_COUNT) return false;
673
+ return Array.prototype.every.call(files, function (file) {
674
+ return !!file && file.size > 0 && file.size <= MAX_IMAGE_SIZE && /^(?:image\/jpeg|image\/png|image\/gif)$/i.test(file.type || '');
675
+ });
676
+ }
677
+
678
+ /***/ }),
679
+
680
+ /***/ 45:
681
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
682
+
683
+ "use strict";
684
+ /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _html_security__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
685
+ /* harmony import */ var _video_security__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59);
508
686
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
509
687
 
510
688
  //
@@ -514,13 +692,14 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
514
692
 
515
693
 
516
694
 
517
- var signIsEditorChange = true;
695
+
518
696
  /* harmony default export */ __webpack_exports__["a"] = ({
519
697
  name: 'ElEditor',
520
698
  data: function data() {
521
699
  return {
522
700
  editor: null,
523
- editorData: ''
701
+ editorData: '',
702
+ isEditorChange: true
524
703
  };
525
704
  },
526
705
 
@@ -542,11 +721,11 @@ var signIsEditorChange = true;
542
721
  mounted: function mounted() {
543
722
  var _this = this;
544
723
 
545
- var E = __webpack_require__(60);
724
+ var E = __webpack_require__(62);
546
725
  var editor = new E(this.$refs.wangEditor);
547
726
 
548
727
  // 自定义按钮 text-indent
549
- var textIndentDef = __webpack_require__(142);
728
+ var textIndentDef = __webpack_require__(144);
550
729
  var textIndent = textIndentDef.default(E);
551
730
  var textIndentKey = 'textIndent';
552
731
  editor.menus.extend('indent', textIndent);
@@ -561,7 +740,8 @@ var signIsEditorChange = true;
561
740
  editor.config.uploadImgServer = '/apiv2/nfs/file/upload/wangEditor';
562
741
  }
563
742
  editor.config.showLinkImg = false;
564
- editor.config.uploadImgMaxSize = 1000 * 1024 * 1024; // 100M
743
+ editor.config.uploadImgMaxSize = _html_security__WEBPACK_IMPORTED_MODULE_0__[/* MAX_IMAGE_SIZE */ "b"];
744
+ editor.config.uploadImgMaxLength = _html_security__WEBPACK_IMPORTED_MODULE_0__[/* MAX_IMAGE_COUNT */ "a"];
565
745
  editor.config.emotions = [{
566
746
  title: 'emoji',
567
747
  type: 'emoji',
@@ -570,39 +750,72 @@ var signIsEditorChange = true;
570
750
 
571
751
  editor.config = _extends({}, editor.config, this.options);
572
752
 
753
+ var customPasteTextHandle = editor.config.pasteTextHandle;
754
+ var customLinkCheck = editor.config.linkCheck;
755
+ var customLinkImgCheck = editor.config.linkImgCheck;
756
+ var customUploadImgBefore = editor.config.uploadImgHooks && editor.config.uploadImgHooks.before;
757
+
758
+ // Security-sensitive settings cannot be relaxed through component options.
759
+ editor.config.uploadImgServer = '/apiv2/nfs/file/upload/wangEditor';
760
+ editor.config.uploadImgShowBase64 = false;
761
+ editor.config.showLinkImg = false;
762
+ editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif'];
763
+ editor.config.uploadImgMaxSize = _html_security__WEBPACK_IMPORTED_MODULE_0__[/* MAX_IMAGE_SIZE */ "b"];
764
+ editor.config.uploadImgMaxLength = _html_security__WEBPACK_IMPORTED_MODULE_0__[/* MAX_IMAGE_COUNT */ "a"];
765
+ editor.config.withCredentials = true;
766
+ editor.config.pasteTextHandle = function (content) {
767
+ return Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* sanitizeEditorHtml */ "e"])(typeof customPasteTextHandle === 'function' ? customPasteTextHandle(content) : content);
768
+ };
769
+ editor.config.linkCheck = function (text, link) {
770
+ if (!Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* isSafeLink */ "c"])(link)) return '链接地址不安全,仅支持 http、https、mailto 和 tel';
771
+ return typeof customLinkCheck === 'function' ? customLinkCheck(text, link) : true;
772
+ };
773
+ editor.config.linkImgCheck = function (src, alt, href) {
774
+ if (!Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* isSafeMediaSource */ "d"])(src) || href && !Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* isSafeLink */ "c"])(href)) {
775
+ return '图片地址不安全';
776
+ }
777
+ return typeof customLinkImgCheck === 'function' ? customLinkImgCheck(src, alt, href) : true;
778
+ };
779
+ editor.config.uploadImgHooks = _extends({}, editor.config.uploadImgHooks, {
780
+ before: function before(xhr, currentEditor, files) {
781
+ if (!Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* validateImageFiles */ "f"])(files)) {
782
+ return { prevent: true, msg: '仅允许上传 10 张以内、单张不超过 5MB 的 JPG、PNG 或 GIF 图片' };
783
+ }
784
+ return typeof customUploadImgBefore === 'function' ? customUploadImgBefore(xhr, currentEditor, files) : undefined;
785
+ }
786
+ });
787
+
573
788
  // wangEditor 4 inserts online-video markup with insertHTML. Always run the
574
789
  // built-in security check before an optional consumer-provided validator.
575
790
  var customOnlineVideoCheck = editor.config.onlineVideoCheck;
576
791
  editor.config.onlineVideoCheck = function (video) {
577
- var securityCheck = Object(_video_security__WEBPACK_IMPORTED_MODULE_0__[/* validateOnlineVideo */ "a"])(video);
792
+ var securityCheck = Object(_video_security__WEBPACK_IMPORTED_MODULE_1__[/* validateOnlineVideo */ "a"])(video);
578
793
  if (securityCheck !== true) return securityCheck;
579
794
  return typeof customOnlineVideoCheck === 'function' ? customOnlineVideoCheck(video) : true;
580
795
  };
581
796
 
582
797
  editor.config.onchange = function (newHtml) {
583
- // this.editorData = newHtml;
584
- signIsEditorChange = false;
585
- _this.$emit('input', newHtml);
798
+ var safeHtml = Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* sanitizeEditorHtml */ "e"])(newHtml);
799
+ _this.isEditorChange = false;
800
+ _this.$emit('input', safeHtml);
586
801
  _this.$nextTick(function () {
587
- signIsEditorChange = true;
802
+ _this.isEditorChange = true;
588
803
  });
589
- _this.$emit('change', { html: newHtml, text: editor.txt.text(), editor: editor });
804
+ _this.$emit('change', { html: safeHtml, text: editor.txt.text(), editor: editor });
590
805
  };
591
806
 
592
807
  editor.config.onblur = function (newHtml) {
593
- // this.editorData = newHtml;
594
- _this.$emit('blur', { html: newHtml, text: editor.txt.text(), editor: editor });
808
+ _this.$emit('blur', { html: Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* sanitizeEditorHtml */ "e"])(newHtml), text: editor.txt.text(), editor: editor });
595
809
  };
596
810
 
597
811
  editor.config.onfocus = function (newHtml) {
598
- // this.editorData = newHtml;
599
- _this.$emit('focus', { html: newHtml, text: editor.txt.text(), editor: editor });
812
+ _this.$emit('focus', { html: Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* sanitizeEditorHtml */ "e"])(newHtml), text: editor.txt.text(), editor: editor });
600
813
  };
601
814
 
602
815
  editor.create();
603
816
 
604
817
  var initValue = this.value !== undefined && this.value !== null ? this.value : this.content;
605
- editor.txt.html(initValue);
818
+ editor.txt.html(Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* sanitizeEditorHtml */ "e"])(initValue || ''));
606
819
  if (this.disabled) {
607
820
  editor.disable();
608
821
  }
@@ -621,22 +834,35 @@ var signIsEditorChange = true;
621
834
  }
622
835
  },
623
836
  value: function value() {
624
- if (this.editor && signIsEditorChange) {
625
- this.editor.txt.html(this.value);
837
+ if (this.editor && this.isEditorChange) {
838
+ this.editor.txt.html(Object(_html_security__WEBPACK_IMPORTED_MODULE_0__[/* sanitizeEditorHtml */ "e"])(this.value || ''));
626
839
  }
627
840
  }
841
+ },
842
+ beforeDestroy: function beforeDestroy() {
843
+ if (this.editor) {
844
+ this.editor.destroy();
845
+ this.editor = null;
846
+ }
628
847
  }
629
848
  });
630
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(59)))
849
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(61)))
850
+
851
+ /***/ }),
852
+
853
+ /***/ 49:
854
+ /***/ (function(module, exports) {
855
+
856
+ module.exports = require("dompurify");
631
857
 
632
858
  /***/ }),
633
859
 
634
- /***/ 57:
860
+ /***/ 59:
635
861
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
636
862
 
637
863
  "use strict";
638
864
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return validateOnlineVideo; });
639
- var ALLOWED_IFRAME_ATTRIBUTES = ['allow', 'allowfullscreen', 'frameborder', 'height', 'loading', 'mozallowfullscreen', 'referrerpolicy', 'src', 'title', 'webkitallowfullscreen', 'width'];
865
+ var ALLOWED_IFRAME_ATTRIBUTES = ['allow', 'allowfullscreen', 'frameborder', 'height', 'loading', 'mozallowfullscreen', 'referrerpolicy', 'sandbox', 'src', 'title', 'webkitallowfullscreen', 'width'];
640
866
 
641
867
  var INVALID_VIDEO_MESSAGE = '视频代码不安全,仅支持使用 http/https 地址的 iframe';
642
868
 
@@ -683,7 +909,7 @@ function validateOnlineVideo(video) {
683
909
 
684
910
  /***/ }),
685
911
 
686
- /***/ 59:
912
+ /***/ 61:
687
913
  /***/ (function(module, exports) {
688
914
 
689
915
  var g;
@@ -710,7 +936,7 @@ module.exports = g;
710
936
 
711
937
  /***/ }),
712
938
 
713
- /***/ 60:
939
+ /***/ 62:
714
940
  /***/ (function(module, exports) {
715
941
 
716
942
  module.exports = require("wangeditor");
package/lib/empty.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 75);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 77);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -199,7 +199,7 @@ module.exports = require("@evolvere/sgp-ui/lib/locale");
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 75:
202
+ /***/ 77:
203
203
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
204
204
 
205
205
  "use strict";
package/lib/footer.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 126);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 128);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 126:
195
+ /***/ 128:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/form-item.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 76);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 78);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -206,14 +206,14 @@ module.exports = require("@evolvere/sgp-ui/lib/mixins/emitter");
206
206
 
207
207
  /***/ }),
208
208
 
209
- /***/ 52:
209
+ /***/ 54:
210
210
  /***/ (function(module, exports) {
211
211
 
212
212
  module.exports = require("async-validator");
213
213
 
214
214
  /***/ }),
215
215
 
216
- /***/ 76:
216
+ /***/ 78:
217
217
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
218
218
 
219
219
  "use strict";
@@ -325,7 +325,7 @@ render._withStripped = true
325
325
  // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=template&id=15341664&
326
326
 
327
327
  // EXTERNAL MODULE: external "async-validator"
328
- var external_async_validator_ = __webpack_require__(52);
328
+ var external_async_validator_ = __webpack_require__(54);
329
329
  var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
330
330
 
331
331
  // EXTERNAL MODULE: external "@evolvere/sgp-ui/lib/mixins/emitter"
package/lib/form.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 106);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 108);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 106:
195
+ /***/ 108:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/header.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 123);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 125);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 123:
195
+ /***/ 125:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/icon.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 109);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 111);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 109:
195
+ /***/ 111:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/image.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 73);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 75);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -213,7 +213,7 @@ module.exports = require("@evolvere/sgp-ui/lib/utils/dom");
213
213
 
214
214
  /***/ }),
215
215
 
216
- /***/ 26:
216
+ /***/ 27:
217
217
  /***/ (function(module, exports) {
218
218
 
219
219
  module.exports = require("throttle-debounce/throttle");
@@ -234,7 +234,7 @@ module.exports = require("@evolvere/sgp-ui/lib/mixins/locale");
234
234
 
235
235
  /***/ }),
236
236
 
237
- /***/ 73:
237
+ /***/ 75:
238
238
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
239
239
 
240
240
  "use strict";
@@ -836,7 +836,7 @@ var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
836
836
  var types_ = __webpack_require__(17);
837
837
 
838
838
  // EXTERNAL MODULE: external "throttle-debounce/throttle"
839
- var throttle_ = __webpack_require__(26);
839
+ var throttle_ = __webpack_require__(27);
840
840
  var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
841
841
 
842
842
  // CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/image/src/main.vue?vue&type=script&lang=js&