giggles 0.3.13 → 0.3.15
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/README.md +9 -3
- package/dist/markdown/index.js +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
# giggles
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+

|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
giggles is a batteries-included react framework for building terminal apps. built on ink, it handles focus, input routing, screen navigation, and theming out of the box so you can skip the plumbing and build.
|
|
10
|
+
|
|
11
|
+
inspired by the [charmbracelet](https://github.com/charmbracelet) ecosystem, it comes with a rich set of UI components, hooks for focus and navigation management, and terminal utilities for things like running shell commands.
|
|
12
|
+
|
|
13
|
+
to get started, run
|
|
14
|
+
|
|
15
|
+
```bash
|
|
10
16
|
npx create-giggles-app
|
|
11
17
|
```
|
|
12
18
|
|
|
13
|
-
see [giggles.zzzzion.com](https://giggles.zzzzion.com) for
|
|
19
|
+
see [giggles.zzzzion.com](https://giggles.zzzzion.com) for API documentation and live demos.
|
package/dist/markdown/index.js
CHANGED
|
@@ -43,13 +43,24 @@ function TokenRenderer({ token }) {
|
|
|
43
43
|
] });
|
|
44
44
|
case "list":
|
|
45
45
|
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginY: 1, children: token.items.map((item, idx) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
46
|
-
/* @__PURE__ */ jsx(Text, { children: token.ordered ? `${idx + 1}. ` :
|
|
46
|
+
/* @__PURE__ */ jsx(Text, { children: token.ordered ? `${idx + 1}. ` : item.checked === true ? `${theme.checkedIndicator} ` : item.checked === false ? `${theme.uncheckedIndicator} ` : `${theme.indicator} ` }),
|
|
47
47
|
/* @__PURE__ */ jsx(Box, { flexDirection: "column", children: item.tokens.map((t, i) => /* @__PURE__ */ jsx(TokenRenderer, { token: t }, i)) })
|
|
48
48
|
] }, idx)) });
|
|
49
|
+
case "html": {
|
|
50
|
+
const stripped = token.text.replace(/<[^>]*>/g, "").trim();
|
|
51
|
+
return stripped ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: stripped }) : null;
|
|
52
|
+
}
|
|
49
53
|
case "table":
|
|
50
54
|
return /* @__PURE__ */ jsx(TableRenderer, { token });
|
|
51
55
|
case "hr":
|
|
52
56
|
return /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2500".repeat(40) });
|
|
57
|
+
case "text": {
|
|
58
|
+
const textToken = token;
|
|
59
|
+
if (textToken.tokens && textToken.tokens.length > 0) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Text, { children: renderInline(textToken.tokens, theme) });
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsx(Text, { children: textToken.text });
|
|
63
|
+
}
|
|
53
64
|
case "space":
|
|
54
65
|
return null;
|
|
55
66
|
default:
|
|
@@ -93,6 +104,12 @@ function renderInline(tokens, theme) {
|
|
|
93
104
|
token.text || token.href,
|
|
94
105
|
"]"
|
|
95
106
|
] }, idx);
|
|
107
|
+
case "escape":
|
|
108
|
+
return /* @__PURE__ */ jsx(Text, { children: token.text }, idx);
|
|
109
|
+
case "html": {
|
|
110
|
+
const stripped = token.text.replace(/<[^>]*>/g, "");
|
|
111
|
+
return stripped ? /* @__PURE__ */ jsx(Text, { children: stripped }, idx) : null;
|
|
112
|
+
}
|
|
96
113
|
case "br":
|
|
97
114
|
return /* @__PURE__ */ jsx(Text, { children: "\n" }, idx);
|
|
98
115
|
case "del":
|