pxx-vue-quill 1.0.126 → 1.0.128
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 +71 -33
- 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-
|
|
10
|
+
* Date: 2025-09-10T08:01:55.927Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18650,8 +18650,8 @@
|
|
|
18650
18650
|
}, [
|
|
18651
18651
|
vue.h('input', {
|
|
18652
18652
|
type: 'text',
|
|
18653
|
-
class: 'custom-link-input',
|
|
18654
18653
|
value: localLinkUrl.value,
|
|
18654
|
+
class: 'custom-link-input',
|
|
18655
18655
|
placeholder: '请输入链接',
|
|
18656
18656
|
onInput: (e) => {
|
|
18657
18657
|
localLinkUrl.value = e.target.value;
|
|
@@ -20190,7 +20190,7 @@
|
|
|
20190
20190
|
console.warn('移除blotFormatter overlay时出错:', error);
|
|
20191
20191
|
}
|
|
20192
20192
|
};
|
|
20193
|
-
const
|
|
20193
|
+
const handleBlotFormatterClick = (event) => {
|
|
20194
20194
|
var _a;
|
|
20195
20195
|
if (!editor.value)
|
|
20196
20196
|
return;
|
|
@@ -20245,32 +20245,18 @@
|
|
|
20245
20245
|
}
|
|
20246
20246
|
};
|
|
20247
20247
|
const registerBlotFormatter = () => {
|
|
20248
|
-
|
|
20248
|
+
console.log("enableImageResize", enableImageResize);
|
|
20249
20249
|
if (!enableImageResize) {
|
|
20250
20250
|
return;
|
|
20251
20251
|
}
|
|
20252
20252
|
try {
|
|
20253
|
-
|
|
20254
|
-
Quill.register('modules/blotFormatter', BlotFormatter);
|
|
20255
|
-
}
|
|
20253
|
+
Quill.register('modules/blotFormatter', BlotFormatter);
|
|
20256
20254
|
}
|
|
20257
20255
|
catch (error) {
|
|
20258
20256
|
console.warn('注册BlotFormatter模块时出错:', error);
|
|
20259
20257
|
}
|
|
20260
20258
|
};
|
|
20261
|
-
const getBlotFormatterConfig = () => {
|
|
20262
|
-
if (!enableImageResize) {
|
|
20263
|
-
return {};
|
|
20264
|
-
}
|
|
20265
|
-
return {
|
|
20266
|
-
blotFormatter: {}
|
|
20267
|
-
};
|
|
20268
|
-
};
|
|
20269
|
-
vue.onMounted(() => {
|
|
20270
|
-
window.addEventListener('click', handleGlobalClick, true);
|
|
20271
|
-
});
|
|
20272
20259
|
vue.onBeforeUnmount(() => {
|
|
20273
|
-
window.removeEventListener('click', handleGlobalClick, true);
|
|
20274
20260
|
removeQuillBlotFormatter();
|
|
20275
20261
|
});
|
|
20276
20262
|
const setQuill = (quillInstance) => {
|
|
@@ -20279,12 +20265,10 @@
|
|
|
20279
20265
|
return {
|
|
20280
20266
|
quillRef,
|
|
20281
20267
|
setQuill,
|
|
20282
|
-
|
|
20283
|
-
handleGlobalClick,
|
|
20268
|
+
handleBlotFormatterClick,
|
|
20284
20269
|
configureBlotFormatter,
|
|
20285
20270
|
applyImageStyle,
|
|
20286
|
-
registerBlotFormatter
|
|
20287
|
-
getBlotFormatterConfig
|
|
20271
|
+
registerBlotFormatter
|
|
20288
20272
|
};
|
|
20289
20273
|
}
|
|
20290
20274
|
|
|
@@ -20346,6 +20330,41 @@
|
|
|
20346
20330
|
};
|
|
20347
20331
|
}
|
|
20348
20332
|
|
|
20333
|
+
function useGlobalClick() {
|
|
20334
|
+
const clickHandlers = vue.ref([]);
|
|
20335
|
+
const handleGlobalClick = (event) => {
|
|
20336
|
+
console.log('handleGlobalClick');
|
|
20337
|
+
clickHandlers.value.forEach(handler => {
|
|
20338
|
+
try {
|
|
20339
|
+
handler(event);
|
|
20340
|
+
}
|
|
20341
|
+
catch (error) {
|
|
20342
|
+
console.warn('全局点击事件处理函数执行出错:', error);
|
|
20343
|
+
}
|
|
20344
|
+
});
|
|
20345
|
+
};
|
|
20346
|
+
const addClickHandler = (handler) => {
|
|
20347
|
+
if (typeof handler === 'function' && !clickHandlers.value.includes(handler)) {
|
|
20348
|
+
clickHandlers.value.push(handler);
|
|
20349
|
+
}
|
|
20350
|
+
};
|
|
20351
|
+
const clearClickHandlers = () => {
|
|
20352
|
+
clickHandlers.value = [];
|
|
20353
|
+
};
|
|
20354
|
+
vue.onMounted(() => {
|
|
20355
|
+
window.addEventListener('click', handleGlobalClick);
|
|
20356
|
+
});
|
|
20357
|
+
vue.onBeforeUnmount(() => {
|
|
20358
|
+
window.removeEventListener('click', handleGlobalClick);
|
|
20359
|
+
clearClickHandlers();
|
|
20360
|
+
});
|
|
20361
|
+
return {
|
|
20362
|
+
addClickHandler,
|
|
20363
|
+
clearClickHandlers,
|
|
20364
|
+
handleGlobalClick
|
|
20365
|
+
};
|
|
20366
|
+
}
|
|
20367
|
+
|
|
20349
20368
|
const boldSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M6.794999938146972,7.7800002288818355L9.045000038146974,7.7800002288818355Q9.855000038146972,7.7800002288818355,10.230000038146972,7.442500128881836Q10.605000038146972,7.105000028881836,10.605000038146972,6.505000128881836Q10.605000038146972,6.114999728881836,10.440000038146973,5.860000628881836Q10.275000138146972,5.6050005288818365,9.929999838146973,5.470000228881836Q9.585000038146973,5.335000028881836,9.045000038146974,5.335000028881836L7.139999938146973,5.335000028881836L7.139999938146973,3.385000228881836L9.045000038146974,3.385000228881836Q10.034999838146973,3.385000228881836,10.852499938146973,3.797500608881836Q11.670000038146974,4.2100000388818355,12.142499938146972,4.922500628881836Q12.614999738146974,5.635000228881836,12.614999738146974,6.505000128881836Q12.614999738146974,7.375000028881836,12.142499938146972,8.042500028881836Q11.670000038146974,8.710000028881836,10.860000138146972,9.070000128881837Q10.050000238146973,9.430000328881835,9.045000038146974,9.430000328881835L6.794999938146972,9.430000328881835L6.794999938146972,7.7800002288818355ZM7.139999938146973,12.550000228881835L9.329999938146972,12.550000228881835Q9.900000138146972,12.550000228881835,10.327499838146974,12.354999528881836Q10.755000138146972,12.159999828881835,10.987500238146973,11.807499928881835Q11.219999838146972,11.454999928881836,11.219999838146972,11.020000428881836Q11.219999838146972,10.600000428881836,10.987500238146973,10.232500028881836Q10.755000138146972,9.864999728881836,10.327499838146974,9.647500028881836Q9.900000138146972,9.430000328881835,9.329999938146972,9.430000328881835L6.975000038146972,9.430000328881835L6.975000038146972,7.7800002288818355L9.329999938146972,7.7800002288818355Q10.349999938146972,7.7800002288818355,11.250000038146972,8.200000328881835Q12.149999638146973,8.620000328881837,12.690000538146972,9.362500228881835Q13.229999538146973,10.104999528881836,13.229999538146973,11.034999828881837Q13.229999538146973,11.949999828881836,12.690000538146972,12.752500528881836Q12.149999638146973,13.555000228881836,11.250000038146972,14.027500228881836Q10.349999938146972,14.500000228881836,9.329999938146972,14.500000228881836L7.139999938146973,14.500000228881836L7.139999938146973,12.550000228881835ZM7.064999938146973,14.500000228881836Q6.284999968146972,14.500000228881836,5.872500058146973,14.095000228881837Q5.460000038146973,13.689999228881836,5.460000038146973,12.895000428881836L5.460000038146973,4.989999728881836Q5.460000038146973,4.195000648881836,5.872500058146973,3.789999958881836Q6.284999968146972,3.385000228881836,7.064999938146973,3.385000228881836L7.469999838146973,3.385000228881836L7.469999838146973,14.500000228881836L7.064999938146973,14.500000228881836Z" fill="#555555" fill-opacity="1"/></g></g></svg>`;
|
|
20350
20369
|
const italicSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M8,3Q7.9015086,3,7.8049095,3.019214718Q7.7083106,3.038429435,7.6173165,3.076120459Q7.5263224,3.11381148,7.4444296,3.16853037Q7.3625371,3.2232492600000002,7.2928932,3.2928932Q7.2232492,3.36253715,7.1685302,3.4444297600000002Q7.1138113999999995,3.52632231,7.0761204,3.61731648Q7.0384293,3.70831072,7.0192146,3.80490965Q6.99999994,3.90150857,7,4Q6.99999994,4.0984913,7.0192146,4.1950902Q7.0384293,4.291689,7.0761204,4.3826833Q7.1138113999999995,4.4736774,7.1685302,4.5555699Q7.2232492,4.6374626,7.2928932,4.7071065999999995Q7.3625371,4.7767504,7.4444296,4.8314693Q7.5263224,4.8861883,7.6173165,4.9238794Q7.7083106,4.9615704,7.8049096,4.9807851Q7.9015086,4.9999999,8,5L9.137146,5L8,13L7,13Q6.90150857,13,6.80490965,13.019215Q6.70831072,13.038429,6.6173164799999995,13.07612Q6.52632231,13.113811,6.44442973,13.16853Q6.36253715,13.223249,6.2928932,13.292892Q6.22324926,13.362536,6.16853037,13.444429Q6.11381148,13.526321,6.076120459,13.617315Q6.038429435,13.708309,6.019214718,13.804909Q6,13.901508,6,14Q6,14.098491,6.019214718,14.195089Q6.038429435,14.291689,6.076120459,14.382683Q6.11381148,14.473677,6.16853037,14.555569Q6.22324926,14.637462,6.2928932,14.707106Q6.36253715,14.77675,6.44442976,14.831469Q6.52632231,14.886187,6.6173164799999995,14.923878Q6.70831072,14.961569,6.80490965,14.980784Q6.90150857,15,7,15L11,15Q11.0984912,15,11.1950898,14.980784Q11.2916889,14.961569,11.382682800000001,14.923878Q11.473677200000001,14.886187,11.5555696,14.831469Q11.6374626,14.77675,11.7071066,14.707106Q11.7767506,14.637462,11.8314691,14.555569Q11.8861876,14.473677,11.9238791,14.382683Q11.9615698,14.291689,11.9807849,14.195089Q12,14.098491,12,14Q12,13.901508,11.9807849,13.804909Q11.9615698,13.708309,11.9238791,13.617315Q11.8861876,13.526321,11.8314691,13.444428Q11.7767506,13.362536,11.7071066,13.292892Q11.6374626,13.223249,11.5555701,13.16853Q11.473677200000001,13.113811,11.382682800000001,13.07612Q11.2916889,13.038429,11.1950903,13.019215Q11.0984912,13,11,13L9.8626451,13L11,5L12,5Q12.0984907,4.9999999,12.1950893,4.9807851Q12.2916884,4.9615703,12.382682800000001,4.9238793Q12.4736767,4.8861883,12.5555696,4.8314693Q12.6374621,4.7767504,12.7071061,4.7071065999999995Q12.776750100000001,4.6374626,12.831468600000001,4.5555699Q12.8861876,4.4736774,12.9238787,4.3826833Q12.9615698,4.291689,12.9807849,4.1950902Q12.999999500000001,4.0984913,13,4Q12.999999500000001,3.90150857,12.980784400000001,3.80490965Q12.9615698,3.70831072,12.9238787,3.61731648Q12.8861876,3.52632231,12.8314691,3.44442973Q12.7767506,3.36253715,12.7071066,3.2928932Q12.6374626,3.2232492600000002,12.5555696,3.16853037Q12.4736767,3.11381148,12.382682800000001,3.076120459Q12.2916884,3.038429435,12.1950898,3.019214718Q12.0984907,3,12,3L8,3Z" fill-rule="evenodd" fill="#555555" fill-opacity="1"/></g></g></svg>`;
|
|
20351
20370
|
const underlineSVG = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><g style="opacity:0;"><rect x="0" y="0" width="18" height="18" rx="0" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M5.000117301940918,14.500022450683593L5.000117301940918,14.500022450683593Q5.000117301940918,14.450777450683594,5.009724660740918,14.402477450683593Q5.019332019940918,14.354177450683594,5.038177530940918,14.308679450683593Q5.057023040940918,14.263182450683594,5.084382488940918,14.222236450683594Q5.111741931940918,14.181290450683594,5.146563901940918,14.146469450683593Q5.181385871940918,14.111646450683594,5.222332181940918,14.084286450683594Q5.263278451940918,14.056927450683594,5.308775541940918,14.038082450683595Q5.354272661940918,14.019237450683594,5.402572121940918,14.009630450683593Q5.450871581940918,14.000022450683593,5.500117301940918,14.000022450683593L12.500117301940918,14.000022450683593Q12.549362201940918,14.000022450683593,12.597661501940918,14.009629450683594Q12.645960801940918,14.019237450683594,12.691457701940918,14.038082450683595Q12.736954701940917,14.056926450683594,12.777901601940918,14.084285450683593Q12.818847701940918,14.111645450683593,12.853670101940917,14.146468450683594Q12.888492101940919,14.181289450683593,12.915851601940918,14.222235450683593Q12.943210601940919,14.263181450683593,12.962056201940918,14.308679450683593Q12.980901701940919,14.354177450683594,12.990509501940917,14.402477450683593Q13.00011680194092,14.450777450683594,13.000117301940918,14.500022450683593L13.000117301940918,14.500022450683593Q13.00011680194092,14.549268450683593,12.990509001940918,14.597566450683594Q12.980901701940919,14.645866450683593,12.962056201940918,14.691363450683594Q12.943210601940919,14.736860450683594,12.915851601940918,14.777807450683595Q12.888492101940919,14.818753450683595,12.853670101940917,14.853575450683593Q12.818847701940918,14.888397450683593,12.777901601940918,14.915756450683594Q12.736954701940917,14.943115450683594,12.691457701940918,14.961960450683593Q12.645960801940918,14.980806450683593,12.597661501940918,14.990413450683594Q12.549362201940918,15.000021450683594,12.500117301940918,15.000022450683593L5.500117301940918,15.000022450683593Q5.450871581940918,15.000021450683594,5.402572121940918,14.990414450683593Q5.354272661940918,14.980806450683593,5.308775541940918,14.961960450683593Q5.263278451940918,14.943115450683594,5.222332161940918,14.915756450683594Q5.181385871940918,14.888397450683593,5.146563901940918,14.853574450683594Q5.111741931940918,14.818752450683593,5.084382488940918,14.777806450683594Q5.057023040940918,14.736860450683594,5.038177530940918,14.691363450683594Q5.019332019940918,14.645866450683593,5.009724660740918,14.597567450683593Q5.000117301940918,14.549268450683593,5.000117301940918,14.500022450683593ZM5.045039176940918,3.548906330683594Q5.045039176940918,3.1015625006835936,5.283039211940918,2.8637809706835937Q5.521039131940918,2.6259994506835938,5.969039081940918,2.6259994506835938L5.997039201940918,2.6259994506835938Q6.445039201940918,2.6259994506835938,6.6830393019409176,2.8637809706835937Q6.921039201940918,3.1015625006835936,6.921039201940918,3.548906330683594L6.921039201940918,9.010000250683593Q6.921039201940918,9.737999950683594,7.180039401940919,10.255999550683594Q7.439039201940918,10.774000150683595,7.908039101940918,11.053999950683593Q8.377039001940918,11.333999650683594,8.993039101940917,11.333999650683594Q9.609039301940918,11.333999650683594,10.085039101940918,11.060999850683594Q10.561039401940917,10.788000150683594,10.820039301940918,10.263000450683593Q11.079039101940918,9.737999950683594,11.079039101940918,9.010000250683593L11.079039101940918,3.548906330683594Q11.079039101940918,3.1015625006835936,11.317039501940918,2.8637809706835937Q11.555039401940917,2.6259994506835938,12.003039401940917,2.6259994506835938L12.031039201940917,2.6259994506835938Q12.479039201940918,2.6259994506835938,12.717039101940918,2.8637809706835937Q12.955039001940918,3.1015625006835936,12.955039001940918,3.548906330683594L12.955039001940918,9.010000250683593Q12.955039001940918,10.144000050683594,12.416039501940919,11.095999750683594Q11.877039901940918,12.048000350683594,10.967039101940918,12.600999850683595Q10.057039301940918,13.154000450683593,8.993039101940917,13.154000450683593Q7.929039001940918,13.154000450683593,7.0190392019409185,12.600999850683595Q6.109039201940918,12.048000350683594,5.577039361940918,11.095999750683594Q5.045039176940918,10.144000050683594,5.045039176940918,9.010000250683593L5.045039176940918,3.548906330683594Z" fill="#555555" fill-opacity="1"/></g></g></svg>`;
|
|
@@ -20445,13 +20464,13 @@
|
|
|
20445
20464
|
const canUseLink = vue.ref(false);
|
|
20446
20465
|
const linkPosition = vue.ref({ top: 0, left: 0 });
|
|
20447
20466
|
const savedRange = vue.ref(null);
|
|
20448
|
-
const {
|
|
20467
|
+
const { addClickHandler } = useGlobalClick();
|
|
20468
|
+
const { setQuill, handleBlotFormatterClick, configureBlotFormatter, applyImageStyle, registerBlotFormatter, } = useBlotFormatter(editor, props.enableImageResize);
|
|
20449
20469
|
const { setQuill: setLinkQuill, setHandleCustomLink, addLinkClickListener } = useLinkClick(editor);
|
|
20450
20470
|
vue.onMounted(() => {
|
|
20451
20471
|
initialize();
|
|
20452
20472
|
});
|
|
20453
20473
|
vue.onBeforeUnmount(() => {
|
|
20454
|
-
removeQuillBlotFormatter();
|
|
20455
20474
|
quill = null;
|
|
20456
20475
|
});
|
|
20457
20476
|
let quill;
|
|
@@ -20571,6 +20590,28 @@
|
|
|
20571
20590
|
quill.on('text-change', updateHistoryState);
|
|
20572
20591
|
quill.on('selection-change', updateHistoryState);
|
|
20573
20592
|
addLinkClickListener();
|
|
20593
|
+
const toolbarClickHandler = (event) => {
|
|
20594
|
+
var _a;
|
|
20595
|
+
const target = event.target;
|
|
20596
|
+
const clickedEditorContainer = target.closest('.quill-editor-container');
|
|
20597
|
+
if (clickedEditorContainer) {
|
|
20598
|
+
const currentEditorContainer = (_a = editor.value) === null || _a === void 0 ? void 0 : _a.closest('.quill-editor-container');
|
|
20599
|
+
if (clickedEditorContainer === currentEditorContainer) {
|
|
20600
|
+
controlToolbarVisible(true);
|
|
20601
|
+
}
|
|
20602
|
+
else {
|
|
20603
|
+
controlToolbarVisible(false);
|
|
20604
|
+
}
|
|
20605
|
+
}
|
|
20606
|
+
else {
|
|
20607
|
+
controlToolbarVisible(false);
|
|
20608
|
+
}
|
|
20609
|
+
};
|
|
20610
|
+
addClickHandler(toolbarClickHandler);
|
|
20611
|
+
addClickHandler(handleBlotFormatterClick);
|
|
20612
|
+
addClickHandler(() => {
|
|
20613
|
+
handleCustomLink(false);
|
|
20614
|
+
});
|
|
20574
20615
|
updateHistoryState();
|
|
20575
20616
|
const toolbarDom = (_a = quill.getModule('toolbar')) === null || _a === void 0 ? void 0 : _a.container;
|
|
20576
20617
|
vue.nextTick(() => {
|
|
@@ -20611,6 +20652,9 @@
|
|
|
20611
20652
|
clientOptions.modules = {
|
|
20612
20653
|
toolbar: "#toolbar-" + props.editorKey,
|
|
20613
20654
|
};
|
|
20655
|
+
if (props.enableImageResize) {
|
|
20656
|
+
clientOptions.modules.blotFormatter = {};
|
|
20657
|
+
}
|
|
20614
20658
|
}
|
|
20615
20659
|
else {
|
|
20616
20660
|
clientOptions.modules = {
|
|
@@ -20648,11 +20692,8 @@
|
|
|
20648
20692
|
},
|
|
20649
20693
|
},
|
|
20650
20694
|
};
|
|
20651
|
-
|
|
20652
|
-
|
|
20653
|
-
const blotFormatterConfig = getBlotFormatterConfig();
|
|
20654
|
-
if (Object.keys(blotFormatterConfig).length > 0) {
|
|
20655
|
-
clientOptions.modules = Object.assign({}, clientOptions.modules, blotFormatterConfig);
|
|
20695
|
+
if (props.enableImageResize) {
|
|
20696
|
+
clientOptions.modules.blotFormatter = {};
|
|
20656
20697
|
}
|
|
20657
20698
|
}
|
|
20658
20699
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
@@ -20718,9 +20759,6 @@
|
|
|
20718
20759
|
if (isEditorFocus.value) {
|
|
20719
20760
|
controlToolbarVisible(true);
|
|
20720
20761
|
}
|
|
20721
|
-
else {
|
|
20722
|
-
controlToolbarVisible(false);
|
|
20723
|
-
}
|
|
20724
20762
|
ctx.emit('selectionChange', { range, oldRange, source });
|
|
20725
20763
|
};
|
|
20726
20764
|
vue.watch(isEditorFocus, (focus) => {
|