@manta-eu/react 0.1.4 → 0.1.6

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 +4 -8
  2. package/dist/components/audience-phase-badge/index.d.ts +1 -1
  3. package/dist/components/audience-phase-badge/index.d.ts.map +1 -1
  4. package/dist/components/audience-phase-badge/index.js +3 -0
  5. package/dist/components/authenticated-chat/index.d.ts.map +1 -1
  6. package/dist/components/authenticated-chat/index.js +0 -5
  7. package/dist/components/chat/chat-input/index.d.ts +1 -1
  8. package/dist/components/chat/chat-input/index.d.ts.map +1 -1
  9. package/dist/components/chat/chat-input/index.js +4 -5
  10. package/dist/components/chat-view/Chat.d.ts +6 -0
  11. package/dist/components/chat-view/Chat.d.ts.map +1 -1
  12. package/dist/components/chat-view/Chat.js +18 -8
  13. package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
  14. package/dist/components/chat-view/ChatHeaders.js +3 -2
  15. package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts +1 -0
  16. package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts.map +1 -1
  17. package/dist/components/embedded-chat/EmbeddedDatastorePicker.js +9 -3
  18. package/dist/components/embedded-chat/index.d.ts.map +1 -1
  19. package/dist/components/embedded-chat/index.js +1 -8
  20. package/dist/components/layouts/Sidebar.d.ts.map +1 -1
  21. package/dist/components/layouts/Sidebar.js +25 -5
  22. package/dist/components/planning/ActioningView.d.ts.map +1 -1
  23. package/dist/components/planning/ActioningView.js +11 -6
  24. package/dist/components/planning/ExecutionSectionItem.d.ts +2 -3
  25. package/dist/components/planning/ExecutionSectionItem.d.ts.map +1 -1
  26. package/dist/components/planning/ExecutionSectionItem.js +3 -6
  27. package/dist/components/planning/ExecutionSections.d.ts +2 -3
  28. package/dist/components/planning/ExecutionSections.d.ts.map +1 -1
  29. package/dist/components/planning/ExecutionSections.js +2 -2
  30. package/dist/components/planning/ManualActionCard.d.ts +3 -4
  31. package/dist/components/planning/ManualActionCard.d.ts.map +1 -1
  32. package/dist/components/planning/ManualActionCard.js +24 -6
  33. package/dist/components/rdf-insights/CampaignChannelMix.js +1 -1
  34. package/dist/components/rdf-insights/CampaignGrid.d.ts.map +1 -1
  35. package/dist/components/rdf-insights/CampaignGrid.js +2 -2
  36. package/dist/components/rdf-insights/DailyPerformance.js +2 -2
  37. package/dist/components/rdf-insights/KpiDashboard.d.ts +2 -2
  38. package/dist/components/rdf-insights/KpiDashboard.d.ts.map +1 -1
  39. package/dist/components/rdf-insights/KpiDashboard.js +33 -53
  40. package/dist/components/rdf-insights/MetaDailyInsights.js +2 -2
  41. package/dist/components/rdf-insights/ProductCard.d.ts.map +1 -1
  42. package/dist/components/rdf-insights/ProductCard.js +1 -1
  43. package/dist/components/rdf-insights/ProductVariantsTable.js +1 -1
  44. package/dist/components/rdf-insights/useExtractedInsights.d.ts +1 -1
  45. package/dist/components/rdf-insights/useExtractedInsights.js +3 -3
  46. package/dist/components/sidebar/nav-menu.d.ts +2 -0
  47. package/dist/components/sidebar/nav-menu.d.ts.map +1 -1
  48. package/dist/components/sidebar/nav-menu.js +11 -6
  49. package/dist/components/table/index.d.ts +26 -0
  50. package/dist/components/table/index.d.ts.map +1 -1
  51. package/dist/components/table/index.js +31 -1
  52. package/dist/datastore-picker/datastore-picker-rows.d.ts +1 -0
  53. package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
  54. package/dist/datastore-picker/datastore-picker-rows.js +6 -2
  55. package/dist/explain-fact/DatalogCode.d.ts.map +1 -1
  56. package/dist/explain-fact/DatalogCode.js +7 -2
  57. package/dist/explain-fact/FactValue.js +3 -3
  58. package/dist/explain-fact/proof-tree/ProofTreeFormulaFooter.d.ts.map +1 -1
  59. package/dist/explain-fact/proof-tree/ProofTreeFormulaFooter.js +2 -1
  60. package/dist/globals.css +10 -102
  61. package/dist/graph/createNodeRouter.d.ts.map +1 -1
  62. package/dist/graph/createNodeRouter.js +3 -0
  63. package/dist/graph/nodes/BrandFacetRuleView.d.ts.map +1 -1
  64. package/dist/graph/nodes/BrandFacetRuleView.js +6 -4
  65. package/dist/graph/nodes/BrandFontFamilyView.d.ts +3 -0
  66. package/dist/graph/nodes/BrandFontFamilyView.d.ts.map +1 -0
  67. package/dist/graph/nodes/BrandFontFamilyView.js +56 -0
  68. package/dist/graph/nodes/BrandFontUploadButton.d.ts +6 -0
  69. package/dist/graph/nodes/BrandFontUploadButton.d.ts.map +1 -0
  70. package/dist/graph/nodes/BrandFontUploadButton.js +65 -0
  71. package/dist/graph/nodes/BrandGuidelinesView.d.ts.map +1 -1
  72. package/dist/graph/nodes/BrandGuidelinesView.js +2 -6
  73. package/dist/graph/nodes/GoogleCampaignView.js +2 -2
  74. package/dist/graph/nodes/brand-font.d.ts +12 -0
  75. package/dist/graph/nodes/brand-font.d.ts.map +1 -0
  76. package/dist/graph/nodes/brand-font.js +12 -0
  77. package/dist/graph/nodes/brand-shared.d.ts +3 -2
  78. package/dist/graph/nodes/brand-shared.d.ts.map +1 -1
  79. package/dist/graph/nodes/brand-shared.js +3 -2
  80. package/dist/hooks/use-action-plans-list.js +1 -1
  81. package/dist/hooks/use-connection-problems.d.ts +15 -0
  82. package/dist/hooks/use-connection-problems.d.ts.map +1 -0
  83. package/dist/hooks/use-connection-problems.js +9 -0
  84. package/dist/hooks/use-font-face.d.ts +3 -0
  85. package/dist/hooks/use-font-face.d.ts.map +1 -0
  86. package/dist/hooks/use-font-face.js +33 -0
  87. package/dist/hooks/use-graph-refresh-after-turn.d.ts +2 -0
  88. package/dist/hooks/use-graph-refresh-after-turn.d.ts.map +1 -0
  89. package/dist/hooks/use-graph-refresh-after-turn.js +12 -0
  90. package/dist/hooks/use-manual-actions.d.ts +11 -1
  91. package/dist/hooks/use-manual-actions.d.ts.map +1 -1
  92. package/dist/hooks/use-manual-actions.js +47 -100
  93. package/dist/hooks/useAuth.d.ts +6 -1
  94. package/dist/hooks/useAuth.d.ts.map +1 -1
  95. package/dist/hooks/useAuth.js +36 -9
  96. package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
  97. package/dist/ldo-ui.d.ts +1 -1
  98. package/dist/ldo-ui.d.ts.map +1 -1
  99. package/dist/lib/activity-changeset.d.ts.map +1 -1
  100. package/dist/lib/activity-changeset.js +6 -3
  101. package/dist/lib/datastore-route-table.d.ts +1 -0
  102. package/dist/lib/datastore-route-table.d.ts.map +1 -1
  103. package/dist/lib/datastore-route-table.js +2 -0
  104. package/dist/lib/manual-actions.js +1 -1
  105. package/dist/lib/rdf/index.d.ts +4 -2
  106. package/dist/lib/rdf/index.d.ts.map +1 -1
  107. package/dist/lib/rdf/index.js +48 -18
  108. package/dist/lib/rdf/insights.d.ts +6 -1
  109. package/dist/lib/rdf/insights.d.ts.map +1 -1
  110. package/dist/lib/rdf/insights.js +15 -3
  111. package/dist/lib/rdf/types.d.ts +21 -8
  112. package/dist/lib/rdf/types.d.ts.map +1 -1
  113. package/dist/lib/tool-icons.d.ts.map +1 -1
  114. package/dist/lib/tool-icons.js +1 -5
  115. package/dist/providers/ActiveChatProvider.d.ts.map +1 -1
  116. package/dist/providers/ActiveChatProvider.js +2 -0
  117. package/dist/providers/AuthContext.d.ts +1 -1
  118. package/dist/providers/AuthContext.d.ts.map +1 -1
  119. package/dist/providers/KnowledgeGraphStateContext.d.ts +0 -1
  120. package/dist/providers/KnowledgeGraphStateContext.d.ts.map +1 -1
  121. package/dist/providers/KnowledgeGraphStateProvider.d.ts.map +1 -1
  122. package/dist/providers/KnowledgeGraphStateProvider.js +8 -19
  123. package/dist/providers/index.d.ts +4 -1
  124. package/dist/providers/index.d.ts.map +1 -1
  125. package/dist/providers/index.js +2 -1
  126. package/dist/routes/activity/change-display.js +1 -1
  127. package/dist/routes/data-explorer/components/record-detail/ActionFormDialog.d.ts.map +1 -1
  128. package/dist/routes/data-explorer/components/record-detail/ActionFormDialog.js +23 -9
  129. package/dist/routes/data-explorer/components/record-detail/action-properties.d.ts +2 -4
  130. package/dist/routes/data-explorer/components/record-detail/action-properties.d.ts.map +1 -1
  131. package/dist/routes/data-explorer/components/record-detail/action-properties.js +8 -50
  132. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +4 -2
  133. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -1
  134. package/dist/routes/datastores/components/DatastoreFormDialog.js +7 -4
  135. package/dist/routes/datastores/components/DatastoresToolbar.d.ts +3 -1
  136. package/dist/routes/datastores/components/DatastoresToolbar.d.ts.map +1 -1
  137. package/dist/routes/datastores/components/DatastoresToolbar.js +18 -5
  138. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts.map +1 -1
  139. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.js +6 -2
  140. package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts +7 -0
  141. package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts.map +1 -0
  142. package/dist/routes/datastores/components/ProvisionDatastoreDialog.js +10 -0
  143. package/dist/routes/datastores/flatten.d.ts +4 -0
  144. package/dist/routes/datastores/flatten.d.ts.map +1 -1
  145. package/dist/routes/datastores/flatten.js +11 -0
  146. package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts +4 -1
  147. package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts.map +1 -1
  148. package/dist/routes/datastores/hooks/useDatastoreColumns.js +6 -2
  149. package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts +3 -0
  150. package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts.map +1 -0
  151. package/dist/routes/datastores/hooks/useTenantOrganizationCheck.js +21 -0
  152. package/dist/routes/datastores/index.d.ts.map +1 -1
  153. package/dist/routes/datastores/index.js +44 -6
  154. package/dist/routes/datastores/link-provider.d.ts +11 -0
  155. package/dist/routes/datastores/link-provider.d.ts.map +1 -0
  156. package/dist/routes/datastores/link-provider.js +34 -0
  157. package/dist/routes/integrations/components/connect-forms/types.d.ts +1 -0
  158. package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
  159. package/dist/routes/integrations/connection-view.d.ts +4 -1
  160. package/dist/routes/integrations/connection-view.d.ts.map +1 -1
  161. package/dist/routes/integrations/connection-view.js +39 -6
  162. package/dist/routes/integrations/types.d.ts +3 -0
  163. package/dist/routes/integrations/types.d.ts.map +1 -1
  164. package/dist/routes/memories/components/ChangeScopeDialog.d.ts +1 -1
  165. package/dist/routes/memories/components/ChangeScopeDialog.d.ts.map +1 -1
  166. package/dist/routes/memories/components/ChangeScopeDialog.js +3 -3
  167. package/dist/routes/memories/components/EmptyStates.d.ts +1 -2
  168. package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
  169. package/dist/routes/memories/components/EmptyStates.js +2 -2
  170. package/dist/routes/memories/components/MemoriesPanel.d.ts +1 -1
  171. package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
  172. package/dist/routes/memories/components/MemoriesPanel.js +9 -9
  173. package/dist/routes/memories/components/MemoryActions.d.ts +1 -1
  174. package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
  175. package/dist/routes/memories/components/MemoryActions.js +4 -4
  176. package/dist/routes/memories/components/MemoryFields.d.ts +1 -1
  177. package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
  178. package/dist/routes/memories/components/MemoryFields.js +2 -2
  179. package/dist/routes/memories/components/MemoryFormDialog.d.ts +1 -1
  180. package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
  181. package/dist/routes/memories/components/MemoryFormDialog.js +2 -2
  182. package/dist/routes/memories/components/TeamPicker.d.ts +1 -1
  183. package/dist/routes/memories/components/TeamPicker.d.ts.map +1 -1
  184. package/dist/routes/memories/components/TeamPicker.js +2 -2
  185. package/dist/routes/memories/hooks/useMemoryColumns.d.ts +1 -1
  186. package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
  187. package/dist/routes/memories/hooks/useMemoryColumns.js +3 -3
  188. package/dist/routes/memories/index.d.ts.map +1 -1
  189. package/dist/routes/memories/index.js +21 -21
  190. package/dist/shacl/shacl-form-types.d.ts +2 -3
  191. package/dist/shacl/shacl-form-types.d.ts.map +1 -1
  192. package/dist/shared/graph-derived-queries.d.ts +5 -0
  193. package/dist/shared/graph-derived-queries.d.ts.map +1 -0
  194. package/dist/shared/graph-derived-queries.js +28 -0
  195. package/package.json +8 -10
  196. package/dist/components/ai-elements/chain-of-thought.d.ts +0 -30
  197. package/dist/components/ai-elements/chain-of-thought.d.ts.map +0 -1
  198. package/dist/components/ai-elements/chain-of-thought.js +0 -57
  199. package/dist/components/context-menu.d.ts +0 -29
  200. package/dist/components/context-menu.d.ts.map +0 -1
  201. package/dist/components/context-menu.js +0 -67
  202. package/dist/components/hover-card.d.ts +0 -6
  203. package/dist/components/hover-card.d.ts.map +0 -1
  204. package/dist/components/hover-card.js +0 -15
  205. package/dist/components/layouts/ChatHistoryItem.d.ts +0 -9
  206. package/dist/components/layouts/ChatHistoryItem.d.ts.map +0 -1
  207. package/dist/components/layouts/ChatHistoryItem.js +0 -7
  208. package/dist/components/layouts/SectionHeader.d.ts +0 -8
  209. package/dist/components/layouts/SectionHeader.d.ts.map +0 -1
  210. package/dist/components/layouts/SectionHeader.js +0 -6
  211. package/dist/components/orbit-site/Block.d.ts +0 -8
  212. package/dist/components/orbit-site/Block.d.ts.map +0 -1
  213. package/dist/components/orbit-site/Block.js +0 -7
  214. package/dist/components/orbit-site/Inset.d.ts +0 -7
  215. package/dist/components/orbit-site/Inset.d.ts.map +0 -1
  216. package/dist/components/orbit-site/Inset.js +0 -6
  217. package/dist/components/orbit-site/Section.d.ts +0 -7
  218. package/dist/components/orbit-site/Section.d.ts.map +0 -1
  219. package/dist/components/orbit-site/Section.js +0 -6
  220. package/dist/components/orbit-site/ThemeSelector.d.ts +0 -3
  221. package/dist/components/orbit-site/ThemeSelector.d.ts.map +0 -1
  222. package/dist/components/orbit-site/ThemeSelector.js +0 -42
  223. package/dist/components/planning/SampleChanges.d.ts +0 -9
  224. package/dist/components/planning/SampleChanges.d.ts.map +0 -1
  225. package/dist/components/planning/SampleChanges.js +0 -117
  226. package/dist/components/tool-invocation-card/index.d.ts +0 -8
  227. package/dist/components/tool-invocation-card/index.d.ts.map +0 -1
  228. package/dist/components/tool-invocation-card/index.js +0 -7
  229. package/dist/lib/schema-fields.d.ts +0 -2
  230. package/dist/lib/schema-fields.d.ts.map +0 -1
  231. package/dist/lib/schema-fields.js +0 -3
  232. package/dist/routes/memories/components/ConflictTimeoutFooter.d.ts +0 -7
  233. package/dist/routes/memories/components/ConflictTimeoutFooter.d.ts.map +0 -1
  234. package/dist/routes/memories/components/ConflictTimeoutFooter.js +0 -6
