@powerduck/md-editor 0.5.0 → 0.6.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 -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 +1232 -1128
- package/dist/plugins/code.d.ts +2 -2
- package/dist/plugins/keyboard.d.ts +5 -0
- package/dist/plugins/mindmap.d.ts +6 -1
- 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,31 @@ 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.5.0
|
|
251
|
+
|
|
252
|
+
- **Fixed**: Admonition `:::` closing marker no longer leaks into rendered body content.
|
|
253
|
+
- **Fixed**: Quote, unordered list, and ordered list toolbar actions now wrap selected text (or the current line) instead of replacing it.
|
|
254
|
+
- **Improved**: Tip/admonition toolbar button now opens a type-picker popup with all six styles (notice, info, tip, success, warning, danger).
|
|
255
|
+
- **Improved**: Help dialog now displays keyboard shortcuts with styled key caps and modifier-key symbols (⌘, ⌥, ⇧).
|
|
256
|
+
- **Improved**: All toolbar icons redesigned in a clean Lucide/Feather line style for a modern Western aesthetic.
|
|
257
|
+
- **Fixed**: Mindmap `transform: translate(NaN,NaN)` error guarded when SVG has zero layout size.
|
|
258
|
+
- **Added**: `formatShortcutHtml()` export for rendering styled key caps.
|
|
259
|
+
- **Test**: 251 tests, all passing.
|
|
260
|
+
|
|
261
|
+
### v0.4.0
|
|
262
|
+
|
|
263
|
+
- Self-contained KaTeX math plugin (removed `markdown-it-texmath`); currency `$5` no longer misparsed.
|
|
264
|
+
- Image upload hook `onImageUpload(file)` with paste/drag support.
|
|
265
|
+
- 11 keyboard shortcuts with macOS Cmd auto-mapping.
|
|
266
|
+
- Help dialog listing all shortcuts.
|
|
267
|
+
- Table rows/columns popup dialog.
|
|
268
|
+
- Theme toggle fixed for dark mode with github-markdown-css.
|
|
269
|
+
- Admonition/tip blocks (`:::notice`, `:::warning`, etc.).
|
|
270
|
+
- Configurable toolbar (include-list or per-item show/label/icon).
|
|
271
|
+
- Standalone `renderMarkdown(source, options)` API export.
|
|
272
|
+
|
|
248
273
|
## License
|
|
249
274
|
|
|
250
275
|
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;
|