@schandlergarcia/sf-web-components 2.2.0 → 2.3.0

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 (61) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/brands/engine/app/api/graphql-operations-types.ts +11260 -0
  3. package/brands/engine/app/api/graphqlClient.ts +25 -0
  4. package/brands/engine/app/api/partnerQueries.ts +212 -0
  5. package/brands/engine/app/appLayout.tsx +13 -0
  6. package/brands/engine/app/components/AgentforceConversationClient.tsx +201 -0
  7. package/brands/engine/app/components/__inherit_AgentforceConversationClient.tsx +3 -0
  8. package/brands/engine/app/components/alerts/status-alert.tsx +49 -0
  9. package/brands/engine/app/components/layouts/card-layout.tsx +29 -0
  10. package/brands/engine/app/components/workspace/CommandCenter.tsx +16 -0
  11. package/brands/engine/app/config/agentApi.ts +36 -0
  12. package/brands/engine/app/features/object-search/__examples__/api/accountSearchService.ts +46 -0
  13. package/brands/engine/app/features/object-search/__examples__/api/query/distinctAccountIndustries.graphql +19 -0
  14. package/brands/engine/app/features/object-search/__examples__/api/query/distinctAccountTypes.graphql +19 -0
  15. package/brands/engine/app/features/object-search/__examples__/api/query/getAccountDetail.graphql +121 -0
  16. package/brands/engine/app/features/object-search/__examples__/api/query/searchAccounts.graphql +51 -0
  17. package/brands/engine/app/features/object-search/__examples__/pages/AccountObjectDetailPage.tsx +357 -0
  18. package/brands/engine/app/features/object-search/__examples__/pages/AccountSearch.tsx +312 -0
  19. package/brands/engine/app/features/object-search/__examples__/pages/Home.tsx +34 -0
  20. package/brands/engine/app/features/object-search/api/objectSearchService.ts +84 -0
  21. package/brands/engine/app/features/object-search/components/ActiveFilters.tsx +89 -0
  22. package/brands/engine/app/features/object-search/components/FilterContext.tsx +83 -0
  23. package/brands/engine/app/features/object-search/components/ObjectBreadcrumb.tsx +66 -0
  24. package/brands/engine/app/features/object-search/components/PaginationControls.tsx +109 -0
  25. package/brands/engine/app/features/object-search/components/SearchBar.tsx +41 -0
  26. package/brands/engine/app/features/object-search/components/SortControl.tsx +143 -0
  27. package/brands/engine/app/features/object-search/components/filters/BooleanFilter.tsx +78 -0
  28. package/brands/engine/app/features/object-search/components/filters/DateFilter.tsx +128 -0
  29. package/brands/engine/app/features/object-search/components/filters/DateRangeFilter.tsx +70 -0
  30. package/brands/engine/app/features/object-search/components/filters/FilterFieldWrapper.tsx +33 -0
  31. package/brands/engine/app/features/object-search/components/filters/MultiSelectFilter.tsx +97 -0
  32. package/brands/engine/app/features/object-search/components/filters/NumericRangeFilter.tsx +163 -0
  33. package/brands/engine/app/features/object-search/components/filters/SearchFilter.tsx +50 -0
  34. package/brands/engine/app/features/object-search/components/filters/SelectFilter.tsx +97 -0
  35. package/brands/engine/app/features/object-search/components/filters/TextFilter.tsx +91 -0
  36. package/brands/engine/app/features/object-search/hooks/useAsyncData.ts +54 -0
  37. package/brands/engine/app/features/object-search/hooks/useCachedAsyncData.ts +184 -0
  38. package/brands/engine/app/features/object-search/hooks/useDebouncedCallback.ts +34 -0
  39. package/brands/engine/app/features/object-search/hooks/useObjectSearchParams.ts +252 -0
  40. package/brands/engine/app/features/object-search/utils/debounce.ts +25 -0
  41. package/brands/engine/app/features/object-search/utils/fieldUtils.ts +29 -0
  42. package/brands/engine/app/features/object-search/utils/filterUtils.ts +404 -0
  43. package/brands/engine/app/features/object-search/utils/sortUtils.ts +38 -0
  44. package/brands/engine/app/hooks/useEngineLiveData.ts +49 -0
  45. package/brands/engine/app/hooks/useEvaAgent.ts +288 -0
  46. package/brands/engine/app/hooks/usePartnerDashboardData.ts +141 -0
  47. package/brands/engine/app/navigationMenu.tsx +80 -0
  48. package/brands/engine/app/pages/AccountObjectDetailPage.tsx +361 -0
  49. package/brands/engine/app/pages/AccountSearch.tsx +305 -0
  50. package/brands/engine/app/pages/BlankDashboard.tsx +15 -0
  51. package/brands/engine/app/pages/DataTest.tsx +78 -0
  52. package/brands/engine/app/pages/Home.tsx +5 -0
  53. package/brands/engine/app/pages/NotFound.tsx +19 -0
  54. package/brands/engine/app/pages/PartnerHubDashboard.tsx +2010 -0
  55. package/brands/engine/app/pages/Search.tsx +13 -0
  56. package/brands/engine/app/router-utils.tsx +35 -0
  57. package/brands/engine/app/routes.tsx +39 -0
  58. package/brands/engine/app/styles/global.css +270 -0
  59. package/package.json +1 -1
  60. package/scripts/apply-brand.mjs +159 -76
  61. package/scripts/postinstall.mjs +24 -5
