pxx-vue-quill 1.0.21 → 1.0.22

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-08-26T02:18:21.558Z
10
+ * Date: 2025-08-26T09:46:02.957Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -18571,52 +18571,44 @@
18571
18571
 
18572
18572
  var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
18573
18573
 
18574
- var Action = {};
18574
+ var Action$1 = {};
18575
18575
 
18576
- var hasRequiredAction;
18577
-
18578
- function requireAction () {
18579
- if (hasRequiredAction) return Action;
18580
- hasRequiredAction = 1;
18581
-
18582
- Object.defineProperty(Action, "__esModule", {
18583
- value: true
18584
- });
18576
+ Object.defineProperty(Action$1, "__esModule", {
18577
+ value: true
18578
+ });
18585
18579
 
18586
- 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; }; }();
18580
+ 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; }; }();
18587
18581
 
18588
- var _BlotFormatter = requireBlotFormatter();
18582
+ var _BlotFormatter$1 = requireBlotFormatter();
18589
18583
 
18590
- _interopRequireDefault(_BlotFormatter);
18584
+ _interopRequireDefault$1(_BlotFormatter$1);
18591
18585
 
18592
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18586
+ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18593
18587
 
18594
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18588
+ function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18595
18589
 
18596
- var Action$1 = function () {
18597
- function Action(formatter) {
18598
- _classCallCheck(this, Action);
18590
+ var Action = function () {
18591
+ function Action(formatter) {
18592
+ _classCallCheck$2(this, Action);
18599
18593
 
18600
- this.formatter = formatter;
18601
- }
18594
+ this.formatter = formatter;
18595
+ }
18602
18596
 
18603
- _createClass(Action, [{
18604
- key: 'onCreate',
18605
- value: function onCreate() {}
18606
- }, {
18607
- key: 'onDestroy',
18608
- value: function onDestroy() {}
18609
- }, {
18610
- key: 'onUpdate',
18611
- value: function onUpdate() {}
18612
- }]);
18597
+ _createClass$2(Action, [{
18598
+ key: 'onCreate',
18599
+ value: function onCreate() {}
18600
+ }, {
18601
+ key: 'onDestroy',
18602
+ value: function onDestroy() {}
18603
+ }, {
18604
+ key: 'onUpdate',
18605
+ value: function onUpdate() {}
18606
+ }]);
18613
18607
 
18614
- return Action;
18615
- }();
18608
+ return Action;
18609
+ }();
18616
18610
 
18617
- Action.default = Action$1;
18618
- return Action;
18619
- }
18611
+ Action$1.default = Action;
18620
18612
 
18621
18613
  var hasRequiredBlotFormatter;
18622
18614
 
@@ -18638,7 +18630,7 @@
18638
18630
 
18639
18631
  var _Options2 = _interopRequireDefault(_Options);
18640
18632
 
18641
- var _Action = requireAction();
18633
+ var _Action = Action$1;
18642
18634
 
18643
18635
  _interopRequireDefault(_Action);
18644
18636
 
@@ -19077,7 +19069,7 @@
19077
19069
 
19078
19070
  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; }; }();
19079
19071
 
19080
- var _Action2 = requireAction();
19072
+ var _Action2 = Action$1;
19081
19073
 
19082
19074
  var _Action3 = _interopRequireDefault(_Action2);
19083
19075
 
@@ -19156,7 +19148,7 @@
19156
19148
 
19157
19149
  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; }; }();
19158
19150
 
19159
- var _Action2 = requireAction();
19151
+ var _Action2 = Action$1;
19160
19152
 
19161
19153
  var _Action3 = _interopRequireDefault(_Action2);
19162
19154
 
@@ -19345,7 +19337,7 @@
19345
19337
 
19346
19338
  var _quill2 = _interopRequireDefault(_quill);
19347
19339
 
19348
- var _Action2 = requireAction();
19340
+ var _Action2 = Action$1;
19349
19341
 
19350
19342
  var _Action3 = _interopRequireDefault(_Action2);
19351
19343
 
@@ -19424,7 +19416,7 @@
19424
19416
 
19425
19417
  _interopRequireDefault(_BlotFormatter);
19426
19418
 
19427
- var _Action = requireAction();
19419
+ var _Action = Action$1;
19428
19420
 
19429
19421
  _interopRequireDefault(_Action);
19430
19422
 
@@ -19872,7 +19864,7 @@
19872
19864
  }
19873
19865
  });
19874
19866
 
19875
- var _Action = requireAction();
19867
+ var _Action = Action$1;
19876
19868
 
