@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/CHANGELOG.md +2 -1
- package/dist/{chunk-F3NGOSYY.js → chunk-AJVN4BMI.js} +6 -2
- package/dist/chunk-AJVN4BMI.js.map +1 -0
- package/dist/index.cjs +24 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +5 -1
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-F3NGOSYY.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
withoutAddition,
|
|
183
183
|
withoutLeadingBlank,
|
|
184
184
|
workedOutErrorFor
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-AJVN4BMI.js";
|
|
186
186
|
import {
|
|
187
187
|
CHART_PLOT_PX,
|
|
188
188
|
EMBEDDED_ROW_PX,
|
|
@@ -32051,6 +32051,24 @@ function FormRunner(props) {
|
|
|
32051
32051
|
}
|
|
32052
32052
|
return /* @__PURE__ */ jsx105(ConnectedFormRunner, { ...props });
|
|
32053
32053
|
}
|
|
32054
|
+
var SEND_CEILING_MS = 6e4;
|
|
32055
|
+
async function sendWithin(send, values, ceilingMs) {
|
|
32056
|
+
const notLanded = (why) => ({
|
|
32057
|
+
ok: false,
|
|
32058
|
+
message: `This answer did not land: ${why} Your answers are still here; pressing send again is safe.`
|
|
32059
|
+
});
|
|
32060
|
+
let timer;
|
|
32061
|
+
const ceiling = new Promise((resolve) => {
|
|
32062
|
+
timer = setTimeout(() => resolve(notLanded("it took too long to get an answer.")), ceilingMs);
|
|
32063
|
+
});
|
|
32064
|
+
try {
|
|
32065
|
+
return await Promise.race([send(values), ceiling]);
|
|
32066
|
+
} catch {
|
|
32067
|
+
return notLanded("the send failed before it was answered.");
|
|
32068
|
+
} finally {
|
|
32069
|
+
if (timer) clearTimeout(timer);
|
|
32070
|
+
}
|
|
32071
|
+
}
|
|
32054
32072
|
function ConnectedFormRunner(props) {
|
|
32055
32073
|
const client = useOptionalRecordsClient9();
|
|
32056
32074
|
const fields = useFields24(props.form.subject);
|
|
@@ -32278,7 +32296,7 @@ function FormStage({
|
|
|
32278
32296
|
live.map((q) => [q.key, answers[q.key] ?? null])
|
|
32279
32297
|
);
|
|
32280
32298
|
if (honeypotKey) values[honeypotKey] = decoy.current;
|
|
32281
|
-
const outcome = await onSubmit
|
|
32299
|
+
const outcome = await sendWithin(onSubmit, values, SEND_CEILING_MS);
|
|
32282
32300
|
setWriting(false);
|
|
32283
32301
|
if (!outcome.ok) {
|
|
32284
32302
|
const inWords = (text) => questions.reduce(
|