zion 2.2.0 → 2.3.0

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/cli.js +45 -44
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -161,7 +161,7 @@ function BlogDetailView({ post, scrollRef, viewportHeight, contentWidth }) {
161
161
  return /* @__PURE__ */ jsxs2(Fragment, { children: [
162
162
  /* @__PURE__ */ jsx3(Box2, { marginTop: 1, children: /* @__PURE__ */ jsx3(Text3, { bold: true, color: "white", children: post.title }) }),
163
163
  /* @__PURE__ */ jsx3(Box2, { marginTop: 1, height: viewportHeight, flexDirection: "column", children: /* @__PURE__ */ jsx3(ScrollView, { ref: scrollRef, children: /* @__PURE__ */ jsx3(Markdown, { width: contentWidth, children: post.content }) }) }),
164
- /* @__PURE__ */ jsx3(Box2, { marginTop: 1, children: /* @__PURE__ */ jsx3(HintBar, { text: "Hint: h/j/k: back, down, up | q: quit" }) })
164
+ /* @__PURE__ */ jsx3(Box2, { marginTop: 1, children: /* @__PURE__ */ jsx3(HintBar, { text: "Hint: h: back | j/k: down, up | q: quit" }) })
165
165
  ] });
166
166
  }
167
167
 
@@ -214,7 +214,7 @@ function BlogListView({ posts, highlightedIndex, scrollRef, viewportHeight }) {
214
214
  /* @__PURE__ */ jsx4(Text4, { bold: isSelected, color: isSelected ? COLORS.selectedBlog : COLORS.text, children: post.title })
215
215
  ] }, post.slug);
216
216
  }) }) }),
217
- /* @__PURE__ */ jsx4(Box3, { marginTop: 1, children: /* @__PURE__ */ jsx4(HintBar, { text: "Hint: h/j/k/l/enter: back, down, up, open | q: quit" }) })
217
+ /* @__PURE__ */ jsx4(Box3, { marginTop: 1, children: /* @__PURE__ */ jsx4(HintBar, { text: "Hint: h/l: home, portfolio | j/k: down, up | enter: open | q: quit" }) })
218
218
  ] });
219
219
  }
220
220
 
@@ -225,7 +225,7 @@ function HomeView({ aboutTitle, aboutContent, contentWidth }) {
225
225
  return /* @__PURE__ */ jsxs4(Fragment3, { children: [
226
226
  /* @__PURE__ */ jsx5(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx5(Text5, { bold: true, color: "white", children: aboutTitle }) }),
227
227
  /* @__PURE__ */ jsx5(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx5(Markdown, { width: contentWidth, children: aboutContent }) }),
228
- /* @__PURE__ */ jsx5(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx5(HintBar, { text: "Hint: b: blog | p: portfolio | q, ctrl+c: quit" }) })
228
+ /* @__PURE__ */ jsx5(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx5(HintBar, { text: "Hint: l: blog | q, ctrl+c: quit" }) })
229
229
  ] });
230
230
  }
231
231
 
@@ -236,7 +236,7 @@ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
236
236
  function NavBar() {
237
237
  return /* @__PURE__ */ jsx6(Box5, { flexDirection: "row", children: NAV_LINKS.map((link, idx) => /* @__PURE__ */ jsxs5(Box5, { flexDirection: "row", children: [
238
238
  idx > 0 && /* @__PURE__ */ jsx6(Text6, { color: COLORS.subtle, children: DOT_CHAR }),
239
- /* @__PURE__ */ jsx6(Box5, { marginRight: 2, children: link.name === "home" || link.name === "blog" ? /* @__PURE__ */ jsx6(Text6, { color: link.color, children: link.name }) : /* @__PURE__ */ jsx6(Text6, { color: link.color, children: terminalLink2(link.name, `${BASE_URL}${link.path}`) }) })
239
+ /* @__PURE__ */ jsx6(Box5, { marginRight: 2, children: link.name === "home" || link.name === "blog" ? /* @__PURE__ */ jsx6(Text6, { color: link.color, children: link.name }) : /* @__PURE__ */ jsx6(Text6, { color: link.color, children: terminalLink2(link.name, `${BASE_URL}${link.path}`, { fallback: () => link.name }) }) })
240
240
  ] }, link.name)) });
241
241
  }
242
242
 
