@ai-matrx/records-ui 0.115.103 → 0.115.104
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/CHANGELOG.md +21 -0
- package/dist/index.cjs +46 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -12
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +43 -9
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +43 -9
- package/dist/pickers.js.map +1 -1
- package/package.json +6 -6
package/dist/pickers.js
CHANGED
|
@@ -6295,6 +6295,11 @@ import { useCallback as useCallback7, useEffect as useEffect19, useState as useS
|
|
|
6295
6295
|
import { Button as Button15 } from "@ai-matrx/design-system";
|
|
6296
6296
|
import { tableShapeChanged, useRecordsClient as useRecordsClient9 } from "@ai-matrx/records/react";
|
|
6297
6297
|
|
|
6298
|
+
// src/leadingBlank.ts
|
|
6299
|
+
function withoutLeadingBlank(text) {
|
|
6300
|
+
return text.replace(/^\s+/, "");
|
|
6301
|
+
}
|
|
6302
|
+
|
|
6298
6303
|
// src/values.tsx
|
|
6299
6304
|
init_personChip();
|
|
6300
6305
|
import { SWATCH_CLASS as SWATCH_CLASS2, formatColumnValue } from "@ai-matrx/design-system/data-table";
|
|
@@ -8254,9 +8259,9 @@ function RecordsTable({ items }) {
|
|
|
8254
8259
|
const pictureFirst = [...keys].sort((a, b) => rank(a, items) - rank(b, items)).slice(0, TABLE_COLUMNS);
|
|
8255
8260
|
const shown2 = all ? items : items.slice(0, TABLE_ROWS);
|
|
8256
8261
|
return /* @__PURE__ */ jsxs26("div", { className: "min-w-0", "data-records-structured": "table", children: [
|
|
8257
|
-
/* @__PURE__ */ jsx28("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", children: /* @__PURE__ */ jsxs26("table", { className: "w-full border-collapse text-xs", children: [
|
|
8262
|
+
/* @__PURE__ */ jsx28("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", "data-records-structured-table-frame": "", children: /* @__PURE__ */ jsxs26("table", { className: "w-full border-collapse text-xs", children: [
|
|
8258
8263
|
/* @__PURE__ */ jsx28("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ jsx28("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("th", { scope: "col", className: "whitespace-nowrap px-2 py-1 font-medium text-muted-foreground", children: keyWords(k) }, k)) }) }),
|
|
8259
|
-
/* @__PURE__ */ jsx28("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ jsx28("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("td", { className: "min-w-[
|
|
8264
|
+
/* @__PURE__ */ jsx28("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ jsx28("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("td", { className: "min-w-[4rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ jsx28(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
|
|
8260
8265
|
] }) }),
|
|
8261
8266
|
items.length > TABLE_ROWS ? /* @__PURE__ */ jsx28(Button14, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
|
|
8262
8267
|
stop(e);
|
|
@@ -8667,7 +8672,7 @@ function scalarText(field, value, labels, stillWaitingFor) {
|
|
|
8667
8672
|
}
|
|
8668
8673
|
if (Array.isArray(value)) return value.length === 0 ? "" : structuredSummary(value);
|
|
8669
8674
|
if (typeof value === "object") return structuredOf(value) ? structuredSummary(value) : "\u2026";
|
|
8670
|
-
return String(value);
|
|
8675
|
+
return typeof value === "string" ? withoutLeadingBlank(value) : String(value);
|
|
8671
8676
|
}
|
|
8672
8677
|
|
|
8673
8678
|
// src/SourceArchivedNotice.tsx
|
|
@@ -11807,12 +11812,39 @@ function buttonPressWords(label, pressed) {
|
|
|
11807
11812
|
}
|
|
11808
11813
|
var POLL_EVERY_MS = 1200;
|
|
11809
11814
|
var POLL_FOR_MS = 12e4;
|
|
11810
|
-
|
|
11815
|
+
var RUN_BOOKKEEPING = /* @__PURE__ */ new Set(["run_id", "conversation_id"]);
|
|
11816
|
+
function answerOf(output) {
|
|
11817
|
+
const raw = (output ?? "").trim();
|
|
11818
|
+
if (raw === "") return { words: "" };
|
|
11819
|
+
let parsed;
|
|
11820
|
+
try {
|
|
11821
|
+
parsed = JSON.parse(raw);
|
|
11822
|
+
} catch {
|
|
11823
|
+
return { words: raw };
|
|
11824
|
+
}
|
|
11825
|
+
if (typeof parsed === "string") return { words: parsed.trim() };
|
|
11826
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
11827
|
+
const shown2 = Object.fromEntries(Object.entries(parsed).filter(([k]) => !RUN_BOOKKEEPING.has(k)));
|
|
11828
|
+
const keys = Object.keys(shown2);
|
|
11829
|
+
if (keys.length === 1 && typeof shown2.text === "string") return { words: shown2.text.trim() };
|
|
11830
|
+
const value2 = structuredOf(shown2);
|
|
11831
|
+
return value2 ? { words: "", value: value2 } : { words: raw };
|
|
11832
|
+
}
|
|
11833
|
+
const value = structuredOf(parsed);
|
|
11834
|
+
return value ? { words: "", value } : { words: raw };
|
|
11835
|
+
}
|
|
11836
|
+
function runAnswer(label, run) {
|
|
11811
11837
|
const steps = run.steps ?? [];
|
|
11812
11838
|
const failedStep = [...steps].reverse().find((s) => s.status === "failed");
|
|
11813
|
-
if (run.status === "failed")
|
|
11814
|
-
|
|
11815
|
-
|
|
11839
|
+
if (run.status === "failed") {
|
|
11840
|
+
const failed = answerOf(failedStep?.output_text).words || failedStep?.says;
|
|
11841
|
+
return { words: [failed, run.says].filter((t, i, all) => t && all.indexOf(t) === i).join(" ") || `${label} failed.` };
|
|
11842
|
+
}
|
|
11843
|
+
for (const step of [...steps].reverse()) {
|
|
11844
|
+
const answered = answerOf(step.output_text);
|
|
11845
|
+
if (answered.words !== "" || answered.value) return answered;
|
|
11846
|
+
}
|
|
11847
|
+
return { words: run.says || `${label} ran.` };
|
|
11816
11848
|
}
|
|
11817
11849
|
var stop2 = (event) => event.stopPropagation();
|
|
11818
11850
|
function ButtonValue({ field, recordId, inCell }) {
|
|
@@ -11859,7 +11891,8 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
11859
11891
|
const run = runs.data.runs.find((r) => r.run_id === pressed.run_id);
|
|
11860
11892
|
if (run && run.status !== "waiting") {
|
|
11861
11893
|
setBusy(false);
|
|
11862
|
-
|
|
11894
|
+
const answer = runAnswer(b.label, run);
|
|
11895
|
+
return setSaid(run.status === "ran" ? { kind: "ran", says: answer.words, value: answer.value } : { kind: "failed", says: answer.words });
|
|
11863
11896
|
}
|
|
11864
11897
|
if (Date.now() > until) {
|
|
11865
11898
|
setBusy(false);
|
|
@@ -11908,7 +11941,8 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
11908
11941
|
said2?.kind === "waiting" ? /* @__PURE__ */ jsx39("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
|
|
11909
11942
|
said2?.kind === "failed" ? /* @__PURE__ */ jsx39("p", { className: "break-words text-destructive", role: "alert", children: said2.says }) : null,
|
|
11910
11943
|
said2?.kind === "public" ? /* @__PURE__ */ jsx39("p", { children: "Buttons run for signed-in people." }) : null,
|
|
11911
|
-
said2?.kind === "ran" ? /* @__PURE__ */ jsxs37("
|
|
11944
|
+
said2?.kind === "ran" ? /* @__PURE__ */ jsxs37("div", { className: "break-words", children: [
|
|
11945
|
+
said2.value ? /* @__PURE__ */ jsx39(StructuredValueView, { structured: said2.value, label: b.label }) : null,
|
|
11912
11946
|
said2.says,
|
|
11913
11947
|
" ",
|
|
11914
11948
|
said2.link ? /* @__PURE__ */ jsx39(OutboundLink7, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
|