1
0
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:
Laurent Cozic 2022-11-13 12:30:47 +00:00
parent 71efa09737
commit a3c88b6ec7
6 changed files with 28 additions and 15 deletions

View File

@ -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.js
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.js
packages/app-cli/app/services/plugins/PluginRunner.js.map

3
.gitignore vendored
View File

@ -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.js
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.js
packages/app-cli/app/services/plugins/PluginRunner.js.map

View File

@ -33,7 +33,7 @@ const ResourceServer = require('./ResourceServer.js');
const NoteMetadataWidget = require('./gui/NoteMetadataWidget.js');
const FolderListWidget = require('./gui/FolderListWidget.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 LinkSelector = require('./LinkSelector.js').default;

View File

@ -1,10 +1,10 @@
const BaseWidget = require('tkwidgets/BaseWidget.js');
const chalk = require('chalk');
const termutils = require('tkwidgets/framework/termutils.js');
const stripAnsi = require('strip-ansi');
import stripAnsi from 'strip-ansi';
const { handleAutocompletion } = require('../autocompletion.js');
class StatusBarWidget extends BaseWidget {
export default class StatusBarWidget extends BaseWidget {
constructor() {
super();
@ -27,7 +27,7 @@ class StatusBarWidget extends BaseWidget {
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 (promptString === null) promptString = ':';
if (options === null) options = {};
@ -36,7 +36,7 @@ class StatusBarWidget extends BaseWidget {
this.promptState_ = {
promise: null,
initialText: stripAnsi(initialText),
initialText: (initialText),
promptString: stripAnsi(promptString),
};
@ -106,7 +106,7 @@ class StatusBarWidget extends BaseWidget {
const isSecurePrompt = !!this.promptState_.secure;
const options = {
const options: any = {
cancelable: true,
history: this.history,
default: this.promptState_.initialText,
@ -161,5 +161,3 @@ class StatusBarWidget extends BaseWidget {
if (doSaveCursor) this.term.restoreCursor();
}
}
module.exports = StatusBarWidget;

View File

@ -59,7 +59,7 @@
"sprintf-js": "1.1.2",
"sqlite3": "5.1.2",
"string-padding": "1.0.2",
"strip-ansi": "7.0.1",
"strip-ansi": "6.0.0",
"tcp-port-used": "1.0.2",
"terminal-kit": "1.49.4",
"tkwidgets": "0.5.27",

View File

@ -20848,7 +20848,7 @@ __metadata:
sprintf-js: 1.1.2
sqlite3: 5.1.2
string-padding: 1.0.2
strip-ansi: 7.0.1
strip-ansi: 6.0.0
tcp-port-used: 1.0.2
temp: 0.9.4
terminal-kit: 1.49.4
@ -30549,12 +30549,12 @@ __metadata:
languageName: node
linkType: hard
"strip-ansi@npm:7.0.1, strip-ansi@npm:^7.0.1":
version: 7.0.1
resolution: "strip-ansi@npm:7.0.1"
"strip-ansi@npm:6.0.0":
version: 6.0.0
resolution: "strip-ansi@npm:6.0.0"
dependencies:
ansi-regex: ^6.0.1
checksum: 257f78fa433520e7f9897722731d78599cb3fce29ff26a20a5e12ba4957463b50a01136f37c43707f4951817a75e90820174853d6ccc240997adc5df8f966039
ansi-regex: ^5.0.0
checksum: 04c3239ede44c4d195b0e66c0ad58b932f08bec7d05290416d361ff908ad282ecdaf5d9731e322c84f151d427436bde01f05b7422c3ec26dd927586736b0e5d0
languageName: node
linkType: hard
@ -30594,6 +30594,15 @@ __metadata:
languageName: node
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":
version: 1.0.0
resolution: "strip-bom-buf@npm:1.0.0"