markmap-lib 0.13.6-alpha.2 → 0.13.6-alpha.5
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 +25 -20
- package/dist/browser/index.min.js +4 -4
- package/dist/index.esm.js +212 -17
- package/dist/index.js +217 -22
- package/package.json +11 -8
- package/types/types.d.ts +7 -4
package/dist/browser/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markmap-lib v0.13.6-alpha.
|
|
1
|
+
/*! markmap-lib v0.13.6-alpha.5+3a7e620 | MIT License */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('katex')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'katex'], factory) :
|
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
11
11
|
|
|
12
12
|
function _extends$1() {
|
|
13
|
-
_extends$1 = Object.assign
|
|
13
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
14
14
|
for (var i = 1; i < arguments.length; i++) {
|
|
15
15
|
var source = arguments[i];
|
|
16
16
|
|
|
@@ -23,11 +23,10 @@ function _extends$1() {
|
|
|
23
23
|
|
|
24
24
|
return target;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
26
|
return _extends$1.apply(this, arguments);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
/*! markmap-common v0.13.
|
|
29
|
+
/*! markmap-common v0.13.4 | MIT License */
|
|
31
30
|
class Hook {
|
|
32
31
|
constructor() {
|
|
33
32
|
this.listeners = [];
|
|
@@ -278,7 +277,7 @@ async function loadJS(items, context) {
|
|
|
278
277
|
}
|
|
279
278
|
|
|
280
279
|
const template = "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n<title>Markmap</title>\n<style>\n* {\n margin: 0;\n padding: 0;\n}\n#mindmap {\n display: block;\n width: 100vw;\n height: 100vh;\n}\n</style>\n<!--CSS-->\n</head>\n<body>\n<svg id=\"mindmap\"></svg>\n<!--JS-->\n</body>\n</html>\n";
|
|
281
|
-
const BASE_JS = [`https://cdn.jsdelivr.net/npm/d3@${"6.7.0"}`, `https://cdn.jsdelivr.net/npm/markmap-view@${"0.13.
|
|
280
|
+
const BASE_JS = [`https://cdn.jsdelivr.net/npm/d3@${"6.7.0"}`, `https://cdn.jsdelivr.net/npm/markmap-view@${"0.13.5"}`].map(src => ({
|
|
282
281
|
type: 'script',
|
|
283
282
|
data: {
|
|
284
283
|
src
|
|
@@ -8612,13 +8611,13 @@ var remarkableKatex = rkatex;
|
|
|
8612
8611
|
|
|
8613
8612
|
var config$1 = {
|
|
8614
8613
|
versions: {
|
|
8615
|
-
katex: "0.
|
|
8614
|
+
katex: "0.16.0",
|
|
8616
8615
|
webfontloader: "1.6.28"
|
|
8617
8616
|
},
|
|
8618
8617
|
preloadScripts: [{
|
|
8619
8618
|
type: 'script',
|
|
8620
8619
|
data: {
|
|
8621
|
-
src: `https://cdn.jsdelivr.net/npm/katex@${"0.
|
|
8620
|
+
src: `https://cdn.jsdelivr.net/npm/katex@${"0.16.0"}/dist/katex.min.js`
|
|
8622
8621
|
}
|
|
8623
8622
|
}],
|
|
8624
8623
|
scripts: [{
|
|
@@ -8652,7 +8651,7 @@ var config$1 = {
|
|
|
8652
8651
|
styles: [{
|
|
8653
8652
|
type: 'stylesheet',
|
|
8654
8653
|
data: {
|
|
8655
|
-
href: `https://cdn.jsdelivr.net/npm/katex@${"0.
|
|
8654
|
+
href: `https://cdn.jsdelivr.net/npm/katex@${"0.16.0"}/dist/katex.min.css`
|
|
8656
8655
|
}
|
|
8657
8656
|
}]
|
|
8658
8657
|
};
|
|
@@ -8707,19 +8706,23 @@ function transform$2(transformHooks) {
|
|
|
8707
8706
|
return result;
|
|
8708
8707
|
};
|
|
8709
8708
|
});
|
|
8710
|
-
transformHooks.
|
|
8709
|
+
transformHooks.beforeParse.tap((_, context) => {
|
|
8711
8710
|
enableFeature = () => {
|
|
8712
8711
|
context.features[name$2] = true;
|
|
8713
8712
|
};
|
|
8714
|
-
|
|
8713
|
+
});
|
|
8714
|
+
transformHooks.afterParse.tap((_, context) => {
|
|
8715
8715
|
const {
|
|
8716
8716
|
frontmatter
|
|
8717
8717
|
} = context;
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8718
|
+
|
|
8719
|
+
if (frontmatter != null && frontmatter.markmap) {
|
|
8720
|
+
['extraJs', 'extraCss'].forEach(key => {
|
|
8721
|
+
if (frontmatter.markmap[key]) {
|
|
8722
|
+
frontmatter.markmap[key] = resolveNpmPaths(frontmatter.markmap[key], name$2, config$1.versions.katex);
|
|
8723
|
+
}
|
|
8724
|
+
});
|
|
8725
|
+
}
|
|
8723
8726
|
});
|
|
8724
8727
|
return {
|
|
8725
8728
|
styles: config$1.styles,
|
|
@@ -8795,7 +8798,7 @@ function transform$1(transformHooks) {
|
|
|
8795
8798
|
}
|
|
8796
8799
|
});
|
|
8797
8800
|
});
|
|
8798
|
-
transformHooks.
|
|
8801
|
+
transformHooks.beforeParse.tap((_, context) => {
|
|
8799
8802
|
enableFeature = () => {
|
|
8800
8803
|
context.features[name$1] = true;
|
|
8801
8804
|
};
|
|
@@ -12664,7 +12667,7 @@ var jsYaml = {
|
|
|
12664
12667
|
|
|
12665
12668
|
const name = 'frontmatter';
|
|
12666
12669
|
function transform(transformHooks) {
|
|
12667
|
-
transformHooks.
|
|
12670
|
+
transformHooks.beforeParse.tap((md, context) => {
|
|
12668
12671
|
const origParse = md.parse;
|
|
12669
12672
|
md.parse = wrapFunction(origParse, {
|
|
12670
12673
|
before(ctx) {
|
|
@@ -12734,7 +12737,8 @@ transform: transform
|
|
|
12734
12737
|
function createTransformHooks() {
|
|
12735
12738
|
return {
|
|
12736
12739
|
parser: new Hook(),
|
|
12737
|
-
|
|
12740
|
+
beforeParse: new Hook(),
|
|
12741
|
+
afterParse: new Hook(),
|
|
12738
12742
|
htmltag: new Hook(),
|
|
12739
12743
|
retransform: new Hook()
|
|
12740
12744
|
};
|
|
@@ -12926,8 +12930,9 @@ class Transformer {
|
|
|
12926
12930
|
const context = {
|
|
12927
12931
|
features: {}
|
|
12928
12932
|
};
|
|
12929
|
-
this.hooks.
|
|
12933
|
+
this.hooks.beforeParse.call(this.md, context);
|
|
12930
12934
|
const tokens = this.md.parse(content, {});
|
|
12935
|
+
this.hooks.afterParse.call(this.md, context);
|
|
12931
12936
|
let root = this.buildTree(tokens);
|
|
12932
12937
|
cleanNode(root);
|
|
12933
12938
|
if (((_root$children = root.children) == null ? void 0 : _root$children.length) === 1) root = root.children[0];
|
|
@@ -12973,7 +12978,7 @@ class Transformer {
|
|
|
12973
12978
|
}
|
|
12974
12979
|
|
|
12975
12980
|
const transformerVersions = {
|
|
12976
|
-
'markmap-lib': '0.13.6-alpha.
|
|
12981
|
+
'markmap-lib': '0.13.6-alpha.5+3a7e620',
|
|
12977
12982
|
d3: "6.7.0"
|
|
12978
12983
|
};
|
|
12979
12984
|
|