@manta-eu/react 0.1.6 → 0.1.8

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 (234) hide show
  1. package/README.md +3 -0
  2. package/dist/components/chart/AreaChart.d.ts.map +1 -1
  3. package/dist/components/chart/AreaChart.js +4 -6
  4. package/dist/components/chart/BarChart.d.ts.map +1 -1
  5. package/dist/components/chart/BarChart.js +5 -6
  6. package/dist/components/chart/ComposedChart.d.ts.map +1 -1
  7. package/dist/components/chart/ComposedChart.js +15 -7
  8. package/dist/components/chart/LineChart.d.ts.map +1 -1
  9. package/dist/components/chart/LineChart.js +4 -6
  10. package/dist/components/chart/annotations.d.ts +4 -0
  11. package/dist/components/chart/annotations.d.ts.map +1 -1
  12. package/dist/components/chart/annotations.js +10 -2
  13. package/dist/components/chart/chart-schemas.d.ts +1960 -54
  14. package/dist/components/chart/chart-schemas.d.ts.map +1 -1
  15. package/dist/components/chart/chart-schemas.js +137 -15
  16. package/dist/components/chart/series.d.ts +28 -0
  17. package/dist/components/chart/series.d.ts.map +1 -0
  18. package/dist/components/chart/series.js +61 -0
  19. package/dist/components/chart/stacks.d.ts +9 -0
  20. package/dist/components/chart/stacks.d.ts.map +1 -0
  21. package/dist/components/chart/stacks.js +11 -0
  22. package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
  23. package/dist/components/chat-view/ChatHeaders.js +2 -2
  24. package/dist/components/embedded-chat/index.d.ts.map +1 -1
  25. package/dist/components/embedded-chat/index.js +2 -1
  26. package/dist/components/layouts/Sidebar.d.ts.map +1 -1
  27. package/dist/components/layouts/Sidebar.js +14 -3
  28. package/dist/components/layouts/StatusScreen.d.ts.map +1 -1
  29. package/dist/components/layouts/StatusScreen.js +3 -1
  30. package/dist/components/planning/ActioningView.d.ts.map +1 -1
  31. package/dist/components/planning/ActioningView.js +7 -49
  32. package/dist/components/planning/ExecutionSectionItem.d.ts +6 -4
  33. package/dist/components/planning/ExecutionSectionItem.d.ts.map +1 -1
  34. package/dist/components/planning/ExecutionSectionItem.js +2 -2
  35. package/dist/components/planning/ExecutionSections.d.ts +6 -4
  36. package/dist/components/planning/ExecutionSections.d.ts.map +1 -1
  37. package/dist/components/planning/ExecutionSections.js +2 -2
  38. package/dist/components/planning/ManualActionCard.d.ts +14 -8
  39. package/dist/components/planning/ManualActionCard.d.ts.map +1 -1
  40. package/dist/components/planning/ManualActionCard.js +44 -24
  41. package/dist/components/planning/ManualActionList.d.ts +22 -0
  42. package/dist/components/planning/ManualActionList.d.ts.map +1 -0
  43. package/dist/components/planning/ManualActionList.js +35 -0
  44. package/dist/components/planning/manual-action-targets.d.ts +4 -0
  45. package/dist/components/planning/manual-action-targets.d.ts.map +1 -0
  46. package/dist/components/planning/manual-action-targets.js +19 -0
  47. package/dist/components/sidebar/index.d.ts +2 -0
  48. package/dist/components/sidebar/index.d.ts.map +1 -1
  49. package/dist/components/sidebar/index.js +1 -0
  50. package/dist/components/sidebar/nav-user.d.ts +1 -1
  51. package/dist/components/sidebar/nav-user.d.ts.map +1 -1
  52. package/dist/components/sidebar/nav-user.js +3 -3
  53. package/dist/components/sidebar/user-avatar.d.ts +7 -0
  54. package/dist/components/sidebar/user-avatar.d.ts.map +1 -0
  55. package/dist/components/sidebar/user-avatar.js +9 -0
  56. package/dist/components/thinking/manta-swim.d.ts.map +1 -1
  57. package/dist/components/thinking/manta-swim.js +3 -1
  58. package/dist/globals.css +6 -13
  59. package/dist/hooks/use-connection-problems.d.ts.map +1 -1
  60. package/dist/hooks/use-manual-actions.d.ts +13 -3
  61. package/dist/hooks/use-manual-actions.d.ts.map +1 -1
  62. package/dist/hooks/use-manual-actions.js +16 -10
  63. package/dist/hooks/useAuth.d.ts +1 -0
  64. package/dist/hooks/useAuth.d.ts.map +1 -1
  65. package/dist/hooks/useAuth.js +7 -1
  66. package/dist/hooks/useConversations.d.ts +1 -0
  67. package/dist/hooks/useConversations.d.ts.map +1 -1
  68. package/dist/hooks/useResolveManualAction.d.ts +14 -0
  69. package/dist/hooks/useResolveManualAction.d.ts.map +1 -0
  70. package/dist/hooks/useResolveManualAction.js +47 -0
  71. package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
  72. package/dist/ldo-ui.d.ts +2 -1
  73. package/dist/ldo-ui.d.ts.map +1 -1
  74. package/dist/ldo-ui.js +2 -1
  75. package/dist/lib/build-config.d.ts +2 -0
  76. package/dist/lib/build-config.d.ts.map +1 -1
  77. package/dist/lib/build-config.js +2 -0
  78. package/dist/lib/chat-types.d.ts +3 -0
  79. package/dist/lib/chat-types.d.ts.map +1 -1
  80. package/dist/lib/datastore-route-table.d.ts +2 -0
  81. package/dist/lib/datastore-route-table.d.ts.map +1 -1
  82. package/dist/lib/datastore-route-table.js +3 -1
  83. package/dist/lib/datastore-routes.d.ts +7 -1
  84. package/dist/lib/datastore-routes.d.ts.map +1 -1
  85. package/dist/lib/datastore-routes.js +7 -2
  86. package/dist/lib/decode-chart-entities.d.ts.map +1 -1
  87. package/dist/lib/decode-chart-entities.js +5 -1
  88. package/dist/lib/manual-actions.d.ts +1 -0
  89. package/dist/lib/manual-actions.d.ts.map +1 -1
  90. package/dist/lib/manual-actions.js +4 -1
  91. package/dist/lib/structured-data/types.d.ts +7 -2
  92. package/dist/lib/structured-data/types.d.ts.map +1 -1
  93. package/dist/lib/tool-icons.d.ts.map +1 -1
  94. package/dist/lib/tool-icons.js +1 -0
  95. package/dist/providers/AssistantIconProvider.d.ts +11 -0
  96. package/dist/providers/AssistantIconProvider.d.ts.map +1 -0
  97. package/dist/providers/AssistantIconProvider.js +10 -0
  98. package/dist/providers/ChatManagerProvider.d.ts.map +1 -1
  99. package/dist/providers/ChatManagerProvider.js +18 -16
  100. package/dist/providers/NavExtrasProvider.d.ts +23 -0
  101. package/dist/providers/NavExtrasProvider.d.ts.map +1 -0
  102. package/dist/providers/NavExtrasProvider.js +10 -0
  103. package/dist/providers/index.d.ts +2 -0
  104. package/dist/providers/index.d.ts.map +1 -1
  105. package/dist/providers/index.js +2 -0
  106. package/dist/routes/chat/index.d.ts +2 -0
  107. package/dist/routes/chat/index.d.ts.map +1 -1
  108. package/dist/routes/chat/index.js +3 -2
  109. package/dist/routes/explain/ExplainEmpty.d.ts.map +1 -1
  110. package/dist/routes/explain/ExplainEmpty.js +2 -1
  111. package/dist/routes/integrations/catalog-shape.d.ts +8 -3
  112. package/dist/routes/integrations/catalog-shape.d.ts.map +1 -1
  113. package/dist/routes/integrations/components/AddIntegrationModal.d.ts.map +1 -1
  114. package/dist/routes/integrations/components/AddIntegrationModal.js +2 -2
  115. package/dist/routes/integrations/components/MantaSyncPluginDownload.d.ts +13 -0
  116. package/dist/routes/integrations/components/MantaSyncPluginDownload.d.ts.map +1 -0
  117. package/dist/routes/integrations/components/MantaSyncPluginDownload.js +23 -0
  118. package/dist/routes/integrations/components/connect-forms/ConnectFormHeader.d.ts +1 -1
  119. package/dist/routes/integrations/components/connect-forms/ConnectFormHeader.d.ts.map +1 -1
  120. package/dist/routes/integrations/components/connect-forms/ConnectWizardShell.d.ts +1 -1
  121. package/dist/routes/integrations/components/connect-forms/ConnectWizardShell.d.ts.map +1 -1
  122. package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.d.ts +11 -0
  123. package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.d.ts.map +1 -0
  124. package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.js +49 -0
  125. package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts +7 -0
  126. package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts.map +1 -0
  127. package/dist/routes/integrations/components/connect-forms/DashConnectForm.js +87 -0
  128. package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.d.ts +20 -0
  129. package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.d.ts.map +1 -0
  130. package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.js +144 -0
  131. package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.d.ts +8 -0
  132. package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.d.ts.map +1 -0
  133. package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.js +44 -0
  134. package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.d.ts +3 -0
  135. package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.d.ts.map +1 -0
  136. package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.js +20 -0
  137. package/dist/routes/integrations/components/connect-forms/GmailConnectForm.d.ts +3 -0
  138. package/dist/routes/integrations/components/connect-forms/GmailConnectForm.d.ts.map +1 -0
  139. package/dist/routes/integrations/components/connect-forms/GmailConnectForm.js +11 -0
  140. package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts +3 -0
  141. package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts.map +1 -0
  142. package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js +37 -0
  143. package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts +3 -0
  144. package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts.map +1 -0
  145. package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js +37 -0
  146. package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.d.ts +21 -0
  147. package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.d.ts.map +1 -0
  148. package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.js +25 -0
  149. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts +45 -0
  150. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map +1 -0
  151. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js +187 -0
  152. package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts +6 -0
  153. package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts.map +1 -0
  154. package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js +68 -0
  155. package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.d.ts +10 -0
  156. package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.d.ts.map +1 -0
  157. package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.js +124 -0
  158. package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.d.ts +14 -0
  159. package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.d.ts.map +1 -0
  160. package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.js +183 -0
  161. package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.d.ts +10 -0
  162. package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.d.ts.map +1 -0
  163. package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.js +17 -0
  164. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts +45 -0
  165. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts.map +1 -0
  166. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js +136 -0
  167. package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.d.ts +23 -0
  168. package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.d.ts.map +1 -0
  169. package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.js +63 -0
  170. package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.d.ts +3 -0
  171. package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.d.ts.map +1 -0
  172. package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.js +14 -0
  173. package/dist/routes/integrations/components/connect-forms/SlackConnectForm.d.ts +3 -0
  174. package/dist/routes/integrations/components/connect-forms/SlackConnectForm.d.ts.map +1 -0
  175. package/dist/routes/integrations/components/connect-forms/SlackConnectForm.js +10 -0
  176. package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts +5 -0
  177. package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts.map +1 -0
  178. package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js +35 -0
  179. package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts +5 -0
  180. package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts.map +1 -0
  181. package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js +47 -0
  182. package/dist/routes/integrations/components/connect-forms/connection-string-fields.d.ts +13 -0
  183. package/dist/routes/integrations/components/connect-forms/connection-string-fields.d.ts.map +1 -0
  184. package/dist/routes/integrations/components/connect-forms/connection-string-fields.js +110 -0
  185. package/dist/routes/integrations/components/connect-forms/dash-folder-tree.d.ts +6 -0
  186. package/dist/routes/integrations/components/connect-forms/dash-folder-tree.d.ts.map +1 -0
  187. package/dist/routes/integrations/components/connect-forms/dash-folder-tree.js +14 -0
  188. package/dist/routes/integrations/components/connect-forms/data-connection-fields.d.ts +35 -0
  189. package/dist/routes/integrations/components/connect-forms/data-connection-fields.d.ts.map +1 -0
  190. package/dist/routes/integrations/components/connect-forms/data-connection-fields.js +88 -0
  191. package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.d.ts +11 -0
  192. package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.d.ts.map +1 -0
  193. package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.js +36 -0
  194. package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.d.ts +6 -0
  195. package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.d.ts.map +1 -0
  196. package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.js +34 -0
  197. package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.d.ts +12 -0
  198. package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.d.ts.map +1 -0
  199. package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.js +33 -0
  200. package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.d.ts +3 -0
  201. package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.d.ts.map +1 -0
  202. package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.js +8 -0
  203. package/dist/routes/integrations/components/connect-forms/types.d.ts +6 -1
  204. package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
  205. package/dist/routes/integrations/components/connect-forms/useConnectWizard.d.ts +19 -0
  206. package/dist/routes/integrations/components/connect-forms/useConnectWizard.d.ts.map +1 -0
  207. package/dist/routes/integrations/components/connect-forms/useConnectWizard.js +28 -0
  208. package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.d.ts +4 -0
  209. package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.d.ts.map +1 -0
  210. package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.js +17 -0
  211. package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.d.ts +7 -0
  212. package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.d.ts.map +1 -0
  213. package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.js +18 -0
  214. package/dist/routes/integrations/connect-forms.d.ts +16 -0
  215. package/dist/routes/integrations/connect-forms.d.ts.map +1 -0
  216. package/dist/routes/integrations/connect-forms.js +14 -0
  217. package/dist/routes/integrations/connection-view.d.ts.map +1 -1
  218. package/dist/routes/integrations/connection-view.js +30 -7
  219. package/dist/routes/integrations/filter-connected-providers.d.ts +3 -0
  220. package/dist/routes/integrations/filter-connected-providers.d.ts.map +1 -0
  221. package/dist/routes/integrations/filter-connected-providers.js +15 -0
  222. package/dist/routes/integrations/overview.d.ts +3 -0
  223. package/dist/routes/integrations/overview.d.ts.map +1 -0
  224. package/dist/routes/integrations/overview.js +2 -0
  225. package/dist/routes/integrations/types.d.ts +24 -4
  226. package/dist/routes/integrations/types.d.ts.map +1 -1
  227. package/dist/routes/integrations/types.js +10 -0
  228. package/dist/routes/integrations/use-connected-account-entities.d.ts +10 -0
  229. package/dist/routes/integrations/use-connected-account-entities.d.ts.map +1 -0
  230. package/dist/routes/integrations/use-connected-account-entities.js +29 -0
  231. package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
  232. package/dist/routes/memories/components/EmptyStates.js +2 -1
  233. package/dist/routes/plans/components/actionPlansTableConfig.d.ts +12 -12
  234. package/package.json +54 -10
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { GQLActionPlanState, GQLManualActionResolveStatus, useResolveManualActionMutation, } from "@manta-eu/client";
2
+ import { GQLActionPlanState } from "@manta-eu/client";
3
3
  import { extractPlanName } from "@manta-eu/client/shared/agent-mode";
