commit 8660ab9e6172ce5714d7ed064af56f47b2b39635 parent fd642acdd2b979336044688af20c25ff7ce98ee8 Author: triesap <137732411+triesap@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:00:51 +0000 apps-lib: edit trellis styles, add trellis select component. use element responsive class. add/edit locales, types, utils Diffstat:
27 files changed, 146 insertions(+), 93 deletions(-)
diff --git a/apps-lib/src/lib/components/button_glyph.svelte b/apps-lib/src/lib/components/button_glyph.svelte @@ -12,7 +12,7 @@ </script> <button - class={`${fmt_cl(basis.classes)} flex flex-col justify-center items-center text-[${styles?.gl_1}px] transition-all`} + class={`${fmt_cl(basis.classes)} flex flex-col justify-center items-center text-[${styles?.gl_1}px] el-re`} on:click={async () => { if (basis.callback) await basis.callback(); }} diff --git a/apps-lib/src/lib/components/button_layout_pair.svelte b/apps-lib/src/lib/components/button_layout_pair.svelte @@ -26,7 +26,7 @@ }} /> {#if basis.back} - <div class={`flex flex-col justify-center items-center transition-all`}> + <div class={`flex flex-col justify-center items-center el-re`}> {#if basis.back?.visible} <button class={`group flex flex-row h-12 w-${$app_layout} justify-center items-center fade-in`} @@ -35,7 +35,7 @@ }} > <p - class={`font-sans font-[600] tracking-wide text-layer-1-glyph-shade ${basis.back?.disabled ? `` : `group-active:text-layer-1-glyph/40`} transition-all`} + class={`font-sans font-[600] tracking-wide text-layer-1-glyph-shade ${basis.back?.disabled ? `` : `group-active:text-layer-1-glyph/40`} el-re`} > {basis.back?.label || `${$t(`common.back`)}`} </p> diff --git a/apps-lib/src/lib/components/entry_multiline.svelte b/apps-lib/src/lib/components/entry_multiline.svelte @@ -28,7 +28,7 @@ {#if basis.notify_inline} {#if `glyph` in basis.notify_inline} <div - class={`z-5 absolute right-0 top-0 flex flex-row h-full pr-3 justify-end items-center translate-x-[34px] fade-in transition-all`} + class={`z-5 absolute right-0 top-0 flex flex-row h-full pr-3 justify-end items-center translate-x-[34px] fade-in `} > <Glyph basis={typeof basis.notify_inline.glyph === `string` diff --git a/apps-lib/src/lib/components/envelope_titled.svelte b/apps-lib/src/lib/components/envelope_titled.svelte @@ -35,7 +35,7 @@ on:click|preventDefault={async () => await callback_close()} > <p - class={`${fmt_cl(basis.previous?.label?.classes)} font-sans text-envelopeTitlePrevious text-layer-${layer}-glyph-hl group-active:opacity-40 transition-all`} + class={`${fmt_cl(basis.previous?.label?.classes)} font-sans text-envelopeTitlePrevious text-layer-${layer}-glyph-hl group-active:opacity-40 el-re`} > {basis.previous?.label?.value || `${$t(`common.cancel`)}`} </p> @@ -71,7 +71,7 @@ <ButtonGlyph basis={basis.submit?.glyph} /> {:else if `label` in basis.submit} <p - class={`font-sans text-envelopeTitleAction ${classes_submit} transition-all`} + class={`font-sans text-envelopeTitleAction ${classes_submit} el-re`} > {basis.submit?.label.value || `${$t(`common.add`)}`} </p> diff --git a/apps-lib/src/lib/components/nav.svelte b/apps-lib/src/lib/components/nav.svelte @@ -68,7 +68,7 @@ <div bind:this={el} - class={`z-10 absolute top-0 left-0 flex flex-col w-full justify-start items-start transition-all duration-[250ms] h-nav_${$app_layout} ${$nav_blur ? `bg-layer-0-surface-blur/30 backdrop-blur-md` : ``}`} + 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`} > <div bind:this={el_inner} diff --git a/apps-lib/src/lib/components/notify_glyph.svelte b/apps-lib/src/lib/components/notify_glyph.svelte @@ -10,7 +10,7 @@ </script> <div - class={`${fmt_cl(basis.classes)} z-10 absolute right-0 top-0 flex flex-row h-full pr-3 justify-end items-center fade-in transition-all`} + class={`${fmt_cl(basis.classes)} z-10 absolute right-0 top-0 flex flex-row h-full pr-3 justify-end items-center fade-in el-re`} > <Glyph basis={typeof basis.glyph === `string` diff --git a/apps-lib/src/lib/components/trellis.svelte b/apps-lib/src/lib/components/trellis.svelte @@ -33,9 +33,9 @@ </script> <div - id={basis.args.id || ""} + id={basis.args.id || ``} class={`${fmt_cl(args.classes)} flex flex-col`} - data-view={basis.args.view || ""} + data-view={basis.args.view || ``} > <div class={`relative flex flex-col h-auto w-${$app_layout} gap-[3px] ${set_title_background ? `bg-layer-${args.layer}-surface` : ``}`} @@ -69,7 +69,7 @@ <div class={`flex flex-col w-full justify-center items-center`}> {#each args.list as basis} <div - class={`${basis.hide_field ? "hidden" : ""} group flex flex-row h-full w-full justify-end items-center bg-layer-${args.layer}-surface ${basis.full_rounded ? `rounded-touch` : ``} ${hide_rounded ? `` : `first:rounded-t-touch last:rounded-b-touch`} ${!basis.hide_active ? `active:bg-layer-${args.layer}-surface_a` : ``} transition-all`} + class={`${basis.hide_field ? "hidden" : ``} group flex flex-row h-full w-full justify-end items-center bg-layer-${args.layer}-surface ${basis.full_rounded ? `rounded-touch` : ``} ${hide_rounded ? `` : `first:rounded-t-2xl last:rounded-b-2xl`} ${!basis.hide_active ? `active:bg-layer-${args.layer}-surface_a` : ``} el-re`} > <div class={`flex flex-row h-full w-full gap-1 items-center overflow-y-hidden`} diff --git a/apps-lib/src/lib/components/trellis_end.svelte b/apps-lib/src/lib/components/trellis_end.svelte @@ -20,7 +20,7 @@ <Glyph basis={{ classes: `text-layer-${layer}-glyph-shade ${hide_active ? `` : `group-active:text-layer-${layer}-glyph_a`} translate-y-[1px] opacity-70`, - dim: `xs-`, + dim: `xs`, weight: `bold`, ...basis.icon, }} diff --git a/apps-lib/src/lib/components/trellis_input.svelte b/apps-lib/src/lib/components/trellis_input.svelte @@ -48,7 +48,7 @@ basis={{ dim: `glyph-send-button`, blades: 8, - classes: `text-layer-${layer}-glyph transition-all`, + classes: `text-layer-${layer}-glyph el-re`, }} /> </div> diff --git a/apps-lib/src/lib/components/trellis_line.svelte b/apps-lib/src/lib/components/trellis_line.svelte @@ -0,0 +1,31 @@ +<script lang="ts"> + import { fmt_trellis, type CallbackPromiseGeneric } from "$lib"; + import type { ThemeLayer } from "@radroots/theme"; + + export let layer: ThemeLayer; + export let callback: CallbackPromiseGeneric<MouseEvent>; + export let hide_border_t: boolean; + export let hide_border_b: boolean; +</script> + +<button + class={`flex flex-row flex-grow overflow-x-hidden`} + on:click={async (ev) => { + if (callback) await callback(ev); + }} +> + <div + class={`${fmt_trellis(hide_border_b, hide_border_t)} flex flex-row h-full w-full justify-center items-center border-t-line border-layer-${layer}-surface-edge el-re`} + > + <div + class={`relative group flex flex-row h-line w-full pr-[2px] justify-between items-center el-re`} + > + <div + class={`flex flex-row h-full w-trellis_display justify-between items-center`} + > + <slot /> + </div> + <slot name="end" /> + </div> + </div> +</button> diff --git a/apps-lib/src/lib/components/trellis_row_display_value.svelte b/apps-lib/src/lib/components/trellis_row_display_value.svelte @@ -1,22 +1,16 @@ <script lang="ts"> - import { - fmt_cl, - get_label_classes, - Glyph, - type ITrellisKindDisplayValue, - } from "$lib"; + import { fmt_cl, Glyph, type ITrellisKindDisplayValue } from "$lib"; import type { ThemeLayer } from "@radroots/theme"; export let basis: ITrellisKindDisplayValue; export let layer: ThemeLayer; export let hide_active: boolean; - export let end_offset: boolean = false; </script> <button - class={`z-10 flex flex-grow justify-end ${end_offset ? `pr-[22px]` : ``}`} - on:click|preventDefault={async (ev) => { - if (basis && basis.callback) await basis.callback(ev); + class={`z-10 flex flex-grow justify-end`} + on:click|stopPropagation={async (ev) => { + if (basis.callback) await basis.callback(ev); }} > {#if `icon` in basis} @@ -33,7 +27,7 @@ {:else if basis.label} {#if `value` in basis.label} <p - class={`${fmt_cl(basis.label.classes)} font-sans text-line_display line-clamp-1 ${get_label_classes(layer, basis.label.kind, hide_active)} transition-all`} + class={`${fmt_cl(basis.label.classes)} font-sans text-line_display_e line-clamp-1 text-layer-0-glyph-label el-re`} > {basis.label.value} </p> diff --git a/apps-lib/src/lib/components/trellis_row_label.svelte b/apps-lib/src/lib/components/trellis_row_label.svelte @@ -1,20 +1,12 @@ <script lang="ts"> - import { - ButtonGlyph, - fmt_cl, - get_label_classes, - type ILabelTupFields, - } from "$lib"; + import { ButtonGlyph, fmt_cl, type ILabelTupFields } from "$lib"; import type { ThemeLayer } from "@radroots/theme"; export let basis: ILabelTupFields; export let layer: ThemeLayer; - export let hide_active: boolean; </script> -<div - class={`flex flex-row h-full w-trellis_display items-center justify-between`} -> +<div class={`flex flex-row h-full items-center justify-between`}> {#if basis.left && basis.left.length} <div class={`flex flex-row h-full items-center truncate`}> {#each basis.left as title_l} @@ -29,7 +21,7 @@ </div> {:else if `value` in title_l} <p - class={`${fmt_cl(title_l.classes)} ${get_label_classes(layer, title_l.kind, hide_active)} ${title_l.hide_truncate ? `` : `truncate`} font-circ text-line_display transition-all`} + class={`${fmt_cl(title_l.classes)} font-sans text-line_display text-layer-${layer}-glyph_d ${title_l.hide_truncate ? `` : `truncate`} el-re`} > {title_l.value || ``} </p> @@ -44,13 +36,13 @@ > {#each basis.right.reverse() as title_r} <div - class={`${fmt_cl(title_r.classes_wrap)} flex flex-row h-full w-trellis_value gap-1 items-center ${title_r.hide_truncate ? `` : `truncate`}`} + class={`${fmt_cl(title_r.classes_wrap)} flex flex-row h-full gap-1 items-center ${title_r.hide_truncate ? `` : `truncate`}`} > {#if `glyph` in title_r} <ButtonGlyph basis={{ ...title_r.glyph }} /> {:else if `value` in title_r} <p - class={`${fmt_cl(title_r.classes)} ${get_label_classes(layer, title_r.kind, hide_active)} ${title_r.hide_truncate ? `` : `truncate`} font-sans text-line_display transition-all`} + class={`${fmt_cl(title_r.classes)} font-sans text-line_display text-layer-${layer}-glyph_d ${title_r.hide_truncate ? `` : `truncate`} el-re`} > {title_r.value || ``} </p> diff --git a/apps-lib/src/lib/components/trellis_select.svelte b/apps-lib/src/lib/components/trellis_select.svelte @@ -0,0 +1,32 @@ +<script lang="ts"> + import { + TrellisEnd, + TrellisRowDisplayValue, + TrellisRowLabel, + type ITrellisBasisSelect, + } from "$lib"; + import type { ThemeLayer } from "@radroots/theme"; + import TrellisLine from "./trellis_line.svelte"; + + export let basis: ITrellisBasisSelect; + export let layer: ThemeLayer; + export let hide_border_t: boolean; + export let hide_border_b: boolean; + export let hide_active: boolean; +</script> + +<TrellisLine {layer} {hide_border_b} {hide_border_t}> + <TrellisRowLabel basis={basis.label} {layer} {hide_active} /> + {#if basis.display} + <TrellisRowDisplayValue + basis={{ ...basis.display }} + {layer} + {hide_active} + /> + {/if} + <div slot="end"> + {#if basis.end} + <TrellisEnd basis={basis.end} {layer} {hide_active} /> + {/if} + </div> +</TrellisLine> diff --git a/apps-lib/src/lib/components/trellis_touch.svelte b/apps-lib/src/lib/components/trellis_touch.svelte @@ -1,13 +1,12 @@ <script lang="ts"> import { - fmt_trellis, - sleep, TrellisEnd, TrellisRowDisplayValue, TrellisRowLabel, type ITrellisBasisTouch, } from "$lib"; import type { ThemeLayer } from "@radroots/theme"; + import TrellisLine from "./trellis_line.svelte"; export let basis: ITrellisBasisTouch; export let layer: ThemeLayer; @@ -16,38 +15,20 @@ export let hide_active: boolean; </script> -<div class={`flex flex-row flex-grow overflow-x-hidden`}> - <div - class={`${fmt_trellis(hide_border_b, hide_border_t)} flex flex-row h-full w-full justify-center items-center border-t-line border-layer-${layer}-surface-edge el-re`} - > - <button - class={`relative group flex flex-row h-line w-full pr-[2px] justify-between items-center el-re`} - on:click={async (ev) => { - await sleep(100); - if (basis.callback) await basis.callback(ev); +<TrellisLine {layer} {hide_border_b} {hide_border_t} callback={basis.callback}> + <TrellisRowLabel basis={basis.label} {layer} /> + {#if basis.display} + <TrellisRowDisplayValue + basis={{ + ...basis.display, }} - > - <div - class={`flex flex-row h-full justify-between items-center ${basis.end ? `pr-2` : ``}`} - > - <TrellisRowLabel basis={basis.label} {layer} {hide_active} /> - {#if basis.display} - <TrellisRowDisplayValue - basis={{ - ...basis.display, - callback: async (ev) => { - //@todo - }, - }} - {layer} - {hide_active} - end_offset={!!basis.end} - /> - {/if} - </div> - {#if basis.end} - <TrellisEnd basis={basis.end} {layer} {hide_active} /> - {/if} - </button> - </div> -</div> + {layer} + {hide_active} + /> + {/if} + <svelte:fragment slot="end"> + {#if basis.end} + <TrellisEnd basis={basis.end} {layer} {hide_active} /> + {/if} + </svelte:fragment> +</TrellisLine> diff --git a/apps-lib/src/lib/el/blur.svelte b/apps-lib/src/lib/el/blur.svelte @@ -3,10 +3,10 @@ </script> <div - class={`z-10 absolute top-0 left-0 modal modal-bottom ${$app_blur ? `modal-open` : ``} h-[100vh] w-full m-0 p-0 backdrop-blur-sm overflow-y-hidden transition-all`} + class={`z-10 absolute top-0 left-0 modal modal-bottom ${$app_blur ? `modal-open` : ``} h-[100vh] w-full m-0 p-0 backdrop-blur-sm overflow-y-hidden el-re`} > <div - class={`modal-box h-full w-full m-0 p-0 bg-transparent overflow-hidden transition-all`} + class={`modal-box h-full w-full m-0 p-0 bg-transparent overflow-hidden el-re`} > <Fill /> </div> diff --git a/apps-lib/src/lib/el/glyph_circle.svelte b/apps-lib/src/lib/el/glyph_circle.svelte @@ -15,7 +15,7 @@ {#if styles?.dim_1} <div - class={`${fmt_cl(basis?.classes_wrap)} flex flex-col h-[${styles?.dim_1}px] w-[${styles?.dim_1}px] justify-center items-center rounded-full transition-all`} + class={`${fmt_cl(basis?.classes_wrap)} flex flex-col h-[${styles?.dim_1}px] w-[${styles?.dim_1}px] justify-center items-center rounded-full el-re`} > <ButtonGlyph basis={basis?.glyph} /> </div> diff --git a/apps-lib/src/lib/el/input_element.svelte b/apps-lib/src/lib/el/input_element.svelte @@ -95,5 +95,5 @@ {id} type="text" class={`${fmt_cl(basis?.classes)} el-input ${classes_layer} el-re`} - placeholder={basis?.placeholder || ""} + placeholder={basis?.placeholder || ``} /> diff --git a/apps-lib/src/lib/el/label_swap.svelte b/apps-lib/src/lib/el/label_swap.svelte @@ -16,14 +16,14 @@ > <div class="swap-on"> <p - class={`${fmt_cl(basis.swap.on.classes || `text-navPrevious text-layer-${layer}-glyph-hl group-active:opacity-60`)} font-sans -translate-y-[1px] transition-all`} + class={`${fmt_cl(basis.swap.on.classes || `text-navPrevious text-layer-${layer}-glyph-hl group-active:opacity-60`)} font-sans -translate-y-[1px] el-re`} > {basis.swap.on.value} </p> </div> <div class="swap-off"> <p - class={`${fmt_cl(basis.swap.off.classes || `text-navPrevious text-layer-${layer}-glyph-hl group-active:opacity-60`)} font-sans -translate-y-[1px] transition-all`} + class={`${fmt_cl(basis.swap.off.classes || `text-navPrevious text-layer-${layer}-glyph-hl group-active:opacity-60`)} font-sans -translate-y-[1px] el-re`} > {basis.swap.off.value} </p> diff --git a/apps-lib/src/lib/el/loading.svelte b/apps-lib/src/lib/el/loading.svelte @@ -11,7 +11,7 @@ </script> <div - class={`relative flex flex-row justify-center items-center h-[${styles?.dim_1}px] w-[${styles?.dim_1}px] fade-in transition-all`} + class={`relative flex flex-row justify-center items-center h-[${styles?.dim_1}px] w-[${styles?.dim_1}px] fade-in el-re`} > <div class={`${num_blades === 12 ? `spinner12 center` : `spinner8 center`} text-[${styles?.gl_2 || styles?.dim_1}px]`} diff --git a/apps-lib/src/lib/el/textarea_element.svelte b/apps-lib/src/lib/el/textarea_element.svelte @@ -76,7 +76,7 @@ {id} contenteditable="true" class={`${fmt_cl(basis.classes)} el-textarea w-full bg-layer-${layer}-surface text-layer-${layer}-glyph placeholder:text-layer-${layer}-glyph_pl caret-layer-${layer}-glyph`} - placeholder={basis.placeholder || ""} + placeholder={basis.placeholder || ``} on:input={async ({ currentTarget: el }) => { await handle_on_input(el); }} diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json @@ -34,6 +34,7 @@ "done": "Done", "edit": "Edit", "end_date": "End date", + "failure_to_process_the_request": "Failure to process the request", "file_name": "File name", "file_size": "File size", "filters": "Filters", @@ -65,6 +66,7 @@ "no": "No", "no_items_to_display": "No items to display", "no_locations_saved": "No locations saved", + "nostr": "Nostr", "not_connected": "Not connected", "npub": "Npub", "nsec": "Nsec", diff --git a/apps-lib/src/lib/locales/en/icu.json b/apps-lib/src/lib/locales/en/icu.json @@ -55,6 +55,7 @@ "nostr_*": "Nostr {value}", "post_*": "Post {value}", "primary_*": "Primary {value}", + "reading_*": "Reading {value}", "set_as_*": "Set as {value}", "show_*": "Show {value}", "the_*": "The {value}", diff --git a/apps-lib/src/lib/locales/en/models.json b/apps-lib/src/lib/locales/en/models.json @@ -33,7 +33,7 @@ } }, "schema": { - "geohash.length": "The location geohash must be 12 characters", + "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", "lat.min": "The location latitude must be greater than -90", diff --git a/apps-lib/src/lib/types/client.ts b/apps-lib/src/lib/types/client.ts @@ -169,7 +169,7 @@ export type ILabelSwap = { export type ILableFields = & { classes_wrap?: string classes?: string; - kind?: LabelFieldKind + kind?: LayerGlyphBasisKind; hide_truncate?: boolean; hide_active?: boolean; } & ( @@ -179,6 +179,8 @@ export type ILableFields = & { | IGl ); +export type LayerGlyphBasisKind = `_a` | `_d` | `_pl`; + export type LabelFieldKind = `link` | `on` | `shade`; export type IToastKind = `simple`; diff --git a/apps-lib/src/lib/types/trellis.ts b/apps-lib/src/lib/types/trellis.ts @@ -49,6 +49,8 @@ export type ITrellisBasisOffsetMod = ITrellisBasisOffsetModKey | (({ glyph: IGly export type ITrellisKind = ( | ITrellisKindTouch | ITrellisKindInput + | ITrellisKindSelect + ); export type ITrellisBasis = { @@ -67,6 +69,9 @@ export type ITrellisBasisOffset = ICbGOpt<MouseEvent> & hide_offset?: boolean; }; +export type ITrellisKindDisplay = { + display?: ITrellisKindDisplayValue; +} export type ITrellisKindDisplayValue = ICbGOpt<MouseEvent> & (ITrellisKindDisplayValueIcon | ILabel); @@ -86,9 +91,8 @@ export type ITrellisKindTouch = ITrellisBasis & { }; export type ITrellisBasisTouch = ICbGOpt<MouseEvent> & - ILabelTup & { + ILabelTup & ITrellisKindDisplay & { end?: ITrellisBasisTouchEnd; - display?: ITrellisKindDisplayValue; }; export type ITrellisKindInput = ITrellisBasis & { @@ -107,4 +111,13 @@ export type ITrellisBasisInput = { callback?: CallbackPromise; glyph?: IGlyph }; -}; -\ No newline at end of file +}; + +export type ITrellisKindSelect = ITrellisBasis & { + select: ITrellisBasisSelect; +}; + +export type ITrellisBasisSelect = + ILabelTup & ITrellisKindDisplay & { + end?: ITrellisBasisTouchEnd; + }; diff --git a/apps-lib/src/lib/utils/client.ts b/apps-lib/src/lib/utils/client.ts @@ -1,5 +1,5 @@ import { goto } from "$app/navigation"; -import { app_toast, locale, nav_prev, t, TOAST_MS, type AnchorRoute, type AppConfigType, type AppLayoutKey, type CallbackPromise, type CallbackPromiseGeneric, type GeolocationLatitudeFmtOption, type GlyphKey, type IToast, type LabelFieldKind, type NavigationParamTuple, type NavigationRoute, type NavigationRouteParamKey } from "$lib"; +import { app_toast, locale, nav_prev, t, TOAST_MS, type AnchorRoute, type AppConfigType, type AppLayoutKey, type CallbackPromise, type CallbackPromiseGeneric, type GeolocationLatitudeFmtOption, type GlyphKey, type IToast, type LabelFieldKind, type LayerGlyphBasisKind, type NavigationParamTuple, type NavigationRoute, type NavigationRouteParamKey } from "$lib"; import type { ColorMode, ThemeKey, ThemeLayer } from "@radroots/theme"; import { get as get_store } from "svelte/store"; @@ -21,7 +21,11 @@ export const fmt_cl = (classes?: string): string => { return classes ? classes : ``; }; -export const get_label_classes = (layer: ThemeLayer, label_kind: LabelFieldKind | undefined, hide_active: boolean): string => { +export const get_label_classes = (layer: ThemeLayer, glyph_kind: LayerGlyphBasisKind | undefined, hide_active: boolean): string => { + return `text-layer-${layer}-glyph${glyph_kind ? `${glyph_kind}` : `_d`} ${hide_active ? `` : `group-active:text-layer-${layer}-glyph_a`}` +}; + +export const get_label_classes_ext = (layer: ThemeLayer, label_kind: LabelFieldKind | undefined, hide_active: boolean): string => { return `text-layer-${layer}-glyph${label_kind ? `-${label_kind}` : ``} ${hide_active ? `` : `group-active:text-layer-${layer}-glyph${label_kind ? `-${label_kind}_a` : `_a`}`}` }; @@ -168,9 +172,9 @@ export const show_toast = async (opts: { export const value_constrain = (regex_charset: RegExp, value: string): string => { return value - .split("") + .split(``) .filter((char) => regex_charset.test(char)) - .join(""); + .join(``); }; export const fmt_textarea_value = (value: string): string => { @@ -182,9 +186,9 @@ export const value_constrain_textarea = (regex_charset: RegExp, value: string): .replace(/\u00A0/g, ` `) .split(/[\n]/) .map(line => line - .split("") + .split(``) .filter((char) => regex_charset.test(char)) - .join("") + .join(``) ) .join("\n"); }; diff --git a/apps-lib/src/lib/utils/routes.ts b/apps-lib/src/lib/utils/routes.ts @@ -9,6 +9,7 @@ export type NavigationRoute = | "/models/trade-product" | "/models/trade-product/add" | "/settings" + | "/settings/nostr" | "/test" | "/cfg/error" | "/cfg/init"; @@ -25,6 +26,7 @@ export function parse_route(route: string): NavigationRoute { case "/models/trade-product": case "/models/trade-product/add": case "/settings": + case "/settings/nostr": case "/test": case "/cfg/error": case "/cfg/init":