@g9tm/aiassistant-svelte 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// All the library's styling is here, under .g9a-styled, from theme tokens; unstyled leaves structure and classes only.
|
|
4
4
|
import type { Snippet } from "svelte";
|
|
5
5
|
import type { Assistant, PartStyles } from "@g9tm/aiassistant";
|
|
6
|
+
import { loadHostTexts, withHostTexts } from "@g9tm/aiassistant/pages";
|
|
6
7
|
import { provideUi, type Overrides } from "./context.js";
|
|
7
8
|
import { themeVars } from "./theme.js";
|
|
8
9
|
|
|
@@ -10,10 +11,14 @@
|
|
|
10
11
|
assistant: Assistant; styles?: PartStyles; unstyled?: boolean; components?: Overrides; children: Snippet;
|
|
11
12
|
} = $props();
|
|
12
13
|
|
|
14
|
+
// The host's server words (its AssistantSetup.Texts), read once: a host key the client does not know shows in words.
|
|
15
|
+
let own = $state<Readonly<Record<string, string>>>({});
|
|
16
|
+
$effect(() => { void loadHostTexts(assistant).then((o) => { own = o; }); });
|
|
17
|
+
|
|
13
18
|
// Getters, not copies: a host that switches unstyled, styles or a replaced component sees it at once.
|
|
14
19
|
provideUi({
|
|
15
20
|
get assistant() { return assistant; },
|
|
16
|
-
get texts() { return assistant.texts; },
|
|
21
|
+
get texts() { return withHostTexts(assistant.texts, () => own); },
|
|
17
22
|
get styles() { return styles; },
|
|
18
23
|
get unstyled() { return unstyled; },
|
|
19
24
|
get components() { return components; },
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// (click, PinPad, code), the taint warning. Confirming always goes through the core, bound to the plan's hash.
|
|
4
4
|
import type { PlanView } from "@g9tm/aiassistant";
|
|
5
5
|
import { needsCode } from "@g9tm/aiassistant";
|
|
6
|
+
import { pageTexts } from "@g9tm/aiassistant/pages";
|
|
6
7
|
import { cls, override, useUi } from "../context.js";
|
|
7
8
|
import PinPad from "../slots/PinPad.svelte";
|
|
8
9
|
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
<Pin bind:value={code} label={t("card.code")} />
|
|
46
47
|
{/if}
|
|
47
48
|
{#if plan.failCode === "confirm.waiting"}<p class="g9a-note" role="status">{t("card.waiting")}</p>
|
|
48
|
-
{:else if plan.failCode}<p class="g9a-note" role="alert">{plan.failCode}{#if plan.triesLeft !== null} · {t("card.tries_left", { count: plan.triesLeft })}{/if}</p>{/if}
|
|
49
|
+
{:else if plan.failCode}<p class="g9a-note" role="alert">{pageTexts(ui.texts).t(plan.failCode)}{#if plan.triesLeft !== null} · {t("card.tries_left", { count: plan.triesLeft })}{/if}</p>{/if}
|
|
49
50
|
<div class="g9a-row">
|
|
50
51
|
<button type="button" class={cls(ui, "card.approval.confirm")} disabled={busy || (needsCode(plan.method) && code.length === 0)} onclick={confirm}>{t("card.confirm")}</button>
|
|
51
52
|
<button type="button" class={cls(ui, "card.approval.refuse")} disabled={busy} onclick={() => ui.assistant.refuse(plan.id)}>{t("card.refuse")}</button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/aiassistant-svelte",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Svelte 5 components for the G9 AI assistant, fully customisable (layouts, tokens, per-part classes, overrides, parts).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@g9tm/aiassistant": "1.
|
|
34
|
+
"@g9tm/aiassistant": "1.3.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@sveltejs/package": "2.5.8",
|