@g9tm/aiassistant-lynx 1.1.0 → 1.2.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 CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { useEffect, useRef, useState } from "@lynx-js/react";
9
9
  import { afterConfirm, ApiError, arr, formatNumber, needsCode, num, obj, planView, str, timer } from "@g9tm/aiassistant";
10
- import { HISTORY_TABS, historyTabs, missingSlots, pageCalls, readConversations, readPicks, readRoutines, slotValue, tabCounts } from "@g9tm/aiassistant/pages";
10
+ import { HISTORY_TABS, historyTabs, missingSlots, pageCalls, pageTexts, readConversations, readPicks, readRoutines, slotValue, tabCounts } from "@g9tm/aiassistant/pages";
11
11
  import { cls, fill, rowOf, swappable, tok, useSnapshot, useUi } from "./context.jsx";
12
12
  import { BlockView } from "./parts.jsx";
13
13
  import { Button, Dialog, field, PinPad } from "./slots.jsx";
@@ -49,7 +49,7 @@ export function Page(props) {
49
49
  }
50
50
  function PlainPage(props) {
51
51
  const ui = useUi();
52
- const t = ui.texts.t;
52
+ const t = pageTexts(ui.texts).t;
53
53
  const api = ui.assistant.api;
54
54
  const snap = useSnapshot(ui.assistant);
55
55
  const [data, setData] = useState(null);
@@ -111,7 +111,7 @@ function Tab(props) {
111
111
  /** One conversation: its title opens it; pin (or unpin) and delete keep their size. Replaceable as `HistoryRow`. */
112
112
  export const HistoryRow = swappable("HistoryRow", (props) => {
113
113
  const ui = useUi();
114
- const t = ui.texts.t;
114
+ const t = pageTexts(ui.texts).t;
115
115
  const r = props.row;
116
116
  return (<view className="g9a-history-row" style={{ ...rowOf(ui, "6px"), minHeight: "40px", marginBottom: "4px" }}>
117
117
  <view style={grow} accessibility-element={true} accessibility-label={r.title} bindtap={props.onOpen}>
@@ -125,7 +125,7 @@ export const HistoryRow = swappable("HistoryRow", (props) => {
125
125
  /** The history: four tabs with counts over one search, pin and unpin, delete after a confirm, open. */
126
126
  function HistoryBody(props) {
127
127
  const ui = useUi();
128
- const t = ui.texts.t;
128
+ const t = pageTexts(ui.texts).t;
129
129
  const api = ui.assistant.api;
130
130
  const [rows, setRows] = useState(null);
131
131
  const [failed, setFailed] = useState(false);
@@ -161,7 +161,7 @@ const PICK_WAIT_MS = 250;
161
161
  /** A searchable picker over the host's things of the slot's kind (asked after a short pause). Replaceable as `SlotPicker`. */
162
162
  export const SlotPicker = swappable("SlotPicker", (props) => {
163
163
  const ui = useUi();
164
- const t = ui.texts.t;
164
+ const t = pageTexts(ui.texts).t;
165
165
  const clock = timer(ui.assistant.host);
166
166
  const [items, setItems] = useState(null);
167
167
  const [failed, setFailed] = useState(false);
@@ -198,7 +198,7 @@ export const SlotPicker = swappable("SlotPicker", (props) => {
198
198
  /** One routine's form: its slots, the preview, then a report or a card confirmed with the person's code. */
199
199
  function RoutineForm(props) {
200
200
  const ui = useUi();
201
- const t = ui.texts.t;
201
+ const t = pageTexts(ui.texts).t;
202
202
  const api = ui.assistant.api;
203
203
  const snap = useSnapshot(ui.assistant);
204
204
  const r = props.routine;
package/dist/parts.jsx CHANGED
@@ -265,8 +265,7 @@ export function Composer(props) {
265
265
  return (<view className={cls(ui, "composer")} style={{ padding: "12px" }}>
266
266
  {props.attachments.length > 0 ? <view className={cls(ui, "file-chips")} style={{ ...rowOf(ui), flexWrap: "wrap" }}>{props.attachments.map((a) => <Button key={a.id} part="file-chip" label={a.name + " ×"} onTap={() => ui.assistant.detach(a.id)}/>)}</view> : null}
267
267
  <view style={rowOf(ui)}>
268
- {host.pickFile ? <Button part="composer.attach" label={t("composer.attach")} onTap={async () => { const f = await host.pickFile?.([".pdf", ".xlsx", ".csv", "image/*"]); if (f)
269
- await ui.assistant.attach(f.name, f.bytes); }}/> : null}
268
+ {host.pickFile || host.uploadFile ? <Button part="composer.attach" label={t("composer.attach")} onTap={() => ui.assistant.attachFromDevice()}/> : null}
270
269
  <view style={{ ...grow, marginLeft: "8px", marginRight: "8px" }}><input key={epoch} className={cls(ui, "composer.input")} style={{ ...field(ui), width: "100%" }} placeholder={t("composer.placeholder")} accessibility-label={t("composer.placeholder")} bindinput={(e) => setText(e.detail.value)}/></view>
271
270
  <Button part={props.busy ? "composer.stop" : "composer.send"} primary label={props.busy ? t("composer.stop") : t("composer.send")} onTap={async () => { if (props.busy)
272
271
  await ui.assistant.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/aiassistant-lynx",
3
- "version": "1.1.0",
3
+ "version": "1.2.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.1.0"
32
+ "@g9tm/aiassistant": "1.2.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@lynx-js/react": "0.129.2",