@cascivo/editor 0.1.1 → 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 +15 -0
- package/dist/editor.css +2 -0
- package/dist/index.d.ts +293 -0
- package/dist/index.js +1278 -0
- package/package.json +4 -3
- package/readme.body.md +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascivo/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Lightweight CSS-native code editor — native textarea overlay + owned zero-dependency tokenizer",
|
|
6
6
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@cascivo/core": "^0.1.3",
|
|
47
|
-
"@cascivo/i18n": "^0.1.
|
|
47
|
+
"@cascivo/i18n": "^0.1.7"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "vp build && node scripts/flatten-types.mjs && node scripts/check-types-flat.mjs",
|
|
69
69
|
"check": "tsc --noEmit",
|
|
70
|
-
"test": "vp test"
|
|
70
|
+
"test": "vp test",
|
|
71
|
+
"verify:pack": "node scripts/check-pack.mjs"
|
|
71
72
|
}
|
|
72
73
|
}
|
package/readme.body.md
CHANGED
|
@@ -40,6 +40,21 @@ import { Highlight } from '@cascivo/editor'
|
|
|
40
40
|
Ships small, tree-shakeable grammars: `plaintext`, `json`, `javascript`, `typescript`, `css`,
|
|
41
41
|
`html`, `markdown`, `bash`. Register your own with `registerGrammar(grammar)`.
|
|
42
42
|
|
|
43
|
+
### Large documents
|
|
44
|
+
|
|
45
|
+
The editor edits long Markdown documents — generated docs, concatenated books, big notes —
|
|
46
|
+
well past the old ~5,000-line ceiling. On every render it tokenizes only the **visible window**
|
|
47
|
+
(O(viewport)) rather than the whole document, and an edit re-tokenizes only the **changed
|
|
48
|
+
suffix** until the grammar state reconverges. This is the same overlay + owned-tokenizer model,
|
|
49
|
+
with **zero new dependencies** and **byte-identical highlighting output** — just a persistent
|
|
50
|
+
per-line state index (`LineStateIndex`) feeding a viewport-scoped `tokenizeRange`. Scrolling and
|
|
51
|
+
typing stay smooth well past 50,000 lines.
|
|
52
|
+
|
|
53
|
+
One trade-off: with `wrap` (soft-wrap) on, row heights are variable so DOM windowing is disabled
|
|
54
|
+
and every row renders (O(n) render). Edits stay cheap, but for sustained editing of very large
|
|
55
|
+
documents (≳10,000 lines) disable `wrap`. See [`PERFORMANCE.md`](./PERFORMANCE.md) for the
|
|
56
|
+
measured before/after numbers and the deferred worker-offload boundary.
|
|
57
|
+
|
|
43
58
|
### Extending the editor
|
|
44
59
|
|
|
45
60
|
Three bounded seams — no plugin lifecycle, no transaction filters (use a full editor
|