@hasna/connectors 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/bin/index.js +38 -5
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -5232,7 +5232,9 @@ function ConnectorSelect({
|
|
|
5232
5232
|
return cursor - half;
|
|
5233
5233
|
}, [cursor, totalItems]);
|
|
5234
5234
|
useInput2((input, key) => {
|
|
5235
|
-
if (key.
|
|
5235
|
+
if (key.escape) {
|
|
5236
|
+
onBack();
|
|
5237
|
+
} else if (key.upArrow) {
|
|
5236
5238
|
setCursor((c) => c > 0 ? c - 1 : totalItems - 1);
|
|
5237
5239
|
} else if (key.downArrow) {
|
|
5238
5240
|
setCursor((c) => c < totalItems - 1 ? c + 1 : 0);
|
|
@@ -5247,6 +5249,19 @@ function ConnectorSelect({
|
|
|
5247
5249
|
}
|
|
5248
5250
|
} else if (input === " " && cursor > 0 && cursor < totalItems - 1) {
|
|
5249
5251
|
onToggle(connectors[cursor - 1].name);
|
|
5252
|
+
} else if (input === "i" && selected.size > 0) {
|
|
5253
|
+
onConfirm();
|
|
5254
|
+
} else if (input === "a") {
|
|
5255
|
+
const allSelected = connectors.every((c) => selected.has(c.name));
|
|
5256
|
+
for (const c of connectors) {
|
|
5257
|
+
if (allSelected) {
|
|
5258
|
+
if (selected.has(c.name))
|
|
5259
|
+
onToggle(c.name);
|
|
5260
|
+
} else {
|
|
5261
|
+
if (!selected.has(c.name))
|
|
5262
|
+
onToggle(c.name);
|
|
5263
|
+
}
|
|
5264
|
+
}
|
|
5250
5265
|
}
|
|
5251
5266
|
});
|
|
5252
5267
|
const visibleStart = scrollOffset;
|
|
@@ -5403,7 +5418,7 @@ function ConnectorSelect({
|
|
|
5403
5418
|
marginTop: 1,
|
|
5404
5419
|
children: /* @__PURE__ */ jsxDEV3(Text5, {
|
|
5405
5420
|
dimColor: true,
|
|
5406
|
-
children: "\u2191\u2193 navigate space toggle
|
|
5421
|
+
children: "\u2191\u2193 navigate space/enter toggle a select all i install esc back"
|
|
5407
5422
|
}, undefined, false, undefined, this)
|
|
5408
5423
|
}, undefined, false, undefined, this)
|
|
5409
5424
|
]
|
|
@@ -5583,6 +5598,19 @@ function SearchView({
|
|
|
5583
5598
|
if (connectorIdx < results.length) {
|
|
5584
5599
|
onToggle(results[connectorIdx].name);
|
|
5585
5600
|
}
|
|
5601
|
+
} else if (input === "i" && selected.size > 0) {
|
|
5602
|
+
onConfirm();
|
|
5603
|
+
} else if (input === "a" && mode === "select") {
|
|
5604
|
+
const allSelected = results.every((c) => selected.has(c.name));
|
|
5605
|
+
for (const c of results) {
|
|
5606
|
+
if (allSelected) {
|
|
5607
|
+
if (selected.has(c.name))
|
|
5608
|
+
onToggle(c.name);
|
|
5609
|
+
} else {
|
|
5610
|
+
if (!selected.has(c.name))
|
|
5611
|
+
onToggle(c.name);
|
|
5612
|
+
}
|
|
5613
|
+
}
|
|
5586
5614
|
}
|
|
5587
5615
|
});
|
|
5588
5616
|
const visibleStart = scrollOffset;
|
|
@@ -5778,7 +5806,7 @@ function SearchView({
|
|
|
5778
5806
|
marginTop: 1,
|
|
5779
5807
|
children: /* @__PURE__ */ jsxDEV4(Text7, {
|
|
5780
5808
|
dimColor: true,
|
|
5781
|
-
children: mode === "search" ? "type to search \u2193 select results esc back" : "\u2191\u2193 navigate space toggle
|
|
5809
|
+
children: mode === "search" ? "type to search \u2193 select results esc back" : "\u2191\u2193 navigate space/enter toggle a select all i install esc search"
|
|
5782
5810
|
}, undefined, false, undefined, this)
|
|
5783
5811
|
}, undefined, false, undefined, this)
|
|
5784
5812
|
]
|
|
@@ -5934,9 +5962,14 @@ function App({ initialConnectors, overwrite = false }) {
|
|
|
5934
5962
|
if (key.escape) {
|
|
5935
5963
|
if (view === "main") {
|
|
5936
5964
|
exit();
|
|
5965
|
+
} else if (view === "browse" || view === "search") {
|
|
5966
|
+
setView("main");
|
|
5967
|
+
} else if (view === "connectors") {
|
|
5968
|
+
setCategory(null);
|
|
5969
|
+
setView("browse");
|
|
5937
5970
|
}
|
|
5938
5971
|
}
|
|
5939
|
-
if (input === "q") {
|
|
5972
|
+
if (input === "q" && view !== "search") {
|
|
5940
5973
|
exit();
|
|
5941
5974
|
}
|
|
5942
5975
|
});
|
|
@@ -6125,7 +6158,7 @@ import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
|
6125
6158
|
loadConnectorVersions();
|
|
6126
6159
|
var isTTY = process.stdout.isTTY ?? false;
|
|
6127
6160
|
var program2 = new Command;
|
|
6128
|
-
program2.name("connectors").description("Install API connectors for your project").version("0.2.
|
|
6161
|
+
program2.name("connectors").description("Install API connectors for your project").version("0.2.1");
|
|
6129
6162
|
program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
|
|
6130
6163
|
if (!isTTY) {
|
|
6131
6164
|
console.log(`Non-interactive environment detected. Use a subcommand:
|