@adoptai/genui-components 0.1.61 → 0.1.62
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/composites/decision-queue/resolver.d.ts +12 -1
- package/dist/composites/decision-queue/resolver.d.ts.map +1 -1
- package/dist/index.cjs +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/dist/renderer.cjs +25 -2
- package/dist/renderer.cjs.map +1 -1
- package/dist/renderer.js +25 -2
- package/dist/renderer.js.map +1 -1
- package/dist/resolver.cjs +25 -2
- package/dist/resolver.cjs.map +1 -1
- package/dist/resolver.js +25 -2
- package/dist/resolver.js.map +1 -1
- package/dist/tool-definitions.json +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { SchemaPayload } from "../../schemas";
|
|
2
3
|
type DecisionQueuePayload = SchemaPayload<"decision-queue">;
|
|
3
4
|
type QueueItem = DecisionQueuePayload["items"][number];
|
|
@@ -15,8 +16,18 @@ export interface DecisionQueueRendererProps {
|
|
|
15
16
|
/** Replayed / host-locked decisions; non-null = the queue is submitted. */
|
|
16
17
|
submitted?: QueueDecision[] | null;
|
|
17
18
|
onSubmit?: (decisions: QueueDecision[], message: string) => void;
|
|
19
|
+
/** Host-driven / controlled mode (used when this queue is one section of a
|
|
20
|
+
* multi-section review with a shared "Submit all" footer):
|
|
21
|
+
* - `hideSubmit` removes the queue's own submit button (the host owns it);
|
|
22
|
+
* - `submitRef` receives the internal submit trigger so the host footer can
|
|
23
|
+
* fire it (no-ops until all decided, like the button);
|
|
24
|
+
* - `onReady` reports completion + the composed message on every change so
|
|
25
|
+
* the host can gate its shared submit. */
|
|
26
|
+
hideSubmit?: boolean;
|
|
27
|
+
submitRef?: React.MutableRefObject<(() => void) | null>;
|
|
28
|
+
onReady?: (ready: boolean, message: string | null, decisions: QueueDecision[]) => void;
|
|
18
29
|
}
|
|
19
|
-
export declare function DecisionQueueRenderer({ data, submitted, onSubmit }: DecisionQueueRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function DecisionQueueRenderer({ data, submitted, onSubmit, hideSubmit, submitRef, onReady, }: DecisionQueueRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
20
31
|
export declare function DecisionQueueResolver(p: DecisionQueuePayload): import("react/jsx-runtime").JSX.Element;
|
|
21
32
|
export {};
|
|
22
33
|
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/composites/decision-queue/resolver.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/composites/decision-queue/resolver.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAMnD,KAAK,oBAAoB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAC5D,KAAK,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBD,iEAAiE;AACjE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,EAAE,EAClB,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC,GAC1C,MAAM,CAOR;AAmBD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE;;;;;;iDAM6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACxF;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,SAAgB,EAChB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,GACR,EAAE,0BAA0B,2CAsR5B;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,oBAAoB,2CAqB5D"}
|
package/dist/index.cjs
CHANGED
|
@@ -20917,7 +20917,14 @@ function amountChip(item) {
|
|
|
20917
20917
|
if (abs >= 1e3) return `${sign}$${(abs / 1e3).toFixed(abs >= 1e4 ? 0 : 1)}K`;
|
|
20918
20918
|
return `${sign}$${abs}`;
|
|
20919
20919
|
}
|
|
20920
|
-
function DecisionQueueRenderer({
|
|
20920
|
+
function DecisionQueueRenderer({
|
|
20921
|
+
data,
|
|
20922
|
+
submitted = null,
|
|
20923
|
+
onSubmit,
|
|
20924
|
+
hideSubmit,
|
|
20925
|
+
submitRef,
|
|
20926
|
+
onReady
|
|
20927
|
+
}) {
|
|
20921
20928
|
var _a2;
|
|
20922
20929
|
const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
|
|
20923
20930
|
const items = (_a2 = data.items) != null ? _a2 : [];
|
|
@@ -20950,6 +20957,22 @@ function DecisionQueueRenderer({ data, submitted = null, onSubmit }) {
|
|
|
20950
20957
|
const final = decisions;
|
|
20951
20958
|
onSubmit == null ? void 0 : onSubmit(final, composeQueueMessage(items, final));
|
|
20952
20959
|
};
|
|
20960
|
+
const onReadyRef = React45__default.default.useRef(onReady);
|
|
20961
|
+
React45__default.default.useEffect(() => {
|
|
20962
|
+
onReadyRef.current = onReady;
|
|
20963
|
+
});
|
|
20964
|
+
React45__default.default.useEffect(() => {
|
|
20965
|
+
if (!onReadyRef.current) return;
|
|
20966
|
+
const msg = allDecided ? composeQueueMessage(items, decisions) : null;
|
|
20967
|
+
onReadyRef.current(allDecided && !isSubmitted, msg, decisions.filter(Boolean));
|
|
20968
|
+
}, [decisions, allDecided, isSubmitted]);
|
|
20969
|
+
React45__default.default.useEffect(() => {
|
|
20970
|
+
if (!submitRef) return;
|
|
20971
|
+
submitRef.current = handleSubmit;
|
|
20972
|
+
return () => {
|
|
20973
|
+
submitRef.current = null;
|
|
20974
|
+
};
|
|
20975
|
+
}, [submitRef, allDecided, isSubmitted, decisions]);
|
|
20953
20976
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20954
20977
|
"div",
|
|
20955
20978
|
{
|
|
@@ -21134,7 +21157,7 @@ function DecisionQueueRenderer({ data, submitted = null, onSubmit }) {
|
|
|
21134
21157
|
isSubmitted ? /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 12.5, fontWeight: 600, color: GREEN4 }, children: [
|
|
21135
21158
|
/* @__PURE__ */ jsxRuntime.jsx(Check, { size: 14, color: GREEN4 }),
|
|
21136
21159
|
"Submitted"
|
|
21137
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
21160
|
+
] }) : hideSubmit ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
21138
21161
|
"button",
|
|
21139
21162
|
{
|
|
21140
21163
|
type: "button",
|