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/README.md +1 -1
- package/dist/overtype-webcomponent.esm.js +18 -4
- package/dist/overtype-webcomponent.esm.js.map +2 -2
- package/dist/overtype-webcomponent.js +18 -4
- package/dist/overtype-webcomponent.js.map +2 -2
- package/dist/overtype-webcomponent.min.js +34 -29
- package/dist/overtype.cjs +18 -4
- package/dist/overtype.cjs.map +2 -2
- package/dist/overtype.esm.js +18 -4
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +18 -4
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +60 -55
- package/package.json +1 -1
- package/src/overtype.js +25 -17
- package/src/styles.js +5 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v2.3.
|
|
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
|
|
@@ -1678,6 +1678,11 @@ function generateStyles(options = {}) {
|
|
|
1678
1678
|
cursor: text !important;
|
|
1679
1679
|
}
|
|
1680
1680
|
|
|
1681
|
+
.overtype-container.overtype-auto-resize[data-mode="preview"] .overtype-preview {
|
|
1682
|
+
position: static !important;
|
|
1683
|
+
height: auto !important;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1681
1686
|
/* Hide syntax markers in preview mode */
|
|
1682
1687
|
.overtype-container[data-mode="preview"] .syntax-marker {
|
|
1683
1688
|
display: none !important;
|
|
@@ -5584,9 +5589,15 @@ var _OverType = class _OverType {
|
|
|
5584
5589
|
const textarea = this.textarea;
|
|
5585
5590
|
const preview = this.preview;
|
|
5586
5591
|
const wrapper = this.wrapper;
|
|
5587
|
-
const
|
|
5588
|
-
|
|
5589
|
-
|
|
5592
|
+
const isPreviewMode = this.container.dataset.mode === "preview";
|
|
5593
|
+
if (isPreviewMode) {
|
|
5594
|
+
wrapper.style.removeProperty("height");
|
|
5595
|
+
preview.style.removeProperty("height");
|
|
5596
|
+
preview.style.removeProperty("overflow-y");
|
|
5597
|
+
textarea.style.removeProperty("height");
|
|
5598
|
+
textarea.style.removeProperty("overflow-y");
|
|
5599
|
+
return;
|
|
5600
|
+
}
|
|
5590
5601
|
const scrollTop = textarea.scrollTop;
|
|
5591
5602
|
wrapper.style.setProperty("height", "auto", "important");
|
|
5592
5603
|
textarea.style.setProperty("height", "auto", "important");
|
|
@@ -5640,6 +5651,7 @@ var _OverType = class _OverType {
|
|
|
5640
5651
|
showNormalEditMode() {
|
|
5641
5652
|
this.container.dataset.mode = "normal";
|
|
5642
5653
|
this.updatePreview();
|
|
5654
|
+
this._updateAutoHeight();
|
|
5643
5655
|
requestAnimationFrame(() => {
|
|
5644
5656
|
this.textarea.scrollTop = this.preview.scrollTop;
|
|
5645
5657
|
this.textarea.scrollLeft = this.preview.scrollLeft;
|
|
@@ -5652,6 +5664,7 @@ var _OverType = class _OverType {
|
|
|
5652
5664
|
*/
|
|
5653
5665
|
showPlainTextarea() {
|
|
5654
5666
|
this.container.dataset.mode = "plain";
|
|
5667
|
+
this._updateAutoHeight();
|
|
5655
5668
|
if (this.toolbar) {
|
|
5656
5669
|
const toggleBtn = this.container.querySelector('[data-action="toggle-plain"]');
|
|
5657
5670
|
if (toggleBtn) {
|
|
@@ -5668,6 +5681,7 @@ var _OverType = class _OverType {
|
|
|
5668
5681
|
showPreviewMode() {
|
|
5669
5682
|
this.container.dataset.mode = "preview";
|
|
5670
5683
|
this.updatePreview();
|
|
5684
|
+
this._updateAutoHeight();
|
|
5671
5685
|
return this;
|
|
5672
5686
|
}
|
|
5673
5687
|
/**
|