@ai-matrx/records-ui 0.116.13 → 0.116.15
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 +11 -1
- package/dist/{SaveToTable-QZCRFD5Q.js → SaveToTable-54FVMGKL.js} +3 -3
- package/dist/{chunk-NE72B4OK.js → chunk-E5HKO5LT.js} +14 -3
- package/dist/chunk-E5HKO5LT.js.map +1 -0
- package/dist/{chunk-RQL7QRGR.js → chunk-TF3JYYJN.js} +1 -1
- package/dist/chunk-TF3JYYJN.js.map +1 -0
- package/dist/{chunk-HUPBD4JF.js → chunk-YIGEIVU7.js} +2 -2
- package/dist/helpers.d.cts +9 -0
- package/dist/helpers.d.ts +9 -0
- package/dist/index.cjs +125 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +119 -19
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +13 -0
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-NE72B4OK.js.map +0 -1
- package/dist/chunk-RQL7QRGR.js.map +0 -1
- /package/dist/{SaveToTable-QZCRFD5Q.js.map → SaveToTable-54FVMGKL.js.map} +0 -0
- /package/dist/{chunk-HUPBD4JF.js.map → chunk-YIGEIVU7.js.map} +0 -0
package/dist/pickers.cjs
CHANGED
|
@@ -850,6 +850,9 @@ function recordName(document2, titleKey, fallback = "Untitled") {
|
|
|
850
850
|
function looksLikeId(value) {
|
|
851
851
|
return typeof value === "string" && (0, import_uuid.isUuidShape)(value.trim());
|
|
852
852
|
}
|
|
853
|
+
function recordNameIn(table, document2, fallback = "Untitled") {
|
|
854
|
+
return recordName(document2, table?.title_field ?? null, fallback);
|
|
855
|
+
}
|
|
853
856
|
function rowNameIn(table, row, fallback = "Untitled") {
|
|
854
857
|
return recordName(row?.document, table?.title_field ?? null, fallback);
|
|
855
858
|
}
|
|
@@ -12322,6 +12325,10 @@ function buttonPressWords(label, pressed) {
|
|
|
12322
12325
|
const status = pressed.status ?? "ran";
|
|
12323
12326
|
return [`${pressed.automation ?? label}: ${status}.`, pressed.says].filter(Boolean).join(" ");
|
|
12324
12327
|
}
|
|
12328
|
+
function addRowWords(label, table, document2) {
|
|
12329
|
+
const name = recordNameIn(table, document2, "");
|
|
12330
|
+
return name !== "" ? `${label}: added \u201C${name}\u201D and opened it.` : `${label}: added to ${tableName(table)} and opened it.`;
|
|
12331
|
+
}
|
|
12325
12332
|
var POLL_EVERY_MS = 1200;
|
|
12326
12333
|
var POLL_FOR_MS = 12e4;
|
|
12327
12334
|
var RUN_BOOKKEEPING = /* @__PURE__ */ new Set(["run_id", "conversation_id"]);
|
|
@@ -12403,6 +12410,12 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
12403
12410
|
here.open(pressed.record_id);
|
|
12404
12411
|
return setSaid({ kind: "ran", says: `${b.label}: a row was added and opened.` });
|
|
12405
12412
|
}
|
|
12413
|
+
if (host.openRecord && addsTo.data) {
|
|
12414
|
+
const made = addsTo.data;
|
|
12415
|
+
host.openRecord({ table: made, recordId: pressed.record_id });
|
|
12416
|
+
const read = await client.recordRead({ record_id: pressed.record_id });
|
|
12417
|
+
return setSaid({ kind: "ran", says: addRowWords(b.label, made, read.ok ? read.data.document : void 0) });
|
|
12418
|
+
}
|
|
12406
12419
|
const href = addsTo.data ? host.hrefForRecord?.({ table: addsTo.data, recordId: pressed.record_id }) : void 0;
|
|
12407
12420
|
if (href) {
|
|
12408
12421
|
setOpening(true);
|