19877
19869
  Object.defineProperty(exports, 'Action', {
19878
19870
  enumerable: true,
@@ -19967,6 +19959,129 @@
19967
19959
 
19968
19960
  var BlotFormatter = /*@__PURE__*/getDefaultExportFromCjs(dist);
19969
19961
 
19962
+ const MoreToolbar = vue.defineComponent({
19963
+ name: 'MoreToolbar',
19964
+ emits: ['toolClick'],
19965
+ setup(props, { emit }) {
19966
+ const showMoreTools = vue.ref(false);
19967
+ const moreButtonClick = () => {
19968
+ showMoreTools.value = !showMoreTools.value;
19969
+ };
19970
+ return () => vue.h('div', {
19971
+ id: 'toolbar'
19972
+ }, [
19973
+ vue.h('div', {
19974
+ class: {
19975
+ 'short-tools': true,
19976
+ 'collapse': showMoreTools.value
19977
+ }
19978
+ }, [
19979
+ // 第一组:基础格式工具
19980
+ vue.h('span', { class: 'ql-formats' }, [
19981
+ // 粗体按钮
19982
+ vue.h('button', {
19983
+ class: 'ql-bold',
19984
+ type: 'button',
19985
+ }, ''),
19986
+ // 斜体按钮
19987
+ vue.h('button', {
19988
+ class: 'ql-italic',
19989
+ type: 'button'
19990
+ }, ''),
19991
+ // 下划线按钮
19992
+ vue.h('button', {
19993
+ class: 'ql-underline',
19994
+ type: 'button'
19995
+ }, '')
19996
+ ]),
19997
+ // 第二组:颜色选择器
19998
+ vue.h('span', { class: 'ql-formats' }, [
19999
+ vue.h('select', {
20000
+ class: 'ql-color ql-picker ql-color-picker ql-expanded',
20001
+ type: 'button'
20002
+ }, [
20003
+ vue.h('span', { class: 'ql-picker-label' }, ''),
20004
+ vue.h('div', { class: 'ql-picker-options' })
20005
+ ]),
20006
+ ]),
20007
+ // 第三组:链接工具
20008
+ vue.h('span', { class: 'ql-formats' }, [
20009
+ vue.h('button', {
20010
+ class: 'ql-link',
20011
+ type: 'button'
20012
+ }, '')
20013
+ ]),
20014
+ // 第四组:更多按钮
20015
+ vue.h('span', { class: 'ql-formats' }, [
20016
+ vue.h('button', {
20017
+ class: 'ql-more mr-0',
20018
+ type: 'button',
20019
+ onClick: moreButtonClick
20020
+ }, '')
20021
+ ])
20022
+ ]),
20023
+ vue.h('div', {
20024
+ class: {
20025
+ "more-tools": true,
20026
+ "collapse": showMoreTools.value
20027
+ }, style: { display: showMoreTools.value ? 'block' : 'none' }
20028
+ }, [
20029
+ vue.h('div', { class: "more-tools-item" }, [
20030
+ vue.h('span', { class: 'ql-formats' }, [
20031
+ vue.h('button', {
20032
+ class: 'ql-list',
20033
+ value: 'ordered',
20034
+ type: 'button'
20035
+ }, ''),
20036
+ vue.h('button', {
20037
+ class: 'ql-list',
20038
+ value: 'bullet',
20039
+ type: 'button'
20040
+ }, '')
20041
+ ]),
20042
+ // 第二组:图片工具
20043
+ vue.h('span', { class: 'ql-formats' }, [
20044
+ vue.h('button', {
20045
+ class: 'ql-image',
20046
+ type: 'button'
20047
+ }, '')
20048
+ ]),
20049
+ // 第三组:撤销和重做
20050
+ vue.h('span', { class: 'ql-formats' }, [
20051
+ vue.h('button', {
20052
+ class: 'ql-undo',
20053
+ type: 'button',
20054
+ onClick: () => emit('toolClick', 'undo')
20055
+ }, ''),
20056
+ vue.h('button', {
20057
+ class: 'ql-redo',
20058
+ type: 'button',
20059
+ onClick: () => emit('toolClick', 'redo')
20060
+ }, '')
20061
+ ]),
20062
+ // 第四组:数学工具
20063
+ vue.h('span', { class: 'ql-formats' }, [
20064
+ vue.h('button', {
20065
+ class: 'ql-math mr-0',
20066
+ type: 'button',
20067
+ onClick: () => emit('toolClick', 'math')
20068
+ }, '')
20069
+ ])
20070
+ ]),
20071
+ vue.h('div', {}, [
20072
+ vue.h('span', { class: 'ql-formats' }, [
20073
+ vue.h('button', {
20074
+ class: 'ql-ocr',
20075
+ type: 'button',
20076
+ onClick: () => emit('toolClick', 'ocr')
20077
+ }, '')
20078
+ ])
20079
+ ])
20080
+ ])
20081
+ ]);
20082
+ }
20083
+ });
20084
+
19970
20085
  // 加粗
19971
20086
  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>`;
19972
20087
  // 斜体
@@ -19985,112 +20100,28 @@
19985
20100
  const ocrSVG = `<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="M3.0000245140625,2.6000244140625L5.5000243140625,2.6000244140625C5.8313951140625,2.6000244140625,6.1000242140625,2.3313953240625,6.1000242140625,2.0000244340625C6.1000242140625,1.6686535440624999,5.8313951140625,1.4000244140625,5.5000243140625,1.4000244140625L3.0000245140625,1.4000244140625Q2.3372827740625,1.4000244140625,1.8686535940625,1.8686535940625Q1.4000244140625,2.3372827740625,1.4000244140625,3.0000245140625L1.4000244140625,5.5000243140625C1.4000244140625,5.8313951140625,1.6686535440624999,6.1000242140625,2.0000244340625,6.1000242140625C2.3313953240625,6.1000242140625,2.6000244140625,5.8313951140625,2.6000244140625,5.5000243140625L2.6000244140625,3.0000245140625Q2.6000244140625,2.6000244140625,3.0000245140625,2.6000244140625ZM12.5000244140625,1.4000244140625L15.0000244140625,1.4000244140625Q15.6627664140625,1.4000244140625,16.1313954140625,1.8686538940625Q16.6000244140625,2.3372834940625,16.6000244140625,3.0000245140625L16.6000244140625,5.5000243140625C16.6000244140625,5.6591539140625,16.5368104140625,5.8117661140625,16.424288414062502,5.9242883140625C16.3117674140625,6.0368099140625,16.1591544140625,6.1000242140625,16.0000244140625,6.1000242140625C15.6686534140625,6.1000242140625,15.4000244140625,5.8313951140625,15.4000244140625,5.5000243140625L15.4000234140625,3.0000245140625Q15.4000234140625,2.6000244140625,15.0000244140625,2.6000244140625L12.5000244140625,2.6000244140625C12.1686534140625,2.6000244140625,11.9000244140625,2.3313953240625,11.9000244140625,2.0000244340625C11.9000244140625,1.6686535440624999,12.1686534140625,1.4000244140625,12.5000244140625,1.4000244140625ZM8.6239776140625,6.4719930140625C8.5439777140625,6.1512432140625,8.3999777140625,5.7421179140625,8.2479777140625,5.4212432140625L9.4959774140625,5.052368214062501C9.6959782140625,5.4293680140625,9.9199772140625,5.9346180140625,9.9999771140625,6.2714929140625L9.3519778140625,6.4719930140625L12.7119784140625,6.4719930140625L12.7119784140625,7.6079931140625L11.5039774140625,7.6079931140625C11.1279774140625,8.6968679140625,10.6159782140625,9.6014929140625,9.9599781140625,10.3461180140625C10.7599773140625,10.9224930140625,11.7279774140625,11.3468685140625,12.8879774140625,11.6029934140625C12.6239774140625,11.8592434140625,12.2799774140625,12.3716184140625,12.1039784140625,12.6918684140625C10.8719778140625,12.3716184140625,9.8719778140625,11.8752434140625,9.0479779140625,11.2107429140625C8.175977714062501,11.8992434140625,7.1199779140625,12.4036184140625,5.8559775140625,12.7558684140625C5.7279777140625,12.4757434140625,5.3759775140625,11.9312434140625,5.1519775140625,11.6591184140625C6.3759775140625,11.3868685140625,7.3839779140625,10.9706182140625,8.1839781140625,10.3781185140625C7.5199776140625,9.6094932140625,7.0079775140625,8.6888685140625,6.5919776140625,7.6079931140625L5.3279776140625,7.6079931140625L5.3279776140625,6.4719930140625L8.6239776140625,6.4719930140625ZM7.7999778140625,7.6079931140625C8.1119776140625,8.344617814062499,8.5359778140625,9.0011186140625,9.0719776140625,9.5694933140625C9.5439777140625,9.0251179140625,9.9199772140625,8.3766184140625,10.1919784140625,7.6079931140625L7.7999778140625,7.6079931140625ZM2.6000244140625,12.5000244140625L2.6000244140625,15.0000244140625Q2.6000244140625,15.4000234140625,3.0000245140625,15.4000234140625L5.5000243140625,15.4000234140625C5.8313951140625,15.4000244140625,6.1000242140625,15.6686534140625,6.1000242140625,16.0000244140625C6.1000242140625,16.3313964140625,5.8313951140625,16.6000254140625,5.5000243140625,16.6000254140625L5.4989548140625,16.6000244140625L3.0000245140625,16.6000244140625Q2.3372834940625,16.6000244140625,1.8686538940625,16.1313954140625Q1.4000244140625,15.6627664140625,1.4000244140625,15.0000244140625L1.4000244140625,12.5000244140625C1.4000244140625,12.1686534140625,1.6686535440624999,11.9000244140625,2.0000244340625,11.9000244140625C2.3313953240625,11.9000244140625,2.6000244140625,12.1686534140625,2.6000244140625,12.5000244140625ZM16.6000244140625,12.5010944140625L16.6000244140625,15.0000244140625Q16.6000244140625,15.6627654140625,16.1313954140625,16.1313954140625Q15.6627654140625,16.6000244140625,15.0000244140625,16.6000244140625L12.5000244140625,16.6000244140625C12.3408944140625,16.6000244140625,12.1882824140625,16.5368104140625,12.0757594140625,16.424288414062502C11.9632384140625,16.3117664140625,11.9000244140625,16.1591544140625,11.9000244140625,16.0000244140625C11.9000244140625,15.6686534140625,12.1686534140625,15.4000244140625,12.5000244140625,15.4000244140625L15.0000244140625,15.4000234140625Q15.4000234140625,15.4000234140625,15.4000234140625,15.0000244140625L15.4000234140625,12.5000244140625C15.4000244140625,12.1686534140625,15.6686534140625,11.9000244140625,16.0000244140625,11.9000244140625C16.3313964140625,11.9000244140625,16.6000254140625,12.1686534140625,16.6000254140625,12.5000244140625L16.6000244140625,12.5010944140625Z" fill-rule="evenodd" fill="#555555" fill-opacity="1"/></g></g></svg>`;
19986
20101
  // 数学公式
19987
20102
  const mathSVG = `<svg t="1756107836493" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10608" width="18" height="18"><path d="M877.454222 856.177778q4.835556-4.835556 7.395556-11.093334 2.616889-6.257778 2.616889-13.084444 0-3.413333-0.625778-6.656-0.682667-3.299556-1.991111-6.428444-1.251556-3.072-3.128889-5.859556-1.877333-2.844444-4.266667-5.176889-2.332444-2.389333-5.12-4.266667-2.844444-1.877333-5.916444-3.128888-3.128889-1.308444-6.428445-1.934223-3.299556-0.682667-6.656-0.682666-6.826667 0-13.084444 2.616889-6.257778 2.56-11.036445 7.395555l-54.044444 53.987556H253.155556l325.688888-325.745778q2.389333-2.389333 4.266667-5.12 1.877333-2.844444 3.128889-5.916445 1.308444-3.128889 1.934222-6.428444 0.682667-3.299556 0.682667-6.656 0-3.413333-0.682667-6.656-0.625778-3.299556-1.934222-6.428444-1.251556-3.072-3.128889-5.859556-1.877333-2.844444-4.266667-5.176889L253.155556 162.133333h522.126222l53.930666 53.987556q4.835556 4.835556 11.093334 7.395555 6.257778 2.616889 13.084444 2.616889 3.413333 0 6.656-0.682666 3.299556-0.625778 6.428445-1.934223 3.072-1.251556 5.859555-3.128888 2.844444-1.877333 5.176889-4.266667 2.389333-2.389333 4.266667-5.12 1.877333-2.844444 3.128889-5.916445 1.308444-3.128889 1.934222-6.428444 0.682667-3.299556 0.682667-6.656 0-6.826667-2.616889-13.084444-2.56-6.257778-7.395556-11.036445l-64-64q-4.778667-4.835556-11.036444-7.395555-6.257778-2.616889-13.084445-2.616889H170.666667q-6.826667 0-13.084445 2.616889-6.257778 2.56-11.036444 7.395555-2.389333 2.389333-4.266667 5.12-1.877333 2.844444-3.128889 5.916445-1.308444 3.128889-1.934222 6.428444-0.682667 3.299556-0.682667 6.656 0 3.413333 0.682667 6.656 0.625778 3.299556 1.934222 6.428444 1.251556 3.072 3.128889 5.859556 1.877333 2.844444 4.266667 5.176889L506.311111 512l-359.822222 359.879111q-4.835556 4.778667-7.395556 11.036445-2.616889 6.257778-2.616889 13.084444 0 3.413333 0.682667 6.656 0.625778 3.299556 1.934222 6.428444 1.251556 3.072 3.128889 5.859556 1.877333 2.844444 4.266667 5.176889 2.389333 2.389333 5.12 4.266667 2.844444 1.877333 5.916444 3.128888 3.128889 1.308444 6.428445 1.991112 3.299556 0.625778 6.656 0.625777h618.666666q6.826667 0 13.084445-2.616889 6.257778-2.56 11.036444-7.395555l64-63.943111z" p-id="10609" fill="#555555"></path></svg>`;
19988
- // 无序列表
19989
- const listBulletSVG = `<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>`;
19990
- // 有序列表
19991
- const listOrderedSVG = `<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>`;
19992
20103
  // 图片
19993
20104
  const imageSVG = `<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="M1.87471507,3.83578219Q1.5,4.18540478,1.5,4.6875L1.5,14.312503Q1.50000006,14.814598,1.874716,15.16422Q2.23459671,15.5,2.73684216,15.5L15.263157,15.5Q15.765403,15.5,16.125284,15.164218Q16.499999000000003,14.814597,16.499999000000003,14.312501L16.499999000000003,4.6875Q16.499999000000003,4.18540342,16.125284999999998,3.83578214Q15.765404,3.5,15.263157,3.5L2.73684216,3.5Q2.23459646,3.5,1.87471507,3.83578219ZM2.5,14.312503L2.5,4.6875Q2.5,4.5,2.73684216,4.5L15.263157,4.5Q15.5,4.5,15.5,4.6875L15.5,14.312501Q15.5,14.5,15.263157,14.5L2.73684216,14.5Q2.5,14.5,2.5,14.312503Z" fill-rule="evenodd" fill="#555555" fill-opacity="1" style="mix-blend-mode:passthrough"/></g><g><ellipse cx="5.4375" cy="7.4375" rx="0.4375" ry="0.4375" fill-opacity="0" stroke-opacity="1" stroke="#555555" fill="none" stroke-width="1" stroke-linecap="ROUND" stroke-linejoin="round" style="mix-blend-mode:passthrough"/></g><g><path d="M5.9053998,9.924615948146972L1.7143693,12.841608238146973Q1.61364189,12.911715538146973,1.55682093,13.020492338146973Q1.5,13.129269138146974,1.5,13.251992238146972L1.50000003,14.418008338146972Q1.50000003,14.876594038146973,1.84130602,15.195924738146973Q2.16843581,15.501991738146973,2.62437022,15.501991738146973L15.375628,15.501991738146973Q15.831564,15.501991738146973,16.158693,15.195924738146973Q16.5,14.876594038146973,16.5,14.418007838146973L16.5,13.251992238146972Q16.500000999999997,13.186988838146974,16.48338,13.124146438146973Q16.466759,13.061303638146972,16.434621,13.004799838146972Q16.402485,12.948296338146973,16.356969,12.901887938146972Q16.311453,12.855479738146972,16.255583,12.822251838146972L9.8796926,9.030259398146972Q9.842938400000001,9.008400078146973,9.8030057,8.993099628146974Q9.763073,8.977799118146972,9.721121799999999,8.969501908146972Q9.6791716,8.961204618146972,9.6364217,8.960151608146973Q9.5936708,8.959098578146973,9.551362000000001,8.965320438146973Q9.5090542,8.971542238146972,9.4684162,8.984858218146973Q9.427778199999999,8.998174158146973,9.3899918,9.018197478146973Q9.352206200000001,9.038220708146973,9.3183689,9.064369648146972Q9.284532500000001,9.090518598146973,9.2556267,9.122033748146972L7.6887164,10.830422738146973L6.4904227,9.934544588146972Q6.4273362,9.887379288146972,6.3528042,9.861893948146973Q6.2782726,9.836408678146972,6.1995153,9.835072038146972Q6.1207581,9.833735408146973,6.045404,9.856676968146973Q5.9700503000000005,9.879618528146972,5.9053998,9.924615948146972ZM2.5,13.513173138146973L2.50000006,14.418008338146972Q2.50000006,14.501992238146972,2.62437022,14.501992238146972L15.375628,14.501992238146972Q15.5,14.501992238146972,15.5,14.418007838146973L15.5,13.536368338146973L9.7178593,10.097503488146973L8.1200023,11.839632738146973Q8.0888524,11.873595438146973,8.052019600000001,11.901292338146973Q8.0151863,11.928988938146972,7.9739118,11.949486538146973Q7.9326363,11.969984038146972,7.88831,11.982591638146973Q7.8439837,11.995199238146974,7.7980995,11.999492138146973Q7.7522154,12.003785338146972,7.7063198,11.999619238146973Q7.6604242,11.995453338146973,7.6160631,11.982968338146973Q7.571702,11.970483338146973,7.5303702,11.950099938146973Q7.4890385,11.929716538146973,7.4521289,11.902122038146972L6.1805682,10.951467238146973L2.5,13.513173138146973Z" fill-rule="evenodd" fill="#555555" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></svg>`;
19994
20105
 
19995
- const MoreTools = vue.defineComponent({
19996
- name: 'MoreTools',
19997
- props: {
19998
- // 传入toolbar的自定义style
19999
- toolbarStyle: {
20000
- type: Object,
20001
- required: false,
20002
- default: () => ({})
20003
- },
20004
- needCollapse: {
20005
- type: Boolean,
20006
- default: false
20007
- },
20008
- onToolClick: {
20009
- type: Function,
20010
- required: true
20011
- }
20012
- },
20013
- setup(props) {
20014
- // 渲染工具按钮
20015
- const renderToolButton = (tool) => {
20016
- if (typeof tool === 'string') {
20017
- // 根据工具名称获取对应的SVG图标
20018
- let iconSVG = '';
20019
- switch (tool) {
20020
- case 'image':
20021
- iconSVG = imageSVG;
20022
- break;
20023
- case 'undo':
20024
- iconSVG = undoSVG;
20025
- break;
20026
- case 'redo':
20027
- iconSVG = redoSVG;
20028
- break;
20029
- case 'ocr':
20030
- iconSVG = ocrSVG;
20031
- break;
20032
- case 'math':
20033
- iconSVG = mathSVG;
20034
- break;
20035
- default:
20036
- iconSVG = '';
20037
- }
20038
- return vue.h('button', {
20039
- class: `ql-${tool}`,
20040
- type: 'button',
20041
- onClick: () => props.onToolClick(tool)
20042
- }, [
20043
- iconSVG ? vue.h('span', { innerHTML: iconSVG }) : null
20044
- ]);
20045
- }
20046
- else if (typeof tool === 'object' && tool !== null) {
20047
- const toolName = Object.keys(tool)[0];
20048
- const toolValue = Object.values(tool)[0];
20049
- let iconSVG = '';
20050
- if (toolName === 'list') {
20051
- iconSVG = toolValue === 'ordered' ? listOrderedSVG : listBulletSVG;
20052
- }
20053
- return vue.h('button', {
20054
- class: `ql-${toolName}`,
20055
- 'data-value': toolValue,
20056
- type: 'button',
20057
- onClick: () => props.onToolClick(`${toolName}-${toolValue}`)
20058
- }, [
20059
- iconSVG ? vue.h('span', { innerHTML: iconSVG }) : null
20060
- ]);
20061
- }
20062
- return null;
20063
- };
20064
- // 渲染工具组
20065
- const renderToolGroup = (tools) => {
20066
- return vue.h('span', {
20067
- class: 'ql-formats'
20068
- }, tools.map(tool => renderToolButton(tool)));
20069
- };
20070
- return () => vue.h('div', {
20071
- class: 'ql-toolbar ql-snow more-tools',
20072
- style: props.toolbarStyle
20073
- }, [
20074
- vue.h('div', {
20075
- class: 'more-tools-item'
20076
- }, [
20077
- // 渲染所有工具组
20078
- ...toolbarOptions.extend.map(toolGroup => renderToolGroup(toolGroup)),
20079
- ]),
20080
- vue.h('div', {}, [
20081
- renderToolGroup(['ocr'])
20082
- ])
20083
- ]);
20084
- }
20085
- });
20086
-
20087
20106
  const QuillEditor = vue.defineComponent({
20088
20107
  name: 'QuillEditor',
20089
20108
  inheritAttrs: false,
20090
20109
  props: {
20110
+ /**
20111
+ * 编辑器内容
20112
+ * 支持多种格式:字符串(HTML)、Delta对象、或undefined/null
20113
+ * 当传入内容时,编辑器会显示对应的内容
20114
+ */
20091
20115
  content: {
20092
20116
  type: [String, Object],
20093
20117
  },
20118
+ /**
20119
+ * 内容类型
20120
+ * - 'delta': 使用Quill的Delta格式(默认)
20121
+ * - 'html': 使用HTML字符串格式
20122
+ * - 'text': 使用纯文本格式
20123
+ * 影响内容的输入输出格式
20124
+ */
20094
20125
  contentType: {
20095
20126
  type: String,
20096
20127
  default: 'delta',
@@ -20098,28 +20129,41 @@
20098
20129
  return ['delta', 'html', 'text'].includes(value);
20099
20130
  },
20100
20131
  },
20132
+ /**
20133
+ * 是否启用编辑器
20134
+ * true: 编辑器可编辑(默认)
20135
+ * false: 编辑器禁用,不可编辑
20136
+ */
20101
20137
  enable: {
20102
20138
  type: Boolean,
20103
20139
  default: true,
20104
20140
  },
20141
+ /**
20142
+ * 是否只读模式
20143
+ * true: 编辑器只读,不可编辑
20144
+ * false: 编辑器可编辑(默认)
20145
+ * 与enable的区别:readOnly只是禁止编辑,enable是禁用整个编辑器
20146
+ */
20105
20147
  readOnly: {
20106
20148
  type: Boolean,
20107
20149
  default: false,
20108
20150
  },
20151
+ /**
20152
+ * 占位符文本
20153
+ * 当编辑器内容为空时显示的提示文字
20154
+ * 默认显示"请输入内容"
20155
+ */
20109
20156
  placeholder: {
20110
20157
  type: String,
20111
20158
  required: false,
20112
20159
  default: "请输入内容"
20113
20160
  },
20114
- minHeight: {
20115
- type: Number,
20116
- required: false,
20117
- default: 20,
20118
- },
20119
- needBorder: {
20120
- type: Boolean,
20121
- default: false,
20122
- },
20161
+ /**
20162
+ * 工具栏模式
20163
+ * - 'fixed-top': 工具栏固定在顶部,不随内容滚动
20164
+ * - 'embedded': 工具栏嵌入在编辑器中,随内容滚动(默认)
20165
+ * 影响工具栏的定位和滚动行为
20166
+ */
20123
20167
  toolbarMode: {
20124
20168
  type: String,
20125
20169
  default: "embedded",
@@ -20127,22 +20171,45 @@
20127
20171
  return ['fixed-top', 'embedded'].includes(value);
20128
20172
  },
20129
20173
  },
20174
+ /**
20175
+ * 是否需要折叠工具栏
20176
+ * true: 显示折叠工具栏,点击"更多"展开(默认)
20177
+ * false: 显示完整工具栏,不折叠
20178
+ * 影响工具栏的显示方式
20179
+ */
20130
20180
  needCollapse: {
20131
20181
  type: Boolean,
20132
- default: true,
20182
+ default: false,
20133
20183
  },
20134
- // 传入toolbar的自定义style
20184
+ /**
20185
+ * 工具栏自定义样式
20186
+ * 传入CSS样式对象,会应用到工具栏容器上
20187
+ * 例如:{ 'background-color': '#f0f0f0', 'border-radius': '8px' }
20188
+ * 支持所有CSS属性
20189
+ */
20135
20190
  toolbarStyle: {
20136
20191
  type: Object,
20137
20192
  required: false,
20138
20193
  default: () => ({})
20139
20194
  },
20140
- // 编辑器输入内容的自定义style
20195
+ /**
20196
+ * 编辑器内容区域自定义样式
20197
+ * 传入CSS样式对象,会应用到编辑器内容区域(.ql-editor)上
20198
+ * 例如:{ 'font-size': '16px', 'line-height': '1.6' }
20199
+ * 支持所有CSS属性
20200
+ */
20141
20201
  editorStyle: {
20142
20202
  type: Object,
20143
20203
  required: false,
20144
20204
  default: () => ({})
20145
20205
  },
20206
+ /**
20207
+ * 编辑器主题
20208
+ * - 'snow': 雪花主题,经典工具栏样式(默认)
20209
+ * - 'bubble': 气泡主题,浮动工具栏样式
20210
+ * - '': 无主题,不应用任何样式
20211
+ * 影响编辑器的整体外观和交互方式
20212
+ */
20146
20213
  theme: {
20147
20214
  type: String,
20148
20215
  default: 'snow',
@@ -20150,6 +20217,15 @@
20150
20217
  return ['snow', 'bubble', ''].includes(value);
20151
20218
  },
20152
20219
  },
20220
+ /**
20221
+ * 工具栏配置
20222
+ * 支持多种格式:
20223
+ * - 字符串: 使用预定义的工具栏配置(如'full', 'short')
20224
+ * - 数组: 自定义工具栏按钮数组
20225
+ * - 对象: 自定义工具栏配置对象
20226
+ * - 布尔值: true显示默认工具栏,false隐藏工具栏
20227
+ * - 以'#'开头: 使用CSS选择器指定的DOM元素作为工具栏
20228
+ */
20153
20229
  toolbar: {
20154
20230
  type: [String, Array, Object, Boolean],
20155
20231
  required: false,
@@ -20164,6 +20240,12 @@
20164
20240
  return true;
20165
20241
  },
20166
20242
  },
20243
+ /**
20244
+ * Quill模块配置
20245
+ * 支持单个模块或模块数组
20246
+ * 每个模块包含:name(模块名)、module(模块对象)、options(模块选项)
20247
+ * 默认包含blotFormatter模块,用于图片拖拽调整
20248
+ */
20167
20249
  modules: {
20168
20250
  type: Object,
20169
20251
  required: false,
@@ -20174,10 +20256,21 @@
20174
20256
  };
20175
20257
  },
