pxx-vue-quill 1.0.14 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2025 Pxx-Team
9
9
  * Released under the MIT license
10
- * Date: 2025-08-21T09:21:09.034Z
10
+ * Date: 2025-08-25T02:25:20.932Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -19130,190 +19130,182 @@
19130
19130
  return AlignAction;
19131
19131
  }
19132
19132
 
19133
- var ResizeAction = {};
19133
+ var ResizeAction$1 = {};
19134
19134
 
19135
- var hasRequiredResizeAction;
19136
-
19137
- function requireResizeAction () {
19138
- if (hasRequiredResizeAction) return ResizeAction;
19139
- hasRequiredResizeAction = 1;
19140
-
19141
- Object.defineProperty(ResizeAction, "__esModule", {
19142
- value: true
19143
- });
19135
+ Object.defineProperty(ResizeAction$1, "__esModule", {
19136
+ value: true
19137
+ });
19144
19138
 
19145
- 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; }; }();
19139
+ 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; }; }();
19146
19140
 
19147
- var _Action2 = requireAction();
19141
+ var _Action2 = requireAction();
19148
19142
 
19149
- var _Action3 = _interopRequireDefault(_Action2);
19143
+ var _Action3 = _interopRequireDefault(_Action2);
19150
19144
 
19151
- var _BlotFormatter = requireBlotFormatter();
19145
+ var _BlotFormatter = requireBlotFormatter();
19152
19146
 
19153
- _interopRequireDefault(_BlotFormatter);
19147
+ _interopRequireDefault(_BlotFormatter);
19154
19148
 
19155
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19149
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19156
19150
 
19157
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19151
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19158
19152
 
19159
- 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; }
19153
+ 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; }
19160
19154
 
19161
- 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; }
19155
+ 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; }
19162
19156
 
