@manta-eu/react 0.1.3 → 0.1.5

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 (139) hide show
  1. package/README.md +6 -9
  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.map +1 -1
  8. package/dist/components/chat/chat-input/index.js +7 -0
  9. package/dist/components/chat-view/Chat.d.ts +8 -1
  10. package/dist/components/chat-view/Chat.d.ts.map +1 -1
  11. package/dist/components/chat-view/Chat.js +9 -7
  12. package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
  13. package/dist/components/chat-view/ChatHeaders.js +3 -2
  14. package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts +1 -0
  15. package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts.map +1 -1
  16. package/dist/components/embedded-chat/EmbeddedDatastorePicker.js +9 -3
  17. package/dist/components/embedded-chat/index.d.ts +1 -0
  18. package/dist/components/embedded-chat/index.d.ts.map +1 -1
  19. package/dist/components/embedded-chat/index.js +2 -9
  20. package/dist/components/layouts/Sidebar.d.ts.map +1 -1
  21. package/dist/components/layouts/Sidebar.js +11 -4
  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/datastore-picker/datastore-picker-rows.d.ts +1 -0
  47. package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
  48. package/dist/datastore-picker/datastore-picker-rows.js +6 -2
  49. package/dist/graph/nodes/GoogleCampaignView.js +2 -2
  50. package/dist/hooks/use-action-plans-list.js +1 -1
  51. package/dist/hooks/use-composer-draft.d.ts +10 -0
  52. package/dist/hooks/use-composer-draft.d.ts.map +1 -0
  53. package/dist/hooks/use-composer-draft.js +20 -0
  54. package/dist/hooks/use-manual-actions.d.ts +11 -1
  55. package/dist/hooks/use-manual-actions.d.ts.map +1 -1
  56. package/dist/hooks/use-manual-actions.js +47 -100
  57. package/dist/hooks/useAuth.d.ts +47 -0
  58. package/dist/hooks/useAuth.d.ts.map +1 -1
  59. package/dist/hooks/useAuth.js +50 -10
  60. package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
  61. package/dist/ldo-ui.d.ts +1 -1
  62. package/dist/ldo-ui.d.ts.map +1 -1
  63. package/dist/lib/chat-types.d.ts +5 -0
  64. package/dist/lib/chat-types.d.ts.map +1 -1
  65. package/dist/lib/manual-actions.js +1 -1
  66. package/dist/lib/rdf/index.d.ts +4 -2
  67. package/dist/lib/rdf/index.d.ts.map +1 -1
  68. package/dist/lib/rdf/index.js +48 -18
  69. package/dist/lib/rdf/insights.d.ts +6 -1
  70. package/dist/lib/rdf/insights.d.ts.map +1 -1
  71. package/dist/lib/rdf/insights.js +15 -3
  72. package/dist/lib/rdf/types.d.ts +21 -8
  73. package/dist/lib/rdf/types.d.ts.map +1 -1
  74. package/dist/providers/AuthContext.d.ts +1 -1
  75. package/dist/providers/AuthContext.d.ts.map +1 -1
  76. package/dist/providers/index.d.ts +4 -1
  77. package/dist/providers/index.d.ts.map +1 -1
  78. package/dist/providers/index.js +2 -1
  79. package/dist/routes/chat/index.d.ts +2 -1
  80. package/dist/routes/chat/index.d.ts.map +1 -1
  81. package/dist/routes/chat/index.js +2 -2
  82. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +4 -2
  83. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -1
  84. package/dist/routes/datastores/components/DatastoreFormDialog.js +7 -4
  85. package/dist/routes/datastores/components/DatastoresToolbar.d.ts +3 -1
  86. package/dist/routes/datastores/components/DatastoresToolbar.d.ts.map +1 -1
  87. package/dist/routes/datastores/components/DatastoresToolbar.js +18 -5
  88. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts.map +1 -1
  89. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.js +6 -2
  90. package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts +7 -0
  91. package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts.map +1 -0
  92. package/dist/routes/datastores/components/ProvisionDatastoreDialog.js +10 -0
  93. package/dist/routes/datastores/flatten.d.ts +4 -0
  94. package/dist/routes/datastores/flatten.d.ts.map +1 -1
  95. package/dist/routes/datastores/flatten.js +11 -0
  96. package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts +4 -1
  97. package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts.map +1 -1
  98. package/dist/routes/datastores/hooks/useDatastoreColumns.js +6 -2
  99. package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts +3 -0
  100. package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts.map +1 -0
  101. package/dist/routes/datastores/hooks/useTenantOrganizationCheck.js +21 -0
  102. package/dist/routes/datastores/index.d.ts.map +1 -1
  103. package/dist/routes/datastores/index.js +44 -6
  104. package/dist/routes/datastores/link-provider.d.ts +11 -0
  105. package/dist/routes/datastores/link-provider.d.ts.map +1 -0
  106. package/dist/routes/datastores/link-provider.js +34 -0
  107. package/dist/routes/integrations/components/connect-forms/types.d.ts +1 -0
  108. package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
  109. package/dist/routes/integrations/connection-view.d.ts.map +1 -1
  110. package/dist/routes/integrations/connection-view.js +19 -6
  111. package/dist/routes/integrations/types.d.ts +2 -0
  112. package/dist/routes/integrations/types.d.ts.map +1 -1
  113. package/dist/routes/memories/components/ChangeScopeDialog.d.ts +1 -1
  114. package/dist/routes/memories/components/ChangeScopeDialog.d.ts.map +1 -1
  115. package/dist/routes/memories/components/ChangeScopeDialog.js +3 -3
  116. package/dist/routes/memories/components/EmptyStates.d.ts +1 -2
  117. package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
  118. package/dist/routes/memories/components/EmptyStates.js +2 -2
  119. package/dist/routes/memories/components/MemoriesPanel.d.ts +1 -1
  120. package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
  121. package/dist/routes/memories/components/MemoriesPanel.js +9 -9
  122. package/dist/routes/memories/components/MemoryActions.d.ts +1 -1
  123. package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
  124. package/dist/routes/memories/components/MemoryActions.js +4 -4
  125. package/dist/routes/memories/components/MemoryFields.d.ts +1 -1
  126. package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
  127. package/dist/routes/memories/components/MemoryFields.js +2 -2
  128. package/dist/routes/memories/components/MemoryFormDialog.d.ts +1 -1
  129. package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
  130. package/dist/routes/memories/components/MemoryFormDialog.js +2 -2
  131. package/dist/routes/memories/components/TeamPicker.d.ts +1 -1
  132. package/dist/routes/memories/components/TeamPicker.d.ts.map +1 -1
  133. package/dist/routes/memories/components/TeamPicker.js +2 -2
  134. package/dist/routes/memories/hooks/useMemoryColumns.d.ts +1 -1
  135. package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
  136. package/dist/routes/memories/hooks/useMemoryColumns.js +3 -3
  137. package/dist/routes/memories/index.d.ts.map +1 -1
  138. package/dist/routes/memories/index.js +21 -21
  139. package/package.json +7 -6
