markmap-lib 0.14.0 → 0.14.2-alpha.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/dist/browser/index.js +167 -153
- package/dist/browser/index.min.js +3 -3
- package/dist/index.esm.js +108 -135
- package/dist/index.js +108 -135
- package/package.json +5 -4
- package/types/plugins/base.d.ts +5 -1
- package/types/plugins/frontmatter.d.ts +2 -3
- package/types/plugins/index.d.ts +1 -4
- package/types/plugins/katex.browser.d.ts +2 -5
- package/types/plugins/katex.d.ts +2 -5
- package/types/plugins/prism.browser.d.ts +2 -5
- package/types/plugins/prism.d.ts +2 -5
- package/types/transform.d.ts +2 -2
- package/types/types.d.ts +7 -3
package/types/plugins/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import * as katex from './katex';
|
|
2
|
-
import * as prism from './prism';
|
|
3
|
-
import * as frontmatter from './frontmatter';
|
|
4
1
|
export * from './base';
|
|
5
|
-
export declare const plugins: (
|
|
2
|
+
export declare const plugins: import("..").ITransformPlugin[];
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { config };
|
|
4
|
-
export declare const name = "katex";
|
|
5
|
-
export declare function transform(transformHooks: ITransformHooks): IAssets;
|
|
1
|
+
declare const _default: import("../types").ITransformPlugin;
|
|
2
|
+
export default _default;
|
package/types/plugins/katex.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { config };
|
|
4
|
-
export declare const name = "katex";
|
|
5
|
-
export declare function transform(transformHooks: ITransformHooks): IAssets;
|
|
1
|
+
declare const _default: import("../types").ITransformPlugin;
|
|
2
|
+
export default _default;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { config };
|
|
4
|
-
export declare const name = "prism";
|
|
5
|
-
export declare function transform(transformHooks: ITransformHooks): IAssets;
|
|
1
|
+
declare const _default: import("../types").ITransformPlugin;
|
|
2
|
+
export default _default;
|
package/types/plugins/prism.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { config };
|
|
4
|
-
export declare const name = "prism";
|
|
5
|
-
export declare function transform(transformHooks: ITransformHooks): IAssets;
|
|
1
|
+
declare const _default: import("../types").ITransformPlugin;
|
|
2
|
+
export default _default;
|
package/types/transform.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Remarkable } from 'remarkable';
|
|
2
2
|
import { INode } from 'markmap-common';
|
|
3
|
-
import { ITransformResult, ITransformPlugin, IAssets,
|
|
3
|
+
import { ITransformResult, ITransformPlugin, IAssets, ITransformHooks, IFeatures } from './types';
|
|
4
4
|
import { plugins as builtInPlugins } from './plugins';
|
|
5
5
|
export { builtInPlugins };
|
|
6
6
|
export declare class Transformer {
|
|
7
7
|
plugins: ITransformPlugin[];
|
|
8
8
|
hooks: ITransformHooks;
|
|
9
9
|
md: Remarkable;
|
|
10
|
-
assetsMap:
|
|
10
|
+
assetsMap: Record<string, IAssets>;
|
|
11
11
|
constructor(plugins?: ITransformPlugin[]);
|
|
12
12
|
buildTree(tokens: Remarkable.Token[]): INode;
|
|
13
13
|
transform(content: string): ITransformResult;
|
package/types/types.d.ts
CHANGED
|
@@ -38,9 +38,6 @@ export interface IMarkmapCreateOptions {
|
|
|
38
38
|
*/
|
|
39
39
|
output?: string;
|
|
40
40
|
}
|
|
41
|
-
export interface IAssetsMap {
|
|
42
|
-
[key: string]: IAssets;
|
|
43
|
-
}
|
|
44
41
|
export interface IFeatures {
|
|
45
42
|
[key: string]: boolean;
|
|
46
43
|
}
|
|
@@ -55,6 +52,13 @@ export interface ITransformResult extends ITransformContext {
|
|
|
55
52
|
}
|
|
56
53
|
export interface ITransformPlugin {
|
|
57
54
|
name: string;
|
|
55
|
+
config?: IAssets & {
|
|
56
|
+
version?: Record<string, string>;
|
|
57
|
+
preloadScripts?: JSItem[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @returns The assets that should be loaded for rendering the output.
|
|
61
|
+
*/
|
|
58
62
|
transform: (transformHooks: ITransformHooks) => IAssets;
|
|
59
63
|
}
|
|
60
64
|
export {};
|