19163
- var ResizeAction$1 = function (_Action) {
19164
- _inherits(ResizeAction, _Action);
19157
+ var ResizeAction = function (_Action) {
19158
+ _inherits(ResizeAction, _Action);
19165
19159
 
19166
- function ResizeAction(formatter) {
19167
- _classCallCheck(this, ResizeAction);
19160
+ function ResizeAction(formatter) {
19161
+ _classCallCheck(this, ResizeAction);
19168
19162
 
19169
- var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
19163
+ var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
19170
19164
 
19171
- _this.onMouseDown = function (event) {
19172
- if (!(event.target instanceof HTMLElement)) {
19173
- return;
19174
- }
19175
- _this.dragHandle = event.target;
19176
- _this.setCursor(_this.dragHandle.style.cursor);
19165
+ _this.onMouseDown = function (event) {
19166
+ if (!(event.target instanceof HTMLElement)) {
19167
+ return;
19168
+ }
19169
+ _this.dragHandle = event.target;
19170
+ _this.setCursor(_this.dragHandle.style.cursor);
19177
19171
 
19178
- if (!_this.formatter.currentSpec) {
19179
- return;
19180
- }
19172
+ if (!_this.formatter.currentSpec) {
19173
+ return;
19174
+ }
19181
19175
 
19182
- var target = _this.formatter.currentSpec.getTargetElement();
19183
- if (!target) {
19184
- return;
19185
- }
19176
+ var target = _this.formatter.currentSpec.getTargetElement();
19177
+ if (!target) {
19178
+ return;
19179
+ }
19186
19180
 
19187
- var rect = target.getBoundingClientRect();
19181
+ var rect = target.getBoundingClientRect();
19188
19182
 
19189
- _this.dragStartX = event.clientX;
19190
- _this.preDragWidth = rect.width;
19191
- _this.targetRatio = rect.height / rect.width;
19183
+ _this.dragStartX = event.clientX;
19184
+ _this.preDragWidth = rect.width;
19185
+ _this.targetRatio = rect.height / rect.width;
19192
19186
 
19193
- document.addEventListener('mousemove', _this.onDrag);
19194
- document.addEventListener('mouseup', _this.onMouseUp);
19195
- };
19187
+ document.addEventListener('mousemove', _this.onDrag);
19188
+ document.addEventListener('mouseup', _this.onMouseUp);
19189
+ };
19196
19190
 
19197
- _this.onDrag = function (event) {
19198
- if (!_this.formatter.currentSpec) {
19199
- return;
19200
- }
19191
+ _this.onDrag = function (event) {
19192
+ if (!_this.formatter.currentSpec) {
19193
+ return;
19194
+ }
19201
19195
 
19202
- var target = _this.formatter.currentSpec.getTargetElement();
19203
- if (!target) {
19204
- return;
19205
- }
19196
+ var target = _this.formatter.currentSpec.getTargetElement();
19197
+ if (!target) {
19198
+ return;
19199
+ }
19206
19200
 
19207
- var deltaX = event.clientX - _this.dragStartX;
19208
- var newWidth = 0;
19201
+ var deltaX = event.clientX - _this.dragStartX;
19202
+ var newWidth = 0;
19209
19203
 
19210
- if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
19211
- newWidth = Math.round(_this.preDragWidth - deltaX);
19212
- } else {
19213
- newWidth = Math.round(_this.preDragWidth + deltaX);
19214
- }
19204
+ if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
19205
+ newWidth = Math.round(_this.preDragWidth - deltaX);
19206
+ } else {
19207
+ newWidth = Math.round(_this.preDragWidth + deltaX);
19208
+ }
19215
19209
 
19216
- var newHeight = _this.targetRatio * newWidth;
19210
+ var newHeight = _this.targetRatio * newWidth;
19217
19211
 
19218
- target.setAttribute('width', '' + newWidth);
19219
- target.setAttribute('height', '' + newHeight);
19212
+ target.setAttribute('width', '' + newWidth);
19213
+ target.setAttribute('height', '' + newHeight);
19220
19214
 
19221
- _this.formatter.update();
19222
- };
19215
+ _this.formatter.update();
19216
+ };
19223
19217
 
19224
- _this.onMouseUp = function () {
19225
- _this.setCursor('');
19226
- document.removeEventListener('mousemove', _this.onDrag);
19227
- document.removeEventListener('mouseup', _this.onMouseUp);
19228
- };
19218
+ _this.onMouseUp = function () {
19219
+ _this.setCursor('');
19220
+ document.removeEventListener('mousemove', _this.onDrag);
19221
+ document.removeEventListener('mouseup', _this.onMouseUp);
19222
+ };
19229
19223
 
19230
- _this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
19231
- _this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
19232
- _this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
19233
- _this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
19234
- _this.dragHandle = null;
19235
- _this.dragStartX = 0;
19236
- _this.preDragWidth = 0;
19237
- _this.targetRatio = 0;
19238
- return _this;
19239
- }
19224
+ _this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
19225
+ _this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
19226
+ _this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
19227
+ _this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
19228
+ _this.dragHandle = null;
19229
+ _this.dragStartX = 0;
19230
+ _this.preDragWidth = 0;
19231
+ _this.targetRatio = 0;
19232
+ return _this;
19233
+ }
19240
19234
 