4
4
  import { isPresent } from "@manta-eu/lib/present";
5
- import { useQueryClient } from "@tanstack/react-query";
6
5
  import { useCallback, useEffect, useMemo, useState } from "react";
7
6
  import { toast } from "sonner";
8
7
  import { deriveExecutionStatus, deriveIsDryRun, isStalePlanCompletion } from "./actioning-view-utils.js";
@@ -11,22 +10,16 @@ import { parseTimestampMs } from "./execution-section-model.js";
11
10
  import { ExecutionSections } from "./ExecutionSections.js";
12
11
  import { ExecutionTopBar } from "./ExecutionTopBar.js";
13
12
  import { FailedBanner } from "./FailedBanner.js";
13
+ import { useManualActionTargets } from "./manual-action-targets.js";
14
14
  import { SummaryBar } from "./SummaryBar.js";
15
15
  import { UnavailablePlanNotice } from "./UnavailablePlanNotice.js";
16
16
  import { Loader } from "#components/loader/index";
17
17
  import { useActionPlanDetail } from "#hooks/useActionPlanDetail";
18
18
  import { useActionPlanExecution } from "#hooks/useActionPlanExecution";
19
- import { useActionPlanDiff, useActionPlanExecutionProvenance, useManualActions, } from "#ldo-ui";
20
- import { extractLabel } from "#lib/iri-labels";
19
+ import { useResolveManualAction } from "#hooks/useResolveManualAction";
20
+ import { useActionPlanDiff, useActionPlanExecutionProvenance, useManualActions } from "#ldo-ui";
21
21
  import { getPendingManualActions } from "#lib/manual-actions";
