@salesforce/templates 66.3.0 → 66.3.2

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 (329) hide show
  1. package/lib/templates/flexipage/RecordPage/_flexipage.flexipage-meta.xml +0 -24
  2. package/lib/templates/project/reactb2e/.a4drules/{graphql.md → features/feature-graphql-graphql-data-access-rule.md} +186 -125
  3. package/lib/templates/project/reactb2e/.a4drules/features/feature-react-agentforce-conversation-client-embedded-agent-rule.md +32 -0
  4. package/lib/templates/project/reactb2e/.a4drules/features/feature-react-chart-analytics-charts-rule.md +27 -0
  5. package/lib/templates/project/reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/SKILL.md +155 -0
  6. package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/explore-schema.md} +58 -29
  7. package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-mutation-query.md} +52 -42
  8. package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-read-query.md} +32 -22
  9. package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/schemas/shared.graphqls → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/shared-schema.graphqls} +1 -1
  10. package/lib/templates/project/reactb2e/.a4drules/skills/feature-micro-frontend-micro-frontend/SKILL.md +137 -0
  11. package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/SKILL.md +108 -0
  12. package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/docs/embed-examples.md +182 -0
  13. package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-chart-analytics-charts/SKILL.md +41 -0
  14. package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-chart-analytics-charts/docs/schema-mapping.md +4 -0
  15. package/lib/templates/project/reactb2e/.a4drules/webapp-code-quality.md +136 -0
  16. package/lib/templates/project/reactb2e/.a4drules/{images.md → webapp-images.md} +6 -4
  17. package/lib/templates/project/reactb2e/.a4drules/webapp-no-node-e.md +3 -2
  18. package/lib/templates/project/reactb2e/.a4drules/webapp-react.md +149 -0
  19. package/lib/templates/project/reactb2e/.a4drules/{typescript.md → webapp-typescript.md} +10 -29
  20. package/lib/templates/project/reactb2e/.a4drules/webapp.md +60 -45
  21. package/lib/templates/project/reactb2e/AGENT.md +1 -1
  22. package/lib/templates/project/reactb2e/CHANGELOG.md +377 -0
  23. package/lib/templates/project/reactb2e/README.md +38 -4
  24. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/CHANGELOG.md +10 -0
  25. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/README.md +35 -0
  26. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/package.json +17 -7
  27. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/appLayout.tsx +76 -10
  28. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/__inherit_AgentforceConversationClient.tsx +3 -0
  29. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/alerts/status-alert.tsx +49 -0
  30. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/layouts/card-layout.tsx +29 -0
  31. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/alert.tsx +76 -0
  32. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/button.tsx +67 -0
  33. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/card.tsx +103 -0
  34. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/dialog.tsx +162 -0
  35. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/field.tsx +237 -0
  36. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/index.ts +84 -0
  37. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/input.tsx +19 -0
  38. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/label.tsx +22 -0
  39. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/pagination.tsx +132 -0
  40. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/select.tsx +193 -0
  41. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/separator.tsx +26 -0
  42. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/skeleton.tsx +14 -0
  43. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/spinner.tsx +16 -0
  44. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/table.tsx +114 -0
  45. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/tabs.tsx +88 -0
  46. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components.json +18 -0
  47. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/constants.ts +39 -0
  48. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/index.ts +19 -0
  49. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/objectDetailService.ts +125 -0
  50. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/objectInfoGraphQLService.ts +194 -0
  51. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/objectInfoService.ts +199 -0
  52. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/recordListGraphQLService.ts +365 -0
  53. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailFields.tsx +55 -0
  54. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailForm.tsx +146 -0
  55. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailHeader.tsx +34 -0
  56. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailLayoutSections.tsx +80 -0
  57. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/Section.tsx +108 -0
  58. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/SectionRow.tsx +20 -0
  59. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/UiApiDetailForm.tsx +140 -0
  60. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FieldValueDisplay.tsx +73 -0
  61. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedAddress.tsx +29 -0
  62. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedEmail.tsx +17 -0
  63. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedPhone.tsx +24 -0
  64. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedText.tsx +11 -0
  65. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedUrl.tsx +29 -0
  66. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/index.ts +6 -0
  67. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FilterField.tsx +54 -0
  68. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FilterInput.tsx +55 -0
  69. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FilterSelect.tsx +72 -0
  70. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FiltersPanel.tsx +380 -0
  71. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/forms/filters-form.tsx +114 -0
  72. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/forms/submit-button.tsx +47 -0
  73. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/GlobalSearchInput.tsx +114 -0
  74. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/ResultCardFields.tsx +71 -0
  75. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchHeader.tsx +31 -0
  76. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchPagination.tsx +144 -0
  77. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchResultCard.tsx +136 -0
  78. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchResultsPanel.tsx +197 -0
  79. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/shared/LoadingFallback.tsx +61 -0
  80. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/filters/FilterInput.tsx +55 -0
  81. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/filters/FilterSelect.tsx +72 -0
  82. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/form.tsx +209 -0
  83. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/index.ts +22 -0
  84. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useObjectInfoBatch.ts +65 -0
  85. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useObjectSearchData.ts +395 -0
  86. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useRecordDetailLayout.ts +156 -0
  87. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useRecordListGraphQL.ts +135 -0
  88. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/pages/DetailPage.tsx +109 -0
  89. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/pages/GlobalSearch.tsx +229 -0
  90. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/filters/filters.ts +120 -0
  91. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/filters/picklist.ts +32 -0
  92. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/index.ts +4 -0
  93. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/objectInfo/objectInfo.ts +166 -0
  94. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/recordDetail/recordDetail.ts +61 -0
  95. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/search/searchResults.ts +229 -0
  96. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/apiUtils.ts +125 -0
  97. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/cacheUtils.ts +76 -0
  98. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/debounce.ts +89 -0
  99. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/fieldUtils.ts +354 -0
  100. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/fieldValueExtractor.ts +67 -0
  101. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/filterUtils.ts +32 -0
  102. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/formDataTransformUtils.ts +260 -0
  103. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/formUtils.ts +142 -0
  104. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/graphQLNodeFieldUtils.ts +186 -0
  105. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/graphQLObjectInfoAdapter.ts +319 -0
  106. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/graphQLRecordAdapter.ts +90 -0
  107. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/index.ts +59 -0
  108. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/layoutTransformUtils.ts +236 -0
  109. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/linkUtils.ts +14 -0
  110. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/paginationUtils.ts +49 -0
  111. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/recordUtils.ts +159 -0
  112. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/sanitizationUtils.ts +49 -0
  113. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/lib/utils.ts +6 -0
  114. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Home.tsx +11 -10
  115. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/TestAccPage.tsx +19 -0
  116. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/routes.tsx +28 -0
  117. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/styles/global.css +122 -0
  118. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/vite.config.ts +2 -1
  119. package/lib/templates/project/reactb2e/package.json +1 -1
  120. package/lib/templates/project/reactb2x/.a4drules/{graphql.md → features/feature-graphql-graphql-data-access-rule.md} +186 -125
  121. package/lib/templates/project/reactb2x/.a4drules/features/feature-react-agentforce-conversation-client-embedded-agent-rule.md +32 -0
  122. package/lib/templates/project/reactb2x/.a4drules/features/feature-react-chart-analytics-charts-rule.md +27 -0
  123. package/lib/templates/project/reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/SKILL.md +155 -0
  124. package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/explore-schema.md} +58 -29
  125. package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-mutation-query.md} +52 -42
  126. package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-read-query.md} +32 -22
  127. package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/schemas/shared.graphqls → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/shared-schema.graphqls} +1 -1
  128. package/lib/templates/project/reactb2x/.a4drules/skills/feature-micro-frontend-micro-frontend/SKILL.md +137 -0
  129. package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/SKILL.md +108 -0
  130. package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/docs/embed-examples.md +182 -0
  131. package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-chart-analytics-charts/SKILL.md +41 -0
  132. package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-chart-analytics-charts/docs/schema-mapping.md +4 -0
  133. package/lib/templates/project/reactb2x/.a4drules/webapp-code-quality.md +136 -0
  134. package/lib/templates/project/reactb2x/.a4drules/{images.md → webapp-images.md} +6 -4
  135. package/lib/templates/project/reactb2x/.a4drules/webapp-no-node-e.md +3 -2
  136. package/lib/templates/project/reactb2x/.a4drules/webapp-react.md +149 -0
  137. package/lib/templates/project/reactb2x/.a4drules/{typescript.md → webapp-typescript.md} +10 -29
  138. package/lib/templates/project/reactb2x/.a4drules/webapp.md +60 -45
  139. package/lib/templates/project/reactb2x/AGENT.md +1 -1
  140. package/lib/templates/project/reactb2x/CHANGELOG.md +377 -0
  141. package/lib/templates/project/reactb2x/README.md +58 -4
  142. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/CHANGELOG.md +10 -0
  143. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/README.md +35 -0
  144. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/package.json +8 -7
  145. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/appLayout.tsx +75 -3
  146. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/alerts/status-alert.tsx +36 -32
  147. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layouts/card-layout.tsx +29 -0
  148. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/alert.tsx +61 -54
  149. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/button.tsx +57 -57
  150. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/card.tsx +86 -75
  151. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/dialog.tsx +129 -110
  152. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/field.tsx +208 -193
  153. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/index.ts +65 -53
  154. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/input.tsx +14 -14
  155. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/label.tsx +17 -14
  156. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/pagination.tsx +108 -88
  157. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/select.tsx +156 -146
  158. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/separator.tsx +19 -19
  159. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/skeleton.tsx +10 -10
  160. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/spinner.tsx +12 -11
  161. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/table.tsx +96 -69
  162. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/tabs.tsx +71 -61
  163. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components.json +1 -1
  164. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/constants.ts +39 -0
  165. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{context → features/authentication/context}/AuthContext.tsx +1 -1
  166. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/footers/footer-link.tsx +1 -1
  167. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/forms/auth-form.tsx +4 -4
  168. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/forms/submit-button.tsx +4 -4
  169. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{hooks → features/authentication/hooks}/form.tsx +13 -9
  170. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/layout/card-skeleton.tsx +2 -2
  171. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/layout/centered-page-layout.tsx +2 -3
  172. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{layouts → features/authentication/layouts}/AuthAppLayout.tsx +2 -2
  173. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication/layouts}/authenticationRouteLayout.tsx +2 -2
  174. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication/layouts}/privateRouteLayout.tsx +2 -2
  175. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/ChangePassword.tsx +6 -6
  176. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/ForgotPassword.tsx +5 -5
  177. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/Login.tsx +6 -6
  178. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/Profile.tsx +22 -13
  179. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/Register.tsx +6 -11
  180. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/ResetPassword.tsx +8 -8
  181. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/sessionTimeout/SessionTimeoutValidator.tsx +6 -6
  182. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/index.ts +19 -0
  183. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/objectDetailService.ts +125 -0
  184. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/objectInfoGraphQLService.ts +194 -0
  185. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/objectInfoService.ts +199 -0
  186. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/recordListGraphQLService.ts +365 -0
  187. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailFields.tsx +55 -0
  188. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailForm.tsx +146 -0
  189. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailHeader.tsx +34 -0
  190. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailLayoutSections.tsx +80 -0
  191. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/Section.tsx +108 -0
  192. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/SectionRow.tsx +20 -0
  193. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/UiApiDetailForm.tsx +140 -0
  194. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FieldValueDisplay.tsx +73 -0
  195. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedAddress.tsx +29 -0
  196. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedEmail.tsx +17 -0
  197. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedPhone.tsx +24 -0
  198. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedText.tsx +11 -0
  199. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedUrl.tsx +29 -0
  200. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/index.ts +6 -0
  201. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FilterField.tsx +54 -0
  202. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FilterInput.tsx +55 -0
  203. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FilterSelect.tsx +72 -0
  204. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FiltersPanel.tsx +380 -0
  205. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/forms/filters-form.tsx +114 -0
  206. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/forms/submit-button.tsx +47 -0
  207. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/GlobalSearchInput.tsx +114 -0
  208. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/ResultCardFields.tsx +71 -0
  209. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchHeader.tsx +31 -0
  210. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchPagination.tsx +144 -0
  211. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchResultCard.tsx +136 -0
  212. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchResultsPanel.tsx +197 -0
  213. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/shared/LoadingFallback.tsx +61 -0
  214. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/filters/FilterInput.tsx +55 -0
  215. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/filters/FilterSelect.tsx +72 -0
  216. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/form.tsx +209 -0
  217. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/index.ts +22 -0
  218. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useObjectInfoBatch.ts +65 -0
  219. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useObjectSearchData.ts +395 -0
  220. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useRecordDetailLayout.ts +156 -0
  221. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useRecordListGraphQL.ts +135 -0
  222. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/pages/DetailPage.tsx +109 -0
  223. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/pages/GlobalSearch.tsx +229 -0
  224. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/filters/filters.ts +120 -0
  225. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/filters/picklist.ts +32 -0
  226. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/index.ts +4 -0
  227. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/objectInfo/objectInfo.ts +166 -0
  228. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/recordDetail/recordDetail.ts +61 -0
  229. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/search/searchResults.ts +229 -0
  230. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/apiUtils.ts +125 -0
  231. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/cacheUtils.ts +76 -0
  232. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/debounce.ts +89 -0
  233. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/fieldUtils.ts +354 -0
  234. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/fieldValueExtractor.ts +67 -0
  235. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/filterUtils.ts +32 -0
  236. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/formDataTransformUtils.ts +260 -0
  237. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/formUtils.ts +142 -0
  238. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/graphQLNodeFieldUtils.ts +186 -0
  239. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/graphQLObjectInfoAdapter.ts +319 -0
  240. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/graphQLRecordAdapter.ts +90 -0
  241. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/index.ts +59 -0
  242. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/layoutTransformUtils.ts +236 -0
  243. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/linkUtils.ts +14 -0
  244. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/paginationUtils.ts +49 -0
  245. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/recordUtils.ts +159 -0
  246. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/sanitizationUtils.ts +49 -0
  247. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/utils.ts +3 -3
  248. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Home.tsx +11 -10
  249. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/routes.tsx +33 -11
  250. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/styles/global.css +107 -107
  251. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/vite.config.ts +2 -1
  252. package/lib/templates/project/reactb2x/package.json +1 -1
  253. package/lib/templates/webapplication/reactbasic/CHANGELOG.md +10 -0
  254. package/lib/templates/webapplication/reactbasic/README.md +75 -0
  255. package/lib/templates/webapplication/reactbasic/package.json +13 -5
  256. package/lib/templates/webapplication/reactbasic/src/appLayout.tsx +75 -3
  257. package/lib/templates/webapplication/reactbasic/src/components/alerts/status-alert.tsx +49 -0
  258. package/lib/templates/webapplication/reactbasic/src/components/layouts/card-layout.tsx +29 -0
  259. package/lib/templates/webapplication/reactbasic/src/components/ui/alert.tsx +76 -0
  260. package/lib/templates/webapplication/reactbasic/src/components/ui/button.tsx +67 -0
  261. package/lib/templates/webapplication/reactbasic/src/components/ui/card.tsx +103 -0
  262. package/lib/templates/webapplication/reactbasic/src/components/ui/dialog.tsx +162 -0
  263. package/lib/templates/webapplication/reactbasic/src/components/ui/field.tsx +237 -0
  264. package/lib/templates/webapplication/reactbasic/src/components/ui/index.ts +84 -0
  265. package/lib/templates/webapplication/reactbasic/src/components/ui/input.tsx +19 -0
  266. package/lib/templates/webapplication/reactbasic/src/components/ui/label.tsx +22 -0
  267. package/lib/templates/webapplication/reactbasic/src/components/ui/pagination.tsx +132 -0
  268. package/lib/templates/webapplication/reactbasic/src/components/ui/select.tsx +193 -0
  269. package/lib/templates/webapplication/reactbasic/src/components/ui/separator.tsx +26 -0
  270. package/lib/templates/webapplication/reactbasic/src/components/ui/skeleton.tsx +14 -0
  271. package/lib/templates/webapplication/reactbasic/src/components/ui/spinner.tsx +16 -0
  272. package/lib/templates/webapplication/reactbasic/src/components/ui/table.tsx +114 -0
  273. package/lib/templates/webapplication/reactbasic/src/components/ui/tabs.tsx +88 -0
  274. package/lib/templates/webapplication/reactbasic/src/components.json +18 -0
  275. package/lib/templates/webapplication/reactbasic/src/lib/utils.ts +6 -0
  276. package/lib/templates/webapplication/reactbasic/src/styles/global.css +122 -0
  277. package/lib/templates/webapplication/reactbasic/vite.config.ts +2 -1
  278. package/lib/templates/webapplication/webappbasic/README.md +15 -0
  279. package/lib/utils/webappTemplateUtils.d.ts +10 -0
  280. package/lib/utils/webappTemplateUtils.js +55 -7
  281. package/lib/utils/webappTemplateUtils.js.map +1 -1
  282. package/package.json +5 -5
  283. package/lib/templates/project/reactb2e/.a4drules/README.md +0 -35
  284. package/lib/templates/project/reactb2e/.a4drules/a4d-webapp-generate.md +0 -27
  285. package/lib/templates/project/reactb2e/.a4drules/build-validation.md +0 -78
  286. package/lib/templates/project/reactb2e/.a4drules/code-quality.md +0 -137
  287. package/lib/templates/project/reactb2e/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +0 -205
  288. package/lib/templates/project/reactb2e/.a4drules/react.md +0 -387
  289. package/lib/templates/project/reactb2e/.a4drules/react_image_processing.md +0 -45
  290. package/lib/templates/project/reactb2e/.a4drules/ui-layout.md +0 -23
  291. package/lib/templates/project/reactb2e/.a4drules/webapp-nav-and-placeholders.md +0 -33
  292. package/lib/templates/project/reactb2e/.a4drules/webapp-ui-first.md +0 -32
  293. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.d.ts +0 -2
  294. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.js +0 -93
  295. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/package-lock.json +0 -14392
  296. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/graphql-operations-types.ts +0 -116
  297. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/accounts.ts +0 -33
  298. package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/query/highRevenueAccountsQuery.graphql +0 -29
  299. package/lib/templates/project/reactb2x/.a4drules/README.md +0 -35
  300. package/lib/templates/project/reactb2x/.a4drules/a4d-webapp-generate.md +0 -27
  301. package/lib/templates/project/reactb2x/.a4drules/build-validation.md +0 -78
  302. package/lib/templates/project/reactb2x/.a4drules/code-quality.md +0 -137
  303. package/lib/templates/project/reactb2x/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +0 -205
  304. package/lib/templates/project/reactb2x/.a4drules/react.md +0 -387
  305. package/lib/templates/project/reactb2x/.a4drules/react_image_processing.md +0 -45
  306. package/lib/templates/project/reactb2x/.a4drules/ui-layout.md +0 -23
  307. package/lib/templates/project/reactb2x/.a4drules/webapp-nav-and-placeholders.md +0 -33
  308. package/lib/templates/project/reactb2x/.a4drules/webapp-ui-first.md +0 -32
  309. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.d.ts +0 -2
  310. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.js +0 -93
  311. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/package-lock.json +0 -18408
  312. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/graphql-operations-types.ts +0 -116
  313. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/accounts.ts +0 -33
  314. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/query/highRevenueAccountsQuery.graphql +0 -29
  315. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/card-layout.tsx +0 -23
  316. package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/data-sdk.ts +0 -21
  317. package/lib/templates/webapplication/reactbasic/build/vite.config.d.ts +0 -2
  318. package/lib/templates/webapplication/reactbasic/build/vite.config.js +0 -93
  319. package/lib/templates/webapplication/reactbasic/package-lock.json +0 -14373
  320. package/lib/templates/webapplication/reactbasic/src/api/graphql-operations-types.ts +0 -116
  321. package/lib/templates/webapplication/reactbasic/src/api/utils/accounts.ts +0 -33
  322. package/lib/templates/webapplication/reactbasic/src/api/utils/query/highRevenueAccountsQuery.graphql +0 -29
  323. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/authHelpers.ts +0 -0
  324. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/authenticationConfig.ts +0 -0
  325. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{hooks → features/authentication/hooks}/useCountdownTimer.ts +0 -0
  326. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{hooks → features/authentication/hooks}/useRetryWithBackoff.ts +0 -0
  327. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/sessionTimeout/sessionTimeService.ts +0 -0
  328. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/sessionTimeout/sessionTimeoutConfig.ts +0 -0
  329. /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{utils → features/authentication/utils}/helpers.ts +0 -0