19241
- _createClass(ResizeAction, [{
19242
- key: 'onCreate',
19243
- value: function onCreate() {
19244
- this.formatter.overlay.appendChild(this.topLeftHandle);
19245
- this.formatter.overlay.appendChild(this.topRightHandle);
19246
- this.formatter.overlay.appendChild(this.bottomRightHandle);
19247
- this.formatter.overlay.appendChild(this.bottomLeftHandle);
19235
+ _createClass(ResizeAction, [{
19236
+ key: 'onCreate',
19237
+ value: function onCreate() {
19238
+ this.formatter.overlay.appendChild(this.topLeftHandle);
19239
+ this.formatter.overlay.appendChild(this.topRightHandle);
19240
+ this.formatter.overlay.appendChild(this.bottomRightHandle);
19241
+ this.formatter.overlay.appendChild(this.bottomLeftHandle);
19248
19242
 
19249
- this.repositionHandles(this.formatter.options.resize.handleStyle);
19250
- }
19251
- }, {
19252
- key: 'onDestroy',
19253
- value: function onDestroy() {
19254
- this.setCursor('');
19255
- this.formatter.overlay.removeChild(this.topLeftHandle);
19256
- this.formatter.overlay.removeChild(this.topRightHandle);
19257
- this.formatter.overlay.removeChild(this.bottomRightHandle);
19258
- this.formatter.overlay.removeChild(this.bottomLeftHandle);
19259
- }
19260
- }, {
19261
- key: 'createHandle',
19262
- value: function createHandle(position, cursor) {
19263
- var box = document.createElement('div');
19264
- box.classList.add(this.formatter.options.resize.handleClassName);
19265
- box.setAttribute('data-position', position);
19266
- box.style.cursor = cursor;
19267
-
19268
- if (this.formatter.options.resize.handleStyle) {
19269
- Object.assign(box.style, this.formatter.options.resize.handleStyle);
19270
- }
19243
+ this.repositionHandles(this.formatter.options.resize.handleStyle);
19244
+ }
19245
+ }, {
19246
+ key: 'onDestroy',
19247
+ value: function onDestroy() {
19248
+ this.setCursor('');
19249
+ this.formatter.overlay.removeChild(this.topLeftHandle);
19250
+ this.formatter.overlay.removeChild(this.topRightHandle);
19251
+ this.formatter.overlay.removeChild(this.bottomRightHandle);
19252
+ this.formatter.overlay.removeChild(this.bottomLeftHandle);
19253
+ }
19254
+ }, {
19255
+ key: 'createHandle',
19256
+ value: function createHandle(position, cursor) {
19257
+ var box = document.createElement('div');
19258
+ box.classList.add(this.formatter.options.resize.handleClassName);
19259
+ box.setAttribute('data-position', position);
19260
+ box.style.cursor = cursor;
19261
+
19262
+ if (this.formatter.options.resize.handleStyle) {
19263
+ Object.assign(box.style, this.formatter.options.resize.handleStyle);
19264
+ }
19271
19265
 
19272
- box.addEventListener('mousedown', this.onMouseDown);
19266
+ box.addEventListener('mousedown', this.onMouseDown);
19273
19267
 
19274
- return box;
19275
- }
19276
- }, {
19277
- key: 'repositionHandles',
19278
- value: function repositionHandles(handleStyle) {
19279
- var handleXOffset = '0px';
19280
- var handleYOffset = '0px';
19281
- if (handleStyle) {
19282
- if (handleStyle.width) {
19283
- handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
19284
- }
19285
- if (handleStyle.height) {
19286
- handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
19287
- }
19288
- }
19268
+ return box;
19269
+ }
19270
+ }, {
19271
+ key: 'repositionHandles',
19272
+ value: function repositionHandles(handleStyle) {
19273
+ var handleXOffset = '0px';
19274
+ var handleYOffset = '0px';
19275
+ if (handleStyle) {
19276
+ if (handleStyle.width) {
19277
+ handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
19278
+ }
19279
+ if (handleStyle.height) {
19280
+ handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
19281
+ }
19282
+ }
19289
19283
 
19290
- Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
19291
- Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
19292
- Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
19293
- Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
19294
- }
19295
- }, {
19296
- key: 'setCursor',
19297
- value: function setCursor(value) {
19298
- if (document.body) {
19299
- document.body.style.cursor = value;
19300
- }
19284
+ Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
19285
+ Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
19286
+ Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
19287
+ Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
19288
+ }
19289
+ }, {
19290
+ key: 'setCursor',
19291
+ value: function setCursor(value) {
19292
+ if (document.body) {
19293
+ document.body.style.cursor = value;
19294
+ }
19301
19295
 
19302
- if (this.formatter.currentSpec) {
19303
- var target = this.formatter.currentSpec.getOverlayElement();
19304
- if (target) {
19305
- target.style.cursor = value;
19306
- }
19307
- }
19308
- }
19309
- }]);
19296
+ if (this.formatter.currentSpec) {
19297
+ var target = this.formatter.currentSpec.getOverlayElement();
19298
+ if (target) {
19299
+ target.style.cursor = value;
19300
+ }
19301
+ }
19302
+ }
19303
+ }]);
19310
19304
 
