pxx-vue-quill 1.0.157 → 1.0.158

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-11T19:06:20.916Z
10
+ * Date: 2025-09-11T19:42:07.160Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -18994,11 +18994,11 @@
18994
18994
  value: true
18995
18995
  });
18996
18996
 
18997
- 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; }; }();
18997
+ 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; }; }();
18998
18998
 
18999
18999
  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; }
19000
19000
 
19001
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19001
+ function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19002
19002
 
19003
19003
  var LEFT_ALIGN = 'left';
19004
19004
  var CENTER_ALIGN = 'center';
@@ -19009,7 +19009,7 @@
19009
19009
  var _this = this,
19010
19010
  _alignments;
19011
19011
 
19012
- _classCallCheck(this, DefaultAligner);
19012
+ _classCallCheck$1(this, DefaultAligner);
19013
19013
 
19014
19014
  this.applyStyle = options.aligner.applyStyle;
19015
19015
  this.alignAttribute = options.attribute;
@@ -19037,7 +19037,7 @@
19037
19037
  }), _alignments);
19038
19038
  }
19039
19039
 
19040
- _createClass(DefaultAligner, [{
19040
+ _createClass$1(DefaultAligner, [{
19041
19041
  key: 'getAlignments',
19042
19042
  value: function getAlignments() {
19043
19043
  var _this2 = this;
@@ -19762,156 +19762,148 @@
19762
19762
 
19763
19763
  var IframeVideoSpec = {};
19764
19764
 
19765
- var UnclickableBlotSpec = {};
19766
-
19767
- var hasRequiredUnclickableBlotSpec;
19765
+ var UnclickableBlotSpec$1 = {};
19768
19766
 
19769
- function requireUnclickableBlotSpec () {
19770
- if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
19771
- hasRequiredUnclickableBlotSpec = 1;
19772
-
19773
- Object.defineProperty(UnclickableBlotSpec, "__esModule", {
19774
- value: true
19775
- });
19776
-
19777
- 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; }; }();
19767
+ Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
19768
+ value: true
19769
+ });
19778
19770
 
19779
- var _BlotSpec2 = requireBlotSpec();
19771
+ 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; }; }();
19780
19772
 
19781
- var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19773
+ var _BlotSpec2 = requireBlotSpec();
19782
19774
 
19783
- var _BlotFormatter = requireBlotFormatter();
19775
+ var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19784
19776
 
19785
- _interopRequireDefault(_BlotFormatter);
19777
+ var _BlotFormatter = requireBlotFormatter();
19786
19778
 
19787
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19779
+ _interopRequireDefault(_BlotFormatter);
19788
19780
 
19789
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19781
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19790
19782
 
19791
- 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; }
19783
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19792
19784
 
19793
- 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; }
19785
+ 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; }
19794
19786
 
19795
- var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19796
- var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19787
+ 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; }
19797
19788
 
19798
- var UnclickableBlotSpec$1 = function (_BlotSpec) {
19799
- _inherits(UnclickableBlotSpec, _BlotSpec);
19789
+ var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19790
+ var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19800
19791
 
19801
- function UnclickableBlotSpec(formatter, selector) {
19802
- _classCallCheck(this, UnclickableBlotSpec);
19792
+ var UnclickableBlotSpec = function (_BlotSpec) {
19793
+ _inherits(UnclickableBlotSpec, _BlotSpec);
19803
19794
 
19804
- var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19795
+ function UnclickableBlotSpec(formatter, selector) {
19796
+ _classCallCheck(this, UnclickableBlotSpec);
19805
19797
 
19806
- _this.onTextChange = function () {
19807
- Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19808
- unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19809
- unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19810
- });
19811
- };
19798
+ var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19812
19799
 
19813
- _this.onMouseEnter = function (event) {
19814
- var unclickable = event.target;
19815
- if (!(unclickable instanceof HTMLElement)) {
19816
- return;
19817
- }
19800
+ _this.onTextChange = function () {
19801
+ Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19802
+ unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19803
+ unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19804
+ });
19805
+ };
19818
19806
 
19819
- _this.nextUnclickable = unclickable;
19820
- _this.repositionProxyImage(_this.nextUnclickable);
19821
- };
19807
+ _this.onMouseEnter = function (event) {
19808
+ var unclickable = event.target;
19809
+ if (!(unclickable instanceof HTMLElement)) {
19810
+ return;
19811
+ }
19822
19812
 
19823
- _this.onProxyImageClick = function () {
19824
- _this.unclickable = _this.nextUnclickable;
19825
- _this.nextUnclickable = null;
19826
- _this.formatter.show(_this);
19827
- _this.hideProxyImage();
19828
- };
19813
+ _this.nextUnclickable = unclickable;
19814
+ _this.repositionProxyImage(_this.nextUnclickable);
19815
+ };
19829
19816
 