@@ -51,6 +51,13 @@ function getCampaignName(campaignNode) {
51
51
  return null;
52
52
  return (getString(campaignNode, "schema:name") || getString(campaignNode, "rdfs:label") || getString(campaignNode, ":name"));
53
53
  }
54
+ export function readCurrency(node) {
55
+ return node ? getString(node, "schema:currency") : null;
56
+ }
57
+ export function sharedCurrency(currencies) {
58
+ const distinct = new Set(currencies);
59
+ return distinct.size === 1 ? (currencies[0] ?? null) : null;
60
+ }
54
61
  export function extractProduct(jsonLd) {
55
62
  const nodes = jsonLd["@graph"];
56
63
  const productNodes = findNodesByType(nodes, ":Product");
@@ -87,6 +94,7 @@ export function extractProductVariant(jsonLd, productUri) {
87
94
  continue;
88
95
  return {
89
96
  uri,
97
+ currency: readCurrency(variantNode),
90
98
  price: getNumber(variantNode, ":price"),
91
99
  cost: getNumber(variantNode, ":cost"),
92
100
  title: getVariantName(variantNode),
@@ -95,22 +103,38 @@ export function extractProductVariant(jsonLd, productUri) {
95
103
  }
96
104
  return null;
97
105
  }
98
- export function extractCompanyKpis(jsonLd) {
99
- const nodes = jsonLd["@graph"];
100
- const kpiNodes = findNodesByType(nodes, ":CompanyKPISnapshot");
101
- const kpiNode = kpiNodes[0];
102
- if (!kpiNode)
103
- return null;
106
+ function kpiValues(node) {
104
107
  return {
105
- mer30d: getNumber(kpiNode, ":mer30d"),
106
- blendedRoas30d: getNumber(kpiNode, ":blendedRoas30d"),
107
- blendedCac30dUsd: getNumber(kpiNode, ":blendedCac30dUsd"),
108
- last30dSpendUsd: getNumber(kpiNode, ":last30dSpendUsd"),
109
- last30dRevenueUsd: getNumber(kpiNode, ":last30dRevenueUsd"),
110
- avgAov30d: getNumber(kpiNode, ":avgAov30d"),
111
- grossMargin30d: getNumber(kpiNode, ":grossMargin30d"),
108
+ spend: getNumber(node, ":totalSpend"),
109
+ revenue: getNumber(node, ":totalRevenue"),
110
+ purchases: getNumber(node, ":totalPurchases"),
111
+ roas: getNumber(node, ":roas"),
112
+ cpa: getNumber(node, ":cpa"),
113
+ aov: getNumber(node, ":aov"),
112
114
  };
113
115
  }
116
+ export function extractKpiSnapshots(jsonLd) {
117
+ const nodes = findNodesByType(jsonLd["@graph"], ":KPISnapshot");
118
+ const inWindow = (window) => nodes.filter((node) => getString(node, ":window") === window);
119
+ const previous = inWindow("prev-30d");
120
+ const snapshots = inWindow("last-30d")
121
+ .map((node) => {
122
+ const currency = readCurrency(node);
123
+ if (!currency)
124
+ return null;
125
+ const previousNode = previous.find((prev) => readCurrency(prev) === currency);
126
+ return {
127
+ currency,
128
+ startDate: getString(node, "schema:startDate"),
129
+ endDate: getString(node, "schema:endDate"),
130
+ current: kpiValues(node),
131
+ previous: previousNode ? kpiValues(previousNode) : null,
132
+ };
133
+ })
134
+ .filter(isNotNil)
135
+ .sort((a, b) => a.currency.localeCompare(b.currency));
136
+ return isPresent(snapshots) ? snapshots : null;
137
+ }
114
138
  export function extractDailyPerformance(jsonLd) {
115
139
  const nodes = jsonLd["@graph"];
116
140
  const snapshotNodes = findNodesByType(nodes, ":BlendedPerformanceDaily");
@@ -133,7 +157,8 @@ export function extractDailyPerformance(jsonLd) {
133
157
  if (!isPresent(days)) {
134
158
  return null;
135
159
  }
136
- return { days };
160
+ // The daily blend is kept in USD: its predicates are the converted :…Usd ones.
161
+ return { currency: "USD", days };
137
162
  }
138
163
  export function extractProductProfitability(jsonLd) {
139
164
  const nodes = jsonLd["@graph"];
@@ -308,7 +333,8 @@ export function extractMetaDailyInsights(jsonLd) {
308
333
  if (!isPresent(days)) {
309
334
  return null;
310
335
  }
311
- return { campaignUri, campaignName, days };
336
+ const currency = readCurrency(campaignNode) ?? readCurrency(firstInsight);
337
+ return { campaignUri, campaignName, currency, days };
312
338
  }
313
339
  export function extractCampaignChannelMix(jsonLd) {
314
340
  const nodes = jsonLd["@graph"];
@@ -321,22 +347,24 @@ export function extractCampaignChannelMix(jsonLd) {
321
347
  const channel = getString(node, "meta:campaignChannel") || "Meta";
322
348
  const spend = getNumber(node, "meta:totalSpend") || 0;
323
349
  const revenue = getNumber(node, "meta:totalRevenue") || 0;
324
- const existing = channelMap.get(channel) || { count: 0, spend: 0, revenue: 0 };
350
+ const existing = channelMap.get(channel) || { count: 0, spend: 0, revenue: 0, currencies: [] };
325
351
  channelMap.set(channel, {
326
352
  count: existing.count + 1,
327
353
  spend: existing.spend + spend,
328
354
  revenue: existing.revenue + revenue,
355
+ currencies: [...existing.currencies, readCurrency(node)],
329
356
  });
330
357
  });
331
358
  const totalCampaigns = campaignNodes.length;
332
359
  const channels = Array.from(channelMap.entries()).map(([channel, data]) => ({
333
360
  channel,
361
+ currency: sharedCurrency(data.currencies),
334
362
  campaignCount: data.count,
335
363
  totalSpend: data.spend,
336
364
  totalRevenue: data.revenue,
337
365
  percentage: (data.count / totalCampaigns) * 100,
338
366
  }));
339
- return isPresent(channels) ? { channels } : null;
367
+ return isPresent(channels) ? { currency: sharedCurrency(campaignNodes.map(readCurrency)), channels } : null;
340
368
  }
341
369
  export function extractProductVariants(jsonLd) {
342
370
  const nodes = jsonLd["@graph"];
@@ -366,6 +394,7 @@ export function extractProductVariants(jsonLd) {
366
394
  const marginPct = price !== null && cost !== null && price > 0 ? ((price - cost) / price) * 100 : null;
367
395
  return {
368
396
  uri,
397
+ currency: readCurrency(node),
369
398
  productName,
370
399
  variantName,
371
400
  sku,
@@ -402,6 +431,7 @@ export function extractCampaignGrid(jsonLd) {
402
431
  }
403
432
  return {
404
433
  uri,
434
+ currency: readCurrency(node),
405
435
  name,
406
436
  status,
407
437
  channel,
@@ -412,5 +442,5 @@ export function extractCampaignGrid(jsonLd) {
412
442
  };
413
443
  })
414
444
  .filter(isNotNil);
415
- return isPresent(campaigns) ? { campaigns } : null;
445
+ return isPresent(campaigns) ? { currency: sharedCurrency(campaigns.map((c) => c.currency)), campaigns } : null;
416
446
  }
@@ -1,4 +1,9 @@
1
- export declare function formatMetric(value: number, type: "currency" | "multiplier" | "percentage"): string;
1
+ /** A money value in the entity's own currency (`schema:currency`); an unknown or mixed one shows the bare amount. */
2
+ export declare function formatMetric(value: number, type: "currency", currency: string | null): string;
3
+ export declare function formatMetric(value: number, type: "multiplier" | "percentage"): string;
4
+ /** A chart axis label such as `€12K`, or `12K` when the currency is unknown or mixed. */
5
+ export declare function formatCompactMoney(value: number, currency: string | null): string;
2
6
  export declare function determineAvailabilityStatus(quantity?: number): "available" | "low-stock" | "made-to-order" | "out-of-stock";
3
7
  export declare function calculateExpectedRevenue(dailyBudget: number, roas: number, days?: number): number;
8
+ export declare function percentChange(current: number | null, previous: number | null | undefined): number | null;
4
9
  //# sourceMappingURL=insights.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"insights.d.ts","sourceRoot":"","sources":["../../../src/lib/rdf/insights.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,CAmBlG;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,CAAC,EAAE,MAAM,GAChB,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,cAAc,CAgB9D;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,MAAM,CAErG"}
1
+ {"version":3,"file":"insights.d.ts","sourceRoot":"","sources":["../../../src/lib/rdf/insights.ts"],"names":[],"mappings":"AAEA,qHAAqH;AACrH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;AAC/F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;AAyBvF,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAMjF;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,CAAC,EAAE,MAAM,GAChB,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,cAAc,CAgB9D;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,MAAM,CAErG;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGxG"}
@@ -1,9 +1,8 @@
1
1
  import { isNotNil } from "ramda";
2
- export function formatMetric(value, type) {
2
+ export function formatMetric(value, type, currency = null) {
3
3
  if (type === "currency") {
4
4
  return new Intl.NumberFormat("en-US", {
5
- style: "currency",
6
- currency: "USD",
5
+ ...(currency ? { style: "currency", currency } : {}),
7
6
  minimumFractionDigits: 2,
8
7
  maximumFractionDigits: 2,
9
8
  }).format(value);
@@ -16,6 +15,14 @@ export function formatMetric(value, type) {
16
15
  }
17
16
  return value.toString();
18
17
  }
18
+ /** A chart axis label such as `€12K`, or `12K` when the currency is unknown or mixed. */
19
+ export function formatCompactMoney(value, currency) {
20
+ return new Intl.NumberFormat("en-US", {
21
+ ...(currency ? { style: "currency", currency } : {}),
22
+ notation: "compact",
23
+ maximumFractionDigits: 0,
24
+ }).format(value);
25
+ }
19
26
  export function determineAvailabilityStatus(quantity) {
20
27
  const quantityExists = isNotNil(quantity);
21
28
  if (quantityExists && quantity < 0) {
@@ -32,3 +39,8 @@ export function determineAvailabilityStatus(quantity) {
32
39
  export function calculateExpectedRevenue(dailyBudget, roas, days = 30) {
33
40
  return dailyBudget * days * roas;
34
41
  }
42
+ export function percentChange(current, previous) {
43
+ if (current === null || previous === null || previous === undefined || previous === 0)
44
+ return null;
45
+ return ((current - previous) / Math.abs(previous)) * 100;
46
+ }
@@ -9,18 +9,25 @@ export type Product = {
9
9
  };
10
10
  export type ProductVariant = {
11
11
  uri: string;
12
+ currency: string | null;
12
13
  price?: number;
13
14
  cost?: number;
14
15
  title?: string;
15
16
  };
16
- export type CompanyKpis = {
17
- mer30d?: number;
18
- blendedRoas30d?: number;
19
- blendedCac30dUsd?: number;
20
- last30dSpendUsd?: number;
21
- last30dRevenueUsd?: number;
22
- avgAov30d?: number;
23
- grossMargin30d?: number;
17
+ export type KpiValues = {
18
+ spend: number | null;
19
+ revenue: number | null;
20
+ purchases: number | null;
21
+ roas: number | null;
22
+ cpa: number | null;
23
+ aov: number | null;
24
+ };
25
+ export type KpiSnapshot = {
26
+ currency: string;
27
+ startDate: string | null;
28
+ endDate: string | null;
29
+ current: KpiValues;
30
+ previous: KpiValues | null;
24
31
  };
25
32
  export type DailyPerformanceDay = {
26
33
  date: string;
@@ -29,6 +36,7 @@ export type DailyPerformanceDay = {
29
36
  orders: number;
30
37
  };
31
38
  export type DailyPerformanceData = {
39
+ currency: string;
32
40
  days: DailyPerformanceDay[];
33
41
  };
34
42
  export type ProductProfitabilityData = {
@@ -95,11 +103,14 @@ export type MetaDailyInsightDay = {
95
103
  export type MetaDailyInsightsData = {
96
104
  campaignUri: string;
97
105
  campaignName: string | null;
106
+ currency: string | null;
98
107
  days: MetaDailyInsightDay[];
99
108
  };
100
109
  export type CampaignChannelMixData = {
110
+ currency: string | null;
101
111
  channels: Array<{
102
112
  channel: string;
113
+ currency: string | null;
103
114
  campaignCount: number;
104
115
  totalSpend: number;
105
116
  totalRevenue: number;
@@ -120,8 +131,10 @@ export type ProductVariantsData = {
120
131
  }>;
121
132
  };
122
133
  export type CampaignGridData = {
134
+ currency: string | null;
123
135
  campaigns: Array<{
124
136
  uri: string;
137
+ currency: string | null;
125
138
  name: string | null;
126
139
  status: string | null;
127
140
  channel: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/rdf/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAMF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MA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,CAAC;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CACF,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,KAAK,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC,CAAC;CACJ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { UseAuthResult } from "../hooks/useAuth.js";
2
2
  import type { User } from "../lib/chat-types.js";
3
- export type AuthContextValue = Pick<UseAuthResult, "datastore" | "datastores" | "logout" | "isOperator" | "canManageTeam" | "orgRoles" | "canManageIntegrations" | "canSwitchDatastore" | "allowedModels"> & {
3
+ export type AuthContextValue = Pick<UseAuthResult, "datastore" | "datastores" | "logout" | "isOperator" | "canManageTeam" | "orgRoles" | "canManageIntegrations" | "canManageStreams" | "canManageSharedMemories" | "canSwitchDatastore" | "allowedModels"> & {
4
4
  user: User;
5
5
  };
6
6
  export declare const AuthContext: import("react").Context<AuthContextValue | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthContext.d.ts","sourceRoot":"","sources":["../../src/providers/AuthContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,aAAa,EACX,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,eAAe,GACf,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,CAClB,GAAG;IACF,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,WAAW,uDAAyD,CAAC;AAElF,wBAAgB,cAAc,IAAI,gBAAgB,CAQjD"}
1
+ {"version":3,"file":"AuthContext.d.ts","sourceRoot":"","sources":["../../src/providers/AuthContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,aAAa,EACX,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,eAAe,GACf,UAAU,GACV,uBAAuB,GACvB,kBAAkB,GAClB,yBAAyB,GACzB,oBAAoB,GACpB,eAAe,CAClB,GAAG;IACF,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,WAAW,uDAAyD,CAAC;AAElF,wBAAgB,cAAc,IAAI,gBAAgB,CAQjD"}
@@ -19,5 +19,8 @@ export type ProvidersProps = {
19
19
  knowledgeGraphPollIntervalMs?: number;
20
20
  };
21
21
  export declare function Providers(props: ProvidersProps): import("react/jsx-runtime").JSX.Element;
22
- export declare function EmbeddedChatProviders(props: ProvidersProps): import("react/jsx-runtime").JSX.Element;
22
+ export type EmbeddedChatProvidersProps = Omit<ProvidersProps, "mantaBaseUrl"> & {
23
+ mantaBaseUrl?: string;
24
+ };
25
+ export declare function EmbeddedChatProviders(props: EmbeddedChatProvidersProps): import("react/jsx-runtime").JSX.Element;
23
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAsCF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAc9C;AAGD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,2CAE1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAsCF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAc9C;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAG1G,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAItE"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { defaultDeployment } from "@manta-eu/auth/default-deployment";
2
3
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
4
  import { NuqsAdapter } from "nuqs/adapters/react-router/v7";
4
5
  import { useState } from "react";
@@ -43,5 +44,5 @@ export function Providers(props) {
43
44
  }
44
45
  // IMPORTANT: Avoid redirects from embedded manta client
45
46
  export function EmbeddedChatProviders(props) {
46
- return _jsx(CoreProviders, { ...props, onUnauthorized: () => { } });
47
+ return (_jsx(CoreProviders, { ...props, mantaBaseUrl: props.mantaBaseUrl ?? defaultDeployment.apiUrl, onUnauthorized: () => { } }));
47
48
  }
@@ -1,6 +1,6 @@
1
1
  import type { MantaModelId } from "@manta-eu/client/shared/model";
2
2
  import type { ReactNode } from "react";
3
- import type { Datastore, User } from "#lib/chat-types";
3
+ import type { ChatDraft, Datastore, User } from "#lib/chat-types";
4
4
  type ChatRouteProps = {
5
5
  datastore?: Datastore;
6
6
  user: User;
@@ -10,6 +10,7 @@ type ChatRouteProps = {
10
10
  datastores?: Datastore[];
11
11
  allowedModels?: MantaModelId[];
12
12
  initialPrompt?: string;
13
+ initialDraft?: ChatDraft;
13
14
  title?: string;
14
15
  welcomeSubtitle?: string;
15
16
  assistantName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/chat/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvD,KAAK,cAAc,GAAG;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CA0C9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/chat/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGlE,KAAK,cAAc,GAAG;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CA4C9C"}
@@ -3,6 +3,6 @@ import { Chat } from "#components/chat-view/index";
3
3
  import { RouteLayout } from "#components/layouts/RouteLayout";
4
4
  import { AssistantNameProvider } from "#providers/AssistantNameProvider";
5
5
  export function ChatRoute(props) {
6
- const { datastore, user, logout, isOperator, canSwitchDatastore, datastores, allowedModels, initialPrompt, title, welcomeSubtitle, assistantName, mark, } = props;
7
- return (_jsx(AssistantNameProvider, { name: assistantName, children: _jsx(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, floatingMobileMenu: true, title: title, mark: mark, children: _jsx(Chat, { datastore: datastore, user: user, onLogout: logout, isOperator: isOperator, allowedModels: allowedModels, initialPrompt: initialPrompt, welcomeSubtitle: welcomeSubtitle, mark: mark }) }) }));
6
+ const { datastore, user, logout, isOperator, canSwitchDatastore, datastores, allowedModels, initialPrompt, initialDraft, title, welcomeSubtitle, assistantName, mark, } = props;
7
+ return (_jsx(AssistantNameProvider, { name: assistantName, children: _jsx(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, floatingMobileMenu: true, title: title, mark: mark, children: _jsx(Chat, { datastore: datastore, user: user, onLogout: logout, isOperator: isOperator, allowedModels: allowedModels, initialPrompt: initialPrompt, initialDraft: initialDraft, welcomeSubtitle: welcomeSubtitle, mark: mark }) }) }));
8
8
  }
@@ -1,3 +1,4 @@
1
+ import type { TenantOrganizationCheck } from "../link-provider.js";
1
2
  export type DatastoreFormTarget = {
2
3
  kind: "organization";
3
4
  } | {
@@ -6,15 +7,16 @@ export type DatastoreFormTarget = {
6
7
  parentName: string;
7
8
  organizationName: string;
8
9
  };
9
- type DatastoreFormDialogProps = {
10
+ export type DatastoreFormDialogProps = {
10
11
  target: DatastoreFormTarget;
11
12
  onSubmit: (values: {
12
13
  name: string;
13
14
  }) => void;
14
15
  onCancel: () => void;
15
16
  isSubmitting?: boolean;
17
+ onNameChange?: (name: string) => void;
18
+ nameCheck?: TenantOrganizationCheck;
16
19
  };
17
20
  export declare function provisioningNotice(target: DatastoreFormTarget): string;
18
21
  export declare function DatastoreFormDialog(props: DatastoreFormDialogProps): import("react/jsx-runtime").JSX.Element;
19
- export {};
20
22
  //# sourceMappingURL=DatastoreFormDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatastoreFormDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/DatastoreFormDialog.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAKtE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAmElE"}
1
+ {"version":3,"file":"DatastoreFormDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/DatastoreFormDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAahE,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAKtE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAsElE"}
@@ -11,10 +11,10 @@ export function provisioningNotice(target) {
11
11
  .exhaustive();
12
12
  }
13
13
  export function DatastoreFormDialog(props) {
14
- const { target, onSubmit, onCancel, isSubmitting = false } = props;
14
+ const { target, onSubmit, onCancel, isSubmitting = false, onNameChange, nameCheck } = props;
15
15
  const [name, setName] = useState("");
16
16
  const isOrganization = target.kind === "organization";
17
- const canSubmit = !!name.trim() && !isSubmitting;
17
+ const canSubmit = !!name.trim() && !isSubmitting && nameCheck?.blocked !== true;
18
18
  function submit() {
19
19
  if (!canSubmit)
20
20
  return;
@@ -24,10 +24,13 @@ export function DatastoreFormDialog(props) {
24
24
  .with({ kind: "organization" }, () => "Sets up a new top-level organization with its own datastore and a fresh Manta you can build on.")
25
25
  .with({ kind: "datastore", parentPath: "/" }, (datastore) => `Adds a top-level datastore in ${datastore.organizationName}.`)
26
26
  .with({ kind: "datastore" }, (datastore) => `Adds a datastore nested under ${datastore.parentName}, in ${datastore.organizationName}.`)
27
- .exhaustive() })] }), _jsx(Input, { autoFocus: true, label: isOrganization ? "Organization name" : "Datastore name", placeholder: isOrganization ? "e.g. Other Reseller Co" : "e.g. Acme Corp", value: name, disabled: isSubmitting, onChange: (event) => setName(event.target.value), onKeyDown: (event) => {
27
+ .exhaustive() })] }), _jsx(Input, { autoFocus: true, label: isOrganization ? "Organization name" : "Datastore name", placeholder: isOrganization ? "e.g. Other Reseller Co" : "e.g. Acme Corp", value: name, disabled: isSubmitting, onChange: (event) => {
28
+ setName(event.target.value);
29
+ onNameChange?.(event.target.value);
30
+ }, onKeyDown: (event) => {
28
31
  if (event.key === "Enter")
29
32
  submit();
30
33
  if (event.key === "Escape")
31
34
  onCancel();
32
- } }), _jsx("p", { role: "status", "aria-live": "polite", className: "typography-caption text-muted-foreground min-h-5", children: isSubmitting ? provisioningNotice(target) : "" }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "tertiary", onClick: onCancel, disabled: isSubmitting, children: "Cancel" }), _jsx(Button, { onClick: submit, disabled: !canSubmit, isLoading: isSubmitting, label: isOrganization ? "Add organization" : "Add datastore" })] })] }) }));
35
+ } }), _jsx("p", { role: "status", "aria-live": "polite", className: "typography-caption text-muted-foreground min-h-5", children: isSubmitting ? provisioningNotice(target) : (nameCheck?.hint ?? "") }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "tertiary", onClick: onCancel, disabled: isSubmitting, children: "Cancel" }), _jsx(Button, { onClick: submit, disabled: !canSubmit, isLoading: isSubmitting, label: isOrganization ? "Add organization" : "Add datastore" })] })] }) }));
33
36
  }