19311
- return ResizeAction;
19312
- }(_Action3.default);
19305
+ return ResizeAction;
19306
+ }(_Action3.default);
19313
19307
 
19314
- ResizeAction.default = ResizeAction$1;
19315
- return ResizeAction;
19316
- }
19308
+ ResizeAction$1.default = ResizeAction;
19317
19309
 
19318
19310
  var DeleteAction = {};
19319
19311
 
@@ -19420,7 +19412,7 @@
19420
19412
 
19421
19413
  var _AlignAction2 = _interopRequireDefault(_AlignAction);
19422
19414
 
19423
- var _ResizeAction = requireResizeAction();
19415
+ var _ResizeAction = ResizeAction$1;
19424
19416
 
19425
19417
  var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
19426
19418
 
@@ -19552,148 +19544,156 @@
19552
19544
 
19553
19545
  var IframeVideoSpec = {};
19554
19546
 
19555
- var UnclickableBlotSpec$1 = {};
19547
+ var UnclickableBlotSpec = {};
19556
19548
 
19557
- Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
19558
- value: true
19559
- });
19549
+ var hasRequiredUnclickableBlotSpec;
19560
19550
 
19561
- 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; }; }();
19551
+ function requireUnclickableBlotSpec () {
19552
+ if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
19553
+ hasRequiredUnclickableBlotSpec = 1;
19562
19554
 
19563
- var _BlotSpec2 = requireBlotSpec();
19555
+ Object.defineProperty(UnclickableBlotSpec, "__esModule", {
19556
+ value: true
19557
+ });
19564
19558
 
19565
- var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19559
+ 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; }; }();
19566
19560
 
19567
- var _BlotFormatter = requireBlotFormatter();
19561
+ var _BlotSpec2 = requireBlotSpec();
19568
19562
 
19569
- _interopRequireDefault(_BlotFormatter);
19563
+ var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19570
19564
 
19571
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19565
+ var _BlotFormatter = requireBlotFormatter();
19572
19566
 
19573
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19567
+ _interopRequireDefault(_BlotFormatter);
19574
19568
 
19575
- 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; }
19569
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19576
19570
 
19577
- 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; }
19571
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19578
19572
 
19579
- var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19580
- var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19573
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19581
19574
 
19582
- var UnclickableBlotSpec = function (_BlotSpec) {
19583
- _inherits(UnclickableBlotSpec, _BlotSpec);
19575
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19584
19576
 
19585
- function UnclickableBlotSpec(formatter, selector) {
19586
- _classCallCheck(this, UnclickableBlotSpec);
19577
+ var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19578
+ var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19587
19579
 
19588
- var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19580
+ var UnclickableBlotSpec$1 = function (_BlotSpec) {
19581
+ _inherits(UnclickableBlotSpec, _BlotSpec);
19589
19582
 
19590
- _this.onTextChange = function () {
19591
- Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19592
- unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19593
- unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19594
- });
19595
- };
19583
+ function UnclickableBlotSpec(formatter, selector) {
19584
+ _classCallCheck(this, UnclickableBlotSpec);
19596
19585
 
19597
- _this.onMouseEnter = function (event) {
19598
- var unclickable = event.target;
19599
- if (!(unclickable instanceof HTMLElement)) {
19600
- return;
19601
- }
19586
+ var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19602
19587
 
19603
- _this.nextUnclickable = unclickable;
19604
- _this.repositionProxyImage(_this.nextUnclickable);
19605
- };
19588
+ _this.onTextChange = function () {
19589
+ Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19590
+ unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19591
+ unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19592
+ });
19593
+ };
19606
19594
 