@@ -284,7 +284,7 @@ function PortfolioListView({ projects, highlightedIndex, scrollRef, viewportHeig
284
284
  project.tools && project.tools.length > 0 && /* @__PURE__ */ jsx9(Box6, { marginLeft: 3, flexDirection: "row", gap: 1, paddingBottom: 1, children: project.tools.map((tool, toolIdx) => /* @__PURE__ */ jsx9(Box6, { children: /* @__PURE__ */ jsx9(Badge, { color: "white", background: "gray", children: tool }) }, toolIdx)) })
285
285
  ] }, idx);
286
286
  }) }) }),
287
- /* @__PURE__ */ jsx9(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx9(HintBar, { text: "Hint: h/j/k: back, down, up | q: quit" }) })
287
+ /* @__PURE__ */ jsx9(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx9(HintBar, { text: "Hint: h: blog | j/k: down, up | q: quit" }) })
288
288
  ] });
289
289
  }
290
290
 
@@ -488,7 +488,7 @@ function useListNavigation({ length, onSelect, isActive }) {
488
488
  if (key.downArrow || input === "j") {
489
489
  setHighlightedIndex((i) => Math.min(length - 1, i + 1));
490
490
  }
491
- if ((input === "l" || key.return) && onSelect) {
491
+ if (key.return && onSelect) {
492
492
  onSelect(highlightedIndex);
493
493
  }
494
494
  },
@@ -570,57 +570,58 @@ function App() {
570
570
  }
571
571
  if (currentView === "blogDetail" && errors.post) visibleErrors.push(errors.post);
572
572
  if (currentView === "portfolioList" && errors.portfolio) visibleErrors.push(errors.portfolio);
573
+ const openBlogList = () => {
574
+ setCurrentView("blogList");
575
+ blogList.reset();
576
+ if (blogPosts.length === 0) {
577
+ setLoading("posts");
578
+ loadBlogPostList().then((result) => {
579
+ setLoading(null);
580
+ if (result.ok) {
581
+ clearError("posts");
582
+ setBlogPosts(result.data);
583
+ } else {
584
+ addError("posts", result.error);
585
+ }
586
+ });
587
+ }
588
+ };
589
+ const openPortfolioList = () => {
590
+ setCurrentView("portfolioList");
591
+ portfolioList.reset();
592
+ if (portfolioProjects.length === 0) {
593
+ setLoading("portfolio");
594
+ loadPortfolioList().then((result) => {
595
+ setLoading(null);
596
+ if (result.ok) {
597
+ clearError("portfolio");
598
+ setPortfolioProjects(result.data);
599
+ } else {
600
+ addError("portfolio", result.error);
601
+ }
602
+ });
603
+ }
604
+ };
573
605
  useInput2((input, key) => {
574
606
  if (input === "q" || key.ctrl && input === "c") {
575
607
  exit();
576
608
  return;
577
609
  }
610
+ const left = input === "h" || key.leftArrow;
611
+ const right = input === "l" || key.rightArrow;
578
612
  switch (currentView) {
579
613
  case "home":
580
- if (input === "b") {
581
- setCurrentView("blogList");
582
- blogList.reset();
583
- if (blogPosts.length === 0) {
584
- setLoading("posts");
585
- loadBlogPostList().then((result) => {
586
- setLoading(null);
587
- if (result.ok) {
588
- clearError("posts");
589
- setBlogPosts(result.data);
590
- } else {
591
- addError("posts", result.error);
592
- }
593
- });
594
- }
595
- } else if (input === "p") {
596
- setCurrentView("portfolioList");
597
- portfolioList.reset();
598
- if (portfolioProjects.length === 0) {
599
- setLoading("portfolio");
600
- loadPortfolioList().then((result) => {
601
- setLoading(null);
602
- if (result.ok) {
603
- clearError("portfolio");
604
- setPortfolioProjects(result.data);
605
- } else {
606
- addError("portfolio", result.error);
607
- }
608
- });
609
- }
610
- }
614
+ if (right) openBlogList();
611
615
  break;
612
616
  case "blogList":
613
- if (input === "h") {
614
- setCurrentView("home");
615
- }
617
+ if (left) setCurrentView("home");
618
+ else if (right) openPortfolioList();
616
619
  break;
617
620
  case "portfolioList":
618
- if (input === "h") {
619
- setCurrentView("home");
620
- }
621
+ if (left) openBlogList();
621
622
  break;
622
623
  case "blogDetail":
623
- if (input === "h") {
624
+ if (left) {
624
625
  setCurrentView("blogList");
625
626
  setCurrentPost(null);
626
627
  } else if (input === "j" || key.downArrow) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zion",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",