@@ -1,6 +1,6 @@
1
1
  import type { Table } from "@tanstack/react-table";
2
2
  import type { ReactNode } from "react";
3
- import type { DatastoreRow } from "../flatten.js";
3
+ import type { DatastoreRow, ProviderFilter } from "../flatten.js";
4
4
  import type { StatusFilter } from "../hooks/useDatastoreTable.js";
5
5
  type DatastoresToolbarProps = {
6
6
  tabs?: ReactNode;
@@ -9,6 +9,8 @@ type DatastoresToolbarProps = {
9
9
  searchPlaceholder?: string;
10
10
  statusFilter: StatusFilter;
11
11
  onStatusFilterChange: (status: StatusFilter) => void;
12
+ providerFilter?: ProviderFilter;
13
+ onProviderFilterChange?: (filter: ProviderFilter) => void;
12
14
  table: Table<DatastoreRow>;
13
15
  columnLabels?: Record<string, string>;
14
16
  columnDefaultOrder?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"DatastoresToolbar.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/DatastoresToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAQ/D,KAAK,sBAAsB,GAAG;IAC5B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,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AC;IACtC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAuI9D"}
@@ -8,22 +8,35 @@ import { Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownTrigger
8
8
  import { FilterSection, FilterSheet } from "#components/filter-sheet/index";
9
9
  import { Input } from "#components/input/index";
10
10
  import { TableColumnRearrangePopover } from "#components/table/index";
11
+ const providerFilterOptions = [
12
+ { id: "ALL", label: "All" },
13
+ { id: "mirrored", label: "Linked to identity provider" },
14
+ { id: "unmirrored", label: "Not linked to identity provider" },
15
+ ];
11
16
  export function DatastoresToolbar(props) {
12
- const { tabs, searchQuery, onSearchQueryChange, searchPlaceholder = "Search by name or ID...", statusFilter, onStatusFilterChange, table, columnLabels = datastoreColumnLabels, columnDefaultOrder = defaultColumnOrder, } = props;
17
+ const { tabs, searchQuery, onSearchQueryChange, searchPlaceholder = "Search by name or ID...", statusFilter, onStatusFilterChange, providerFilter, onProviderFilterChange, table, columnLabels = datastoreColumnLabels, columnDefaultOrder = defaultColumnOrder, } = props;
13
18
  const allStatusesSelected = statusFilter === "ALL";
14
19
  const selectedStatusLabel = datastoreStatusFilterOptions.find((option) => option.id === statusFilter)?.label;
15
- const hasActiveFilters = isPresent(searchQuery) || !allStatusesSelected;
16
- const activeFilterCount = (isPresent(searchQuery) ? 1 : 0) + (allStatusesSelected ? 0 : 1);
20
+ const providerFiltered = isPresent(providerFilter) && providerFilter !== "ALL";
21
+ const selectedProviderLabel = providerFilterOptions.find((option) => option.id === providerFilter)?.label;
22
+ const hasActiveFilters = isPresent(searchQuery) || !allStatusesSelected || providerFiltered;
23
+ const activeFilterCount = (isPresent(searchQuery) ? 1 : 0) + (allStatusesSelected ? 0 : 1) + (providerFiltered ? 1 : 0);
17
24
  function handleClearFilters() {
18
25
  onSearchQueryChange("");
19
26
  onStatusFilterChange("ALL");
27
+ onProviderFilterChange?.("ALL");
20
28
  }
21
29
  function statusDropdown(className) {
22
30
  return (_jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsxs(Button, { variant: "tertiary", size: "base", rounded: "lg", className: className, children: [_jsx("span", { children: allStatusesSelected ? "Status" : selectedStatusLabel }), _jsx(ChevronDown, { className: "size-4" })] }) }), _jsx(DropdownContent, { align: "start", className: "w-48", children: _jsx(DropdownGroup, { label: "Filter by status", children: datastoreStatusFilterOptions.map((option) => (_jsx(DropdownItem, { selected: option.id === statusFilter, onClick: () => onStatusFilterChange(option.id), children: option.label }, option.id))) }) })] }));
