@g9tm/aiassistant-lynx 1.4.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/dist/pages.jsx +4 -2
  2. package/package.json +2 -2
package/dist/pages.jsx CHANGED
@@ -175,10 +175,12 @@ export const SlotPicker = swappable("SlotPicker", (props) => {
175
175
  const [failed, setFailed] = useState(false);
176
176
  const wait = useRef(null);
177
177
  const asked = useRef(0);
178
+ const [query, setQuery] = useState("");
178
179
  const find = (q) => {
179
180
  const n = ++asked.current;
180
181
  pageCalls.pick(ui.assistant.api, props.slot.kind, q).then((r) => { if (n === asked.current) {
181
182
  setItems(readPicks(r));
183
+ setQuery(q.trim());
182
184
  setFailed(false);
183
185
  } }, () => { if (n === asked.current) {
184
186
  setItems([]);
@@ -199,7 +201,7 @@ export const SlotPicker = swappable("SlotPicker", (props) => {
199
201
  <view className="g9a-slot-picker">
200
202
  <input style={{ ...field(ui), marginBottom: "8px" }} placeholder={t("history.search")} accessibility-label={t("history.search")} bindinput={(e) => typed(e.detail.value)}/>
201
203
  {failed ? <text style={{ color: tok(ui, "danger", "#b42318") }} text-maxline="2">{t("error.network")}</text> : null}
202
- {items !== null && items.length === 0 && !failed ? <Empty words={t("routine.none_found")}/> : (items ?? []).map((p) => <Button key={p.id} label={p.label} onTap={() => props.onPick(p)}/>)}
204
+ {items !== null && items.length === 0 && !failed ? <Empty words={t(query.length === 0 ? "routine.type_to_search" : "routine.none_found")}/> : (items ?? []).map((p) => <Button key={p.id} label={p.label} onTap={() => props.onPick(p)}/>)}
203
205
  </view>
204
206
  </Dialog>);
205
207
  });
@@ -298,7 +300,7 @@ function RoutineForm(props) {
298
300
  {s.field === "pick" ? (<view style={rowOf(ui, "8px")}>
299
301
  <view style={grow}><text text-maxline="1">{picked.get(s.name)?.label ?? "—"}</text></view>
300
302
  <Button label={t("routine.choose")} onTap={() => setPicking(s)}/>
301
- </view>) : (<input style={{ ...field(ui) }} type="text" placeholder={s.name} accessibility-label={s.name} bindinput={(e) => edit(s.name, e.detail.value)}/>)}
303
+ </view>) : (<input style={{ ...field(ui) }} type="text" placeholder={slotLabel(t, s.name)} accessibility-label={slotLabel(t, s.name)} bindinput={(e) => edit(s.name, e.detail.value)}/>)}
302
304
  {flag ? <text className="g9a-routine-flag" style={{ fontSize: "12px", color: danger }} text-maxline="1">{t(flag)}</text> : null}
303
305
  </view>);
304
306
  })}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/aiassistant-lynx",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
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.4.0"
32
+ "@g9tm/aiassistant": "1.4.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@lynx-js/react": "0.129.2",