@salesforce/webapp-template-app-react-sample-b2x-experimental 1.116.7 → 1.116.9

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 (53) hide show
  1. package/dist/CHANGELOG.md +16 -0
  2. package/dist/force-app/main/default/webapplications/propertyrentalapp/eslint.config.js +13 -2
  3. package/dist/force-app/main/default/webapplications/propertyrentalapp/package.json +3 -3
  4. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/graphql-operations-types.ts +24594 -7234
  5. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/maintenanceRequests/maintenanceRequestApi.ts +21 -157
  6. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/maintenanceRequests/query/maintenanceRequests.graphql +60 -0
  7. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/propertyDetailGraphQL.ts +45 -444
  8. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/propertyNodeUtils.ts +29 -0
  9. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/propertySearchService.ts +56 -0
  10. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/query/distinctPropertyStatus.graphql +19 -0
  11. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/query/distinctPropertyType.graphql +19 -0
  12. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/query/listingById.graphql +29 -0
  13. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/query/propertyAddressesByIds.graphql +17 -0
  14. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/query/propertyDetailById.graphql +124 -0
  15. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/query/searchProperties.graphql +85 -0
  16. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/appLayout.tsx +1 -1
  17. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/SkeletonPrimitives.tsx +9 -6
  18. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/dashboard/WeatherWidget.tsx +35 -19
  19. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/maintenanceRequests/MaintenanceRequestList.tsx +7 -5
  20. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/maintenanceRequests/MaintenanceRequestListItem.tsx +11 -10
  21. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/maintenanceRequests/MaintenanceSummaryDetailsModal.tsx +20 -15
  22. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/properties/PropertyListingCard.tsx +11 -24
  23. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/properties/PropertyMap.tsx +2 -1
  24. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/authentication/context/AuthContext.tsx +1 -1
  25. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/authentication/hooks/useCountdownTimer.ts +1 -1
  26. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/authentication/pages/Profile.tsx +3 -3
  27. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/authentication/pages/Register.tsx +1 -1
  28. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/authentication/sessionTimeout/SessionTimeoutValidator.tsx +12 -18
  29. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/object-search/components/FilterContext.tsx +1 -1
  30. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/features/object-search/hooks/useObjectSearchParams.ts +10 -5
  31. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/useGeocode.ts +23 -38
  32. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/useMaintenanceRequests.ts +29 -25
  33. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/usePropertyDetail.ts +42 -78
  34. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/usePropertyMapMarkers.ts +34 -41
  35. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/useWeather.ts +14 -30
  36. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/Application.tsx +41 -74
  37. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/Contact.tsx +44 -55
  38. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/Dashboard.tsx +1 -0
  39. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/Home.tsx +63 -32
  40. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/Maintenance.tsx +97 -8
  41. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/PropertyDetails.tsx +67 -45
  42. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/pages/PropertySearch.tsx +299 -191
  43. package/dist/package-lock.json +2 -2
  44. package/dist/package.json +1 -1
  45. package/package.json +4 -1
  46. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/properties/propertyListingGraphQL.ts +0 -380
  47. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/components/properties/PropertyListingSearchPagination.tsx +0 -136
  48. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/constants/propertyListing.ts +0 -4
  49. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/usePropertyAddresses.ts +0 -45
  50. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/usePropertyListingAmenities.ts +0 -57
  51. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/usePropertyListingSearch.ts +0 -84
  52. package/dist/force-app/main/default/webapplications/propertyrentalapp/src/hooks/usePropertyPrimaryImages.ts +0 -53
  53. /package/dist/force-app/main/default/webapplications/propertyrentalapp/src/api/{leadApi.ts → leads/leadApi.ts} +0 -0