23
31
  }
32
+ function providerDropdown(className) {
33
+ if (!isPresent(providerFilter) || !onProviderFilterChange)
34
+ return null;
35
+ return (_jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsxs(Button, { variant: "tertiary", size: "base", rounded: "lg", className: className, children: [_jsx("span", { children: providerFiltered ? selectedProviderLabel : "Identity provider" }), _jsx(ChevronDown, { className: "size-4" })] }) }), _jsx(DropdownContent, { align: "start", className: "w-64", children: _jsx(DropdownGroup, { label: "Filter by identity provider", children: providerFilterOptions.map((option) => (_jsx(DropdownItem, { selected: option.id === providerFilter, onClick: () => onProviderFilterChange(option.id), children: option.label }, option.id))) }) })] }));
36
+ }
24
37
  function filterControls() {
25
- return (_jsxs(_Fragment, { children: [statusDropdown(), hasActiveFilters && (_jsx(Button, { variant: "ghost", size: "base", rounded: "lg", onClick: handleClearFilters, icon: X, children: "Clear filters" }))] }));
38
+ return (_jsxs(_Fragment, { children: [statusDropdown(), providerDropdown(), hasActiveFilters && (_jsx(Button, { variant: "ghost", size: "base", rounded: "lg", onClick: handleClearFilters, icon: X, children: "Clear filters" }))] }));
26
39
  }
