web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit 00e8dd2e20a5a71689140e482b38153925854d94
parent 5747aeb1386dcab704de1ac576a490361dde7c0f
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Tue,  3 Dec 2024 11:21:33 +0000

apps-lib: edit components features, styles, basis types. add/edit locales, types, utils

Diffstat:
Mapps-lib/package.json | 4++--
Mapps-lib/src/lib/components/button_layout.svelte | 5+++--
Mapps-lib/src/lib/components/button_layout_pair.svelte | 14+++++++++-----
Mapps-lib/src/lib/components/nav.svelte | 4+++-
Mapps-lib/src/lib/components/nav_option.svelte | 6+++---
Mapps-lib/src/lib/el/css_static.svelte | 4++--
Mapps-lib/src/lib/locales/en/models.json | 252++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mapps-lib/src/lib/types/components.ts | 7+++----
Mapps-lib/src/lib/types/el.ts | 13+++++++++++--
Mapps-lib/src/lib/utils/routes.ts | 2++
10 files changed, 164 insertions(+), 147 deletions(-)

diff --git a/apps-lib/package.json b/apps-lib/package.json @@ -44,8 +44,8 @@ }, "dependencies": { "@nostr-dev-kit/ndk": "^2.10.6", - "@nostr-dev-kit/ndk-cache-dexie": "^2.5.1", - "@nostr-dev-kit/ndk-svelte": "^2.2.18", + "@nostr-dev-kit/ndk-cache-dexie": "^2.5.7", + "@nostr-dev-kit/ndk-svelte": "^2.3.1", "@radroots/theme": "workspace:*", "@sveltekit-i18n/base": "^1.3.7", "@sveltekit-i18n/parser-icu": "^1.0.8", diff --git a/apps-lib/src/lib/components/button_layout.svelte b/apps-lib/src/lib/components/button_layout.svelte @@ -5,14 +5,15 @@ parse_layer, type CallbackPromise, type IClOpt, + type IDisabledOpt, type ILyOpt, } from "$lib"; export let basis: ILyOpt & - IClOpt & { + IClOpt & + IDisabledOpt & { classes_inner?: string; hide_active?: boolean; - disabled?: boolean; label: string; callback: CallbackPromise; }; diff --git a/apps-lib/src/lib/components/button_layout_pair.svelte b/apps-lib/src/lib/components/button_layout_pair.svelte @@ -1,16 +1,20 @@ <script lang="ts"> - import { app_layout, Fill, t, type CallbackPromise } from "$lib"; + import { + app_layout, + Fill, + t, + type CallbackPromise, + type IDisabledOpt, + } from "$lib"; import ButtonLayout from "./button_layout.svelte"; export let basis: { - continue: { - disabled?: boolean; + continue: IDisabledOpt & { label?: string; callback: CallbackPromise; }; - back?: { + back?: IDisabledOpt & { visible: boolean; - disabled?: boolean; label?: string; callback: CallbackPromise; }; diff --git a/apps-lib/src/lib/components/nav.svelte b/apps-lib/src/lib/components/nav.svelte @@ -23,6 +23,8 @@ let nav_prev_label = ``; + $: classes_nav_blur = $nav_blur ? `bg-white/40 backdrop-blur-lg` : ``; + onMount(async () => { try { nav_visible.set(true); @@ -68,7 +70,7 @@ <div bind:this={el} - class={`z-10 absolute top-0 left-0 flex flex-col w-full justify-start items-start h-nav_${$app_layout} ${$nav_blur ? `bg-layer-0-surface-blur/30 backdrop-blur-md` : ``} duration-[250ms] el-re`} + class={`z-10 absolute top-0 left-0 flex flex-col w-full justify-start items-start h-nav_${$app_layout} ${classes_nav_blur} duration-[250ms] el-re`} > <div bind:this={el_inner} diff --git a/apps-lib/src/lib/components/nav_option.svelte b/apps-lib/src/lib/components/nav_option.svelte @@ -12,8 +12,8 @@ export let basis: INavBasisOption; $: basis = basis; - $: layer = parse_layer(1); + $: classes_disabled = basis.disabled ? `opacity-60` : ``; </script> {#if basis?.loading} @@ -22,9 +22,9 @@ </div> {:else} <button - class={`${fmt_cl(basis?.classes)} group col-span-4 flex flex-row h-full justify-end items-center`} + class={`${fmt_cl(basis?.classes)} group col-span-4 flex flex-row h-full justify-end items-center ${classes_disabled}`} on:click={async () => { - await basis?.callback(el_swap); + if (!basis.disabled) await basis?.callback(el_swap); }} > {#if `glyph` in basis && basis?.glyph} diff --git a/apps-lib/src/lib/el/css_static.svelte b/apps-lib/src/lib/el/css_static.svelte @@ -1 +1 @@ -<div class="hidden bg-layer-0-surface active:bg-layer-0-surface group-active:bg-layer-0-surface focus:bg-layer-0-surface group-focus:bg-layer-0-surface border-layer-0-surface active:border-layer-0-surface group-active:border-layer-0-surface focus:border-layer-0-surface group-focus:border-layer-0-surface bg-layer-0-surface_a active:bg-layer-0-surface_a group-active:bg-layer-0-surface_a focus:bg-layer-0-surface_a group-focus:bg-layer-0-surface_a border-layer-0-surface_a active:border-layer-0-surface_a group-active:border-layer-0-surface_a focus:border-layer-0-surface_a group-focus:border-layer-0-surface_a bg-layer-0-surface_w active:bg-layer-0-surface_w group-active:bg-layer-0-surface_w focus:bg-layer-0-surface_w group-focus:bg-layer-0-surface_w border-layer-0-surface_w active:border-layer-0-surface_w group-active:border-layer-0-surface_w focus:border-layer-0-surface_w group-focus:border-layer-0-surface_w bg-layer-0-surface-edge active:bg-layer-0-surface-edge group-active:bg-layer-0-surface-edge focus:bg-layer-0-surface-edge group-focus:bg-layer-0-surface-edge border-layer-0-surface-edge active:border-layer-0-surface-edge group-active:border-layer-0-surface-edge focus:border-layer-0-surface-edge group-focus:border-layer-0-surface-edge bg-layer-0-surface-blur active:bg-layer-0-surface-blur group-active:bg-layer-0-surface-blur focus:bg-layer-0-surface-blur group-focus:bg-layer-0-surface-blur border-layer-0-surface-blur active:border-layer-0-surface-blur group-active:border-layer-0-surface-blur focus:border-layer-0-surface-blur group-focus:border-layer-0-surface-blur bg-layer-1-surface active:bg-layer-1-surface group-active:bg-layer-1-surface focus:bg-layer-1-surface group-focus:bg-layer-1-surface border-layer-1-surface active:border-layer-1-surface group-active:border-layer-1-surface focus:border-layer-1-surface group-focus:border-layer-1-surface bg-layer-1-surface_a active:bg-layer-1-surface_a group-active:bg-layer-1-surface_a focus:bg-layer-1-surface_a group-focus:bg-layer-1-surface_a border-layer-1-surface_a active:border-layer-1-surface_a group-active:border-layer-1-surface_a focus:border-layer-1-surface_a group-focus:border-layer-1-surface_a bg-layer-1-surface-edge active:bg-layer-1-surface-edge group-active:bg-layer-1-surface-edge focus:bg-layer-1-surface-edge group-focus:bg-layer-1-surface-edge border-layer-1-surface-edge active:border-layer-1-surface-edge group-active:border-layer-1-surface-edge focus:border-layer-1-surface-edge group-focus:border-layer-1-surface-edge bg-layer-1-surface-err active:bg-layer-1-surface-err group-active:bg-layer-1-surface-err focus:bg-layer-1-surface-err group-focus:bg-layer-1-surface-err border-layer-1-surface-err active:border-layer-1-surface-err group-active:border-layer-1-surface-err focus:border-layer-1-surface-err group-focus:border-layer-1-surface-err bg-layer-1-surface-focus active:bg-layer-1-surface-focus group-active:bg-layer-1-surface-focus focus:bg-layer-1-surface-focus group-focus:bg-layer-1-surface-focus border-layer-1-surface-focus active:border-layer-1-surface-focus group-active:border-layer-1-surface-focus focus:border-layer-1-surface-focus group-focus:border-layer-1-surface-focus bg-layer-2-surface active:bg-layer-2-surface group-active:bg-layer-2-surface focus:bg-layer-2-surface group-focus:bg-layer-2-surface border-layer-2-surface active:border-layer-2-surface group-active:border-layer-2-surface focus:border-layer-2-surface group-focus:border-layer-2-surface bg-layer-2-surface_a active:bg-layer-2-surface_a group-active:bg-layer-2-surface_a focus:bg-layer-2-surface_a group-focus:bg-layer-2-surface_a border-layer-2-surface_a active:border-layer-2-surface_a group-active:border-layer-2-surface_a focus:border-layer-2-surface_a group-focus:border-layer-2-surface_a bg-layer-2-surface-edge active:bg-layer-2-surface-edge group-active:bg-layer-2-surface-edge focus:bg-layer-2-surface-edge group-focus:bg-layer-2-surface-edge border-layer-2-surface-edge active:border-layer-2-surface-edge group-active:border-layer-2-surface-edge focus:border-layer-2-surface-edge group-focus:border-layer-2-surface-edge text-layer-0-glyph active:text-layer-0-glyph group-active:text-layer-0-glyph focus:text-layer-0-glyph group-focus:text-layer-0-glyph text-layer-0-glyph_a active:text-layer-0-glyph_a group-active:text-layer-0-glyph_a focus:text-layer-0-glyph_a group-focus:text-layer-0-glyph_a text-layer-0-glyph-hl active:text-layer-0-glyph-hl group-active:text-layer-0-glyph-hl focus:text-layer-0-glyph-hl group-focus:text-layer-0-glyph-hl text-layer-0-glyph-hl_a active:text-layer-0-glyph-hl_a group-active:text-layer-0-glyph-hl_a focus:text-layer-0-glyph-hl_a group-focus:text-layer-0-glyph-hl_a text-layer-0-glyph-shade active:text-layer-0-glyph-shade group-active:text-layer-0-glyph-shade focus:text-layer-0-glyph-shade group-focus:text-layer-0-glyph-shade text-layer-0-glyph-label active:text-layer-0-glyph-label group-active:text-layer-0-glyph-label focus:text-layer-0-glyph-label group-focus:text-layer-0-glyph-label text-layer-1-glyph active:text-layer-1-glyph group-active:text-layer-1-glyph focus:text-layer-1-glyph group-focus:text-layer-1-glyph text-layer-1-glyph_a active:text-layer-1-glyph_a group-active:text-layer-1-glyph_a focus:text-layer-1-glyph_a group-focus:text-layer-1-glyph_a text-layer-1-glyph_d active:text-layer-1-glyph_d group-active:text-layer-1-glyph_d focus:text-layer-1-glyph_d group-focus:text-layer-1-glyph_d text-layer-1-glyph_pl active:text-layer-1-glyph_pl group-active:text-layer-1-glyph_pl focus:text-layer-1-glyph_pl group-focus:text-layer-1-glyph_pl text-layer-1-glyph-hl active:text-layer-1-glyph-hl group-active:text-layer-1-glyph-hl focus:text-layer-1-glyph-hl group-focus:text-layer-1-glyph-hl text-layer-1-glyph-hl_a active:text-layer-1-glyph-hl_a group-active:text-layer-1-glyph-hl_a focus:text-layer-1-glyph-hl_a group-focus:text-layer-1-glyph-hl_a text-layer-1-glyph-shade active:text-layer-1-glyph-shade group-active:text-layer-1-glyph-shade focus:text-layer-1-glyph-shade group-focus:text-layer-1-glyph-shade text-layer-1-glyph-label active:text-layer-1-glyph-label group-active:text-layer-1-glyph-label focus:text-layer-1-glyph-label group-focus:text-layer-1-glyph-label text-layer-2-glyph active:text-layer-2-glyph group-active:text-layer-2-glyph focus:text-layer-2-glyph group-focus:text-layer-2-glyph text-layer-2-glyph_a active:text-layer-2-glyph_a group-active:text-layer-2-glyph_a focus:text-layer-2-glyph_a group-focus:text-layer-2-glyph_a text-layer-2-glyph_d active:text-layer-2-glyph_d group-active:text-layer-2-glyph_d focus:text-layer-2-glyph_d group-focus:text-layer-2-glyph_d text-layer-2-glyph_pl active:text-layer-2-glyph_pl group-active:text-layer-2-glyph_pl focus:text-layer-2-glyph_pl group-focus:text-layer-2-glyph_pl text-layer-2-glyph-hl active:text-layer-2-glyph-hl group-active:text-layer-2-glyph-hl focus:text-layer-2-glyph-hl group-focus:text-layer-2-glyph-hl text-layer-2-glyph-hl_a active:text-layer-2-glyph-hl_a group-active:text-layer-2-glyph-hl_a focus:text-layer-2-glyph-hl_a group-focus:text-layer-2-glyph-hl_a text-layer-2-glyph-shade active:text-layer-2-glyph-shade group-active:text-layer-2-glyph-shade focus:text-layer-2-glyph-shade group-focus:text-layer-2-glyph-shade"></div> -\ No newline at end of file +<div class="hidden bg-layer-0-surface active:bg-layer-0-surface group-active:bg-layer-0-surface focus:bg-layer-0-surface group-focus:bg-layer-0-surface border-layer-0-surface active:border-layer-0-surface group-active:border-layer-0-surface focus:border-layer-0-surface group-focus:border-layer-0-surface bg-layer-0-surface_a active:bg-layer-0-surface_a group-active:bg-layer-0-surface_a focus:bg-layer-0-surface_a group-focus:bg-layer-0-surface_a border-layer-0-surface_a active:border-layer-0-surface_a group-active:border-layer-0-surface_a focus:border-layer-0-surface_a group-focus:border-layer-0-surface_a bg-layer-0-surface_w active:bg-layer-0-surface_w group-active:bg-layer-0-surface_w focus:bg-layer-0-surface_w group-focus:bg-layer-0-surface_w border-layer-0-surface_w active:border-layer-0-surface_w group-active:border-layer-0-surface_w focus:border-layer-0-surface_w group-focus:border-layer-0-surface_w bg-layer-0-surface-edge active:bg-layer-0-surface-edge group-active:bg-layer-0-surface-edge focus:bg-layer-0-surface-edge group-focus:bg-layer-0-surface-edge border-layer-0-surface-edge active:border-layer-0-surface-edge group-active:border-layer-0-surface-edge focus:border-layer-0-surface-edge group-focus:border-layer-0-surface-edge bg-layer-0-surface-blur active:bg-layer-0-surface-blur group-active:bg-layer-0-surface-blur focus:bg-layer-0-surface-blur group-focus:bg-layer-0-surface-blur border-layer-0-surface-blur active:border-layer-0-surface-blur group-active:border-layer-0-surface-blur focus:border-layer-0-surface-blur group-focus:border-layer-0-surface-blur bg-layer-1-surface active:bg-layer-1-surface group-active:bg-layer-1-surface focus:bg-layer-1-surface group-focus:bg-layer-1-surface border-layer-1-surface active:border-layer-1-surface group-active:border-layer-1-surface focus:border-layer-1-surface group-focus:border-layer-1-surface bg-layer-1-surface_a active:bg-layer-1-surface_a group-active:bg-layer-1-surface_a focus:bg-layer-1-surface_a group-focus:bg-layer-1-surface_a border-layer-1-surface_a active:border-layer-1-surface_a group-active:border-layer-1-surface_a focus:border-layer-1-surface_a group-focus:border-layer-1-surface_a bg-layer-1-surface-edge active:bg-layer-1-surface-edge group-active:bg-layer-1-surface-edge focus:bg-layer-1-surface-edge group-focus:bg-layer-1-surface-edge border-layer-1-surface-edge active:border-layer-1-surface-edge group-active:border-layer-1-surface-edge focus:border-layer-1-surface-edge group-focus:border-layer-1-surface-edge bg-layer-1-surface-err active:bg-layer-1-surface-err group-active:bg-layer-1-surface-err focus:bg-layer-1-surface-err group-focus:bg-layer-1-surface-err border-layer-1-surface-err active:border-layer-1-surface-err group-active:border-layer-1-surface-err focus:border-layer-1-surface-err group-focus:border-layer-1-surface-err bg-layer-1-surface-focus active:bg-layer-1-surface-focus group-active:bg-layer-1-surface-focus focus:bg-layer-1-surface-focus group-focus:bg-layer-1-surface-focus border-layer-1-surface-focus active:border-layer-1-surface-focus group-active:border-layer-1-surface-focus focus:border-layer-1-surface-focus group-focus:border-layer-1-surface-focus bg-layer-2-surface active:bg-layer-2-surface group-active:bg-layer-2-surface focus:bg-layer-2-surface group-focus:bg-layer-2-surface border-layer-2-surface active:border-layer-2-surface group-active:border-layer-2-surface focus:border-layer-2-surface group-focus:border-layer-2-surface bg-layer-2-surface_a active:bg-layer-2-surface_a group-active:bg-layer-2-surface_a focus:bg-layer-2-surface_a group-focus:bg-layer-2-surface_a border-layer-2-surface_a active:border-layer-2-surface_a group-active:border-layer-2-surface_a focus:border-layer-2-surface_a group-focus:border-layer-2-surface_a bg-layer-2-surface-edge active:bg-layer-2-surface-edge group-active:bg-layer-2-surface-edge focus:bg-layer-2-surface-edge group-focus:bg-layer-2-surface-edge border-layer-2-surface-edge active:border-layer-2-surface-edge group-active:border-layer-2-surface-edge focus:border-layer-2-surface-edge group-focus:border-layer-2-surface-edge text-layer-0-glyph active:text-layer-0-glyph group-active:text-layer-0-glyph focus:text-layer-0-glyph group-focus:text-layer-0-glyph text-layer-0-glyph_a active:text-layer-0-glyph_a group-active:text-layer-0-glyph_a focus:text-layer-0-glyph_a group-focus:text-layer-0-glyph_a text-layer-0-glyph_pl active:text-layer-0-glyph_pl group-active:text-layer-0-glyph_pl focus:text-layer-0-glyph_pl group-focus:text-layer-0-glyph_pl text-layer-0-glyph-hl active:text-layer-0-glyph-hl group-active:text-layer-0-glyph-hl focus:text-layer-0-glyph-hl group-focus:text-layer-0-glyph-hl text-layer-0-glyph-hl_a active:text-layer-0-glyph-hl_a group-active:text-layer-0-glyph-hl_a focus:text-layer-0-glyph-hl_a group-focus:text-layer-0-glyph-hl_a text-layer-0-glyph-shade active:text-layer-0-glyph-shade group-active:text-layer-0-glyph-shade focus:text-layer-0-glyph-shade group-focus:text-layer-0-glyph-shade text-layer-0-glyph-label active:text-layer-0-glyph-label group-active:text-layer-0-glyph-label focus:text-layer-0-glyph-label group-focus:text-layer-0-glyph-label text-layer-1-glyph active:text-layer-1-glyph group-active:text-layer-1-glyph focus:text-layer-1-glyph group-focus:text-layer-1-glyph text-layer-1-glyph_a active:text-layer-1-glyph_a group-active:text-layer-1-glyph_a focus:text-layer-1-glyph_a group-focus:text-layer-1-glyph_a text-layer-1-glyph_d active:text-layer-1-glyph_d group-active:text-layer-1-glyph_d focus:text-layer-1-glyph_d group-focus:text-layer-1-glyph_d text-layer-1-glyph_pl active:text-layer-1-glyph_pl group-active:text-layer-1-glyph_pl focus:text-layer-1-glyph_pl group-focus:text-layer-1-glyph_pl text-layer-1-glyph-hl active:text-layer-1-glyph-hl group-active:text-layer-1-glyph-hl focus:text-layer-1-glyph-hl group-focus:text-layer-1-glyph-hl text-layer-1-glyph-hl_a active:text-layer-1-glyph-hl_a group-active:text-layer-1-glyph-hl_a focus:text-layer-1-glyph-hl_a group-focus:text-layer-1-glyph-hl_a text-layer-1-glyph-shade active:text-layer-1-glyph-shade group-active:text-layer-1-glyph-shade focus:text-layer-1-glyph-shade group-focus:text-layer-1-glyph-shade text-layer-1-glyph-label active:text-layer-1-glyph-label group-active:text-layer-1-glyph-label focus:text-layer-1-glyph-label group-focus:text-layer-1-glyph-label text-layer-2-glyph active:text-layer-2-glyph group-active:text-layer-2-glyph focus:text-layer-2-glyph group-focus:text-layer-2-glyph text-layer-2-glyph_a active:text-layer-2-glyph_a group-active:text-layer-2-glyph_a focus:text-layer-2-glyph_a group-focus:text-layer-2-glyph_a text-layer-2-glyph_d active:text-layer-2-glyph_d group-active:text-layer-2-glyph_d focus:text-layer-2-glyph_d group-focus:text-layer-2-glyph_d text-layer-2-glyph_pl active:text-layer-2-glyph_pl group-active:text-layer-2-glyph_pl focus:text-layer-2-glyph_pl group-focus:text-layer-2-glyph_pl text-layer-2-glyph-hl active:text-layer-2-glyph-hl group-active:text-layer-2-glyph-hl focus:text-layer-2-glyph-hl group-focus:text-layer-2-glyph-hl text-layer-2-glyph-hl_a active:text-layer-2-glyph-hl_a group-active:text-layer-2-glyph-hl_a focus:text-layer-2-glyph-hl_a group-focus:text-layer-2-glyph-hl_a text-layer-2-glyph-shade active:text-layer-2-glyph-shade group-active:text-layer-2-glyph-shade focus:text-layer-2-glyph-shade group-focus:text-layer-2-glyph-shade placeholder:text-layer-0-glyph_pl placeholder:text-layer-1-glyph_pl placeholder:text-layer-2-glyph_pl"></div> +\ No newline at end of file diff --git a/apps-lib/src/lib/locales/en/models.json b/apps-lib/src/lib/locales/en/models.json @@ -1,17 +1,17 @@ { "location_gcs": { "fields": { - "lat": { - "label": "Location Latitude" + "gc_admin1_id": { + "label": "Location Gc Admin1 Id" }, - "lng": { - "label": "Location Latitude" + "gc_admin1_name": { + "label": "Location Gc Admin1 Name" }, - "geohash": { - "label": "Location Geohash" + "gc_country_id": { + "label": "Location Gc Country Id" }, - "label": { - "label": "Location Label" + "gc_country_name": { + "label": "Location Gc Country Name" }, "gc_id": { "label": "Location Gc Id" @@ -19,70 +19,76 @@ "gc_name": { "label": "Location Gc Name" }, - "gc_admin1_id": { - "label": "Location Gc Admin1 Id" + "geohash": { + "label": "Location Geohash" }, - "gc_admin1_name": { - "label": "Location Gc Admin1 Name" + "label": { + "label": "Location Label" }, - "gc_country_id": { - "label": "Location Gc Country Id" + "lat": { + "label": "Location Latitude" }, - "gc_country_name": { - "label": "Location Gc Country Name" + "lng": { + "label": "Location Latitude" } }, "schema": { - "lat.required": "The location latitude is required", - "lat.min": "The location latitude must be greater than -90", + "geohash.length": "The location geohash must be 9 characters", + "geohash.required": "The location geohash is required", "lat.max": "The location latitude must be less than 90", - "lng.required": "The location latitude is required", - "lng.min": "The location latitude must be greater than -180", + "lat.min": "The location latitude must be greater than -90", + "lat.required": "The location latitude is required", "lng.max": "The location latitude must be less than 180", - "geohash.required": "The location geohash is required", - "geohash.length": "The location geohash must be 9 characters" + "lng.min": "The location latitude must be greater than -180", + "lng.required": "The location latitude is required" } }, "log_error": { "fields": { - "error": { - "label": "Log Error" - }, - "message": { - "label": "Log Message" + "app_system": { + "label": "Log App System" }, - "stack_trace": { - "label": "Log Stack Trace" + "app_version": { + "label": "Log App Version" }, "cause": { "label": "Log Cause" }, - "app_system": { - "label": "Log App System" + "data": { + "label": "Log Data" }, - "app_version": { - "label": "Log App Version" + "error": { + "label": "Log Error" + }, + "message": { + "label": "Log Message" }, "nostr_pubkey": { "label": "Log Nostr Pubkey" }, - "data": { - "label": "Log Data" + "stack_trace": { + "label": "Log Stack Trace" } }, "schema": { - "error.required": "The log error is required", - "message.required": "The log message is required", "app_system.required": "The log app system is required", "app_version.required": "The log app version is required", + "error.required": "The log error is required", + "message.required": "The log message is required", "nostr_pubkey.required": "The log nostr pubkey is required" } }, "media_upload": { "fields": { + "description": { + "label": "Description" + }, "file_path": { "label": "File Path" }, + "label": { + "label": "Label" + }, "mime_type": { "label": "Mime Type" }, @@ -91,102 +97,96 @@ }, "res_path": { "label": "Resource Path" - }, - "label": { - "label": "Label" - }, - "description": { - "label": "Description" } }, "schema": { "file_path.required": "The media file path is required", "mime_type.required": "The media mime type is required", + "res_base.regex": "The media resource endpoint requires an http protocol", "res_base.required": "The media resource endpoint is required", "res_base.url": "The media resource endpoint is incorrectly formatted", - "res_base.regex": "The media resource endpoint requires an http protocol", "res_path.required": "The media resource path is required" } }, "nostr_profile": { "fields": { - "public_key": { - "label": "Profile Public Key" - }, - "name": { - "label": "Profile Name" - }, - "display_name": { - "label": "Profile Display Name" - }, "about": { "label": "Profile About" }, - "website": { - "label": "Profile Website" - }, - "picture": { - "label": "Profile Picture" - }, "banner": { "label": "Profile Banner" }, - "nip05": { - "label": "Profile Nip-05" + "display_name": { + "label": "Profile Display Name" }, "lud06": { "label": "Profile Lud-06" }, "lud16": { "label": "Profile Lud-16" + }, + "name": { + "label": "Profile Name" + }, + "nip05": { + "label": "Profile Nip-05" + }, + "picture": { + "label": "Profile Picture" + }, + "public_key": { + "label": "Profile Public Key" + }, + "website": { + "label": "Profile Website" } }, "schema": { - "public_key.required": "The profile public key is required", - "public_key.length": "The profile public key must be 64 characters", - "website.url": "The profile website url is incomplete", - "picture.url": "The profile picture url is incomplete", "banner.url": "The profile banner url is incomplete", - "nip05.email": "The profile nip-05 is incorrectly formatted" + "nip05.email": "The profile nip-05 is incorrectly formatted", + "picture.url": "The profile picture url is incomplete", + "public_key.length": "The profile public key must be 64 characters", + "public_key.required": "The profile public key is required", + "website.url": "The profile website url is incomplete" } }, "nostr_relay": { "fields": { - "url": { - "label": "Relay Endpoint" - }, - "relay_id": { - "label": "Relay Id" + "contact": { + "label": "Administrator Contact" }, - "name": { - "label": "Relay Name" + "data": { + "label": "Additional Information" }, "description": { "label": "Relay Description" }, + "name": { + "label": "Relay Name" + }, "pubkey": { "label": "Administrator" }, - "contact": { - "label": "Administrator Contact" + "relay_id": { + "label": "Relay Id" + }, + "software": { + "label": "Software" }, "supported_nips": { "label": "Supported Nips" }, - "software": { - "label": "Software" + "url": { + "label": "Relay Endpoint" }, "version": { "label": "Software Version" - }, - "data": { - "label": "Additional Information" } }, "schema": { + "url.regex": "The relay relay endpoint requires a websocket protocol", "url.required": "The relay relay endpoint is required", - "url.url": "The relay relay endpoint is incorrectly formatted", - "url.regex": "The relay relay endpoint requires a websocket protocol" + "url.url": "The relay relay endpoint is incorrectly formatted" } }, "trade_product": { @@ -194,78 +194,78 @@ "key": { "label": "Product Kind" }, - "title": { - "label": "Product Title" + "lot": { + "label": "Product Lot" }, - "summary": { - "label": "Product Description" + "notes": { + "label": "Notes" + }, + "price_amt": { + "label": "Price Amount" + }, + "price_currency": { + "label": "Price Currency" + }, + "price_qty_amt": { + "label": "Price Quantity" + }, + "price_qty_unit": { + "label": "Price Quantity Unit" }, "process": { "label": "Processing Method" }, - "lot": { - "label": "Product Lot" - }, "profile": { "label": "Flavor Profile" }, - "year": { - "label": "Production Year" - }, "qty_amt": { "label": "Quantity Amount" }, - "qty_unit": { - "label": "Quantity Unit" - }, - "qty_label": { - "label": "Quantity Name" - }, "qty_avail": { "label": "Quantity Available" }, - "price_amt": { - "label": "Price Amount" + "qty_label": { + "label": "Quantity Name" }, - "price_currency": { - "label": "Price Currency" + "qty_unit": { + "label": "Quantity Unit" }, - "price_qty_amt": { - "label": "Price Quantity" + "summary": { + "label": "Product Description" }, - "price_qty_unit": { - "label": "Price Quantity Unit" + "title": { + "label": "Product Title" }, - "notes": { - "label": "Notes" + "year": { + "label": "Production Year" } }, "schema": { "key.required": "The product kind is required", - "title.required": "The product title is required", - "summary.required": "The product description is required", - "process.required": "The product processing method is required", - "lot.required": "The product lot is required", - "lot.min": "The product lot must be more than 1 character", "lot.max": "The product lot must be less than 120 characters", + "lot.min": "The product lot must be more than 1 character", + "lot.required": "The product lot is required", + "price_amt.positive": "The product price amount must be positive", + "price_amt.required": "The product price amount is required", + "price_currency.length": "The product price currency must be 3 characters", + "price_currency.required": "The product price currency is required", + "price_qty_amt.int": "The product price quantity must be an integer", + "price_qty_amt.positive": "The product price quantity must be positive", + "price_qty_amt.required": "The product price quantity is required", + "price_qty_unit.required": "The product price quantity unit is required", + "process.required": "The product processing method is required", "profile.required": "The product flavor profile is required", - "year.required": "The product production year is required", - "year.int": "The product production year must be an integer", - "year.positive": "The product production year must be positive", - "qty_amt.required": "The product quantity amount is required", "qty_amt.int": "The product quantity amount must be an integer", "qty_amt.positive": "The product quantity amount must be positive", - "qty_unit.required": "The product quantity unit is required", + "qty_amt.required": "The product quantity amount is required", "qty_avail.int": "The product quantity available must be an integer", "qty_avail.positive": "The product quantity available must be positive", - "price_amt.required": "The product price amount is required", - "price_amt.positive": "The product price amount must be positive", - "price_currency.required": "The product price currency is required", - "price_currency.length": "The product price currency must be 3 characters", - "price_qty_amt.required": "The product price quantity is required", - "price_qty_amt.int": "The product price quantity must be an integer", - "price_qty_amt.positive": "The product price quantity must be positive", - "price_qty_unit.required": "The product price quantity unit is required" + "qty_unit.required": "The product quantity unit is required", + "summary.required": "The product description is required", + "title.required": "The product title is required", + "year.int": "The product production year must be an integer", + "year.positive": "The product production year must be positive", + "year.required": "The product production year is required" } } } \ No newline at end of file diff --git a/apps-lib/src/lib/types/components.ts b/apps-lib/src/lib/types/components.ts @@ -1,4 +1,4 @@ -import type { CallbackPromise, CallbackPromiseGeneric, GlyphKey, GlyphWeight, ICb, ICbG, ICbOpt, IClOpt, IGl, IGlOpt, IGlyph, IIdOpt, IIdWrapOpt, IInputElement, ILabel, ILabelFieldsOpt, ILabelOpt, ILabelOptFieldsOpt, ILabelValue, ILoadingOpt, ILyOpt, ILyOptTs, ISelectElement, ITextAreaElement, NavigationParamTuple, NavigationRoute } from "$lib"; +import type { CallbackPromise, CallbackPromiseGeneric, GlyphKey, GlyphWeight, ICb, ICbG, ICbOpt, IClOpt, IDisabledOpt, IGl, IGlOpt, IGlyph, IIdOpt, IIdWrapOpt, IInputElement, ILabel, ILabelFieldsOpt, ILabelOpt, ILabelOptFieldsOpt, ILabelValue, ILoadingOpt, ILyOpt, ILyOptTs, ISelectElement, ITextAreaElement, NavigationParamTuple, NavigationRoute } from "$lib"; import type { TransitionConfig } from "svelte/transition"; export type ITabsBasisList = IClOpt & { @@ -52,10 +52,9 @@ export type IEntryMultiLine = { }; } -export type IEntrySelectOption = { +export type IEntrySelectOption = IDisabledOpt & { value: string; label?: string; - disabled?: boolean; selected?: boolean; }; @@ -95,7 +94,7 @@ export type IEnvelopeTitledBasis = { export type INavBasisOption = IClOpt & ICbG< HTMLLabelElement | null -> & IGlOpt & ILabelOpt & { +> & IGlOpt & ILabelOpt & IDisabledOpt & { loading?: boolean; }; export type INavBasis = { diff --git a/apps-lib/src/lib/types/el.ts b/apps-lib/src/lib/types/el.ts @@ -4,6 +4,12 @@ import type { ThemeLayer } from "@radroots/theme"; export type GlyphKeyCurrency = `dollar` | `eur`; export type GlyphKey = | + `bell` | + `columns` | + `bold` | + `article` | + `grid-four` | + `link-simple` | `seal-check` | `selection-foreground` | `image-square` | @@ -137,10 +143,13 @@ export type ILoading = { dim?: ILoadingDimension; }; -export type ISelectOption<T extends string> = { +export type IDisabledOpt = { + disabled?: boolean; +} + +export type ISelectOption<T extends string> = IDisabledOpt & { value: T; label: string; - disabled?: boolean; }; export type ISelectElement = IIdOpt & IClOpt & ILyOptTs & diff --git a/apps-lib/src/lib/utils/routes.ts b/apps-lib/src/lib/utils/routes.ts @@ -10,6 +10,7 @@ export type NavigationRoute = | "/models/trade-product/add" | "/models/trade-product/view" | "/settings" + | "/settings/account" | "/settings/nostr" | "/test" | "/cfg/error" @@ -28,6 +29,7 @@ export function parse_route(route: string): NavigationRoute { case "/models/trade-product/add": case "/models/trade-product/view": case "/settings": + case "/settings/account": case "/settings/nostr": case "/test": case "/cfg/error":