pxx-vue-quill 1.0.23 → 1.0.25
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.cjs.js +55 -117
- package/dist/vue-quill.cjs.prod.js +2 -2
- package/dist/vue-quill.esm-browser.js +221 -283
- package/dist/vue-quill.esm-browser.prod.js +2 -2
- package/dist/vue-quill.esm-bundler.js +56 -118
- package/dist/vue-quill.esm-bundler.prod.js +2 -2
- package/dist/vue-quill.global.js +187 -241
- package/dist/vue-quill.global.prod.js +2 -2
- package/dist/vue-quill.snow.css +1 -1
- package/dist/vue-quill.snow.prod.css +1 -1
- package/package.json +1 -1
- package/dist/vue-quill.bubble.css +0 -490
- package/dist/vue-quill.bubble.prod.css +0 -1
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2025 Pxx-Team
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2025-08-
|
|
10
|
+
* Date: 2025-08-27T08:02:05.295Z
|
|
11
11
|
*/
|
|
12
|
-
import { defineComponent, ref, h, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue';
|
|
12
|
+
import { defineComponent, ref, h, onMounted, onBeforeUnmount, computed, watchEffect, watch, nextTick } from 'vue';
|
|
13
13
|
|
|
14
14
|
var global$1 = (typeof global !== "undefined" ? global :
|
|
15
15
|
typeof self !== "undefined" ? self :
|
|
@@ -18447,20 +18447,6 @@ const toolbarOptions = {
|
|
|
18447
18447
|
['undo', 'redo'],
|
|
18448
18448
|
['math'],
|
|
18449
18449
|
['ocr'],
|
|
18450
|
-
],
|
|
18451
|
-
// 如果编辑器宽度不够,就显示短的工具栏
|
|
18452
|
-
short: [
|
|
18453
|
-
['bold', 'italic', 'underline'],
|
|
18454
|
-
[{ color: [] }],
|
|
18455
|
-
['link'],
|
|
18456
|
-
['more']
|
|
18457
|
-
],
|
|
18458
|
-
// 点击更多显示的第二栏工具
|
|
18459
|
-
extend: [
|
|
18460
|
-
[{ list: 'ordered' }, { list: 'bullet' }],
|
|
18461
|
-
['image'],
|
|
18462
|
-
['undo', 'redo'],
|
|
18463
|
-
['math'],
|
|
18464
18450
|
]
|
|
18465
18451
|
};
|
|
18466
18452
|
|
|
@@ -18567,44 +18553,52 @@ var es = /*#__PURE__*/Object.freeze({
|
|
|
18567
18553
|
|
|
18568
18554
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(es);
|
|
18569
18555
|
|
|
18570
|
-
var Action
|
|
18556
|
+
var Action = {};
|
|
18571
18557
|
|
|
18572
|
-
|
|
18573
|
-
value: true
|
|
18574
|
-
});
|
|
18558
|
+
var hasRequiredAction;
|
|
18575
18559
|
|
|
18576
|
-
|
|
18560
|
+
function requireAction () {
|
|
18561
|
+
if (hasRequiredAction) return Action;
|
|
18562
|
+
hasRequiredAction = 1;
|
|
18577
18563
|
|
|
18578
|
-
|
|
18564
|
+
Object.defineProperty(Action, "__esModule", {
|
|
18565
|
+
value: true
|
|
18566
|
+
});
|
|
18579
18567
|
|
|
18580
|
-
|
|
18568
|
+
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; }; }();
|
|
18581
18569
|
|
|
18582
|
-
|
|
18570
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
18583
18571
|
|
|
18584
|
-
|
|
18572
|
+
_interopRequireDefault(_BlotFormatter);
|
|
18585
18573
|
|
|
18586
|
-
|
|
18587
|
-
function Action(formatter) {
|
|
18588
|
-
_classCallCheck$1(this, Action);
|
|
18574
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18589
18575
|
|
|
18590
|
-
|
|
18591
|
-
}
|
|
18576
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18592
18577
|
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
}, {
|
|
18597
|
-
key: 'onDestroy',
|
|
18598
|
-
value: function onDestroy() {}
|
|
18599
|
-
}, {
|
|
18600
|
-
key: 'onUpdate',
|
|
18601
|
-
value: function onUpdate() {}
|
|
18602
|
-
}]);
|
|
18578
|
+
var Action$1 = function () {
|
|
18579
|
+
function Action(formatter) {
|
|
18580
|
+
_classCallCheck(this, Action);
|
|
18603
18581
|
|
|
18604
|
-
|
|
18605
|
-
}
|
|
18582
|
+
this.formatter = formatter;
|
|
18583
|
+
}
|
|
18584
|
+
|
|
18585
|
+
_createClass(Action, [{
|
|
18586
|
+
key: 'onCreate',
|
|
18587
|
+
value: function onCreate() {}
|
|
18588
|
+
}, {
|
|
18589
|
+
key: 'onDestroy',
|
|
18590
|
+
value: function onDestroy() {}
|
|
18591
|
+
}, {
|
|
18592
|
+
key: 'onUpdate',
|
|
18593
|
+
value: function onUpdate() {}
|
|
18594
|
+
}]);
|
|
18606
18595
|
|
|
18607
|
-
|
|
18596
|
+
return Action;
|
|
18597
|
+
}();
|
|
18598
|
+
|
|
18599
|
+
Action.default = Action$1;
|
|
18600
|
+
return Action;
|
|
18601
|
+
}
|
|
18608
18602
|
|
|
18609
18603
|
var hasRequiredBlotFormatter;
|
|
18610
18604
|
|
|
@@ -18626,7 +18620,7 @@ function requireBlotFormatter () {
|
|
|
18626
18620
|
|
|
18627
18621
|
var _Options2 = _interopRequireDefault(_Options);
|
|
18628
18622
|
|
|
18629
|
-
var _Action =
|
|
18623
|
+
var _Action = requireAction();
|
|
18630
18624
|
|
|
18631
18625
|
_interopRequireDefault(_Action);
|
|
18632
18626
|
|
|
@@ -18784,11 +18778,11 @@ Object.defineProperty(DefaultAligner$1, "__esModule", {
|
|
|
18784
18778
|
value: true
|
|
18785
18779
|
});
|
|
18786
18780
|
|
|
18787
|
-
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; }; }();
|
|
18781
|
+
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; }; }();
|
|
18788
18782
|
|
|
18789
18783
|
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; }
|
|
18790
18784
|
|
|
18791
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18785
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18792
18786
|
|
|
18793
18787
|
var LEFT_ALIGN = 'left';
|
|
18794
18788
|
var CENTER_ALIGN = 'center';
|
|
@@ -18799,7 +18793,7 @@ var DefaultAligner = function () {
|
|
|
18799
18793
|
var _this = this,
|
|
18800
18794
|
_alignments;
|
|
18801
18795
|
|
|
18802
|
-
_classCallCheck(this, DefaultAligner);
|
|
18796
|
+
_classCallCheck$1(this, DefaultAligner);
|
|
18803
18797
|
|
|
18804
18798
|
this.applyStyle = options.aligner.applyStyle;
|
|
18805
18799
|
this.alignAttribute = options.attribute;
|
|
@@ -18827,7 +18821,7 @@ var DefaultAligner = function () {
|
|
|
18827
18821
|
}), _alignments);
|
|
18828
18822
|
}
|
|
18829
18823
|
|
|
18830
|
-
_createClass(DefaultAligner, [{
|
|
18824
|
+
_createClass$1(DefaultAligner, [{
|
|
18831
18825
|
key: 'getAlignments',
|
|
18832
18826
|
value: function getAlignments() {
|
|
18833
18827
|
var _this2 = this;
|
|
@@ -19065,7 +19059,7 @@ function requireAlignAction () {
|
|
|
19065
19059
|
|
|
19066
19060
|
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; }; }();
|
|
19067
19061
|
|
|
19068
|
-
var _Action2 =
|
|
19062
|
+
var _Action2 = requireAction();
|
|
19069
19063
|
|
|
19070
19064
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19071
19065
|
|
|
@@ -19144,7 +19138,7 @@ function requireResizeAction () {
|
|
|
19144
19138
|
|
|
19145
19139
|
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; }; }();
|
|
19146
19140
|
|
|
19147
|
-
var _Action2 =
|
|
19141
|
+
var _Action2 = requireAction();
|
|
19148
19142
|
|
|
19149
19143
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19150
19144
|
|
|
@@ -19333,7 +19327,7 @@ function requireDeleteAction () {
|
|
|
19333
19327
|
|
|
19334
19328
|
var _quill2 = _interopRequireDefault(_quill);
|
|
19335
19329
|
|
|
19336
|
-
var _Action2 =
|
|
19330
|
+
var _Action2 = requireAction();
|
|
19337
19331
|
|
|
19338
19332
|
var _Action3 = _interopRequireDefault(_Action2);
|
|
19339
19333
|
|
|
@@ -19412,7 +19406,7 @@ function requireBlotSpec () {
|
|
|
19412
19406
|
|
|
19413
19407
|
_interopRequireDefault(_BlotFormatter);
|
|
19414
19408
|
|
|
19415
|
-
var _Action =
|
|
19409
|
+
var _Action = requireAction();
|
|
19416
19410
|
|
|
19417
19411
|
_interopRequireDefault(_Action);
|
|
19418
19412
|
|
|
@@ -19552,156 +19546,148 @@ function requireImageSpec () {
|
|
|
19552
19546
|
|
|
19553
19547
|
var IframeVideoSpec = {};
|
|
19554
19548
|
|
|
19555
|
-
var UnclickableBlotSpec = {};
|
|
19556
|
-
|
|
19557
|
-
var hasRequiredUnclickableBlotSpec;
|
|
19549
|
+
var UnclickableBlotSpec$1 = {};
|
|
19558
19550
|
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19564
|
-
value: true
|
|
19565
|
-
});
|
|
19566
|
-
|
|
19567
|
-
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; }; }();
|
|
19551
|
+
Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
|
|
19552
|
+
value: true
|
|
19553
|
+
});
|
|
19568
19554
|
|
|
19569
|
-
|
|
19555
|
+
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; }; }();
|
|
19570
19556
|
|
|
19571
|
-
|
|
19557
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19572
19558
|
|
|
19573
|
-
|
|
19559
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19574
19560
|
|
|
19575
|
-
|
|
19561
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19576
19562
|
|
|
19577
|
-
|
|
19563
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19578
19564
|
|
|
19579
|
-
|
|
19565
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19580
19566
|
|
|
19581
|
-
|
|
19567
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19582
19568
|
|
|
19583
|
-
|
|
19569
|
+
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; }
|
|
19584
19570
|
|
|
19585
|
-
|
|
19586
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19571
|
+
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; }
|
|
19587
19572
|
|
|
19588
|
-
|
|
19589
|
-
|
|
19573
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19574
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19590
19575
|
|
|
19591
|
-
|
|
19592
|
-
|
|
19576
|
+
var UnclickableBlotSpec = function (_BlotSpec) {
|
|
19577
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19593
19578
|
|
|
19594
|
-
|
|
19579
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19580
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19595
19581
|
|
|
19596
|
-
|
|
19597
|
-
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19598
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19599
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19600
|
-
});
|
|
19601
|
-
};
|
|
19582
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19602
19583
|
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19584
|
+
_this.onTextChange = function () {
|
|
19585
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19586
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19587
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19588
|
+
});
|
|
19589
|
+
};
|
|
19608
19590
|
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19591
|
+
_this.onMouseEnter = function (event) {
|
|
19592
|
+
var unclickable = event.target;
|
|
19593
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19594
|
+
return;
|
|
19595
|
+
}
|
|
19612
19596
|
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
_this.formatter.show(_this);
|
|
19617
|
-
_this.hideProxyImage();
|
|
19618
|
-
};
|
|
19597
|
+
_this.nextUnclickable = unclickable;
|
|
19598
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19599
|
+
};
|
|
19619
19600
|
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19601
|
+
_this.onProxyImageClick = function () {
|
|
19602
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19603
|
+
_this.nextUnclickable = null;
|
|
19604
|
+
_this.formatter.show(_this);
|
|
19605
|
+
_this.hideProxyImage();
|
|
19606
|
+
};
|
|
19625
19607
|
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
it's important that this is attached to the body instead of the root quill element.
|
|
19632
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19633
|
-
*/
|
|
19634
|
-
document.body.appendChild(this.createProxyImage());
|
|
19635
|
-
}
|
|
19608
|
+
_this.selector = selector;
|
|
19609
|
+
_this.unclickable = null;
|
|
19610
|
+
_this.nextUnclickable = null;
|
|
19611
|
+
return _this;
|
|
19612
|
+
}
|
|
19636
19613
|
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
key: 'getOverlayElement',
|
|
19648
|
-
value: function getOverlayElement() {
|
|
19649
|
-
return this.unclickable;
|
|
19650
|
-
}
|
|
19651
|
-
}, {
|
|
19652
|
-
key: 'onHide',
|
|
19653
|
-
value: function onHide() {
|
|
19654
|
-
this.hideProxyImage();
|
|
19655
|
-
this.nextUnclickable = null;
|
|
19656
|
-
this.unclickable = null;
|
|
19657
|
-
}
|
|
19658
|
-
}, {
|
|
19659
|
-
key: 'createProxyImage',
|
|
19660
|
-
value: function createProxyImage() {
|
|
19661
|
-
var canvas = document.createElement('canvas');
|
|
19662
|
-
var context = canvas.getContext('2d');
|
|
19663
|
-
context.globalAlpha = 0;
|
|
19664
|
-
context.fillRect(0, 0, 1, 1);
|
|
19665
|
-
|
|
19666
|
-
this.proxyImage = document.createElement('img');
|
|
19667
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19668
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19669
|
-
|
|
19670
|
-
Object.assign(this.proxyImage.style, {
|
|
19671
|
-
position: 'absolute',
|
|
19672
|
-
margin: '0'
|
|
19673
|
-
});
|
|
19614
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19615
|
+
key: 'init',
|
|
19616
|
+
value: function init() {
|
|
19617
|
+
if (document.body) {
|
|
19618
|
+
/*
|
|
19619
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19620
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19621
|
+
*/
|
|
19622
|
+
document.body.appendChild(this.createProxyImage());
|
|
19623
|
+
}
|
|
19674
19624
|
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19625
|
+
this.hideProxyImage();
|
|
19626
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19627
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19628
|
+
}
|
|
19629
|
+
}, {
|
|
19630
|
+
key: 'getTargetElement',
|
|
19631
|
+
value: function getTargetElement() {
|
|
19632
|
+
return this.unclickable;
|
|
19633
|
+
}
|
|
19634
|
+
}, {
|
|
19635
|
+
key: 'getOverlayElement',
|
|
19636
|
+
value: function getOverlayElement() {
|
|
19637
|
+
return this.unclickable;
|
|
19638
|
+
}
|
|
19639
|
+
}, {
|
|
19640
|
+
key: 'onHide',
|
|
19641
|
+
value: function onHide() {
|
|
19642
|
+
this.hideProxyImage();
|
|
19643
|
+
this.nextUnclickable = null;
|
|
19644
|
+
this.unclickable = null;
|
|
19645
|
+
}
|
|
19646
|
+
}, {
|
|
19647
|
+
key: 'createProxyImage',
|
|
19648
|
+
value: function createProxyImage() {
|
|
19649
|
+
var canvas = document.createElement('canvas');
|
|
19650
|
+
var context = canvas.getContext('2d');
|
|
19651
|
+
context.globalAlpha = 0;
|
|
19652
|
+
context.fillRect(0, 0, 1, 1);
|
|
19653
|
+
|
|
19654
|
+
this.proxyImage = document.createElement('img');
|
|
19655
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19656
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19657
|
+
|
|
19658
|
+
Object.assign(this.proxyImage.style, {
|
|
19659
|
+
position: 'absolute',
|
|
19660
|
+
margin: '0'
|
|
19661
|
+
});
|
|
19688
19662
|
|
|
19689
|
-
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
|
|
19663
|
+
return this.proxyImage;
|
|
19664
|
+
}
|
|
19665
|
+
}, {
|
|
19666
|
+
key: 'hideProxyImage',
|
|
19667
|
+
value: function hideProxyImage() {
|
|
19668
|
+
Object.assign(this.proxyImage.style, {
|
|
19669
|
+
display: 'none'
|
|
19670
|
+
});
|
|
19671
|
+
}
|
|
19672
|
+
}, {
|
|
19673
|
+
key: 'repositionProxyImage',
|
|
19674
|
+
value: function repositionProxyImage(unclickable) {
|
|
19675
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19676
|
+
|
|
19677
|
+
Object.assign(this.proxyImage.style, {
|
|
19678
|
+
display: 'block',
|
|
19679
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19680
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19681
|
+
width: rect.width + 'px',
|
|
19682
|
+
height: rect.height + 'px'
|
|
19683
|
+
});
|
|
19684
|
+
}
|
|
19685
|
+
}]);
|
|
19698
19686
|
|
|
19699
|
-
|
|
19700
|
-
|
|
19687
|
+
return UnclickableBlotSpec;
|
|
19688
|
+
}(_BlotSpec3.default);
|
|
19701
19689
|
|
|
19702
|
-
|
|
19703
|
-
return UnclickableBlotSpec;
|
|
19704
|
-
}
|
|
19690
|
+
UnclickableBlotSpec$1.default = UnclickableBlotSpec;
|
|
19705
19691
|
|
|
19706
19692
|
var hasRequiredIframeVideoSpec;
|
|
19707
19693
|
|
|
@@ -19713,7 +19699,7 @@ function requireIframeVideoSpec () {
|
|
|
19713
19699
|
value: true
|
|
19714
19700
|
});
|
|
19715
19701
|
|
|
19716
|
-
var _UnclickableBlotSpec2 =
|
|
19702
|
+
var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
|
|
19717
19703
|
|
|
19718
19704
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19719
19705
|
|
|
@@ -19868,7 +19854,7 @@ function requireOptions () {
|
|
|
19868
19854
|
}
|
|
19869
19855
|
});
|
|
19870
19856
|
|
|
19871
|
-
var _Action =
|
|
19857
|
+
var _Action = requireAction();
|
|
19872
19858
|
|
|
19873
19859
|
Object.defineProperty(exports, 'Action', {
|
|
19874
19860
|
enumerable: true,
|
|
@@ -19940,7 +19926,7 @@ function requireOptions () {
|
|
|
19940
19926
|
}
|
|
19941
19927
|
});
|
|
19942
19928
|
|
|
19943
|
-
var _UnclickableBlotSpec =
|
|
19929
|
+
var _UnclickableBlotSpec = UnclickableBlotSpec$1;
|
|
19944
19930
|
|
|
19945
19931
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19946
19932
|
enumerable: true,
|
|
@@ -19970,6 +19956,10 @@ const MoreToolbar = defineComponent({
|
|
|
19970
19956
|
type: String,
|
|
19971
19957
|
required: true,
|
|
19972
19958
|
},
|
|
19959
|
+
toolbarStyle: {
|
|
19960
|
+
type: Object,
|
|
19961
|
+
default: () => ({}),
|
|
19962
|
+
},
|
|
19973
19963
|
},
|
|
19974
19964
|
emits: ['toolClick'],
|
|
19975
19965
|
setup(props, { emit }) {
|
|
@@ -19984,7 +19974,8 @@ const MoreToolbar = defineComponent({
|
|
|
19984
19974
|
class: {
|
|
19985
19975
|
'short-tools': true,
|
|
19986
19976
|
'collapse': showMoreTools.value
|
|
19987
|
-
}
|
|
19977
|
+
},
|
|
19978
|
+
style: props.toolbarStyle
|
|
19988
19979
|
}, [
|
|
19989
19980
|
// 第一组:基础格式工具
|
|
19990
19981
|
h('span', { class: 'ql-formats' }, [
|
|
@@ -20034,7 +20025,7 @@ const MoreToolbar = defineComponent({
|
|
|
20034
20025
|
class: {
|
|
20035
20026
|
"more-tools": true,
|
|
20036
20027
|
"collapse": showMoreTools.value
|
|
20037
|
-
}, style: { display: showMoreTools.value ? 'block' : 'none' }
|
|
20028
|
+
}, style: { display: showMoreTools.value ? 'block' : 'none', ...props.toolbarStyle }
|
|
20038
20029
|
}, [
|
|
20039
20030
|
h('div', { class: "more-tools-item" }, [
|
|
20040
20031
|
h('span', { class: 'ql-formats' }, [
|
|
@@ -20118,12 +20109,12 @@ const QuillEditor = defineComponent({
|
|
|
20118
20109
|
inheritAttrs: false,
|
|
20119
20110
|
props: {
|
|
20120
20111
|
/**
|
|
20121
|
-
* 编辑器的key
|
|
20122
|
-
*
|
|
20112
|
+
* 编辑器的key(唯一值)
|
|
20113
|
+
* 如果页面上存在多个needCollapse为true的编辑器的话必须传递
|
|
20114
|
+
* 为什么需要传? 因为needCollapse为true的时候,初始化toolbar需要用到id,如果id相同,则toolbar会互相影响
|
|
20123
20115
|
*/
|
|
20124
20116
|
editorKey: {
|
|
20125
|
-
type: String,
|
|
20126
|
-
required: true,
|
|
20117
|
+
type: [String, Number],
|
|
20127
20118
|
},
|
|
20128
20119
|
/**
|
|
20129
20120
|
* 编辑器内容
|
|
@@ -20203,7 +20194,7 @@ const QuillEditor = defineComponent({
|
|
|
20203
20194
|
* 工具栏自定义样式
|
|
20204
20195
|
* 传入CSS样式对象,会应用到工具栏容器上
|
|
20205
20196
|
* 例如:{ 'background-color': '#f0f0f0', 'border-radius': '8px' }
|
|
20206
|
-
*
|
|
20197
|
+
* 为了让编辑器的toolbar的样式更灵活,支持所有CSS属性
|
|
20207
20198
|
*/
|
|
20208
20199
|
toolbarStyle: {
|
|
20209
20200
|
type: Object,
|
|
@@ -20214,50 +20205,13 @@ const QuillEditor = defineComponent({
|
|
|
20214
20205
|
* 编辑器内容区域自定义样式
|
|
20215
20206
|
* 传入CSS样式对象,会应用到编辑器内容区域(.ql-editor)上
|
|
20216
20207
|
* 例如:{ 'font-size': '16px', 'line-height': '1.6' }
|
|
20217
|
-
*
|
|
20208
|
+
* 为了让编辑器的输入部分的样式更灵活,支持所有CSS属性
|
|
20218
20209
|
*/
|
|
20219
20210
|
editorStyle: {
|
|
20220
20211
|
type: Object,
|
|
20221
20212
|
required: false,
|
|
20222
20213
|
default: () => ({})
|
|
20223
20214
|
},
|
|
20224
|
-
/**
|
|
20225
|
-
* 编辑器主题
|
|
20226
|
-
* - 'snow': 雪花主题,经典工具栏样式(默认)
|
|
20227
|
-
* - 'bubble': 气泡主题,浮动工具栏样式
|
|
20228
|
-
* - '': 无主题,不应用任何样式
|
|
20229
|
-
* 影响编辑器的整体外观和交互方式
|
|
20230
|
-
*/
|
|
20231
|
-
theme: {
|
|
20232
|
-
type: String,
|
|
20233
|
-
default: 'snow',
|
|
20234
|
-
validator: (value) => {
|
|
20235
|
-
return ['snow', 'bubble', ''].includes(value);
|
|
20236
|
-
},
|
|
20237
|
-
},
|
|
20238
|
-
/**
|
|
20239
|
-
* 工具栏配置
|
|
20240
|
-
* 支持多种格式:
|
|
20241
|
-
* - 字符串: 使用预定义的工具栏配置(如'full', 'short')
|
|
20242
|
-
* - 数组: 自定义工具栏按钮数组
|
|
20243
|
-
* - 对象: 自定义工具栏配置对象
|
|
20244
|
-
* - 布尔值: true显示默认工具栏,false隐藏工具栏
|
|
20245
|
-
* - 以'#'开头: 使用CSS选择器指定的DOM元素作为工具栏
|
|
20246
|
-
*/
|
|
20247
|
-
toolbar: {
|
|
20248
|
-
type: [String, Array, Object, Boolean],
|
|
20249
|
-
required: false,
|
|
20250
|
-
validator: (value) => {
|
|
20251
|
-
if (!value)
|
|
20252
|
-
return false;
|
|
20253
|
-
if (typeof value === 'string' && value !== '') {
|
|
20254
|
-
return value.charAt(0) === '#'
|
|
20255
|
-
? true
|
|
20256
|
-
: Object.keys(toolbarOptions).indexOf(value) !== -1;
|
|
20257
|
-
}
|
|
20258
|
-
return true;
|
|
20259
|
-
},
|
|
20260
|
-
},
|
|
20261
20215
|
/**
|
|
20262
20216
|
* Quill模块配置
|
|
20263
20217
|
* 支持单个模块或模块数组
|
|
@@ -20345,17 +20299,13 @@ const QuillEditor = defineComponent({
|
|
|
20345
20299
|
}
|
|
20346
20300
|
}
|
|
20347
20301
|
};
|
|
20348
|
-
|
|
20349
|
-
|
|
20350
|
-
nextTick(() => {
|
|
20302
|
+
watchEffect(() => {
|
|
20303
|
+
if (!props.needCollapse && props.toolbarStyle) {
|
|
20351
20304
|
applyToolbarStyle();
|
|
20352
|
-
}
|
|
20305
|
+
}
|
|
20353
20306
|
});
|
|
20354
|
-
|
|
20355
|
-
|
|
20356
|
-
nextTick(() => {
|
|
20357
|
-
applyEditorStyle();
|
|
20358
|
-
});
|
|
20307
|
+
watchEffect(() => {
|
|
20308
|
+
applyEditorStyle();
|
|
20359
20309
|
});
|
|
20360
20310
|
const registerModule = (moduleName, module) => {
|
|
20361
20311
|
Quill.register(moduleName, module);
|
|
@@ -20398,66 +20348,55 @@ const QuillEditor = defineComponent({
|
|
|
20398
20348
|
quill.on('text-change', handleTextChange);
|
|
20399
20349
|
quill.on('selection-change', handleSelectionChange);
|
|
20400
20350
|
quill.on('editor-change', handleEditorChange);
|
|
20401
|
-
if (props.theme !== 'bubble')
|
|
20402
|
-
editor.value.classList.remove('ql-bubble');
|
|
20403
|
-
if (props.theme !== 'snow')
|
|
20404
|
-
editor.value.classList.remove('ql-snow');
|
|
20405
20351
|
(_b = quill
|
|
20406
20352
|
.getModule('toolbar')) === null || _b === void 0 ? void 0 : _b.container.addEventListener('mousedown', (e) => {
|
|
20407
20353
|
e.preventDefault();
|
|
20408
20354
|
});
|
|
20409
|
-
// 应用初始toolbar样式
|
|
20410
|
-
applyToolbarStyle();
|
|
20411
|
-
// 应用初始editor样式
|
|
20412
|
-
applyEditorStyle();
|
|
20413
20355
|
ctx.emit('ready', quill);
|
|
20414
20356
|
};
|
|
20415
20357
|
// Compose Options
|
|
20416
20358
|
const composeOptions = () => {
|
|
20417
20359
|
const clientOptions = {};
|
|
20418
|
-
|
|
20419
|
-
clientOptions.theme = props.theme;
|
|
20360
|
+
clientOptions.theme = 'snow';
|
|
20420
20361
|
if (props.readOnly)
|
|
20421
20362
|
clientOptions.readOnly = props.readOnly;
|
|
20422
20363
|
if (props.placeholder)
|
|
20423
20364
|
clientOptions.placeholder = props.placeholder;
|
|
20424
|
-
if (props.
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
|
|
20440
|
-
(_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
|
|
20441
|
-
},
|
|
20442
|
-
undo: function () {
|
|
20443
|
-
var _a;
|
|
20444
|
-
(_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
|
|
20445
|
-
},
|
|
20446
|
-
ocr: function () {
|
|
20447
|
-
// 按钮点击逻辑
|
|
20448
|
-
ctx.emit('ocr');
|
|
20449
|
-
},
|
|
20450
|
-
math: function () {
|
|
20451
|
-
// 按钮点击逻辑
|
|
20452
|
-
ctx.emit('math');
|
|
20453
|
-
},
|
|
20454
|
-
more: function () {
|
|
20455
|
-
showMoreToolbar.value = !showMoreToolbar.value;
|
|
20456
|
-
}
|
|
20365
|
+
if (props.needCollapse) {
|
|
20366
|
+
clientOptions.modules = {
|
|
20367
|
+
toolbar: "#toolbar-" + props.editorKey,
|
|
20368
|
+
};
|
|
20369
|
+
}
|
|
20370
|
+
else {
|
|
20371
|
+
clientOptions.modules = {
|
|
20372
|
+
toolbar: {
|
|
20373
|
+
// 需要展开的话显示完整的工具栏
|
|
20374
|
+
container: [
|
|
20375
|
+
...toolbarOptions.full,
|
|
20376
|
+
],
|
|
20377
|
+
handlers: {
|
|
20378
|
+
redo: function () {
|
|
20379
|
+
var _a;
|
|
20380
|
+
(_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
|
|
20457
20381
|
},
|
|
20382
|
+
undo: function () {
|
|
20383
|
+
var _a;
|
|
20384
|
+
(_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
|
|
20385
|
+
},
|
|
20386
|
+
ocr: function () {
|
|
20387
|
+
// 按钮点击逻辑
|
|
20388
|
+
ctx.emit('ocr');
|
|
20389
|
+
},
|
|
20390
|
+
math: function () {
|
|
20391
|
+
// 按钮点击逻辑
|
|
20392
|
+
ctx.emit('math');
|
|
20393
|
+
},
|
|
20394
|
+
more: function () {
|
|
20395
|
+
showMoreToolbar.value = !showMoreToolbar.value;
|
|
20396
|
+
}
|
|
20458
20397
|
},
|
|
20459
|
-
}
|
|
20460
|
-
}
|
|
20398
|
+
},
|
|
20399
|
+
};
|
|
20461
20400
|
}
|
|
20462
20401
|
if (props.modules) {
|
|
20463
20402
|
const modules = (() => {
|
|
@@ -20669,10 +20608,9 @@ const QuillEditor = defineComponent({
|
|
|
20669
20608
|
render() {
|
|
20670
20609
|
return [
|
|
20671
20610
|
h('div', { class: this.editorWrapClass }, [
|
|
20672
|
-
// this.$slots.toolbar?.(), // 工具栏内容固定
|
|
20673
20611
|
// 当 needCollapse 为 false 时,显示 MoreToolbar 组件
|
|
20674
|
-
this.$props.needCollapse && h(MoreToolbar, {
|
|
20675
|
-
editorKey: this.$props.editorKey,
|
|
20612
|
+
this.$props.needCollapse && this.$props.editorKey && h(MoreToolbar, {
|
|
20613
|
+
editorKey: String(this.$props.editorKey),
|
|
20676
20614
|
needCollapse: this.needCollapse,
|
|
20677
20615
|
toolbarStyle: this.$props.toolbarStyle,
|
|
20678
20616
|
onToolClick: (tool) => {
|