@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.
@@ -1,5 +1,4 @@
1
- import type MarkdownIt from 'markdown-it';
2
- import 'highlight.js/styles/atom-one-dark.css';
1
+ import type { MarkdownIt } from "markdown-it";
3
2
  export interface CodeHighlightOptions {
4
3
  /** Languages to skip (delegate to the previously-registered renderer). Default: ['mindmap']. */
5
4
  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 'markdown-it';
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
@@ -21,9 +21,17 @@ export declare function useMindmap(md: MarkdownIt): void;
21
21
  * markmap-lib / markmap-view are dynamically imported so they do not
22
22
  * increase the initial bundle size when mindmaps are absent.
23
23
  *
24
- * IMPORTANT: The SVG must have explicit pixel width/height attributes before
24
+ * CRITICAL: The SVG must have explicit pixel width/height attributes before
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
+ * CRITICAL 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) scale(NaN). d3-zoom then
32
+ * schedules a transition from NaN, and every animation frame throws
33
+ * "Expected number" errors (hundreds per mindmap). We defer fit() to the next
34
+ * animation frame when layout is complete, with a setTimeout fallback for
35
+ * environments where requestAnimationFrame does not fire (jsdom).
28
36
  */
29
37
  export declare function hydrateMindmaps(root: HTMLElement): Promise<void>;
@@ -1,2 +1,2 @@
1
- import type MarkdownIt from 'markdown-it';
1
+ import type { MarkdownIt } from "markdown-it";
2
2
  export declare function useTips(md: MarkdownIt): void;
@@ -1,4 +1,4 @@
1
- import type MarkdownIt from 'markdown-it';
1
+ import type { MarkdownIt } from "markdown-it";
2
2
  /**
3
3
  * Override the markdown-it image renderer to detect video file URLs
4
4
  * (.mp4, .webm, .ogg, etc.) and render them as <video> elements instead