pxx-vue-quill 1.0.129 → 1.0.131
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 +276 -294
- 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-10T08:
|
|
10
|
+
* Date: 2025-09-10T08:19:24.291Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18775,24 +18775,24 @@
|
|
|
18775
18775
|
value: true
|
|
18776
18776
|
});
|
|
18777
18777
|
|
|
18778
|
-
var _createClass$
|
|
18778
|
+
var _createClass$3 = 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; }; }();
|
|
18779
18779
|
|
|
18780
|
-
var _BlotFormatter = requireBlotFormatter();
|
|
18780
|
+
var _BlotFormatter$2 = requireBlotFormatter();
|
|
18781
18781
|
|
|
18782
|
-
_interopRequireDefault(_BlotFormatter);
|
|
18782
|
+
_interopRequireDefault$2(_BlotFormatter$2);
|
|
18783
18783
|
|
|
18784
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18784
|
+
function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18785
18785
|
|
|
18786
|
-
function _classCallCheck$
|
|
18786
|
+
function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18787
18787
|
|
|
18788
18788
|
var Action = function () {
|
|
18789
18789
|
function Action(formatter) {
|
|
18790
|
-
_classCallCheck$
|
|
18790
|
+
_classCallCheck$3(this, Action);
|
|
18791
18791
|
|
|
18792
18792
|
this.formatter = formatter;
|
|
18793
18793
|
}
|
|
18794
18794
|
|
|
18795
|
-
_createClass$
|
|
18795
|
+
_createClass$3(Action, [{
|
|
18796
18796
|
key: 'onCreate',
|
|
18797
18797
|
value: function onCreate() {}
|
|
18798
18798
|
}, {
|
|
@@ -18986,11 +18986,11 @@
|
|
|
18986
18986
|
value: true
|
|
18987
18987
|
});
|
|
18988
18988
|
|
|
18989
|
-
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; }; }();
|
|
18989
|
+
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; }; }();
|
|
18990
18990
|
|
|
18991
18991
|
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; }
|
|
18992
18992
|
|
|
18993
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18993
|
+
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18994
18994
|
|
|
18995
18995
|
var LEFT_ALIGN = 'left';
|
|
18996
18996
|
var CENTER_ALIGN = 'center';
|
|
@@ -19001,7 +19001,7 @@
|
|
|
19001
19001
|
var _this = this,
|
|
19002
19002
|
_alignments;
|
|
19003
19003
|
|
|
19004
|
-
_classCallCheck(this, DefaultAligner);
|
|
19004
|
+
_classCallCheck$2(this, DefaultAligner);
|
|
19005
19005
|
|
|
19006
19006
|
this.applyStyle = options.aligner.applyStyle;
|
|
19007
19007
|
this.alignAttribute = options.attribute;
|
|
@@ -19029,7 +19029,7 @@
|
|
|
19029
19029
|
}), _alignments);
|
|
19030
19030
|
}
|
|
19031
19031
|
|
|
19032
|
-
_createClass(DefaultAligner, [{
|
|
19032
|
+
_createClass$2(DefaultAligner, [{
|
|
19033
19033
|
key: 'getAlignments',
|
|
19034
19034
|
value: function getAlignments() {
|
|
19035
19035
|
var _this2 = this;
|
|
@@ -19332,190 +19332,182 @@
|
|
|
19332
19332
|
return AlignAction;
|
|
19333
19333
|
}
|
|
19334
19334
|
|
|
19335
|
-
var ResizeAction = {};
|
|
19336
|
-
|
|
19337
|
-
var hasRequiredResizeAction;
|
|
19338
|
-
|
|
19339
|
-
function requireResizeAction () {
|
|
19340
|
-
if (hasRequiredResizeAction) return ResizeAction;
|
|
19341
|
-
hasRequiredResizeAction = 1;
|
|
19335
|
+
var ResizeAction$1 = {};
|
|
19342
19336
|
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
|
|
19337
|
+
Object.defineProperty(ResizeAction$1, "__esModule", {
|
|
19338
|
+
value: true
|
|
19339
|
+
});
|
|
19346
19340
|
|
|
19347
|
-
|
|
19341
|
+
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; }; }();
|
|
19348
19342
|
|
|
19349
|
-
|
|
19343
|
+
var _Action2 = Action$1;
|
|
19350
19344
|
|
|
19351
|
-
|
|
19345
|
+
var _Action3 = _interopRequireDefault$1(_Action2);
|
|
19352
19346
|
|
|
19353
|
-
|
|
19347
|
+
var _BlotFormatter$1 = requireBlotFormatter();
|
|
19354
19348
|
|
|
19355
|
-
|
|
19349
|
+
_interopRequireDefault$1(_BlotFormatter$1);
|
|
19356
19350
|
|
|
19357
|
-
|
|
19351
|
+
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19358
19352
|
|
|
19359
|
-
|
|
19353
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19360
19354
|
|
|
19361
|
-
|
|
19355
|
+
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; }
|
|
19362
19356
|
|
|
19363
|
-
|
|
19357
|
+
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; }
|
|
19364
19358
|
|
|
19365
|
-
|
|
19366
|
-
|
|
19359
|
+
var ResizeAction = function (_Action) {
|
|
19360
|
+
_inherits$1(ResizeAction, _Action);
|
|
19367
19361
|
|
|
19368
|
-
|
|
19369
|
-
|
|
19362
|
+
function ResizeAction(formatter) {
|
|
19363
|
+
_classCallCheck$1(this, ResizeAction);
|
|
19370
19364
|
|
|
19371
|
-
|
|
19365
|
+
var _this = _possibleConstructorReturn$1(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19372
19366
|
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19377
|
-
|
|
19378
|
-
|
|
19367
|
+
_this.onMouseDown = function (event) {
|
|
19368
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19369
|
+
return;
|
|
19370
|
+
}
|
|
19371
|
+
_this.dragHandle = event.target;
|
|
19372
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19379
19373
|
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19374
|
+
if (!_this.formatter.currentSpec) {
|
|
19375
|
+
return;
|
|
19376
|
+
}
|
|
19383
19377
|
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19378
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19379
|
+
if (!target) {
|
|
19380
|
+
return;
|
|
19381
|
+
}
|
|
19388
19382
|
|
|
19389
|
-
|
|
19383
|
+
var rect = target.getBoundingClientRect();
|
|
19390
19384
|
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19385
|
+
_this.dragStartX = event.clientX;
|
|
19386
|
+
_this.preDragWidth = rect.width;
|
|
19387
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19394
19388
|
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
|
|
19389
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19390
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19391
|
+
};
|
|
19398
19392
|
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19393
|
+
_this.onDrag = function (event) {
|
|
19394
|
+
if (!_this.formatter.currentSpec) {
|
|
19395
|
+
return;
|
|
19396
|
+
}
|
|
19403
19397
|
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19398
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19399
|
+
if (!target) {
|
|
19400
|
+
return;
|
|
19401
|
+
}
|
|
19408
19402
|
|
|
19409
|
-
|
|
19410
|
-
|
|
19403
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19404
|
+
var newWidth = 0;
|
|
19411
19405
|
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19406
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19407
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19408
|
+
} else {
|
|
19409
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19410
|
+
}
|
|
19417
19411
|
|
|
19418
|
-
|
|
19412
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19419
19413
|
|
|
19420
|
-
|
|
19421
|
-
|
|
19414
|
+
target.setAttribute('width', '' + newWidth);
|
|
19415
|
+
target.setAttribute('height', '' + newHeight);
|
|
19422
19416
|
|
|
19423
|
-
|
|
19424
|
-
|
|
19417
|
+
_this.formatter.update();
|
|
19418
|
+
};
|
|
19425
19419
|
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19420
|
+
_this.onMouseUp = function () {
|
|
19421
|
+
_this.setCursor('');
|
|
19422
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19423
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19424
|
+
};
|
|
19431
19425
|
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19426
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19427
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19428
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19429
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19430
|
+
_this.dragHandle = null;
|
|
19431
|
+
_this.dragStartX = 0;
|
|
19432
|
+
_this.preDragWidth = 0;
|
|
19433
|
+
_this.targetRatio = 0;
|
|
19434
|
+
return _this;
|
|
19435
|
+
}
|
|
19442
19436
|
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19437
|
+
_createClass$1(ResizeAction, [{
|
|
19438
|
+
key: 'onCreate',
|
|
19439
|
+
value: function onCreate() {
|
|
19440
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19441
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19442
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19443
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19450
19444
|
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19445
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19446
|
+
}
|
|
19447
|
+
}, {
|
|
19448
|
+
key: 'onDestroy',
|
|
19449
|
+
value: function onDestroy() {
|
|
19450
|
+
this.setCursor('');
|
|
19451
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19452
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19453
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19454
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19455
|
+
}
|
|
19456
|
+
}, {
|
|
19457
|
+
key: 'createHandle',
|
|
19458
|
+
value: function createHandle(position, cursor) {
|
|
19459
|
+
var box = document.createElement('div');
|
|
19460
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19461
|
+
box.setAttribute('data-position', position);
|
|
19462
|
+
box.style.cursor = cursor;
|
|
19463
|
+
|
|
19464
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19465
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19466
|
+
}
|
|
19473
19467
|
|
|
19474
|
-
|
|
19468
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19475
19469
|
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
|
|
19480
|
-
|
|
19481
|
-
|
|
19482
|
-
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19470
|
+
return box;
|
|
19471
|
+
}
|
|
19472
|
+
}, {
|
|
19473
|
+
key: 'repositionHandles',
|
|
19474
|
+
value: function repositionHandles(handleStyle) {
|
|
19475
|
+
var handleXOffset = '0px';
|
|
19476
|
+
var handleYOffset = '0px';
|
|
19477
|
+
if (handleStyle) {
|
|
19478
|
+
if (handleStyle.width) {
|
|
19479
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19480
|
+
}
|
|
19481
|
+
if (handleStyle.height) {
|
|
19482
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19483
|
+
}
|
|
19484
|
+
}
|
|
19491
19485
|
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19486
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19487
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19488
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19489
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19490
|
+
}
|
|
19491
|
+
}, {
|
|
19492
|
+
key: 'setCursor',
|
|
19493
|
+
value: function setCursor(value) {
|
|
19494
|
+
if (document.body) {
|
|
19495
|
+
document.body.style.cursor = value;
|
|
19496
|
+
}
|
|
19503
19497
|
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
|
|
19511
|
-
|
|
19498
|
+
if (this.formatter.currentSpec) {
|
|
19499
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19500
|
+
if (target) {
|
|
19501
|
+
target.style.cursor = value;
|
|
19502
|
+
}
|
|
19503
|
+
}
|
|
19504
|
+
}
|
|
19505
|
+
}]);
|
|
19512
19506
|
|
|
19513
|
-
|
|
19514
|
-
|
|
19507
|
+
return ResizeAction;
|
|
19508
|
+
}(_Action3.default);
|
|
19515
19509
|
|
|
19516
|
-
|
|
19517
|
-
return ResizeAction;
|
|
19518
|
-
}
|
|
19510
|
+
ResizeAction$1.default = ResizeAction;
|
|
19519
19511
|
|
|
19520
19512
|
var DeleteAction = {};
|
|
19521
19513
|
|
|
@@ -19622,7 +19614,7 @@
|
|
|
19622
19614
|
|
|
19623
19615
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19624
19616
|
|
|
19625
|
-
var _ResizeAction =
|
|
19617
|
+
var _ResizeAction = ResizeAction$1;
|
|
19626
19618
|
|
|
19627
19619
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19628
19620
|
|
|
@@ -19754,156 +19746,148 @@
|
|
|
19754
19746
|
|
|
19755
19747
|
var IframeVideoSpec = {};
|
|
19756
19748
|
|
|
19757
|
-
var UnclickableBlotSpec = {};
|
|
19749
|
+
var UnclickableBlotSpec$1 = {};
|
|
19758
19750
|
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
|
|
19763
|
-
hasRequiredUnclickableBlotSpec = 1;
|
|
19764
|
-
|
|
19765
|
-
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19766
|
-
value: true
|
|
19767
|
-
});
|
|
19768
|
-
|
|
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; }; }();
|
|
19751
|
+
Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
|
|
19752
|
+
value: true
|
|
19753
|
+
});
|
|
19770
19754
|
|
|
19771
|
-
|
|
19755
|
+
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; }; }();
|
|
19772
19756
|
|
|
19773
|
-
|
|
19757
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19774
19758
|
|
|
19775
|
-
|
|
19759
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19776
19760
|
|
|
19777
|
-
|
|
19761
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19778
19762
|
|
|
19779
|
-
|
|
19763
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19780
19764
|
|
|
19781
|
-
|
|
19765
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19782
19766
|
|
|
19783
|
-
|
|
19767
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19784
19768
|
|
|
19785
|
-
|
|
19769
|
+
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; }
|
|
19786
19770
|
|
|
19787
|
-
|
|
19788
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19771
|
+
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; }
|
|
19789
19772
|
|
|
19790
|
-
|
|
19791
|
-
|
|
19773
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19774
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19792
19775
|
|
|
19793
|
-
|
|
19794
|
-
|
|
19776
|
+
var UnclickableBlotSpec = function (_BlotSpec) {
|
|
19777
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19795
19778
|
|
|
19796
|
-
|
|
19779
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19780
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19797
19781
|
|
|
19798
|
-
|
|
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
|
-
};
|
|
19782
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19804
19783
|
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
|
|
19784
|
+
_this.onTextChange = function () {
|
|
19785
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19786
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19787
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19788
|
+
});
|
|
19789
|
+
};
|
|
19810
19790
|
|
|
19811
|
-
|
|
19812
|
-
|
|
19813
|
-
|
|
19791
|
+
_this.onMouseEnter = function (event) {
|
|
19792
|
+
var unclickable = event.target;
|
|
19793
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19794
|
+
return;
|
|
19795
|
+
}
|
|
19814
19796
|
|
|
19815
|
-
|
|
19816
|
-
|
|
19817
|
-
|
|
19818
|
-
_this.formatter.show(_this);
|
|
19819
|
-
_this.hideProxyImage();
|
|
19820
|
-
};
|
|
19797
|
+
_this.nextUnclickable = unclickable;
|
|
19798
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19799
|
+
};
|
|
19821
19800
|
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19801
|
+
_this.onProxyImageClick = function () {
|
|
19802
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19803
|
+
_this.nextUnclickable = null;
|
|
19804
|
+
_this.formatter.show(_this);
|
|
19805
|
+
_this.hideProxyImage();
|
|
19806
|
+
};
|
|
19827
19807
|
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
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
|
-
}
|
|
19808
|
+
_this.selector = selector;
|
|
19809
|
+
_this.unclickable = null;
|
|
19810
|
+
_this.nextUnclickable = null;
|
|
19811
|
+
return _this;
|
|
19812
|
+
}
|
|
19838
19813
|
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
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
|
-
});
|
|
19814
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19815
|
+
key: 'init',
|
|
19816
|
+
value: function init() {
|
|
19817
|
+
if (document.body) {
|
|
19818
|
+
/*
|
|
19819
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19820
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19821
|
+
*/
|
|
19822
|
+
document.body.appendChild(this.createProxyImage());
|
|
19823
|
+
}
|
|
19876
19824
|
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19889
|
-
|
|
19825
|
+
this.hideProxyImage();
|
|
19826
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19827
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19828
|
+
}
|
|
19829
|
+
}, {
|
|
19830
|
+
key: 'getTargetElement',
|
|
19831
|
+
value: function getTargetElement() {
|
|
19832
|
+
return this.unclickable;
|
|
19833
|
+
}
|
|
19834
|
+
}, {
|
|
19835
|
+
key: 'getOverlayElement',
|
|
19836
|
+
value: function getOverlayElement() {
|
|
19837
|
+
return this.unclickable;
|
|
19838
|
+
}
|
|
19839
|
+
}, {
|
|
19840
|
+
key: 'onHide',
|
|
19841
|
+
value: function onHide() {
|
|
19842
|
+
this.hideProxyImage();
|
|
19843
|
+
this.nextUnclickable = null;
|
|
19844
|
+
this.unclickable = null;
|
|
19845
|
+
}
|
|
19846
|
+
}, {
|
|
19847
|
+
key: 'createProxyImage',
|
|
19848
|
+
value: function createProxyImage() {
|
|
19849
|
+
var canvas = document.createElement('canvas');
|
|
19850
|
+
var context = canvas.getContext('2d');
|
|
19851
|
+
context.globalAlpha = 0;
|
|
19852
|
+
context.fillRect(0, 0, 1, 1);
|
|
19853
|
+
|
|
19854
|
+
this.proxyImage = document.createElement('img');
|
|
19855
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19856
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19857
|
+
|
|
19858
|
+
Object.assign(this.proxyImage.style, {
|
|
19859
|
+
position: 'absolute',
|
|
19860
|
+
margin: '0'
|
|
19861
|
+
});
|
|
19890
19862
|
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19863
|
+
return this.proxyImage;
|
|
19864
|
+
}
|
|
19865
|
+
}, {
|
|
19866
|
+
key: 'hideProxyImage',
|
|
19867
|
+
value: function hideProxyImage() {
|
|
19868
|
+
Object.assign(this.proxyImage.style, {
|
|
19869
|
+
display: 'none'
|
|
19870
|
+
});
|
|
19871
|
+
}
|
|
19872
|
+
}, {
|
|
19873
|
+
key: 'repositionProxyImage',
|
|
19874
|
+
value: function repositionProxyImage(unclickable) {
|
|
19875
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19876
|
+
|
|
19877
|
+
Object.assign(this.proxyImage.style, {
|
|
19878
|
+
display: 'block',
|
|
19879
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19880
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19881
|
+
width: rect.width + 'px',
|
|
19882
|
+
height: rect.height + 'px'
|
|
19883
|
+
});
|
|
19884
|
+
}
|
|
19885
|
+
}]);
|
|
19900
19886
|
|
|
19901
|
-
|
|
19902
|
-
|
|
19887
|
+
return UnclickableBlotSpec;
|
|
19888
|
+
}(_BlotSpec3.default);
|
|
19903
19889
|
|
|
19904
|
-
|
|
19905
|
-
return UnclickableBlotSpec;
|
|
19906
|
-
}
|
|
19890
|
+
UnclickableBlotSpec$1.default = UnclickableBlotSpec;
|
|
19907
19891
|
|
|
19908
19892
|
var hasRequiredIframeVideoSpec;
|
|
19909
19893
|
|
|
@@ -19915,7 +19899,7 @@
|
|
|
19915
19899
|
value: true
|
|
19916
19900
|
});
|
|
19917
19901
|
|
|
19918
|
-
var _UnclickableBlotSpec2 =
|
|
19902
|
+
var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
|
|
19919
19903
|
|
|
19920
19904
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19921
19905
|
|
|
@@ -20115,7 +20099,7 @@
|
|
|
20115
20099
|
}
|
|
20116
20100
|
});
|
|
20117
20101
|
|
|
20118
|
-
var _ResizeAction =
|
|
20102
|
+
var _ResizeAction = ResizeAction$1;
|
|
20119
20103
|
|
|
20120
20104
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
20121
20105
|
enumerable: true,
|
|
@@ -20142,7 +20126,7 @@
|
|
|
20142
20126
|
}
|
|
20143
20127
|
});
|
|
20144
20128
|
|
|
20145
|
-
var _UnclickableBlotSpec =
|
|
20129
|
+
var _UnclickableBlotSpec = UnclickableBlotSpec$1;
|
|
20146
20130
|
|
|
20147
20131
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
20148
20132
|
enumerable: true,
|
|
@@ -20343,12 +20327,10 @@
|
|
|
20343
20327
|
clickHandlers.value = [];
|
|
20344
20328
|
};
|
|
20345
20329
|
vue.onMounted(() => {
|
|
20346
|
-
|
|
20347
|
-
(_a = document.getElementById("#questionDrawer")) === null || _a === void 0 ? void 0 : _a.addEventListener('click', handleGlobalClick, true);
|
|
20330
|
+
window.addEventListener('click', handleGlobalClick);
|
|
20348
20331
|
});
|
|
20349
20332
|
vue.onBeforeUnmount(() => {
|
|
20350
|
-
|
|
20351
|
-
(_a = document.getElementById("#questionDrawer")) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', handleGlobalClick, true);
|
|
20333
|
+
window.removeEventListener('click', handleGlobalClick);
|
|
20352
20334
|
clearClickHandlers();
|
|
20353
20335
|
});
|
|
20354
20336
|
return {
|