pxx-vue-quill 1.0.88 → 1.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-quill.umd.js +350 -307
- package/dist/vue-quill.umd.prod.js +2 -2
- package/package.json +1 -1
package/dist/vue-quill.umd.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2025 Pxx-Team
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2025-09-08T04:
|
|
10
|
+
* Date: 2025-09-08T04:21:54.197Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18556,44 +18556,52 @@
|
|
|
18556
18556
|
|
|
18557
18557
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
|
|
18558
18558
|
|
|
18559
|
-
var Action
|
|
18559
|
+
var Action = {};
|
|
18560
18560
|
|
|
18561
|
-
|
|
18562
|
-
value: true
|
|
18563
|
-
});
|
|
18561
|
+
var hasRequiredAction;
|
|
18564
18562
|
|
|
18565
|
-
|
|
18563
|
+
function requireAction () {
|
|
18564
|
+
if (hasRequiredAction) return Action;
|
|
18565
|
+
hasRequiredAction = 1;
|
|
18566
18566
|
|
|
18567
|
-
|
|
18567
|
+
Object.defineProperty(Action, "__esModule", {
|
|
18568
|
+
value: true
|
|
18569
|
+
});
|
|
18568
18570
|
|
|
18569
|
-
|
|
18571
|
+
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; }; }();
|
|
18570
18572
|
|
|
18571
|
-
|
|
18573
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
18572
18574
|
|
|
18573
|
-
|
|
18575
|
+
_interopRequireDefault(_BlotFormatter);
|
|
18574
18576
|
|
|
18575
|
-
|
|
18576
|
-
function Action(formatter) {
|
|
18577
|
-
_classCallCheck$3(this, Action);
|
|
18577
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18578
18578
|
|
|
18579
|
-
|
|
18580
|
-
}
|
|
18579
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18581
18580
|
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18585
|
-
}, {
|
|
18586
|
-
key: 'onDestroy',
|
|
18587
|
-
value: function onDestroy() {}
|
|
18588
|
-
}, {
|
|
18589
|
-
key: 'onUpdate',
|
|
18590
|
-
value: function onUpdate() {}
|
|
18591
|
-
}]);
|
|
18581
|
+
var Action$1 = function () {
|
|
18582
|
+
function Action(formatter) {
|
|
18583
|
+
_classCallCheck(this, Action);
|
|
18592
18584
|
|
|
18593
|
-
|
|
18594
|
-
|
|
18585
|
+
this.formatter = formatter;
|
|
18586
|
+
}
|
|
18595
18587
|
|
|
18596
|
-
|
|
18588
|
+
_createClass(Action, [{
|
|
18589
|
+
key: 'onCreate',
|
|
18590
|
+
value: function onCreate() {}
|
|
18591
|
+
}, {
|
|
18592
|
+
key: 'onDestroy',
|
|
18593
|
+
value: function onDestroy() {}
|
|
18594
|
+
}, {
|
|
18595
|
+
key: 'onUpdate',
|
|
18596
|
+
value: function onUpdate() {}
|
|
18597
|
+
}]);
|
|
18598
|
+
|
|
18599
|
+
return Action;
|
|
18600
|
+
}();
|
|
18601
|
+
|
|
18602
|
+
Action.default = Action$1;
|
|
18603
|
+
return Action;
|
|
18604
|
+
}
|
|
18597
18605
|
|
|
18598
18606
|
var hasRequiredBlotFormatter;
|
|
18599
18607
|
|
|
@@ -18615,7 +18623,7 @@
|
|
|
18615
18623
|
|
|
18616
18624
|
var _Options2 = _interopRequireDefault(_Options);
|
|
18617
18625
|
|
|
18618
|
-
var _Action =
|
|
18626
|
+
var _Action = requireAction();
|
|
18619
18627
|
|
|
18620
18628
|
_interopRequireDefault(_Action);
|
|
18621
18629
|
|
|
@@ -18773,11 +18781,11 @@
|
|
|
18773
18781
|
value: true
|
|
18774
18782
|
});
|
|
18775
18783
|
|
|
18776
|
-
var _createClass
|
|
18784
|
+
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; }; }();
|
|
18777
18785
|
|
|
18778
18786
|
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; }
|
|
18779
18787
|
|
|
18780
|
-
function _classCallCheck
|
|
18788
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18781
18789
|
|
|
18782
18790
|
var LEFT_ALIGN = 'left';
|
|
18783
18791
|
var CENTER_ALIGN = 'center';
|
|
@@ -18788,7 +18796,7 @@
|
|
|
18788
18796
|
var _this = this,
|
|
18789
18797
|
_alignments;
|
|
18790
18798
|
|
|
18791
|
-
_classCallCheck
|
|
18799
|
+
_classCallCheck(this, DefaultAligner);
|
|
18792
18800
|
|
|
18793
18801
|
this.applyStyle = options.aligner.applyStyle;
|
|
18794
18802
|
this.alignAttribute = options.attribute;
|
|
@@ -18816,7 +18824,7 @@
|
|
|
18816
18824
|
}), _alignments);
|
|
18817
18825
|
}
|
|
18818
18826
|
|
|
18819
|
-
_createClass
|
|
18827
|
+
_createClass(DefaultAligner, [{
|
|
18820
18828
|
key: 'getAlignments',
|
|
18821
18829
|
value: function getAlignments() {
|
|
18822
18830
|
var _this2 = this;
|
|
@@ -19054,7 +19062,7 @@
|
|
|
19054
19062
|
|
|
19055
19063
|
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; }; }();
|
|
19056
19064
|
|
|
19057
|
-
var _Action2 =
|
|
19065
|
+
var _Action2 = requireAction();
|
|
19058
19066
|
|
|
19059
19067
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19060
19068
|
|
|
@@ -19119,182 +19127,190 @@
|
|
|
19119
19127
|
return AlignAction;
|
|
19120
19128
|
}
|
|
19121
19129
|
|
|
19122
|
-
var ResizeAction
|
|
19130
|
+
var ResizeAction = {};
|
|
19123
19131
|
|
|
19124
|
-
|
|
19125
|
-
value: true
|
|
19126
|
-
});
|
|
19132
|
+
var hasRequiredResizeAction;
|
|
19127
19133
|
|
|
19128
|
-
|
|
19134
|
+
function requireResizeAction () {
|
|
19135
|
+
if (hasRequiredResizeAction) return ResizeAction;
|
|
19136
|
+
hasRequiredResizeAction = 1;
|
|
19129
19137
|
|
|
19130
|
-
|
|
19138
|
+
Object.defineProperty(ResizeAction, "__esModule", {
|
|
19139
|
+
value: true
|
|
19140
|
+
});
|
|
19131
19141
|
|
|
19132
|
-
|
|
19142
|
+
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; }; }();
|
|
19133
19143
|
|
|
19134
|
-
|
|
19144
|
+
var _Action2 = requireAction();
|
|
19135
19145
|
|
|
19136
|
-
|
|
19146
|
+
var _Action3 = _interopRequireDefault(_Action2);
|
|
19137
19147
|
|
|
19138
|
-
|
|
19148
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19139
19149
|
|
|
19140
|
-
|
|
19150
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19141
19151
|
|
|
19142
|
-
|
|
19152
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19143
19153
|
|
|
19144
|
-
|
|
19154
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19145
19155
|
|
|
19146
|
-
|
|
19147
|
-
_inherits$1(ResizeAction, _Action);
|
|
19156
|
+
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; }
|
|
19148
19157
|
|
|
19149
|
-
|
|
19150
|
-
_classCallCheck$1(this, ResizeAction);
|
|
19158
|
+
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; }
|
|
19151
19159
|
|
|
19152
|
-
|
|
19160
|
+
var ResizeAction$1 = function (_Action) {
|
|
19161
|
+
_inherits(ResizeAction, _Action);
|
|
19153
19162
|
|
|
19154
|
-
|
|
19155
|
-
|
|
19156
|
-
return;
|
|
19157
|
-
}
|
|
19158
|
-
_this.dragHandle = event.target;
|
|
19159
|
-
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19163
|
+
function ResizeAction(formatter) {
|
|
19164
|
+
_classCallCheck(this, ResizeAction);
|
|
19160
19165
|
|
|
19161
|
-
|
|
19162
|
-
return;
|
|
19163
|
-
}
|
|
19166
|
+
var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
|
|
19164
19167
|
|
|
19165
|
-
|
|
19166
|
-
|
|
19167
|
-
|
|
19168
|
-
|
|
19168
|
+
_this.onMouseDown = function (event) {
|
|
19169
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
19170
|
+
return;
|
|
19171
|
+
}
|
|
19172
|
+
_this.dragHandle = event.target;
|
|
19173
|
+
_this.setCursor(_this.dragHandle.style.cursor);
|
|
19169
19174
|
|
|
19170
|
-
|
|
19175
|
+
if (!_this.formatter.currentSpec) {
|
|
19176
|
+
return;
|
|
19177
|
+
}
|
|
19171
19178
|
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19179
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19180
|
+
if (!target) {
|
|
19181
|
+
return;
|
|
19182
|
+
}
|
|
19175
19183
|
|
|
19176
|
-
|
|
19177
|
-
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19178
|
-
};
|
|
19184
|
+
var rect = target.getBoundingClientRect();
|
|
19179
19185
|
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
}
|
|
19186
|
+
_this.dragStartX = event.clientX;
|
|
19187
|
+
_this.preDragWidth = rect.width;
|
|
19188
|
+
_this.targetRatio = rect.height / rect.width;
|
|
19184
19189
|
|
|
19185
|
-
|
|
19186
|
-
|
|
19187
|
-
|
|
19188
|
-
}
|
|
19190
|
+
document.addEventListener('mousemove', _this.onDrag);
|
|
19191
|
+
document.addEventListener('mouseup', _this.onMouseUp);
|
|
19192
|
+
};
|
|
19189
19193
|
|
|
19190
|
-
|
|
19191
|
-
|
|
19194
|
+
_this.onDrag = function (event) {
|
|
19195
|
+
if (!_this.formatter.currentSpec) {
|
|
19196
|
+
return;
|
|
19197
|
+
}
|
|
19192
19198
|
|
|
19193
|
-
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
}
|
|
19199
|
+
var target = _this.formatter.currentSpec.getTargetElement();
|
|
19200
|
+
if (!target) {
|
|
19201
|
+
return;
|
|
19202
|
+
}
|
|
19198
19203
|
|
|
19199
|
-
|
|
19204
|
+
var deltaX = event.clientX - _this.dragStartX;
|
|
19205
|
+
var newWidth = 0;
|
|
19200
19206
|
|
|
19201
|
-
|
|
19202
|
-
|
|
19207
|
+
if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
|
|
19208
|
+
newWidth = Math.round(_this.preDragWidth - deltaX);
|
|
19209
|
+
} else {
|
|
19210
|
+
newWidth = Math.round(_this.preDragWidth + deltaX);
|
|
19211
|
+
}
|
|
19203
19212
|
|
|
19204
|
-
|
|
19205
|
-
};
|
|
19213
|
+
var newHeight = _this.targetRatio * newWidth;
|
|
19206
19214
|
|
|
19207
|
-
|
|
19208
|
-
|
|
19209
|
-
document.removeEventListener('mousemove', _this.onDrag);
|
|
19210
|
-
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19211
|
-
};
|
|
19215
|
+
target.setAttribute('width', '' + newWidth);
|
|
19216
|
+
target.setAttribute('height', '' + newHeight);
|
|
19212
19217
|
|
|
19213
|
-
|
|
19214
|
-
|
|
19215
|
-
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19216
|
-
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19217
|
-
_this.dragHandle = null;
|
|
19218
|
-
_this.dragStartX = 0;
|
|
19219
|
-
_this.preDragWidth = 0;
|
|
19220
|
-
_this.targetRatio = 0;
|
|
19221
|
-
return _this;
|
|
19222
|
-
}
|
|
19218
|
+
_this.formatter.update();
|
|
19219
|
+
};
|
|
19223
19220
|
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
|
|
19229
|
-
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19230
|
-
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19221
|
+
_this.onMouseUp = function () {
|
|
19222
|
+
_this.setCursor('');
|
|
19223
|
+
document.removeEventListener('mousemove', _this.onDrag);
|
|
19224
|
+
document.removeEventListener('mouseup', _this.onMouseUp);
|
|
19225
|
+
};
|
|
19231
19226
|
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
}
|
|
19243
|
-
}, {
|
|
19244
|
-
key: 'createHandle',
|
|
19245
|
-
value: function createHandle(position, cursor) {
|
|
19246
|
-
var box = document.createElement('div');
|
|
19247
|
-
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19248
|
-
box.setAttribute('data-position', position);
|
|
19249
|
-
box.style.cursor = cursor;
|
|
19250
|
-
|
|
19251
|
-
if (this.formatter.options.resize.handleStyle) {
|
|
19252
|
-
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19253
|
-
}
|
|
19227
|
+
_this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
|
|
19228
|
+
_this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
|
|
19229
|
+
_this.bottomRightHandle = _this.createHandle('bottom-right', 'nwse-resize');
|
|
19230
|
+
_this.bottomLeftHandle = _this.createHandle('bottom-left', 'nesw-resize');
|
|
19231
|
+
_this.dragHandle = null;
|
|
19232
|
+
_this.dragStartX = 0;
|
|
19233
|
+
_this.preDragWidth = 0;
|
|
19234
|
+
_this.targetRatio = 0;
|
|
19235
|
+
return _this;
|
|
19236
|
+
}
|
|
19254
19237
|
|
|
19255
|
-
|
|
19238
|
+
_createClass(ResizeAction, [{
|
|
19239
|
+
key: 'onCreate',
|
|
19240
|
+
value: function onCreate() {
|
|
19241
|
+
this.formatter.overlay.appendChild(this.topLeftHandle);
|
|
19242
|
+
this.formatter.overlay.appendChild(this.topRightHandle);
|
|
19243
|
+
this.formatter.overlay.appendChild(this.bottomRightHandle);
|
|
19244
|
+
this.formatter.overlay.appendChild(this.bottomLeftHandle);
|
|
19256
19245
|
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19271
|
-
|
|
19246
|
+
this.repositionHandles(this.formatter.options.resize.handleStyle);
|
|
19247
|
+
}
|
|
19248
|
+
}, {
|
|
19249
|
+
key: 'onDestroy',
|
|
19250
|
+
value: function onDestroy() {
|
|
19251
|
+
this.setCursor('');
|
|
19252
|
+
this.formatter.overlay.removeChild(this.topLeftHandle);
|
|
19253
|
+
this.formatter.overlay.removeChild(this.topRightHandle);
|
|
19254
|
+
this.formatter.overlay.removeChild(this.bottomRightHandle);
|
|
19255
|
+
this.formatter.overlay.removeChild(this.bottomLeftHandle);
|
|
19256
|
+
}
|
|
19257
|
+
}, {
|
|
19258
|
+
key: 'createHandle',
|
|
19259
|
+
value: function createHandle(position, cursor) {
|
|
19260
|
+
var box = document.createElement('div');
|
|
19261
|
+
box.classList.add(this.formatter.options.resize.handleClassName);
|
|
19262
|
+
box.setAttribute('data-position', position);
|
|
19263
|
+
box.style.cursor = cursor;
|
|
19264
|
+
|
|
19265
|
+
if (this.formatter.options.resize.handleStyle) {
|
|
19266
|
+
Object.assign(box.style, this.formatter.options.resize.handleStyle);
|
|
19267
|
+
}
|
|
19272
19268
|
|
|
19273
|
-
|
|
19274
|
-
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19275
|
-
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19276
|
-
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19277
|
-
}
|
|
19278
|
-
}, {
|
|
19279
|
-
key: 'setCursor',
|
|
19280
|
-
value: function setCursor(value) {
|
|
19281
|
-
if (document.body) {
|
|
19282
|
-
document.body.style.cursor = value;
|
|
19283
|
-
}
|
|
19269
|
+
box.addEventListener('mousedown', this.onMouseDown);
|
|
19284
19270
|
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19271
|
+
return box;
|
|
19272
|
+
}
|
|
19273
|
+
}, {
|
|
19274
|
+
key: 'repositionHandles',
|
|
19275
|
+
value: function repositionHandles(handleStyle) {
|
|
19276
|
+
var handleXOffset = '0px';
|
|
19277
|
+
var handleYOffset = '0px';
|
|
19278
|
+
if (handleStyle) {
|
|
19279
|
+
if (handleStyle.width) {
|
|
19280
|
+
handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
|
|
19281
|
+
}
|
|
19282
|
+
if (handleStyle.height) {
|
|
19283
|
+
handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
|
|
19284
|
+
}
|
|
19285
|
+
}
|
|
19286
|
+
|
|
19287
|
+
Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
|
|
19288
|
+
Object.assign(this.topRightHandle.style, { right: handleXOffset, top: handleYOffset });
|
|
19289
|
+
Object.assign(this.bottomRightHandle.style, { right: handleXOffset, bottom: handleYOffset });
|
|
19290
|
+
Object.assign(this.bottomLeftHandle.style, { left: handleXOffset, bottom: handleYOffset });
|
|
19291
|
+
}
|
|
19292
|
+
}, {
|
|
19293
|
+
key: 'setCursor',
|
|
19294
|
+
value: function setCursor(value) {
|
|
19295
|
+
if (document.body) {
|
|
19296
|
+
document.body.style.cursor = value;
|
|
19297
|
+
}
|
|
19293
19298
|
|
|
19294
|
-
|
|
19295
|
-
|
|
19299
|
+
if (this.formatter.currentSpec) {
|
|
19300
|
+
var target = this.formatter.currentSpec.getOverlayElement();
|
|
19301
|
+
if (target) {
|
|
19302
|
+
target.style.cursor = value;
|
|
19303
|
+
}
|
|
19304
|
+
}
|
|
19305
|
+
}
|
|
19306
|
+
}]);
|
|
19296
19307
|
|
|
19297
|
-
|
|
19308
|
+
return ResizeAction;
|
|
19309
|
+
}(_Action3.default);
|
|
19310
|
+
|
|
19311
|
+
ResizeAction.default = ResizeAction$1;
|
|
19312
|
+
return ResizeAction;
|
|
19313
|
+
}
|
|
19298
19314
|
|
|
19299
19315
|
var DeleteAction = {};
|
|
19300
19316
|
|
|
@@ -19314,7 +19330,7 @@
|
|
|
19314
19330
|
|
|
19315
19331
|
var _quill2 = _interopRequireDefault(_quill);
|
|
19316
19332
|
|
|
19317
|
-
var _Action2 =
|
|
19333
|
+
var _Action2 = requireAction();
|
|
19318
19334
|
|
|
19319
19335
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19320
19336
|
|
|
@@ -19393,7 +19409,7 @@
|
|
|
19393
19409
|
|
|
19394
19410
|
_interopRequireDefault(_BlotFormatter);
|
|
19395
19411
|
|
|
19396
|
-
var _Action =
|
|
19412
|
+
var _Action = requireAction();
|
|
19397
19413
|
|
|
19398
19414
|
_interopRequireDefault(_Action);
|
|
19399
19415
|
|
|
@@ -19401,7 +19417,7 @@
|
|
|
19401
19417
|
|
|
19402
19418
|
var _AlignAction2 = _interopRequireDefault(_AlignAction);
|
|
19403
19419
|
|
|
19404
|
-
var _ResizeAction =
|
|
19420
|
+
var _ResizeAction = requireResizeAction();
|
|
19405
19421
|
|
|
19406
19422
|
var _ResizeAction2 = _interopRequireDefault(_ResizeAction);
|
|
19407
19423
|
|
|
@@ -19533,148 +19549,156 @@
|
|
|
19533
19549
|
|
|
19534
19550
|
var IframeVideoSpec = {};
|
|
19535
19551
|
|
|
19536
|
-
var UnclickableBlotSpec
|
|
19552
|
+
var UnclickableBlotSpec = {};
|
|
19537
19553
|
|
|
19538
|
-
|
|
19539
|
-
value: true
|
|
19540
|
-
});
|
|
19554
|
+
var hasRequiredUnclickableBlotSpec;
|
|
19541
19555
|
|
|
19542
|
-
|
|
19556
|
+
function requireUnclickableBlotSpec () {
|
|
19557
|
+
if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
|
|
19558
|
+
hasRequiredUnclickableBlotSpec = 1;
|
|
19543
19559
|
|
|
19544
|
-
|
|
19560
|
+
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19561
|
+
value: true
|
|
19562
|
+
});
|
|
19545
19563
|
|
|
19546
|
-
|
|
19564
|
+
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; }; }();
|
|
19547
19565
|
|
|
19548
|
-
|
|
19566
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19549
19567
|
|
|
19550
|
-
|
|
19568
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19551
19569
|
|
|
19552
|
-
|
|
19570
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19553
19571
|
|
|
19554
|
-
|
|
19572
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19555
19573
|
|
|
19556
|
-
|
|
19574
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19557
19575
|
|
|
19558
|
-
|
|
19576
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19559
19577
|
|
|
19560
|
-
|
|
19561
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19578
|
+
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; }
|
|
19562
19579
|
|
|
19563
|
-
|
|
19564
|
-
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19580
|
+
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; }
|
|
19565
19581
|
|
|
19566
|
-
|
|
19567
|
-
|
|
19582
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19583
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19568
19584
|
|
|
19569
|
-
|
|
19585
|
+
var UnclickableBlotSpec$1 = function (_BlotSpec) {
|
|
19586
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19570
19587
|
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19574
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19575
|
-
});
|
|
19576
|
-
};
|
|
19588
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19589
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19577
19590
|
|
|
19578
|
-
|
|
19579
|
-
var unclickable = event.target;
|
|
19580
|
-
if (!(unclickable instanceof HTMLElement)) {
|
|
19581
|
-
return;
|
|
19582
|
-
}
|
|
19591
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19583
19592
|
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19593
|
+
_this.onTextChange = function () {
|
|
19594
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19595
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19596
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19597
|
+
});
|
|
19598
|
+
};
|
|
19587
19599
|
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
};
|
|
19600
|
+
_this.onMouseEnter = function (event) {
|
|
19601
|
+
var unclickable = event.target;
|
|
19602
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19603
|
+
return;
|
|
19604
|
+
}
|
|
19594
19605
|
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
return _this;
|
|
19599
|
-
}
|
|
19606
|
+
_this.nextUnclickable = unclickable;
|
|
19607
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19608
|
+
};
|
|
19600
19609
|
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19608
|
-
*/
|
|
19609
|
-
document.body.appendChild(this.createProxyImage());
|
|
19610
|
-
}
|
|
19610
|
+
_this.onProxyImageClick = function () {
|
|
19611
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19612
|
+
_this.nextUnclickable = null;
|
|
19613
|
+
_this.formatter.show(_this);
|
|
19614
|
+
_this.hideProxyImage();
|
|
19615
|
+
};
|
|
19611
19616
|
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
key: 'getTargetElement',
|
|
19618
|
-
value: function getTargetElement() {
|
|
19619
|
-
return this.unclickable;
|
|
19620
|
-
}
|
|
19621
|
-
}, {
|
|
19622
|
-
key: 'getOverlayElement',
|
|
19623
|
-
value: function getOverlayElement() {
|
|
19624
|
-
return this.unclickable;
|
|
19625
|
-
}
|
|
19626
|
-
}, {
|
|
19627
|
-
key: 'onHide',
|
|
19628
|
-
value: function onHide() {
|
|
19629
|
-
this.hideProxyImage();
|
|
19630
|
-
this.nextUnclickable = null;
|
|
19631
|
-
this.unclickable = null;
|
|
19632
|
-
}
|
|
19633
|
-
}, {
|
|
19634
|
-
key: 'createProxyImage',
|
|
19635
|
-
value: function createProxyImage() {
|
|
19636
|
-
var canvas = document.createElement('canvas');
|
|
19637
|
-
var context = canvas.getContext('2d');
|
|
19638
|
-
context.globalAlpha = 0;
|
|
19639
|
-
context.fillRect(0, 0, 1, 1);
|
|
19640
|
-
|
|
19641
|
-
this.proxyImage = document.createElement('img');
|
|
19642
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19643
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19644
|
-
|
|
19645
|
-
Object.assign(this.proxyImage.style, {
|
|
19646
|
-
position: 'absolute',
|
|
19647
|
-
margin: '0'
|
|
19648
|
-
});
|
|
19617
|
+
_this.selector = selector;
|
|
19618
|
+
_this.unclickable = null;
|
|
19619
|
+
_this.nextUnclickable = null;
|
|
19620
|
+
return _this;
|
|
19621
|
+
}
|
|
19649
19622
|
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
key: 'repositionProxyImage',
|
|
19661
|
-
value: function repositionProxyImage(unclickable) {
|
|
19662
|
-
var rect = unclickable.getBoundingClientRect();
|
|
19663
|
-
|
|
19664
|
-
Object.assign(this.proxyImage.style, {
|
|
19665
|
-
display: 'block',
|
|
19666
|
-
left: rect.left + window.pageXOffset + 'px',
|
|
19667
|
-
top: rect.top + window.pageYOffset + 'px',
|
|
19668
|
-
width: rect.width + 'px',
|
|
19669
|
-
height: rect.height + 'px'
|
|
19670
|
-
});
|
|
19671
|
-
}
|
|
19672
|
-
}]);
|
|
19623
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19624
|
+
key: 'init',
|
|
19625
|
+
value: function init() {
|
|
19626
|
+
if (document.body) {
|
|
19627
|
+
/*
|
|
19628
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19629
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19630
|
+
*/
|
|
19631
|
+
document.body.appendChild(this.createProxyImage());
|
|
19632
|
+
}
|
|
19673
19633
|
|
|
19674
|
-
|
|
19675
|
-
|
|
19634
|
+
this.hideProxyImage();
|
|
19635
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19636
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19637
|
+
}
|
|
19638
|
+
}, {
|
|
19639
|
+
key: 'getTargetElement',
|
|
19640
|
+
value: function getTargetElement() {
|
|
19641
|
+
return this.unclickable;
|
|
19642
|
+
}
|
|
19643
|
+
}, {
|
|
19644
|
+
key: 'getOverlayElement',
|
|
19645
|
+
value: function getOverlayElement() {
|
|
19646
|
+
return this.unclickable;
|
|
19647
|
+
}
|
|
19648
|
+
}, {
|
|
19649
|
+
key: 'onHide',
|
|
19650
|
+
value: function onHide() {
|
|
19651
|
+
this.hideProxyImage();
|
|
19652
|
+
this.nextUnclickable = null;
|
|
19653
|
+
this.unclickable = null;
|
|
19654
|
+
}
|
|
19655
|
+
}, {
|
|
19656
|
+
key: 'createProxyImage',
|
|
19657
|
+
value: function createProxyImage() {
|
|
19658
|
+
var canvas = document.createElement('canvas');
|
|
19659
|
+
var context = canvas.getContext('2d');
|
|
19660
|
+
context.globalAlpha = 0;
|
|
19661
|
+
context.fillRect(0, 0, 1, 1);
|
|
19662
|
+
|
|
19663
|
+
this.proxyImage = document.createElement('img');
|
|
19664
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19665
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19666
|
+
|
|
19667
|
+
Object.assign(this.proxyImage.style, {
|
|
19668
|
+
position: 'absolute',
|
|
19669
|
+
margin: '0'
|
|
19670
|
+
});
|
|
19676
19671
|
|
|
19677
|
-
|
|
19672
|
+
return this.proxyImage;
|
|
19673
|
+
}
|
|
19674
|
+
}, {
|
|
19675
|
+
key: 'hideProxyImage',
|
|
19676
|
+
value: function hideProxyImage() {
|
|
19677
|
+
Object.assign(this.proxyImage.style, {
|
|
19678
|
+
display: 'none'
|
|
19679
|
+
});
|
|
19680
|
+
}
|
|
19681
|
+
}, {
|
|
19682
|
+
key: 'repositionProxyImage',
|
|
19683
|
+
value: function repositionProxyImage(unclickable) {
|
|
19684
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19685
|
+
|
|
19686
|
+
Object.assign(this.proxyImage.style, {
|
|
19687
|
+
display: 'block',
|
|
19688
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19689
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19690
|
+
width: rect.width + 'px',
|
|
19691
|
+
height: rect.height + 'px'
|
|
19692
|
+
});
|
|
19693
|
+
}
|
|
19694
|
+
}]);
|
|
19695
|
+
|
|
19696
|
+
return UnclickableBlotSpec;
|
|
19697
|
+
}(_BlotSpec3.default);
|
|
19698
|
+
|
|
19699
|
+
UnclickableBlotSpec.default = UnclickableBlotSpec$1;
|
|
19700
|
+
return UnclickableBlotSpec;
|
|
19701
|
+
}
|
|
19678
19702
|
|
|
19679
19703
|
var hasRequiredIframeVideoSpec;
|
|
19680
19704
|
|
|
@@ -19686,7 +19710,7 @@
|
|
|
19686
19710
|
value: true
|
|
19687
19711
|
});
|
|
19688
19712
|
|
|
19689
|
-
var _UnclickableBlotSpec2 =
|
|
19713
|
+
var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
|
|
19690
19714
|
|
|
19691
19715
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19692
19716
|
|
|
@@ -19841,7 +19865,7 @@
|
|
|
19841
19865
|
}
|
|
19842
19866
|
});
|
|
19843
19867
|
|
|
19844
|
-
var _Action =
|
|
19868
|
+
var _Action = requireAction();
|
|
19845
19869
|
|
|
19846
19870
|
Object.defineProperty(exports, 'Action', {
|
|
19847
19871
|
enumerable: true,
|
|
@@ -19886,7 +19910,7 @@
|
|
|
19886
19910
|
}
|
|
19887
19911
|
});
|
|
19888
19912
|
|
|
19889
|
-
var _ResizeAction =
|
|
19913
|
+
var _ResizeAction = requireResizeAction();
|
|
19890
19914
|
|
|
19891
19915
|
Object.defineProperty(exports, 'ResizeAction', {
|
|
19892
19916
|
enumerable: true,
|
|
@@ -19913,7 +19937,7 @@
|
|
|
19913
19937
|
}
|
|
19914
19938
|
});
|
|
19915
19939
|
|
|
19916
|
-
var _UnclickableBlotSpec =
|
|
19940
|
+
var _UnclickableBlotSpec = requireUnclickableBlotSpec();
|
|
19917
19941
|
|
|
19918
19942
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19919
19943
|
enumerable: true,
|
|
@@ -20264,6 +20288,8 @@
|
|
|
20264
20288
|
var _a, _b;
|
|
20265
20289
|
if (!editor.value)
|
|
20266
20290
|
return;
|
|
20291
|
+
registerModule('modules/blotFormatter', BlotFormatter);
|
|
20292
|
+
options = composeOptions();
|
|
20267
20293
|
quill = new Quill(editor.value, options);
|
|
20268
20294
|
const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
|
|
20269
20295
|
if (toolbar) {
|
|
@@ -20280,9 +20306,6 @@
|
|
|
20280
20306
|
icons['ocr'] = ocrSVG;
|
|
20281
20307
|
icons['math'] = mathSVG;
|
|
20282
20308
|
icons['image'] = imageSVG;
|
|
20283
|
-
options = composeOptions();
|
|
20284
|
-
registerModule('modules/blotFormatter', BlotFormatter);
|
|
20285
|
-
quill = new Quill(editor.value, options);
|
|
20286
20309
|
setContents(props.content);
|
|
20287
20310
|
quill.on('text-change', handleTextChange);
|
|
20288
20311
|
quill.on('selection-change', handleSelectionChange);
|
|
@@ -20301,6 +20324,30 @@
|
|
|
20301
20324
|
applyToolbarStyle();
|
|
20302
20325
|
}
|
|
20303
20326
|
applyEditorStyle();
|
|
20327
|
+
const blotFormatter = quill.getModule('blotFormatter');
|
|
20328
|
+
if (blotFormatter) {
|
|
20329
|
+
const originalShow = blotFormatter.show.bind(blotFormatter);
|
|
20330
|
+
blotFormatter.show = function (spec) {
|
|
20331
|
+
var _a;
|
|
20332
|
+
originalShow(spec);
|
|
20333
|
+
const target = (_a = this.currentSpec) === null || _a === void 0 ? void 0 : _a.getTargetElement();
|
|
20334
|
+
if (target && target.tagName === 'IMG') {
|
|
20335
|
+
target.style.maxWidth = '100%';
|
|
20336
|
+
target.style.height = 'auto';
|
|
20337
|
+
target.style.objectFit = 'contain';
|
|
20338
|
+
const width = target.getAttribute('width');
|
|
20339
|
+
if (width) {
|
|
20340
|
+
const naturalWidth = target.naturalWidth;
|
|
20341
|
+
const naturalHeight = target.naturalHeight;
|
|
20342
|
+
if (naturalWidth && naturalHeight) {
|
|
20343
|
+
const aspectRatio = naturalHeight / naturalWidth;
|
|
20344
|
+
const newHeight = Math.round(parseInt(width) * aspectRatio);
|
|
20345
|
+
target.setAttribute('height', '' + newHeight);
|
|
20346
|
+
}
|
|
20347
|
+
}
|
|
20348
|
+
}
|
|
20349
|
+
};
|
|
20350
|
+
}
|
|
20304
20351
|
ctx.emit('ready', quill);
|
|
20305
20352
|
};
|
|
20306
20353
|
const composeOptions = () => {
|
|
@@ -20344,11 +20391,7 @@
|
|
|
20344
20391
|
};
|
|
20345
20392
|
}
|
|
20346
20393
|
clientOptions.modules = Object.assign({}, clientOptions.modules, {
|
|
20347
|
-
blotFormatter:
|
|
20348
|
-
keyboard: {
|
|
20349
|
-
enabled: false
|
|
20350
|
-
}
|
|
20351
|
-
}
|
|
20394
|
+
blotFormatter: true
|
|
20352
20395
|
});
|
|
20353
20396
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
20354
20397
|
};
|