@ai-matrx/records-ui 0.116.56 → 0.116.57
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 +20 -1
- package/dist/{SaveToTable-EM2JT3OS.js → SaveToTable-2TQKEYJA.js} +3 -3
- package/dist/{chunk-GZJ7GRM2.js → chunk-F3NGOSYY.js} +3 -3
- package/dist/{chunk-7LELV7UI.js → chunk-NGOPU3AJ.js} +128 -44
- package/dist/chunk-NGOPU3AJ.js.map +1 -0
- package/dist/{chunk-BZ6PLCAR.js → chunk-Y6U5OFJX.js} +2 -2
- package/dist/index.cjs +10007 -9839
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +130 -60
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +2018 -1961
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-7LELV7UI.js.map +0 -1
- /package/dist/{SaveToTable-EM2JT3OS.js.map → SaveToTable-2TQKEYJA.js.map} +0 -0
- /package/dist/{chunk-GZJ7GRM2.js.map → chunk-F3NGOSYY.js.map} +0 -0
- /package/dist/{chunk-BZ6PLCAR.js.map → chunk-Y6U5OFJX.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
### Unreleased
|
|
4
4
|
|
|
5
|
+
- **A hook that reads the store never drops a refusal (lane TABLEFACTS-SILENT, 2026-10-19).** `usePublicReadOnly` read a timed-out `table_facts` as "not public" and said nothing; thirteen sibling hooks did the same with their own reads (`useStageField`, `useFarFields`, `useStructureHidden`, `useTableDecorations`, `useChoiceOptions`, `useColumnSummaries` operations, `useLinkGroupNamer`, `useFormulaReadings`, `usePickerTables`, `useWholeTableCount`, `useRecordVersion`, `useAddedRows`, `useMemberQuestion`, `useNames`, the value counts). They now read through one shared seat (`readRefusals.tsx`: `askWithOneRetry`, `useReadRefusal`, `useReadAgain`): a refused read is asked once more by itself, then said in place as the shared timeout sentence with Try again by `ReadRefusalDock` (fixed over the page, so nothing moves; mounted by `TablePage` and `PageCanvas`), and cleared when an answer lands. Guard: `a-hook-that-reads-the-store-never-swallows-a-refusal.test.tsx` (red on 13 hooks before). Consumer action: none. Needs `@ai-matrx/records` whose memory store answers `table_facts` (a template preview otherwise shows the refusal).
|
|
5
6
|
- **"Fill N rows" in the AI fill panel; a bulk fill confirms with its points estimate (lane ENRICH-SPEED, 2026-10-19).** `EnrichPanel` gains a small number box and "Fill N rows" (1 to 50, default 3) beside "Try on 1 row", so a person can try 3 or 10 before paying for all. It runs the same `host.enrich` as "Fill in what is due" (never a second runner); 10 rows or fewer run at once, anything bigger, including "Fill in what is due" (the rows still empty, at most 50), meets a confirm step that shows the points estimate (`cost_per_row_cents` at the host's `pointsRate`, or says there is no estimate yet). New exports from `Enrich`: `FILL_TRY_MAX`, `FILL_ROWS_MAX`, `dueRowsEstimate`, `fillCountFrom`. Guard: `fill-n-rows-and-a-bulk-fill-confirms.test.tsx` (red before). Consumer action: none.
|
|
6
7
|
- **A chart view counts each option of a many-value column (CHART-READ-2, 2026-10-19).** `ChartLayout` asks the store for the split (`splitMulti: true`), so a multi-select or multi-link chart draws one bar per option / linked record instead of one per distinct combination. Guard: `a-chart-view-counts-each-option-of-a-many-value-column.test.tsx` (red before). Consumer action: none.
|
|
7
8
|
- **An AI column fills from its own header menu (lane SERVER-STORE, 2026-10-19).** The column header menu of an AI column (`source: "agent"`) draws "Fill with AI…" (`col-fill-ai`); it opens THE column's AI fill panel (`EnrichPanel`, the same one as Settings > Fields > "AI fill") in a dialog, through the new optional `GridMenuActions.fillWithAi`. Guard: `an-ai-column-fills-from-its-own-header-menu.test.tsx` (red before). Consumer action: none.
|
|
@@ -38,11 +39,29 @@
|
|
|
38
39
|
- Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
|
|
39
40
|
- **New subpath `@ai-matrx/records-ui/data-source`:** `recordsDataSource`, `personActor` and the who-changed words (`whenWords`, `actorWords`, `actorBadge`, `lastChangeSentence`, `SOMEBODY`, `THE_SYSTEM`) alone. `/helpers` also carries the field-type words, the colour resolver and the table builders, which read `@ai-matrx/records/core`; this entry reaches `@ai-matrx/kit` only, and shares the one data-source cache with `/helpers` and the root. Additive. Consumer action: a shell-reachable service that only binds its supabase client or says when imports from `/data-source`.
|
|
40
41
|
|
|
41
|
-
## 0.116.
|
|
42
|
+
## 0.116.57
|
|
42
43
|
|
|
43
44
|
UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
|
|
44
45
|
Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
|
|
45
46
|
|
|
47
|
+
## 0.116.55
|
|
48
|
+
|
|
49
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
50
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
51
|
+
Diff: `git diff 5a0efb1322 44f2cc191e -- apps/shared/records-ui/src`
|
|
52
|
+
|
|
53
|
+
Changed shipped source files (1):
|
|
54
|
+
- `apps/shared/records-ui/src/StageRules.tsx`
|
|
55
|
+
|
|
56
|
+
## 0.116.54
|
|
57
|
+
|
|
58
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
59
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
60
|
+
Diff: `git diff 339d1dfc94 5a0efb1322 -- apps/shared/records-ui/src`
|
|
61
|
+
|
|
62
|
+
Changed shipped source files (1):
|
|
63
|
+
- `apps/shared/records-ui/src/Enrich.tsx`
|
|
64
|
+
|
|
46
65
|
## 0.116.53
|
|
47
66
|
|
|
48
67
|
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
SAVE_TO_TABLE_TYPES,
|
|
5
5
|
SaveToTable,
|
|
6
6
|
shapesOfSource
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Y6U5OFJX.js";
|
|
8
8
|
import "./chunk-ABIUJCNS.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NGOPU3AJ.js";
|
|
10
10
|
import "./chunk-6Z537SLG.js";
|
|
11
11
|
import "./chunk-LBZZDHV6.js";
|
|
12
12
|
import "./chunk-4ZS4WEEE.js";
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
SaveToTable,
|
|
18
18
|
shapesOfSource
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=SaveToTable-
|
|
20
|
+
//# sourceMappingURL=SaveToTable-2TQKEYJA.js.map
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
useRecordsUi,
|
|
55
55
|
useTableRights,
|
|
56
56
|
withoutInternalCodes
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-NGOPU3AJ.js";
|
|
58
58
|
import {
|
|
59
59
|
kindItemWords,
|
|
60
60
|
kindLabel,
|
|
@@ -4790,7 +4790,7 @@ import { AlchemyMenu } from "@ai-matrx/alchemy/react";
|
|
|
4790
4790
|
import { OutboundLink as OutboundLink5 } from "@ai-matrx/kit/outbound-react";
|
|
4791
4791
|
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
4792
4792
|
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4793
|
-
var SaveToTable = lazy(() => import("./SaveToTable-
|
|
4793
|
+
var SaveToTable = lazy(() => import("./SaveToTable-2TQKEYJA.js").then((m) => ({ default: m.SaveToTable })));
|
|
4794
4794
|
var LONGEST_READ = 5e5;
|
|
4795
4795
|
var FENCE = /^```(?:json)?[ \t]*\r?\n([\s\S]*?)\r?\n?```$/;
|
|
4796
4796
|
function isPlainObject(v) {
|
|
@@ -12334,4 +12334,4 @@ export {
|
|
|
12334
12334
|
RecordNameText,
|
|
12335
12335
|
HeldChangeDecision
|
|
12336
12336
|
};
|
|
12337
|
-
//# sourceMappingURL=chunk-
|
|
12337
|
+
//# sourceMappingURL=chunk-F3NGOSYY.js.map
|
|
@@ -292,14 +292,14 @@ function withoutMachineClauses(sentence) {
|
|
|
292
292
|
});
|
|
293
293
|
dropped.push(...footnotes);
|
|
294
294
|
const clauses = withoutFootnotes.split(/(?:,\s+so\s+|\s+—\s+|\s+--\s+|\s*\|\s*)/).map((clause) => clause.trim()).filter((clause) => clause !== "");
|
|
295
|
-
const
|
|
295
|
+
const kept2 = clauses.filter((clause) => {
|
|
296
296
|
if (!isMachineIdentity(clause)) return true;
|
|
297
297
|
dropped.push(clause);
|
|
298
298
|
return false;
|
|
299
299
|
});
|
|
300
|
-
if (
|
|
300
|
+
if (kept2.length === 0) return { kept: null, dropped };
|
|
301
301
|
if (dropped.length === 0) return { kept: sentence.trim(), dropped };
|
|
302
|
-
let joined =
|
|
302
|
+
let joined = kept2.join(". ").replace(/\.\.+/g, ".").trim();
|
|
303
303
|
if (!/[.!?]$/.test(joined)) joined = `${joined}.`;
|
|
304
304
|
return { kept: joined, dropped };
|
|
305
305
|
}
|
|
@@ -316,15 +316,15 @@ function refusalSentence(error) {
|
|
|
316
316
|
}
|
|
317
317
|
function plainSentence(message) {
|
|
318
318
|
const dropped = [];
|
|
319
|
-
const
|
|
319
|
+
const kept2 = [];
|
|
320
320
|
for (const raw of message.split(/(?<=[.!?])\s+/)) {
|
|
321
321
|
const sentence = raw.trim();
|
|
322
322
|
if (sentence === "") continue;
|
|
323
323
|
const cleaned = withoutMachineClauses(sentence);
|
|
324
324
|
dropped.push(...cleaned.dropped);
|
|
325
|
-
if (cleaned.kept)
|
|
325
|
+
if (cleaned.kept) kept2.push(cleaned.kept);
|
|
326
326
|
}
|
|
327
|
-
return { kept:
|
|
327
|
+
return { kept: kept2.length === 0 ? null : kept2.join(" "), dropped };
|
|
328
328
|
}
|
|
329
329
|
function exampleOf(error) {
|
|
330
330
|
const detail = error.detail;
|
|
@@ -920,25 +920,105 @@ function madeOn(stamp) {
|
|
|
920
920
|
}
|
|
921
921
|
|
|
922
922
|
// src/tablePicking.tsx
|
|
923
|
-
import { useCallback, useEffect as
|
|
923
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useState as useState4 } from "react";
|
|
924
924
|
import { withTablePlacement } from "@ai-matrx/records";
|
|
925
925
|
import { useRecordsClient, useTables } from "@ai-matrx/records/react";
|
|
926
926
|
import { Checkbox, cn as cn5 } from "@ai-matrx/design-system";
|
|
927
|
-
|
|
927
|
+
|
|
928
|
+
// src/readRefusals.tsx
|
|
929
|
+
import { useCallback, useEffect as useEffect3, useId, useState as useState3, useSyncExternalStore } from "react";
|
|
930
|
+
import { Button as Button2, ErrorNotice } from "@ai-matrx/design-system";
|
|
931
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
932
|
+
var kept = [];
|
|
933
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
934
|
+
var docks = [];
|
|
935
|
+
var emit = () => listeners.forEach((l) => l());
|
|
936
|
+
var subscribe = (l) => {
|
|
937
|
+
listeners.add(l);
|
|
938
|
+
return () => void listeners.delete(l);
|
|
939
|
+
};
|
|
940
|
+
var READ_RETRY_PAUSE_MS = 1500;
|
|
941
|
+
async function askWithOneRetry(ask, pauseMs = READ_RETRY_PAUSE_MS) {
|
|
942
|
+
const first = await ask();
|
|
943
|
+
if (first.ok) return first;
|
|
944
|
+
await new Promise((resolve) => setTimeout(resolve, pauseMs));
|
|
945
|
+
return ask();
|
|
946
|
+
}
|
|
947
|
+
function useReadAgain() {
|
|
948
|
+
const [n, setN] = useState3(0);
|
|
949
|
+
return [n, useCallback(() => setN((v) => v + 1), [])];
|
|
950
|
+
}
|
|
951
|
+
function useReadRefusal(key) {
|
|
952
|
+
useEffect3(
|
|
953
|
+
() => () => {
|
|
954
|
+
kept = kept.filter((k) => k.key !== key);
|
|
955
|
+
emit();
|
|
956
|
+
},
|
|
957
|
+
[key]
|
|
958
|
+
);
|
|
959
|
+
const take = useCallback(
|
|
960
|
+
(answer, retry) => {
|
|
961
|
+
if (answer.ok) {
|
|
962
|
+
if (kept.some((k) => k.key === key)) {
|
|
963
|
+
kept = kept.filter((k) => k.key !== key);
|
|
964
|
+
emit();
|
|
965
|
+
}
|
|
966
|
+
return true;
|
|
967
|
+
}
|
|
968
|
+
kept = [...kept.filter((k) => k.key !== key), { key, error: answer.error, retry }];
|
|
969
|
+
if (docks.length === 0) console.error(`[records-ui] a read the screen needs was refused (${key}): ${refusalSaid(answer.error)}`);
|
|
970
|
+
emit();
|
|
971
|
+
return false;
|
|
972
|
+
},
|
|
973
|
+
[key]
|
|
974
|
+
);
|
|
975
|
+
return { take };
|
|
976
|
+
}
|
|
977
|
+
function ReadRefusalDock() {
|
|
978
|
+
const id = useId();
|
|
979
|
+
useEffect3(() => {
|
|
980
|
+
docks.push(id);
|
|
981
|
+
emit();
|
|
982
|
+
return () => {
|
|
983
|
+
const at = docks.indexOf(id);
|
|
984
|
+
if (at >= 0) docks.splice(at, 1);
|
|
985
|
+
emit();
|
|
986
|
+
};
|
|
987
|
+
}, [id]);
|
|
988
|
+
const now = useSyncExternalStore(subscribe, () => kept, () => kept);
|
|
989
|
+
if (now.length === 0 || docks[0] !== id) return null;
|
|
990
|
+
const retryAll = () => now.forEach((k) => k.retry());
|
|
991
|
+
const first = now[0];
|
|
992
|
+
return /* @__PURE__ */ jsx6("div", { "data-read-refusal-dock": "", className: "pointer-events-none fixed inset-x-0 bottom-3 z-50 flex justify-center px-3", children: /* @__PURE__ */ jsx6("div", { className: "pointer-events-auto w-full max-w-md rounded-lg border bg-background shadow-sm", children: /* @__PURE__ */ jsx6(
|
|
993
|
+
ErrorNotice,
|
|
994
|
+
{
|
|
995
|
+
size: "compact",
|
|
996
|
+
error: refusalTimedOut(first.error) ? { code: "timed_out" } : first.error,
|
|
997
|
+
message: refusalTimedOut(first.error) ? null : refusalSaid(first.error),
|
|
998
|
+
operation: `read ${first.key}`,
|
|
999
|
+
actions: /* @__PURE__ */ jsx6(Button2, { type: "button", size: "sm", variant: "outline", "data-error-retry": "", onClick: retryAll, children: "Try again" })
|
|
1000
|
+
}
|
|
1001
|
+
) }) });
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// src/tablePicking.tsx
|
|
1005
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
928
1006
|
function usePickerTables() {
|
|
929
1007
|
const client = useRecordsClient();
|
|
930
1008
|
const tables = useTables();
|
|
931
|
-
const [facts, setFacts] =
|
|
932
|
-
const [nonce, setNonce] =
|
|
1009
|
+
const [facts, setFacts] = useState4("reading");
|
|
1010
|
+
const [nonce, setNonce] = useState4(0);
|
|
933
1011
|
const reloadTables = tables.reload;
|
|
934
|
-
const reload =
|
|
1012
|
+
const reload = useCallback2(() => {
|
|
935
1013
|
reloadTables();
|
|
936
1014
|
setNonce((n) => n + 1);
|
|
937
1015
|
}, [reloadTables]);
|
|
938
|
-
|
|
1016
|
+
const reads = useReadRefusal("table_facts");
|
|
1017
|
+
useEffect4(() => {
|
|
939
1018
|
let alive = true;
|
|
940
|
-
void client.tableFacts().then((answered) => {
|
|
941
|
-
if (alive)
|
|
1019
|
+
void askWithOneRetry(() => client.tableFacts()).then((answered) => {
|
|
1020
|
+
if (!alive) return;
|
|
1021
|
+
setFacts(reads.take(answered, () => setNonce((n) => n + 1)) ? answered.data ?? null : null);
|
|
942
1022
|
});
|
|
943
1023
|
return () => {
|
|
944
1024
|
alive = false;
|
|
@@ -958,7 +1038,7 @@ function ShowListsToggle({
|
|
|
958
1038
|
}) {
|
|
959
1039
|
if (count === 0) return null;
|
|
960
1040
|
return /* @__PURE__ */ jsxs5("label", { className: cn5("flex items-center gap-1.5 text-[11px] text-muted-foreground", className), children: [
|
|
961
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ jsx7(Checkbox, { checked: on, onCheckedChange: (next) => onChange(next === true), "aria-label": "Show lists" }),
|
|
962
1042
|
"Show lists (",
|
|
963
1043
|
count,
|
|
964
1044
|
")"
|
|
@@ -1132,9 +1212,9 @@ var ABSENCE_WORD_LABEL = {
|
|
|
1132
1212
|
};
|
|
1133
1213
|
|
|
1134
1214
|
// src/FilePicker.tsx
|
|
1135
|
-
import { useCallback as
|
|
1136
|
-
import { Button as
|
|
1137
|
-
import { jsx as
|
|
1215
|
+
import { useCallback as useCallback3, useId as useId2, useRef as useRef2, useState as useState5 } from "react";
|
|
1216
|
+
import { Button as Button3, cn as cn6 } from "@ai-matrx/design-system";
|
|
1217
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1138
1218
|
function FilePicker({
|
|
1139
1219
|
label,
|
|
1140
1220
|
accept,
|
|
@@ -1146,17 +1226,17 @@ function FilePicker({
|
|
|
1146
1226
|
chosenName,
|
|
1147
1227
|
className
|
|
1148
1228
|
}) {
|
|
1149
|
-
const inputId =
|
|
1229
|
+
const inputId = useId2();
|
|
1150
1230
|
const input = useRef2(null);
|
|
1151
|
-
const [over, setOver] =
|
|
1152
|
-
const take =
|
|
1231
|
+
const [over, setOver] = useState5(false);
|
|
1232
|
+
const take = useCallback3(
|
|
1153
1233
|
(file) => {
|
|
1154
1234
|
if (!file || disabled) return;
|
|
1155
1235
|
onFile(file);
|
|
1156
1236
|
},
|
|
1157
1237
|
[disabled, onFile]
|
|
1158
1238
|
);
|
|
1159
|
-
const onDrop =
|
|
1239
|
+
const onDrop = useCallback3(
|
|
1160
1240
|
(e) => {
|
|
1161
1241
|
e.preventDefault();
|
|
1162
1242
|
setOver(false);
|
|
@@ -1186,7 +1266,7 @@ function FilePicker({
|
|
|
1186
1266
|
disabled && "opacity-60"
|
|
1187
1267
|
),
|
|
1188
1268
|
children: [
|
|
1189
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ jsx8(
|
|
1190
1270
|
"input",
|
|
1191
1271
|
{
|
|
1192
1272
|
ref: input,
|
|
@@ -1203,8 +1283,8 @@ function FilePicker({
|
|
|
1203
1283
|
}
|
|
1204
1284
|
}
|
|
1205
1285
|
),
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
|
|
1286
|
+
/* @__PURE__ */ jsx8(
|
|
1287
|
+
Button3,
|
|
1208
1288
|
{
|
|
1209
1289
|
type: "button",
|
|
1210
1290
|
size: "sm",
|
|
@@ -1214,19 +1294,19 @@ function FilePicker({
|
|
|
1214
1294
|
children: chosenName ? "Choose a different file" : label
|
|
1215
1295
|
}
|
|
1216
1296
|
),
|
|
1217
|
-
chosenName ? /* @__PURE__ */
|
|
1218
|
-
chosenName && onClear ? /* @__PURE__ */
|
|
1297
|
+
chosenName ? /* @__PURE__ */ jsx8("span", { className: "min-w-0 flex-1 truncate text-xs", title: chosenName, children: chosenName }) : /* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: "or drop it here" }),
|
|
1298
|
+
chosenName && onClear ? /* @__PURE__ */ jsx8(Button3, { type: "button", size: "sm", variant: "ghost", disabled, onClick: onClear, children: "Cancel" }) : null
|
|
1219
1299
|
]
|
|
1220
1300
|
}
|
|
1221
1301
|
),
|
|
1222
|
-
hint && !chosenName ? /* @__PURE__ */
|
|
1302
|
+
hint && !chosenName ? /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: hint }) : null
|
|
1223
1303
|
]
|
|
1224
1304
|
}
|
|
1225
1305
|
);
|
|
1226
1306
|
}
|
|
1227
1307
|
|
|
1228
1308
|
// src/choiceNudge.ts
|
|
1229
|
-
import { useEffect as
|
|
1309
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
1230
1310
|
import { useOptionalRecordsClient } from "@ai-matrx/records/react";
|
|
1231
1311
|
var asked = /* @__PURE__ */ new WeakMap();
|
|
1232
1312
|
function choiceNudgeOf(client) {
|
|
@@ -1242,8 +1322,8 @@ function choiceNudgeOf(client) {
|
|
|
1242
1322
|
}
|
|
1243
1323
|
function useChoiceNudge(enabled = true) {
|
|
1244
1324
|
const client = useOptionalRecordsClient();
|
|
1245
|
-
const [nudge, setNudge] =
|
|
1246
|
-
|
|
1325
|
+
const [nudge, setNudge] = useState6(null);
|
|
1326
|
+
useEffect5(() => {
|
|
1247
1327
|
if (!enabled || !client) return;
|
|
1248
1328
|
let live = true;
|
|
1249
1329
|
void choiceNudgeOf(client).then((answer) => {
|
|
@@ -1258,9 +1338,9 @@ function useChoiceNudge(enabled = true) {
|
|
|
1258
1338
|
}
|
|
1259
1339
|
|
|
1260
1340
|
// src/PickOne.tsx
|
|
1261
|
-
import { useState as
|
|
1341
|
+
import { useState as useState7 } from "react";
|
|
1262
1342
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, cn as cn7 } from "@ai-matrx/design-system";
|
|
1263
|
-
import { jsx as
|
|
1343
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1264
1344
|
var PICK_ONE_SEARCH_AFTER = 7;
|
|
1265
1345
|
var EMPTY = "__records_pick_one_empty__";
|
|
1266
1346
|
var inner = (v) => v === "" ? EMPTY : v;
|
|
@@ -1276,13 +1356,13 @@ function PickOne({
|
|
|
1276
1356
|
disabled,
|
|
1277
1357
|
attrs
|
|
1278
1358
|
}) {
|
|
1279
|
-
const [open, setOpen] =
|
|
1280
|
-
const [search, setSearch] =
|
|
1359
|
+
const [open, setOpen] = useState7(false);
|
|
1360
|
+
const [search, setSearch] = useState7("");
|
|
1281
1361
|
const current = options.find((o) => o.value === value);
|
|
1282
1362
|
if (options.length > PICK_ONE_SEARCH_AFTER) {
|
|
1283
1363
|
const q = search.trim().toLowerCase();
|
|
1284
1364
|
const shown = q === "" ? options : options.filter((o) => o.label.toLowerCase().includes(q));
|
|
1285
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ jsx9("span", { className: cn7("inline-flex min-w-0", className), "data-records-pick-one": "search", "data-pick-value": value, ...attrs ?? {}, children: /* @__PURE__ */ jsx9(
|
|
1286
1366
|
PickOrAdd,
|
|
1287
1367
|
{
|
|
1288
1368
|
triggerSize: "compact",
|
|
@@ -1308,12 +1388,12 @@ function PickOne({
|
|
|
1308
1388
|
setOpen(false);
|
|
1309
1389
|
setSearch("");
|
|
1310
1390
|
},
|
|
1311
|
-
empty: /* @__PURE__ */
|
|
1391
|
+
empty: /* @__PURE__ */ jsx9("p", { className: "p-2 text-xs text-muted-foreground", children: "No match" })
|
|
1312
1392
|
}
|
|
1313
1393
|
) });
|
|
1314
1394
|
}
|
|
1315
1395
|
return /* @__PURE__ */ jsxs7(Select, { value: current ? inner(current.value) : "", onValueChange: (v) => onChange(outer(v)), disabled: disabled ?? false, children: [
|
|
1316
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ jsx9(
|
|
1317
1397
|
SelectTrigger,
|
|
1318
1398
|
{
|
|
1319
1399
|
id,
|
|
@@ -1323,14 +1403,14 @@ function PickOne({
|
|
|
1323
1403
|
"data-records-pick-one": "list",
|
|
1324
1404
|
"data-pick-value": value,
|
|
1325
1405
|
...attrs ?? {},
|
|
1326
|
-
children: /* @__PURE__ */
|
|
1406
|
+
children: /* @__PURE__ */ jsx9(SelectValue, { placeholder })
|
|
1327
1407
|
}
|
|
1328
1408
|
),
|
|
1329
|
-
/* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ jsx9(SelectContent, { children: groupsOf(options).map(
|
|
1330
1410
|
([group, items]) => group ? /* @__PURE__ */ jsxs7(SelectGroup, { children: [
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
items.map((o) => /* @__PURE__ */
|
|
1333
|
-
] }, group) : items.map((o) => /* @__PURE__ */
|
|
1411
|
+
/* @__PURE__ */ jsx9(SelectLabel, { children: group }),
|
|
1412
|
+
items.map((o) => /* @__PURE__ */ jsx9(SelectItem, { value: inner(o.value), "data-pick-value": o.value, "data-pick-group": group, children: o.label }, inner(o.value)))
|
|
1413
|
+
] }, group) : items.map((o) => /* @__PURE__ */ jsx9(SelectItem, { value: inner(o.value), "data-pick-value": o.value, children: o.label }, inner(o.value)))
|
|
1334
1414
|
) })
|
|
1335
1415
|
] });
|
|
1336
1416
|
}
|
|
@@ -1400,6 +1480,10 @@ export {
|
|
|
1400
1480
|
isValueSet,
|
|
1401
1481
|
isKeptTable,
|
|
1402
1482
|
tablePickerEntries,
|
|
1483
|
+
askWithOneRetry,
|
|
1484
|
+
useReadAgain,
|
|
1485
|
+
useReadRefusal,
|
|
1486
|
+
ReadRefusalDock,
|
|
1403
1487
|
usePickerTables,
|
|
1404
1488
|
ShowListsToggle,
|
|
1405
1489
|
refusals_exports,
|
|
@@ -1436,4 +1520,4 @@ export {
|
|
|
1436
1520
|
choiceNudgeOf,
|
|
1437
1521
|
useChoiceNudge
|
|
1438
1522
|
};
|
|
1439
|
-
//# sourceMappingURL=chunk-
|
|
1523
|
+
//# sourceMappingURL=chunk-NGOPU3AJ.js.map
|