@@ -1,14 +1,13 @@
1
1
  import type { EntityTypeEntry } from "./ActionPlanDetailView.js";
2
2
  import type { ManualActionEntity } from "./ManualActionCard.js";
3
- import type { ActionPlanExecutionProvenanceResult, ManualAction } from "#ldo-ui";
3
+ import type { ActionPlanExecutionProvenanceResult, ManualAction, ManualActionResolution } from "#ldo-ui";
4
4
  export type ExecutionSectionsProps = {
5
5
  entityTypes: EntityTypeEntry[];
6
6
  provenance: ActionPlanExecutionProvenanceResult | null;
7
7
  manualActions?: ManualAction[];
8
8
  manualActionEntities?: Map<string, ManualActionEntity[]>;
9
9
  activeStartedAtMs?: number | null;
10
- onManualActionResolve?: (subjectIri: string, status: "COMPLETED" | "REJECTED") => void;
11
- onManualActionSkip?: (subjectIri: string) => void;
10
+ onManualActionResolve?: (subjectIri: string, resolution: ManualActionResolution) => void;
12
11
  isResolvingManualAction?: boolean;
13
12
  };
14
13
  export declare function ExecutionSections(props: ExecutionSectionsProps): import("react/jsx-runtime").JSX.Element;
@@ -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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BAAqB,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"}
@@ -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, onManualActionSkip, isResolvingManualAction = false, } = props;
8
+ const { entityTypes, provenance, manualActions = [], manualActionEntities, activeStartedAtMs = null, onManualActionResolve, isResolvingManualAction = false, } = 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, onManualActionSkip: onManualActionSkip, 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, isResolvingManualAction: isResolvingManualAction }, section.key));
30
30
  }) }));
