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 CHANGED
@@ -16,7 +16,7 @@ A lightweight markdown editor library with perfect WYSIWYG alignment using an in
16
16
 
17
17
  ## How it works
18
18
 
19
- <!-- ![OverType Architecture Diagram](diagram.png) -->
19
+ ![OverType Architecture Diagram](https://websharebox.s3.amazonaws.com/diagram.png)
20
20
 
21
21
  We overlap an invisible textarea on top of styled output, giving the illusion of editing styled text using a plain textarea.
22
22
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OverType v1.0.1
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
@@ -1672,13 +1672,6 @@ function generateStyles(options = {}) {
1672
1672
  height: 20px;
1673
1673
  fill: currentColor;
1674
1674
  }
1675
-
1676
- /* Special sizing for code block icon */
1677
- .overtype-toolbar-button[data-action="insertCodeBlock"] svg {
1678
- width: 22px;
1679
- height: 18px;
1680
- fill: transparent !important;
1681
- }
1682
1675
 
1683
1676
  .overtype-toolbar-button:hover {
1684
1677
  background: var(--toolbar-hover, var(--bg-secondary, #e9ecef));
@@ -1761,10 +1754,6 @@ var codeIcon = `<svg viewBox="0 0 18 18">
1761
1754
  <polyline stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" points="13 7 15 9 13 11"></polyline>
1762
1755
  <line stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="10" x2="8" y1="5" y2="13"></line>
1763
1756
  </svg>`;
1764
- var codeBlockIcon = `<svg viewBox="0 0 46 33" fill="transparent" xmlns="http://www.w3.org/2000/svg">
1765
- <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>
1766
- <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>
1767
- </svg>`;
1768
1757
  var bulletListIcon = `<svg viewBox="0 0 18 18">
1769
1758
  <line stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="6" x2="15" y1="4" y2="4"></line>
1770
1759
  <line stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="6" x2="15" y1="9" y2="9"></line>
@@ -1819,8 +1808,7 @@ var Toolbar = class {
1819
1808
  { name: "h3", icon: h3Icon, title: "Heading 3", action: "insertH3" },
1820
1809
  { separator: true },
1821
1810
  { name: "link", icon: linkIcon, title: "Insert Link (Ctrl+K)", action: "insertLink" },
1822
- { name: "code", icon: codeIcon, title: "Inline Code", action: "toggleCode" },
1823
- { name: "codeBlock", icon: codeBlockIcon, title: "Code Block", action: "insertCodeBlock" },
1811
+ { name: "code", icon: codeIcon, title: "Code (Ctrl+`)", action: "toggleCode" },
1824
1812
  { separator: true },
1825
1813
  { name: "quote", icon: quoteIcon, title: "Quote", action: "toggleQuote" },
1826
1814
  { separator: true },
@@ -1895,13 +1883,6 @@ var Toolbar = class {
1895
1883
  case "toggleCode":
1896
1884
  toggleCode(textarea);
1897
1885
  break;
1898
- case "insertCodeBlock":
1899
- const start = textarea.selectionStart;
1900
- const end = textarea.selectionEnd;
1901
- const selectedText = textarea.value.slice(start, end);
1902
- const codeBlock = "```\n" + selectedText + "\n```";
1903
- textarea.setRangeText(codeBlock, start, end, "end");
1904
- break;
1905
1886
  case "toggleBulletList":
1906
1887
  toggleBulletList(textarea);
1907
1888
  break;