pxx-vue-quill 1.0.100 → 1.0.101

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