pxx-vue-quill 1.0.17 → 1.0.19

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,9 +7,9 @@
7
7
  *
8
8
  * Copyright (c) 2025 Pxx-Team
9
9
  * Released under the MIT license
10
- * Date: 2025-08-25T02:25:20.932Z
10
+ * Date: 2025-08-26T02:18:21.558Z
11
11
  */
12
- import { defineComponent, onMounted, onBeforeUnmount, ref, computed, watch, nextTick, h } from 'vue';
12
+ import { defineComponent, h, onMounted, onBeforeUnmount, ref, computed, watch, nextTick } from 'vue';
13
13
 
14
14
  var global$1 = (typeof global !== "undefined" ? global :
15
15
  typeof self !== "undefined" ? self :
@@ -18437,19 +18437,31 @@ var Delta_1 = Delta;
18437
18437
  var Delta$1 = Delta_1;
18438
18438
 
18439
18439
  const toolbarOptions = {
18440
+ // 完整的工具栏
18440
18441
  full: [
18441
- // ['bold', 'italic', 'underline', 'strike'], // toggled buttons
18442
18442
  ['bold', 'italic', 'underline'],
18443
+ [{ color: [] }],
18444
+ ['link'],
18443
18445
  [{ list: 'ordered' }, { list: 'bullet' }],
18444
- // [{ direction: 'rtl' }], // text direction
18445
- // [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown
18446
- // [{ header: [1, 2, 3, 4, 5, 6, false] }],
18447
- [{ color: [] }, { background: [] }],
18448
- // [{ font: [] }],
18449
- // [{ align: [] }],
18450
18446
  ['image'],
18451
- // ['clean'], // remove formatting button
18447
+ ['undo', 'redo'],
18448
+ ['math'],
18449
+ ['ocr'],
18452
18450
  ],
18451
+ // 如果编辑器宽度不够,就显示短的工具栏
18452
+ short: [
18453
+ ['bold', 'italic', 'underline'],
18454
+ [{ color: [] }],
18455
+ ['link'],
18456
+ ['more']
18457
+ ],
18458
+ // 点击更多显示的第二栏工具
18459
+ extend: [
18460
+ [{ list: 'ordered' }, { list: 'bullet' }],
18461
+ ['image'],
18462
+ ['undo', 'redo'],
18463
+ ['math'],
18464
+ ]
18453
18465
  };
18454
18466
 
18455
18467
  var dist = {};
@@ -18555,44 +18567,52 @@ var es = /*#__PURE__*/Object.freeze({
18555
18567
 
18556
18568
  var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
18557
18569
 
18558
- var Action$1 = {};
18570
+ var Action = {};
18559
18571
 
18560
- Object.defineProperty(Action$1, "__esModule", {
18561
- value: true
18562
- });
18572
+ var hasRequiredAction;
18563
18573
 
18564
- 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; }; }();
18574
+ function requireAction () {
18575
+ if (hasRequiredAction) return Action;
18576
+ hasRequiredAction = 1;
18565
18577
 
18566
- var _BlotFormatter$1 = requireBlotFormatter();
18578
+ Object.defineProperty(Action, "__esModule", {
18579
+ value: true
18580
+ });
18567
18581
 
18568
- _interopRequireDefault$1(_BlotFormatter$1);
18582
+ 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; }; }();
18569
18583
 
18570
- function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18584
+ var _BlotFormatter = requireBlotFormatter();
18571
18585
 
18572
- function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18586
+ _interopRequireDefault(_BlotFormatter);
18573
18587
 
18574
- var Action = function () {
18575
- function Action(formatter) {
18576
- _classCallCheck$2(this, Action);
18588
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18577
18589
 
18578
- this.formatter = formatter;
18579
- }
18590
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18580
18591
 
18581
- _createClass$2(Action, [{
18582
- key: 'onCreate',
18583
- value: function onCreate() {}
18584
- }, {
18585
- key: 'onDestroy',
18586
- value: function onDestroy() {}
18587
- }, {
18588
- key: 'onUpdate',
18589
- value: function onUpdate() {}
18590
- }]);
18592
+ var Action$1 = function () {
18593
+ function Action(formatter) {
18594
+ _classCallCheck(this, Action);
18591
18595
 
18592
- return Action;
18593
- }();
18596
+ this.formatter = formatter;
18597
+ }
18598
+
18599
+ _createClass(Action, [{
18600
+ key: 'onCreate',
18601
+ value: function onCreate() {}
18602
+ }, {
18603
+ key: 'onDestroy',
18604
+ value: function onDestroy() {}
18605
+ }, {
18606
+ key: 'onUpdate',
18607
+ value: function onUpdate() {}
18608
+ }]);
18594
18609
 
18595
- Action$1.default = Action;
18610
+ return Action;
18611
+ }();
18612
+
18613
+ Action.default = Action$1;
18614
+ return Action;
18615
+ }
18596
18616
 
18597
18617
  var hasRequiredBlotFormatter;
18598
18618
 
@@ -18614,7 +18634,7 @@ function requireBlotFormatter () {
18614
18634
 
18615
18635
  var _Options2 = _interopRequireDefault(_Options);
18616
18636
 
18617
- var _Action = Action$1;
18637
+ var _Action = requireAction();
18618
18638
 
18619
18639
  _interopRequireDefault(_Action);
18620
18640
 
@@ -18772,11 +18792,11 @@ Object.defineProperty(DefaultAligner$1, "__esModule", {
18772
18792
  value: true
18773
18793
  });
18774
18794
 
18775
- 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; }; }();
18795
+ 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; }; }();
18776
18796
 
18777
18797
  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; }
18778
18798
 
18779
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18799
+ function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18780
18800
 
18781
18801
  var LEFT_ALIGN = 'left';
18782
18802
  var CENTER_ALIGN = 'center';
@@ -18787,7 +18807,7 @@ var DefaultAligner = function () {
18787
18807
  var _this = this,
18788
18808
  _alignments;
18789
18809
 
18790
- _classCallCheck$1(this, DefaultAligner);
18810
+ _classCallCheck$2(this, DefaultAligner);
18791
18811
 
18792
18812
  this.applyStyle = options.aligner.applyStyle;
18793
18813
  this.alignAttribute = options.attribute;
@@ -18815,7 +18835,7 @@ var DefaultAligner = function () {
18815
18835
  }), _alignments);
18816
18836
  }
18817
18837
 
