@moonbase.sh/gorilla-engine 0.2.0 → 0.2.1
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/README.md +2 -1
- package/dist/index.cjs +84 -22
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +84 -22
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -96,7 +96,8 @@ offer those calls, the module says so through `onError` rather than claim the pl
|
|
|
96
96
|
Every instance of the plugin, in any number of hosts, shares the license, kept by default in the manufacturer's
|
|
97
97
|
folder: `~/Library/Application Support/<manufacturer>/<plugin>/license.mb` on macOS and
|
|
98
98
|
`%APPDATA%\<manufacturer>\<plugin>\license.mb` on Windows. Activating in one unlocks the others within a few seconds,
|
|
99
|
-
and deactivating locks them.
|
|
99
|
+
and deactivating locks them. Moonbase's mark for the overlay's footer is written beside it, as `moonbase-mark.png` and
|
|
100
|
+
`moonbase-mark@2x.png`, since Gorilla Engine draws images from files only.
|
|
100
101
|
|
|
101
102
|
The folder is named after the plugin as it was built, so renaming the plugin would lose its customers' licenses.
|
|
102
103
|
`storage: { manufacturer, plugin }` names the folder for good instead, and `previousLicenseFiles` takes the license
|
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(src_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(src_exports);
|
|
44
44
|
|
|
45
45
|
// src/moonbase.ts
|
|
46
|
+
var import_node_buffer = require("buffer");
|
|
46
47
|
var import_node_child_process = require("child_process");
|
|
47
48
|
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
48
49
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -52,7 +53,7 @@ var import_node_process = __toESM(require("process"), 1);
|
|
|
52
53
|
var import_licensing = require("@moonbase.sh/licensing");
|
|
53
54
|
|
|
54
55
|
// package.json
|
|
55
|
-
var version = "0.2.
|
|
56
|
+
var version = "0.2.1";
|
|
56
57
|
|
|
57
58
|
// src/download.ts
|
|
58
59
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
@@ -77,6 +78,10 @@ function uniquePath(dir, name) {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
// src/mark.ts
|
|
82
|
+
var MARK_PNG = "iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAB8klEQVR4nIxSTUhUURQ+3503P07jrk1Bf7QIhsioqRCpiOiHcCIolIQKhvYFQa0Cly3atIgicJ5CGLUoZl5QRPBslfFeRVGbFjWBuFFReT4ddeYez3v6dBRED7z77rnn3O873znXoAYz7X8p9sbuKtBgpf3wx25A0zqGaNNbcto08CwGdfNG/tBn2sCMYOmznKOa6RNAVzZzKWS0bduoeJk/DFQL+VyWNmnqv5+5QMAeIh5sDLyyf2Ua/T7rW6tZdn8ULbeXmWFIiZfAPCNq/Sip33K3dpzaP9rNrHaX3VYdj43Xa/WXAHYQ88/i2+8HDDDtFcYmEO8yS84ZBqWNmbkPAUB24HfaB1qoVn8gqrwldQ5Yn1TCNB+4TDgLxIcF1fSbEtPFsuv5U1VP4o+laQPybWfiIdLJN3J2XEm575loWuaS1Ji/r0GXA1+C1ah0yTnBTJNQRp7U7ENhqahMc+qpbCbCIgidMUa2zjgt6ZYkDwvICIFfS0OOka7dE+YOhnoePgCz7LwTneeXGQJGoiehnkAKc5scXhXkbQL2onAx1xU+gCRwbZboq2x3LjJTWn53QgiOJh4i9hjJ+K1wjsHSlc+NJpA4GKCt6KIva2b+aEtz6vb1cy1+hLPKekrOPulsJ8Bqqds10dhfaD/ytzFvAQAA///wPXGEAAAABklEQVQDACqdwnQigg9+AAAAAElFTkSuQmCC";
|
|
83
|
+
var MARK_PNG_2X = "iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAEk0lEQVR4nLRVbUybVRQ+977vgNJWIX47w2SG+AFztOuME2ZcIsaJLU6zojPTFVQSl2xG4x8z4+IPh8ZkiskiP2gpWdTxx9BC3aaOTP8Q+lJAmV/4MUOmzpHBRvnue8/OLbSjH5SFsSdp773n3vucc+75eFVYAvsReYFfq2bAygViw5DDNrifMQHLBMu06fYFn6PhHTo1y0B92mW3DMJVQk0nbPH1F+ps1kvTzYDYOKbk7d3zRNE0rABSPPR09Jai0I/Txk207HDZbU/CCiLBQ29bz/26rn/PGJgA4Q+jOedZWGHw2KTlWP/NOsdvo8oIgrE3nVtKwrDCiCuMzMw00DPeKOcIMBy5DdvhGiCq0B0I3UdpXx2XIjTX2WyzcA0QjSHTxWsLhYxjT6ZLzb7gMxfVvPZMmdvkD63nIHaT8RVC4dtrK61alNvT+VcOjg3/zxgzx08j2+RybOiCZaAhMJhtjozWA2NxJxBxh2nK1vrTdkAVx4fLpTIE/Iae9VF5gAP+cyXkjZq2Kutf/NRoMuyVCdbU9ouZR0a/ImVlCQcZF1LZnR0hC2fILVHZvDKJCKIhmVy2OG9b0LJQljV2g0LDkJwfDnRdx3m4ExlwREhofeTAyJqjfQUC8AHm9msfUna+kcDO2Vbj+PTJidysVyOqwfPS48XnIQPcPs3KGDaR2aW0PE5xe4Q8yIofUJVCFsG7BOpbKGkwO6Xh6GKz0/nQUY8vWK3MTLzv8WknSOoHhj/KbZwrn7V0r4hWxXR70wKOxxLpsNu11XKaOKrpqc0ySyeSLUbGnqdA7/P4tYMU389IVDH3m2NKNC9j/5dkh+cGfIW4mul52bnkM0Sxxtuh2WscGz+neCQ0AFpfIGOGUu6gWkK7fYnK4AfjVE5jc0foYcoRehE8w7nCu9MZJpDVt7YOZDFd2UkXT8eJmex6sCrVkUhgPoYxw+Qnbcd/pmwmdP0jKeOo/MwxN7+bSuLP5MwiL+8dN0wdcG2zjHKmlpNXvfNb+bR7axobCy47Bn8zUMp2OUpPmfXRQ/SUMrtHDJOWbq5fPH9HoSl8NyloSUPyOiXOQQERs2nK8CARHSDFY7AYECfp/2OTKafEOFUaokSpJ+Nq5o3wO51MZ0RApdFTRgpP0lPxdDwyPvQKuS6HJdjaOWAKhyd3UUyKiWZ1tBEinqHx1KwBvHUVtgtNbaHbORdfgPyAx8AVi6vS0hdPMaqlI6TQubjxFBMGhwRwT63d2p/ujLs9uJYD2yYEvE1nr798GT5xOWx7osbHZJ4ve/NA1QdouhqWxgj9+smKX6mEZAO3EpGMkzGNob8jmqy1VfeMJSic99JKQ1e6LFwOSFlYUdQNL1aW/haTJcSsxmELUYt6ip5gFK4SFPMPyPsXFipLUSjhsm8MkHA9mfcdLB/j9HZfRwCPJW8s2pdk9nrbtZ0IbB8tixL2AN6ii++l3pHFjm6Byru1Vda0n7glGuGcYuqpDiqD3VQf62TRk+wsFfMtMSXEcoKsCOiYfeTlqnVnM/EtqTAZjX4tVwVexEHPZ1wR00JodXbbxJXevwQAAP//kVVCeAAAAAZJREFUAwDo79Or7AZ5mAAAAABJRU5ErkJggg==";
|
|
84
|
+
|
|
80
85
|
// src/moonbase.ts
|
|
81
86
|
function runtime() {
|
|
82
87
|
var _a;
|
|
@@ -156,6 +161,11 @@ function errorKind(err) {
|
|
|
156
161
|
return (_a = err.type) != null ? _a : "internal";
|
|
157
162
|
return "internal";
|
|
158
163
|
}
|
|
164
|
+
function writeIfChanged(file, data) {
|
|
165
|
+
if (import_node_fs2.default.existsSync(file) && import_node_fs2.default.readFileSync(file).equals(data))
|
|
166
|
+
return;
|
|
167
|
+
import_node_fs2.default.writeFileSync(file, data);
|
|
168
|
+
}
|
|
159
169
|
var MoonbaseGorillaEngine = class extends import_licensing.ActivationController {
|
|
160
170
|
constructor(options) {
|
|
161
171
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -244,6 +254,27 @@ var MoonbaseGorillaEngine = class extends import_licensing.ActivationController
|
|
|
244
254
|
this.reportError("previousLicense", err);
|
|
245
255
|
}
|
|
246
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Moonbase's mark, for the overlay's footer, as an image file: Gorilla Engine
|
|
259
|
+
* draws images from files only, and a module can't add to the plugin's assets.
|
|
260
|
+
* Written beside the license file, with its `@2x`, the first time it is asked
|
|
261
|
+
* for. Null when it can't be written, and the footer goes without it.
|
|
262
|
+
*/
|
|
263
|
+
moonbaseMark() {
|
|
264
|
+
if (this.markFile !== void 0)
|
|
265
|
+
return this.markFile;
|
|
266
|
+
const file = import_node_path2.default.join(import_node_path2.default.dirname(this.licenseFile), "moonbase-mark.png");
|
|
267
|
+
try {
|
|
268
|
+
import_node_fs2.default.mkdirSync(import_node_path2.default.dirname(file), { recursive: true });
|
|
269
|
+
writeIfChanged(file, import_node_buffer.Buffer.from(MARK_PNG, "base64"));
|
|
270
|
+
writeIfChanged(file.replace(/\.png$/, "@2x.png"), import_node_buffer.Buffer.from(MARK_PNG_2X, "base64"));
|
|
271
|
+
this.markFile = file;
|
|
272
|
+
} catch (err) {
|
|
273
|
+
this.reportError("moonbaseMark", err);
|
|
274
|
+
this.markFile = null;
|
|
275
|
+
}
|
|
276
|
+
return this.markFile;
|
|
277
|
+
}
|
|
247
278
|
/**
|
|
248
279
|
* Hand a failure to `onError`: the overlay does with every action that
|
|
249
280
|
* fails, and the module with the host's.
|
|
@@ -985,6 +1016,15 @@ function card(props, ...children) {
|
|
|
985
1016
|
...props.onClick && { onClick: props.onClick, mouseCursorType: "pointing hand" }
|
|
986
1017
|
}, ...children);
|
|
987
1018
|
}
|
|
1019
|
+
var SCROLLBAR = 6;
|
|
1020
|
+
function scrollView(props, contentHeight, ...children) {
|
|
1021
|
+
return h("geScrollView", {
|
|
1022
|
+
...props,
|
|
1023
|
+
hideHorizontalScrollbar: true,
|
|
1024
|
+
scrollbarThickness: SCROLLBAR,
|
|
1025
|
+
scrollbar: { background: palette.transparent, track: palette.transparent, thumb: color("#ffffff", 0.16) }
|
|
1026
|
+
}, label({ x: 0, y: 0, width: props.width - SCROLLBAR, height: contentHeight }, ...children));
|
|
1027
|
+
}
|
|
988
1028
|
function barBlock(fraction, fill, options = {}) {
|
|
989
1029
|
var _a, _b;
|
|
990
1030
|
const marginTop = (_a = options.marginTop) != null ? _a : 14;
|
|
@@ -1299,7 +1339,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1299
1339
|
return { height: 14 + body.height, render: (x, y, available) => body.render(x, y + 14, available) };
|
|
1300
1340
|
};
|
|
1301
1341
|
const backLink = (value, onClick) => ({
|
|
1302
|
-
height: 20 +
|
|
1342
|
+
height: 20 + 12,
|
|
1303
1343
|
render: (x, y) => h(LinkNode, { key: "back", theme, x, y, value: `\u2039 ${value}`, onClick })
|
|
1304
1344
|
});
|
|
1305
1345
|
const notice = (value, tone) => {
|
|
@@ -1452,7 +1492,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1452
1492
|
});
|
|
1453
1493
|
};
|
|
1454
1494
|
const step = (n, value) => ({
|
|
1455
|
-
height: 20 +
|
|
1495
|
+
height: 20 + 10,
|
|
1456
1496
|
render: (x, y) => label({ key: `step-${n}`, x, y, width, height: 20 }, label({ x: 0, y: 0, width: 20, height: 20, cornerRadius: 10, backgroundColor: color(theme.accent), text: n, fontSize: 11, textColor: palette.white, textAlign: "center" }), text(theme, value, 30, 0, width - 30, { size: 13, weight: 500, textColor: palette.textBody, height: 20 }))
|
|
1457
1497
|
});
|
|
1458
1498
|
return [
|
|
@@ -1460,31 +1500,31 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1460
1500
|
heading(theme, "Offline activation", width),
|
|
1461
1501
|
space(8),
|
|
1462
1502
|
paragraph(theme, `For computers without internet. Save your request file, take it to ${activationHost(moonbase)}/activate on a connected device, and bring back the license file.`, width),
|
|
1463
|
-
space(
|
|
1503
|
+
space(18),
|
|
1464
1504
|
step("1", "Save your request file"),
|
|
1465
1505
|
{
|
|
1466
|
-
height:
|
|
1467
|
-
render: (x, y) => card({ x, y, width, height:
|
|
1506
|
+
height: 52 + 16,
|
|
1507
|
+
render: (x, y) => card({ x, y, width, height: 52, radius: 9, background: palette.ghost, border: color("#ffffff", 0.12), onClick: saveRequest }, text(theme, requestFile, 16, 7, width - 120, { size: 13, mono: true, textColor: palette.textPrimary }), text(theme, saveSub, 16, 27, width - 120, { size: 11.5, textColor: palette.textSecondary }), text(theme, offline.saved ? "\u2713" : "Save\u2026", width - 80, 0, 64, { size: offline.saved ? 18 : 12.5, weight: 600, textColor: offline.saved ? color(palette.success) : palette.link, align: "right", height: 52 }))
|
|
1468
1508
|
},
|
|
1469
1509
|
step("2", "Add the license file"),
|
|
1470
1510
|
{
|
|
1471
|
-
height:
|
|
1511
|
+
height: 72,
|
|
1472
1512
|
render: (x, y) => h("geDropZone", {
|
|
1473
1513
|
key: "drop",
|
|
1474
1514
|
x,
|
|
1475
1515
|
y,
|
|
1476
1516
|
width,
|
|
1477
|
-
height:
|
|
1517
|
+
height: 72,
|
|
1478
1518
|
onDroppedFiles: (dropped) => {
|
|
1479
1519
|
const file = droppedFiles(dropped)[0];
|
|
1480
1520
|
if (file)
|
|
1481
1521
|
useFile(moonbase.readLicenseFile(file));
|
|
1482
1522
|
}
|
|
1483
|
-
}, card({ x: 0, y: 0, width, height:
|
|
1523
|
+
}, card({ x: 0, y: 0, width, height: 72, radius: 10, background: color("#ffffff", 0.02), border: color("#ffffff", 0.16), onClick: () => useFile(moonbase.chooseLicenseFile()) }, text(theme, offline.file ? offline.file.name : "Drop your license file here", 0, 15, width, { size: 13, weight: 600, mono: !!offline.file, textColor: offline.file ? palette.textPrimary : palette.textBody, align: "center" }), text(theme, offline.file ? "Click to choose a different file" : "or click to browse \xB7 .mb", 0, 38, width, { size: 11.5, textColor: palette.textSecondary, align: "center" })))
|
|
1484
1524
|
},
|
|
1485
1525
|
errorLine(offline.error),
|
|
1486
|
-
space(
|
|
1487
|
-
buttonBlock(theme, offline.busy ? "Verifying\u2026" : "Activate offline", activateOffline, { disabled: offline.busy })
|
|
1526
|
+
space(16),
|
|
1527
|
+
buttonBlock(theme, offline.busy ? "Verifying\u2026" : "Activate offline", activateOffline, { disabled: offline.busy, height: 44 })
|
|
1488
1528
|
];
|
|
1489
1529
|
},
|
|
1490
1530
|
trial: () => {
|
|
@@ -1554,6 +1594,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1554
1594
|
const seatCount = license.seatCount;
|
|
1555
1595
|
const used = license.seatsUsed;
|
|
1556
1596
|
const pipCount = seatCount ? Math.min(seatCount, 8) : 0;
|
|
1597
|
+
const lit = !seatCount || !used ? 0 : used >= seatCount ? pipCount : Math.max(1, Math.min(pipCount - 1, Math.round(used / seatCount * pipCount)));
|
|
1557
1598
|
const seatsTitle = seatCount ? `Activations \xB7 ${used != null ? used : "?"} of ${seatCount} ${seatCount === 1 ? "device" : "devices"}` : license.activationMethod === "Offline" ? "Activated offline on this device" : "Activated on this device";
|
|
1558
1599
|
const idCopied = copied === license.id;
|
|
1559
1600
|
const rowHeight = 44;
|
|
@@ -1568,7 +1609,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1568
1609
|
},
|
|
1569
1610
|
{
|
|
1570
1611
|
height: 64 + 22,
|
|
1571
|
-
render: (x, y) => card({ x, y, width, height: 64 }, text(theme, seatsTitle, 16, pipCount ? 11 : 0, width - 220, { size: 12.5, weight: 500, textColor: palette.textBright, height: pipCount ? 22 : 64 }), ...Array.from({ length: pipCount }, (_, index) => label({ key: `pip-${index}`, x: 16 + index * 40, y: 40, width: 34, height: 6, cornerRadius: 3, backgroundColor: index <
|
|
1612
|
+
render: (x, y) => card({ x, y, width, height: 64 }, text(theme, seatsTitle, 16, pipCount ? 11 : 0, width - 220, { size: 12.5, weight: 500, textColor: palette.textBright, height: pipCount ? 22 : 64 }), ...Array.from({ length: pipCount }, (_, index) => label({ key: `pip-${index}`, x: 16 + index * 40, y: 40, width: 34, height: 6, cornerRadius: 3, backgroundColor: index < lit ? color(theme.accent) : color("#ffffff", 0.1) })), h(Button, {
|
|
1572
1613
|
key: "deactivate",
|
|
1573
1614
|
theme,
|
|
1574
1615
|
x: width - 16 - 178,
|
|
@@ -1607,8 +1648,10 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1607
1648
|
list = {
|
|
1608
1649
|
height: listHeight,
|
|
1609
1650
|
render: (x, y) => {
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1651
|
+
const scrolls2 = rows.length > visible;
|
|
1652
|
+
const rowWidth = scrolls2 ? width - SCROLLBAR - 8 : width;
|
|
1653
|
+
const content2 = rows.map((row, index) => addOnRow(row, 0, index * (rowHeight + 10), rowWidth, rowHeight));
|
|
1654
|
+
return scrolls2 ? scrollView({ key: "addon-list", x, y, width, height: listHeight }, rows.length * (rowHeight + 10) - 10, ...content2) : label({ key: "addon-list", x, y, width, height: listHeight }, ...content2);
|
|
1612
1655
|
}
|
|
1613
1656
|
};
|
|
1614
1657
|
} else if (info.phase !== "ready") {
|
|
@@ -1736,7 +1779,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1736
1779
|
let content;
|
|
1737
1780
|
if (scrolls) {
|
|
1738
1781
|
const inner = stack(blocks, PAD_X, 0, width);
|
|
1739
|
-
content = { height: room, nodes: [
|
|
1782
|
+
content = { height: room, nodes: [scrollView({ key: "screen", x: 0, y: PAD_TOP, width: cardWidth - 10, height: room }, inner.height, ...inner.nodes)] };
|
|
1740
1783
|
} else {
|
|
1741
1784
|
content = stack(blocks, PAD_X, PAD_TOP, width);
|
|
1742
1785
|
}
|
|
@@ -1758,7 +1801,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1758
1801
|
const divider = height - footer - PAD_BOTTOM + 30;
|
|
1759
1802
|
return [
|
|
1760
1803
|
label({ key: "divider", x: PAD_X, y: divider, width, height: 1, backgroundColor: color("#ffffff", 0.06) }),
|
|
1761
|
-
h(
|
|
1804
|
+
h(Badge, { key: "badge", theme, x: PAD_X, y: divider + 14, width, mark: moonbase.moonbaseMark(), onClick: () => run2("openLink", () => moonbase.openLink("https://moonbase.sh")) })
|
|
1762
1805
|
];
|
|
1763
1806
|
} : null,
|
|
1764
1807
|
still
|
|
@@ -1782,18 +1825,16 @@ function PanelCard(props) {
|
|
|
1782
1825
|
);
|
|
1783
1826
|
}
|
|
1784
1827
|
function LinkNode(props) {
|
|
1785
|
-
var _a;
|
|
1786
1828
|
const [hovered, setHovered] = React3.useState(false);
|
|
1787
|
-
const width = (_a = props.width) != null ? _a : textWidth(props.value, 12.5, 500) + 8;
|
|
1788
1829
|
return label({
|
|
1789
1830
|
x: props.x,
|
|
1790
1831
|
y: props.y,
|
|
1791
|
-
width,
|
|
1832
|
+
width: textWidth(props.value, 12.5, 500) + 8,
|
|
1792
1833
|
height: 20,
|
|
1793
1834
|
text: props.value,
|
|
1794
|
-
fontSize:
|
|
1795
|
-
textColor: hovered ? palette.textBright :
|
|
1796
|
-
textAlign:
|
|
1835
|
+
fontSize: 12.5,
|
|
1836
|
+
textColor: hovered ? palette.textBright : palette.textSecondary,
|
|
1837
|
+
textAlign: "centered left",
|
|
1797
1838
|
interceptsMouseClicks: true,
|
|
1798
1839
|
mouseCursorType: "pointing hand",
|
|
1799
1840
|
onMouseEnter: () => setHovered(true),
|
|
@@ -1801,6 +1842,27 @@ function LinkNode(props) {
|
|
|
1801
1842
|
onClick: props.onClick
|
|
1802
1843
|
});
|
|
1803
1844
|
}
|
|
1845
|
+
function Badge(props) {
|
|
1846
|
+
const [hovered, setHovered] = React3.useState(false);
|
|
1847
|
+
const lead = "Licensing secured by";
|
|
1848
|
+
const gap = 7;
|
|
1849
|
+
const size = props.mark ? 14 : 0;
|
|
1850
|
+
const markGap = props.mark ? gap : 0;
|
|
1851
|
+
const wordmark = textWidth("moonbase", 12, 500) + 16;
|
|
1852
|
+
const start = Math.round((props.width - (textWidth(lead, 11) + gap + size + markGap + wordmark)) / 2);
|
|
1853
|
+
const linkX = start + textWidth(lead, 11) + gap;
|
|
1854
|
+
return label({ x: props.x, y: props.y, width: props.width, height: 20 }, text(props.theme, lead, 0, 0, linkX - gap, { size: 11, textColor: palette.textMuted, align: "right", height: 20 }), label({
|
|
1855
|
+
x: linkX,
|
|
1856
|
+
y: 0,
|
|
1857
|
+
width: size + markGap + wordmark,
|
|
1858
|
+
height: 20,
|
|
1859
|
+
interceptsMouseClicks: true,
|
|
1860
|
+
mouseCursorType: "pointing hand",
|
|
1861
|
+
onMouseEnter: () => setHovered(true),
|
|
1862
|
+
onMouseExit: () => setHovered(false),
|
|
1863
|
+
onClick: props.onClick
|
|
1864
|
+
}, props.mark && label({ x: 0, y: (20 - size) / 2, width: size, height: size, backgroundImage: props.mark, alpha: hovered ? 1 : 0.85 }), text(props.theme, "moonbase", size + markGap, 0, wordmark, { size: 12, weight: 500, kerning: 0.06, textColor: hovered ? palette.textPrimary : palette.textBright, height: 20 })));
|
|
1865
|
+
}
|
|
1804
1866
|
function osLabel() {
|
|
1805
1867
|
switch (import_node_process2.default.platform) {
|
|
1806
1868
|
case "darwin":
|
package/dist/index.d.cts
CHANGED
|
@@ -201,6 +201,8 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
201
201
|
private stopFocus;
|
|
202
202
|
/** Aborts the update download when the instance is disposed. */
|
|
203
203
|
private readonly aborts;
|
|
204
|
+
/** Where Moonbase's mark was written, null when it couldn't be, undefined before it was asked for. */
|
|
205
|
+
private markFile;
|
|
204
206
|
constructor(options: MoonbaseGorillaEngineOptions);
|
|
205
207
|
/**
|
|
206
208
|
* Validate the stored license, start watching it, and bring the overlay up
|
|
@@ -216,6 +218,13 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
216
218
|
dispose(): void;
|
|
217
219
|
/** When the license file is missing, take the one an earlier version kept. */
|
|
218
220
|
private importPreviousLicense;
|
|
221
|
+
/**
|
|
222
|
+
* Moonbase's mark, for the overlay's footer, as an image file: Gorilla Engine
|
|
223
|
+
* draws images from files only, and a module can't add to the plugin's assets.
|
|
224
|
+
* Written beside the license file, with its `@2x`, the first time it is asked
|
|
225
|
+
* for. Null when it can't be written, and the footer goes without it.
|
|
226
|
+
*/
|
|
227
|
+
moonbaseMark(): string | null;
|
|
219
228
|
/**
|
|
220
229
|
* Hand a failure to `onError`: the overlay does with every action that
|
|
221
230
|
* fails, and the module with the host's.
|
package/dist/index.d.ts
CHANGED
|
@@ -201,6 +201,8 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
201
201
|
private stopFocus;
|
|
202
202
|
/** Aborts the update download when the instance is disposed. */
|
|
203
203
|
private readonly aborts;
|
|
204
|
+
/** Where Moonbase's mark was written, null when it couldn't be, undefined before it was asked for. */
|
|
205
|
+
private markFile;
|
|
204
206
|
constructor(options: MoonbaseGorillaEngineOptions);
|
|
205
207
|
/**
|
|
206
208
|
* Validate the stored license, start watching it, and bring the overlay up
|
|
@@ -216,6 +218,13 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
216
218
|
dispose(): void;
|
|
217
219
|
/** When the license file is missing, take the one an earlier version kept. */
|
|
218
220
|
private importPreviousLicense;
|
|
221
|
+
/**
|
|
222
|
+
* Moonbase's mark, for the overlay's footer, as an image file: Gorilla Engine
|
|
223
|
+
* draws images from files only, and a module can't add to the plugin's assets.
|
|
224
|
+
* Written beside the license file, with its `@2x`, the first time it is asked
|
|
225
|
+
* for. Null when it can't be written, and the footer goes without it.
|
|
226
|
+
*/
|
|
227
|
+
moonbaseMark(): string | null;
|
|
219
228
|
/**
|
|
220
229
|
* Hand a failure to `onError`: the overlay does with every action that
|
|
221
230
|
* fails, and the module with the host's.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/moonbase.ts
|
|
2
|
+
import { Buffer } from "buffer";
|
|
2
3
|
import { execFile, spawn } from "child_process";
|
|
3
4
|
import fsSync from "fs";
|
|
4
5
|
import fs2 from "fs/promises";
|
|
@@ -8,7 +9,7 @@ import process from "process";
|
|
|
8
9
|
import { ActivationController, ActivationError, licensingVersion, MoonbaseError, ReleaseNotCoveredError } from "@moonbase.sh/licensing";
|
|
9
10
|
|
|
10
11
|
// package.json
|
|
11
|
-
var version = "0.2.
|
|
12
|
+
var version = "0.2.1";
|
|
12
13
|
|
|
13
14
|
// src/download.ts
|
|
14
15
|
import fs from "fs";
|
|
@@ -33,6 +34,10 @@ function uniquePath(dir, name) {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
// src/mark.ts
|
|
38
|
+
var MARK_PNG = "iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAB8klEQVR4nIxSTUhUURQ+3503P07jrk1Bf7QIhsioqRCpiOiHcCIolIQKhvYFQa0Cly3atIgicJ5CGLUoZl5QRPBslfFeRVGbFjWBuFFReT4ddeYez3v6dBRED7z77rnn3O873znXoAYz7X8p9sbuKtBgpf3wx25A0zqGaNNbcto08CwGdfNG/tBn2sCMYOmznKOa6RNAVzZzKWS0bduoeJk/DFQL+VyWNmnqv5+5QMAeIh5sDLyyf2Ua/T7rW6tZdn8ULbeXmWFIiZfAPCNq/Sip33K3dpzaP9rNrHaX3VYdj43Xa/WXAHYQ88/i2+8HDDDtFcYmEO8yS84ZBqWNmbkPAUB24HfaB1qoVn8gqrwldQ5Yn1TCNB+4TDgLxIcF1fSbEtPFsuv5U1VP4o+laQPybWfiIdLJN3J2XEm575loWuaS1Ji/r0GXA1+C1ah0yTnBTJNQRp7U7ENhqahMc+qpbCbCIgidMUa2zjgt6ZYkDwvICIFfS0OOka7dE+YOhnoePgCz7LwTneeXGQJGoiehnkAKc5scXhXkbQL2onAx1xU+gCRwbZboq2x3LjJTWn53QgiOJh4i9hjJ+K1wjsHSlc+NJpA4GKCt6KIva2b+aEtz6vb1cy1+hLPKekrOPulsJ8Bqqds10dhfaD/ytzFvAQAA///wPXGEAAAABklEQVQDACqdwnQigg9+AAAAAElFTkSuQmCC";
|
|
39
|
+
var MARK_PNG_2X = "iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAEk0lEQVR4nLRVbUybVRQ+977vgNJWIX47w2SG+AFztOuME2ZcIsaJLU6zojPTFVQSl2xG4x8z4+IPh8ZkiskiP2gpWdTxx9BC3aaOTP8Q+lJAmV/4MUOmzpHBRvnue8/OLbSjH5SFsSdp773n3vucc+75eFVYAvsReYFfq2bAygViw5DDNrifMQHLBMu06fYFn6PhHTo1y0B92mW3DMJVQk0nbPH1F+ps1kvTzYDYOKbk7d3zRNE0rABSPPR09Jai0I/Txk207HDZbU/CCiLBQ29bz/26rn/PGJgA4Q+jOedZWGHw2KTlWP/NOsdvo8oIgrE3nVtKwrDCiCuMzMw00DPeKOcIMBy5DdvhGiCq0B0I3UdpXx2XIjTX2WyzcA0QjSHTxWsLhYxjT6ZLzb7gMxfVvPZMmdvkD63nIHaT8RVC4dtrK61alNvT+VcOjg3/zxgzx08j2+RybOiCZaAhMJhtjozWA2NxJxBxh2nK1vrTdkAVx4fLpTIE/Iae9VF5gAP+cyXkjZq2Kutf/NRoMuyVCdbU9ouZR0a/ImVlCQcZF1LZnR0hC2fILVHZvDKJCKIhmVy2OG9b0LJQljV2g0LDkJwfDnRdx3m4ExlwREhofeTAyJqjfQUC8AHm9msfUna+kcDO2Vbj+PTJidysVyOqwfPS48XnIQPcPs3KGDaR2aW0PE5xe4Q8yIofUJVCFsG7BOpbKGkwO6Xh6GKz0/nQUY8vWK3MTLzv8WknSOoHhj/KbZwrn7V0r4hWxXR70wKOxxLpsNu11XKaOKrpqc0ySyeSLUbGnqdA7/P4tYMU389IVDH3m2NKNC9j/5dkh+cGfIW4mul52bnkM0Sxxtuh2WscGz+neCQ0AFpfIGOGUu6gWkK7fYnK4AfjVE5jc0foYcoRehE8w7nCu9MZJpDVt7YOZDFd2UkXT8eJmex6sCrVkUhgPoYxw+Qnbcd/pmwmdP0jKeOo/MwxN7+bSuLP5MwiL+8dN0wdcG2zjHKmlpNXvfNb+bR7axobCy47Bn8zUMp2OUpPmfXRQ/SUMrtHDJOWbq5fPH9HoSl8NyloSUPyOiXOQQERs2nK8CARHSDFY7AYECfp/2OTKafEOFUaokSpJ+Nq5o3wO51MZ0RApdFTRgpP0lPxdDwyPvQKuS6HJdjaOWAKhyd3UUyKiWZ1tBEinqHx1KwBvHUVtgtNbaHbORdfgPyAx8AVi6vS0hdPMaqlI6TQubjxFBMGhwRwT63d2p/ujLs9uJYD2yYEvE1nr798GT5xOWx7osbHZJ4ve/NA1QdouhqWxgj9+smKX6mEZAO3EpGMkzGNob8jmqy1VfeMJSic99JKQ1e6LFwOSFlYUdQNL1aW/haTJcSsxmELUYt6ip5gFK4SFPMPyPsXFipLUSjhsm8MkHA9mfcdLB/j9HZfRwCPJW8s2pdk9nrbtZ0IbB8tixL2AN6ii++l3pHFjm6Byru1Vda0n7glGuGcYuqpDiqD3VQf62TRk+wsFfMtMSXEcoKsCOiYfeTlqnVnM/EtqTAZjX4tVwVexEHPZ1wR00JodXbbxJXevwQAAP//kVVCeAAAAAZJREFUAwDo79Or7AZ5mAAAAABJRU5ErkJggg==";
|
|
40
|
+
|
|
36
41
|
// src/moonbase.ts
|
|
37
42
|
function runtime() {
|
|
38
43
|
var _a;
|
|
@@ -112,6 +117,11 @@ function errorKind(err) {
|
|
|
112
117
|
return (_a = err.type) != null ? _a : "internal";
|
|
113
118
|
return "internal";
|
|
114
119
|
}
|
|
120
|
+
function writeIfChanged(file, data) {
|
|
121
|
+
if (fsSync.existsSync(file) && fsSync.readFileSync(file).equals(data))
|
|
122
|
+
return;
|
|
123
|
+
fsSync.writeFileSync(file, data);
|
|
124
|
+
}
|
|
115
125
|
var MoonbaseGorillaEngine = class extends ActivationController {
|
|
116
126
|
constructor(options) {
|
|
117
127
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -200,6 +210,27 @@ var MoonbaseGorillaEngine = class extends ActivationController {
|
|
|
200
210
|
this.reportError("previousLicense", err);
|
|
201
211
|
}
|
|
202
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Moonbase's mark, for the overlay's footer, as an image file: Gorilla Engine
|
|
215
|
+
* draws images from files only, and a module can't add to the plugin's assets.
|
|
216
|
+
* Written beside the license file, with its `@2x`, the first time it is asked
|
|
217
|
+
* for. Null when it can't be written, and the footer goes without it.
|
|
218
|
+
*/
|
|
219
|
+
moonbaseMark() {
|
|
220
|
+
if (this.markFile !== void 0)
|
|
221
|
+
return this.markFile;
|
|
222
|
+
const file = path2.join(path2.dirname(this.licenseFile), "moonbase-mark.png");
|
|
223
|
+
try {
|
|
224
|
+
fsSync.mkdirSync(path2.dirname(file), { recursive: true });
|
|
225
|
+
writeIfChanged(file, Buffer.from(MARK_PNG, "base64"));
|
|
226
|
+
writeIfChanged(file.replace(/\.png$/, "@2x.png"), Buffer.from(MARK_PNG_2X, "base64"));
|
|
227
|
+
this.markFile = file;
|
|
228
|
+
} catch (err) {
|
|
229
|
+
this.reportError("moonbaseMark", err);
|
|
230
|
+
this.markFile = null;
|
|
231
|
+
}
|
|
232
|
+
return this.markFile;
|
|
233
|
+
}
|
|
203
234
|
/**
|
|
204
235
|
* Hand a failure to `onError`: the overlay does with every action that
|
|
205
236
|
* fails, and the module with the host's.
|
|
@@ -941,6 +972,15 @@ function card(props, ...children) {
|
|
|
941
972
|
...props.onClick && { onClick: props.onClick, mouseCursorType: "pointing hand" }
|
|
942
973
|
}, ...children);
|
|
943
974
|
}
|
|
975
|
+
var SCROLLBAR = 6;
|
|
976
|
+
function scrollView(props, contentHeight, ...children) {
|
|
977
|
+
return h("geScrollView", {
|
|
978
|
+
...props,
|
|
979
|
+
hideHorizontalScrollbar: true,
|
|
980
|
+
scrollbarThickness: SCROLLBAR,
|
|
981
|
+
scrollbar: { background: palette.transparent, track: palette.transparent, thumb: color("#ffffff", 0.16) }
|
|
982
|
+
}, label({ x: 0, y: 0, width: props.width - SCROLLBAR, height: contentHeight }, ...children));
|
|
983
|
+
}
|
|
944
984
|
function barBlock(fraction, fill, options = {}) {
|
|
945
985
|
var _a, _b;
|
|
946
986
|
const marginTop = (_a = options.marginTop) != null ? _a : 14;
|
|
@@ -1255,7 +1295,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1255
1295
|
return { height: 14 + body.height, render: (x, y, available) => body.render(x, y + 14, available) };
|
|
1256
1296
|
};
|
|
1257
1297
|
const backLink = (value, onClick) => ({
|
|
1258
|
-
height: 20 +
|
|
1298
|
+
height: 20 + 12,
|
|
1259
1299
|
render: (x, y) => h(LinkNode, { key: "back", theme, x, y, value: `\u2039 ${value}`, onClick })
|
|
1260
1300
|
});
|
|
1261
1301
|
const notice = (value, tone) => {
|
|
@@ -1408,7 +1448,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1408
1448
|
});
|
|
1409
1449
|
};
|
|
1410
1450
|
const step = (n, value) => ({
|
|
1411
|
-
height: 20 +
|
|
1451
|
+
height: 20 + 10,
|
|
1412
1452
|
render: (x, y) => label({ key: `step-${n}`, x, y, width, height: 20 }, label({ x: 0, y: 0, width: 20, height: 20, cornerRadius: 10, backgroundColor: color(theme.accent), text: n, fontSize: 11, textColor: palette.white, textAlign: "center" }), text(theme, value, 30, 0, width - 30, { size: 13, weight: 500, textColor: palette.textBody, height: 20 }))
|
|
1413
1453
|
});
|
|
1414
1454
|
return [
|
|
@@ -1416,31 +1456,31 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1416
1456
|
heading(theme, "Offline activation", width),
|
|
1417
1457
|
space(8),
|
|
1418
1458
|
paragraph(theme, `For computers without internet. Save your request file, take it to ${activationHost(moonbase)}/activate on a connected device, and bring back the license file.`, width),
|
|
1419
|
-
space(
|
|
1459
|
+
space(18),
|
|
1420
1460
|
step("1", "Save your request file"),
|
|
1421
1461
|
{
|
|
1422
|
-
height:
|
|
1423
|
-
render: (x, y) => card({ x, y, width, height:
|
|
1462
|
+
height: 52 + 16,
|
|
1463
|
+
render: (x, y) => card({ x, y, width, height: 52, radius: 9, background: palette.ghost, border: color("#ffffff", 0.12), onClick: saveRequest }, text(theme, requestFile, 16, 7, width - 120, { size: 13, mono: true, textColor: palette.textPrimary }), text(theme, saveSub, 16, 27, width - 120, { size: 11.5, textColor: palette.textSecondary }), text(theme, offline.saved ? "\u2713" : "Save\u2026", width - 80, 0, 64, { size: offline.saved ? 18 : 12.5, weight: 600, textColor: offline.saved ? color(palette.success) : palette.link, align: "right", height: 52 }))
|
|
1424
1464
|
},
|
|
1425
1465
|
step("2", "Add the license file"),
|
|
1426
1466
|
{
|
|
1427
|
-
height:
|
|
1467
|
+
height: 72,
|
|
1428
1468
|
render: (x, y) => h("geDropZone", {
|
|
1429
1469
|
key: "drop",
|
|
1430
1470
|
x,
|
|
1431
1471
|
y,
|
|
1432
1472
|
width,
|
|
1433
|
-
height:
|
|
1473
|
+
height: 72,
|
|
1434
1474
|
onDroppedFiles: (dropped) => {
|
|
1435
1475
|
const file = droppedFiles(dropped)[0];
|
|
1436
1476
|
if (file)
|
|
1437
1477
|
useFile(moonbase.readLicenseFile(file));
|
|
1438
1478
|
}
|
|
1439
|
-
}, card({ x: 0, y: 0, width, height:
|
|
1479
|
+
}, card({ x: 0, y: 0, width, height: 72, radius: 10, background: color("#ffffff", 0.02), border: color("#ffffff", 0.16), onClick: () => useFile(moonbase.chooseLicenseFile()) }, text(theme, offline.file ? offline.file.name : "Drop your license file here", 0, 15, width, { size: 13, weight: 600, mono: !!offline.file, textColor: offline.file ? palette.textPrimary : palette.textBody, align: "center" }), text(theme, offline.file ? "Click to choose a different file" : "or click to browse \xB7 .mb", 0, 38, width, { size: 11.5, textColor: palette.textSecondary, align: "center" })))
|
|
1440
1480
|
},
|
|
1441
1481
|
errorLine(offline.error),
|
|
1442
|
-
space(
|
|
1443
|
-
buttonBlock(theme, offline.busy ? "Verifying\u2026" : "Activate offline", activateOffline, { disabled: offline.busy })
|
|
1482
|
+
space(16),
|
|
1483
|
+
buttonBlock(theme, offline.busy ? "Verifying\u2026" : "Activate offline", activateOffline, { disabled: offline.busy, height: 44 })
|
|
1444
1484
|
];
|
|
1445
1485
|
},
|
|
1446
1486
|
trial: () => {
|
|
@@ -1510,6 +1550,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1510
1550
|
const seatCount = license.seatCount;
|
|
1511
1551
|
const used = license.seatsUsed;
|
|
1512
1552
|
const pipCount = seatCount ? Math.min(seatCount, 8) : 0;
|
|
1553
|
+
const lit = !seatCount || !used ? 0 : used >= seatCount ? pipCount : Math.max(1, Math.min(pipCount - 1, Math.round(used / seatCount * pipCount)));
|
|
1513
1554
|
const seatsTitle = seatCount ? `Activations \xB7 ${used != null ? used : "?"} of ${seatCount} ${seatCount === 1 ? "device" : "devices"}` : license.activationMethod === "Offline" ? "Activated offline on this device" : "Activated on this device";
|
|
1514
1555
|
const idCopied = copied === license.id;
|
|
1515
1556
|
const rowHeight = 44;
|
|
@@ -1524,7 +1565,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1524
1565
|
},
|
|
1525
1566
|
{
|
|
1526
1567
|
height: 64 + 22,
|
|
1527
|
-
render: (x, y) => card({ x, y, width, height: 64 }, text(theme, seatsTitle, 16, pipCount ? 11 : 0, width - 220, { size: 12.5, weight: 500, textColor: palette.textBright, height: pipCount ? 22 : 64 }), ...Array.from({ length: pipCount }, (_, index) => label({ key: `pip-${index}`, x: 16 + index * 40, y: 40, width: 34, height: 6, cornerRadius: 3, backgroundColor: index <
|
|
1568
|
+
render: (x, y) => card({ x, y, width, height: 64 }, text(theme, seatsTitle, 16, pipCount ? 11 : 0, width - 220, { size: 12.5, weight: 500, textColor: palette.textBright, height: pipCount ? 22 : 64 }), ...Array.from({ length: pipCount }, (_, index) => label({ key: `pip-${index}`, x: 16 + index * 40, y: 40, width: 34, height: 6, cornerRadius: 3, backgroundColor: index < lit ? color(theme.accent) : color("#ffffff", 0.1) })), h(Button, {
|
|
1528
1569
|
key: "deactivate",
|
|
1529
1570
|
theme,
|
|
1530
1571
|
x: width - 16 - 178,
|
|
@@ -1563,8 +1604,10 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1563
1604
|
list = {
|
|
1564
1605
|
height: listHeight,
|
|
1565
1606
|
render: (x, y) => {
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1607
|
+
const scrolls2 = rows.length > visible;
|
|
1608
|
+
const rowWidth = scrolls2 ? width - SCROLLBAR - 8 : width;
|
|
1609
|
+
const content2 = rows.map((row, index) => addOnRow(row, 0, index * (rowHeight + 10), rowWidth, rowHeight));
|
|
1610
|
+
return scrolls2 ? scrollView({ key: "addon-list", x, y, width, height: listHeight }, rows.length * (rowHeight + 10) - 10, ...content2) : label({ key: "addon-list", x, y, width, height: listHeight }, ...content2);
|
|
1568
1611
|
}
|
|
1569
1612
|
};
|
|
1570
1613
|
} else if (info.phase !== "ready") {
|
|
@@ -1692,7 +1735,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1692
1735
|
let content;
|
|
1693
1736
|
if (scrolls) {
|
|
1694
1737
|
const inner = stack(blocks, PAD_X, 0, width);
|
|
1695
|
-
content = { height: room, nodes: [
|
|
1738
|
+
content = { height: room, nodes: [scrollView({ key: "screen", x: 0, y: PAD_TOP, width: cardWidth - 10, height: room }, inner.height, ...inner.nodes)] };
|
|
1696
1739
|
} else {
|
|
1697
1740
|
content = stack(blocks, PAD_X, PAD_TOP, width);
|
|
1698
1741
|
}
|
|
@@ -1714,7 +1757,7 @@ function Panel({ moonbase, state, screen, request, download, width: areaWidth, h
|
|
|
1714
1757
|
const divider = height - footer - PAD_BOTTOM + 30;
|
|
1715
1758
|
return [
|
|
1716
1759
|
label({ key: "divider", x: PAD_X, y: divider, width, height: 1, backgroundColor: color("#ffffff", 0.06) }),
|
|
1717
|
-
h(
|
|
1760
|
+
h(Badge, { key: "badge", theme, x: PAD_X, y: divider + 14, width, mark: moonbase.moonbaseMark(), onClick: () => run2("openLink", () => moonbase.openLink("https://moonbase.sh")) })
|
|
1718
1761
|
];
|
|
1719
1762
|
} : null,
|
|
1720
1763
|
still
|
|
@@ -1738,18 +1781,16 @@ function PanelCard(props) {
|
|
|
1738
1781
|
);
|
|
1739
1782
|
}
|
|
1740
1783
|
function LinkNode(props) {
|
|
1741
|
-
var _a;
|
|
1742
1784
|
const [hovered, setHovered] = React3.useState(false);
|
|
1743
|
-
const width = (_a = props.width) != null ? _a : textWidth(props.value, 12.5, 500) + 8;
|
|
1744
1785
|
return label({
|
|
1745
1786
|
x: props.x,
|
|
1746
1787
|
y: props.y,
|
|
1747
|
-
width,
|
|
1788
|
+
width: textWidth(props.value, 12.5, 500) + 8,
|
|
1748
1789
|
height: 20,
|
|
1749
1790
|
text: props.value,
|
|
1750
|
-
fontSize:
|
|
1751
|
-
textColor: hovered ? palette.textBright :
|
|
1752
|
-
textAlign:
|
|
1791
|
+
fontSize: 12.5,
|
|
1792
|
+
textColor: hovered ? palette.textBright : palette.textSecondary,
|
|
1793
|
+
textAlign: "centered left",
|
|
1753
1794
|
interceptsMouseClicks: true,
|
|
1754
1795
|
mouseCursorType: "pointing hand",
|
|
1755
1796
|
onMouseEnter: () => setHovered(true),
|
|
@@ -1757,6 +1798,27 @@ function LinkNode(props) {
|
|
|
1757
1798
|
onClick: props.onClick
|
|
1758
1799
|
});
|
|
1759
1800
|
}
|
|
1801
|
+
function Badge(props) {
|
|
1802
|
+
const [hovered, setHovered] = React3.useState(false);
|
|
1803
|
+
const lead = "Licensing secured by";
|
|
1804
|
+
const gap = 7;
|
|
1805
|
+
const size = props.mark ? 14 : 0;
|
|
1806
|
+
const markGap = props.mark ? gap : 0;
|
|
1807
|
+
const wordmark = textWidth("moonbase", 12, 500) + 16;
|
|
1808
|
+
const start = Math.round((props.width - (textWidth(lead, 11) + gap + size + markGap + wordmark)) / 2);
|
|
1809
|
+
const linkX = start + textWidth(lead, 11) + gap;
|
|
1810
|
+
return label({ x: props.x, y: props.y, width: props.width, height: 20 }, text(props.theme, lead, 0, 0, linkX - gap, { size: 11, textColor: palette.textMuted, align: "right", height: 20 }), label({
|
|
1811
|
+
x: linkX,
|
|
1812
|
+
y: 0,
|
|
1813
|
+
width: size + markGap + wordmark,
|
|
1814
|
+
height: 20,
|
|
1815
|
+
interceptsMouseClicks: true,
|
|
1816
|
+
mouseCursorType: "pointing hand",
|
|
1817
|
+
onMouseEnter: () => setHovered(true),
|
|
1818
|
+
onMouseExit: () => setHovered(false),
|
|
1819
|
+
onClick: props.onClick
|
|
1820
|
+
}, props.mark && label({ x: 0, y: (20 - size) / 2, width: size, height: size, backgroundImage: props.mark, alpha: hovered ? 1 : 0.85 }), text(props.theme, "moonbase", size + markGap, 0, wordmark, { size: 12, weight: 500, kerning: 0.06, textColor: hovered ? palette.textPrimary : palette.textBright, height: 20 })));
|
|
1821
|
+
}
|
|
1760
1822
|
function osLabel() {
|
|
1761
1823
|
switch (process2.platform) {
|
|
1762
1824
|
case "darwin":
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/gorilla-engine",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"description": "Moonbase.sh licensing for Gorilla Engine plugins, with a finished activation overlay",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react": ">=18"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@moonbase.sh/licensing": "3.5.
|
|
35
|
+
"@moonbase.sh/licensing": "3.5.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jsonwebtoken": "^9.0.9",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"vitest": "^2.1.4"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
-
"build": "tsup",
|
|
51
|
+
"build": "tsup && tsc -p tsconfig.dist.json",
|
|
52
52
|
"dev": "tsup --watch",
|
|
53
53
|
"type-check": "tsc --noEmit -p tsconfig.typecheck.json",
|
|
54
54
|
"lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --cache-strategy content",
|