@g9tm/aiassistant-lynx 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.
- package/dist/pages.jsx +1 -1
- package/dist/parts.jsx +2 -2
- package/dist/surfaces.jsx +5 -1
- package/package.json +2 -2
package/dist/pages.jsx
CHANGED
|
@@ -303,7 +303,7 @@ function RoutineForm(props) {
|
|
|
303
303
|
{p.steps.map((s) => <text key={s.index} className={cls(ui, "card.approval.step")} text-maxline="2">{String(s.index) + ". " + s.text + (s.undoable ? "" : " (" + t("card.irreversible") + ")")}</text>)}
|
|
304
304
|
{p.answered === null ? (<view>
|
|
305
305
|
{needsCode(p.method) ? <view className={cls(ui, "card.approval.code")}><PinPad key={epoch} label={t("card.code")} onInput={(v) => { code.current = v; }}/></view> : null}
|
|
306
|
-
{p.failCode === "confirm.waiting" ? <text>{t("card.waiting")}</text> : p.failCode ? <text text-maxline="2">{p.failCode + (p.triesLeft !== null ? " · " + t("card.tries_left", { count: p.triesLeft }) : "")}</text> : null}
|
|
306
|
+
{p.failCode === "confirm.waiting" ? <text>{t("card.waiting")}</text> : p.failCode ? <text text-maxline="2">{t(p.failCode) + (p.triesLeft !== null ? " · " + t("card.tries_left", { count: p.triesLeft }) : "")}</text> : null}
|
|
307
307
|
<view style={rowOf(ui, "8px")}>
|
|
308
308
|
<Button part="card.approval.confirm" primary label={t("card.confirm")} onTap={() => void run()}/>
|
|
309
309
|
<Button part="card.approval.refuse" label={t("card.refuse")} onTap={() => setPending(null)}/>
|
package/dist/parts.jsx
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { useEffect, useState } from "@lynx-js/react";
|
|
7
7
|
import { arr, blockView, can, finished, needsCode, obj, parseText, str, visibleText, LONG_RUNNING_MS, REVEAL_MS, windowView } from "@g9tm/aiassistant";
|
|
8
|
-
import { saveCsv } from "@g9tm/aiassistant/pages";
|
|
8
|
+
import { pageTexts, saveCsv } from "@g9tm/aiassistant/pages";
|
|
9
9
|
import { Chart } from "./chart.jsx";
|
|
10
10
|
import { blockOverride, cls, fill, override, rowOf, swappable, tok, useUi } from "./context.jsx";
|
|
11
11
|
import { Button, field, PinPad, SecretField } from "./slots.jsx";
|
|
@@ -135,7 +135,7 @@ export function ApprovalCard(props) {
|
|
|
135
135
|
</view>))}
|
|
136
136
|
{p.answered === null ? (<view>
|
|
137
137
|
{needsCode(p.method) ? <view className={cls(ui, "card.approval.code")}><PinPad key={epoch} label={t("card.code")} onInput={setCode}/></view> : null}
|
|
138
|
-
{p.failCode === "confirm.waiting" ? <text>{t("card.waiting")}</text> : p.failCode ? <text>{p.failCode}{p.triesLeft !== null ? " · " + t("card.tries_left", { count: p.triesLeft }) : ""}</text> : null}
|
|
138
|
+
{p.failCode === "confirm.waiting" ? <text>{t("card.waiting")}</text> : p.failCode ? <text>{pageTexts(ui.texts).t(p.failCode)}{p.triesLeft !== null ? " · " + t("card.tries_left", { count: p.triesLeft }) : ""}</text> : null}
|
|
139
139
|
<view style={rowOf(ui)}>
|
|
140
140
|
<Button part="card.approval.confirm" primary label={t("card.confirm")} onTap={() => void confirm()}/>
|
|
141
141
|
<Button part="card.approval.refuse" label={t("card.refuse")} onTap={() => void ui.assistant.refuse(p.id)}/>
|
package/dist/surfaces.jsx
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { useEffect, useState } from "@lynx-js/react";
|
|
7
7
|
import { formatNumber, obj, pickLayout, str } from "@g9tm/aiassistant";
|
|
8
|
+
import { loadHostTexts, withHostTexts } from "@g9tm/aiassistant/pages";
|
|
8
9
|
import { cls, fill, override, rowOf, swappable, tok, UiProvider, useSnapshot, useUi } from "./context.jsx";
|
|
9
10
|
import { Composer, Message, Small, WorkCard } from "./parts.jsx";
|
|
10
11
|
import { Button, field } from "./slots.jsx";
|
|
@@ -14,7 +15,10 @@ const DARK = { ...LIGHT, "surface": "#1d1b19", "surface-2": "#272421", "ink": "#
|
|
|
14
15
|
export function AssistantRoot(props) {
|
|
15
16
|
const host = props.assistant.host;
|
|
16
17
|
const theme = { ...(host.theme.mode === "dark" ? DARK : LIGHT), ...host.theme.tokens };
|
|
17
|
-
|
|
18
|
+
// The host's server words (its AssistantSetup.Texts), read once: a host key the client does not know shows in words.
|
|
19
|
+
const [own, setOwn] = useState({});
|
|
20
|
+
useEffect(() => { void loadHostTexts(props.assistant).then(setOwn); }, [props.assistant]);
|
|
21
|
+
return (<UiProvider value={{ assistant: props.assistant, texts: withHostTexts(props.assistant.texts, () => own), styles: props.styles ?? {}, unstyled: props.unstyled ?? false, components: props.components ?? {}, theme, layer: (host.sheetLayer ?? 1000) + 1 }}>
|
|
18
22
|
{props.children}
|
|
19
23
|
</UiProvider>);
|
|
20
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/aiassistant-lynx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "ReactLynx components for the G9 AI assistant, fully customisable (layouts, tokens, per-part classes, overrides, parts).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@g9tm/aiassistant": "1.
|
|
32
|
+
"@g9tm/aiassistant": "1.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@lynx-js/react": "0.129.2",
|