pxx-vue-quill 1.0.77 → 1.0.79

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:25:45.618Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -20157,10 +20157,6 @@
20157
20157
  type: Object,
20158
20158
  required: false,
20159
20159
  },
20160
- enableImageResize: {
20161
- type: Boolean,
20162
- default: true,
20163
- },
20164
20160
  },
20165
20161
  emits: [
20166
20162
  'textChange',
@@ -20182,8 +20178,6 @@
20182
20178
  document.addEventListener('keyup', handleGlobalKeyup, true);
20183
20179
  });
20184
20180
  const removeQuillBlotFormatter = () => {
20185
- if (!props.enableImageResize)
20186
- return;
20187
20181
  try {
20188
20182
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20189
20183
  if (blotFormatter && blotFormatter.overlay) {
@@ -20200,8 +20194,6 @@
20200
20194
  const handleGlobalClick = (event) => {
20201
20195
  if (!editor.value)
20202
20196
  return;
20203
- if (!props.enableImageResize)
20204
- return;
20205
20197
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20206
20198
  if (!blotFormatter || !blotFormatter.overlay)
20207
20199
  return;
@@ -20211,8 +20203,6 @@
20211
20203
  }
20212
20204
  };
20213
20205
  const handleGlobalKeyup = (event) => {
20214
- if (!props.enableImageResize)
20215
- return;
20216
20206
  if (event.keyCode !== 46 && event.keyCode !== 8)
20217
20207
  return;
20218
20208
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
@@ -20273,6 +20263,20 @@
20273
20263
  }
20274
20264
  }
20275
20265
  };
20266
+ const applyImageStyle = () => {
20267
+ var _a;
20268
+ if (quill) {
20269
+ const editorElement = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.querySelector('.ql-editor');
20270
+ if (editorElement) {
20271
+ const images = editorElement.querySelectorAll('img');
20272
+ images.forEach(img => {
20273
+ img.style.maxWidth = '100%';
20274
+ img.style.height = 'auto';
20275
+ img.style.objectFit = 'contain';
20276
+ });
20277
+ }
20278
+ }
20279
+ };
20276
20280
  const registerModule = (moduleName, module) => {
20277
20281
  Quill.register(moduleName, module);
20278
20282
  };
@@ -20297,9 +20301,7 @@
20297
20301
  icons['math'] = mathSVG;
20298
20302
  icons['image'] = imageSVG;
20299
20303
  options = composeOptions();
20300
- if (props.enableImageResize) {
20301
- registerModule('modules/blotFormatter', BlotFormatter);
20302
- }
20304
+ registerModule('modules/blotFormatter', BlotFormatter);
20303
20305
  quill = new Quill(editor.value, options);
20304
20306
  setContents(props.content);
20305
20307
  quill.on('text-change', handleTextChange);
@@ -20361,15 +20363,13 @@
20361
20363
  },
20362
20364
  };
20363
20365
  }
20364
- if (props.enableImageResize) {
20365
- clientOptions.modules = Object.assign({}, clientOptions.modules, {
20366
- blotFormatter: {
20367
- keyboard: {
20368
- enabled: false
20369
- }
20366
+ clientOptions.modules = Object.assign({}, clientOptions.modules, {
20367
+ blotFormatter: {
20368
+ keyboard: {
20369
+ enabled: false
20370
20370
  }
20371
- });
20372
- }
20371
+ }
20372
+ });
20373
20373
  return Object.assign({}, props.globalOptions, props.options, clientOptions);
20374
20374
  };
20375
20375
  const maybeClone = (delta) => {
@@ -20404,6 +20404,9 @@
20404
20404
  if (!internalModelEquals(props.content)) {
20405
20405
  ctx.emit('update:content', internalModel);
20406
20406
  }
20407
+ vue.nextTick(() => {
20408
+ applyImageStyle();
20409
+ });
20407
20410
  ctx.emit('textChange', { delta, oldContents, source });
20408
20411
  };
20409
20412
  const observeTooltip = () => {