andesine 0.5.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 +13 -0
- package/dist/cli.js +39 -80
- package/dist/cli.js.map +1 -1
- package/dist/templates/extension/README.md +11 -5
- package/dist/templates/extension/andesine.config.ts +21 -17
- package/dist/templates/extension/package.template.json +4 -4
- package/dist/templates/extension/src/backend/server.ts +0 -5
- package/dist/templates/extension/src/frontend/count-words-action.tsx +46 -0
- package/dist/templates/extension/src/frontend/hello-panel.tsx +35 -3
- package/dist/templates/extension/src/frontend/index.tsx +2 -2
- package/dist/templates/extension/src/frontend/note-view.tsx +1 -4
- package/dist/templates/extension/src/frontend/shout-action.tsx +18 -42
- package/dist/templates/extension/src/frontend/wrap-in-note-action.tsx +52 -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 +4 -4
- package/dist/templates/extension/src/frontend/about-section.tsx +0 -47
- package/dist/templates/extension/src/frontend/bookmarks-panel.tsx +0 -67
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",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"rolldown": "^1.2.2",
|
|
40
40
|
"unocss": "^66.7.5",
|
|
41
41
|
"zod": "4.5.4",
|
|
42
|
-
"@andesine/sdk": "0.
|
|
42
|
+
"@andesine/sdk": "0.6.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/babel__core": "^7.20.5",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"publint": "0.3.24",
|
|
50
50
|
"tsx": "^4.23.5",
|
|
51
51
|
"typescript": "6.0.3",
|
|
52
|
-
"@andesine/
|
|
53
|
-
"@andesine/
|
|
52
|
+
"@andesine/uno-preset": "0.0.0",
|
|
53
|
+
"@andesine/contracts": "0.0.0"
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Badge,
|
|
3
|
-
Button,
|
|
4
|
-
copyText,
|
|
5
|
-
downloadFile,
|
|
6
|
-
openURL,
|
|
7
|
-
Setting,
|
|
8
|
-
Stack,
|
|
9
|
-
storage,
|
|
10
|
-
usePermissions
|
|
11
|
-
} from "@andesine/extensions/solid";
|
|
12
|
-
import { For } from "solid-js";
|
|
13
|
-
|
|
14
|
-
/** A settings section: the granted permissions and the host actions. */
|
|
15
|
-
export const AboutSection = () => {
|
|
16
|
-
const permissions = usePermissions();
|
|
17
|
-
const exportStorage = async () => {
|
|
18
|
-
const { data } = await storage.list();
|
|
19
|
-
|
|
20
|
-
await downloadFile("hello-storage.json", JSON.stringify(data, null, 2), "application/json");
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Stack gap="small">
|
|
25
|
-
<Setting label="Permissions" description="What the extension can do for you">
|
|
26
|
-
<Stack direction="row" gap="small" wrap>
|
|
27
|
-
<For each={permissions()}>{(permission) => <Badge>{permission}</Badge>}</For>
|
|
28
|
-
</Stack>
|
|
29
|
-
</Setting>
|
|
30
|
-
<Setting label="Storage" description="Download the extension's stored data">
|
|
31
|
-
<Button variant="outlined" size="small" onClick={exportStorage}>
|
|
32
|
-
Download
|
|
33
|
-
</Button>
|
|
34
|
-
</Setting>
|
|
35
|
-
<Setting label="Share" description="Host actions need a click in the view">
|
|
36
|
-
<Stack direction="row" gap="small">
|
|
37
|
-
<Button variant="text" size="small" onClick={() => copyText("example/hello")}>
|
|
38
|
-
Copy name
|
|
39
|
-
</Button>
|
|
40
|
-
<Button variant="text" size="small" onClick={() => openURL("https://andesine.app/")}>
|
|
41
|
-
Open site
|
|
42
|
-
</Button>
|
|
43
|
-
</Stack>
|
|
44
|
-
</Setting>
|
|
45
|
-
</Stack>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button,
|
|
3
|
-
Icon,
|
|
4
|
-
IconButton,
|
|
5
|
-
Input,
|
|
6
|
-
Link,
|
|
7
|
-
List,
|
|
8
|
-
Stack,
|
|
9
|
-
storage,
|
|
10
|
-
Text,
|
|
11
|
-
TimeAgo
|
|
12
|
-
} from "@andesine/extensions/solid";
|
|
13
|
-
import { createResource, createSignal, For, Show } from "solid-js";
|
|
14
|
-
|
|
15
|
-
const KEY = "bookmarks";
|
|
16
|
-
|
|
17
|
-
/** The left panel: a workspace list kept in the extension storage, which its backend shares. */
|
|
18
|
-
export const BookmarksPanel = () => {
|
|
19
|
-
const [title, setTitle] = createSignal("");
|
|
20
|
-
const [entry, { mutate }] = createResource(() => {
|
|
21
|
-
return storage.get<string[]>(KEY).catch(() => null);
|
|
22
|
-
});
|
|
23
|
-
const bookmarks = () => entry()?.value ?? [];
|
|
24
|
-
const save = async (next: string[]) => {
|
|
25
|
-
const { updatedAt } = await storage.set(KEY, next);
|
|
26
|
-
|
|
27
|
-
mutate({ key: KEY, value: next, updatedAt });
|
|
28
|
-
};
|
|
29
|
-
const add = () => {
|
|
30
|
-
if (!title().trim()) return;
|
|
31
|
-
|
|
32
|
-
void save([...bookmarks(), title().trim()]);
|
|
33
|
-
setTitle("");
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Stack gap="small">
|
|
38
|
-
<Stack direction="row" gap="small" align="center">
|
|
39
|
-
<Icon name="i-lucide:bookmark" size="small" tone="muted" />
|
|
40
|
-
<Text weight="semibold">Bookmarks</Text>
|
|
41
|
-
</Stack>
|
|
42
|
-
<List
|
|
43
|
-
emptyLabel="No bookmarks yet"
|
|
44
|
-
onRemove={(index) => save(bookmarks().filter((_, item) => item !== index))}
|
|
45
|
-
>
|
|
46
|
-
<For each={bookmarks()}>{(bookmark) => <Text>{bookmark}</Text>}</For>
|
|
47
|
-
</List>
|
|
48
|
-
<Stack direction="row" gap="small">
|
|
49
|
-
<Input value={title()} placeholder="Title" onInput={setTitle} onEnter={add} />
|
|
50
|
-
<IconButton icon="i-lucide:plus" label="Add bookmark" onClick={add} />
|
|
51
|
-
</Stack>
|
|
52
|
-
<Show when={entry()}>
|
|
53
|
-
{(saved) => (
|
|
54
|
-
<Text size="xs" tone="muted">
|
|
55
|
-
Saved <TimeAgo date={saved().updatedAt} />
|
|
56
|
-
</Text>
|
|
57
|
-
)}
|
|
58
|
-
</Show>
|
|
59
|
-
<Stack direction="row" justify="between" align="center">
|
|
60
|
-
<Link href="https://andesine.app/">Andesine</Link>
|
|
61
|
-
<Button variant="text" size="small" onClick={() => save([])}>
|
|
62
|
-
Clear
|
|
63
|
-
</Button>
|
|
64
|
-
</Stack>
|
|
65
|
-
</Stack>
|
|
66
|
-
);
|
|
67
|
-
};
|