27
- const filterSheetContent = _jsx(FilterSection, { title: "Status", children: statusDropdown("w-full justify-between") });
40
+ const filterSheetContent = (_jsxs(_Fragment, { children: [_jsx(FilterSection, { title: "Status", children: statusDropdown("w-full justify-between") }), isPresent(providerFilter) && (_jsx(FilterSection, { title: "Identity provider", children: providerDropdown("w-full justify-between") }))] }));
28
41
  return (_jsxs("div", { className: "flex min-w-0 flex-col gap-3 3xl:flex-row 3xl:items-center", children: [isPresent(tabs) && _jsx("div", { className: "min-w-0", children: tabs }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 flex-1 min-w-0", children: [_jsx(Input, { containerClassName: "min-w-0 flex-1 sm:w-64 sm:flex-none", type: "search", variant: "search", placeholder: searchPlaceholder, value: searchQuery, onChange: (event) => onSearchQueryChange(event.target.value) }), _jsx("div", { className: "sm:hidden", children: _jsx(FilterSheet, { activeCount: activeFilterCount, onReset: handleClearFilters, children: filterSheetContent }) }), _jsx("div", { className: "hidden sm:contents", children: filterControls() }), _jsx("div", { className: "ml-auto hidden shrink-0 sm:block", children: _jsx(TableColumnRearrangePopover, { enableReset: true, table: table, columnLabels: columnLabels, defaultOrder: columnDefaultOrder }) })] })] }));
29
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LinkUnlinkedDatastoreDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/LinkUnlinkedDatastoreDialog.tsx"],"names":[],"mappings":"AAqBA,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAIF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,2CAkIlF"}
1
+ {"version":3,"file":"LinkUnlinkedDatastoreDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/LinkUnlinkedDatastoreDialog.tsx"],"names":[],"mappings":"AAuBA,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAIF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,2CA0IlF"}
@@ -6,6 +6,8 @@ import { useQueryClient } from "@tanstack/react-query";
6
6
  import { useState } from "react";
7
7
  import { toast } from "sonner";
8
8
  import { organizationNameKey } from "../flatten.js";
9
+ import { useTenantOrganizationCheck } from "../hooks/useTenantOrganizationCheck.js";
10
+ import { toastProviderWarning } from "../link-provider.js";
9
11
  import { Button } from "#components/button/index";
10
12
  import { Input } from "#components/input/index";
11
13
  import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "#components/modal/index";
@@ -27,6 +29,7 @@ export function LinkUnlinkedDatastoreDialog(props) {
27
29
  void queryClient.invalidateQueries({ queryKey: useUnlinkedDatastoresQuery.getKey() });
28
30
  void queryClient.invalidateQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
29
31
  toast.success(`Linked to the existing datastore '${datastoreId}'`);
32
+ toastProviderWarning(result.linkUnlinkedDatastore.providerWarning);
30
33
  onClose();
31
34
  }
32
35
  else {
@@ -40,7 +43,8 @@ export function LinkUnlinkedDatastoreDialog(props) {
40
43
  toast.error(info.message, { description: info.description });
41
44
  },
42
45
  });
43
- const canSubmit = mode === "new" ? !!organizationName.trim() : !!existingOrganizationName;
46
+ const tenantCheck = useTenantOrganizationCheck(mode === "new" ? organizationName : "", existingOrganizationNames);
47
+ const canSubmit = mode === "new" ? !!organizationName.trim() && !tenantCheck.blocked : !!existingOrganizationName;
44
48
  const atExistingOrganizationRoot = mode === "existing" && !name.trim();
45
49
  const suggestedParentPath = suggestedMatch &&
46
50
  existingOrganizationName === suggestedMatch.organizationName &&
@@ -79,5 +83,5 @@ export function LinkUnlinkedDatastoreDialog(props) {
79
83
  };
80
84
  linkMutation.mutate({ input });
81
85
  }
82
- return (_jsx(Dialog, { open: true, onOpenChange: (nextOpen) => !nextOpen && onClose(), children: _jsxs(DialogContent, { className: "flex flex-col overflow-hidden", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { text: "Link datastore" }), _jsx(DialogDescription, { children: `Link the existing datastore '${datastoreId}' to an organization or group.` })] }), _jsxs(RadioGroup, { value: mode, onValueChange: (v) => setMode(v), className: "flex gap-4 items-center", children: [_jsx(RadioGroupItem, { value: "new", label: "New organization" }), _jsx(RadioGroupItem, { value: "existing", label: "Existing organization", disabled: !isPresent(organizationNames) })] }), mode === "new" ? (_jsx(Input, { autoFocus: true, label: "Organization name", placeholder: "e.g. Acme Corp", value: organizationName, onChange: (event) => setOrganizationName(event.target.value) })) : (_jsxs(_Fragment, { children: [_jsxs(Select, { value: existingOrganizationName, onValueChange: setExistingOrganizationName, children: [_jsx(SelectTrigger, { label: "Organization", id: "link-organization", children: _jsx(SelectValue, { placeholder: "Select an organization\u2026" }) }), _jsx(SelectContent, { children: organizationNames.map((orgName) => (_jsx(SelectItem, { value: orgName, children: orgName }, orgName))) })] }), _jsx(Input, { label: "Datastore name", placeholder: "Leave empty to link to the organization root", value: name, onChange: (event) => setName(event.target.value) })] })), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "tertiary", onClick: onClose, children: "Cancel" }), _jsx(Button, { onClick: submit, disabled: !canSubmit || linkMutation.isPending, children: "Link" })] })] }) }));
86
+ return (_jsx(Dialog, { open: true, onOpenChange: (nextOpen) => !nextOpen && onClose(), children: _jsxs(DialogContent, { className: "flex flex-col overflow-hidden", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { text: "Link datastore" }), _jsx(DialogDescription, { children: `Link the existing datastore '${datastoreId}' to an organization or group.` })] }), _jsxs(RadioGroup, { value: mode, onValueChange: (v) => setMode(v), className: "flex gap-4 items-center", children: [_jsx(RadioGroupItem, { value: "new", label: "New organization" }), _jsx(RadioGroupItem, { value: "existing", label: "Existing organization", disabled: !isPresent(organizationNames) })] }), mode === "new" ? (_jsxs(_Fragment, { children: [_jsx(Input, { autoFocus: true, label: "Organization name", placeholder: "e.g. Acme Corp", value: organizationName, onChange: (event) => setOrganizationName(event.target.value) }), isPresent(tenantCheck.hint) ? (_jsx("span", { className: "typography-caption text-muted-foreground", children: tenantCheck.hint })) : null] })) : (_jsxs(_Fragment, { children: [_jsxs(Select, { value: existingOrganizationName, onValueChange: setExistingOrganizationName, children: [_jsx(SelectTrigger, { label: "Organization", id: "link-organization", children: _jsx(SelectValue, { placeholder: "Select an organization\u2026" }) }), _jsx(SelectContent, { children: organizationNames.map((orgName) => (_jsx(SelectItem, { value: orgName, children: orgName }, orgName))) })] }), _jsx(Input, { label: "Datastore name", placeholder: "Leave empty to link to the organization root", value: name, onChange: (event) => setName(event.target.value) })] })), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "tertiary", onClick: onClose, children: "Cancel" }), _jsx(Button, { onClick: submit, disabled: !canSubmit || linkMutation.isPending, children: "Link" })] })] }) }));
83
87
  }
