You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor plugin registration and toolbar management for improved readability and consistency
- Updated the `registerPlugin` function to use consistent formatting and arrow functions.
- Enhanced the `parseToolbar`, `getToolbarButton`, and `buildToolbarLayout` functions for better readability.
- Refactored the `cloneButton` and `validatePlugins` functions to maintain consistent code style.
- Reformatted plugin registrations for core, formatting, blocks, lists, links, tables, tasks, and math plugins to use consistent string quotes.
- Improved test cases in `editor-core-behavior.spec.mjs` for consistency in string quotes and formatting.
- Updated TypeScript definitions in `index.d.ts` to use consistent string quotes and formatting.
A rich text editor with security-first design, accessibility focus, and modern developer experience. Plugin system, declarative toolbar, CSS variables theming, and TypeScript support.
12
10
13
11
## ⚡ Quick Start
@@ -16,19 +14,23 @@ A rich text editor with security-first design, accessibility focus, and modern d
* Toolbar: roving tabindex with arrow key navigation; each button has `aria-label`.
114
-
* Live region (polite) announces successful command application.
115
-
* Keyboard shortcuts documented above; headings via Ctrl+Alt+1/2/3 for quick structure.
116
-
* Focus stays in editor; undo/redo notifies via updated content (consider adding optional audible notifications later).
118
+
- Toolbar: roving tabindex with arrow key navigation; each button has `aria-label`.
119
+
- Live region (polite) announces successful command application.
120
+
- Keyboard shortcuts documented above; headings via Ctrl+Alt+1/2/3 for quick structure.
121
+
- Focus stays in editor; undo/redo notifies via updated content (consider adding optional audible notifications later).
117
122
118
123
## Themes
119
124
120
125
Apply CSS classes to the editor root for education-friendly themes:
121
126
122
-
*`.theme-high-contrast`: Black background, white text/borders.
123
-
*`.theme-dyslexia`: Comic Sans font, light blue background.
127
+
-`.theme-high-contrast`: Black background, white text/borders.
128
+
-`.theme-dyslexia`: Comic Sans font, light blue background.
124
129
125
130
Example:
126
131
@@ -134,43 +139,42 @@ Example:
134
139
135
140
`scripts/bench-normalize.mjs` benchmarks normalization over synthetic documents. CI captures the JSON and invokes `scripts/perf-regression-check.mjs` with:
136
141
137
-
* PERF_BASELINE_MS_PER_BLOCK=0.60
138
-
* PERF_TOLERANCE_PCT=20
142
+
- PERF_BASELINE_MS_PER_BLOCK=0.60
143
+
- PERF_TOLERANCE_PCT=20
139
144
140
-
If average ms/block > baseline * (1 + tolerance/100) the build fails. After intentional performance-affecting changes capture a fresh benchmark and update env values in `.github/workflows/ci.yml`.
145
+
If average ms/block > baseline \* (1 + tolerance/100) the build fails. After intentional performance-affecting changes capture a fresh benchmark and update env values in `.github/workflows/ci.yml`.
141
146
142
147
## Development Scripts
143
148
144
-
| Command | Action |
145
-
| ------- | ------ |
146
-
|`npm run test`| JS tests + coverage output under `artifacts/coverage/js`. |
147
-
|`npm run lint`| ESLint over editor sources. |
148
-
|`npm run bench:normalize`| Run normalization benchmark locally. |
149
-
|`npm run build:js`| Build ESM + UMD + minified bundles to `dist/`. |
150
-
|`npm run build:js:prod`| Build JS bundles (including min) and list outputs. |
151
-
|`npm run coverage:check`| Enforce JS coverage threshold (CI gate). |
152
-
|`dotnet test`| Run .NET unit tests (sanitizer parity, etc.). |
0 commit comments