@difizen/libro-terminal 0.1.9 → 0.1.11
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/es/command.d.ts +18 -0
- package/es/command.d.ts.map +1 -0
- package/es/command.js +117 -0
- package/es/configuration.d.ts +28 -26
- package/es/configuration.d.ts.map +1 -1
- package/es/configuration.js +30 -14
- package/es/connection.js +4 -4
- package/es/index.d.ts +1 -0
- package/es/index.d.ts.map +1 -1
- package/es/index.js +1 -0
- package/es/manager.d.ts +1 -0
- package/es/manager.d.ts.map +1 -1
- package/es/manager.js +16 -7
- package/es/module.d.ts.map +1 -1
- package/es/module.js +2 -1
- package/es/restapi.js +2 -2
- package/es/stateful-view.js +2 -2
- package/es/theme-service.js +2 -2
- package/es/view.d.ts +3 -3
- package/es/view.d.ts.map +1 -1
- package/es/view.js +32 -20
- package/package.json +11 -9
- package/src/command.ts +60 -0
- package/src/configuration.ts +58 -39
- package/src/index.ts +1 -0
- package/src/manager.ts +4 -0
- package/src/module.ts +2 -0
- package/src/view.tsx +39 -24
package/es/command.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Command, CommandRegistry, KeybindingRegistry } from '@difizen/mana-app';
|
|
2
|
+
import { ConfigurationService, KeybindingContribution } from '@difizen/mana-app';
|
|
3
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
4
|
+
import { ViewManager } from '@difizen/mana-app';
|
|
5
|
+
import { CommandContribution } from '@difizen/mana-app';
|
|
6
|
+
import { TerminalManager } from './manager.js';
|
|
7
|
+
export declare const TerminalCommands: Record<string, Command & {
|
|
8
|
+
keybind?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare class TerminalCommandContribution implements CommandContribution, KeybindingContribution {
|
|
11
|
+
viewManager: ViewManager;
|
|
12
|
+
protected slotManager: SlotViewManager;
|
|
13
|
+
protected config: ConfigurationService;
|
|
14
|
+
manager: TerminalManager;
|
|
15
|
+
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
16
|
+
registerCommands(commands: CommandRegistry): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAU,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAM3E,CAAC;AAEF,qBACa,2BACX,YAAW,mBAAmB,EAAE,sBAAsB;IAEjC,WAAW,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,WAAW,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAC5C,OAAO,EAAE,eAAe,CAAC;IAClD,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI;IAS1D,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;CAuBlD"}
|
package/es/command.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
13
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
14
|
+
import { ConfigurationService, KeybindingContribution } from '@difizen/mana-app';
|
|
15
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
16
|
+
import { inject, ViewManager } from '@difizen/mana-app';
|
|
17
|
+
import { singleton } from '@difizen/mana-app';
|
|
18
|
+
import { CommandContribution } from '@difizen/mana-app';
|
|
19
|
+
import { terminalDefaultSlot } from "./configuration.js";
|
|
20
|
+
import { TerminalManager } from "./manager.js";
|
|
21
|
+
import { LibroTerminalView } from "./view.js";
|
|
22
|
+
export var TerminalCommands = {
|
|
23
|
+
OpenTerminal: {
|
|
24
|
+
id: 'libro-terminal-open',
|
|
25
|
+
label: '新建终端',
|
|
26
|
+
keybind: 'ctrl+`'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export var TerminalCommandContribution = (_dec = singleton({
|
|
30
|
+
contrib: [CommandContribution, KeybindingContribution]
|
|
31
|
+
}), _dec2 = inject(ViewManager), _dec3 = inject(SlotViewManager), _dec4 = inject(ConfigurationService), _dec5 = inject(TerminalManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
32
|
+
function TerminalCommandContribution() {
|
|
33
|
+
_classCallCheck(this, TerminalCommandContribution);
|
|
34
|
+
_initializerDefineProperty(this, "viewManager", _descriptor, this);
|
|
35
|
+
_initializerDefineProperty(this, "slotManager", _descriptor2, this);
|
|
36
|
+
_initializerDefineProperty(this, "config", _descriptor3, this);
|
|
37
|
+
_initializerDefineProperty(this, "manager", _descriptor4, this);
|
|
38
|
+
}
|
|
39
|
+
_createClass(TerminalCommandContribution, [{
|
|
40
|
+
key: "registerKeybindings",
|
|
41
|
+
value: function registerKeybindings(keybindings) {
|
|
42
|
+
if (TerminalCommands['OpenTerminal'].keybind) {
|
|
43
|
+
keybindings.registerKeybinding({
|
|
44
|
+
keybinding: TerminalCommands['OpenTerminal'].keybind,
|
|
45
|
+
command: TerminalCommands['OpenTerminal'].id
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
key: "registerCommands",
|
|
51
|
+
value: function registerCommands(commands) {
|
|
52
|
+
var _this = this;
|
|
53
|
+
commands.registerCommand(TerminalCommands['OpenTerminal'], {
|
|
54
|
+
execute: function () {
|
|
55
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
56
|
+
var terminalView, slot;
|
|
57
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
58
|
+
while (1) switch (_context.prev = _context.next) {
|
|
59
|
+
case 0:
|
|
60
|
+
_context.prev = 0;
|
|
61
|
+
_context.next = 3;
|
|
62
|
+
return _this.viewManager.getOrCreateView(LibroTerminalView, {
|
|
63
|
+
id: _this.manager.newTerminalName()
|
|
64
|
+
});
|
|
65
|
+
case 3:
|
|
66
|
+
terminalView = _context.sent;
|
|
67
|
+
_context.next = 6;
|
|
68
|
+
return _this.config.get(terminalDefaultSlot);
|
|
69
|
+
case 6:
|
|
70
|
+
slot = _context.sent;
|
|
71
|
+
if (slot) {
|
|
72
|
+
_this.slotManager.addView(terminalView, slot, {
|
|
73
|
+
reveal: true
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
_context.next = 13;
|
|
77
|
+
break;
|
|
78
|
+
case 10:
|
|
79
|
+
_context.prev = 10;
|
|
80
|
+
_context.t0 = _context["catch"](0);
|
|
81
|
+
console.error(_context.t0);
|
|
82
|
+
case 13:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context.stop();
|
|
85
|
+
}
|
|
86
|
+
}, _callee, null, [[0, 10]]);
|
|
87
|
+
}));
|
|
88
|
+
function execute() {
|
|
89
|
+
return _execute.apply(this, arguments);
|
|
90
|
+
}
|
|
91
|
+
return execute;
|
|
92
|
+
}()
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}]);
|
|
96
|
+
return TerminalCommandContribution;
|
|
97
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec2], {
|
|
98
|
+
configurable: true,
|
|
99
|
+
enumerable: true,
|
|
100
|
+
writable: true,
|
|
101
|
+
initializer: null
|
|
102
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "slotManager", [_dec3], {
|
|
103
|
+
configurable: true,
|
|
104
|
+
enumerable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
initializer: null
|
|
107
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "config", [_dec4], {
|
|
108
|
+
configurable: true,
|
|
109
|
+
enumerable: true,
|
|
110
|
+
writable: true,
|
|
111
|
+
initializer: null
|
|
112
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "manager", [_dec5], {
|
|
113
|
+
configurable: true,
|
|
114
|
+
enumerable: true,
|
|
115
|
+
writable: true,
|
|
116
|
+
initializer: null
|
|
117
|
+
})), _class2)) || _class);
|
package/es/configuration.d.ts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import type { ConfigurationNode } from '@difizen/mana-app';
|
|
2
|
+
import { ConfigurationContribution } from '@difizen/mana-app';
|
|
2
3
|
export type TerminalRendererType = 'canvas' | 'dom';
|
|
3
4
|
export declare const DEFAULT_TERMINAL_RENDERER_TYPE = "canvas";
|
|
4
5
|
export declare function isTerminalRendererType(arg: any): arg is TerminalRendererType;
|
|
5
6
|
export type CursorStyle = 'block' | 'underline' | 'bar';
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
29
|
-
export declare
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
export declare const terminalDefaultSlot: ConfigurationNode<string | undefined>;
|
|
8
|
+
export declare const terminalEnableCopy: ConfigurationNode<boolean>;
|
|
9
|
+
export declare const terminalEnablePaste: ConfigurationNode<boolean>;
|
|
10
|
+
export declare const terminalIntegratedFontFamily: ConfigurationNode<string>;
|
|
11
|
+
export declare const terminalIntegratedFontSize: ConfigurationNode<number>;
|
|
12
|
+
export declare const terminalIntegratedFontWeight: ConfigurationNode<string>;
|
|
13
|
+
export declare const terminalIntegratedFontWeightBold: ConfigurationNode<string>;
|
|
14
|
+
export declare const terminalIntegratedDrawBoldTextInBrightColors: ConfigurationNode<boolean>;
|
|
15
|
+
export declare const terminalIntegratedLetterSpacing: ConfigurationNode<number>;
|
|
16
|
+
export declare const terminalIntegratedLineHeight: ConfigurationNode<number>;
|
|
17
|
+
export declare const terminalIntegratedScrollback: ConfigurationNode<number>;
|
|
18
|
+
export declare const terminalIntegratedFastScrollSensitivity: ConfigurationNode<number>;
|
|
19
|
+
export declare const terminalIntegratedRendererType: ConfigurationNode<string>;
|
|
20
|
+
export declare const terminalIntegratedCopyOnSelection: ConfigurationNode<boolean>;
|
|
21
|
+
export declare const terminalIntegratedCursorBlinking: ConfigurationNode<boolean>;
|
|
22
|
+
export declare const terminalIntegratedCursorStyle: ConfigurationNode<string>;
|
|
23
|
+
export declare const terminalIntegratedCursorWidth: ConfigurationNode<number>;
|
|
24
|
+
export declare const terminalIntegratedShellWindows: ConfigurationNode<string | undefined>;
|
|
25
|
+
export declare const terminalIntegratedShellOsx: ConfigurationNode<string | undefined>;
|
|
26
|
+
export declare const terminalIntegratedShellLinux: ConfigurationNode<string | undefined>;
|
|
27
|
+
export declare const terminalIntegratedShellArgsWindows: ConfigurationNode<string[]>;
|
|
28
|
+
export declare const terminalIntegratedShellArgsOsx: ConfigurationNode<string[]>;
|
|
29
|
+
export declare const terminalIntegratedShellArgsLinux: ConfigurationNode<string[]>;
|
|
30
|
+
export declare const terminalIntegratedConfirmOnExit: ConfigurationNode<string>;
|
|
31
|
+
export declare class TerminalConfiguration implements ConfigurationContribution {
|
|
32
|
+
configs: (ConfigurationNode<string | undefined> | ConfigurationNode<boolean> | ConfigurationNode<number> | ConfigurationNode<string[]>)[];
|
|
33
|
+
registerConfigurations(): (ConfigurationNode<string | undefined> | ConfigurationNode<boolean> | ConfigurationNode<number> | ConfigurationNode<string[]>)[];
|
|
32
34
|
}
|
|
33
35
|
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAIL,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAC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C;AACF,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAAC,MAAM,CASnE,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,CAShF,CAAC;AACF,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,CAQ5E,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,CAQ9E,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAS1E,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAStE,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CASxE,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,iBAAiB,CAAC,MAAM,CAcrE,CAAC;AAEF,qBACa,qBAAsB,YAAW,yBAAyB;IACrE,OAAO,mIAyBL;IAEF,sBAAsB;CAGvB"}
|
package/es/configuration.js
CHANGED
|
@@ -3,14 +3,22 @@ var _dec, _class;
|
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
function _toPropertyKey(
|
|
7
|
-
function _toPrimitive(
|
|
8
|
-
import { isOSX, isWindows, singleton } from '@difizen/mana-app';
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
import { isOSX, isWindows, singleton, ConfigurationContribution } from '@difizen/mana-app';
|
|
9
9
|
export var DEFAULT_TERMINAL_RENDERER_TYPE = 'canvas';
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
11
|
export function isTerminalRendererType(arg) {
|
|
12
12
|
return typeof arg === 'string' && (arg === 'canvas' || arg === 'dom');
|
|
13
13
|
}
|
|
14
|
+
export var terminalDefaultSlot = {
|
|
15
|
+
id: 'terminal.default.slot',
|
|
16
|
+
schema: {
|
|
17
|
+
type: 'string'
|
|
18
|
+
},
|
|
19
|
+
description: 'The location where the terminal is opened by default.',
|
|
20
|
+
defaultValue: undefined
|
|
21
|
+
};
|
|
14
22
|
export var terminalEnableCopy = {
|
|
15
23
|
id: 'terminal.enableCopy',
|
|
16
24
|
schema: {
|
|
@@ -173,7 +181,10 @@ export var terminalIntegratedShellLinux = {
|
|
|
173
181
|
export var terminalIntegratedShellArgsWindows = {
|
|
174
182
|
id: 'terminal.integrated.shellArgs.windows',
|
|
175
183
|
schema: {
|
|
176
|
-
type: '
|
|
184
|
+
type: 'array',
|
|
185
|
+
items: {
|
|
186
|
+
type: 'string'
|
|
187
|
+
}
|
|
177
188
|
},
|
|
178
189
|
description: 'The command line arguments to use when on the Windows terminal.',
|
|
179
190
|
defaultValue: []
|
|
@@ -181,7 +192,10 @@ export var terminalIntegratedShellArgsWindows = {
|
|
|
181
192
|
export var terminalIntegratedShellArgsOsx = {
|
|
182
193
|
id: 'terminal.integrated.shellArgs.osx',
|
|
183
194
|
schema: {
|
|
184
|
-
type: '
|
|
195
|
+
type: 'array',
|
|
196
|
+
items: {
|
|
197
|
+
type: 'string'
|
|
198
|
+
}
|
|
185
199
|
},
|
|
186
200
|
description: 'The command line arguments to use when on the macOS terminal.',
|
|
187
201
|
defaultValue: ['-l']
|
|
@@ -189,7 +203,10 @@ export var terminalIntegratedShellArgsOsx = {
|
|
|
189
203
|
export var terminalIntegratedShellArgsLinux = {
|
|
190
204
|
id: 'terminal.integrated.shellArgs.linux',
|
|
191
205
|
schema: {
|
|
192
|
-
type: '
|
|
206
|
+
type: 'array',
|
|
207
|
+
items: {
|
|
208
|
+
type: 'string'
|
|
209
|
+
}
|
|
193
210
|
},
|
|
194
211
|
description: 'The command line arguments to use when on the Linux terminal.',
|
|
195
212
|
defaultValue: []
|
|
@@ -208,18 +225,17 @@ export var terminalIntegratedConfirmOnExit = {
|
|
|
208
225
|
// ],
|
|
209
226
|
defaultValue: 'never'
|
|
210
227
|
};
|
|
211
|
-
export var TerminalConfiguration = (_dec = singleton(
|
|
228
|
+
export var TerminalConfiguration = (_dec = singleton({
|
|
229
|
+
contrib: ConfigurationContribution
|
|
230
|
+
}), _dec(_class = /*#__PURE__*/function () {
|
|
212
231
|
function TerminalConfiguration() {
|
|
213
232
|
_classCallCheck(this, TerminalConfiguration);
|
|
214
|
-
this.configs = [terminalEnableCopy, terminalEnablePaste, terminalIntegratedFontFamily, terminalIntegratedFontSize, terminalIntegratedFontWeight, terminalIntegratedFontWeightBold, terminalIntegratedDrawBoldTextInBrightColors, terminalIntegratedLetterSpacing, terminalIntegratedLineHeight, terminalIntegratedScrollback, terminalIntegratedFastScrollSensitivity, terminalIntegratedRendererType, terminalIntegratedCopyOnSelection, terminalIntegratedCursorBlinking, terminalIntegratedCursorStyle, terminalIntegratedCursorWidth, terminalIntegratedShellWindows, terminalIntegratedShellOsx, terminalIntegratedShellLinux, terminalIntegratedShellArgsWindows, terminalIntegratedShellArgsOsx, terminalIntegratedShellArgsLinux, terminalIntegratedConfirmOnExit];
|
|
233
|
+
this.configs = [terminalEnableCopy, terminalEnablePaste, terminalIntegratedFontFamily, terminalIntegratedFontSize, terminalIntegratedFontWeight, terminalIntegratedFontWeightBold, terminalIntegratedDrawBoldTextInBrightColors, terminalIntegratedLetterSpacing, terminalIntegratedLineHeight, terminalIntegratedScrollback, terminalIntegratedFastScrollSensitivity, terminalIntegratedRendererType, terminalIntegratedCopyOnSelection, terminalIntegratedCursorBlinking, terminalIntegratedCursorStyle, terminalIntegratedCursorWidth, terminalIntegratedShellWindows, terminalIntegratedShellOsx, terminalIntegratedShellLinux, terminalIntegratedShellArgsWindows, terminalIntegratedShellArgsOsx, terminalIntegratedShellArgsLinux, terminalIntegratedConfirmOnExit, terminalDefaultSlot];
|
|
215
234
|
}
|
|
216
235
|
_createClass(TerminalConfiguration, [{
|
|
217
|
-
key: "
|
|
218
|
-
value: function
|
|
219
|
-
|
|
220
|
-
return (_this$configs$find = this.configs.find(function (item) {
|
|
221
|
-
return item.id === key;
|
|
222
|
-
})) === null || _this$configs$find === void 0 ? void 0 : _this$configs$find.defaultValue;
|
|
236
|
+
key: "registerConfigurations",
|
|
237
|
+
value: function registerConfigurations() {
|
|
238
|
+
return this.configs;
|
|
223
239
|
}
|
|
224
240
|
}]);
|
|
225
241
|
return TerminalConfiguration;
|
package/es/connection.js
CHANGED
|
@@ -13,8 +13,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
|
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
-
function _toPropertyKey(
|
|
17
|
-
function _toPrimitive(
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
19
19
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
20
20
|
import { URL } from '@difizen/libro-common';
|
|
@@ -312,7 +312,7 @@ export var TerminalConnection = (_dec = transient(), _dec2 = inject(TerminalRest
|
|
|
312
312
|
*/
|
|
313
313
|
}, {
|
|
314
314
|
key: "shutdown",
|
|
315
|
-
value: function () {
|
|
315
|
+
value: (function () {
|
|
316
316
|
var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
317
317
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
318
318
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -331,7 +331,7 @@ export var TerminalConnection = (_dec = transient(), _dec2 = inject(TerminalRest
|
|
|
331
331
|
return _shutdown.apply(this, arguments);
|
|
332
332
|
}
|
|
333
333
|
return shutdown;
|
|
334
|
-
}()
|
|
334
|
+
}())
|
|
335
335
|
}, {
|
|
336
336
|
key: "_updateConnectionStatus",
|
|
337
337
|
value:
|
package/es/index.d.ts
CHANGED
package/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
package/es/index.js
CHANGED
package/es/manager.d.ts
CHANGED
|
@@ -101,5 +101,6 @@ export declare class TerminalManager implements Disposable, Disposed {
|
|
|
101
101
|
*/
|
|
102
102
|
protected _onDisposed(terminalConnection: TerminalConnection): void;
|
|
103
103
|
getOrCreate: (options: TerminalOption) => Promise<TerminalConnection>;
|
|
104
|
+
newTerminalName: () => string;
|
|
104
105
|
}
|
|
105
106
|
//# sourceMappingURL=manager.d.ts.map
|
package/es/manager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceR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property, descriptor, context) { if
|
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
16
16
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
17
17
|
// Copyright (c) Jupyter Development Team.
|
|
@@ -21,6 +21,7 @@ import { Poll } from '@difizen/libro-common';
|
|
|
21
21
|
import { NetworkError, ServerConnection } from '@difizen/libro-kernel';
|
|
22
22
|
import { singleton } from '@difizen/mana-app';
|
|
23
23
|
import { Emitter, inject } from '@difizen/mana-app';
|
|
24
|
+
import { v4 } from 'uuid';
|
|
24
25
|
import { TerminalConnectionFactory } from "./protocol.js";
|
|
25
26
|
import { TerminalRestAPI } from "./restapi.js";
|
|
26
27
|
export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI), _dec3 = inject(TerminalConnectionFactory), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
@@ -98,6 +99,9 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
98
99
|
return _ref.apply(this, arguments);
|
|
99
100
|
};
|
|
100
101
|
}();
|
|
102
|
+
this.newTerminalName = function () {
|
|
103
|
+
return v4();
|
|
104
|
+
};
|
|
101
105
|
this.serverConnection = serverConnection;
|
|
102
106
|
//
|
|
103
107
|
// Start polling with exponential backoff.
|
|
@@ -254,7 +258,7 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
254
258
|
*/
|
|
255
259
|
}, {
|
|
256
260
|
key: "refreshRunning",
|
|
257
|
-
value: function () {
|
|
261
|
+
value: (function () {
|
|
258
262
|
var _refreshRunning = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
259
263
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
260
264
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -286,9 +290,10 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
286
290
|
* The manager `serverSettings` will be used unless overridden in the
|
|
287
291
|
* options.
|
|
288
292
|
*/
|
|
293
|
+
)
|
|
289
294
|
}, {
|
|
290
295
|
key: "startNew",
|
|
291
|
-
value: function () {
|
|
296
|
+
value: (function () {
|
|
292
297
|
var _startNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(options) {
|
|
293
298
|
var model;
|
|
294
299
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -318,9 +323,10 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
318
323
|
/**
|
|
319
324
|
* Shut down a terminal session by name.
|
|
320
325
|
*/
|
|
326
|
+
)
|
|
321
327
|
}, {
|
|
322
328
|
key: "shutdown",
|
|
323
|
-
value: function () {
|
|
329
|
+
value: (function () {
|
|
324
330
|
var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(name) {
|
|
325
331
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
326
332
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -346,9 +352,10 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
346
352
|
*
|
|
347
353
|
* @returns A promise that resolves when all of the sessions are shut down.
|
|
348
354
|
*/
|
|
355
|
+
)
|
|
349
356
|
}, {
|
|
350
357
|
key: "shutdownAll",
|
|
351
|
-
value: function () {
|
|
358
|
+
value: (function () {
|
|
352
359
|
var _shutdownAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
353
360
|
var _this2 = this;
|
|
354
361
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
@@ -378,9 +385,10 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
378
385
|
/**
|
|
379
386
|
* Execute a request to the server to poll running terminals and update state.
|
|
380
387
|
*/
|
|
388
|
+
)
|
|
381
389
|
}, {
|
|
382
390
|
key: "requestRunning",
|
|
383
|
-
value: function () {
|
|
391
|
+
value: (function () {
|
|
384
392
|
var _requestRunning = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
385
393
|
var models, _response, _response2, names;
|
|
386
394
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
@@ -441,6 +449,7 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
441
449
|
/**
|
|
442
450
|
* Handle a session starting.
|
|
443
451
|
*/
|
|
452
|
+
)
|
|
444
453
|
}, {
|
|
445
454
|
key: "_onStarted",
|
|
446
455
|
value: function _onStarted(terminalConnection) {
|
package/es/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,OAAO,cAAc,CAAC;AAWtB,eAAO,MAAM,cAAc,YA2B1B,CAAC"}
|
package/es/module.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KernelSpecRestAPI, ServerConnection, ServerManager } from '@difizen/libro-kernel';
|
|
2
2
|
import { ManaModule } from '@difizen/mana-app';
|
|
3
|
+
import { TerminalCommandContribution } from "./command.js";
|
|
3
4
|
import { TerminalConfiguration } from "./configuration.js";
|
|
4
5
|
import { TerminalConnection } from "./connection.js";
|
|
5
6
|
import "./index.less";
|
|
@@ -8,7 +9,7 @@ import { TerminalConnectionFactory, TerminalOption, TerminalViewOption } from ".
|
|
|
8
9
|
import { TerminalRestAPI } from "./restapi.js";
|
|
9
10
|
import { TerminalThemeService } from "./theme-service.js";
|
|
10
11
|
import { LibroTerminalView } from "./view.js";
|
|
11
|
-
export var TerminalModule = ManaModule.create().register(TerminalConfiguration, TerminalConnection, TerminalManager, TerminalRestAPI, LibroTerminalView, ServerConnection, ServerManager, KernelSpecRestAPI, {
|
|
12
|
+
export var TerminalModule = ManaModule.create().register(TerminalCommandContribution, TerminalConfiguration, TerminalConnection, TerminalManager, TerminalRestAPI, LibroTerminalView, ServerConnection, ServerManager, KernelSpecRestAPI, {
|
|
12
13
|
token: TerminalConnectionFactory,
|
|
13
14
|
useFactory: function useFactory(ctx) {
|
|
14
15
|
return function (options) {
|
package/es/restapi.js
CHANGED
|
@@ -10,8 +10,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
|
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
16
16
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
17
17
|
import { URL } from '@difizen/libro-common';
|
package/es/stateful-view.js
CHANGED
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _toPropertyKey(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
8
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
package/es/theme-service.js
CHANGED
|
@@ -4,8 +4,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
|
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
5
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
6
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _toPropertyKey(
|
|
8
|
-
function _toPrimitive(
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
9
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
10
10
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
11
11
|
import { ColorRegistry, ThemeService } from '@difizen/mana-app';
|
package/es/view.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { ConfigurationService } from '@difizen/mana-app';
|
|
2
3
|
import { Disposable, DisposableCollection, Emitter } from '@difizen/mana-app';
|
|
3
4
|
import type { ITerminalOptions } from 'xterm';
|
|
4
5
|
import { Terminal } from 'xterm';
|
|
5
6
|
import { FitAddon } from 'xterm-addon-fit';
|
|
6
7
|
import type { CursorStyle, TerminalRendererType } from './configuration.js';
|
|
7
|
-
import { TerminalConfiguration } from './configuration.js';
|
|
8
8
|
import type { TerminalConnection } from './connection.js';
|
|
9
9
|
import { TerminalManager } from './manager.js';
|
|
10
10
|
import type { TerminalMessage, TerminalViewOption } from './protocol.js';
|
|
@@ -19,7 +19,7 @@ export declare class LibroTerminalView extends BaseStatefulView {
|
|
|
19
19
|
protected termOpened: boolean;
|
|
20
20
|
protected initialData: string;
|
|
21
21
|
protected fitAddon: FitAddon;
|
|
22
|
-
protected readonly config:
|
|
22
|
+
protected readonly config: ConfigurationService;
|
|
23
23
|
protected readonly themeService: TerminalThemeService;
|
|
24
24
|
protected readonly terminalManager: TerminalManager;
|
|
25
25
|
protected readonly toDisposeOnConnect: DisposableCollection;
|
|
@@ -42,7 +42,7 @@ export declare class LibroTerminalView extends BaseStatefulView {
|
|
|
42
42
|
protected _isReady: boolean;
|
|
43
43
|
protected onReadyEmitter: Emitter<boolean>;
|
|
44
44
|
constructor(options: TerminalViewOption, // 这里是 server需要的配置
|
|
45
|
-
config:
|
|
45
|
+
config: ConfigurationService, themeService: TerminalThemeService, terminalManager: TerminalManager);
|
|
46
46
|
afterRestore(): void;
|
|
47
47
|
initConnection(): Promise<TerminalConnection>;
|
|
48
48
|
storeState(): object;
|