@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/dist/plugins/code.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type MarkdownIt from
|
|
2
|
-
import
|
|
1
|
+
import type { MarkdownIt } from "markdown-it";
|
|
2
|
+
import "highlight.js/styles/atom-one-dark.css";
|
|
3
3
|
export interface CodeHighlightOptions {
|
|
4
4
|
/** Languages to skip (delegate to the previously-registered renderer). Default: ['mindmap']. */
|
|
5
5
|
reservedLanguages?: readonly string[];
|
|
@@ -20,3 +20,8 @@ export declare function matchShortcut(shortcut: string, e: KeyboardEvent): boole
|
|
|
20
20
|
* e.g. 'Mod-b' -> 'Ctrl+B' (Windows) or 'Cmd+B' (macOS)
|
|
21
21
|
*/
|
|
22
22
|
export declare function formatShortcut(shortcut: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format a shortcut as HTML with styled kbd elements.
|
|
25
|
+
* Modifier keys get symbol icons (⌘, ⌥, ⇧) on macOS.
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatShortcutHtml(shortcut: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type MarkdownIt from
|
|
1
|
+
import type { MarkdownIt } from "markdown-it";
|
|
2
2
|
/**
|
|
3
3
|
* Intercept ```mindmap code fences and convert their content (a markdown
|
|
4
4
|
* outline) into a placeholder div. The actual SVG rendering happens
|
|
@@ -25,5 +25,10 @@ export declare function useMindmap(md: MarkdownIt): void;
|
|
|
25
25
|
* Markmap.create is called. markmap-view's d3-zoom gesture reads
|
|
26
26
|
* svg.width.baseVal.value, which throws "Could not resolve relative length"
|
|
27
27
|
* when the SVG only has percentage-based CSS dimensions (width:100%).
|
|
28
|
+
*
|
|
29
|
+
* IMPORTANT 2: autoFit must be false at creation time. The SVG is appended
|
|
30
|
+
* synchronously but the browser has not laid it out yet, so getBoundingClientRect
|
|
31
|
+
* returns 0x0 and markmap computes translate(NaN,NaN). We defer fit() to the
|
|
32
|
+
* next animation frame when layout is complete.
|
|
28
33
|
*/
|
|
29
34
|
export declare function hydrateMindmaps(root: HTMLElement): Promise<void>;
|
package/dist/plugins/tips.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type MarkdownIt from
|
|
1
|
+
import type { MarkdownIt } from "markdown-it";
|
|
2
2
|
export declare function useTips(md: MarkdownIt): void;
|
package/dist/plugins/video.d.ts
CHANGED