overtype 2.3.6 → 2.3.7
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 +7 -2
- package/dist/overtype-webcomponent.esm.js +18 -7
- package/dist/overtype-webcomponent.esm.js.map +2 -2
- package/dist/overtype-webcomponent.js +18 -7
- package/dist/overtype-webcomponent.js.map +2 -2
- package/dist/overtype-webcomponent.min.js +40 -40
- package/dist/overtype.cjs +18 -7
- package/dist/overtype.cjs.map +2 -2
- package/dist/overtype.esm.js +18 -7
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +18 -7
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +41 -41
- package/package.json +1 -1
- package/src/overtype.js +16 -6
- package/src/parser.js +3 -3
package/README.md
CHANGED
|
@@ -775,14 +775,19 @@ Special thanks to:
|
|
|
775
775
|
- [Kristián Kostecký](https://github.com/kristiankostecky) - Fixed toolbar option being ignored in reinit() ([#62](https://github.com/panphora/overtype/pull/62))
|
|
776
776
|
- [Lyric Wai](https://github.com/lyricat) - Fixed double-escaping of links ([#64](https://github.com/panphora/overtype/pull/64)), shared code block alignment fix ([#65](https://github.com/panphora/overtype/issues/65))
|
|
777
777
|
- [kozi](https://github.com/kozi) - Reported Firefox link tooltip bug ([#68](https://github.com/panphora/overtype/issues/68)), toolbar positioning ([#69](https://github.com/panphora/overtype/issues/69)), theme CSS variable issues ([#70](https://github.com/panphora/overtype/issues/70), [#71](https://github.com/panphora/overtype/issues/71))
|
|
778
|
-
- [1951FDG](https://github.com/1951FDG) - Reported unordered list rendering bug ([#74](https://github.com/panphora/overtype/issues/74)), suggested showStats() API improvement ([#77](https://github.com/panphora/overtype/issues/77))
|
|
779
|
-
- [nodesocket](https://github.com/nodesocket) - Reported toolbarButtons export issues ([#73](https://github.com/panphora/overtype/issues/73), [#78](https://github.com/panphora/overtype/issues/78)), suggested image toolbar button ([#89](https://github.com/panphora/overtype/issues/89))
|
|
778
|
+
- [1951FDG](https://github.com/1951FDG) - Reported unordered list rendering bug ([#74](https://github.com/panphora/overtype/issues/74)), suggested showStats() API improvement ([#77](https://github.com/panphora/overtype/issues/77)), reported placeholder CSS regression ([#102](https://github.com/panphora/overtype/issues/102))
|
|
779
|
+
- [nodesocket](https://github.com/nodesocket) - Reported toolbarButtons export issues ([#73](https://github.com/panphora/overtype/issues/73), [#78](https://github.com/panphora/overtype/issues/78)), suggested image toolbar button ([#89](https://github.com/panphora/overtype/issues/89)), reported custom theme stats bar styling ([#101](https://github.com/panphora/overtype/issues/101))
|
|
780
780
|
- [Travis Bell](https://github.com/travisbell) - Reported keyboard shortcuts bug in ESM build ([#80](https://github.com/panphora/overtype/issues/80))
|
|
781
781
|
- [fab2713](https://github.com/fab2713) - Reported italic rendering in lists ([#81](https://github.com/panphora/overtype/issues/81)), reinit maxHeight ([#82](https://github.com/panphora/overtype/issues/82)), placeholder visibility ([#83](https://github.com/panphora/overtype/issues/83)), suggested auto theme ([#84](https://github.com/panphora/overtype/issues/84)), relative URL prefix ([#85](https://github.com/panphora/overtype/issues/85)), minification improvements ([#94](https://github.com/panphora/overtype/issues/94))
|
|
782
782
|
- [oooo-ps](https://github.com/oooo-ps) - Reported remote script loading issue ([#86](https://github.com/panphora/overtype/issues/86))
|
|
783
783
|
- [ddarfantasy](https://github.com/ddarfantasy), [ThaUnknown](https://github.com/ThaUnknown) - Reported and debugged text misalignment caused by CSS framework font resets ([#91](https://github.com/panphora/overtype/issues/91))
|
|
784
784
|
- [milen-yordanov](https://github.com/milen-yordanov) - Reported code block colors ignoring theme in preview mode ([#97](https://github.com/panphora/overtype/issues/97))
|
|
785
785
|
- [asalimian](https://github.com/asalimian) - Reported spellcheck being disabled ([#98](https://github.com/panphora/overtype/issues/98))
|
|
786
|
+
- [be5invis](https://github.com/be5invis) - Reported reinit() not propagating fontSize changes ([#108](https://github.com/panphora/overtype/issues/108))
|
|
787
|
+
- [Danny Vink](https://github.com/dannyvink) - Fixed task list overlay alignment with spaced checkbox markers ([#109](https://github.com/panphora/overtype/pull/109))
|
|
788
|
+
- [yurivish](https://github.com/yurivish) - Reported fontFamily option not being applied ([#110](https://github.com/panphora/overtype/issues/110))
|
|
789
|
+
- [phinnaeus](https://github.com/phinnaeus) - Diagnosed missing fontFamily wiring ([#110](https://github.com/panphora/overtype/issues/110))
|
|
790
|
+
- [Tan Nhu](https://github.com/tnhu) - Fixed onChange feedback loop with async syntax highlighters ([#111](https://github.com/panphora/overtype/pull/111))
|
|
786
791
|
|
|
787
792
|
### TypeScript & Framework Support
|
|
788
793
|
- [merlinz01](https://github.com/merlinz01) - Contributed TypeScript declaration file ([#20](https://github.com/panphora/overtype/pull/20))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v2.3.
|
|
2
|
+
* OverType v2.3.7
|
|
3
3
|
* A lightweight markdown editor library with perfect WYSIWYG alignment
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author David Miranda
|
|
@@ -122,13 +122,13 @@ var MarkdownParser = class {
|
|
|
122
122
|
* @returns {string} Parsed task list item
|
|
123
123
|
*/
|
|
124
124
|
static parseTaskList(html, isPreviewMode = false) {
|
|
125
|
-
return html.replace(/^((?: )*)
|
|
125
|
+
return html.replace(/^((?: )*)-(\s+)\[([ xX])\](\s*)(.*)$/, (match, indent, spacingBeforeBox, checked, spacingAfterBox, content) => {
|
|
126
126
|
content = this.parseInlineElements(content);
|
|
127
127
|
if (isPreviewMode) {
|
|
128
128
|
const isChecked = checked.toLowerCase() === "x";
|
|
129
129
|
return `${indent}<li class="task-list"><input type="checkbox" ${isChecked ? "checked" : ""}> ${content}</li>`;
|
|
130
130
|
} else {
|
|
131
|
-
return `${indent}<li class="task-list"><span class="syntax-marker"
|
|
131
|
+
return `${indent}<li class="task-list"><span class="syntax-marker">-${spacingBeforeBox}[${checked}]${spacingAfterBox}</span>${content}</li>`;
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
}
|
|
@@ -4715,7 +4715,7 @@ var _OverType = class _OverType {
|
|
|
4715
4715
|
});
|
|
4716
4716
|
this.initialized = true;
|
|
4717
4717
|
if (this.options.onChange) {
|
|
4718
|
-
this.
|
|
4718
|
+
this._notifyChange();
|
|
4719
4719
|
}
|
|
4720
4720
|
}
|
|
4721
4721
|
/**
|
|
@@ -5155,13 +5155,19 @@ var _OverType = class _OverType {
|
|
|
5155
5155
|
if (this.options.showStats && this.statsBar) {
|
|
5156
5156
|
this._updateStats();
|
|
5157
5157
|
}
|
|
5158
|
-
if (this.options.onChange && this.initialized) {
|
|
5159
|
-
this.options.onChange(text, this);
|
|
5160
|
-
}
|
|
5161
5158
|
if (this.options.onRender) {
|
|
5162
5159
|
this.options.onRender(this.preview, isPreviewMode ? "preview" : "normal", this);
|
|
5163
5160
|
}
|
|
5164
5161
|
}
|
|
5162
|
+
/**
|
|
5163
|
+
* Notify listeners that the editor value changed
|
|
5164
|
+
* @private
|
|
5165
|
+
*/
|
|
5166
|
+
_notifyChange() {
|
|
5167
|
+
if (!this.options.onChange || !this.initialized)
|
|
5168
|
+
return;
|
|
5169
|
+
this.options.onChange(this.textarea.value, this);
|
|
5170
|
+
}
|
|
5165
5171
|
/**
|
|
5166
5172
|
* Apply background styling to code blocks
|
|
5167
5173
|
* @private
|
|
@@ -5195,6 +5201,7 @@ var _OverType = class _OverType {
|
|
|
5195
5201
|
*/
|
|
5196
5202
|
handleInput(event) {
|
|
5197
5203
|
this.updatePreview();
|
|
5204
|
+
this._notifyChange();
|
|
5198
5205
|
}
|
|
5199
5206
|
/**
|
|
5200
5207
|
* Handle keydown events
|
|
@@ -5375,11 +5382,15 @@ var _OverType = class _OverType {
|
|
|
5375
5382
|
* @param {string} value - Markdown content to set
|
|
5376
5383
|
*/
|
|
5377
5384
|
setValue(value) {
|
|
5385
|
+
const didChange = this.textarea.value !== value;
|
|
5378
5386
|
this.textarea.value = value;
|
|
5379
5387
|
this.updatePreview();
|
|
5380
5388
|
if (this.options.autoResize) {
|
|
5381
5389
|
this._updateAutoHeight();
|
|
5382
5390
|
}
|
|
5391
|
+
if (didChange) {
|
|
5392
|
+
this._notifyChange();
|
|
5393
|
+
}
|
|
5383
5394
|
}
|
|
5384
5395
|
/**
|
|
5385
5396
|
* Execute an action by ID
|