@pfmcodes/caret 0.2.0 → 0.2.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 +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,12 +29,12 @@ A lightweight, feature-rich code editor with real-time syntax highlighting and c
|
|
|
29
29
|
- [Customization](#customization)
|
|
30
30
|
- [Contributing](#contributing)
|
|
31
31
|
- [License](#license)
|
|
32
|
-
- [
|
|
32
|
+
- [Perfomance Notes](#performance-notes)
|
|
33
33
|
|
|
34
34
|
## What's-New?
|
|
35
35
|
|
|
36
36
|
### The editor has been optimized like crazy, the editor used to lag at 500 lines not it does not lag until 10k+ lines(x20 performance increase)
|
|
37
|
-
### for more info about the
|
|
37
|
+
### for more info about the perfomace check out [this](#performance-notes) and [this](#performance).
|
|
38
38
|
|
|
39
39
|
## Installation
|
|
40
40
|
|
|
@@ -91,7 +91,7 @@ pnpm add @pfmcodes/caret
|
|
|
91
91
|
### ES Module Import
|
|
92
92
|
|
|
93
93
|
```javascript
|
|
94
|
-
import editor from '
|
|
94
|
+
import editor from './node_modules/@pfmcodes/caret/esm/index.js';
|
|
95
95
|
|
|
96
96
|
// Create editor instance
|
|
97
97
|
const editorInstance = await editor.editor.createEditor(
|
|
@@ -123,7 +123,7 @@ caret/
|
|
|
123
123
|
### JavaScript Editor
|
|
124
124
|
|
|
125
125
|
```javascript
|
|
126
|
-
import editor from '
|
|
126
|
+
import editor from './node_modules/@pfmcodes/caret/esm/index.js'; // auto link to commonjs version
|
|
127
127
|
|
|
128
128
|
const jsEditor = await editor.editor.createEditor(
|
|
129
129
|
document.getElementById('js-editor'),
|
|
@@ -480,7 +480,7 @@ The editor synchronizes all layers during:
|
|
|
480
480
|
- **Real-time Highlighting**: Uses Highlight.js for fast, accurate syntax highlighting
|
|
481
481
|
- **Canvas Measurement**: Employs HTML5 Canvas API for precise text width calculations
|
|
482
482
|
- **Event Optimization**: Efficiently updates only what's necessary on each interaction
|
|
483
|
-
- **Heavy Optimization**:
|
|
483
|
+
- **Heavy Optimization**: v0.1.5 used to handle 500 lines before lagging, with new caret@0.2.0 and onwards, there's almost 20 times performance increase now it can handle 10K+ lines smoothly before lagging(better results in optimized browsers like firefox)
|
|
484
484
|
|
|
485
485
|
### Browser Support
|
|
486
486
|
|