overtype 1.2.5 → 1.2.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 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. ~86KB minified with all features.
3
+ A lightweight markdown editor library with perfect WYSIWYG alignment using an invisible textarea overlay technique. Includes optional toolbar. ~85KB 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** - ~86KB minified
22
+ - 🚀 **Lightweight** - ~85KB 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** | ~86KB | 364.02 KB | 344.51 KB | 560.99 KB | 323.69 KB |
38
+ | **Size** | ~85KB | 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 |
@@ -574,31 +574,21 @@ Special thanks to:
574
574
 
575
575
  MIT
576
576
 
577
- ## Related Projects
578
-
579
- ### Synesthesia
577
+ ## Contributing
580
578
 
581
- [Synesthesia](https://github.com/panphora/synesthesia) is a lightweight syntax highlighting editor library that extracted and refined the core textarea overlay technique from OverType. While OverType is focused on markdown editing with toolbar features, Synesthesia provides a more generalized code editing solution with:
579
+ Contributions are welcome! Please feel free to submit a Pull Request.
582
580
 
583
- - **Pluggable parser system** - Support for any programming language or syntax
584
- - **Parser registry** - Automatic language detection by file extension or MIME type
585
- - **Cleaner separation** - Extracted the overlay technique without markdown-specific features
586
- - **Smaller footprint** - ~86KB minified (vs OverType's ~78KB)
581
+ ---
587
582
 
588
- Key components extracted from OverType to Synesthesia:
589
- - The transparent textarea overlay technique for perfect WYSIWYG alignment
590
- - Theme system with CSS variable support
591
- - DOM persistence and recovery mechanisms
592
- - Auto-resize functionality
593
- - Event delegation for efficient multi-instance support
583
+ Built with the radical idea that sometimes dumb ideas work.
594
584
 
595
- If you need a markdown editor with toolbar and formatting features, use OverType. If you need a lightweight code editor with custom syntax highlighting, check out Synesthesia.
585
+ ---
596
586
 
597
- ## Contributing
587
+ **Ready for another radical idea?**
588
+ Let's remove every layer of the web application stack.
598
589
 
599
- Contributions are welcome! Please feel free to submit a Pull Request.
590
+ ### Hyperclay
600
591
 
601
- ---
592
+ [Hyperclay](https://hyperclay.com) by @panphora allows you to make a web app in a single, portable, self-updating, vanilla HTML file. No frameworks, no build steps, no deployment pipelines. Just a single HTML file that persists its own state and can be edited live.
602
593
 
603
- Ready for another radical idea?
604
- [Let's remove every layer of the web application stack.](https://hyperclay.com)
594
+ Think of it as a Google Document for interactive code, where the UI, logic, and data all live in one self-modifying file. Share apps instantly, edit them directly, use them offline.
package/dist/overtype.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OverType v1.2.5
2
+ * OverType v1.2.6
3
3
  * A lightweight markdown editor library with perfect WYSIWYG alignment
4
4
  * @license MIT
5
5
  * @author Demo User
@@ -2608,51 +2608,6 @@ var Toolbar = class {
2608
2608
  this.buttons = {};
2609
2609
  this.buttonConfig = buttonConfig;
2610
2610
  }
2611
- /**
2612
- * Check if cursor/selection is inside a markdown link
2613
- * @param {HTMLTextAreaElement} textarea - The textarea element
2614
- * @returns {boolean} True if inside a link
2615
- */
2616
- isInsideLink(textarea) {
2617
- const value = textarea.value;
2618
- const start = textarea.selectionStart;
2619
- const end = textarea.selectionEnd;
2620
- let insideLink = false;
2621
- let openBracket = -1;
2622
- let closeBracket = -1;
2623
- for (let i = start - 1; i >= 0; i--) {
2624
- if (value[i] === "[") {
2625
- openBracket = i;
2626
- break;
2627
- }
2628
- if (value[i] === "\n") {
2629
- break;
2630
- }
2631
- }
2632
- if (openBracket >= 0) {
2633
- for (let i = end; i < value.length - 1; i++) {
2634
- if (value[i] === "]" && value[i + 1] === "(") {
2635
- closeBracket = i;
2636
- break;
2637
- }
2638
- if (value[i] === "\n") {
2639
- break;
2640
- }
2641
- }
2642
- }
2643
- if (openBracket >= 0 && closeBracket >= 0) {
2644
- for (let i = closeBracket + 2; i < value.length; i++) {
2645
- if (value[i] === ")") {
2646
- insideLink = true;
2647
- break;
2648
- }
2649
- if (value[i] === "\n" || value[i] === " ") {
2650
- break;
2651
- }
2652
- }
2653
- }
2654
- return insideLink;
2655
- }
2656
2611
  /**
2657
2612
  * Create and attach toolbar to editor
2658
2613
  */
@@ -2756,9 +2711,6 @@ var Toolbar = class {
2756
2711
  insertLink(textarea);
2757
2712
  break;
2758
2713
  case "toggleCode":
2759
- if (this.isInsideLink(textarea)) {
2760
- return;
2761
- }
2762
2714
  toggleCode(textarea);
2763
2715
  break;
2764
2716
  case "toggleBulletList":