18818
- _createClass$1(DefaultAligner, [{
18838
+ _createClass$2(DefaultAligner, [{
18819
18839
  key: 'getAlignments',
18820
18840
  value: function getAlignments() {
18821
18841
  var _this2 = this;
@@ -19053,7 +19073,7 @@ function requireAlignAction () {
19053
19073
 
19054
19074
  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; }; }();
19055
19075
 
19056
- var _Action2 = Action$1;
19076
+ var _Action2 = requireAction();
19057
19077
 
19058
19078
  var _Action3 = _interopRequireDefault(_Action2);
19059
19079
 
@@ -19118,190 +19138,182 @@ function requireAlignAction () {
19118
19138
  return AlignAction;
19119
19139
  }
19120
19140
 
19121
- var ResizeAction = {};
19122
-
19123
- var hasRequiredResizeAction;
19124
-
19125
- function requireResizeAction () {
19126
- if (hasRequiredResizeAction) return ResizeAction;
19127
- hasRequiredResizeAction = 1;
19141
+ var ResizeAction$1 = {};
19128
19142
 
19129
- Object.defineProperty(ResizeAction, "__esModule", {
19130
- value: true
19131
- });
19143
+ Object.defineProperty(ResizeAction$1, "__esModule", {
19144
+ value: true
19145
+ });
19132
19146
 
19133
- 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; }; }();
19147
+ 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; }; }();
19134
19148
 
19135
- var _Action2 = Action$1;
19149
+ var _Action2 = requireAction();
19136
19150
 
19137
- var _Action3 = _interopRequireDefault(_Action2);
19151
+ var _Action3 = _interopRequireDefault$1(_Action2);
19138
19152
 
19139
- var _BlotFormatter = requireBlotFormatter();
19153
+ var _BlotFormatter$1 = requireBlotFormatter();
19140
19154
 
19141
- _interopRequireDefault(_BlotFormatter);
19155
+ _interopRequireDefault$1(_BlotFormatter$1);
19142
19156
 
19143
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19157
+ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19144
19158
 
19145
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19159
+ function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19146
19160
 
19147
- 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; }
19161
+ function _possibleConstructorReturn$1(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; }
19148
19162
 
19149
- 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; }
19163
+ function _inherits$1(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; }
19150
19164
 
19151
- var ResizeAction$1 = function (_Action) {
19152
- _inherits(ResizeAction, _Action);
19165
+ var ResizeAction = function (_Action) {
19166
+ _inherits$1(ResizeAction, _Action);
19153
19167
 
19154
- function ResizeAction(formatter) {
19155
- _classCallCheck(this, ResizeAction);
19168
+ function ResizeAction(formatter) {
19169
+ _classCallCheck$1(this, ResizeAction);
19156
19170
 
19157
- var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
19171
+ var _this = _possibleConstructorReturn$1(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
19158
19172
 
19159
- _this.onMouseDown = function (event) {
19160
- if (!(event.target instanceof HTMLElement)) {
19161
- return;
19162
- }
19163
- _this.dragHandle = event.target;
19164
- _this.setCursor(_this.dragHandle.style.cursor);
19173
+ _this.onMouseDown = function (event) {
19174
+ if (!(event.target instanceof HTMLElement)) {
19175
+ return;
19176
+ }
19177
+ _this.dragHandle = event.target;
19178
+ _this.setCursor(_this.dragHandle.style.cursor);
19165
19179
 
19166
- if (!_this.formatter.currentSpec) {
19167
- return;
19168
- }
19180
+ if (!_this.formatter.currentSpec) {
19181
+ return;
19182
+ }
19169
19183
 
19170
- var target = _this.formatter.currentSpec.getTargetElement();
19171
- if (!target) {
19172
- return;
19173
- }
19184
+ var target = _this.formatter.currentSpec.getTargetElement();
19185
+ if (!target) {
19186
+ return;
19187
+ }
19174
19188
 
19175
- var rect = target.getBoundingClientRect();
19189
+ var rect = target.getBoundingClientRect();
19176
19190
 
19177
- _this.dragStartX = event.clientX;
19178
- _this.preDragWidth = rect.width;
19179
- _this.targetRatio = rect.height / rect.width;
19191
+ _this.dragStartX = event.clientX;
19192
+ _this.preDragWidth = rect.width;
19193
+ _this.targetRatio = rect.height / rect.width;
19180
19194
 
19181
- document.addEventListener('mousemove', _this.onDrag);
19182
- document.addEventListener('mouseup', _this.onMouseUp);
19183
- };
19195
+ document.addEventListener('mousemove', _this.onDrag);
19196
+ document.addEventListener('mouseup', _this.onMouseUp);
19197
+ };
19184
19198
 
19185
- _this.onDrag = function (event) {
19186
- if (!_this.formatter.currentSpec) {
19187
- return;
19188
- }
19199
+ _this.onDrag = function (event) {
19200
+ if (!_this.formatter.currentSpec) {
19201
+ return;
19202
+ }
19189
19203
 
19190
- var target = _this.formatter.currentSpec.getTargetElement();
19191
- if (!target) {
19192
- return;
19193
- }
19204
+ var target = _this.formatter.currentSpec.getTargetElement();
19205
+ if (!target) {
19206
+ return;
19207
+ }
19194
19208
 
19195
- var deltaX = event.clientX - _this.dragStartX;
19196
- var newWidth = 0;
19209
+ var deltaX = event.clientX - _this.dragStartX;
19210
+ var newWidth = 0;
19197
19211
 
19198
- if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
19199
- newWidth = Math.round(_this.preDragWidth - deltaX);
19200
- } else {
19201
- newWidth = Math.round(_this.preDragWidth + deltaX);
19202
- }
19212
+ if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
19213
+ newWidth = Math.round(_this.preDragWidth - deltaX);
19214
+ } else {
19215
+ newWidth = Math.round(_this.preDragWidth + deltaX);
19216
+ }
19203
19217
 
19204
- var newHeight = _this.targetRatio * newWidth;
19218
+ var newHeight = _this.targetRatio * newWidth;
19205
19219
 
19206
- target.setAttribute('width', '' + newWidth);
19207
- target.setAttribute('height', '' + newHeight);
19220
+ target.setAttribute('width', '' + newWidth);
19221
+ target.setAttribute('height', '' + newHeight);
19208
19222
 
19209
- _this.formatter.update();
19210
- };
19223
+ _this.formatter.update();
19224
+ };
19211
19225
 
19212
- _this.onMouseUp = function () {
19213
- _this.setCursor('');
19214
- document.removeEventListener('mousemove', _this.onDrag);
19215
- document.removeEventListener('mouseup', _this.onMouseUp);
19216
- };
19226
+ _this.onMouseUp = function () {
19227
+ _this.setCursor('');
19228
+ document.removeEventListener('mousemove', _this.onDrag);
19229
+ document.removeEventListener('mouseup', _this.onMouseUp);
19230
+ };
19217
19231
 
19218
- _this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
19219
- _this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
19220
- _this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
19221
- _this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
19222
- _this.dragHandle = null;
19223
- _this.dragStartX = 0;
19224
- _this.preDragWidth = 0;
19225
- _this.targetRatio = 0;
19226
- return _this;
19227
- }
19232
+ _this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
19233
+ _this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
19234
+ _this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
19235
+ _this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
19236
+ _this.dragHandle = null;
19237
+ _this.dragStartX = 0;
19238
+ _this.preDragWidth = 0;
19239
+ _this.targetRatio = 0;
19240
+ return _this;
19241
+ }
19228
19242
 
19229
- _createClass(ResizeAction, [{
19230
- key: 'onCreate',
19231
- value: function onCreate() {
19232
- this.formatter.overlay.appendChild(this.topLeftHandle);
19233
- this.formatter.overlay.appendChild(this.topRightHandle);
19234
- this.formatter.overlay.appendChild(this.bottomRightHandle);
19235
- this.formatter.overlay.appendChild(this.bottomLeftHandle);
19243
+ _createClass$1(ResizeAction, [{
19244
+ key: 'onCreate',
19245
+ value: function onCreate() {
19246
+ this.formatter.overlay.appendChild(this.topLeftHandle);
19247
+ this.formatter.overlay.appendChild(this.topRightHandle);
19248
+ this.formatter.overlay.appendChild(this.bottomRightHandle);
19249
+ this.formatter.overlay.appendChild(this.bottomLeftHandle);
19236
19250
 
19237
- this.repositionHandles(this.formatter.options.resize.handleStyle);
19238
- }
19239
- }, {
19240
- key: 'onDestroy',
19241
- value: function onDestroy() {
19242
- this.setCursor('');
19243
- this.formatter.overlay.removeChild(this.topLeftHandle);
19244
- this.formatter.overlay.removeChild(this.topRightHandle);
19245
- this.formatter.overlay.removeChild(this.bottomRightHandle);
19246
- this.formatter.overlay.removeChild(this.bottomLeftHandle);
19247
- }
19248
- }, {
19249
- key: 'createHandle',
19250
- value: function createHandle(position, cursor) {
19251
- var box = document.createElement('div');
19252
- box.classList.add(this.formatter.options.resize.handleClassName);
19253
- box.setAttribute('data-position', position);
19254
- box.style.cursor = cursor;
19255
-
19256
- if (this.formatter.options.resize.handleStyle) {
19257
- Object.assign(box.style, this.formatter.options.resize.handleStyle);
19258
- }
19251
+ this.repositionHandles(this.formatter.options.resize.handleStyle);
19252
+ }
19253
+ }, {
19254
+ key: 'onDestroy',
19255
+ value: function onDestroy() {
19256
+ this.setCursor('');
19257
+ this.formatter.overlay.removeChild(this.topLeftHandle);
19258
+ this.formatter.overlay.removeChild(this.topRightHandle);
19259
+ this.formatter.overlay.removeChild(this.bottomRightHandle);
19260
+ this.formatter.overlay.removeChild(this.bottomLeftHandle);
19261
+ }
19262
+ }, {
19263
+ key: 'createHandle',
19264
+ value: function createHandle(position, cursor) {
19265
+ var box = document.createElement('div');
19266
+ box.classList.add(this.formatter.options.resize.handleClassName);
19267
+ box.setAttribute('data-position', position);
19268
+ box.style.cursor = cursor;
19269
+
19270
+ if (this.formatter.options.resize.handleStyle) {
19271
+ Object.assign(box.style, this.formatter.options.resize.handleStyle);
19272
+ }
19259
19273
 
19260
- box.addEventListener('mousedown', this.onMouseDown);
19274
+ box.addEventListener('mousedown', this.onMouseDown);
19261
19275
 
19262
- return box;
19263
- }
19264
- }, {
19265
- key: 'repositionHandles',
19266
- value: function repositionHandles(handleStyle) {
19267
- var handleXOffset = '0px';
19268
- var handleYOffset = '0px';
19269
- if (handleStyle) {
19270
- if (handleStyle.width) {
19271
- handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
19272
- }
19273
- if (handleStyle.height) {
19274
- handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
19275
- }
19276
- }
19276
+ return box;
19277
+ }
19278
+ }, {
19279
+ key: 'repositionHandles',
19280
+ value: function repositionHandles(handleStyle) {
19281
+ var handleXOffset = '0px';
19282
+ var handleYOffset = '0px';
19283
+ if (handleStyle) {
19284
+ if (handleStyle.width) {
19285
+ handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
19286
+ }
19287
+ if (handleStyle.height) {
19288
+ handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
19289
+ }
19290
+ }
19277
19291
 
19278
- Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
19279
- Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
19280
- Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
19281
- Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
19282
- }
19283
- }, {
19284
- key: 'setCursor',
19285
- value: function setCursor(value) {
19286
- if (document.body) {
19287
- document.body.style.cursor = value;
19288
- }
19292
+ Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
19293
+ Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
19294
+ Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
19295
+ Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
19296
+ }
19297
+ }, {
19298
+ key: 'setCursor',
19299
+ value: function setCursor(value) {
19300
+ if (document.body) {
19301
+ document.body.style.cursor = value;
19302
+ }
19289
19303
 
19290
- if (this.formatter.currentSpec) {
19291
- var target = this.formatter.currentSpec.getOverlayElement();
19292
- if (target) {
19293
- target.style.cursor = value;
19294
- }
19295
- }
19296
- }
19297
- }]);
19304
+ if (this.formatter.currentSpec) {
19305
+ var target = this.formatter.currentSpec.getOverlayElement();
19306
+ if (target) {
19307
+ target.style.cursor = value;
19308
+ }
19309
+ }
19310
+ }
19311
+ }]);
19298
19312
 
19299
- return ResizeAction;
19300
- }(_Action3.default);
19313
+ return ResizeAction;
19314
+ }(_Action3.default);
19301
19315
 
