@algolia/wizard 0.24.0-rc.117.212 → 0.24.0-rc.117.213

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.
Files changed (2) hide show
  1. package/dist/main.js +26 -15
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -567,9 +567,13 @@ function parseHex(hex) {
567
567
  b: parseInt(n.slice(4, 6), 16)
568
568
  };
569
569
  }
570
- function Notices() {
570
+ function Notices({
571
+ showAll = false,
572
+ border = true
573
+ } = {}) {
571
574
  const notices = useWizard((s) => s.notices);
572
575
  const latest = notices[notices.length - 1];
576
+ const visible = showAll ? notices : latest ? [latest] : [];
573
577
  const [pulseStep, setPulseStep] = useState2(0);
574
578
  useEffect2(() => {
575
579
  let direction = 1;
@@ -583,38 +587,39 @@ function Notices() {
583
587
  }, PULSE_STEP_MS);
584
588
  return () => clearInterval(id);
585
589
  }, []);
586
- if (!latest) return null;
590
+ if (visible.length === 0) return null;
587
591
  const pulseColor = PULSE_COLORS[pulseStep];
588
- return /* @__PURE__ */ jsxs2(
592
+ return /* @__PURE__ */ jsx2(
589
593
  Box3,
590
594
  {
591
- borderColor: COLORS.border,
592
- borderStyle: "single",
595
+ borderColor: border ? COLORS.border : void 0,
596
+ borderStyle: border ? "single" : void 0,
593
597
  borderBackgroundColor: COLORS.bg.main,
594
598
  borderLeft: false,
595
599
  borderRight: false,
596
600
  borderBottom: false,
597
- paddingTop: 1,
601
+ paddingTop: border ? 1 : 0,
598
602
  flexDirection: "column",
599
- children: [
600
- latest.messages?.map((m, j) => {
603
+ gap: 1,
604
+ children: visible.map((notice, i) => /* @__PURE__ */ jsxs2(Box3, { flexDirection: "column", children: [
605
+ notice.messages?.map((m, j) => {
601
606
  const line = typeof m === "string" ? { text: m } : m;
602
607
  const prefix = j === 0 ? `${AGENT_MARKER} ` : " ";
603
608
  return /* @__PURE__ */ jsxs2(
604
609
  Text3,
605
610
  {
606
- color: !line.color ? pulseColor : line.color ?? COLORS.dim,
611
+ color: !line.color ? notice === latest ? pulseColor : COLORS.dim : line.color ?? COLORS.dim,
607
612
  bold: line.bold,
608
613
  children: [
609
614
  prefix,
610
615
  line.text
611
616
  ]
612
617
  },
613
- `notice-${j}`
618
+ `notice-line-${j}`
614
619
  );
615
620
  }),
616
- latest.table && /* @__PURE__ */ jsx2(Table, { columns: latest.table.columns, rows: latest.table.rows })
617
- ]
621
+ notice.table && /* @__PURE__ */ jsx2(Table, { columns: notice.table.columns, rows: notice.table.rows })
622
+ ] }, `notice-${i}`))
618
623
  }
619
624
  );
620
625
  }
@@ -2047,6 +2052,11 @@ function App() {
2047
2052
  const [showLogs, setShowLogs] = useState8(false);
2048
2053
  const finished = phase === "done" || phase === "error";
2049
2054
  const currentStep = steps[currentStepIndex];
2055
+ const isInitialAnalysisStep = currentStepIndex === 0;
2056
+ const isAwaitingUserInput = phase === "awaitingInput" && !!inputReq;
2057
+ const showTips = phase === "running" && isInitialAnalysisStep && notices.length > 0;
2058
+ const showNoticesInMain = !isInitialAnalysisStep;
2059
+ const showNotices = !isAwaitingUserInput;
2050
2060
  useInput7(
2051
2061
  (_input, key) => {
2052
2062
  if (key.return) {
@@ -2119,14 +2129,15 @@ function App() {
2119
2129
  /* @__PURE__ */ jsx17(Text19, { color: COLORS.muted, children: "A browser window will open \u2014 complete sign-in there." })
2120
2130
  ] }),
2121
2131
  /* @__PURE__ */ jsx17(CliOutput, {}),
2122
- notices.length > 0 && phase === "running" && /* @__PURE__ */ jsx17(Tips, {}),
2132
+ showTips && /* @__PURE__ */ jsx17(Tips, {}),
2133
+ showNoticesInMain && showNotices && /* @__PURE__ */ jsx17(Notices, { showAll: true, border: false }),
2123
2134
  /* @__PURE__ */ jsx17(PromptInput, {}),
2124
2135
  phase === "error" && error && /* @__PURE__ */ jsx17(Box19, { marginTop: 1, children: /* @__PURE__ */ jsxs17(Text19, { color: COLORS.status.error, children: [
2125
2136
  "\u2716 ",
2126
2137
  error
2127
2138
  ] }) })
2128
2139
  ] }),
2129
- /* @__PURE__ */ jsx17(Notices, {})
2140
+ !showNoticesInMain && showNotices && /* @__PURE__ */ jsx17(Notices, {})
2130
2141
  ]
2131
2142
  }
2132
2143
  ),
@@ -3967,7 +3978,7 @@ async function runAnalysis(mode, extraInstructions = []) {
3967
3978
  // package.json
3968
3979
  var package_default = {
3969
3980
  name: "@algolia/wizard",
3970
- version: "0.24.0-rc.117.212",
3981
+ version: "0.24.0-rc.117.213",
3971
3982
  description: "Magically implement Algolia functionality in your codebase",
3972
3983
  type: "module",
3973
3984
  engines: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.24.0-rc.117.212",
3
+ "version": "0.24.0-rc.117.213",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {