markmap-lib 0.17.2 → 0.17.3-alpha.1

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/plugins.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Hook, buildJSItem, buildCSSItem, noop, wrapFunction } from "markmap-common";
2
2
  import { parse } from "yaml";
3
3
  import hljs from "highlight.js";
4
- import katexPlugin from "@iktakahiro/markdown-it-katex";
4
+ import katexPlugin from "@vscode/markdown-it-katex";
5
5
  function createTransformHooks(transformer) {
6
6
  return {
7
7
  transformer,
@@ -45,7 +45,6 @@ const plugin$3 = definePlugin({
45
45
  return {};
46
46
  }
47
47
  });
48
- const pluginCheckbox = plugin$3;
49
48
  const name$4 = "frontmatter";
50
49
  const pluginFrontmatter = definePlugin({
51
50
  name: name$4,
@@ -53,11 +52,9 @@ const pluginFrontmatter = definePlugin({
53
52
  transformHooks.beforeParse.tap((_md, context) => {
54
53
  var _a;
55
54
  const { content } = context;
56
- if (!/^---\r?\n/.test(content))
57
- return;
55
+ if (!/^---\r?\n/.test(content)) return;
58
56
  const match = /\n---\r?\n/.exec(content);
59
- if (!match)
60
- return;
57
+ if (!match) return;
61
58
  const raw = content.slice(4, match.index).trimEnd();
62
59
  let frontmatter;
63
60
  try {
@@ -82,41 +79,36 @@ const pluginFrontmatter = definePlugin({
82
79
  }
83
80
  });
84
81
  function normalizeMarkmapJsonOptions(options) {
85
- if (!options)
86
- return;
82
+ if (!options) return;
87
83
  ["color", "extraJs", "extraCss"].forEach((key) => {
88
- if (options[key] != null)
89
- options[key] = normalizeStringArray(options[key]);
84
+ if (options[key] != null) options[key] = normalizeStringArray(options[key]);
90
85
  });
91
86
  ["duration", "maxWidth", "initialExpandLevel"].forEach((key) => {
92
- if (options[key] != null)
93
- options[key] = normalizeNumber(options[key]);
87
+ if (options[key] != null) options[key] = normalizeNumber(options[key]);
94
88
  });
95
89
  return options;
96
90
  }
97
91
  function normalizeStringArray(value) {
98
92
  let result;
99
- if (typeof value === "string")
100
- result = [value];
93
+ if (typeof value === "string") result = [value];
101
94
  else if (Array.isArray(value))
102
95
  result = value.filter((item) => item && typeof item === "string");
103
96
  return (result == null ? void 0 : result.length) ? result : void 0;
104
97
  }
105
98
  function normalizeNumber(value) {
106
- if (isNaN(+value))
107
- return;
99
+ if (isNaN(+value)) return;
108
100
  return +value;
109
101
  }
110
102
  const name$3 = "hljs";
111
103
  const preloadScripts$1 = [
112
- `@highlightjs/cdn-assets@${"11.8.0"}/highlight.min.js`
104
+ `@highlightjs/cdn-assets@${"11.10.0"}/highlight.min.js`
113
105
  ].map((path) => buildJSItem(path));
114
106
  const styles$1 = [
115
- `@highlightjs/cdn-assets@${"11.8.0"}/styles/default.min.css`
107
+ `@highlightjs/cdn-assets@${"11.10.0"}/styles/default.min.css`
116
108
  ].map((path) => buildCSSItem(path));
117
109
  const config$1 = {
118
110
  versions: {
119
- hljs: "11.8.0"
111
+ hljs: "11.10.0"
120
112
  },
121
113
  preloadScripts: preloadScripts$1,
122
114
  styles: styles$1
@@ -145,21 +137,20 @@ const plugin$2 = definePlugin({
145
137
  };
146
138
  }
147
139
  });
148
- const pluginHljs = plugin$2;
149
140
  const name$2 = "katex";
150
141
  const preloadScripts = [
151
- `katex@${"0.16.8"}/dist/katex.min.js`
142
+ `katex@${"0.16.11"}/dist/katex.min.js`
152
143
  ].map((path) => buildJSItem(path));
153
144
  const webfontloader = buildJSItem(
154
145
  `webfontloader@${"1.6.28"}/webfontloader.js`
155
146
  );
156
147
  webfontloader.data.defer = true;
157
- const styles = [`katex@${"0.16.8"}/dist/katex.min.css`].map(
148
+ const styles = [`katex@${"0.16.11"}/dist/katex.min.css`].map(
158
149
  (path) => buildCSSItem(path)
159
150
  );
160
151
  const config = {
161
152
  versions: {
162
- katex: "0.16.8",
153
+ katex: "0.16.11",
163
154
  webfontloader: "1.6.28"
164
155
  },
165
156
  preloadScripts,
@@ -228,7 +219,6 @@ const plugin$1 = definePlugin({
228
219
  };
229
220
  }
230
221
  });
231
- const pluginKatex = plugin$1;
232
222
  const name$1 = "npmUrl";
233
223
  const pluginNpmUrl = definePlugin({
234
224
  name: name$1,
@@ -274,23 +264,22 @@ const plugin = definePlugin({
274
264
  return {};
275
265
  }
276
266
  });
277
- const pluginSourceLines = plugin;
278
267
  const plugins = [
279
268
  pluginFrontmatter,
280
- pluginKatex,
281
- pluginHljs,
269
+ plugin$1,
270
+ plugin$2,
282
271
  pluginNpmUrl,
283
- pluginCheckbox,
284
- pluginSourceLines
272
+ plugin$3,
273
+ plugin
285
274
  ];
286
275
  export {
287
276
  createTransformHooks,
288
277
  definePlugin,
289
- pluginCheckbox,
278
+ plugin$3 as pluginCheckbox,
290
279
  pluginFrontmatter,
291
- pluginHljs,
292
- pluginKatex,
280
+ plugin$2 as pluginHljs,
281
+ plugin$1 as pluginKatex,
293
282
  pluginNpmUrl,
294
- pluginSourceLines,
283
+ plugin as pluginSourceLines,
295
284
  plugins
296
285
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-lib",
3
- "version": "0.17.2",
3
+ "version": "0.17.3-alpha.1+4942a37",
4
4
  "description": "Visualize your Markdown as mindmaps with Markmap",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@babel/runtime": "^7.22.6",
69
- "@iktakahiro/markdown-it-katex": "^4.0.1",
69
+ "@vscode/markdown-it-katex": "^1.1.0",
70
70
  "highlight.js": "^11.8.0",
71
71
  "katex": "^0.16.8",
72
72
  "markdown-it": "^14.1.0",
@@ -74,8 +74,8 @@
74
74
  "markdown-it-mark": "^4.0.0",
75
75
  "markdown-it-sub": "^2.0.0",
76
76
  "markdown-it-sup": "^2.0.0",
77
- "markmap-html-parser": "0.17.1",
78
- "markmap-view": "0.17.2",
77
+ "markmap-html-parser": "0.17.3-alpha.1+4942a37",
78
+ "markmap-view": "0.17.3-alpha.1+4942a37",
79
79
  "prismjs": "^1.29.0",
80
80
  "yaml": "^2.5.1"
81
81
  },
@@ -96,5 +96,5 @@
96
96
  "^(.*\\.svg)\\?raw$": "$1"
97
97
  }
98
98
  },
99
- "gitHead": "bbeec32d0efeea4e36755b1909a5993187264487"
99
+ "gitHead": "4942a3759db08bbbc179034c0b08c5c2112566dc"
100
100
  }