@ai-matrx/content-ir-react 0.15.1 → 0.15.2
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 +5 -0
- package/dist/directives.cjs +7 -2
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.js +7 -2
- package/dist/directives.js.map +1 -1
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +7 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +7 -2
- package/dist/react.js.map +1 -1
- package/package.json +3 -3
package/dist/react.cjs
CHANGED
|
@@ -305,6 +305,7 @@ function ApplyDirectiveButton({
|
|
|
305
305
|
readsLedger ? { status: "checking" } : { status: "idle" }
|
|
306
306
|
);
|
|
307
307
|
const [elapsed, setElapsed] = (0, import_react4.useState)(0);
|
|
308
|
+
const [askingAgain, setAskingAgain] = (0, import_react4.useState)(false);
|
|
308
309
|
const startedAt = (0, import_react4.useRef)(null);
|
|
309
310
|
const nounText = (0, import_content_ir.nounLabel)(directive.noun, host.nouns);
|
|
310
311
|
const shellKey = readsLedger ? JSON.stringify([directive.slug, items, conversationId ?? null]) : "";
|
|
@@ -369,7 +370,8 @@ function ApplyDirectiveButton({
|
|
|
369
370
|
if (!confirm) return;
|
|
370
371
|
const before = state;
|
|
371
372
|
if (host.ask) {
|
|
372
|
-
|
|
373
|
+
if (again) setAskingAgain(true);
|
|
374
|
+
else setState({ status: "asking" });
|
|
373
375
|
let ok = false;
|
|
374
376
|
try {
|
|
375
377
|
ok = await host.ask({
|
|
@@ -379,12 +381,14 @@ function ApplyDirectiveButton({
|
|
|
379
381
|
...again ? { again: true } : {}
|
|
380
382
|
});
|
|
381
383
|
} catch (error) {
|
|
384
|
+
setAskingAgain(false);
|
|
382
385
|
setState({
|
|
383
386
|
status: "error",
|
|
384
387
|
message: error instanceof Error && error.message ? error.message : "We could not ask you to confirm this, so nothing was done."
|
|
385
388
|
});
|
|
386
389
|
return;
|
|
387
390
|
}
|
|
391
|
+
setAskingAgain(false);
|
|
388
392
|
if (!ok) {
|
|
389
393
|
setState(again ? before : { status: "idle" });
|
|
390
394
|
return;
|
|
@@ -440,8 +444,9 @@ function ApplyDirectiveButton({
|
|
|
440
444
|
"button",
|
|
441
445
|
{
|
|
442
446
|
type: "button",
|
|
447
|
+
disabled: askingAgain,
|
|
443
448
|
onClick: () => void handleApply(!bad),
|
|
444
|
-
className: "inline-flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
449
|
+
className: "inline-flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50",
|
|
445
450
|
"data-apply-action": bad ? "retry" : "run-again",
|
|
446
451
|
children: [
|
|
447
452
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RotateCcwIcon, { className: "h-3 w-3" }),
|