19607
- _this.onProxyImageClick = function () {
19608
- _this.unclickable = _this.nextUnclickable;
19609
- _this.nextUnclickable = null;
19610
- _this.formatter.show(_this);
19611
- _this.hideProxyImage();
19612
- };
19595
+ _this.onMouseEnter = function (event) {
19596
+ var unclickable = event.target;
19597
+ if (!(unclickable instanceof HTMLElement)) {
19598
+ return;
19599
+ }
19613
19600
 
19614
- _this.selector = selector;
19615
- _this.unclickable = null;
19616
- _this.nextUnclickable = null;
19617
- return _this;
19618
- }
19601
+ _this.nextUnclickable = unclickable;
19602
+ _this.repositionProxyImage(_this.nextUnclickable);
19603
+ };
19619
19604
 
19620
- _createClass(UnclickableBlotSpec, [{
19621
- key: 'init',
19622
- value: function init() {
19623
- if (document.body) {
19624
- /*
19625
- it's important that this is attached to the body instead of the root quill element.
19626
- this prevents the click event from overlapping with ImageSpec
19627
- */
19628
- document.body.appendChild(this.createProxyImage());
19629
- }
19605
+ _this.onProxyImageClick = function () {
19606
+ _this.unclickable = _this.nextUnclickable;
19607
+ _this.nextUnclickable = null;
19608
+ _this.formatter.show(_this);
19609
+ _this.hideProxyImage();
19610
+ };
19630
19611
 
19631
- this.hideProxyImage();
19632
- this.proxyImage.addEventListener('click', this.onProxyImageClick);
19633
- this.formatter.quill.on('text-change', this.onTextChange);
19634
- }
19635
- }, {
19636
- key: 'getTargetElement',
19637
- value: function getTargetElement() {
19638
- return this.unclickable;
19639
- }
19640
- }, {
19641
- key: 'getOverlayElement',
19642
- value: function getOverlayElement() {
19643
- return this.unclickable;
19644
- }
19645
- }, {
19646
- key: 'onHide',
19647
- value: function onHide() {
19648
- this.hideProxyImage();
19649
- this.nextUnclickable = null;
19650
- this.unclickable = null;
19651
- }
19652
- }, {
19653
- key: 'createProxyImage',
19654
- value: function createProxyImage() {
19655
- var canvas = document.createElement('canvas');
19656
- var context = canvas.getContext('2d');
19657
- context.globalAlpha = 0;
19658
- context.fillRect(0, 0, 1, 1);
19659
-
19660
- this.proxyImage = document.createElement('img');
19661
- this.proxyImage.src = canvas.toDataURL('image/png');
19662
- this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19663
-
19664
- Object.assign(this.proxyImage.style, {
19665
- position: 'absolute',
19666
- margin: '0'
19667
- });
19612
+ _this.selector = selector;
19613
+ _this.unclickable = null;
19614
+ _this.nextUnclickable = null;
19615
+ return _this;
19616
+ }
19668
19617
 
19669
- return this.proxyImage;
19670
- }
19671
- }, {
19672
- key: 'hideProxyImage',
19673
- value: function hideProxyImage() {
19674
- Object.assign(this.proxyImage.style, {
19675
- display: 'none'
19676
- });
19677
- }
19678
- }, {
19679
- key: 'repositionProxyImage',
19680
- value: function repositionProxyImage(unclickable) {
19681
- var rect = unclickable.getBoundingClientRect();
19682
-
19683
- Object.assign(this.proxyImage.style, {
19684
- display: 'block',
19685
- left: rect.left + window.pageXOffset + 'px',
19686
- top: rect.top + window.pageYOffset + 'px',
19687
- width: rect.width + 'px',
19688
- height: rect.height + 'px'
19689
- });
19690
- }
19691
- }]);
19618
+ _createClass(UnclickableBlotSpec, [{
19619
+ key: 'init',
19620
+ value: function init() {
19621
+ if (document.body) {
19622
+ /*
19623
+ it's important that this is attached to the body instead of the root quill element.
19624
+ this prevents the click event from overlapping with ImageSpec
19625
+ */
19626
+ document.body.appendChild(this.createProxyImage());
19627
+ }
19628
+
19629
+ this.hideProxyImage();
19630
+ this.proxyImage.addEventListener('click', this.onProxyImageClick);
19631
+ this.formatter.quill.on('text-change', this.onTextChange);
19632
+ }
19633
+ }, {
19634
+ key: 'getTargetElement',
19635
+ value: function getTargetElement() {
19636
+ return this.unclickable;
19637
+ }
19638
+ }, {
19639
+ key: 'getOverlayElement',
19640
+ value: function getOverlayElement() {
19641
+ return this.unclickable;
19642
+ }
19643
+ }, {
19644
+ key: 'onHide',
19645
+ value: function onHide() {
19646
+ this.hideProxyImage();
19647
+ this.nextUnclickable = null;
19648
+ this.unclickable = null;
19649
+ }
19650
+ }, {
19651
+ key: 'createProxyImage',
19652
+ value: function createProxyImage() {
19653
+ var canvas = document.createElement('canvas');
19654
+ var context = canvas.getContext('2d');
19655
+ context.globalAlpha = 0;
19656
+ context.fillRect(0, 0, 1, 1);
19657
+
19658
+ this.proxyImage = document.createElement('img');
19659
+ this.proxyImage.src = canvas.toDataURL('image/png');
19660
+ this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19661
+
19662
+ Object.assign(this.proxyImage.style, {
19663
+ position: 'absolute',
19664
+ margin: '0'
19665
+ });
19666
+
19667
+ return this.proxyImage;
19668
+ }
19669
+ }, {
19670
+ key: 'hideProxyImage',
19671
+ value: function hideProxyImage() {
19672
+ Object.assign(this.proxyImage.style, {
19673
+ display: 'none'
19674
+ });
19675
+ }
19676
+ }, {
19677
+ key: 'repositionProxyImage',
19678
+ value: function repositionProxyImage(unclickable) {
19679
+ var rect = unclickable.getBoundingClientRect();
19692
19680
 
19693
- return UnclickableBlotSpec;
19694
- }(_BlotSpec3.default);
19681
+ Object.assign(this.proxyImage.style, {
19682
+ display: 'block',
19683
+ left: rect.left + window.pageXOffset + 'px',
19684
+ top: rect.top + window.pageYOffset + 'px',
19685
+ width: rect.width + 'px',
19686
+ height: rect.height + 'px'
19687
+ });
19688
+ }
19689
+ }]);
19695
19690
 
