pxx-vue-quill 1.0.85 → 1.0.87
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 +135 -137
- 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-08T04:
|
|
10
|
+
* Date: 2025-09-08T04:14:12.416Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18781,11 +18781,11 @@
|
|
|
18781
18781
|
value: true
|
|
18782
18782
|
});
|
|
18783
18783
|
|
|
18784
|
-
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; }; }();
|
|
18784
|
+
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; }; }();
|
|
18785
18785
|
|
|
18786
18786
|
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; }
|
|
18787
18787
|
|
|
18788
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18788
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18789
18789
|
|
|
18790
18790
|
var LEFT_ALIGN = 'left';
|
|
18791
18791
|
var CENTER_ALIGN = 'center';
|
|
@@ -18796,7 +18796,7 @@
|
|
|
18796
18796
|
var _this = this,
|
|
18797
18797
|
_alignments;
|
|
18798
18798
|
|
|
18799
|
-
_classCallCheck(this, DefaultAligner);
|
|
18799
|
+
_classCallCheck$1(this, DefaultAligner);
|
|
18800
18800
|
|
|
18801
18801
|
this.applyStyle = options.aligner.applyStyle;
|
|
18802
18802
|
this.alignAttribute = options.attribute;
|
|
@@ -18824,7 +18824,7 @@
|
|
|
18824
18824
|
}), _alignments);
|
|
18825
18825
|
}
|
|
18826
18826
|
|
|
18827
|
-
_createClass(DefaultAligner, [{
|
|
18827
|
+
_createClass$1(DefaultAligner, [{
|
|
18828
18828
|
key: 'getAlignments',
|
|
18829
18829
|
value: function getAlignments() {
|
|
18830
18830
|
var _this2 = this;
|
|
@@ -19549,156 +19549,148 @@
|
|
|
19549
19549
|
|
|
19550
19550
|
var IframeVideoSpec = {};
|
|
19551
19551
|
|
|
19552
|
-
var UnclickableBlotSpec = {};
|
|
19553
|
-
|
|
19554
|
-
var hasRequiredUnclickableBlotSpec;
|
|
19552
|
+
var UnclickableBlotSpec$1 = {};
|
|
19555
19553
|
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
Object.defineProperty(UnclickableBlotSpec, "__esModule", {
|
|
19561
|
-
value: true
|
|
19562
|
-
});
|
|
19563
|
-
|
|
19564
|
-
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; }; }();
|
|
19554
|
+
Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
|
|
19555
|
+
value: true
|
|
19556
|
+
});
|
|
19565
19557
|
|
|
19566
|
-
|
|
19558
|
+
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; }; }();
|
|
19567
19559
|
|
|
19568
|
-
|
|
19560
|
+
var _BlotSpec2 = requireBlotSpec();
|
|
19569
19561
|
|
|
19570
|
-
|
|
19562
|
+
var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
|
|
19571
19563
|
|
|
19572
|
-
|
|
19564
|
+
var _BlotFormatter = requireBlotFormatter();
|
|
19573
19565
|
|
|
19574
|
-
|
|
19566
|
+
_interopRequireDefault(_BlotFormatter);
|
|
19575
19567
|
|
|
19576
|
-
|
|
19568
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19577
19569
|
|
|
19578
|
-
|
|
19570
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19579
19571
|
|
|
19580
|
-
|
|
19572
|
+
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; }
|
|
19581
19573
|
|
|
19582
|
-
|
|
19583
|
-
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19574
|
+
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; }
|
|
19584
19575
|
|
|
19585
|
-
|
|
19586
|
-
|
|
19576
|
+
var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
|
|
19577
|
+
var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
|
|
19587
19578
|
|
|
19588
|
-
|
|
19589
|
-
|
|
19579
|
+
var UnclickableBlotSpec = function (_BlotSpec) {
|
|
19580
|
+
_inherits(UnclickableBlotSpec, _BlotSpec);
|
|
19590
19581
|
|
|
19591
|
-
|
|
19582
|
+
function UnclickableBlotSpec(formatter, selector) {
|
|
19583
|
+
_classCallCheck(this, UnclickableBlotSpec);
|
|
19592
19584
|
|
|
19593
|
-
|
|
19594
|
-
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19595
|
-
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19596
|
-
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19597
|
-
});
|
|
19598
|
-
};
|
|
19585
|
+
var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
|
|
19599
19586
|
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19587
|
+
_this.onTextChange = function () {
|
|
19588
|
+
Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
|
|
19589
|
+
unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
|
|
19590
|
+
unclickable.addEventListener('mouseenter', _this.onMouseEnter);
|
|
19591
|
+
});
|
|
19592
|
+
};
|
|
19605
19593
|
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19594
|
+
_this.onMouseEnter = function (event) {
|
|
19595
|
+
var unclickable = event.target;
|
|
19596
|
+
if (!(unclickable instanceof HTMLElement)) {
|
|
19597
|
+
return;
|
|
19598
|
+
}
|
|
19609
19599
|
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
_this.formatter.show(_this);
|
|
19614
|
-
_this.hideProxyImage();
|
|
19615
|
-
};
|
|
19600
|
+
_this.nextUnclickable = unclickable;
|
|
19601
|
+
_this.repositionProxyImage(_this.nextUnclickable);
|
|
19602
|
+
};
|
|
19616
19603
|
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19604
|
+
_this.onProxyImageClick = function () {
|
|
19605
|
+
_this.unclickable = _this.nextUnclickable;
|
|
19606
|
+
_this.nextUnclickable = null;
|
|
19607
|
+
_this.formatter.show(_this);
|
|
19608
|
+
_this.hideProxyImage();
|
|
19609
|
+
};
|
|
19622
19610
|
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
it's important that this is attached to the body instead of the root quill element.
|
|
19629
|
-
this prevents the click event from overlapping with ImageSpec
|
|
19630
|
-
*/
|
|
19631
|
-
document.body.appendChild(this.createProxyImage());
|
|
19632
|
-
}
|
|
19611
|
+
_this.selector = selector;
|
|
19612
|
+
_this.unclickable = null;
|
|
19613
|
+
_this.nextUnclickable = null;
|
|
19614
|
+
return _this;
|
|
19615
|
+
}
|
|
19633
19616
|
|
|
19634
|
-
|
|
19635
|
-
|
|
19636
|
-
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
key: 'getOverlayElement',
|
|
19645
|
-
value: function getOverlayElement() {
|
|
19646
|
-
return this.unclickable;
|
|
19647
|
-
}
|
|
19648
|
-
}, {
|
|
19649
|
-
key: 'onHide',
|
|
19650
|
-
value: function onHide() {
|
|
19651
|
-
this.hideProxyImage();
|
|
19652
|
-
this.nextUnclickable = null;
|
|
19653
|
-
this.unclickable = null;
|
|
19654
|
-
}
|
|
19655
|
-
}, {
|
|
19656
|
-
key: 'createProxyImage',
|
|
19657
|
-
value: function createProxyImage() {
|
|
19658
|
-
var canvas = document.createElement('canvas');
|
|
19659
|
-
var context = canvas.getContext('2d');
|
|
19660
|
-
context.globalAlpha = 0;
|
|
19661
|
-
context.fillRect(0, 0, 1, 1);
|
|
19662
|
-
|
|
19663
|
-
this.proxyImage = document.createElement('img');
|
|
19664
|
-
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19665
|
-
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19666
|
-
|
|
19667
|
-
Object.assign(this.proxyImage.style, {
|
|
19668
|
-
position: 'absolute',
|
|
19669
|
-
margin: '0'
|
|
19670
|
-
});
|
|
19617
|
+
_createClass(UnclickableBlotSpec, [{
|
|
19618
|
+
key: 'init',
|
|
19619
|
+
value: function init() {
|
|
19620
|
+
if (document.body) {
|
|
19621
|
+
/*
|
|
19622
|
+
it's important that this is attached to the body instead of the root quill element.
|
|
19623
|
+
this prevents the click event from overlapping with ImageSpec
|
|
19624
|
+
*/
|
|
19625
|
+
document.body.appendChild(this.createProxyImage());
|
|
19626
|
+
}
|
|
19671
19627
|
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19628
|
+
this.hideProxyImage();
|
|
19629
|
+
this.proxyImage.addEventListener('click', this.onProxyImageClick);
|
|
19630
|
+
this.formatter.quill.on('text-change', this.onTextChange);
|
|
19631
|
+
}
|
|
19632
|
+
}, {
|
|
19633
|
+
key: 'getTargetElement',
|
|
19634
|
+
value: function getTargetElement() {
|
|
19635
|
+
return this.unclickable;
|
|
19636
|
+
}
|
|
19637
|
+
}, {
|
|
19638
|
+
key: 'getOverlayElement',
|
|
19639
|
+
value: function getOverlayElement() {
|
|
19640
|
+
return this.unclickable;
|
|
19641
|
+
}
|
|
19642
|
+
}, {
|
|
19643
|
+
key: 'onHide',
|
|
19644
|
+
value: function onHide() {
|
|
19645
|
+
this.hideProxyImage();
|
|
19646
|
+
this.nextUnclickable = null;
|
|
19647
|
+
this.unclickable = null;
|
|
19648
|
+
}
|
|
19649
|
+
}, {
|
|
19650
|
+
key: 'createProxyImage',
|
|
19651
|
+
value: function createProxyImage() {
|
|
19652
|
+
var canvas = document.createElement('canvas');
|
|
19653
|
+
var context = canvas.getContext('2d');
|
|
19654
|
+
context.globalAlpha = 0;
|
|
19655
|
+
context.fillRect(0, 0, 1, 1);
|
|
19656
|
+
|
|
19657
|
+
this.proxyImage = document.createElement('img');
|
|
19658
|
+
this.proxyImage.src = canvas.toDataURL('image/png');
|
|
19659
|
+
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
|
|
19660
|
+
|
|
19661
|
+
Object.assign(this.proxyImage.style, {
|
|
19662
|
+
position: 'absolute',
|
|
19663
|
+
margin: '0'
|
|
19664
|
+
});
|
|
19685
19665
|
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
|
|
19666
|
+
return this.proxyImage;
|
|
19667
|
+
}
|
|
19668
|
+
}, {
|
|
19669
|
+
key: 'hideProxyImage',
|
|
19670
|
+
value: function hideProxyImage() {
|
|
19671
|
+
Object.assign(this.proxyImage.style, {
|
|
19672
|
+
display: 'none'
|
|
19673
|
+
});
|
|
19674
|
+
}
|
|
19675
|
+
}, {
|
|
19676
|
+
key: 'repositionProxyImage',
|
|
19677
|
+
value: function repositionProxyImage(unclickable) {
|
|
19678
|
+
var rect = unclickable.getBoundingClientRect();
|
|
19679
|
+
|
|
19680
|
+
Object.assign(this.proxyImage.style, {
|
|
19681
|
+
display: 'block',
|
|
19682
|
+
left: rect.left + window.pageXOffset + 'px',
|
|
19683
|
+
top: rect.top + window.pageYOffset + 'px',
|
|
19684
|
+
width: rect.width + 'px',
|
|
19685
|
+
height: rect.height + 'px'
|
|
19686
|
+
});
|
|
19687
|
+
}
|
|
19688
|
+
}]);
|
|
19695
19689
|
|
|
19696
|
-
|
|
19697
|
-
|
|
19690
|
+
return UnclickableBlotSpec;
|
|
19691
|
+
}(_BlotSpec3.default);
|
|
19698
19692
|
|
|
19699
|
-
|
|
19700
|
-
return UnclickableBlotSpec;
|
|
19701
|
-
}
|
|
19693
|
+
UnclickableBlotSpec$1.default = UnclickableBlotSpec;
|
|
19702
19694
|
|
|
19703
19695
|
var hasRequiredIframeVideoSpec;
|
|
19704
19696
|
|
|
@@ -19710,7 +19702,7 @@
|
|
|
19710
19702
|
value: true
|
|
19711
19703
|
});
|
|
19712
19704
|
|
|
19713
|
-
var _UnclickableBlotSpec2 =
|
|
19705
|
+
var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
|
|
19714
19706
|
|
|
19715
19707
|
var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
|
|
19716
19708
|
|
|
@@ -19937,7 +19929,7 @@
|
|
|
19937
19929
|
}
|
|
19938
19930
|
});
|
|
19939
19931
|
|
|
19940
|
-
var _UnclickableBlotSpec =
|
|
19932
|
+
var _UnclickableBlotSpec = UnclickableBlotSpec$1;
|
|
19941
19933
|
|
|
19942
19934
|
Object.defineProperty(exports, 'UnclickableBlotSpec', {
|
|
19943
19935
|
enumerable: true,
|
|
@@ -20174,10 +20166,14 @@
|
|
|
20174
20166
|
setup: (props, ctx) => {
|
|
20175
20167
|
vue.onMounted(() => {
|
|
20176
20168
|
initialize();
|
|
20177
|
-
|
|
20178
|
-
|
|
20169
|
+
console.log("onMounted handleGlobalClick");
|
|
20170
|
+
vue.nextTick(() => {
|
|
20171
|
+
window.addEventListener('click', handleGlobalClick, true);
|
|
20172
|
+
window.addEventListener('keyup', handleGlobalKeyup, true);
|
|
20173
|
+
});
|
|
20179
20174
|
});
|
|
20180
20175
|
const removeQuillBlotFormatter = () => {
|
|
20176
|
+
console.log("removeQuillBlotFormatter");
|
|
20181
20177
|
try {
|
|
20182
20178
|
const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
|
|
20183
20179
|
if (blotFormatter && blotFormatter.overlay) {
|
|
@@ -20192,12 +20188,14 @@
|
|
|
20192
20188
|
}
|
|
20193
20189
|
};
|
|
20194
20190
|
const handleGlobalClick = (event) => {
|
|
20191
|
+
console.log("start handleGlobalClick");
|
|
20195
20192
|
if (!editor.value)
|
|
20196
20193
|
return;
|
|
20197
20194
|
const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
|
|
20198
20195
|
if (!blotFormatter || !blotFormatter.overlay)
|
|
20199
20196
|
return;
|
|
20200
20197
|
const isClickInsideEditor = editor.value.contains(event.target);
|
|
20198
|
+
console.log("isClickInsideEditor", isClickInsideEditor);
|
|
20201
20199
|
if (!isClickInsideEditor) {
|
|
20202
20200
|
removeQuillBlotFormatter();
|
|
20203
20201
|
}
|
|
@@ -20228,8 +20226,8 @@
|
|
|
20228
20226
|
});
|
|
20229
20227
|
};
|
|
20230
20228
|
vue.onBeforeUnmount(() => {
|
|
20231
|
-
|
|
20232
|
-
|
|
20229
|
+
window.removeEventListener('click', handleGlobalClick, true);
|
|
20230
|
+
window.removeEventListener('keyup', handleGlobalKeyup, true);
|
|
20233
20231
|
removeQuillBlotFormatter();
|
|
20234
20232
|
quill = null;
|
|
20235
20233
|
});
|