19830
- _this.selector = selector;
19831
- _this.unclickable = null;
19832
- _this.nextUnclickable = null;
19833
- return _this;
19834
- }
19817
+ _this.onProxyImageClick = function () {
19818
+ _this.unclickable = _this.nextUnclickable;
19819
+ _this.nextUnclickable = null;
19820
+ _this.formatter.show(_this);
19821
+ _this.hideProxyImage();
19822
+ };
19835
19823
 
19836
- _createClass(UnclickableBlotSpec, [{
19837
- key: 'init',
19838
- value: function init() {
19839
- if (document.body) {
19840
- /*
19841
- it's important that this is attached to the body instead of the root quill element.
19842
- this prevents the click event from overlapping with ImageSpec
19843
- */
19844
- document.body.appendChild(this.createProxyImage());
19845
- }
19824
+ _this.selector = selector;
19825
+ _this.unclickable = null;
19826
+ _this.nextUnclickable = null;
19827
+ return _this;
19828
+ }
19846
19829
 
19847
- this.hideProxyImage();
19848
- this.proxyImage.addEventListener('click', this.onProxyImageClick);
19849
- this.formatter.quill.on('text-change', this.onTextChange);
19850
- }
19851
- }, {
19852
- key: 'getTargetElement',
19853
- value: function getTargetElement() {
19854
- return this.unclickable;
19855
- }
19856
- }, {
19857
- key: 'getOverlayElement',
19858
- value: function getOverlayElement() {
19859
- return this.unclickable;
19860
- }
19861
- }, {
19862
- key: 'onHide',
19863
- value: function onHide() {
19864
- this.hideProxyImage();
19865
- this.nextUnclickable = null;
19866
- this.unclickable = null;
19867
- }
19868
- }, {
19869
- key: 'createProxyImage',
19870
- value: function createProxyImage() {
19871
- var canvas = document.createElement('canvas');
19872
- var context = canvas.getContext('2d');
19873
- context.globalAlpha = 0;
19874
- context.fillRect(0, 0, 1, 1);
19875
-
19876
- this.proxyImage = document.createElement('img');
19877
- this.proxyImage.src = canvas.toDataURL('image/png');
19878
- this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19879
-
19880
- Object.assign(this.proxyImage.style, {
19881
- position: 'absolute',
19882
- margin: '0'
19883
- });
19830
+ _createClass(UnclickableBlotSpec, [{
19831
+ key: 'init',
19832
+ value: function init() {
19833
+ if (document.body) {
19834
+ /*
19835
+ it's important that this is attached to the body instead of the root quill element.
19836
+ this prevents the click event from overlapping with ImageSpec
19837
+ */
19838
+ document.body.appendChild(this.createProxyImage());
19839
+ }
19884
19840
 
19885
- return this.proxyImage;
19886
- }
19887
- }, {
19888
- key: 'hideProxyImage',
19889
- value: function hideProxyImage() {
19890
- Object.assign(this.proxyImage.style, {
19891
- display: 'none'
19892
- });
19893
- }
19894
- }, {
19895
- key: 'repositionProxyImage',
19896
- value: function repositionProxyImage(unclickable) {
19897
- var rect = unclickable.getBoundingClientRect();
19841
+ this.hideProxyImage();
19842
+ this.proxyImage.addEventListener('click', this.onProxyImageClick);
19843
+ this.formatter.quill.on('text-change', this.onTextChange);
19844
+ }
19845
+ }, {
19846
+ key: 'getTargetElement',
19847
+ value: function getTargetElement() {
19848
+ return this.unclickable;
19849
+ }
19850
+ }, {
19851
+ key: 'getOverlayElement',
19852
+ value: function getOverlayElement() {
19853
+ return this.unclickable;
19854
+ }
19855
+ }, {
19856
+ key: 'onHide',
19857
+ value: function onHide() {
19858
+ this.hideProxyImage();
19859
+ this.nextUnclickable = null;
19860
+ this.unclickable = null;
19861
+ }
19862
+ }, {
19863
+ key: 'createProxyImage',
19864
+ value: function createProxyImage() {
19865
+ var canvas = document.createElement('canvas');
19866
+ var context = canvas.getContext('2d');
19867
+ context.globalAlpha = 0;
19868
+ context.fillRect(0, 0, 1, 1);
19869
+
19870
+ this.proxyImage = document.createElement('img');
19871
+ this.proxyImage.src = canvas.toDataURL('image/png');
19872
+ this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19873
+
19874
+ Object.assign(this.proxyImage.style, {
19875
+ position: 'absolute',
19876
+ margin: '0'
19877
+ });
19898
19878
 
19899
- Object.assign(this.proxyImage.style, {
19900
- display: 'block',
19901
- left: rect.left + window.pageXOffset + 'px',
19902
- top: rect.top + window.pageYOffset + 'px',
19903
- width: rect.width + 'px',
19904
- height: rect.height + 'px'
19905
- });
19906
- }
19907
- }]);
19879
+ return this.proxyImage;
19880
+ }
19881
+ }, {
19882
+ key: 'hideProxyImage',
19883
+ value: function hideProxyImage() {
19884
+ Object.assign(this.proxyImage.style, {
19885
+ display: 'none'
19886
+ });
19887
+ }
19888
+ }, {
19889
+ key: 'repositionProxyImage',
19890
+ value: function repositionProxyImage(unclickable) {
19891
+ var rect = unclickable.getBoundingClientRect();
19892
+
19893
+ Object.assign(this.proxyImage.style, {
19894
+ display: 'block',
19895
+ left: rect.left + window.pageXOffset + 'px',
19896
+ top: rect.top + window.pageYOffset + 'px',
19897
+ width: rect.width + 'px',
19898
+ height: rect.height + 'px'
19899
+ });
19900
+ }
19901
+ }]);
19908
19902
 