31
31
  }
@@ -1,4 +1,4 @@
1
- import type { ManualAction } from "#ldo-ui";
1
+ import type { ManualAction, ManualActionResolution } from "#ldo-ui";
2
2
  export type ManualActionEntity = {
3
3
  subjectIri: string;
4
4
  label: string;
@@ -14,10 +14,9 @@ type ManualActionCardProps = {
14
14
  entities: ManualActionEntity[];
15
15
  description?: string | null;
16
16
  isResolving: boolean;
17
- onApprove: () => void;
18
- onReject: () => void;
19
- onSkip?: () => void;
17
+ onResolve: (resolution: ManualActionResolution) => void;
20
18
  };
21
19
  export declare function ManualActionCard(props: ManualActionCardProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function resolutionChoices(retryable: boolean, defaultResolution: "COMPLETED" | "RETRY"): ManualActionResolution[];
22
21
  export {};
23
22
  //# sourceMappingURL=ManualActionCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManualActionCard.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ManualActionCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,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,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAiB5D"}
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,13 +1,13 @@
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 } from "lucide-react";
4
+ import { CircleCheck, Hand, MessageSquareWarning, RotateCcw } from "lucide-react";
5
5
  import { cn } from "#lib/utils";
6
6
  export function ManualActionCard(props) {
7
- const { manualAction, entities, description, isResolving, onApprove, onReject } = props;
8
- const title = description ?? buildManualActionTitle(manualAction);
7
+ const { manualAction, entities, description, isResolving, onResolve } = props;
8
+ const title = description ?? manualAction.description ?? buildManualActionTitle(manualAction);
9
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, onApprove: onApprove, onReject: onReject })] }) }));
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 })] }) }));
11
11
  }
12
12
  function CardHeader(props) {
13
13
  const { title } = props;
@@ -39,9 +39,27 @@ function PropertyChangePills(props) {
39
39
  }
40
40
  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
41
  }
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
+ export function resolutionChoices(retryable, defaultResolution) {
45
+ const positive = retryable ? ["COMPLETED", "RETRY"] : ["COMPLETED"];
46
+ const ordered = retryable && defaultResolution === "RETRY" ? [...positive].reverse() : positive;
47
+ return [...ordered, "REJECTED"];
48
+ }
49
+ const choiceLabels = {
50
+ COMPLETED: "Done, I fixed it",
51
+ RETRY: "Retry",
52
+ REJECTED: "Reject",
53
+ };
54
+ const choiceIcons = {
55
+ COMPLETED: _jsx(CircleCheck, { className: "size-4" }),
56
+ RETRY: _jsx(RotateCcw, { className: "size-4" }),
57
+ REJECTED: _jsx(MessageSquareWarning, { className: "size-4" }),
58
+ };
42
59
  function CardFooter(props) {
43
- const { isResolving, onApprove, onReject } = props;
44
- return (_jsx("div", { className: "flex items-center justify-between bg-muted px-3 py-3", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("button", { type: "button", disabled: isResolving, onClick: onApprove, className: 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"), children: [_jsx(CircleCheck, { className: "size-4" }), "Mark as Completed"] }), _jsxs("button", { type: "button", disabled: isResolving, onClick: onReject, className: 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"), children: [_jsx(MessageSquareWarning, { className: "size-4" }), "Mark as Rejected"] })] }) }));
60
+ const { isResolving, retryable, defaultResolution, onResolve } = props;
61
+ 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))) }) }));
45
63
  }
46
64
  function buildManualActionTitle(manualAction) {
47
65
  const subject = manualAction.subjectLabel || manualAction.typeName;
@@ -38,5 +38,5 @@ export function CampaignChannelMix(props) {
38
38
  return (_jsxs("text", { x: viewBox.cx, y: viewBox.cy, textAnchor: "middle", dominantBaseline: "middle", children: [_jsx("tspan", { x: viewBox.cx, y: viewBox.cy, className: "fill-default-foreground typography-extra-large-header ", children: totalCampaigns }), _jsx("tspan", { x: viewBox.cx, y: (viewBox.cy || 0) + 24, className: "fill-muted-foreground typography-tiny", children: "Campaigns" })] }));
39
39
  }
40
40
  return null;
41
- } }) })] }) }), _jsx("div", { className: "space-y-2", children: data.channels.map((channel, index) => (_jsxs("div", { className: "flex items-center justify-between rounded-md border border-muted-border/50 p-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "size-3 rounded-full", style: { backgroundColor: chartData[index]?.fill } }), _jsx("span", { className: "typography-small-medium", children: channel.channel })] }), _jsxs("div", { className: "flex items-center gap-4 typography-tiny text-muted-foreground", children: [_jsxs("span", { children: [channel.campaignCount, " campaign", channel.campaignCount !== 1 ? "s" : ""] }), _jsxs("span", { children: [channel.percentage.toFixed(1), "%"] }), _jsx("span", { className: "font-mono", children: formatMetric(channel.totalSpend, "currency") })] })] }, channel.channel))) }), _jsx(InsightCardFooter, { left: `Total: ${totalCampaigns} campaigns across ${data.channels.length} channels`, right: `${formatMetric(totalSpend, "currency")} spend` })] })] }));
41
+ } }) })] }) }), _jsx("div", { className: "space-y-2", children: data.channels.map((channel, index) => (_jsxs("div", { className: "flex items-center justify-between rounded-md border border-muted-border/50 p-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "size-3 rounded-full", style: { backgroundColor: chartData[index]?.fill } }), _jsx("span", { className: "typography-small-medium", children: channel.channel })] }), _jsxs("div", { className: "flex items-center gap-4 typography-tiny text-muted-foreground", children: [_jsxs("span", { children: [channel.campaignCount, " campaign", channel.campaignCount !== 1 ? "s" : ""] }), _jsxs("span", { children: [channel.percentage.toFixed(1), "%"] }), _jsx("span", { className: "font-mono", children: formatMetric(channel.totalSpend, "currency", channel.currency) })] })] }, channel.channel))) }), _jsx(InsightCardFooter, { left: `Total: ${totalCampaigns} campaigns across ${data.channels.length} channels`, right: `${formatMetric(totalSpend, "currency", data.currency)} spend` })] })] }));
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CampaignGrid.d.ts","sourceRoot":"","sources":["../../../src/components/rdf-insights/CampaignGrid.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAoHvD,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAyBpD"}
1
+ {"version":3,"file":"CampaignGrid.d.ts","sourceRoot":"","sources":["../../../src/components/rdf-insights/CampaignGrid.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAwHvD,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAyBpD"}
@@ -44,12 +44,12 @@ function Campaign(props) {
44
44
  index,
45
45
  value,
46
46
  }));
47
- return (_jsxs("div", { className: "rounded-lg border border-muted-border/50 p-4 space-y-3 hover:border-muted-border transition-colors", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "typography-small-semibold line-clamp-1", children: campaign.name || "Unnamed Campaign" }), _jsxs("div", { className: "flex items-center gap-2 typography-tiny", children: [_jsxs(Badge, { variant: "secondary", className: "gap-1", children: [_jsx(Circle, { className: cn("size-2", getStatusColor(campaign.status)) }), _jsx("span", { children: campaign.status || "Active" })] }), campaign.channel && _jsx("span", { className: "text-muted-foreground", children: campaign.channel })] })] }), _jsx("div", { className: "h-12 -mx-2", children: _jsx(ChartContainer, { config: sparklineConfig, className: "h-full w-full", children: _jsx(LineChart, { data: sparklineData, children: _jsx(Line, { type: "monotone", dataKey: "value", stroke: "var(--color-value)", strokeWidth: 2, dot: false, isAnimationActive: false }) }) }) }), _jsxs("div", { className: "space-y-2 pt-2 border-t border-muted-border/50", children: [_jsxs("div", { className: "flex items-center justify-between typography-tiny", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx(DollarSign, { className: "size-3" }), "Spend"] }), _jsx("span", { className: "font-mono typography-small-semibold", children: formatMetric(campaign.spend, "currency") })] }), _jsxs("div", { className: "flex items-center justify-between typography-tiny", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx(TrendingUp, { className: "size-3" }), "Revenue"] }), _jsx("span", { className: "font-mono typography-small-semibold", children: formatMetric(campaign.revenue, "currency") })] }), _jsxs("div", { className: "flex items-center justify-between typography-tiny", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Target, { className: "size-3" }), "ROAS"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: cn("font-mono typography-small-semibold", roasTier.color), children: [campaign.roas.toFixed(2), "x"] }), _jsx(Badge, { variant: "secondary", className: cn("typography-tiny", roasTier.color), children: roasTier.label })] })] })] })] }, campaign.uri));
47
+ return (_jsxs("div", { className: "rounded-lg border border-muted-border/50 p-4 space-y-3 hover:border-muted-border transition-colors", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "typography-small-semibold line-clamp-1", children: campaign.name || "Unnamed Campaign" }), _jsxs("div", { className: "flex items-center gap-2 typography-tiny", children: [_jsxs(Badge, { variant: "secondary", className: "gap-1", children: [_jsx(Circle, { className: cn("size-2", getStatusColor(campaign.status)) }), _jsx("span", { children: campaign.status || "Active" })] }), campaign.channel && _jsx("span", { className: "text-muted-foreground", children: campaign.channel })] })] }), _jsx("div", { className: "h-12 -mx-2", children: _jsx(ChartContainer, { config: sparklineConfig, className: "h-full w-full", children: _jsx(LineChart, { data: sparklineData, children: _jsx(Line, { type: "monotone", dataKey: "value", stroke: "var(--color-value)", strokeWidth: 2, dot: false, isAnimationActive: false }) }) }) }), _jsxs("div", { className: "space-y-2 pt-2 border-t border-muted-border/50", children: [_jsxs("div", { className: "flex items-center justify-between typography-tiny", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx(DollarSign, { className: "size-3" }), "Spend"] }), _jsx("span", { className: "font-mono typography-small-semibold", children: formatMetric(campaign.spend, "currency", campaign.currency) })] }), _jsxs("div", { className: "flex items-center justify-between typography-tiny", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx(TrendingUp, { className: "size-3" }), "Revenue"] }), _jsx("span", { className: "font-mono typography-small-semibold", children: formatMetric(campaign.revenue, "currency", campaign.currency) })] }), _jsxs("div", { className: "flex items-center justify-between typography-tiny", children: [_jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Target, { className: "size-3" }), "ROAS"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: cn("font-mono typography-small-semibold", roasTier.color), children: [campaign.roas.toFixed(2), "x"] }), _jsx(Badge, { variant: "secondary", className: cn("typography-tiny", roasTier.color), children: roasTier.label })] })] })] })] }, campaign.uri));
48
48
  }