20176
20258
  },
20259
+ /**
20260
+ * 编辑器选项配置
20261
+ * 传入QuillOptionsStatic对象,用于配置编辑器的各种选项
20262
+ * 这些选项会与默认选项合并,优先级高于默认选项
20263
+ */
20177
20264
  options: {
20178
20265
  type: Object,
20179
20266
  required: false,
20180
20267
  },
20268
+ /**
20269
+ * 全局选项配置
20270
+ * 传入QuillOptionsStatic对象,用于配置编辑器的全局选项
20271
+ * 这些选项会与默认选项合并,优先级最低
20272
+ * 通常用于设置全局默认值
20273
+ */
20181
20274
  globalOptions: {
20182
20275
  type: Object,
20183
20276
  required: false,
@@ -20193,6 +20286,7 @@
20193
20286
  'ready',
20194
20287
  'ocr',
20195
20288
  'math',
20289
+ 'image',
20196
20290
  ],
20197
20291
  setup: (props, ctx) => {
20198
20292
  vue.onMounted(() => {
@@ -20208,7 +20302,6 @@
20208
20302
  const editorWrapClass = vue.computed(() => {
20209
20303
  return {
20210
20304
  'quill-editor-container': true,
20211
- 'need-border': props.needBorder,
20212
20305
  'more-toolbar': showMoreToolbar.value,
20213
20306
  'fixed-top': props.toolbarMode === 'fixed-top',
20214
20307
  'embedded': props.toolbarMode === 'embedded',
@@ -20260,6 +20353,7 @@
20260
20353
  toolbar.style.display = 'none';
20261
20354
  }
20262
20355
  const icons = Quill.import('ui/icons');
20356
+ // 因为设计稿的图标样式和quill的图标样式不一致,所以需要手动替换
20263
20357
  icons['bold'] = boldSVG;
20264
20358
  icons['italic'] = italicSVG;
20265
20359
  icons['underline'] = underlineSVG;
@@ -20310,37 +20404,42 @@
20310
20404
  if (props.placeholder)
20311
20405
  clientOptions.placeholder = props.placeholder;
20312
20406
  if (props.toolbar && props.toolbar !== '') {
20313
- clientOptions.modules = {
20314
- toolbar: {
20315
- // 需要展开的话显示完整的工具栏
20316
- container: props.needCollapse ? [
20317
- ...toolbarOptions.full,
20318
- ] : [
20319
- ...toolbarOptions.short,
20320
- ],
20321
- handlers: {
20322
- redo: function () {
20323
- var _a;
20324
- (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
20325
- },
20326
- undo: function () {
20327
- var _a;
20328
- (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
20329
- },
20330
- ocr: function () {
20331
- // 按钮点击逻辑
20332
- ctx.emit('ocr');
20333
- },
20334
- math: function () {
20335
- // 按钮点击逻辑
20336
- ctx.emit('math');
20407
+ if (props.needCollapse) {
20408
+ clientOptions.modules = {
20409
+ toolbar: "#toolbar",
20410
+ };
20411
+ }
20412
+ else {
20413
+ clientOptions.modules = {
20414
+ toolbar: {
20415
+ // 需要展开的话显示完整的工具栏
20416
+ container: [
20417
+ ...toolbarOptions.full,
20418
+ ],
20419
+ handlers: {
20420
+ redo: function () {
20421
+ var _a;
20422
+ (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
20423
+ },
20424
+ undo: function () {
20425
+ var _a;
20426
+ (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
20427
+ },
20428
+ ocr: function () {
20429
+ // 按钮点击逻辑
20430
+ ctx.emit('ocr');
20431
+ },
20432
+ math: function () {
20433
+ // 按钮点击逻辑
20434
+ ctx.emit('math');
20435
+ },
20436
+ more: function () {
20437
+ showMoreToolbar.value = !showMoreToolbar.value;
20438
+ }
20337
20439
  },
20338
- more: function () {
20339
- showMoreToolbar.value = !showMoreToolbar.value;
20340
- }
20341
20440
  },
20342
- },
20343
- };
20441
+ };
20442
+ }
20344
20443
  }
20345
20444
  if (props.modules) {
20346
20445
  const modules = (() => {
@@ -20384,7 +20483,6 @@
20384
20483
  };
20385
20484
  const handleTextChange = (delta, oldContents, source) => {
20386
20485
  internalModel = maybeClone(getContents());
20387
- // Update v-model:content when text changes
20388
20486
  if (!internalModelEquals(props.content)) {
20389
20487
  ctx.emit('update:content', internalModel);
20390
20488
  }
@@ -20501,6 +20599,23 @@
20501
20599
  initialize();
20502
20600
  });
20503
20601
  };
20602
+ const moreToolbarToolClick = (tool) => {
20603
+ var _a, _b;
20604
+ if (!quill)
20605
+ return;
20606
+ if (tool === 'undo') {
20607
+ (_a = quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
20608
+ }
20609
+ else if (tool === 'redo') {
20610
+ (_b = quill.getModule('history')) === null || _b === void 0 ? void 0 : _b.redo();
20611
+ }
20612
+ else if (tool === 'ocr') {
20613
+ ctx.emit('ocr');
20614
+ }
20615
+ else if (tool === 'math') {
20616
+ ctx.emit('math');
20617
+ }
20618
+ };
20504
20619
  vue.watch(() => props.content, (newContent) => {
20505
20620
  if (!quill || !newContent || internalModelEquals(newContent))
20506
20621
  return;
@@ -20530,30 +20645,19 @@
20530
20645
  reinit,
20531
20646
  editorWrapClass,
20532
20647
  showMoreToolbar,
20648
+ moreToolbarToolClick
20533
20649
  };
20534
20650
  },
20535
20651
  render() {
20536
20652
  return [
20537
20653
  vue.h('div', { class: this.editorWrapClass }, [
20538
20654
  // this.$slots.toolbar?.(), // 工具栏内容固定
20539
- // 当 needCollapse 为 false 时,显示 MoreTools 组件
20540
- this.showMoreToolbar && vue.h(MoreTools, {
20655
+ // 当 needCollapse 为 false 时,显示 MoreToolbar 组件
20656
+ this.$props.needCollapse && vue.h(MoreToolbar, {
20541
20657
  needCollapse: this.needCollapse,
20542
20658
  toolbarStyle: this.$props.toolbarStyle,
20543
20659
  onToolClick: (tool) => {
20544
- var _a, _b, _c, _d;
20545
- if (tool === 'undo') {
20546
- (_b = (_a = this.getQuill()) === null || _a === void 0 ? void 0 : _a.getModule('history')) === null || _b === void 0 ? void 0 : _b.undo();
20547
- }
20548
- else if (tool === 'redo') {
20549
- (_d = (_c = this.getQuill()) === null || _c === void 0 ? void 0 : _c.getModule('history')) === null || _d === void 0 ? void 0 : _d.redo();
20550
- }
20551
- else if (tool === 'ocr') {
20552
- this.$emit('ocr');
20553
- }
20554
- else if (tool === 'math') {
20555
- this.$emit('math');
20556
- }
20660
+ this.moreToolbarToolClick(tool);
20557
20661
  }
20558
20662
  }),
20559
20663
  vue.h('div', {