19909
- return UnclickableBlotSpec;
19910
- }(_BlotSpec3.default);
19903
+ return UnclickableBlotSpec;
19904
+ }(_BlotSpec3.default);
19911
19905
 
19912
- UnclickableBlotSpec.default = UnclickableBlotSpec$1;
19913
- return UnclickableBlotSpec;
19914
- }
19906
+ UnclickableBlotSpec$1.default = UnclickableBlotSpec;
19915
19907
 
19916
19908
  var hasRequiredIframeVideoSpec;
19917
19909
 
@@ -19923,7 +19915,7 @@
19923
19915
  value: true
19924
19916
  });
19925
19917
 
19926
- var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
19918
+ var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
19927
19919
 
19928
19920
  var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
19929
19921
 
@@ -20150,7 +20142,7 @@
20150
20142
  }
20151
20143
  });
20152
20144
 
20153
- var _UnclickableBlotSpec = requireUnclickableBlotSpec();
20145
+ var _UnclickableBlotSpec = UnclickableBlotSpec$1;
20154
20146
 
20155
20147
  Object.defineProperty(exports, 'UnclickableBlotSpec', {
20156
20148
  enumerable: true,
@@ -21108,7 +21100,7 @@
21108
21100
  savedRange.value = null;
21109
21101
  };
21110
21102
  vue.watch(() => props.content, (newContent) => {
21111
- if (!quill)
21103
+ if (!quill || internalModelEquals(newContent))
21112
21104
  return;
21113
21105
  const selection = quill.getSelection();
21114
21106
  if (selection) {