web


git clone https://radroots.dev/git/web.git
Log | Files | Refs | Submodules | README | LICENSE

commit 57894938ca09df2820645f33b204de232309f6aa
parent af6e43f93db2754206203843fb317510a809d4d0
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Tue,  4 Mar 2025 07:53:58 +0000

Add `@radroots/nostr-util`, edit app layouts and utils, update imports/packages.

Diffstat:
M.gitmodules | 3+++
Mapp/package.json | 3++-
Mapp/src/lib/util/conf.ts | 3++-
Mapp/src/lib/util/index.ts | 7++++---
Mapp/src/lib/util/nostr/nostr-sync.ts | 3++-
Mapp/src/routes/(app)/+layout.svelte | 4+++-
Mapp/src/routes/+layout.svelte | 7+++----
Mcrates/tauri/Cargo.toml | 2+-
Apackages/nostr-util | 1+
Mpnpm-lock.yaml | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
10 files changed, 84 insertions(+), 28 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -45,3 +45,6 @@ path = app/static/assets url = git@github.com:72-61-64-72-6f-6f-74-73/assets.git branch = app +[submodule "packages/nostr-util"] + path = packages/nostr-util + url = git@github.com:72-61-64-72-6f-6f-74-73/nostr-util.git diff --git a/app/package.json b/app/package.json @@ -35,7 +35,8 @@ "@radroots/geocoder": "workspace:*", "@radroots/lib-app": "workspace:*", "@radroots/models": "workspace:*", - "@radroots/svelte-maplibre": "workspace:*", + "@radroots/nostr-util": "workspace:*", + "svelte-maplibre": "workspace:*", "@radroots/theme": "workspace:*", "@radroots/util": "workspace:*", "chart.js": "^4.4.5", diff --git a/app/src/lib/util/conf.ts b/app/src/lib/util/conf.ts @@ -1,5 +1,6 @@ import { PUBLIC_RADROOTS_NOSTR_PUBKEY, PUBLIC_RADROOTS_RELAY_URL } from "$env/static/public"; -import { root_symbol, type NostrEventTagClient } from "@radroots/util"; +import type { NostrEventTagClient } from "@radroots/nostr-util"; +import { root_symbol } from "@radroots/util"; export const cfg_delay = { load: 321, diff --git a/app/src/lib/util/index.ts b/app/src/lib/util/index.ts @@ -4,8 +4,9 @@ import { ls } from "$lib/locale/i18n"; import { TauriClientDatabase, TauriClientDatastore, TauriClientFs, TauriClientGeolocation, TauriClientGui, TauriClientHttp, TauriClientKeys, TauriClientRadroots } from "@radroots/client"; import { Geocoder } from "@radroots/geocoder"; import { app_notify, get_store, handle_err } from "@radroots/lib-app"; -import { encode_qp_route, NostrEventUtil, NostrKeyUtil, type CallbackPromise, type NavigationParamTuple } from "@radroots/util"; +import { encode_qp_route, type CallbackPromise, type NavigationParamTuple } from "@radroots/util"; import type { NavigationRoute } from "./routes"; +import { NostrKeyService, NostrEventService } from "@radroots/nostr-util"; export const db = new TauriClientDatabase(); export const datastore = new TauriClientDatastore(); @@ -17,8 +18,8 @@ export const keys = new TauriClientKeys(); export const radroots = new TauriClientRadroots(PUBLIC_RADROOTS_URL); export const geoc = new Geocoder(); -export const nostrkey = new NostrKeyUtil(); -export const nostre = new NostrEventUtil(); +export const nostrkey = new NostrKeyService(); +export const nostre = new NostrEventService(); export const route = async (nav_route: NavigationRoute, params: NavigationParamTuple[] = []): Promise<void> => { try { diff --git a/app/src/lib/util/nostr/nostr-sync.ts b/app/src/lib/util/nostr/nostr-sync.ts @@ -4,8 +4,9 @@ import { cfg_nostr_client } from "$lib/util/conf"; import { NDKKind } from "@nostr-dev-kit/ndk"; import { get_store, handle_err, key_nostr, ndk, ndk_user, nostr_sync_prevent } from "@radroots/lib-app"; import type { NostrRelay } from "@radroots/models"; -import { ndk_event, ndk_event_metadata, num_str, throw_err } from "@radroots/util"; +import { num_str, throw_err } from "@radroots/util"; import { err } from "../err"; +import { ndk_event_metadata, ndk_event } from "@radroots/nostr-util"; export const nostr_sync_metadata = async (): Promise<void> => { try { diff --git a/app/src/routes/(app)/+layout.svelte b/app/src/routes/(app)/+layout.svelte @@ -9,7 +9,9 @@ ndk_user, nostr_ndk_configured, } from "@radroots/lib-app"; - import { ndk_init, throw_err } from "@radroots/util"; + import { ndk_init } from "@radroots/nostr-util"; + import { throw_err } from "@radroots/util"; + import { onMount } from "svelte"; import type { LayoutProps } from "./$types"; diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte @@ -7,9 +7,9 @@ app_notify, app_th, app_thc, - app_win, LayoutWindow, theme_set, + win_h, } from "@radroots/lib-app"; import { parse_color_mode, parse_theme_key } from "@radroots/theme"; import { cfg_app, sleep } from "@radroots/util"; @@ -27,9 +27,8 @@ theme_set(parse_theme_key(_app_th), parse_color_mode($app_thc)), ); - app_win.subscribe((_app_win) => { - // @todo android layout - if (_app_win.h > cfg_app.layout.ios1.h) app_lo.set(`ios1`); + win_h.subscribe((_win_h) => { + if (_win_h > cfg_app.layout.ios1.h) app_lo.set(`ios1`); else app_lo.set(`ios0`); }); diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml @@ -17,7 +17,7 @@ tauri-build = { version = "2.0.0", features = [] } tauri = { version = "2.2.0", features = ["protocol-asset"] } tauri-plugin-dialog = { version = "2.2.0" } tauri-plugin-fs = { version = "2.2.0" } -tauri-plugin-geolocation = { path = "../../../../../../lib/plugins-workspace/plugins/geolocation/" } +tauri-plugin-geolocation = { path = "../../../lib/plugins-workspace/plugins/geolocation" } tauri-plugin-http = { version = "2.2.0" } tauri-plugin-notification = { version = "2.2.0" } tauri-plugin-os = { version = "2.2.0" } diff --git a/packages/nostr-util b/packages/nostr-util @@ -0,0 +1 @@ +Subproject commit f38bd0309a2cfd062ecfdc986620f48b5ba8f351 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml @@ -38,9 +38,9 @@ importers: '@radroots/models': specifier: workspace:* version: link:../packages/models - '@radroots/svelte-maplibre': + '@radroots/nostr-util': specifier: workspace:* - version: link:../packages/svelte-maplibre + version: link:../packages/nostr-util '@radroots/theme': specifier: workspace:* version: link:../packages/theme @@ -53,6 +53,9 @@ importers: css-paint-polyfill: specifier: ^3.4.0 version: 3.4.0 + svelte-maplibre: + specifier: workspace:* + version: link:../packages/svelte-maplibre devDependencies: '@sveltejs/adapter-static': specifier: ^3.0.0 @@ -93,15 +96,12 @@ importers: packages/client: dependencies: - '@noble/hashes': - specifier: ^1.4.0 - version: 1.7.1 - '@nostr-dev-kit/ndk': - specifier: ^2.10.7 - version: 2.11.0(typescript@5.7.3) '@radroots/models': specifier: workspace:* version: link:../models + '@radroots/nostr-util': + specifier: workspace:* + version: link:../nostr-util '@radroots/util': specifier: workspace:* version: link:../util @@ -135,9 +135,6 @@ importers: '@tauri-apps/plugin-store': specifier: ^2.1.0 version: 2.2.0 - nostr-tools: - specifier: ^2.10.4 - version: 2.10.4(typescript@5.7.3) devDependencies: '@types/debug': specifier: ^4.1.12 @@ -203,9 +200,6 @@ importers: '@nostr-dev-kit/ndk-svelte': specifier: ^2.4.0 version: 2.4.0(svelte@5.19.9)(typescript@5.7.3) - '@radroots/svelte-maplibre': - specifier: workspace:* - version: link:../svelte-maplibre '@radroots/theme': specifier: workspace:* version: link:../theme @@ -221,6 +215,9 @@ importers: luxon: specifier: ^3.5.0 version: 3.5.0 + svelte-maplibre: + specifier: workspace:* + version: link:../svelte-maplibre sveltekit-search-params: specifier: ^3.0.0 version: 3.0.0(@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)))(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)))(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)) @@ -269,6 +266,37 @@ importers: specifier: ^5.3.3 version: 5.7.3 + packages/nostr-util: + dependencies: + '@noble/curves': + specifier: ^1.6.0 + version: 1.8.1 + '@noble/hashes': + specifier: ^1.4.0 + version: 1.7.1 + '@nostr-dev-kit/ndk': + specifier: ^2.11.0 + version: 2.11.0(typescript@5.7.3) + nostr-geotags: + specifier: ^0.7.1 + version: 0.7.2 + nostr-tools: + specifier: ^2.10.4 + version: 2.10.4(typescript@5.7.3) + uuid: + specifier: ^10.0.0 + version: 10.0.0 + devDependencies: + '@types/uuid': + specifier: ^10.0.0 + version: 10.0.0 + tsup: + specifier: ^6.2.3 + version: 6.7.0(postcss@8.5.1)(typescript@5.7.3) + typescript: + specifier: ^5.3.3 + version: 5.7.3 + packages/svelte-maplibre: dependencies: d3-geo: @@ -463,6 +491,9 @@ importers: nostr-tools: specifier: ^2.10.4 version: 2.10.4(typescript@5.7.3) + sveltekit-i18n: + specifier: ^2.4.2 + version: 2.4.2(svelte@5.19.9) uuid: specifier: ^10.0.0 version: 10.0.0 @@ -1500,6 +1531,9 @@ packages: peerDependencies: svelte: '>=3.49.0' + '@sveltekit-i18n/parser-default@1.1.1': + resolution: {integrity: sha512-/gtzLlqm/sox7EoPKD56BxGZktK/syGc79EbJAPWY5KVitQD9SM0TP8yJCqDxTVPk7Lk0WJhrBGUE2Nn0f5M1w==} + '@sveltekit-i18n/parser-icu@1.0.8': resolution: {integrity: sha512-/LnvE1EJv+higIxB5cWIV+9neiOe+CfC7VKhpv9mnU35NcZO3yOhEZ8y6F8nHHkMYIABLcqr15yk4hSvmRGWDw==} @@ -3513,6 +3547,11 @@ packages: resolution: {integrity: sha512-860s752/ZZxHIsii31ELkdKBOCeAuDsfb/AGUXJyQyzUVLRSt4oqEw/BV5+2+mNg8mbqmD3OK+vMvwWMPM6f8A==} engines: {node: '>=18'} + sveltekit-i18n@2.4.2: + resolution: {integrity: sha512-hjRWn4V4DBL8JQKJoJa3MRvn6d32Zo+rWkoSP5bsQ/XIAguPdQUZJ8LMe6Nc1rST8WEVdu9+vZI3aFdKYGR3+Q==} + peerDependencies: + svelte: '>=3.49.0' + sveltekit-search-params@3.0.0: resolution: {integrity: sha512-wq1Yo5zITev8ty9CWGmHgvAh+Xb3mCUewyUmvCdv6MJWi+/aZ4o79Y6SjuduDL0Cfd/KYHkqt4f/wQ4FtokSdw==} peerDependencies: @@ -4771,12 +4810,12 @@ snapshots: '@scure/bip32@1.3.1': dependencies: '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.2 '@scure/base': 1.1.1 '@scure/bip39@1.2.1': dependencies: - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.2 '@scure/base': 1.1.1 '@skeletonlabs/skeleton@2.11.0(svelte@5.19.9)': @@ -4923,6 +4962,8 @@ snapshots: dependencies: svelte: 5.19.9 + '@sveltekit-i18n/parser-default@1.1.1': {} + '@sveltekit-i18n/parser-icu@1.0.8': dependencies: intl-messageformat: 10.7.15 @@ -6937,6 +6978,12 @@ snapshots: magic-string: 0.30.17 zimmerframe: 1.1.2 + sveltekit-i18n@2.4.2(svelte@5.19.9): + dependencies: + '@sveltekit-i18n/base': 1.3.7(svelte@5.19.9) + '@sveltekit-i18n/parser-default': 1.1.1 + svelte: 5.19.9 + sveltekit-search-params@3.0.0(@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)))(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)))(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)): dependencies: '@sveltejs/kit': 2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0)))(svelte@5.19.9)(vite@6.1.0(@types/node@22.13.1)(jiti@1.21.7)(yaml@2.7.0))