pxx-vue-quill 1.0.125 → 1.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-quill.umd.js +335 -287
- package/dist/vue-quill.umd.prod.js +2 -2
- package/package.json +1 -1
package/dist/vue-quill.umd.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2025 Pxx-Team
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2025-09-
|
|
10
|
+
* Date: 2025-09-10T07:42:03.136Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18650,8 +18650,8 @@
|
|
|
18650
18650
|
}, [
|
|
18651
18651
|
vue.h('input', {
|
|
18652
18652
|
type: 'text',
|
|
18653
|
-
class: 'custom-link-input',
|
|
18654
18653
|
value: localLinkUrl.value,
|
|
18654
|
+
class: 'custom-link-input',
|
|
18655
18655
|
placeholder: '请输入链接',
|
|
18656
18656
|
onInput: (e) => {
|
|
18657
18657
|
localLinkUrl.value = e.target.value;
|
|
@@ -19340,190 +19340,182 @@
|
|
|
19340
19340
|
return AlignAction;
|
|
19341
19341
|
}
|
|
19342
19342
|
|
|
19343
|
-
var ResizeAction = {};
|
|
19344
|
-
|
|
19345
|
-
var hasRequiredResizeAction;
|
|
19346
|
-
|
|
19347
|
-
function requireResizeAction () {
|
|
19348
|
-
if (hasRequiredResizeAction) return ResizeAction;
|
|
19349
|
-
hasRequiredResizeAction = 1;
|
|
19343
|
+
var ResizeAction$1 = {};
|
|
19350
19344
|
|
|
19351
|
-
|
|
19352
|
-
|
|
19353
|
-
|
|
19345
|
+
Object.defineProperty(ResizeAction$1, "__esModule", {
|
|
19346
|
+
value: true
|
|
19347
|
+
});
|
|
19354
19348
|
|
|
19355
|
-
|
|
19349
|
+
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; }; }();
|
|
19356
19350
|
|
|
19357
|
-
|
|
19351
|
+
var _Action2 = requireAction();
|
|
19358
19352
|
|
|
19359
|
-
|
|
19353
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19360
19354
|
|
|
19361
|
-
|
|
19355
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19362
19356
|
|
|
19363
|
-
|
|
19357
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19364
19358
|
|
|
19365
|
-
|
|
19359
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19366
19360
|
|
|
19367
|
-
|
|
19361
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19368
19362
|
|
|
19369
|
-
|
|
19363
|
+
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; }
|
|
19370
19364
|
|
|
19371
|
-
|
|
19365
|
+
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; }
|
|
19372
19366
|
|
|
19373
|
-
|
|
19374
|
-
|
|
19367
|
+
var ResizeAction = function (_Action) {
|
|
19368
|
+
_inherits(ResizeAction, _Action);
|
|
19375
19369
|
|
|
19376
|
-
|
|
19377
|
-
|
|
19370
|
+
function ResizeAction(formatter) {
|
|
19371
|
+
_classCallCheck(this, ResizeAction);
|
|
19378
19372
|
|
|
19379
|
-
|
|
19373
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19380
19374
|
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19375
|
+
_this.onMouseDown = function (event) {
|
|
19376
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19377
|
+
return;
|
|
19378
|
+
}
|
|
19379
|
+
_this.dragHandle = event.target;
|
|
19380
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19387
19381
|
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19382
|
+
if (!_this.formatter.currentSpec) {
|
|
19383
|
+
return;
|
|
19384
|
+
}
|
|
19391
19385
|
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19386
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19387
|
+
if (!target) {
|
|
19388
|
+
return;
|
|
19389
|
+
}
|
|
19396
19390
|
|
|
19397
|
-
|
|
19391
|
+
var rect = target.getBoundingClientRect();
|
|
19398
19392
|
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
|
|
19393
|
+
_this.dragStartX = event.clientX;
|
|
19394
|
+
_this.preDragWidth = rect.width;
|
|
19395
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19402
19396
|
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19397
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19398
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19399
|
+
};
|
|
19406
19400
|
|
|
19407
|
-
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19401
|
+
_this.onDrag = function (event) {
|
|
19402
|
+
if (!_this.formatter.currentSpec) {
|
|
19403
|
+
return;
|
|
19404
|
+
}
|
|
19411
19405
|
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19406
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19407
|
+
if (!target) {
|
|
19408
|
+
return;
|
|
19409
|
+
}
|
|
19416
19410
|
|
|
19417
|
-
|
|
19418
|
-
|
|
19411
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19412
|
+
var newWidth = 0;
|
|
19419
19413
|
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19414
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19415
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19416
|
+
} else {
|
|
19417
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19418
|
+
}
|
|
19425
19419
|
|
|
19426
|
-
|
|
19420
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19427
19421
|
|
|
19428
|
-
|
|
19429
|
-
|
|
19422
|
+
target.setAttribute('width', '' + newWidth);
|
|
19423
|
+
target.setAttribute('height', '' + newHeight);
|
|
19430
19424
|
|
|
19431
|
-
|
|
19432
|
-
|
|
19425
|
+
_this.formatter.update();
|
|
19426
|
+
};
|
|
19433
19427
|
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19428
|
+
_this.onMouseUp = function () {
|
|
19429
|
+
_this.setCursor('');
|
|
19430
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19431
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19432
|
+
};
|
|
19439
19433
|
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19434
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19435
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19436
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19437
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19438
|
+
_this.dragHandle = null;
|
|
19439
|
+
_this.dragStartX = 0;
|
|
19440
|
+
_this.preDragWidth = 0;
|
|
19441
|
+
_this.targetRatio = 0;
|
|
19442
|
+
return _this;
|
|
19443
|
+
}
|
|
19450
19444
|
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19445
|
+
_createClass(ResizeAction, [{
|
|
19446
|
+
key: 'onCreate',
|
|
19447
|
+
value: function onCreate() {
|
|
19448
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19449
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19450
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19451
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19458
19452
|
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
|
|
19480
|
-
|
|
19453
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19454
|
+
}
|
|
19455
|
+
}, {
|
|
19456
|
+
key: 'onDestroy',
|
|
19457
|
+
value: function onDestroy() {
|
|
19458
|
+
this.setCursor('');
|
|
19459
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19460
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19461
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19462
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19463
|
+
}
|
|
19464
|
+
}, {
|
|
19465
|
+
key: 'createHandle',
|
|
19466
|
+
value: function createHandle(position, cursor) {
|
|
19467
|
+
var box = document.createElement('div');
|
|
19468
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19469
|
+
box.setAttribute('data-position', position);
|
|
19470
|
+
box.style.cursor = cursor;
|
|
19471
|
+
|
|
19472
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19473
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19474
|
+
}
|
|
19481
19475
|
|
|
19482
|
-
|
|
19476
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19483
19477
|
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19478
|
+
return box;
|
|
19479
|
+
}
|
|
19480
|
+
}, {
|
|
19481
|
+
key: 'repositionHandles',
|
|
19482
|
+
value: function repositionHandles(handleStyle) {
|
|
19483
|
+
var handleXOffset = '0px';
|
|
19484
|
+
var handleYOffset = '0px';
|
|
19485
|
+
if (handleStyle) {
|
|
19486
|
+
if (handleStyle.width) {
|
|
19487
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19488
|
+
}
|
|
19489
|
+
if (handleStyle.height) {
|
|
19490
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19491
|
+
}
|
|
19492
|
+
}
|
|
19499
19493
|
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
|
|
19494
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19495
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19496
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19497
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19498
|
+
}
|
|
19499
|
+
}, {
|
|
19500
|
+
key: 'setCursor',
|
|
19501
|
+
value: function setCursor(value) {
|
|
19502
|
+
if (document.body) {
|
|
19503
|
+
document.body.style.cursor = value;
|
|
19504
|
+
}
|
|
19511
19505
|
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19506
|
+
if (this.formatter.currentSpec) {
|
|
19507
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19508
|
+
if (target) {
|
|
19509
|
+
target.style.cursor = value;
|
|
19510
|
+
}
|
|
19511
|
+
}
|
|
19512
|
+
}
|
|
19513
|
+
}]);
|
|
19520
19514
|
|
|
19521
|
-
|
|
19522
|
-
|
|
19515
|
+
return ResizeAction;
|
|
19516
|
+
}(_Action3.default);
|
|
19523
19517
|
|
|
19524
|
-
|
|
19525
|
-
return ResizeAction;
|
|
19526
|
-
}
|
|
19518
|
+
ResizeAction$1.default = ResizeAction;
|
|
19527
19519
|
|
|
19528
19520
|
var DeleteAction = {};
|
|
19529
19521
|
|
|
@@ -19630,7 +19622,7 @@
|
|
|
19630
19622
|
|
|
19631
19623
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19632
19624
|
|
|
19633
|
-
var _ResizeAction =
|
|
19625
|
+
var _ResizeAction = ResizeAction$1;
|
|
19634
19626
|
|
|
19635
19627
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19636
19628
|
|
|
@@ -19762,148 +19754,156 @@
|
|
|
19762
19754
|
|
|
19763
19755
|
var IframeVideoSpec = {};
|
|
19764
19756
|
|
|
19765
|
-
var UnclickableBlotSpec
|
|
19757
|
+
var UnclickableBlotSpec = {};
|
|
19766
19758
|
|
|
19767
|
-
|
|
19768
|
-
value: true
|
|
19769
|
-
});
|
|
19759
|
+
var hasRequiredUnclickableBlotSpec;
|
|
19770
19760
|
|
|
19771
|
-
|
|
19761
|
+
function requireUnclickableBlotSpec () {
|
|
19762
|
+
if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
|
|
19763
|
+
hasRequiredUnclickableBlotSpec = 1;
|
|
19772
19764
|
|
|
19773
|
-
|
|
19765
|
+
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19766
|
+
value: true
|
|
19767
|
+
});
|
|
19774
19768
|
|
|
19775
|
-
|
|
19769
|
+
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; }; }();
|
|
19776
19770
|
|
|
19777
|
-
|
|
19771
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19778
19772
|
|
|
19779
|
-
|
|
19773
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19780
19774
|
|
|
19781
|
-
|
|
19775
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19782
19776
|
|
|
19783
|
-
|
|
19777
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19784
19778
|
|
|
19785
|
-
|
|
19779
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19786
19780
|
|
|
19787
|
-
|
|
19781
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19788
19782
|
|
|
19789
|
-
|
|
19790
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19783
|
+
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; }
|
|
19791
19784
|
|
|
19792
|
-
|
|
19793
|
-
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19785
|
+
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; }
|
|
19794
19786
|
|
|
19795
|
-
|
|
19796
|
-
|
|
19787
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19788
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19797
19789
|
|
|
19798
|
-
|
|
19790
|
+
var UnclickableBlotSpec$1 = function (_BlotSpec) {
|
|
19791
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19799
19792
|
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19803
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19804
|
-
});
|
|
19805
|
-
};
|
|
19793
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19794
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19806
19795
|
|
|
19807
|
-
|
|
19808
|
-
var unclickable = event.target;
|
|
19809
|
-
if (!(unclickable instanceof HTMLElement)) {
|
|
19810
|
-
return;
|
|
19811
|
-
}
|
|
19796
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19812
19797
|
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19798
|
+
_this.onTextChange = function () {
|
|
19799
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19800
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19801
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19802
|
+
});
|
|
19803
|
+
};
|
|
19816
19804
|
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
};
|
|
19805
|
+
_this.onMouseEnter = function (event) {
|
|
19806
|
+
var unclickable = event.target;
|
|
19807
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19808
|
+
return;
|
|
19809
|
+
}
|
|
19823
19810
|
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
return _this;
|
|
19828
|
-
}
|
|
19811
|
+
_this.nextUnclickable = unclickable;
|
|
19812
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19813
|
+
};
|
|
19829
19814
|
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19837
|
-
*/
|
|
19838
|
-
document.body.appendChild(this.createProxyImage());
|
|
19839
|
-
}
|
|
19815
|
+
_this.onProxyImageClick = function () {
|
|
19816
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19817
|
+
_this.nextUnclickable = null;
|
|
19818
|
+
_this.formatter.show(_this);
|
|
19819
|
+
_this.hideProxyImage();
|
|
19820
|
+
};
|
|
19840
19821
|
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
key: 'getTargetElement',
|
|
19847
|
-
value: function getTargetElement() {
|
|
19848
|
-
return this.unclickable;
|
|
19849
|
-
}
|
|
19850
|
-
}, {
|
|
19851
|
-
key: 'getOverlayElement',
|
|
19852
|
-
value: function getOverlayElement() {
|
|
19853
|
-
return this.unclickable;
|
|
19854
|
-
}
|
|
19855
|
-
}, {
|
|
19856
|
-
key: 'onHide',
|
|
19857
|
-
value: function onHide() {
|
|
19858
|
-
this.hideProxyImage();
|
|
19859
|
-
this.nextUnclickable = null;
|
|
19860
|
-
this.unclickable = null;
|
|
19861
|
-
}
|
|
19862
|
-
}, {
|
|
19863
|
-
key: 'createProxyImage',
|
|
19864
|
-
value: function createProxyImage() {
|
|
19865
|
-
var canvas = document.createElement('canvas');
|
|
19866
|
-
var context = canvas.getContext('2d');
|
|
19867
|
-
context.globalAlpha = 0;
|
|
19868
|
-
context.fillRect(0, 0, 1, 1);
|
|
19869
|
-
|
|
19870
|
-
this.proxyImage = document.createElement('img');
|
|
19871
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19872
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19873
|
-
|
|
19874
|
-
Object.assign(this.proxyImage.style, {
|
|
19875
|
-
position: 'absolute',
|
|
19876
|
-
margin: '0'
|
|
19877
|
-
});
|
|
19822
|
+
_this.selector = selector;
|
|
19823
|
+
_this.unclickable = null;
|
|
19824
|
+
_this.nextUnclickable = null;
|
|
19825
|
+
return _this;
|
|
19826
|
+
}
|
|
19878
19827
|
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19889
|
-
|
|
19890
|
-
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19828
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19829
|
+
key: 'init',
|
|
19830
|
+
value: function init() {
|
|
19831
|
+
if (document.body) {
|
|
19832
|
+
/*
|
|
19833
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19834
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19835
|
+
*/
|
|
19836
|
+
document.body.appendChild(this.createProxyImage());
|
|
19837
|
+
}
|
|
19838
|
+
|
|
19839
|
+
this.hideProxyImage();
|
|
19840
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19841
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19842
|
+
}
|
|
19843
|
+
}, {
|
|
19844
|
+
key: 'getTargetElement',
|
|
19845
|
+
value: function getTargetElement() {
|
|
19846
|
+
return this.unclickable;
|
|
19847
|
+
}
|
|
19848
|
+
}, {
|
|
19849
|
+
key: 'getOverlayElement',
|
|
19850
|
+
value: function getOverlayElement() {
|
|
19851
|
+
return this.unclickable;
|
|
19852
|
+
}
|
|
19853
|
+
}, {
|
|
19854
|
+
key: 'onHide',
|
|
19855
|
+
value: function onHide() {
|
|
19856
|
+
this.hideProxyImage();
|
|
19857
|
+
this.nextUnclickable = null;
|
|
19858
|
+
this.unclickable = null;
|
|
19859
|
+
}
|
|
19860
|
+
}, {
|
|
19861
|
+
key: 'createProxyImage',
|
|
19862
|
+
value: function createProxyImage() {
|
|
19863
|
+
var canvas = document.createElement('canvas');
|
|
19864
|
+
var context = canvas.getContext('2d');
|
|
19865
|
+
context.globalAlpha = 0;
|
|
19866
|
+
context.fillRect(0, 0, 1, 1);
|
|
19867
|
+
|
|
19868
|
+
this.proxyImage = document.createElement('img');
|
|
19869
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19870
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19871
|
+
|
|
19872
|
+
Object.assign(this.proxyImage.style, {
|
|
19873
|
+
position: 'absolute',
|
|
19874
|
+
margin: '0'
|
|
19875
|
+
});
|
|
19902
19876
|
|
|
19903
|
-
|
|
19904
|
-
|
|
19877
|
+
return this.proxyImage;
|
|
19878
|
+
}
|
|
19879
|
+
}, {
|
|
19880
|
+
key: 'hideProxyImage',
|
|
19881
|
+
value: function hideProxyImage() {
|
|
19882
|
+
Object.assign(this.proxyImage.style, {
|
|
19883
|
+
display: 'none'
|
|
19884
|
+
});
|
|
19885
|
+
}
|
|
19886
|
+
}, {
|
|
19887
|
+
key: 'repositionProxyImage',
|
|
19888
|
+
value: function repositionProxyImage(unclickable) {
|
|
19889
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19905
19890
|
|
|
19906
|
-
|
|
19891
|
+
Object.assign(this.proxyImage.style, {
|
|
19892
|
+
display: 'block',
|
|
19893
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19894
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19895
|
+
width: rect.width + 'px',
|
|
19896
|
+
height: rect.height + 'px'
|
|
19897
|
+
});
|
|
19898
|
+
}
|
|
19899
|
+
}]);
|
|
19900
|
+
|
|
19901
|
+
return UnclickableBlotSpec;
|
|
19902
|
+
}(_BlotSpec3.default);
|
|
19903
|
+
|
|
19904
|
+
UnclickableBlotSpec.default = UnclickableBlotSpec$1;
|
|
19905
|
+
return UnclickableBlotSpec;
|
|
19906
|
+
}
|
|
19907
19907
|
|
|
19908
19908
|
var hasRequiredIframeVideoSpec;
|
|
19909
19909
|
|
|
@@ -19915,7 +19915,7 @@
|
|
|
19915
19915
|
value: true
|
|
19916
19916
|
});
|
|
19917
19917
|
|
|
19918
|
-
var _UnclickableBlotSpec2 =
|
|
19918
|
+
var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
|
|
19919
19919
|
|
|
19920
19920
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19921
19921
|
|
|
@@ -20115,7 +20115,7 @@
|
|
|
20115
20115
|
}
|
|
20116
20116
|
});
|
|
20117
20117
|
|
|
20118
|
-
var _ResizeAction =
|
|
20118
|
+
var _ResizeAction = ResizeAction$1;
|
|
20119
20119
|
|
|
20120
20120
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
20121
20121
|
enumerable: true,
|
|
@@ -20142,7 +20142,7 @@
|
|
|
20142
20142
|
}
|
|
20143
20143
|
});
|
|
20144
20144
|
|
|
20145
|
-
var _UnclickableBlotSpec =
|
|
20145
|
+
var _UnclickableBlotSpec = requireUnclickableBlotSpec();
|
|
20146
20146
|
|
|
20147
20147
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
20148
20148
|
enumerable: true,
|
|
@@ -20182,7 +20182,7 @@
|
|
|
20182
20182
|
console.warn('移除blotFormatter overlay时出错:', error);
|
|
20183
20183
|
}
|
|
20184
20184
|
};
|
|
20185
|
-
const
|
|
20185
|
+
const handleBlotFormatterClick = (event) => {
|
|
20186
20186
|
var _a;
|
|
20187
20187
|
if (!editor.value)
|
|
20188
20188
|
return;
|
|
@@ -20258,11 +20258,7 @@
|
|
|
20258
20258
|
blotFormatter: {}
|
|
20259
20259
|
};
|
|
20260
20260
|
};
|
|
20261
|
-
vue.onMounted(() => {
|
|
20262
|
-
window.addEventListener('click', handleGlobalClick, true);
|
|
20263
|
-
});
|
|
20264
20261
|
vue.onBeforeUnmount(() => {
|
|
20265
|
-
window.removeEventListener('click', handleGlobalClick, true);
|
|
20266
20262
|
removeQuillBlotFormatter();
|
|
20267
20263
|
});
|
|
20268
20264
|
const setQuill = (quillInstance) => {
|
|
@@ -20271,8 +20267,7 @@
|
|
|
20271
20267
|
return {
|
|
20272
20268
|
quillRef,
|
|
20273
20269
|
setQuill,
|
|
20274
|
-
|
|
20275
|
-
handleGlobalClick,
|
|
20270
|
+
handleBlotFormatterClick,
|
|
20276
20271
|
configureBlotFormatter,
|
|
20277
20272
|
applyImageStyle,
|
|
20278
20273
|
registerBlotFormatter,
|
|
@@ -20338,6 +20333,41 @@
|
|
|
20338
20333
|
};
|
|
20339
20334
|
}
|
|
20340
20335
|
|
|
20336
|
+
function useGlobalClick() {
|
|
20337
|
+
const clickHandlers = vue.ref([]);
|
|
20338
|
+
const handleGlobalClick = (event) => {
|
|
20339
|
+
console.log('handleGlobalClick');
|
|
20340
|
+
clickHandlers.value.forEach(handler => {
|
|
20341
|
+
try {
|
|
20342
|
+
handler(event);
|
|
20343
|
+
}
|
|
20344
|
+
catch (error) {
|
|
20345
|
+
console.warn('全局点击事件处理函数执行出错:', error);
|
|
20346
|
+
}
|
|
20347
|
+
});
|
|
20348
|
+
};
|
|
20349
|
+
const addClickHandler = (handler) => {
|
|
20350
|
+
if (typeof handler === 'function' && !clickHandlers.value.includes(handler)) {
|
|
20351
|
+
clickHandlers.value.push(handler);
|
|
20352
|
+
}
|
|
20353
|
+
};
|
|
20354
|
+
const clearClickHandlers = () => {
|
|
20355
|
+
clickHandlers.value = [];
|
|
20356
|
+
};
|
|
20357
|
+
vue.onMounted(() => {
|
|
20358
|
+
window.addEventListener('click', handleGlobalClick);
|
|
20359
|
+
});
|
|
20360
|
+
vue.onBeforeUnmount(() => {
|
|
20361
|
+
window.removeEventListener('click', handleGlobalClick);
|
|
20362
|
+
clearClickHandlers();
|
|
20363
|
+
});
|
|
20364
|
+
return {
|
|
20365
|
+
addClickHandler,
|
|
20366
|
+
clearClickHandlers,
|
|
20367
|
+
handleGlobalClick
|
|
20368
|
+
};
|
|
20369
|
+
}
|
|
20370
|
+
|
|
20341
20371
|
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>`;
|
|
20342
20372
|
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>`;
|
|
20343
20373
|
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>`;
|
|
@@ -20392,7 +20422,7 @@
|
|
|
20392
20422
|
},
|
|
20393
20423
|
enableImageResize: {
|
|
20394
20424
|
type: Boolean,
|
|
20395
|
-
default:
|
|
20425
|
+
default: true,
|
|
20396
20426
|
},
|
|
20397
20427
|
toolbarStyle: {
|
|
20398
20428
|
type: Object,
|
|
@@ -20437,14 +20467,13 @@
|
|
|
20437
20467
|
const canUseLink = vue.ref(false);
|
|
20438
20468
|
const linkPosition = vue.ref({ top: 0, left: 0 });
|
|
20439
20469
|
const savedRange = vue.ref(null);
|
|
20440
|
-
|
|
20441
|
-
const { setQuill,
|
|
20470
|
+
const { addClickHandler } = useGlobalClick();
|
|
20471
|
+
const { setQuill, handleBlotFormatterClick, configureBlotFormatter, applyImageStyle, registerBlotFormatter, getBlotFormatterConfig } = useBlotFormatter(editor, props.enableImageResize);
|
|
20442
20472
|
const { setQuill: setLinkQuill, setHandleCustomLink, addLinkClickListener } = useLinkClick(editor);
|
|
20443
20473
|
vue.onMounted(() => {
|
|
20444
20474
|
initialize();
|
|
20445
20475
|
});
|
|
20446
20476
|
vue.onBeforeUnmount(() => {
|
|
20447
|
-
removeQuillBlotFormatter();
|
|
20448
20477
|
quill = null;
|
|
20449
20478
|
});
|
|
20450
20479
|
let quill;
|
|
@@ -20548,10 +20577,10 @@
|
|
|
20548
20577
|
var _a;
|
|
20549
20578
|
if (!editor.value)
|
|
20550
20579
|
return;
|
|
20551
|
-
options = composeOptions();
|
|
20552
20580
|
if (props.enableImageResize) {
|
|
20553
20581
|
registerBlotFormatter();
|
|
20554
20582
|
}
|
|
20583
|
+
options = composeOptions();
|
|
20555
20584
|
setIcons();
|
|
20556
20585
|
quill = new Quill(editor.value, options);
|
|
20557
20586
|
setQuill(quill);
|
|
@@ -20564,6 +20593,28 @@
|
|
|
20564
20593
|
quill.on('text-change', updateHistoryState);
|
|
20565
20594
|
quill.on('selection-change', updateHistoryState);
|
|
20566
20595
|
addLinkClickListener();
|
|
20596
|
+
const toolbarClickHandler = (event) => {
|
|
20597
|
+
var _a;
|
|
20598
|
+
const target = event.target;
|
|
20599
|
+
const clickedEditorContainer = target.closest('.quill-editor-container');
|
|
20600
|
+
if (clickedEditorContainer) {
|
|
20601
|
+
const currentEditorContainer = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.closest('.quill-editor-container');
|
|
20602
|
+
if (clickedEditorContainer === currentEditorContainer) {
|
|
20603
|
+
controlToolbarVisible(true);
|
|
20604
|
+
}
|
|
20605
|
+
else {
|
|
20606
|
+
controlToolbarVisible(false);
|
|
20607
|
+
}
|
|
20608
|
+
}
|
|
20609
|
+
else {
|
|
20610
|
+
controlToolbarVisible(false);
|
|
20611
|
+
}
|
|
20612
|
+
};
|
|
20613
|
+
addClickHandler(toolbarClickHandler);
|
|
20614
|
+
addClickHandler(handleBlotFormatterClick);
|
|
20615
|
+
addClickHandler(() => {
|
|
20616
|
+
handleCustomLink(false);
|
|
20617
|
+
});
|
|
20567
20618
|
updateHistoryState();
|
|
20568
20619
|
const toolbarDom = (_a = quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
|
|
20569
20620
|
vue.nextTick(() => {
|
|
@@ -20716,9 +20767,6 @@
|
|
|
20716
20767
|
if (isEditorFocus.value) {
|
|
20717
20768
|
controlToolbarVisible(true);
|
|
20718
20769
|
}
|
|
20719
|
-
else {
|
|
20720
|
-
controlToolbarVisible(false);
|
|
20721
|
-
}
|
|
20722
20770
|
ctx.emit('selectionChange', { range, oldRange, source });
|
|
20723
20771
|
};
|
|
20724
20772
|
vue.watch(isEditorFocus, (focus) => {
|