mdwysiwyg 0.3.0 → 0.5.0
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 +25 -5
- package/dist/index.cjs +1955 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +403 -183
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +224 -17
- package/dist/index.d.ts +224 -17
- package/dist/index.js +1960 -291
- package/dist/index.js.map +1 -1
- package/docs/THEMING.md +329 -0
- package/package.json +11 -3
package/README.md
CHANGED
|
@@ -85,8 +85,24 @@ export default function App() {
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
That's it — no configuration required.
|
|
89
|
-
|
|
88
|
+
That's it — no configuration required. Every prop is documented in the code itself (hover it in your editor to
|
|
89
|
+
see what it does, its default and how it relates to other props).
|
|
90
|
+
|
|
91
|
+
- **All props, API and examples**: [component documentation](./src/components/MarkdownEditor/README.md)
|
|
92
|
+
- **Styling it for your app** (dark theme, brand colors, fonts — every CSS variable, recipes, troubleshooting):
|
|
93
|
+
[How to style mdwysiwyg in your host](https://github.com/ferkiernan/mdwysiwyg/blob/master/docs/THEMING.md) (Spanish)
|
|
94
|
+
- **Try every prop and build your theme live**: [playground](https://ferkiernan.github.io/mdwysiwyg/)
|
|
95
|
+
|
|
96
|
+
To match your product's look, declare `--mdw-*` variables on a class and pass it in `className` (or declare them on any
|
|
97
|
+
ancestor / `:root` for every editor on the page):
|
|
98
|
+
|
|
99
|
+
```css
|
|
100
|
+
.my-editor { --mdw-bg: #0b1220; --mdw-fg: #e5e7eb; --mdw-accent: #60a5fa; }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<MarkdownEditor className="my-editor" />
|
|
105
|
+
```
|
|
90
106
|
|
|
91
107
|
### Cloning the repository instead
|
|
92
108
|
|
|
@@ -122,9 +138,13 @@ Try it in your browser, no install required: **[ferkiernan.github.io/mdwysiwyg](
|
|
|
122
138
|
| Diagrams | ` ```mermaid ` blocks render as live diagrams; pasted Mermaid syntax is auto-detected on HTML insert. Lazy-loaded, `securityLevel: strict` |
|
|
123
139
|
| Export | Copy as Markdown or as HTML, one click |
|
|
124
140
|
| Modes | Full editor (default) or read-only viewer (`onlyView`, with a configurable notice via `onlyViewNotice`) |
|
|
125
|
-
| Sizing | Fixed (`width`/`height` props)
|
|
126
|
-
|
|
|
127
|
-
|
|
|
141
|
+
| Sizing | Fixed (`width`/`height` props), user-resizable (`resizable`, default on) or growing with its content (`autoHeight`: no inner vertical scrollbar, `height` becomes the minimum) |
|
|
142
|
+
| Toolbar | Shown by default; hide/show it at runtime with `showToolbar` (no content, caret or undo loss), or only while the editor has focus with `autoHideBar` |
|
|
143
|
+
| Version history | Opt-in `historyUndo`: a version is saved after 3 s without changes; a clock icon right after the HTML button opens a history mode with ← Undo / Redo →, Confirm / Cancel (back to last version) and a right-hand list of versions with their time (click one to jump to it; document read-only while browsing; `Ctrl+Z` / `Ctrl+Shift+Z` map to Undo / Redo) |
|
|
144
|
+
| Compare mode | `mode="compare"` + `compareOrientation` (`side-to-side` / `up-and-down`) + `compareContent`: read-only original next to an editable new version with changed words highlighted in yellow, and a second bar to accept, reject or restore the change (`onCompareDecision`) |
|
|
145
|
+
| Compare scroll sync | In compare mode the two panes follow each other by matching content (top edge ↔ top edge; added/removed passages are crossed proportionally; vertical only). On by default; turn it off with `compareSyncScroll={false}` |
|
|
146
|
+
| Theming | 47 CSS Custom Properties (`--mdw-*`) covering toolbar, content, tables, code and syntax highlighting, quotes, menus/dialogs, compare highlight and scrollbars; declare them on your class, a wrapper or `:root`, in any load order — see the [theming guide](https://github.com/ferkiernan/mdwysiwyg/blob/master/docs/THEMING.md) |
|
|
147
|
+
| Imperative API | `ref` exposing `reset()`, `isModified()`, `insertMarkdown()` and `setMarkdown()` |
|
|
128
148
|
|
|
129
149
|
## Tech under the hood
|
|
130
150
|
|