19696
- UnclickableBlotSpec$1.default = UnclickableBlotSpec;
19691
+ return UnclickableBlotSpec;
19692
+ }(_BlotSpec3.default);
19693
+
19694
+ UnclickableBlotSpec.default = UnclickableBlotSpec$1;
19695
+ return UnclickableBlotSpec;
19696
+ }
19697
19697
 
19698
19698
  var hasRequiredIframeVideoSpec;
19699
19699
 
@@ -19705,7 +19705,7 @@
19705
19705
  value: true
19706
19706
  });
19707
19707
 
19708
- var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
19708
+ var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
19709
19709
 
19710
19710
  var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
19711
19711
 
@@ -19905,7 +19905,7 @@
19905
19905
  }
19906
19906
  });
19907
19907
 
19908
- var _ResizeAction = requireResizeAction();
19908
+ var _ResizeAction = ResizeAction$1;
19909
19909
 
19910
19910
  Object.defineProperty(exports, 'ResizeAction', {
19911
19911
  enumerable: true,
@@ -19932,7 +19932,7 @@
19932
19932
  }
19933
19933
  });
19934
19934
 
19935
- var _UnclickableBlotSpec = UnclickableBlotSpec$1;
19935
+ var _UnclickableBlotSpec = requireUnclickableBlotSpec();
19936
19936
 
19937
19937
  Object.defineProperty(exports, 'UnclickableBlotSpec', {
19938
19938
  enumerable: true,
@@ -19998,6 +19998,12 @@
19998
19998
  return ['fixed-top', 'embedded'].includes(value);
19999
19999
  },
20000
20000
  },
