@wildo-ai/saas-frontend-lib 1.1.12 → 1.1.13

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.
Files changed (46) hide show
  1. package/dist/esm/components/data-display/approval-seal.d.ts +97 -0
  2. package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -0
  3. package/dist/esm/components/data-display/approval-seal.js +208 -0
  4. package/dist/esm/components/data-display/approval-seal.js.map +1 -0
  5. package/dist/esm/components/data-display/formatters/display-field-file.d.ts.map +1 -1
  6. package/dist/esm/components/data-display/formatters/display-field-file.js +16 -2
  7. package/dist/esm/components/data-display/formatters/display-field-file.js.map +1 -1
  8. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  9. package/dist/esm/components/flows-actors/approval.js +48 -18
  10. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  11. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
  12. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +5 -1
  13. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
  14. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +27 -24
  15. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
  16. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +27 -33
  17. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
  18. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts +37 -0
  19. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts.map +1 -0
  20. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js +100 -0
  21. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js.map +1 -0
  22. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts +3 -0
  23. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts.map +1 -0
  24. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js +34 -0
  25. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js.map +1 -0
  26. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts +47 -0
  27. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts.map +1 -0
  28. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js +94 -0
  29. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js.map +1 -0
  30. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +39 -0
  31. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -0
  32. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js +155 -0
  33. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -0
  34. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
  35. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +2 -0
  36. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
  37. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +34 -1
  38. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  39. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +41 -0
  40. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  41. package/dist/esm/index.d.ts +4 -0
  42. package/dist/esm/index.d.ts.map +1 -1
  43. package/dist/esm/index.js +4 -0
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/tsconfig.build.tsbuildinfo +1 -1
  46. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../../src/components/flows-actors/approval.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAE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EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,KAAK,EAAE,EAAE,CAAC,EAC5E,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC,EAChF,cAAc,EAAE,kBAAkB,EAClC,UAAU,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAChK,YAAY,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,CAAC,EACrH,aAAa,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,EACzF,aAAa,EAAE,UAAyB;QACxC,2GAA2G;QAC3G,SAAS,EAAE,SAAS,KAAK,yBAAyB,CAAC,OAAO,EAC1D,UAAU,EAAE,SAAS,KAAK,yBAAyB,CAAC,MAAM,EAC1D,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,KAC9B,KAAK,GACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n AI_ApprovalRequest,\n AI_ApprovalQueue,\n type AI_ApprovalQueueItem,\n type AI_ApprovalReasonCodeOption,\n type AI_ApprovalReassignCandidate,\n type AI_ApprovalRequestProps,\n type AI_ApprovalQueueProps,\n type AI_DecisionAnswerValue,\n type AI_DecisionQuestion,\n} from \"~wildo-frontend-lib/components/ai-elements/decision/approval\";\nimport {\n AGENT_WORK_REASON_CODE_VOCABULARY,\n ApplicationConfigVocabulary,\n FlowsActorsToolLabelSlot,\n flowsActorsToolLabelKey,\n flowsActorsToolLabelScope,\n HumanDecision_Act,\n HumanDecision_ActOutcomeKind,\n HumanDecision_Plane,\n HumanDecision_RefusalReason,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n HumanDecisionPhraseKind,\n HUMAN_DECISION_INBOX_FOCUS_PARAM,\n HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE,\n ReviewDeadlineKind,\n describeHumanDecisionCard,\n humanDecisionAsksItsOwnQuestion,\n humanDecisionOptionPhrase,\n type HumanDecisionPhrase,\n type HumanDecision_ActOutcome,\n type HumanDecision_ActRequest,\n type HumanDecision_PendingCard,\n type HumanDecision_Request,\n} from \"@wildo-ai/saas-models\";\nimport { PendingDecisionsReadState, usePendingDecisions } from \"~wildo-frontend-lib/core/flows-actors/usePendingDecisions\";\nimport { useFlowsActors } from \"~wildo-frontend-lib/core/flows-actors/useFlowsActors\";\nimport type { ComponentProps } from \"react\";\nimport type { SerializableZodSchema } from \"@wildo-ai/zod-decorators\";\nimport { FrontendComponentType, LabellingTypes, ResourceOperationTextSlot } from \"@wildo-ai/presets-components-models\"\nimport { useI18n } from \"~wildo-frontend-lib/core/i18n/useI18n\";\nimport { describeApprovalModificationRefusal } from \"~wildo-frontend-lib/components/flows-actors/approval-modification-refusal.utils\";\n\n//===============================================================\n// Flows-Actors Approval Wrappers\n//\n// Thin context-wired wrappers over the preset decision components.\n//\n// - FlowsActors_ApprovalRequest answers a decision IN its conversation, over the socket the turn runs on.\n// - FlowsActors_ApprovalQueue is the person's INBOX: every decision they may act on, read from the server\n// (#1594 D6), answered and moved over REST.\n//\n// A decision with options of its OWN — an actor system's question, with its fields — is answered in the inbox too\n// (#2526): its card carries the request, and the inbox draws its options in place of Approve and Deny and sends the\n// chosen one, with the field values, in the one answer shape. Two standalone wrappers that answered such a decision\n// outside any list (FlowsActors_DecisionRequest, FlowsActors_HumanInputRequest) had no consumer and were folded into\n// this one path; since #2539 an application raises those decisions on its own actor plane.\n//===============================================================\n\n/**\n * What an act came to, in the approval's own labels. Total over the outcome vocabulary, so an outcome added\n * tomorrow is a compile error here rather than a silent act.\n */\nfunction noticeOfOutcome(\n outcome: HumanDecision_ActOutcome,\n t: (labelRef: string, params?: Record<string, string>) => string,\n): string | undefined {\n // #3316: the arguments a refusal is about, by name: the inbox has no error payload, and the values may all be valid.\n const named = { arguments: (outcome.argumentNames ?? []).join(', ') || t(\"noticeTheseArguments\") };\n const byKind: Readonly<Record<HumanDecision_ActOutcomeKind, string | undefined>> = {\n [HumanDecision_ActOutcomeKind.APPLIED]: undefined,\n // An admitted person's refused clock act names why (#1628); anything else stays one undisclosing notice.\n // #2903: the request changed since it was read; the list just re-read shows it as it is now.\n [HumanDecision_ActOutcomeKind.NOT_ACTIONABLE]: outcome.reason === HumanDecision_RefusalReason.PRESENTATION_STALE ? t(\"noticePresentationStale\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_ALREADY_PAUSED ? t(\"noticeClockAlreadyPaused\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_NOT_PAUSED ? t(\"noticeClockNotPaused\")\n : outcome.reason === HumanDecision_RefusalReason.PAUSE_STATE_NOT_DECLARED ? t(\"noticePauseStateNotDeclared\")\n : t(\"noticeNotActionable\"),\n [HumanDecision_ActOutcomeKind.LAPSED]: t(\"noticeLapsed\"),\n [HumanDecision_ActOutcomeKind.REQUESTER_AUTHORITY_LAPSED]: t(\"noticeRequesterAuthorityLapsed\"),\n // An edit pointing the call at a record the answerer may not reach says so (#2734): the inbox gets no error payload,\n // only the outcome, so its reason is what tells a representative to put the arguments back.\n // Likewise a call that would not run as read (#3295): the values may be valid, so \"refused\" alone says nothing.\n [HumanDecision_ActOutcomeKind.MODIFICATION_REJECTED]: outcome.reason === HumanDecision_RefusalReason.EDITED_CALL_NOT_REACHABLE\n ? t(\"noticeEditedCallNotReachable\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_NOT_RUN_AS_READ\n ? t(\"noticeCallNotRunAsRead\", named)\n : outcome.reason === HumanDecision_RefusalReason.CREDENTIAL_NOT_ACCEPTED\n ? t(\"noticeCredentialNotAccepted\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_CANNOT_RUN\n ? t(\"noticeCallCannotRun\")\n : outcome.reason === HumanDecision_RefusalReason.ARGUMENTS_CANNOT_BE_CORRECTED\n ? t(\"noticeArgumentsCannotBeCorrected\", named)\n : t(\"noticeModificationRejected\"),\n [HumanDecision_ActOutcomeKind.REASON_CODE_REJECTED]: t(\"noticeReasonCodeRejected\"),\n [HumanDecision_ActOutcomeKind.CONSENT_REQUIRED]: t(\"noticeConsentRequired\"),\n [HumanDecision_ActOutcomeKind.TARGET_REFUSED]: outcome.reason === HumanDecision_RefusalReason.NO_TARGET ? t(\"noticeNoEscalationTarget\") : t(\"noticeTargetRefused\"),\n [HumanDecision_ActOutcomeKind.SUPERSEDED]: t(\"noticeSuperseded\"),\n };\n return byKind[outcome.kind];\n}\n\n/**\n * The presentation a card was read on (#2903), echoed on its answer: the server rebuilds the decision's presentation and\n * refuses an answer naming none, or one that is no longer current, so what is sealed is what this reviewer read.\n */\nfunction presentationEchoOf(decisions: readonly HumanDecision_PendingCard[], decisionRef: string): Pick<HumanDecision_ActRequest, 'presentationId'> {\n const presentationId = decisions.find((card) => card.decisionRef === decisionRef)?.presentationId;\n return presentationId ? { presentationId } : {};\n}\n\n/**\n * The reason picker's options (#1921): each declared code with its word from `system_enums.AgentWorkReasonCode.<code>`.\n *\n * The codes are the APPLICATION's (`agentWorkReview.reasonCodes`); their words live under the framework's named\n * vocabulary, where the labelling pipeline plans one key per declared code. A code nobody has worded yet shows as the\n * code itself — `tSystemEnum` answers the raw value on a miss — which is a missing label that looks missing, never words\n * invented from the identifier. Exported for the pin that holds that fallback.\n */\nexport function describeReasonCodeOptions(\n reasonCodes: readonly string[] | undefined,\n tSystemEnum: (enumName: typeof AGENT_WORK_REASON_CODE_VOCABULARY, enumValue: string) => string,\n): AI_ApprovalReasonCodeOption[] | undefined {\n if (!reasonCodes || reasonCodes.length === 0) return undefined;\n return reasonCodes.map((code) => ({ value: code, label: tSystemEnum(AGENT_WORK_REASON_CODE_VOCABULARY, code) }));\n}\n\n/**\n * A gate's pause states as the words a reviewer reads (#1864): each state's word under the framework's named vocabulary\n * `system_enums.HumanDecisionPauseState.<state>`, which the labelling pipeline plans from every gate's declared\n * `pauseStates`. A state nobody has worded yet shows as itself — `tSystemEnum` answers the raw value on a miss — a\n * missing label that looks missing. Exported for the pin that holds it.\n */\nexport function describePauseState(\n pauseState: string,\n tSystemEnum: (enumName: ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, enumValue: string) => string,\n): string {\n return tSystemEnum(ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, pauseState);\n}\n\n/**\n * The label namespaces the approval wrappers read beyond their own component: the reason codes' (#1921) and pause\n * states' (#1864) words, and the roles' (#2526 review F3) — the holder line names a role, and `roles` is not an eager\n * section, so without it every ROLE card named the role by its key.\n */\nconst APPROVAL_LABEL_NAMESPACES = [LabellingTypes.SYSTEM_ENUMS, LabellingTypes.ROLES];\n/** The chat card holds a tool approval, never an operation approval, so it loads no resource's operation titles. */\nconst NO_OPERATION_RESOURCES: readonly string[] = [];\n\n//===============================================================\n// FlowsActors_ApprovalRequest\n//\n// A decision answered in the conversation it was raised in.\n//===============================================================\n\nexport type FlowsActors_ApprovalRequestProps = Omit<\n AI_ApprovalRequestProps,\n \"approvalId\" | \"actionDescription\" | \"riskLevel\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"answerable\"\n> & {\n executionId: string;\n};\n\nexport function FlowsActors_ApprovalRequest({\n executionId,\n ...props\n}: FlowsActors_ApprovalRequestProps): React.JSX.Element | null {\n const { executions, respondToApproval, answerQuestion } = useFlowsActors();\n const [processingId, setProcessingId] = React.useState<string | null>(null);\n const execution = executions.get(executionId);\n const pendingApproval = execution?.pendingApproval;\n // The paused tool's title is loaded with the card's own words, so the card names the call as the inbox does.\n const pendingToolName = pendingApproval?.toolName;\n const toolNames = React.useMemo(() => (pendingToolName ? [pendingToolName] : []), [pendingToolName]);\n const { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum } = useHumanDecisionWords(toolNames, NO_OPERATION_RESOURCES);\n\n // Every hook runs BEFORE the early return below. React requires the same hooks on every render, and the render\n // that clears `pendingApproval` — the moment a decision is answered — used to run three fewer (#534 fourth\n // review F1).\n const handleApprove = React.useCallback((id: string, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n setProcessingId(id);\n // The reason rides only when given, so an answer without one keeps the call shape it always had.\n respondToApproval(executionId, id, true, comment, modifiedToolArgs, ...(reasonCode ? [reasonCode] : []));\n }, [executionId, respondToApproval]);\n\n const handleDeny = React.useCallback((id: string, comment?: string, reasonCode?: string) => {\n setProcessingId(id);\n if (reasonCode) respondToApproval(executionId, id, false, comment, undefined, reasonCode);\n else respondToApproval(executionId, id, false, comment);\n }, [executionId, respondToApproval]);\n\n // #2720: the agent's QUESTION is answered with the person's values, or declined — never approved.\n const handleAnswer = React.useCallback((id: string, optionRef: string, values: readonly AI_DecisionAnswerValue[], comment?: string) => {\n setProcessingId(id);\n answerQuestion(executionId, optionRef, values, comment);\n }, [executionId, answerQuestion]);\n const approvalWord = React.useCallback(\n (labelRef: string) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never),\n [tComponent],\n );\n\n // A decision answered and then handed BACK arrives as a new pending approval — a refused edit (#587), or a\n // decision the consent requirement refused (#534). Whatever this component recorded as in flight has been\n // answered, so the decision is answerable again instead of staying disabled until the view remounts.\n React.useEffect(() => {\n setProcessingId(null);\n }, [pendingApproval]);\n\n if (!execution || !pendingApproval) return null;\n\n const {\n approvalId, riskLevel, expiresAt, toolName, toolArgs, toolInputSchema, modificationRefusal,\n rejectedToolArgs, routeKind, reasonCodes, reasonCodeRefused, question, presentation,\n } = pendingApproval;\n /*\n * The card's title, in this reader's words (#3201): the decision's presentation when the server sealed one, else the\n * tool-approval title every decision surface derives (`describeHumanDecisionCard`), worded exactly as the inbox words\n * the same decision. The pause carries typed state only: the server's English `Waiting for approval to run \"<tool>\".`,\n * built from the tool's IDENTIFIER and rendered here as written, is gone from the announcement.\n */\n const actionDescription = wordHumanDecisionPhrase(\n presentation?.title ?? describeHumanDecisionCard({ plane: HumanDecision_Plane.CONVERSATIONAL, toolName: toolName ?? '' }).title,\n t, roleLabel, toolLabel, operationLabel,\n );\n /*\n * Only an OWNER-routed decision is answered here. One routed to an assignee or a role is answered by a\n * reviewer from their inbox, and the person whose conversation this is may not answer it (separation of\n * duties, #1594) — so it shows as waiting, with nothing to press that the server would refuse.\n *\n * There is no Escalate here either. It used to send a DENIAL prefixed `[ESCALATED]`, which refused the call\n * and escalated nothing; an OWNER route cannot be escalated at all, and a reviewer escalates from the inbox.\n */\n const answerable = routeKind === undefined || routeKind === HumanDecision_RouteKind.OWNER;\n\n if (question) {\n // #2720: the agent asks its person. Its questions, through their form, in place of the call and its arguments.\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={question.title}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n question={humanDecisionQuestionOf(question, approvalWord)}\n onAnswer={handleAnswer}\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n }\n\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={actionDescription}\n riskLevel={riskLevel}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n // A refused reason code leaves the approval standing (#1921): it is back on screen, and says why in its own labels.\n actionNotice={!answerable\n ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"awaitingReview\")\n : reasonCodeRefused ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"noticeReasonCodeRejected\") : undefined}\n reasonCodeOptions={answerable ? describeReasonCodeOptions(reasonCodes, tSystemEnum) : undefined}\n /*\n * The tool call is WHAT is being approved, and until #528 it did not reach the browser at all.\n * `toolArgs` are the proposed arguments — a person approving \"rename this record\" is approving\n * a specific new title, and an approval surface that hides them is asking for a signature on an\n * unread document.\n *\n * #566 built the carrier for an edited call: the payload takes `modifiedToolArgs`, the server\n * re-validates them against the tool's own `inputSchema`, re-signs the approval over them and\n * records that the decider changed them. So the editor is offered here, where the decision is\n * answered — never where it is only shown.\n */\n allowArgumentModification={answerable}\n toolName={toolName}\n // The call's line names the tool by its title, as the card's title does (#3201).\n toolLabel={toolName ? toolLabel(toolName) : undefined}\n executionContext={toolArgs}\n // #2903: the arguments as the server presented them, rendered verbatim: what the person reads is what is sealed.\n presentedArguments={pendingApproval.presentation?.fields}\n argumentsSchema={toolInputSchema}\n // The refusal in the approval's own labels, naming the tool and the offending arguments (#1186).\n argumentModificationError={modificationRefusal\n ? describeApprovalModificationRefusal(modificationRefusal, (labelRef, params) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef, params))\n : undefined}\n rejectedArguments={rejectedToolArgs}\n onApprove={handleApprove}\n onDeny={handleDeny}\n // Released by the effect above whenever the approval is handed back. Not released while the socket is\n // disconnected: `respondToApproval` then sends nothing and leaves the approval exactly as it was, so its\n // identity never changes — a stuck state that predates #534 and is cured by the view remounting.\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n}\n\n//===============================================================\n// FlowsActors_ApprovalQueue\n//\n// The person's inbox: every decision they may act on, from the server.\n//===============================================================\n\n/**\n * Who holds a listed decision now, in the approval's own words (#2526). Total over the route vocabulary.\n *\n * The inbox lists only decisions the viewer may ANSWER (#1594 I3), so an ASSIGNEE card is always assigned to the\n * viewer: \"you claimed it\" when they took it from a role, \"assigned to you\" when a resolver, a reassignment or an\n * escalation put it there. A decision a colleague claimed is not in the viewer's list at all. A ROLE card names the role\n * in the roles tree's words, never its key. Exported for the pin that holds it.\n */\nexport function describeDecisionHolder(\n route: HumanDecision_PendingCard['route'],\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n formatDateTime: (value: Date | string) => string,\n): string | undefined {\n const byKind: Readonly<Record<HumanDecision_RouteKind, () => string | undefined>> = {\n [HumanDecision_RouteKind.OWNER]: () => t(\"holderOwner\"),\n [HumanDecision_RouteKind.ASSIGNEE]: () => (route.claimedAt ? t(\"holderClaimedByYou\", { when: formatDateTime(route.claimedAt) }) : t(\"holderAssignedToYou\")),\n // A ROLE route always names its role (a gate without one stops the application at startup); none means no line.\n [HumanDecision_RouteKind.ROLE]: () => (route.eligibleRole ? t(\"holderRole\", { role: roleLabel(route.eligibleRole) }) : undefined),\n };\n return byKind[route.kind]();\n}\n\n/**\n * Who raised a listed decision, when that is worth saying (#2526). Total over the requester vocabulary.\n *\n * A person's own request needs no line: the holder line already says whose conversation it is when it is the viewer's,\n * and naming another person by id would show an identifier (naming people is #1852). What a reviewer must not miss is\n * a request with NO person behind it — an autonomous agent, raised by a machine — or one raised through an application a\n * person connected, which resumes only while that delegation holds.\n */\nconst REQUESTER_LABEL: Readonly<Record<HumanDecision_RequesterKind, string | undefined>> = {\n [HumanDecision_RequesterKind.USER]: undefined,\n [HumanDecision_RequesterKind.MACHINE]: \"requesterAutonomousAgent\",\n [HumanDecision_RequesterKind.DELEGATED_CLIENT]: \"requesterConnectedApplication\",\n};\n\nexport function describeDecisionRequester(\n requesterKind: HumanDecision_RequesterKind,\n t: (labelRef: string) => string,\n): string | undefined {\n const labelRef = REQUESTER_LABEL[requesterKind];\n return labelRef ? t(labelRef) : undefined;\n}\n\n/**\n * A phrase of the shared wording (`describeHumanDecisionCard`), in this inbox's words: an approval label through `t`, a\n * role through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation\n * through its title in the resource label tree (#2288), a host's own words as written.\n */\nfunction wordHumanDecisionPhrase(\n phrase: HumanDecisionPhrase,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n toolLabel: (toolName: string) => string,\n // With no wording function, the operation's label key: a missing label looks missing.\n operationLabel: (resourceType: string, operationIdentifier: string) => string = (resourceType, operationIdentifier) =>\n `${LabellingTypes.RESOURCES}.${resourceType}.operations.${operationIdentifier}.${ResourceOperationTextSlot.TITLE}`,\n): string {\n switch (phrase.kind) {\n case HumanDecisionPhraseKind.LABEL:\n return phrase.params\n ? t(phrase.labelRef, Object.fromEntries(Object.entries(phrase.params).map(([key, value]) => [key, typeof value === 'object' ? wordHumanDecisionPhrase(value, t, roleLabel, toolLabel, operationLabel) : String(value)])))\n : t(phrase.labelRef);\n case HumanDecisionPhraseKind.ROLE:\n return roleLabel(phrase.roleKey);\n case HumanDecisionPhraseKind.TOOL:\n return toolLabel(phrase.toolName);\n case HumanDecisionPhraseKind.RESOURCE_OPERATION:\n return operationLabel(phrase.resourceType, phrase.operationIdentifier);\n case HumanDecisionPhraseKind.TEXT:\n return phrase.text;\n default: {\n const unhandled: never = phrase;\n return unhandled;\n }\n }\n}\n\n/**\n * What one inbox card SAYS, from the wording every decision surface shares (`describeHumanDecisionCard`): the same\n * line a chat card posted for this decision carries. A tool approval also shows the tool and its proposed arguments;\n * a representative admission (#1612) and a card asking its own question show none — there is no tool call.\n */\nfunction describeInboxCard(\n card: HumanDecision_PendingCard,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string = (roleKey) => roleKey,\n toolLabel: (toolName: string) => string = (toolName) => toolName,\n operationLabel?: (resourceType: string, operationIdentifier: string) => string,\n): Pick<AI_ApprovalQueueItem, 'actionDescription' | 'toolName' | 'toolLabel' | 'executionContext' | 'presentedArguments'> {\n // #2903: the values as the server presented them, rendered verbatim, so what the reviewer reads is what is sealed.\n const presented = card.presentation ? { presentedArguments: card.presentation.fields } : {};\n const actionDescription = wordHumanDecisionPhrase(card.presentation?.title ?? describeHumanDecisionCard(card).title, t, roleLabel, toolLabel, operationLabel);\n // #2288: an operation approval shows the values the requester sent, as a tool approval shows its arguments.\n if (card.plane === HumanDecision_Plane.OPERATION_APPROVAL && card.operationApproval) {\n return { actionDescription, executionContext: card.operationApproval.requestedValues, ...presented };\n }\n const isRepresentativeAdmission = card.plane === HumanDecision_Plane.REPRESENTATIVE_ADMISSION && !!card.representativeAdmission;\n if (isRepresentativeAdmission || humanDecisionAsksItsOwnQuestion(card)) return { actionDescription };\n return { actionDescription, toolName: card.toolName, toolLabel: toolLabel(card.toolName), executionContext: card.toolArgs, ...presented };\n}\n\n/**\n * A request as the card asks it: its reason, its options and its fields with their form. An option the engine wrote is\n * worded by the approval label it names (`labelRef`, #2754), through `word` in this reader's language; any other option\n * carries the words its host wrote. The decision is the shared wording's (`humanDecisionOptionPhrase`), so the chat card,\n * the inbox and a notice cannot word one option two ways.\n */\nexport function humanDecisionQuestionOf(request: HumanDecision_Request, word: (labelRef: string) => string): AI_DecisionQuestion {\n return {\n description: request.description,\n options: request.options.map((option) => ({\n ref: option.ref,\n // An option phrase is a label or text: no role and no tool to word, so both pass through.\n label: wordHumanDecisionPhrase(humanDecisionOptionPhrase(option), word, (roleKey) => roleKey, (toolName) => toolName),\n intent: option.intent,\n ...(option.description ? { description: option.description } : {}),\n })),\n fields: request.fields,\n ...(request.form ? { form: request.form } : {}),\n };\n}\n\n/**\n * A card's own question, when it asks one (#2526): the request it carries, on a plane whose options are not the inbox's\n * Approve and Deny — or, on a plane that has those, a request that asks FIELDS, which only an agent's question to its\n * person does (#2720). `undefined` for a request the inbox words itself.\n */\nexport function decisionQuestionOf(card: Pick<HumanDecision_PendingCard, 'plane' | 'request'>, word: (labelRef: string) => string): AI_DecisionQuestion | undefined {\n if (!card.request) return undefined;\n if (!humanDecisionAsksItsOwnQuestion(card)) return undefined;\n // An option is worded by the label it names, on any plane (#2754): an agent's question and a flow's person step name\n // theirs. A host that named its own options keeps its words, whatever refs it chose (#2720 review L6).\n return humanDecisionQuestionOf(card.request, word);\n}\n\nexport type FlowsActors_ApprovalQueueProps = Omit<\n AI_ApprovalQueueProps,\n | \"items\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"onAnswer\" | \"onClaim\" | \"onUnclaim\" | \"onReassignOpen\" | \"onReassign\" | \"onPauseClock\" | \"onResumeClock\"\n | \"processingIds\" | \"isLoading\" | \"loadFailed\" | \"onRetry\"\n>;\n\n/**\n * The words a pending decision is read in, for every surface that shows one: an approval label through `t`, a role\n * through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation through its\n * title. The inbox and the chat card (#3201) both word a decision through these, so the two cannot read one decision two\n * ways, and neither shows a sentence the server wrote.\n *\n * `toolNames` and `operationResources` name the label scopes to load, so the titles are there when the card renders.\n */\nfunction useHumanDecisionWords(toolNames: readonly string[], operationResources: readonly string[]) {\n const labelKeys = React.useMemo(\n () => [...APPROVAL_LABEL_NAMESPACES, ...toolNames.map(flowsActorsToolLabelScope), ...operationResources.map((type) => `${LabellingTypes.RESOURCES}.${type}`)],\n [toolNames, operationResources],\n );\n const { t: tKey, tComponent, tRole, tSystemEnum, tResourceOperation, formatDateTime } = useI18n({ component: FrontendComponentType.LOW_LEVEL_AI_APPROVAL, keys: labelKeys });\n const t = React.useCallback(\n (labelRef: string, params?: Record<string, string>) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never, params),\n [tComponent],\n );\n // A role is worded by the roles label tree, never shown as its identifier.\n const roleLabel = React.useCallback((roleKey: string) => (tRole ? tRole(roleKey, 'label') : roleKey), [tRole]);\n // A tool by its title, as the conversation names the same call; a tool with no words yet by its name.\n const toolLabel = React.useCallback((toolName: string) => {\n const key = flowsActorsToolLabelKey(toolName, FlowsActorsToolLabelSlot.TITLE);\n const resolved = tKey(key);\n return resolved === key || resolved.length === 0 ? toolName : resolved;\n }, [tKey]);\n // An operation by its title, as the application names it everywhere; with no title generated, its key (missing looks missing).\n const operationLabel = React.useCallback(\n (resourceType: string, operationIdentifier: string) => tResourceOperation(resourceType, operationIdentifier, ResourceOperationTextSlot.TITLE),\n [tResourceOperation],\n );\n return { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum, formatDateTime };\n}\n\n/**\n * The inbox's cards with the one a link named first (#2923): a chat card that cannot answer a decision links to it here\n * (`humanDecisionInboxPathOf`), and the person lands on it. The others keep their order.\n */\nexport function withFocusedDecisionFirst<T extends { readonly decisionRef: string }>(cards: readonly T[], search: string): readonly T[] {\n const focused = new URLSearchParams(search).get(HUMAN_DECISION_INBOX_FOCUS_PARAM);\n if (!focused) return cards;\n const named = cards.filter((card) => card.decisionRef === focused);\n return named.length === 0 ? cards : [...named, ...cards.filter((card) => card.decisionRef !== focused)];\n}\n\nexport function FlowsActors_ApprovalQueue(props: FlowsActors_ApprovalQueueProps): React.JSX.Element {\n const { decisions: listed, readState, refresh, act, candidates } = usePendingDecisions();\n // #2923: a link to one decision lists it first.\n const decisions = React.useMemo(() => withFocusedDecisionFirst(listed, window.location.search), [listed]);\n // The words of every tool a listed decision would run (#2551), loaded with the inbox's own.\n const toolNames = React.useMemo(() => [...new Set(decisions.map((card) => card.toolName).filter((name): name is string => !!name))].sort(), [decisions]);\n // #2288: the resources whose held operations are listed, so each operation is named by its title.\n const operationResources = React.useMemo(\n () => [...new Set(decisions.map((card) => card.operationApproval?.resourceType).filter((type): type is string => !!type))].sort(),\n [decisions],\n );\n const { t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime } = useHumanDecisionWords(toolNames, operationResources);\n // Keyed by decisionRef: a decision is in flight from the act until its outcome returns.\n const [processing, setProcessing] = React.useState<ReadonlySet<string>>(() => new Set());\n const [notices, setNotices] = React.useState<ReadonlyMap<string, string>>(() => new Map());\n const [reassignCandidates, setReassignCandidates] = React.useState<ReadonlyMap<string, readonly AI_ApprovalReassignCandidate[]>>(() => new Map());\n\n const run = React.useCallback(async (decisionRef: string, decisionAct: HumanDecision_Act, request: HumanDecision_ActRequest) => {\n setProcessing((previous) => new Set(previous).add(decisionRef));\n try {\n const outcome = await act(decisionRef, decisionAct, request);\n const notice = noticeOfOutcome(outcome, t);\n setNotices((previous) => {\n const next = new Map(previous);\n if (notice === undefined) next.delete(decisionRef); else next.set(decisionRef, notice);\n return next;\n });\n } catch {\n // Not an outcome the server reported (a network failure): say it did not take, and leave it answerable.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n } finally {\n setProcessing((previous) => {\n const next = new Set(previous);\n next.delete(decisionRef);\n return next;\n });\n }\n }, [act, t]);\n\n const items: AI_ApprovalQueueItem[] = React.useMemo(() => decisions.map((card) => ({\n approvalId: card.decisionRef,\n executionId: card.executionId,\n systemRef: card.systemRef,\n // #2526: the assistant by its own name, never its identifier; the risk the call's GATE declares, absent when none.\n systemName: card.systemDisplayName,\n riskLevel: card.riskLevel,\n // #2526: a decision asking its own question is answered by its own options.\n question: decisionQuestionOf(card, t),\n holderNotice: describeDecisionHolder(card.route, t, roleLabel, formatDateTime),\n requesterNotice: describeDecisionRequester(card.requesterKind, t),\n ...describeInboxCard(card, t, roleLabel, toolLabel, operationLabel),\n expiresAt: card.expiresAt ? new Date(card.expiresAt) : undefined,\n createdAt: new Date(card.requestedAt),\n // Only the acts the server says this person may perform — computed with the rule every act is checked by.\n // The inbox's Escalate names nobody, so it is offered only where the gate declares where escalations go;\n // handing it to a person of the reviewer's choosing is Reassign.\n canEscalate: card.permittedActs.includes(HumanDecision_Act.ESCALATE) && card.declaresEscalationTarget,\n canClaim: card.permittedActs.includes(HumanDecision_Act.CLAIM),\n canUnclaim: card.permittedActs.includes(HumanDecision_Act.UNCLAIM),\n canReassign: card.permittedActs.includes(HumanDecision_Act.REASSIGN),\n reassignCandidates: reassignCandidates.get(card.decisionRef),\n actionNotice: notices.get(card.decisionRef),\n // #1628 — the next deadline, or why its deadlines are paused; Pause only with a declared reason to name.\n canPauseClock: card.permittedActs.includes(HumanDecision_Act.PAUSE_CLOCK) && !card.clockPause && card.pauseStates.length > 0,\n canResumeClock: card.permittedActs.includes(HumanDecision_Act.RESUME_CLOCK) && !!card.clockPause,\n // A pause state is the APPLICATION's identifier, shown as its word (#1864) — see `describePauseState`.\n pauseStateOptions: card.pauseStates.map((pauseState) => ({ value: pauseState, label: describePauseState(pauseState, tSystemEnum) })),\n deadlineNotice: card.nextDeadline\n ? t(card.nextDeadline.kind === ReviewDeadlineKind.CLAIM ? \"deadlineClaimBy\" : \"deadlineDecisionBy\", { when: formatDateTime(card.nextDeadline.dueAt) })\n : undefined,\n clockPausedNotice: card.clockPause ? t(\"clockPausedIn\", { pauseState: describePauseState(card.clockPause.pauseStateRef, tSystemEnum) }) : undefined,\n // #1921 — the reviewer may give a reason from the application's vocabulary when correcting the agent, and may\n // CORRECT it by editing the call: the act request carries `modifiedToolArgs`, which the server re-validates against\n // the tool's own schema. Only on a tool approval — a representative admission has no call to edit and no agent to correct.\n reasonCodeOptions: describeReasonCodeOptions(card.reasonCodes, tSystemEnum),\n allowArgumentModification: card.plane === HumanDecision_Plane.CONVERSATIONAL,\n argumentsSchema: card.toolInputSchema as SerializableZodSchema | undefined,\n })), [decisions, reassignCandidates, notices, t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime]);\n\n /**\n * An answer in the one answer shape: the option chosen, and no values. Which option refs \"approve\" and \"deny\" mean\n * depends on the decision's plane — a tool approval's, or a representative admission's (#1612) — so the card decides.\n */\n const answer = React.useCallback((decisionRef: string, approve: boolean, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n const plane = decisions.find((card) => card.decisionRef === decisionRef)?.plane;\n const options = plane ? HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE[plane] : undefined;\n if (!options) {\n // A plane whose options this inbox does not offer: say it cannot be answered here, and send nothing.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n return;\n }\n const optionRef = approve ? options.approve : options.deny;\n void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [] },\n // #2903: the presentation the reviewer read; the server refuses an answer naming none, or one no longer current.\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // Only when the reviewer edited the call: an absent field means \"run it as proposed\" (#566).\n ...(modifiedToolArgs ? { modifiedToolArgs } : {}),\n // Why the reviewer corrected the agent (#1921); refused with REASON_CODE_REJECTED unless the application declares it.\n ...(reasonCode ? { reasonCode } : {}),\n });\n }, [run, decisions, t]);\n\n const handleReassignOpen = React.useCallback((decisionRef: string) => {\n setReassignCandidates((previous) => {\n const next = new Map(previous);\n next.delete(decisionRef);\n return next;\n });\n void candidates(decisionRef)\n .then((people) => setReassignCandidates((previous) => new Map(previous).set(\n decisionRef,\n // The membership's email is how a same-organization reviewer tells people apart; it is data, not a label.\n people.map((person) => ({ value: person.userId, label: person.email ?? person.userId })),\n )))\n .catch(() => setReassignCandidates((previous) => new Map(previous).set(decisionRef, [])));\n }, [candidates]);\n\n return (\n <AI_ApprovalQueue\n items={items}\n onApprove={(decisionRef, comment, modifiedToolArgs, reasonCode) => answer(decisionRef, true, comment, modifiedToolArgs, reasonCode)}\n onDeny={(decisionRef, comment, reasonCode) => answer(decisionRef, false, comment, undefined, reasonCode)}\n onEscalate={(decisionRef, comment) => void run(decisionRef, HumanDecision_Act.ESCALATE, comment ? { reason: comment } : {})}\n // #2526: the option the reviewer chose and the values it carries, in the one answer shape the server checks against\n // the decision's own request (an option it never offered, or values an option does not take, is refused).\n onAnswer={(decisionRef, optionRef, values, comment, reasonCode) => void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [...values] },\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // #2539: an actor question that reviews an agent's work may carry a declared reason, as a tool approval does.\n ...(reasonCode ? { reasonCode } : {}),\n })}\n onClaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.CLAIM, {})}\n onUnclaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.UNCLAIM, {})}\n onReassignOpen={handleReassignOpen}\n onReassign={(decisionRef, targetUserId, comment) => void run(decisionRef, HumanDecision_Act.REASSIGN, { targetUserId, ...(comment ? { reason: comment } : {}) })}\n onPauseClock={(decisionRef, pauseStateRef) => void run(decisionRef, HumanDecision_Act.PAUSE_CLOCK, { pauseStateRef })}\n onResumeClock={(decisionRef) => void run(decisionRef, HumanDecision_Act.RESUME_CLOCK, {})}\n processingIds={processing as Set<string>}\n // #2526: a read still settling, and a read that failed, are states the inbox SHOWS — never an empty inbox.\n isLoading={readState === PendingDecisionsReadState.LOADING}\n loadFailed={readState === PendingDecisionsReadState.FAILED}\n onRetry={() => { void refresh(); }}\n {...props}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../../src/components/flows-actors/approval.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GAQjB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,gCAAgC,EAChC,uCAAuC,EACvC,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,EACzB,4BAA4B,GAM7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAC3H,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAGtF,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,mC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AW,CAA2F,CACxI,CAAC,IACC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n AI_ApprovalRequest,\n AI_ApprovalQueue,\n type AI_ApprovalQueueItem,\n type AI_ApprovalReasonCodeOption,\n type AI_ApprovalReassignCandidate,\n type AI_ApprovalRequestProps,\n type AI_ApprovalQueueProps,\n type AI_DecisionAnswerValue,\n type AI_DecisionQuestion,\n} from \"~wildo-frontend-lib/components/ai-elements/decision/approval\";\nimport {\n AGENT_WORK_REASON_CODE_VOCABULARY,\n ApplicationConfigVocabulary,\n FlowsActorsToolLabelSlot,\n flowsActorsToolLabelKey,\n flowsActorsToolLabelScope,\n HumanDecision_Act,\n HumanDecision_ActOutcomeKind,\n HumanDecision_Plane,\n HumanDecision_RefusalReason,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n HumanDecisionPhraseKind,\n HUMAN_DECISION_INBOX_FOCUS_PARAM,\n HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE,\n ReviewDeadlineKind,\n describeHumanDecisionCard,\n humanDecisionAsksItsOwnQuestion,\n humanDecisionOptionPhrase,\n humanDecisionPresentedRowsOf,\n type HumanDecisionPhrase,\n type HumanDecision_ActOutcome,\n type HumanDecision_ActRequest,\n type HumanDecision_PendingCard,\n type HumanDecision_Request,\n} from \"@wildo-ai/saas-models\";\nimport { PendingDecisionsReadState, usePendingDecisions } from \"~wildo-frontend-lib/core/flows-actors/usePendingDecisions\";\nimport { useFlowsActors } from \"~wildo-frontend-lib/core/flows-actors/useFlowsActors\";\nimport type { ComponentProps } from \"react\";\nimport type { SerializableZodSchema } from \"@wildo-ai/zod-decorators\";\nimport { FrontendComponentType, LabellingTypes, ResourceOperationTextSlot } from \"@wildo-ai/presets-components-models\"\nimport { useI18n } from \"~wildo-frontend-lib/core/i18n/useI18n\";\nimport { describeApprovalModificationRefusal } from \"~wildo-frontend-lib/components/flows-actors/approval-modification-refusal.utils\";\nimport { DecisionApprovalSeal } from \"~wildo-frontend-lib/components/data-display/approval-seal\";\n\n/** How many decisions answered in this inbox keep their seal shown under it, newest first (#2913). */\nconst DECIDED_SEALS_SHOWN = 5;\n\n//===============================================================\n// Flows-Actors Approval Wrappers\n//\n// Thin context-wired wrappers over the preset decision components.\n//\n// - FlowsActors_ApprovalRequest answers a decision IN its conversation, over the socket the turn runs on.\n// - FlowsActors_ApprovalQueue is the person's INBOX: every decision they may act on, read from the server\n// (#1594 D6), answered and moved over REST.\n//\n// A decision with options of its OWN — an actor system's question, with its fields — is answered in the inbox too\n// (#2526): its card carries the request, and the inbox draws its options in place of Approve and Deny and sends the\n// chosen one, with the field values, in the one answer shape. Two standalone wrappers that answered such a decision\n// outside any list (FlowsActors_DecisionRequest, FlowsActors_HumanInputRequest) had no consumer and were folded into\n// this one path; since #2539 an application raises those decisions on its own actor plane.\n//===============================================================\n\n/**\n * What an act came to, in the approval's own labels. Total over the outcome vocabulary, so an outcome added\n * tomorrow is a compile error here rather than a silent act.\n */\nfunction noticeOfOutcome(\n outcome: HumanDecision_ActOutcome,\n t: (labelRef: string, params?: Record<string, string>) => string,\n): string | undefined {\n // #3316: the arguments a refusal is about, by name: the inbox has no error payload, and the values may all be valid.\n const named = { arguments: (outcome.argumentNames ?? []).join(', ') || t(\"noticeTheseArguments\") };\n const byKind: Readonly<Record<HumanDecision_ActOutcomeKind, string | undefined>> = {\n [HumanDecision_ActOutcomeKind.APPLIED]: undefined,\n // An admitted person's refused clock act names why (#1628); anything else stays one undisclosing notice.\n // #2903: the request changed since it was read; the list just re-read shows it as it is now.\n [HumanDecision_ActOutcomeKind.NOT_ACTIONABLE]: outcome.reason === HumanDecision_RefusalReason.PRESENTATION_STALE ? t(\"noticePresentationStale\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_ALREADY_PAUSED ? t(\"noticeClockAlreadyPaused\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_NOT_PAUSED ? t(\"noticeClockNotPaused\")\n : outcome.reason === HumanDecision_RefusalReason.PAUSE_STATE_NOT_DECLARED ? t(\"noticePauseStateNotDeclared\")\n : t(\"noticeNotActionable\"),\n [HumanDecision_ActOutcomeKind.LAPSED]: t(\"noticeLapsed\"),\n [HumanDecision_ActOutcomeKind.REQUESTER_AUTHORITY_LAPSED]: t(\"noticeRequesterAuthorityLapsed\"),\n // An edit pointing the call at a record the answerer may not reach says so (#2734): the inbox gets no error payload,\n // only the outcome, so its reason is what tells a representative to put the arguments back.\n // Likewise a call that would not run as read (#3295): the values may be valid, so \"refused\" alone says nothing.\n [HumanDecision_ActOutcomeKind.MODIFICATION_REJECTED]: outcome.reason === HumanDecision_RefusalReason.EDITED_CALL_NOT_REACHABLE\n ? t(\"noticeEditedCallNotReachable\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_NOT_RUN_AS_READ\n ? t(\"noticeCallNotRunAsRead\", named)\n : outcome.reason === HumanDecision_RefusalReason.CREDENTIAL_NOT_ACCEPTED\n ? t(\"noticeCredentialNotAccepted\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_CANNOT_RUN\n ? t(\"noticeCallCannotRun\")\n : outcome.reason === HumanDecision_RefusalReason.ARGUMENTS_CANNOT_BE_CORRECTED\n ? t(\"noticeArgumentsCannotBeCorrected\", named)\n : t(\"noticeModificationRejected\"),\n [HumanDecision_ActOutcomeKind.REASON_CODE_REJECTED]: t(\"noticeReasonCodeRejected\"),\n [HumanDecision_ActOutcomeKind.CONSENT_REQUIRED]: t(\"noticeConsentRequired\"),\n [HumanDecision_ActOutcomeKind.TARGET_REFUSED]: outcome.reason === HumanDecision_RefusalReason.NO_TARGET ? t(\"noticeNoEscalationTarget\") : t(\"noticeTargetRefused\"),\n [HumanDecision_ActOutcomeKind.SUPERSEDED]: t(\"noticeSuperseded\"),\n };\n return byKind[outcome.kind];\n}\n\n/**\n * The presentation a card was read on (#2903), echoed on its answer: the server rebuilds the decision's presentation and\n * refuses an answer naming none, or one that is no longer current, so what is sealed is what this reviewer read.\n */\nfunction presentationEchoOf(decisions: readonly HumanDecision_PendingCard[], decisionRef: string): Pick<HumanDecision_ActRequest, 'presentationId'> {\n const presentationId = decisions.find((card) => card.decisionRef === decisionRef)?.presentationId;\n return presentationId ? { presentationId } : {};\n}\n\n/**\n * The reason picker's options (#1921): each declared code with its word from `system_enums.AgentWorkReasonCode.<code>`.\n *\n * The codes are the APPLICATION's (`agentWorkReview.reasonCodes`); their words live under the framework's named\n * vocabulary, where the labelling pipeline plans one key per declared code. A code nobody has worded yet shows as the\n * code itself — `tSystemEnum` answers the raw value on a miss — which is a missing label that looks missing, never words\n * invented from the identifier. Exported for the pin that holds that fallback.\n */\nexport function describeReasonCodeOptions(\n reasonCodes: readonly string[] | undefined,\n tSystemEnum: (enumName: typeof AGENT_WORK_REASON_CODE_VOCABULARY, enumValue: string) => string,\n): AI_ApprovalReasonCodeOption[] | undefined {\n if (!reasonCodes || reasonCodes.length === 0) return undefined;\n return reasonCodes.map((code) => ({ value: code, label: tSystemEnum(AGENT_WORK_REASON_CODE_VOCABULARY, code) }));\n}\n\n/**\n * A gate's pause states as the words a reviewer reads (#1864): each state's word under the framework's named vocabulary\n * `system_enums.HumanDecisionPauseState.<state>`, which the labelling pipeline plans from every gate's declared\n * `pauseStates`. A state nobody has worded yet shows as itself — `tSystemEnum` answers the raw value on a miss — a\n * missing label that looks missing. Exported for the pin that holds it.\n */\nexport function describePauseState(\n pauseState: string,\n tSystemEnum: (enumName: ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, enumValue: string) => string,\n): string {\n return tSystemEnum(ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, pauseState);\n}\n\n/**\n * The label namespaces the approval wrappers read beyond their own component: the reason codes' (#1921) and pause\n * states' (#1864) words, and the roles' (#2526 review F3) — the holder line names a role, and `roles` is not an eager\n * section, so without it every ROLE card named the role by its key.\n */\nconst APPROVAL_LABEL_NAMESPACES = [LabellingTypes.SYSTEM_ENUMS, LabellingTypes.ROLES];\n/** The chat card holds a tool approval, never an operation approval, so it loads no resource's operation titles. */\nconst NO_OPERATION_RESOURCES: readonly string[] = [];\n\n//===============================================================\n// FlowsActors_ApprovalRequest\n//\n// A decision answered in the conversation it was raised in.\n//===============================================================\n\nexport type FlowsActors_ApprovalRequestProps = Omit<\n AI_ApprovalRequestProps,\n \"approvalId\" | \"actionDescription\" | \"riskLevel\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"answerable\"\n> & {\n executionId: string;\n};\n\nexport function FlowsActors_ApprovalRequest({\n executionId,\n ...props\n}: FlowsActors_ApprovalRequestProps): React.JSX.Element | null {\n const { executions, respondToApproval, answerQuestion } = useFlowsActors();\n const [processingId, setProcessingId] = React.useState<string | null>(null);\n /**\n * #2913: the decision this card answered, kept once the card's pending decision clears so the card shows its seal in\n * its place. `shown` is what the card showed when it was answered: its decision and its title.\n */\n const [answered, setAnswered] = React.useState<{ readonly decisionRef: string; readonly title: string } | null>(null);\n const shown = React.useRef<{ readonly decisionRef: string; readonly title: string } | null>(null);\n const execution = executions.get(executionId);\n const pendingApproval = execution?.pendingApproval;\n // The paused tool's title is loaded with the card's own words, so the card names the call as the inbox does.\n const pendingToolName = pendingApproval?.toolName;\n const toolNames = React.useMemo(() => (pendingToolName ? [pendingToolName] : []), [pendingToolName]);\n const { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum } = useHumanDecisionWords(toolNames, NO_OPERATION_RESOURCES);\n\n // Every hook runs BEFORE the early return below. React requires the same hooks on every render, and the render\n // that clears `pendingApproval` — the moment a decision is answered — used to run three fewer (#534 fourth\n // review F1).\n const handleApprove = React.useCallback((id: string, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n setProcessingId(id);\n setAnswered(shown.current);\n // The reason rides only when given, so an answer without one keeps the call shape it always had.\n respondToApproval(executionId, id, true, comment, modifiedToolArgs, ...(reasonCode ? [reasonCode] : []));\n }, [executionId, respondToApproval]);\n\n const handleDeny = React.useCallback((id: string, comment?: string, reasonCode?: string) => {\n setProcessingId(id);\n setAnswered(shown.current);\n if (reasonCode) respondToApproval(executionId, id, false, comment, undefined, reasonCode);\n else respondToApproval(executionId, id, false, comment);\n }, [executionId, respondToApproval]);\n\n // #2720: the agent's QUESTION is answered with the person's values, or declined — never approved.\n const handleAnswer = React.useCallback((id: string, optionRef: string, values: readonly AI_DecisionAnswerValue[], comment?: string) => {\n setProcessingId(id);\n setAnswered(shown.current);\n answerQuestion(executionId, optionRef, values, comment);\n }, [executionId, answerQuestion]);\n const approvalWord = React.useCallback(\n (labelRef: string) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never),\n [tComponent],\n );\n\n // A decision answered and then handed BACK arrives as a new pending approval — a refused edit (#587), or a\n // decision the consent requirement refused (#534). Whatever this component recorded as in flight has been\n // answered, so the decision is answerable again instead of staying disabled until the view remounts.\n React.useEffect(() => {\n setProcessingId(null);\n }, [pendingApproval]);\n\n if (!execution || !pendingApproval) {\n // Answered here and gone from the pending state: the seal of that answer, signed seconds later (#2913). A decision that\n // sealed nothing (or one answered by someone else) answers 404, and the card draws nothing, as before.\n return answered ? <DecisionApprovalSeal decisionRef={answered.decisionRef} description={answered.title} /> : null;\n }\n\n const {\n approvalId, riskLevel, expiresAt, toolName, toolArgs, toolInputSchema, modificationRefusal,\n rejectedToolArgs, routeKind, reasonCodes, reasonCodeRefused, question, presentation,\n } = pendingApproval;\n /*\n * The card's title, in this reader's words (#3201): the decision's presentation when the server sealed one, else the\n * tool-approval title every decision surface derives (`describeHumanDecisionCard`), worded exactly as the inbox words\n * the same decision. The pause carries typed state only: the server's English `Waiting for approval to run \"<tool>\".`,\n * built from the tool's IDENTIFIER and rendered here as written, is gone from the announcement.\n */\n const actionDescription = wordHumanDecisionPhrase(\n presentation?.title ?? describeHumanDecisionCard({ plane: HumanDecision_Plane.CONVERSATIONAL, toolName: toolName ?? '' }).title,\n t, roleLabel, toolLabel, operationLabel,\n );\n shown.current = pendingApproval.decisionRef ? { decisionRef: pendingApproval.decisionRef, title: actionDescription } : null;\n /*\n * Only an OWNER-routed decision is answered here. One routed to an assignee or a role is answered by a\n * reviewer from their inbox, and the person whose conversation this is may not answer it (separation of\n * duties, #1594) — so it shows as waiting, with nothing to press that the server would refuse.\n *\n * There is no Escalate here either. It used to send a DENIAL prefixed `[ESCALATED]`, which refused the call\n * and escalated nothing; an OWNER route cannot be escalated at all, and a reviewer escalates from the inbox.\n */\n const answerable = routeKind === undefined || routeKind === HumanDecision_RouteKind.OWNER;\n\n if (question) {\n // #2720: the agent asks its person. Its questions, through their form, in place of the call and its arguments.\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={question.title}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n question={humanDecisionQuestionOf(question, approvalWord)}\n onAnswer={handleAnswer}\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n }\n\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={actionDescription}\n riskLevel={riskLevel}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n // A refused reason code leaves the approval standing (#1921): it is back on screen, and says why in its own labels.\n actionNotice={!answerable\n ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"awaitingReview\")\n : reasonCodeRefused ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"noticeReasonCodeRejected\") : undefined}\n reasonCodeOptions={answerable ? describeReasonCodeOptions(reasonCodes, tSystemEnum) : undefined}\n /*\n * The tool call is WHAT is being approved, and until #528 it did not reach the browser at all.\n * `toolArgs` are the proposed arguments — a person approving \"rename this record\" is approving\n * a specific new title, and an approval surface that hides them is asking for a signature on an\n * unread document.\n *\n * #566 built the carrier for an edited call: the payload takes `modifiedToolArgs`, the server\n * re-validates them against the tool's own `inputSchema`, re-signs the approval over them and\n * records that the decider changed them. So the editor is offered here, where the decision is\n * answered — never where it is only shown.\n */\n allowArgumentModification={answerable}\n toolName={toolName}\n // The call's line names the tool by its title, as the card's title does (#3201).\n toolLabel={toolName ? toolLabel(toolName) : undefined}\n executionContext={toolArgs}\n // #2903: the arguments as the server presented them, rendered verbatim: what the person reads is what is sealed.\n // #2914: then the values of the record the approval covers, which the seal binds too.\n presentedArguments={pendingApproval.presentation ? humanDecisionPresentedRowsOf(pendingApproval.presentation) : undefined}\n argumentsSchema={toolInputSchema}\n // The refusal in the approval's own labels, naming the tool and the offending arguments (#1186).\n argumentModificationError={modificationRefusal\n ? describeApprovalModificationRefusal(modificationRefusal, (labelRef, params) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef, params))\n : undefined}\n rejectedArguments={rejectedToolArgs}\n onApprove={handleApprove}\n onDeny={handleDeny}\n // Released by the effect above whenever the approval is handed back. Not released while the socket is\n // disconnected: `respondToApproval` then sends nothing and leaves the approval exactly as it was, so its\n // identity never changes — a stuck state that predates #534 and is cured by the view remounting.\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n}\n\n//===============================================================\n// FlowsActors_ApprovalQueue\n//\n// The person's inbox: every decision they may act on, from the server.\n//===============================================================\n\n/**\n * Who holds a listed decision now, in the approval's own words (#2526). Total over the route vocabulary.\n *\n * The inbox lists only decisions the viewer may ANSWER (#1594 I3), so an ASSIGNEE card is always assigned to the\n * viewer: \"you claimed it\" when they took it from a role, \"assigned to you\" when a resolver, a reassignment or an\n * escalation put it there. A decision a colleague claimed is not in the viewer's list at all. A ROLE card names the role\n * in the roles tree's words, never its key. Exported for the pin that holds it.\n */\nexport function describeDecisionHolder(\n route: HumanDecision_PendingCard['route'],\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n formatDateTime: (value: Date | string) => string,\n): string | undefined {\n const byKind: Readonly<Record<HumanDecision_RouteKind, () => string | undefined>> = {\n [HumanDecision_RouteKind.OWNER]: () => t(\"holderOwner\"),\n [HumanDecision_RouteKind.ASSIGNEE]: () => (route.claimedAt ? t(\"holderClaimedByYou\", { when: formatDateTime(route.claimedAt) }) : t(\"holderAssignedToYou\")),\n // A ROLE route always names its role (a gate without one stops the application at startup); none means no line.\n [HumanDecision_RouteKind.ROLE]: () => (route.eligibleRole ? t(\"holderRole\", { role: roleLabel(route.eligibleRole) }) : undefined),\n };\n return byKind[route.kind]();\n}\n\n/**\n * Who raised a listed decision, when that is worth saying (#2526). Total over the requester vocabulary.\n *\n * A person's own request needs no line: the holder line already says whose conversation it is when it is the viewer's,\n * and naming another person by id would show an identifier (naming people is #1852). What a reviewer must not miss is\n * a request with NO person behind it — an autonomous agent, raised by a machine — or one raised through an application a\n * person connected, which resumes only while that delegation holds.\n */\nconst REQUESTER_LABEL: Readonly<Record<HumanDecision_RequesterKind, string | undefined>> = {\n [HumanDecision_RequesterKind.USER]: undefined,\n [HumanDecision_RequesterKind.MACHINE]: \"requesterAutonomousAgent\",\n [HumanDecision_RequesterKind.DELEGATED_CLIENT]: \"requesterConnectedApplication\",\n};\n\nexport function describeDecisionRequester(\n requesterKind: HumanDecision_RequesterKind,\n t: (labelRef: string) => string,\n): string | undefined {\n const labelRef = REQUESTER_LABEL[requesterKind];\n return labelRef ? t(labelRef) : undefined;\n}\n\n/**\n * A phrase of the shared wording (`describeHumanDecisionCard`), in this inbox's words: an approval label through `t`, a\n * role through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation\n * through its title in the resource label tree (#2288), a host's own words as written.\n */\nfunction wordHumanDecisionPhrase(\n phrase: HumanDecisionPhrase,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n toolLabel: (toolName: string) => string,\n // With no wording function, the operation's label key: a missing label looks missing.\n operationLabel: (resourceType: string, operationIdentifier: string) => string = (resourceType, operationIdentifier) =>\n `${LabellingTypes.RESOURCES}.${resourceType}.operations.${operationIdentifier}.${ResourceOperationTextSlot.TITLE}`,\n): string {\n switch (phrase.kind) {\n case HumanDecisionPhraseKind.LABEL:\n return phrase.params\n ? t(phrase.labelRef, Object.fromEntries(Object.entries(phrase.params).map(([key, value]) => [key, typeof value === 'object' ? wordHumanDecisionPhrase(value, t, roleLabel, toolLabel, operationLabel) : String(value)])))\n : t(phrase.labelRef);\n case HumanDecisionPhraseKind.ROLE:\n return roleLabel(phrase.roleKey);\n case HumanDecisionPhraseKind.TOOL:\n return toolLabel(phrase.toolName);\n case HumanDecisionPhraseKind.RESOURCE_OPERATION:\n return operationLabel(phrase.resourceType, phrase.operationIdentifier);\n case HumanDecisionPhraseKind.TEXT:\n return phrase.text;\n default: {\n const unhandled: never = phrase;\n return unhandled;\n }\n }\n}\n\n/**\n * What one inbox card SAYS, from the wording every decision surface shares (`describeHumanDecisionCard`): the same\n * line a chat card posted for this decision carries. A tool approval also shows the tool and its proposed arguments;\n * a representative admission (#1612) and a card asking its own question show none — there is no tool call.\n */\nfunction describeInboxCard(\n card: HumanDecision_PendingCard,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string = (roleKey) => roleKey,\n toolLabel: (toolName: string) => string = (toolName) => toolName,\n operationLabel?: (resourceType: string, operationIdentifier: string) => string,\n): Pick<AI_ApprovalQueueItem, 'actionDescription' | 'toolName' | 'toolLabel' | 'executionContext' | 'presentedArguments'> {\n // #2903: the values as the server presented them, rendered verbatim, so what the reviewer reads is what is sealed.\n // #2914: with the values of the record the approval covers.\n const presented = card.presentation ? { presentedArguments: humanDecisionPresentedRowsOf(card.presentation) } : {};\n const actionDescription = wordHumanDecisionPhrase(card.presentation?.title ?? describeHumanDecisionCard(card).title, t, roleLabel, toolLabel, operationLabel);\n // #2288: an operation approval shows the values the requester sent, as a tool approval shows its arguments.\n if (card.plane === HumanDecision_Plane.OPERATION_APPROVAL && card.operationApproval) {\n return { actionDescription, executionContext: card.operationApproval.requestedValues, ...presented };\n }\n const isRepresentativeAdmission = card.plane === HumanDecision_Plane.REPRESENTATIVE_ADMISSION && !!card.representativeAdmission;\n if (isRepresentativeAdmission || humanDecisionAsksItsOwnQuestion(card)) return { actionDescription };\n return { actionDescription, toolName: card.toolName, toolLabel: toolLabel(card.toolName), executionContext: card.toolArgs, ...presented };\n}\n\n/**\n * A request as the card asks it: its reason, its options and its fields with their form. An option the engine wrote is\n * worded by the approval label it names (`labelRef`, #2754), through `word` in this reader's language; any other option\n * carries the words its host wrote. The decision is the shared wording's (`humanDecisionOptionPhrase`), so the chat card,\n * the inbox and a notice cannot word one option two ways.\n */\nexport function humanDecisionQuestionOf(request: HumanDecision_Request, word: (labelRef: string) => string): AI_DecisionQuestion {\n return {\n description: request.description,\n options: request.options.map((option) => ({\n ref: option.ref,\n // An option phrase is a label or text: no role and no tool to word, so both pass through.\n label: wordHumanDecisionPhrase(humanDecisionOptionPhrase(option), word, (roleKey) => roleKey, (toolName) => toolName),\n intent: option.intent,\n ...(option.description ? { description: option.description } : {}),\n })),\n fields: request.fields,\n ...(request.form ? { form: request.form } : {}),\n };\n}\n\n/**\n * A card's own question, when it asks one (#2526): the request it carries, on a plane whose options are not the inbox's\n * Approve and Deny — or, on a plane that has those, a request that asks FIELDS, which only an agent's question to its\n * person does (#2720). `undefined` for a request the inbox words itself.\n */\nexport function decisionQuestionOf(card: Pick<HumanDecision_PendingCard, 'plane' | 'request'>, word: (labelRef: string) => string): AI_DecisionQuestion | undefined {\n if (!card.request) return undefined;\n if (!humanDecisionAsksItsOwnQuestion(card)) return undefined;\n // An option is worded by the label it names, on any plane (#2754): an agent's question and a flow's person step name\n // theirs. A host that named its own options keeps its words, whatever refs it chose (#2720 review L6).\n return humanDecisionQuestionOf(card.request, word);\n}\n\nexport type FlowsActors_ApprovalQueueProps = Omit<\n AI_ApprovalQueueProps,\n | \"items\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"onAnswer\" | \"onClaim\" | \"onUnclaim\" | \"onReassignOpen\" | \"onReassign\" | \"onPauseClock\" | \"onResumeClock\"\n | \"processingIds\" | \"isLoading\" | \"loadFailed\" | \"onRetry\"\n>;\n\n/**\n * The words a pending decision is read in, for every surface that shows one: an approval label through `t`, a role\n * through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation through its\n * title. The inbox and the chat card (#3201) both word a decision through these, so the two cannot read one decision two\n * ways, and neither shows a sentence the server wrote.\n *\n * `toolNames` and `operationResources` name the label scopes to load, so the titles are there when the card renders.\n */\nfunction useHumanDecisionWords(toolNames: readonly string[], operationResources: readonly string[]) {\n const labelKeys = React.useMemo(\n () => [...APPROVAL_LABEL_NAMESPACES, ...toolNames.map(flowsActorsToolLabelScope), ...operationResources.map((type) => `${LabellingTypes.RESOURCES}.${type}`)],\n [toolNames, operationResources],\n );\n const { t: tKey, tComponent, tRole, tSystemEnum, tResourceOperation, formatDateTime } = useI18n({ component: FrontendComponentType.LOW_LEVEL_AI_APPROVAL, keys: labelKeys });\n const t = React.useCallback(\n (labelRef: string, params?: Record<string, string>) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never, params),\n [tComponent],\n );\n // A role is worded by the roles label tree, never shown as its identifier.\n const roleLabel = React.useCallback((roleKey: string) => (tRole ? tRole(roleKey, 'label') : roleKey), [tRole]);\n // A tool by its title, as the conversation names the same call; a tool with no words yet by its name.\n const toolLabel = React.useCallback((toolName: string) => {\n const key = flowsActorsToolLabelKey(toolName, FlowsActorsToolLabelSlot.TITLE);\n const resolved = tKey(key);\n return resolved === key || resolved.length === 0 ? toolName : resolved;\n }, [tKey]);\n // An operation by its title, as the application names it everywhere; with no title generated, its key (missing looks missing).\n const operationLabel = React.useCallback(\n (resourceType: string, operationIdentifier: string) => tResourceOperation(resourceType, operationIdentifier, ResourceOperationTextSlot.TITLE),\n [tResourceOperation],\n );\n return { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum, formatDateTime };\n}\n\n/**\n * The inbox's cards with the one a link named first (#2923): a chat card that cannot answer a decision links to it here\n * (`humanDecisionInboxPathOf`), and the person lands on it. The others keep their order.\n */\nexport function withFocusedDecisionFirst<T extends { readonly decisionRef: string }>(cards: readonly T[], search: string): readonly T[] {\n const focused = new URLSearchParams(search).get(HUMAN_DECISION_INBOX_FOCUS_PARAM);\n if (!focused) return cards;\n const named = cards.filter((card) => card.decisionRef === focused);\n return named.length === 0 ? cards : [...named, ...cards.filter((card) => card.decisionRef !== focused)];\n}\n\nexport function FlowsActors_ApprovalQueue(props: FlowsActors_ApprovalQueueProps): React.JSX.Element {\n const { decisions: listed, readState, refresh, act, candidates } = usePendingDecisions();\n // #2923: a link to one decision lists it first.\n const decisions = React.useMemo(() => withFocusedDecisionFirst(listed, window.location.search), [listed]);\n // The words of every tool a listed decision would run (#2551), loaded with the inbox's own.\n const toolNames = React.useMemo(() => [...new Set(decisions.map((card) => card.toolName).filter((name): name is string => !!name))].sort(), [decisions]);\n // #2288: the resources whose held operations are listed, so each operation is named by its title.\n const operationResources = React.useMemo(\n () => [...new Set(decisions.map((card) => card.operationApproval?.resourceType).filter((type): type is string => !!type))].sort(),\n [decisions],\n );\n const { t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime } = useHumanDecisionWords(toolNames, operationResources);\n // Keyed by decisionRef: a decision is in flight from the act until its outcome returns.\n const [processing, setProcessing] = React.useState<ReadonlySet<string>>(() => new Set());\n const [notices, setNotices] = React.useState<ReadonlyMap<string, string>>(() => new Map());\n const [reassignCandidates, setReassignCandidates] = React.useState<ReadonlyMap<string, readonly AI_ApprovalReassignCandidate[]>>(() => new Map());\n /**\n * #2913: the decisions this person answered here. An answered card leaves the pending list, so its seal is shown under\n * the list instead: signed seconds after the answer, then current or not over the record it is about. Each keeps the\n * title its card showed, read from `cardTitles` when the answer was sent.\n */\n const [decided, setDecided] = React.useState<ReadonlyArray<{ readonly decisionRef: string; readonly title?: string }>>([]);\n const cardTitles = React.useRef<ReadonlyMap<string, string>>(new Map());\n\n const run = React.useCallback(async (decisionRef: string, decisionAct: HumanDecision_Act, request: HumanDecision_ActRequest) => {\n setProcessing((previous) => new Set(previous).add(decisionRef));\n const title = cardTitles.current.get(decisionRef);\n try {\n const outcome = await act(decisionRef, decisionAct, request);\n if (decisionAct === HumanDecision_Act.ANSWER && outcome.kind === HumanDecision_ActOutcomeKind.APPLIED) {\n setDecided((previous) => [{ decisionRef, ...(title ? { title } : {}) }, ...previous.filter((entry) => entry.decisionRef !== decisionRef)].slice(0, DECIDED_SEALS_SHOWN));\n }\n const notice = noticeOfOutcome(outcome, t);\n setNotices((previous) => {\n const next = new Map(previous);\n if (notice === undefined) next.delete(decisionRef); else next.set(decisionRef, notice);\n return next;\n });\n } catch {\n // Not an outcome the server reported (a network failure): say it did not take, and leave it answerable.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n } finally {\n setProcessing((previous) => {\n const next = new Set(previous);\n next.delete(decisionRef);\n return next;\n });\n }\n }, [act, t]);\n\n const items: AI_ApprovalQueueItem[] = React.useMemo(() => decisions.map((card) => ({\n approvalId: card.decisionRef,\n executionId: card.executionId,\n systemRef: card.systemRef,\n // #2526: the assistant by its own name, never its identifier; the risk the call's GATE declares, absent when none.\n systemName: card.systemDisplayName,\n riskLevel: card.riskLevel,\n // #2526: a decision asking its own question is answered by its own options.\n question: decisionQuestionOf(card, t),\n holderNotice: describeDecisionHolder(card.route, t, roleLabel, formatDateTime),\n requesterNotice: describeDecisionRequester(card.requesterKind, t),\n ...describeInboxCard(card, t, roleLabel, toolLabel, operationLabel),\n expiresAt: card.expiresAt ? new Date(card.expiresAt) : undefined,\n createdAt: new Date(card.requestedAt),\n // Only the acts the server says this person may perform — computed with the rule every act is checked by.\n // The inbox's Escalate names nobody, so it is offered only where the gate declares where escalations go;\n // handing it to a person of the reviewer's choosing is Reassign.\n canEscalate: card.permittedActs.includes(HumanDecision_Act.ESCALATE) && card.declaresEscalationTarget,\n canClaim: card.permittedActs.includes(HumanDecision_Act.CLAIM),\n canUnclaim: card.permittedActs.includes(HumanDecision_Act.UNCLAIM),\n canReassign: card.permittedActs.includes(HumanDecision_Act.REASSIGN),\n reassignCandidates: reassignCandidates.get(card.decisionRef),\n actionNotice: notices.get(card.decisionRef),\n // #1628 — the next deadline, or why its deadlines are paused; Pause only with a declared reason to name.\n canPauseClock: card.permittedActs.includes(HumanDecision_Act.PAUSE_CLOCK) && !card.clockPause && card.pauseStates.length > 0,\n canResumeClock: card.permittedActs.includes(HumanDecision_Act.RESUME_CLOCK) && !!card.clockPause,\n // A pause state is the APPLICATION's identifier, shown as its word (#1864) — see `describePauseState`.\n pauseStateOptions: card.pauseStates.map((pauseState) => ({ value: pauseState, label: describePauseState(pauseState, tSystemEnum) })),\n deadlineNotice: card.nextDeadline\n ? t(card.nextDeadline.kind === ReviewDeadlineKind.CLAIM ? \"deadlineClaimBy\" : \"deadlineDecisionBy\", { when: formatDateTime(card.nextDeadline.dueAt) })\n : undefined,\n clockPausedNotice: card.clockPause ? t(\"clockPausedIn\", { pauseState: describePauseState(card.clockPause.pauseStateRef, tSystemEnum) }) : undefined,\n // #1921 — the reviewer may give a reason from the application's vocabulary when correcting the agent, and may\n // CORRECT it by editing the call: the act request carries `modifiedToolArgs`, which the server re-validates against\n // the tool's own schema. Only on a tool approval — a representative admission has no call to edit and no agent to correct.\n reasonCodeOptions: describeReasonCodeOptions(card.reasonCodes, tSystemEnum),\n allowArgumentModification: card.plane === HumanDecision_Plane.CONVERSATIONAL,\n argumentsSchema: card.toolInputSchema as SerializableZodSchema | undefined,\n })), [decisions, reassignCandidates, notices, t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime]);\n cardTitles.current = new Map(items.flatMap((item) => (typeof item.actionDescription === 'string' ? [[item.approvalId, item.actionDescription] as const] : [])));\n\n /**\n * An answer in the one answer shape: the option chosen, and no values. Which option refs \"approve\" and \"deny\" mean\n * depends on the decision's plane — a tool approval's, or a representative admission's (#1612) — so the card decides.\n */\n const answer = React.useCallback((decisionRef: string, approve: boolean, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n const plane = decisions.find((card) => card.decisionRef === decisionRef)?.plane;\n const options = plane ? HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE[plane] : undefined;\n if (!options) {\n // A plane whose options this inbox does not offer: say it cannot be answered here, and send nothing.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n return;\n }\n const optionRef = approve ? options.approve : options.deny;\n void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [] },\n // #2903: the presentation the reviewer read; the server refuses an answer naming none, or one no longer current.\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // Only when the reviewer edited the call: an absent field means \"run it as proposed\" (#566).\n ...(modifiedToolArgs ? { modifiedToolArgs } : {}),\n // Why the reviewer corrected the agent (#1921); refused with REASON_CODE_REJECTED unless the application declares it.\n ...(reasonCode ? { reasonCode } : {}),\n });\n }, [run, decisions, t]);\n\n const handleReassignOpen = React.useCallback((decisionRef: string) => {\n setReassignCandidates((previous) => {\n const next = new Map(previous);\n next.delete(decisionRef);\n return next;\n });\n void candidates(decisionRef)\n .then((people) => setReassignCandidates((previous) => new Map(previous).set(\n decisionRef,\n // The membership's email is how a same-organization reviewer tells people apart; it is data, not a label.\n people.map((person) => ({ value: person.userId, label: person.email ?? person.userId })),\n )))\n .catch(() => setReassignCandidates((previous) => new Map(previous).set(decisionRef, [])));\n }, [candidates]);\n\n return (\n <>\n <AI_ApprovalQueue\n items={items}\n onApprove={(decisionRef, comment, modifiedToolArgs, reasonCode) => answer(decisionRef, true, comment, modifiedToolArgs, reasonCode)}\n onDeny={(decisionRef, comment, reasonCode) => answer(decisionRef, false, comment, undefined, reasonCode)}\n onEscalate={(decisionRef, comment) => void run(decisionRef, HumanDecision_Act.ESCALATE, comment ? { reason: comment } : {})}\n // #2526: the option the reviewer chose and the values it carries, in the one answer shape the server checks against\n // the decision's own request (an option it never offered, or values an option does not take, is refused).\n onAnswer={(decisionRef, optionRef, values, comment, reasonCode) => void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [...values] },\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // #2539: an actor question that reviews an agent's work may carry a declared reason, as a tool approval does.\n ...(reasonCode ? { reasonCode } : {}),\n })}\n onClaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.CLAIM, {})}\n onUnclaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.UNCLAIM, {})}\n onReassignOpen={handleReassignOpen}\n onReassign={(decisionRef, targetUserId, comment) => void run(decisionRef, HumanDecision_Act.REASSIGN, { targetUserId, ...(comment ? { reason: comment } : {}) })}\n onPauseClock={(decisionRef, pauseStateRef) => void run(decisionRef, HumanDecision_Act.PAUSE_CLOCK, { pauseStateRef })}\n onResumeClock={(decisionRef) => void run(decisionRef, HumanDecision_Act.RESUME_CLOCK, {})}\n processingIds={processing as Set<string>}\n // #2526: a read still settling, and a read that failed, are states the inbox SHOWS — never an empty inbox.\n isLoading={readState === PendingDecisionsReadState.LOADING}\n loadFailed={readState === PendingDecisionsReadState.FAILED}\n onRetry={() => { void refresh(); }}\n {...props}\n />\n {decided.map((entry) => (\n <DecisionApprovalSeal key={entry.decisionRef} decisionRef={entry.decisionRef} {...(entry.title ? { description: entry.title } : {})} />\n ))}\n </>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceCollectionBody_Calendar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/collection/calendar/ResourceCollectionBody_Calendar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAM/E,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,iGAAiG,CAAC;AAEzG,MAAM,WAAW,oCAAoC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzF,mEAAmE;IACnE,KAAK,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC;IAC/C,mFAAmF;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V,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,YAAY,GACb,EAAE,oCAAoC,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAoJjE"}