22
22
  import { cn } from "#lib/utils";
23
- import { useMantaClient } from "#providers/MantaClientProvider";
24
- import { invalidateActionPlanQueries } from "#shared/query-keys";
25
- const resolutionStatuses = {
26
- COMPLETED: GQLManualActionResolveStatus.Completed,
27
- RETRY: GQLManualActionResolveStatus.Retry,
28
- REJECTED: GQLManualActionResolveStatus.Rejected,
29
- };
30
23
  export function ActioningView(props) {
31
24
  const { planGraphIri, diff, isLoading, executionControl, executePromptNonce, datastoreId, userId, hideTopBar = false, chatIri, completedChangesSlot, } = props;
32
25
  const planName = extractPlanName(planGraphIri);
@@ -73,30 +66,7 @@ export function ActioningView(props) {
73
66
  const planEndedAtMs = stale ? null : parseTimestampMs(provenance?.planEndedAtTime);
74
67
  const isExecutionActive = executionStatus === "running" || executionStatus === "needs-approval";
75
68
  const activeStartedAtMs = isExecutionActive ? planStartedAtMs : null;
76
- const queryClient = useQueryClient();
77
- const { mantaClient } = useMantaClient();
78
- const resolveManualAction = useResolveManualActionMutation(mantaClient);
79
- const canResolveManualAction = !!datastoreId && !!userId;
80
- const handleManualActionResolve = useCallback((subjectIri, resolution) => {
81
- if (!userId) {
82
- toast.error("Cannot resolve manual action: missing user context.");
83
- return;
84
- }
85
- resolveManualAction.mutate({
86
- namedGraphIri: planGraphIri,
87
- subjectIri,
88
- resolvedBy: userId,
89
- status: resolutionStatuses[resolution],
90
- }, {
91
- onSuccess: async () => {
92
- await invalidateActionPlanQueries(queryClient, planGraphIri);
93
- },
94
- onError: (err) => {
95
- console.error("Failed to resolve manual action", err);
96
- toast.error(err instanceof Error ? err.message : "Failed to resolve manual action.");
97
- },
98
- });
99
- }, [userId, planGraphIri, resolveManualAction, queryClient]);
69
+ const manualActionResolver = useResolveManualAction({ planGraphIri, userId, datastoreId });
100
70
  const handleExecute = useCallback((nextDryRun) => {
101
71
  void execute(nextDryRun);
102
72
  }, [execute]);
@@ -109,19 +79,7 @@ export function ActioningView(props) {
109
79
  toast.error(nextDryRun ? "Failed to preview plan re-run" : "Failed to re-run plan");
110
80
  }
111
81
  }, [execute]);
112
- const manualActionEntities = useMemo(() => {
113
- const map = new Map();
114
- for (const ma of manualActions) {
115
- map.set(ma.subjectIri, [
116
- {
117
- subjectIri: ma.subjectIri,
118
- label: (ma.aboutIri && extractLabel(ma.aboutIri)) || ma.subjectLabel || ma.typeName || "Manual action",
119
- properties: [],
120
- },
121
- ]);
122
- }
123
- return map;
124
- }, [manualActions]);
82
+ const manualActionEntities = useManualActionTargets(manualActions);
125
83
  const entityTypes = useMemo(() => {
126
84
  if (!ldoDiff)
127
85
  return [];
@@ -154,5 +112,5 @@ export function ActioningView(props) {
154
112
  }, [entityTypes, manualActions]);
155
113
  const completedChanges = executionStatus === "completed" ? completedChangesSlot : null;
156
114
  return (_jsxs("div", { className: cn("flex flex-col", !hideTopBar && "h-full bg-background"), children: [!hideTopBar && (_jsx(ExecutionTopBar, { planName: planName, status: executionStatus, workflowId: workflowId, triggerError: triggerError, onExecute: hasCurrentFacts ? handleExecute : undefined, onRerun: hasCurrentFacts ? handleConfirmRerun : undefined, isExecuteDialogOpen: isExecuteDialogOpen, onExecuteDialogOpenChange: setIsExecuteDialogOpen, isDryRun: isDryRun })), !hideTopBar && isDryRunCompleted && _jsx(DryRunCompleteBanner, {}), _jsx("div", { className: cn(!hideTopBar && "flex-1 overflow-y-auto"), children: _jsxs("div", { className: cn("space-y-6", hideTopBar ? "mx-auto w-full max-w-7xl px-8" : "mx-auto max-w-[960px] px-16 py-8"), children: [!hideTopBar && plan && !plan.hasCurrentFacts && (_jsx(UnavailablePlanNotice, { hasExecutionHistory: plan.hasExecutionHistory })), executionStatus === "failed" && (provenance?.planErrorMessage || triggerError) && (_jsx(FailedBanner, { message: provenance?.planErrorMessage ?? triggerError ?? "Execution failed" })), isLoading && !isPresent(effectiveEntityTypes) && (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader, { className: "size-6" }) })), plan && (_jsx(SummaryBar, { plan: plan, executionStatus: executionStatus, startedAtMs: planStartedAtMs, endedAtMs: planEndedAtMs })), completedChanges ??
157
- (isPresent(effectiveEntityTypes) && (_jsx(ExecutionSections, { entityTypes: effectiveEntityTypes, provenance: provenance ?? null, manualActions: manualActions, manualActionEntities: manualActionEntities, activeStartedAtMs: activeStartedAtMs, onManualActionResolve: handleManualActionResolve, isResolvingManualAction: resolveManualAction.isPending || !canResolveManualAction })))] }) })] }));
115
+ (isPresent(effectiveEntityTypes) && (_jsx(ExecutionSections, { entityTypes: effectiveEntityTypes, provenance: provenance ?? null, manualActions: manualActions, manualActionEntities: manualActionEntities, activeStartedAtMs: activeStartedAtMs, onManualActionResolve: manualActionResolver.resolve, resolvingManualAction: manualActionResolver.resolving, canResolveManualAction: manualActionResolver.canResolve, manualActionDisabledReason: manualActionResolver.disabledReason })))] }) })] }));
158
116
  }
@@ -1,7 +1,7 @@
1
1
  import type { EntityTypeEntry } from "./ActionPlanDetailView.js";
2
2
  import { type SectionStatus } from "./execution-section-model.js";
