pxx-vue-quill 1.0.29 → 1.0.31
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.cjs.js +24 -4
- package/dist/vue-quill.cjs.prod.js +2 -2
- package/dist/vue-quill.esm-browser.js +346 -302
- package/dist/vue-quill.esm-browser.prod.js +2 -2
- package/dist/vue-quill.esm-bundler.js +24 -4
- package/dist/vue-quill.esm-bundler.prod.js +2 -2
- package/dist/vue-quill.global.js +24 -4
- package/dist/vue-quill.global.prod.js +2 -2
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2025 Pxx-Team
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2025-08-
|
|
10
|
+
* Date: 2025-08-28T10:30:27.567Z
|
|
11
11
|
*/
|
|
12
12
|
import { defineComponent, h, onMounted, onBeforeUnmount, ref, computed, watchEffect, watch, nextTick } from 'vue';
|
|
13
13
|
|
|
@@ -18553,44 +18553,52 @@ var es = /*#__PURE__*/Object.freeze({
|
|
|
18553
18553
|
|
|
18554
18554
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
|
|
18555
18555
|
|
|
18556
|
-
var Action
|
|
18556
|
+
var Action = {};
|
|
18557
18557
|
|
|
18558
|
-
|
|
18559
|
-
value: true
|
|
18560
|
-
});
|
|
18558
|
+
var hasRequiredAction;
|
|
18561
18559
|
|
|
18562
|
-
|
|
18560
|
+
function requireAction () {
|
|
18561
|
+
if (hasRequiredAction) return Action;
|
|
18562
|
+
hasRequiredAction = 1;
|
|
18563
18563
|
|
|
18564
|
-
|
|
18564
|
+
Object.defineProperty(Action, "__esModule", {
|
|
18565
|
+
value: true
|
|
18566
|
+
});
|
|
18565
18567
|
|
|
18566
|
-
|
|
18568
|
+
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; }; }();
|
|
18567
18569
|
|
|
18568
|
-
|
|
18570
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
18569
18571
|
|
|
18570
|
-
|
|
18572
|
+
_interopRequireDefault(_BlotFormatter);
|
|
18571
18573
|
|
|
18572
|
-
|
|
18573
|
-
function Action(formatter) {
|
|
18574
|
-
_classCallCheck$3(this, Action);
|
|
18574
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18575
18575
|
|
|
18576
|
-
|
|
18577
|
-
}
|
|
18576
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18578
18577
|
|
|
18579
|
-
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
}, {
|
|
18583
|
-
key: 'onDestroy',
|
|
18584
|
-
value: function onDestroy() {}
|
|
18585
|
-
}, {
|
|
18586
|
-
key: 'onUpdate',
|
|
18587
|
-
value: function onUpdate() {}
|
|
18588
|
-
}]);
|
|
18578
|
+
var Action$1 = function () {
|
|
18579
|
+
function Action(formatter) {
|
|
18580
|
+
_classCallCheck(this, Action);
|
|
18589
18581
|
|
|
18590
|
-
|
|
18591
|
-
}
|
|
18582
|
+
this.formatter = formatter;
|
|
18583
|
+
}
|
|
18592
18584
|
|
|
18593
|
-
Action
|
|
18585
|
+
_createClass(Action, [{
|
|
18586
|
+
key: 'onCreate',
|
|
18587
|
+
value: function onCreate() {}
|
|
18588
|
+
}, {
|
|
18589
|
+
key: 'onDestroy',
|
|
18590
|
+
value: function onDestroy() {}
|
|
18591
|
+
}, {
|
|
18592
|
+
key: 'onUpdate',
|
|
18593
|
+
value: function onUpdate() {}
|
|
18594
|
+
}]);
|
|
18595
|
+
|
|
18596
|
+
return Action;
|
|
18597
|
+
}();
|
|
18598
|
+
|
|
18599
|
+
Action.default = Action$1;
|
|
18600
|
+
return Action;
|
|
18601
|
+
}
|
|
18594
18602
|
|
|
18595
18603
|
var hasRequiredBlotFormatter;
|
|
18596
18604
|
|
|
@@ -18612,7 +18620,7 @@ function requireBlotFormatter () {
|
|
|
18612
18620
|
|
|
18613
18621
|
var _Options2 = _interopRequireDefault(_Options);
|
|
18614
18622
|
|
|
18615
|
-
var _Action =
|
|
18623
|
+
var _Action = requireAction();
|
|
18616
18624
|
|
|
18617
18625
|
_interopRequireDefault(_Action);
|
|
18618
18626
|
|
|
@@ -18770,11 +18778,11 @@ Object.defineProperty(DefaultAligner$1, "__esModule", {
|
|
|
18770
18778
|
value: true
|
|
18771
18779
|
});
|
|
18772
18780
|
|
|
18773
|
-
var _createClass
|
|
18781
|
+
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; }; }();
|
|
18774
18782
|
|
|
18775
18783
|
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; }
|
|
18776
18784
|
|
|
18777
|
-
function _classCallCheck
|
|
18785
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18778
18786
|
|
|
18779
18787
|
var LEFT_ALIGN = 'left';
|
|
18780
18788
|
var CENTER_ALIGN = 'center';
|
|
@@ -18785,7 +18793,7 @@ var DefaultAligner = function () {
|
|
|
18785
18793
|
var _this = this,
|
|
18786
18794
|
_alignments;
|
|
18787
18795
|
|
|
18788
|
-
_classCallCheck
|
|
18796
|
+
_classCallCheck(this, DefaultAligner);
|
|
18789
18797
|
|
|
18790
18798
|
this.applyStyle = options.aligner.applyStyle;
|
|
18791
18799
|
this.alignAttribute = options.attribute;
|
|
@@ -18813,7 +18821,7 @@ var DefaultAligner = function () {
|
|
|
18813
18821
|
}), _alignments);
|
|
18814
18822
|
}
|
|
18815
18823
|
|
|
18816
|
-
_createClass
|
|
18824
|
+
_createClass(DefaultAligner, [{
|
|
18817
18825
|
key: 'getAlignments',
|
|
18818
18826
|
value: function getAlignments() {
|
|
18819
18827
|
var _this2 = this;
|
|
@@ -19051,7 +19059,7 @@ function requireAlignAction () {
|
|
|
19051
19059
|
|
|
19052
19060
|
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; }; }();
|
|
19053
19061
|
|
|
19054
|
-
var _Action2 =
|
|
19062
|
+
var _Action2 = requireAction();
|
|
19055
19063
|
|
|
19056
19064
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19057
19065
|
|
|
@@ -19116,182 +19124,190 @@ function requireAlignAction () {
|
|
|
19116
19124
|
return AlignAction;
|
|
19117
19125
|
}
|
|
19118
19126
|
|
|
19119
|
-
var ResizeAction
|
|
19127
|
+
var ResizeAction = {};
|
|
19120
19128
|
|
|
19121
|
-
|
|
19122
|
-
value: true
|
|
19123
|
-
});
|
|
19129
|
+
var hasRequiredResizeAction;
|
|
19124
19130
|
|
|
19125
|
-
|
|
19131
|
+
function requireResizeAction () {
|
|
19132
|
+
if (hasRequiredResizeAction) return ResizeAction;
|
|
19133
|
+
hasRequiredResizeAction = 1;
|
|
19126
19134
|
|
|
19127
|
-
|
|
19135
|
+
Object.defineProperty(ResizeAction, "__esModule", {
|
|
19136
|
+
value: true
|
|
19137
|
+
});
|
|
19128
19138
|
|
|
19129
|
-
var
|
|
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; }; }();
|
|
19130
19140
|
|
|
19131
|
-
var
|
|
19141
|
+
var _Action2 = requireAction();
|
|
19132
19142
|
|
|
19133
|
-
_interopRequireDefault
|
|
19143
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19134
19144
|
|
|
19135
|
-
|
|
19145
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19136
19146
|
|
|
19137
|
-
|
|
19147
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19138
19148
|
|
|
19139
|
-
function
|
|
19149
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19140
19150
|
|
|
19141
|
-
function
|
|
19151
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19142
19152
|
|
|
19143
|
-
|
|
19144
|
-
_inherits$1(ResizeAction, _Action);
|
|
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; }
|
|
19145
19154
|
|
|
19146
|
-
|
|
19147
|
-
_classCallCheck$1(this, ResizeAction);
|
|
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; }
|
|
19148
19156
|
|
|
19149
|
-
|
|
19157
|
+
var ResizeAction$1 = function (_Action) {
|
|
19158
|
+
_inherits(ResizeAction, _Action);
|
|
19150
19159
|
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
return;
|
|
19154
|
-
}
|
|
19155
|
-
_this.dragHandle = event.target;
|
|
19156
|
-
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19160
|
+
function ResizeAction(formatter) {
|
|
19161
|
+
_classCallCheck(this, ResizeAction);
|
|
19157
19162
|
|
|
19158
|
-
|
|
19159
|
-
return;
|
|
19160
|
-
}
|
|
19163
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19161
19164
|
|
|
19162
|
-
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
|
|
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);
|
|
19166
19171
|
|
|
19167
|
-
|
|
19172
|
+
if (!_this.formatter.currentSpec) {
|
|
19173
|
+
return;
|
|
19174
|
+
}
|
|
19168
19175
|
|
|
19169
|
-
|
|
19170
|
-
|
|
19171
|
-
|
|
19176
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19177
|
+
if (!target) {
|
|
19178
|
+
return;
|
|
19179
|
+
}
|
|
19172
19180
|
|
|
19173
|
-
|
|
19174
|
-
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19175
|
-
};
|
|
19181
|
+
var rect = target.getBoundingClientRect();
|
|
19176
19182
|
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
}
|
|
19183
|
+
_this.dragStartX = event.clientX;
|
|
19184
|
+
_this.preDragWidth = rect.width;
|
|
19185
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19181
19186
|
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
}
|
|
19187
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19188
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19189
|
+
};
|
|
19186
19190
|
|
|
19187
|
-
|
|
19188
|
-
|
|
19191
|
+
_this.onDrag = function (event) {
|
|
19192
|
+
if (!_this.formatter.currentSpec) {
|
|
19193
|
+
return;
|
|
19194
|
+
}
|
|
19189
19195
|
|
|
19190
|
-
|
|
19191
|
-
|
|
19192
|
-
|
|
19193
|
-
|
|
19194
|
-
}
|
|
19196
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19197
|
+
if (!target) {
|
|
19198
|
+
return;
|
|
19199
|
+
}
|
|
19195
19200
|
|
|
19196
|
-
|
|
19201
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19202
|
+
var newWidth = 0;
|
|
19197
19203
|
|
|
19198
|
-
|
|
19199
|
-
|
|
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
|
+
}
|
|
19200
19209
|
|
|
19201
|
-
|
|
19202
|
-
};
|
|
19210
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19203
19211
|
|
|
19204
|
-
|
|
19205
|
-
|
|
19206
|
-
document.removeEventListener('mousemove', _this.onDrag);
|
|
19207
|
-
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19208
|
-
};
|
|
19212
|
+
target.setAttribute('width', '' + newWidth);
|
|
19213
|
+
target.setAttribute('height', '' + newHeight);
|
|
19209
19214
|
|
|
19210
|
-
|
|
19211
|
-
|
|
19212
|
-
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19213
|
-
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19214
|
-
_this.dragHandle = null;
|
|
19215
|
-
_this.dragStartX = 0;
|
|
19216
|
-
_this.preDragWidth = 0;
|
|
19217
|
-
_this.targetRatio = 0;
|
|
19218
|
-
return _this;
|
|
19219
|
-
}
|
|
19215
|
+
_this.formatter.update();
|
|
19216
|
+
};
|
|
19220
19217
|
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19227
|
-
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19218
|
+
_this.onMouseUp = function () {
|
|
19219
|
+
_this.setCursor('');
|
|
19220
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19221
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19222
|
+
};
|
|
19228
19223
|
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
}
|
|
19240
|
-
}, {
|
|
19241
|
-
key: 'createHandle',
|
|
19242
|
-
value: function createHandle(position, cursor) {
|
|
19243
|
-
var box = document.createElement('div');
|
|
19244
|
-
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19245
|
-
box.setAttribute('data-position', position);
|
|
19246
|
-
box.style.cursor = cursor;
|
|
19247
|
-
|
|
19248
|
-
if (this.formatter.options.resize.handleStyle) {
|
|
19249
|
-
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19250
|
-
}
|
|
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
|
+
}
|
|
19251
19234
|
|
|
19252
|
-
|
|
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);
|
|
19253
19242
|
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
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
|
+
}
|
|
19269
19265
|
|
|
19270
|
-
|
|
19271
|
-
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19272
|
-
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19273
|
-
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19274
|
-
}
|
|
19275
|
-
}, {
|
|
19276
|
-
key: 'setCursor',
|
|
19277
|
-
value: function setCursor(value) {
|
|
19278
|
-
if (document.body) {
|
|
19279
|
-
document.body.style.cursor = value;
|
|
19280
|
-
}
|
|
19266
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19281
19267
|
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
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
|
+
}
|
|
19290
19283
|
|
|
19291
|
-
|
|
19292
|
-
|
|
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
|
+
}
|
|
19293
19295
|
|
|
19294
|
-
|
|
19296
|
+
if (this.formatter.currentSpec) {
|
|
19297
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19298
|
+
if (target) {
|
|
19299
|
+
target.style.cursor = value;
|
|
19300
|
+
}
|
|
19301
|
+
}
|
|
19302
|
+
}
|
|
19303
|
+
}]);
|
|
19304
|
+
|
|
19305
|
+
return ResizeAction;
|
|
19306
|
+
}(_Action3.default);
|
|
19307
|
+
|
|
19308
|
+
ResizeAction.default = ResizeAction$1;
|
|
19309
|
+
return ResizeAction;
|
|
19310
|
+
}
|
|
19295
19311
|
|
|
19296
19312
|
var DeleteAction = {};
|
|
19297
19313
|
|
|
@@ -19311,7 +19327,7 @@ function requireDeleteAction () {
|
|
|
19311
19327
|
|
|
19312
19328
|
var _quill2 = _interopRequireDefault(_quill);
|
|
19313
19329
|
|
|
19314
|
-
var _Action2 =
|
|
19330
|
+
var _Action2 = requireAction();
|
|
19315
19331
|
|
|
19316
19332
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19317
19333
|
|
|
@@ -19390,7 +19406,7 @@ function requireBlotSpec () {
|
|
|
19390
19406
|
|
|
19391
19407
|
_interopRequireDefault(_BlotFormatter);
|
|
19392
19408
|
|
|
19393
|
-
var _Action =
|
|
19409
|
+
var _Action = requireAction();
|
|
19394
19410
|
|
|
19395
19411
|
_interopRequireDefault(_Action);
|
|
19396
19412
|
|
|
@@ -19398,7 +19414,7 @@ function requireBlotSpec () {
|
|
|
19398
19414
|
|
|
19399
19415
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19400
19416
|
|
|
19401
|
-
var _ResizeAction =
|
|
19417
|
+
var _ResizeAction = requireResizeAction();
|
|
19402
19418
|
|
|
19403
19419
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19404
19420
|
|
|
@@ -19530,148 +19546,156 @@ function requireImageSpec () {
|
|
|
19530
19546
|
|
|
19531
19547
|
var IframeVideoSpec = {};
|
|
19532
19548
|
|
|
19533
|
-
var UnclickableBlotSpec
|
|
19549
|
+
var UnclickableBlotSpec = {};
|
|
19534
19550
|
|
|
19535
|
-
|
|
19536
|
-
value: true
|
|
19537
|
-
});
|
|
19551
|
+
var hasRequiredUnclickableBlotSpec;
|
|
19538
19552
|
|
|
19539
|
-
|
|
19553
|
+
function requireUnclickableBlotSpec () {
|
|
19554
|
+
if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
|
|
19555
|
+
hasRequiredUnclickableBlotSpec = 1;
|
|
19540
19556
|
|
|
19541
|
-
|
|
19557
|
+
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19558
|
+
value: true
|
|
19559
|
+
});
|
|
19542
19560
|
|
|
19543
|
-
var
|
|
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; }; }();
|
|
19544
19562
|
|
|
19545
|
-
var
|
|
19563
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19546
19564
|
|
|
19547
|
-
_interopRequireDefault(
|
|
19565
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19548
19566
|
|
|
19549
|
-
|
|
19567
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19550
19568
|
|
|
19551
|
-
|
|
19569
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19552
19570
|
|
|
19553
|
-
function
|
|
19571
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19554
19572
|
|
|
19555
|
-
function
|
|
19573
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19556
19574
|
|
|
19557
|
-
|
|
19558
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
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; }
|
|
19559
19576
|
|
|
19560
|
-
|
|
19561
|
-
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
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; }
|
|
19562
19578
|
|
|
19563
|
-
|
|
19564
|
-
|
|
19579
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19580
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19565
19581
|
|
|
19566
|
-
|
|
19582
|
+
var UnclickableBlotSpec$1 = function (_BlotSpec) {
|
|
19583
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19567
19584
|
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19571
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19572
|
-
});
|
|
19573
|
-
};
|
|
19585
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19586
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19574
19587
|
|
|
19575
|
-
|
|
19576
|
-
var unclickable = event.target;
|
|
19577
|
-
if (!(unclickable instanceof HTMLElement)) {
|
|
19578
|
-
return;
|
|
19579
|
-
}
|
|
19588
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19580
19589
|
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
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
|
+
};
|
|
19584
19596
|
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
};
|
|
19597
|
+
_this.onMouseEnter = function (event) {
|
|
19598
|
+
var unclickable = event.target;
|
|
19599
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19600
|
+
return;
|
|
19601
|
+
}
|
|
19591
19602
|
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
return _this;
|
|
19596
|
-
}
|
|
19603
|
+
_this.nextUnclickable = unclickable;
|
|
19604
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19605
|
+
};
|
|
19597
19606
|
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19605
|
-
*/
|
|
19606
|
-
document.body.appendChild(this.createProxyImage());
|
|
19607
|
-
}
|
|
19607
|
+
_this.onProxyImageClick = function () {
|
|
19608
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19609
|
+
_this.nextUnclickable = null;
|
|
19610
|
+
_this.formatter.show(_this);
|
|
19611
|
+
_this.hideProxyImage();
|
|
19612
|
+
};
|
|
19608
19613
|
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
key: 'getTargetElement',
|
|
19615
|
-
value: function getTargetElement() {
|
|
19616
|
-
return this.unclickable;
|
|
19617
|
-
}
|
|
19618
|
-
}, {
|
|
19619
|
-
key: 'getOverlayElement',
|
|
19620
|
-
value: function getOverlayElement() {
|
|
19621
|
-
return this.unclickable;
|
|
19622
|
-
}
|
|
19623
|
-
}, {
|
|
19624
|
-
key: 'onHide',
|
|
19625
|
-
value: function onHide() {
|
|
19626
|
-
this.hideProxyImage();
|
|
19627
|
-
this.nextUnclickable = null;
|
|
19628
|
-
this.unclickable = null;
|
|
19629
|
-
}
|
|
19630
|
-
}, {
|
|
19631
|
-
key: 'createProxyImage',
|
|
19632
|
-
value: function createProxyImage() {
|
|
19633
|
-
var canvas = document.createElement('canvas');
|
|
19634
|
-
var context = canvas.getContext('2d');
|
|
19635
|
-
context.globalAlpha = 0;
|
|
19636
|
-
context.fillRect(0, 0, 1, 1);
|
|
19637
|
-
|
|
19638
|
-
this.proxyImage = document.createElement('img');
|
|
19639
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19640
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19641
|
-
|
|
19642
|
-
Object.assign(this.proxyImage.style, {
|
|
19643
|
-
position: 'absolute',
|
|
19644
|
-
margin: '0'
|
|
19645
|
-
});
|
|
19614
|
+
_this.selector = selector;
|
|
19615
|
+
_this.unclickable = null;
|
|
19616
|
+
_this.nextUnclickable = null;
|
|
19617
|
+
return _this;
|
|
19618
|
+
}
|
|
19646
19619
|
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
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
|
+
}
|
|
19630
|
+
|
|
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
|
+
});
|
|
19670
19668
|
|
|
19671
|
-
|
|
19672
|
-
}
|
|
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();
|
|
19673
19682
|
|
|
19674
|
-
|
|
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
|
+
}]);
|
|
19692
|
+
|
|
19693
|
+
return UnclickableBlotSpec;
|
|
19694
|
+
}(_BlotSpec3.default);
|
|
19695
|
+
|
|
19696
|
+
UnclickableBlotSpec.default = UnclickableBlotSpec$1;
|
|
19697
|
+
return UnclickableBlotSpec;
|
|
19698
|
+
}
|
|
19675
19699
|
|
|
19676
19700
|
var hasRequiredIframeVideoSpec;
|
|
19677
19701
|
|
|
@@ -19683,7 +19707,7 @@ function requireIframeVideoSpec () {
|
|
|
19683
19707
|
value: true
|
|
19684
19708
|
});
|
|
19685
19709
|
|
|
19686
|
-
var _UnclickableBlotSpec2 =
|
|
19710
|
+
var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
|
|
19687
19711
|
|
|
19688
19712
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19689
19713
|
|
|
@@ -19838,7 +19862,7 @@ function requireOptions () {
|
|
|
19838
19862
|
}
|
|
19839
19863
|
});
|
|
19840
19864
|
|
|
19841
|
-
var _Action =
|
|
19865
|
+
var _Action = requireAction();
|
|
19842
19866
|
|
|
19843
19867
|
Object.defineProperty(exports, 'Action', {
|
|
19844
19868
|
enumerable: true,
|
|
@@ -19883,7 +19907,7 @@ function requireOptions () {
|
|
|
19883
19907
|
}
|
|
19884
19908
|
});
|
|
19885
19909
|
|
|
19886
|
-
var _ResizeAction =
|
|
19910
|
+
var _ResizeAction = requireResizeAction();
|
|
19887
19911
|
|
|
19888
19912
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
19889
19913
|
enumerable: true,
|
|
@@ -19910,7 +19934,7 @@ function requireOptions () {
|
|
|
19910
19934
|
}
|
|
19911
19935
|
});
|
|
19912
19936
|
|
|
19913
|
-
var _UnclickableBlotSpec =
|
|
19937
|
+
var _UnclickableBlotSpec = requireUnclickableBlotSpec();
|
|
19914
19938
|
|
|
19915
19939
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19916
19940
|
enumerable: true,
|
|
@@ -20428,6 +20452,13 @@ const QuillEditor = defineComponent({
|
|
|
20428
20452
|
};
|
|
20429
20453
|
const handleTextChange = (delta, oldContents, source) => {
|
|
20430
20454
|
internalModel = maybeClone(getContents());
|
|
20455
|
+
// 因为默认是<p><br></p>,影响element-ui的表单验证,所以默认设为空,有值才显示<p>内容</p>
|
|
20456
|
+
if (props.contentType === 'html') {
|
|
20457
|
+
const html = getHTML();
|
|
20458
|
+
if (html === '' || html === '<p><br></p>' || html === '<p></p>') {
|
|
20459
|
+
internalModel = '';
|
|
20460
|
+
}
|
|
20461
|
+
}
|
|
20431
20462
|
if (!internalModelEquals(props.content)) {
|
|
20432
20463
|
ctx.emit('update:content', internalModel);
|
|
20433
20464
|
}
|
|
@@ -20503,7 +20534,15 @@ const QuillEditor = defineComponent({
|
|
|
20503
20534
|
: ''
|
|
20504
20535
|
: content;
|
|
20505
20536
|
if (props.contentType === 'html') {
|
|
20506
|
-
|
|
20537
|
+
// 对于空内容,直接清空编辑器,不插入默认结构
|
|
20538
|
+
if (!normalizedContent || normalizedContent === '') {
|
|
20539
|
+
if (quill) {
|
|
20540
|
+
quill.root.innerHTML = '';
|
|
20541
|
+
}
|
|
20542
|
+
}
|
|
20543
|
+
else {
|
|
20544
|
+
setHTML(normalizedContent);
|
|
20545
|
+
}
|
|
20507
20546
|
}
|
|
20508
20547
|
else if (props.contentType === 'text') {
|
|
20509
20548
|
setText(normalizedContent, source);
|
|
@@ -20522,7 +20561,12 @@ const QuillEditor = defineComponent({
|
|
|
20522
20561
|
};
|
|
20523
20562
|
const getHTML = () => {
|
|
20524
20563
|
var _a;
|
|
20525
|
-
|
|
20564
|
+
const html = (_a = quill === null || quill === void 0 ? void 0 : quill.root.innerHTML) !== null && _a !== void 0 ? _a : '';
|
|
20565
|
+
// 如果内容是默认的空段落结构,返回空字符串
|
|
20566
|
+
if (html === '<p><br></p>' || html === '<p></p>') {
|
|
20567
|
+
return '';
|
|
20568
|
+
}
|
|
20569
|
+
return html;
|
|
20526
20570
|
};
|
|
20527
20571
|
const setHTML = (html) => {
|
|
20528
20572
|
if (quill)
|
|
@@ -20566,7 +20610,7 @@ const QuillEditor = defineComponent({
|
|
|
20566
20610
|
}
|
|
20567
20611
|
};
|
|
20568
20612
|
watch(() => props.content, (newContent) => {
|
|
20569
|
-
if (!quill ||
|
|
20613
|
+
if (!quill || internalModelEquals(newContent))
|
|
20570
20614
|
return;
|
|
20571
20615
|
const selection = quill.getSelection();
|
|
20572
20616
|
if (selection) {
|