tigma 1.0.1 → 1.0.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/dist/index.js +88 -87
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
2
3
|
// node_modules/@opentui/core/index-rysm4rsr.js
|
|
3
4
|
import { Buffer as Buffer2 } from "buffer";
|
|
4
5
|
import { EventEmitter } from "events";
|
|
@@ -1703,56 +1704,56 @@ var Yoga = wrapAssembly(await yoga_wasm_base64_esm_default());
|
|
|
1703
1704
|
var src_default = Yoga;
|
|
1704
1705
|
var BorderChars = {
|
|
1705
1706
|
single: {
|
|
1706
|
-
topLeft: "
|
|
1707
|
-
topRight: "
|
|
1708
|
-
bottomLeft: "
|
|
1709
|
-
bottomRight: "
|
|
1710
|
-
horizontal: "
|
|
1711
|
-
vertical: "
|
|
1712
|
-
topT: "
|
|
1713
|
-
bottomT: "
|
|
1714
|
-
leftT: "
|
|
1715
|
-
rightT: "
|
|
1716
|
-
cross: "
|
|
1707
|
+
topLeft: "\u250C",
|
|
1708
|
+
topRight: "\u2510",
|
|
1709
|
+
bottomLeft: "\u2514",
|
|
1710
|
+
bottomRight: "\u2518",
|
|
1711
|
+
horizontal: "\u2500",
|
|
1712
|
+
vertical: "\u2502",
|
|
1713
|
+
topT: "\u252C",
|
|
1714
|
+
bottomT: "\u2534",
|
|
1715
|
+
leftT: "\u251C",
|
|
1716
|
+
rightT: "\u2524",
|
|
1717
|
+
cross: "\u253C"
|
|
1717
1718
|
},
|
|
1718
1719
|
double: {
|
|
1719
|
-
topLeft: "
|
|
1720
|
-
topRight: "
|
|
1721
|
-
bottomLeft: "
|
|
1722
|
-
bottomRight: "
|
|
1723
|
-
horizontal: "
|
|
1724
|
-
vertical: "
|
|
1725
|
-
topT: "
|
|
1726
|
-
bottomT: "
|
|
1727
|
-
leftT: "
|
|
1728
|
-
rightT: "
|
|
1729
|
-
cross: "
|
|
1720
|
+
topLeft: "\u2554",
|
|
1721
|
+
topRight: "\u2557",
|
|
1722
|
+
bottomLeft: "\u255A",
|
|
1723
|
+
bottomRight: "\u255D",
|
|
1724
|
+
horizontal: "\u2550",
|
|
1725
|
+
vertical: "\u2551",
|
|
1726
|
+
topT: "\u2566",
|
|
1727
|
+
bottomT: "\u2569",
|
|
1728
|
+
leftT: "\u2560",
|
|
1729
|
+
rightT: "\u2563",
|
|
1730
|
+
cross: "\u256C"
|
|
1730
1731
|
},
|
|
1731
1732
|
rounded: {
|
|
1732
|
-
topLeft: "
|
|
1733
|
-
topRight: "
|
|
1734
|
-
bottomLeft: "
|
|
1735
|
-
bottomRight: "
|
|
1736
|
-
horizontal: "
|
|
1737
|
-
vertical: "
|
|
1738
|
-
topT: "
|
|
1739
|
-
bottomT: "
|
|
1740
|
-
leftT: "
|
|
1741
|
-
rightT: "
|
|
1742
|
-
cross: "
|
|
1733
|
+
topLeft: "\u256D",
|
|
1734
|
+
topRight: "\u256E",
|
|
1735
|
+
bottomLeft: "\u2570",
|
|
1736
|
+
bottomRight: "\u256F",
|
|
1737
|
+
horizontal: "\u2500",
|
|
1738
|
+
vertical: "\u2502",
|
|
1739
|
+
topT: "\u252C",
|
|
1740
|
+
bottomT: "\u2534",
|
|
1741
|
+
leftT: "\u251C",
|
|
1742
|
+
rightT: "\u2524",
|
|
1743
|
+
cross: "\u253C"
|
|
1743
1744
|
},
|
|
1744
1745
|
heavy: {
|
|
1745
|
-
topLeft: "
|
|
1746
|
-
topRight: "
|
|
1747
|
-
bottomLeft: "
|
|
1748
|
-
bottomRight: "
|
|
1749
|
-
horizontal: "
|
|
1750
|
-
vertical: "
|
|
1751
|
-
topT: "
|
|
1752
|
-
bottomT: "
|
|
1753
|
-
leftT: "
|
|
1754
|
-
rightT: "
|
|
1755
|
-
cross: "
|
|
1746
|
+
topLeft: "\u250F",
|
|
1747
|
+
topRight: "\u2513",
|
|
1748
|
+
bottomLeft: "\u2517",
|
|
1749
|
+
bottomRight: "\u251B",
|
|
1750
|
+
horizontal: "\u2501",
|
|
1751
|
+
vertical: "\u2503",
|
|
1752
|
+
topT: "\u2533",
|
|
1753
|
+
bottomT: "\u253B",
|
|
1754
|
+
leftT: "\u2523",
|
|
1755
|
+
rightT: "\u252B",
|
|
1756
|
+
cross: "\u254B"
|
|
1756
1757
|
}
|
|
1757
1758
|
};
|
|
1758
1759
|
function getBorderSides(border) {
|
|
@@ -2288,7 +2289,7 @@ var parseKeypress = (s = "", options = {}) => {
|
|
|
2288
2289
|
key.meta = s.length === 2;
|
|
2289
2290
|
} else if (s === "\t") {
|
|
2290
2291
|
key.name = "tab";
|
|
2291
|
-
} else if (s === "\b" || s === "\x1B\b" || s === "
|
|
2292
|
+
} else if (s === "\b" || s === "\x1B\b" || s === "\x7F" || s === "\x1B\x7F") {
|
|
2292
2293
|
key.name = "backspace";
|
|
2293
2294
|
key.meta = s.charAt(0) === "\x1B";
|
|
2294
2295
|
} else if (s === "\x1B" || s === "\x1B\x1B") {
|
|
@@ -16109,31 +16110,31 @@ class CanvasApp {
|
|
|
16109
16110
|
for (let x = startX;x < startX + promptWidth; x++) {
|
|
16110
16111
|
if (x >= 0 && x < this.gridWidth) {
|
|
16111
16112
|
if (startY >= 0 && startY < this.gridHeight) {
|
|
16112
|
-
buffer.setCell(x, startY, "
|
|
16113
|
+
buffer.setCell(x, startY, "\u2500", borderColor, bgColor, 0);
|
|
16113
16114
|
}
|
|
16114
16115
|
if (startY + promptHeight - 1 >= 0 && startY + promptHeight - 1 < this.gridHeight) {
|
|
16115
|
-
buffer.setCell(x, startY + promptHeight - 1, "
|
|
16116
|
+
buffer.setCell(x, startY + promptHeight - 1, "\u2500", borderColor, bgColor, 0);
|
|
16116
16117
|
}
|
|
16117
16118
|
}
|
|
16118
16119
|
}
|
|
16119
16120
|
for (let y = startY;y < startY + promptHeight; y++) {
|
|
16120
16121
|
if (y >= 0 && y < this.gridHeight) {
|
|
16121
16122
|
if (startX >= 0 && startX < this.gridWidth) {
|
|
16122
|
-
buffer.setCell(startX, y, "
|
|
16123
|
+
buffer.setCell(startX, y, "\u2502", borderColor, bgColor, 0);
|
|
16123
16124
|
}
|
|
16124
16125
|
if (startX + promptWidth - 1 >= 0 && startX + promptWidth - 1 < this.gridWidth) {
|
|
16125
|
-
buffer.setCell(startX + promptWidth - 1, y, "
|
|
16126
|
+
buffer.setCell(startX + promptWidth - 1, y, "\u2502", borderColor, bgColor, 0);
|
|
16126
16127
|
}
|
|
16127
16128
|
}
|
|
16128
16129
|
}
|
|
16129
16130
|
if (startX >= 0 && startY >= 0)
|
|
16130
|
-
buffer.setCell(startX, startY, "
|
|
16131
|
+
buffer.setCell(startX, startY, "\u250C", borderColor, bgColor, 0);
|
|
16131
16132
|
if (startX + promptWidth - 1 < this.gridWidth && startY >= 0)
|
|
16132
|
-
buffer.setCell(startX + promptWidth - 1, startY, "
|
|
16133
|
+
buffer.setCell(startX + promptWidth - 1, startY, "\u2510", borderColor, bgColor, 0);
|
|
16133
16134
|
if (startX >= 0 && startY + promptHeight - 1 < this.gridHeight)
|
|
16134
|
-
buffer.setCell(startX, startY + promptHeight - 1, "
|
|
16135
|
+
buffer.setCell(startX, startY + promptHeight - 1, "\u2514", borderColor, bgColor, 0);
|
|
16135
16136
|
if (startX + promptWidth - 1 < this.gridWidth && startY + promptHeight - 1 < this.gridHeight)
|
|
16136
|
-
buffer.setCell(startX + promptWidth - 1, startY + promptHeight - 1, "
|
|
16137
|
+
buffer.setCell(startX + promptWidth - 1, startY + promptHeight - 1, "\u2518", borderColor, bgColor, 0);
|
|
16137
16138
|
const title = " Save As ";
|
|
16138
16139
|
const titleX = startX + Math.floor((promptWidth - title.length) / 2);
|
|
16139
16140
|
for (let i = 0;i < title.length; i++) {
|
|
@@ -16157,7 +16158,7 @@ class CanvasApp {
|
|
|
16157
16158
|
}
|
|
16158
16159
|
const cursorX = inputX + displayText.length;
|
|
16159
16160
|
if (cursorX >= 0 && cursorX < inputX + inputWidth && inputY >= 0 && inputY < this.gridHeight) {
|
|
16160
|
-
buffer.setCell(cursorX, inputY, "
|
|
16161
|
+
buffer.setCell(cursorX, inputY, "\u258F", borderColor, inputBgColor, 0);
|
|
16161
16162
|
}
|
|
16162
16163
|
const hint = "Enter to save, Esc to cancel";
|
|
16163
16164
|
const hintX = startX + Math.floor((promptWidth - hint.length) / 2);
|
|
@@ -16208,16 +16209,16 @@ class CanvasApp {
|
|
|
16208
16209
|
buffer.setCell(x, y, char, borderColor, bg2, 0);
|
|
16209
16210
|
}
|
|
16210
16211
|
};
|
|
16211
|
-
drawBorderCell(x1, y1, "
|
|
16212
|
-
drawBorderCell(x2, y1, "
|
|
16213
|
-
drawBorderCell(x1, y2, "
|
|
16214
|
-
drawBorderCell(x2, y2, "
|
|
16212
|
+
drawBorderCell(x1, y1, "\u250C");
|
|
16213
|
+
drawBorderCell(x2, y1, "\u2510");
|
|
16214
|
+
drawBorderCell(x1, y2, "\u2514");
|
|
16215
|
+
drawBorderCell(x2, y2, "\u2518");
|
|
16215
16216
|
for (let x = x1 + 1;x < x2; x++) {
|
|
16216
|
-
drawBorderCell(x, y1, "
|
|
16217
|
-
drawBorderCell(x, y2, "
|
|
16217
|
+
drawBorderCell(x, y1, "\u2500");
|
|
16218
|
+
drawBorderCell(x, y2, "\u2500");
|
|
16218
16219
|
}
|
|
16219
|
-
drawBorderCell(x1, box.y, "
|
|
16220
|
-
drawBorderCell(x2, box.y, "
|
|
16220
|
+
drawBorderCell(x1, box.y, "\u2502");
|
|
16221
|
+
drawBorderCell(x2, box.y, "\u2502");
|
|
16221
16222
|
}
|
|
16222
16223
|
renderTextCursor(buffer, box) {
|
|
16223
16224
|
if (!this.cursorBlinkVisible)
|
|
@@ -16257,17 +16258,17 @@ class CanvasApp {
|
|
|
16257
16258
|
continue;
|
|
16258
16259
|
let char = "";
|
|
16259
16260
|
if (y === y1 && x === x1)
|
|
16260
|
-
char = "
|
|
16261
|
+
char = "\u250C";
|
|
16261
16262
|
else if (y === y1 && x === x2)
|
|
16262
|
-
char = "
|
|
16263
|
+
char = "\u2510";
|
|
16263
16264
|
else if (y === y2 && x === x1)
|
|
16264
|
-
char = "
|
|
16265
|
+
char = "\u2514";
|
|
16265
16266
|
else if (y === y2 && x === x2)
|
|
16266
|
-
char = "
|
|
16267
|
+
char = "\u2518";
|
|
16267
16268
|
else if (y === y1 || y === y2)
|
|
16268
|
-
char = "
|
|
16269
|
+
char = "\u2500";
|
|
16269
16270
|
else if (x === x1 || x === x2)
|
|
16270
|
-
char = "
|
|
16271
|
+
char = "\u2502";
|
|
16271
16272
|
if (char) {
|
|
16272
16273
|
let bg2 = this.bgColor;
|
|
16273
16274
|
if (isHovered) {
|
|
@@ -16292,17 +16293,17 @@ class CanvasApp {
|
|
|
16292
16293
|
continue;
|
|
16293
16294
|
let char = "";
|
|
16294
16295
|
if (y === y1 && x === x1)
|
|
16295
|
-
char = "
|
|
16296
|
+
char = "\u250C";
|
|
16296
16297
|
else if (y === y1 && x === x2)
|
|
16297
|
-
char = "
|
|
16298
|
+
char = "\u2510";
|
|
16298
16299
|
else if (y === y2 && x === x1)
|
|
16299
|
-
char = "
|
|
16300
|
+
char = "\u2514";
|
|
16300
16301
|
else if (y === y2 && x === x2)
|
|
16301
|
-
char = "
|
|
16302
|
+
char = "\u2518";
|
|
16302
16303
|
else if (y === y1 || y === y2)
|
|
16303
|
-
char = "
|
|
16304
|
+
char = "\u2500";
|
|
16304
16305
|
else if (x === x1 || x === x2)
|
|
16305
|
-
char = "
|
|
16306
|
+
char = "\u2502";
|
|
16306
16307
|
if (char) {
|
|
16307
16308
|
buffer.setCell(x, y, char, fg2, this.bgColor, attrs);
|
|
16308
16309
|
}
|
|
@@ -16343,23 +16344,23 @@ class CanvasApp {
|
|
|
16343
16344
|
const dy = y2 - y1;
|
|
16344
16345
|
if (dx === 0) {
|
|
16345
16346
|
if (index === 0)
|
|
16346
|
-
return dy > 0 ? "
|
|
16347
|
+
return dy > 0 ? "\u2577" : "\u2575";
|
|
16347
16348
|
if (index === total - 1)
|
|
16348
|
-
return dy > 0 ? "
|
|
16349
|
-
return "
|
|
16349
|
+
return dy > 0 ? "\u2575" : "\u2577";
|
|
16350
|
+
return "\u2502";
|
|
16350
16351
|
} else if (dy === 0) {
|
|
16351
16352
|
if (index === 0)
|
|
16352
|
-
return dx > 0 ? "
|
|
16353
|
+
return dx > 0 ? "\u2576" : "\u2574";
|
|
16353
16354
|
if (index === total - 1)
|
|
16354
|
-
return dx > 0 ? "
|
|
16355
|
-
return "
|
|
16355
|
+
return dx > 0 ? "\u2574" : "\u2576";
|
|
16356
|
+
return "\u2500";
|
|
16356
16357
|
} else {
|
|
16357
16358
|
const goingRight = dx > 0;
|
|
16358
16359
|
const goingDown = dy > 0;
|
|
16359
16360
|
if (goingRight === goingDown) {
|
|
16360
|
-
return "
|
|
16361
|
+
return "\u2572";
|
|
16361
16362
|
} else {
|
|
16362
|
-
return "
|
|
16363
|
+
return "\u2571";
|
|
16363
16364
|
}
|
|
16364
16365
|
}
|
|
16365
16366
|
}
|
|
@@ -16543,9 +16544,9 @@ class CanvasApp {
|
|
|
16543
16544
|
if (x < width) {
|
|
16544
16545
|
if (color === null) {
|
|
16545
16546
|
const fg2 = isSelected ? this.toolbarActiveColor : this.toolbarTextColor;
|
|
16546
|
-
buffer.setCell(x, pickerY, "
|
|
16547
|
+
buffer.setCell(x, pickerY, "\u2205", fg2, this.toolbarBgColor, 0);
|
|
16547
16548
|
} else {
|
|
16548
|
-
const char = isSelected ? "
|
|
16549
|
+
const char = isSelected ? "\u2588" : "\u25A0";
|
|
16549
16550
|
buffer.setCell(x, pickerY, char, color, this.toolbarBgColor, 0);
|
|
16550
16551
|
}
|
|
16551
16552
|
x++;
|
|
@@ -16556,9 +16557,9 @@ class CanvasApp {
|
|
|
16556
16557
|
if (x < width) {
|
|
16557
16558
|
if (color === null) {
|
|
16558
16559
|
const fg2 = isSelected ? this.toolbarActiveColor : this.toolbarTextColor;
|
|
16559
|
-
buffer.setCell(x, pickerY, "
|
|
16560
|
+
buffer.setCell(x, pickerY, "\u2205", fg2, this.toolbarBgColor, 0);
|
|
16560
16561
|
} else {
|
|
16561
|
-
const char = isSelected ? "
|
|
16562
|
+
const char = isSelected ? "\u2588" : "\u25A0";
|
|
16562
16563
|
buffer.setCell(x, pickerY, char, color, this.toolbarBgColor, 0);
|
|
16563
16564
|
}
|
|
16564
16565
|
x++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tigma",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A terminal-based design tool",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "bun build ./index.ts --outdir ./dist --target
|
|
15
|
+
"build": "bun build ./index.ts --outdir ./dist --target bun && echo '#!/usr/bin/env bun' | cat - ./dist/index.js > ./dist/temp && mv ./dist/temp ./dist/index.js && chmod +x ./dist/index.js",
|
|
16
16
|
"prepublishOnly": "bun run build"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|