overtype 1.0.2 → 1.0.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.esm.js +2 -21
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +2 -21
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +15 -25
- package/package.json +1 -1
- package/src/icons.js +0 -4
- package/src/styles.js +0 -7
- package/src/toolbar.js +1 -10
package/dist/overtype.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v1.0.
|
|
2
|
+
* OverType v1.0.3
|
|
3
3
|
* A lightweight markdown editor library with perfect WYSIWYG alignment
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author Demo User
|
|
@@ -1696,13 +1696,6 @@ ${blockSuffix}` : suffix;
|
|
|
1696
1696
|
height: 20px;
|
|
1697
1697
|
fill: currentColor;
|
|
1698
1698
|
}
|
|
1699
|
-
|
|
1700
|
-
/* Special sizing for code block icon */
|
|
1701
|
-
.overtype-toolbar-button[data-action="insertCodeBlock"] svg {
|
|
1702
|
-
width: 22px;
|
|
1703
|
-
height: 18px;
|
|
1704
|
-
fill: transparent !important;
|
|
1705
|
-
}
|
|
1706
1699
|
|
|
1707
1700
|
.overtype-toolbar-button:hover {
|
|
1708
1701
|
background: var(--toolbar-hover, var(--bg-secondary, #e9ecef));
|
|
@@ -1784,10 +1777,6 @@ ${blockSuffix}` : suffix;
|
|
|
1784
1777
|
<polyline stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" points="5 7 3 9 5 11"></polyline>
|
|
1785
1778
|
<polyline stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" points="13 7 15 9 13 11"></polyline>
|
|
1786
1779
|
<line stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="10" x2="8" y1="5" y2="13"></line>
|
|
1787
|
-
</svg>`;
|
|
1788
|
-
var codeBlockIcon = `<svg viewBox="0 0 46 33" fill="transparent" xmlns="http://www.w3.org/2000/svg">
|
|
1789
|
-
<path d="M35 8h3a5 5 0 0 1 5 5v12a5 5 0 0 1-5 5H18a5 5 0 0 1-5-5v-2" stroke="currentColor" stroke-width="4" stroke-linecap="round"></path>
|
|
1790
|
-
<path d="m9 2.5-6 6L9 14M20 2.5l6 6-6 5.5" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
1791
1780
|
</svg>`;
|
|
1792
1781
|
var bulletListIcon = `<svg viewBox="0 0 18 18">
|
|
1793
1782
|
<line stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="6" x2="15" y1="4" y2="4"></line>
|
|
@@ -1843,8 +1832,7 @@ ${blockSuffix}` : suffix;
|
|
|
1843
1832
|
{ name: "h3", icon: h3Icon, title: "Heading 3", action: "insertH3" },
|
|
1844
1833
|
{ separator: true },
|
|
1845
1834
|
{ name: "link", icon: linkIcon, title: "Insert Link (Ctrl+K)", action: "insertLink" },
|
|
1846
|
-
{ name: "code", icon: codeIcon, title: "
|
|
1847
|
-
{ name: "codeBlock", icon: codeBlockIcon, title: "Code Block", action: "insertCodeBlock" },
|
|
1835
|
+
{ name: "code", icon: codeIcon, title: "Code (Ctrl+`)", action: "toggleCode" },
|
|
1848
1836
|
{ separator: true },
|
|
1849
1837
|
{ name: "quote", icon: quoteIcon, title: "Quote", action: "toggleQuote" },
|
|
1850
1838
|
{ separator: true },
|
|
@@ -1919,13 +1907,6 @@ ${blockSuffix}` : suffix;
|
|
|
1919
1907
|
case "toggleCode":
|
|
1920
1908
|
toggleCode(textarea);
|
|
1921
1909
|
break;
|
|
1922
|
-
case "insertCodeBlock":
|
|
1923
|
-
const start = textarea.selectionStart;
|
|
1924
|
-
const end = textarea.selectionEnd;
|
|
1925
|
-
const selectedText = textarea.value.slice(start, end);
|
|
1926
|
-
const codeBlock = "```\n" + selectedText + "\n```";
|
|
1927
|
-
textarea.setRangeText(codeBlock, start, end, "end");
|
|
1928
|
-
break;
|
|
1929
1910
|
case "toggleBulletList":
|
|
1930
1911
|
toggleBulletList(textarea);
|
|
1931
1912
|
break;
|