pxx-vue-quill 1.0.14 → 1.0.17
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 +43 -10
- package/dist/vue-quill.cjs.prod.js +2 -2
- package/dist/vue-quill.esm-browser.js +200 -183
- package/dist/vue-quill.esm-browser.prod.js +2 -2
- package/dist/vue-quill.esm-bundler.js +43 -10
- package/dist/vue-quill.esm-bundler.prod.js +2 -2
- package/dist/vue-quill.global.js +313 -280
- package/dist/vue-quill.global.prod.js +2 -2
- package/dist/vue-quill.snow.css +1 -3
- package/dist/vue-quill.snow.prod.css +1 -1
- 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-
|
|
10
|
+
* Date: 2025-08-25T02:25:20.932Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -19130,190 +19130,182 @@
|
|
|
19130
19130
|
return AlignAction;
|
|
19131
19131
|
}
|
|
19132
19132
|
|
|
19133
|
-
var ResizeAction = {};
|
|
19133
|
+
var ResizeAction$1 = {};
|
|
19134
19134
|
|
|
19135
|
-
|
|
19136
|
-
|
|
19137
|
-
|
|
19138
|
-
if (hasRequiredResizeAction) return ResizeAction;
|
|
19139
|
-
hasRequiredResizeAction = 1;
|
|
19140
|
-
|
|
19141
|
-
Object.defineProperty(ResizeAction, "__esModule", {
|
|
19142
|
-
value: true
|
|
19143
|
-
});
|
|
19135
|
+
Object.defineProperty(ResizeAction$1, "__esModule", {
|
|
19136
|
+
value: true
|
|
19137
|
+
});
|
|
19144
19138
|
|
|
19145
|
-
|
|
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; }; }();
|
|
19146
19140
|
|
|
19147
|
-
|
|
19141
|
+
var _Action2 = requireAction();
|
|
19148
19142
|
|
|
19149
|
-
|
|
19143
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19150
19144
|
|
|
19151
|
-
|
|
19145
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19152
19146
|
|
|
19153
|
-
|
|
19147
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19154
19148
|
|
|
19155
|
-
|
|
19149
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19156
19150
|
|
|
19157
|
-
|
|
19151
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19158
19152
|
|
|
19159
|
-
|
|
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; }
|
|
19160
19154
|
|
|
19161
|
-
|
|
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; }
|
|
19162
19156
|
|
|
19163
|
-
|
|
19164
|
-
|
|
19157
|
+
var ResizeAction = function (_Action) {
|
|
19158
|
+
_inherits(ResizeAction, _Action);
|
|
19165
19159
|
|
|
19166
|
-
|
|
19167
|
-
|
|
19160
|
+
function ResizeAction(formatter) {
|
|
19161
|
+
_classCallCheck(this, ResizeAction);
|
|
19168
19162
|
|
|
19169
|
-
|
|
19163
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19170
19164
|
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
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);
|
|
19177
19171
|
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19172
|
+
if (!_this.formatter.currentSpec) {
|
|
19173
|
+
return;
|
|
19174
|
+
}
|
|
19181
19175
|
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19176
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19177
|
+
if (!target) {
|
|
19178
|
+
return;
|
|
19179
|
+
}
|
|
19186
19180
|
|
|
19187
|
-
|
|
19181
|
+
var rect = target.getBoundingClientRect();
|
|
19188
19182
|
|
|
19189
|
-
|
|
19190
|
-
|
|
19191
|
-
|
|
19183
|
+
_this.dragStartX = event.clientX;
|
|
19184
|
+
_this.preDragWidth = rect.width;
|
|
19185
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19192
19186
|
|
|
19193
|
-
|
|
19194
|
-
|
|
19195
|
-
|
|
19187
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19188
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19189
|
+
};
|
|
19196
19190
|
|
|
19197
|
-
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
|
|
19191
|
+
_this.onDrag = function (event) {
|
|
19192
|
+
if (!_this.formatter.currentSpec) {
|
|
19193
|
+
return;
|
|
19194
|
+
}
|
|
19201
19195
|
|
|
19202
|
-
|
|
19203
|
-
|
|
19204
|
-
|
|
19205
|
-
|
|
19196
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19197
|
+
if (!target) {
|
|
19198
|
+
return;
|
|
19199
|
+
}
|
|
19206
19200
|
|
|
19207
|
-
|
|
19208
|
-
|
|
19201
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19202
|
+
var newWidth = 0;
|
|
19209
19203
|
|
|
19210
|
-
|
|
19211
|
-
|
|
19212
|
-
|
|
19213
|
-
|
|
19214
|
-
|
|
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
|
+
}
|
|
19215
19209
|
|
|
19216
|
-
|
|
19210
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19217
19211
|
|
|
19218
|
-
|
|
19219
|
-
|
|
19212
|
+
target.setAttribute('width', '' + newWidth);
|
|
19213
|
+
target.setAttribute('height', '' + newHeight);
|
|
19220
19214
|
|
|
19221
|
-
|
|
19222
|
-
|
|
19215
|
+
_this.formatter.update();
|
|
19216
|
+
};
|
|
19223
19217
|
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
|
|
19218
|
+
_this.onMouseUp = function () {
|
|
19219
|
+
_this.setCursor('');
|
|
19220
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19221
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19222
|
+
};
|
|
19229
19223
|
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
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
|
+
}
|
|
19240
19234
|
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
|
|
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);
|
|
19248
19242
|
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
|
|
19252
|
-
|
|
19253
|
-
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
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
|
+
}
|
|
19271
19265
|
|
|
19272
|
-
|
|
19266
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19273
19267
|
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
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
|
+
}
|
|
19289
19283
|
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
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
|
+
}
|
|
19301
19295
|
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
|
|
19309
|
-
|
|
19296
|
+
if (this.formatter.currentSpec) {
|
|
19297
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19298
|
+
if (target) {
|
|
19299
|
+
target.style.cursor = value;
|
|
19300
|
+
}
|
|
19301
|
+
}
|
|
19302
|
+
}
|
|
19303
|
+
}]);
|
|
19310
19304
|
|
|
19311
|
-
|
|
19312
|
-
|
|
19305
|
+
return ResizeAction;
|
|
19306
|
+
}(_Action3.default);
|
|
19313
19307
|
|
|
19314
|
-
|
|
19315
|
-
return ResizeAction;
|
|
19316
|
-
}
|
|
19308
|
+
ResizeAction$1.default = ResizeAction;
|
|
19317
19309
|
|
|
19318
19310
|
var DeleteAction = {};
|
|
19319
19311
|
|
|
@@ -19420,7 +19412,7 @@
|
|
|
19420
19412
|
|
|
19421
19413
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19422
19414
|
|
|
19423
|
-
var _ResizeAction =
|
|
19415
|
+
var _ResizeAction = ResizeAction$1;
|
|
19424
19416
|
|
|
19425
19417
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19426
19418
|
|
|
@@ -19552,148 +19544,156 @@
|
|
|
19552
19544
|
|
|
19553
19545
|
var IframeVideoSpec = {};
|
|
19554
19546
|
|
|
19555
|
-
var UnclickableBlotSpec
|
|
19547
|
+
var UnclickableBlotSpec = {};
|
|
19556
19548
|
|
|
19557
|
-
|
|
19558
|
-
value: true
|
|
19559
|
-
});
|
|
19549
|
+
var hasRequiredUnclickableBlotSpec;
|
|
19560
19550
|
|
|
19561
|
-
|
|
19551
|
+
function requireUnclickableBlotSpec () {
|
|
19552
|
+
if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
|
|
19553
|
+
hasRequiredUnclickableBlotSpec = 1;
|
|
19562
19554
|
|
|
19563
|
-
|
|
19555
|
+
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19556
|
+
value: true
|
|
19557
|
+
});
|
|
19564
19558
|
|
|
19565
|
-
|
|
19559
|
+
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; }; }();
|
|
19566
19560
|
|
|
19567
|
-
|
|
19561
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19568
19562
|
|
|
19569
|
-
|
|
19563
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19570
19564
|
|
|
19571
|
-
|
|
19565
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19572
19566
|
|
|
19573
|
-
|
|
19567
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19574
19568
|
|
|
19575
|
-
|
|
19569
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19576
19570
|
|
|
19577
|
-
|
|
19571
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19578
19572
|
|
|
19579
|
-
|
|
19580
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19573
|
+
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; }
|
|
19581
19574
|
|
|
19582
|
-
|
|
19583
|
-
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19575
|
+
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; }
|
|
19584
19576
|
|
|
19585
|
-
|
|
19586
|
-
|
|
19577
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19578
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19587
19579
|
|
|
19588
|
-
|
|
19580
|
+
var UnclickableBlotSpec$1 = function (_BlotSpec) {
|
|
19581
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19589
19582
|
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19593
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19594
|
-
});
|
|
19595
|
-
};
|
|
19583
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19584
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19596
19585
|
|
|
19597
|
-
|
|
19598
|
-
var unclickable = event.target;
|
|
19599
|
-
if (!(unclickable instanceof HTMLElement)) {
|
|
19600
|
-
return;
|
|
19601
|
-
}
|
|
19586
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19602
19587
|
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19588
|
+
_this.onTextChange = function () {
|
|
19589
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19590
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19591
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19592
|
+
});
|
|
19593
|
+
};
|
|
19606
19594
|
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
};
|
|
19595
|
+
_this.onMouseEnter = function (event) {
|
|
19596
|
+
var unclickable = event.target;
|
|
19597
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19598
|
+
return;
|
|
19599
|
+
}
|
|
19613
19600
|
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
return _this;
|
|
19618
|
-
}
|
|
19601
|
+
_this.nextUnclickable = unclickable;
|
|
19602
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19603
|
+
};
|
|
19619
19604
|
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19627
|
-
*/
|
|
19628
|
-
document.body.appendChild(this.createProxyImage());
|
|
19629
|
-
}
|
|
19605
|
+
_this.onProxyImageClick = function () {
|
|
19606
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19607
|
+
_this.nextUnclickable = null;
|
|
19608
|
+
_this.formatter.show(_this);
|
|
19609
|
+
_this.hideProxyImage();
|
|
19610
|
+
};
|
|
19630
19611
|
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
|
|
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
|
-
});
|
|
19612
|
+
_this.selector = selector;
|
|
19613
|
+
_this.unclickable = null;
|
|
19614
|
+
_this.nextUnclickable = null;
|
|
19615
|
+
return _this;
|
|
19616
|
+
}
|
|
19668
19617
|
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19691
|
-
|
|
19618
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19619
|
+
key: 'init',
|
|
19620
|
+
value: function init() {
|
|
19621
|
+
if (document.body) {
|
|
19622
|
+
/*
|
|
19623
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19624
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19625
|
+
*/
|
|
19626
|
+
document.body.appendChild(this.createProxyImage());
|
|
19627
|
+
}
|
|
19628
|
+
|
|
19629
|
+
this.hideProxyImage();
|
|
19630
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19631
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19632
|
+
}
|
|
19633
|
+
}, {
|
|
19634
|
+
key: 'getTargetElement',
|
|
19635
|
+
value: function getTargetElement() {
|
|
19636
|
+
return this.unclickable;
|
|
19637
|
+
}
|
|
19638
|
+
}, {
|
|
19639
|
+
key: 'getOverlayElement',
|
|
19640
|
+
value: function getOverlayElement() {
|
|
19641
|
+
return this.unclickable;
|
|
19642
|
+
}
|
|
19643
|
+
}, {
|
|
19644
|
+
key: 'onHide',
|
|
19645
|
+
value: function onHide() {
|
|
19646
|
+
this.hideProxyImage();
|
|
19647
|
+
this.nextUnclickable = null;
|
|
19648
|
+
this.unclickable = null;
|
|
19649
|
+
}
|
|
19650
|
+
}, {
|
|
19651
|
+
key: 'createProxyImage',
|
|
19652
|
+
value: function createProxyImage() {
|
|
19653
|
+
var canvas = document.createElement('canvas');
|
|
19654
|
+
var context = canvas.getContext('2d');
|
|
19655
|
+
context.globalAlpha = 0;
|
|
19656
|
+
context.fillRect(0, 0, 1, 1);
|
|
19657
|
+
|
|
19658
|
+
this.proxyImage = document.createElement('img');
|
|
19659
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19660
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19661
|
+
|
|
19662
|
+
Object.assign(this.proxyImage.style, {
|
|
19663
|
+
position: 'absolute',
|
|
19664
|
+
margin: '0'
|
|
19665
|
+
});
|
|
19666
|
+
|
|
19667
|
+
return this.proxyImage;
|
|
19668
|
+
}
|
|
19669
|
+
}, {
|
|
19670
|
+
key: 'hideProxyImage',
|
|
19671
|
+
value: function hideProxyImage() {
|
|
19672
|
+
Object.assign(this.proxyImage.style, {
|
|
19673
|
+
display: 'none'
|
|
19674
|
+
});
|
|
19675
|
+
}
|
|
19676
|
+
}, {
|
|
19677
|
+
key: 'repositionProxyImage',
|
|
19678
|
+
value: function repositionProxyImage(unclickable) {
|
|
19679
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19692
19680
|
|
|
19693
|
-
|
|
19694
|
-
|
|
19681
|
+
Object.assign(this.proxyImage.style, {
|
|
19682
|
+
display: 'block',
|
|
19683
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19684
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19685
|
+
width: rect.width + 'px',
|
|
19686
|
+
height: rect.height + 'px'
|
|
19687
|
+
});
|
|
19688
|
+
}
|
|
19689
|
+
}]);
|
|
19695
19690
|
|
|
19696
|
-
|
|
19691
|
+
return UnclickableBlotSpec;
|
|
19692
|
+
}(_BlotSpec3.default);
|
|
19693
|
+
|
|
19694
|
+
UnclickableBlotSpec.default = UnclickableBlotSpec$1;
|
|
19695
|
+
return UnclickableBlotSpec;
|
|
19696
|
+
}
|
|
19697
19697
|
|
|
19698
19698
|
var hasRequiredIframeVideoSpec;
|
|
19699
19699
|
|
|
@@ -19705,7 +19705,7 @@
|
|
|
19705
19705
|
value: true
|
|
19706
19706
|
});
|
|
19707
19707
|
|
|
19708
|
-
var _UnclickableBlotSpec2 =
|
|
19708
|
+
var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
|
|
19709
19709
|
|
|
19710
19710
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19711
19711
|
|
|
@@ -19905,7 +19905,7 @@
|
|
|
19905
19905
|
}
|
|
19906
19906
|
});
|
|
19907
19907
|
|
|
19908
|
-
var _ResizeAction =
|
|
19908
|
+
var _ResizeAction = ResizeAction$1;
|
|
19909
19909
|
|
|
19910
19910
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
19911
19911
|
enumerable: true,
|
|
@@ -19932,7 +19932,7 @@
|
|
|
19932
19932
|
}
|
|
19933
19933
|
});
|
|
19934
19934
|
|
|
19935
|
-
var _UnclickableBlotSpec =
|
|
19935
|
+
var _UnclickableBlotSpec = requireUnclickableBlotSpec();
|
|
19936
19936
|
|
|
19937
19937
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19938
19938
|
enumerable: true,
|
|
@@ -19998,6 +19998,12 @@
|
|
|
19998
19998
|
return ['fixed-top', 'embedded'].includes(value);
|
|
19999
19999
|
},
|
|
20000
20000
|
},
|
|
20001
|
+
// 传入toolbar的自定义style
|
|
20002
|
+
toolbarStyle: {
|
|
20003
|
+
type: Object,
|
|
20004
|
+
required: false,
|
|
20005
|
+
default: () => ({})
|
|
20006
|
+
},
|
|
20001
20007
|
theme: {
|
|
20002
20008
|
type: String,
|
|
20003
20009
|
default: 'snow',
|
|
@@ -20059,11 +20065,6 @@
|
|
|
20059
20065
|
let quill;
|
|
20060
20066
|
let options;
|
|
20061
20067
|
const editor = vue.ref();
|
|
20062
|
-
const editorWrapStyle = vue.computed(() => {
|
|
20063
|
-
return {
|
|
20064
|
-
minHeight: `${props.minHeight}px`,
|
|
20065
|
-
};
|
|
20066
|
-
});
|
|
20067
20068
|
const editorWrapClass = vue.computed(() => {
|
|
20068
20069
|
return {
|
|
20069
20070
|
'quill-editor-container': true,
|
|
@@ -20072,6 +20073,37 @@
|
|
|
20072
20073
|
'embedded': props.toolbarMode === 'embedded',
|
|
20073
20074
|
};
|
|
20074
20075
|
});
|
|
20076
|
+
// 监听 minHeight 变化,同步设置编辑器高度
|
|
20077
|
+
const updateEditorHeight = () => {
|
|
20078
|
+
if (quill && editor.value) {
|
|
20079
|
+
const editorElement = editor.value.querySelector('.ql-editor');
|
|
20080
|
+
if (editorElement) {
|
|
20081
|
+
editorElement.style.minHeight = `${props.minHeight}px`;
|
|
20082
|
+
}
|
|
20083
|
+
}
|
|
20084
|
+
};
|
|
20085
|
+
// 监听 minHeight 变化
|
|
20086
|
+
vue.watch(() => props.minHeight, () => {
|
|
20087
|
+
vue.nextTick(() => {
|
|
20088
|
+
updateEditorHeight();
|
|
20089
|
+
});
|
|
20090
|
+
});
|
|
20091
|
+
// 应用自定义toolbar样式
|
|
20092
|
+
const applyToolbarStyle = () => {
|
|
20093
|
+
var _a;
|
|
20094
|
+
if (quill && props.toolbarStyle) {
|
|
20095
|
+
const toolbar = (_a = quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
|
|
20096
|
+
if (toolbar) {
|
|
20097
|
+
Object.assign(toolbar.style, props.toolbarStyle);
|
|
20098
|
+
}
|
|
20099
|
+
}
|
|
20100
|
+
};
|
|
20101
|
+
// 监听 toolbarStyle 变化
|
|
20102
|
+
vue.watch(() => props.toolbarStyle, () => {
|
|
20103
|
+
vue.nextTick(() => {
|
|
20104
|
+
applyToolbarStyle();
|
|
20105
|
+
});
|
|
20106
|
+
});
|
|
20075
20107
|
// Register Module if not already registered
|
|
20076
20108
|
const registerModule = (moduleName, module) => {
|
|
20077
20109
|
// For Quill 1.x, we can't check if module is already registered
|
|
@@ -20123,6 +20155,10 @@
|
|
|
20123
20155
|
.getModule('toolbar')) === null || _b === void 0 ? void 0 : _b.container.addEventListener('mousedown', (e) => {
|
|
20124
20156
|
e.preventDefault();
|
|
20125
20157
|
});
|
|
20158
|
+
// 设置初始编辑器高度
|
|
20159
|
+
updateEditorHeight();
|
|
20160
|
+
// 应用初始toolbar样式
|
|
20161
|
+
applyToolbarStyle();
|
|
20126
20162
|
// Emit ready event
|
|
20127
20163
|
ctx.emit('ready', quill);
|
|
20128
20164
|
};
|
|
@@ -20146,7 +20182,6 @@
|
|
|
20146
20182
|
handlers: {
|
|
20147
20183
|
ocr: function () {
|
|
20148
20184
|
// 按钮点击逻辑
|
|
20149
|
-
console.log('ocr');
|
|
20150
20185
|
ctx.emit('ocr');
|
|
20151
20186
|
},
|
|
20152
20187
|
math: function () {
|
|
@@ -20209,7 +20244,6 @@
|
|
|
20209
20244
|
const isEditorFocus = vue.ref();
|
|
20210
20245
|
const handleSelectionChange = (range, oldRange, source) => {
|
|
20211
20246
|
var _a;
|
|
20212
|
-
// Set isEditorFocus if quill.hasFocus()
|
|
20213
20247
|
isEditorFocus.value = !!(quill === null || quill === void 0 ? void 0 : quill.hasFocus());
|
|
20214
20248
|
// 动态显示/隐藏toolbar
|
|
20215
20249
|
const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
|
|
@@ -20345,14 +20379,13 @@
|
|
|
20345
20379
|
getText,
|
|
20346
20380
|
setText,
|
|
20347
20381
|
reinit,
|
|
20348
|
-
editorWrapStyle,
|
|
20349
20382
|
editorWrapClass,
|
|
20350
20383
|
};
|
|
20351
20384
|
},
|
|
20352
20385
|
render() {
|
|
20353
20386
|
var _a, _b;
|
|
20354
20387
|
return [
|
|
20355
|
-
vue.h('div', { class: this.editorWrapClass
|
|
20388
|
+
vue.h('div', { class: this.editorWrapClass }, [
|
|
20356
20389
|
(_b = (_a = this.$slots).toolbar) === null || _b === void 0 ? void 0 : _b.call(_a),
|
|
20357
20390
|
vue.h('div', { ref: 'editor', ...this.$attrs }),
|
|
20358
20391
|
]),
|