zion 2.1.0 → 2.2.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 +37 -28
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/app.tsx
4
4
  import { useEffect as useEffect4, useRef as useRef2, useState as useState3 } from "react";
5
- import { Box as Box7, Text as Text10, useApp, useInput as useInput2, useStdout as useStdout2 } from "ink";
5
+ import { Box as Box7, Text as Text11, useApp, useInput as useInput2, useStdout as useStdout2 } from "ink";
6
6
 
7
7
  // src/components/BlogDetailView.tsx
8
8
  import { useEffect } from "react";
@@ -241,7 +241,7 @@ function NavBar() {
241
241
  }
242
242
 
243
243
  // src/components/PortfolioListView.tsx
244
- import { Box as Box6, Text as Text8 } from "ink";
244
+ import { Box as Box6, Text as Text9 } from "ink";
245
245
  import { ScrollView as ScrollView3 } from "ink-scroll-view";
246
246
 
247
247
  // src/components/ui/Badge.tsx
@@ -255,35 +255,44 @@ function Badge({ color, background, children }) {
255
255
  ] });
256
256
  }
257
257
 
258
+ // src/components/ui/Stars.tsx
259
+ import { Text as Text8 } from "ink";
260
+ import { jsx as jsx8 } from "react/jsx-runtime";
261
+ var formatter = new Intl.NumberFormat("en", { notation: "compact", maximumFractionDigits: 1 });
262
+ function Stars({ count }) {
263
+ return /* @__PURE__ */ jsx8(Text8, { color: COLORS.subtle, children: `\u2605 ${formatter.format(count).toLowerCase()}` });
264
+ }
265
+
258
266
  // src/components/PortfolioListView.tsx
