pxx-vue-quill 1.0.90 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue-quill.umd.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2025 Pxx-Team
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2025-09-
|
|
10
|
+
* Date: 2025-09-08T14:19:47.300Z
|
|
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 = {};
|
|
@@ -18556,52 +18683,44 @@
|
|
|
18556
18683
|
|
|
18557
18684
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
|
|
18558
18685
|
|
|
18559
|
-
var Action = {};
|
|
18686
|
+
var Action$1 = {};
|
|
18560
18687
|
|
|
18561
|
-
|
|
18688
|
+
Object.defineProperty(Action$1, "__esModule", {
|
|
18689
|
+
value: true
|
|
18690
|
+
});
|
|
18562
18691
|
|
|
18563
|
-
function
|
|
18564
|
-
if (hasRequiredAction) return Action;
|
|
18565
|
-
hasRequiredAction = 1;
|
|
18692
|
+
var _createClass$2 = 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; }; }();
|
|
18566
18693
|
|
|
18567
|
-
|
|
18568
|
-
value: true
|
|
18569
|
-
});
|
|
18694
|
+
var _BlotFormatter$1 = requireBlotFormatter();
|
|
18570
18695
|
|
|
18571
|
-
|
|
18696
|
+
_interopRequireDefault$1(_BlotFormatter$1);
|
|
18572
18697
|
|
|
18573
|
-
|
|
18698
|
+
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18574
18699
|
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18700
|
+
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18578
18701
|
|
|
18579
|
-
|
|
18702
|
+
var Action = function () {
|
|
18703
|
+
function Action(formatter) {
|
|
18704
|
+
_classCallCheck$2(this, Action);
|
|
18580
18705
|
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
_classCallCheck(this, Action);
|
|
18584
|
-
|
|
18585
|
-
this.formatter = formatter;
|
|
18586
|
-
}
|
|
18706
|
+
this.formatter = formatter;
|
|
18707
|
+
}
|
|
18587
18708
|
|
|
18588
|
-
|
|
18589
|
-
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18709
|
+
_createClass$2(Action, [{
|
|
18710
|
+
key: 'onCreate',
|
|
18711
|
+
value: function onCreate() {}
|
|
18712
|
+
}, {
|
|
18713
|
+
key: 'onDestroy',
|
|
18714
|
+
value: function onDestroy() {}
|
|
18715
|
+
}, {
|
|
18716
|
+
key: 'onUpdate',
|
|
18717
|
+
value: function onUpdate() {}
|
|
18718
|
+
}]);
|
|
18598
18719
|
|
|
18599
|
-
|
|
18600
|
-
|
|
18720
|
+
return Action;
|
|
18721
|
+
}();
|
|
18601
18722
|
|
|
18602
|
-
|
|
18603
|
-
return Action;
|
|
18604
|
-
}
|
|
18723
|
+
Action$1.default = Action;
|
|
18605
18724
|
|
|
18606
18725
|
var hasRequiredBlotFormatter;
|
|
18607
18726
|
|
|
@@ -18623,7 +18742,7 @@
|
|
|
18623
18742
|
|
|
18624
18743
|
var _Options2 = _interopRequireDefault(_Options);
|
|
18625
18744
|
|
|
18626
|
-
var _Action =
|
|
18745
|
+
var _Action = Action$1;
|
|
18627
18746
|
|
|
18628
18747
|
_interopRequireDefault(_Action);
|
|
18629
18748
|
|
|
@@ -18781,11 +18900,11 @@
|
|
|
18781
18900
|
value: true
|
|
18782
18901
|
});
|
|
18783
18902
|
|
|
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; }; }();
|
|
18903
|
+
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
18904
|
|
|
18786
18905
|
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
18906
|
|
|
18788
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18907
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18789
18908
|
|
|
18790
18909
|
var LEFT_ALIGN = 'left';
|
|
18791
18910
|
var CENTER_ALIGN = 'center';
|
|
@@ -18796,7 +18915,7 @@
|
|
|
18796
18915
|
var _this = this,
|
|
18797
18916
|
_alignments;
|
|
18798
18917
|
|
|
18799
|
-
_classCallCheck(this, DefaultAligner);
|
|
18918
|
+
_classCallCheck$1(this, DefaultAligner);
|
|
18800
18919
|
|
|
18801
18920
|
this.applyStyle = options.aligner.applyStyle;
|
|
18802
18921
|
this.alignAttribute = options.attribute;
|
|
@@ -18824,7 +18943,7 @@
|
|
|
18824
18943
|
}), _alignments);
|
|
18825
18944
|
}
|
|
18826
18945
|
|
|
18827
|
-
_createClass(DefaultAligner, [{
|
|
18946
|
+
_createClass$1(DefaultAligner, [{
|
|
18828
18947
|
key: 'getAlignments',
|
|
18829
18948
|
value: function getAlignments() {
|
|
18830
18949
|
var _this2 = this;
|
|
@@ -19062,7 +19181,7 @@
|
|
|
19062
19181
|
|
|
19063
19182
|
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; }; }();
|
|
19064
19183
|
|
|
19065
|
-
var _Action2 =
|
|
19184
|
+
var _Action2 = Action$1;
|
|
19066
19185
|
|
|
19067
19186
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19068
19187
|
|
|
@@ -19127,190 +19246,182 @@
|
|
|
19127
19246
|
return AlignAction;
|
|
19128
19247
|
}
|
|
19129
19248
|
|
|
19130
|
-
var ResizeAction = {};
|
|
19131
|
-
|
|
19132
|
-
var hasRequiredResizeAction;
|
|
19133
|
-
|
|
19134
|
-
function requireResizeAction () {
|
|
19135
|
-
if (hasRequiredResizeAction) return ResizeAction;
|
|
19136
|
-
hasRequiredResizeAction = 1;
|
|
19249
|
+
var ResizeAction$1 = {};
|
|
19137
19250
|
|
|
19138
|
-
|
|
19139
|
-
|
|
19140
|
-
|
|
19251
|
+
Object.defineProperty(ResizeAction$1, "__esModule", {
|
|
19252
|
+
value: true
|
|
19253
|
+
});
|
|
19141
19254
|
|
|
19142
|
-
|
|
19255
|
+
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; }; }();
|
|
19143
19256
|
|
|
19144
|
-
|
|
19257
|
+
var _Action2 = Action$1;
|
|
19145
19258
|
|
|
19146
|
-
|
|
19259
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19147
19260
|
|
|
19148
|
-
|
|
19261
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19149
19262
|
|
|
19150
|
-
|
|
19263
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19151
19264
|
|
|
19152
|
-
|
|
19265
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19153
19266
|
|
|
19154
|
-
|
|
19267
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19155
19268
|
|
|
19156
|
-
|
|
19269
|
+
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; }
|
|
19157
19270
|
|
|
19158
|
-
|
|
19271
|
+
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; }
|
|
19159
19272
|
|
|
19160
|
-
|
|
19161
|
-
|
|
19273
|
+
var ResizeAction = function (_Action) {
|
|
19274
|
+
_inherits(ResizeAction, _Action);
|
|
19162
19275
|
|
|
19163
|
-
|
|
19164
|
-
|
|
19276
|
+
function ResizeAction(formatter) {
|
|
19277
|
+
_classCallCheck(this, ResizeAction);
|
|
19165
19278
|
|
|
19166
|
-
|
|
19279
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19167
19280
|
|
|
19168
|
-
|
|
19169
|
-
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19281
|
+
_this.onMouseDown = function (event) {
|
|
19282
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19283
|
+
return;
|
|
19284
|
+
}
|
|
19285
|
+
_this.dragHandle = event.target;
|
|
19286
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19174
19287
|
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19288
|
+
if (!_this.formatter.currentSpec) {
|
|
19289
|
+
return;
|
|
19290
|
+
}
|
|
19178
19291
|
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19292
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19293
|
+
if (!target) {
|
|
19294
|
+
return;
|
|
19295
|
+
}
|
|
19183
19296
|
|
|
19184
|
-
|
|
19297
|
+
var rect = target.getBoundingClientRect();
|
|
19185
19298
|
|
|
19186
|
-
|
|
19187
|
-
|
|
19188
|
-
|
|
19299
|
+
_this.dragStartX = event.clientX;
|
|
19300
|
+
_this.preDragWidth = rect.width;
|
|
19301
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19189
19302
|
|
|
19190
|
-
|
|
19191
|
-
|
|
19192
|
-
|
|
19303
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19304
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19305
|
+
};
|
|
19193
19306
|
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
|
|
19307
|
+
_this.onDrag = function (event) {
|
|
19308
|
+
if (!_this.formatter.currentSpec) {
|
|
19309
|
+
return;
|
|
19310
|
+
}
|
|
19198
19311
|
|
|
19199
|
-
|
|
19200
|
-
|
|
19201
|
-
|
|
19202
|
-
|
|
19312
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19313
|
+
if (!target) {
|
|
19314
|
+
return;
|
|
19315
|
+
}
|
|
19203
19316
|
|
|
19204
|
-
|
|
19205
|
-
|
|
19317
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19318
|
+
var newWidth = 0;
|
|
19206
19319
|
|
|
19207
|
-
|
|
19208
|
-
|
|
19209
|
-
|
|
19210
|
-
|
|
19211
|
-
|
|
19320
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19321
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19322
|
+
} else {
|
|
19323
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19324
|
+
}
|
|
19212
19325
|
|
|
19213
|
-
|
|
19326
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19214
19327
|
|
|
19215
|
-
|
|
19216
|
-
|
|
19328
|
+
target.setAttribute('width', '' + newWidth);
|
|
19329
|
+
target.setAttribute('height', '' + newHeight);
|
|
19217
19330
|
|
|
19218
|
-
|
|
19219
|
-
|
|
19331
|
+
_this.formatter.update();
|
|
19332
|
+
};
|
|
19220
19333
|
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19334
|
+
_this.onMouseUp = function () {
|
|
19335
|
+
_this.setCursor('');
|
|
19336
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19337
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19338
|
+
};
|
|
19226
19339
|
|
|
19227
|
-
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19340
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19341
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19342
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19343
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19344
|
+
_this.dragHandle = null;
|
|
19345
|
+
_this.dragStartX = 0;
|
|
19346
|
+
_this.preDragWidth = 0;
|
|
19347
|
+
_this.targetRatio = 0;
|
|
19348
|
+
return _this;
|
|
19349
|
+
}
|
|
19237
19350
|
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19351
|
+
_createClass(ResizeAction, [{
|
|
19352
|
+
key: 'onCreate',
|
|
19353
|
+
value: function onCreate() {
|
|
19354
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19355
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19356
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19357
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19245
19358
|
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
|
|
19252
|
-
|
|
19253
|
-
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19359
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19360
|
+
}
|
|
19361
|
+
}, {
|
|
19362
|
+
key: 'onDestroy',
|
|
19363
|
+
value: function onDestroy() {
|
|
19364
|
+
this.setCursor('');
|
|
19365
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19366
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19367
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19368
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19369
|
+
}
|
|
19370
|
+
}, {
|
|
19371
|
+
key: 'createHandle',
|
|
19372
|
+
value: function createHandle(position, cursor) {
|
|
19373
|
+
var box = document.createElement('div');
|
|
19374
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19375
|
+
box.setAttribute('data-position', position);
|
|
19376
|
+
box.style.cursor = cursor;
|
|
19377
|
+
|
|
19378
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19379
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19380
|
+
}
|
|
19268
19381
|
|
|
19269
|
-
|
|
19382
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19270
19383
|
|
|
19271
|
-
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19384
|
+
return box;
|
|
19385
|
+
}
|
|
19386
|
+
}, {
|
|
19387
|
+
key: 'repositionHandles',
|
|
19388
|
+
value: function repositionHandles(handleStyle) {
|
|
19389
|
+
var handleXOffset = '0px';
|
|
19390
|
+
var handleYOffset = '0px';
|
|
19391
|
+
if (handleStyle) {
|
|
19392
|
+
if (handleStyle.width) {
|
|
19393
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19394
|
+
}
|
|
19395
|
+
if (handleStyle.height) {
|
|
19396
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19397
|
+
}
|
|
19398
|
+
}
|
|
19286
19399
|
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19400
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19401
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19402
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19403
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19404
|
+
}
|
|
19405
|
+
}, {
|
|
19406
|
+
key: 'setCursor',
|
|
19407
|
+
value: function setCursor(value) {
|
|
19408
|
+
if (document.body) {
|
|
19409
|
+
document.body.style.cursor = value;
|
|
19410
|
+
}
|
|
19298
19411
|
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
-
|
|
19412
|
+
if (this.formatter.currentSpec) {
|
|
19413
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19414
|
+
if (target) {
|
|
19415
|
+
target.style.cursor = value;
|
|
19416
|
+
}
|
|
19417
|
+
}
|
|
19418
|
+
}
|
|
19419
|
+
}]);
|
|
19307
19420
|
|
|
19308
|
-
|
|
19309
|
-
|
|
19421
|
+
return ResizeAction;
|
|
19422
|
+
}(_Action3.default);
|
|
19310
19423
|
|
|
19311
|
-
|
|
19312
|
-
return ResizeAction;
|
|
19313
|
-
}
|
|
19424
|
+
ResizeAction$1.default = ResizeAction;
|
|
19314
19425
|
|
|
19315
19426
|
var DeleteAction = {};
|
|
19316
19427
|
|
|
@@ -19330,7 +19441,7 @@
|
|
|
19330
19441
|
|
|
19331
19442
|
var _quill2 = _interopRequireDefault(_quill);
|
|
19332
19443
|
|
|
19333
|
-
var _Action2 =
|
|
19444
|
+
var _Action2 = Action$1;
|
|
19334
19445
|
|
|
19335
19446
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19336
19447
|
|
|
@@ -19409,7 +19520,7 @@
|
|
|
19409
19520
|
|
|
19410
19521
|
_interopRequireDefault(_BlotFormatter);
|
|
19411
19522
|
|
|
19412
|
-
var _Action =
|
|
19523
|
+
var _Action = Action$1;
|
|
19413
19524
|
|
|
19414
19525
|
_interopRequireDefault(_Action);
|
|
19415
19526
|
|
|
@@ -19417,7 +19528,7 @@
|
|
|
19417
19528
|
|
|
19418
19529
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19419
19530
|
|
|
19420
|
-
var _ResizeAction =
|
|
19531
|
+
var _ResizeAction = ResizeAction$1;
|
|
19421
19532
|
|
|
19422
19533
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19423
19534
|
|
|
@@ -19865,7 +19976,7 @@
|
|
|
19865
19976
|
}
|
|
19866
19977
|
});
|
|
19867
19978
|
|
|
19868
|
-
var _Action =
|
|
19979
|
+
var _Action = Action$1;
|
|
19869
19980
|
|
|
19870
19981
|
Object.defineProperty(exports, 'Action', {
|
|
19871
19982
|
enumerable: true,
|
|
@@ -19910,7 +20021,7 @@
|
|
|
19910
20021
|
}
|
|
19911
20022
|
});
|
|
19912
20023
|
|
|
19913
|
-
var _ResizeAction =
|
|
20024
|
+
var _ResizeAction = ResizeAction$1;
|
|
19914
20025
|
|
|
19915
20026
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
19916
20027
|
enumerable: true,
|
|
@@ -19960,132 +20071,135 @@
|
|
|
19960
20071
|
|
|
19961
20072
|
var BlotFormatter = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
|
19962
20073
|
|
|
19963
|
-
|
|
19964
|
-
|
|
19965
|
-
|
|
19966
|
-
|
|
19967
|
-
|
|
19968
|
-
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
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
|
|
20074
|
+
function useBlotFormatter(editor) {
|
|
20075
|
+
const quillRef = vue.ref(null);
|
|
20076
|
+
const removeQuillBlotFormatter = () => {
|
|
20077
|
+
var _a;
|
|
20078
|
+
try {
|
|
20079
|
+
const blotFormatter = (_a = quillRef.value) === null || _a === void 0 ? void 0 : _a.getModule('blotFormatter');
|
|
20080
|
+
if (blotFormatter && blotFormatter.overlay) {
|
|
20081
|
+
const overlay = blotFormatter.overlay;
|
|
20082
|
+
if (overlay.parentNode) {
|
|
20083
|
+
overlay.parentNode.removeChild(overlay);
|
|
20084
|
+
}
|
|
19986
20085
|
}
|
|
19987
|
-
}
|
|
19988
|
-
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
20086
|
+
}
|
|
20087
|
+
catch (error) {
|
|
20088
|
+
console.warn('移除blotFormatter overlay时出错:', error);
|
|
20089
|
+
}
|
|
20090
|
+
};
|
|
20091
|
+
const handleGlobalClick = (event) => {
|
|
20092
|
+
var _a;
|
|
20093
|
+
if (!editor.value)
|
|
20094
|
+
return;
|
|
20095
|
+
const blotFormatter = (_a = quillRef.value) === null || _a === void 0 ? void 0 : _a.getModule('blotFormatter');
|
|
20096
|
+
if (!blotFormatter || !blotFormatter.overlay)
|
|
20097
|
+
return;
|
|
20098
|
+
const isClickInsideEditor = editor.value.contains(event.target);
|
|
20099
|
+
if (!isClickInsideEditor) {
|
|
20100
|
+
removeQuillBlotFormatter();
|
|
20101
|
+
}
|
|
20102
|
+
};
|
|
20103
|
+
const handleGlobalKeyup = (event) => {
|
|
20104
|
+
var _a;
|
|
20105
|
+
if (event.keyCode !== 46 && event.keyCode !== 8)
|
|
20106
|
+
return;
|
|
20107
|
+
const blotFormatter = (_a = quillRef.value) === null || _a === void 0 ? void 0 : _a.getModule('blotFormatter');
|
|
20108
|
+
if (!blotFormatter || !blotFormatter.currentSpec)
|
|
20109
|
+
return;
|
|
20110
|
+
const target = event.target;
|
|
20111
|
+
if (!editor.value || !editor.value.contains(target)) {
|
|
20112
|
+
event.stopImmediatePropagation();
|
|
20113
|
+
event.preventDefault();
|
|
20114
|
+
return;
|
|
20115
|
+
}
|
|
20116
|
+
const allEditors = document.querySelectorAll('.quill-editor-container');
|
|
20117
|
+
allEditors.forEach(editorElement => {
|
|
20118
|
+
if (editorElement !== editor.value) {
|
|
20119
|
+
const otherQuill = editorElement.__quill;
|
|
20120
|
+
if (otherQuill && otherQuill !== quillRef.value) {
|
|
20121
|
+
const otherBlotFormatter = otherQuill.getModule('blotFormatter');
|
|
20122
|
+
if (otherBlotFormatter && otherBlotFormatter.currentSpec) {
|
|
20123
|
+
otherBlotFormatter.hide();
|
|
20124
|
+
}
|
|
19992
20125
|
}
|
|
19993
|
-
}
|
|
19994
|
-
|
|
19995
|
-
|
|
19996
|
-
|
|
19997
|
-
|
|
19998
|
-
|
|
19999
|
-
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20009
|
-
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20017
|
-
|
|
20018
|
-
|
|
20019
|
-
|
|
20020
|
-
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
|
|
20025
|
-
|
|
20026
|
-
|
|
20027
|
-
|
|
20028
|
-
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20065
|
-
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
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
|
-
});
|
|
20126
|
+
}
|
|
20127
|
+
});
|
|
20128
|
+
};
|
|
20129
|
+
const configureBlotFormatter = () => {
|
|
20130
|
+
if (!quillRef.value)
|
|
20131
|
+
return;
|
|
20132
|
+
const blotFormatter = quillRef.value.getModule('blotFormatter');
|
|
20133
|
+
if (blotFormatter) {
|
|
20134
|
+
const originalShow = blotFormatter.show.bind(blotFormatter);
|
|
20135
|
+
blotFormatter.show = function (spec) {
|
|
20136
|
+
var _a;
|
|
20137
|
+
originalShow(spec);
|
|
20138
|
+
const target = (_a = this.currentSpec) === null || _a === void 0 ? void 0 : _a.getTargetElement();
|
|
20139
|
+
if (target && target.tagName === 'IMG') {
|
|
20140
|
+
target.style.maxWidth = '100%';
|
|
20141
|
+
target.style.height = 'auto';
|
|
20142
|
+
target.style.objectFit = 'contain';
|
|
20143
|
+
const width = target.getAttribute('width');
|
|
20144
|
+
if (width) {
|
|
20145
|
+
const naturalWidth = target.naturalWidth;
|
|
20146
|
+
const naturalHeight = target.naturalHeight;
|
|
20147
|
+
if (naturalWidth && naturalHeight) {
|
|
20148
|
+
const aspectRatio = naturalHeight / naturalWidth;
|
|
20149
|
+
const newHeight = Math.round(parseInt(width) * aspectRatio);
|
|
20150
|
+
target.setAttribute('height', '' + newHeight);
|
|
20151
|
+
}
|
|
20152
|
+
}
|
|
20153
|
+
}
|
|
20154
|
+
};
|
|
20155
|
+
}
|
|
20156
|
+
};
|
|
20157
|
+
const applyImageStyle = () => {
|
|
20158
|
+
var _a;
|
|
20159
|
+
if (!quillRef.value)
|
|
20160
|
+
return;
|
|
20161
|
+
const editorElement = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.querySelector('.ql-editor');
|
|
20162
|
+
if (editorElement) {
|
|
20163
|
+
const images = editorElement.querySelectorAll('img');
|
|
20164
|
+
images.forEach(img => {
|
|
20165
|
+
img.style.maxWidth = '100%';
|
|
20166
|
+
img.style.height = 'auto';
|
|
20167
|
+
img.style.objectFit = 'contain';
|
|
20168
|
+
});
|
|
20169
|
+
}
|
|
20170
|
+
};
|
|
20171
|
+
const registerBlotFormatter = () => {
|
|
20172
|
+
Quill.register('modules/blotFormatter', BlotFormatter);
|
|
20173
|
+
};
|
|
20174
|
+
const getBlotFormatterConfig = () => {
|
|
20175
|
+
return {
|
|
20176
|
+
blotFormatter: true
|
|
20177
|
+
};
|
|
20178
|
+
};
|
|
20179
|
+
vue.onMounted(() => {
|
|
20180
|
+
window.addEventListener('click', handleGlobalClick, true);
|
|
20181
|
+
window.addEventListener('keyup', handleGlobalKeyup, true);
|
|
20182
|
+
});
|
|
20183
|
+
vue.onBeforeUnmount(() => {
|
|
20184
|
+
window.removeEventListener('click', handleGlobalClick, true);
|
|
20185
|
+
window.removeEventListener('keyup', handleGlobalKeyup, true);
|
|
20186
|
+
removeQuillBlotFormatter();
|
|
20187
|
+
});
|
|
20188
|
+
const setQuill = (quillInstance) => {
|
|
20189
|
+
quillRef.value = quillInstance;
|
|
20190
|
+
};
|
|
20191
|
+
return {
|
|
20192
|
+
quillRef,
|
|
20193
|
+
setQuill,
|
|
20194
|
+
removeQuillBlotFormatter,
|
|
20195
|
+
handleGlobalClick,
|
|
20196
|
+
handleGlobalKeyup,
|
|
20197
|
+
configureBlotFormatter,
|
|
20198
|
+
applyImageStyle,
|
|
20199
|
+
registerBlotFormatter,
|
|
20200
|
+
getBlotFormatterConfig
|
|
20201
|
+
};
|
|
20202
|
+
}
|
|
20089
20203
|
|
|
20090
20204
|
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
20205
|
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 +20208,8 @@
|
|
|
20094
20208
|
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
20209
|
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
20210
|
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="
|
|
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="
|
|
20211
|
+
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>`;
|
|
20212
|
+
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
20213
|
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
20214
|
|
|
20101
20215
|
const QuillEditor = vue.defineComponent({
|
|
@@ -20172,71 +20286,18 @@
|
|
|
20172
20286
|
'image',
|
|
20173
20287
|
],
|
|
20174
20288
|
setup: (props, ctx) => {
|
|
20289
|
+
const editor = vue.ref();
|
|
20290
|
+
const showMoreToolbar = vue.ref(false);
|
|
20291
|
+
const { setQuill, removeQuillBlotFormatter, configureBlotFormatter, applyImageStyle, registerBlotFormatter, getBlotFormatterConfig } = useBlotFormatter(editor);
|
|
20175
20292
|
vue.onMounted(() => {
|
|
20176
20293
|
initialize();
|
|
20177
|
-
window.addEventListener('click', handleGlobalClick, true);
|
|
20178
|
-
window.addEventListener('keyup', handleGlobalKeyup, true);
|
|
20179
20294
|
});
|
|
20180
|
-
const removeQuillBlotFormatter = () => {
|
|
20181
|
-
try {
|
|
20182
|
-
const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
|
|
20183
|
-
if (blotFormatter && blotFormatter.overlay) {
|
|
20184
|
-
const overlay = blotFormatter.overlay;
|
|
20185
|
-
if (overlay.parentNode) {
|
|
20186
|
-
overlay.parentNode.removeChild(overlay);
|
|
20187
|
-
}
|
|
20188
|
-
}
|
|
20189
|
-
}
|
|
20190
|
-
catch (error) {
|
|
20191
|
-
console.warn('移除blotFormatter overlay时出错:', error);
|
|
20192
|
-
}
|
|
20193
|
-
};
|
|
20194
|
-
const handleGlobalClick = (event) => {
|
|
20195
|
-
if (!editor.value)
|
|
20196
|
-
return;
|
|
20197
|
-
const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
|
|
20198
|
-
if (!blotFormatter || !blotFormatter.overlay)
|
|
20199
|
-
return;
|
|
20200
|
-
const isClickInsideEditor = editor.value.contains(event.target);
|
|
20201
|
-
if (!isClickInsideEditor) {
|
|
20202
|
-
removeQuillBlotFormatter();
|
|
20203
|
-
}
|
|
20204
|
-
};
|
|
20205
|
-
const handleGlobalKeyup = (event) => {
|
|
20206
|
-
if (event.keyCode !== 46 && event.keyCode !== 8)
|
|
20207
|
-
return;
|
|
20208
|
-
const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
|
|
20209
|
-
if (!blotFormatter || !blotFormatter.currentSpec)
|
|
20210
|
-
return;
|
|
20211
|
-
const target = event.target;
|
|
20212
|
-
if (!editor.value || !editor.value.contains(target)) {
|
|
20213
|
-
event.stopImmediatePropagation();
|
|
20214
|
-
event.preventDefault();
|
|
20215
|
-
return;
|
|
20216
|
-
}
|
|
20217
|
-
const allEditors = document.querySelectorAll('.quill-editor-container');
|
|
20218
|
-
allEditors.forEach(editorElement => {
|
|
20219
|
-
if (editorElement !== editor.value) {
|
|
20220
|
-
const otherQuill = editorElement.__quill;
|
|
20221
|
-
if (otherQuill && otherQuill !== quill) {
|
|
20222
|
-
const otherBlotFormatter = otherQuill.getModule('blotFormatter');
|
|
20223
|
-
if (otherBlotFormatter && otherBlotFormatter.currentSpec) {
|
|
20224
|
-
otherBlotFormatter.hide();
|
|
20225
|
-
}
|
|
20226
|
-
}
|
|
20227
|
-
}
|
|
20228
|
-
});
|
|
20229
|
-
};
|
|
20230
20295
|
vue.onBeforeUnmount(() => {
|
|
20231
|
-
window.removeEventListener('click', handleGlobalClick, true);
|
|
20232
|
-
window.removeEventListener('keyup', handleGlobalKeyup, true);
|
|
20233
20296
|
removeQuillBlotFormatter();
|
|
20234
20297
|
quill = null;
|
|
20235
20298
|
});
|
|
20236
20299
|
let quill;
|
|
20237
20300
|
let options;
|
|
20238
|
-
const editor = vue.ref();
|
|
20239
|
-
const showMoreToolbar = vue.ref(false);
|
|
20240
20301
|
const editorWrapClass = vue.computed(() => {
|
|
20241
20302
|
return {
|
|
20242
20303
|
'quill-editor-container': true,
|
|
@@ -20263,45 +20324,39 @@
|
|
|
20263
20324
|
}
|
|
20264
20325
|
}
|
|
20265
20326
|
};
|
|
20266
|
-
const
|
|
20267
|
-
|
|
20268
|
-
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20327
|
+
const setIcons = () => {
|
|
20328
|
+
try {
|
|
20329
|
+
const icons = Quill.import('ui/icons');
|
|
20330
|
+
if (icons) {
|
|
20331
|
+
icons['bold'] = boldSVG;
|
|
20332
|
+
icons['italic'] = italicSVG;
|
|
20333
|
+
icons['underline'] = underlineSVG;
|
|
20334
|
+
icons['more'] = moreSVG;
|
|
20335
|
+
icons['link'] = linkSVG;
|
|
20336
|
+
icons['undo'] = undoSVG;
|
|
20337
|
+
icons['redo'] = redoSVG;
|
|
20338
|
+
icons['ocr'] = ocrSVG;
|
|
20339
|
+
icons['math'] = mathSVG;
|
|
20340
|
+
icons['image'] = imageSVG;
|
|
20277
20341
|
}
|
|
20278
20342
|
}
|
|
20279
|
-
|
|
20280
|
-
|
|
20281
|
-
|
|
20343
|
+
catch (error) {
|
|
20344
|
+
console.warn('设置图标时出错:', error);
|
|
20345
|
+
}
|
|
20282
20346
|
};
|
|
20283
20347
|
const initialize = () => {
|
|
20284
20348
|
var _a, _b;
|
|
20285
20349
|
if (!editor.value)
|
|
20286
20350
|
return;
|
|
20287
|
-
|
|
20351
|
+
registerBlotFormatter();
|
|
20288
20352
|
options = composeOptions();
|
|
20353
|
+
setIcons();
|
|
20289
20354
|
quill = new Quill(editor.value, options);
|
|
20355
|
+
setQuill(quill);
|
|
20290
20356
|
const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
|
|
20291
20357
|
if (toolbar) {
|
|
20292
20358
|
toolbar.style.display = 'none';
|
|
20293
20359
|
}
|
|
20294
|
-
const icons = Quill.import('ui/icons');
|
|
20295
|
-
icons['bold'] = boldSVG;
|
|
20296
|
-
icons['italic'] = italicSVG;
|
|
20297
|
-
icons['underline'] = underlineSVG;
|
|
20298
|
-
icons['more'] = moreSVG;
|
|
20299
|
-
icons['link'] = linkSVG;
|
|
20300
|
-
icons['undo'] = undoSVG;
|
|
20301
|
-
icons['redo'] = redoSVG;
|
|
20302
|
-
icons['ocr'] = ocrSVG;
|
|
20303
|
-
icons['math'] = mathSVG;
|
|
20304
|
-
icons['image'] = imageSVG;
|
|
20305
20360
|
setContents(props.content);
|
|
20306
20361
|
quill.on('text-change', handleTextChange);
|
|
20307
20362
|
quill.on('selection-change', handleSelectionChange);
|
|
@@ -20320,30 +20375,7 @@
|
|
|
20320
20375
|
applyToolbarStyle();
|
|
20321
20376
|
}
|
|
20322
20377
|
applyEditorStyle();
|
|
20323
|
-
|
|
20324
|
-
if (blotFormatter) {
|
|
20325
|
-
const originalShow = blotFormatter.show.bind(blotFormatter);
|
|
20326
|
-
blotFormatter.show = function (spec) {
|
|
20327
|
-
var _a;
|
|
20328
|
-
originalShow(spec);
|
|
20329
|
-
const target = (_a = this.currentSpec) === null || _a === void 0 ? void 0 : _a.getTargetElement();
|
|
20330
|
-
if (target && target.tagName === 'IMG') {
|
|
20331
|
-
target.style.maxWidth = '100%';
|
|
20332
|
-
target.style.height = 'auto';
|
|
20333
|
-
target.style.objectFit = 'contain';
|
|
20334
|
-
const width = target.getAttribute('width');
|
|
20335
|
-
if (width) {
|
|
20336
|
-
const naturalWidth = target.naturalWidth;
|
|
20337
|
-
const naturalHeight = target.naturalHeight;
|
|
20338
|
-
if (naturalWidth && naturalHeight) {
|
|
20339
|
-
const aspectRatio = naturalHeight / naturalWidth;
|
|
20340
|
-
const newHeight = Math.round(parseInt(width) * aspectRatio);
|
|
20341
|
-
target.setAttribute('height', '' + newHeight);
|
|
20342
|
-
}
|
|
20343
|
-
}
|
|
20344
|
-
}
|
|
20345
|
-
};
|
|
20346
|
-
}
|
|
20378
|
+
configureBlotFormatter();
|
|
20347
20379
|
ctx.emit('ready', quill);
|
|
20348
20380
|
};
|
|
20349
20381
|
const composeOptions = () => {
|
|
@@ -20386,9 +20418,7 @@
|
|
|
20386
20418
|
},
|
|
20387
20419
|
};
|
|
20388
20420
|
}
|
|
20389
|
-
clientOptions.modules = Object.assign({}, clientOptions.modules,
|
|
20390
|
-
blotFormatter: true
|
|
20391
|
-
});
|
|
20421
|
+
clientOptions.modules = Object.assign({}, clientOptions.modules, getBlotFormatterConfig());
|
|
20392
20422
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
20393
20423
|
};
|
|
20394
20424
|
const maybeClone = (delta) => {
|
|
@@ -20592,6 +20622,8 @@
|
|
|
20592
20622
|
});
|
|
20593
20623
|
return {
|
|
20594
20624
|
editor,
|
|
20625
|
+
editorWrapClass,
|
|
20626
|
+
showMoreToolbar,
|
|
20595
20627
|
getEditor,
|
|
20596
20628
|
getToolbar,
|
|
20597
20629
|
getQuill,
|
|
@@ -20604,8 +20636,6 @@
|
|
|
20604
20636
|
getText,
|
|
20605
20637
|
setText,
|
|
20606
20638
|
reinit,
|
|
20607
|
-
editorWrapClass,
|
|
20608
|
-
showMoreToolbar,
|
|
20609
20639
|
moreToolbarToolClick
|
|
20610
20640
|
};
|
|
20611
20641
|
},
|