49
49
  export function CampaignGrid(props) {
50
50
  const { data } = props;
51
51
  if (!isPresent(data.campaigns))
52
52
  return null;
53
53
  const totalSpend = data.campaigns.reduce((sum, c) => sum + c.spend, 0);
54
- return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: LayoutGrid, title: `Campaigns (${data.campaigns.length})` }), _jsxs(CardContent, { className: "pt-4", children: [_jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: data.campaigns.map((campaign) => (_jsx(Campaign, { campaign: campaign }, campaign.uri))) }), _jsx(InsightCardFooter, { left: `Showing ${data.campaigns.length} campaigns`, right: `Total Spend: ${formatMetric(totalSpend, "currency")}` })] })] }));
54
+ return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: LayoutGrid, title: `Campaigns (${data.campaigns.length})` }), _jsxs(CardContent, { className: "pt-4", children: [_jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: data.campaigns.map((campaign) => (_jsx(Campaign, { campaign: campaign }, campaign.uri))) }), _jsx(InsightCardFooter, { left: `Showing ${data.campaigns.length} campaigns`, right: `Total Spend: ${formatMetric(totalSpend, "currency", data.currency)}` })] })] }));
55
55
  }
@@ -6,7 +6,7 @@ import { InsightCardHeader } from "./InsightCardHeader.js";
6
6
  import { MetricDisplay } from "./MetricDisplay.js";
7
7
  import { Card, CardContent } from "#components/card/index";
8
8
  import { ChartContainer, ChartTooltip, ChartTooltipContent } from "#components/chart/index";
9
- import { formatMetric } from "#lib/rdf/insights";
9
+ import { formatCompactMoney, formatMetric } from "#lib/rdf/insights";
10
10
  export function DailyPerformance(props) {
11
11
  const { data } = props;
12
12
  if (!isPresent(data.days))
@@ -46,5 +46,5 @@ export function DailyPerformance(props) {
46
46
  return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
47
47
  }
48
48
  const dateRange = startDate && endDate ? `${formatDate(startDate)} - ${formatDate(endDate)}` : "";
49
- return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Calendar, title: "Daily Performance", dateRange: dateRange }), _jsxs(CardContent, { className: "pt-4 space-y-4", children: [_jsx(ChartContainer, { config: chartConfig, className: "h-[300px]", children: _jsxs(LineChart, { data: chartData, margin: { left: 0, right: 0 }, children: [_jsx(CartesianGrid, { vertical: false }), _jsx(XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => value }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => `$${(value / 1000).toFixed(0)}k` }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, {}) }), _jsx(Legend, {}), _jsx(Line, { dataKey: "revenue", type: "monotone", stroke: "var(--color-revenue)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "spend", type: "monotone", stroke: "var(--color-spend)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "orders", type: "monotone", stroke: "var(--color-orders)", strokeWidth: 2, strokeDasharray: "5 5", dot: false })] }) }), _jsxs("div", { className: "grid grid-cols-3 gap-4 pt-4", children: [_jsx(MetricDisplay, { icon: DollarSign, label: "Revenue", value: formatMetric(totalRevenue, "currency"), subtitle: `$${avgDailyRevenue.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: DollarSign, label: "Spend", value: formatMetric(totalSpend, "currency"), subtitle: `$${avgDailySpend.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: ShoppingCart, label: "Orders", value: totalOrders.toString(), subtitle: `${avgDailyOrders.toFixed(1)}/day avg` })] }), _jsxs("div", { className: "pt-2 border-t border-muted-border/50 flex items-center justify-between", children: [_jsx("span", { className: "typography-tiny text-muted-foreground", children: "Overall ROAS" }), _jsxs("span", { className: "typography-small-semibold font-mono", children: [overallRoas.toFixed(2), "x"] })] })] })] }));
49
+ return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Calendar, title: "Daily Performance", dateRange: dateRange }), _jsxs(CardContent, { className: "pt-4 space-y-4", children: [_jsx(ChartContainer, { config: chartConfig, className: "h-[300px]", children: _jsxs(LineChart, { data: chartData, margin: { left: 0, right: 0 }, children: [_jsx(CartesianGrid, { vertical: false }), _jsx(XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => value }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => formatCompactMoney(value, data.currency) }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, {}) }), _jsx(Legend, {}), _jsx(Line, { dataKey: "revenue", type: "monotone", stroke: "var(--color-revenue)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "spend", type: "monotone", stroke: "var(--color-spend)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "orders", type: "monotone", stroke: "var(--color-orders)", strokeWidth: 2, strokeDasharray: "5 5", dot: false })] }) }), _jsxs("div", { className: "grid grid-cols-3 gap-4 pt-4", children: [_jsx(MetricDisplay, { icon: DollarSign, label: "Revenue", value: formatMetric(totalRevenue, "currency", data.currency), subtitle: `$${avgDailyRevenue.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: DollarSign, label: "Spend", value: formatMetric(totalSpend, "currency", data.currency), subtitle: `$${avgDailySpend.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: ShoppingCart, label: "Orders", value: totalOrders.toString(), subtitle: `${avgDailyOrders.toFixed(1)}/day avg` })] }), _jsxs("div", { className: "pt-2 border-t border-muted-border/50 flex items-center justify-between", children: [_jsx("span", { className: "typography-tiny text-muted-foreground", children: "Overall ROAS" }), _jsxs("span", { className: "typography-small-semibold font-mono", children: [overallRoas.toFixed(2), "x"] })] })] })] }));
50
50
  }
@@ -1,6 +1,6 @@
1
- import type { CompanyKpis } from "#lib/rdf/types";
1
+ import type { KpiSnapshot } from "#lib/rdf/types";
2
2
  type KpiDashboardProps = {
3
- kpis: CompanyKpis;
3
+ kpis: KpiSnapshot[];
4
4
  };
5
5
  export declare function KpiDashboard(props: KpiDashboardProps): import("react/jsx-runtime").JSX.Element | null;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"KpiDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/rdf-insights/KpiDashboard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAoDF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDA0CpD"}
1
+ {"version":3,"file":"KpiDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/rdf-insights/KpiDashboard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAC;AAE7D,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB,CAAC;AA4DF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAqBpD"}
@@ -3,61 +3,41 @@ import { isPresent } from "@manta-eu/lib/present";
3
3
  import { Building2 } from "lucide-react";
4
4
  import { InsightCardHeader } from "./InsightCardHeader.js";
5
5
  import { Card, CardContent } from "#components/card/index";