259
- import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
267
+ import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
260
268
  function PortfolioListView({ projects, highlightedIndex, scrollRef, viewportHeight }) {
261
269
  return /* @__PURE__ */ jsxs7(Fragment5, { children: [
262
- /* @__PURE__ */ jsx8(Box6, { marginTop: 1, height: viewportHeight, flexDirection: "column", children: /* @__PURE__ */ jsx8(ScrollView3, { ref: scrollRef, children: projects.map((project, idx) => {
270
+ /* @__PURE__ */ jsx9(Box6, { marginTop: 1, height: viewportHeight, flexDirection: "column", children: /* @__PURE__ */ jsx9(ScrollView3, { ref: scrollRef, children: projects.map((project, idx) => {
263
271
  const isSelected = idx === highlightedIndex;
264
272
  const prefix = isSelected ? "\u203A " : " ";
265
273
  return /* @__PURE__ */ jsxs7(Box6, { flexDirection: "column", marginBottom: 2, children: [
266
274
  /* @__PURE__ */ jsxs7(Box6, { flexDirection: "row", children: [
267
- /* @__PURE__ */ jsx8(Text8, { bold: isSelected, color: isSelected ? COLORS.selectedBlog : void 0, children: prefix }),
268
- /* @__PURE__ */ jsx8(Text8, { bold: isSelected, color: isSelected ? COLORS.selectedBlog : COLORS.text, children: project.title })
275
+ /* @__PURE__ */ jsx9(Text9, { bold: isSelected, color: isSelected ? COLORS.selectedBlog : void 0, children: prefix }),
276
+ /* @__PURE__ */ jsx9(Text9, { bold: isSelected, color: isSelected ? COLORS.selectedBlog : COLORS.text, children: project.title }),
277
+ project.stars !== void 0 && /* @__PURE__ */ jsx9(Box6, { marginLeft: 2, children: /* @__PURE__ */ jsx9(Stars, { count: project.stars }) })
269
278
  ] }),
270
- /* @__PURE__ */ jsx8(Box6, { marginLeft: 3, paddingBottom: 1, children: /* @__PURE__ */ jsxs7(Text8, { color: COLORS.subtle, children: [
279
+ /* @__PURE__ */ jsx9(Box6, { marginLeft: 3, paddingBottom: 1, children: /* @__PURE__ */ jsxs7(Text9, { color: COLORS.subtle, children: [
271
280
  project.description,
272
281
  " "
273
282
  ] }) }),
274
- project.links && project.links.length > 0 && /* @__PURE__ */ jsx8(Box6, { marginLeft: 3, flexDirection: "column", paddingBottom: 1, children: project.links.map((link, linkIdx) => /* @__PURE__ */ jsx8(Text8, { color: COLORS.link, children: link.url }, linkIdx)) }),
275
- project.tools && project.tools.length > 0 && /* @__PURE__ */ jsx8(Box6, { marginLeft: 3, flexDirection: "row", gap: 1, paddingBottom: 1, children: project.tools.map((tool, toolIdx) => /* @__PURE__ */ jsx8(Box6, { children: /* @__PURE__ */ jsx8(Badge, { color: "white", background: "gray", children: tool }) }, toolIdx)) })
283
+ project.links && project.links.length > 0 && /* @__PURE__ */ jsx9(Box6, { marginLeft: 3, flexDirection: "column", paddingBottom: 1, children: project.links.map((link, linkIdx) => /* @__PURE__ */ jsx9(Text9, { color: COLORS.link, children: link.url }, linkIdx)) }),
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)) })
276
285
  ] }, idx);
277
286
  }) }) }),
278
- /* @__PURE__ */ jsx8(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx8(HintBar, { text: "Hint: h/j/k: back, down, up | q: quit" }) })
287
+ /* @__PURE__ */ jsx9(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx9(HintBar, { text: "Hint: h/j/k: back, down, up | q: quit" }) })
279
288
  ] });
280
289
  }
281
290
 
282
291
  // src/components/ui/AnimatedText.tsx
283
292
  import chalk from "chalk";
284
293
  import { useEffect as useEffect2, useState } from "react";
285
- import { Text as Text9 } from "ink";
286
- import { jsx as jsx9 } from "react/jsx-runtime";
294
+ import { Text as Text10 } from "ink";
295
+ import { jsx as jsx10 } from "react/jsx-runtime";
287
296
  function hexToRgb(hex) {
288
297
  const h = hex.replace("#", "");
289
298
  const n = h.length === 3 ? parseInt(h[0] + h[0] + h[1] + h[1] + h[2] + h[2], 16) : parseInt(h, 16);
@@ -439,7 +448,7 @@ function AnimatedText({
439
448
  if (underline) animated = chalk.underline(animated);
440
449
  if (strikethrough) animated = chalk.strikethrough(animated);
441
450
  if (dimColor) animated = chalk.dim(animated);
442
- return /* @__PURE__ */ jsx9(Text9, { children: animated });
451
+ return /* @__PURE__ */ jsx10(Text10, { children: animated });
443
452
  }
444
453
 
445
454
  // src/hooks/useListNavigation.ts
@@ -493,7 +502,7 @@ function useListNavigation({ length, onSelect, isActive }) {
493
502
  }
494
503
 
495
504
  // src/app.tsx
496
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
505
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
497
506
  function App() {
498
507
  const { exit } = useApp();
499
508
  const { stdout } = useStdout2();
@@ -622,12 +631,12 @@ function App() {
622
631
  break;
623
632
  }
624
633
  });
625
- return /* @__PURE__ */ jsx10(Box7, { width: columns, height: rows, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs8(Box7, { flexDirection: "column", width: contentWidth, children: [
626
- /* @__PURE__ */ jsx10(NavBar, {}),
627
- visibleErrors.length > 0 && /* @__PURE__ */ jsx10(Box7, { marginTop: 1, flexDirection: "column", children: visibleErrors.map((err, i) => /* @__PURE__ */ jsx10(Text10, { color: "red", children: err }, i)) }),
628
- loading && /* @__PURE__ */ jsx10(Box7, { paddingY: 2, children: /* @__PURE__ */ jsx10(AnimatedText, { name: "radar", speed: 0.6, children: "Loading" }) }),
629
- currentView === "home" && !loading && /* @__PURE__ */ jsx10(HomeView, { aboutTitle, aboutContent, contentWidth }),
630
- currentView === "blogList" && !loading && /* @__PURE__ */ jsx10(
634
+ return /* @__PURE__ */ jsx11(Box7, { width: columns, height: rows, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs8(Box7, { flexDirection: "column", width: contentWidth, children: [
635
+ /* @__PURE__ */ jsx11(NavBar, {}),
636
+ visibleErrors.length > 0 && /* @__PURE__ */ jsx11(Box7, { marginTop: 1, flexDirection: "column", children: visibleErrors.map((err, i) => /* @__PURE__ */ jsx11(Text11, { color: "red", children: err }, i)) }),
637
+ loading && /* @__PURE__ */ jsx11(Box7, { paddingY: 2, children: /* @__PURE__ */ jsx11(AnimatedText, { name: "radar", speed: 0.6, children: "Loading" }) }),
638
+ currentView === "home" && !loading && /* @__PURE__ */ jsx11(HomeView, { aboutTitle, aboutContent, contentWidth }),
639
+ currentView === "blogList" && !loading && /* @__PURE__ */ jsx11(
631
640
  BlogListView,
632
641
  {
633
642
  posts: blogPosts,
@@ -636,7 +645,7 @@ function App() {
636
645
  viewportHeight: blogListVPHeight
637
646
  }
638
647
  ),
639
- currentView === "blogDetail" && currentPost && /* @__PURE__ */ jsx10(
648
+ currentView === "blogDetail" && currentPost && /* @__PURE__ */ jsx11(
640
649
  BlogDetailView,
641
650
  {
642
651
  post: currentPost,
@@ -645,7 +654,7 @@ function App() {
645
654
  contentWidth
646
655
  }
647
656
  ),
648
- currentView === "portfolioList" && !loading && /* @__PURE__ */ jsx10(
657
+ currentView === "portfolioList" && !loading && /* @__PURE__ */ jsx11(
649
658
  PortfolioListView,
650
659
  {
651
660
  projects: portfolioProjects,
@@ -663,7 +672,7 @@ import { render as inkRender } from "ink";
663
672
  // src/lib/Screen.tsx
664
673
  import { useCallback, useEffect as useEffect5, useState as useState4 } from "react";
665
674
  import { Box as Box8, useStdout as useStdout3 } from "ink";
666
- import { jsx as jsx11 } from "react/jsx-runtime";
675
+ import { jsx as jsx12 } from "react/jsx-runtime";
667
676
  function Screen({ children }) {
668
677
  const { stdout } = useStdout3();
669
678
  const getSize = useCallback(() => ({ height: stdout.rows, width: stdout.columns }), [stdout]);
@@ -675,17 +684,17 @@ function Screen({ children }) {
675
684
  stdout.off("resize", onResize);
676
685
  };
677
686
  }, [stdout, getSize]);
678
- return /* @__PURE__ */ jsx11(Box8, { height: size.height, width: size.width, children });
687
+ return /* @__PURE__ */ jsx12(Box8, { height: size.height, width: size.width, children });
679
688
  }
680
689
 
681
690
  // src/lib/render.tsx
682
- import { jsx as jsx12 } from "react/jsx-runtime";
691
+ import { jsx as jsx13 } from "react/jsx-runtime";
683
692
  var ENTER_ALT_BUFFER = "\x1B[?1049h";
684
693
  var EXIT_ALT_BUFFER = "\x1B[?1049l";
685
694
  var CLEAR_SCREEN = "\x1B[2J\x1B[H";
686
695
  function render(node, options) {
687
696
  process.stdout.write(ENTER_ALT_BUFFER + CLEAR_SCREEN);
688
- const element = /* @__PURE__ */ jsx12(Screen, { children: node });
697
+ const element = /* @__PURE__ */ jsx13(Screen, { children: node });
689
698
  const instance = inkRender(element, options);
690
699
  setImmediate(() => instance.rerender(element));
691
700
  const cleanup = () => process.stdout.write(EXIT_ALT_BUFFER);
@@ -706,5 +715,5 @@ function render(node, options) {
706
715
  }
707
716
 
708
717
  // src/cli.tsx
709
- import { jsx as jsx13 } from "react/jsx-runtime";
710
- render(/* @__PURE__ */ jsx13(App, {}));
718
+ import { jsx as jsx14 } from "react/jsx-runtime";
719
+ render(/* @__PURE__ */ jsx14(App, {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zion",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",