19302
- ResizeAction.default = ResizeAction$1;
19303
- return ResizeAction;
19304
- }
19316
+ ResizeAction$1.default = ResizeAction;
19305
19317
 
19306
19318
  var DeleteAction = {};
19307
19319
 
@@ -19321,7 +19333,7 @@ function requireDeleteAction () {
19321
19333
 
19322
19334
  var _quill2 = _interopRequireDefault(_quill);
19323
19335
 
19324
- var _Action2 = Action$1;
19336
+ var _Action2 = requireAction();
19325
19337
 
19326
19338
  var _Action3 = _interopRequireDefault(_Action2);
19327
19339
 
@@ -19400,7 +19412,7 @@ function requireBlotSpec () {
19400
19412
 
19401
19413
  _interopRequireDefault(_BlotFormatter);
19402
19414
 
19403
- var _Action = Action$1;
19415
+ var _Action = requireAction();
19404
19416
 
19405
19417
  _interopRequireDefault(_Action);
19406
19418
 
@@ -19408,7 +19420,7 @@ function requireBlotSpec () {
19408
19420
 
19409
19421
  var _AlignAction2 = _interopRequireDefault(_AlignAction);
19410
19422
 
19411
- var _ResizeAction = requireResizeAction();
19423
+ var _ResizeAction = ResizeAction$1;
19412
19424
 
19413
19425
  var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
19414
19426
 
@@ -19848,7 +19860,7 @@ function requireOptions () {
19848
19860
  }
19849
19861
  });
19850
19862
 
19851
- var _Action = Action$1;
19863
+ var _Action = requireAction();
19852
19864
 
19853
19865
  Object.defineProperty(exports, 'Action', {
19854
19866
  enumerable: true,
@@ -19893,7 +19905,7 @@ function requireOptions () {
19893
19905
  }
19894
19906
  });
19895
19907
 
19896
- var _ResizeAction = requireResizeAction();
19908
+ var _ResizeAction = ResizeAction$1;
19897
19909
 
19898
19910
  Object.defineProperty(exports, 'ResizeAction', {
19899
19911
  enumerable: true,
@@ -19943,6 +19955,123 @@ function requireOptions () {
19943
19955
 
19944
19956
  var BlotFormatter = /*@__PURE__*/getDefaultExportFromCjs(dist);
19945
19957
 
19958
+ // 加粗
19959
+ 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>`;
19960
+ // 斜体
19961
+ 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>`;
19962
+ // 下划线
19963
+ const underlineSVG = `<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="M5.000117301940918,14.500022450683593L5.000117301940918,14.500022450683593Q5.000117301940918,14.450777450683594,5.009724660740918,14.402477450683593Q5.019332019940918,14.354177450683594,5.038177530940918,14.308679450683593Q5.057023040940918,14.263182450683594,5.084382488940918,14.222236450683594Q5.111741931940918,14.181290450683594,5.146563901940918,14.146469450683593Q5.181385871940918,14.111646450683594,5.222332181940918,14.084286450683594Q5.263278451940918,14.056927450683594,5.308775541940918,14.038082450683595Q5.354272661940918,14.019237450683594,5.402572121940918,14.009630450683593Q5.450871581940918,14.000022450683593,5.500117301940918,14.000022450683593L12.500117301940918,14.000022450683593Q12.549362201940918,14.000022450683593,12.597661501940918,14.009629450683594Q12.645960801940918,14.019237450683594,12.691457701940918,14.038082450683595Q12.736954701940917,14.056926450683594,12.777901601940918,14.084285450683593Q12.818847701940918,14.111645450683593,12.853670101940917,14.146468450683594Q12.888492101940919,14.181289450683593,12.915851601940918,14.222235450683593Q12.943210601940919,14.263181450683593,12.962056201940918,14.308679450683593Q12.980901701940919,14.354177450683594,12.990509501940917,14.402477450683593Q13.00011680194092,14.450777450683594,13.000117301940918,14.500022450683593L13.000117301940918,14.500022450683593Q13.00011680194092,14.549268450683593,12.990509001940918,14.597566450683594Q12.980901701940919,14.645866450683593,12.962056201940918,14.691363450683594Q12.943210601940919,14.736860450683594,12.915851601940918,14.777807450683595Q12.888492101940919,14.818753450683595,12.853670101940917,14.853575450683593Q12.818847701940918,14.888397450683593,12.777901601940918,14.915756450683594Q12.736954701940917,14.943115450683594,12.691457701940918,14.961960450683593Q12.645960801940918,14.980806450683593,12.597661501940918,14.990413450683594Q12.549362201940918,15.000021450683594,12.500117301940918,15.000022450683593L5.500117301940918,15.000022450683593Q5.450871581940918,15.000021450683594,5.402572121940918,14.990414450683593Q5.354272661940918,14.980806450683593,5.308775541940918,14.961960450683593Q5.263278451940918,14.943115450683594,5.222332161940918,14.915756450683594Q5.181385871940918,14.888397450683593,5.146563901940918,14.853574450683594Q5.111741931940918,14.818752450683593,5.084382488940918,14.777806450683594Q5.057023040940918,14.736860450683594,5.038177530940918,14.691363450683594Q5.019332019940918,14.645866450683593,5.009724660740918,14.597567450683593Q5.000117301940918,14.549268450683593,5.000117301940918,14.500022450683593ZM5.045039176940918,3.548906330683594Q5.045039176940918,3.1015625006835936,5.283039211940918,2.8637809706835937Q5.521039131940918,2.6259994506835938,5.969039081940918,2.6259994506835938L5.997039201940918,2.6259994506835938Q6.445039201940918,2.6259994506835938,6.6830393019409176,2.8637809706835937Q6.921039201940918,3.1015625006835936,6.921039201940918,3.548906330683594L6.921039201940918,9.010000250683593Q6.921039201940918,9.737999950683594,7.180039401940919,10.255999550683594Q7.439039201940918,10.774000150683595,7.908039101940918,11.053999950683593Q8.377039001940918,11.333999650683594,8.993039101940917,11.333999650683594Q9.609039301940918,11.333999650683594,10.085039101940918,11.060999850683594Q10.561039401940917,10.788000150683594,10.820039301940918,10.263000450683593Q11.079039101940918,9.737999950683594,11.079039101940918,9.010000250683593L11.079039101940918,3.548906330683594Q11.079039101940918,3.1015625006835936,11.317039501940918,2.8637809706835937Q11.555039401940917,2.6259994506835938,12.003039401940917,2.6259994506835938L12.031039201940917,2.6259994506835938Q12.479039201940918,2.6259994506835938,12.717039101940918,2.8637809706835937Q12.955039001940918,3.1015625006835936,12.955039001940918,3.548906330683594L12.955039001940918,9.010000250683593Q12.955039001940918,10.144000050683594,12.416039501940919,11.095999750683594Q11.877039901940918,12.048000350683594,10.967039101940918,12.600999850683595Q10.057039301940918,13.154000450683593,8.993039101940917,13.154000450683593Q7.929039001940918,13.154000450683593,7.0190392019409185,12.600999850683595Q6.109039201940918,12.048000350683594,5.577039361940918,11.095999750683594Q5.045039176940918,10.144000050683594,5.045039176940918,9.010000250683593L5.045039176940918,3.548906330683594Z" fill="#555555" fill-opacity="1"/></g></g></svg>`;
19964
+ // 更多
19965
+ const moreSVG = `<svg t="1756109058354" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11458" width="18" height="18"><path d="M512 320q-3.150769 0-6.301538-0.315077-3.111385-0.315077-6.183385-0.905846-3.072-0.630154-6.104615-1.536-2.993231-0.905846-5.907693-2.126769-2.914462-1.181538-5.671384-2.678154-2.756923-1.496615-5.395693-3.229539-2.599385-1.732923-5.04123-3.741538-2.441846-1.969231-4.647385-4.214154-2.244923-2.205538-4.214154-4.647385-1.969231-2.441846-3.741538-5.04123-1.732923-2.638769-3.229539-5.395693-1.496615-2.756923-2.678154-5.671384-1.181538-2.914462-2.126769-5.907693-0.905846-3.032615-1.536-6.104615-0.590769-3.072-0.905846-6.222769T448 256q0-3.150769 0.315077-6.301538 0.315077-3.111385 0.905846-6.183385 0.630154-3.072 1.536-6.104615 0.905846-2.993231 2.126769-5.907693 1.181538-2.914462 2.678154-5.671384 1.496615-2.756923 3.229539-5.395693 1.732923-2.599385 3.741538-5.04123 1.969231-2.441846 4.214154-4.647385 2.205538-2.205538 4.647385-4.214154 2.441846-1.969231 5.04123-3.741538 2.638769-1.732923 5.395693-3.229539 2.756923-1.496615 5.671384-2.678154 2.914462-1.181538 5.907693-2.126769 3.032615-0.905846 6.104615-1.536 3.072-0.590769 6.222769-0.905846T512 192q3.150769 0 6.301538 0.315077 3.111385 0.315077 6.183385 0.905846 3.072 0.630154 6.104615 1.536 2.993231 0.905846 5.907693 2.126769 2.914462 1.181538 5.671384 2.678154 2.756923 1.496615 5.395693 3.229539 2.599385 1.732923 5.04123 3.741538 2.441846 1.969231 4.647385 4.214154 2.205538 2.205538 4.214154 4.647385 1.969231 2.441846 3.741538 5.04123 1.732923 2.638769 3.229539 5.395693 1.496615 2.756923 2.678154 5.671384 1.181538 2.914462 2.126769 5.907693 0.905846 3.032615 1.536 6.104615 0.590769 3.072 0.905846 6.222769t0.315077 6.262154q0 3.150769-0.315077 6.301538-0.315077 3.111385-0.905846 6.183385-0.630154 3.072-1.536 6.104615-0.905846 2.993231-2.126769 5.907693-1.181538 2.914462-2.678154 5.671384-1.496615 2.756923-3.229539 5.395693-1.732923 2.599385-3.741538 5.04123-1.969231 2.441846-4.214154 4.647385-2.205538 2.244923-4.647385 4.214154-2.441846 1.969231-5.04123 3.741538-2.638769 1.732923-5.395693 3.229539-2.756923 1.496615-5.671384 2.678154-2.914462 1.181538-5.907693 2.126769-3.032615 0.905846-6.104615 1.536-3.072 0.590769-6.222769 0.905846T512 320z m0 256q-3.150769 0-6.301538-0.315077-3.111385-0.315077-6.183385-0.905846-3.072-0.630154-6.104615-1.536-2.993231-0.905846-5.907693-2.126769-2.914462-1.181538-5.671384-2.678154-2.756923-1.496615-5.395693-3.229539-2.599385-1.732923-5.04123-3.741538-2.441846-1.969231-4.647385-4.214154-2.244923-2.205538-4.214154-4.647385-1.969231-2.441846-3.741538-5.04123-1.732923-2.638769-3.229539-5.395693-1.496615-2.756923-2.678154-5.671384-1.181538-2.914462-2.126769-5.907693-0.905846-3.032615-1.536-6.104615-0.590769-3.072-0.905846-6.222769T448 512q0-3.150769 0.315077-6.301538 0.315077-3.111385 0.905846-6.183385 0.630154-3.072 1.536-6.104615 0.905846-2.993231 2.126769-5.907693 1.181538-2.914462 2.678154-5.671384 1.496615-2.756923 3.229539-5.395693 1.732923-2.599385 3.741538-5.04123 1.969231-2.441846 4.214154-4.647385 2.205538-2.244923 4.647385-4.214154 2.441846-1.969231 5.04123-3.741538 2.638769-1.732923 5.395693-3.229539 2.756923-1.496615 5.671384-2.678154 2.914462-1.181538 5.907693-2.126769 3.032615-0.905846 6.104615-1.536 3.072-0.590769 6.222769-0.905846T512 448q3.150769 0 6.301538 0.315077 3.111385 0.315077 6.183385 0.905846 3.072 0.630154 6.104615 1.536 2.993231 0.905846 5.907693 2.126769 2.914462 1.181538 5.671384 2.678154 2.756923 1.496615 5.395693 3.229539 2.599385 1.732923 5.04123 3.741538 2.441846 1.969231 4.647385 4.214154 2.205538 2.205538 4.214154 4.647385 1.969231 2.441846 3.741538 5.04123 1.732923 2.638769 3.229539 5.395693 1.496615 2.756923 2.678154 5.671384 1.181538 2.914462 2.126769 5.907693 0.905846 3.032615 1.536 6.104615 0.590769 3.072 0.905846 6.222769t0.315077 6.262154q0 3.150769-0.315077 6.301538-0.315077 3.111385-0.905846 6.183385-0.630154 3.072-1.536 6.104615-0.905846 2.993231-2.126769 5.907693-1.181538 2.914462-2.678154 5.671384-1.496615 2.756923-3.229539 5.395693-1.732923 2.599385-3.741538 5.04123-1.969231 2.441846-4.214154 4.647385-2.205538 2.244923-4.647385 4.214154-2.441846 1.969231-5.04123 3.741538-2.638769 1.732923-5.395693 3.229539-2.756923 1.496615-5.671384 2.678154-2.914462 1.181538-5.907693 2.126769-3.032615 0.905846-6.104615 1.536-3.072 0.590769-6.222769 0.905846T512 576z m0 256q-3.150769 0-6.301538-0.315077-3.111385-0.315077-6.183385-0.905846-3.072-0.630154-6.104615-1.536-2.993231-0.905846-5.907693-2.126769-2.914462-1.181538-5.671384-2.678154-2.756923-1.496615-5.395693-3.229539-2.599385-1.732923-5.04123-3.741538-2.441846-1.969231-4.647385-4.214154-2.244923-2.205538-4.214154-4.647385-1.969231-2.441846-3.741538-5.04123-1.732923-2.638769-3.229539-5.395693-1.496615-2.756923-2.678154-5.671384-1.181538-2.914462-2.126769-5.907693-0.905846-3.032615-1.536-6.104615-0.590769-3.072-0.905846-6.222769t-0.315077-6.262154q0-3.150769 0.315077-6.301538 0.315077-3.111385 0.905846-6.183385 0.630154-3.072 1.536-6.104615 0.905846-2.993231 2.126769-5.907693 1.181538-2.914462 2.678154-5.671384 1.496615-2.756923 3.229539-5.395693 1.732923-2.599385 3.741538-5.04123 1.969231-2.441846 4.214154-4.647385 2.205538-2.205538 4.647385-4.214154 2.441846-1.969231 5.04123-3.741538 2.638769-1.732923 5.395693-3.229539 2.756923-1.496615 5.671384-2.678154 2.914462-1.181538 5.907693-2.126769 3.032615-0.905846 6.104615-1.536 3.072-0.590769 6.222769-0.905846T512 704q3.150769 0 6.301538 0.315077 3.111385 0.315077 6.183385 0.905846 3.072 0.630154 6.104615 1.536 2.993231 0.905846 5.907693 2.126769 2.914462 1.181538 5.671384 2.678154 2.756923 1.496615 5.395693 3.229539 2.599385 1.732923 5.04123 3.741538 2.441846 1.969231 4.647385 4.214154 2.205538 2.205538 4.214154 4.647385 1.969231 2.441846 3.741538 5.04123 1.732923 2.638769 3.229539 5.395693 1.496615 2.756923 2.678154 5.671384 1.181538 2.914462 2.126769 5.907693 0.905846 3.032615 1.536 6.104615 0.590769 3.072 0.905846 6.222769t0.315077 6.262154q0 3.150769-0.315077 6.301538-0.315077 3.111385-0.905846 6.183385-0.630154 3.072-1.536 6.104615-0.905846 2.993231-2.126769 5.907693-1.181538 2.914462-2.678154 5.671384-1.496615 2.756923-3.229539 5.395693-1.732923 2.599385-3.741538 5.04123-1.969231 2.441846-4.214154 4.647385-2.205538 2.205538-4.647385 4.214154-2.441846 1.969231-5.04123 3.741538-2.638769 1.732923-5.395693 3.229539-2.756923 1.496615-5.671384 2.678154-2.914462 1.181538-5.907693 2.126769-3.032615 0.905846-6.104615 1.536-3.072 0.590769-6.222769 0.905846T512 832z" p-id="11459" fill="#555555"></path></svg>`;
19966
+ // 链接
19967
+ 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>`;
19968
+ // 撤销
19969
+ 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>`;
19970
+ // 重做
19971
+ 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>`;
19972
+ // 图片识别
19973
+ const ocrSVG = `<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="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>`;
19974
+ // 数学公式
19975
+ 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="18" height="18"><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>`;
19976
+ // 无序列表
19977
+ const listBulletSVG = `<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>`;
19978
+ // 有序列表
19979
+ const listOrderedSVG = `<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>`;
19980
+ // 图片
19981
+ 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>`;
19982
+
19983
+ const MoreTools = defineComponent({
19984
+ name: 'MoreTools',
19985
+ props: {
19986
+ // 传入toolbar的自定义style
19987
+ toolbarStyle: {
19988
+ type: Object,
19989
+ required: false,
19990
+ default: () => ({})
19991
+ },
19992
+ needCollapse: {
19993
+ type: Boolean,
19994
+ default: false
19995
+ },
19996
+ onToolClick: {
19997
+ type: Function,
19998
+ required: true
19999
+ }
20000
+ },
20001
+ setup(props) {
20002
+ // 渲染工具按钮
20003
+ const renderToolButton = (tool) => {
20004
+ if (typeof tool === 'string') {
20005
+ // 根据工具名称获取对应的SVG图标
20006
+ let iconSVG = '';
20007
+ switch (tool) {
20008
+ case 'image':
20009
+ iconSVG = imageSVG;
20010
+ break;
20011
+ case 'undo':
20012
+ iconSVG = undoSVG;
20013
+ break;
20014
+ case 'redo':
20015
+ iconSVG = redoSVG;
20016
+ break;
20017
+ case 'ocr':
20018
+ iconSVG = ocrSVG;
20019
+ break;
20020
+ case 'math':
20021
+ iconSVG = mathSVG;
20022
+ break;
20023
+ default:
20024
+ iconSVG = '';
20025
+ }
20026
+ return h('button', {
20027
+ class: `ql-${tool}`,
20028
+ type: 'button',
20029
+ onClick: () => props.onToolClick(tool)
20030
+ }, [
20031
+ iconSVG ? h('span', { innerHTML: iconSVG }) : null
20032
+ ]);
20033
+ }
20034
+ else if (typeof tool === 'object' && tool !== null) {
20035
+ const toolName = Object.keys(tool)[0];
20036
+ const toolValue = Object.values(tool)[0];
20037
+ let iconSVG = '';
20038
+ if (toolName === 'list') {
20039
+ iconSVG = toolValue === 'ordered' ? listOrderedSVG : listBulletSVG;
20040
+ }
20041
+ return h('button', {
20042
+ class: `ql-${toolName}`,
20043
+ 'data-value': toolValue,
20044
+ type: 'button',
20045
+ onClick: () => props.onToolClick(`${toolName}-${toolValue}`)
20046
+ }, [
20047
+ iconSVG ? h('span', { innerHTML: iconSVG }) : null
20048
+ ]);
20049
+ }
20050
+ return null;
20051
+ };
20052
+ // 渲染工具组
20053
+ const renderToolGroup = (tools) => {
20054
+ return h('span', {
20055
+ class: 'ql-formats'
20056
+ }, tools.map(tool => renderToolButton(tool)));
20057
+ };
20058
+ return () => h('div', {
20059
+ class: 'ql-toolbar ql-snow more-tools',
20060
+ style: props.toolbarStyle
20061
+ }, [
20062
+ h('div', {
20063
+ class: 'more-tools-item'
20064
+ }, [
20065
+ // 渲染所有工具组
20066
+ ...toolbarOptions.extend.map(toolGroup => renderToolGroup(toolGroup)),
20067
+ ]),
20068
+ h('div', {}, [
20069
+ renderToolGroup(['ocr'])
20070
+ ])
20071
+ ]);
20072
+ }
20073
+ });
20074
+
19946
20075
  const QuillEditor = defineComponent({
19947
20076
  name: 'QuillEditor',
19948
20077
  inheritAttrs: false,
@@ -19986,12 +20115,22 @@ const QuillEditor = defineComponent({
19986
20115
  return ['fixed-top', 'embedded'].includes(value);
19987
20116
  },
19988
20117
  },
20118
+ needCollapse: {
20119
+ type: Boolean,
20120
+ default: true,
20121
+ },
19989
20122
  // 传入toolbar的自定义style
19990
20123
  toolbarStyle: {
19991
20124
  type: Object,
19992
20125
  required: false,
19993
20126
  default: () => ({})
19994
20127
  },
20128
+ // 编辑器输入内容的自定义style
20129
+ editorStyle: {
20130
+ type: Object,
20131
+ required: false,
20132
+ default: () => ({})
20133
+ },
19995
20134
  theme: {
19996
20135
  type: String,
19997
20136
  default: 'snow',
@@ -20053,30 +20192,17 @@ const QuillEditor = defineComponent({
20053
20192
  let quill;
20054
20193
  let options;
20055
20194
  const editor = ref();
20195
+ const showMoreToolbar = ref(false);
20056
20196
  const editorWrapClass = computed(() => {
20057
20197
  return {
20058
20198
  'quill-editor-container': true,
20059
20199
  'need-border': props.needBorder,
20200
+ 'more-toolbar': showMoreToolbar.value,
20060
20201
  'fixed-top': props.toolbarMode === 'fixed-top',
20061
20202
  'embedded': props.toolbarMode === 'embedded',
20062
20203
  };
20063
20204
  });
20064
- // 监听 minHeight 变化,同步设置编辑器高度
20065
- const updateEditorHeight = () => {
20066
- if (quill && editor.value) {
20067
- const editorElement = editor.value.querySelector('.ql-editor');
20068
- if (editorElement) {
20069
- editorElement.style.minHeight = `${props.minHeight}px`;
20070
- }
20071
- }
20072
- };
20073
- // 监听 minHeight 变化
20074
- watch(() => props.minHeight, () => {
20075
- nextTick(() => {
20076
- updateEditorHeight();
20077
- });
20078
- });
20079
- // 应用自定义toolbar样式
20205
+ // 应用自定义toolbar样式,目前通过改dom的形式,因为h函数没有暴露更深的dom,无法绑定真正的toolbar
20080
20206
  const applyToolbarStyle = () => {
20081
20207
  var _a;
20082
20208
  if (quill && props.toolbarStyle) {
@@ -20086,24 +20212,35 @@ const QuillEditor = defineComponent({
20086
20212
  }
20087
20213
  }
20088
20214
  };
20215
+ // 应用自定义editor样式,目前通过改dom的形式,因为h函数没有暴露更深的dom,无法绑定真正的editor
20216
+ const applyEditorStyle = () => {
20217
+ var _a;
20218
+ if (quill && props.editorStyle) {
20219
+ const editorElement = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.querySelector('.ql-editor');
20220
+ if (editorElement) {
20221
+ Object.assign(editorElement.style, props.editorStyle);
20222
+ }
20223
+ }
20224
+ };
20089
20225
  // 监听 toolbarStyle 变化
20090
20226
  watch(() => props.toolbarStyle, () => {
20091
20227
  nextTick(() => {
20092
20228
  applyToolbarStyle();
20093
20229
  });
20094
20230
  });
20095
- // Register Module if not already registered
20231
+ // 监听 editorStyle 变化
20232
+ watch(() => props.editorStyle, () => {
20233
+ nextTick(() => {
20234
+ applyEditorStyle();
20235
+ });
20236
+ });
20096
20237
  const registerModule = (moduleName, module) => {
20097
- // For Quill 1.x, we can't check if module is already registered
20098
- // So we'll just register it directly
20099
20238
  Quill.register(moduleName, module);
20100
20239
  };
20101
- // Initialize Quill
20102
20240
  const initialize = () => {
20103
20241
  var _a, _b;
20104
20242
  if (!editor.value)
20105
20243
  return;
20106
- // Create new Quill instance
20107
20244
  quill = new Quill(editor.value, options);
20108
20245
  // 初始隐藏toolbar
20109
20246
  const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
@@ -20111,10 +20248,17 @@ const QuillEditor = defineComponent({
20111
20248
  toolbar.style.display = 'none';
20112
20249
  }
20113
20250
  const icons = Quill.import('ui/icons');
20114
- icons['ocr'] = `<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="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="#333333" fill-opacity="1"/></g></g></svg>`;
20115
- icons['math'] = `<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"><defs><clipPath id="master_svg0_6759_139354"><rect x="0" y="0" width="18" height="18" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_6759_139354)"><g><path d="M15.423694,15.049834L15.424264,15.049264Q15.508656,14.964872,15.554328,14.85461Q15.6,14.744348,15.6,14.625Q15.6,14.565905,15.58847,14.507944Q15.576942,14.449986,15.554328,14.395388Q15.531713,14.340792,15.498882,14.291656Q15.466051,14.242521,15.424265,14.200735Q15.382479,14.158949,15.333343,14.126117Q15.284206,14.093286,15.229609,14.070671Q15.175013,14.048058,15.117053,14.036528Q15.059094,14.025,15,14.025Q14.880652,14.025,14.77039,14.070672Q14.660128,14.116344,14.575736,14.200736L13.626472,15.150001L4.4485275,15.150001L10.174264,9.424264Q10.2160501,9.3824773,10.2488813,9.3333416Q10.281712500000001,9.2842059,10.304327,9.229609499999999Q10.3269415,9.175012599999999,10.3384705,9.117054Q10.349999,9.0590944,10.349999,8.999999500000001Q10.349999,8.9409046,10.3384705,8.8829451Q10.3269415,8.8249855,10.304327,8.7703896Q10.281712500000001,8.715793099999999,10.2488813,8.6666574Q10.2160501,8.6175222,10.174264,8.575736L4.4485282,2.85000002L13.626472,2.85000002L14.575395,3.7989223L14.575736,3.7992642Q14.660127,3.8836554999999997,14.77039,3.9293277Q14.880651,3.9749999000000003,15,3.975Q15.059094,3.9749999000000003,15.117054,3.9634712Q15.175013,3.9519422,15.229609,3.9293275999999997Q15.284206,3.906713,15.333342,3.8738817Q15.382478,3.8410504000000003,15.424264,3.7992641000000003Q15.466051,3.7574776,15.498882,3.7083421000000003Q15.531713,3.6592064,15.554328,3.60461Q15.576942,3.5500134,15.588472,3.4920541Q15.6,3.4340948,15.6,3.375Q15.6,3.2556524,15.554328,3.1453898000000002Q15.508656,3.03512704,15.424264,2.9507357499999998L15.423856,2.9503274L14.299264,1.82573593Q14.214872,1.7413445699999999,14.10461,1.69567227Q13.994347,1.64999998,13.875,1.64999998L3,1.64999998Q2.88065257,1.64999998,2.77038994,1.69567227Q2.66012731,1.7413445699999999,2.57573593,1.82573593Q2.53394958,1.8675223,2.50111824,1.91665789Q2.46828693,1.96579346,2.44567233,2.02038996Q2.42305773,2.07498647,2.41152894,2.13294582Q2.4000000999999997,2.190905161,2.40000004,2.25Q2.4000000999999997,2.309094839,2.41152889,2.36705418Q2.42305773,2.42501353,2.44567233,2.47961004Q2.46828693,2.53420654,2.50111827,2.58334213Q2.53394958,2.6324777,2.57573593,2.67426407L8.9014721,9L2.57573593,15.325736Q2.49134457,15.410126,2.44567227,15.520389Q2.39999998,15.630651,2.39999998,15.75Q2.39999998,15.809094,2.41152883,15.867053Q2.42305768,15.925013,2.44567233,15.979609Q2.46828693,16.034204000000003,2.50111827,16.08334Q2.53394958,16.132476,2.57573593,16.174263Q2.6175223,16.216048999999998,2.66665787,16.24888Q2.71579343,16.281712,2.77038994,16.304327Q2.82498646,16.326940999999998,2.88294581,16.33847Q2.940905157,16.349998,3,16.349999L13.875,16.349999Q13.994347,16.349998,14.104609,16.304326Q14.214872,16.258654,14.299264,16.174264L15.423694,15.049834Z" fill-rule="evenodd" fill="#333333" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></svg>`;
20251
+ icons['bold'] = boldSVG;
20252
+ icons['italic'] = italicSVG;
20253
+ icons['underline'] = underlineSVG;
20254
+ icons['more'] = moreSVG;
20255
+ icons['link'] = linkSVG;
20256
+ icons['undo'] = undoSVG;
20257
+ icons['redo'] = redoSVG;
20258
+ icons['ocr'] = ocrSVG;
20259
+ icons['math'] = mathSVG;
20260
+ icons['image'] = imageSVG;
20116
20261
  options = composeOptions();
20117
- // Register modules
20118
20262
  if (props.modules) {
20119
20263
  if (Array.isArray(props.modules)) {
20120
20264
  for (const module of props.modules) {
@@ -20125,29 +20269,23 @@ const QuillEditor = defineComponent({
20125
20269
  registerModule(`modules/${props.modules.name}`, props.modules.module);
20126
20270
  }
20127
20271
  }
20128
- // Create new Quill instance
20129
20272
  quill = new Quill(editor.value, options);
20130
- // Set editor content
20131
20273
  setContents(props.content);
20132
- // Set event handlers
20133
20274
  quill.on('text-change', handleTextChange);
20134
20275
  quill.on('selection-change', handleSelectionChange);
20135
20276
  quill.on('editor-change', handleEditorChange);
20136
- // Remove editor class when theme changes
20137
20277
  if (props.theme !== 'bubble')
20138
20278
  editor.value.classList.remove('ql-bubble');
20139
20279
  if (props.theme !== 'snow')
20140
20280
  editor.value.classList.remove('ql-snow');
20141
- // Fix clicking the quill toolbar is detected as blur event
20142
20281
  (_b = quill
20143
20282
  .getModule('toolbar')) === null || _b === void 0 ? void 0 : _b.container.addEventListener('mousedown', (e) => {
20144
20283
  e.preventDefault();
20145
20284
  });
20146
- // 设置初始编辑器高度
20147
- updateEditorHeight();
20148
20285
  // 应用初始toolbar样式
20149
20286
  applyToolbarStyle();
20150
- // Emit ready event
20287
+ // 应用初始editor样式
20288
+ applyEditorStyle();
20151
20289
  ctx.emit('ready', quill);
20152
20290
  };
20153
20291
  // Compose Options
@@ -20162,12 +20300,21 @@ const QuillEditor = defineComponent({
20162
20300
  if (props.toolbar && props.toolbar !== '') {
20163
20301
  clientOptions.modules = {
20164
20302
  toolbar: {
20165
- container: [
20303
+ // 需要展开的话显示完整的工具栏
20304
+ container: props.needCollapse ? [
20166
20305
  ...toolbarOptions.full,
20167
- ['ocr'],
20168
- [{ 'math': true }], // 自定义按钮
20306
+ ] : [
20307
+ ...toolbarOptions.short,
20169
20308
  ],
20170
20309
  handlers: {
20310
+ redo: function () {
20311
+ var _a;
20312
+ (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
20313
+ },
20314
+ undo: function () {
20315
+ var _a;
20316
+ (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
20317
+ },
20171
20318
  ocr: function () {
20172
20319
  // 按钮点击逻辑
20173
20320
  ctx.emit('ocr');
@@ -20176,6 +20323,9 @@ const QuillEditor = defineComponent({
20176
20323
  // 按钮点击逻辑
20177
20324
  ctx.emit('math');
20178
20325
  },
20326
+ more: function () {
20327
+ showMoreToolbar.value = !showMoreToolbar.value;
20328
+ }
20179
20329
  },
20180
20330
  },
20181
20331
  };
@@ -20204,7 +20354,6 @@ const QuillEditor = defineComponent({
20204
20354
  const deltaHasValuesOtherThanRetain = (delta) => {
20205
20355
  return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
20206
20356
  };
20207
- // Doesn't need reactivity, but does need to be cloned to avoid deep mutations always registering as equal
20208
20357
  let internalModel;
20209
20358
  const internalModelEquals = (against) => {
20210
20359
  if (typeof internalModel === typeof against) {
@@ -20237,9 +20386,10 @@ const QuillEditor = defineComponent({
20237
20386
  const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
20238
20387
  if (toolbar) {
20239
20388
  if (isEditorFocus.value) {
20240
- toolbar.style.display = 'flex';
20389
+ toolbar.style.display = 'block';
20241
20390
  }
20242
20391
  else {
20392
+ showMoreToolbar.value = false;
20243
20393
  toolbar.style.display = 'none';
20244
20394
  }
20245
20395
  }
@@ -20342,7 +20492,6 @@ const QuillEditor = defineComponent({
20342
20492
  watch(() => props.content, (newContent) => {
20343
20493
  if (!quill || !newContent || internalModelEquals(newContent))
20344
20494
  return;
20345
- // Restore the selection and cursor position after updating the content
20346
20495
  const selection = quill.getSelection();
20347
20496
  if (selection) {
20348
20497
  nextTick(() => quill === null || quill === void 0 ? void 0 : quill.setSelection(selection));
@@ -20368,14 +20517,36 @@ const QuillEditor = defineComponent({
20368
20517
  setText,
20369
20518
  reinit,
20370
20519
  editorWrapClass,
20520
+ showMoreToolbar,
20371
20521
  };
20372
20522
  },
20373
20523
  render() {
20374
- var _a, _b;
20375
20524
  return [
20376
20525
  h('div', { class: this.editorWrapClass }, [
20377
- (_b = (_a = this.$slots).toolbar) === null || _b === void 0 ? void 0 : _b.call(_a),
20378
- h('div', { ref: 'editor', ...this.$attrs }),
20526
+ // this.$slots.toolbar?.(), // 工具栏内容固定
20527
+ // needCollapse false 时,显示 MoreTools 组件
20528
+ this.showMoreToolbar && h(MoreTools, {
20529
+ needCollapse: this.needCollapse,
20530
+ toolbarStyle: this.$props.toolbarStyle,
20531
+ onToolClick: (tool) => {
20532
+ var _a, _b, _c, _d;
20533
+ if (tool === 'undo') {
20534
+ (_b = (_a = this.getQuill()) === null || _a === void 0 ? void 0 : _a.getModule('history')) === null || _b === void 0 ? void 0 : _b.undo();
20535
+ }
20536
+ else if (tool === 'redo') {
20537
+ (_d = (_c = this.getQuill()) === null || _c === void 0 ? void 0 : _c.getModule('history')) === null || _d === void 0 ? void 0 : _d.redo();
20538
+ }
20539
+ else if (tool === 'ocr') {
20540
+ this.$emit('ocr');
20541
+ }
20542
+ else if (tool === 'math') {
20543
+ this.$emit('math');
20544
+ }
20545
+ }
20546
+ }),
20547
+ h('div', {
20548
+ ref: 'editor', ...this.$attrs
20549
+ }),
20379
20550
  ]),
20380
20551
  ];
20381
20552
  },