6
- import { formatMetric } from "#lib/rdf/insights";
7
- const kpiMetadata = {
8
- mer30d: {
9
- label: "MER (30d)",
10
- format: "multiplier",
11
- description: "Marketing Efficiency Ratio - revenue generated per dollar spent",
12
- },
13
- blendedRoas30d: {
14
- label: "ROAS (30d)",
15
- format: "multiplier",
16
- description: "Return on Ad Spend - 30-day blended ROAS",
17
- },
18
- blendedCac30dUsd: {
19
- label: "CAC (30d)",
20
- format: "currency",
21
- description: "Customer Acquisition Cost - cost to acquire one customer",
22
- },
23
- last30dSpendUsd: {
24
- label: "Spend (30d)",
25
- format: "currency",
26
- description: "Total advertising spend in the last 30 days",
27
- },
28
- last30dRevenueUsd: {
29
- label: "Revenue (30d)",
30
- format: "currency",
31
- description: "Total revenue generated in the last 30 days",
32
- },
33
- avgAov30d: {
34
- label: "AOV (30d)",
35
- format: "currency",
36
- description: "Average Order Value - average revenue per order",
37
- },
38
- grossMargin30d: {
39
- label: "Gross Margin (30d)",
40
- format: "percentage",
41
- description: "Gross profit margin percentage",
42
- },
43
- };
6
+ import { formatMetric, percentChange } from "#lib/rdf/insights";
7
+ const kpiMetadata = [
8
+ { key: "spend", label: "Spend", format: "currency" },
9
+ { key: "revenue", label: "Revenue", format: "currency" },
10
+ { key: "roas", label: "ROAS", format: "multiplier" },
11
+ { key: "purchases", label: "Purchases", format: "count" },
12
+ { key: "cpa", label: "CPA", format: "currency" },
13
+ { key: "aov", label: "AOV", format: "currency" },
14
+ ];
15
+ function formatValue(value, format, currency) {
16
+ if (format === "count")
17
+ return Math.round(value).toLocaleString("en-US");
18
+ return format === "currency" ? formatMetric(value, format, currency) : formatMetric(value, format);
19
+ }
20
+ function formatChange(change) {
21
+ return `${change > 0 ? "+" : ""}${change.toFixed(1)}%`;
22
+ }
23
+ function SnapshotGrid(props) {
24
+ const { snapshot, showCurrency } = props;
25
+ const metrics = kpiMetadata.flatMap((metadata) => {
26
+ const value = snapshot.current[metadata.key];
27
+ if (value === null)
28
+ return [];
29
+ return [{ ...metadata, value, change: percentChange(value, snapshot.previous?.[metadata.key]) }];
30
+ });
31
+ if (!isPresent(metrics))
32
+ return null;
33
+ return (_jsxs("div", { className: "space-y-2", children: [showCurrency && (_jsx("div", { className: "typography-tiny-medium tracking-wide text-muted-foreground uppercase", children: snapshot.currency })), _jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3", children: metrics.map((metric) => (_jsxs("div", { className: "space-y-0.5", children: [_jsx("div", { className: "typography-tiny-medium tracking-wide text-muted-foreground/70 uppercase", children: metric.label }), _jsx("div", { className: "typography-large-body-semibold font-mono leading-tight", children: formatValue(metric.value, metric.format, snapshot.currency) }), metric.change !== null && (_jsxs("div", { className: "typography-tiny text-muted-foreground", children: [formatChange(metric.change), " vs prev 30d"] }))] }, metric.key))) })] }));
34
+ }
44
35
  export function KpiDashboard(props) {
45
36
  const { kpis } = props;
46
- const metrics = [];
47
- Object.entries(kpis).forEach(([key, value]) => {
48
- if (value !== null) {
49
- const metadata = kpiMetadata[key];
50
- if (metadata) {
51
- metrics.push({
52
- label: metadata.label,
53
- value,
54
- format: metadata.format,
55
- });
56
- }
57
- }
58
- });
59
- if (!isPresent(metrics)) {
37
+ if (!isPresent(kpis)) {
60
38
  return null;
61
39
  }
62
- return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Building2, title: "Your Performance (30 days)" }), _jsx(CardContent, { className: "pt-4", children: _jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3", children: metrics.map((metric) => (_jsxs("div", { className: "space-y-0.5", children: [_jsx("div", { className: "typography-tiny-medium tracking-wide text-muted-foreground/70 uppercase", children: metric.label }), _jsx("div", { className: "typography-large-body-semibold font-mono leading-tight", children: formatMetric(metric.value, metric.format) })] }, metric.label))) }) })] }));
40
+ const [first] = kpis;
41
+ const dateRange = first?.startDate && first.endDate ? `${first.startDate} – ${first.endDate}` : undefined;
42
+ return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Building2, title: "Your Performance (30 days)", dateRange: dateRange }), _jsx(CardContent, { className: "pt-4 space-y-4", children: kpis.map((snapshot) => (_jsx(SnapshotGrid, { snapshot: snapshot, showCurrency: kpis.length > 1 }, snapshot.currency))) })] }));
63
43
  }
@@ -6,7 +6,7 @@ import { InsightCardHeader } from "./InsightCardHeader.js";
6
6
  import { MetricDisplay } from "./MetricDisplay.js";
7
7
  import { Card, CardContent, CardFooter } from "#components/card/index";
8
8
  import { ChartContainer, ChartTooltip, ChartTooltipContent } from "#components/chart/index";
