pxx-vue-quill 1.0.99 → 1.0.100
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 +161 -153
- 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-10T02:07:14.968Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18993,11 +18993,11 @@
|
|
|
18993
18993
|
value: true
|
|
18994
18994
|
});
|
|
18995
18995
|
|
|
18996
|
-
var _createClass
|
|
18996
|
+
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; }; }();
|
|
18997
18997
|
|
|
18998
18998
|
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; }
|
|
18999
18999
|
|
|
19000
|
-
function _classCallCheck
|
|
19000
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19001
19001
|
|
|
19002
19002
|
var LEFT_ALIGN = 'left';
|
|
19003
19003
|
var CENTER_ALIGN = 'center';
|
|
@@ -19008,7 +19008,7 @@
|
|
|
19008
19008
|
var _this = this,
|
|
19009
19009
|
_alignments;
|
|
19010
19010
|
|
|
19011
|
-
_classCallCheck
|
|
19011
|
+
_classCallCheck(this, DefaultAligner);
|
|
19012
19012
|
|
|
19013
19013
|
this.applyStyle = options.aligner.applyStyle;
|
|
19014
19014
|
this.alignAttribute = options.attribute;
|
|
@@ -19036,7 +19036,7 @@
|
|
|
19036
19036
|
}), _alignments);
|
|
19037
19037
|
}
|
|
19038
19038
|
|
|
19039
|
-
_createClass
|
|
19039
|
+
_createClass(DefaultAligner, [{
|
|
19040
19040
|
key: 'getAlignments',
|
|
19041
19041
|
value: function getAlignments() {
|
|
19042
19042
|
var _this2 = this;
|
|
@@ -19339,182 +19339,190 @@
|
|
|
19339
19339
|
return AlignAction;
|
|
19340
19340
|
}
|
|
19341
19341
|
|
|
19342
|
-
var ResizeAction
|
|
19342
|
+
var ResizeAction = {};
|
|
19343
19343
|
|
|
19344
|
-
|
|
19345
|
-
value: true
|
|
19346
|
-
});
|
|
19344
|
+
var hasRequiredResizeAction;
|
|
19347
19345
|
|
|
19348
|
-
|
|
19346
|
+
function requireResizeAction () {
|
|
19347
|
+
if (hasRequiredResizeAction) return ResizeAction;
|
|
19348
|
+
hasRequiredResizeAction = 1;
|
|
19349
19349
|
|
|
19350
|
-
|
|
19350
|
+
Object.defineProperty(ResizeAction, "__esModule", {
|
|
19351
|
+
value: true
|
|
19352
|
+
});
|
|
19351
19353
|
|
|
19352
|
-
|
|
19354
|
+
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; }; }();
|
|
19353
19355
|
|
|
19354
|
-
|
|
19356
|
+
var _Action2 = requireAction();
|
|
19355
19357
|
|
|
19356
|
-
|
|
19358
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19357
19359
|
|
|
19358
|
-
|
|
19360
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19359
19361
|
|
|
19360
|
-
|
|
19362
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19361
19363
|
|
|
19362
|
-
|
|
19364
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19363
19365
|
|
|
19364
|
-
|
|
19366
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19365
19367
|
|
|
19366
|
-
|
|
19367
|
-
_inherits(ResizeAction, _Action);
|
|
19368
|
+
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; }
|
|
19368
19369
|
|
|
19369
|
-
|
|
19370
|
-
_classCallCheck(this, ResizeAction);
|
|
19370
|
+
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; }
|
|
19371
19371
|
|
|
19372
|
-
|
|
19372
|
+
var ResizeAction$1 = function (_Action) {
|
|
19373
|
+
_inherits(ResizeAction, _Action);
|
|
19373
19374
|
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
return;
|
|
19377
|
-
}
|
|
19378
|
-
_this.dragHandle = event.target;
|
|
19379
|
-
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19375
|
+
function ResizeAction(formatter) {
|
|
19376
|
+
_classCallCheck(this, ResizeAction);
|
|
19380
19377
|
|
|
19381
|
-
|
|
19382
|
-
return;
|
|
19383
|
-
}
|
|
19378
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19384
19379
|
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
|
|
19380
|
+
_this.onMouseDown = function (event) {
|
|
19381
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19382
|
+
return;
|
|
19383
|
+
}
|
|
19384
|
+
_this.dragHandle = event.target;
|
|
19385
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19389
19386
|
|
|
19390
|
-
|
|
19387
|
+
if (!_this.formatter.currentSpec) {
|
|
19388
|
+
return;
|
|
19389
|
+
}
|
|
19391
19390
|
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19391
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19392
|
+
if (!target) {
|
|
19393
|
+
return;
|
|
19394
|
+
}
|
|
19395
19395
|
|
|
19396
|
-
|
|
19397
|
-
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19398
|
-
};
|
|
19396
|
+
var rect = target.getBoundingClientRect();
|
|
19399
19397
|
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19403
|
-
}
|
|
19398
|
+
_this.dragStartX = event.clientX;
|
|
19399
|
+
_this.preDragWidth = rect.width;
|
|
19400
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19404
19401
|
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19408
|
-
}
|
|
19402
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19403
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19404
|
+
};
|
|
19409
19405
|
|
|
19410
|
-
|
|
19411
|
-
|
|
19406
|
+
_this.onDrag = function (event) {
|
|
19407
|
+
if (!_this.formatter.currentSpec) {
|
|
19408
|
+
return;
|
|
19409
|
+
}
|
|
19412
19410
|
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
}
|
|
19411
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19412
|
+
if (!target) {
|
|
19413
|
+
return;
|
|
19414
|
+
}
|
|
19418
19415
|
|
|
19419
|
-
|
|
19416
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19417
|
+
var newWidth = 0;
|
|
19420
19418
|
|
|
19421
|
-
|
|
19422
|
-
|
|
19419
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19420
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19421
|
+
} else {
|
|
19422
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19423
|
+
}
|
|
19423
19424
|
|
|
19424
|
-
|
|
19425
|
-
};
|
|
19425
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19426
19426
|
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
document.removeEventListener('mousemove', _this.onDrag);
|
|
19430
|
-
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19431
|
-
};
|
|
19427
|
+
target.setAttribute('width', '' + newWidth);
|
|
19428
|
+
target.setAttribute('height', '' + newHeight);
|
|
19432
19429
|
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19436
|
-
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19437
|
-
_this.dragHandle = null;
|
|
19438
|
-
_this.dragStartX = 0;
|
|
19439
|
-
_this.preDragWidth = 0;
|
|
19440
|
-
_this.targetRatio = 0;
|
|
19441
|
-
return _this;
|
|
19442
|
-
}
|
|
19430
|
+
_this.formatter.update();
|
|
19431
|
+
};
|
|
19443
19432
|
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19450
|
-
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19433
|
+
_this.onMouseUp = function () {
|
|
19434
|
+
_this.setCursor('');
|
|
19435
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19436
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19437
|
+
};
|
|
19451
19438
|
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
}
|
|
19463
|
-
}, {
|
|
19464
|
-
key: 'createHandle',
|
|
19465
|
-
value: function createHandle(position, cursor) {
|
|
19466
|
-
var box = document.createElement('div');
|
|
19467
|
-
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19468
|
-
box.setAttribute('data-position', position);
|
|
19469
|
-
box.style.cursor = cursor;
|
|
19470
|
-
|
|
19471
|
-
if (this.formatter.options.resize.handleStyle) {
|
|
19472
|
-
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19473
|
-
}
|
|
19439
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19440
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19441
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19442
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19443
|
+
_this.dragHandle = null;
|
|
19444
|
+
_this.dragStartX = 0;
|
|
19445
|
+
_this.preDragWidth = 0;
|
|
19446
|
+
_this.targetRatio = 0;
|
|
19447
|
+
return _this;
|
|
19448
|
+
}
|
|
19474
19449
|
|
|
19475
|
-
|
|
19450
|
+
_createClass(ResizeAction, [{
|
|
19451
|
+
key: 'onCreate',
|
|
19452
|
+
value: function onCreate() {
|
|
19453
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19454
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19455
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19456
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19476
19457
|
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
|
|
19480
|
-
|
|
19481
|
-
|
|
19482
|
-
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19458
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19459
|
+
}
|
|
19460
|
+
}, {
|
|
19461
|
+
key: 'onDestroy',
|
|
19462
|
+
value: function onDestroy() {
|
|
19463
|
+
this.setCursor('');
|
|
19464
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19465
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19466
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19467
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19468
|
+
}
|
|
19469
|
+
}, {
|
|
19470
|
+
key: 'createHandle',
|
|
19471
|
+
value: function createHandle(position, cursor) {
|
|
19472
|
+
var box = document.createElement('div');
|
|
19473
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19474
|
+
box.setAttribute('data-position', position);
|
|
19475
|
+
box.style.cursor = cursor;
|
|
19476
|
+
|
|
19477
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19478
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19479
|
+
}
|
|
19492
19480
|
|
|
19493
|
-
|
|
19494
|
-
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19495
|
-
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19496
|
-
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19497
|
-
}
|
|
19498
|
-
}, {
|
|
19499
|
-
key: 'setCursor',
|
|
19500
|
-
value: function setCursor(value) {
|
|
19501
|
-
if (document.body) {
|
|
19502
|
-
document.body.style.cursor = value;
|
|
19503
|
-
}
|
|
19481
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19504
19482
|
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
|
|
19511
|
-
|
|
19512
|
-
|
|
19483
|
+
return box;
|
|
19484
|
+
}
|
|
19485
|
+
}, {
|
|
19486
|
+
key: 'repositionHandles',
|
|
19487
|
+
value: function repositionHandles(handleStyle) {
|
|
19488
|
+
var handleXOffset = '0px';
|
|
19489
|
+
var handleYOffset = '0px';
|
|
19490
|
+
if (handleStyle) {
|
|
19491
|
+
if (handleStyle.width) {
|
|
19492
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19493
|
+
}
|
|
19494
|
+
if (handleStyle.height) {
|
|
19495
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19496
|
+
}
|
|
19497
|
+
}
|
|
19513
19498
|
|
|
19514
|
-
|
|
19515
|
-
|
|
19499
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19500
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19501
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19502
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19503
|
+
}
|
|
19504
|
+
}, {
|
|
19505
|
+
key: 'setCursor',
|
|
19506
|
+
value: function setCursor(value) {
|
|
19507
|
+
if (document.body) {
|
|
19508
|
+
document.body.style.cursor = value;
|
|
19509
|
+
}
|
|
19516
19510
|
|
|
19517
|
-
|
|
19511
|
+
if (this.formatter.currentSpec) {
|
|
19512
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19513
|
+
if (target) {
|
|
19514
|
+
target.style.cursor = value;
|
|
19515
|
+
}
|
|
19516
|
+
}
|
|
19517
|
+
}
|
|
19518
|
+
}]);
|
|
19519
|
+
|
|
19520
|
+
return ResizeAction;
|
|
19521
|
+
}(_Action3.default);
|
|
19522
|
+
|
|
19523
|
+
ResizeAction.default = ResizeAction$1;
|
|
19524
|
+
return ResizeAction;
|
|
19525
|
+
}
|
|
19518
19526
|
|
|
19519
19527
|
var DeleteAction = {};
|
|
19520
19528
|
|
|
@@ -19621,7 +19629,7 @@
|
|
|
19621
19629
|
|
|
19622
19630
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19623
19631
|
|
|
19624
|
-
var _ResizeAction =
|
|
19632
|
+
var _ResizeAction = requireResizeAction();
|
|
19625
19633
|
|
|
19626
19634
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19627
19635
|
|
|
@@ -20114,7 +20122,7 @@
|
|
|
20114
20122
|
}
|
|
20115
20123
|
});
|
|
20116
20124
|
|
|
20117
|
-
var _ResizeAction =
|
|
20125
|
+
var _ResizeAction = requireResizeAction();
|
|
20118
20126
|
|
|
20119
20127
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
20120
20128
|
enumerable: true,
|
|
@@ -20236,14 +20244,12 @@
|
|
|
20236
20244
|
}
|
|
20237
20245
|
};
|
|
20238
20246
|
const registerBlotFormatter = () => {
|
|
20239
|
-
var _a;
|
|
20240
20247
|
if (!enableImageResize) {
|
|
20241
20248
|
return;
|
|
20242
20249
|
}
|
|
20243
20250
|
try {
|
|
20244
|
-
|
|
20245
|
-
|
|
20246
|
-
}
|
|
20251
|
+
Quill.register('modules/blotFormatter', BlotFormatter);
|
|
20252
|
+
console.log('BlotFormatter模块已注册');
|
|
20247
20253
|
}
|
|
20248
20254
|
catch (error) {
|
|
20249
20255
|
console.warn('注册BlotFormatter模块时出错:', error);
|
|
@@ -20254,7 +20260,9 @@
|
|
|
20254
20260
|
return {};
|
|
20255
20261
|
}
|
|
20256
20262
|
return {
|
|
20257
|
-
|
|
20263
|
+
modules: {
|
|
20264
|
+
blotFormatter: true
|
|
20265
|
+
}
|
|
20258
20266
|
};
|
|
20259
20267
|
};
|
|
20260
20268
|
vue.onBeforeUnmount(() => {
|
|
@@ -20618,7 +20626,7 @@
|
|
|
20618
20626
|
if (props.enableImageResize) {
|
|
20619
20627
|
const blotFormatterConfig = getBlotFormatterConfig();
|
|
20620
20628
|
if (Object.keys(blotFormatterConfig).length > 0) {
|
|
20621
|
-
clientOptions.modules = Object.assign({}, clientOptions.modules, blotFormatterConfig);
|
|
20629
|
+
clientOptions.modules = Object.assign({}, clientOptions.modules, blotFormatterConfig.modules);
|
|
20622
20630
|
}
|
|
20623
20631
|
}
|
|
20624
20632
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|