@powerduck/md-editor 0.6.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 +10 -0
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +180 -164
- package/dist/plugins/code.d.ts +0 -1
- package/dist/plugins/mindmap.d.ts +7 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/plugins/code.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MarkdownIt } from "markdown-it";
|
|
2
|
-
import "highlight.js/styles/atom-one-dark.css";
|
|
3
2
|
export interface CodeHighlightOptions {
|
|
4
3
|
/** Languages to skip (delegate to the previously-registered renderer). Default: ['mindmap']. */
|
|
5
4
|
reservedLanguages?: readonly string[];
|
|
@@ -21,14 +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
|
-
*
|
|
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
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* CRITICAL 2: autoFit MUST be false at creation time. The SVG is appended
|
|
30
30
|
* synchronously but the browser has not laid it out yet, so getBoundingClientRect
|
|
31
|
-
* returns 0x0 and markmap computes translate(NaN,NaN)
|
|
32
|
-
*
|
|
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).
|
|
33
36
|
*/
|
|
34
37
|
export declare function hydrateMindmaps(root: HTMLElement): Promise<void>;
|