pxx-vue-quill 1.0.89 → 1.0.91

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.
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2025 Pxx-Team
9
9
  * Released under the MIT license
10
- * Date: 2025-09-08T04:21:54.197Z
10
+ * Date: 2025-09-08T13:52:15.208Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -18453,6 +18453,133 @@
18453
18453
  ]
18454
18454
  };
18455
18455
 
18456
+ const MoreToolbar = vue.defineComponent({
18457
+ name: 'MoreToolbar',
18458
+ props: {
18459
+ editorKey: {
18460
+ type: String,
18461
+ required: true,
18462
+ },
18463
+ toolbarStyle: {
18464
+ type: Object,
18465
+ default: () => ({}),
18466
+ },
18467
+ showMoreToolbar: {
18468
+ type: Boolean,
18469
+ default: false,
18470
+ },
18471
+ },
18472
+ emits: ['toolClick'],
18473
+ setup(props, { emit }) {
18474
+ return () => vue.h('div', {
18475
+ id: 'toolbar-' + props.editorKey,
18476
+ dataC: props.showMoreToolbar,
18477
+ style: {
18478
+ ...props.toolbarStyle
18479
+ }
18480
+ }, [
18481
+ vue.h('div', {
18482
+ class: {
18483
+ 'short-tools': true,
18484
+ 'collapse': props.showMoreToolbar
18485
+ }
18486
+ }, [
18487
+ vue.h('span', { class: 'ql-formats' }, [
18488
+ vue.h('button', {
18489
+ class: 'ql-bold',
18490
+ type: 'button',
18491
+ }, ''),
18492
+ vue.h('button', {
18493
+ class: 'ql-italic',
18494
+ type: 'button'
18495
+ }, ''),
18496
+ vue.h('button', {
18497
+ class: 'ql-underline',
18498
+ type: 'button'
18499
+ }, '')
18500
+ ]),
18501
+ vue.h('span', { class: 'ql-formats' }, [
18502
+ vue.h('select', {
18503
+ class: 'ql-color ql-picker ql-color-picker',
18504
+ type: 'button'
18505
+ }, [
18506
+ vue.h('span', { class: 'ql-picker-label' }, ''),
18507
+ vue.h('div', { class: 'ql-picker-options' })
18508
+ ]),
18509
+ ]),
18510
+ vue.h('span', { class: 'ql-formats' }, [
18511
+ vue.h('button', {
18512
+ class: 'ql-link',
18513
+ type: 'button'
18514
+ }, '')
18515
+ ]),
18516
+ vue.h('span', { class: 'ql-formats' }, [
18517
+ vue.h('button', {
18518
+ class: `ql-more mr-0 ${props.showMoreToolbar ? 'ql-active' : ''}`,
18519
+ type: 'button',
18520
+ onClick: () => emit('toolClick', 'more')
18521
+ }, '')
18522
+ ])
18523
+ ]),
18524
+ vue.h('div', {
18525
+ class: {
18526
+ "more-tools": true,
18527
+ "collapse": props.showMoreToolbar
18528
+ }, style: { display: props.showMoreToolbar ? 'block' : 'none' }
18529
+ }, [
18530
+ vue.h('div', { class: "more-tools-item" }, [
18531
+ vue.h('span', { class: 'ql-formats' }, [
18532
+ vue.h('button', {
18533
+ class: 'ql-list',
18534
+ value: 'ordered',
18535
+ type: 'button'
18536
+ }, ''),
18537
+ vue.h('button', {
18538
+ class: 'ql-list',
18539
+ value: 'bullet',
18540
+ type: 'button'
18541
+ }, '')
18542
+ ]),
18543
+ vue.h('span', { class: 'ql-formats' }, [
18544
+ vue.h('button', {
18545
+ class: 'ql-image',
18546
+ type: 'button'
18547
+ }, '')
18548
+ ]),
18549
+ vue.h('span', { class: 'ql-formats' }, [
18550
+ vue.h('button', {
18551
+ class: 'ql-undo',
18552
+ type: 'button',
18553
+ onClick: () => emit('toolClick', 'undo')
18554
+ }, ''),
18555
+ vue.h('button', {
18556
+ class: 'ql-redo',
18557
+ type: 'button',
18558
+ onClick: () => emit('toolClick', 'redo')
18559
+ }, '')
18560
+ ]),
18561
+ vue.h('span', { class: 'ql-formats' }, [
18562
+ vue.h('button', {
18563
+ class: 'ql-math mr-0',
18564
+ type: 'button',
18565
+ onClick: () => emit('toolClick', 'math')
18566
+ }, '')
18567
+ ])
18568
+ ]),
18569
+ vue.h('div', {}, [
18570
+ vue.h('span', { class: 'ql-formats' }, [
18571
+ vue.h('button', {
18572
+ class: 'ql-ocr',
18573
+ type: 'button',
18574
+ onClick: () => emit('toolClick', 'ocr')
18575
+ }, '')
18576
+ ])
18577
+ ])
18578
+ ])
18579
+ ]);
18580
+ }
18581
+ });
18582
+
18456
18583
  var dist = {};
18457
18584
 
18458
18585
  var Options = {};
@@ -18781,11 +18908,11 @@
18781
18908
  value: true
18782
18909
  });
18783
18910
 
18784
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
18911
+ var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
18785
18912
 
18786
18913
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18787
18914
 
18788
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18915
+ function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18789
18916
 
18790
18917
  var LEFT_ALIGN = 'left';
18791
18918
  var CENTER_ALIGN = 'center';
@@ -18796,7 +18923,7 @@
18796
18923
  var _this = this,
18797
18924
  _alignments;
18798
18925
 
18799
- _classCallCheck(this, DefaultAligner);
18926
+ _classCallCheck$1(this, DefaultAligner);
18800
18927
 
18801
18928
  this.applyStyle = options.aligner.applyStyle;
18802
18929
  this.alignAttribute = options.attribute;
@@ -18824,7 +18951,7 @@
18824
18951
  }), _alignments);
18825
18952
  }
18826
18953
 
