overtype 2.3.0 → 2.3.1

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
@@ -1,6 +1,6 @@
1
1
  # OverType
2
2
 
3
- A lightweight markdown editor library with perfect WYSIWYG alignment using an invisible textarea overlay technique. Includes optional toolbar. ~116KB minified with all features.
3
+ A lightweight markdown editor library with perfect WYSIWYG alignment using an invisible textarea overlay technique. Includes optional toolbar. ~117KB minified with all features.
4
4
 
5
5
  ## Live Examples
6
6
 
@@ -19,7 +19,7 @@ A lightweight markdown editor library with perfect WYSIWYG alignment using an in
19
19
  - ⌨️ **Keyboard shortcuts** - Common markdown shortcuts (Cmd/Ctrl+B for bold, etc.)
20
20
  - 📱 **Mobile optimized** - Responsive design with mobile-specific styles
21
21
  - 🔄 **DOM persistence aware** - Recovers from existing DOM (perfect for HyperClay and similar platforms)
22
- - 🚀 **Lightweight** - ~116KB minified
22
+ - 🚀 **Lightweight** - ~117KB minified
23
23
  - 🎯 **Optional toolbar** - Clean, minimal toolbar with all essential formatting
24
24
  - ✨ **Smart shortcuts** - Keyboard shortcuts with selection preservation
25
25
  - 📝 **Smart list continuation** - GitHub-style automatic list continuation on Enter
@@ -35,7 +35,7 @@ We overlap an invisible textarea on top of styled output, giving the illusion of
35
35
 
36
36
  | Feature | OverType | HyperMD | Milkdown | TUI Editor | EasyMDE |
37
37
  |---------|----------|---------|----------|------------|---------|
38
- | **Size** | ~116KB | 364.02 KB | 344.51 KB | 560.99 KB | 323.69 KB |
38
+ | **Size** | ~117KB | 364.02 KB | 344.51 KB | 560.99 KB | 323.69 KB |
39
39
  | **Dependencies** | Bundled | CodeMirror | ProseMirror + plugins | Multiple libs | CodeMirror |
40
40
  | **Setup** | Single file | Complex config | Build step required | Complex config | Moderate |
41
41
  | **Approach** | Invisible textarea | ContentEditable | ContentEditable | ContentEditable | CodeMirror |
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OverType v2.3.0
2
+ * OverType v2.3.1
3
3
  * A lightweight markdown editor library with perfect WYSIWYG alignment
4
4
  * @license MIT
5
5
  * @author David Miranda
@@ -858,17 +858,17 @@ var solar = {
858
858
  // Gray - placeholder text
859
859
  },
860
860
  previewColors: {
861
- text: "#1a1a1a",
862
- h1: "#1a1a1a",
863
- h2: "#2a2a2a",
864
- h3: "#3a3a3a",
861
+ text: "#0d3b66",
862
+ h1: "inherit",
863
+ h2: "inherit",
864
+ h3: "inherit",
865
865
  strong: "inherit",
866
866
  em: "inherit",
867
- link: "#0066cc",
868
- code: "#1a1a1a",
869
- codeBg: "rgba(135, 131, 120, 0.15)",
870
- blockquote: "#555",
871
- hr: "#ddd",
867
+ link: "#0d3b66",
868
+ code: "#0d3b66",
869
+ codeBg: "rgba(244, 211, 94, 0.4)",
870
+ blockquote: "#5a7a9b",
871
+ hr: "#5a7a9b",
872
872
  bg: "transparent"
873
873
  }
874
874
  };
@@ -939,16 +939,16 @@ var cave = {
939
939
  },
940
940
  previewColors: {
941
941
  text: "#c5dde8",
942
- h1: "#e0e0e0",
943
- h2: "#d0d0d0",
944
- h3: "#c0c0c0",
942
+ h1: "inherit",
943
+ h2: "inherit",
944
+ h3: "inherit",
945
945
  strong: "inherit",
946
946
  em: "inherit",
947
- link: "#6cb6e0",
947
+ link: "#9fcfec",
948
948
  code: "#c5dde8",
949
- codeBg: "rgba(255, 255, 255, 0.08)",
950
- blockquote: "#9aa8b4",
951
- hr: "rgba(255, 255, 255, 0.15)",
949
+ codeBg: "#1a232b",
950
+ blockquote: "#9fcfec",
951
+ hr: "#c5dde8",
952
952
  bg: "transparent"
953
953
  }
954
954
  };
