pxx-vue-quill 1.0.77 → 1.0.78

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-05T07:41:50.281Z
10
+ * Date: 2025-09-05T09:23:42.868Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -18556,52 +18556,44 @@
18556
18556
 
18557
18557
  var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
18558
18558
 
18559
- var Action = {};
18559
+ var Action$1 = {};
18560
18560
 
18561
- var hasRequiredAction;
18562
-
18563
- function requireAction () {
18564
- if (hasRequiredAction) return Action;
18565
- hasRequiredAction = 1;
18566
-
18567
- Object.defineProperty(Action, "__esModule", {
18568
- value: true
18569
- });
18561
+ Object.defineProperty(Action$1, "__esModule", {
18562
+ value: true
18563
+ });
18570
18564
 
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; }; }();
18565
+ 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; }; }();
18572
18566
 
18573
- var _BlotFormatter = requireBlotFormatter();
18567
+ var _BlotFormatter = requireBlotFormatter();
18574
18568
 
18575
- _interopRequireDefault(_BlotFormatter);
18569
+ _interopRequireDefault(_BlotFormatter);
18576
18570
 
18577
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18571
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18578
18572
 
18579
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18573
+ function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18580
18574
 
18581
- var Action$1 = function () {
18582
- function Action(formatter) {
18583
- _classCallCheck(this, Action);
18575
+ var Action = function () {
18576
+ function Action(formatter) {
18577
+ _classCallCheck$1(this, Action);
18584
18578
 
18585
- this.formatter = formatter;
18586
- }
18579
+ this.formatter = formatter;
18580
+ }
18587
18581
 
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
- }]);
18582
+ _createClass$1(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
+ }]);
18598
18592
 
18599
- return Action;
18600
- }();
18593
+ return Action;
18594
+ }();
18601
18595
 
18602
- Action.default = Action$1;
18603
- return Action;
18604
- }
18596
+ Action$1.default = Action;
18605
18597
 
18606
18598
  var hasRequiredBlotFormatter;
18607
18599
 
@@ -18623,7 +18615,7 @@
18623
18615
 
18624
18616
  var _Options2 = _interopRequireDefault(_Options);
18625
18617
 
18626
- var _Action = requireAction();
18618
+ var _Action = Action$1;
18627
18619
 
18628
18620
  _interopRequireDefault(_Action);
18629
18621
 
@@ -19062,7 +19054,7 @@
19062
19054
 
19063
19055
  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; }; }();
19064
19056
 
19065
- var _Action2 = requireAction();
19057
+ var _Action2 = Action$1;
19066
19058
 
19067
19059
  var _Action3 = _interopRequireDefault(_Action2);
19068
19060
 
@@ -19141,7 +19133,7 @@
19141
19133
 
19142
19134
  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; }; }();
19143
19135
 
19144
- var _Action2 = requireAction();
19136
+ var _Action2 = Action$1;
19145
19137
 
19146
19138
  var _Action3 = _interopRequireDefault(_Action2);
19147
19139
 
@@ -19330,7 +19322,7 @@
19330
19322
 
19331
19323
  var _quill2 = _interopRequireDefault(_quill);
19332
19324
 
19333
- var _Action2 = requireAction();
19325
+ var _Action2 = Action$1;
19334
19326
 
19335
19327
  var _Action3 = _interopRequireDefault(_Action2);
19336
19328
 
@@ -19409,7 +19401,7 @@
19409
19401
 
19410
19402
  _interopRequireDefault(_BlotFormatter);
19411
19403
 
19412
- var _Action = requireAction();
19404
+ var _Action = Action$1;
19413
19405
 
19414
19406
  _interopRequireDefault(_Action);
19415
19407
 
@@ -19865,7 +19857,7 @@
19865
19857
  }
19866
19858
  });
19867
19859
 
19868
- var _Action = requireAction();
19860
+ var _Action = Action$1;
19869
19861
 
