markmap-lib 0.15.2 → 0.15.3

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.15.2 | MIT License */
1
+ /*! markmap-lib v0.15.3 | 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) :
@@ -6,7 +6,7 @@ typeof define === 'function' && define.amd ? define(['exports', 'katex'], factor
6
6
  })(this, (function (exports, require$$0) { 'use strict';
7
7
 
8
8
  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" ;
9
- const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.0"}/dist/browser/index.js`];
9
+ const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.3"}/dist/browser/index.js`];
10
10
 
11
11
  function _extends$1() {
12
12
  _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
@@ -7119,7 +7119,7 @@ Remarkable.prototype.renderInline = function (str, env) {
7119
7119
  return this.renderer.render(this.parseInline(str, env), this.options, env);
7120
7120
  };
7121
7121
 
7122
- /*! markmap-common v0.15.0 | MIT License */
7122
+ /*! markmap-common v0.15.3 | MIT License */
7123
7123
  function _extends() {
7124
7124
  _extends = Object.assign ? Object.assign.bind() : function (target) {
7125
7125
  for (var i = 1; i < arguments.length; i++) {
@@ -7144,18 +7144,23 @@ class UrlBuilder {
7144
7144
  this.providers = _extends({}, defaultProviders);
7145
7145
  this.provider = "jsdelivr";
7146
7146
  }
7147
- getFastestProvider(path = testPath) {
7148
- return Promise.any(Object.entries(this.providers).map(async ([name, factory]) => {
7149
- const res = await fetch(factory(path));
7150
- if (!res.ok) {
7151
- throw res;
7152
- }
7153
- await res.text();
7154
- return name;
7155
- }));
7147
+ getFastestProvider(timeout = 5e3, path = testPath) {
7148
+ return new Promise((resolve, reject) => {
7149
+ Promise.all(Object.entries(this.providers).map(async ([name, factory]) => {
7150
+ try {
7151
+ const res = await fetch(factory(path));
7152
+ if (!res.ok) {
7153
+ throw res;
7154
+ }
7155
+ await res.text();
7156
+ resolve(name);
7157
+ } catch (_unused) {}
7158
+ })).then(() => reject(new Error("All providers failed")));
7159
+ setTimeout(reject, timeout, new Error("Timed out"));
7160
+ });
7156
7161
  }
7157
- async findFastestProvider() {
7158
- this.provider = await this.getFastestProvider();
7162
+ async findFastestProvider(timeout) {
7163
+ this.provider = await this.getFastestProvider(timeout);
7159
7164
  return this.provider;
7160
7165
  }
7161
7166
  setProvider(name, factory) {
@@ -11319,7 +11324,7 @@ class Transformer {
11319
11324
  }
11320
11325
 
11321
11326
  const transformerVersions = {
11322
- 'markmap-lib': '0.15.2',
11327
+ 'markmap-lib': '0.15.3',
11323
11328
  d3: "7.8.5"
11324
11329
  };
11325
11330
 
@@ -1,4 +1,4 @@
1
- /*! markmap-lib v0.15.2 | MIT License */
1
+ /*! markmap-lib v0.15.3 | MIT License */
2
2
  import _extends from '@babel/runtime/helpers/esm/extends';
3
3
  import { Remarkable } from 'remarkable';
4
4
  import { buildJSItem, buildCSSItem, Hook, noop, loadJS, UrlBuilder, wrapFunction, persistCSS, persistJS } from 'markmap-common';
@@ -6,7 +6,7 @@ import remarkableKatex from 'remarkable-katex';
6
6
  import yaml from 'js-yaml';
7
7
 
8
8
  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" ;
9
- const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.0"}/dist/browser/index.js`];
9
+ const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.3"}/dist/browser/index.js`];
10
10
 
11
11
  const name$3 = 'katex';
12
12
  const preloadScripts$1 = [`katex@${"0.16.8"}/dist/katex.min.js`].map(path => buildJSItem(path));
@@ -530,7 +530,7 @@ class Transformer {
530
530
  }
531
531
 
532
532
  const transformerVersions = {
533
- 'markmap-lib': '0.15.2',
533
+ 'markmap-lib': '0.15.3',
534
534
  d3: "7.8.5"
535
535
  };
536
536
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! markmap-lib v0.15.2 | MIT License */
1
+ /*! markmap-lib v0.15.3 | MIT License */
2
2
  'use strict';
3
3
 
4
4
  var _extends = require('@babel/runtime/helpers/extends');
@@ -9,7 +9,7 @@ var yaml = require('js-yaml');
9
9
  var hljs = require('highlight.js');
10
10
 
11
11
  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" ;
12
- const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.0"}/dist/browser/index.js`];
12
+ const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.3"}/dist/browser/index.js`];
13
13
 
14
14
  const name$3 = 'katex';
15
15
  const preloadScripts$1 = [`katex@${"0.16.8"}/dist/katex.min.js`].map(path => markmapCommon.buildJSItem(path));
@@ -466,7 +466,7 @@ class Transformer {
466
466
  }
467
467
 
468
468
  const transformerVersions = {
469
- 'markmap-lib': '0.15.2',
469
+ 'markmap-lib': '0.15.3',
470
470
  d3: "7.8.5"
471
471
  };
472
472
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! markmap-lib v0.15.2 | MIT License */
1
+ /*! markmap-lib v0.15.3 | MIT License */
2
2
  import _extends from '@babel/runtime/helpers/esm/extends';
3
3
  import { Remarkable } from 'remarkable';
4
4
  import { buildJSItem, buildCSSItem, Hook, wrapFunction, noop, UrlBuilder, persistCSS, persistJS } from 'markmap-common';
@@ -7,7 +7,7 @@ import yaml from 'js-yaml';
7
7
  import hljs from 'highlight.js';
8
8
 
9
9
  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" ;
10
- const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.0"}/dist/browser/index.js`];
10
+ const baseJsPaths = [`d3@${"7.8.5"}/dist/d3.min.js`, `markmap-view@${"0.15.3"}/dist/browser/index.js`];
11
11
 
12
12
  const name$3 = 'katex';
13
13
  const preloadScripts$1 = [`katex@${"0.16.8"}/dist/katex.min.js`].map(path => buildJSItem(path));
@@ -464,7 +464,7 @@ class Transformer {
464
464
  }
465
465
 
466
466
  const transformerVersions = {
467
- 'markmap-lib': '0.15.2',
467
+ 'markmap-lib': '0.15.3',
468
468
  d3: "7.8.5"
469
469
  };
470
470
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-lib",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Visualize your Markdown as mindmaps with Markmap",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -49,8 +49,8 @@
49
49
  "devDependencies": {
50
50
  "@highlightjs/cdn-assets": "^11.8.0",
51
51
  "@types/remarkable": "^2.0.3",
52
- "markmap-common": "0.15.0",
53
- "markmap-view": "0.15.0",
52
+ "markmap-common": "0.15.3",
53
+ "markmap-view": "0.15.3",
54
54
  "webfontloader": "^1.6.28"
55
55
  },
56
56
  "dependencies": {
@@ -75,5 +75,5 @@
75
75
  ]
76
76
  }
77
77
  },
78
- "gitHead": "4509199626b39150b4b2dda76d11b400251b5ea2"
78
+ "gitHead": "428254f2f36d56a89a3e161658f079d74dd16d15"
79
79
  }