overtype 2.3.1 → 2.3.3
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-webcomponent.esm.js +9 -6
- package/dist/overtype-webcomponent.esm.js.map +2 -2
- package/dist/overtype-webcomponent.js +9 -6
- package/dist/overtype-webcomponent.js.map +2 -2
- package/dist/overtype-webcomponent.min.js +29 -29
- package/dist/overtype.cjs +9 -6
- package/dist/overtype.cjs.map +2 -2
- package/dist/overtype.esm.js +9 -6
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +9 -6
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +29 -29
- package/package.json +1 -1
- package/src/overtype.js +15 -13
package/dist/overtype.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v2.3.
|
|
2
|
+
* OverType v2.3.3
|
|
3
3
|
* A lightweight markdown editor library with perfect WYSIWYG alignment
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author David Miranda
|
|
@@ -5610,12 +5610,12 @@ ${blockSuffix}` : suffix;
|
|
|
5610
5610
|
const textarea = this.textarea;
|
|
5611
5611
|
const preview = this.preview;
|
|
5612
5612
|
const wrapper = this.wrapper;
|
|
5613
|
-
const
|
|
5614
|
-
const
|
|
5615
|
-
|
|
5616
|
-
|
|
5613
|
+
const isPreviewMode = this.container.dataset.mode === "preview";
|
|
5614
|
+
const scrollTop = isPreviewMode ? preview.scrollTop : textarea.scrollTop;
|
|
5615
|
+
wrapper.style.setProperty("height", "auto", "important");
|
|
5616
|
+
preview.style.setProperty("height", "auto", "important");
|
|
5617
5617
|
textarea.style.setProperty("height", "auto", "important");
|
|
5618
|
-
let newHeight = textarea.scrollHeight;
|
|
5618
|
+
let newHeight = isPreviewMode ? preview.scrollHeight : textarea.scrollHeight;
|
|
5619
5619
|
if (this.options.minHeight) {
|
|
5620
5620
|
const minHeight = parseInt(this.options.minHeight);
|
|
5621
5621
|
newHeight = Math.max(newHeight, minHeight);
|
|
@@ -5665,6 +5665,7 @@ ${blockSuffix}` : suffix;
|
|
|
5665
5665
|
showNormalEditMode() {
|
|
5666
5666
|
this.container.dataset.mode = "normal";
|
|
5667
5667
|
this.updatePreview();
|
|
5668
|
+
this._updateAutoHeight();
|
|
5668
5669
|
requestAnimationFrame(() => {
|
|
5669
5670
|
this.textarea.scrollTop = this.preview.scrollTop;
|
|
5670
5671
|
this.textarea.scrollLeft = this.preview.scrollLeft;
|
|
@@ -5677,6 +5678,7 @@ ${blockSuffix}` : suffix;
|
|
|
5677
5678
|
*/
|
|
5678
5679
|
showPlainTextarea() {
|
|
5679
5680
|
this.container.dataset.mode = "plain";
|
|
5681
|
+
this._updateAutoHeight();
|
|
5680
5682
|
if (this.toolbar) {
|
|
5681
5683
|
const toggleBtn = this.container.querySelector('[data-action="toggle-plain"]');
|
|
5682
5684
|
if (toggleBtn) {
|
|
@@ -5693,6 +5695,7 @@ ${blockSuffix}` : suffix;
|
|
|
5693
5695
|
showPreviewMode() {
|
|
5694
5696
|
this.container.dataset.mode = "preview";
|
|
5695
5697
|
this.updatePreview();
|
|
5698
|
+
this._updateAutoHeight();
|
|
5696
5699
|
return this;
|
|
5697
5700
|
}
|
|
5698
5701
|
/**
|