mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
Fixed string-ansi
This commit is contained in:
parent
71efa09737
commit
a3c88b6ec7
@ -96,6 +96,9 @@ packages/app-cli/app/command-sync.js.map
|
|||||||
packages/app-cli/app/command-testing.d.ts
|
packages/app-cli/app/command-testing.d.ts
|
||||||
packages/app-cli/app/command-testing.js
|
packages/app-cli/app/command-testing.js
|
||||||
packages/app-cli/app/command-testing.js.map
|
packages/app-cli/app/command-testing.js.map
|
||||||
|
packages/app-cli/app/gui/StatusBarWidget.d.ts
|
||||||
|
packages/app-cli/app/gui/StatusBarWidget.js
|
||||||
|
packages/app-cli/app/gui/StatusBarWidget.js.map
|
||||||
packages/app-cli/app/services/plugins/PluginRunner.d.ts
|
packages/app-cli/app/services/plugins/PluginRunner.d.ts
|
||||||
packages/app-cli/app/services/plugins/PluginRunner.js
|
packages/app-cli/app/services/plugins/PluginRunner.js
|
||||||
packages/app-cli/app/services/plugins/PluginRunner.js.map
|
packages/app-cli/app/services/plugins/PluginRunner.js.map
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -84,6 +84,9 @@ packages/app-cli/app/command-sync.js.map
|
|||||||
packages/app-cli/app/command-testing.d.ts
|
packages/app-cli/app/command-testing.d.ts
|
||||||
packages/app-cli/app/command-testing.js
|
packages/app-cli/app/command-testing.js
|
||||||
packages/app-cli/app/command-testing.js.map
|
packages/app-cli/app/command-testing.js.map
|
||||||
|
packages/app-cli/app/gui/StatusBarWidget.d.ts
|
||||||
|
packages/app-cli/app/gui/StatusBarWidget.js
|
||||||
|
packages/app-cli/app/gui/StatusBarWidget.js.map
|
||||||
packages/app-cli/app/services/plugins/PluginRunner.d.ts
|
packages/app-cli/app/services/plugins/PluginRunner.d.ts
|
||||||
packages/app-cli/app/services/plugins/PluginRunner.js
|
packages/app-cli/app/services/plugins/PluginRunner.js
|
||||||
packages/app-cli/app/services/plugins/PluginRunner.js.map
|
packages/app-cli/app/services/plugins/PluginRunner.js.map
|
||||||
|
@ -33,7 +33,7 @@ const ResourceServer = require('./ResourceServer.js');
|
|||||||
const NoteMetadataWidget = require('./gui/NoteMetadataWidget.js');
|
const NoteMetadataWidget = require('./gui/NoteMetadataWidget.js');
|
||||||
const FolderListWidget = require('./gui/FolderListWidget.js');
|
const FolderListWidget = require('./gui/FolderListWidget.js');
|
||||||
const NoteListWidget = require('./gui/NoteListWidget.js');
|
const NoteListWidget = require('./gui/NoteListWidget.js');
|
||||||
const StatusBarWidget = require('./gui/StatusBarWidget.js');
|
const StatusBarWidget = require('./gui/StatusBarWidget').default;
|
||||||
const ConsoleWidget = require('./gui/ConsoleWidget.js');
|
const ConsoleWidget = require('./gui/ConsoleWidget.js');
|
||||||
const LinkSelector = require('./LinkSelector.js').default;
|
const LinkSelector = require('./LinkSelector.js').default;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
const BaseWidget = require('tkwidgets/BaseWidget.js');
|
const BaseWidget = require('tkwidgets/BaseWidget.js');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
const termutils = require('tkwidgets/framework/termutils.js');
|
const termutils = require('tkwidgets/framework/termutils.js');
|
||||||
const stripAnsi = require('strip-ansi');
|
import stripAnsi from 'strip-ansi';
|
||||||
const { handleAutocompletion } = require('../autocompletion.js');
|
const { handleAutocompletion } = require('../autocompletion.js');
|
||||||
|
|
||||||
class StatusBarWidget extends BaseWidget {
|
export default class StatusBarWidget extends BaseWidget {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ class StatusBarWidget extends BaseWidget {
|
|||||||
this.invalidate();
|
this.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
async prompt(initialText = '', promptString = null, options = null) {
|
async prompt(initialText = '', promptString: any = null, options: any = null) {
|
||||||
if (this.promptState_) throw new Error('Another prompt already active');
|
if (this.promptState_) throw new Error('Another prompt already active');
|
||||||
if (promptString === null) promptString = ':';
|
if (promptString === null) promptString = ':';
|
||||||
if (options === null) options = {};
|
if (options === null) options = {};
|
||||||
@ -36,7 +36,7 @@ class StatusBarWidget extends BaseWidget {
|
|||||||
|
|
||||||
this.promptState_ = {
|
this.promptState_ = {
|
||||||
promise: null,
|
promise: null,
|
||||||
initialText: stripAnsi(initialText),
|
initialText: (initialText),
|
||||||
promptString: stripAnsi(promptString),
|
promptString: stripAnsi(promptString),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ class StatusBarWidget extends BaseWidget {
|
|||||||
|
|
||||||
const isSecurePrompt = !!this.promptState_.secure;
|
const isSecurePrompt = !!this.promptState_.secure;
|
||||||
|
|
||||||
const options = {
|
const options: any = {
|
||||||
cancelable: true,
|
cancelable: true,
|
||||||
history: this.history,
|
history: this.history,
|
||||||
default: this.promptState_.initialText,
|
default: this.promptState_.initialText,
|
||||||
@ -161,5 +161,3 @@ class StatusBarWidget extends BaseWidget {
|
|||||||
if (doSaveCursor) this.term.restoreCursor();
|
if (doSaveCursor) this.term.restoreCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = StatusBarWidget;
|
|
@ -59,7 +59,7 @@
|
|||||||
"sprintf-js": "1.1.2",
|
"sprintf-js": "1.1.2",
|
||||||
"sqlite3": "5.1.2",
|
"sqlite3": "5.1.2",
|
||||||
"string-padding": "1.0.2",
|
"string-padding": "1.0.2",
|
||||||
"strip-ansi": "7.0.1",
|
"strip-ansi": "6.0.0",
|
||||||
"tcp-port-used": "1.0.2",
|
"tcp-port-used": "1.0.2",
|
||||||
"terminal-kit": "1.49.4",
|
"terminal-kit": "1.49.4",
|
||||||
"tkwidgets": "0.5.27",
|
"tkwidgets": "0.5.27",
|
||||||
|
21
yarn.lock
21
yarn.lock
@ -20848,7 +20848,7 @@ __metadata:
|
|||||||
sprintf-js: 1.1.2
|
sprintf-js: 1.1.2
|
||||||
sqlite3: 5.1.2
|
sqlite3: 5.1.2
|
||||||
string-padding: 1.0.2
|
string-padding: 1.0.2
|
||||||
strip-ansi: 7.0.1
|
strip-ansi: 6.0.0
|
||||||
tcp-port-used: 1.0.2
|
tcp-port-used: 1.0.2
|
||||||
temp: 0.9.4
|
temp: 0.9.4
|
||||||
terminal-kit: 1.49.4
|
terminal-kit: 1.49.4
|
||||||
@ -30549,12 +30549,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"strip-ansi@npm:7.0.1, strip-ansi@npm:^7.0.1":
|
"strip-ansi@npm:6.0.0":
|
||||||
version: 7.0.1
|
version: 6.0.0
|
||||||
resolution: "strip-ansi@npm:7.0.1"
|
resolution: "strip-ansi@npm:6.0.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
ansi-regex: ^6.0.1
|
ansi-regex: ^5.0.0
|
||||||
checksum: 257f78fa433520e7f9897722731d78599cb3fce29ff26a20a5e12ba4957463b50a01136f37c43707f4951817a75e90820174853d6ccc240997adc5df8f966039
|
checksum: 04c3239ede44c4d195b0e66c0ad58b932f08bec7d05290416d361ff908ad282ecdaf5d9731e322c84f151d427436bde01f05b7422c3ec26dd927586736b0e5d0
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -30594,6 +30594,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"strip-ansi@npm:^7.0.1":
|
||||||
|
version: 7.0.1
|
||||||
|
resolution: "strip-ansi@npm:7.0.1"
|
||||||
|
dependencies:
|
||||||
|
ansi-regex: ^6.0.1
|
||||||
|
checksum: 257f78fa433520e7f9897722731d78599cb3fce29ff26a20a5e12ba4957463b50a01136f37c43707f4951817a75e90820174853d6ccc240997adc5df8f966039
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"strip-bom-buf@npm:^1.0.0":
|
"strip-bom-buf@npm:^1.0.0":
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
resolution: "strip-bom-buf@npm:1.0.0"
|
resolution: "strip-bom-buf@npm:1.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user