@algolia/wizard 0.3.0-rc.44.3 → 0.3.0-rc.47.9
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 +51 -26
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { render } from "ink";
|
|
5
5
|
|
|
6
6
|
// src/ui/App.tsx
|
|
7
|
-
import { Box as Box12, Text as Text12, useApp, useInput as useInput5, useWindowSize as
|
|
7
|
+
import { Box as Box12, Text as Text12, useApp, useInput as useInput5, useWindowSize as useWindowSize5 } from "ink";
|
|
8
8
|
|
|
9
9
|
// src/core/store.ts
|
|
10
10
|
import { create } from "zustand";
|
|
@@ -722,7 +722,7 @@ function PromptInput() {
|
|
|
722
722
|
// src/ui/Welcome.tsx
|
|
723
723
|
import { dirname as dirname2, join as join3 } from "node:path";
|
|
724
724
|
import { fileURLToPath } from "node:url";
|
|
725
|
-
import { Box as Box6, Spacer, Text as Text6, useInput as useInput3 } from "ink";
|
|
725
|
+
import { Box as Box6, Spacer, Text as Text6, useInput as useInput3, useWindowSize as useWindowSize3 } from "ink";
|
|
726
726
|
|
|
727
727
|
// src/ui/copy/welcome.ts
|
|
728
728
|
var sidebarItems = [
|
|
@@ -770,36 +770,61 @@ function SidebarItem({
|
|
|
770
770
|
function Welcome() {
|
|
771
771
|
const confirmStart = useWizard((s) => s.confirmStart);
|
|
772
772
|
const openLearnMore = useWizard((s) => s.openLearnMore);
|
|
773
|
+
const { rows } = useWindowSize3();
|
|
773
774
|
useInput3((input) => {
|
|
774
775
|
if (input === " ") confirmStart();
|
|
775
776
|
else if (input === "i") openLearnMore();
|
|
776
777
|
});
|
|
778
|
+
const scales = {
|
|
779
|
+
large: {
|
|
780
|
+
sidebar: { padding: { x: 4, y: 2 }, gap: 2 },
|
|
781
|
+
main: { padding: { x: 8, y: 4 } }
|
|
782
|
+
},
|
|
783
|
+
small: {
|
|
784
|
+
sidebar: { padding: { x: 2, y: 1 }, gap: 1 },
|
|
785
|
+
main: { padding: { x: 4, y: 2 } }
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
let layout = scales["large"];
|
|
789
|
+
if (rows < 30) {
|
|
790
|
+
layout = scales["small"];
|
|
791
|
+
}
|
|
777
792
|
return /* @__PURE__ */ jsxs5(Box6, { flexDirection: "row", justifyContent: "space-between", width: "100%", children: [
|
|
778
|
-
/* @__PURE__ */ jsx6(
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
793
|
+
/* @__PURE__ */ jsx6(
|
|
794
|
+
Box6,
|
|
795
|
+
{
|
|
796
|
+
paddingY: layout.main.padding.y,
|
|
797
|
+
paddingX: layout.main.padding.x,
|
|
798
|
+
flexDirection: "column",
|
|
799
|
+
justifyContent: "center",
|
|
800
|
+
children: /* @__PURE__ */ jsxs5(Box6, { flexDirection: "column", gap: 2, children: [
|
|
801
|
+
/* @__PURE__ */ jsx6(InkPictureProvider, { children: /* @__PURE__ */ jsx6(
|
|
802
|
+
Image,
|
|
803
|
+
{
|
|
804
|
+
src: IMAGE_PATH,
|
|
805
|
+
objectFit: "contain",
|
|
806
|
+
alt: "Algolia",
|
|
807
|
+
width: 20,
|
|
808
|
+
height: 10,
|
|
809
|
+
protocol: "halfBlock"
|
|
810
|
+
}
|
|
811
|
+
) }),
|
|
812
|
+
/* @__PURE__ */ jsx6(Text6, { color: COLORS.muted, children: "\u2726 From zero \u2192 working search in ~10 minutes" }),
|
|
813
|
+
/* @__PURE__ */ jsxs5(Box6, { gap: 1, flexDirection: "column", children: [
|
|
814
|
+
/* @__PURE__ */ jsx6(NextAction, { action: "start wizard", keyHint: "space" }),
|
|
815
|
+
/* @__PURE__ */ jsx6(NextAction, { action: "learn more", keyHint: "i", hierarchy: "secondary" })
|
|
816
|
+
] })
|
|
817
|
+
] })
|
|
818
|
+
}
|
|
819
|
+
),
|
|
796
820
|
/* @__PURE__ */ jsxs5(
|
|
797
821
|
Box6,
|
|
798
822
|
{
|
|
799
823
|
backgroundColor: COLORS.bg.sidebar,
|
|
800
824
|
width: 40,
|
|
801
|
-
|
|
802
|
-
|
|
825
|
+
paddingY: layout.sidebar.padding.y,
|
|
826
|
+
paddingX: layout.sidebar.padding.x,
|
|
827
|
+
gap: layout.sidebar.gap,
|
|
803
828
|
flexDirection: "column",
|
|
804
829
|
justifyContent: "center",
|
|
805
830
|
children: [
|
|
@@ -813,7 +838,7 @@ function Welcome() {
|
|
|
813
838
|
|
|
814
839
|
// src/ui/LearnMore.tsx
|
|
815
840
|
import { Fragment as Fragment2 } from "react";
|
|
816
|
-
import { Box as Box7, Text as Text7, useInput as useInput4, useWindowSize as
|
|
841
|
+
import { Box as Box7, Text as Text7, useInput as useInput4, useWindowSize as useWindowSize4 } from "ink";
|
|
817
842
|
|
|
818
843
|
// src/ui/copy/learn-more.ts
|
|
819
844
|
var accessIntro = "Everything runs locally on your machine. Nothing is written or sent without an explicit yes from you.";
|
|
@@ -877,7 +902,7 @@ function NeverLine({
|
|
|
877
902
|
function LearnMore() {
|
|
878
903
|
const confirmStart = useWizard((s) => s.confirmStart);
|
|
879
904
|
const backToHome = useWizard((s) => s.backToHome);
|
|
880
|
-
const { columns } =
|
|
905
|
+
const { columns } = useWindowSize4();
|
|
881
906
|
const dividerWidth = Math.max(0, columns - PADDING_X * 2);
|
|
882
907
|
useInput4((input, key) => {
|
|
883
908
|
if (key.escape) backToHome();
|
|
@@ -1091,7 +1116,7 @@ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
|
1091
1116
|
function App() {
|
|
1092
1117
|
const { phase, error, homeScreen } = useWizard();
|
|
1093
1118
|
const { exit } = useApp();
|
|
1094
|
-
const { columns, rows } =
|
|
1119
|
+
const { columns, rows } = useWindowSize5();
|
|
1095
1120
|
const finished = phase === "done" || phase === "error";
|
|
1096
1121
|
useInput5(
|
|
1097
1122
|
(_input, key) => {
|
|
@@ -2437,7 +2462,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
2437
2462
|
// package.json
|
|
2438
2463
|
var package_default = {
|
|
2439
2464
|
name: "@algolia/wizard",
|
|
2440
|
-
version: "0.3.0-rc.
|
|
2465
|
+
version: "0.3.0-rc.47.9",
|
|
2441
2466
|
description: "Magically implement Algolia functionality in your codebase",
|
|
2442
2467
|
type: "module",
|
|
2443
2468
|
engines: {
|