20001
+ // 传入toolbar的自定义style
20002
+ toolbarStyle: {
20003
+ type: Object,
20004
+ required: false,
20005
+ default: () => ({})
20006
+ },
20001
20007
  theme: {
20002
20008
  type: String,
20003
20009
  default: 'snow',
@@ -20059,11 +20065,6 @@
20059
20065
  let quill;
20060
20066
  let options;
20061
20067
  const editor = vue.ref();
20062
- const editorWrapStyle = vue.computed(() => {
20063
- return {
20064
- minHeight: `${props.minHeight}px`,
20065
- };
20066
- });
20067
20068
  const editorWrapClass = vue.computed(() => {
20068
20069
  return {
20069
20070
  'quill-editor-container': true,
@@ -20072,6 +20073,37 @@
20072
20073
  'embedded': props.toolbarMode === 'embedded',
20073
20074
  };
20074
20075
  });
20076
+ // 监听 minHeight 变化,同步设置编辑器高度
20077
+ const updateEditorHeight = () => {
20078
+ if (quill && editor.value) {
20079
+ const editorElement = editor.value.querySelector('.ql-editor');
20080
+ if (editorElement) {
20081
+ editorElement.style.minHeight = `${props.minHeight}px`;
20082
+ }
20083
+ }
20084
+ };
20085
+ // 监听 minHeight 变化
20086
+ vue.watch(() => props.minHeight, () => {
20087
+ vue.nextTick(() => {
20088
+ updateEditorHeight();
20089
+ });
20090
+ });
20091
+ // 应用自定义toolbar样式
20092
+ const applyToolbarStyle = () => {
20093
+ var _a;
20094
+ if (quill && props.toolbarStyle) {
20095
+ const toolbar = (_a = quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
20096
+ if (toolbar) {
20097
+ Object.assign(toolbar.style, props.toolbarStyle);
20098
+ }
20099
+ }
20100
+ };
20101
+ // 监听 toolbarStyle 变化
20102
+ vue.watch(() => props.toolbarStyle, () => {
20103
+ vue.nextTick(() => {
20104
+ applyToolbarStyle();
20105
+ });
20106
+ });
20075
20107
  // Register Module if not already registered
20076
20108
  const registerModule = (moduleName, module) => {
20077
20109
  // For Quill 1.x, we can't check if module is already registered
@@ -20123,6 +20155,10 @@
20123
20155
  .getModule('toolbar')) === null || _b === void 0 ? void 0 : _b.container.addEventListener('mousedown', (e) => {
20124
20156
  e.preventDefault();
20125
20157
  });
20158
+ // 设置初始编辑器高度
20159
+ updateEditorHeight();
20160
+ // 应用初始toolbar样式
20161
+ applyToolbarStyle();
20126
20162
  // Emit ready event
20127
20163
  ctx.emit('ready', quill);
20128
20164
  };
@@ -20146,7 +20182,6 @@
20146
20182
  handlers: {
20147
20183
  ocr: function () {
20148
20184
  // 按钮点击逻辑
20149
- console.log('ocr');
20150
20185
  ctx.emit('ocr');
20151
20186
  },
20152
20187
  math: function () {
@@ -20209,7 +20244,6 @@
20209
20244
  const isEditorFocus = vue.ref();
20210
20245
  const handleSelectionChange = (range, oldRange, source) => {
20211
20246
  var _a;
20212
- // Set isEditorFocus if quill.hasFocus()
20213
20247
  isEditorFocus.value = !!(quill === null || quill === void 0 ? void 0 : quill.hasFocus());
20214
20248
  // 动态显示/隐藏toolbar
20215
20249
  const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
@@ -20345,14 +20379,13 @@
20345
20379
  getText,
20346
20380
  setText,
20347
20381
  reinit,
20348
- editorWrapStyle,
20349
20382
  editorWrapClass,
20350
20383
  };
20351
20384
  },
20352
20385
  render() {
20353
20386
  var _a, _b;
20354
20387
  return [
20355
- vue.h('div', { class: this.editorWrapClass, style: this.editorWrapStyle }, [
20388
+ vue.h('div', { class: this.editorWrapClass }, [
20356
20389
  (_b = (_a = this.$slots).toolbar) === null || _b === void 0 ? void 0 : _b.call(_a),
20357
20390
  vue.h('div', { ref: 'editor', ...this.$attrs }),
20358
20391
  ]),