1
+ {"version":3,"file":"ResourceCollectionBody_Calendar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/collection/calendar/ResourceCollectionBody_Calendar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAO/E,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,iGAAiG,CAAC;AAEzG,MAAM,WAAW,oCAAoC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzF,mEAAmE;IACnE,KAAK,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC;IAC/C,mFAAmF;IACnF,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC,CAAC;IAClD,6DAA6D;IAC7D,KAAK,EAAE,IAAI,CAAC;IACZ,kDAAkD;IAClD,KAAK,EAAE,IAAI,CAAC;IACZ,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,sCAAsC;IACtC,cAAc,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,CAAC;IACtC,4EAA4E;IAC5E,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACnC,yCAAyC;IACzC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACtC,2FAA2F;IAC3F,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;IACtC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAID,wBAAgB,+BAA+B,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACrF,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,YAAY,GACb,EAAE,oCAAoC,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAuJjE"}
@@ -17,6 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  import { useCallback, useEffect, useId, useRef, useState } from 'react';
18
18
  import { ButtonSize } from '@wildo-ai/presets-components-models';
19
19
  import { cn } from '../../../../core/ui/cn.js';
20
+ import { focusIndicatorClasses, FocusIndicatorShape } from '../../../../core/ui/themes/focus-indicator.js';
20
21
  import { Button, ButtonVariants_Variant } from '../../../../components/actions/button.js';