@@ -0,0 +1,78 @@
1
+ import { createDataSDK, gql } from "@salesforce/sdk-data";
2
+ import { useEffect, useState } from "react";
3
+
4
+ const GET_CURRENT_USER = gql`
5
+ query GetCurrentUser {
6
+ uiapi {
7
+ currentUser {
8
+ Id
9
+ Name @optional { value }
10
+ Email @optional { value }
11
+ }
12
+ }
13
+ }
14
+ `;
15
+
16
+ export default function DataTest() {
17
+ const [status, setStatus] = useState("Loading...");
18
+ const [user, setUser] = useState<any>(null);
19
+ const [error, setError] = useState<any>(null);
20
+
21
+ useEffect(() => {
22
+ async function test() {
23
+ try {
24
+ console.log("Creating Data SDK...");
25
+ const sdk = await createDataSDK();
26
+ console.log("SDK created:", sdk);
27
+
28
+ console.log("Executing GraphQL query...");
29
+ const response = await sdk.graphql?.(GET_CURRENT_USER);
30
+ console.log("Response:", response);
31
+
32
+ if (response?.errors?.length) {
33
+ throw new Error(JSON.stringify(response.errors, null, 2));
34
+ }
35
+
36
+ const userData = response?.data?.uiapi?.currentUser;
37
+ console.log("User data:", userData);
38
+ setUser(userData);
39
+ setStatus("Success!");
40
+ } catch (err: any) {
41
+ console.error("Error:", err);
42
+ setError(err);
43
+ setStatus("Error - check console");
44
+ }
45
+ }
46
+
47
+ test();
48
+ }, []);
49
+
50
+ return (
51
+ <div style={{ padding: "2rem", fontFamily: "monospace" }}>
52
+ <h1>Data SDK Test</h1>
53
+ <div style={{ marginTop: "1rem" }}>
54
+ <strong>Status:</strong> {status}
55
+ </div>
56
+
57
+ {user && (
58
+ <div style={{ marginTop: "1rem", background: "#e8f5e9", padding: "1rem", borderRadius: "4px" }}>
59
+ <strong>Current User:</strong>
60
+ <pre>{JSON.stringify(user, null, 2)}</pre>
61
+ </div>
62
+ )}
63
+
64
+ {error && (
65
+ <div style={{ marginTop: "1rem", background: "#ffebee", padding: "1rem", borderRadius: "4px" }}>
66
+ <strong>Error:</strong>
67
+ <pre>{error.toString()}</pre>
68
+ {error.stack && <pre style={{ fontSize: "0.8em", marginTop: "0.5rem" }}>{error.stack}</pre>}
69
+ </div>
70
+ )}
71
+
72
+ <div style={{ marginTop: "2rem", fontSize: "0.9em", color: "#666" }}>
73
+ <p>Check browser console for detailed logs</p>
74
+ <p>Expected: Current user info from Salesforce org</p>
75
+ </div>
76
+ </div>
77
+ );
78
+ }
@@ -0,0 +1,5 @@
1
+ import CommandCenter from "@/components/workspace/CommandCenter";
2
+
3
+ export default function HomePage() {
4
+ return <CommandCenter />;
5
+ }
@@ -0,0 +1,19 @@
1
+ import { useNavigate } from "react-router";
2
+ import { Button } from "@/components/ui/button";
3
+
4
+ export default function NotFound() {
5
+ const navigate = useNavigate();
6
+
7
+ return (
8
+ <div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8">
9
+ <div className="w-full max-w-2xl text-center">
10
+ <h1 className="text-6xl font-bold text-slate-900 dark:text-slate-50 mb-4">404</h1>
11
+ <h2 className="text-2xl font-semibold text-slate-700 dark:text-slate-300 mb-4">Page Not Found</h2>
12
+ <p className="text-lg text-slate-600 dark:text-slate-400 mb-8">
13
+ The page you're looking for doesn't exist.
14
+ </p>
15
+ <Button onClick={() => navigate("/")}>Go Home</Button>
16
+ </div>
17
+ </div>
18
+ );
19
+ }