web_lib

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

commit 6586a3190fec4740dd56c04c5532cf9ebcf63b6c
parent bb50ecf4919003b22f3748f3d5ccf7d94a5a7260
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Mon,  9 Dec 2024 01:43:22 +0000

apps-lib: add/edit components, locales, utils

Diffstat:
Dapps-lib/src/lib/components/button_glyph_primary.svelte | 21---------------------
Aapps-lib/src/lib/components/button_glyph_simple.svelte | 25+++++++++++++++++++++++++
Mapps-lib/src/lib/components/envelope_lower.svelte | 8++------
Mapps-lib/src/lib/index.ts | 2+-
Mapps-lib/src/lib/locales/en/common.json | 2++
Mapps-lib/src/lib/locales/en/error.json | 3++-
Mapps-lib/src/lib/utils/carousel.ts | 4+++-
7 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/apps-lib/src/lib/components/button_glyph_primary.svelte b/apps-lib/src/lib/components/button_glyph_primary.svelte @@ -1,21 +0,0 @@ -<script lang="ts"> - import type { CallbackPromise } from "$lib"; - - export let basis: { - label: string; - callback: CallbackPromise; - }; -</script> - -<button - class={`group flex flex-row justify-center items-center`} - on:click={async () => { - await basis.callback(); - }} -> - <p - class={`font-sans font-[600] text-guide text-layer-0-glyph-hl opacity-active`} - > - {basis.label} - </p> -</button> diff --git a/apps-lib/src/lib/components/button_glyph_simple.svelte b/apps-lib/src/lib/components/button_glyph_simple.svelte @@ -0,0 +1,25 @@ +<script lang="ts"> + import type { CallbackPromise } from "$lib"; + + export let basis: { + kind?: `primary` | `neutral`; + label: string; + callback: CallbackPromise; + }; + + $: classes_kind = + basis.kind === `neutral` + ? `text-layer-0-glyph-shade` + : `text-layer-0-glyph-hl`; +</script> + +<button + class={`group flex flex-row justify-center items-center`} + on:click={async () => { + await basis.callback(); + }} +> + <p class={`font-sans font-[600] text-guide ${classes_kind} opacity-active`}> + {basis.label} + </p> +</button> diff --git a/apps-lib/src/lib/components/envelope_lower.svelte b/apps-lib/src/lib/components/envelope_lower.svelte @@ -15,12 +15,8 @@ $: basis = basis; const handle_close = async (): Promise<void> => { - try { - envelope_visible.set(false); - await basis.close(); - } catch (e) { - console.log(`(error) handle_close `, e); - } + envelope_visible.set(false); + await basis.close(); }; const handle_scroll = (): void => { diff --git a/apps-lib/src/lib/index.ts b/apps-lib/src/lib/index.ts @@ -60,7 +60,6 @@ export { default as EnvelopeButtons } from "./components/envelope_buttons.svelte export { default as LayoutWindow } from "./components/layout_window.svelte"; export { default as EntryMultiline } from "./components/entry_multiline.svelte"; export { default as EntryWrap } from "./components/entry_wrap.svelte"; -export { default as ButtonGlyphPrimary } from "./components/button_glyph_primary.svelte"; export { default as ButtonLayout } from "./components/button_layout.svelte"; export { default as LayoutTrellisLine } from "./components/layout_trellis_line.svelte"; export { default as PageHeader } from "./components/page_header.svelte"; @@ -81,4 +80,5 @@ export { default as LoadingView } from "./components/loading_view.svelte"; export { default as NavOption } from "./components/nav_option.svelte"; export { default as LogoCircle } from "./components/logo_circle.svelte"; export { default as TrellisRowLabel } from "./components/trellis_row_label.svelte"; +export { default as ButtonGlyphSimple } from "./components/button_glyph_simple.svelte"; export { default as LayoutView } from "./components/layout_view.svelte"; diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json @@ -67,6 +67,7 @@ "key": "Key", "keypair": "Keypair", "keys": "Keys", + "land_area": "Land area", "land_plot": "Land plot", "latitude": "Latitude", "light": "Light", @@ -86,6 +87,7 @@ "month": "Month", "month_to_date": "Month to date", "name": "Name", + "name_of_farm_or_estate": "Name of farm or estate", "new": "New", "no": "No", "no_items_to_display": "No items to display", diff --git a/apps-lib/src/lib/locales/en/error.json b/apps-lib/src/lib/locales/en/error.json @@ -22,7 +22,8 @@ "geolocation": { "request": { "current": "Geolocation request failure" - } + }, + "result_missing": "The geolocation data is not available" }, "radroots": { "account_required_upload": "To post photos using Radroots hosting you must request a profile name registration. There is no cost to register, do you want to continue?", diff --git a/apps-lib/src/lib/utils/carousel.ts b/apps-lib/src/lib/utils/carousel.ts @@ -74,7 +74,9 @@ export const carousel_dec = async <T extends string>( await exe_iter(async () => carousel_dec_handler(view), num, duration); }; -export const carousel_init = (num_max: number): void => { +export const carousel_init = async <T extends string>(view: T, num_max: number, +): Promise<void> => { + await carousel_dec(view); carousel_index.set(0); carousel_index_max.set(num_max); carousel_num.set(1);