pxx-vue-quill 1.0.88 → 1.0.90

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.
@@ -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:17:30.651Z
10
+ * Date: 2025-09-08T07:35:12.646Z
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$1 = {};
18559
+ var Action = {};
18560
18560
 
18561
- Object.defineProperty(Action$1, "__esModule", {
18562
- value: true
18563
- });
18561
+ var hasRequiredAction;
18564
18562
 
18565
- var _createClass$3 = 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; }; }();
18563
+ function requireAction () {
18564
+ if (hasRequiredAction) return Action;
18565
+ hasRequiredAction = 1;
18566
18566
 
18567
- var _BlotFormatter$2 = requireBlotFormatter();
18567
+ Object.defineProperty(Action, "__esModule", {
18568
+ value: true
18569
+ });
18568
18570
 
18569
- _interopRequireDefault$2(_BlotFormatter$2);
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
- function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18573
+ var _BlotFormatter = requireBlotFormatter();
18572
18574
 
18573
- function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18575
+ _interopRequireDefault(_BlotFormatter);
18574
18576
 
18575
- var Action = function () {
18576
- function Action(formatter) {
18577
- _classCallCheck$3(this, Action);
18577
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18578
18578
 
18579
- this.formatter = formatter;
18580
- }
18579
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18581
18580
 
18582
- _createClass$3(Action, [{
18583
- key: 'onCreate',
18584
- value: function onCreate() {}
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
- return Action;
18594
- }();
18585
+ this.formatter = formatter;
18586
+ }
18595
18587
 
18596
- Action$1.default = Action;
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 = Action$1;
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$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
+ 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$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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$2(this, DefaultAligner);
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$2(DefaultAligner, [{
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 = Action$1;
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$1 = {};
19130
+ var ResizeAction = {};
19123
19131
 
19124
- Object.defineProperty(ResizeAction$1, "__esModule", {
19125
- value: true
19126
- });
19132
+ var hasRequiredResizeAction;
19127
19133
 
19128
- 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; }; }();
19134
+ function requireResizeAction () {
19135
+ if (hasRequiredResizeAction) return ResizeAction;
19136
+ hasRequiredResizeAction = 1;
19129
19137
 
19130
- var _Action2 = Action$1;
19138
+ Object.defineProperty(ResizeAction, "__esModule", {
19139
+ value: true
19140
+ });
19131
19141
 
19132
- var _Action3 = _interopRequireDefault$1(_Action2);
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
- var _BlotFormatter$1 = requireBlotFormatter();
19144
+ var _Action2 = requireAction();
19135
19145
 
19136
- _interopRequireDefault$1(_BlotFormatter$1);
19146
+ var _Action3 = _interopRequireDefault(_Action2);
19137
19147
 
19138
- function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19148
+ var _BlotFormatter = requireBlotFormatter();
19139
19149
 
19140
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19150
+ _interopRequireDefault(_BlotFormatter);
19141
19151
 
19142
- 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; }
19152
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19143
19153
 
19144
- 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; }
19154
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19145
19155
 
19146
- var ResizeAction = function (_Action) {
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
- function ResizeAction(formatter) {
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
- var _this = _possibleConstructorReturn$1(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
19160
+ var ResizeAction$1 = function (_Action) {
19161
+ _inherits(ResizeAction, _Action);
19153
19162
 
19154
- _this.onMouseDown = function (event) {
19155
- if (!(event.target instanceof HTMLElement)) {
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
- if (!_this.formatter.currentSpec) {
19162
- return;
19163
- }
19166
+ var _this = _possibleConstructorReturn(this, (ResizeAction.__proto__ || Object.getPrototypeOf(ResizeAction)).call(this, formatter));
19164
19167
 
19165
- var target = _this.formatter.currentSpec.getTargetElement();
19166
- if (!target) {
19167
- return;
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
- var rect = target.getBoundingClientRect();
19175
+ if (!_this.formatter.currentSpec) {
19176
+ return;
19177
+ }
19171
19178
 
19172
- _this.dragStartX = event.clientX;
19173
- _this.preDragWidth = rect.width;
19174
- _this.targetRatio = rect.height / rect.width;
19179
+ var target = _this.formatter.currentSpec.getTargetElement();
19180
+ if (!target) {
19181
+ return;
19182
+ }
19175
19183
 
19176
- document.addEventListener('mousemove', _this.onDrag);
19177
- document.addEventListener('mouseup', _this.onMouseUp);
19178
- };
19184
+ var rect = target.getBoundingClientRect();
19179
19185
 
19180
- _this.onDrag = function (event) {
19181
- if (!_this.formatter.currentSpec) {
19182
- return;
19183
- }
19186
+ _this.dragStartX = event.clientX;
19187
+ _this.preDragWidth = rect.width;
19188
+ _this.targetRatio = rect.height / rect.width;
19184
19189
 
19185
- var target = _this.formatter.currentSpec.getTargetElement();
19186
- if (!target) {
19187
- return;
19188
- }
19190
+ document.addEventListener('mousemove', _this.onDrag);
19191
+ document.addEventListener('mouseup', _this.onMouseUp);
19192
+ };
19189
19193
 
19190
- var deltaX = event.clientX - _this.dragStartX;
19191
- var newWidth = 0;
19194
+ _this.onDrag = function (event) {
19195
+ if (!_this.formatter.currentSpec) {
19196
+ return;
19197
+ }
19192
19198
 
19193
- if (_this.dragHandle === _this.topLeftHandle || _this.dragHandle === _this.bottomLeftHandle) {
19194
- newWidth = Math.round(_this.preDragWidth - deltaX);
19195
- } else {
19196
- newWidth = Math.round(_this.preDragWidth + deltaX);
19197
- }
19199
+ var target = _this.formatter.currentSpec.getTargetElement();
19200
+ if (!target) {
19201
+ return;
19202
+ }
19198
19203
 
19199
- var newHeight = _this.targetRatio * newWidth;
19204
+ var deltaX = event.clientX - _this.dragStartX;
19205
+ var newWidth = 0;
19200
19206
 
19201
- target.setAttribute('width', '' + newWidth);
19202
- target.setAttribute('height', '' + newHeight);
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
- _this.formatter.update();
19205
- };
19213
+ var newHeight = _this.targetRatio * newWidth;
19206
19214
 
19207
- _this.onMouseUp = function () {
19208
- _this.setCursor('');
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
- _this.topLeftHandle = _this.createHandle('top-left', 'nwse-resize');
19214
- _this.topRightHandle = _this.createHandle('top-right', 'nesw-resize');
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
- _createClass$1(ResizeAction, [{
19225
- key: 'onCreate',
19226
- value: function onCreate() {
19227
- this.formatter.overlay.appendChild(this.topLeftHandle);
19228
- this.formatter.overlay.appendChild(this.topRightHandle);
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
- this.repositionHandles(this.formatter.options.resize.handleStyle);
19233
- }
19234
- }, {
19235
- key: 'onDestroy',
19236
- value: function onDestroy() {
19237
- this.setCursor('');
19238
- this.formatter.overlay.removeChild(this.topLeftHandle);
19239
- this.formatter.overlay.removeChild(this.topRightHandle);
19240
- this.formatter.overlay.removeChild(this.bottomRightHandle);
19241
- this.formatter.overlay.removeChild(this.bottomLeftHandle);
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
- box.addEventListener('mousedown', this.onMouseDown);
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
- return box;
19258
- }
19259
- }, {
19260
- key: 'repositionHandles',
19261
- value: function repositionHandles(handleStyle) {
19262
- var handleXOffset = '0px';
19263
- var handleYOffset = '0px';
19264
- if (handleStyle) {
19265
- if (handleStyle.width) {
19266
- handleXOffset = -parseFloat(handleStyle.width) / 2 + 'px';
19267
- }
19268
- if (handleStyle.height) {
19269
- handleYOffset = -parseFloat(handleStyle.height) / 2 + 'px';
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
- Object.assign(this.topLeftHandle.style, { left: handleXOffset, top: handleYOffset });
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
- if (this.formatter.currentSpec) {
19286
- var target = this.formatter.currentSpec.getOverlayElement();
19287
- if (target) {
19288
- target.style.cursor = value;
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
- return ResizeAction;
19295
- }(_Action3.default);
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
- ResizeAction$1.default = ResizeAction;
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 = Action$1;
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 = Action$1;
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 = ResizeAction$1;
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$1 = {};
19552
+ var UnclickableBlotSpec = {};
19537
19553
 
19538
- Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
19539
- value: true
19540
- });
19554
+ var hasRequiredUnclickableBlotSpec;
19541
19555
 
19542
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19556
+ function requireUnclickableBlotSpec () {
19557
+ if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
19558
+ hasRequiredUnclickableBlotSpec = 1;
19543
19559
 
19544
- var _BlotSpec2 = requireBlotSpec();
19560
+ Object.defineProperty(UnclickableBlotSpec, "__esModule", {
19561
+ value: true
19562
+ });
19545
19563
 
19546
- var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
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
- var _BlotFormatter = requireBlotFormatter();
19566
+ var _BlotSpec2 = requireBlotSpec();
19549
19567
 
19550
- _interopRequireDefault(_BlotFormatter);
19568
+ var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19551
19569
 
19552
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19570
+ var _BlotFormatter = requireBlotFormatter();
19553
19571
 
19554
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19572
+ _interopRequireDefault(_BlotFormatter);
19555
19573
 
19556
- 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; }
19574
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19557
19575
 
19558
- 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; }
19576
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19559
19577
 
19560
- var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
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
- var UnclickableBlotSpec = function (_BlotSpec) {
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
- function UnclickableBlotSpec(formatter, selector) {
19567
- _classCallCheck(this, UnclickableBlotSpec);
19582
+ var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19583
+ var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19568
19584
 
19569
- var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19585
+ var UnclickableBlotSpec$1 = function (_BlotSpec) {
19586
+ _inherits(UnclickableBlotSpec, _BlotSpec);
19570
19587
 
19571
- _this.onTextChange = function () {
19572
- Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
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
- _this.onMouseEnter = function (event) {
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
- _this.nextUnclickable = unclickable;
19585
- _this.repositionProxyImage(_this.nextUnclickable);
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
- _this.onProxyImageClick = function () {
19589
- _this.unclickable = _this.nextUnclickable;
19590
- _this.nextUnclickable = null;
19591
- _this.formatter.show(_this);
19592
- _this.hideProxyImage();
19593
- };
19600
+ _this.onMouseEnter = function (event) {
19601
+ var unclickable = event.target;
19602
+ if (!(unclickable instanceof HTMLElement)) {
19603
+ return;
19604
+ }
19594
19605
 
19595
- _this.selector = selector;
19596
- _this.unclickable = null;
19597
- _this.nextUnclickable = null;
19598
- return _this;
19599
- }
19606
+ _this.nextUnclickable = unclickable;
19607
+ _this.repositionProxyImage(_this.nextUnclickable);
19608
+ };
19600
19609
 
19601
- _createClass(UnclickableBlotSpec, [{
19602
- key: 'init',
19603
- value: function init() {
19604
- if (document.body) {
19605
- /*
19606
- it's important that this is attached to the body instead of the root quill element.
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
- this.hideProxyImage();
19613
- this.proxyImage.addEventListener('click', this.onProxyImageClick);
19614
- this.formatter.quill.on('text-change', this.onTextChange);
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
- return this.proxyImage;
19651
- }
19652
- }, {
19653
- key: 'hideProxyImage',
19654
- value: function hideProxyImage() {
19655
- Object.assign(this.proxyImage.style, {
19656
- display: 'none'
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
- return UnclickableBlotSpec;
19675
- }(_BlotSpec3.default);
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
- UnclickableBlotSpec$1.default = UnclickableBlotSpec;
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 = UnclickableBlotSpec$1;
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 = Action$1;
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 = ResizeAction$1;
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 = UnclickableBlotSpec$1;
19940
+ var _UnclickableBlotSpec = requireUnclickableBlotSpec();
19917
19941
 
19918
19942
  Object.defineProperty(exports, 'UnclickableBlotSpec', {
19919
19943
  enumerable: true,
@@ -20150,12 +20174,10 @@
20150
20174
  setup: (props, ctx) => {
20151
20175
  vue.onMounted(() => {
20152
20176
  initialize();
20153
- console.log("onMounted handleGlobalClick");
20154
20177
  window.addEventListener('click', handleGlobalClick, true);
20155
20178
  window.addEventListener('keyup', handleGlobalKeyup, true);
20156
20179
  });
20157
20180
  const removeQuillBlotFormatter = () => {
20158
- console.log("removeQuillBlotFormatter");
20159
20181
  try {
20160
20182
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20161
20183
  if (blotFormatter && blotFormatter.overlay) {
@@ -20170,14 +20192,12 @@
20170
20192
  }
20171
20193
  };
20172
20194
  const handleGlobalClick = (event) => {
20173
- console.log("start handleGlobalClick");
20174
20195
  if (!editor.value)
20175
20196
  return;
20176
20197
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20177
20198
  if (!blotFormatter || !blotFormatter.overlay)
20178
20199
  return;
20179
20200
  const isClickInsideEditor = editor.value.contains(event.target);
20180
- console.log("isClickInsideEditor", isClickInsideEditor);
20181
20201
  if (!isClickInsideEditor) {
20182
20202
  removeQuillBlotFormatter();
20183
20203
  }
@@ -20264,6 +20284,8 @@
20264
20284
  var _a, _b;
20265
20285
  if (!editor.value)
20266
20286
  return;
20287
+ registerModule('modules/blotFormatter', BlotFormatter);
20288
+ options = composeOptions();
20267
20289
  quill = new Quill(editor.value, options);
20268
20290
  const toolbar = (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
20269
20291
  if (toolbar) {
@@ -20280,9 +20302,6 @@
20280
20302
  icons['ocr'] = ocrSVG;
20281
20303
  icons['math'] = mathSVG;
20282
20304
  icons['image'] = imageSVG;
20283
- options = composeOptions();
20284
- registerModule('modules/blotFormatter', BlotFormatter);
20285
- quill = new Quill(editor.value, options);
20286
20305
  setContents(props.content);
20287
20306
  quill.on('text-change', handleTextChange);
20288
20307
  quill.on('selection-change', handleSelectionChange);
@@ -20301,6 +20320,30 @@
20301
20320
  applyToolbarStyle();
20302
20321
  }
20303
20322
  applyEditorStyle();
20323
+ const blotFormatter = quill.getModule('blotFormatter');
20324
+ if (blotFormatter) {
20325
+ const originalShow = blotFormatter.show.bind(blotFormatter);
20326
+ blotFormatter.show = function (spec) {
20327
+ var _a;
20328
+ originalShow(spec);
20329
+ const target = (_a = this.currentSpec) === null || _a === void 0 ? void 0 : _a.getTargetElement();
20330
+ if (target && target.tagName === 'IMG') {
20331
+ target.style.maxWidth = '100%';
20332
+ target.style.height = 'auto';
20333
+ target.style.objectFit = 'contain';
20334
+ const width = target.getAttribute('width');
20335
+ if (width) {
20336
+ const naturalWidth = target.naturalWidth;
20337
+ const naturalHeight = target.naturalHeight;
20338
+ if (naturalWidth && naturalHeight) {
20339
+ const aspectRatio = naturalHeight / naturalWidth;
20340
+ const newHeight = Math.round(parseInt(width) * aspectRatio);
20341
+ target.setAttribute('height', '' + newHeight);
20342
+ }
20343
+ }
20344
+ }
20345
+ };
20346
+ }
20304
20347
  ctx.emit('ready', quill);
20305
20348
  };
20306
20349
  const composeOptions = () => {
@@ -20344,11 +20387,7 @@
20344
20387
  };
20345
20388
  }
20346
20389
  clientOptions.modules = Object.assign({}, clientOptions.modules, {
20347
- blotFormatter: {
20348
- keyboard: {
20349
- enabled: false
20350
- }
20351
- }
20390
+ blotFormatter: true
20352
20391
  });
20353
20392
  return Object.assign({}, props.globalOptions, props.options, clientOptions);
20354
20393
  };