pxx-vue-quill 1.0.28 → 1.0.29
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 +17 -10
- package/dist/vue-quill.cjs.prod.js +2 -2
- package/dist/vue-quill.esm-browser.js +316 -333
- package/dist/vue-quill.esm-browser.prod.js +2 -2
- package/dist/vue-quill.esm-bundler.js +18 -11
- package/dist/vue-quill.esm-bundler.prod.js +2 -2
- package/dist/vue-quill.global.js +299 -276
- package/dist/vue-quill.global.prod.js +2 -2
- package/package.json +1 -1
package/dist/vue-quill.global.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-08-27T08:
|
|
10
|
+
* Date: 2025-08-27T08:53:43.171Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18782,11 +18782,11 @@
|
|
|
18782
18782
|
value: true
|
|
18783
18783
|
});
|
|
18784
18784
|
|
|
18785
|
-
var _createClass
|
|
18785
|
+
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; }; }();
|
|
18786
18786
|
|
|
18787
18787
|
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; }
|
|
18788
18788
|
|
|
18789
|
-
function _classCallCheck
|
|
18789
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18790
18790
|
|
|
18791
18791
|
var LEFT_ALIGN = 'left';
|
|
18792
18792
|
var CENTER_ALIGN = 'center';
|
|
@@ -18797,7 +18797,7 @@
|
|
|
18797
18797
|
var _this = this,
|
|
18798
18798
|
_alignments;
|
|
18799
18799
|
|
|
18800
|
-
_classCallCheck
|
|
18800
|
+
_classCallCheck(this, DefaultAligner);
|
|
18801
18801
|
|
|
18802
18802
|
this.applyStyle = options.aligner.applyStyle;
|
|
18803
18803
|
this.alignAttribute = options.attribute;
|
|
@@ -18825,7 +18825,7 @@
|
|
|
18825
18825
|
}), _alignments);
|
|
18826
18826
|
}
|
|
18827
18827
|
|
|
18828
|
-
_createClass
|
|
18828
|
+
_createClass(DefaultAligner, [{
|
|
18829
18829
|
key: 'getAlignments',
|
|
18830
18830
|
value: function getAlignments() {
|
|
18831
18831
|
var _this2 = this;
|
|
@@ -19128,182 +19128,190 @@
|
|
|
19128
19128
|
return AlignAction;
|
|
19129
19129
|
}
|
|
19130
19130
|
|
|
19131
|
-
var ResizeAction
|
|
19131
|
+
var ResizeAction = {};
|
|
19132
19132
|
|
|
19133
|
-
|
|
19134
|
-
value: true
|
|
19135
|
-
});
|
|
19133
|
+
var hasRequiredResizeAction;
|
|
19136
19134
|
|
|
19137
|
-
|
|
19135
|
+
function requireResizeAction () {
|
|
19136
|
+
if (hasRequiredResizeAction) return ResizeAction;
|
|
19137
|
+
hasRequiredResizeAction = 1;
|
|
19138
19138
|
|
|
19139
|
-
|
|
19139
|
+
Object.defineProperty(ResizeAction, "__esModule", {
|
|
19140
|
+
value: true
|
|
19141
|
+
});
|
|
19140
19142
|
|
|
19141
|
-
|
|
19143
|
+
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; }; }();
|
|
19142
19144
|
|
|
19143
|
-
|
|
19145
|
+
var _Action2 = requireAction();
|
|
19144
19146
|
|
|
19145
|
-
|
|
19147
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19146
19148
|
|
|
19147
|
-
|
|
19149
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19148
19150
|
|
|
19149
|
-
|
|
19151
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19150
19152
|
|
|
19151
|
-
|
|
19153
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19152
19154
|
|
|
19153
|
-
|
|
19155
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19154
19156
|
|
|
19155
|
-
|
|
19156
|
-
_inherits$1(ResizeAction, _Action);
|
|
19157
|
+
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; }
|
|
19157
19158
|
|
|
19158
|
-
|
|
19159
|
-
_classCallCheck$1(this, ResizeAction);
|
|
19159
|
+
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; }
|
|
19160
19160
|
|
|
19161
|
-
|
|
19161
|
+
var ResizeAction$1 = function (_Action) {
|
|
19162
|
+
_inherits(ResizeAction, _Action);
|
|
19162
19163
|
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
return;
|
|
19166
|
-
}
|
|
19167
|
-
_this.dragHandle = event.target;
|
|
19168
|
-
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19164
|
+
function ResizeAction(formatter) {
|
|
19165
|
+
_classCallCheck(this, ResizeAction);
|
|
19169
19166
|
|
|
19170
|
-
|
|
19171
|
-
return;
|
|
19172
|
-
}
|
|
19167
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19173
19168
|
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19169
|
+
_this.onMouseDown = function (event) {
|
|
19170
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19171
|
+
return;
|
|
19172
|
+
}
|
|
19173
|
+
_this.dragHandle = event.target;
|
|
19174
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19178
19175
|
|
|
19179
|
-
|
|
19176
|
+
if (!_this.formatter.currentSpec) {
|
|
19177
|
+
return;
|
|
19178
|
+
}
|
|
19180
19179
|
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19180
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19181
|
+
if (!target) {
|
|
19182
|
+
return;
|
|
19183
|
+
}
|
|
19184
19184
|
|
|
19185
|
-
|
|
19186
|
-
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19187
|
-
};
|
|
19185
|
+
var rect = target.getBoundingClientRect();
|
|
19188
19186
|
|
|
19189
|
-
|
|
19190
|
-
|
|
19191
|
-
|
|
19192
|
-
}
|
|
19187
|
+
_this.dragStartX = event.clientX;
|
|
19188
|
+
_this.preDragWidth = rect.width;
|
|
19189
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19193
19190
|
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
}
|
|
19191
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19192
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19193
|
+
};
|
|
19198
19194
|
|
|
19199
|
-
|
|
19200
|
-
|
|
19195
|
+
_this.onDrag = function (event) {
|
|
19196
|
+
if (!_this.formatter.currentSpec) {
|
|
19197
|
+
return;
|
|
19198
|
+
}
|
|
19201
19199
|
|
|
19202
|
-
|
|
19203
|
-
|
|
19204
|
-
|
|
19205
|
-
|
|
19206
|
-
}
|
|
19200
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19201
|
+
if (!target) {
|
|
19202
|
+
return;
|
|
19203
|
+
}
|
|
19207
19204
|
|
|
19208
|
-
|
|
19205
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19206
|
+
var newWidth = 0;
|
|
19209
19207
|
|
|
19210
|
-
|
|
19211
|
-
|
|
19208
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19209
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19210
|
+
} else {
|
|
19211
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19212
|
+
}
|
|
19212
19213
|
|
|
19213
|
-
|
|
19214
|
-
};
|
|
19214
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19215
19215
|
|
|
19216
|
-
|
|
19217
|
-
|
|
19218
|
-
document.removeEventListener('mousemove', _this.onDrag);
|
|
19219
|
-
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19220
|
-
};
|
|
19216
|
+
target.setAttribute('width', '' + newWidth);
|
|
19217
|
+
target.setAttribute('height', '' + newHeight);
|
|
19221
19218
|
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19225
|
-
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19226
|
-
_this.dragHandle = null;
|
|
19227
|
-
_this.dragStartX = 0;
|
|
19228
|
-
_this.preDragWidth = 0;
|
|
19229
|
-
_this.targetRatio = 0;
|
|
19230
|
-
return _this;
|
|
19231
|
-
}
|
|
19219
|
+
_this.formatter.update();
|
|
19220
|
+
};
|
|
19232
19221
|
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19239
|
-
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19222
|
+
_this.onMouseUp = function () {
|
|
19223
|
+
_this.setCursor('');
|
|
19224
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19225
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19226
|
+
};
|
|
19240
19227
|
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
}
|
|
19252
|
-
}, {
|
|
19253
|
-
key: 'createHandle',
|
|
19254
|
-
value: function createHandle(position, cursor) {
|
|
19255
|
-
var box = document.createElement('div');
|
|
19256
|
-
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19257
|
-
box.setAttribute('data-position', position);
|
|
19258
|
-
box.style.cursor = cursor;
|
|
19259
|
-
|
|
19260
|
-
if (this.formatter.options.resize.handleStyle) {
|
|
19261
|
-
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19262
|
-
}
|
|
19228
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19229
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19230
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19231
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19232
|
+
_this.dragHandle = null;
|
|
19233
|
+
_this.dragStartX = 0;
|
|
19234
|
+
_this.preDragWidth = 0;
|
|
19235
|
+
_this.targetRatio = 0;
|
|
19236
|
+
return _this;
|
|
19237
|
+
}
|
|
19263
19238
|
|
|
19264
|
-
|
|
19239
|
+
_createClass(ResizeAction, [{
|
|
19240
|
+
key: 'onCreate',
|
|
19241
|
+
value: function onCreate() {
|
|
19242
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19243
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19244
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19245
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19265
19246
|
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19271
|
-
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19247
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19248
|
+
}
|
|
19249
|
+
}, {
|
|
19250
|
+
key: 'onDestroy',
|
|
19251
|
+
value: function onDestroy() {
|
|
19252
|
+
this.setCursor('');
|
|
19253
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19254
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19255
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19256
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19257
|
+
}
|
|
19258
|
+
}, {
|
|
19259
|
+
key: 'createHandle',
|
|
19260
|
+
value: function createHandle(position, cursor) {
|
|
19261
|
+
var box = document.createElement('div');
|
|
19262
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19263
|
+
box.setAttribute('data-position', position);
|
|
19264
|
+
box.style.cursor = cursor;
|
|
19265
|
+
|
|
19266
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19267
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19268
|
+
}
|
|
19281
19269
|
|
|
19282
|
-
|
|
19283
|
-
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19284
|
-
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19285
|
-
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19286
|
-
}
|
|
19287
|
-
}, {
|
|
19288
|
-
key: 'setCursor',
|
|
19289
|
-
value: function setCursor(value) {
|
|
19290
|
-
if (document.body) {
|
|
19291
|
-
document.body.style.cursor = value;
|
|
19292
|
-
}
|
|
19270
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19293
19271
|
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19272
|
+
return box;
|
|
19273
|
+
}
|
|
19274
|
+
}, {
|
|
19275
|
+
key: 'repositionHandles',
|
|
19276
|
+
value: function repositionHandles(handleStyle) {
|
|
19277
|
+
var handleXOffset = '0px';
|
|
19278
|
+
var handleYOffset = '0px';
|
|
19279
|
+
if (handleStyle) {
|
|
19280
|
+
if (handleStyle.width) {
|
|
19281
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19282
|
+
}
|
|
19283
|
+
if (handleStyle.height) {
|
|
19284
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19285
|
+
}
|
|
19286
|
+
}
|
|
19302
19287
|
|
|
19303
|
-
|
|
19304
|
-
|
|
19288
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19289
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19290
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19291
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19292
|
+
}
|
|
19293
|
+
}, {
|
|
19294
|
+
key: 'setCursor',
|
|
19295
|
+
value: function setCursor(value) {
|
|
19296
|
+
if (document.body) {
|
|
19297
|
+
document.body.style.cursor = value;
|
|
19298
|
+
}
|
|
19305
19299
|
|
|
19306
|
-
|
|
19300
|
+
if (this.formatter.currentSpec) {
|
|
19301
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19302
|
+
if (target) {
|
|
19303
|
+
target.style.cursor = value;
|
|
19304
|
+
}
|
|
19305
|
+
}
|
|
19306
|
+
}
|
|
19307
|
+
}]);
|
|
19308
|
+
|
|
19309
|
+
return ResizeAction;
|
|
19310
|
+
}(_Action3.default);
|
|
19311
|
+
|
|
19312
|
+
ResizeAction.default = ResizeAction$1;
|
|
19313
|
+
return ResizeAction;
|
|
19314
|
+
}
|
|
19307
19315
|
|
|
19308
19316
|
var DeleteAction = {};
|
|
19309
19317
|
|
|
@@ -19410,7 +19418,7 @@
|
|
|
19410
19418
|
|
|
19411
19419
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19412
19420
|
|
|
19413
|
-
var _ResizeAction =
|
|
19421
|
+
var _ResizeAction = requireResizeAction();
|
|
19414
19422
|
|
|
19415
19423
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19416
19424
|
|
|
@@ -19542,148 +19550,156 @@
|
|
|
19542
19550
|
|
|
19543
19551
|
var IframeVideoSpec = {};
|
|
19544
19552
|
|
|
19545
|
-
var UnclickableBlotSpec
|
|
19553
|
+
var UnclickableBlotSpec = {};
|
|
19546
19554
|
|
|
19547
|
-
|
|
19548
|
-
value: true
|
|
19549
|
-
});
|
|
19555
|
+
var hasRequiredUnclickableBlotSpec;
|
|
19550
19556
|
|
|
19551
|
-
|
|
19557
|
+
function requireUnclickableBlotSpec () {
|
|
19558
|
+
if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
|
|
19559
|
+
hasRequiredUnclickableBlotSpec = 1;
|
|
19552
19560
|
|
|
19553
|
-
|
|
19561
|
+
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19562
|
+
value: true
|
|
19563
|
+
});
|
|
19554
19564
|
|
|
19555
|
-
|
|
19565
|
+
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; }; }();
|
|
19556
19566
|
|
|
19557
|
-
|
|
19567
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19558
19568
|
|
|
19559
|
-
|
|
19569
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19560
19570
|
|
|
19561
|
-
|
|
19571
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19562
19572
|
|
|
19563
|
-
|
|
19573
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19564
19574
|
|
|
19565
|
-
|
|
19575
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19566
19576
|
|
|
19567
|
-
|
|
19577
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19568
19578
|
|
|
19569
|
-
|
|
19570
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19579
|
+
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; }
|
|
19571
19580
|
|
|
19572
|
-
|
|
19573
|
-
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19581
|
+
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; }
|
|
19574
19582
|
|
|
19575
|
-
|
|
19576
|
-
|
|
19583
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19584
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19577
19585
|
|
|
19578
|
-
|
|
19586
|
+
var UnclickableBlotSpec$1 = function (_BlotSpec) {
|
|
19587
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19579
19588
|
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19583
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19584
|
-
});
|
|
19585
|
-
};
|
|
19589
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19590
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19586
19591
|
|
|
19587
|
-
|
|
19588
|
-
var unclickable = event.target;
|
|
19589
|
-
if (!(unclickable instanceof HTMLElement)) {
|
|
19590
|
-
return;
|
|
19591
|
-
}
|
|
19592
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19592
19593
|
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19594
|
+
_this.onTextChange = function () {
|
|
19595
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19596
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19597
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19598
|
+
});
|
|
19599
|
+
};
|
|
19596
19600
|
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
};
|
|
19601
|
+
_this.onMouseEnter = function (event) {
|
|
19602
|
+
var unclickable = event.target;
|
|
19603
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19604
|
+
return;
|
|
19605
|
+
}
|
|
19603
19606
|
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
return _this;
|
|
19608
|
-
}
|
|
19607
|
+
_this.nextUnclickable = unclickable;
|
|
19608
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19609
|
+
};
|
|
19609
19610
|
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19617
|
-
*/
|
|
19618
|
-
document.body.appendChild(this.createProxyImage());
|
|
19619
|
-
}
|
|
19611
|
+
_this.onProxyImageClick = function () {
|
|
19612
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19613
|
+
_this.nextUnclickable = null;
|
|
19614
|
+
_this.formatter.show(_this);
|
|
19615
|
+
_this.hideProxyImage();
|
|
19616
|
+
};
|
|
19620
19617
|
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
key: 'getTargetElement',
|
|
19627
|
-
value: function getTargetElement() {
|
|
19628
|
-
return this.unclickable;
|
|
19629
|
-
}
|
|
19630
|
-
}, {
|
|
19631
|
-
key: 'getOverlayElement',
|
|
19632
|
-
value: function getOverlayElement() {
|
|
19633
|
-
return this.unclickable;
|
|
19634
|
-
}
|
|
19635
|
-
}, {
|
|
19636
|
-
key: 'onHide',
|
|
19637
|
-
value: function onHide() {
|
|
19638
|
-
this.hideProxyImage();
|
|
19639
|
-
this.nextUnclickable = null;
|
|
19640
|
-
this.unclickable = null;
|
|
19641
|
-
}
|
|
19642
|
-
}, {
|
|
19643
|
-
key: 'createProxyImage',
|
|
19644
|
-
value: function createProxyImage() {
|
|
19645
|
-
var canvas = document.createElement('canvas');
|
|
19646
|
-
var context = canvas.getContext('2d');
|
|
19647
|
-
context.globalAlpha = 0;
|
|
19648
|
-
context.fillRect(0, 0, 1, 1);
|
|
19649
|
-
|
|
19650
|
-
this.proxyImage = document.createElement('img');
|
|
19651
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19652
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19653
|
-
|
|
19654
|
-
Object.assign(this.proxyImage.style, {
|
|
19655
|
-
position: 'absolute',
|
|
19656
|
-
margin: '0'
|
|
19657
|
-
});
|
|
19618
|
+
_this.selector = selector;
|
|
19619
|
+
_this.unclickable = null;
|
|
19620
|
+
_this.nextUnclickable = null;
|
|
19621
|
+
return _this;
|
|
19622
|
+
}
|
|
19658
19623
|
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19624
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19625
|
+
key: 'init',
|
|
19626
|
+
value: function init() {
|
|
19627
|
+
if (document.body) {
|
|
19628
|
+
/*
|
|
19629
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19630
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19631
|
+
*/
|
|
19632
|
+
document.body.appendChild(this.createProxyImage());
|
|
19633
|
+
}
|
|
19634
|
+
|
|
19635
|
+
this.hideProxyImage();
|
|
19636
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19637
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19638
|
+
}
|
|
19639
|
+
}, {
|
|
19640
|
+
key: 'getTargetElement',
|
|
19641
|
+
value: function getTargetElement() {
|
|
19642
|
+
return this.unclickable;
|
|
19643
|
+
}
|
|
19644
|
+
}, {
|
|
19645
|
+
key: 'getOverlayElement',
|
|
19646
|
+
value: function getOverlayElement() {
|
|
19647
|
+
return this.unclickable;
|
|
19648
|
+
}
|
|
19649
|
+
}, {
|
|
19650
|
+
key: 'onHide',
|
|
19651
|
+
value: function onHide() {
|
|
19652
|
+
this.hideProxyImage();
|
|
19653
|
+
this.nextUnclickable = null;
|
|
19654
|
+
this.unclickable = null;
|
|
19655
|
+
}
|
|
19656
|
+
}, {
|
|
19657
|
+
key: 'createProxyImage',
|
|
19658
|
+
value: function createProxyImage() {
|
|
19659
|
+
var canvas = document.createElement('canvas');
|
|
19660
|
+
var context = canvas.getContext('2d');
|
|
19661
|
+
context.globalAlpha = 0;
|
|
19662
|
+
context.fillRect(0, 0, 1, 1);
|
|
19663
|
+
|
|
19664
|
+
this.proxyImage = document.createElement('img');
|
|
19665
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19666
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19667
|
+
|
|
19668
|
+
Object.assign(this.proxyImage.style, {
|
|
19669
|
+
position: 'absolute',
|
|
19670
|
+
margin: '0'
|
|
19671
|
+
});
|
|
19672
|
+
|
|
19673
|
+
return this.proxyImage;
|
|
19674
|
+
}
|
|
19675
|
+
}, {
|
|
19676
|
+
key: 'hideProxyImage',
|
|
19677
|
+
value: function hideProxyImage() {
|
|
19678
|
+
Object.assign(this.proxyImage.style, {
|
|
19679
|
+
display: 'none'
|
|
19680
|
+
});
|
|
19681
|
+
}
|
|
19682
|
+
}, {
|
|
19683
|
+
key: 'repositionProxyImage',
|
|
19684
|
+
value: function repositionProxyImage(unclickable) {
|
|
19685
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19686
|
+
|
|
19687
|
+
Object.assign(this.proxyImage.style, {
|
|
19688
|
+
display: 'block',
|
|
19689
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19690
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19691
|
+
width: rect.width + 'px',
|
|
19692
|
+
height: rect.height + 'px'
|
|
19693
|
+
});
|
|
19694
|
+
}
|
|
19695
|
+
}]);
|
|
19682
19696
|
|
|
19683
|
-
|
|
19684
|
-
|
|
19697
|
+
return UnclickableBlotSpec;
|
|
19698
|
+
}(_BlotSpec3.default);
|
|
19685
19699
|
|
|
19686
|
-
|
|
19700
|
+
UnclickableBlotSpec.default = UnclickableBlotSpec$1;
|
|
19701
|
+
return UnclickableBlotSpec;
|
|
19702
|
+
}
|
|
19687
19703
|
|
|
19688
19704
|
var hasRequiredIframeVideoSpec;
|
|
19689
19705
|
|
|
@@ -19695,7 +19711,7 @@
|
|
|
19695
19711
|
value: true
|
|
19696
19712
|
});
|
|
19697
19713
|
|
|
19698
|
-
var _UnclickableBlotSpec2 =
|
|
19714
|
+
var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
|
|
19699
19715
|
|
|
19700
19716
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19701
19717
|
|
|
@@ -19895,7 +19911,7 @@
|
|
|
19895
19911
|
}
|
|
19896
19912
|
});
|
|
19897
19913
|
|
|
19898
|
-
var _ResizeAction =
|
|
19914
|
+
var _ResizeAction = requireResizeAction();
|
|
19899
19915
|
|
|
19900
19916
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
19901
19917
|
enumerable: true,
|
|
@@ -19922,7 +19938,7 @@
|
|
|
19922
19938
|
}
|
|
19923
19939
|
});
|
|
19924
19940
|
|
|
19925
|
-
var _UnclickableBlotSpec =
|
|
19941
|
+
var _UnclickableBlotSpec = requireUnclickableBlotSpec();
|
|
19926
19942
|
|
|
19927
19943
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19928
19944
|
enumerable: true,
|
|
@@ -19956,15 +19972,16 @@
|
|
|
19956
19972
|
type: Object,
|
|
19957
19973
|
default: () => ({}),
|
|
19958
19974
|
},
|
|
19975
|
+
showMoreToolbar: {
|
|
19976
|
+
type: Boolean,
|
|
19977
|
+
default: false,
|
|
19978
|
+
},
|
|
19959
19979
|
},
|
|
19960
19980
|
emits: ['toolClick'],
|
|
19961
19981
|
setup(props, { emit }) {
|
|
19962
|
-
const showMoreTools = vue.ref(false);
|
|
19963
|
-
const moreButtonClick = () => {
|
|
19964
|
-
showMoreTools.value = !showMoreTools.value;
|
|
19965
|
-
};
|
|
19966
19982
|
return () => vue.h('div', {
|
|
19967
19983
|
id: 'toolbar-' + props.editorKey,
|
|
19984
|
+
dataC: props.showMoreToolbar,
|
|
19968
19985
|
style: {
|
|
19969
19986
|
...props.toolbarStyle
|
|
19970
19987
|
}
|
|
@@ -19972,7 +19989,7 @@
|
|
|
19972
19989
|
vue.h('div', {
|
|
19973
19990
|
class: {
|
|
19974
19991
|
'short-tools': true,
|
|
19975
|
-
'collapse':
|
|
19992
|
+
'collapse': props.showMoreToolbar
|
|
19976
19993
|
}
|
|
19977
19994
|
}, [
|
|
19978
19995
|
// 第一组:基础格式工具
|
|
@@ -20015,15 +20032,15 @@
|
|
|
20015
20032
|
vue.h('button', {
|
|
20016
20033
|
class: 'ql-more mr-0',
|
|
20017
20034
|
type: 'button',
|
|
20018
|
-
onClick:
|
|
20035
|
+
onClick: () => emit('toolClick', 'more')
|
|
20019
20036
|
}, '')
|
|
20020
20037
|
])
|
|
20021
20038
|
]),
|
|
20022
20039
|
vue.h('div', {
|
|
20023
20040
|
class: {
|
|
20024
20041
|
"more-tools": true,
|
|
20025
|
-
"collapse":
|
|
20026
|
-
}, style: { display:
|
|
20042
|
+
"collapse": props.showMoreToolbar
|
|
20043
|
+
}, style: { display: props.showMoreToolbar ? 'block' : 'none' }
|
|
20027
20044
|
}, [
|
|
20028
20045
|
vue.h('div', { class: "more-tools-item" }, [
|
|
20029
20046
|
vue.h('span', { class: 'ql-formats' }, [
|
|
@@ -20303,6 +20320,7 @@
|
|
|
20303
20320
|
}
|
|
20304
20321
|
});
|
|
20305
20322
|
vue.watchEffect(() => {
|
|
20323
|
+
console.log("init");
|
|
20306
20324
|
applyEditorStyle();
|
|
20307
20325
|
});
|
|
20308
20326
|
const registerModule = (moduleName, module) => {
|
|
@@ -20454,8 +20472,8 @@
|
|
|
20454
20472
|
toolbar.style.display = 'block';
|
|
20455
20473
|
}
|
|
20456
20474
|
else {
|
|
20457
|
-
showMoreToolbar.value = false;
|
|
20458
20475
|
toolbar.style.display = 'none';
|
|
20476
|
+
showMoreToolbar.value = false;
|
|
20459
20477
|
}
|
|
20460
20478
|
}
|
|
20461
20479
|
ctx.emit('selectionChange', { range, oldRange, source });
|
|
@@ -20570,6 +20588,10 @@
|
|
|
20570
20588
|
else if (tool === 'math') {
|
|
20571
20589
|
ctx.emit('math');
|
|
20572
20590
|
}
|
|
20591
|
+
else if (tool === 'more') {
|
|
20592
|
+
// 处理更多按钮点击
|
|
20593
|
+
showMoreToolbar.value = !showMoreToolbar.value;
|
|
20594
|
+
}
|
|
20573
20595
|
};
|
|
20574
20596
|
vue.watch(() => props.content, (newContent) => {
|
|
20575
20597
|
if (!quill || !newContent || internalModelEquals(newContent))
|
|
@@ -20611,6 +20633,7 @@
|
|
|
20611
20633
|
editorKey: String(this.$props.editorKey),
|
|
20612
20634
|
needCollapse: this.needCollapse,
|
|
20613
20635
|
toolbarStyle: this.$props.toolbarStyle,
|
|
20636
|
+
showMoreToolbar: this.showMoreToolbar,
|
|
20614
20637
|
onToolClick: (tool) => {
|
|
20615
20638
|
this.moreToolbarToolClick(tool);
|
|
20616
20639
|
}
|