@@ -1,84 +0,0 @@
1
- /**
2
- * Property Listing search via GraphQL. Optional text, price range, and bedrooms filters.
3
- */
4
- import { useState, useEffect, useRef, useCallback } from "react";
5
- import {
6
- queryPropertyListingsGraphQL,
7
- type PropertyListingFilters,
8
- } from "@/api/properties/propertyListingGraphQL";
9
- import type { SearchResultRecord } from "@/types/searchResults.js";
10
-
11
- export function usePropertyListingSearch(
12
- searchQuery: string,
13
- pageSize: number,
14
- pageToken: string,
15
- filters?: PropertyListingFilters,
16
- ) {
17
- const [results, setResults] = useState<SearchResultRecord[]>([]);
18
- const [nextPageToken, setNextPageToken] = useState<string | null>(null);
19
- const [previousPageToken, setPreviousPageToken] = useState<string | null>(null);
20
- const [loading, setLoading] = useState(true);
21
- const [error, setError] = useState<string | null>(null);
22
-
23
- const abortControllerRef = useRef<AbortController | null>(null);
24
- const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
25
-
26
- const fetchResults = useCallback(async () => {
27
- const ac = new AbortController();
28
- abortControllerRef.current = ac;
29
- setLoading(true);
30
- setError(null);
31
- try {
32
- const afterCursor = pageToken === "0" || pageToken === "" ? null : pageToken;
33
- const result = await queryPropertyListingsGraphQL(
34
- searchQuery,
35
- pageSize,
36
- afterCursor,
37
- ac.signal,
38
- filters,
39
- );
40
- if (ac.signal.aborted) return;
41
- setResults(result.records);
42
- setNextPageToken(result.nextPageToken);
43
- setPreviousPageToken(result.previousPageToken);
44
- } catch (err) {
45
- if (ac.signal.aborted || (err instanceof Error && err.name === "AbortError")) return;
46
- setError(err instanceof Error ? err.message : "Unable to load property listings");
47
- setResults([]);
48
- setNextPageToken(null);
49
- setPreviousPageToken(null);
50
- } finally {
51
- if (!ac.signal.aborted) setLoading(false);
52
- }
53
- }, [searchQuery, pageSize, pageToken, filters]);
54
-
55
- useEffect(() => {
56
- if (debounceRef.current) {
57
- clearTimeout(debounceRef.current);
58
- debounceRef.current = null;
59
- }
60
- if (abortControllerRef.current) {
61
- abortControllerRef.current.abort();
62
- }
63
-
64
- // When on first page, debounce to avoid firing on every keystroke
65
- if (pageToken === "0" || pageToken === "") {
66
- debounceRef.current = setTimeout(() => fetchResults(), 300);
67
- } else {
68
- fetchResults();
69
- }
70
- return () => {
71
- if (debounceRef.current) clearTimeout(debounceRef.current);
72
- abortControllerRef.current?.abort();
73
- };
74
- }, [searchQuery, pageSize, pageToken, fetchResults]);
75
-
76
- return {
77
- results,
78
- nextPageToken,
79
- previousPageToken,
80
- currentPageToken: pageToken === "" ? "0" : pageToken,
81
- resultsLoading: loading,
82
- resultsError: error,
83
- };
84
- }
@@ -1,53 +0,0 @@
1
- /**
2
- * Fetches primary image URL for each property id from search results.
3
- * Returns a map of propertyId -> imageUrl for use in listing cards.
4
- */
5
- import { useState, useEffect } from "react";
6
- import { fetchPrimaryImagesByPropertyIds } from "@/api/properties/propertyDetailGraphQL";
7
- import type { SearchResultRecord } from "@/types/searchResults.js";
8
-
9
- export function getPropertyIdFromRecord(record: {
10
- fields?: Record<string, { value?: unknown }>;
11
- }): string | null {
12
- const f = record.fields?.Property__c;
13
- if (!f || typeof f !== "object") return null;
14
- const v = (f as { value?: unknown }).value;
15
- return typeof v === "string" ? v : null;
16
- }
17
-
18
- export function usePropertyPrimaryImages(
19
- results: SearchResultRecord[],
20
- ): Record<string, string> & { loading: boolean } {
21
- const [map, setMap] = useState<Record<string, string>>({});
22
- const [fetchedKey, setFetchedKey] = useState("");
23
-
24
- const propertyIds = results
25
- .map((r) => r?.record && getPropertyIdFromRecord(r.record))
26
- .filter((id): id is string => Boolean(id));
27
- const idsKey = propertyIds.join(",");
28
- const loading = idsKey !== "" && idsKey !== fetchedKey;
29
-
30
- useEffect(() => {
31
- if (propertyIds.length === 0) {
32
- setMap({});
33
- setFetchedKey("");
34
- return;
35
- }
36
- let cancelled = false;
37
- fetchPrimaryImagesByPropertyIds(propertyIds)
38
- .then((next) => {
39
- if (!cancelled) setMap(next);
40
- })
41
- .catch(() => {
42
- if (!cancelled) setMap({});
43
- })
44
- .finally(() => {
45
- if (!cancelled) setFetchedKey(idsKey);
46
- });
47
- return () => {
48
- cancelled = true;
49
- };
50
- }, [idsKey]);
51
-
52
- return Object.assign(map, { loading });
53
- }