9
- import { formatMetric } from "#lib/rdf/insights";
9
+ import { formatCompactMoney, formatMetric } from "#lib/rdf/insights";
10
10
  export function MetaDailyInsights(props) {
11
11
  const { data } = props;
12
12
  if (!isPresent(data.days))
@@ -45,5 +45,5 @@ export function MetaDailyInsights(props) {
45
45
  return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
46
46
  }
47
47
  const dateRange = startDate && endDate ? `${formatDate(startDate)} - ${formatDate(endDate)}` : "";
48
- return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Calendar, title: "Meta Campaign Daily Insights", subtitle: data.campaignName, dateRange: dateRange }), _jsxs(CardContent, { className: "pt-4 space-y-4", children: [_jsx("div", { className: "bg-muted/10 rounded-radius p-4", children: _jsx(ChartContainer, { config: chartConfig, className: "h-[300px]", children: _jsxs(LineChart, { data: chartData, margin: { left: 0, right: 0 }, children: [_jsx(CartesianGrid, { vertical: false, strokeOpacity: 0.3 }), _jsx(XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => value }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => `$${(value / 1000).toFixed(0)}k` }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, {}) }), _jsx(Legend, {}), _jsx(Line, { dataKey: "revenue", type: "monotone", stroke: "var(--color-revenue)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "spend", type: "monotone", stroke: "var(--color-spend)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "roas", type: "monotone", stroke: "var(--color-roas)", strokeWidth: 2, strokeDasharray: "5 5", dot: false })] }) }) }), _jsxs("div", { className: "grid grid-cols-3 gap-4 pt-4", children: [_jsx(MetricDisplay, { icon: DollarSign, label: "Spend", value: formatMetric(totalSpend, "currency"), subtitle: `$${avgDailySpend.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: TrendingUp, label: "Revenue", value: formatMetric(totalRevenue, "currency"), subtitle: `$${avgDailyRevenue.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: ShoppingCart, label: "Purchases", value: totalPurchases.toString(), subtitle: `${(totalPurchases / data.days.length).toFixed(1)}/day avg` })] })] }), _jsx(CardFooter, { className: "pt-0 border-t border-muted-border pt-4", children: _jsxs("div", { className: "flex items-center justify-between w-full typography-tiny", children: [_jsx("span", { className: "text-muted-foreground", children: "Overall ROAS" }), _jsxs("span", { className: "font-mono typography-small-semibold", children: [overallRoas.toFixed(2), "x"] })] }) })] }));
48
+ return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Calendar, title: "Meta Campaign Daily Insights", subtitle: data.campaignName, dateRange: dateRange }), _jsxs(CardContent, { className: "pt-4 space-y-4", children: [_jsx("div", { className: "bg-muted/10 rounded-radius p-4", children: _jsx(ChartContainer, { config: chartConfig, className: "h-[300px]", children: _jsxs(LineChart, { data: chartData, margin: { left: 0, right: 0 }, children: [_jsx(CartesianGrid, { vertical: false, strokeOpacity: 0.3 }), _jsx(XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => value }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => formatCompactMoney(value, data.currency) }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, {}) }), _jsx(Legend, {}), _jsx(Line, { dataKey: "revenue", type: "monotone", stroke: "var(--color-revenue)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "spend", type: "monotone", stroke: "var(--color-spend)", strokeWidth: 2, dot: false }), _jsx(Line, { dataKey: "roas", type: "monotone", stroke: "var(--color-roas)", strokeWidth: 2, strokeDasharray: "5 5", dot: false })] }) }) }), _jsxs("div", { className: "grid grid-cols-3 gap-4 pt-4", children: [_jsx(MetricDisplay, { icon: DollarSign, label: "Spend", value: formatMetric(totalSpend, "currency", data.currency), subtitle: `$${avgDailySpend.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: TrendingUp, label: "Revenue", value: formatMetric(totalRevenue, "currency", data.currency), subtitle: `$${avgDailyRevenue.toFixed(0)}/day avg` }), _jsx(MetricDisplay, { icon: ShoppingCart, label: "Purchases", value: totalPurchases.toString(), subtitle: `${(totalPurchases / data.days.length).toFixed(1)}/day avg` })] })] }), _jsx(CardFooter, { className: "pt-0 border-t border-muted-border pt-4", children: _jsxs("div", { className: "flex items-center justify-between w-full typography-tiny", children: [_jsx("span", { className: "text-muted-foreground", children: "Overall ROAS" }), _jsxs("span", { className: "font-mono typography-small-semibold", children: [overallRoas.toFixed(2), "x"] })] }) })] }));
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../src/components/rdf-insights/ProductCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG9D,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA8ElD"}
1
+ {"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../src/components/rdf-insights/ProductCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG9D,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAgFlD"}
@@ -15,5 +15,5 @@ export function ProductCard(props) {
15
15
  "out-of-stock": { color: "bg-error-foreground", text: "Out of Stock" },
16
16
  };
17
17
  const status = statusConfig[availabilityStatus];
18
- return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(ShoppingBag, { className: "size-5 text-muted-foreground mt-0.5" }), _jsxs("div", { className: "flex-1", children: [_jsx(CardTitle, { className: "typography-body", children: product.name }), product.vendor && (_jsxs("div", { className: "flex items-center gap-1 mt-1 typography-small text-muted-foreground", children: [_jsx(User, { className: "size-3.5" }), _jsx("span", { children: product.vendor })] }))] })] }) }), _jsxs(CardContent, { className: "space-y-3", children: [variant?.price !== null && variant?.price !== undefined && (_jsx("div", { className: "typography-large-body-semibold font-mono", children: formatMetric(variant.price, "currency") })), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: `size-2 rounded-full ${status.color}` }), _jsx("span", { className: "typography-small text-muted-foreground", children: status.text }), product.quantity != null && product.quantity < 0 && (_jsx("span", { className: "typography-tiny text-muted-foreground", children: "(Negative inventory tracked)" }))] }), isPresent(product.tags) && (_jsx("div", { className: "flex flex-wrap gap-1", children: product.tags.map((tag) => (_jsx(Badge, { variant: "secondary", className: "typography-tiny", children: tag }, tag))) })), variant?.cost === 0 && (_jsxs("div", { className: cn("flex items-start gap-2 p-3 rounded-md", "bg-warning", "border border-muted-border"), children: [_jsx(AlertCircle, { className: "size-4 text-warning-foreground mt-0.5" }), _jsxs("div", { className: "flex-1 typography-small", children: [_jsx("p", { className: "typography-small-medium text-warning-foreground", children: "Missing cost data" }), _jsx("p", { className: "text-warning-foreground/80 typography-tiny mt-0.5", children: "Add cost to track profit margins" })] })] })), product.url && (_jsxs("a", { href: product.url, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 typography-small text-primary hover:underline", children: ["View in Shopify", _jsx(ExternalLink, { className: "size-3.5" })] }))] })] }));
18
+ return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(ShoppingBag, { className: "size-5 text-muted-foreground mt-0.5" }), _jsxs("div", { className: "flex-1", children: [_jsx(CardTitle, { className: "typography-body", children: product.name }), product.vendor && (_jsxs("div", { className: "flex items-center gap-1 mt-1 typography-small text-muted-foreground", children: [_jsx(User, { className: "size-3.5" }), _jsx("span", { children: product.vendor })] }))] })] }) }), _jsxs(CardContent, { className: "space-y-3", children: [variant?.price !== null && variant?.price !== undefined && (_jsx("div", { className: "typography-large-body-semibold font-mono", children: formatMetric(variant.price, "currency", variant.currency) })), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: `size-2 rounded-full ${status.color}` }), _jsx("span", { className: "typography-small text-muted-foreground", children: status.text }), product.quantity != null && product.quantity < 0 && (_jsx("span", { className: "typography-tiny text-muted-foreground", children: "(Negative inventory tracked)" }))] }), isPresent(product.tags) && (_jsx("div", { className: "flex flex-wrap gap-1", children: product.tags.map((tag) => (_jsx(Badge, { variant: "secondary", className: "typography-tiny", children: tag }, tag))) })), variant?.cost === 0 && (_jsxs("div", { className: cn("flex items-start gap-2 p-3 rounded-md", "bg-warning", "border border-muted-border"), children: [_jsx(AlertCircle, { className: "size-4 text-warning-foreground mt-0.5" }), _jsxs("div", { className: "flex-1 typography-small", children: [_jsx("p", { className: "typography-small-medium text-warning-foreground", children: "Missing cost data" }), _jsx("p", { className: "text-warning-foreground/80 typography-tiny mt-0.5", children: "Add cost to track profit margins" })] })] })), product.url && (_jsxs("a", { href: product.url, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 typography-small text-primary hover:underline", children: ["View in Shopify", _jsx(ExternalLink, { className: "size-3.5" })] }))] })] }));
19
19
  }
@@ -53,5 +53,5 @@ export function ProductVariantsTable(props) {
53
53
  return null;
54
54
  const totalInventory = data.variants.reduce((sum, v) => sum + (v.inventory || 0), 0);
55
55
  const avgMargin = data.variants.reduce((sum, v) => sum + (v.marginPct || 0), 0) / data.variants.length;
56
- return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Package, title: `Product Variants (${data.variants.length})` }), _jsxs(CardContent, { className: "pt-4", children: [_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-[200px]", children: "Variant Name" }), _jsx(TableHead, { children: "SKU" }), _jsx(TableHead, { children: "Price" }), _jsx(TableHead, { children: "Cost" }), _jsx(TableHead, { className: "w-[200px]", children: "Margin %" }), _jsx(TableHead, { children: "Inventory" })] }) }), _jsx(TableBody, { children: data.variants.map((variant) => (_jsxs(TableRow, { children: [_jsxs(TableCell, { children: [_jsx("div", { className: "typography-small-medium", children: variant.variantName || "Default" }), variant.productName && (_jsx("div", { className: "typography-tiny text-muted-foreground", children: variant.productName }))] }), _jsx(TableCell, { className: "font-mono typography-tiny text-muted-foreground", children: variant.sku || "—" }), _jsx(TableCell, { className: "font-mono", children: isNotNil(variant.price) ? (_jsxs(_Fragment, { children: [variant.compareAtPrice && variant.compareAtPrice > variant.price && (_jsx("div", { className: "typography-tiny text-muted-foreground line-through", children: formatMetric(variant.compareAtPrice, "currency") })), _jsx("div", { children: formatMetric(variant.price, "currency") })] })) : ("—") }), _jsx(TableCell, { className: "font-mono", children: isNotNil(variant.cost) ? formatMetric(variant.cost, "currency") : "—" }), _jsx(TableCell, { children: isNotNil(variant.marginPct) ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Circle, { className: cn("size-2", getMarginIconColor(variant.marginPct)) }), _jsxs("span", { className: cn("font-mono typography-small-semibold", getMarginColor(variant.marginPct)), children: [variant.marginPct.toFixed(0), "%"] }), _jsx("div", { className: "flex-1 h-2 bg-muted rounded-full overflow-hidden", children: _jsx("div", { className: cn("h-full transition-all", getMarginBgColor(variant.marginPct)), style: { width: `${Math.min(variant.marginPct, 100)}%` } }) })] })) : ("—") }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Circle, { className: cn("size-2", getStockIconColor(variant.inventory)) }), _jsxs("div", { children: [_jsx("div", { className: "font-mono typography-small-semibold", children: variant.inventory !== null ? variant.inventory : "—" }), variant.inventory !== null && (_jsx("div", { className: "typography-tiny text-muted-foreground", children: getStockText(variant.inventory) }))] })] }) })] }, variant.uri))) })] }), _jsx(InsightCardFooter, { left: `${data.variants.length} variants · Avg margin: ${avgMargin.toFixed(1)}%`, right: `Total inventory: ${totalInventory} units` })] })] }));
56
+ return (_jsxs(Card, { className: "shadow-none gap-4 py-4", children: [_jsx(InsightCardHeader, { icon: Package, title: `Product Variants (${data.variants.length})` }), _jsxs(CardContent, { className: "pt-4", children: [_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-[200px]", children: "Variant Name" }), _jsx(TableHead, { children: "SKU" }), _jsx(TableHead, { children: "Price" }), _jsx(TableHead, { children: "Cost" }), _jsx(TableHead, { className: "w-[200px]", children: "Margin %" }), _jsx(TableHead, { children: "Inventory" })] }) }), _jsx(TableBody, { children: data.variants.map((variant) => (_jsxs(TableRow, { children: [_jsxs(TableCell, { children: [_jsx("div", { className: "typography-small-medium", children: variant.variantName || "Default" }), variant.productName && (_jsx("div", { className: "typography-tiny text-muted-foreground", children: variant.productName }))] }), _jsx(TableCell, { className: "font-mono typography-tiny text-muted-foreground", children: variant.sku || "—" }), _jsx(TableCell, { className: "font-mono", children: isNotNil(variant.price) ? (_jsxs(_Fragment, { children: [variant.compareAtPrice && variant.compareAtPrice > variant.price && (_jsx("div", { className: "typography-tiny text-muted-foreground line-through", children: formatMetric(variant.compareAtPrice, "currency", variant.currency) })), _jsx("div", { children: formatMetric(variant.price, "currency", variant.currency) })] })) : ("—") }), _jsx(TableCell, { className: "font-mono", children: isNotNil(variant.cost) ? formatMetric(variant.cost, "currency", variant.currency) : "—" }), _jsx(TableCell, { children: isNotNil(variant.marginPct) ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Circle, { className: cn("size-2", getMarginIconColor(variant.marginPct)) }), _jsxs("span", { className: cn("font-mono typography-small-semibold", getMarginColor(variant.marginPct)), children: [variant.marginPct.toFixed(0), "%"] }), _jsx("div", { className: "flex-1 h-2 bg-muted rounded-full overflow-hidden", children: _jsx("div", { className: cn("h-full transition-all", getMarginBgColor(variant.marginPct)), style: { width: `${Math.min(variant.marginPct, 100)}%` } }) })] })) : ("—") }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Circle, { className: cn("size-2", getStockIconColor(variant.inventory)) }), _jsxs("div", { children: [_jsx("div", { className: "font-mono typography-small-semibold", children: variant.inventory !== null ? variant.inventory : "—" }), variant.inventory !== null && (_jsx("div", { className: "typography-tiny text-muted-foreground", children: getStockText(variant.inventory) }))] })] }) })] }, variant.uri))) })] }), _jsx(InsightCardFooter, { left: `${data.variants.length} variants · Avg margin: ${avgMargin.toFixed(1)}%`, right: `Total inventory: ${totalInventory} units` })] })] }));
57
57
  }
@@ -10,7 +10,7 @@ export declare function useExtractedInsights(jsonLd: JsonLdGraphDocument): {
10
10
  productVariants: import("../../lib/rdf/types.js").ProductVariantsData | null;
11
11
  campaignGrid: import("../../lib/rdf/types.js").CampaignGridData | null;
12
12
  product: import("../../lib/rdf/types.js").Product | null;
13
- kpis: import("../../lib/rdf/types.js").CompanyKpis | null;
13
+ kpis: import("../../lib/rdf/types.js").KpiSnapshot[] | null;
14
14
  entityRelationTree: import("./EntityRelationTreeInsight.js").EntityRelationTreeRoot[];
15
15
  hasExtractableInsights: boolean;
16
16
  };
@@ -4,7 +4,7 @@ import { m, meta } from "@manta-eu/rdf-lib/namespaces";
4
4
  import { flatten, uniq } from "ramda";
5
5
  import { useMemo } from "react";
6
6
  import { extractEntityRelationTreeRoots } from "./extractEntityRelationTreeRoots.js";
7
- import { extractCampaignChannelMix, extractCampaignGrid, extractCampaignPerformanceSummary, extractCompanyKpis, extractDailyPerformance, extractMetaDailyInsights, extractProduct, extractProductProfitability, extractProductSalesRanking, extractProductVariants, extractRoasBenchmark, } from "#lib/rdf/index";
7
+ import { extractCampaignChannelMix, extractCampaignGrid, extractCampaignPerformanceSummary, extractDailyPerformance, extractKpiSnapshots, extractMetaDailyInsights, extractProduct, extractProductProfitability, extractProductSalesRanking, extractProductVariants, extractRoasBenchmark, } from "#lib/rdf/index";
8
8
  const typeToExtractors = {
9
9
  [m.ProductProfitability]: ["productProfitability"],
10
10
  [m.ProductSalesRanking]: ["productSalesRanking"],
@@ -15,7 +15,7 @@ const typeToExtractors = {
15
15
  [meta.Campaign]: ["campaignChannelMix", "campaignGrid"],
16
16
  [m.ProductVariant]: ["productVariants"],
17
17
  [m.Product]: ["product"],
18
- [m.CompanyKPISnapshot]: ["kpis"],
18
+ [m.KPISnapshot]: ["kpis"],
19
19
  };
20
20
  function collectTypes(jsonLd) {
21
21
  return new Set(flatten(jsonLd["@graph"].map((node) => getNodeTypes(node).map(expandPrefix))));
@@ -45,7 +45,7 @@ export function useExtractedInsights(jsonLd) {
45
45
  const productVariants = requiredExtractors.has("productVariants") ? extractProductVariants(jsonLd) : null;
46
46
  const campaignGrid = requiredExtractors.has("campaignGrid") ? extractCampaignGrid(jsonLd) : null;
47
47
  const product = requiredExtractors.has("product") ? extractProduct(jsonLd) : null;
48
- const kpis = requiredExtractors.has("kpis") ? extractCompanyKpis(jsonLd) : null;
48
+ const kpis = requiredExtractors.has("kpis") ? extractKpiSnapshots(jsonLd) : null;
49
49
  // Candidates only — EntityRelationTreeInsight filters against live connected-account IRIs.
50
50
  const entityRelationTree = extractEntityRelationTreeRoots(jsonLd);
51
51
  const hasExtractableInsights = productProfitability ||
@@ -21,6 +21,8 @@ export type NavItemBase = {
21
21
  disabled?: boolean;
22
22
  isActive?: boolean;
23
23
  shortcut?: ReactNode;
24
+ badge?: ReactNode;
25
+ badgeLabel?: string;
24
26
  tooltip?: string;
25
27
  };
26
28
  export type NavLeafItem = NavItemBase & {
@@ -1 +1 @@
1
- {"version":3,"file":"nav-menu.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/nav-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAuBf,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAEnE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAA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AAc,GAAG,WAAW,GAAG;IACzC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,UAAU,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAWF,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,2CAczC"}
@@ -26,6 +26,11 @@ function NavMenuEntry(props) {
26
26
  function hasSubItems(item) {
27
27
  return Array.isArray(item.items) && item.items.length > 0;
28
28
  }
29
+ function navItemLabel(item) {
30
+ if (item.disabled || !item.badge || !item.badgeLabel)
31
+ return item.title;
32
+ return `${item.title}, ${item.badgeLabel}`;
33
+ }
29
34
  function NavSubmenuMenuItem(props) {
30
35
  const { item, linkComponent, submenuVariant } = props;
31
36
  const { isMobile, state } = useSidebar();
@@ -42,12 +47,12 @@ function NavSubmenuMenuItem(props) {
42
47
  }
43
48
  }, [hasActiveSubItem]);
44
49
  if (item.disabled) {
45
- return (_jsx(SidebarMenuItem, { children: _jsx(NavMenuDisabledTooltip, { content: tooltipContent, children: _jsx(SidebarMenuButton, { type: "button", disabled: true, isActive: isActive, "aria-label": item.title, className: disabledTopLevelClassName, "data-nav-id": item.id, children: _jsx(NavMenuItemContent, { item: item }) }) }) }));
50
+ return (_jsx(SidebarMenuItem, { children: _jsx(NavMenuDisabledTooltip, { content: tooltipContent, children: _jsx(SidebarMenuButton, { type: "button", disabled: true, isActive: isActive, "aria-label": navItemLabel(item), className: disabledTopLevelClassName, "data-nav-id": item.id, children: _jsx(NavMenuItemContent, { item: item }) }) }) }));
46
51
  }
47
52
  if (resolvedSubmenuVariant === "dropdown") {
48
- return (_jsx(SidebarMenuItem, { children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { type: "button", isActive: isActive, tooltip: tooltipContent, "aria-label": item.title, className: "group data-[state=open]:bg-muted data-[state=open]:text-default-foreground", "data-nav-id": item.id, children: [_jsx(NavMenuItemContent, { item: item }), _jsx(ChevronDown, { className: "ml-auto size-4 shrink-0 transition-transform duration-150 ease-out group-data-[collapsible=icon]:hidden group-data-[state=open]:rotate-180" })] }) }), _jsx(DropdownContent, { className: "w-40 min-w-40 p-0 shadow-md", side: isMobile ? "bottom" : "right", align: "start", sideOffset: 8, children: _jsx(DropdownGroup, { label: item.title, className: "p-2", children: item.items.map((subItem) => (_jsx(NavDropdownSubItem, { item: subItem, linkComponent: linkComponent }, subItem.title))) }) })] }) }));
53
+ return (_jsx(SidebarMenuItem, { children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { type: "button", isActive: isActive, tooltip: tooltipContent, "aria-label": navItemLabel(item), className: "group data-[state=open]:bg-muted data-[state=open]:text-default-foreground", "data-nav-id": item.id, children: [_jsx(NavMenuItemContent, { item: item }), _jsx(ChevronDown, { className: "ml-auto size-4 shrink-0 transition-transform duration-150 ease-out group-data-[collapsible=icon]:hidden group-data-[state=open]:rotate-180" })] }) }), _jsx(DropdownContent, { className: "w-40 min-w-40 p-0 shadow-md", side: isMobile ? "bottom" : "right", align: "start", sideOffset: 8, children: _jsx(DropdownGroup, { label: item.title, className: "p-2", children: item.items.map((subItem) => (_jsx(NavDropdownSubItem, { item: subItem, linkComponent: linkComponent }, subItem.title))) }) })] }) }));
49
54
  }
50
- return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { type: "button", isActive: isActive, tooltip: tooltipContent, "aria-label": item.title, "aria-expanded": isOpen, "aria-controls": submenuId, onClick: () => setIsOpen((current) => !current), "data-nav-id": item.id, children: [_jsx(NavMenuItemContent, { item: item }), _jsx(ChevronDown, { className: cn("ml-auto size-4 shrink-0 transition-transform duration-150 ease-out group-data-[collapsible=icon]:hidden", isOpen && "rotate-180") })] }), _jsx(AnimatePresence, { initial: false, children: isOpen && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: shouldReduceMotion ? { duration: 0 } : { duration: 0.2, ease: [0.23, 1, 0.32, 1] }, className: "overflow-hidden", children: _jsx(SidebarMenuSub, { id: submenuId, className: "ml-5.5 mr-0 mt-1 translate-x-0 border-muted-border px-3 py-0", children: item.items.map((subItem) => (_jsx(SidebarMenuSubItem, { children: _jsx(NavListSubItem, { item: subItem, linkComponent: linkComponent }) }, subItem.title))) }) })) })] }));
55
+ return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { type: "button", isActive: isActive, tooltip: tooltipContent, "aria-label": navItemLabel(item), "aria-expanded": isOpen, "aria-controls": submenuId, onClick: () => setIsOpen((current) => !current), "data-nav-id": item.id, children: [_jsx(NavMenuItemContent, { item: item }), _jsx(ChevronDown, { className: cn("ml-auto size-4 shrink-0 transition-transform duration-150 ease-out group-data-[collapsible=icon]:hidden", isOpen && "rotate-180") })] }), _jsx(AnimatePresence, { initial: false, children: isOpen && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: shouldReduceMotion ? { duration: 0 } : { duration: 0.2, ease: [0.23, 1, 0.32, 1] }, className: "overflow-hidden", children: _jsx(SidebarMenuSub, { id: submenuId, className: "ml-5.5 mr-0 mt-1 translate-x-0 border-muted-border px-3 py-0", children: item.items.map((subItem) => (_jsx(SidebarMenuSubItem, { children: _jsx(NavListSubItem, { item: subItem, linkComponent: linkComponent }) }, subItem.title))) }) })) })] }));
51
56
  }