3
- import { type ManualActionEntity } from "./ManualActionCard.js";
4
- import type { ExecutionProvenanceActivity, ManualAction, ManualActionResolution } from "#ldo-ui";
3
+ import { type ManualActionTarget } from "./ManualActionCard.js";
4
+ import type { ExecutionProvenanceActivity, ManualAction, ManualActionResolution, ManualActionResolving } from "#ldo-ui";
5
5
  export type ExecutionSectionItemProps = {
6
6
  entry: EntityTypeEntry;
7
7
  activities: ExecutionProvenanceActivity[];
@@ -10,9 +10,11 @@ export type ExecutionSectionItemProps = {
10
10
  isExpanded: boolean;
11
11
  onToggle: () => void;
12
12
  manualActions?: ManualAction[];
13
- manualActionEntities?: Map<string, ManualActionEntity[]>;
13
+ manualActionEntities?: Map<string, ManualActionTarget[]>;
14
14
  onManualActionResolve?: (subjectIri: string, resolution: ManualActionResolution) => void;
15
- isResolvingManualAction?: boolean;
15
+ resolvingManualAction?: ManualActionResolving;
16
+ canResolveManualAction?: boolean;
17
+ manualActionDisabledReason?: string;
16
18
  };
17
19
  export declare function ExecutionSectionItem(props: ExecutionSectionItemProps): import("react/jsx-runtime").JSX.Element;
18
20
  //# sourceMappingURL=ExecutionSectionItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExecutionSectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSectionItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEjH,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIjG,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,2BAA2B,EAAE,CAAC;IAC1C,MAAM,EAAE,aAAa,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAoFpE"}
1
+ {"version":3,"file":"ExecutionSectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSectionItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEjH,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIxH,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,2BAA2B,EAAE,CAAC;IAC1C,MAAM,EAAE,aAAa,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzF,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAwFpE"}
@@ -12,11 +12,11 @@ import { ManualActionCard } from "./ManualActionCard.js";
12
12
  import { getPendingManualActions, getResolvedManualActions } from "#lib/manual-actions";
13
13
  import { cn } from "#lib/utils";
14
14
  export function ExecutionSectionItem(props) {
15
- const { entry, activities, status, fallbackStartedAtMs = null, isExpanded, onToggle, manualActions = [], manualActionEntities, onManualActionResolve, isResolvingManualAction = false, } = props;
15
+ const { entry, activities, status, fallbackStartedAtMs = null, isExpanded, onToggle, manualActions = [], manualActionEntities, onManualActionResolve, resolvingManualAction, canResolveManualAction, manualActionDisabledReason, } = props;
16
16
  const pendingManualActions = getPendingManualActions(manualActions);
17
17
  const resolvedManualActions = getResolvedManualActions(manualActions);
18
18
  const hasContent = isPresent(activities) || isPresent(pendingManualActions);
19
- return (_jsxs("div", { children: [_jsxs("button", { type: "button", onClick: onToggle, className: "flex w-full items-center gap-3 pl-2 pr-3 py-3 text-left transition-colors hover:bg-muted/30", children: [_jsx("div", { className: "flex shrink-0 items-center p-1.5 rounded-lg", children: _jsx(ChevronDown, { className: cn("size-5 shrink-0 text-muted-foreground transition-transform", !isExpanded && "-rotate-90") }) }), _jsx("div", { className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-faint", children: resolveStepIcon(entry.typeName, "size-5 text-muted-foreground") }), _jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-0.5", children: [_jsx("span", { className: cn("typography-small-medium block truncate", status === "pending" ? "text-muted-foreground" : "text-default-foreground"), children: entry.typeName }), entry.description && (_jsx("span", { className: "typography-tiny text-muted-foreground block truncate", children: entry.description }))] }), _jsxs("div", { className: "flex items-center gap-3 shrink-0", children: [_jsx(SectionElapsed, { activities: activities, status: status, estimatedTime: entry.estimatedTime ?? null, fallbackStartedAtMs: fallbackStartedAtMs }), _jsx(SectionStatusIcon, { status: status })] })] }), isExpanded && hasContent && (_jsxs("div", { className: "bg-faint border-t border-default-border py-1.5", children: [activities.map((activity) => (_jsx(ExecutionActivityRow, { activity: activity, manualActionStatus: findResolvedManualActionStatus(activity, resolvedManualActions) }, activity.iri))), pendingManualActions.map((ma) => (_jsx(ManualActionCard, { manualAction: ma, entities: manualActionEntities?.get(ma.subjectIri) ?? [], description: ma.description ?? entry.description ?? undefined, isResolving: isResolvingManualAction, onResolve: (resolution) => onManualActionResolve?.(ma.subjectIri, resolution) }, ma.subjectIri)))] }))] }));
19
+ return (_jsxs("div", { children: [_jsxs("button", { type: "button", onClick: onToggle, className: "flex w-full items-center gap-3 pl-2 pr-3 py-3 text-left transition-colors hover:bg-muted/30", children: [_jsx("div", { className: "flex shrink-0 items-center p-1.5 rounded-lg", children: _jsx(ChevronDown, { className: cn("size-5 shrink-0 text-muted-foreground transition-transform", !isExpanded && "-rotate-90") }) }), _jsx("div", { className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-faint", children: resolveStepIcon(entry.typeName, "size-5 text-muted-foreground") }), _jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-0.5", children: [_jsx("span", { className: cn("typography-small-medium block truncate", status === "pending" ? "text-muted-foreground" : "text-default-foreground"), children: entry.typeName }), entry.description && (_jsx("span", { className: "typography-tiny text-muted-foreground block truncate", children: entry.description }))] }), _jsxs("div", { className: "flex items-center gap-3 shrink-0", children: [_jsx(SectionElapsed, { activities: activities, status: status, estimatedTime: entry.estimatedTime ?? null, fallbackStartedAtMs: fallbackStartedAtMs }), _jsx(SectionStatusIcon, { status: status })] })] }), isExpanded && hasContent && (_jsxs("div", { className: "bg-faint border-t border-default-border py-1.5", children: [activities.map((activity) => (_jsx(ExecutionActivityRow, { activity: activity, manualActionStatus: findResolvedManualActionStatus(activity, resolvedManualActions) }, activity.iri))), pendingManualActions.map((ma) => (_jsx(ManualActionCard, { manualAction: ma, entities: manualActionEntities?.get(ma.subjectIri) ?? [], description: ma.description ?? entry.description ?? undefined, resolving: resolvingManualAction, onResolve: (resolution) => onManualActionResolve?.(ma.subjectIri, resolution), canResolve: canResolveManualAction, disabledReason: manualActionDisabledReason }, ma.subjectIri)))] }))] }));
20
20
  }
21
21
  function SectionStatusIcon(props) {
22
22
  return match(props.status)
@@ -1,14 +1,16 @@
1
1
  import type { EntityTypeEntry } from "./ActionPlanDetailView.js";
2
- import type { ManualActionEntity } from "./ManualActionCard.js";
3
- import type { ActionPlanExecutionProvenanceResult, ManualAction, ManualActionResolution } from "#ldo-ui";
2
+ import type { ManualActionTarget } from "./ManualActionCard.js";
3
+ import type { ActionPlanExecutionProvenanceResult, ManualAction, ManualActionResolution, ManualActionResolving } from "#ldo-ui";
4
4
  export type ExecutionSectionsProps = {
5
5
  entityTypes: EntityTypeEntry[];
6
6
  provenance: ActionPlanExecutionProvenanceResult | null;
7
7
  manualActions?: ManualAction[];
8
- manualActionEntities?: Map<string, ManualActionEntity[]>;
8
+ manualActionEntities?: Map<string, ManualActionTarget[]>;
9
9
  activeStartedAtMs?: number | null;
10
10
  onManualActionResolve?: (subjectIri: string, resolution: ManualActionResolution) => void;
11
- isResolvingManualAction?: boolean;
11
+ resolvingManualAction?: ManualActionResolving;
12
+ canResolveManualAction?: boolean;
13
+ manualActionDisabledReason?: string;
12
14
  };
13
15
  export declare function ExecutionSections(props: ExecutionSectionsProps): import("react/jsx-runtime").JSX.Element;
14
16
  //# sourceMappingURL=ExecutionSections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExecutionSections.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSections.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mCAAmC,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEzG,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,mCAAmC,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAkE9D"}
1
+ {"version":3,"file":"ExecutionSections.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSections.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,mCAAmC,EACnC,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,mCAAmC,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzF,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAsE9D"}
@@ -5,7 +5,7 @@ import { buildSections, matchesManualActionSection } from "./execution-section-m
5
5
  import { ExecutionActivityRow } from "./ExecutionActivityRow.js";
6
6
  import { ExecutionSectionItem } from "./ExecutionSectionItem.js";
7
7
  export function ExecutionSections(props) {
8
- const { entityTypes, provenance, manualActions = [], manualActionEntities, activeStartedAtMs = null, onManualActionResolve, isResolvingManualAction = false, } = props;
8
+ const { entityTypes, provenance, manualActions = [], manualActionEntities, activeStartedAtMs = null, onManualActionResolve, resolvingManualAction, canResolveManualAction, manualActionDisabledReason, } = props;
9
9
  const [expandedIndex, setExpandedIndex] = useState(0);
10
10
  const [lastAutoExpandedRunning, setLastAutoExpandedRunning] = useState(-1);
11
11
  const activities = provenance?.activities ?? [];
@@ -26,6 +26,6 @@ export function ExecutionSections(props) {
26
26
  const effectiveStatus = activeFallbackApplies ? "running" : section.status;
27
27
  const fallbackStartedAtMs = activeFallbackApplies ? activeStartedAtMs : null;
28
28
  const sectionManualActions = manualActions.filter((manualAction) => matchesManualActionSection(manualAction, section.entry, sections.length));
29
- return (_jsx(ExecutionSectionItem, { entry: section.entry, activities: section.activities, status: effectiveStatus, fallbackStartedAtMs: fallbackStartedAtMs, isExpanded: expandedIndex === index, onToggle: () => setExpandedIndex((prev) => (prev === index ? null : index)), manualActions: sectionManualActions, manualActionEntities: manualActionEntities, onManualActionResolve: onManualActionResolve, isResolvingManualAction: isResolvingManualAction }, section.key));
29
+ return (_jsx(ExecutionSectionItem, { entry: section.entry, activities: section.activities, status: effectiveStatus, fallbackStartedAtMs: fallbackStartedAtMs, isExpanded: expandedIndex === index, onToggle: () => setExpandedIndex((prev) => (prev === index ? null : index)), manualActions: sectionManualActions, manualActionEntities: manualActionEntities, onManualActionResolve: onManualActionResolve, resolvingManualAction: resolvingManualAction, canResolveManualAction: canResolveManualAction, manualActionDisabledReason: manualActionDisabledReason }, section.key));
30
30
  }) }));