19870
19862
  Object.defineProperty(exports, 'Action', {
19871
19863
  enumerable: true,
@@ -20157,10 +20149,6 @@
20157
20149
  type: Object,
20158
20150
  required: false,
20159
20151
  },
20160
- enableImageResize: {
20161
- type: Boolean,
20162
- default: true,
20163
- },
20164
20152
  },
20165
20153
  emits: [
20166
20154
  'textChange',
@@ -20182,8 +20170,6 @@
20182
20170
  document.addEventListener('keyup', handleGlobalKeyup, true);
20183
20171
  });
20184
20172
  const removeQuillBlotFormatter = () => {
20185
- if (!props.enableImageResize)
20186
- return;
20187
20173
  try {
20188
20174
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20189
20175
  if (blotFormatter && blotFormatter.overlay) {
@@ -20200,8 +20186,6 @@
20200
20186
  const handleGlobalClick = (event) => {
20201
20187
  if (!editor.value)
20202
20188
  return;
20203
- if (!props.enableImageResize)
20204
- return;
20205
20189
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20206
20190
  if (!blotFormatter || !blotFormatter.overlay)
20207
20191
  return;
@@ -20211,8 +20195,6 @@
20211
20195
  }
20212
20196
  };
20213
20197
  const handleGlobalKeyup = (event) => {
20214
- if (!props.enableImageResize)
20215
- return;
20216
20198
  if (event.keyCode !== 46 && event.keyCode !== 8)
20217
20199
  return;
20218
20200
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
@@ -20273,6 +20255,20 @@
20273
20255
  }
20274
20256
  }
20275
20257
  };
20258
+ const applyImageStyle = () => {
20259
+ var _a;
20260
+ if (quill) {
20261
+ const editorElement = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.querySelector('.ql-editor');
20262
+ if (editorElement) {
20263
+ const images = editorElement.querySelectorAll('img');
20264
+ images.forEach(img => {
20265
+ img.style.maxWidth = '100%';
20266
+ img.style.height = 'auto';
20267
+ img.style.objectFit = 'contain';
20268
+ });
20269
+ }
20270
+ }
20271
+ };
20276
20272
  const registerModule = (moduleName, module) => {
20277
20273
  Quill.register(moduleName, module);
20278
20274
  };
@@ -20297,9 +20293,7 @@
20297
20293
  icons['math'] = mathSVG;
20298
20294
  icons['image'] = imageSVG;
20299
20295
  options = composeOptions();
20300
- if (props.enableImageResize) {
20301
- registerModule('modules/blotFormatter', BlotFormatter);
20302
- }
20296
+ registerModule('modules/blotFormatter', BlotFormatter);
20303
20297
  quill = new Quill(editor.value, options);
20304
20298
  setContents(props.content);
20305
20299
  quill.on('text-change', handleTextChange);
@@ -20361,15 +20355,13 @@
20361
20355
  },
20362
20356
  };
20363
20357
  }
20364
- if (props.enableImageResize) {
20365
- clientOptions.modules = Object.assign({}, clientOptions.modules, {
20366
- blotFormatter: {
20367
- keyboard: {
20368
- enabled: false
20369
- }
20358
+ clientOptions.modules = Object.assign({}, clientOptions.modules, {
20359
+ blotFormatter: {
20360
+ keyboard: {
20361
+ enabled: false
20370
20362
  }
20371
- });
20372
- }
20363
+ }
20364
+ });
20373
20365
  return Object.assign({}, props.globalOptions, props.options, clientOptions);
20374
20366
  };
20375
20367
  const maybeClone = (delta) => {
@@ -20404,6 +20396,9 @@
20404
20396
  if (!internalModelEquals(props.content)) {
20405
20397
  ctx.emit('update:content', internalModel);
20406
20398
  }
20399
+ vue.nextTick(() => {
20400
+ applyImageStyle();
20401
+ });
20407
20402
  ctx.emit('textChange', { delta, oldContents, source });
20408
20403
  };
20409
20404
  const observeTooltip = () => {