52
57
  function NavLeafMenuItem(props) {
53
58
  const { item, linkComponent: LinkComponent } = props;
@@ -55,13 +60,13 @@ function NavLeafMenuItem(props) {
55
60
  const tooltipContent = useNavMenuTooltipContent(item);
56
61
  if (item.onClick || !href || item.disabled) {
57
62
  const isDisabled = item.disabled || !item.onClick;
58
- const button = (_jsx(SidebarMenuButton, { type: "button", onClick: item.disabled ? undefined : item.onClick, disabled: isDisabled, tooltip: isDisabled ? undefined : tooltipContent, isActive: !item.disabled && item.isActive, "aria-label": item.title, className: isDisabled ? disabledTopLevelClassName : undefined, "data-nav-id": item.id, children: _jsx(NavMenuItemContent, { item: item }) }));
63
+ const button = (_jsx(SidebarMenuButton, { type: "button", onClick: item.disabled ? undefined : item.onClick, disabled: isDisabled, tooltip: isDisabled ? undefined : tooltipContent, isActive: !item.disabled && item.isActive, "aria-label": navItemLabel(item), className: isDisabled ? disabledTopLevelClassName : undefined, "data-nav-id": item.id, children: _jsx(NavMenuItemContent, { item: item }) }));
59
64
  if (isDisabled) {
60
65
  return _jsx(NavMenuDisabledTooltip, { content: tooltipContent, children: button });
61
66
  }
62
67
  return button;
63
68
  }
64
- return (_jsx(SidebarMenuButton, { asChild: true, tooltip: tooltipContent, isActive: item.isActive, "data-nav-id": item.id, children: _jsx(LinkComponent, { href: href, "aria-label": item.title, children: _jsx(NavMenuItemContent, { item: item }) }) }));
69
+ return (_jsx(SidebarMenuButton, { asChild: true, tooltip: tooltipContent, isActive: item.isActive, "data-nav-id": item.id, children: _jsx(LinkComponent, { href: href, "aria-label": navItemLabel(item), children: _jsx(NavMenuItemContent, { item: item }) }) }));
65
70
  }
66
71
  function useNavMenuTooltipContent(item) {
67
72
  const { isMobile, state } = useSidebar();
@@ -83,7 +88,7 @@ function NavMenuDisabledTooltip(props) {
83
88
  }
84
89
  function NavMenuItemContent(props) {
85
90
  const { item } = props;
86
- return (_jsxs(_Fragment, { children: [_jsx(item.icon, { height: 20, width: 20, className: "size-5" }), _jsx("span", { children: item.title }), !item.disabled && item.shortcut, item.disabled && (_jsx(LockIcon, { className: "ml-auto size-4 shrink-0 text-muted-foreground group-data-[collapsible=icon]:absolute group-data-[collapsible=icon]:top-1 group-data-[collapsible=icon]:right-1 group-data-[collapsible=icon]:size-2.5" }))] }));
91
+ return (_jsxs(_Fragment, { children: [_jsx(item.icon, { height: 20, width: 20, className: "size-5" }), _jsx("span", { children: item.title }), !item.disabled && item.shortcut, !item.disabled && item.badge && (_jsx("div", { className: "ml-auto flex shrink-0 group-data-[collapsible=icon]:absolute group-data-[collapsible=icon]:top-1 group-data-[collapsible=icon]:right-1", children: item.badge })), item.disabled && (_jsx(LockIcon, { className: "ml-auto size-4 shrink-0 text-muted-foreground group-data-[collapsible=icon]:absolute group-data-[collapsible=icon]:top-1 group-data-[collapsible=icon]:right-1 group-data-[collapsible=icon]:size-2.5" }))] }));
87
92
  }
88
93
  function NavListSubItem(props) {
89
94
  const { item, linkComponent: LinkComponent } = props;
@@ -69,6 +69,32 @@ export type DataTableWithoutRowInteraction<TData> = DataTableBaseProps<TData> &
69
69
  };
70
70
  export type DataTableProps<TData> = DataTableWithRowClick<TData> | DataTableWithRowHref<TData> | DataTableWithoutRowInteraction<TData>;
71
71
  export declare function DataTable<TData>(props: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
72
+ export type SortableColumn<TRow> = {
73
+ key: keyof TRow & string;
74
+ header: string;
75
+ numeric?: boolean;
76
+ sortable?: boolean;
77
+ cell?: (row: TRow) => ReactNode;
78
+ };
79
+ export type SortableTableBaseProps<TRow> = {
80
+ columns: SortableColumn<TRow>[];
81
+ rows: TRow[];
82
+ noResultsMessage?: string;
83
+ className?: string;
84
+ isLoading?: boolean;
85
+ };
86
+ export type SortableTableProps<TRow> = (SortableTableBaseProps<TRow> & {
87
+ onRowClick: (row: TRow) => void;
88
+ rowHref?: never;
89
+ }) | (SortableTableBaseProps<TRow> & {
90
+ onRowClick?: never;
91
+ rowHref: (row: TRow) => string;
92
+ }) | (SortableTableBaseProps<TRow> & {
93
+ onRowClick?: never;
94
+ rowHref?: never;
95
+ });
96
+ export declare function renderCellValue(value: unknown): ReactNode;
97
+ export declare function SortableTable<TRow extends object>(props: SortableTableProps<TRow>): import("react/jsx-runtime").JSX.Element;
72
98
  export type { TableColumnRearrangePopoverProps, WithClassName } from "./table-column-rearrange-popover.js";
73
99
  export type { TableConfigProps } from "./table-config.js";
74
100
  export type { PinnedColumnInfo } from "./table-utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGvF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAiB,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjG,OAAO,EAAE,2BAA2B,EAAE,KAAK,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AACjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,2CAMrE;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,2CAE3E;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAA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