@@ -0,0 +1,7 @@
1
+ import { type DatastoreFormDialogProps } from "./DatastoreFormDialog.js";
2
+ type ProvisionDatastoreDialogProps = Omit<DatastoreFormDialogProps, "onNameChange" | "nameCheck"> & {
3
+ existingOrganizationNames: Set<string>;
4
+ };
5
+ export declare function ProvisionDatastoreDialog(props: ProvisionDatastoreDialogProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=ProvisionDatastoreDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProvisionDatastoreDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/ProvisionDatastoreDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,KAAK,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,EAAE,cAAc,GAAG,WAAW,CAAC,GAAG;IAClG,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,2CAS5E"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { useTenantOrganizationCheck } from "../hooks/useTenantOrganizationCheck.js";
4
+ import { DatastoreFormDialog } from "./DatastoreFormDialog.js";
5
+ export function ProvisionDatastoreDialog(props) {
6
+ const { existingOrganizationNames, ...dialogProps } = props;
7
+ const [name, setName] = useState("");
8
+ const nameCheck = useTenantOrganizationCheck(dialogProps.target.kind === "organization" ? name : "", existingOrganizationNames);
9
+ return _jsx(DatastoreFormDialog, { ...dialogProps, onNameChange: setName, nameCheck: nameCheck });
10
+ }
@@ -14,10 +14,14 @@ export type DatastoreRow = {
14
14
  provisionedAt?: string;
15
15
  provisionedBy?: string;
16
16
  isOrganization: boolean;
17
+ mirrored?: boolean;
17
18
  isRealmDefault?: boolean;
18
19
  isUnlinked?: boolean;
19
20
  };
20
21
  export declare function realmDefaultRow(datastoreId: Realm): DatastoreRow;
22
+ export declare function isUnmirroredOrganization(row: DatastoreRow): boolean;
23
+ export type ProviderFilter = "ALL" | "mirrored" | "unmirrored";
24
+ export declare function matchesProviderFilter(row: DatastoreRow, filter: ProviderFilter): boolean;
21
25
  export type DatastoreRowVisibility = {
22
26
  showArchived: boolean;
23
27
  showUnprovisioned: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/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