markmap-lib 0.15.9-alpha.11 → 0.15.9-alpha.12

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.
@@ -18078,7 +18078,7 @@
18078
18078
  return {};
18079
18079
  }
18080
18080
  });
18081
- const checkbox = plugin$3;
18081
+ const pluginCheckbox = plugin$3;
18082
18082
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
18083
18083
  function isNothing(subject) {
18084
18084
  return typeof subject === "undefined" || subject === null;
@@ -20769,7 +20769,7 @@
20769
20769
  };
20770
20770
  const yaml = jsYaml;
20771
20771
  const name$4 = "frontmatter";
20772
- const frontmatter = definePlugin({
20772
+ const pluginFrontmatter = definePlugin({
20773
20773
  name: name$4,
20774
20774
  transform(transformHooks) {
20775
20775
  transformHooks.beforeParse.tap((md, context) => {
@@ -20780,18 +20780,18 @@
20780
20780
  if (!match)
20781
20781
  return;
20782
20782
  const raw = content.slice(4, match.index);
20783
- let frontmatter2;
20783
+ let frontmatter;
20784
20784
  try {
20785
- frontmatter2 = yaml.load(raw);
20786
- if (frontmatter2 == null ? void 0 : frontmatter2.markmap) {
20787
- frontmatter2.markmap = normalizeMarkmapJsonOptions(
20788
- frontmatter2.markmap
20785
+ frontmatter = yaml.load(raw);
20786
+ if (frontmatter == null ? void 0 : frontmatter.markmap) {
20787
+ frontmatter.markmap = normalizeMarkmapJsonOptions(
20788
+ frontmatter.markmap
20789
20789
  );
20790
20790
  }
20791
20791
  } catch {
20792
20792
  return;
20793
20793
  }
20794
- context.frontmatter = frontmatter2;
20794
+ context.frontmatter = frontmatter;
20795
20795
  context.content = content.slice(match.index + match[0].length);
20796
20796
  context.contentLineOffset = content.slice(0, match.index).split("\n").length + 1;
20797
20797
  });
@@ -20881,9 +20881,9 @@
20881
20881
  md.set({
20882
20882
  highlight: (str2, language) => {
20883
20883
  enableFeature();
20884
- const { hljs: hljs2 } = window;
20885
- if (hljs2) {
20886
- return hljs2.highlightAuto(str2, language ? [language] : void 0).value;
20884
+ const { hljs } = window;
20885
+ if (hljs) {
20886
+ return hljs.highlightAuto(str2, language ? [language] : void 0).value;
20887
20887
  }
20888
20888
  autoload().then(() => {
20889
20889
  transformHooks.retransform.call();
@@ -20902,7 +20902,7 @@
20902
20902
  };
20903
20903
  }
20904
20904
  });
20905
- const hljs = plugin$2;
20905
+ const pluginHljs = plugin$2;
20906
20906
  const rkatex = (md, options) => {
20907
20907
  const backslash = "\\";
20908
20908
  const dollar = "$";
@@ -20911,8 +20911,8 @@
20911
20911
  if (delimiter.length !== 1) {
20912
20912
  throw new Error("invalid delimiter");
20913
20913
  }
20914
- const katex2 = require$$0;
20915
- const renderKatex = (source, displayMode) => katex2.renderToString(
20914
+ const katex = require$$0;
20915
+ const renderKatex = (source, displayMode) => katex.renderToString(
20916
20916
  source,
20917
20917
  {
20918
20918
  displayMode,
@@ -21116,9 +21116,9 @@
21116
21116
  return loading;
21117
21117
  };
21118
21118
  const renderKatex = (source, displayMode) => {
21119
- const { katex: katex2 } = window;
21120
- if (katex2) {
21121
- return katex2.renderToString(source, {
21119
+ const { katex } = window;
21120
+ if (katex) {
21121
+ return katex.renderToString(source, {
21122
21122
  displayMode,
21123
21123
  throwOnError: false
21124
21124
  });
@@ -21165,14 +21165,14 @@
21165
21165
  };
21166
21166
  }
21167
21167
  });
21168
- const katex = plugin$1;
21168
+ const pluginKatex = plugin$1;
21169
21169
  const name$1 = "npmUrl";
21170
- const npmUrl = definePlugin({
21170
+ const pluginNpmUrl = definePlugin({
21171
21171
  name: name$1,
21172
21172
  transform(transformHooks) {
21173
21173
  transformHooks.afterParse.tap((_, context) => {
21174
- const { frontmatter: frontmatter2 } = context;
21175
- const markmap = frontmatter2 == null ? void 0 : frontmatter2.markmap;
21174
+ const { frontmatter } = context;
21175
+ const markmap = frontmatter == null ? void 0 : frontmatter.markmap;
21176
21176
  if (markmap) {
21177
21177
  ["extraJs", "extraCss"].forEach((key) => {
21178
21178
  const value = markmap[key];
@@ -21223,14 +21223,14 @@
21223
21223
  return html2;
21224
21224
  });
21225
21225
  }
21226
- const sourceLines = plugin;
21226
+ const pluginSourceLines = plugin;
21227
21227
  const plugins = [
21228
- frontmatter,
21229
- katex,
21230
- hljs,
21231
- npmUrl,
21232
- checkbox,
21233
- sourceLines
21228
+ pluginFrontmatter,
21229
+ pluginKatex,
21230
+ pluginHljs,
21231
+ pluginNpmUrl,
21232
+ pluginCheckbox,
21233
+ pluginSourceLines
21234
21234
  ];
21235
21235
  const builtInPlugins = plugins;
21236
21236
  function cleanNode(node) {
@@ -54,9 +54,9 @@ const plugin$3 = definePlugin({
54
54
  return {};
55
55
  }
56
56
  });
57
- const checkbox = plugin$3;
57
+ const pluginCheckbox = plugin$3;
58
58
  const name$4 = "frontmatter";
59
- const frontmatter = definePlugin({
59
+ const pluginFrontmatter = definePlugin({
60
60
  name: name$4,
61
61
  transform(transformHooks) {
62
62
  transformHooks.beforeParse.tap((md, context) => {
@@ -67,18 +67,18 @@ const frontmatter = definePlugin({
67
67
  if (!match)
68
68
  return;
69
69
  const raw = content.slice(4, match.index);
70
- let frontmatter2;
70
+ let frontmatter;
71
71
  try {
72
- frontmatter2 = yaml.load(raw);
73
- if (frontmatter2 == null ? void 0 : frontmatter2.markmap) {
74
- frontmatter2.markmap = normalizeMarkmapJsonOptions(
75
- frontmatter2.markmap
72
+ frontmatter = yaml.load(raw);
73
+ if (frontmatter == null ? void 0 : frontmatter.markmap) {
74
+ frontmatter.markmap = normalizeMarkmapJsonOptions(
75
+ frontmatter.markmap
76
76
  );
77
77
  }
78
78
  } catch {
79
79
  return;
80
80
  }
81
- context.frontmatter = frontmatter2;
81
+ context.frontmatter = frontmatter;
82
82
  context.content = content.slice(match.index + match[0].length);
83
83
  context.contentLineOffset = content.slice(0, match.index).split("\n").length + 1;
84
84
  });
@@ -168,9 +168,9 @@ const plugin$2 = definePlugin({
168
168
  md.set({
169
169
  highlight: (str, language) => {
170
170
  enableFeature();
171
- const { hljs: hljs2 } = window;
172
- if (hljs2) {
173
- return hljs2.highlightAuto(str, language ? [language] : void 0).value;
171
+ const { hljs } = window;
172
+ if (hljs) {
173
+ return hljs.highlightAuto(str, language ? [language] : void 0).value;
174
174
  }
175
175
  autoload().then(() => {
176
176
  transformHooks.retransform.call();
@@ -189,7 +189,7 @@ const plugin$2 = definePlugin({
189
189
  };
190
190
  }
191
191
  });
192
- const hljs = plugin$2;
192
+ const pluginHljs = plugin$2;
193
193
  const name$2 = "katex";
194
194
  const preloadScripts = [
195
195
  `katex@${"0.16.8"}/dist/katex.min.js`
@@ -273,9 +273,9 @@ const plugin$1 = definePlugin({
273
273
  return loading;
274
274
  };
275
275
  const renderKatex = (source, displayMode) => {
276
- const { katex: katex2 } = window;
277
- if (katex2) {
278
- return katex2.renderToString(source, {
276
+ const { katex } = window;
277
+ if (katex) {
278
+ return katex.renderToString(source, {
279
279
  displayMode,
280
280
  throwOnError: false
281
281
  });
@@ -322,14 +322,14 @@ const plugin$1 = definePlugin({
322
322
  };
323
323
  }
324
324
  });
325
- const katex = plugin$1;
325
+ const pluginKatex = plugin$1;
326
326
  const name$1 = "npmUrl";
327
- const npmUrl = definePlugin({
327
+ const pluginNpmUrl = definePlugin({
328
328
  name: name$1,
329
329
  transform(transformHooks) {
330
330
  transformHooks.afterParse.tap((_, context) => {
331
- const { frontmatter: frontmatter2 } = context;
332
- const markmap = frontmatter2 == null ? void 0 : frontmatter2.markmap;
331
+ const { frontmatter } = context;
332
+ const markmap = frontmatter == null ? void 0 : frontmatter.markmap;
333
333
  if (markmap) {
334
334
  ["extraJs", "extraCss"].forEach((key) => {
335
335
  const value = markmap[key];
@@ -380,14 +380,14 @@ function patchRule(rule, _key) {
380
380
  return html;
381
381
  });
382
382
  }
383
- const sourceLines = plugin;
383
+ const pluginSourceLines = plugin;
384
384
  const plugins = [
385
- frontmatter,
386
- katex,
387
- hljs,
388
- npmUrl,
389
- checkbox,
390
- sourceLines
385
+ pluginFrontmatter,
386
+ pluginKatex,
387
+ pluginHljs,
388
+ pluginNpmUrl,
389
+ pluginCheckbox,
390
+ pluginSourceLines
391
391
  ];
392
392
  const builtInPlugins = plugins;
393
393
  function cleanNode(node) {
@@ -1,2 +1,9 @@
1
+ import pluginCheckbox from './checkbox';
2
+ import pluginFrontmatter from './frontmatter';
3
+ import pluginHljs from './hljs';
4
+ import pluginKatex from './katex';
5
+ import pluginNpmUrl from './npm-url';
6
+ import pluginSourceLines from './source-lines';
1
7
  export * from './base';
8
+ export { pluginCheckbox, pluginFrontmatter, pluginHljs, pluginKatex, pluginNpmUrl, pluginSourceLines, };
2
9
  export declare const plugins: import("..").ITransformPlugin[];
package/dist/plugins.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const markmapCommon = require("markmap-common");
4
4
  const yaml = require("js-yaml");
5
- const hljs$1 = require("highlight.js");
5
+ const hljs = require("highlight.js");
6
6
  const remarkableKatex = require("remarkable-katex");
7
7
  function createTransformHooks(transformer) {
8
8
  return {
@@ -50,9 +50,9 @@ const plugin$3 = definePlugin({
50
50
  return {};
51
51
  }
52
52
  });
53
- const checkbox = plugin$3;
53
+ const pluginCheckbox = plugin$3;
54
54
  const name$4 = "frontmatter";
55
- const frontmatter = definePlugin({
55
+ const pluginFrontmatter = definePlugin({
56
56
  name: name$4,
57
57
  transform(transformHooks) {
58
58
  transformHooks.beforeParse.tap((md, context) => {
@@ -63,18 +63,18 @@ const frontmatter = definePlugin({
63
63
  if (!match)
64
64
  return;
65
65
  const raw = content.slice(4, match.index);
66
- let frontmatter2;
66
+ let frontmatter;
67
67
  try {
68
- frontmatter2 = yaml.load(raw);
69
- if (frontmatter2 == null ? void 0 : frontmatter2.markmap) {
70
- frontmatter2.markmap = normalizeMarkmapJsonOptions(
71
- frontmatter2.markmap
68
+ frontmatter = yaml.load(raw);
69
+ if (frontmatter == null ? void 0 : frontmatter.markmap) {
70
+ frontmatter.markmap = normalizeMarkmapJsonOptions(
71
+ frontmatter.markmap
72
72
  );
73
73
  }
74
74
  } catch {
75
75
  return;
76
76
  }
77
- context.frontmatter = frontmatter2;
77
+ context.frontmatter = frontmatter;
78
78
  context.content = content.slice(match.index + match[0].length);
79
79
  context.contentLineOffset = content.slice(0, match.index).split("\n").length + 1;
80
80
  });
@@ -132,7 +132,7 @@ const plugin$2 = definePlugin({
132
132
  md.set({
133
133
  highlight: (str, language) => {
134
134
  enableFeature();
135
- return hljs$1.highlightAuto(str, language ? [language] : void 0).value;
135
+ return hljs.highlightAuto(str, language ? [language] : void 0).value;
136
136
  }
137
137
  });
138
138
  });
@@ -146,7 +146,7 @@ const plugin$2 = definePlugin({
146
146
  };
147
147
  }
148
148
  });
149
- const hljs = plugin$2;
149
+ const pluginHljs = plugin$2;
150
150
  const name$2 = "katex";
151
151
  const preloadScripts = [
152
152
  `katex@${"0.16.8"}/dist/katex.min.js`
@@ -227,14 +227,14 @@ const plugin$1 = definePlugin({
227
227
  };
228
228
  }
229
229
  });
230
- const katex = plugin$1;
230
+ const pluginKatex = plugin$1;
231
231
  const name$1 = "npmUrl";
232
- const npmUrl = definePlugin({
232
+ const pluginNpmUrl = definePlugin({
233
233
  name: name$1,
234
234
  transform(transformHooks) {
235
235
  transformHooks.afterParse.tap((_, context) => {
236
- const { frontmatter: frontmatter2 } = context;
237
- const markmap = frontmatter2 == null ? void 0 : frontmatter2.markmap;
236
+ const { frontmatter } = context;
237
+ const markmap = frontmatter == null ? void 0 : frontmatter.markmap;
238
238
  if (markmap) {
239
239
  ["extraJs", "extraCss"].forEach((key) => {
240
240
  const value = markmap[key];
@@ -285,15 +285,21 @@ function patchRule(rule, _key) {
285
285
  return html;
286
286
  });
287
287
  }
288
- const sourceLines = plugin;
288
+ const pluginSourceLines = plugin;
289
289
  const plugins = [
290
- frontmatter,
291
- katex,
292
- hljs,
293
- npmUrl,
294
- checkbox,
295
- sourceLines
290
+ pluginFrontmatter,
291
+ pluginKatex,
292
+ pluginHljs,
293
+ pluginNpmUrl,
294
+ pluginCheckbox,
295
+ pluginSourceLines
296
296
  ];
297
297
  exports.createTransformHooks = createTransformHooks;
298
298
  exports.definePlugin = definePlugin;
299
+ exports.pluginCheckbox = pluginCheckbox;
300
+ exports.pluginFrontmatter = pluginFrontmatter;
301
+ exports.pluginHljs = pluginHljs;
302
+ exports.pluginKatex = pluginKatex;
303
+ exports.pluginNpmUrl = pluginNpmUrl;
304
+ exports.pluginSourceLines = pluginSourceLines;
299
305
  exports.plugins = plugins;
package/dist/plugins.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Hook, buildJSItem, buildCSSItem, noop, wrapFunction } from "markmap-common";
2
2
  import yaml from "js-yaml";
3
- import hljs$1 from "highlight.js";
3
+ import hljs from "highlight.js";
4
4
  import remarkableKatex from "remarkable-katex";
5
5
  function createTransformHooks(transformer) {
6
6
  return {
@@ -48,9 +48,9 @@ const plugin$3 = definePlugin({
48
48
  return {};
49
49
  }
50
50
  });
51
- const checkbox = plugin$3;
51
+ const pluginCheckbox = plugin$3;
52
52
  const name$4 = "frontmatter";
53
- const frontmatter = definePlugin({
53
+ const pluginFrontmatter = definePlugin({
54
54
  name: name$4,
55
55
  transform(transformHooks) {
56
56
  transformHooks.beforeParse.tap((md, context) => {
@@ -61,18 +61,18 @@ const frontmatter = definePlugin({
61
61
  if (!match)
62
62
  return;
63
63
  const raw = content.slice(4, match.index);
64
- let frontmatter2;
64
+ let frontmatter;
65
65
  try {
66
- frontmatter2 = yaml.load(raw);
67
- if (frontmatter2 == null ? void 0 : frontmatter2.markmap) {
68
- frontmatter2.markmap = normalizeMarkmapJsonOptions(
69
- frontmatter2.markmap
66
+ frontmatter = yaml.load(raw);
67
+ if (frontmatter == null ? void 0 : frontmatter.markmap) {
68
+ frontmatter.markmap = normalizeMarkmapJsonOptions(
69
+ frontmatter.markmap
70
70
  );
71
71
  }
72
72
  } catch {
73
73
  return;
74
74
  }
75
- context.frontmatter = frontmatter2;
75
+ context.frontmatter = frontmatter;
76
76
  context.content = content.slice(match.index + match[0].length);
77
77
  context.contentLineOffset = content.slice(0, match.index).split("\n").length + 1;
78
78
  });
@@ -130,7 +130,7 @@ const plugin$2 = definePlugin({
130
130
  md.set({
131
131
  highlight: (str, language) => {
132
132
  enableFeature();
133
- return hljs$1.highlightAuto(str, language ? [language] : void 0).value;
133
+ return hljs.highlightAuto(str, language ? [language] : void 0).value;
134
134
  }
135
135
  });
136
136
  });
@@ -144,7 +144,7 @@ const plugin$2 = definePlugin({
144
144
  };
145
145
  }
146
146
  });
147
- const hljs = plugin$2;
147
+ const pluginHljs = plugin$2;
148
148
  const name$2 = "katex";
149
149
  const preloadScripts = [
150
150
  `katex@${"0.16.8"}/dist/katex.min.js`
@@ -225,14 +225,14 @@ const plugin$1 = definePlugin({
225
225
  };
226
226
  }
227
227
  });
228
- const katex = plugin$1;
228
+ const pluginKatex = plugin$1;
229
229
  const name$1 = "npmUrl";
230
- const npmUrl = definePlugin({
230
+ const pluginNpmUrl = definePlugin({
231
231
  name: name$1,
232
232
  transform(transformHooks) {
233
233
  transformHooks.afterParse.tap((_, context) => {
234
- const { frontmatter: frontmatter2 } = context;
235
- const markmap = frontmatter2 == null ? void 0 : frontmatter2.markmap;
234
+ const { frontmatter } = context;
235
+ const markmap = frontmatter == null ? void 0 : frontmatter.markmap;
236
236
  if (markmap) {
237
237
  ["extraJs", "extraCss"].forEach((key) => {
238
238
  const value = markmap[key];
@@ -283,17 +283,23 @@ function patchRule(rule, _key) {
283
283
  return html;
284
284
  });
285
285
  }
286
- const sourceLines = plugin;
286
+ const pluginSourceLines = plugin;
287
287
  const plugins = [
288
- frontmatter,
289
- katex,
290
- hljs,
291
- npmUrl,
292
- checkbox,
293
- sourceLines
288
+ pluginFrontmatter,
289
+ pluginKatex,
290
+ pluginHljs,
291
+ pluginNpmUrl,
292
+ pluginCheckbox,
293
+ pluginSourceLines
294
294
  ];
295
295
  export {
296
296
  createTransformHooks,
297
297
  definePlugin,
298
+ pluginCheckbox,
299
+ pluginFrontmatter,
300
+ pluginHljs,
301
+ pluginKatex,
302
+ pluginNpmUrl,
303
+ pluginSourceLines,
298
304
  plugins
299
305
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-lib",
3
- "version": "0.15.9-alpha.11+d60da2f",
3
+ "version": "0.15.9-alpha.12+e2132d2",
4
4
  "description": "Visualize your Markdown as mindmaps with Markmap",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -59,8 +59,8 @@
59
59
  "devDependencies": {
60
60
  "@highlightjs/cdn-assets": "^11.8.0",
61
61
  "@types/remarkable": "^2.0.3",
62
- "markmap-common": "0.15.9-alpha.11+d60da2f",
63
- "markmap-view": "0.15.9-alpha.11+d60da2f",
62
+ "markmap-common": "0.15.9-alpha.12+e2132d2",
63
+ "markmap-view": "0.15.9-alpha.12+e2132d2",
64
64
  "webfontloader": "^1.6.28"
65
65
  },
66
66
  "dependencies": {
@@ -68,7 +68,7 @@
68
68
  "highlight.js": "^11.8.0",
69
69
  "js-yaml": "^4.1.0",
70
70
  "katex": "^0.16.8",
71
- "markmap-html-parser": "0.15.9-alpha.11+d60da2f",
71
+ "markmap-html-parser": "0.15.9-alpha.12+e2132d2",
72
72
  "prismjs": "^1.29.0",
73
73
  "remarkable": "^2.0.1",
74
74
  "remarkable-katex": "^1.2.1"
@@ -86,5 +86,5 @@
86
86
  ]
87
87
  }
88
88
  },
89
- "gitHead": "d60da2fb13a85edec875ef002f1be414a0c00abe"
89
+ "gitHead": "e2132d2615f5b19e246478dc9dbb6b6ca4d6d75f"
90
90
  }