overtype 2.3.5 → 2.3.6
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 +4 -4
- package/dist/overtype-webcomponent.esm.js +35 -37
- package/dist/overtype-webcomponent.esm.js.map +2 -2
- package/dist/overtype-webcomponent.js +35 -37
- package/dist/overtype-webcomponent.js.map +2 -2
- package/dist/overtype-webcomponent.min.js +15 -24
- package/dist/overtype.cjs +35 -37
- package/dist/overtype.cjs.map +2 -2
- package/dist/overtype.esm.js +35 -37
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +35 -37
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +11 -20
- package/package.json +1 -1
- package/src/overtype.js +28 -21
- package/src/styles.js +9 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v2.3.
|
|
2
|
+
* OverType v2.3.6
|
|
3
3
|
* A lightweight markdown editor library with perfect WYSIWYG alignment
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author David Miranda
|
|
@@ -1129,9 +1129,9 @@ var OverTypeEditor = (() => {
|
|
|
1129
1129
|
left: 0 !important;
|
|
1130
1130
|
width: 100% !important;
|
|
1131
1131
|
height: 100% !important;
|
|
1132
|
-
|
|
1132
|
+
|
|
1133
1133
|
/* Font properties - any difference breaks alignment */
|
|
1134
|
-
font-family: ${fontFamily} !important;
|
|
1134
|
+
font-family: var(--instance-font-family, ${fontFamily}) !important;
|
|
1135
1135
|
font-variant-ligatures: none !important; /* keep metrics stable for code */
|
|
1136
1136
|
font-size: var(--instance-font-size, ${fontSize}) !important;
|
|
1137
1137
|
line-height: var(--instance-line-height, ${lineHeight}) !important;
|
|
@@ -1238,15 +1238,12 @@ var OverTypeEditor = (() => {
|
|
|
1238
1238
|
z-index: 0 !important;
|
|
1239
1239
|
pointer-events: none !important;
|
|
1240
1240
|
user-select: none !important;
|
|
1241
|
-
font-family: ${fontFamily} !important;
|
|
1241
|
+
font-family: var(--instance-font-family, ${fontFamily}) !important;
|
|
1242
1242
|
font-size: var(--instance-font-size, ${fontSize}) !important;
|
|
1243
1243
|
line-height: var(--instance-line-height, ${lineHeight}) !important;
|
|
1244
1244
|
padding: var(--instance-padding, ${padding}) !important;
|
|
1245
1245
|
box-sizing: border-box !important;
|
|
1246
1246
|
color: var(--placeholder, #999) !important;
|
|
1247
|
-
overflow: hidden !important;
|
|
1248
|
-
white-space: nowrap !important;
|
|
1249
|
-
text-overflow: ellipsis !important;
|
|
1250
1247
|
}
|
|
1251
1248
|
|
|
1252
1249
|
/* Preview layer styles */
|
|
@@ -1399,7 +1396,7 @@ var OverTypeEditor = (() => {
|
|
|
1399
1396
|
.overtype-wrapper .overtype-preview pre code {
|
|
1400
1397
|
background: transparent !important;
|
|
1401
1398
|
color: var(--code, #0d3b66) !important;
|
|
1402
|
-
font-family: ${fontFamily} !important; /* Match textarea font exactly for alignment */
|
|
1399
|
+
font-family: var(--instance-font-family, ${fontFamily}) !important; /* Match textarea font exactly for alignment */
|
|
1403
1400
|
}
|
|
1404
1401
|
|
|
1405
1402
|
/* Blockquotes */
|
|
@@ -1484,26 +1481,20 @@ var OverTypeEditor = (() => {
|
|
|
1484
1481
|
.overtype-stats {
|
|
1485
1482
|
height: 40px !important;
|
|
1486
1483
|
padding: 0 20px !important;
|
|
1487
|
-
background: #f8f9fa !important;
|
|
1488
|
-
border-top: 1px solid #e0e0e0 !important;
|
|
1484
|
+
background: var(--bg-secondary, #f8f9fa) !important;
|
|
1485
|
+
border-top: 1px solid var(--border, #e0e0e0) !important;
|
|
1489
1486
|
display: flex !important;
|
|
1490
1487
|
justify-content: space-between !important;
|
|
1491
1488
|
align-items: center !important;
|
|
1492
1489
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
|
|
1493
1490
|
font-size: 0.85rem !important;
|
|
1494
|
-
color: #666 !important;
|
|
1491
|
+
color: var(--text-secondary, #666) !important;
|
|
1495
1492
|
flex-shrink: 0 !important; /* Don't shrink */
|
|
1496
1493
|
z-index: 10001 !important; /* Above link tooltip */
|
|
1497
1494
|
position: relative !important; /* Enable z-index */
|
|
1498
1495
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
.overtype-container[data-theme="cave"] .overtype-stats {
|
|
1502
|
-
background: var(--bg-secondary, #1D2D3E) !important;
|
|
1503
|
-
border-top: 1px solid rgba(197, 221, 232, 0.1) !important;
|
|
1504
|
-
color: var(--text, #c5dde8) !important;
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1496
|
+
|
|
1497
|
+
|
|
1507
1498
|
.overtype-stats .overtype-stat {
|
|
1508
1499
|
display: flex !important;
|
|
1509
1500
|
align-items: center !important;
|
|
@@ -4848,15 +4839,7 @@ ${blockSuffix}` : suffix;
|
|
|
4848
4839
|
return;
|
|
4849
4840
|
}
|
|
4850
4841
|
this.wrapper._instance = this;
|
|
4851
|
-
|
|
4852
|
-
this.wrapper.style.setProperty("--instance-font-size", this.options.fontSize);
|
|
4853
|
-
}
|
|
4854
|
-
if (this.options.lineHeight) {
|
|
4855
|
-
this.wrapper.style.setProperty("--instance-line-height", String(this.options.lineHeight));
|
|
4856
|
-
}
|
|
4857
|
-
if (this.options.padding) {
|
|
4858
|
-
this.wrapper.style.setProperty("--instance-padding", this.options.padding);
|
|
4859
|
-
}
|
|
4842
|
+
this._applyInstanceCSSVars();
|
|
4860
4843
|
this._configureTextarea();
|
|
4861
4844
|
this._applyOptions();
|
|
4862
4845
|
}
|
|
@@ -4904,15 +4887,7 @@ ${blockSuffix}` : suffix;
|
|
|
4904
4887
|
}
|
|
4905
4888
|
this.wrapper = document.createElement("div");
|
|
4906
4889
|
this.wrapper.className = "overtype-wrapper";
|
|
4907
|
-
|
|
4908
|
-
this.wrapper.style.setProperty("--instance-font-size", this.options.fontSize);
|
|
4909
|
-
}
|
|
4910
|
-
if (this.options.lineHeight) {
|
|
4911
|
-
this.wrapper.style.setProperty("--instance-line-height", String(this.options.lineHeight));
|
|
4912
|
-
}
|
|
4913
|
-
if (this.options.padding) {
|
|
4914
|
-
this.wrapper.style.setProperty("--instance-padding", this.options.padding);
|
|
4915
|
-
}
|
|
4890
|
+
this._applyInstanceCSSVars();
|
|
4916
4891
|
this.wrapper._instance = this;
|
|
4917
4892
|
this.textarea = document.createElement("textarea");
|
|
4918
4893
|
this.textarea.className = "overtype-input";
|
|
@@ -5026,11 +5001,34 @@ ${blockSuffix}` : suffix;
|
|
|
5026
5001
|
Object.assign(this.actionsById, buildActionsMap([toolbarButtons.upload]));
|
|
5027
5002
|
}
|
|
5028
5003
|
}
|
|
5004
|
+
/**
|
|
5005
|
+
* Apply instance-specific styles via CSS custom properties on the wrapper.
|
|
5006
|
+
* Called from init paths and from _applyOptions so reinit() propagates
|
|
5007
|
+
* font/padding changes.
|
|
5008
|
+
* @private
|
|
5009
|
+
*/
|
|
5010
|
+
_applyInstanceCSSVars() {
|
|
5011
|
+
if (!this.wrapper)
|
|
5012
|
+
return;
|
|
5013
|
+
if (this.options.fontSize) {
|
|
5014
|
+
this.wrapper.style.setProperty("--instance-font-size", this.options.fontSize);
|
|
5015
|
+
}
|
|
5016
|
+
if (this.options.lineHeight) {
|
|
5017
|
+
this.wrapper.style.setProperty("--instance-line-height", String(this.options.lineHeight));
|
|
5018
|
+
}
|
|
5019
|
+
if (this.options.padding) {
|
|
5020
|
+
this.wrapper.style.setProperty("--instance-padding", this.options.padding);
|
|
5021
|
+
}
|
|
5022
|
+
if (this.options.fontFamily) {
|
|
5023
|
+
this.wrapper.style.setProperty("--instance-font-family", this.options.fontFamily);
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5029
5026
|
/**
|
|
5030
5027
|
* Apply options to the editor
|
|
5031
5028
|
* @private
|
|
5032
5029
|
*/
|
|
5033
5030
|
_applyOptions() {
|
|
5031
|
+
this._applyInstanceCSSVars();
|
|
5034
5032
|
if (this.options.autofocus) {
|
|
5035
5033
|
this.textarea.focus();
|
|
5036
5034
|
}
|