@@ -0,0 +1,354 @@
1
+ /**
2
+ * Field value extraction and formatting for Salesforce UI API record shapes.
3
+ * Handles primitives, nested paths (e.g. Owner.Alias), reference/relationship display,
4
+ * address and modstamp compound formatting, and layout-item value clubbing.
5
+ */
6
+
7
+ import type { FieldValue, ComplexFieldValue } from "../types/search/searchResults";
8
+
9
+ /** Fallback field names for reference/relationship display when object info nameFields are not available. */
10
+ const DISPLAY_FIELD_CANDIDATES = [
11
+ "Name",
12
+ "CaseNumber",
13
+ "Subject",
14
+ "Title",
15
+ "DeveloperName",
16
+ "ContractNumber",
17
+ ] as const;
18
+
19
+ function isDefined(val: unknown): val is string | number | boolean {
20
+ return val !== null && val !== undefined;
21
+ }
22
+
23
+ function isComplexValue(val: unknown): val is ComplexFieldValue {
24
+ return typeof val === "object" && val !== null && "fields" in val;
25
+ }
26
+
27
+ function extractComplexValue(complex: ComplexFieldValue): string | null {
28
+ const fields = complex.fields;
29
+ if (!fields) return null;
30
+
31
+ for (const fieldName of DISPLAY_FIELD_CANDIDATES) {
32
+ const field = fields[fieldName];
33
+ if (field) {
34
+ if (isDefined(field.displayValue)) {
35
+ return field.displayValue;
36
+ }
37
+ if (isDefined(field.value)) {
38
+ return field.value.toString();
39
+ }
40
+ }
41
+ }
42
+
43
+ return null;
44
+ }
45
+
46
+ function extractFieldPrimitive(field: FieldValue): string | number | boolean | null {
47
+ if (isDefined(field.displayValue)) {
48
+ return field.displayValue;
49
+ }
50
+
51
+ if (isComplexValue(field.value)) {
52
+ const extracted = extractComplexValue(field.value);
53
+ return extracted !== null ? extracted : null;
54
+ }
55
+
56
+ if (isDefined(field.value)) {
57
+ return field.value;
58
+ }
59
+
60
+ return null;
61
+ }
62
+
63
+ export type FieldValueWithRelationship = FieldValue & {
64
+ relationshipField?: FieldValue | null;
65
+ constituents?: Record<string, FieldValue>;
66
+ };
67
+
68
+ /** Id + Date pairs for Created By / Last Modified By (UI API modstamp convention). */
69
+ const MODSTAMP_FIELDS = [
70
+ { idFieldName: "CreatedById", dateFieldName: "CreatedDate" },
71
+ { idFieldName: "LastModifiedById", dateFieldName: "LastModifiedDate" },
72
+ ] as const;
73
+
74
+ function isModstampConstituents(constituents: Record<string, FieldValue>): boolean {
75
+ return MODSTAMP_FIELDS.some(
76
+ ({ idFieldName, dateFieldName }) =>
77
+ idFieldName in constituents && dateFieldName in constituents,
78
+ );
79
+ }
80
+
81
+ /**
82
+ * Formats an ISO 8601 date-time string to the user's locale and timezone.
83
+ * Uses the browser's default locale and local timezone.
84
+ */
85
+ export function formatDateTimeForDisplay(isoOrDateString: string): string {
86
+ if (!isoOrDateString || typeof isoOrDateString !== "string") return isoOrDateString;
87
+ const trimmed = isoOrDateString.trim();
88
+ if (!trimmed) return isoOrDateString;
89
+ const date = new Date(trimmed);
90
+ if (Number.isNaN(date.getTime())) return isoOrDateString;
91
+ try {
92
+ return new Intl.DateTimeFormat(undefined, {
93
+ dateStyle: "medium",
94
+ timeStyle: "short",
95
+ }).format(date);
96
+ } catch {
97
+ return isoOrDateString;
98
+ }
99
+ }
100
+
101
+ function formatModstampDisplay(constituents: Record<string, FieldValue>): string {
102
+ for (const { idFieldName, dateFieldName } of MODSTAMP_FIELDS) {
103
+ const idField = constituents[idFieldName];
104
+ const dateField = constituents[dateFieldName];
105
+ if (!idField || !dateField) continue;
106
+ const idWithRel = idField as FieldValueWithRelationship;
107
+ const name =
108
+ idWithRel.relationshipField != null
109
+ ? getPrimitiveString(idWithRel.relationshipField)
110
+ : getPrimitiveString(idField);
111
+ const dateRaw = getPrimitiveString(dateField);
112
+ const date = dateRaw ? formatDateTimeForDisplay(dateRaw) : "";
113
+ const parts = [name, date].filter(Boolean);
114
+ if (parts.length) return parts.join(" ");
115
+ }
116
+ return "";
117
+ }
118
+
119
+ const ADDRESS_STREET_SUFFIXES = ["Street"];
120
+ const ADDRESS_CITY_SUFFIXES = ["City"];
121
+ const ADDRESS_STATE_SUFFIXES = ["State", "StateCode"];
122
+ const ADDRESS_POSTAL_SUFFIXES = ["PostalCode"];
123
+ const ADDRESS_COUNTRY_SUFFIXES = ["Country", "CountryCode"];
124
+
125
+ function getPrimitiveString(fv: FieldValue | undefined): string {
126
+ if (!fv) return "";
127
+ const p = extractFieldPrimitive(fv);
128
+ return ((p as string) || "").trim();
129
+ }
130
+
131
+ function fieldNameEndsWithOneOf(name: string, suffixes: string[]): boolean {
132
+ return suffixes.some(
133
+ (s) =>
134
+ name === s || name.endsWith(s) || (name.endsWith("__c") && name.slice(0, -3).endsWith(s)),
135
+ );
136
+ }
137
+
138
+ function findAddressPartKey(keys: string[], suffixes: string[]): string | undefined {
139
+ return keys.find((k) => fieldNameEndsWithOneOf(k, suffixes));
140
+ }
141
+
142
+ export interface AddressParts {
143
+ street: string;
144
+ city: string;
145
+ state: string;
146
+ postalCode: string;
147
+ country: string;
148
+ }
149
+
150
+ export function getAddressPartsFromConstituents(
151
+ constituents: Record<string, FieldValue>,
152
+ ): AddressParts {
153
+ const keys = Object.keys(constituents);
154
+ const streetKey = findAddressPartKey(keys, ADDRESS_STREET_SUFFIXES);
155
+ const cityKey = findAddressPartKey(keys, ADDRESS_CITY_SUFFIXES);
156
+ const stateKey = findAddressPartKey(keys, ADDRESS_STATE_SUFFIXES);
157
+ const postalKey = findAddressPartKey(keys, ADDRESS_POSTAL_SUFFIXES);
158
+ const countryKey = findAddressPartKey(keys, ADDRESS_COUNTRY_SUFFIXES);
159
+ return {
160
+ street: streetKey ? getPrimitiveString(constituents[streetKey]) : "",
161
+ city: cityKey ? getPrimitiveString(constituents[cityKey]) : "",
162
+ state: stateKey ? getPrimitiveString(constituents[stateKey]) : "",
163
+ postalCode: postalKey ? getPrimitiveString(constituents[postalKey]) : "",
164
+ country: countryKey ? getPrimitiveString(constituents[countryKey]) : "",
165
+ };
166
+ }
167
+
168
+ export function isAddressConstituents(constituents: Record<string, FieldValue>): boolean {
169
+ const keys = Object.keys(constituents);
170
+ const hasStreet = !!findAddressPartKey(keys, ADDRESS_STREET_SUFFIXES);
171
+ const hasCity = !!findAddressPartKey(keys, ADDRESS_CITY_SUFFIXES);
172
+ const hasState = !!findAddressPartKey(keys, ADDRESS_STATE_SUFFIXES);
173
+ const hasCountry = !!findAddressPartKey(keys, ADDRESS_COUNTRY_SUFFIXES);
174
+ return hasStreet && (hasCity || hasState || hasCountry);
175
+ }
176
+
177
+ export function formatAddressDisplay(parts: AddressParts): string {
178
+ const { street, city, state, postalCode, country } = parts;
179
+ const statePostal = [state, postalCode].filter(Boolean).join(" ");
180
+ const line2 = city ? (statePostal ? `${city}, ${statePostal}` : city) : statePostal;
181
+ const lines = [street, line2, country].filter(Boolean);
182
+ return lines.join("\n").trim();
183
+ }
184
+
185
+ export function formatAddressFromConstituents(constituents: Record<string, FieldValue>): string {
186
+ const parts = getAddressPartsFromConstituents(constituents);
187
+ return formatAddressDisplay(parts);
188
+ }
189
+
190
+ function isModstampApiNames(apiNames: string[]): boolean {
191
+ return MODSTAMP_FIELDS.some(
192
+ ({ idFieldName, dateFieldName }) =>
193
+ apiNames.includes(idFieldName) && apiNames.includes(dateFieldName),
194
+ );
195
+ }
196
+
197
+ function isAddressApiNames(apiNames: string[]): boolean {
198
+ const hasStreet = apiNames.some((n) => fieldNameEndsWithOneOf(n, ADDRESS_STREET_SUFFIXES));
199
+ const hasCity = apiNames.some((n) => fieldNameEndsWithOneOf(n, ADDRESS_CITY_SUFFIXES));
200
+ const hasState = apiNames.some((n) => fieldNameEndsWithOneOf(n, ADDRESS_STATE_SUFFIXES));
201
+ const hasCountry = apiNames.some((n) => fieldNameEndsWithOneOf(n, ADDRESS_COUNTRY_SUFFIXES));
202
+ return hasStreet && (hasCity || hasState || hasCountry);
203
+ }
204
+
205
+ export interface LayoutItemDisplayResult {
206
+ value: string | number | boolean | null;
207
+ dataType?: string;
208
+ }
209
+
210
+ export function getDisplayValueForLayoutItem(
211
+ fields: Record<string, FieldValue> | undefined,
212
+ componentApiNames: string[],
213
+ ): LayoutItemDisplayResult {
214
+ if (!fields || componentApiNames.length === 0) {
215
+ return { value: null };
216
+ }
217
+ if (componentApiNames.length === 1) {
218
+ const value = getDisplayValueForDetailField(
219
+ fields[componentApiNames[0]] as FieldValueWithRelationship | undefined,
220
+ );
221
+ return { value };
222
+ }
223
+ const constituents: Record<string, FieldValue> = {};
224
+ for (const apiName of componentApiNames) {
225
+ if (fields[apiName] != null) constituents[apiName] = fields[apiName];
226
+ }
227
+ if (isModstampApiNames(componentApiNames)) {
228
+ const value = formatModstampDisplay(constituents);
229
+ return { value: value || null };
230
+ }
231
+ if (isAddressApiNames(componentApiNames)) {
232
+ const parts = getAddressPartsFromConstituents(constituents);
233
+ const value = formatAddressDisplay(parts);
234
+ return { value: value || null, dataType: "Address" };
235
+ }
236
+ const values = componentApiNames
237
+ .map((apiName) =>
238
+ getDisplayValueForDetailField(fields[apiName] as FieldValueWithRelationship | undefined),
239
+ )
240
+ .filter((v) => v !== null && v !== undefined && v !== "");
241
+ return { value: values.length > 0 ? values.join(", ") : null };
242
+ }
243
+
244
+ export function getDisplayValueForDetailField(
245
+ field: FieldValueWithRelationship | undefined,
246
+ ): string | number | boolean | null {
247
+ if (!field) return null;
248
+ const withExt = field as FieldValueWithRelationship;
249
+ if (withExt.relationshipField != null) {
250
+ const fromRel = extractFieldPrimitive(withExt.relationshipField);
251
+ if (fromRel !== null && fromRel !== undefined && fromRel !== "") {
252
+ return fromRel;
253
+ }
254
+ }
255
+ if (withExt.constituents != null) {
256
+ if (isModstampConstituents(withExt.constituents)) {
257
+ const formatted = formatModstampDisplay(withExt.constituents);
258
+ if (formatted) return formatted;
259
+ } else if (isAddressConstituents(withExt.constituents)) {
260
+ const formatted = formatAddressFromConstituents(withExt.constituents);
261
+ if (formatted) return formatted;
262
+ }
263
+ }
264
+ return extractFieldPrimitive(field);
265
+ }
266
+
267
+ export function getNestedFieldValue(
268
+ fields: Record<string, FieldValue> | undefined,
269
+ fieldPath: string,
270
+ ): string | number | boolean | null {
271
+ if (!fields || !fieldPath) {
272
+ return null;
273
+ }
274
+
275
+ const pathParts = fieldPath.split(".");
276
+ if (pathParts.length === 1) {
277
+ const field = fields[fieldPath];
278
+ if (!field) return null;
279
+
280
+ return extractFieldPrimitive(field);
281
+ }
282
+
283
+ let currentFields: Record<string, FieldValue> | undefined = fields;
284
+ for (let i = 0; i < pathParts.length - 1; i++) {
285
+ const part = pathParts[i];
286
+ if (!currentFields || !currentFields[part]) {
287
+ return null;
288
+ }
289
+
290
+ const field: FieldValue = currentFields[part];
291
+ if (isComplexValue(field.value)) {
292
+ currentFields = field.value.fields;
293
+ } else {
294
+ return null;
295
+ }
296
+ }
297
+
298
+ const finalFieldName = pathParts[pathParts.length - 1];
299
+ if (!currentFields || !currentFields[finalFieldName]) {
300
+ return null;
301
+ }
302
+
303
+ const finalField = currentFields[finalFieldName];
304
+ return extractFieldPrimitive(finalField);
305
+ }
306
+
307
+ /** Minimal metadata for record display name (nameFields from object info API). */
308
+ export type RecordDisplayNameMetadata = { nameFields?: string[] } | null;
309
+
310
+ /**
311
+ * Resolves a display name for a record: tries metadata.nameFields first, then
312
+ * DISPLAY_FIELD_CANDIDATES (Name, Subject, etc.), then record.id.
313
+ */
314
+ export function getRecordDisplayName(
315
+ record: { id: string; fields: Record<string, FieldValue> },
316
+ metadata?: RecordDisplayNameMetadata,
317
+ ): string {
318
+ const candidates = [...(metadata?.nameFields ?? []), ...DISPLAY_FIELD_CANDIDATES];
319
+ for (const fieldPath of candidates) {
320
+ const v = getNestedFieldValue(record.fields, fieldPath);
321
+ return v as string;
322
+ }
323
+ return record.id;
324
+ }
325
+
326
+ /** Adapts object info (e.g. ObjectInfoResult) to the shape expected by getRecordDisplayName. */
327
+ export function toRecordDisplayNameMetadata(obj: unknown): RecordDisplayNameMetadata {
328
+ if (obj != null && typeof obj === "object" && "nameFields" in obj) {
329
+ const nameFields = (obj as { nameFields?: string[] }).nameFields;
330
+ if (Array.isArray(nameFields)) return { nameFields };
331
+ }
332
+ return null;
333
+ }
334
+
335
+ export function extractFieldValue(
336
+ fieldValue: FieldValue | undefined,
337
+ useDisplayValue: boolean = false,
338
+ ): string {
339
+ if (!fieldValue) {
340
+ return "—";
341
+ }
342
+
343
+ if (useDisplayValue && isDefined(fieldValue.displayValue)) {
344
+ return fieldValue.displayValue;
345
+ }
346
+
347
+ const extracted = extractFieldPrimitive(fieldValue);
348
+
349
+ if (extracted !== null) {
350
+ return extracted as string;
351
+ }
352
+
353
+ return "—";
354
+ }
@@ -0,0 +1,67 @@
1
+ import type { FieldValue, ComplexFieldValue } from "../types/search/searchResults";
2
+
3
+ const DISPLAY_FIELD_CANDIDATES = [
4
+ "Name",
5
+ "CaseNumber",
6
+ "Subject",
7
+ "Title",
8
+ "DeveloperName",
9
+ "ContractNumber",
10
+ ];
11
+ /**
12
+ * Extracts the display value from a field value, handling nested structures
13
+ * For complex fields like Owner, extracts nested values from fields.Name.value
14
+ */
15
+ export function extractFieldValue(
16
+ fieldValue: FieldValue | undefined,
17
+ useDisplayValue: boolean = false,
18
+ ): string {
19
+ if (!fieldValue) {
20
+ return "—";
21
+ }
22
+
23
+ // If displayValue exists and is not null, use it (highest priority)
24
+ if (useDisplayValue && isDefined(fieldValue.displayValue)) {
25
+ return fieldValue.displayValue;
26
+ }
27
+
28
+ // If value is a complex object (like Owner), extract nested value
29
+ if (isComplexValue(fieldValue.value)) {
30
+ return extractComplexValue(fieldValue.value as ComplexFieldValue) ?? "—";
31
+ }
32
+
33
+ // Otherwise use the value directly (for simple fields)
34
+ if (isDefined(fieldValue.value)) {
35
+ return fieldValue.value as string;
36
+ }
37
+
38
+ return "—";
39
+ }
40
+
41
+ /**
42
+ * Helper to safely extract name from related object
43
+ */
44
+ function extractComplexValue(complex: ComplexFieldValue): string | null {
45
+ const fields = complex.fields;
46
+ if (!fields) return null;
47
+ // Scale: Check the candidate list until we find a field that exists and has a value
48
+ for (const fieldName of DISPLAY_FIELD_CANDIDATES) {
49
+ const field = fields[fieldName];
50
+ if (field) {
51
+ // Priority: DisplayValue -> Value
52
+ if (isDefined(field.displayValue)) return field.displayValue;
53
+ if (isDefined(field.value)) return field.value as string;
54
+ }
55
+ }
56
+
57
+ return null;
58
+ }
59
+ /**
60
+ * Type Guard checks
61
+ */
62
+ function isDefined(val: unknown): val is string | number | boolean {
63
+ return val !== null && val !== undefined;
64
+ }
65
+ function isComplexValue(val: unknown): val is ComplexFieldValue {
66
+ return typeof val === "object" && val !== null;
67
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Filter Utilities
3
+ *
4
+ * Utility functions for filter value parsing and transformation.
5
+ * These utilities handle the conversion of form values to filter criteria.
6
+ */
7
+
8
+ /**
9
+ * Parses a string value to either a number or string
10
+ * Attempts to parse as integer, falls back to trimmed string if not a valid number
11
+ *
12
+ * @param val - The value to parse (string)
13
+ * @returns Parsed number if valid, otherwise trimmed string, or empty string if input is empty
14
+ *
15
+ * @remarks
16
+ * - Returns empty string for empty/whitespace input
17
+ * - Attempts integer parsing first
18
+ * - Falls back to trimmed string if parsing fails
19
+ * - Used for filter values that can be either numeric or text
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * const parsed = parseFilterValue("123"); // 123 (number)
24
+ * const parsed = parseFilterValue("abc"); // "abc" (string)
25
+ * const parsed = parseFilterValue(" "); // "" (empty string)
26
+ * ```
27
+ */
28
+ export function parseFilterValue(val: string): string | number {
29
+ if (!val.trim()) return "";
30
+ const numVal = parseInt(val.trim(), 10);
31
+ return isNaN(numVal) ? val.trim() : numVal;
32
+ }