@nsshunt/stsui 1.6.0 → 1.6.3
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/.github/workflows/npm-publish.yml +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/jest/setEnvVars.js +4 -0
- package/dist/jest/setEnvVars.js.map +1 -0
- package/dist/jest.config.js +143 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/menubar.js +58 -0
- package/dist/menubar.js.map +1 -0
- package/dist/stsuiframe.js +493 -0
- package/dist/stsuiframe.js.map +1 -0
- package/dist/stsuiframe.test.js +16 -0
- package/dist/stsuiframe.test.js.map +1 -0
- package/menubar.ts +1 -0
- package/package.json +2 -2
- package/stsuiframe.ts +6 -6
- package/types/menubar.d.ts.map +1 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./stsuiframe"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Normally, this would be set for all test cases however, this module we actually test the
|
|
2
|
+
// environment vars themselves. See each test code for details.
|
|
3
|
+
//process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
4
|
+
//# sourceMappingURL=setEnvVars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setEnvVars.js","sourceRoot":"","sources":["../../jest/setEnvVars.js"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,+DAA+D;AAE/D,0EAA0E"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* For a detailed explanation regarding each configuration property, visit:
|
|
3
|
+
* https://jestjs.io/docs/configuration
|
|
4
|
+
*/
|
|
5
|
+
module.exports = {
|
|
6
|
+
setupFiles: ['./jest/setEnvVars.js'],
|
|
7
|
+
// All imported modules in your tests should be mocked automatically
|
|
8
|
+
// automock: false,
|
|
9
|
+
// Stop running tests after `n` failures
|
|
10
|
+
// bail: 0,
|
|
11
|
+
// The directory where Jest should store its cached dependency information
|
|
12
|
+
// cacheDirectory: "/tmp/jest_rs",
|
|
13
|
+
// Automatically clear mock calls, instances and results before every test
|
|
14
|
+
// clearMocks: false,
|
|
15
|
+
// Indicates whether the coverage information should be collected while executing the test
|
|
16
|
+
// collectCoverage: false,
|
|
17
|
+
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
|
18
|
+
// collectCoverageFrom: undefined,
|
|
19
|
+
// The directory where Jest should output its coverage files
|
|
20
|
+
// coverageDirectory: undefined,
|
|
21
|
+
// An array of regexp pattern strings used to skip coverage collection
|
|
22
|
+
// coveragePathIgnorePatterns: [
|
|
23
|
+
// "/node_modules/"
|
|
24
|
+
// ],
|
|
25
|
+
// Indicates which provider should be used to instrument code for coverage
|
|
26
|
+
// coverageProvider: "v8",
|
|
27
|
+
// A list of reporter names that Jest uses when writing coverage reports
|
|
28
|
+
// coverageReporters: [
|
|
29
|
+
// "json",
|
|
30
|
+
// "text",
|
|
31
|
+
// "lcov",
|
|
32
|
+
// "clover"
|
|
33
|
+
// ],
|
|
34
|
+
// An object that configures minimum threshold enforcement for coverage results
|
|
35
|
+
// coverageThreshold: undefined,
|
|
36
|
+
// A path to a custom dependency extractor
|
|
37
|
+
// dependencyExtractor: undefined,
|
|
38
|
+
// Make calling deprecated APIs throw helpful error messages
|
|
39
|
+
// errorOnDeprecated: false,
|
|
40
|
+
// Force coverage collection from ignored files using an array of glob patterns
|
|
41
|
+
// forceCoverageMatch: [],
|
|
42
|
+
// A path to a module which exports an async function that is triggered once before all test suites
|
|
43
|
+
// globalSetup: undefined,
|
|
44
|
+
// A path to a module which exports an async function that is triggered once after all test suites
|
|
45
|
+
// globalTeardown: undefined,
|
|
46
|
+
// A set of global variables that need to be available in all test environments
|
|
47
|
+
// globals: {},
|
|
48
|
+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
|
49
|
+
// maxWorkers: "50%",
|
|
50
|
+
// An array of directory names to be searched recursively up from the requiring module's location
|
|
51
|
+
// moduleDirectories: [
|
|
52
|
+
// "node_modules"
|
|
53
|
+
// ],
|
|
54
|
+
// An array of file extensions your modules use
|
|
55
|
+
// moduleFileExtensions: [
|
|
56
|
+
// "js",
|
|
57
|
+
// "jsx",
|
|
58
|
+
// "ts",
|
|
59
|
+
// "tsx",
|
|
60
|
+
// "json",
|
|
61
|
+
// "node"
|
|
62
|
+
// ],
|
|
63
|
+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
|
64
|
+
// moduleNameMapper: {},
|
|
65
|
+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
|
66
|
+
// modulePathIgnorePatterns: [],
|
|
67
|
+
// Activates notifications for test results
|
|
68
|
+
// notify: false,
|
|
69
|
+
// An enum that specifies notification mode. Requires { notify: true }
|
|
70
|
+
// notifyMode: "failure-change",
|
|
71
|
+
// A preset that is used as a base for Jest's configuration
|
|
72
|
+
// preset: undefined,
|
|
73
|
+
// Run tests from one or more projects
|
|
74
|
+
// projects: undefined,
|
|
75
|
+
// Use this configuration option to add custom reporters to Jest
|
|
76
|
+
// reporters: undefined,
|
|
77
|
+
// Automatically reset mock state before every test
|
|
78
|
+
// resetMocks: false,
|
|
79
|
+
// Reset the module registry before running each individual test
|
|
80
|
+
// resetModules: false,
|
|
81
|
+
// A path to a custom resolver
|
|
82
|
+
// resolver: undefined,
|
|
83
|
+
// Automatically restore mock state and implementation before every test
|
|
84
|
+
// restoreMocks: false,
|
|
85
|
+
// The root directory that Jest should scan for tests and modules within
|
|
86
|
+
// rootDir: undefined,
|
|
87
|
+
// A list of paths to directories that Jest should use to search for files in
|
|
88
|
+
// roots: [
|
|
89
|
+
// "<rootDir>"
|
|
90
|
+
// ],
|
|
91
|
+
// Allows you to use a custom runner instead of Jest's default test runner
|
|
92
|
+
// runner: "jest-runner",
|
|
93
|
+
// The paths to modules that run some code to configure or set up the testing environment before each test
|
|
94
|
+
// setupFiles: [],
|
|
95
|
+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
|
96
|
+
// setupFilesAfterEnv: [],
|
|
97
|
+
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
|
98
|
+
// slowTestThreshold: 5,
|
|
99
|
+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
|
100
|
+
// snapshotSerializers: [],
|
|
101
|
+
// The test environment that will be used for testing
|
|
102
|
+
// testEnvironment: "jest-environment-node",
|
|
103
|
+
// Options that will be passed to the testEnvironment
|
|
104
|
+
// testEnvironmentOptions: {},
|
|
105
|
+
// Adds a location field to test results
|
|
106
|
+
// testLocationInResults: false,
|
|
107
|
+
// The glob patterns Jest uses to detect test files
|
|
108
|
+
// testMatch: [
|
|
109
|
+
// "**/__tests__/**/*.[jt]s?(x)",
|
|
110
|
+
// "**/?(*.)+(spec|test).[tj]s?(x)"
|
|
111
|
+
// ],
|
|
112
|
+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
|
113
|
+
testPathIgnorePatterns: [
|
|
114
|
+
"/node_modules/",
|
|
115
|
+
"/dist/"
|
|
116
|
+
],
|
|
117
|
+
// The regexp pattern or array of patterns that Jest uses to detect test files
|
|
118
|
+
// testRegex: [],
|
|
119
|
+
// This option allows the use of a custom results processor
|
|
120
|
+
// testResultsProcessor: undefined,
|
|
121
|
+
// This option allows use of a custom test runner
|
|
122
|
+
// testRunner: "jest-circus/runner",
|
|
123
|
+
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
|
|
124
|
+
// testURL: "http://localhost",
|
|
125
|
+
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
|
|
126
|
+
// timers: "real",
|
|
127
|
+
// A map from regular expressions to paths to transformers
|
|
128
|
+
// transform: undefined,
|
|
129
|
+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
|
130
|
+
// transformIgnorePatterns: [
|
|
131
|
+
// "/node_modules/",
|
|
132
|
+
// "\\.pnp\\.[^\\/]+$"
|
|
133
|
+
// ],
|
|
134
|
+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
|
135
|
+
// unmockedModulePathPatterns: undefined,
|
|
136
|
+
// Indicates whether each individual test should be reported during the run
|
|
137
|
+
// verbose: undefined,
|
|
138
|
+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
|
139
|
+
// watchPathIgnorePatterns: [],
|
|
140
|
+
// Whether to use watchman for file crawling
|
|
141
|
+
// watchman: true,
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=jest.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.js"],"names":[],"m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sB;IAEtB,6EAA6E;IAC7E,WAAW;IACX,gBAAgB;IAChB,KAAK;IAEL,0EAA0E;IAC1E,yBAAyB;IAEzB,0GAA0G;IAC1G,kBAAkB;IAElB,8GAA8G;IAC9G,0BAA0B;IAE1B,sGAAsG;IACtG,wBAAwB;IAExB,sFAAsF;IACtF,2BAA2B;IAE3B,qDAAqD;IACrD,4CAA4C;IAE5C,qDAAqD;IACrD,8BAA8B;IAE9B,wCAAwC;IACxC,gCAAgC;IAEhC,mDAAmD;IACnD,eAAe;IACf,mCAAmC;IACnC,qCAAqC;IACrC,KAAK;IAEL,wGAAwG;IACvG,sBAAsB,EAAE;QACtB,gBAAgB;QAChB,QAAQ;KACT;IAEF,8EAA8E;IAC9E,iBAAiB;IAEjB,2DAA2D;IAC3D,mCAAmC;IAEnC,iDAAiD;IACjD,oCAAoC;IAEpC,0GAA0G;IAC1G,+BAA+B;IAE/B,gGAAgG;IAChG,kBAAkB;IAElB,0DAA0D;IAC1D,wBAAwB;IAExB,4HAA4H;IAC5H,6BAA6B;IAC7B,sBAAsB;IACtB,wBAAwB;IACxB,KAAK;IAEL,6IAA6I;IAC7I,yCAAyC;IAEzC,2EAA2E;IAC3E,sBAAsB;IAEtB,mHAAmH;IACnH,+BAA+B;IAE/B,4CAA4C;IAC5C,kBAAkB;CAClB,CAAC"}
|
package/dist/menubar.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MenuBar = void 0;
|
|
7
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
8
|
+
class MenuBar {
|
|
9
|
+
// options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }
|
|
10
|
+
constructor(screen, options) {
|
|
11
|
+
this.listb = null;
|
|
12
|
+
const compoptions = {
|
|
13
|
+
parent: screen,
|
|
14
|
+
left: 0,
|
|
15
|
+
right: 0,
|
|
16
|
+
height: 1,
|
|
17
|
+
width: 'shrink',
|
|
18
|
+
mouse: true,
|
|
19
|
+
keys: true,
|
|
20
|
+
autoCommandKeys: true,
|
|
21
|
+
scrollable: true,
|
|
22
|
+
style: {
|
|
23
|
+
fg: 'yellow',
|
|
24
|
+
bg: 'blue',
|
|
25
|
+
item: {
|
|
26
|
+
hover: {
|
|
27
|
+
fg: 'white',
|
|
28
|
+
bg: 'green',
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
selected: {
|
|
32
|
+
fg: 'black',
|
|
33
|
+
bg: 'yellow',
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
if (options.top === true) {
|
|
38
|
+
compoptions.top = 0;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
compoptions.bottom = 0;
|
|
42
|
+
}
|
|
43
|
+
compoptions.commands = {};
|
|
44
|
+
for (const [, value] of Object.entries(options.menuitems)) {
|
|
45
|
+
compoptions.commands[value.text] =
|
|
46
|
+
{
|
|
47
|
+
keys: [value.key],
|
|
48
|
+
callback: value.cb
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
this.listb = blessed_1.default.listbar(compoptions);
|
|
52
|
+
}
|
|
53
|
+
get listbar() {
|
|
54
|
+
return this.listb;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.MenuBar = MenuBar;
|
|
58
|
+
//# sourceMappingURL=menubar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar.js","sourceRoot":"","sources":["../menubar.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAc9B,MAAa,OAAO;IAInB,+HAA+H;IAC/H,YAAY,MAAyB,EAAE,OAAuB;QAHtD,UAAK,GAAsB,IAAI,CAAC;QAKpC,MAAM,WAAW,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k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
+
};
|
|
31
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
var _STSUIFrame_instances, _STSUIFrame_cursor, _STSUIFrame_cursorInfo, _STSUIFrame_renderPanelFn, _STSUIFrame_CalcBoxPos, _STSUIFrame_UpdateUIBoxPos, _STSUIFrame_ReSize, _STSUIFrame_UpdatePanelPosition, _STSUIFrame_SetupPanels, _STSUIFrame_UpdateUI;
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.STSUIFrame = void 0;
|
|
42
|
+
const events_1 = __importDefault(require("events"));
|
|
43
|
+
// https://github.com/yaronn/blessed-contrib
|
|
44
|
+
//var contrib = require('blessed-contrib');
|
|
45
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
46
|
+
require("colors");
|
|
47
|
+
//const { v4: uuidv4 } = require('uuid');
|
|
48
|
+
const uuid_1 = require("uuid");
|
|
49
|
+
const MenuBar = __importStar(require("./menubar"));
|
|
50
|
+
class STSUIFrame extends events_1.default {
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param {*} data The screen layout data. Schema: { title: <str>,
|
|
54
|
+
* grid: { rows: <int>, cols: <int> },
|
|
55
|
+
* panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> },
|
|
56
|
+
* template: <handlebars func>, widgets: { [ { <prop_name>: <blessed widget> } ] } } ] }
|
|
57
|
+
*/
|
|
58
|
+
constructor(data, renderPanelFn = null) {
|
|
59
|
+
super();
|
|
60
|
+
_STSUIFrame_instances.add(this);
|
|
61
|
+
this.uiBoxes = {}; // { box: <<blessed box>>, boxHeader: <<blessed box>> }
|
|
62
|
+
this.screen = null;
|
|
63
|
+
_STSUIFrame_cursor.set(this, 0); // panel index with the complete model data.
|
|
64
|
+
_STSUIFrame_cursorInfo.set(this, null);
|
|
65
|
+
_STSUIFrame_renderPanelFn.set(this, null);
|
|
66
|
+
this.screenHeaderText = '...';
|
|
67
|
+
this.minRows = 1;
|
|
68
|
+
this.minCols = 1;
|
|
69
|
+
this.minWidth = 40;
|
|
70
|
+
this.minHeight = 7;
|
|
71
|
+
this.sortInfo = null; // Current sort mode UI box control
|
|
72
|
+
this.screenHeader = null;
|
|
73
|
+
this.uidata = null;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param {number} position The index (0 based) for the panel item to be calculated
|
|
77
|
+
* @returns object with top, left, width and height correctly set
|
|
78
|
+
*/
|
|
79
|
+
_STSUIFrame_CalcBoxPos.set(this, (panel) => {
|
|
80
|
+
// Calculate the position and dimensions for this UI element
|
|
81
|
+
let screenHeight = this.screen.height;
|
|
82
|
+
if (this.uidata.menu !== null) {
|
|
83
|
+
screenHeight -= this.uidata.menu.length; // Allow for any menu items
|
|
84
|
+
}
|
|
85
|
+
const screenWidth = this.screen.width;
|
|
86
|
+
const rows = this.uidata.grid.rows;
|
|
87
|
+
const cols = this.uidata.grid.cols;
|
|
88
|
+
const pos = panel.pos;
|
|
89
|
+
const colWidth = Math.floor(screenWidth / cols);
|
|
90
|
+
const rowHeight = Math.floor(screenHeight / rows);
|
|
91
|
+
// Allow for a top offset if a top menu is present
|
|
92
|
+
let topoffset = 0;
|
|
93
|
+
if (this.uidata.menu !== null) {
|
|
94
|
+
for (const [, value] of Object.entries(this.uidata.menu)) {
|
|
95
|
+
if (value.top === true) {
|
|
96
|
+
topoffset = 1;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const boxPos = {
|
|
102
|
+
top: (pos.row * rowHeight) + topoffset,
|
|
103
|
+
left: pos.col * colWidth,
|
|
104
|
+
width: colWidth * pos.colSpan,
|
|
105
|
+
height: rowHeight * pos.rowSpan
|
|
106
|
+
};
|
|
107
|
+
// Now check if this panel is on the far right and if so adjust for a perfect fit
|
|
108
|
+
if ((pos.col + pos.colSpan) === cols) {
|
|
109
|
+
//if (pos.col === (cols - 1)) {
|
|
110
|
+
boxPos.width = screenWidth - (pos.col * colWidth);
|
|
111
|
+
}
|
|
112
|
+
// Now check if this panel is on the bottom and if so adjust for a perfect fit
|
|
113
|
+
if ((pos.row + pos.rowSpan) === rows) {
|
|
114
|
+
boxPos.height = screenHeight - (pos.row * rowHeight);
|
|
115
|
+
}
|
|
116
|
+
return boxPos;
|
|
117
|
+
});
|
|
118
|
+
_STSUIFrame_UpdateUIBoxPos.set(this, (panel, uiBox) => {
|
|
119
|
+
const pos = __classPrivateFieldGet(this, _STSUIFrame_CalcBoxPos, "f").call(this, panel);
|
|
120
|
+
uiBox.box.top = pos.top;
|
|
121
|
+
uiBox.box.left = pos.left;
|
|
122
|
+
uiBox.box.width = pos.width;
|
|
123
|
+
uiBox.box.height = pos.height;
|
|
124
|
+
uiBox.boxHeader.top = pos.top;
|
|
125
|
+
uiBox.boxHeader.left = pos.left + 2;
|
|
126
|
+
if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {
|
|
127
|
+
for (const [, value] of Object.entries(panel.widgets)) {
|
|
128
|
+
if (value.widget === 'log') {
|
|
129
|
+
const widget = uiBox.box.get(value.widget);
|
|
130
|
+
if (widget.position.top >= (uiBox.box.height - 4)) {
|
|
131
|
+
widget.position.top = uiBox.box.height - 4;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
widget.position.top = value.options.top;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* ReSize the grid layout
|
|
142
|
+
*/
|
|
143
|
+
_STSUIFrame_ReSize.set(this, () => {
|
|
144
|
+
for (const [, value] of Object.entries(this.uiBoxes)) {
|
|
145
|
+
__classPrivateFieldGet(this, _STSUIFrame_UpdateUIBoxPos, "f").call(this, value.box.get('panel'), value);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
_STSUIFrame_UpdatePanelPosition.set(this, (panel, row, col, uiBox) => {
|
|
149
|
+
// Update the panel position within the current screen view
|
|
150
|
+
panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };
|
|
151
|
+
__classPrivateFieldGet(this, _STSUIFrame_UpdateUIBoxPos, "f").call(this, panel, uiBox);
|
|
152
|
+
uiBox.boxHeader.setContent(panel.panelHeader);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* Setup all panels
|
|
157
|
+
*/
|
|
158
|
+
);
|
|
159
|
+
// https://www.npmjs.com/package/blessed
|
|
160
|
+
// data:= { title: <str>,
|
|
161
|
+
// grid: { rows: <int>, cols: <int> },
|
|
162
|
+
// menu: [ { top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <func> } ] } ]
|
|
163
|
+
// panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, template: <str> } ] }
|
|
164
|
+
/**
|
|
165
|
+
*
|
|
166
|
+
* @param {*} data UI Data
|
|
167
|
+
*/
|
|
168
|
+
this.SetupUI = () => {
|
|
169
|
+
this.DestroyUI();
|
|
170
|
+
if (this.screen === null) {
|
|
171
|
+
// Create a screen object.
|
|
172
|
+
this.screen = blessed_1.default.screen({
|
|
173
|
+
smartCSR: true
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const data = this.uidata;
|
|
177
|
+
this.screen.title = data.title;
|
|
178
|
+
this.screen.on('resize', () => {
|
|
179
|
+
__classPrivateFieldGet(this, _STSUIFrame_ReSize, "f").call(this);
|
|
180
|
+
this.screen.render();
|
|
181
|
+
});
|
|
182
|
+
if (data.menu !== null) {
|
|
183
|
+
for (let i = 0; i < data.menu.length; i++) {
|
|
184
|
+
new MenuBar.MenuBar(this.screen, data.menu[i]);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Allow the serrvice to terminate by pressing Control-C.
|
|
188
|
+
this.screen.key(['C-c'], function () {
|
|
189
|
+
this.DestroyUI();
|
|
190
|
+
this.emit('exit');
|
|
191
|
+
// Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)
|
|
192
|
+
//setTimeout(() => process.kill(process.pid), 0);
|
|
193
|
+
}.bind(this));
|
|
194
|
+
this.screen.key(['escape'], function () {
|
|
195
|
+
this.emit('escape');
|
|
196
|
+
// Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)
|
|
197
|
+
//setTimeout(() => process.kill(process.pid), 0);
|
|
198
|
+
}.bind(this));
|
|
199
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_SetupPanels).call(this);
|
|
200
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursorInfo, blessed_1.default.box({
|
|
201
|
+
parent: this.screen,
|
|
202
|
+
bottom: 0,
|
|
203
|
+
right: 0,
|
|
204
|
+
width: 'shrink',
|
|
205
|
+
height: 1,
|
|
206
|
+
style: {
|
|
207
|
+
bg: 'gray',
|
|
208
|
+
fg: 'white'
|
|
209
|
+
},
|
|
210
|
+
keys: false,
|
|
211
|
+
mouse: false,
|
|
212
|
+
content: '',
|
|
213
|
+
tags: true // Allow style in-line tags such as bolt, italics, etc.
|
|
214
|
+
}), "f");
|
|
215
|
+
this.sortInfo = blessed_1.default.box({
|
|
216
|
+
parent: this.screen,
|
|
217
|
+
top: 0,
|
|
218
|
+
right: 0,
|
|
219
|
+
width: 'shrink',
|
|
220
|
+
height: 1,
|
|
221
|
+
style: {
|
|
222
|
+
bg: 'gray',
|
|
223
|
+
fg: 'white'
|
|
224
|
+
},
|
|
225
|
+
keys: false,
|
|
226
|
+
mouse: false,
|
|
227
|
+
content: '',
|
|
228
|
+
tags: true // Allow style in-line tags such as bolt, italics, etc.
|
|
229
|
+
});
|
|
230
|
+
this.screenHeader = blessed_1.default.box({
|
|
231
|
+
parent: this.screen,
|
|
232
|
+
top: 0,
|
|
233
|
+
left: 'center',
|
|
234
|
+
width: 'shrink',
|
|
235
|
+
height: 1,
|
|
236
|
+
style: {
|
|
237
|
+
bg: 'gray',
|
|
238
|
+
fg: 'white'
|
|
239
|
+
},
|
|
240
|
+
keys: false,
|
|
241
|
+
mouse: false,
|
|
242
|
+
content: `[ ... ]`,
|
|
243
|
+
tags: true // Allow style in-line tags such as bolt, italics, etc.
|
|
244
|
+
});
|
|
245
|
+
this.UpdateCursorInfo();
|
|
246
|
+
this.UpdateSortInfo('Default');
|
|
247
|
+
this.UpdateScreenHeader(this.screenHeaderText);
|
|
248
|
+
// Render the screen.
|
|
249
|
+
this.screen.render();
|
|
250
|
+
};
|
|
251
|
+
this.UpdateCursorInfo = () => {
|
|
252
|
+
__classPrivateFieldGet(this, _STSUIFrame_cursorInfo, "f").setContent(`Cursor: ${__classPrivateFieldGet(this, _STSUIFrame_cursor, "f")} / ${this.TotalPanelNumber}`);
|
|
253
|
+
};
|
|
254
|
+
this.UpdateSortInfo = (sortMode) => {
|
|
255
|
+
this.sortInfo.setContent(`Sort: ${sortMode}`);
|
|
256
|
+
};
|
|
257
|
+
this.UpdateScreenHeader = (screenHeaderText) => {
|
|
258
|
+
this.screenHeaderText = screenHeaderText;
|
|
259
|
+
this.screenHeader.setContent(`[ ${screenHeaderText} ]`);
|
|
260
|
+
};
|
|
261
|
+
this.IncRows = () => {
|
|
262
|
+
if (this.screen.height / (this.uidata.grid.rows + 1) > this.minHeight) {
|
|
263
|
+
this.uidata.grid.rows++;
|
|
264
|
+
this.CheckCursor();
|
|
265
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_UpdateUI).call(this);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
this.DecRows = () => {
|
|
269
|
+
if (this.uidata.grid.rows > this.minRows) {
|
|
270
|
+
this.uidata.grid.rows--;
|
|
271
|
+
this.CheckCursor();
|
|
272
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_UpdateUI).call(this);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
this.IncCols = () => {
|
|
276
|
+
if (this.screen.width / (this.uidata.grid.cols + 1) > this.minWidth) {
|
|
277
|
+
this.uidata.grid.cols++;
|
|
278
|
+
this.CheckCursor();
|
|
279
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_UpdateUI).call(this);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
this.DecCols = () => {
|
|
283
|
+
if (this.uidata.grid.cols > this.minCols) {
|
|
284
|
+
this.uidata.grid.cols--;
|
|
285
|
+
this.CheckCursor();
|
|
286
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_UpdateUI).call(this);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
this.CheckCursor = () => {
|
|
290
|
+
if (__classPrivateFieldGet(this, _STSUIFrame_cursor, "f") > (this.TotalPanelNumber - this.ScreenCells)) {
|
|
291
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursor, this.TotalPanelNumber - this.ScreenCells, "f");
|
|
292
|
+
if (__classPrivateFieldGet(this, _STSUIFrame_cursor, "f") < 0) {
|
|
293
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursor, 0, "f");
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
this.UpdateCursorInfo();
|
|
297
|
+
};
|
|
298
|
+
this.NextPage = () => {
|
|
299
|
+
const endpos = this.TotalPanelNumber - this.ScreenCells;
|
|
300
|
+
if (__classPrivateFieldGet(this, _STSUIFrame_cursor, "f") < endpos) {
|
|
301
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursor, __classPrivateFieldGet(this, _STSUIFrame_cursor, "f") + this.ScreenCells, "f");
|
|
302
|
+
if (__classPrivateFieldGet(this, _STSUIFrame_cursor, "f") > endpos) {
|
|
303
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursor, endpos, "f");
|
|
304
|
+
}
|
|
305
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_UpdateUI).call(this);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
this.PrevPage = () => {
|
|
309
|
+
if (__classPrivateFieldGet(this, _STSUIFrame_cursor, "f") > 0) {
|
|
310
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursor, __classPrivateFieldGet(this, _STSUIFrame_cursor, "f") - this.ScreenCells, "f");
|
|
311
|
+
if (__classPrivateFieldGet(this, _STSUIFrame_cursor, "f") < 0) {
|
|
312
|
+
__classPrivateFieldSet(this, _STSUIFrame_cursor, 0, "f");
|
|
313
|
+
}
|
|
314
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_UpdateUI).call(this);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
this.Exit = () => {
|
|
318
|
+
this.DestroyUI();
|
|
319
|
+
this.emit('exit');
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
*
|
|
323
|
+
*/
|
|
324
|
+
this.DestroyUI = () => {
|
|
325
|
+
// Destroy the screen and disable UI log processing
|
|
326
|
+
if (this.screen !== null) {
|
|
327
|
+
this.uiBoxes = null;
|
|
328
|
+
this.screen.destroy();
|
|
329
|
+
this.screen = null;
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Render the screen.
|
|
334
|
+
*/
|
|
335
|
+
this.Render = () => {
|
|
336
|
+
this.screen.render();
|
|
337
|
+
};
|
|
338
|
+
this.uidata = data;
|
|
339
|
+
__classPrivateFieldSet(this, _STSUIFrame_renderPanelFn, renderPanelFn, "f");
|
|
340
|
+
this.SetupUI();
|
|
341
|
+
}
|
|
342
|
+
get gridData() {
|
|
343
|
+
return this.uidata;
|
|
344
|
+
}
|
|
345
|
+
set gridData(gridData) {
|
|
346
|
+
this.uidata = gridData;
|
|
347
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_SetupPanels).call(this);
|
|
348
|
+
this.UpdateCursorInfo();
|
|
349
|
+
this.screen.render();
|
|
350
|
+
}
|
|
351
|
+
get gridDataPanels() {
|
|
352
|
+
return this.uidata.panels;
|
|
353
|
+
}
|
|
354
|
+
set gridDataPanels(gridDataPanels) {
|
|
355
|
+
this.uidata.panels = gridDataPanels;
|
|
356
|
+
__classPrivateFieldGet(this, _STSUIFrame_instances, "m", _STSUIFrame_SetupPanels).call(this);
|
|
357
|
+
this.UpdateCursorInfo();
|
|
358
|
+
this.screen.render();
|
|
359
|
+
}
|
|
360
|
+
get rows() {
|
|
361
|
+
return this.uidata.grid.rows;
|
|
362
|
+
}
|
|
363
|
+
get cols() {
|
|
364
|
+
return this.uidata.grid.cols;
|
|
365
|
+
}
|
|
366
|
+
get ScreenCells() {
|
|
367
|
+
return this.uidata.grid.cols * this.uidata.grid.rows;
|
|
368
|
+
}
|
|
369
|
+
get TotalPanelNumber() {
|
|
370
|
+
return Object.keys(this.uidata.panels).length;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
exports.STSUIFrame = STSUIFrame;
|
|
374
|
+
_STSUIFrame_cursor = new WeakMap(), _STSUIFrame_cursorInfo = new WeakMap(), _STSUIFrame_renderPanelFn = new WeakMap(), _STSUIFrame_CalcBoxPos = new WeakMap(), _STSUIFrame_UpdateUIBoxPos = new WeakMap(), _STSUIFrame_ReSize = new WeakMap(), _STSUIFrame_UpdatePanelPosition = new WeakMap(), _STSUIFrame_instances = new WeakSet(), _STSUIFrame_SetupPanels = function _STSUIFrame_SetupPanels() {
|
|
375
|
+
const panelKeys = Object.keys(this.uidata.panels);
|
|
376
|
+
// Check for deleted panels
|
|
377
|
+
const uiBoxIds = Object.keys(this.uiBoxes);
|
|
378
|
+
for (let i = 0; i < uiBoxIds.length; i++) {
|
|
379
|
+
if (typeof this.uidata.panels[uiBoxIds[i]] === 'undefined') {
|
|
380
|
+
let uiBox = this.uiBoxes[uiBoxIds[i]];
|
|
381
|
+
if (typeof uiBox !== 'undefined') {
|
|
382
|
+
this.screen.remove(uiBox.boxHeader);
|
|
383
|
+
this.screen.remove(uiBox.box);
|
|
384
|
+
uiBox = null;
|
|
385
|
+
delete this.uiBoxes[uiBoxIds[i]];
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
const touched = {};
|
|
390
|
+
for (let i = 0; i < (this.uidata.grid.cols * this.uidata.grid.rows); i++) {
|
|
391
|
+
const gridPos = __classPrivateFieldGet(this, _STSUIFrame_cursor, "f") + i;
|
|
392
|
+
const col = i % this.uidata.grid.cols;
|
|
393
|
+
const row = Math.floor(i / this.uidata.grid.cols);
|
|
394
|
+
// Get the panel for this position within the grid
|
|
395
|
+
const panel = this.uidata.panels[panelKeys[gridPos]];
|
|
396
|
+
if (typeof panel !== 'undefined') {
|
|
397
|
+
if (typeof this.uiBoxes[panel.id] === 'undefined') {
|
|
398
|
+
this.uiBoxes[panel.id] = { box: null, boxHeader: null };
|
|
399
|
+
// Update the panel position within the current screen view
|
|
400
|
+
panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };
|
|
401
|
+
const { top, left, width, height } = __classPrivateFieldGet(this, _STSUIFrame_CalcBoxPos, "f").call(this, panel);
|
|
402
|
+
// Create the UI box
|
|
403
|
+
const box = blessed_1.default.box({
|
|
404
|
+
parent: this.screen,
|
|
405
|
+
top: top,
|
|
406
|
+
left: left,
|
|
407
|
+
width: width,
|
|
408
|
+
height: height,
|
|
409
|
+
style: {
|
|
410
|
+
bg: '#101010' // was gray
|
|
411
|
+
,
|
|
412
|
+
fg: 'white'
|
|
413
|
+
},
|
|
414
|
+
border: {
|
|
415
|
+
type: 'line'
|
|
416
|
+
},
|
|
417
|
+
keys: false,
|
|
418
|
+
tags: true // Allow style in-line tags such as bolt, italics, etc.
|
|
419
|
+
});
|
|
420
|
+
const boxHeader = blessed_1.default.box({
|
|
421
|
+
parent: this.screen,
|
|
422
|
+
top: top,
|
|
423
|
+
left: left + 2,
|
|
424
|
+
width: 'shrink',
|
|
425
|
+
height: 1,
|
|
426
|
+
style: {
|
|
427
|
+
bg: 'gray',
|
|
428
|
+
fg: 'white'
|
|
429
|
+
},
|
|
430
|
+
keys: false,
|
|
431
|
+
mouse: false,
|
|
432
|
+
content: panel.panelHeader,
|
|
433
|
+
tags: true // Allow style in-line tags such as bolt, italics, etc.
|
|
434
|
+
});
|
|
435
|
+
this.uiBoxes[panel.id].boxHeader = boxHeader;
|
|
436
|
+
boxHeader.setIndex(-1);
|
|
437
|
+
// https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-inside-a-callback
|
|
438
|
+
box.on('click', (data) => {
|
|
439
|
+
this.emit('click', data.panel);
|
|
440
|
+
});
|
|
441
|
+
if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {
|
|
442
|
+
for (const [, value] of Object.entries(panel.widgets)) {
|
|
443
|
+
// Create a fresh copy of the options for this widget instance.
|
|
444
|
+
// If this is not done, all widgets will use the same options object and will not be able
|
|
445
|
+
// to update screen elements individually.
|
|
446
|
+
const widgetoptions = Object.assign({}, value.options);
|
|
447
|
+
// Ensure that we always show at least 2 lines of log data even if this means we position over the top of
|
|
448
|
+
// elements above this position.
|
|
449
|
+
if (widgetoptions.top >= (box.height - 3)) {
|
|
450
|
+
widgetoptions.top = box.height - 4;
|
|
451
|
+
}
|
|
452
|
+
const widget = blessed_1.default[value.widget].call(this, widgetoptions);
|
|
453
|
+
widget.set('id', (0, uuid_1.v4)());
|
|
454
|
+
box.append(widget);
|
|
455
|
+
box.set(value.widget, widget); // Set the user data for this widget. This allows the handlebars template access via the name from the box object.
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// The entire panel is accessible using the _panel property.
|
|
459
|
+
// This is so that the model is accessible from within the handlebars templates.
|
|
460
|
+
// Access to a named widget can be done using box._panel.widgets[name] or box._panel.widgets.name
|
|
461
|
+
box.set('panel', panel);
|
|
462
|
+
this.uiBoxes[panel.id].box = box;
|
|
463
|
+
touched[panel.id] = true;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
//@@ need to hide previous positions
|
|
467
|
+
//@@ and show ones that are visible
|
|
468
|
+
__classPrivateFieldGet(this, _STSUIFrame_UpdatePanelPosition, "f").call(this, panel, row, col, this.uiBoxes[panel.id]);
|
|
469
|
+
touched[panel.id] = true;
|
|
470
|
+
//this.#uiBox[panel.id].box.show();
|
|
471
|
+
}
|
|
472
|
+
// Render the uiBox with the renderPanelFn using the panel as the utility including the model
|
|
473
|
+
__classPrivateFieldGet(this, _STSUIFrame_renderPanelFn, "f").call(this, this.uiBoxes[panel.id].box, panel);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
for (const [key,] of Object.entries(this.uiBoxes)) {
|
|
477
|
+
if (typeof touched[key] === 'undefined') {
|
|
478
|
+
this.uiBoxes[key].box.hide();
|
|
479
|
+
this.uiBoxes[key].boxHeader.hide();
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
this.uiBoxes[key].box.show();
|
|
483
|
+
this.uiBoxes[key].boxHeader.show();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}, _STSUIFrame_UpdateUI = function _STSUIFrame_UpdateUI() {
|
|
487
|
+
this.SetupUI();
|
|
488
|
+
//@@ fix screen render - should not need to blow entire screen away ...
|
|
489
|
+
//this.#SetupPanels();
|
|
490
|
+
//this.UpdateCursorInfo();
|
|
491
|
+
//this.#screen.render();
|
|
492
|
+
};
|
|
493
|
+
//# sourceMappingURL=stsuiframe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsuiframe.js","sourceRoot":"","sources":["../stsuiframe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAiC;AAEjC,4CAA4C;AAC5C,2CAA2C;AAC3C,sDAA8B;AAE9B,kBAAgB;AAEhB,yCAAyC;AACzC,+BAAoC;AAGpC,mDAAoC;AAyDpC,MAAa,UAAW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AmC;aAChC;YAED,6FAA6F;YAC7F,uBAAA,IAAI,iCAAe,MAAnB,IAAI,EAAgB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SACvD;KACD;IAEJ,KAAK,MAAM,CAAC,GAAG,EAAG,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QACnD,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,WAAW,EAAE;YACxC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;SACnC;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;SACnC;KACD;AAEF,CAAC;IAkOA,IAAI,CAAC,OAAO,EAAE,CAAC;IAEf,uEAAuE;IACvE,sBAAsB;IACtB,0BAA0B;IAC1B,wBAAwB;AACzB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
describe("Test", () => {
|
|
11
|
+
test('Testing Module', () => __awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
expect.assertions(1);
|
|
13
|
+
expect(1).toEqual(1);
|
|
14
|
+
}));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=stsuiframe.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsuiframe.test.js","sourceRoot":"","sources":["../stsuiframe.test.ts"],"names":[],"mappings":";;;;;;;;;AACA,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IAErB,IAAI,CAAC,gBAAgB,EAAE,GAAS,EAAE;QAEjC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,CAAA,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/menubar.ts
CHANGED
package/package.json
CHANGED
package/stsuiframe.ts
CHANGED
|
@@ -132,12 +132,12 @@ export class STSUIFrame extends EventEmitter {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
const boxPos: boxPos = {
|
|
136
|
+
top: (pos.row * rowHeight) + topoffset,
|
|
137
|
+
left: pos.col * colWidth,
|
|
138
|
+
width: colWidth * pos.colSpan,
|
|
139
|
+
height: rowHeight * pos.rowSpan
|
|
140
|
+
}
|
|
141
141
|
|
|
142
142
|
// Now check if this panel is on the far right and if so adjust for a perfect fit
|
|
143
143
|
|
package/types/menubar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../menubar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAE1C,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,IAAI,IAAI,CAAA;CACV;AAED,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,OAAO,CAAA;IACZ,SAAS,EAAE;QAAE,CAAE,WAAW,EAAE,MAAM,GAAI,QAAQ,CAAA;KAAE,CAAA;CAChD;AAED,qBAAa,OAAO;IAEnB,OAAO,CAAC,KAAK,CAA2B;gBAG5B,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../menubar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAE1C,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,IAAI,IAAI,CAAA;CACV;AAED,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,OAAO,CAAA;IACZ,SAAS,EAAE;QAAE,CAAE,WAAW,EAAE,MAAM,GAAI,QAAQ,CAAA;KAAE,CAAA;CAChD;AAED,qBAAa,OAAO;IAEnB,OAAO,CAAC,KAAK,CAA2B;gBAG5B,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc;IA+C9D,IAAI,OAAO,uBAGV;CACD"}
|