18827
- _createClass(DefaultAligner, [{
18954
+ _createClass$1(DefaultAligner, [{
18828
18955
  key: 'getAlignments',
18829
18956
  value: function getAlignments() {
18830
18957
  var _this2 = this;
@@ -19549,156 +19676,148 @@
19549
19676
 
19550
19677
  var IframeVideoSpec = {};
19551
19678
 
19552
- var UnclickableBlotSpec = {};
19679
+ var UnclickableBlotSpec$1 = {};
19553
19680
 
19554
- var hasRequiredUnclickableBlotSpec;
19681
+ Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
19682
+ value: true
19683
+ });
19555
19684
 
19556
- function requireUnclickableBlotSpec () {
19557
- if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
19558
- hasRequiredUnclickableBlotSpec = 1;
19685
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19559
19686
 
19560
- Object.defineProperty(UnclickableBlotSpec, "__esModule", {
19561
- value: true
19562
- });
19687
+ var _BlotSpec2 = requireBlotSpec();
19563
19688
 
19564
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19689
+ var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19565
19690
 
19566
- var _BlotSpec2 = requireBlotSpec();
19567
-
19568
- var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19691
+ var _BlotFormatter = requireBlotFormatter();
19569
19692
 
19570
- var _BlotFormatter = requireBlotFormatter();
19693
+ _interopRequireDefault(_BlotFormatter);
19571
19694
 
19572
- _interopRequireDefault(_BlotFormatter);
19695
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19573
19696
 
19574
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19575
-
19576
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19577
-
19578
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19697
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19579
19698
 
19580
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19699
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19581
19700
 
19582
- var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19583
- var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19701
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19584
19702
 
19585
- var UnclickableBlotSpec$1 = function (_BlotSpec) {
19586
- _inherits(UnclickableBlotSpec, _BlotSpec);
19703
+ var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19704
+ var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19587
19705
 
19588
- function UnclickableBlotSpec(formatter, selector) {
19589
- _classCallCheck(this, UnclickableBlotSpec);
19706
+ var UnclickableBlotSpec = function (_BlotSpec) {
19707
+ _inherits(UnclickableBlotSpec, _BlotSpec);
19590
19708
 
19591
- var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19709
+ function UnclickableBlotSpec(formatter, selector) {
19710
+ _classCallCheck(this, UnclickableBlotSpec);
19592
19711
 
19593
- _this.onTextChange = function () {
19594
- Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19595
- unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19596
- unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19597
- });
19598
- };
19712
+ var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19599
19713
 
19600
- _this.onMouseEnter = function (event) {
19601
- var unclickable = event.target;
19602
- if (!(unclickable instanceof HTMLElement)) {
19603
- return;
19604
- }
19714
+ _this.onTextChange = function () {
19715
+ Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19716
+ unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19717
+ unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19718
+ });
19719
+ };
19605
19720
 
19606
- _this.nextUnclickable = unclickable;
19607
- _this.repositionProxyImage(_this.nextUnclickable);
19608
- };
19721
+ _this.onMouseEnter = function (event) {
19722
+ var unclickable = event.target;
19723
+ if (!(unclickable instanceof HTMLElement)) {
19724
+ return;
19725
+ }
19609
19726
 
19610
- _this.onProxyImageClick = function () {
19611
- _this.unclickable = _this.nextUnclickable;
19612
- _this.nextUnclickable = null;
19613
- _this.formatter.show(_this);
19614
- _this.hideProxyImage();
19615
- };
19727
+ _this.nextUnclickable = unclickable;
19728
+ _this.repositionProxyImage(_this.nextUnclickable);
19729
+ };
19616
19730
 
19617
- _this.selector = selector;
19618
- _this.unclickable = null;
19619
- _this.nextUnclickable = null;
19620
- return _this;
19621
- }
19731
+ _this.onProxyImageClick = function () {
19732
+ _this.unclickable = _this.nextUnclickable;
19733
+ _this.nextUnclickable = null;
19734
+ _this.formatter.show(_this);
19735
+ _this.hideProxyImage();
19736
+ };
19622
19737
 
19623
- _createClass(UnclickableBlotSpec, [{
19624
- key: 'init',
19625
- value: function init() {
19626
- if (document.body) {
19627
- /*
19628
- it's important that this is attached to the body instead of the root quill element.
19629
- this prevents the click event from overlapping with ImageSpec
19630
- */
19631
- document.body.appendChild(this.createProxyImage());
19632
- }
19738
+ _this.selector = selector;
19739
+ _this.unclickable = null;
19740
+ _this.nextUnclickable = null;
19741
+ return _this;
19742
+ }
19633
19743
 
19634
- this.hideProxyImage();
19635
- this.proxyImage.addEventListener('click', this.onProxyImageClick);
19636
- this.formatter.quill.on('text-change', this.onTextChange);
19637
- }
19638
- }, {
19639
- key: 'getTargetElement',
19640
- value: function getTargetElement() {
19641
- return this.unclickable;
19642
- }
19643
- }, {
19644
- key: 'getOverlayElement',
19645
- value: function getOverlayElement() {
19646
- return this.unclickable;
19647
- }
19648
- }, {
19649
- key: 'onHide',
19650
- value: function onHide() {
19651
- this.hideProxyImage();
19652
- this.nextUnclickable = null;
19653
- this.unclickable = null;
19654
- }
19655
- }, {
19656
- key: 'createProxyImage',
19657
- value: function createProxyImage() {
19658
- var canvas = document.createElement('canvas');
19659
- var context = canvas.getContext('2d');
19660
- context.globalAlpha = 0;
19661
- context.fillRect(0, 0, 1, 1);
19662
-
19663
- this.proxyImage = document.createElement('img');
19664
- this.proxyImage.src = canvas.toDataURL('image/png');
19665
- this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19666
-
19667
- Object.assign(this.proxyImage.style, {
19668
- position: 'absolute',
19669
- margin: '0'
19670
- });
19744
+ _createClass(UnclickableBlotSpec, [{
19745
+ key: 'init',
19746
+ value: function init() {
19747
+ if (document.body) {
19748
+ /*
19749
+ it's important that this is attached to the body instead of the root quill element.
19750
+ this prevents the click event from overlapping with ImageSpec
19751
+ */
19752
+ document.body.appendChild(this.createProxyImage());
19753
+ }
19671
19754
 
19672
- return this.proxyImage;
19673
- }
19674
- }, {
19675
- key: 'hideProxyImage',
19676
- value: function hideProxyImage() {
19677
- Object.assign(this.proxyImage.style, {
19678
- display: 'none'
19679
- });
19680
- }
19681
- }, {
19682
- key: 'repositionProxyImage',
19683
- value: function repositionProxyImage(unclickable) {
19684
- var rect = unclickable.getBoundingClientRect();
19755
+ this.hideProxyImage();
19756
+ this.proxyImage.addEventListener('click', this.onProxyImageClick);
19757
+ this.formatter.quill.on('text-change', this.onTextChange);
19758
+ }
19759
+ }, {
19760
+ key: 'getTargetElement',
19761
+ value: function getTargetElement() {
19762
+ return this.unclickable;
19763
+ }
19764
+ }, {
19765
+ key: 'getOverlayElement',
19766
+ value: function getOverlayElement() {
19767
+ return this.unclickable;
19768
+ }
19769
+ }, {
19770
+ key: 'onHide',
19771
+ value: function onHide() {
19772
+ this.hideProxyImage();
19773
+ this.nextUnclickable = null;
19774
+ this.unclickable = null;
19775
+ }
19776
+ }, {
19777
+ key: 'createProxyImage',
19778
+ value: function createProxyImage() {
19779
+ var canvas = document.createElement('canvas');
19780
+ var context = canvas.getContext('2d');
19781
+ context.globalAlpha = 0;
19782
+ context.fillRect(0, 0, 1, 1);
19783
+
19784
+ this.proxyImage = document.createElement('img');
19785
+ this.proxyImage.src = canvas.toDataURL('image/png');
19786
+ this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19787
+
19788
+ Object.assign(this.proxyImage.style, {
19789
+ position: 'absolute',
19790
+ margin: '0'
19791
+ });
19685
19792
 
19686
- Object.assign(this.proxyImage.style, {
19687
- display: 'block',
19688
- left: rect.left + window.pageXOffset + 'px',
19689
- top: rect.top + window.pageYOffset + 'px',
19690
- width: rect.width + 'px',
19691
- height: rect.height + 'px'
19692
- });
19693
- }
19694
- }]);
19793
+ return this.proxyImage;
19794
+ }
19795
+ }, {
19796
+ key: 'hideProxyImage',
19797
+ value: function hideProxyImage() {
19798
+ Object.assign(this.proxyImage.style, {
19799
+ display: 'none'
19800
+ });
19801
+ }
19802
+ }, {
19803
+ key: 'repositionProxyImage',
19804
+ value: function repositionProxyImage(unclickable) {
19805
+ var rect = unclickable.getBoundingClientRect();
19806
+
19807
+ Object.assign(this.proxyImage.style, {
19808
+ display: 'block',
19809
+ left: rect.left + window.pageXOffset + 'px',
19810
+ top: rect.top + window.pageYOffset + 'px',
19811
+ width: rect.width + 'px',
19812
+ height: rect.height + 'px'
19813
+ });
19814
+ }
19815
+ }]);
19695
19816
 
19696
- return UnclickableBlotSpec;
19697
- }(_BlotSpec3.default);
19817
+ return UnclickableBlotSpec;
19818
+ }(_BlotSpec3.default);
19698
19819
 
19699
- UnclickableBlotSpec.default = UnclickableBlotSpec$1;
19700
- return UnclickableBlotSpec;
19701
- }
19820
+ UnclickableBlotSpec$1.default = UnclickableBlotSpec;
19702
19821
 
19703
19822
  var hasRequiredIframeVideoSpec;
19704
19823
 
@@ -19710,7 +19829,7 @@
19710
19829
  value: true
19711
19830
  });
19712
19831
 
19713
- var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
19832
+ var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
19714
19833
 
19715
19834
  var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
19716
19835
 
@@ -19937,7 +20056,7 @@
19937
20056
  }
19938
20057
  });
19939
20058
 
19940
- var _UnclickableBlotSpec = requireUnclickableBlotSpec();
20059
+ var _UnclickableBlotSpec = UnclickableBlotSpec$1;
19941
20060
 
