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.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
|
|
@@ -1267,6 +1267,16 @@ var OverType = (() => {
|
|
|
1267
1267
|
-ms-user-select: none !important;
|
|
1268
1268
|
}
|
|
1269
1269
|
|
|
1270
|
+
/* Prevent external resets (Tailwind, Bootstrap, etc.) from breaking alignment.
|
|
1271
|
+
Any element whose font metrics differ from the textarea causes the CSS "strut"
|
|
1272
|
+
to inflate line boxes, drifting the overlay. Force inheritance so every element
|
|
1273
|
+
inside the preview matches the textarea exactly. */
|
|
1274
|
+
.overtype-wrapper .overtype-preview * {
|
|
1275
|
+
font-family: inherit !important;
|
|
1276
|
+
font-size: inherit !important;
|
|
1277
|
+
line-height: inherit !important;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1270
1280
|
/* Defensive styles for preview child divs */
|
|
1271
1281
|
.overtype-wrapper .overtype-preview div {
|
|
1272
1282
|
/* Reset any inherited styles */
|
|
@@ -4777,6 +4787,7 @@ ${blockSuffix}` : suffix;
|
|
|
4777
4787
|
// Callbacks
|
|
4778
4788
|
onChange: null,
|
|
4779
4789
|
onKeydown: null,
|
|
4790
|
+
onRender: null,
|
|
4780
4791
|
// Features
|
|
4781
4792
|
showActiveLineRaw: false,
|
|
4782
4793
|
showStats: false,
|
|
@@ -5175,6 +5186,9 @@ ${blockSuffix}` : suffix;
|
|
|
5175
5186
|
if (this.options.onChange && this.initialized) {
|
|
5176
5187
|
this.options.onChange(text, this);
|
|
5177
5188
|
}
|
|
5189
|
+
if (this.options.onRender) {
|
|
5190
|
+
this.options.onRender(this.preview, isPreviewMode ? "preview" : "normal", this);
|
|
5191
|
+
}
|
|
5178
5192
|
}
|
|
5179
5193
|
/**
|
|
5180
5194
|
* Apply background styling to code blocks
|