@powerduck/md-editor 0.5.0 → 0.7.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 +35 -0
- package/dist/Editor.d.ts +6 -0
- package/dist/Renderer.d.ts +2 -2
- package/dist/icons.d.ts +8 -7
- package/dist/index.cjs +21 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1300 -1180
- package/dist/plugins/code.d.ts +1 -2
- package/dist/plugins/keyboard.d.ts +5 -0
- package/dist/plugins/mindmap.d.ts +10 -2
- package/dist/plugins/tips.d.ts +1 -1
- package/dist/plugins/video.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -245,6 +245,41 @@ npm test # run all tests (vitest + jsdom)
|
|
|
245
245
|
npm run build # vite build + d.ts generation
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
+
## Changelog
|
|
249
|
+
|
|
250
|
+
### v0.6.0
|
|
251
|
+
|
|
252
|
+
- **Fixed**: Mindmap `transform: translate(NaN,NaN) scale(NaN)` console errors (hundreds per mindmap). Root cause: `autoFit: true` computed transform on zero-size SVG before layout, and d3-zoom scheduled hundreds of animation frames each throwing "Expected number". Fix: create with `autoFit: false`, set safe default transform immediately, defer `fit()` to next animation frame with dimension guard.
|
|
253
|
+
- **Fixed**: Code block colors now sync with editor theme (light/dark). Previously hardcoded to atom-one-dark in all themes. Now uses CSS variables (`--code-bg`, `--code-fg`, `--code-keyword`, etc.) with GitHub-style light and dark palettes.
|
|
254
|
+
- **Fixed**: UL/OL list styling in preview now has consistent spacing, bullet alignment, and line height.
|
|
255
|
+
- **Improved**: Removed `highlight.js/styles/atom-one-dark.css` import; syntax highlighting colors are now fully theme-aware via CSS variables.
|
|
256
|
+
- **Improved**: Removed stale `markdown-it-texmath` from vite external deps (removed in v0.4.0).
|
|
257
|
+
- **Improved**: Vitest config now excludes `__MACOSX` and AppleDouble (`._*`) files to prevent false test failures from macOS zip artifacts.
|
|
258
|
+
- **Test**: 251 tests, all passing, zero unhandled errors.
|
|
259
|
+
|
|
260
|
+
### v0.5.0
|
|
261
|
+
|
|
262
|
+
- **Fixed**: Admonition `:::` closing marker no longer leaks into rendered body content.
|
|
263
|
+
- **Fixed**: Quote, unordered list, and ordered list toolbar actions now wrap selected text (or the current line) instead of replacing it.
|
|
264
|
+
- **Improved**: Tip/admonition toolbar button now opens a type-picker popup with all six styles (notice, info, tip, success, warning, danger).
|
|
265
|
+
- **Improved**: Help dialog now displays keyboard shortcuts with styled key caps and modifier-key symbols (⌘, ⌥, ⇧).
|
|
266
|
+
- **Improved**: All toolbar icons redesigned in a clean Lucide/Feather line style for a modern Western aesthetic.
|
|
267
|
+
- **Fixed**: Mindmap `transform: translate(NaN,NaN)` error guarded when SVG has zero layout size.
|
|
268
|
+
- **Added**: `formatShortcutHtml()` export for rendering styled key caps.
|
|
269
|
+
- **Test**: 251 tests, all passing.
|
|
270
|
+
|
|
271
|
+
### v0.4.0
|
|
272
|
+
|
|
273
|
+
- Self-contained KaTeX math plugin (removed `markdown-it-texmath`); currency `$5` no longer misparsed.
|
|
274
|
+
- Image upload hook `onImageUpload(file)` with paste/drag support.
|
|
275
|
+
- 11 keyboard shortcuts with macOS Cmd auto-mapping.
|
|
276
|
+
- Help dialog listing all shortcuts.
|
|
277
|
+
- Table rows/columns popup dialog.
|
|
278
|
+
- Theme toggle fixed for dark mode with github-markdown-css.
|
|
279
|
+
- Admonition/tip blocks (`:::notice`, `:::warning`, etc.).
|
|
280
|
+
- Configurable toolbar (include-list or per-item show/label/icon).
|
|
281
|
+
- Standalone `renderMarkdown(source, options)` API export.
|
|
282
|
+
|
|
248
283
|
## License
|
|
249
284
|
|
|
250
285
|
MIT
|
package/dist/Editor.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ export declare class CodeEditor {
|
|
|
34
34
|
*/
|
|
35
35
|
wrapSelection(prefix: string, suffix: string, placeholder: string): void;
|
|
36
36
|
getSelection(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Prefix each line of the current selection (or current line if no
|
|
39
|
+
* selection) with the given prefix. Used for blockquote, unordered list,
|
|
40
|
+
* ordered list, etc. If nothing is selected, inserts prefix + placeholder.
|
|
41
|
+
*/
|
|
42
|
+
wrapLines(prefix: string, placeholder: string): void;
|
|
37
43
|
focus(): void;
|
|
38
44
|
destroy(): void;
|
|
39
45
|
}
|
package/dist/Renderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import MarkdownIt from
|
|
2
|
-
import
|
|
1
|
+
import type { MarkdownIt } from "markdown-it";
|
|
2
|
+
import "github-markdown-css/github-markdown.css";
|
|
3
3
|
export interface RendererOptions {
|
|
4
4
|
/** Enable KaTeX math rendering. Default: true. */
|
|
5
5
|
math?: boolean;
|
package/dist/icons.d.ts
CHANGED
|
@@ -4,20 +4,21 @@ export declare const icons: {
|
|
|
4
4
|
readonly heading: string;
|
|
5
5
|
readonly link: string;
|
|
6
6
|
readonly code: string;
|
|
7
|
-
readonly table: string;
|
|
8
|
-
readonly sigma: string;
|
|
9
|
-
readonly mindmap: string;
|
|
10
|
-
readonly eye: string;
|
|
11
|
-
readonly refresh: string;
|
|
12
|
-
readonly moon: string;
|
|
13
|
-
readonly sun: string;
|
|
14
7
|
readonly image: string;
|
|
15
8
|
readonly video: string;
|
|
16
9
|
readonly youtube: string;
|
|
17
10
|
readonly quote: string;
|
|
18
11
|
readonly list: string;
|
|
19
12
|
readonly listOrdered: string;
|
|
13
|
+
readonly table: string;
|
|
20
14
|
readonly hr: string;
|
|
15
|
+
readonly alert: string;
|
|
16
|
+
readonly sigma: string;
|
|
17
|
+
readonly mindmap: string;
|
|
18
|
+
readonly eye: string;
|
|
21
19
|
readonly help: string;
|
|
20
|
+
readonly moon: string;
|
|
21
|
+
readonly sun: string;
|
|
22
|
+
readonly refresh: string;
|
|
22
23
|
};
|
|
23
24
|
export type IconName = keyof typeof icons;
|