31
31
  }
@@ -1,22 +1,28 @@
1
- import type { ManualAction, ManualActionResolution } from "#ldo-ui";
2
- export type ManualActionEntity = {
1
+ import type { ManualAction, ManualActionResolution, ManualActionResolving } from "#ldo-ui";
2
+ export type ManualActionTarget = {
3
3
  subjectIri: string;
4
4
  label: string;
5
- properties: PropertyChange[];
5
+ properties: ManualActionPropertyChange[];
6
6
  };
7
- export type PropertyChange = {
7
+ export type ManualActionPropertyChange = {
8
8
  label: string;
9
9
  oldValue: string | null;
10
10
  newValue: string | null;
11
11
  };
12
- type ManualActionCardProps = {
12
+ export type ManualActionCardProps = {
13
13
  manualAction: ManualAction;
14
- entities: ManualActionEntity[];
14
+ entities?: ManualActionTarget[];
15
15
  description?: string | null;
16
- isResolving: boolean;
16
+ resolving?: ManualActionResolving;
17
17
  onResolve: (resolution: ManualActionResolution) => void;
18
+ canResolve?: boolean;
19
+ disabledReason?: string;
18
20
  };
19
21
  export declare function ManualActionCard(props: ManualActionCardProps): import("react/jsx-runtime").JSX.Element;
22
+ export type ManualActionCardSkeletonProps = {
23
+ titleClassName?: string;
24
+ instructionClassName?: string;
25
+ };
26
+ export declare function ManualActionCardSkeleton(props: ManualActionCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
20
27
  export declare function resolutionChoices(retryable: boolean, defaultResolution: "COMPLETED" | "RETRY"): ManualActionResolution[];
21
- export {};
22
28
  //# sourceMappingURL=ManualActionCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManualActionCard.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ManualActionCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGpE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAsB5D;AAwID,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,OAAO,EAClB,iBAAiB,EAAE,WAAW,GAAG,OAAO,GACvC,sBAAsB,EAAE,CAI1B"}
1
+ {"version":3,"file":"ManualActionCard.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ManualActionCard.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAI3F,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,0BAA0B,EAAE,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,SAAS,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CA+C5D;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,2CAyB5E;AAsID,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,OAAO,EAClB,iBAAiB,EAAE,WAAW,GAAG,OAAO,GACvC,sBAAsB,EAAE,CAI1B"}
@@ -1,27 +1,56 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { isPresent } from "@manta-eu/lib/present";
3
3
  import { addAll } from "@manta-eu/lib/set";
4
- import { CircleCheck, Hand, MessageSquareWarning, RotateCcw } from "lucide-react";
4
+ import { CircleCheck, Clock, Hand, MessageSquareWarning, RotateCcw } from "lucide-react";
5
+ import { match } from "ts-pattern";
6
+ import { Badge } from "#components/badge/index";
7
+ import { Button } from "#components/button/index";
8
+ import { DisabledActionTooltip } from "#components/disabled-action-tooltip/index";
9
+ import { Skeleton } from "#components/skeleton/index";
10
+ import { isUnstartedManualAction } from "#lib/manual-actions";
5
11
  import { cn } from "#lib/utils";
6
12
  export function ManualActionCard(props) {
7
- const { manualAction, entities, description, isResolving, onResolve } = props;
8
- const title = description ?? manualAction.description ?? buildManualActionTitle(manualAction);
9
- const displayEntities = isPresent(entities) ? entities : [buildFallbackEntity(manualAction)];
10
- return (_jsx("div", { className: "mx-2 my-2", children: _jsxs("div", { className: "overflow-hidden rounded-xl border border-dashed border-active-border/50 bg-card shadow-sm", children: [_jsx(CardHeader, { title: title }), _jsx(EntityTable, { entities: displayEntities }), _jsx(CardFooter, { isResolving: isResolving, retryable: manualAction.retryable ?? false, defaultResolution: manualAction.defaultResolution ?? "COMPLETED", onResolve: onResolve })] }) }));
13
+ const { manualAction, entities = [], description, resolving, onResolve, canResolve = true, disabledReason } = props;
14
+ const instruction = description ?? manualAction.description ?? null;
15
+ const title = manualAction.label ?? instruction ?? buildManualActionTitle(manualAction);
16
+ const body = title === instruction ? null : instruction;
17
+ const state = manualActionState(manualAction);
18
+ return (_jsx("div", { className: "mx-2 my-2", children: _jsxs("div", { className: "overflow-hidden rounded-xl border border-dashed border-active-border/50 bg-card shadow-sm", children: [_jsx(CardHeader, { title: title, state: state }), (isPresent(body) || isPresent(manualAction.observedValue)) && (_jsxs("div", { className: "flex flex-col gap-1.5 border-b border-default-border px-3 py-3", children: [isPresent(body) && _jsx("p", { className: "typography-tiny text-default-foreground", children: body }), isPresent(manualAction.observedValue) && (_jsxs("p", { className: "typography-tiny text-muted-foreground", children: ["Observed: ", _jsx("span", { className: "font-mono", children: manualAction.observedValue })] }))] })), isPresent(entities) && _jsx(EntityTable, { entities: entities }), state === "pending" && (_jsx(CardFooter, { isResolving: isPresent(resolving), resolvingChoice: resolving?.subjectIri === manualAction.subjectIri ? resolving.resolution : undefined, retryable: manualAction.retryable ?? false, defaultResolution: manualAction.defaultResolution ?? "COMPLETED", onResolve: onResolve, canResolve: canResolve, disabledReason: disabledReason })), state === "unstarted" && (_jsxs("div", { className: "flex items-center gap-2 bg-muted px-3 py-3 typography-tiny text-muted-foreground", children: [_jsx(Clock, { className: "size-4" }), "Someone can act on this once the plan runs and reaches it."] }))] }) }));
11
19
  }
20
+ export function ManualActionCardSkeleton(props) {
21
+ const { titleClassName = "w-2/5", instructionClassName = "w-4/5" } = props;
22
+ return (_jsx("div", { className: "mx-2 my-2", "aria-hidden": true, children: _jsxs("div", { className: "overflow-hidden rounded-xl border border-dashed border-active-border/50 bg-card shadow-sm", children: [_jsxs("div", { className: "flex items-center gap-2 border-b border-default-border bg-faint px-3 py-3", children: [_jsx(Skeleton, { className: "size-4 shrink-0 rounded-sm-v4" }), _jsx(Skeleton, { className: cn("h-3.5", titleClassName) }), _jsx(Skeleton, { className: "ml-auto h-6 w-24 shrink-0 rounded-full" })] }), _jsxs("div", { className: "flex flex-col gap-2 border-b border-default-border px-3 py-3.5", children: [_jsx(Skeleton, { className: "h-3 w-full" }), _jsx(Skeleton, { className: cn("h-3", instructionClassName) })] }), _jsx("div", { className: "border-b border-default-border px-3 py-3.5", children: _jsx(Skeleton, { className: "h-3 w-1/4" }) }), _jsxs("div", { className: "flex items-center gap-2 bg-muted px-3 py-3", children: [_jsx(Skeleton, { className: "h-8 w-24 rounded-lg-v4" }), _jsx(Skeleton, { className: "h-8 w-20 rounded-lg-v4" })] })] }) }));
23
+ }
24
+ function manualActionState(manualAction) {
25
+ if (isUnstartedManualAction(manualAction))
26
+ return "unstarted";
27
+ return match(manualAction.status)
28
+ .returnType()
29
+ .with("PENDING", null, () => "pending")
30
+ .with("COMPLETED", "REJECTED", "RETRY", (resolved) => resolved.toLowerCase())
31
+ .exhaustive();
32
+ }
33
+ const stateBadges = {
34
+ pending: { label: "Needs a person", variant: "warning" },
35
+ unstarted: { label: "Not started", variant: "secondary" },
36
+ completed: { label: "Done", variant: "success" },
37
+ rejected: { label: "Rejected", variant: "destructive" },
38
+ retry: { label: "Retrying", variant: "info" },
39
+ };
12
40
  function CardHeader(props) {
13
- const { title } = props;
14
- return (_jsxs("div", { className: "flex items-center gap-2 border-b border-default-border bg-faint px-3 py-3", children: [_jsx(Hand, { className: "size-4 text-primary" }), _jsx("span", { className: "typography-tiny text-default-foreground", children: title })] }));
41
+ const { title, state } = props;
42
+ const badge = stateBadges[state];
43
+ return (_jsxs("div", { className: "flex items-center gap-2 border-b border-default-border bg-faint px-3 py-3", children: [_jsx(Hand, { className: "size-4 shrink-0 text-primary" }), _jsx("span", { className: "typography-tiny-medium min-w-0 flex-1 text-default-foreground", children: title }), _jsx(Badge, { size: "sm", variant: badge.variant, children: badge.label })] }));
15
44
  }
16
45
  function EntityTable(props) {
17
46
  const { entities } = props;
18
47
  const hasProperties = entities.some((e) => isPresent(e.properties));
19
48
  const propertyLabels = hasProperties ? collectPropertyLabels(entities) : [];
20
- return (_jsxs("div", { children: [hasProperties && (_jsxs("div", { className: "flex items-center gap-3 border-b border-default-border bg-muted px-3 py-2.5", children: [_jsx("span", { className: "typography-tiny w-[240px] text-muted-foreground", children: "Entity" }), propertyLabels.map((label) => (_jsx("span", { className: "typography-tiny flex-1 text-right text-muted-foreground", children: label }, label))), _jsx("div", { className: "w-7" })] })), entities.map((entity) => (_jsx(EntityRow, { entity: entity, propertyLabels: propertyLabels }, entity.subjectIri)))] }));
49
+ return (_jsxs("div", { children: [hasProperties && (_jsxs("div", { className: "flex items-center gap-3 border-b border-default-border bg-muted px-3 py-2.5", children: [_jsx("span", { className: "typography-tiny w-[240px] text-muted-foreground", children: "Entity" }), propertyLabels.map((label) => (_jsx("span", { className: "typography-tiny flex-1 text-right text-muted-foreground", children: label }, label)))] })), entities.map((entity) => (_jsx(EntityRow, { entity: entity, propertyLabels: propertyLabels }, entity.subjectIri)))] }));
21
50
  }
22
51
  function EntityRow(props) {
23
52
  const { entity, propertyLabels } = props;
24
- return (_jsxs("div", { className: "flex items-center gap-3 border-b border-default-border bg-card px-3 py-3 last:border-b-0", children: [_jsx("div", { className: "flex items-center gap-2 w-[240px]", children: _jsx("span", { className: "typography-tiny truncate text-default-foreground", children: entity.label || "Manual action" }) }), propertyLabels.map((label) => {
53
+ return (_jsxs("div", { className: "flex items-center gap-3 border-b border-default-border bg-card px-3 py-3 last:border-b-0", children: [_jsx("div", { className: "flex w-[240px] items-center gap-2", children: _jsx("span", { className: "typography-tiny truncate text-default-foreground", children: entity.label || "Manual action" }) }), propertyLabels.map((label) => {
25
54
  const change = entity.properties.find((p) => p.label === label);
26
55
  if (!change) {
27
56
  return (_jsx("span", { className: "typography-tiny flex-1 text-right text-muted-foreground", children: "\u2014" }, label));
@@ -39,27 +68,25 @@ function PropertyChangePills(props) {
39
68
  }
40
69
  return (_jsxs("div", { className: "flex flex-1 items-center justify-end gap-1.5", children: [_jsx("span", { className: "rounded-[5px] bg-accent px-1.5 py-0.5 font-mono text-[11px] leading-4 text-muted-foreground", children: change.oldValue }), _jsx("span", { className: "font-mono text-[11px] text-muted-foreground", children: "\u2192" }), _jsx("span", { className: "rounded-[5px] bg-success px-1.5 py-0.5 font-mono text-[11px] leading-4 text-success-foreground", children: change.newValue })] }));
41
70
  }
42
- const primaryButton = cn("flex h-8 items-center gap-1.5 rounded-lg bg-success px-3", "typography-tiny text-success-foreground", "hover:bg-success/80 transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed");
43
- const secondaryButton = cn("flex h-8 items-center gap-1.5 rounded-lg border border-default-border bg-card px-3", "typography-tiny text-default-foreground", "hover:bg-muted-border transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed");
44
71
  export function resolutionChoices(retryable, defaultResolution) {
45
72
  const positive = retryable ? ["COMPLETED", "RETRY"] : ["COMPLETED"];
46
73
  const ordered = retryable && defaultResolution === "RETRY" ? [...positive].reverse() : positive;
47
74
  return [...ordered, "REJECTED"];
48
75
  }
49
76
  const choiceLabels = {
50
- COMPLETED: "Done, I fixed it",
77
+ COMPLETED: "Done",
51
78
  RETRY: "Retry",
52
79
  REJECTED: "Reject",
53
80
  };
54
81
  const choiceIcons = {
55
- COMPLETED: _jsx(CircleCheck, { className: "size-4" }),
56
- RETRY: _jsx(RotateCcw, { className: "size-4" }),
57
- REJECTED: _jsx(MessageSquareWarning, { className: "size-4" }),
82
+ COMPLETED: CircleCheck,
83
+ RETRY: RotateCcw,
84
+ REJECTED: MessageSquareWarning,
58
85
  };
59
86
  function CardFooter(props) {
60
- const { isResolving, retryable, defaultResolution, onResolve } = props;
87
+ const { isResolving, resolvingChoice, retryable, defaultResolution, onResolve, canResolve, disabledReason } = props;
61
88
  const choices = resolutionChoices(retryable, defaultResolution);
62
- return (_jsx("div", { className: "flex items-center justify-between bg-muted px-3 py-3", children: _jsx("div", { className: "flex items-center gap-2", children: choices.map((choice, index) => (_jsxs("button", { type: "button", disabled: isResolving, onClick: () => onResolve(choice), className: index === 0 ? primaryButton : secondaryButton, children: [choiceIcons[choice], choiceLabels[choice]] }, choice))) }) }));
89
+ return (_jsx("div", { className: "flex items-center bg-muted px-3 py-3", children: _jsx(DisabledActionTooltip, { reason: canResolve ? undefined : disabledReason, children: _jsx("div", { className: "flex flex-wrap items-center gap-2", children: choices.map((choice, index) => (_jsx(Button, { size: "sm", rounded: "lg", variant: index === 0 ? "primary" : "tertiary", icon: choiceIcons[choice], label: choiceLabels[choice], disabled: !canResolve || isResolving, isLoading: isResolving && resolvingChoice === choice, onClick: () => onResolve(choice) }, choice))) }) }) }));
63
90
  }
64
91
  function buildManualActionTitle(manualAction) {
65
92
  const subject = manualAction.subjectLabel || manualAction.typeName;
@@ -68,13 +95,6 @@ function buildManualActionTitle(manualAction) {
68
95
  }
69
96
  return "Manual action needs approval";
70
97
  }
71
- function buildFallbackEntity(manualAction) {
72
- return {
73
- subjectIri: manualAction.subjectIri,
74
- label: manualAction.subjectLabel || manualAction.typeName || "Manual action",
75
- properties: [],
76
- };
77
- }
78
98
  function collectPropertyLabels(entities) {
79
99
  const labels = new Set();
80
100
  for (const entity of entities) {
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from "react";
2
+ import { type ManualActionTarget } from "./ManualActionCard.js";
3
+ import { type ManualAction, type ManualActionResolution, type ManualActionResolving } from "#hooks/use-manual-actions";
4
+ export type ManualActionListViewProps = {
5
+ actions: ManualAction[];
6
+ targetsBySubject?: Map<string, ManualActionTarget[]>;
7
+ onResolve: (action: ManualAction, resolution: ManualActionResolution) => void;
8
+ resolving?: ManualActionResolving;
9
+ canResolve?: boolean;
10
+ disabledReason?: string;
11
+ isLoading?: boolean;
12
+ failed?: boolean;
13
+ emptyFallback?: ReactNode;
14
+ };
15
+ export declare function ManualActionListView(props: ManualActionListViewProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
16
+ export type PlanManualActionsProps = Omit<ManualActionListViewProps, "actions" | "targetsBySubject" | "isLoading" | "failed"> & {
17
+ planGraphIri: string;
18
+ includeUnstarted?: boolean;
19
+ refetchIntervalMs?: number | false;
20
+ };
21
+ export declare function PlanManualActions(props: PlanManualActionsProps): import("react/jsx-runtime").JSX.Element;
22
+ //# sourceMappingURL=ManualActionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManualActionList.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ManualActionList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAA8C,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACrD,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC9E,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B,CAAC;AAQF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,wTA6DpE;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,yBAAyB,EACzB,SAAS,GAAG,kBAAkB,GAAG,WAAW,GAAG,QAAQ,CACxD,GAAG;IACF,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACpC,CAAC;AAIF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAoB9D"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { isPresent } from "@manta-eu/lib/present";
3
+ import { useManualActionTargets } from "./manual-action-targets.js";
4
+ import { ManualActionCard, ManualActionCardSkeleton } from "./ManualActionCard.js";
5
+ import { useManualActions, } from "#hooks/use-manual-actions";
6
+ const skeletonShapes = [
7
+ { title: "w-2/5", instruction: "w-4/5" },
8
+ { title: "w-1/2", instruction: "w-3/5" },
9
+ { title: "w-1/3", instruction: "w-2/3" },
10
+ ];
11
+ export function ManualActionListView(props) {
12
+ const { actions, targetsBySubject, onResolve, resolving, canResolve, disabledReason, isLoading = false, failed = false, emptyFallback, } = props;
13
+ if (isLoading) {
14
+ return (_jsxs("div", { role: "status", "aria-busy": "true", className: "flex flex-col", children: [_jsx("span", { className: "sr-only", children: "Loading manual steps" }), skeletonShapes.map((shape) => (_jsx(ManualActionCardSkeleton, { titleClassName: shape.title, instructionClassName: shape.instruction }, shape.title)))] }));
15
+ }
16
+ if (failed) {
17
+ return (_jsx("div", { className: "rounded-xl border border-error-border bg-card px-4 py-6 typography-small text-error-foreground", children: "This plan's manual steps could not be read." }));
18
+ }
19
+ if (!isPresent(actions)) {
20
+ return (emptyFallback ?? (_jsx("div", { className: "rounded-xl border border-muted-border bg-card px-4 py-6 typography-small text-muted-foreground", children: "No manual steps in this plan." })));
21
+ }
22
+ return (_jsx("div", { className: "flex flex-col", children: actions.map((action) => (_jsx(ManualActionCard, { manualAction: action, entities: targetsBySubject?.get(action.subjectIri) ?? [], resolving: resolving, onResolve: (resolution) => onResolve(action, resolution), canResolve: canResolve, disabledReason: disabledReason }, action.subjectIri))) }));
23
+ }
24
+ const noActions = [];
25
+ export function PlanManualActions(props) {
26
+ const { planGraphIri, includeUnstarted = true, refetchIntervalMs = false, ...view } = props;
27
+ const { data, isLoading, isError } = useManualActions({
28
+ planGraphIri,
29
+ includeUnstarted,
30
+ refetchIntervalMs,
31
+ });
32
+ const actions = data ?? noActions;
33
+ const targetsBySubject = useManualActionTargets(actions);
34
+ return (_jsx(ManualActionListView, { actions: actions, targetsBySubject: targetsBySubject, isLoading: isLoading, failed: isError && data === undefined, ...view }));
35
+ }
@@ -0,0 +1,4 @@
1
+ import type { ManualActionTarget } from "./ManualActionCard.js";
2
+ import type { ManualAction } from "#hooks/use-manual-actions";
3
+ export declare function useManualActionTargets(actions: readonly ManualAction[]): Map<string, ManualActionTarget[]>;
4
+ //# sourceMappingURL=manual-action-targets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manual-action-targets.d.ts","sourceRoot":"","sources":["../../../src/components/planning/manual-action-targets.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAgB1G"}
@@ -0,0 +1,19 @@
1
+ import { humanizeEntityName } from "@manta-eu/client/shared/agent-mode";
2
+ import { iriLocalName } from "@manta-eu/client/shared/rdf-namespaces";
3
+ import { isPresent } from "@manta-eu/lib/present";
4
+ import { useMemo } from "react";
5
+ import { useInstanceLabels } from "#hooks/use-instance-labels";
6
+ export function useManualActionTargets(actions) {
7
+ const aboutIris = useMemo(() => actions.flatMap(({ aboutIri }) => (isPresent(aboutIri) ? [aboutIri] : [])), [actions]);
8
+ const labels = useInstanceLabels(aboutIris);
9
+ return useMemo(() => {
10
+ const targets = new Map();
11
+ for (const action of actions) {
12
+ if (!isPresent(action.aboutIri))
13
+ continue;
14
+ const label = labels.get(action.aboutIri) ?? humanizeEntityName(iriLocalName(action.aboutIri));
15
+ targets.set(action.subjectIri, [{ subjectIri: action.aboutIri, label, properties: [] }]);
16
+ }
17
+ return targets;
18
+ }, [actions, labels]);
19
+ }
@@ -63,9 +63,11 @@ export { Initials } from "./initials.js";
63
63
  export { NavMenu, type NavItem, type NavMenuLinkProps, type NavSubItem } from "./nav-menu.js";
64
64
  export { useIsMobile } from "./use-mobile.js";
65
65
  export { NavUser } from "./nav-user.js";
66
+ export { UserAvatar } from "./user-avatar.js";
66
67
  export { sidebarStorageKey };
67
68
  export type { CompanyPickerProps } from "./company-picker.js";
68
69
  export type { InitialsArgs } from "./initials.js";
70
+ export type { UserAvatarArgs } from "./user-avatar.js";
69
71
  export type { NavItemBase, NavLeafItem, NavMenuArgs, NavMenuLinkComponent, NavMenuSubmenuVariant, NavSubmenuItem, } from "./nav-menu.js";
70
72
  export type { NavUserArgs } from "./nav-user.js";
71
73
  export type { SidebarContextProps } from "./sidebar-context.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAyD,KAAK,cAAc,EAAsB,MAAM,OAAO,CAAC;AACvH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,OAAO,EAAW,cAAc,EAAmB,MAAM,YAAY,CAAC;AACtE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAI7E,QAAA,MAAM,iBAAiB,kBAAkB,CAAC;AAM1C,iBAAS,UAAU,wBAOlB;AAED,iBAAS,eAAe,CAAC,EACvB,WAAkB,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,WAAW,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,2CAkFA;AAED,iBAAS,OAAO,CAAC,EACf,IAAa,EACb,OAAmB,EACnB,WAAyB,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;IAC3C,WAAW,CAAC,EAAE,WAAW,G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Y,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAG7B,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -264,4 +264,5 @@ export { Initials } from "./initials.js";
264
264
  export { NavMenu } from "./nav-menu.js";
265
265
  export { useIsMobile } from "./use-mobile.js";
266
266
  export { NavUser } from "./nav-user.js";
267
+ export { UserAvatar } from "./user-avatar.js";
267
268
  export { sidebarStorageKey };
@@ -4,9 +4,9 @@ export type NavUserArgs = {
4
4
  topSlot?: ReactNode;
5
5
  accountExtraSlot?: ReactNode;
6
6
  name: string;
7
+ picture?: string | null;
7
8
  currentDatastore: {
8
9
  name: string;
9
- iconLogoUrl?: string;
10
10
  };
11
11
  pickerSlot?: ReactNode;
12
12
  onNavigateToAccount: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"nav-user.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/nav-user.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,2CA2FxC"}
1
+ {"version":3,"file":"nav-user.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/nav-user.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,2CAmFxC"}
@@ -2,10 +2,10 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ChevronsUpDown, LogOut } from "lucide-react";
4
4
  import { Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownSeparator, DropdownTrigger, preventPointerFocus, } from "../dropdown/index.js";
5
- import { Initials } from "./initials.js";
5
+ import { UserAvatar } from "./user-avatar.js";
6
6
  import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "./index.js";
7
7
  export function NavUser(args) {
8
- const { children, topSlot, accountExtraSlot, className, name, currentDatastore, pickerSlot, onNavigateToAccount, onLogout, onCloseAutoFocus, } = args;
8
+ const { children, topSlot, accountExtraSlot, className, name, picture, currentDatastore, pickerSlot, onNavigateToAccount, onLogout, onCloseAutoFocus, } = args;
9
9
  const { isMobile } = useSidebar();
10
- return (_jsx(SidebarMenu, { className: className, children: _jsx(SidebarMenuItem, { children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { "data-testid": "user-menu-trigger", className: "data-[state=open]:bg-muted data-[state=open]:text-default-foreground w-full group-data-[collapsible=icon]:p-0", tooltip: currentDatastore.name, children: [currentDatastore.iconLogoUrl ? (_jsx("img", { src: currentDatastore.iconLogoUrl, alt: currentDatastore.name, width: 32, height: 32, className: "size-8 object-cover bg-faint rounded-full shrink-0 transition-[width,height] duration-200 ease-linear" })) : (_jsx(Initials, { className: "bg-primary shrink-0 rounded-full transition-[width,height] duration-200 ease-linear group-data-[collapsible=icon]:p-0", name: currentDatastore.name })), _jsxs("div", { className: "flex flex-col min-w-0 flex-1 transition-[opacity,max-width] duration-200 ease-linear max-w-full group-data-[collapsible=icon]:max-w-0 group-data-[collapsible=icon]:hidden", children: [_jsx("span", { "data-testid": "user-display-name", className: "truncate typography-small-medium text-left", children: name }), _jsx("span", { className: "truncate typography-tiny text-muted-foreground text-left", children: currentDatastore.name })] }), _jsx(ChevronsUpDown, { className: "ml-auto size-4 shrink-0 my-auto transition-[opacity,max-width] duration-200 ease-linear group-data-[collapsible=icon]:max-w-0 group-data-[collapsible=icon]:hidden" })] }) }), _jsxs(DropdownContent, { className: "w-(--radix-dropdown-menu-trigger-width) min-w-60 rounded-lg px-0 bg-card border-muted shadow-md", side: isMobile ? "bottom" : "right", align: "end", sideOffset: 4, onCloseAutoFocus: onCloseAutoFocus, children: [pickerSlot, topSlot, (pickerSlot || topSlot) && _jsx(DropdownSeparator, {}), _jsxs(DropdownGroup, { className: "p-2", children: [_jsxs(DropdownItem, { className: "p-1.5 flex flex-row items-center gap-1.5 typography-caption h-11", onClick: onNavigateToAccount, onPointerMove: preventPointerFocus, onPointerLeave: preventPointerFocus, children: [_jsx(Initials, { name: name }), _jsx("span", { className: "typography-caption", children: name })] }), accountExtraSlot] }), children, _jsx(DropdownSeparator, {}), _jsx(DropdownGroup, { className: "p-2", children: _jsxs(DropdownItem, { "data-testid": "logout-button", className: "p-1.5 flex flex-row items-center gap-1.5 h-11", onClick: onLogout, onPointerMove: preventPointerFocus, onPointerLeave: preventPointerFocus, children: [_jsx(LogOut, { className: "size-4" }), _jsx("span", { className: "my-auto typography-caption", children: "Sign out" })] }) })] })] }) }) }));
10
+ return (_jsx(SidebarMenu, { className: className, children: _jsx(SidebarMenuItem, { children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { "data-testid": "user-menu-trigger", className: "data-[state=open]:bg-muted data-[state=open]:text-default-foreground w-full group-data-[collapsible=icon]:p-0", tooltip: `${name} · ${currentDatastore.name}`, children: [_jsx(UserAvatar, { className: "shrink-0 rounded-full transition-[width,height] duration-200 ease-linear group-data-[collapsible=icon]:p-0", name: name, picture: picture }), _jsxs("div", { className: "flex flex-col min-w-0 flex-1 transition-[opacity,max-width] duration-200 ease-linear max-w-full group-data-[collapsible=icon]:max-w-0 group-data-[collapsible=icon]:hidden", children: [_jsx("span", { "data-testid": "user-display-name", className: "truncate typography-small-medium text-left", children: name }), _jsx("span", { className: "truncate typography-tiny text-muted-foreground text-left", children: currentDatastore.name })] }), _jsx(ChevronsUpDown, { className: "ml-auto size-4 shrink-0 my-auto transition-[opacity,max-width] duration-200 ease-linear group-data-[collapsible=icon]:max-w-0 group-data-[collapsible=icon]:hidden" })] }) }), _jsxs(DropdownContent, { className: "w-(--radix-dropdown-menu-trigger-width) min-w-60 rounded-lg px-0 bg-card border-muted shadow-md", side: isMobile ? "bottom" : "right", align: "end", sideOffset: 4, onCloseAutoFocus: onCloseAutoFocus, children: [pickerSlot, topSlot, (pickerSlot || topSlot) && _jsx(DropdownSeparator, {}), _jsxs(DropdownGroup, { className: "p-2", children: [_jsxs(DropdownItem, { className: "p-1.5 flex flex-row items-center gap-1.5 typography-caption h-11", onClick: onNavigateToAccount, onPointerMove: preventPointerFocus, onPointerLeave: preventPointerFocus, children: [_jsx(UserAvatar, { name: name, picture: picture }), _jsx("span", { className: "typography-caption", children: name })] }), accountExtraSlot] }), children, _jsx(DropdownSeparator, {}), _jsx(DropdownGroup, { className: "p-2", children: _jsxs(DropdownItem, { "data-testid": "logout-button", className: "p-1.5 flex flex-row items-center gap-1.5 h-11", onClick: onLogout, onPointerMove: preventPointerFocus, onPointerLeave: preventPointerFocus, children: [_jsx(LogOut, { className: "size-4" }), _jsx("span", { className: "my-auto typography-caption", children: "Sign out" })] }) })] })] }) }) }));
11
11
  }
@@ -0,0 +1,7 @@
1
+ export type UserAvatarArgs = {
2
+ name: string;
3
+ picture?: string | null;
4
+ className?: string;
5
+ };
6
+ export declare function UserAvatar(props: UserAvatarArgs): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=user-avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-avatar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/user-avatar.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,2CAe/C"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { isPresent } from "@manta-eu/lib/present";
3
+ import { Initials } from "./initials.js";
4
+ import { Avatar, AvatarFallback, AvatarImage } from "#components/avatar/index";
5
+ import { cn } from "#style";
6
+ export function UserAvatar(props) {
7
+ const { name, picture, className } = props;
8
+ return (_jsx(Avatar, { asChild: true, className: cn("size-8 rounded-lg", className), children: _jsxs("div", { "data-testid": "user-avatar", "aria-hidden": true, children: [isPresent(picture) && (_jsx(AvatarImage, { src: picture, alt: "", referrerPolicy: "no-referrer", className: "object-cover" })), _jsx(AvatarFallback, { className: "bg-transparent", children: _jsx(Initials, { name: name, className: "size-full rounded-[inherit]" }) })] }) }));
9
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"manta-swim.d.ts","sourceRoot":"","sources":["../../../src/components/thinking/manta-swim.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAa9C;AAED,wBAAgB,SAAS,4CAuBxB"}
1
+ {"version":3,"file":"manta-swim.d.ts","sourceRoot":"","sources":["../../../src/components/thinking/manta-swim.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAc9C;AAED,wBAAgB,SAAS,4CAuBxB"}