web_lib

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

commit c08c7bbdd7a1062ab21ccb15751cfe0b664fff01
parent b8a92514d62e6dd7a5b40b81f068ff2f1da17d8e
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Sat,  7 Dec 2024 23:52:07 +0000

apps-lib: add glyph title select label component. add/edit locales, utils

Diffstat:
Aapps-lib/src/lib/components/glyph_title_select_label.svelte | 34++++++++++++++++++++++++++++++++++
Mapps-lib/src/lib/index.ts | 1+
Mapps-lib/src/lib/locales/en/app.json | 4++--
Mapps-lib/src/lib/locales/en/common.json | 2+-
Mapps-lib/src/lib/locales/en/measurement.json | 14++++++++++++++
Mapps-lib/src/lib/locales/en/models.json | 280++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mapps-lib/src/lib/utils/client.ts | 7+++++++
7 files changed, 199 insertions(+), 143 deletions(-)

diff --git a/apps-lib/src/lib/components/glyph_title_select_label.svelte b/apps-lib/src/lib/components/glyph_title_select_label.svelte @@ -0,0 +1,34 @@ +<script lang="ts"> + import { ascii } from "$lib"; + + export let basis: { + label: string; + }; +</script> + +<div class={`flex flex-row justify-start items-center`}> + <p + class={`pr-[13px] font-sansd text-trellisTitle text-layer-0-glyph-label uppercase`} + > + {`(${basis.label}`} + </p> + <div + class={`relative flex flex-row justify-start items-center -translate-x-[10px] -translate-y-[1px]`} + > + <p + class={`absolute font-sansd text-trellisTitle text-layer-0-glyph-label uppercase scale-y-[70%] scale-x-[80%] -translate-y-[1px]`} + > + {`${ascii.up}`} + </p> + <p + class={`absolute font-sansd text-trellisTitle text-layer-0-glyph-label uppercase scale-y-[70%] scale-x-[80%] translate-y-[2px]`} + > + {`${ascii.down}`} + </p> + </div> + <p + class={`font-sansd text-trellisTitle text-layer-0-glyph-label uppercase`} + > + {`)`} + </p> +</div> diff --git a/apps-lib/src/lib/index.ts b/apps-lib/src/lib/index.ts @@ -43,6 +43,7 @@ export { default as TrellisEnd } from "./components/trellis_end.svelte"; export { default as ButtonGlyph } from "./components/button_glyph.svelte"; export { default as Envelope } from "./components/envelope.svelte"; export { default as DisplayLine } from "./components/display_line.svelte"; +export { default as GlyphTitleSelectLabel } from "./components/glyph_title_select_label.svelte"; export { default as LayoutTrellis } from "./components/layout_trellis.svelte"; export { default as Tabs } from "./components/tabs.svelte"; export { default as ButtonArrow } from "./components/button_arrow.svelte"; diff --git a/apps-lib/src/lib/locales/en/app.json b/apps-lib/src/lib/locales/en/app.json @@ -10,7 +10,6 @@ "6": "Saturday" } }, - "name": "Radroots", "cfg": { "init": { "greeting": "Welcome to Radroots!", @@ -20,5 +19,6 @@ "welcome": "Welcome! Your device was configured. To view or change your configuration go to Settings > Configuration" } } - } + }, + "name": "Radroots" } \ No newline at end of file diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json @@ -1,5 +1,4 @@ { - "using_public_key": "Using public key", "accept": "Accept", "activation": "Activation", "active": "Active", @@ -151,6 +150,7 @@ "upload_url": "Upload url", "url": "url", "username": "Username", + "using_public_key": "Using public key", "value": "Value", "view": "View", "wallet": "Wallet", diff --git a/apps-lib/src/lib/locales/en/measurement.json b/apps-lib/src/lib/locales/en/measurement.json @@ -1,4 +1,18 @@ { + "area": { + "ac": "Acre", + "ac_ab": "Ac.", + "ha": "Hectare", + "ha_ab": "Ha.", + "m2": "Square metre", + "m2_ab": "Sq. M." + }, + "length": { + "ft": "Foot", + "ft_ab": "Ft.", + "m": "Metre", + "m_ab": "M." + }, "mass": { "unit": { "g": "Gram", diff --git a/apps-lib/src/lib/locales/en/models.json b/apps-lib/src/lib/locales/en/models.json @@ -1,38 +1,14 @@ { "location_gcs": { "fields": { - "lat": { - "label": "Location Latitude" - }, - "lng": { - "label": "Location Latitude" - }, - "geohash": { - "label": "Location Geohash" - }, - "kind": { - "label": "Location Kind" - }, - "label": { - "label": "Location Label" - }, "area": { "label": "Location Area" }, - "elevation": { - "label": "Location Elevation" - }, - "soil": { - "label": "Location Soil" - }, "climate": { "label": "Location Climate" }, - "gc_id": { - "label": "Location Gc Id" - }, - "gc_name": { - "label": "Location Gc Name" + "elevation": { + "label": "Location Elevation" }, "gc_admin1_id": { "label": "Location Gc Admin1 Id" @@ -45,60 +21,90 @@ }, "gc_country_name": { "label": "Location Gc Country Name" + }, + "gc_id": { + "label": "Location Gc Id" + }, + "gc_name": { + "label": "Location Gc Name" + }, + "geohash": { + "label": "Location Geohash" + }, + "kind": { + "label": "Location Kind" + }, + "label": { + "label": "Location Label" + }, + "lat": { + "label": "Location Latitude" + }, + "lng": { + "label": "Location Latitude" + }, + "soil": { + "label": "Location Soil" } }, "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", + "kind.required": "The location kind 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", - "kind.required": "The location kind is required" + "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" }, @@ -107,185 +113,179 @@ }, "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": { "fields": { + "category": { + "label": "Product Category" + }, "key": { "label": "Product Kind" }, - "category": { - "label": "Product Category" + "lot": { + "label": "Product Lot" }, - "title": { - "label": "Product Title" + "notes": { + "label": "Notes" }, - "summary": { - "label": "Product Description" + "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", "category.required": "The product category 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", + "key.required": "The product kind is required", "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/utils/client.ts b/apps-lib/src/lib/utils/client.ts @@ -3,6 +3,13 @@ import { app_toast, locale, ls, nav_prev, TOAST_MS, type AnchorRoute, type AppCo import type { ColorMode, ThemeKey, ThemeLayer } from "@radroots/theme"; import { get } from "svelte/store"; +export const ascii = { + bullet: '•', + dash: `—`, + up: `↑`, + down: `↓` +} + export const get_store = get; export const sleep = async (ms: number): Promise<void> => {