overtype 2.3.2 → 2.3.4

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OverType v2.3.2
2
+ * OverType v2.3.4
3
3
  * A lightweight markdown editor library with perfect WYSIWYG alignment
4
4
  * @license MIT
5
5
  * @author David Miranda
@@ -1701,6 +1701,11 @@ var OverTypeEditor = (() => {
1701
1701
  cursor: text !important;
1702
1702
  }
1703
1703
 
1704
+ .overtype-container.overtype-auto-resize[data-mode="preview"] .overtype-preview {
1705
+ position: static !important;
1706
+ height: auto !important;
1707
+ }
1708
+
1704
1709
  /* Hide syntax markers in preview mode */
1705
1710
  .overtype-container[data-mode="preview"] .syntax-marker {
1706
1711
  display: none !important;
@@ -5607,9 +5612,15 @@ ${blockSuffix}` : suffix;
5607
5612
  const textarea = this.textarea;
5608
5613
  const preview = this.preview;
5609
5614
  const wrapper = this.wrapper;
5610
- const computed = window.getComputedStyle(textarea);
5611
- const paddingTop = parseFloat(computed.paddingTop);
5612
- const paddingBottom = parseFloat(computed.paddingBottom);
5615
+ const isPreviewMode = this.container.dataset.mode === "preview";
5616
+ if (isPreviewMode) {
5617
+ wrapper.style.removeProperty("height");
5618
+ preview.style.removeProperty("height");
5619
+ preview.style.removeProperty("overflow-y");
5620
+ textarea.style.removeProperty("height");
5621
+ textarea.style.removeProperty("overflow-y");
5622
+ return;
5623
+ }
5613
5624
  const scrollTop = textarea.scrollTop;
5614
5625
  wrapper.style.setProperty("height", "auto", "important");
5615
5626
  textarea.style.setProperty("height", "auto", "important");
@@ -5663,6 +5674,7 @@ ${blockSuffix}` : suffix;
5663
5674
  showNormalEditMode() {
5664
5675
  this.container.dataset.mode = "normal";
5665
5676
  this.updatePreview();
5677
+ this._updateAutoHeight();
5666
5678
  requestAnimationFrame(() => {
5667
5679
  this.textarea.scrollTop = this.preview.scrollTop;
5668
5680
  this.textarea.scrollLeft = this.preview.scrollLeft;
@@ -5675,6 +5687,7 @@ ${blockSuffix}` : suffix;
5675
5687
  */
5676
5688
  showPlainTextarea() {
5677
5689
  this.container.dataset.mode = "plain";
5690
+ this._updateAutoHeight();
5678
5691
  if (this.toolbar) {
5679
5692
  const toggleBtn = this.container.querySelector('[data-action="toggle-plain"]');
5680
5693
  if (toggleBtn) {
@@ -5691,6 +5704,7 @@ ${blockSuffix}` : suffix;
5691
5704
  showPreviewMode() {
5692
5705
  this.container.dataset.mode = "preview";
5693
5706
  this.updatePreview();
5707
+ this._updateAutoHeight();
5694
5708
  return this;
5695
5709
  }
5696
5710
  /**