overtype 2.3.4 → 2.3.5
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 +3 -3
- package/dist/overtype-webcomponent.esm.js +31 -2
- package/dist/overtype-webcomponent.esm.js.map +2 -2
- package/dist/overtype-webcomponent.js +31 -2
- package/dist/overtype-webcomponent.js.map +2 -2
- package/dist/overtype-webcomponent.min.js +20 -10
- package/dist/overtype.cjs +15 -1
- package/dist/overtype.cjs.map +2 -2
- package/dist/overtype.esm.js +15 -1
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +15 -1
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +16 -6
- package/package.json +3 -2
- package/src/overtype-webcomponent.js +17 -1
- package/src/overtype.js +6 -0
- package/src/styles.js +10 -0
package/dist/overtype.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v2.3.
|
|
2
|
+
* OverType v2.3.5
|
|
3
3
|
* A lightweight markdown editor library with perfect WYSIWYG alignment
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author David Miranda
|
|
@@ -1241,6 +1241,16 @@ function generateStyles(options = {}) {
|
|
|
1241
1241
|
-ms-user-select: none !important;
|
|
1242
1242
|
}
|
|
1243
1243
|
|
|
1244
|
+
/* Prevent external resets (Tailwind, Bootstrap, etc.) from breaking alignment.
|
|
1245
|
+
Any element whose font metrics differ from the textarea causes the CSS "strut"
|
|
1246
|
+
to inflate line boxes, drifting the overlay. Force inheritance so every element
|
|
1247
|
+
inside the preview matches the textarea exactly. */
|
|
1248
|
+
.overtype-wrapper .overtype-preview * {
|
|
1249
|
+
font-family: inherit !important;
|
|
1250
|
+
font-size: inherit !important;
|
|
1251
|
+
line-height: inherit !important;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1244
1254
|
/* Defensive styles for preview child divs */
|
|
1245
1255
|
.overtype-wrapper .overtype-preview div {
|
|
1246
1256
|
/* Reset any inherited styles */
|
|
@@ -4751,6 +4761,7 @@ var _OverType = class _OverType {
|
|
|
4751
4761
|
// Callbacks
|
|
4752
4762
|
onChange: null,
|
|
4753
4763
|
onKeydown: null,
|
|
4764
|
+
onRender: null,
|
|
4754
4765
|
// Features
|
|
4755
4766
|
showActiveLineRaw: false,
|
|
4756
4767
|
showStats: false,
|
|
@@ -5149,6 +5160,9 @@ var _OverType = class _OverType {
|
|
|
5149
5160
|
if (this.options.onChange && this.initialized) {
|
|
5150
5161
|
this.options.onChange(text, this);
|
|
5151
5162
|
}
|
|
5163
|
+
if (this.options.onRender) {
|
|
5164
|
+
this.options.onRender(this.preview, isPreviewMode ? "preview" : "normal", this);
|
|
5165
|
+
}
|
|
5152
5166
|
}
|
|
5153
5167
|
/**
|
|
5154
5168
|
* Apply background styling to code blocks
|