pxx-vue-quill 1.0.80 → 1.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2025 Pxx-Team
9
9
  * Released under the MIT license
10
- * Date: 2025-09-08T03:17:09.380Z
10
+ * Date: 2025-09-08T03:55:16.043Z
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
- function requireUnclickableBlotSpec () {
19557
- if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
19558
- hasRequiredUnclickableBlotSpec = 1;
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
- var _BlotSpec2 = requireBlotSpec();
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
- var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19560
+ var _BlotSpec2 = requireBlotSpec();
19569
19561
 
19570
- var _BlotFormatter = requireBlotFormatter();
19562
+ var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19571
19563
 
19572
- _interopRequireDefault(_BlotFormatter);
19564
+ var _BlotFormatter = requireBlotFormatter();
19573
19565
 
19574
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19566
+ _interopRequireDefault(_BlotFormatter);
19575
19567
 
19576
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19568
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19577
19569
 
19578
- 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; }
19570
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19579
19571
 
19580
- 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; }
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
- var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
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
- var UnclickableBlotSpec$1 = function (_BlotSpec) {
19586
- _inherits(UnclickableBlotSpec, _BlotSpec);
19576
+ var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19577
+ var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19587
19578
 
19588
- function UnclickableBlotSpec(formatter, selector) {
19589
- _classCallCheck(this, UnclickableBlotSpec);
19579
+ var UnclickableBlotSpec = function (_BlotSpec) {
19580
+ _inherits(UnclickableBlotSpec, _BlotSpec);
19590
19581
 
19591
- var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19582
+ function UnclickableBlotSpec(formatter, selector) {
19583
+ _classCallCheck(this, UnclickableBlotSpec);
19592
19584
 
19593
- _this.onTextChange = function () {
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
- _this.onMouseEnter = function (event) {
19601
- var unclickable = event.target;
19602
- if (!(unclickable instanceof HTMLElement)) {
19603
- return;
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
- _this.nextUnclickable = unclickable;
19607
- _this.repositionProxyImage(_this.nextUnclickable);
19608
- };
19594
+ _this.onMouseEnter = function (event) {
19595
+ var unclickable = event.target;
19596
+ if (!(unclickable instanceof HTMLElement)) {
19597
+ return;
19598
+ }
19609
19599
 
19610
- _this.onProxyImageClick = function () {
19611
- _this.unclickable = _this.nextUnclickable;
19612
- _this.nextUnclickable = null;
19613
- _this.formatter.show(_this);
19614
- _this.hideProxyImage();
19615
- };
19600
+ _this.nextUnclickable = unclickable;
19601
+ _this.repositionProxyImage(_this.nextUnclickable);
19602
+ };
19616
19603
 
19617
- _this.selector = selector;
19618
- _this.unclickable = null;
19619
- _this.nextUnclickable = null;
19620
- return _this;
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
- _createClass(UnclickableBlotSpec, [{
19624
- key: 'init',
19625
- value: function init() {
19626
- if (document.body) {
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
- this.hideProxyImage();
19635
- this.proxyImage.addEventListener('click', this.onProxyImageClick);
19636
- this.formatter.quill.on('text-change', this.onTextChange);
19637
- }
19638
- }, {
19639
- key: 'getTargetElement',
19640
- value: function getTargetElement() {
19641
- return this.unclickable;
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
- return this.proxyImage;
19673
- }
19674
- }, {
19675
- key: 'hideProxyImage',
19676
- value: function hideProxyImage() {
19677
- Object.assign(this.proxyImage.style, {
19678
- display: 'none'
19679
- });
19680
- }
19681
- }, {
19682
- key: 'repositionProxyImage',
19683
- value: function repositionProxyImage(unclickable) {
19684
- var rect = unclickable.getBoundingClientRect();
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
- Object.assign(this.proxyImage.style, {
19687
- display: 'block',
19688
- left: rect.left + window.pageXOffset + 'px',
19689
- top: rect.top + window.pageYOffset + 'px',
19690
- width: rect.width + 'px',
19691
- height: rect.height + 'px'
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
- return UnclickableBlotSpec;
19697
- }(_BlotSpec3.default);
19690
+ return UnclickableBlotSpec;
19691
+ }(_BlotSpec3.default);
19698
19692
 
19699
- UnclickableBlotSpec.default = UnclickableBlotSpec$1;
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 = requireUnclickableBlotSpec();
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 = requireUnclickableBlotSpec();
19932
+ var _UnclickableBlotSpec = UnclickableBlotSpec$1;
19941
19933
 
19942
19934
  Object.defineProperty(exports, 'UnclickableBlotSpec', {
19943
19935
  enumerable: true,
@@ -20174,10 +20166,12 @@
20174
20166
  setup: (props, ctx) => {
20175
20167
  vue.onMounted(() => {
20176
20168
  initialize();
20169
+ console.log("onMounted handleGlobalClick");
20177
20170
  document.addEventListener('click', handleGlobalClick);
20178
20171
  document.addEventListener('keyup', handleGlobalKeyup, true);
20179
20172
  });
20180
20173
  const removeQuillBlotFormatter = () => {
20174
+ console.log("removeQuillBlotFormatter");
20181
20175
  try {
20182
20176
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20183
20177
  if (blotFormatter && blotFormatter.overlay) {
@@ -20192,12 +20186,14 @@
20192
20186
  }
20193
20187
  };
20194
20188
  const handleGlobalClick = (event) => {
20189
+ console.log("start handleGlobalClick", editor.value);
20195
20190
  if (!editor.value)
20196
20191
  return;
20197
20192
  const blotFormatter = quill === null || quill === void 0 ? void 0 : quill.getModule('blotFormatter');
20198
20193
  if (!blotFormatter || !blotFormatter.overlay)
20199
20194
  return;
20200
20195
  const isClickInsideEditor = editor.value.contains(event.target);
20196
+ console.log("isClickInsideEditor", isClickInsideEditor);
20201
20197
  if (!isClickInsideEditor) {
20202
20198
  removeQuillBlotFormatter();
20203
20199
  }