markmap-lib 0.13.6-alpha.3 → 0.13.6-alpha.6

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.
@@ -1,4 +1,4 @@
1
- /*! markmap-lib v0.13.6-alpha.3+3e26a91 | MIT License */
1
+ /*! markmap-lib v0.13.6-alpha.6+e810c56 | 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 || function (target) {
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,7 +23,6 @@ function _extends$1() {
23
23
 
24
24
  return target;
25
25
  };
26
-
27
26
  return _extends$1.apply(this, arguments);
28
27
  }
29
28
 
@@ -8612,13 +8611,13 @@ var remarkableKatex = rkatex;
8612
8611
 
8613
8612
  var config$1 = {
8614
8613
  versions: {
8615
- katex: "0.15.3",
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.15.3"}/dist/katex.min.js`
8620
+ src: `https://cdn.jsdelivr.net/npm/katex@${"0.16.0"}/dist/katex.min.js`
8622
8621
  }
8623
8622
  }],
8624
8623
  scripts: [{
@@ -8652,18 +8651,24 @@ var config$1 = {
8652
8651
  styles: [{
8653
8652
  type: 'stylesheet',
8654
8653
  data: {
8655
- href: `https://cdn.jsdelivr.net/npm/katex@${"0.15.3"}/dist/katex.min.css`
8654
+ href: `https://cdn.jsdelivr.net/npm/katex@${"0.16.0"}/dist/katex.min.css`
8656
8655
  }
8657
8656
  }]
8658
8657
  };
8659
8658
 
8659
+ const npmPrefix = 'https://cdn.jsdelivr.net/npm/';
8660
8660
  /**
8661
8661
  * Find NPM paths and resolve them to full URLs with the same package version as in this library.
8662
8662
  */
8663
+
8663
8664
  function resolveNpmPaths(paths, name, version) {
8664
8665
  return paths.map(path => {
8665
- if (typeof path === 'string' && path.startsWith(`${name}/`)) {
8666
- return `https://cdn.jsdelivr.net/npm/${name}@${version}${path.slice(name.length)}`;
8666
+ if (typeof path === 'string') {
8667
+ if (path.startsWith(`${name}/`)) {
8668
+ path = `${npmPrefix}${name}@${version}${path.slice(name.length)}`;
8669
+ } else if (path.startsWith(`${name}@`)) {
8670
+ path = `${npmPrefix}${path}`;
8671
+ }
8667
8672
  }
8668
8673
 
8669
8674
  return path;
@@ -8707,11 +8712,12 @@ function transform$2(transformHooks) {
8707
8712
  return result;
8708
8713
  };
8709
8714
  });
8710
- transformHooks.transform.tap((_, context) => {
8715
+ transformHooks.beforeParse.tap((_, context) => {
8711
8716
  enableFeature = () => {
8712
8717
  context.features[name$2] = true;
8713
8718
  };
8714
-
8719
+ });
8720
+ transformHooks.afterParse.tap((_, context) => {
8715
8721
  const {
8716
8722
  frontmatter
8717
8723
  } = context;
@@ -8798,7 +8804,7 @@ function transform$1(transformHooks) {
8798
8804
  }
8799
8805
  });
8800
8806
  });
8801
- transformHooks.transform.tap((_, context) => {
8807
+ transformHooks.beforeParse.tap((_, context) => {
8802
8808
  enableFeature = () => {
8803
8809
  context.features[name$1] = true;
8804
8810
  };
@@ -12667,7 +12673,7 @@ var jsYaml = {
12667
12673
 
12668
12674
  const name = 'frontmatter';
12669
12675
  function transform(transformHooks) {
12670
- transformHooks.transform.tap((md, context) => {
12676
+ transformHooks.beforeParse.tap((md, context) => {
12671
12677
  const origParse = md.parse;
12672
12678
  md.parse = wrapFunction(origParse, {
12673
12679
  before(ctx) {
@@ -12737,7 +12743,8 @@ transform: transform
12737
12743
  function createTransformHooks() {
12738
12744
  return {
12739
12745
  parser: new Hook(),
12740
- transform: new Hook(),
12746
+ beforeParse: new Hook(),
12747
+ afterParse: new Hook(),
12741
12748
  htmltag: new Hook(),
12742
12749
  retransform: new Hook()
12743
12750
  };
@@ -12929,8 +12936,9 @@ class Transformer {
12929
12936
  const context = {
12930
12937
  features: {}
12931
12938
  };
12932
- this.hooks.transform.call(this.md, context);
12939
+ this.hooks.beforeParse.call(this.md, context);
12933
12940
  const tokens = this.md.parse(content, {});
12941
+ this.hooks.afterParse.call(this.md, context);
12934
12942
  let root = this.buildTree(tokens);
12935
12943
  cleanNode(root);
12936
12944
  if (((_root$children = root.children) == null ? void 0 : _root$children.length) === 1) root = root.children[0];
@@ -12976,7 +12984,7 @@ class Transformer {
12976
12984
  }
12977
12985
 
12978
12986
  const transformerVersions = {
12979
- 'markmap-lib': '0.13.6-alpha.3+3e26a91',
12987
+ 'markmap-lib': '0.13.6-alpha.6+e810c56',
12980
12988
  d3: "6.7.0"
12981
12989
  };
12982
12990