@ai-matrx/records-ui 0.116.57 → 0.116.59

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/index.cjs CHANGED
@@ -14721,7 +14721,11 @@ function EntityReferencePicker({
14721
14721
  onSearch: setSearch,
14722
14722
  items,
14723
14723
  notice: notice2,
14724
- empty: found.loading ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "px-2 py-1 text-[11px] text-muted-foreground", children: search.trim() ? `No ${kindWords} you can open is called \u201C${search.trim()}\u201D.` : `There is no ${kindWords} you can open yet.` }),
14724
+ empty: (
14725
+ // LINK-PICKER: a refused search is never an empty list. The refusal line above says why; "there is
14726
+ // none you can open" under it would be a second, untrue answer (the 2026-10-20 dead picker).
14727
+ found.loading || found.error ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "px-2 py-1 text-[11px] text-muted-foreground", children: search.trim() ? `No ${kindWords} you can open is called \u201C${search.trim()}\u201D.` : `There is no ${kindWords} you can open yet.` })
14728
+ ),
14725
14729
  onPick: (key) => {
14726
14730
  const r = (found.data ?? []).find((x) => `${x.token}:${x.id}` === key);
14727
14731
  if (!r) return;
@@ -52836,6 +52840,24 @@ function FormRunner(props) {
52836
52840
  }
52837
52841
  return /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(ConnectedFormRunner, { ...props });
52838
52842
  }
52843
+ var SEND_CEILING_MS = 6e4;
52844
+ async function sendWithin(send, values, ceilingMs) {
52845
+ const notLanded = (why) => ({
52846
+ ok: false,
52847
+ message: `This answer did not land: ${why} Your answers are still here; pressing send again is safe.`
52848
+ });
52849
+ let timer;
52850
+ const ceiling = new Promise((resolve) => {
52851
+ timer = setTimeout(() => resolve(notLanded("it took too long to get an answer.")), ceilingMs);
52852
+ });
52853
+ try {
52854
+ return await Promise.race([send(values), ceiling]);
52855
+ } catch {
52856
+ return notLanded("the send failed before it was answered.");
52857
+ } finally {
52858
+ if (timer) clearTimeout(timer);
52859
+ }
52860
+ }
52839
52861
  function ConnectedFormRunner(props) {
52840
52862
  const client = (0, import_react302.useOptionalRecordsClient)();
52841
52863
  const fields = (0, import_react302.useFields)(props.form.subject);
@@ -53063,7 +53085,7 @@ function FormStage({
53063
53085
  live.map((q) => [q.key, answers2[q.key] ?? null])
53064
53086
  );
53065
53087
  if (honeypotKey) values[honeypotKey] = decoy.current;
53066
- const outcome = await onSubmit(values);
53088
+ const outcome = await sendWithin(onSubmit, values, SEND_CEILING_MS);
53067
53089
  setWriting(false);
53068
53090
  if (!outcome.ok) {
53069
53091
  const inWords = (text) => questions.reduce(