19942
20061
  Object.defineProperty(exports, 'UnclickableBlotSpec', {
19943
20062
  enumerable: true,
@@ -19960,132 +20079,135 @@
19960
20079
 
19961
20080
  var BlotFormatter = /*@__PURE__*/getDefaultExportFromCjs(dist);
19962
20081
 
19963
- const MoreToolbar = vue.defineComponent({
19964
- name: 'MoreToolbar',
19965
- props: {
19966
- editorKey: {
19967
- type: String,
19968
- required: true,
19969
- },
19970
- toolbarStyle: {
19971
- type: Object,
19972
- default: () => ({}),
19973
- },
19974
- showMoreToolbar: {
19975
- type: Boolean,
19976
- default: false,
19977
- },
19978
- },
19979
- emits: ['toolClick'],
19980
- setup(props, { emit }) {
19981
- return () => vue.h('div', {
19982
- id: 'toolbar-' + props.editorKey,
19983
- dataC: props.showMoreToolbar,
19984
- style: {
19985
- ...props.toolbarStyle
20082
+ function useBlotFormatter(editor) {
20083
+ const quillRef = vue.ref(null);
20084
+ const removeQuillBlotFormatter = () => {
20085
+ var _a;
20086
+ try {
20087
+ const blotFormatter = (_a = quillRef.value) === null || _a === void 0 ? void 0 : _a.getModule('blotFormatter');
20088
+ if (blotFormatter && blotFormatter.overlay) {
20089
+ const overlay = blotFormatter.overlay;
20090
+ if (overlay.parentNode) {
20091
+ overlay.parentNode.removeChild(overlay);
20092
+ }
19986
20093
  }
19987
- }, [
19988
- vue.h('div', {
19989
- class: {
19990
- 'short-tools': true,
19991
- 'collapse': props.showMoreToolbar
20094
+ }
20095
+ catch (error) {
20096
+ console.warn('移除blotFormatter overlay时出错:', error);
20097
+ }
20098
+ };
20099
+ const handleGlobalClick = (event) => {
20100
+ var _a;
20101
+ if (!editor.value)
20102
+ return;
20103
+ const blotFormatter = (_a = quillRef.value) === null || _a === void 0 ? void 0 : _a.getModule('blotFormatter');
20104
+ if (!blotFormatter || !blotFormatter.overlay)
20105
+ return;
20106
+ const isClickInsideEditor = editor.value.contains(event.target);
20107
+ if (!isClickInsideEditor) {
20108
+ removeQuillBlotFormatter();
20109
+ }
20110
+ };
20111
+ const handleGlobalKeyup = (event) => {
20112
+ var _a;
20113
+ if (event.keyCode !== 46 && event.keyCode !== 8)
20114
+ return;
20115
+ const blotFormatter = (_a = quillRef.value) === null || _a === void 0 ? void 0 : _a.getModule('blotFormatter');
20116
+ if (!blotFormatter || !blotFormatter.currentSpec)
20117
+ return;
20118
+ const target = event.target;
20119
+ if (!editor.value || !editor.value.contains(target)) {
20120
+ event.stopImmediatePropagation();
20121
+ event.preventDefault();
20122
+ return;
20123
+ }
20124
+ const allEditors = document.querySelectorAll('.quill-editor-container');
20125
+ allEditors.forEach(editorElement => {
20126
+ if (editorElement !== editor.value) {
20127
+ const otherQuill = editorElement.__quill;
20128
+ if (otherQuill && otherQuill !== quillRef.value) {
20129
+ const otherBlotFormatter = otherQuill.getModule('blotFormatter');
20130
+ if (otherBlotFormatter && otherBlotFormatter.currentSpec) {
20131
+ otherBlotFormatter.hide();
20132
+ }
19992
20133
  }
19993
- }, [
19994
- vue.h('span', { class: 'ql-formats' }, [
19995
- vue.h('button', {
19996
- class: 'ql-bold',
19997
- type: 'button',
19998
- }, ''),
19999
- vue.h('button', {
20000
- class: 'ql-italic',
20001
- type: 'button'
20002
- }, ''),
20003
- vue.h('button', {
20004
- class: 'ql-underline',
20005
- type: 'button'
20006
- }, '')
20007
- ]),
20008
- vue.h('span', { class: 'ql-formats' }, [
20009
- vue.h('select', {
20010
- class: 'ql-color ql-picker ql-color-picker',
20011
- type: 'button'
20012
- }, [
20013
- vue.h('span', { class: 'ql-picker-label' }, ''),
20014
- vue.h('div', { class: 'ql-picker-options' })
20015
- ]),
20016
- ]),
20017
- vue.h('span', { class: 'ql-formats' }, [
20018
- vue.h('button', {
20019
- class: 'ql-link',
20020
- type: 'button'
20021
- }, '')
20022
- ]),
20023
- vue.h('span', { class: 'ql-formats' }, [
20024
- vue.h('button', {
20025
- class: `ql-more mr-0 ${props.showMoreToolbar ? 'ql-active' : ''}`,
20026
- type: 'button',
20027
- onClick: () => emit('toolClick', 'more')
20028
- }, '')
20029
- ])
20030
- ]),
20031
- vue.h('div', {
20032
- class: {
20033
- "more-tools": true,
20034
- "collapse": props.showMoreToolbar
20035
- }, style: { display: props.showMoreToolbar ? 'block' : 'none' }
20036
- }, [
20037
- vue.h('div', { class: "more-tools-item" }, [
20038
- vue.h('span', { class: 'ql-formats' }, [
20039
- vue.h('button', {
20040
- class: 'ql-list',
20041
- value: 'ordered',
20042
- type: 'button'
20043
- }, ''),
20044
- vue.h('button', {
20045
- class: 'ql-list',
20046
- value: 'bullet',
20047
- type: 'button'
20048
- }, '')
20049
- ]),
20050
- vue.h('span', { class: 'ql-formats' }, [
20051
- vue.h('button', {
20052
- class: 'ql-image',
20053
- type: 'button'
20054
- }, '')
20055
- ]),
20056
- vue.h('span', { class: 'ql-formats' }, [
20057
- vue.h('button', {
20058
- class: 'ql-undo',
20059
- type: 'button',
20060
- onClick: () => emit('toolClick', 'undo')
20061
- }, ''),
20062
- vue.h('button', {
20063
- class: 'ql-redo',
20064
- type: 'button',
20065
- onClick: () => emit('toolClick', 'redo')
20066
- }, '')
20067
- ]),
20068
- vue.h('span', { class: 'ql-formats' }, [
20069
- vue.h('button', {
20070
- class: 'ql-math mr-0',
20071
- type: 'button',
20072
- onClick: () => emit('toolClick', 'math')
20073
- }, '')
20074
- ])
20075
- ]),
20076
- vue.h('div', {}, [
20077
- vue.h('span', { class: 'ql-formats' }, [
20078
- vue.h('button', {
20079
- class: 'ql-ocr',
20080
- type: 'button',
20081
- onClick: () => emit('toolClick', 'ocr')
20082
- }, '')
20083
- ])
20084
- ])
20085
- ])
20086
- ]);
20087
- }
20088
- });
20134
+ }
20135
+ });
20136
+ };
20137
+ const configureBlotFormatter = () => {
20138
+ if (!quillRef.value)
20139
+ return;
20140
+ const blotFormatter = quillRef.value.getModule('blotFormatter');
20141
+ if (blotFormatter) {
20142
+ const originalShow = blotFormatter.show.bind(blotFormatter);
20143
+ blotFormatter.show = function (spec) {
20144
+ var _a;
20145
+ originalShow(spec);
20146
+ const target = (_a = this.currentSpec) === null || _a === void 0 ? void 0 : _a.getTargetElement();
20147
+ if (target && target.tagName === 'IMG') {
20148
+ target.style.maxWidth = '100%';
20149
+ target.style.height = 'auto';
20150
+ target.style.objectFit = 'contain';
20151
+ const width = target.getAttribute('width');
20152
+ if (width) {
20153
+ const naturalWidth = target.naturalWidth;
20154
+ const naturalHeight = target.naturalHeight;
20155
+ if (naturalWidth && naturalHeight) {
20156
+ const aspectRatio = naturalHeight / naturalWidth;
20157
+ const newHeight = Math.round(parseInt(width) * aspectRatio);
20158
+ target.setAttribute('height', '' + newHeight);
20159
+ }
20160
+ }
20161
+ }
20162
+ };
20163
+ }
20164
+ };
20165
+ const applyImageStyle = () => {
20166
+ var _a;
20167
+ if (!quillRef.value)
20168
+ return;
20169
+ const editorElement = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.querySelector('.ql-editor');
20170
+ if (editorElement) {
20171
+ const images = editorElement.querySelectorAll('img');
20172
+ images.forEach(img => {
20173
+ img.style.maxWidth = '100%';
20174
+ img.style.height = 'auto';
20175
+ img.style.objectFit = 'contain';
20176
+ });
20177
+ }
20178
+ };
20179
+ const registerBlotFormatter = () => {
20180
+ Quill.register('modules/blotFormatter', BlotFormatter);
20181
+ };
20182
+ const getBlotFormatterConfig = () => {
20183
+ return {
20184
+ blotFormatter: true
20185
+ };
20186
+ };
20187
+ vue.onMounted(() => {
20188
+ window.addEventListener('click', handleGlobalClick, true);
20189
+ window.addEventListener('keyup', handleGlobalKeyup, true);
20190
+ });
20191
+ vue.onBeforeUnmount(() => {
20192
+ window.removeEventListener('click', handleGlobalClick, true);
20193
+ window.removeEventListener('keyup', handleGlobalKeyup, true);
20194
+ removeQuillBlotFormatter();
20195
+ });
20196
+ const setQuill = (quillInstance) => {
20197
+ quillRef.value = quillInstance;
20198
+ };
20199
+ return {
20200
+ quillRef,
20201
+ setQuill,
20202
+ removeQuillBlotFormatter,
20203
+ handleGlobalClick,
20204
+ handleGlobalKeyup,
20205
+ configureBlotFormatter,
20206
+ applyImageStyle,
20207
+ registerBlotFormatter,
20208
+ getBlotFormatterConfig
20209
+ };
20210
+ }
20089
20211
 
20090
20212
  const boldSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M6.794999938146972,7.7800002288818355L9.045000038146974,7.7800002288818355Q9.855000038146972,7.7800002288818355,10.230000038146972,7.442500128881836Q10.605000038146972,7.105000028881836,10.605000038146972,6.505000128881836Q10.605000038146972,6.114999728881836,10.440000038146973,5.860000628881836Q10.275000138146972,5.6050005288818365,9.929999838146973,5.470000228881836Q9.585000038146973,5.335000028881836,9.045000038146974,5.335000028881836L7.139999938146973,5.335000028881836L7.139999938146973,3.385000228881836L9.045000038146974,3.385000228881836Q10.034999838146973,3.385000228881836,10.852499938146973,3.797500608881836Q11.670000038146974,4.2100000388818355,12.142499938146972,4.922500628881836Q12.614999738146974,5.635000228881836,12.614999738146974,6.505000128881836Q12.614999738146974,7.375000028881836,12.142499938146972,8.042500028881836Q11.670000038146974,8.710000028881836,10.860000138146972,9.070000128881837Q10.050000238146973,9.430000328881835,9.045000038146974,9.430000328881835L6.794999938146972,9.430000328881835L6.794999938146972,7.7800002288818355ZM7.139999938146973,12.550000228881835L9.329999938146972,12.550000228881835Q9.900000138146972,12.550000228881835,10.327499838146974,12.354999528881836Q10.755000138146972,12.159999828881835,10.987500238146973,11.807499928881835Q11.219999838146972,11.454999928881836,11.219999838146972,11.020000428881836Q11.219999838146972,10.600000428881836,10.987500238146973,10.232500028881836Q10.755000138146972,9.864999728881836,10.327499838146974,9.647500028881836Q9.900000138146972,9.430000328881835,9.329999938146972,9.430000328881835L6.975000038146972,9.430000328881835L6.975000038146972,7.7800002288818355L9.329999938146972,7.7800002288818355Q10.349999938146972,7.7800002288818355,11.250000038146972,8.200000328881835Q12.149999638146973,8.620000328881837,12.690000538146972,9.362500228881835Q13.229999538146973,10.104999528881836,13.229999538146973,11.034999828881837Q13.229999538146973,11.949999828881836,12.690000538146972,12.752500528881836Q12.149999638146973,13.555000228881836,11.250000038146972,14.027500228881836Q10.349999938146972,14.500000228881836,9.329999938146972,14.500000228881836L7.139999938146973,14.500000228881836L7.139999938146973,12.550000228881835ZM7.064999938146973,14.500000228881836Q6.284999968146972,14.500000228881836,5.872500058146973,14.095000228881837Q5.460000038146973,13.689999228881836,5.460000038146973,12.895000428881836L5.460000038146973,4.989999728881836Q5.460000038146973,4.195000648881836,5.872500058146973,3.789999958881836Q6.284999968146972,3.385000228881836,7.064999938146973,3.385000228881836L7.469999838146973,3.385000228881836L7.469999838146973,14.500000228881836L7.064999938146973,14.500000228881836Z" fill="#555555" fill-opacity="1"/></g></g></svg>`;
20091
20213
  const italicSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M8,3Q7.9015086,3,7.8049095,3.019214718Q7.7083106,3.038429435,7.6173165,3.076120459Q7.5263224,3.11381148,7.4444296,3.16853037Q7.3625371,3.2232492600000002,7.2928932,3.2928932Q7.2232492,3.36253715,7.1685302,3.4444297600000002Q7.1138113999999995,3.52632231,7.0761204,3.61731648Q7.0384293,3.70831072,7.0192146,3.80490965Q6.99999994,3.90150857,7,4Q6.99999994,4.0984913,7.0192146,4.1950902Q7.0384293,4.291689,7.0761204,4.3826833Q7.1138113999999995,4.4736774,7.1685302,4.5555699Q7.2232492,4.6374626,7.2928932,4.7071065999999995Q7.3625371,4.7767504,7.4444296,4.8314693Q7.5263224,4.8861883,7.6173165,4.9238794Q7.7083106,4.9615704,7.8049096,4.9807851Q7.9015086,4.9999999,8,5L9.137146,5L8,13L7,13Q6.90150857,13,6.80490965,13.019215Q6.70831072,13.038429,6.6173164799999995,13.07612Q6.52632231,13.113811,6.44442973,13.16853Q6.36253715,13.223249,6.2928932,13.292892Q6.22324926,13.362536,6.16853037,13.444429Q6.11381148,13.526321,6.076120459,13.617315Q6.038429435,13.708309,6.019214718,13.804909Q6,13.901508,6,14Q6,14.098491,6.019214718,14.195089Q6.038429435,14.291689,6.076120459,14.382683Q6.11381148,14.473677,6.16853037,14.555569Q6.22324926,14.637462,6.2928932,14.707106Q6.36253715,14.77675,6.44442976,14.831469Q6.52632231,14.886187,6.6173164799999995,14.923878Q6.70831072,14.961569,6.80490965,14.980784Q6.90150857,15,7,15L11,15Q11.0984912,15,11.1950898,14.980784Q11.2916889,14.961569,11.382682800000001,14.923878Q11.473677200000001,14.886187,11.5555696,14.831469Q11.6374626,14.77675,11.7071066,14.707106Q11.7767506,14.637462,11.8314691,14.555569Q11.8861876,14.473677,11.9238791,14.382683Q11.9615698,14.291689,11.9807849,14.195089Q12,14.098491,12,14Q12,13.901508,11.9807849,13.804909Q11.9615698,13.708309,11.9238791,13.617315Q11.8861876,13.526321,11.8314691,13.444428Q11.7767506,13.362536,11.7071066,13.292892Q11.6374626,13.223249,11.5555701,13.16853Q11.473677200000001,13.113811,11.382682800000001,13.07612Q11.2916889,13.038429,11.1950903,13.019215Q11.0984912,13,11,13L9.8626451,13L11,5L12,5Q12.0984907,4.9999999,12.1950893,4.9807851Q12.2916884,4.9615703,12.382682800000001,4.9238793Q12.4736767,4.8861883,12.5555696,4.8314693Q12.6374621,4.7767504,12.7071061,4.7071065999999995Q12.776750100000001,4.6374626,12.831468600000001,4.5555699Q12.8861876,4.4736774,12.9238787,4.3826833Q12.9615698,4.291689,12.9807849,4.1950902Q12.999999500000001,4.0984913,13,4Q12.999999500000001,3.90150857,12.980784400000001,3.80490965Q12.9615698,3.70831072,12.9238787,3.61731648Q12.8861876,3.52632231,12.8314691,3.44442973Q12.7767506,3.36253715,12.7071066,3.2928932Q12.6374626,3.2232492600000002,12.5555696,3.16853037Q12.4736767,3.11381148,12.382682800000001,3.076120459Q12.2916884,3.038429435,12.1950898,3.019214718Q12.0984907,3,12,3L8,3Z" fill-rule="evenodd" fill="#555555" fill-opacity="1"/></g></g></svg>`;
@@ -20094,8 +20216,8 @@
20094
20216
  const linkSVG = `<svg t="1756107950494" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11245" width="18" height="18" style="padding:1px"><path d="M292.693333 564.906667L123.477333 395.648q-55.296-55.338667-54.272-134.4 1.066667-78.336 57.088-134.357333Q182.186667 70.912 260.608 69.845333q79.061333-1.066667 134.4 54.272l194.944 194.986667a40.533333 40.533333 0 0 1 0.938667 0.938667q54.4 55.04 53.333333 133.461333-1.066667 78.336-57.045333 134.357333a42.666667 42.666667 0 1 1-60.330667-60.330666q31.445333-31.488 32.042667-75.178667 0.597333-43.050667-29.269334-72.874667a44.458667 44.458667 0 0 1-0.853333-0.896l-194.133333-194.133333q-72.618667-72.618667-148.053334 2.773333-31.488 31.488-32.085333 75.178667-0.554667 43.050667 29.269333 72.874667l169.258667 169.301333a42.666667 42.666667 0 1 1-60.288 60.330667z m202.538667-69.674667a42.666667 42.666667 0 0 0-60.330667-60.373333q-55.978667 56.021333-57.045333 134.4-1.066667 79.018667 54.272 134.357333a40.362667 40.362667 0 0 0 0.981333 0.938667l1.706667 1.877333 194.986667 194.986667q55.338667 55.296 134.4 54.229333 78.336-1.066667 134.357333-57.045333 55.978667-56.021333 57.045333-134.4 1.066667-79.018667-54.272-134.357334l-169.258666-169.258666a42.666667 42.666667 0 1 0-60.373334 60.330666l169.301334 169.301334q29.866667 29.866667 29.269333 72.874666-0.597333 43.690667-32.042667 75.178667-31.488 31.445333-75.178666 32.042667-43.050667 0.597333-72.874667-29.269334l-194.986667-194.986666a39.68 39.68 0 0 0-0.981333-0.938667 43.52 43.52 0 0 0-1.749333-1.834667q-29.866667-29.866667-29.269334-72.917333 0.554667-43.690667 32.042667-75.136z" p-id="11246" fill="#555555"></path></svg>`;
20095
20217
  const undoSVG = `<svg t="1756107888940" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10819" width="18" height="18"><path d="M220.086857 374.893714l102.473143 102.473143c10.605714 10.642286 28.818286 3.108571 28.818286-11.922286v-77.275428h261.851428l8.009143 0.146286c98.048 3.364571 169.216 68.754286 169.216 160.182857 0 93.952-75.044571 160.365714-177.225143 160.365714H241.883429l-3.437715 0.256a25.307429 25.307429 0 0 0 3.437715 50.395429h371.346285l8.374857-0.146286c124.708571-3.657143 219.501714-90.148571 219.501715-210.834286 0-123.392-99.035429-211.017143-227.876572-211.017143h-261.851428V260.498286a16.896 16.896 0 0 0-28.818286-11.922286L220.086857 351.049143a16.896 16.896 0 0 0 0 23.844571z" p-id="10820" fill="#555555"></path></svg>`;
20096
20218
  const redoSVG = `<svg t="1756107908999" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11032" width="18" height="18"><path d="M836.205714 374.893714l-102.473143 102.473143a16.896 16.896 0 0 1-28.818285-11.922286v-77.275428h-261.851429l-8.045714 0.146286c-98.011429 3.364571-169.179429 68.754286-169.179429 160.182857 0 93.952 75.044571 160.365714 177.225143 160.365714h371.346286l3.437714 0.256a25.307429 25.307429 0 0 1-3.437714 50.395429H443.062857l-8.374857-0.146286c-124.708571-3.657143-219.501714-90.148571-219.501714-210.834286 0-123.392 99.035429-211.017143 227.84-211.017143h261.888V260.498286c0-15.030857 18.176-22.564571 28.818285-11.922286l102.473143 102.473143c6.582857 6.582857 6.582857 17.261714 0 23.844571z" p-id="11033" fill="#555555"></path></svg>`;
20097
- const ocrSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="15" height="15" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M3.0000245140625,2.6000244140625L5.5000243140625,2.6000244140625C5.8313951140625,2.6000244140625,6.1000242140625,2.3313953240625,6.1000242140625,2.0000244340625C6.1000242140625,1.6686535440624999,5.8313951140625,1.4000244140625,5.5000243140625,1.4000244140625L3.0000245140625,1.4000244140625Q2.3372827740625,1.4000244140625,1.8686535940625,1.8686535940625Q1.4000244140625,2.3372827740625,1.4000244140625,3.0000245140625L1.4000244140625,5.5000243140625C1.4000244140625,5.8313951140625,1.6686535440624999,6.1000242140625,2.0000244340625,6.1000242140625C2.3313953240625,6.1000242140625,2.6000244140625,5.8313951140625,2.6000244140625,5.5000243140625L2.6000244140625,3.0000245140625Q2.6000244140625,2.6000244140625,3.0000245140625,2.6000244140625ZM12.5000244140625,1.4000244140625L15.0000244140625,1.4000244140625Q15.6627664140625,1.4000244140625,16.1313954140625,1.8686538940625Q16.6000244140625,2.3372834940625,16.6000244140625,3.0000245140625L16.6000244140625,5.5000243140625C16.6000244140625,5.6591539140625,16.5368104140625,5.8117661140625,16.424288414062502,5.9242883140625C16.3117674140625,6.0368099140625,16.1591544140625,6.1000242140625,16.0000244140625,6.1000242140625C15.6686534140625,6.1000242140625,15.4000244140625,5.8313951140625,15.4000244140625,5.5000243140625L15.4000234140625,3.0000245140625Q15.4000234140625,2.6000244140625,15.0000244140625,2.6000244140625L12.5000244140625,2.6000244140625C12.1686534140625,2.6000244140625,11.9000244140625,2.3313953240625,11.9000244140625,2.0000244340625C11.9000244140625,1.6686535440624999,12.1686534140625,1.4000244140625,12.5000244140625,1.4000244140625ZM8.6239776140625,6.4719930140625C8.5439777140625,6.1512432140625,8.3999777140625,5.7421179140625,8.2479777140625,5.4212432140625L9.4959774140625,5.052368214062501C9.6959782140625,5.4293680140625,9.9199772140625,5.9346180140625,9.9999771140625,6.2714929140625L9.3519778140625,6.4719930140625L12.7119784140625,6.4719930140625L12.7119784140625,7.6079931140625L11.5039774140625,7.6079931140625C11.1279774140625,8.6968679140625,10.6159782140625,9.6014929140625,9.9599781140625,10.3461180140625C10.7599773140625,10.9224930140625,11.7279774140625,11.3468685140625,12.8879774140625,11.6029934140625C12.6239774140625,11.8592434140625,12.2799774140625,12.3716184140625,12.1039784140625,12.6918684140625C10.8719778140625,12.3716184140625,9.8719778140625,11.8752434140625,9.0479779140625,11.2107429140625C8.175977714062501,11.8992434140625,7.1199779140625,12.4036184140625,5.8559775140625,12.7558684140625C5.7279777140625,12.4757434140625,5.3759775140625,11.9312434140625,5.1519775140625,11.6591184140625C6.3759775140625,11.3868685140625,7.3839779140625,10.9706182140625,8.1839781140625,10.3781185140625C7.5199776140625,9.6094932140625,7.0079775140625,8.6888685140625,6.5919776140625,7.6079931140625L5.3279776140625,7.6079931140625L5.3279776140625,6.4719930140625L8.6239776140625,6.4719930140625ZM7.7999778140625,7.6079931140625C8.1119776140625,8.344617814062499,8.5359778140625,9.0011186140625,9.0719776140625,9.5694933140625C9.5439777140625,9.0251179140625,9.9199772140625,8.3766184140625,10.1919784140625,7.6079931140625L7.7999778140625,7.6079931140625ZM2.6000244140625,12.5000244140625L2.6000244140625,15.0000244140625Q2.6000244140625,15.4000234140625,3.0000245140625,15.4000234140625L5.5000243140625,15.4000234140625C5.8313951140625,15.4000244140625,6.1000242140625,15.6686534140625,6.1000242140625,16.0000244140625C6.1000242140625,16.3313964140625,5.8313951140625,16.6000254140625,5.5000243140625,16.6000254140625L5.4989548140625,16.6000244140625L3.0000245140625,16.6000244140625Q2.3372834940625,16.6000244140625,1.8686538940625,16.1313954140625Q1.4000244140625,15.6627664140625,1.4000244140625,15.0000244140625L1.4000244140625,12.5000244140625C1.4000244140625,12.1686534140625,1.6686535440624999,11.9000244140625,2.0000244340625,11.9000244140625C2.3313953240625,11.9000244140625,2.6000244140625,12.1686534140625,2.6000244140625,12.5000244140625ZM16.6000244140625,12.5010944140625L16.6000244140625,15.0000244140625Q16.6000244140625,15.6627654140625,16.1313954140625,16.1313954140625Q15.6627654140625,16.6000244140625,15.0000244140625,16.6000244140625L12.5000244140625,16.6000244140625C12.3408944140625,16.6000244140625,12.1882824140625,16.5368104140625,12.0757594140625,16.424288414062502C11.9632384140625,16.3117664140625,11.9000244140625,16.1591544140625,11.9000244140625,16.0000244140625C11.9000244140625,15.6686534140625,12.1686534140625,15.4000244140625,12.5000244140625,15.4000244140625L15.0000244140625,15.4000234140625Q15.4000234140625,15.4000234140625,15.4000234140625,15.0000244140625L15.4000234140625,12.5000244140625C15.4000244140625,12.1686534140625,15.6686534140625,11.9000244140625,16.0000244140625,11.9000244140625C16.3313964140625,11.9000244140625,16.6000254140625,12.1686534140625,16.6000254140625,12.5000244140625L16.6000244140625,12.5010944140625Z" fill-rule="evenodd" fill="#555555" fill-opacity="1"/></g></g></svg>`;
20098
- const mathSVG = `<svg t="1756107836493" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10608" width="15" height="15"><path d="M877.454222 856.177778q4.835556-4.835556 7.395556-11.093334 2.616889-6.257778 2.616889-13.084444 0-3.413333-0.625778-6.656-0.682667-3.299556-1.991111-6.428444-1.251556-3.072-3.128889-5.859556-1.877333-2.844444-4.266667-5.176889-2.332444-2.389333-5.12-4.266667-2.844444-1.877333-5.916444-3.128888-3.128889-1.308444-6.428445-1.934223-3.299556-0.682667-6.656-0.682666-6.826667 0-13.084444 2.616889-6.257778 2.56-11.036445 7.395555l-54.044444 53.987556H253.155556l325.688888-325.745778q2.389333-2.389333 4.266667-5.12 1.877333-2.844444 3.128889-5.916445 1.308444-3.128889 1.934222-6.428444 0.682667-3.299556 0.682667-6.656 0-3.413333-0.682667-6.656-0.625778-3.299556-1.934222-6.428444-1.251556-3.072-3.128889-5.859556-1.877333-2.844444-4.266667-5.176889L253.155556 162.133333h522.126222l53.930666 53.987556q4.835556 4.835556 11.093334 7.395555 6.257778 2.616889 13.084444 2.616889 3.413333 0 6.656-0.682666 3.299556-0.625778 6.428445-1.934223 3.072-1.251556 5.859555-3.128888 2.844444-1.877333 5.176889-4.266667 2.389333-2.389333 4.266667-5.12 1.877333-2.844444 3.128889-5.916445 1.308444-3.128889 1.934222-6.428444 0.682667-3.299556 0.682667-6.656 0-6.826667-2.616889-13.084444-2.56-6.257778-7.395556-11.036445l-64-64q-4.778667-4.835556-11.036444-7.395555-6.257778-2.616889-13.084445-2.616889H170.666667q-6.826667 0-13.084445 2.616889-6.257778 2.56-11.036444 7.395555-2.389333 2.389333-4.266667 5.12-1.877333 2.844444-3.128889 5.916445-1.308444 3.128889-1.934222 6.428444-0.682667 3.299556-0.682667 6.656 0 3.413333 0.682667 6.656 0.625778 3.299556 1.934222 6.428444 1.251556 3.072 3.128889 5.859556 1.877333 2.844444 4.266667 5.176889L506.311111 512l-359.822222 359.879111q-4.835556 4.778667-7.395556 11.036445-2.616889 6.257778-2.616889 13.084444 0 3.413333 0.682667 6.656 0.625778 3.299556 1.934222 6.428444 1.251556 3.072 3.128889 5.859556 1.877333 2.844444 4.266667 5.176889 2.389333 2.389333 5.12 4.266667 2.844444 1.877333 5.916444 3.128888 3.128889 1.308444 6.428445 1.991112 3.299556 0.625778 6.656 0.625777h618.666666q6.826667 0 13.084445-2.616889 6.257778-2.56 11.036444-7.395555l64-63.943111z" p-id="10609" fill="#555555"></path></svg>`;
20219
+ const ocrSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="15" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M3.0000245140625,2.6000244140625L5.5000243140625,2.6000244140625C5.8313951140625,2.6000244140625,6.1000242140625,2.3313953240625,6.1000242140625,2.0000244340625C6.1000242140625,1.6686535440624999,5.8313951140625,1.4000244140625,5.5000243140625,1.4000244140625L3.0000245140625,1.4000244140625Q2.3372827740625,1.4000244140625,1.8686535940625,1.8686535940625Q1.4000244140625,2.3372827740625,1.4000244140625,3.0000245140625L1.4000244140625,5.5000243140625C1.4000244140625,5.8313951140625,1.6686535440624999,6.1000242140625,2.0000244340625,6.1000242140625C2.3313953240625,6.1000242140625,2.6000244140625,5.8313951140625,2.6000244140625,5.5000243140625L2.6000244140625,3.0000245140625Q2.6000244140625,2.6000244140625,3.0000245140625,2.6000244140625ZM12.5000244140625,1.4000244140625L15.0000244140625,1.4000244140625Q15.6627664140625,1.4000244140625,16.1313954140625,1.8686538940625Q16.6000244140625,2.3372834940625,16.6000244140625,3.0000245140625L16.6000244140625,5.5000243140625C16.6000244140625,5.6591539140625,16.5368104140625,5.8117661140625,16.424288414062502,5.9242883140625C16.3117674140625,6.0368099140625,16.1591544140625,6.1000242140625,16.0000244140625,6.1000242140625C15.6686534140625,6.1000242140625,15.4000244140625,5.8313951140625,15.4000244140625,5.5000243140625L15.4000234140625,3.0000245140625Q15.4000234140625,2.6000244140625,15.0000244140625,2.6000244140625L12.5000244140625,2.6000244140625C12.1686534140625,2.6000244140625,11.9000244140625,2.3313953240625,11.9000244140625,2.0000244340625C11.9000244140625,1.6686535440624999,12.1686534140625,1.4000244140625,12.5000244140625,1.4000244140625ZM8.6239776140625,6.4719930140625C8.5439777140625,6.1512432140625,8.3999777140625,5.7421179140625,8.2479777140625,5.4212432140625L9.4959774140625,5.052368214062501C9.6959782140625,5.4293680140625,9.9199772140625,5.9346180140625,9.9999771140625,6.2714929140625L9.3519778140625,6.4719930140625L12.7119784140625,6.4719930140625L12.7119784140625,7.6079931140625L11.5039774140625,7.6079931140625C11.1279774140625,8.6968679140625,10.6159782140625,9.6014929140625,9.9599781140625,10.3461180140625C10.7599773140625,10.9224930140625,11.7279774140625,11.3468685140625,12.8879774140625,11.6029934140625C12.6239774140625,11.8592434140625,12.2799774140625,12.3716184140625,12.1039784140625,12.6918684140625C10.8719778140625,12.3716184140625,9.8719778140625,11.8752434140625,9.0479779140625,11.2107429140625C8.175977714062501,11.8992434140625,7.1199779140625,12.4036184140625,5.8559775140625,12.7558684140625C5.7279777140625,12.4757434140625,5.3759775140625,11.9312434140625,5.1519775140625,11.6591184140625C6.3759775140625,11.3868685140625,7.3839779140625,10.9706182140625,8.1839781140625,10.3781185140625C7.5199776140625,9.6094932140625,7.0079775140625,8.6888685140625,6.5919776140625,7.6079931140625L5.3279776140625,7.6079931140625L5.3279776140625,6.4719930140625L8.6239776140625,6.4719930140625ZM7.7999778140625,7.6079931140625C8.1119776140625,8.344617814062499,8.5359778140625,9.0011186140625,9.0719776140625,9.5694933140625C9.5439777140625,9.0251179140625,9.9199772140625,8.3766184140625,10.1919784140625,7.6079931140625L7.7999778140625,7.6079931140625ZM2.6000244140625,12.5000244140625L2.6000244140625,15.0000244140625Q2.6000244140625,15.4000234140625,3.0000245140625,15.4000234140625L5.5000243140625,15.4000234140625C5.8313951140625,15.4000244140625,6.1000242140625,15.6686534140625,6.1000242140625,16.0000244140625C6.1000242140625,16.3313964140625,5.8313951140625,16.6000254140625,5.5000243140625,16.6000254140625L5.4989548140625,16.6000244140625L3.0000245140625,16.6000244140625Q2.3372834940625,16.6000244140625,1.8686538940625,16.1313954140625Q1.4000244140625,15.6627664140625,1.4000244140625,15.0000244140625L1.4000244140625,12.5000244140625C1.4000244140625,12.1686534140625,1.6686535440624999,11.9000244140625,2.0000244340625,11.9000244140625C2.3313953240625,11.9000244140625,2.6000244140625,12.1686534140625,2.6000244140625,12.5000244140625ZM16.6000244140625,12.5010944140625L16.6000244140625,15.0000244140625Q16.6000244140625,15.6627654140625,16.1313954140625,16.1313954140625Q15.6627654140625,16.6000244140625,15.0000244140625,16.6000244140625L12.5000244140625,16.6000244140625C12.3408944140625,16.6000244140625,12.1882824140625,16.5368104140625,12.0757594140625,16.424288414062502C11.9632384140625,16.3117664140625,11.9000244140625,16.1591544140625,11.9000244140625,16.0000244140625C11.9000244140625,15.6686534140625,12.1686534140625,15.4000244140625,12.5000244140625,15.4000244140625L15.0000244140625,15.4000234140625Q15.4000234140625,15.4000234140625,15.4000234140625,15.0000244140625L15.4000234140625,12.5000244140625C15.4000244140625,12.1686534140625,15.6686534140625,11.9000244140625,16.0000244140625,11.9000244140625C16.3313964140625,11.9000244140625,16.6000254140625,12.1686534140625,16.6000254140625,12.5000244140625L16.6000244140625,12.5010944140625Z" fill-rule="evenodd" fill="#555555" fill-opacity="1"/></g></g></svg>`;
20220
+ const mathSVG = `<svg t="1756107836493" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10608" width="16" height="15"><path d="M877.454222 856.177778q4.835556-4.835556 7.395556-11.093334 2.616889-6.257778 2.616889-13.084444 0-3.413333-0.625778-6.656-0.682667-3.299556-1.991111-6.428444-1.251556-3.072-3.128889-5.859556-1.877333-2.844444-4.266667-5.176889-2.332444-2.389333-5.12-4.266667-2.844444-1.877333-5.916444-3.128888-3.128889-1.308444-6.428445-1.934223-3.299556-0.682667-6.656-0.682666-6.826667 0-13.084444 2.616889-6.257778 2.56-11.036445 7.395555l-54.044444 53.987556H253.155556l325.688888-325.745778q2.389333-2.389333 4.266667-5.12 1.877333-2.844444 3.128889-5.916445 1.308444-3.128889 1.934222-6.428444 0.682667-3.299556 0.682667-6.656 0-3.413333-0.682667-6.656-0.625778-3.299556-1.934222-6.428444-1.251556-3.072-3.128889-5.859556-1.877333-2.844444-4.266667-5.176889L253.155556 162.133333h522.126222l53.930666 53.987556q4.835556 4.835556 11.093334 7.395555 6.257778 2.616889 13.084444 2.616889 3.413333 0 6.656-0.682666 3.299556-0.625778 6.428445-1.934223 3.072-1.251556 5.859555-3.128888 2.844444-1.877333 5.176889-4.266667 2.389333-2.389333 4.266667-5.12 1.877333-2.844444 3.128889-5.916445 1.308444-3.128889 1.934222-6.428444 0.682667-3.299556 0.682667-6.656 0-6.826667-2.616889-13.084444-2.56-6.257778-7.395556-11.036445l-64-64q-4.778667-4.835556-11.036444-7.395555-6.257778-2.616889-13.084445-2.616889H170.666667q-6.826667 0-13.084445 2.616889-6.257778 2.56-11.036444 7.395555-2.389333 2.389333-4.266667 5.12-1.877333 2.844444-3.128889 5.916445-1.308444 3.128889-1.934222 6.428444-0.682667 3.299556-0.682667 6.656 0 3.413333 0.682667 6.656 0.625778 3.299556 1.934222 6.428444 1.251556 3.072 3.128889 5.859556 1.877333 2.844444 4.266667 5.176889L506.311111 512l-359.822222 359.879111q-4.835556 4.778667-7.395556 11.036445-2.616889 6.257778-2.616889 13.084444 0 3.413333 0.682667 6.656 0.625778 3.299556 1.934222 6.428444 1.251556 3.072 3.128889 5.859556 1.877333 2.844444 4.266667 5.176889 2.389333 2.389333 5.12 4.266667 2.844444 1.877333 5.916444 3.128888 3.128889 1.308444 6.428445 1.991112 3.299556 0.625778 6.656 0.625777h618.666666q6.826667 0 13.084445-2.616889 6.257778-2.56 11.036444-7.395555l64-63.943111z" p-id="10609" fill="#555555"></path></svg>`;
20099
20221
  const imageSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M1.87471507,3.83578219Q1.5,4.18540478,1.5,4.6875L1.5,14.312503Q1.50000006,14.814598,1.874716,15.16422Q2.23459671,15.5,2.73684216,15.5L15.263157,15.5Q15.765403,15.5,16.125284,15.164218Q16.499999000000003,14.814597,16.499999000000003,14.312501L16.499999000000003,4.6875Q16.499999000000003,4.18540342,16.125284999999998,3.83578214Q15.765404,3.5,15.263157,3.5L2.73684216,3.5Q2.23459646,3.5,1.87471507,3.83578219ZM2.5,14.312503L2.5,4.6875Q2.5,4.5,2.73684216,4.5L15.263157,4.5Q15.5,4.5,15.5,4.6875L15.5,14.312501Q15.5,14.5,15.263157,14.5L2.73684216,14.5Q2.5,14.5,2.5,14.312503Z" fill-rule="evenodd" fill="#555555" fill-opacity="1" style="mix-blend-mode:passthrough"/></g><g><ellipse cx="5.4375" cy="7.4375" rx="0.4375" ry="0.4375" fill-opacity="0" stroke-opacity="1" stroke="#555555" fill="none" stroke-width="1" stroke-linecap="ROUND" stroke-linejoin="round" style="mix-blend-mode:passthrough"/></g><g><path d="M5.9053998,9.924615948146972L1.7143693,12.841608238146973Q1.61364189,12.911715538146973,1.55682093,13.020492338146973Q1.5,13.129269138146974,1.5,13.251992238146972L1.50000003,14.418008338146972Q1.50000003,14.876594038146973,1.84130602,15.195924738146973Q2.16843581,15.501991738146973,2.62437022,15.501991738146973L15.375628,15.501991738146973Q15.831564,15.501991738146973,16.158693,15.195924738146973Q16.5,14.876594038146973,16.5,14.418007838146973L16.5,13.251992238146972Q16.500000999999997,13.186988838146974,16.48338,13.124146438146973Q16.466759,13.061303638146972,16.434621,13.004799838146972Q16.402485,12.948296338146973,16.356969,12.901887938146972Q16.311453,12.855479738146972,16.255583,12.822251838146972L9.8796926,9.030259398146972Q9.842938400000001,9.008400078146973,9.8030057,8.993099628146974Q9.763073,8.977799118146972,9.721121799999999,8.969501908146972Q9.6791716,8.961204618146972,9.6364217,8.960151608146973Q9.5936708,8.959098578146973,9.551362000000001,8.965320438146973Q9.5090542,8.971542238146972,9.4684162,8.984858218146973Q9.427778199999999,8.998174158146973,9.3899918,9.018197478146973Q9.352206200000001,9.038220708146973,9.3183689,9.064369648146972Q9.284532500000001,9.090518598146973,9.2556267,9.122033748146972L7.6887164,10.830422738146973L6.4904227,9.934544588146972Q6.4273362,9.887379288146972,6.3528042,9.861893948146973Q6.2782726,9.836408678146972,6.1995153,9.835072038146972Q6.1207581,9.833735408146973,6.045404,9.856676968146973Q5.9700503000000005,9.879618528146972,5.9053998,9.924615948146972ZM2.5,13.513173138146973L2.50000006,14.418008338146972Q2.50000006,14.501992238146972,2.62437022,14.501992238146972L15.375628,14.501992238146972Q15.5,14.501992238146972,15.5,14.418007838146973L15.5,13.536368338146973L9.7178593,10.097503488146973L8.1200023,11.839632738146973Q8.0888524,11.873595438146973,8.052019600000001,11.901292338146973Q8.0151863,11.928988938146972,7.9739118,11.949486538146973Q7.9326363,11.969984038146972,7.88831,11.982591638146973Q7.8439837,11.995199238146974,7.7980995,11.999492138146973Q7.7522154,12.003785338146972,7.7063198,11.999619238146973Q7.6604242,11.995453338146973,7.6160631,11.982968338146973Q7.571702,11.970483338146973,7.5303702,11.950099938146973Q7.4890385,11.929716538146973,7.4521289,11.902122038146972L6.1805682,10.951467238146973L2.5,13.513173138146973Z" fill-rule="evenodd" fill="#555555" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></svg>`;
20100
20222
 
20101
20223
  const QuillEditor = vue.defineComponent({
@@ -20172,75 +20294,18 @@
20172
20294
  'image',
20173
20295
  ],
20174
20296
  setup: (props, ctx) => {
20297
+ const editor = vue.ref();
20298
+ const showMoreToolbar = vue.ref(false);
20299
+ const { setQuill, removeQuillBlotFormatter, configureBlotFormatter, applyImageStyle, registerBlotFormatter, getBlotFormatterConfig } = useBlotFormatter(editor);
20175
20300
  vue.onMounted(() => {
20176
20301
  initialize();
20177
- console.log("onMounted handleGlobalClick");
20178
- window.addEventListener('click', handleGlobalClick, true);
20179
- window.addEventListener('keyup', handleGlobalKeyup, true);
20180
20302
  });
20181
- const removeQuillBlotFormatter = () => {
20182
- console.log("removeQuillBlotFormatter");
20183
- try {
20184
- const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20185
- if (blotFormatter && blotFormatter.overlay) {
20186
- const overlay = blotFormatter.overlay;
20187
- if (overlay.parentNode) {
20188
- overlay.parentNode.removeChild(overlay);
20189
- }
20190
- }
20191
- }
20192
- catch (error) {
20193
- console.warn('移除blotFormatter overlay时出错:', error);
20194
- }
20195
- };
20196
- const handleGlobalClick = (event) => {
20197
- console.log("start handleGlobalClick");
20198
- if (!editor.value)
20199
- return;
20200
- const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20201
- if (!blotFormatter || !blotFormatter.overlay)
20202
- return;
20203
- const isClickInsideEditor = editor.value.contains(event.target);
20204
- console.log("isClickInsideEditor", isClickInsideEditor);
20205
- if (!isClickInsideEditor) {
20206
- removeQuillBlotFormatter();
20207
- }
20208
- };
20209
- const handleGlobalKeyup = (event) => {
20210
- if (event.keyCode !== 46 && event.keyCode !== 8)
20211
- return;
20212
- const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20213
- if (!blotFormatter || !blotFormatter.currentSpec)
20214
- return;
20215
- const target = event.target;
20216
- if (!editor.value || !editor.value.contains(target)) {
20217
- event.stopImmediatePropagation();
20218
- event.preventDefault();
20219
- return;
20220
- }
20221
- const allEditors = document.querySelectorAll('.quill-editor-container');
20222
- allEditors.forEach(editorElement => {
20223
- if (editorElement !== editor.value) {
20224
- const otherQuill = editorElement.__quill;
20225
- if (otherQuill && otherQuill !== quill) {
20226
- const otherBlotFormatter = otherQuill.getModule('blotFormatter');
20227
- if (otherBlotFormatter && otherBlotFormatter.currentSpec) {
20228
- otherBlotFormatter.hide();
20229
- }
20230
- }
20231
- }
20232
- });
20233
- };
20234
20303
  vue.onBeforeUnmount(() => {
20235
- window.removeEventListener('click', handleGlobalClick, true);
20236
- window.removeEventListener('keyup', handleGlobalKeyup, true);
20237
20304
  removeQuillBlotFormatter();
20238
20305
  quill = null;
20239
20306
  });
20240
20307
  let quill;
20241
20308
  let options;
20242
- const editor = vue.ref();
20243
- const showMoreToolbar = vue.ref(false);
20244
20309
  const editorWrapClass = vue.computed(() => {
20245
20310
  return {
20246
20311
  'quill-editor-container': true,
@@ -20267,35 +20332,8 @@
20267
20332
  }
20268
20333
  }
20269
20334
  };
20270
- const applyImageStyle = () => {
20271
- var _a;
20272
- if (quill) {
20273
- const editorElement = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.querySelector('.ql-editor');
20274
- if (editorElement) {
20275
- const images = editorElement.querySelectorAll('img');
20276
- images.forEach(img => {
20277
- img.style.maxWidth = '100%';
20278
- img.style.height = 'auto';
20279
- img.style.objectFit = 'contain';
20280
- });
20281
- }
20282
- }
20283
- };
20284
- const registerModule = (moduleName, module) => {
20285
- Quill.register(moduleName, module);
20286
- };
20287
- const initialize = () => {
20288
- var _a, _b;
20289
- if (!editor.value)
20290
- return;
20291
- registerModule('modules/blotFormatter', BlotFormatter);
20292
- options = composeOptions();
20293
- quill = new Quill(editor.value, options);
20294
- const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
20295
- if (toolbar) {
20296
- toolbar.style.display = 'none';
20297
- }
20298
- const icons = Quill.import('ui/icons');
20335
+ const setIcons = async () => {
20336
+ const icons = await Quill.import('ui/icons');
20299
20337
  icons['bold'] = boldSVG;
20300
20338
  icons['italic'] = italicSVG;
20301
20339
  icons['underline'] = underlineSVG;
@@ -20306,6 +20344,21 @@
20306
20344
  icons['ocr'] = ocrSVG;
20307
20345
  icons['math'] = mathSVG;
20308
20346
  icons['image'] = imageSVG;
20347
+ return icons;
20348
+ };
20349
+ const initialize = async () => {
20350
+ var _a, _b;
20351
+ if (!editor.value)
20352
+ return;
20353
+ registerBlotFormatter();
20354
+ options = composeOptions();
20355
+ await setIcons();
20356
+ quill = new Quill(editor.value, options);
20357
+ setQuill(quill);
20358
+ const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
20359
+ if (toolbar) {
20360
+ toolbar.style.display = 'none';
20361
+ }
20309
20362
  setContents(props.content);
20310
20363
  quill.on('text-change', handleTextChange);
20311
20364
  quill.on('selection-change', handleSelectionChange);
@@ -20324,30 +20377,7 @@
20324
20377
  applyToolbarStyle();
20325
20378
  }
20326
20379
  applyEditorStyle();
20327
- const blotFormatter = quill.getModule('blotFormatter');
20328
- if (blotFormatter) {
20329
- const originalShow = blotFormatter.show.bind(blotFormatter);
20330
- blotFormatter.show = function (spec) {
20331
- var _a;
20332
- originalShow(spec);
20333
- const target = (_a = this.currentSpec) === null || _a === void 0 ? void 0 : _a.getTargetElement();
20334
- if (target && target.tagName === 'IMG') {
20335
- target.style.maxWidth = '100%';
20336
- target.style.height = 'auto';
20337
- target.style.objectFit = 'contain';
20338
- const width = target.getAttribute('width');
20339
- if (width) {
20340
- const naturalWidth = target.naturalWidth;
20341
- const naturalHeight = target.naturalHeight;
20342
- if (naturalWidth && naturalHeight) {
20343
- const aspectRatio = naturalHeight / naturalWidth;
20344
- const newHeight = Math.round(parseInt(width) * aspectRatio);
20345
- target.setAttribute('height', '' + newHeight);
20346
- }
20347
- }
20348
- }
20349
- };
20350
- }
20380
+ configureBlotFormatter();
20351
20381
  ctx.emit('ready', quill);
20352
20382
  };
20353
20383
  const composeOptions = () => {
@@ -20390,9 +20420,7 @@
20390
20420
  },
20391
20421
  };
20392
20422
  }
20393
- clientOptions.modules = Object.assign({}, clientOptions.modules, {
20394
- blotFormatter: true
20395
- });
20423
+ clientOptions.modules = Object.assign({}, clientOptions.modules, getBlotFormatterConfig());
20396
20424
  return Object.assign({}, props.globalOptions, props.options, clientOptions);
20397
20425
  };
20398
20426
  const maybeClone = (delta) => {
@@ -20596,6 +20624,8 @@
20596
20624
  });
20597
20625
  return {
20598
20626
  editor,
20627
+ editorWrapClass,
20628
+ showMoreToolbar,
20599
20629
  getEditor,
20600
20630
  getToolbar,
20601
20631
  getQuill,
@@ -20608,8 +20638,6 @@
20608
20638
  getText,
20609
20639
  setText,
20610
20640
  reinit,
20611
- editorWrapClass,
20612
- showMoreToolbar,
20613
20641
  moreToolbarToolClick
20614
20642
  };
20615
20643
  },