Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d42360549 | ||
|
|
70c5143445 | ||
|
|
41b66b18f5 | ||
|
|
dda0720ed4 |
+16
-16
@@ -9,8 +9,8 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lume/system": "workspace:^",
|
||||
"@lume/icons": "workspace:^",
|
||||
"@lume/system": "workspace:^",
|
||||
"@lume/ui": "workspace:^",
|
||||
"@lume/utils": "workspace:^",
|
||||
"@radix-ui/react-avatar": "^1.0.4",
|
||||
@@ -22,42 +22,42 @@
|
||||
"@radix-ui/react-popover": "^1.0.7",
|
||||
"@radix-ui/react-switch": "^1.0.3",
|
||||
"@radix-ui/react-tooltip": "^1.0.7",
|
||||
"@tanstack/query-sync-storage-persister": "^5.36.0",
|
||||
"@tanstack/react-query": "^5.36.0",
|
||||
"@tanstack/react-query-persist-client": "^5.36.0",
|
||||
"@tanstack/react-router": "1.32.5",
|
||||
"i18next": "^23.11.4",
|
||||
"@tanstack/query-sync-storage-persister": "^5.40.0",
|
||||
"@tanstack/react-query": "^5.40.0",
|
||||
"@tanstack/react-query-persist-client": "^5.40.0",
|
||||
"@tanstack/react-router": "^1.34.5",
|
||||
"i18next": "^23.11.5",
|
||||
"i18next-resources-to-backend": "^1.2.1",
|
||||
"minidenticons": "^4.2.1",
|
||||
"nanoid": "^5.0.7",
|
||||
"nostr-tools": "^2.5.2",
|
||||
"nostr-tools": "^2.6.0",
|
||||
"react": "^18.3.1",
|
||||
"react-currency-input-field": "^3.8.0",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-hook-form": "^7.51.4",
|
||||
"react-hook-form": "^7.51.5",
|
||||
"react-hotkeys-hook": "^4.5.0",
|
||||
"react-i18next": "^14.1.1",
|
||||
"react-i18next": "^14.1.2",
|
||||
"react-string-replace": "^1.1.1",
|
||||
"slate": "^0.103.0",
|
||||
"slate-react": "^0.102.0",
|
||||
"slate-react": "^0.104.0",
|
||||
"sonner": "^1.4.41",
|
||||
"use-debounce": "^10.0.0",
|
||||
"use-debounce": "^10.0.1",
|
||||
"virtua": "^0.31.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lume/tailwindcss": "workspace:^",
|
||||
"@lume/tsconfig": "workspace:^",
|
||||
"@lume/types": "workspace:^",
|
||||
"@tanstack/router-devtools": "^1.32.5",
|
||||
"@tanstack/router-vite-plugin": "^1.32.2",
|
||||
"@types/react": "^18.3.2",
|
||||
"@tanstack/router-devtools": "^1.34.5",
|
||||
"@tanstack/router-vite-plugin": "^1.34.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react-swc": "^3.6.0",
|
||||
"@vitejs/plugin-react-swc": "^3.7.0",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"postcss": "^8.4.38",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.2.11",
|
||||
"vite": "^5.2.12",
|
||||
"vite-plugin-top-level-await": "^1.4.1",
|
||||
"vite-tsconfig-paths": "^4.3.2"
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 171 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 201 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
+2
-3
@@ -9,7 +9,7 @@ import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export const Route = createFileRoute("/auth/new/$account/backup")({
|
||||
export const Route = createFileRoute("/auth/$account/backup")({
|
||||
component: Screen,
|
||||
});
|
||||
|
||||
@@ -33,8 +33,7 @@ function Screen() {
|
||||
}
|
||||
|
||||
return navigate({
|
||||
to: "/auth/$account/settings",
|
||||
params: { account },
|
||||
to: "/auth/settings",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function Screen() {
|
||||
|
||||
if (eventId) {
|
||||
navigate({
|
||||
to: "/auth/new/$account/backup",
|
||||
to: "/auth/$account/backup",
|
||||
params: { account: account.npub },
|
||||
replace: true,
|
||||
});
|
||||
|
||||
@@ -28,8 +28,7 @@ function Screen() {
|
||||
|
||||
if (npub) {
|
||||
navigate({
|
||||
to: "/auth/$account/settings",
|
||||
params: { account: npub },
|
||||
to: "/auth/settings",
|
||||
replace: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ function Screen() {
|
||||
|
||||
if (npub) {
|
||||
navigate({
|
||||
to: "/auth/$account/settings",
|
||||
params: { account: npub },
|
||||
to: "/auth/settings",
|
||||
replace: true,
|
||||
});
|
||||
}
|
||||
|
||||
+4
-5
@@ -8,7 +8,7 @@ import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export const Route = createFileRoute("/auth/$account/settings")({
|
||||
export const Route = createFileRoute("/auth/settings")({
|
||||
beforeLoad: async () => {
|
||||
const settings = await NostrQuery.getSettings();
|
||||
return { settings };
|
||||
@@ -18,14 +18,14 @@ export const Route = createFileRoute("/auth/$account/settings")({
|
||||
});
|
||||
|
||||
function Screen() {
|
||||
const navigate = Route.useNavigate();
|
||||
const { account } = Route.useParams();
|
||||
const { settings } = Route.useRouteContext();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [newSettings, setNewSettings] = useState(settings);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const navigate = Route.useNavigate();
|
||||
|
||||
const toggleNofitication = async () => {
|
||||
await requestPermission();
|
||||
setNewSettings((prev) => ({
|
||||
@@ -72,8 +72,7 @@ function Screen() {
|
||||
|
||||
if (eventId) {
|
||||
return navigate({
|
||||
to: "/$account/home",
|
||||
params: { account },
|
||||
to: "/",
|
||||
replace: true,
|
||||
});
|
||||
}
|
||||
@@ -34,6 +34,8 @@ function Screen() {
|
||||
className="h-auto w-full aspect-square rounded-lg shadow-md transform"
|
||||
controls
|
||||
muted
|
||||
preload="none"
|
||||
poster="/poster_1.jpeg"
|
||||
>
|
||||
<source
|
||||
src="https://video.nostr.build/692f71e2be47ecfc29edcbdaa198cc5979bfb9c900f05d78682895dd546d8d4f.mp4"
|
||||
@@ -55,6 +57,8 @@ function Screen() {
|
||||
className="h-auto w-full aspect-square rounded-lg shadow-md transform"
|
||||
controls
|
||||
muted
|
||||
preload="none"
|
||||
poster="/poster_2.jpeg"
|
||||
>
|
||||
<source
|
||||
src="https://video.nostr.build/d33962520506d86acfb4b55a7b265821e10ae637f5ec830a173b7e6092b16ec8.mp4"
|
||||
@@ -76,6 +80,8 @@ function Screen() {
|
||||
className="h-auto w-full aspect-square rounded-lg shadow-md transform"
|
||||
controls
|
||||
muted
|
||||
preload="none"
|
||||
poster="/poster_3.jpeg"
|
||||
>
|
||||
<source
|
||||
src="https://video.nostr.build/927abbfde2097e470ac751181b1db456b7e4b9149550408efff1a966a7ffb9a8.mp4"
|
||||
@@ -97,6 +103,8 @@ function Screen() {
|
||||
className="h-auto w-full rounded-lg shadow-md transform"
|
||||
controls
|
||||
muted
|
||||
preload="none"
|
||||
poster="/poster_4.jpeg"
|
||||
>
|
||||
<source
|
||||
src="https://video.nostr.build/513de4824b6abaf7e9698c1dad2f68096574356848c0c200bc8cb8074df29410.mp4"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"@astrojs/check": "^0.5.10",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@fontsource/alice": "^5.0.13",
|
||||
"astro": "^4.8.3",
|
||||
"astro": "^4.9.2",
|
||||
"astro-seo-meta": "^4.1.1",
|
||||
"astro-seo-schema": "^4.0.2",
|
||||
"schema-dts": "^1.1.2",
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.0.0-beta.7",
|
||||
"@tauri-apps/api": "2.0.0-beta.13",
|
||||
"@tauri-apps/plugin-autostart": "2.0.0-beta.3",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.1",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-beta.3",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lume/tsconfig": "workspace:*",
|
||||
"@types/react": "^18.3.2",
|
||||
"@types/react": "^18.3.3",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
"main": "./src/index.ts",
|
||||
"dependencies": {
|
||||
"@lume/utils": "workspace:^",
|
||||
"@tanstack/react-query": "^5.36.0",
|
||||
"@tanstack/react-query": "^5.40.0",
|
||||
"react": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lume/tsconfig": "workspace:^",
|
||||
"@lume/types": "workspace:^",
|
||||
"@types/react": "^18.3.2",
|
||||
"@types/react": "^18.3.3",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
|
||||
+61
-247
@@ -11,10 +11,7 @@ export const commands = {
|
||||
},
|
||||
async connectRelay(relay: string) : Promise<Result<boolean, null>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("connect_relay", { relay }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("connect_relay", { relay }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -22,10 +19,7 @@ export const commands = {
|
||||
},
|
||||
async removeRelay(relay: string) : Promise<Result<boolean, null>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("remove_relay", { relay }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("remove_relay", { relay }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -47,43 +41,25 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async saveAccount(
|
||||
nsec: string,
|
||||
password: string,
|
||||
): Promise<Result<string, string>> {
|
||||
async saveAccount(nsec: string, password: string) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("save_account", { nsec, password }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("save_account", { nsec, password }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getEncryptedKey(
|
||||
npub: string,
|
||||
password: string,
|
||||
): Promise<Result<string, string>> {
|
||||
async getEncryptedKey(npub: string, password: string) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_encrypted_key", { npub, password }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_encrypted_key", { npub, password }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async nostrConnect(
|
||||
npub: string,
|
||||
uri: string,
|
||||
): Promise<Result<string, string>> {
|
||||
async nostrConnect(npub: string, uri: string) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("nostr_connect", { npub, uri }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("nostr_connect", { npub, uri }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -91,38 +67,23 @@ export const commands = {
|
||||
},
|
||||
async loadAccount(npub: string) : Promise<Result<boolean, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("load_account", { npub }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("load_account", { npub }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async eventToBech32(
|
||||
id: string,
|
||||
relays: string[],
|
||||
): Promise<Result<string, null>> {
|
||||
async eventToBech32(id: string, relays: string[]) : Promise<Result<string, null>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("event_to_bech32", { id, relays }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("event_to_bech32", { id, relays }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async userToBech32(
|
||||
key: string,
|
||||
relays: string[],
|
||||
): Promise<Result<string, null>> {
|
||||
async userToBech32(key: string, relays: string[]) : Promise<Result<string, null>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("user_to_bech32", { key, relays }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("user_to_bech32", { key, relays }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -136,29 +97,17 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async verifyNip05(
|
||||
key: string,
|
||||
nip05: string,
|
||||
): Promise<Result<boolean, string>> {
|
||||
async verifyNip05(key: string, nip05: string) : Promise<Result<boolean, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("verify_nip05", { key, nip05 }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("verify_nip05", { key, nip05 }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getActivities(
|
||||
account: string,
|
||||
kind: string,
|
||||
): Promise<Result<string[], string>> {
|
||||
async getActivities(account: string, kind: string) : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_activities", { account, kind }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_activities", { account, kind }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -166,10 +115,7 @@ export const commands = {
|
||||
},
|
||||
async getCurrentUserProfile() : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_current_user_profile"),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_current_user_profile") };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -193,53 +139,23 @@ export const commands = {
|
||||
},
|
||||
async setContactList(pubkeys: string[]) : Promise<Result<boolean, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("set_contact_list", { pubkeys }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("set_contact_list", { pubkeys }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async createProfile(
|
||||
name: string,
|
||||
displayName: string,
|
||||
about: string,
|
||||
picture: string,
|
||||
banner: string,
|
||||
nip05: string,
|
||||
lud16: string,
|
||||
website: string,
|
||||
): Promise<Result<string, string>> {
|
||||
async createProfile(name: string, displayName: string, about: string, picture: string, banner: string, nip05: string, lud16: string, website: string) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("create_profile", {
|
||||
name,
|
||||
displayName,
|
||||
about,
|
||||
picture,
|
||||
banner,
|
||||
nip05,
|
||||
lud16,
|
||||
website,
|
||||
}),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("create_profile", { name, displayName, about, picture, banner, nip05, lud16, website }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async follow(
|
||||
id: string,
|
||||
alias: string | null,
|
||||
): Promise<Result<string, string>> {
|
||||
async follow(id: string, alias: string | null) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("follow", { id, alias }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("follow", { id, alias }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -261,15 +177,9 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async setNstore(
|
||||
key: string,
|
||||
content: string,
|
||||
): Promise<Result<string, string>> {
|
||||
async setNstore(key: string, content: string) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("set_nstore", { key, content }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("set_nstore", { key, content }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -299,31 +209,17 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async zapProfile(
|
||||
id: string,
|
||||
amount: string,
|
||||
message: string,
|
||||
): Promise<Result<boolean, string>> {
|
||||
async zapProfile(id: string, amount: string, message: string) : Promise<Result<boolean, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("zap_profile", { id, amount, message }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("zap_profile", { id, amount, message }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async zapEvent(
|
||||
id: string,
|
||||
amount: string,
|
||||
message: string,
|
||||
): Promise<Result<boolean, string>> {
|
||||
async zapEvent(id: string, amount: string, message: string) : Promise<Result<boolean, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("zap_event", { id, amount, message }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("zap_event", { id, amount, message }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -331,10 +227,7 @@ export const commands = {
|
||||
},
|
||||
async friendToFriend(npub: string) : Promise<Result<boolean, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("friend_to_friend", { npub }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("friend_to_friend", { npub }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -356,70 +249,41 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getEventsBy(
|
||||
publicKey: string,
|
||||
asOf: string | null,
|
||||
): Promise<Result<string[], string>> {
|
||||
async getEventsBy(publicKey: string, asOf: string | null) : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_events_by", { publicKey, asOf }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_events_by", { publicKey, asOf }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getLocalEvents(
|
||||
pubkeys: string[],
|
||||
until: string | null,
|
||||
): Promise<Result<string[], string>> {
|
||||
async getLocalEvents(pubkeys: string[], until: string | null) : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_local_events", { pubkeys, until }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_local_events", { pubkeys, until }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getGlobalEvents(
|
||||
until: string | null,
|
||||
): Promise<Result<string[], string>> {
|
||||
async getGlobalEvents(until: string | null) : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_global_events", { until }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_global_events", { until }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getHashtagEvents(
|
||||
hashtags: string[],
|
||||
until: string | null,
|
||||
): Promise<Result<string[], string>> {
|
||||
async getHashtagEvents(hashtags: string[], until: string | null) : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("get_hashtag_events", { hashtags, until }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_hashtag_events", { hashtags, until }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async publish(
|
||||
content: string,
|
||||
tags: string[][],
|
||||
): Promise<Result<string, string>> {
|
||||
async publish(content: string, tags: string[][]) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("publish", { content, tags }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("publish", { content, tags }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -436,26 +300,9 @@ export const commands = {
|
||||
async showInFolder(path: string) : Promise<void> {
|
||||
await TAURI_INVOKE("show_in_folder", { path });
|
||||
},
|
||||
async createColumn(
|
||||
label: string,
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
url: string,
|
||||
): Promise<Result<string, string>> {
|
||||
async createColumn(label: string, x: number, y: number, width: number, height: number, url: string) : Promise<Result<string, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("create_column", {
|
||||
label,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
url,
|
||||
}),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("create_column", { label, x, y, width, height, url }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -463,63 +310,31 @@ export const commands = {
|
||||
},
|
||||
async closeColumn(label: string) : Promise<Result<boolean, null>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("close_column", { label }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("close_column", { label }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async repositionColumn(
|
||||
label: string,
|
||||
x: number,
|
||||
y: number,
|
||||
): Promise<Result<null, string>> {
|
||||
async repositionColumn(label: string, x: number, y: number) : Promise<Result<null, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("reposition_column", { label, x, y }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("reposition_column", { label, x, y }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async resizeColumn(
|
||||
label: string,
|
||||
width: number,
|
||||
height: number,
|
||||
): Promise<Result<null, string>> {
|
||||
async resizeColumn(label: string, width: number, height: number) : Promise<Result<null, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("resize_column", { label, width, height }),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("resize_column", { label, width, height }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async openWindow(
|
||||
label: string,
|
||||
title: string,
|
||||
url: string,
|
||||
width: number,
|
||||
height: number,
|
||||
): Promise<Result<null, string>> {
|
||||
async openWindow(label: string, title: string, url: string, width: number, height: number) : Promise<Result<null, string>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("open_window", {
|
||||
label,
|
||||
title,
|
||||
url,
|
||||
width,
|
||||
height,
|
||||
}),
|
||||
};
|
||||
return { status: "ok", data: await TAURI_INVOKE("open_window", { label, title, url, width, height }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
@@ -527,18 +342,15 @@ export const commands = {
|
||||
},
|
||||
async setBadge(count: number) : Promise<void> {
|
||||
await TAURI_INVOKE("set_badge", { count });
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** user-defined types **/
|
||||
|
||||
export type Account = { npub: string; nsec: string };
|
||||
export type Relays = {
|
||||
connected: string[];
|
||||
read: string[] | null;
|
||||
write: string[] | null;
|
||||
both: string[] | null;
|
||||
};
|
||||
export type Account = { npub: string; nsec: string }
|
||||
export type Relays = { connected: string[]; read: string[] | null; write: string[] | null; both: string[] | null }
|
||||
|
||||
/** tauri-specta globals **/
|
||||
|
||||
@@ -548,10 +360,10 @@ import { type WebviewWindow as __WebviewWindow__ } from "@tauri-apps/api/webview
|
||||
|
||||
type __EventObj__<T> = {
|
||||
listen: (
|
||||
cb: TAURI_API_EVENT.EventCallback<T>,
|
||||
cb: TAURI_API_EVENT.EventCallback<T>
|
||||
) => ReturnType<typeof TAURI_API_EVENT.listen<T>>;
|
||||
once: (
|
||||
cb: TAURI_API_EVENT.EventCallback<T>,
|
||||
cb: TAURI_API_EVENT.EventCallback<T>
|
||||
) => ReturnType<typeof TAURI_API_EVENT.once<T>>;
|
||||
emit: T extends null
|
||||
? (payload?: T) => ReturnType<typeof TAURI_API_EVENT.emit>
|
||||
@@ -563,7 +375,7 @@ export type Result<T, E> =
|
||||
| { status: "error"; error: E };
|
||||
|
||||
function __makeEvents__<T extends Record<string, any>>(
|
||||
mappings: Record<keyof T, string>,
|
||||
mappings: Record<keyof T, string>
|
||||
) {
|
||||
return new Proxy(
|
||||
{} as unknown as {
|
||||
@@ -593,6 +405,8 @@ function __makeEvents__<T extends Record<string, any>>(
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -236,31 +236,28 @@ export class NostrQuery {
|
||||
}
|
||||
|
||||
static async getColumns() {
|
||||
const systemPath = "resources/system_columns.json";
|
||||
const resourcePath = await resolveResource(systemPath);
|
||||
const resourceFile = await readTextFile(resourcePath);
|
||||
const systemColumns: LumeColumn[] = JSON.parse(resourceFile);
|
||||
const query = await commands.getNstore(NSTORE_KEYS.columns);
|
||||
|
||||
if (query.status === "ok") {
|
||||
const columns: LumeColumn[] = query.data ? JSON.parse(query.data) : [];
|
||||
|
||||
if (columns.length < 1) {
|
||||
const systemPath = "resources/system_columns.json";
|
||||
const resourcePath = await resolveResource(systemPath);
|
||||
const resourceFile = await readTextFile(resourcePath);
|
||||
const systemColumns: LumeColumn[] = JSON.parse(resourceFile);
|
||||
|
||||
return systemColumns;
|
||||
}
|
||||
|
||||
return columns;
|
||||
} else {
|
||||
return [];
|
||||
return systemColumns;
|
||||
}
|
||||
}
|
||||
|
||||
static async setColumns(columns: LumeColumn[]) {
|
||||
const query = await commands.setNstore(
|
||||
NSTORE_KEYS.columns,
|
||||
JSON.stringify(columns),
|
||||
);
|
||||
const content = JSON.stringify(columns);
|
||||
const query = await commands.setNstore(NSTORE_KEYS.columns, content);
|
||||
|
||||
if (query.status === "ok") {
|
||||
return query.data;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"@lume/tailwindcss": "workspace:^",
|
||||
"@lume/tsconfig": "workspace:^",
|
||||
"@lume/types": "workspace:^",
|
||||
"@types/react": "^18.3.2",
|
||||
"@types/react": "^18.3.3",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.36.0",
|
||||
"@tanstack/react-query": "^5.40.0",
|
||||
"bitcoin-units": "^1.0.0",
|
||||
"clsx": "^2.1.1",
|
||||
"dayjs": "^1.11.11",
|
||||
"light-bolt11-decoder": "^3.1.1",
|
||||
"nostr-tools": "^2.5.2",
|
||||
"nostr-tools": "^2.6.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"slate": "^0.103.0",
|
||||
"slate-react": "^0.102.0"
|
||||
"slate-react": "^0.104.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lume/tsconfig": "workspace:^",
|
||||
"@lume/types": "workspace:^",
|
||||
"@types/react": "^18.3.2",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"typescript": "^5.4.5"
|
||||
|
||||
Generated
+871
-851
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"productName": "Lume",
|
||||
"version": "4.0.6",
|
||||
"version": "4.0.7",
|
||||
"identifier": "nu.lume.Lume",
|
||||
"build": {
|
||||
"beforeBuildCommand": "pnpm desktop:build",
|
||||
|
||||
Reference in New Issue
Block a user