markmap-common
Advanced tools
Comparing version 0.15.6 to 0.15.9-alpha.0
@@ -177,9 +177,7 @@ "use strict"; | ||
var _a; | ||
(_a = item.children) == null ? void 0 : _a.forEach((child) => { | ||
walk(child, item); | ||
}); | ||
return (_a = item.children) == null ? void 0 : _a.map((child) => walk(child, item)); | ||
}, | ||
parent | ||
); | ||
walk(tree); | ||
return walk(tree); | ||
} | ||
@@ -232,2 +230,24 @@ function addClass(className, ...rest) { | ||
} | ||
function debounce(fn, time) { | ||
const state = { | ||
timer: 0 | ||
}; | ||
function reset() { | ||
if (state.timer) { | ||
window.clearTimeout(state.timer); | ||
state.timer = 0; | ||
} | ||
} | ||
function run() { | ||
reset(); | ||
if (state.args) | ||
state.result = fn(...state.args); | ||
} | ||
return function debounced(...args) { | ||
reset(); | ||
state.args = args; | ||
state.timer = window.setTimeout(run, time); | ||
return state.result; | ||
}; | ||
} | ||
/*! @gera2ld/jsx-dom v2.2.2 | ISC License */ | ||
@@ -502,2 +522,3 @@ const VTYPE_ELEMENT = 1; | ||
exports.childSelector = childSelector; | ||
exports.debounce = debounce; | ||
exports.defer = defer; | ||
@@ -504,0 +525,0 @@ exports.escapeHtml = escapeHtml; |
export interface IPureNode { | ||
type: string; | ||
depth: number; | ||
/** | ||
@@ -21,10 +19,2 @@ * HTML of the node content. | ||
/** | ||
* Index of list items. | ||
*/ | ||
index?: number; | ||
/** | ||
* Start index of an ordered list. | ||
*/ | ||
startIndex?: number; | ||
/** | ||
* First and last lines of the source generating the node. | ||
@@ -56,2 +46,3 @@ */ | ||
key: string; | ||
depth: number; | ||
el: HTMLElement; | ||
@@ -103,13 +94,2 @@ x0: number; | ||
} | ||
export interface IMarkmapJSONOptions { | ||
color?: string[]; | ||
colorFreezeLevel?: number; | ||
duration?: number; | ||
maxWidth?: number; | ||
initialExpandLevel?: number; | ||
extraJs?: string[]; | ||
extraCss?: string[]; | ||
zoom?: boolean; | ||
pan?: boolean; | ||
} | ||
export interface IMarkmapOptions { | ||
@@ -116,0 +96,0 @@ id?: string; |
@@ -6,3 +6,3 @@ import { IDeferred } from './types'; | ||
children?: T[]; | ||
}>(tree: T, callback: (item: T, next: () => void, parent?: T) => void): void; | ||
}, U = void>(tree: T, callback: (item: T, next: () => U[] | undefined, parent?: T) => U): U; | ||
export declare function addClass(className: string, ...rest: string[]): string; | ||
@@ -13,1 +13,2 @@ export declare function childSelector<T extends Element>(filter?: string | ((el: T) => boolean)): () => T[]; | ||
export declare function memoize<T extends unknown[], U>(fn: (...args: T) => U): (...args: T) => U; | ||
export declare function debounce<T extends unknown[], U>(fn: (...args: T) => U, time: number): (...args: T) => U | undefined; |
{ | ||
"name": "markmap-common", | ||
"version": "0.15.6", | ||
"version": "0.15.9-alpha.0+9cb40e7", | ||
"description": "", | ||
@@ -35,3 +35,3 @@ "author": "", | ||
}, | ||
"gitHead": "7309ee74a3fed2c40a2fc37f1b5df208f25f3c3a" | ||
"gitHead": "9cb40e7e9ec0aa1f25a2de6a74912cd0c21f52ed" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
33691
1223
5