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.
package/dist/overtype.js CHANGED
@@ -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
@@ -1704,6 +1704,11 @@ var OverType = (() => {
1704
1704
  cursor: text !important;
1705
1705
  }
1706
1706
 
1707
+ .overtype-container.overtype-auto-resize[data-mode="preview"] .overtype-preview {
1708
+ position: static !important;
1709
+ height: auto !important;
1710
+ }
1711
+
1707
1712
  /* Hide syntax markers in preview mode */
1708
1713
  .overtype-container[data-mode="preview"] .syntax-marker {
1709
1714
  display: none !important;
@@ -5610,9 +5615,15 @@ ${blockSuffix}` : suffix;
5610
5615
  const textarea = this.textarea;
5611
5616
  const preview = this.preview;
5612
5617
  const wrapper = this.wrapper;
5613
- const computed = window.getComputedStyle(textarea);
5614
- const paddingTop = parseFloat(computed.paddingTop);
5615
- const paddingBottom = parseFloat(computed.paddingBottom);
5618
+ const isPreviewMode = this.container.dataset.mode === "preview";
5619
+ if (isPreviewMode) {
5620
+ wrapper.style.removeProperty("height");
5621
+ preview.style.removeProperty("height");
5622
+ preview.style.removeProperty("overflow-y");
5623
+ textarea.style.removeProperty("height");
5624
+ textarea.style.removeProperty("overflow-y");
5625
+ return;
5626
+ }
5616
5627
  const scrollTop = textarea.scrollTop;
5617
5628
  wrapper.style.setProperty("height", "auto", "important");
5618
5629
  textarea.style.setProperty("height", "auto", "important");
@@ -5666,6 +5677,7 @@ ${blockSuffix}` : suffix;
5666
5677
  showNormalEditMode() {
5667
5678
  this.container.dataset.mode = "normal";
5668
5679
  this.updatePreview();
5680
+ this._updateAutoHeight();
5669
5681
  requestAnimationFrame(() => {
5670
5682
  this.textarea.scrollTop = this.preview.scrollTop;
5671
5683
  this.textarea.scrollLeft = this.preview.scrollLeft;
@@ -5678,6 +5690,7 @@ ${blockSuffix}` : suffix;
5678
5690
  */
5679
5691
  showPlainTextarea() {
5680
5692
  this.container.dataset.mode = "plain";
5693
+ this._updateAutoHeight();
5681
5694
  if (this.toolbar) {
5682
5695
  const toggleBtn = this.container.querySelector('[data-action="toggle-plain"]');
5683
5696
  if (toggleBtn) {
@@ -5694,6 +5707,7 @@ ${blockSuffix}` : suffix;
5694
5707
  showPreviewMode() {
5695
5708
  this.container.dataset.mode = "preview";
5696
5709
  this.updatePreview();
5710
+ this._updateAutoHeight();
5697
5711
  return this;
5698
5712
  }
5699
5713
  /**