markmap-view 0.15.8 → 0.15.9-alpha.11

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/dist/types.d.ts CHANGED
@@ -7,3 +7,14 @@ export interface IMarkmapState {
7
7
  minY: number;
8
8
  maxY: number;
9
9
  }
10
+ export interface IMarkmapJSONOptions {
11
+ color?: string[];
12
+ colorFreezeLevel?: number;
13
+ duration?: number;
14
+ maxWidth?: number;
15
+ initialExpandLevel?: number;
16
+ extraJs?: string[];
17
+ extraCss?: string[];
18
+ zoom?: boolean;
19
+ pan?: boolean;
20
+ }
package/dist/util.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { IMarkmapOptions } from 'markmap-common';
2
+ import { IMarkmapJSONOptions } from './types';
3
+ export declare function deriveOptions(jsonOptions?: IMarkmapJSONOptions): Partial<IMarkmapOptions>;
package/dist/view.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type * as d3 from 'd3';
2
2
  import { FlextreeNode } from 'd3-flextree';
3
- import { Hook, INode, IPureNode, IMarkmapOptions, IMarkmapJSONOptions } from 'markmap-common';
3
+ import { Hook, IMarkmapOptions, INode, IPureNode } from 'markmap-common';
4
4
  import { IMarkmapState } from './types';
5
5
  export declare const globalCSS: string;
6
6
  interface IPadding {
@@ -10,24 +10,20 @@ interface IPadding {
10
10
  bottom: number;
11
11
  }
12
12
  type ID3SVGElement = d3.Selection<SVGElement, FlextreeNode<INode>, HTMLElement, FlextreeNode<INode>>;
13
- declare function createViewHooks(): {
14
- transformHtml: Hook<[mm: Markmap, nodes: HTMLElement[]]>;
15
- };
16
13
  /**
17
14
  * A global hook to refresh all markmaps when called.
18
15
  */
19
16
  export declare const refreshHook: Hook<[]>;
20
- export declare const defaultColorFn: d3.ScaleOrdinal<string, string, never>;
21
17
  export declare class Markmap {
22
- static defaultOptions: IMarkmapOptions;
23
18
  options: IMarkmapOptions;
24
19
  state: IMarkmapState;
25
20
  svg: ID3SVGElement;
26
21
  styleNode: d3.Selection<HTMLStyleElement, FlextreeNode<INode>, HTMLElement, FlextreeNode<INode>>;
27
22
  g: d3.Selection<SVGGElement, FlextreeNode<INode>, HTMLElement, FlextreeNode<INode>>;
28
23
  zoom: d3.ZoomBehavior<SVGElement, FlextreeNode<INode>>;
29
- viewHooks: ReturnType<typeof createViewHooks>;
30
24
  revokers: (() => void)[];
25
+ private imgCache;
26
+ private debouncedRefresh;
31
27
  constructor(svg: string | SVGElement | ID3SVGElement, opts?: Partial<IMarkmapOptions>);
32
28
  getStyleContent(): string;
33
29
  updateStyle(): void;
@@ -36,6 +32,8 @@ export declare class Markmap {
36
32
  toggleNode(data: INode, recursive?: boolean): void;
37
33
  handleClick: (e: MouseEvent, d: FlextreeNode<INode>) => void;
38
34
  initializeData(node: INode): void;
35
+ private _checkImages;
36
+ private _loadImage;
39
37
  setOptions(opts?: Partial<IMarkmapOptions>): void;
40
38
  setData(data?: IPureNode | null, opts?: Partial<IMarkmapOptions>): void;
41
39
  renderData(originData?: INode): void;
@@ -44,6 +42,10 @@ export declare class Markmap {
44
42
  * Fit the content to the viewport.
45
43
  */
46
44
  fit(): Promise<void>;
45
+ findElement(node: INode): {
46
+ data: FlextreeNode<INode>;
47
+ g: SVGGElement;
48
+ } | undefined;
47
49
  /**
48
50
  * Pan the content to make the provided node visible in the viewport.
49
51
  */
@@ -55,5 +57,4 @@ export declare class Markmap {
55
57
  destroy(): void;
56
58
  static create(svg: string | SVGElement | ID3SVGElement, opts?: Partial<IMarkmapOptions>, data?: IPureNode | null): Markmap;
57
59
  }
58
- export declare function deriveOptions(jsonOptions?: IMarkmapJSONOptions): Partial<IMarkmapOptions>;
59
60
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-view",
3
- "version": "0.15.8",
3
+ "version": "0.15.9-alpha.11+d60da2f",
4
4
  "description": "View markmaps in browser",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -21,7 +21,8 @@
21
21
  "scripts": {
22
22
  "clean": "del-cli dist",
23
23
  "build:types": "tsc",
24
- "build:js": "vite build && TARGET=es vite build --emptyOutDir=false"
24
+ "build:js": "vite build && TARGET=es vite build",
25
+ "build": "run-s clean build:*"
25
26
  },
26
27
  "bugs": {
27
28
  "url": "https://github.com/markmap/markmap/issues"
@@ -44,10 +45,10 @@
44
45
  },
45
46
  "devDependencies": {
46
47
  "@types/d3-flextree": "^2.1.1",
47
- "markmap-common": "0.15.6"
48
+ "markmap-common": "0.15.9-alpha.11+d60da2f"
48
49
  },
49
50
  "peerDependencies": {
50
51
  "markmap-common": "*"
51
52
  },
52
- "gitHead": "d5a29ab4064a5496f879de04d730d7192461d3c5"
53
+ "gitHead": "d60da2fb13a85edec875ef002f1be414a0c00abe"
53
54
  }