pxx-vue-quill 1.0.3 → 1.0.5
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 +13 -3
- package/dist/vue-quill.cjs.prod.js +2 -2
- package/dist/vue-quill.esm-browser.js +280 -286
- package/dist/vue-quill.esm-browser.prod.js +2 -2
- package/dist/vue-quill.esm-bundler.js +14 -4
- package/dist/vue-quill.esm-bundler.prod.js +2 -2
- package/dist/vue-quill.global.js +159 -157
- package/dist/vue-quill.global.prod.js +2 -2
- package/dist/vue-quill.snow.css +13 -2
- package/dist/vue-quill.snow.prod.css +1 -1
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2025 Pxx-Team
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2025-08-
|
|
10
|
+
* Date: 2025-08-21T03:23:56.124Z
|
|
11
11
|
*/
|
|
12
|
-
import { defineComponent, onMounted, onBeforeUnmount, ref, watch, nextTick, h } from 'vue';
|
|
12
|
+
import { defineComponent, onMounted, onBeforeUnmount, ref, computed, watch, nextTick, h } from 'vue';
|
|
13
13
|
|
|
14
14
|
var global$1 = (typeof global !== "undefined" ? global :
|
|
15
15
|
typeof self !== "undefined" ? self :
|
|
@@ -18780,11 +18780,11 @@ Object.defineProperty(DefaultAligner$1, "__esModule", {
|
|
|
18780
18780
|
value: true
|
|
18781
18781
|
});
|
|
18782
18782
|
|
|
18783
|
-
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; }; }();
|
|
18783
|
+
var _createClass$2 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
18784
18784
|
|
|
18785
18785
|
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; }
|
|
18786
18786
|
|
|
18787
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18787
|
+
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18788
18788
|
|
|
18789
18789
|
var LEFT_ALIGN = 'left';
|
|
18790
18790
|
var CENTER_ALIGN = 'center';
|
|
@@ -18795,7 +18795,7 @@ var DefaultAligner = function () {
|
|
|
18795
18795
|
var _this = this,
|
|
18796
18796
|
_alignments;
|
|
18797
18797
|
|
|
18798
|
-
_classCallCheck(this, DefaultAligner);
|
|
18798
|
+
_classCallCheck$2(this, DefaultAligner);
|
|
18799
18799
|
|
|
18800
18800
|
this.applyStyle = options.aligner.applyStyle;
|
|
18801
18801
|
this.alignAttribute = options.attribute;
|
|
@@ -18823,7 +18823,7 @@ var DefaultAligner = function () {
|
|
|
18823
18823
|
}), _alignments);
|
|
18824
18824
|
}
|
|
18825
18825
|
|
|
18826
|
-
_createClass(DefaultAligner, [{
|
|
18826
|
+
_createClass$2(DefaultAligner, [{
|
|
18827
18827
|
key: 'getAlignments',
|
|
18828
18828
|
value: function getAlignments() {
|
|
18829
18829
|
var _this2 = this;
|
|
@@ -19126,190 +19126,182 @@ function requireAlignAction () {
|
|
|
19126
19126
|
return AlignAction;
|
|
19127
19127
|
}
|
|
19128
19128
|
|
|
19129
|
-
var ResizeAction = {};
|
|
19130
|
-
|
|
19131
|
-
var hasRequiredResizeAction;
|
|
19129
|
+
var ResizeAction$1 = {};
|
|
19132
19130
|
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19136
|
-
|
|
19137
|
-
Object.defineProperty(ResizeAction, "__esModule", {
|
|
19138
|
-
value: true
|
|
19139
|
-
});
|
|
19131
|
+
Object.defineProperty(ResizeAction$1, "__esModule", {
|
|
19132
|
+
value: true
|
|
19133
|
+
});
|
|
19140
19134
|
|
|
19141
|
-
|
|
19135
|
+
var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
19142
19136
|
|
|
19143
|
-
|
|
19137
|
+
var _Action2 = requireAction();
|
|
19144
19138
|
|
|
19145
|
-
|
|
19139
|
+
var _Action3 = _interopRequireDefault$1(_Action2);
|
|
19146
19140
|
|
|
19147
|
-
|
|
19141
|
+
var _BlotFormatter$1 = requireBlotFormatter();
|
|
19148
19142
|
|
|
19149
|
-
|
|
19143
|
+
_interopRequireDefault$1(_BlotFormatter$1);
|
|
19150
19144
|
|
|
19151
|
-
|
|
19145
|
+
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19152
19146
|
|
|
19153
|
-
|
|
19147
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19154
19148
|
|
|
19155
|
-
|
|
19149
|
+
function _possibleConstructorReturn$1(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
19156
19150
|
|
|
19157
|
-
|
|
19151
|
+
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
19158
19152
|
|
|
19159
|
-
|
|
19160
|
-
|
|
19153
|
+
var ResizeAction = function (_Action) {
|
|
19154
|
+
_inherits$1(ResizeAction, _Action);
|
|
19161
19155
|
|
|
19162
|
-
|
|
19163
|
-
|
|
19156
|
+
function ResizeAction(formatter) {
|
|
19157
|
+
_classCallCheck$1(this, ResizeAction);
|
|
19164
19158
|
|
|
19165
|
-
|
|
19159
|
+
var _this = _possibleConstructorReturn$1(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19166
19160
|
|
|
19167
|
-
|
|
19168
|
-
|
|
19169
|
-
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19161
|
+
_this.onMouseDown = function (event) {
|
|
19162
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19163
|
+
return;
|
|
19164
|
+
}
|
|
19165
|
+
_this.dragHandle = event.target;
|
|
19166
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19173
19167
|
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19168
|
+
if (!_this.formatter.currentSpec) {
|
|
19169
|
+
return;
|
|
19170
|
+
}
|
|
19177
19171
|
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19172
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19173
|
+
if (!target) {
|
|
19174
|
+
return;
|
|
19175
|
+
}
|
|
19182
19176
|
|
|
19183
|
-
|
|
19177
|
+
var rect = target.getBoundingClientRect();
|
|
19184
19178
|
|
|
19185
|
-
|
|
19186
|
-
|
|
19187
|
-
|
|
19179
|
+
_this.dragStartX = event.clientX;
|
|
19180
|
+
_this.preDragWidth = rect.width;
|
|
19181
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19188
19182
|
|
|
19189
|
-
|
|
19190
|
-
|
|
19191
|
-
|
|
19183
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19184
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19185
|
+
};
|
|
19192
19186
|
|
|
19193
|
-
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19187
|
+
_this.onDrag = function (event) {
|
|
19188
|
+
if (!_this.formatter.currentSpec) {
|
|
19189
|
+
return;
|
|
19190
|
+
}
|
|
19197
19191
|
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
|
|
19201
|
-
|
|
19192
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19193
|
+
if (!target) {
|
|
19194
|
+
return;
|
|
19195
|
+
}
|
|
19202
19196
|
|
|
19203
|
-
|
|
19204
|
-
|
|
19197
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19198
|
+
var newWidth = 0;
|
|
19205
19199
|
|
|
19206
|
-
|
|
19207
|
-
|
|
19208
|
-
|
|
19209
|
-
|
|
19210
|
-
|
|
19200
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19201
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19202
|
+
} else {
|
|
19203
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19204
|
+
}
|
|
19211
19205
|
|
|
19212
|
-
|
|
19206
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19213
19207
|
|
|
19214
|
-
|
|
19215
|
-
|
|
19208
|
+
target.setAttribute('width', '' + newWidth);
|
|
19209
|
+
target.setAttribute('height', '' + newHeight);
|
|
19216
19210
|
|
|
19217
|
-
|
|
19218
|
-
|
|
19211
|
+
_this.formatter.update();
|
|
19212
|
+
};
|
|
19219
19213
|
|
|
19220
|
-
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19214
|
+
_this.onMouseUp = function () {
|
|
19215
|
+
_this.setCursor('');
|
|
19216
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19217
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19218
|
+
};
|
|
19225
19219
|
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19220
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19221
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19222
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19223
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19224
|
+
_this.dragHandle = null;
|
|
19225
|
+
_this.dragStartX = 0;
|
|
19226
|
+
_this.preDragWidth = 0;
|
|
19227
|
+
_this.targetRatio = 0;
|
|
19228
|
+
return _this;
|
|
19229
|
+
}
|
|
19236
19230
|
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19231
|
+
_createClass$1(ResizeAction, [{
|
|
19232
|
+
key: 'onCreate',
|
|
19233
|
+
value: function onCreate() {
|
|
19234
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19235
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19236
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19237
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19244
19238
|
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
|
|
19252
|
-
|
|
19253
|
-
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19239
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19240
|
+
}
|
|
19241
|
+
}, {
|
|
19242
|
+
key: 'onDestroy',
|
|
19243
|
+
value: function onDestroy() {
|
|
19244
|
+
this.setCursor('');
|
|
19245
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19246
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19247
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19248
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19249
|
+
}
|
|
19250
|
+
}, {
|
|
19251
|
+
key: 'createHandle',
|
|
19252
|
+
value: function createHandle(position, cursor) {
|
|
19253
|
+
var box = document.createElement('div');
|
|
19254
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19255
|
+
box.setAttribute('data-position', position);
|
|
19256
|
+
box.style.cursor = cursor;
|
|
19257
|
+
|
|
19258
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19259
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19260
|
+
}
|
|
19267
19261
|
|
|
19268
|
-
|
|
19262
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19269
19263
|
|
|
19270
|
-
|
|
19271
|
-
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19264
|
+
return box;
|
|
19265
|
+
}
|
|
19266
|
+
}, {
|
|
19267
|
+
key: 'repositionHandles',
|
|
19268
|
+
value: function repositionHandles(handleStyle) {
|
|
19269
|
+
var handleXOffset = '0px';
|
|
19270
|
+
var handleYOffset = '0px';
|
|
19271
|
+
if (handleStyle) {
|
|
19272
|
+
if (handleStyle.width) {
|
|
19273
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19274
|
+
}
|
|
19275
|
+
if (handleStyle.height) {
|
|
19276
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19277
|
+
}
|
|
19278
|
+
}
|
|
19285
19279
|
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19280
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19281
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19282
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19283
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19284
|
+
}
|
|
19285
|
+
}, {
|
|
19286
|
+
key: 'setCursor',
|
|
19287
|
+
value: function setCursor(value) {
|
|
19288
|
+
if (document.body) {
|
|
19289
|
+
document.body.style.cursor = value;
|
|
19290
|
+
}
|
|
19297
19291
|
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
19292
|
+
if (this.formatter.currentSpec) {
|
|
19293
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19294
|
+
if (target) {
|
|
19295
|
+
target.style.cursor = value;
|
|
19296
|
+
}
|
|
19297
|
+
}
|
|
19298
|
+
}
|
|
19299
|
+
}]);
|
|
19306
19300
|
|
|
19307
|
-
|
|
19308
|
-
|
|
19301
|
+
return ResizeAction;
|
|
19302
|
+
}(_Action3.default);
|
|
19309
19303
|
|
|
19310
|
-
|
|
19311
|
-
return ResizeAction;
|
|
19312
|
-
}
|
|
19304
|
+
ResizeAction$1.default = ResizeAction;
|
|
19313
19305
|
|
|
19314
19306
|
var DeleteAction = {};
|
|
19315
19307
|
|
|
@@ -19416,7 +19408,7 @@ function requireBlotSpec () {
|
|
|
19416
19408
|
|
|
19417
19409
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19418
19410
|
|
|
19419
|
-
var _ResizeAction =
|
|
19411
|
+
var _ResizeAction = ResizeAction$1;
|
|
19420
19412
|
|
|
19421
19413
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19422
19414
|
|
|
@@ -19548,156 +19540,148 @@ function requireImageSpec () {
|
|
|
19548
19540
|
|
|
19549
19541
|
var IframeVideoSpec = {};
|
|
19550
19542
|
|
|
19551
|
-
var UnclickableBlotSpec = {};
|
|
19552
|
-
|
|
19553
|
-
var hasRequiredUnclickableBlotSpec;
|
|
19543
|
+
var UnclickableBlotSpec$1 = {};
|
|
19554
19544
|
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19560
|
-
value: true
|
|
19561
|
-
});
|
|
19562
|
-
|
|
19563
|
-
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; }; }();
|
|
19545
|
+
Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
|
|
19546
|
+
value: true
|
|
19547
|
+
});
|
|
19564
19548
|
|
|
19565
|
-
|
|
19549
|
+
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
19550
|
|
|
19567
|
-
|
|
19551
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19568
19552
|
|
|
19569
|
-
|
|
19553
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19570
19554
|
|
|
19571
|
-
|
|
19555
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19572
19556
|
|
|
19573
|
-
|
|
19557
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19574
19558
|
|
|
19575
|
-
|
|
19559
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19576
19560
|
|
|
19577
|
-
|
|
19561
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19578
19562
|
|
|
19579
|
-
|
|
19563
|
+
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; }
|
|
19580
19564
|
|
|
19581
|
-
|
|
19582
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19565
|
+
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; }
|
|
19583
19566
|
|
|
19584
|
-
|
|
19585
|
-
|
|
19567
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19568
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19586
19569
|
|
|
19587
|
-
|
|
19588
|
-
|
|
19570
|
+
var UnclickableBlotSpec = function (_BlotSpec) {
|
|
19571
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19589
19572
|
|
|
19590
|
-
|
|
19573
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19574
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19591
19575
|
|
|
19592
|
-
|
|
19593
|
-
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19594
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19595
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19596
|
-
});
|
|
19597
|
-
};
|
|
19576
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19598
19577
|
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19578
|
+
_this.onTextChange = function () {
|
|
19579
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19580
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19581
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19582
|
+
});
|
|
19583
|
+
};
|
|
19604
19584
|
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19585
|
+
_this.onMouseEnter = function (event) {
|
|
19586
|
+
var unclickable = event.target;
|
|
19587
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19588
|
+
return;
|
|
19589
|
+
}
|
|
19608
19590
|
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
_this.formatter.show(_this);
|
|
19613
|
-
_this.hideProxyImage();
|
|
19614
|
-
};
|
|
19591
|
+
_this.nextUnclickable = unclickable;
|
|
19592
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19593
|
+
};
|
|
19615
19594
|
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19595
|
+
_this.onProxyImageClick = function () {
|
|
19596
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19597
|
+
_this.nextUnclickable = null;
|
|
19598
|
+
_this.formatter.show(_this);
|
|
19599
|
+
_this.hideProxyImage();
|
|
19600
|
+
};
|
|
19621
19601
|
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
it's important that this is attached to the body instead of the root quill element.
|
|
19628
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19629
|
-
*/
|
|
19630
|
-
document.body.appendChild(this.createProxyImage());
|
|
19631
|
-
}
|
|
19602
|
+
_this.selector = selector;
|
|
19603
|
+
_this.unclickable = null;
|
|
19604
|
+
_this.nextUnclickable = null;
|
|
19605
|
+
return _this;
|
|
19606
|
+
}
|
|
19632
19607
|
|
|
19633
|
-
|
|
19634
|
-
|
|
19635
|
-
|
|
19636
|
-
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
key: 'getOverlayElement',
|
|
19644
|
-
value: function getOverlayElement() {
|
|
19645
|
-
return this.unclickable;
|
|
19646
|
-
}
|
|
19647
|
-
}, {
|
|
19648
|
-
key: 'onHide',
|
|
19649
|
-
value: function onHide() {
|
|
19650
|
-
this.hideProxyImage();
|
|
19651
|
-
this.nextUnclickable = null;
|
|
19652
|
-
this.unclickable = null;
|
|
19653
|
-
}
|
|
19654
|
-
}, {
|
|
19655
|
-
key: 'createProxyImage',
|
|
19656
|
-
value: function createProxyImage() {
|
|
19657
|
-
var canvas = document.createElement('canvas');
|
|
19658
|
-
var context = canvas.getContext('2d');
|
|
19659
|
-
context.globalAlpha = 0;
|
|
19660
|
-
context.fillRect(0, 0, 1, 1);
|
|
19661
|
-
|
|
19662
|
-
this.proxyImage = document.createElement('img');
|
|
19663
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19664
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19665
|
-
|
|
19666
|
-
Object.assign(this.proxyImage.style, {
|
|
19667
|
-
position: 'absolute',
|
|
19668
|
-
margin: '0'
|
|
19669
|
-
});
|
|
19608
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19609
|
+
key: 'init',
|
|
19610
|
+
value: function init() {
|
|
19611
|
+
if (document.body) {
|
|
19612
|
+
/*
|
|
19613
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19614
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19615
|
+
*/
|
|
19616
|
+
document.body.appendChild(this.createProxyImage());
|
|
19617
|
+
}
|
|
19670
19618
|
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19619
|
+
this.hideProxyImage();
|
|
19620
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19621
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19622
|
+
}
|
|
19623
|
+
}, {
|
|
19624
|
+
key: 'getTargetElement',
|
|
19625
|
+
value: function getTargetElement() {
|
|
19626
|
+
return this.unclickable;
|
|
19627
|
+
}
|
|
19628
|
+
}, {
|
|
19629
|
+
key: 'getOverlayElement',
|
|
19630
|
+
value: function getOverlayElement() {
|
|
19631
|
+
return this.unclickable;
|
|
19632
|
+
}
|
|
19633
|
+
}, {
|
|
19634
|
+
key: 'onHide',
|
|
19635
|
+
value: function onHide() {
|
|
19636
|
+
this.hideProxyImage();
|
|
19637
|
+
this.nextUnclickable = null;
|
|
19638
|
+
this.unclickable = null;
|
|
19639
|
+
}
|
|
19640
|
+
}, {
|
|
19641
|
+
key: 'createProxyImage',
|
|
19642
|
+
value: function createProxyImage() {
|
|
19643
|
+
var canvas = document.createElement('canvas');
|
|
19644
|
+
var context = canvas.getContext('2d');
|
|
19645
|
+
context.globalAlpha = 0;
|
|
19646
|
+
context.fillRect(0, 0, 1, 1);
|
|
19647
|
+
|
|
19648
|
+
this.proxyImage = document.createElement('img');
|
|
19649
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19650
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19651
|
+
|
|
19652
|
+
Object.assign(this.proxyImage.style, {
|
|
19653
|
+
position: 'absolute',
|
|
19654
|
+
margin: '0'
|
|
19655
|
+
});
|
|
19684
19656
|
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19657
|
+
return this.proxyImage;
|
|
19658
|
+
}
|
|
19659
|
+
}, {
|
|
19660
|
+
key: 'hideProxyImage',
|
|
19661
|
+
value: function hideProxyImage() {
|
|
19662
|
+
Object.assign(this.proxyImage.style, {
|
|
19663
|
+
display: 'none'
|
|
19664
|
+
});
|
|
19665
|
+
}
|
|
19666
|
+
}, {
|
|
19667
|
+
key: 'repositionProxyImage',
|
|
19668
|
+
value: function repositionProxyImage(unclickable) {
|
|
19669
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19670
|
+
|
|
19671
|
+
Object.assign(this.proxyImage.style, {
|
|
19672
|
+
display: 'block',
|
|
19673
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19674
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19675
|
+
width: rect.width + 'px',
|
|
19676
|
+
height: rect.height + 'px'
|
|
19677
|
+
});
|
|
19678
|
+
}
|
|
19679
|
+
}]);
|
|
19694
19680
|
|
|
19695
|
-
|
|
19696
|
-
|
|
19681
|
+
return UnclickableBlotSpec;
|
|
19682
|
+
}(_BlotSpec3.default);
|
|
19697
19683
|
|
|
19698
|
-
|
|
19699
|
-
return UnclickableBlotSpec;
|
|
19700
|
-
}
|
|
19684
|
+
UnclickableBlotSpec$1.default = UnclickableBlotSpec;
|
|
19701
19685
|
|
|
19702
19686
|
var hasRequiredIframeVideoSpec;
|
|
19703
19687
|
|
|
@@ -19709,7 +19693,7 @@ function requireIframeVideoSpec () {
|
|
|
19709
19693
|
value: true
|
|
19710
19694
|
});
|
|
19711
19695
|
|
|
19712
|
-
var _UnclickableBlotSpec2 =
|
|
19696
|
+
var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
|
|
19713
19697
|
|
|
19714
19698
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19715
19699
|
|
|
@@ -19909,7 +19893,7 @@ function requireOptions () {
|
|
|
19909
19893
|
}
|
|
19910
19894
|
});
|
|
19911
19895
|
|
|
19912
|
-
var _ResizeAction =
|
|
19896
|
+
var _ResizeAction = ResizeAction$1;
|
|
19913
19897
|
|
|
19914
19898
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
19915
19899
|
enumerable: true,
|
|
@@ -19936,7 +19920,7 @@ function requireOptions () {
|
|
|
19936
19920
|
}
|
|
19937
19921
|
});
|
|
19938
19922
|
|
|
19939
|
-
var _UnclickableBlotSpec =
|
|
19923
|
+
var _UnclickableBlotSpec = UnclickableBlotSpec$1;
|
|
19940
19924
|
|
|
19941
19925
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19942
19926
|
enumerable: true,
|
|
@@ -19989,7 +19973,11 @@ const QuillEditor = defineComponent({
|
|
|
19989
19973
|
minHeight: {
|
|
19990
19974
|
type: Number,
|
|
19991
19975
|
required: false,
|
|
19992
|
-
default:
|
|
19976
|
+
default: 40,
|
|
19977
|
+
},
|
|
19978
|
+
needBorder: {
|
|
19979
|
+
type: Boolean,
|
|
19980
|
+
default: true,
|
|
19993
19981
|
},
|
|
19994
19982
|
theme: {
|
|
19995
19983
|
type: String,
|
|
@@ -20052,6 +20040,11 @@ const QuillEditor = defineComponent({
|
|
|
20052
20040
|
let quill;
|
|
20053
20041
|
let options;
|
|
20054
20042
|
const editor = ref();
|
|
20043
|
+
const editorStyleFilter = computed(() => {
|
|
20044
|
+
return {
|
|
20045
|
+
minHeight: `${props.minHeight}px`,
|
|
20046
|
+
};
|
|
20047
|
+
});
|
|
20055
20048
|
// Register Module if not already registered
|
|
20056
20049
|
const registerModule = (moduleName, module) => {
|
|
20057
20050
|
// For Quill 1.x, we can't check if module is already registered
|
|
@@ -20325,12 +20318,13 @@ const QuillEditor = defineComponent({
|
|
|
20325
20318
|
getText,
|
|
20326
20319
|
setText,
|
|
20327
20320
|
reinit,
|
|
20321
|
+
editorStyleFilter,
|
|
20328
20322
|
};
|
|
20329
20323
|
},
|
|
20330
20324
|
render() {
|
|
20331
20325
|
var _a, _b;
|
|
20332
20326
|
return [
|
|
20333
|
-
h('div', { class:
|
|
20327
|
+
h('div', { class: `quill-editor-container ${this.$props.needBorder ? 'need-border' : ''}`, style: this.editorStyleFilter }, [
|
|
20334
20328
|
(_b = (_a = this.$slots).toolbar) === null || _b === void 0 ? void 0 : _b.call(_a),
|
|
20335
20329
|
h('div', { ref: 'editor', ...this.$attrs }),
|
|
20336
20330
|
]),
|