mdwysiwyg 0.1.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 +13 -4
- package/dist/index.cjs +458 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +45 -11
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +424 -32
- package/dist/index.js.map +1 -1
- package/package.json +18 -14
package/README.md
CHANGED
|
@@ -40,7 +40,12 @@ personal and commercial use under the MIT license.
|
|
|
40
40
|
- 🖍️ **Syntax-highlighted code blocks** — JSON, SQL, TypeScript, JavaScript, Java out of the
|
|
41
41
|
box, with graceful fallback for any other language.
|
|
42
42
|
- 📊 **Visual table picker** — a hover-to-size 10×10 grid, just like Excel/Google Sheets/Notion,
|
|
43
|
-
instead of typing row/column counts into a form.
|
|
43
|
+
instead of typing row/column counts into a form. Click a cell you're already in to add, move or
|
|
44
|
+
delete columns and rows from a context menu.
|
|
45
|
+
- 📈 **Mermaid diagrams** — ` ```mermaid ` blocks render as real diagrams, with auto-detection when
|
|
46
|
+
you paste diagram syntax. Lazy-loaded, so it costs nothing if you never use it.
|
|
47
|
+
- 🎛️ **Imperative API** — a `ref` with `reset()` and `isModified()`, so "discard changes" and
|
|
48
|
+
"unsaved changes?" flows are three lines of code, not a remount hack.
|
|
44
49
|
- 🧩 **GitHub Flavored Markdown** — tables, task lists, strikethrough, and more, parsed and
|
|
45
50
|
serialized through the same battle-tested `unified`/`remark`/`rehype` ecosystem used across
|
|
46
51
|
the JS Markdown world.
|
|
@@ -111,11 +116,14 @@ Try it in your browser, no install required: **[ferkiernan.github.io/mdwysiwyg](
|
|
|
111
116
|
| Lists | Ordered, unordered, nested, task lists (checklists) |
|
|
112
117
|
| Insert | Images (by URL), links (URL-only dialog when text is already selected, auto `http://` prefix), tables (visual size picker), horizontal rules, embedded HTML |
|
|
113
118
|
| Links | Click an existing link to open a quick popover: go to URL, copy URL, or edit/remove it inline |
|
|
119
|
+
| Tables | Click an already-focused cell again for a context menu: add/move/delete columns (header cells) or rows (data cells) |
|
|
114
120
|
| Code | Fenced code blocks with a language picker (JSON/SQL/TypeScript/JavaScript/Java/custom) and syntax highlighting |
|
|
121
|
+
| Diagrams | ` ```mermaid ` blocks render as live diagrams; pasted Mermaid syntax is auto-detected on HTML insert. Lazy-loaded, `securityLevel: strict` |
|
|
115
122
|
| Export | Copy as Markdown or as HTML, one click |
|
|
116
|
-
| Modes | Full editor (default) or read-only viewer (`onlyView`) |
|
|
123
|
+
| Modes | Full editor (default) or read-only viewer (`onlyView`, with a configurable notice via `onlyViewNotice`) |
|
|
117
124
|
| Sizing | Fixed (`width`/`height` props) or user-resizable (`resizable`, default on) |
|
|
118
|
-
| Theming | CSS Custom Properties for toolbar colors/gradient/font and content-area background (solid color, gradient, or image) |
|
|
125
|
+
| Theming | CSS Custom Properties for toolbar colors/gradient/font, per-view content color & font, table header, code block & Mermaid-diagram-area backgrounds, scrollbar colors (including the toolbar's own auto-scroll), and content-area background (solid color, gradient, or image) |
|
|
126
|
+
| Imperative API | `ref` exposing `reset()` and `isModified()` for discard-changes / unsaved-warning flows |
|
|
119
127
|
|
|
120
128
|
## Tech under the hood
|
|
121
129
|
|
|
@@ -129,7 +137,8 @@ TypeScript strict, tested with Vitest + React Testing Library.
|
|
|
129
137
|
|
|
130
138
|
This project is developed spec-first: every feature has a written specification, implementation
|
|
131
139
|
plan, and task breakdown under [`specs/`](./specs/) before being built. See
|
|
132
|
-
[`specs/`](./specs/) for the full history of what's implemented and why.
|
|
140
|
+
[`specs/`](./specs/) for the full history of what's implemented and why. See
|
|
141
|
+
[CHANGELOG.md](./CHANGELOG.md) for a version-by-version summary of what shipped.
|
|
133
142
|
|
|
134
143
|
## Contributing
|
|
135
144
|
|