markmap-cli 0.14.5-alpha.15 → 0.14.5-alpha.17

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! markmap-cli v0.14.5-alpha.15+1fe26c8 | MIT License */
1
+ /*! markmap-cli v0.14.5-alpha.17+0d6a717 | MIT License */
2
2
  'use strict';
3
3
 
4
4
  var fs = require('fs');
@@ -27,7 +27,7 @@ function _extends() {
27
27
  return _extends.apply(this, arguments);
28
28
  }
29
29
 
30
- const TOOLBAR_VERSION = "0.14.5-alpha.15+1fe26c8";
30
+ const TOOLBAR_VERSION = "0.14.5-alpha.17+0d6a717";
31
31
  const TOOLBAR_CSS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/style.css`;
32
32
  const TOOLBAR_JS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/index.js`;
33
33
  const renderToolbar = () => {
@@ -55,14 +55,6 @@ function addToolbar(assets) {
55
55
  }]
56
56
  };
57
57
  }
58
- class Defer {
59
- constructor() {
60
- this.promise = new Promise((resolve, reject) => {
61
- this.resolve = resolve;
62
- this.reject = reject;
63
- });
64
- }
65
- }
66
58
  function localProvider(path) {
67
59
  const parts = path.split('/');
68
60
  parts[0] = parts[0].replace(/@[\d.]+$/, '');
@@ -70,12 +62,11 @@ function localProvider(path) {
70
62
  return `/node_modules/${path}`;
71
63
  }
72
64
 
73
- /* eslint-disable max-classes-per-file */
74
65
  function sequence(fn) {
75
66
  let promise;
76
67
  return () => {
77
68
  promise || (promise = fn().finally(() => {
78
- promise = null;
69
+ promise = undefined;
79
70
  }));
80
71
  return promise;
81
72
  };
@@ -85,6 +76,8 @@ class BufferContentProvider {
85
76
  this.deferredSet = new Set();
86
77
  this.events = new events.EventEmitter();
87
78
  this.ts = 0;
79
+ this.content = '';
80
+ this.line = -1;
88
81
  this.events.on('content', () => {
89
82
  this.feed({
90
83
  ts: this.ts,
@@ -98,7 +91,7 @@ class BufferContentProvider {
98
91
  });
99
92
  }
100
93
  async getUpdate(ts, timeout = 10000) {
101
- const deferred = new Defer();
94
+ const deferred = markmapCommon.defer();
102
95
  this.deferredSet.add(deferred);
103
96
  setTimeout(() => {
104
97
  this.feed({}, deferred);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-cli",
3
- "version": "0.14.5-alpha.15+1fe26c8",
3
+ "version": "0.14.5-alpha.17+0d6a717",
4
4
  "description": "Create markmaps from CLI",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -44,14 +44,14 @@
44
44
  "d3": "^6.2.0",
45
45
  "katex": "^0.16.0",
46
46
  "koa": "^2.13.1",
47
- "markmap-common": "0.14.5-alpha.15+1fe26c8",
48
- "markmap-lib": "0.14.5-alpha.15+1fe26c8",
49
- "markmap-toolbar": "0.14.5-alpha.15+1fe26c8",
50
- "markmap-view": "0.14.5-alpha.15+1fe26c8",
47
+ "markmap-common": "0.14.2",
48
+ "markmap-lib": "0.14.5-alpha.17+0d6a717",
49
+ "markmap-toolbar": "0.14.5-alpha.17+0d6a717",
50
+ "markmap-view": "0.14.5-alpha.17+0d6a717",
51
51
  "open": "^8.0.3",
52
52
  "prismjs": "^1.28.0",
53
53
  "update-notifier": "^5.1.0",
54
54
  "webfontloader": "^1.6.28"
55
55
  },
56
- "gitHead": "1fe26c8234296e2188e466c7b9dbf3b7e171857d"
56
+ "gitHead": "0d6a717b05c622a23faa501e79a7da7cda3ea0b6"
57
57
  }
package/types/util.d.ts CHANGED
@@ -15,9 +15,4 @@ export interface IDevelopOptions {
15
15
  offline: boolean;
16
16
  }
17
17
  export declare function addToolbar(assets: IAssets): IAssets;
18
- export declare class Defer<T> {
19
- resolve: (value: T) => void;
20
- reject: (err: Error) => void;
21
- promise: Promise<unknown>;
22
- }
23
18
  export declare function localProvider(path: string): string;