@algolia/wizard 0.41.0-rc.131.289 → 0.41.0-rc.131.290
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/main.js +26 -13
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import { render } from "ink";
|
|
|
5
5
|
|
|
6
6
|
// src/ui/App.tsx
|
|
7
7
|
import { Box as Box20, Text as Text20, useApp, useInput as useInput7, useWindowSize as useWindowSize7 } from "ink";
|
|
8
|
-
import
|
|
8
|
+
import Spinner3 from "ink-spinner";
|
|
9
9
|
|
|
10
10
|
// src/core/store.ts
|
|
11
11
|
import { create } from "zustand";
|
|
@@ -642,6 +642,7 @@ function Notices({
|
|
|
642
642
|
|
|
643
643
|
// src/ui/PromptInput.tsx
|
|
644
644
|
import { Box as Box9, Text as Text9 } from "ink";
|
|
645
|
+
import Spinner from "ink-spinner";
|
|
645
646
|
import TextInput from "ink-text-input";
|
|
646
647
|
import { useState as useState6 } from "react";
|
|
647
648
|
|
|
@@ -1058,11 +1059,23 @@ function EnterToContinuePrompt({
|
|
|
1058
1059
|
function PromptInput() {
|
|
1059
1060
|
const { phase, inputReq, submitInput } = useWizard();
|
|
1060
1061
|
const [draft, setDraft] = useState6("");
|
|
1062
|
+
const [submittedReq, setSubmittedReq] = useState6(null);
|
|
1061
1063
|
const promptKey = inputReq && `${inputReq.promptType}:${inputReq.prompt}`;
|
|
1064
|
+
const submitting = inputReq != null && submittedReq === inputReq;
|
|
1062
1065
|
if (phase === "done" || phase === "error") {
|
|
1063
1066
|
return /* @__PURE__ */ jsx7(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx7(Text9, { color: "gray", dimColor: true, children: "Press Enter or Esc to exit" }) });
|
|
1064
1067
|
}
|
|
1065
1068
|
if (phase !== "awaitingInput" || !inputReq) return null;
|
|
1069
|
+
if (submitting) {
|
|
1070
|
+
return /* @__PURE__ */ jsx7(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsxs8(Text9, { color: COLORS.strong, bold: true, children: [
|
|
1071
|
+
/* @__PURE__ */ jsx7(Spinner, { type: "dots" }),
|
|
1072
|
+
" Continuing\u2026"
|
|
1073
|
+
] }) });
|
|
1074
|
+
}
|
|
1075
|
+
const handleSubmit = (value) => {
|
|
1076
|
+
setSubmittedReq(inputReq);
|
|
1077
|
+
submitInput(value);
|
|
1078
|
+
};
|
|
1066
1079
|
if (inputReq.promptType === "multipleChoice") {
|
|
1067
1080
|
return /* @__PURE__ */ jsx7(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx7(
|
|
1068
1081
|
SelectPrompt,
|
|
@@ -1077,7 +1090,7 @@ function PromptInput() {
|
|
|
1077
1090
|
defaultSelectedIndex: inputReq.defaultSelectedIndex,
|
|
1078
1091
|
cancelable: inputReq.cancelable,
|
|
1079
1092
|
error: inputReq.error,
|
|
1080
|
-
onSelect:
|
|
1093
|
+
onSelect: handleSubmit
|
|
1081
1094
|
},
|
|
1082
1095
|
promptKey
|
|
1083
1096
|
) });
|
|
@@ -1093,7 +1106,7 @@ function PromptInput() {
|
|
|
1093
1106
|
table: inputReq.table,
|
|
1094
1107
|
options: inputReq.options,
|
|
1095
1108
|
error: inputReq.error,
|
|
1096
|
-
onSelect:
|
|
1109
|
+
onSelect: handleSubmit
|
|
1097
1110
|
},
|
|
1098
1111
|
promptKey
|
|
1099
1112
|
) });
|
|
@@ -1105,7 +1118,7 @@ function PromptInput() {
|
|
|
1105
1118
|
question: inputReq.prompt,
|
|
1106
1119
|
messages: inputReq.messages,
|
|
1107
1120
|
options: ["Continue"],
|
|
1108
|
-
onSelect:
|
|
1121
|
+
onSelect: handleSubmit
|
|
1109
1122
|
},
|
|
1110
1123
|
promptKey
|
|
1111
1124
|
) });
|
|
@@ -1132,7 +1145,7 @@ function PromptInput() {
|
|
|
1132
1145
|
messages: inputReq.messages,
|
|
1133
1146
|
options: labels,
|
|
1134
1147
|
secondary: inputReq.secondary,
|
|
1135
|
-
onSelect: (value) =>
|
|
1148
|
+
onSelect: (value) => handleSubmit(value === labels[0])
|
|
1136
1149
|
},
|
|
1137
1150
|
promptKey
|
|
1138
1151
|
) });
|
|
@@ -3535,7 +3548,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
3535
3548
|
// package.json
|
|
3536
3549
|
var package_default = {
|
|
3537
3550
|
name: "@algolia/wizard",
|
|
3538
|
-
version: "0.41.0-rc.131.
|
|
3551
|
+
version: "0.41.0-rc.131.290",
|
|
3539
3552
|
description: "Magically implement Algolia functionality in your codebase",
|
|
3540
3553
|
type: "module",
|
|
3541
3554
|
engines: {
|
|
@@ -5069,13 +5082,13 @@ import { Box as Box15, Text as Text15 } from "ink";
|
|
|
5069
5082
|
|
|
5070
5083
|
// src/ui/Steps.tsx
|
|
5071
5084
|
import { Box as Box13, Text as Text13 } from "ink";
|
|
5072
|
-
import
|
|
5085
|
+
import Spinner2 from "ink-spinner";
|
|
5073
5086
|
import { jsx as jsx11, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5074
5087
|
function Steps() {
|
|
5075
5088
|
const { steps } = useWizard();
|
|
5076
5089
|
const visibleSteps = steps.filter(isStepVisible);
|
|
5077
5090
|
return /* @__PURE__ */ jsx11(Box13, { flexDirection: "column", gap: 1, children: visibleSteps.map((s) => /* @__PURE__ */ jsx11(Box13, { flexDirection: "column", children: /* @__PURE__ */ jsxs12(Text13, { color: COLORS.status[s.status], children: [
|
|
5078
|
-
s.status === "running" ? /* @__PURE__ */ jsx11(
|
|
5091
|
+
s.status === "running" ? /* @__PURE__ */ jsx11(Spinner2, { type: "dots" }) : MARKER[s.status],
|
|
5079
5092
|
" ",
|
|
5080
5093
|
s.title
|
|
5081
5094
|
] }) }, s.id)) });
|
|
@@ -5085,7 +5098,7 @@ function CurrentStep() {
|
|
|
5085
5098
|
const currentStep = steps.filter(isStepVisible).find((s) => s.status === "running");
|
|
5086
5099
|
if (!currentStep) return null;
|
|
5087
5100
|
return /* @__PURE__ */ jsxs12(Text13, { color: COLORS.status.running, children: [
|
|
5088
|
-
/* @__PURE__ */ jsx11(
|
|
5101
|
+
/* @__PURE__ */ jsx11(Spinner2, { type: "dots" }),
|
|
5089
5102
|
" ",
|
|
5090
5103
|
` ${currentStep.title}`
|
|
5091
5104
|
] });
|
|
@@ -5717,22 +5730,22 @@ function App() {
|
|
|
5717
5730
|
children: [
|
|
5718
5731
|
/* @__PURE__ */ jsxs18(Box20, { flexGrow: 2, flexDirection: "column", children: [
|
|
5719
5732
|
phase === "preflight" && !user && /* @__PURE__ */ jsx18(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: COLORS.strong, bold: true, children: [
|
|
5720
|
-
/* @__PURE__ */ jsx18(
|
|
5733
|
+
/* @__PURE__ */ jsx18(Spinner3, { type: "dots" }),
|
|
5721
5734
|
" Signing in to Algolia"
|
|
5722
5735
|
] }) }),
|
|
5723
5736
|
phase === "preflight" && user && /* @__PURE__ */ jsx18(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: COLORS.strong, bold: true, children: [
|
|
5724
|
-
/* @__PURE__ */ jsx18(
|
|
5737
|
+
/* @__PURE__ */ jsx18(Spinner3, { type: "dots" }),
|
|
5725
5738
|
" Getting things ready"
|
|
5726
5739
|
] }) }),
|
|
5727
5740
|
phase === "authenticating" && /* @__PURE__ */ jsxs18(Box20, { flexDirection: "column", marginBottom: 1, children: [
|
|
5728
5741
|
/* @__PURE__ */ jsxs18(Text20, { color: COLORS.strong, bold: true, children: [
|
|
5729
|
-
/* @__PURE__ */ jsx18(
|
|
5742
|
+
/* @__PURE__ */ jsx18(Spinner3, { type: "dots" }),
|
|
5730
5743
|
" Signing in to Algolia"
|
|
5731
5744
|
] }),
|
|
5732
5745
|
/* @__PURE__ */ jsx18(Text20, { color: COLORS.muted, children: "A browser window will open \u2014 complete sign-in there." })
|
|
5733
5746
|
] }),
|
|
5734
5747
|
settingUpAppId && /* @__PURE__ */ jsx18(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: COLORS.strong, bold: true, children: [
|
|
5735
|
-
/* @__PURE__ */ jsx18(
|
|
5748
|
+
/* @__PURE__ */ jsx18(Spinner3, { type: "dots" }),
|
|
5736
5749
|
" Setting up Wizard using app",
|
|
5737
5750
|
" ",
|
|
5738
5751
|
settingUpAppId
|