@@ -982,7 +982,7 @@ function themeToCSSVars(colors, previewColors) {
982
982
  if (previewColors) {
983
983
  for (const [key, value] of Object.entries(previewColors)) {
984
984
  const varName = key.replace(/([A-Z])/g, "-$1").toLowerCase();
985
- vars.push(`--preview-${varName}: ${value};`);
985
+ vars.push(`--preview-${varName}-default: ${value};`);
986
986
  }
987
987
  }
988
988
  return vars.join("\n");
@@ -1707,17 +1707,17 @@ function generateStyles(options = {}) {
1707
1707
 
1708
1708
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview h1 {
1709
1709
  font-size: 2em !important;
1710
- color: var(--preview-h1, #222) !important;
1710
+ color: var(--preview-h1, var(--preview-h1-default)) !important;
1711
1711
  }
1712
1712
 
1713
1713
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview h2 {
1714
1714
  font-size: 1.5em !important;
1715
- color: var(--preview-h2, #333) !important;
1715
+ color: var(--preview-h2, var(--preview-h2-default)) !important;
1716
1716
  }
1717
1717
 
1718
1718
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview h3 {
1719
1719
  font-size: 1.17em !important;
1720
- color: var(--preview-h3, #444) !important;
1720
+ color: var(--preview-h3, var(--preview-h3-default)) !important;
1721
1721
  }
1722
1722
 
1723
1723
  /* Lists - restore list styling in preview mode */
@@ -1767,14 +1767,14 @@ function generateStyles(options = {}) {
1767
1767
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview a {
1768
1768
  pointer-events: auto !important;
1769
1769
  cursor: pointer !important;
1770
- color: var(--preview-link, #0066cc) !important;
1770
+ color: var(--preview-link, var(--preview-link-default)) !important;
1771
1771
  text-decoration: underline !important;
1772
1772
  }
1773
1773
 
1774
1774
  /* Code blocks - proper pre/code styling in preview mode */
1775
1775
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview pre.code-block {
1776
- background: var(--preview-code-bg, rgba(135, 131, 120, 0.15)) !important;
1777
- color: var(--preview-code, #333) !important;
1776
+ background: var(--preview-code-bg, var(--preview-code-bg-default)) !important;
1777
+ color: var(--preview-code, var(--preview-code-default)) !important;
1778
1778
  padding: 1.2em !important;
1779
1779
  border-radius: 3px !important;
1780
1780
  overflow-x: auto !important;
@@ -1803,8 +1803,8 @@ function generateStyles(options = {}) {
1803
1803
  /* Blockquotes - enhanced styling in preview mode */
1804
1804
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview .blockquote {
1805
1805
  display: block !important;
1806
- border-left: 4px solid var(--preview-blockquote, #666) !important;
1807
- color: var(--preview-blockquote, #666) !important;
1806
+ border-left: 4px solid var(--preview-blockquote, var(--preview-blockquote-default)) !important;
1807
+ color: var(--preview-blockquote, var(--preview-blockquote-default)) !important;
1808
1808
  padding-left: 1em !important;
1809
1809
  margin: 1em 0 !important;
1810
1810
  font-style: italic !important;
@@ -1815,16 +1815,16 @@ function generateStyles(options = {}) {
1815
1815
  font-family: Georgia, 'Times New Roman', serif !important;
1816
1816
  font-size: 16px !important;
1817
1817
  line-height: 1.8 !important;
1818
- color: var(--preview-text, #333) !important;
1819
- background: var(--preview-bg, transparent) !important;
1818
+ color: var(--preview-text, var(--preview-text-default)) !important;
1819
+ background: var(--preview-bg, var(--preview-bg-default)) !important;
1820
1820
  }
1821
1821
 
1822
1822
  /* Inline code in preview mode - keep monospace */
1823
1823
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview code {
1824
1824
  font-family: ${fontFamily} !important;
1825
1825
  font-size: 0.9em !important;
1826
- background: var(--preview-code-bg, rgba(135, 131, 120, 0.15)) !important;
1827
- color: var(--preview-code, #333) !important;
1826
+ background: var(--preview-code-bg, var(--preview-code-bg-default)) !important;
1827
+ color: var(--preview-code, var(--preview-code-default)) !important;
1828
1828
  padding: 0.2em 0.4em !important;
1829
1829
  border-radius: 3px !important;
1830
1830
  }
@@ -1832,18 +1832,18 @@ function generateStyles(options = {}) {
1832
1832
  /* Strong and em elements in preview mode */
1833
1833
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview strong {
1834
1834
  font-weight: 700 !important;
1835
- color: var(--preview-strong, inherit) !important;
1835
+ color: var(--preview-strong, var(--preview-strong-default)) !important;
1836
1836
  }
1837
1837
 
1838
1838
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview em {
1839
1839
  font-style: italic !important;
1840
- color: var(--preview-em, inherit) !important;
1840
+ color: var(--preview-em, var(--preview-em-default)) !important;
1841
1841
  }
1842
1842
 
1843
1843
  /* HR in preview mode */
1844
1844
  .overtype-container[data-mode="preview"] .overtype-wrapper .overtype-preview .hr-marker {
1845
1845
  display: block !important;
1846
- border-top: 2px solid var(--preview-hr, #ddd) !important;
1846
+ border-top: 2px solid var(--preview-hr, var(--preview-hr-default)) !important;
1847
1847
  text-indent: -9999px !important;
1848
1848
  height: 2px !important;
1849
1849
  }