andesine 0.4.0 → 0.6.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.
- package/CHANGELOG.md +36 -0
- package/README.md +66 -0
- package/dist/cli.js +2492 -49
- package/dist/cli.js.map +1 -1
- package/dist/templates/extension/.env.example +5 -0
- package/dist/templates/extension/LICENSE +21 -0
- package/dist/templates/extension/README.md +39 -0
- package/dist/templates/extension/andesine.config.ts +83 -0
- package/dist/templates/extension/andesine.keys.json +4 -0
- package/dist/templates/extension/gitignore +4 -0
- package/dist/templates/extension/package.template.json +27 -0
- package/dist/templates/extension/src/backend/server.ts +80 -0
- package/dist/templates/extension/src/frontend/count-words-action.tsx +46 -0
- package/dist/templates/extension/src/frontend/hello-panel.tsx +93 -0
- package/dist/templates/extension/src/frontend/index.tsx +6 -0
- package/dist/templates/extension/src/frontend/note-view.tsx +51 -0
- package/dist/templates/extension/src/frontend/shout-action.tsx +33 -0
- package/dist/templates/extension/src/frontend/wrap-in-note-action.tsx +52 -0
- package/dist/templates/extension/tsconfig.json +16 -0
- package/dist/templates/pages/package.template.json +3 -3
- package/dist/templates/pages/src/components/content/copy-button.tsx +1 -1
- package/dist/templates/pages/src/components/layout/call-to-action.tsx +2 -6
- package/dist/templates/pages/src/components/layout/footer.astro +1 -2
- package/dist/templates/pages/src/components/layout/header.astro +0 -3
- package/dist/templates/pages/src/components/layout/mobile-navigation.tsx +1 -1
- package/dist/templates/pages/src/components/layout/page-actions.tsx +1 -7
- package/dist/templates/pages/src/components/primitives/button.tsx +21 -37
- package/dist/templates/pages/src/components/search/search-palette.tsx +1 -3
- package/package.json +18 -7
|
@@ -53,9 +53,7 @@ const PageActions: Component<PageActionsProps> = (props) => {
|
|
|
53
53
|
return (
|
|
54
54
|
<div class="flex shrink-0 gap-1">
|
|
55
55
|
<Button
|
|
56
|
-
|
|
57
|
-
variant="outlined"
|
|
58
|
-
size="small"
|
|
56
|
+
variant="secondary"
|
|
59
57
|
text="base"
|
|
60
58
|
class="gap-1.5"
|
|
61
59
|
aria-label="Copy page as Markdown"
|
|
@@ -72,10 +70,6 @@ const PageActions: Component<PageActionsProps> = (props) => {
|
|
|
72
70
|
<IconButton
|
|
73
71
|
{...triggerProps()}
|
|
74
72
|
icon="i-lucide:chevron-down"
|
|
75
|
-
color="contrast"
|
|
76
|
-
variant="outlined"
|
|
77
|
-
size="small"
|
|
78
|
-
text="soft"
|
|
79
73
|
aria-label="More page actions"
|
|
80
74
|
/>
|
|
81
75
|
)}
|
|
@@ -3,9 +3,10 @@ import { type JSX, type ParentComponent, mergeProps, Show, splitProps } from "so
|
|
|
3
3
|
import { Dynamic } from "solid-js/web";
|
|
4
4
|
|
|
5
5
|
interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
|
|
6
|
+
/** Defaults to `primary` for buttons and `secondary` for icon buttons. */
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
8
|
size?: ButtonSize;
|
|
9
|
+
/** The gray level of `secondary` and `ghost` buttons; icon buttons default to `soft`. */
|
|
9
10
|
text?: ButtonText;
|
|
10
11
|
/** Renders an `<a>` element. */
|
|
11
12
|
link?: string;
|
|
@@ -20,8 +21,7 @@ interface IconButtonProps extends ButtonProps {
|
|
|
20
21
|
iconClass?: string;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
type
|
|
24
|
-
type ButtonVariant = "solid" | "text" | "outlined";
|
|
24
|
+
type ButtonVariant = "primary" | "secondary" | "ghost";
|
|
25
25
|
type ButtonSize = "xs" | "small" | "medium";
|
|
26
26
|
type ButtonText = "base" | "soft" | "softer";
|
|
27
27
|
|
|
@@ -30,15 +30,19 @@ const sizeClasses: Record<ButtonSize, string> = {
|
|
|
30
30
|
small: ":base: px-1.5 py-1 text-sm",
|
|
31
31
|
medium: ":base: px-2 py-1 text-base"
|
|
32
32
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
primary: ":base: bg-gradient-to-tr bg-[length:125%_auto] text-white outline-tertiary"
|
|
37
|
-
};
|
|
33
|
+
const outlinedClasses =
|
|
34
|
+
":base: outline outline-1 -outline-offset-1 shadow-md focus-visible:outline-1";
|
|
35
|
+
// Keyboard focus shows the hover style.
|
|
38
36
|
const variantClasses: Record<ButtonVariant, string> = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
primary: clsx(
|
|
38
|
+
outlinedClasses,
|
|
39
|
+
":base: bg-gradient-to-tr bg-[length:125%_auto] text-white outline-tertiary @hover:bg-right focus-visible:bg-right"
|
|
40
|
+
),
|
|
41
|
+
secondary: clsx(
|
|
42
|
+
outlinedClasses,
|
|
43
|
+
":base: bg-white outline-gray-200 shadow-gray-200 @hover:bg-gray-100 focus-visible:bg-gray-100"
|
|
44
|
+
),
|
|
45
|
+
ghost: ":base: bg-transparent focus:outline-none @hover:bg-gray-200 focus-visible:bg-gray-200"
|
|
42
46
|
};
|
|
43
47
|
const textClasses: Record<ButtonText, string> = {
|
|
44
48
|
base: ":base: text-gray-700",
|
|
@@ -51,28 +55,9 @@ const iconButtonSizes: Record<ButtonSize, Record<"button" | "icon" | "label", st
|
|
|
51
55
|
medium: { button: ":base-2: p-1", icon: ":base: h-6 w-6", label: ":base: pl-1" }
|
|
52
56
|
};
|
|
53
57
|
|
|
54
|
-
// Keyboard focus shows the hover style.
|
|
55
|
-
const getHoverClasses = (color: ButtonColor, variant: ButtonVariant): string => {
|
|
56
|
-
if (color === "primary") return ":base: @hover:bg-right focus-visible:bg-right";
|
|
57
|
-
if (color === "contrast") return ":base: @hover:bg-gray-100 focus-visible:bg-gray-100";
|
|
58
|
-
if (variant === "text") return ":base: @hover:bg-gray-200 focus-visible:bg-gray-200";
|
|
59
|
-
|
|
60
|
-
return ":base: @hover:(shadow-inner outline-gray-300) focus-visible:(shadow-inner outline-gray-300)";
|
|
61
|
-
};
|
|
62
58
|
const Button: ParentComponent<ButtonProps> = (providedProps) => {
|
|
63
|
-
const props = mergeProps(
|
|
64
|
-
|
|
65
|
-
providedProps
|
|
66
|
-
);
|
|
67
|
-
const [local, rest] = splitProps(props, [
|
|
68
|
-
"class",
|
|
69
|
-
"color",
|
|
70
|
-
"variant",
|
|
71
|
-
"size",
|
|
72
|
-
"text",
|
|
73
|
-
"link",
|
|
74
|
-
"badge"
|
|
75
|
-
]);
|
|
59
|
+
const props = mergeProps({ variant: "primary", size: "small" } as const, providedProps);
|
|
60
|
+
const [local, rest] = splitProps(props, ["class", "variant", "size", "text", "link", "badge"]);
|
|
76
61
|
const component = (): "a" | "div" | "button" => {
|
|
77
62
|
if (local.link) return "a";
|
|
78
63
|
if (local.badge) return "div";
|
|
@@ -91,20 +76,19 @@ const Button: ParentComponent<ButtonProps> = (providedProps) => {
|
|
|
91
76
|
!local.badge && ":base: cursor-pointer",
|
|
92
77
|
sizeClasses[local.size],
|
|
93
78
|
variantClasses[local.variant],
|
|
94
|
-
local.variant !== "
|
|
95
|
-
local.text && textClasses[local.text],
|
|
96
|
-
getHoverClasses(local.color, local.variant),
|
|
79
|
+
local.text && local.variant !== "primary" && textClasses[local.text],
|
|
97
80
|
local.class
|
|
98
81
|
)}
|
|
99
82
|
/>
|
|
100
83
|
);
|
|
101
84
|
};
|
|
102
85
|
const IconButton: ParentComponent<IconButtonProps> = (providedProps) => {
|
|
103
|
-
const props = mergeProps({ size: "
|
|
86
|
+
const props = mergeProps({ variant: "secondary", size: "small" } as const, providedProps);
|
|
104
87
|
const [local, rest] = splitProps(props, ["class", "icon", "label", "iconClass", "children"]);
|
|
88
|
+
const text = () => props.text ?? (props.variant === "primary" ? undefined : "soft");
|
|
105
89
|
|
|
106
90
|
return (
|
|
107
|
-
<Button {...rest} class={clsx(iconButtonSizes[props.size].button, local.class)}>
|
|
91
|
+
<Button {...rest} text={text()} class={clsx(iconButtonSizes[props.size].button, local.class)}>
|
|
108
92
|
<span
|
|
109
93
|
aria-hidden="true"
|
|
110
94
|
class={clsx("shrink-0", iconButtonSizes[props.size].icon, local.icon, local.iconClass)}
|
|
@@ -93,9 +93,7 @@ const SearchPalette: Component<SearchPaletteProps> = (props) => {
|
|
|
93
93
|
<Tooltip content="Close">
|
|
94
94
|
<IconButton
|
|
95
95
|
icon="i-lucide:x"
|
|
96
|
-
variant="
|
|
97
|
-
text="soft"
|
|
98
|
-
size="small"
|
|
96
|
+
variant="ghost"
|
|
99
97
|
aria-label="Close search"
|
|
100
98
|
onClick={() => palette.setOpen(false)}
|
|
101
99
|
/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "andesine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Command-line tools for Andesine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,22 +24,33 @@
|
|
|
24
24
|
"node": ">=22.12.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@babel/core": "^7.29.7",
|
|
27
28
|
"@clack/prompts": "1.7.0",
|
|
28
29
|
"@commander-js/extra-typings": "15.0.0",
|
|
30
|
+
"@iconify-json/lucide": "^1.2.140",
|
|
31
|
+
"@iconify-json/tabler": "^1.2.41",
|
|
32
|
+
"@iconify/utils": "^3.1.4",
|
|
33
|
+
"@orpc/zod": "^1.14.14",
|
|
34
|
+
"babel-preset-solid": "^1.9.12",
|
|
35
|
+
"base-x": "^5.0.1",
|
|
29
36
|
"commander": "15.0.0",
|
|
30
|
-
"zod": "4.5.4",
|
|
31
37
|
"open": "11.0.0",
|
|
32
38
|
"proper-lockfile": "4.1.2",
|
|
33
|
-
"
|
|
39
|
+
"rolldown": "^1.2.2",
|
|
40
|
+
"unocss": "^66.7.5",
|
|
41
|
+
"zod": "4.5.4",
|
|
42
|
+
"@andesine/sdk": "0.6.0"
|
|
34
43
|
},
|
|
35
44
|
"devDependencies": {
|
|
45
|
+
"@types/babel__core": "^7.20.5",
|
|
36
46
|
"@types/node": "^26.1.2",
|
|
37
|
-
"publint": "0.3.24",
|
|
38
|
-
"rolldown": "^1.2.2",
|
|
39
|
-
"typescript": "6.0.3",
|
|
40
47
|
"@types/proper-lockfile": "4.1.4",
|
|
48
|
+
"prettier": "^3.9.6",
|
|
49
|
+
"publint": "0.3.24",
|
|
41
50
|
"tsx": "^4.23.5",
|
|
42
|
-
"
|
|
51
|
+
"typescript": "6.0.3",
|
|
52
|
+
"@andesine/uno-preset": "0.0.0",
|
|
53
|
+
"@andesine/contracts": "0.0.0"
|
|
43
54
|
},
|
|
44
55
|
"repository": {
|
|
45
56
|
"type": "git",
|