21
22
  import { useIconRegistry } from '../../../../core/icons/useIconRegistry.js';
22
23
  import { IconSize, StandardIconReference } from '../../../../core/icons/icon-registry.frontend.schemas.js';
@@ -64,7 +65,10 @@ export function ResourceCollectionBody_Calendar({ weeks, itemsByDay, month, toda
64
65
  const items = itemsByDay.get(key) ?? NO_ITEMS;
65
66
  const isFocused = key === focusedKey;
66
67
  return (_jsxs("td", { role: "gridcell", "data-calendar-day": key, "data-in-month": inMonth ? 'true' : undefined, "data-today": key === todayKey ? 'true' : undefined, "aria-label": dayLabel(day, items.length), "aria-current": key === todayKey ? 'date' : undefined, tabIndex: isFocused ? 0 : -1, onKeyDown: (event) => onDayKeyDown(event, day), onFocus: (event) => { if (event.target === event.currentTarget && !isFocused)
67
- setFocusedDay(day); }, className: cn('h-24 border align-top p-item-xs outline-none focus-visible:ring-2 focus-visible:ring-ring', !inMonth && 'bg-muted/30 text-muted-foreground'), children: [_jsx("span", { "aria-hidden": "true", className: cn('mb-item-xs inline-flex size-6 items-center justify-center rounded-full text-xs', key === todayKey && 'bg-primary text-primary-foreground'), children: dayNumberLabel(day) }), items.length > 0 && (_jsx("ul", { role: "list", className: "flex max-h-28 flex-col gap-px overflow-y-auto", children: items.map((item) => {
68
+ setFocusedDay(day); }, className: cn(
69
+ // A day cell sits packed in the grid, its neighbours flush against it: the INSET shape draws
70
+ // inside the box so no neighbour or clipping ancestor covers it.
71
+ 'h-24 border align-top p-item-xs', focusIndicatorClasses(FocusIndicatorShape.INSET), !inMonth && 'bg-muted/30 text-muted-foreground'), children: [_jsx("span", { "aria-hidden": "true", className: cn('mb-item-xs inline-flex size-6 items-center justify-center rounded-full text-xs', key === todayKey && 'bg-primary text-primary-foreground'), children: dayNumberLabel(day) }), items.length > 0 && (_jsx("ul", { role: "list", className: "flex max-h-28 flex-col gap-px overflow-y-auto", children: items.map((item) => {
68
72
  const itemId = getItemId(item);
69
73
  const label = getItemLabel(item);
70
74
  return (_jsx("li", { className: "list-none", "data-calendar-item": itemId, children: canOpenItem(item) ? (_jsx(Button, { variant: ButtonVariants_Variant.GHOST, size: ButtonSize.XS, tabIndex: isFocused ? 0 : -1, className: "h-auto w-full justify-start truncate px-item-xs py-px text-start text-xs font-normal", title: label, onClick: () => onOpenItem(item), children: label })) : (_jsx("span", { className: "block truncate px-item-xs text-xs", title: label, children: label })) }, itemId));
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceCollectionBody_Calendar.js","sourceRoot":"","sources":["../../../../../../src/components/resources/collection/calendar/ResourceCollectionBody_Calendar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAChH,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,iGAAiG,CAAC;AAoCzG,MAAM,QAAQ,GAAuB,EAAE,CAAC;AAExC,MAAM,UAAU,+BAA+B,CAAwC,EACrF,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,YAAY,GACgC;IAC5C,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,KAAK,EAAE,CAAC;IAC1B,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC/C,0GAA0G;IAC1G,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAO,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,OAA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AAK,EAAE,KAAK,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,YAE9B,KAAK,GACC,CACV,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,mCAAmC,EAAC,KAAK,EAAE,KAAK,YAAG,KAAK,GAAQ,CACjF,IAdM,MAAM,CAeV,CACN,CAAC;4CACJ,CAAC,CAAC,GACC,CACN,KAjDI,GAAG,CAkDL,CACN,CAAC;4BACJ,CAAC,CAAC,IA1DK,IAAI,CAAC,CAAC,CAAE,CAAC,GAAG,CA2DhB,CACN,CAAC,GACI,IACF,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The CALENDAR body of a resource collection (`CollectionDisplayMode.CALENDAR`, #2298): a month grid, each row on the\n * day its date field falls on.\n *\n * Like the table and board bodies, the list host owns the fetch (whose window on the date field IS the visible weeks,\n * so moving to another month refetches), the bucketing by day, the row's label and what opening a row does. This\n * component owns the grid, the month navigation and the keyboard.\n *\n * ## Keyboard (the WAI-ARIA date-grid pattern)\n *\n * The grid is one tab stop: the FOCUSED day. Arrow keys move between days (Left/Right a day, Up/Down a week), Home/End\n * to the start and end of the week, Page Up/Page Down a month. Moving past the displayed month shows the neighbouring\n * month, and the focus follows. Tab from the focused day reaches that day's items (buttons), and only that day's: the\n * items of other days are reached by moving to their day first, so a month of rows does not become a hundred tab stops.\n */\n\nimport React, { useCallback, useEffect, useId, useRef, useState } from 'react';\nimport { ButtonSize } from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { useIconRegistry } from '~wildo-frontend-lib/core/icons/useIconRegistry';\nimport { IconSize, StandardIconReference } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport {\n calendarDayKey,\n calendarKeyboardStep,\n calendarMonthOf,\n moveCalendarFocus,\n shiftCalendarMonth,\n type CalendarGridDay,\n} from '~wildo-frontend-lib/components/resources/collection/calendar/collection-calendar.frontend.utils';\n\nexport interface ResourceCollectionBody_CalendarProps<TItem extends Record<string, unknown>> {\n /** The weeks of the displayed month (`buildCalendarMonthGrid`). */\n weeks: readonly (readonly CalendarGridDay[])[];\n /** The rows of each day, keyed by `calendarDayKey` (`groupItemsByCalendarDay`). */\n itemsByDay: ReadonlyMap<string, readonly TItem[]>;\n /** The first day of the displayed month, as UTC midnight. */\n month: Date;\n /** Today, as UTC midnight of the reader's day. */\n today: Date;\n /** The first day of the reader's week, `0` Sunday … `6` Saturday. */\n firstDayOfWeek: number;\n /** Show another month (the host moves its fetch window with it). */\n onMonthChange: (month: Date) => void;\n /** The heading of the displayed month (\"November 2026\"). */\n monthHeading: string;\n /** The seven weekday column headings, in grid order. */\n weekdayLabels: readonly string[];\n /** The day number shown in a cell. */\n dayNumberLabel: (day: Date) => string;\n /** A day cell's accessible name: its date and how many items fall on it. */\n dayLabel: (day: Date, count: number) => string;\n getItemId: (item: TItem) => string;\n /** The row's name as a list shows it. */\n getItemLabel: (item: TItem) => string;\n /** Whether the row can be opened; one that cannot is shown and not offered as a button. */\n canOpenItem: (item: TItem) => boolean;\n onOpenItem: (item: TItem) => void;\n calendarLabel: string;\n previousMonthLabel: string;\n nextMonthLabel: string;\n todayLabel: string;\n keyboardHint: string;\n}\n\nconst NO_ITEMS: readonly unknown[] = [];\n\nexport function ResourceCollectionBody_Calendar<TItem extends Record<string, unknown>>({\n weeks,\n itemsByDay,\n month,\n today,\n firstDayOfWeek,\n onMonthChange,\n monthHeading,\n weekdayLabels,\n dayNumberLabel,\n dayLabel,\n getItemId,\n getItemLabel,\n canOpenItem,\n onOpenItem,\n calendarLabel,\n previousMonthLabel,\n nextMonthLabel,\n todayLabel,\n keyboardHint,\n}: ResourceCollectionBody_CalendarProps<TItem>): React.JSX.Element {\n const hintId = useId();\n const headingId = useId();\n const { renderIcon } = useIconRegistry();\n const gridRef = useRef<HTMLTableElement>(null);\n /** The day holding the grid's single tab stop. Kept inside the displayed month when the month changes. */\n const [focusedDay, setFocusedDay] = useState<Date>(() => (calendarMonthOf(today).getTime() === calendarMonthOf(month).getTime() ? today : calendarMonthOf(month)));\n /** Set by a keyboard move, so the focus follows the move once the grid has re-rendered (the month may change). */\n const moveFocusRef = useRef(false);\n\n // A month changed by the buttons (or by the host) brings the tab stop with it.\n useEffect(() => {\n setFocusedDay((current) => (calendarMonthOf(current).getTime() === calendarMonthOf(month).getTime() ? current : calendarMonthOf(month)));\n }, [month]);\n\n const focusedKey = calendarDayKey(focusedDay);\n useEffect(() => {\n if (!moveFocusRef.current) return;\n moveFocusRef.current = false;\n gridRef.current?.querySelector<HTMLElement>(`[data-calendar-day=\"${focusedKey}\"]`)?.focus();\n }, [focusedKey, weeks]);\n\n const focusDay = useCallback((day: Date) => {\n moveFocusRef.current = true;\n setFocusedDay(day);\n const target = calendarMonthOf(day);\n if (target.getTime() !== calendarMonthOf(month).getTime()) onMonthChange(target);\n }, [month, onMonthChange]);\n\n const onDayKeyDown = (event: React.KeyboardEvent<HTMLElement>, day: Date) => {\n // Only the day cell itself: the arrow keys keep their meaning on the items inside it.\n if (event.target !== event.currentTarget) return;\n const step = calendarKeyboardStep(event.key);\n if (!step) return;\n event.preventDefault();\n focusDay(moveCalendarFocus(day, step, firstDayOfWeek));\n };\n\n const todayKey = calendarDayKey(today);\n return (\n <div className=\"flex flex-col gap-item-sm\" data-slot=\"collection-calendar\">\n <div className=\"flex items-center gap-item-sm\">\n <Button\n variant={ButtonVariants_Variant.OUTLINE}\n size={ButtonSize.ICON_SM}\n aria-label={previousMonthLabel}\n title={previousMonthLabel}\n onClick={() => onMonthChange(shiftCalendarMonth(month, -1))}\n >\n <span aria-hidden=\"true\">{renderIcon(StandardIconReference.CHEVRON_LEFT, { size: IconSize.SM })}</span>\n </Button>\n <Button\n variant={ButtonVariants_Variant.OUTLINE}\n size={ButtonSize.ICON_SM}\n aria-label={nextMonthLabel}\n title={nextMonthLabel}\n onClick={() => onMonthChange(shiftCalendarMonth(month, 1))}\n >\n <span aria-hidden=\"true\">{renderIcon(StandardIconReference.CHEVRON_RIGHT, { size: IconSize.SM })}</span>\n </Button>\n <h3 id={headingId} className=\"text-sm font-medium\" aria-live=\"polite\">{monthHeading}</h3>\n <Button variant={ButtonVariants_Variant.GHOST} size={ButtonSize.SM} className=\"ms-auto\" onClick={() => focusDay(today)}>\n {todayLabel}\n </Button>\n </div>\n <span id={hintId} className=\"sr-only\">{keyboardHint}</span>\n <table\n ref={gridRef}\n role=\"grid\"\n aria-label={calendarLabel}\n aria-describedby={hintId}\n className=\"w-full table-fixed border-collapse\"\n >\n <caption className=\"sr-only\">{monthHeading}</caption>\n <thead>\n <tr>\n {weekdayLabels.map((label, index) => (\n <th key={index} scope=\"col\" className=\"pb-item-xs text-xs font-medium text-muted-foreground\">{label}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]!.key}>\n {week.map(({ day, key, inMonth }) => {\n const items = itemsByDay.get(key) ?? (NO_ITEMS as readonly TItem[]);\n const isFocused = key === focusedKey;\n return (\n <td\n key={key}\n role=\"gridcell\"\n data-calendar-day={key}\n data-in-month={inMonth ? 'true' : undefined}\n data-today={key === todayKey ? 'true' : undefined}\n aria-label={dayLabel(day, items.length)}\n aria-current={key === todayKey ? 'date' : undefined}\n tabIndex={isFocused ? 0 : -1}\n onKeyDown={(event) => onDayKeyDown(event, day)}\n onFocus={(event) => { if (event.target === event.currentTarget && !isFocused) setFocusedDay(day); }}\n className={cn(\n 'h-24 border align-top p-item-xs outline-none focus-visible:ring-2 focus-visible:ring-ring',\n !inMonth && 'bg-muted/30 text-muted-foreground',\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mb-item-xs inline-flex size-6 items-center justify-center rounded-full text-xs',\n key === todayKey && 'bg-primary text-primary-foreground',\n )}\n >\n {dayNumberLabel(day)}\n </span>\n {items.length > 0 && (\n <ul role=\"list\" className=\"flex max-h-28 flex-col gap-px overflow-y-auto\">\n {items.map((item) => {\n const itemId = getItemId(item);\n const label = getItemLabel(item);\n return (\n <li key={itemId} className=\"list-none\" data-calendar-item={itemId}>\n {canOpenItem(item) ? (\n <Button\n variant={ButtonVariants_Variant.GHOST}\n size={ButtonSize.XS}\n tabIndex={isFocused ? 0 : -1}\n className=\"h-auto w-full justify-start truncate px-item-xs py-px text-start text-xs font-normal\"\n title={label}\n onClick={() => onOpenItem(item)}\n >\n {label}\n </Button>\n ) : (\n <span className=\"block truncate px-item-xs text-xs\" title={label}>{label}</span>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ResourceCollectionBody_Calendar.js","sourceRoot":"","sources":["../../../../../../src/components/resources/collection/calendar/ResourceCollectionBody_Calendar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAChH,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAChH,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,iGAAiG,CAAC;AAoCzG,MAAM,QAAQ,GAAuB,EAAE,CAAC;AAExC,MAAM,UAAU,+BAA+B,CAAwC,EACrF,KAAK,EACL,UAAU,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EA,cAAc,CAAC,GAAG,CAAC,GACf,EACN,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,aAAI,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,+CAA+C,YACtE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gDAClB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;gDAC/B,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;gDACjC,OAAO,CACL,aAAiB,SAAS,EAAC,WAAW,wBAAqB,MAAM,YAC9D,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACnB,KAAC,MAAM,IACL,OAAO,EAAE,sBAAsB,CAAC,KAAK,EACrC,IAAI,EAAE,UAAU,CAAC,EAAE,EACnB,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC5B,SAAS,EAAC,sFAAsF,EAChG,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,YAE9B,KAAK,GACC,CACV,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,mCAAmC,EAAC,KAAK,EAAE,KAAK,YAAG,KAAK,GAAQ,CACjF,IAdM,MAAM,CAeV,CACN,CAAC;4CACJ,CAAC,CAAC,GACC,CACN,KApDI,GAAG,CAqDL,CACN,CAAC;4BACJ,CAAC,CAAC,IA7DK,IAAI,CAAC,CAAC,CAAE,CAAC,GAAG,CA8DhB,CACN,CAAC,GACI,IACF,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The CALENDAR body of a resource collection (`CollectionDisplayMode.CALENDAR`, #2298): a month grid, each row on the\n * day its date field falls on.\n *\n * Like the table and board bodies, the list host owns the fetch (whose window on the date field IS the visible weeks,\n * so moving to another month refetches), the bucketing by day, the row's label and what opening a row does. This\n * component owns the grid, the month navigation and the keyboard.\n *\n * ## Keyboard (the WAI-ARIA date-grid pattern)\n *\n * The grid is one tab stop: the FOCUSED day. Arrow keys move between days (Left/Right a day, Up/Down a week), Home/End\n * to the start and end of the week, Page Up/Page Down a month. Moving past the displayed month shows the neighbouring\n * month, and the focus follows. Tab from the focused day reaches that day's items (buttons), and only that day's: the\n * items of other days are reached by moving to their day first, so a month of rows does not become a hundred tab stops.\n */\n\nimport React, { useCallback, useEffect, useId, useRef, useState } from 'react';\nimport { ButtonSize } from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { focusIndicatorClasses, FocusIndicatorShape } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { useIconRegistry } from '~wildo-frontend-lib/core/icons/useIconRegistry';\nimport { IconSize, StandardIconReference } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport {\n calendarDayKey,\n calendarKeyboardStep,\n calendarMonthOf,\n moveCalendarFocus,\n shiftCalendarMonth,\n type CalendarGridDay,\n} from '~wildo-frontend-lib/components/resources/collection/calendar/collection-calendar.frontend.utils';\n\nexport interface ResourceCollectionBody_CalendarProps<TItem extends Record<string, unknown>> {\n /** The weeks of the displayed month (`buildCalendarMonthGrid`). */\n weeks: readonly (readonly CalendarGridDay[])[];\n /** The rows of each day, keyed by `calendarDayKey` (`groupItemsByCalendarDay`). */\n itemsByDay: ReadonlyMap<string, readonly TItem[]>;\n /** The first day of the displayed month, as UTC midnight. */\n month: Date;\n /** Today, as UTC midnight of the reader's day. */\n today: Date;\n /** The first day of the reader's week, `0` Sunday … `6` Saturday. */\n firstDayOfWeek: number;\n /** Show another month (the host moves its fetch window with it). */\n onMonthChange: (month: Date) => void;\n /** The heading of the displayed month (\"November 2026\"). */\n monthHeading: string;\n /** The seven weekday column headings, in grid order. */\n weekdayLabels: readonly string[];\n /** The day number shown in a cell. */\n dayNumberLabel: (day: Date) => string;\n /** A day cell's accessible name: its date and how many items fall on it. */\n dayLabel: (day: Date, count: number) => string;\n getItemId: (item: TItem) => string;\n /** The row's name as a list shows it. */\n getItemLabel: (item: TItem) => string;\n /** Whether the row can be opened; one that cannot is shown and not offered as a button. */\n canOpenItem: (item: TItem) => boolean;\n onOpenItem: (item: TItem) => void;\n calendarLabel: string;\n previousMonthLabel: string;\n nextMonthLabel: string;\n todayLabel: string;\n keyboardHint: string;\n}\n\nconst NO_ITEMS: readonly unknown[] = [];\n\nexport function ResourceCollectionBody_Calendar<TItem extends Record<string, unknown>>({\n weeks,\n itemsByDay,\n month,\n today,\n firstDayOfWeek,\n onMonthChange,\n monthHeading,\n weekdayLabels,\n dayNumberLabel,\n dayLabel,\n getItemId,\n getItemLabel,\n canOpenItem,\n onOpenItem,\n calendarLabel,\n previousMonthLabel,\n nextMonthLabel,\n todayLabel,\n keyboardHint,\n}: ResourceCollectionBody_CalendarProps<TItem>): React.JSX.Element {\n const hintId = useId();\n const headingId = useId();\n const { renderIcon } = useIconRegistry();\n const gridRef = useRef<HTMLTableElement>(null);\n /** The day holding the grid's single tab stop. Kept inside the displayed month when the month changes. */\n const [focusedDay, setFocusedDay] = useState<Date>(() => (calendarMonthOf(today).getTime() === calendarMonthOf(month).getTime() ? today : calendarMonthOf(month)));\n /** Set by a keyboard move, so the focus follows the move once the grid has re-rendered (the month may change). */\n const moveFocusRef = useRef(false);\n\n // A month changed by the buttons (or by the host) brings the tab stop with it.\n useEffect(() => {\n setFocusedDay((current) => (calendarMonthOf(current).getTime() === calendarMonthOf(month).getTime() ? current : calendarMonthOf(month)));\n }, [month]);\n\n const focusedKey = calendarDayKey(focusedDay);\n useEffect(() => {\n if (!moveFocusRef.current) return;\n moveFocusRef.current = false;\n gridRef.current?.querySelector<HTMLElement>(`[data-calendar-day=\"${focusedKey}\"]`)?.focus();\n }, [focusedKey, weeks]);\n\n const focusDay = useCallback((day: Date) => {\n moveFocusRef.current = true;\n setFocusedDay(day);\n const target = calendarMonthOf(day);\n if (target.getTime() !== calendarMonthOf(month).getTime()) onMonthChange(target);\n }, [month, onMonthChange]);\n\n const onDayKeyDown = (event: React.KeyboardEvent<HTMLElement>, day: Date) => {\n // Only the day cell itself: the arrow keys keep their meaning on the items inside it.\n if (event.target !== event.currentTarget) return;\n const step = calendarKeyboardStep(event.key);\n if (!step) return;\n event.preventDefault();\n focusDay(moveCalendarFocus(day, step, firstDayOfWeek));\n };\n\n const todayKey = calendarDayKey(today);\n return (\n <div className=\"flex flex-col gap-item-sm\" data-slot=\"collection-calendar\">\n <div className=\"flex items-center gap-item-sm\">\n <Button\n variant={ButtonVariants_Variant.OUTLINE}\n size={ButtonSize.ICON_SM}\n aria-label={previousMonthLabel}\n title={previousMonthLabel}\n onClick={() => onMonthChange(shiftCalendarMonth(month, -1))}\n >\n <span aria-hidden=\"true\">{renderIcon(StandardIconReference.CHEVRON_LEFT, { size: IconSize.SM })}</span>\n </Button>\n <Button\n variant={ButtonVariants_Variant.OUTLINE}\n size={ButtonSize.ICON_SM}\n aria-label={nextMonthLabel}\n title={nextMonthLabel}\n onClick={() => onMonthChange(shiftCalendarMonth(month, 1))}\n >\n <span aria-hidden=\"true\">{renderIcon(StandardIconReference.CHEVRON_RIGHT, { size: IconSize.SM })}</span>\n </Button>\n <h3 id={headingId} className=\"text-sm font-medium\" aria-live=\"polite\">{monthHeading}</h3>\n <Button variant={ButtonVariants_Variant.GHOST} size={ButtonSize.SM} className=\"ms-auto\" onClick={() => focusDay(today)}>\n {todayLabel}\n </Button>\n </div>\n <span id={hintId} className=\"sr-only\">{keyboardHint}</span>\n <table\n ref={gridRef}\n role=\"grid\"\n aria-label={calendarLabel}\n aria-describedby={hintId}\n className=\"w-full table-fixed border-collapse\"\n >\n <caption className=\"sr-only\">{monthHeading}</caption>\n <thead>\n <tr>\n {weekdayLabels.map((label, index) => (\n <th key={index} scope=\"col\" className=\"pb-item-xs text-xs font-medium text-muted-foreground\">{label}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]!.key}>\n {week.map(({ day, key, inMonth }) => {\n const items = itemsByDay.get(key) ?? (NO_ITEMS as readonly TItem[]);\n const isFocused = key === focusedKey;\n return (\n <td\n key={key}\n role=\"gridcell\"\n data-calendar-day={key}\n data-in-month={inMonth ? 'true' : undefined}\n data-today={key === todayKey ? 'true' : undefined}\n aria-label={dayLabel(day, items.length)}\n aria-current={key === todayKey ? 'date' : undefined}\n tabIndex={isFocused ? 0 : -1}\n onKeyDown={(event) => onDayKeyDown(event, day)}\n onFocus={(event) => { if (event.target === event.currentTarget && !isFocused) setFocusedDay(day); }}\n className={cn(\n // A day cell sits packed in the grid, its neighbours flush against it: the INSET shape draws\n // inside the box so no neighbour or clipping ancestor covers it.\n 'h-24 border align-top p-item-xs',\n focusIndicatorClasses(FocusIndicatorShape.INSET),\n !inMonth && 'bg-muted/30 text-muted-foreground',\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mb-item-xs inline-flex size-6 items-center justify-center rounded-full text-xs',\n key === todayKey && 'bg-primary text-primary-foreground',\n )}\n >\n {dayNumberLabel(day)}\n </span>\n {items.length > 0 && (\n <ul role=\"list\" className=\"flex max-h-28 flex-col gap-px overflow-y-auto\">\n {items.map((item) => {\n const itemId = getItemId(item);\n const label = getItemLabel(item);\n return (\n <li key={itemId} className=\"list-none\" data-calendar-item={itemId}>\n {canOpenItem(item) ? (\n <Button\n variant={ButtonVariants_Variant.GHOST}\n size={ButtonSize.XS}\n tabIndex={isFocused ? 0 : -1}\n className=\"h-auto w-full justify-start truncate px-item-xs py-px text-start text-xs font-normal\"\n title={label}\n onClick={() => onOpenItem(item)}\n >\n {label}\n </Button>\n ) : (\n <span className=\"block truncate px-item-xs text-xs\" title={label}>{label}</span>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n"]}
@@ -13,29 +13,16 @@
13
13
  * A tile may be a FIGURE as well as a drawing: a chart view whose chart is a `ChartType.KPI` (a count, a sum, a rate over
14
14
  * the whole scope, its query grouping by nothing) renders as one number (`ChartKpiFigure`). It is declared, fetched,
15
15
  * authorized and hidden exactly as a chart tile, because it IS a chart: one resource's declared aggregation (#2299).
16
+ *
17
+ * A dashboard given a `layoutRef` may be ARRANGED per organization (#2299): the organization's administrators reorder,
18
+ * resize and hide its tiles, stored as the organization's `organizationDashboardLayouts` row for that ref, and every
19
+ * member sees the arrangement. The arrangement only rearranges the declared tiles ({@link arrangeChartDashboardTiles}),
20
+ * and the read gate runs after it, so no arrangement shows a chart its viewer may not read.
16
21
  */
17
22
  import React from 'react';
23
+ import { ChartDashboardTileRows, ChartDashboardTileSpan } from '@wildo-ai/saas-models';
18
24
  import { type CompositeViewAuthoringConfig } from '../../../core/config/composite-view.schemas';
19
25
  /** @wildo_source:part:start saas.frontend.chart-dashboard facet:layer:frontend facet:family:view facet:audience:app-developer */
20
- /** How many grid columns a dashboard tile spans, where the dashboard is wide enough to have them. */
21
- export declare enum ChartDashboardTileSpan {
22
- /** One column (the default): a donut, a bar of a few categories. */
23
- ONE = "one",
24
- /** Two columns: a trend over time, a bar of many categories. One column where the dashboard has one. */
25
- TWO = "two",
26
- /** The whole row: a long timeline, a wide table-like chart. */
27
- FULL = "full"
28
- }
29
- /** How many grid rows a dashboard tile spans, where the dashboard has more than one column. */
30
- export declare enum ChartDashboardTileRows {
31
- /** One row (the default). */
32
- ONE = "one",
33
- /**
34
- * Two rows: a large chart beside two smaller ones stacked in the next column. Place it right after the first
35
- * small tile, so the second small tile flows into the row beneath the first: `[small, large (TWO rows), small]`.
36
- */
37
- TWO = "two"
38
- }
39
26
  /**
40
27
  * The most columns a dashboard's grid reaches, as its container widens. Every dashboard is one column in a narrow pane.
41
28
  */
@@ -59,13 +46,15 @@ export interface ChartDashboardTile {
59
46
  resourceType: string;
60
47
  /** The chart view's `ref` on that resource (`InsertedChartDeclaration.ref`, usually `<chartDefinition>.ref`). */
61
48
  chartViewRef: string;
62
- /** Grid columns the tile spans. Default: {@link ChartDashboardTileSpan.ONE}. */
49
+ /** Grid columns the tile spans (`ChartDashboardTileSpan`, `@wildo-ai/saas-models`). Default: `ONE`. */
63
50
  span?: ChartDashboardTileSpan;
64
- /** Grid rows the tile spans. Default: {@link ChartDashboardTileRows.ONE}. */
51
+ /** Grid rows the tile spans (`ChartDashboardTileRows`, `@wildo-ai/saas-models`). Default: `ONE`. */
65
52
  rows?: ChartDashboardTileRows;
66
53
  /**
67
- * Chart canvas height in px (the canvas is sized by this, not by the tile). Default: 280 for a chart; a KPI tile takes
68
- * the height of its figure, and this only sizes its loading placeholder (default 64).
54
+ * Chart canvas height in px for the tile's declared `rows` (the canvas is sized by this, not by the tile). Default:
55
+ * 280 for a one-row chart, 592 for a two-row one (two rows and the gap between them); a KPI tile takes the height of its
56
+ * figure, and this only sizes its loading placeholder (default 64). When an organization's layout changes the tile's
57
+ * rows, this height is doubled (plus the gap) or halved with them.
69
58
  */
70
59
  height?: number;
71
60
  }
@@ -74,6 +63,13 @@ export interface ChartDashboardProps {
74
63
  tiles: readonly ChartDashboardTile[];
75
64
  /** The most columns the grid reaches. Default: {@link ChartDashboardColumns.FOUR}. */
76
65
  columns?: ChartDashboardColumns;
66
+ /**
67
+ * The dashboard's name for an organization's stored arrangement of it (`organizationDashboardLayouts.dashboardRef`),
68
+ * unique within the application, e.g. `'home-analytics'`. Given one, the organization's administrators may reorder,
69
+ * resize and hide its tiles for every member, and go back to the declared layout; without one the dashboard is always
70
+ * laid out as declared.
71
+ */
72
+ layoutRef?: string;
77
73
  className?: string;
78
74
  }
79
75
  /**
@@ -90,6 +86,11 @@ export interface ChartDashboardProps {
90
86
  *
91
87
  * A KPI tile (a chart view whose chart is `ChartType.KPI`) shows one figure under that title, hidden by the same rule.
92
88
  *
89
+ * With a `layoutRef`, the current organization's stored arrangement applies first (order, sizes, hidden tiles); the read
90
+ * gate then applies to what is left. An administrator who may arrange it gets a "customize" button above the grid,
91
+ * opening the layout editor, and keeps it even when every tile is hidden. The grid waits for the arrangement to be read,
92
+ * and a read that fails shows the declared layout.
93
+ *
93
94
  * Place it inside a composite view (`CompositeLayout`), or declare a whole view as one with
94
95
  * {@link defineChartDashboardView}.
95
96
  *
@@ -104,7 +105,7 @@ export interface ChartDashboardProps {
104
105
  * />
105
106
  * ```
106
107
  */
107
- export declare function ChartDashboard({ tiles, columns, className }: ChartDashboardProps): React.JSX.Element | null;
108
+ export declare function ChartDashboard({ tiles, columns, layoutRef, className }: ChartDashboardProps): React.JSX.Element | null;
108
109
  /** @wildo_source:part:start saas.frontend.chart-dashboard-view facet:layer:frontend facet:family:view facet:audience:app-developer */
109
110
  /**
110
111
  * A whole composite view that is a chart dashboard, declared as data — register it under the frontend domain module's
@@ -126,6 +127,8 @@ export declare function ChartDashboard({ tiles, columns, className }: ChartDashb
126
127
  */
127
128
  export declare function defineChartDashboardView(config: {
128
129
  tiles: readonly ChartDashboardTile[];
130
+ columns?: ChartDashboardColumns;
131
+ layoutRef?: string;
129
132
  } & Omit<CompositeViewAuthoringConfig, 'viewComponent'>): CompositeViewAuthoringConfig;
130
133
  /** @wildo_source:part:end saas.frontend.chart-dashboard-view */
131
134
  //# sourceMappingURL=ChartDashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartDashboard.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-dashboard/ChartDashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,wDAAwD,CAAC;AAMhE,iIAAiI;AACjI,qGAAqG;AACrG,oBAAY,sBAAsB;IAChC,oEAAoE;IACpE,GAAG,QAAQ;IACX,wGAAwG;IACxG,GAAG,QAAQ;IACX,+DAA+D;IAC/D,IAAI,SAAS;CACd;AAED,+FAA+F;AAC/F,oBAAY,sBAAsB;IAChC,6BAA6B;IAC7B,GAAG,QAAQ;IACX;;;OAGG;IACH,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,mDAAmD;IACnD,GAAG,QAAQ;IACX;;;OAGG;IACH,KAAK,UAAU;IACf,8FAA8F;IAC9F,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,iHAAiH;IACjH,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,6EAA6E;IAC7E,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,qFAAqF;IACrF,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrC,sFAAsF;IACtF,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAoC,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAyBxI;AAwDD,sIAAsI;AACtI;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE;IAAE,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,4BAA4B,EAAE,eAAe,CAAC,GACrG,4BAA4B,CAU9B;AACD,gEAAgE"}
1
+ {"version":3,"file":"ChartDashboard.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-dashboard/ChartDashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAC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