@pega/sdk 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +10 -3
  2. package/dist/index.js +764 -165
  3. package/package.json +1 -1
  4. package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
  5. package/templates/react-native-sdk-reference/.prettierignore +17 -0
  6. package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
  7. package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
  8. package/templates/react-native-sdk-reference/AGENTS.md +3 -0
  9. package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
  10. package/templates/react-native-sdk-reference/README.md +56 -0
  11. package/templates/react-native-sdk-reference/app.json +40 -5
  12. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
  13. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
  14. package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
  15. package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
  16. package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
  17. package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
  18. package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
  19. package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
  20. package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
  21. package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
  22. package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
  23. package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
  24. package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
  25. package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
  26. package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
  27. package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
  28. package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
  29. package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
  30. package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
  31. package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
  32. package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
  33. package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
  34. package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
  35. package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
  36. package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
  37. package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
  38. package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
  39. package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
  40. package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
  41. package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
  42. package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
  43. package/templates/react-native-sdk-reference/package.json +59 -14
  44. package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
  45. package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  46. package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
  47. package/templates/react-native-sdk-reference/sdk-config.json +31 -9
  48. package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
  49. package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
  50. package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
  51. package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
  52. package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
  53. package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
  54. package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
  55. package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
  56. package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
  57. package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
  58. package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
  59. package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
  60. package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
  61. package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
  62. package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
  63. package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
  64. package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
  65. package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
  66. package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
  67. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
  68. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
  69. package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
  70. package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
  71. package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
  72. package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
  73. package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
  74. package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
  75. package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
  76. package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
  77. package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
  78. package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
  79. package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
  80. package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
  81. package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
  82. package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
  83. package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
  84. package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
  85. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
  86. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
  87. package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
  88. package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
  89. package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
  90. package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
  91. package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
  92. package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
  93. package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
  94. package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
  95. package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
  96. package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
  97. package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
  98. package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
  99. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
  100. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
  101. package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
  102. package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
  103. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
  104. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
  105. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
  106. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
  107. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
  108. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
  109. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
  110. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
  111. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
  112. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
  113. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
  114. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
  115. package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
  116. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
  117. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
  118. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
  119. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
  120. package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
  121. package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
  122. package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
  123. package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
  124. package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
  125. package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
  126. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
  127. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
  128. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
  129. package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
  130. package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
  131. package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
  132. package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
  133. package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
  134. package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
  135. package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
  136. package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
  137. package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
  138. package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
  139. package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
  140. package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
  141. package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
  142. package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
  143. package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
  144. package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
  145. package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
  146. package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
  147. package/templates/react-native-sdk-reference/tsconfig.json +9 -8
  148. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
  149. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
  150. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
  151. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
  152. package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
  153. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
  154. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
  155. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
  156. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
  157. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
  158. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
  159. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
  160. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
  161. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
  162. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
  163. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
  164. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
  165. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
  166. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
  167. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
  168. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
  169. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
  170. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
  171. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
  172. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
  173. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
  174. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
  175. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
  176. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
  177. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
  178. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
  179. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
  180. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
  181. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
  182. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
  183. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
  184. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
  185. package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
  186. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
  187. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
  188. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
  189. package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
  190. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
  191. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
  192. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
  193. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
  194. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
  195. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
  196. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
  197. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
  198. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
  199. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
  200. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
  201. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
  202. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
  203. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
  204. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
  205. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
  206. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
  207. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
  208. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
  209. package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
  210. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
  211. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
  212. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
  213. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
  214. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
  215. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
  216. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
  217. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
  218. package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
  219. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
  220. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
  221. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
  222. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
  223. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
  224. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
  225. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
  226. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
  227. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
  228. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
  229. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
  230. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
  231. package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
  232. package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
  233. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
  234. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
  235. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
  236. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
  237. package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
  238. package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
  239. package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
  240. package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
  241. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
  242. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
  243. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
  244. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
  245. package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
  246. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
  247. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
  248. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
  249. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
  250. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
  251. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
  252. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
  253. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
  254. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
  255. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
  256. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
  257. package/templates/react-sdk-reference/package.json +1 -1
  258. package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
  259. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  260. package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
  261. package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
  262. package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
  263. package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
  264. package/templates/react-native-sdk-reference/App.tsx +0 -49
  265. package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
  266. package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
@@ -6,21 +6,21 @@ Inline dashboard page template. Builds filter components from promoted filters m
6
6
 
7
7
  ---
8
8
 
9
- > ⚠️ **CRITICAL — Must use `buildFilterComponents` from `@pega/sdk-react`**
9
+ > ⚠️ **CRITICAL — Must use the project's filter-component builder utility**
10
10
  >
11
- > This component MUST use `buildFilterComponents(getPConnect, allFilters)` imported from `@pega/sdk-react` to generate proper filter UI components. Without this, dashboard filters will not render correctly.
11
+ > This component MUST use the project's filter-component builder utility (invoked with `getPConnect` and the filters array) to generate proper filter UI components. Without this, dashboard filters will not render correctly.
12
12
  >
13
13
  > **Mandatory implementation details:**
14
14
  >
15
- > 1. `import { buildFilterComponents } from '@pega/sdk-react'` — filter component builder
15
+ > 1. Obtain the filter-component builder utility from the project's SDK bridge layer
16
16
  > 2. `getPConnect().getRawMetadata().children[1]` — extract filter metadata
17
- > 3. `useEffect` + `useState` for `filterComponents` — build filters on mount
18
- > 4. Assemble `inlineProps.children[1] = filterComponents` for InlineDashboard
17
+ > 3. Local state for `filterComponents` populated via a lifecycle effect on mount
18
+ > 4. Assemble forwarded children so index 1 contains the built filter components
19
19
  >
20
20
  > **Minimum Implementation Checklist:**
21
21
  >
22
- > - [ ] `buildFilterComponents` imported from `@pega/sdk-react`
23
- > - [ ] `filterComponents` state populated via `useEffect`
22
+ > - [ ] Filter-component builder utility obtained from the project's SDK bridge
23
+ > - [ ] `filterComponents` local state populated via lifecycle effect
24
24
  > - [ ] Filter metadata extracted from `getRawMetadata().children[1]`
25
25
  > - [ ] InlineDashboard receives filter components as children
26
26
 
@@ -28,84 +28,53 @@ Inline dashboard page template. Builds filter components from promoted filters m
28
28
 
29
29
  ## Component Purpose
30
30
 
31
- Page-level wrapper for the inline dashboard. Extracts promoted filter definitions from the PConnect metadata, builds React filter components from them, and passes them to `InlineDashboard` as the second child (filter panel). The first child (main content) is passed through unchanged.
31
+ Page-level wrapper for the inline dashboard. Extracts promoted filter definitions from the PConnect metadata, builds filter components from them, and passes them to `InlineDashboard` as the second child (filter panel). The first child (main content) is passed through unchanged.
32
32
 
33
33
  > See `InlineDashboard.md` for the layout and rendering behavior. This component only handles filter component construction.
34
34
 
35
35
  ## Pega Metadata
36
36
 
37
- - **Registration key:** `InlineDashboardPage` (in `component-map.ts`)
37
+ - **Registration key:** `InlineDashboardPage` (in the project's component map)
38
38
  - **Category:** Page template — dashboard page
39
- - **Extends:** `PConnProps`
40
-
41
- ## Props
42
-
43
- | Prop | Type | Required | Description |
44
- | ---------------- | ------------- | -------- | ----------------------------------------------- |
45
- | `children` | `ReactNode[]` | Yes | Main content children passed to InlineDashboard |
46
- | `title` | `string` | No | Dashboard title |
47
- | `filterPosition` | `string` | No | Filter position: `'block-start'` or side |
48
- | `getPConnect` | `function` | Yes | PConnect getter |
49
-
50
- ## Component Skeleton
51
-
52
- ```typescript
53
- import { useMemo, Children, useEffect, useState, type PropsWithChildren } from 'react';
54
- import { buildFilterComponents, getComponentFromRegistry } from '@pega/sdk-react';
55
- import type { PConnProps } from '@pega/sdk-react';
56
-
57
- interface InlineDashboardPageProps extends PConnProps {
58
- title: string;
59
- icon?: string;
60
- filterPosition?: string;
61
- }
62
-
63
- export default function InlineDashboardPage(props: PropsWithChildren<InlineDashboardPageProps>) {
64
- const InlineDashboard = getComponentFromRegistry('InlineDashboard');
65
- const { children, getPConnect, filterPosition = 'block-start' } = props;
66
- const [filterComponents, setFilterComponents] = useState([]);
67
- const childArray = useMemo(() => Children.toArray(children), [children]);
68
-
69
- // 1. Build filter components from metadata on mount
70
- const allFilters = (getPConnect().getRawMetadata() as any).children[1];
71
- useEffect(() => {
72
- setFilterComponents(buildFilterComponents(getPConnect, allFilters));
73
- }, []);
74
-
75
- // 2. Assemble props for InlineDashboard
76
- const inlineProps = { ...props };
77
- inlineProps.children = [];
78
- inlineProps.children[0] = childArray[0]; // main content
79
- inlineProps.children[1] = filterComponents; // built filters
80
-
81
- // 3. Delegate to InlineDashboard
82
- return <InlineDashboard {...inlineProps} />;
83
- }
84
- ```
39
+ - **Extends:** The project's base component interface
40
+
41
+ ## Inputs
42
+
43
+ | Input | Type | Required | Description |
44
+ | ---------------- | ------------------ | -------- | ----------------------------------------------- |
45
+ | `children` | child element list | Yes | Main content children passed to InlineDashboard |
46
+ | `title` | `string` | No | Dashboard title |
47
+ | `filterPosition` | `string` | No | Filter position: `'block-start'` or side |
48
+ | `getPConnect` | `function` | Yes | PConnect getter |
49
+
50
+ ## Implementation Structure
51
+
52
+ **Module Setup:** Obtain the project's filter-component builder utility from the SDK bridge layer and the `InlineDashboard` component from the project's component registry. The component requires local state management and a lifecycle effect for initialization.
53
+
54
+ The component's interface extends the project's base component interface with `title: string`, optional `icon?: string`, and optional `filterPosition?: string`.
55
+
56
+ **Main Component Logic** — steps in order:
57
+
58
+ 1. Retrieve `InlineDashboard` from the project's component registry. Receive inputs: `children`, `getPConnect`, and `filterPosition` (default `'block-start'`). Declare local state `filterComponents` (array, initially empty). Create a memoized computation that converts children into a flat array.
59
+ 2. Build filter components from metadata on mount: read `allFilters = getPConnect().getRawMetadata().children[1]`, then inside a lifecycle effect that runs once on initialization, invoke the project's filter-component builder utility with `getPConnect` and `allFilters`, and store the result in `filterComponents` local state.
60
+ 3. Assemble the inputs to forward to `InlineDashboard`: shallow-copy the received inputs into a forwarding object, then set its children to a new array whose index 0 is the first child element (the main content) and whose index 1 is `filterComponents` (the built filters).
61
+ 4. Delegate rendering entirely to `InlineDashboard`, spreading all assembled inputs.
85
62
 
86
63
  ## Behavioral Contract
87
64
 
88
65
  ### Filter Component Construction
89
66
 
90
- In `useEffect([])` (on mount):
67
+ In a lifecycle effect (on mount, runs once):
91
68
 
92
- 1. Get promoted filters: `allFilters = getPConnect().getRawMetadata().config.promotedFilters || []`.
93
- 2. Call `buildFilterComponents(getPConnect, allFilters)`:
69
+ 1. Get promoted filters: `allFilters = getPConnect().getRawMetadata().children[1]`.
70
+ 2. Invoke the project's filter-component builder utility with `getPConnect` and `allFilters`:
94
71
  - For each filter in `allFilters`, creates a PConnect-based filter field component.
95
- - Returns an array of React elements ready to render.
96
- 3. Store result in `filterComponents` state.
72
+ - Returns an array of rendered filter elements ready to display.
73
+ 3. Store result in `filterComponents` local state.
97
74
 
98
75
  ### Render
99
76
 
100
- ```tsx
101
- <InlineDashboard title={title} filterPosition={filterPosition} getPConnect={getPConnect}>
102
- {children[0]} {/* main content */}
103
- {filterComponents} {/* built filter components */}
104
- </InlineDashboard>
105
- ```
106
-
107
- - `children[0]` = main content region.
108
- - `filterComponents` = built filter elements (replaces raw `children[1]`).
77
+ Delegate to `InlineDashboard`, forwarding `title`, `filterPosition`, and `getPConnect`, with two children: children index 0 (the main content region) and `filterComponents` (the built filter elements, replacing the raw children index 1).
109
78
 
110
79
  ## Visual Specifications
111
80
 
@@ -114,25 +83,23 @@ Identical to `InlineDashboard` — see `InlineDashboard.md`. The only difference
114
83
  ## Edge Cases & Special Logic
115
84
 
116
85
  - `allFilters` may be empty — if no promoted filters exist, `filterComponents` is an empty array, and `InlineDashboard` renders without a filter panel.
117
- - `buildFilterComponents` is async in some implementations — show a loading state if needed until filters are ready.
118
- - `children[0]` is always the main content — index is stable.
119
- - `filterComponents` replaces `children[1]` entirely — do not render both.
86
+ - The filter-component builder utility may be async in some implementations — show a loading state if needed until filters are ready.
87
+ - Children index 0 is always the main content — index is stable.
88
+ - `filterComponents` replaces children index 1 entirely — do not render both.
120
89
 
121
90
  ## Dependencies
122
91
 
123
- - `buildFilterComponents` from `./utils` — constructs filter field components from promoted filter config
124
- - `InlineDashboard` — the layout template this component wraps
92
+ - The project's filter-component builder utility — constructs filter field components from promoted filter config; accepts `getPConnect` and a filters array and returns rendered filter components
93
+ - `InlineDashboard` — the layout template this component wraps (resolved via the project's component registry)
125
94
 
126
95
  ## Design System Mapping
127
96
 
128
97
  **UI control type:** Dashboard page — programmatic filter construction + InlineDashboard delegation.
129
98
 
130
- Listed design systems are examples only.
131
-
132
- This component is a thin orchestration layer. All visual implementation is in `InlineDashboard`. The only implementation detail is `buildFilterComponents` — which creates filter field components from metadata definitions.
99
+ This component is a thin orchestration layer. All visual implementation is in `InlineDashboard`. The only implementation detail is the filter-component builder utility — which creates filter field components from metadata definitions.
133
100
 
134
- When implementing in a specific design system:
101
+ When implementing in a specific design system, map the following:
135
102
 
136
- - `buildFilterComponents` must create proper PConnect-backed filter field components
137
- - If `promotedFilters` is empty, skip the filter panel entirely
103
+ - The filter-component builder utility must create proper PConnect-backed filter field components
104
+ - If promoted filters metadata is empty, skip the filter panel entirely
138
105
  - All layout and styling is delegated to `InlineDashboard`
@@ -8,21 +8,21 @@ List page template. Thin wrapper that renders `ListView` in standalone page mode
8
8
 
9
9
  ## Component Purpose
10
10
 
11
- Renders a full-page list view by forwarding all props to `ListView` with `bInForm: false`. There is no additional logic — this component exists solely to provide a registration key that signals "this is a page, not an inline table."
11
+ Renders a full-page list view by forwarding all inputs to `ListView` with `bInForm: false`. There is no additional logic — this component exists solely to provide a registration key that signals "this is a page, not an inline table."
12
12
 
13
13
  > See `ListView.md` for full documentation of all capabilities.
14
14
 
15
15
  ## Pega Metadata
16
16
 
17
- - **Registration key:** `ListPage` (in `component-map.ts`)
17
+ - **Registration key:** `ListPage` (in the project's component map)
18
18
  - **Category:** Page template — list page
19
- - **Extends:** `PConnProps`
19
+ - **Extends:** The project's base component interface
20
20
 
21
- ## Props
21
+ ## Inputs
22
22
 
23
- All props are forwarded to `ListView`. Key props:
23
+ All inputs are forwarded to `ListView`. Key inputs:
24
24
 
25
- | Prop | Type | Required | Description |
25
+ | Input | Type | Required | Description |
26
26
  | -------------- | ---------- | -------- | ------------------------------ |
27
27
  | `dataPageName` | `string` | Yes | Data page to load records from |
28
28
  | `columns` | `array` | No | Column definitions |
@@ -30,31 +30,20 @@ All props are forwarded to `ListView`. Key props:
30
30
  | `payload` | `object` | No | Query payload |
31
31
  | `getPConnect` | `function` | Yes | PConnect getter |
32
32
 
33
- ## Component Skeleton
33
+ ## Implementation Structure
34
34
 
35
- Simplest possible template — pure pass-through to `ListView` with one prop override.
35
+ Simplest possible template — pure pass-through to `ListView` with one input override.
36
36
 
37
- ```typescript
38
- import { getComponentFromRegistry } from '@pega/sdk-react';
39
- import type { PConnProps } from '@pega/sdk-react';
37
+ **Module Setup:** Obtain `ListView` from the project's component registry. The component's interface extends the project's base component interface with `parameters: object`.
40
38
 
41
- interface ListPageProps extends PConnProps {
42
- parameters: object;
43
- }
39
+ **Main Component Logic** — steps in order:
44
40
 
45
- export default function ListPage(props: ListPageProps) {
46
- const ListView = getComponentFromRegistry('ListView');
47
- return <ListView {...props} bInForm={false} />;
48
- }
49
- ```
41
+ 1. Retrieve `ListView` from the project's component registry.
42
+ 2. Render `ListView` forwarding all received inputs and overriding `bInForm` to `false`.
50
43
 
51
44
  ## Behavioral Contract
52
45
 
53
- ```tsx
54
- <ListView {...props} bInForm={false} />
55
- ```
56
-
57
- That is the complete implementation. `bInForm: false` ensures ListView renders with full page chrome (outer padding, page-level toolbar layout).
46
+ The complete implementation renders `ListView` forwarding all inputs with `bInForm` overridden to `false`. `bInForm: false` ensures ListView renders with full page chrome (outer padding, page-level toolbar layout).
58
47
 
59
48
  ## Visual Specifications
60
49
 
@@ -72,17 +61,15 @@ None beyond `ListView`. The only constraint is that `bInForm` is always `false`
72
61
 
73
62
  ## Dependencies
74
63
 
75
- - `ListView` — the primary list template component
64
+ - `ListView` — the primary list template component (resolved via the project's component registry)
76
65
 
77
66
  ## Design System Mapping
78
67
 
79
68
  **UI control type:** Full-page data list — pass-through to `ListView` with page-mode flag.
80
69
 
81
- Listed design systems are examples only.
82
-
83
- Implement identically to `ListView` — `ListPage` adds no new UI. The distinction is purely in the `bInForm` prop which controls spacing/chrome.
70
+ Implement identically to `ListView` — `ListPage` adds no new UI. The distinction is purely in the `bInForm` input which controls spacing/chrome.
84
71
 
85
- When implementing in a specific design system:
72
+ When implementing in a specific design system, map the following:
86
73
 
87
74
  - `bInForm: false` signals that the list should have page-level layout (more padding, full-width toolbar)
88
75
  - No additional logic beyond `ListView` is required
@@ -12,29 +12,10 @@ Full-featured list view template. Renders a data table with sorting, pagination,
12
12
  >
13
13
  > 1. Check `typeof referenceList === 'string'` before using it
14
14
  > 2. Call `PCore.getDataApiUtils().getData(referenceList, payload)` to fetch actual row data
15
- > 3. Initialize row state as empty array: `useState<any[]>([])`
15
+ > 3. Initialize row state as empty array
16
16
  > 4. NEVER put `referenceList` directly into state or call `.filter()` on it
17
17
  >
18
- > ```typescript
19
- > // ❌ WRONG — will crash with "rows.filter is not a function"
20
- > const [rows, setRows] = useState(referenceList);
21
- >
22
- > // ✅ CORRECT — fetch data from the reference string
23
- > const [rows, setRows] = useState<any[]>([]);
24
- > useEffect(() => {
25
- > if (Array.isArray(referenceList)) {
26
- > setRows(referenceList);
27
- > return;
28
- > }
29
- > const dataRef = typeof referenceList === 'string' ? referenceList : dataPageName;
30
- > if (dataRef) {
31
- > PCore.getDataApiUtils()
32
- > .getData(dataRef, payload ?? {})
33
- > .then((response) => setRows(response?.data?.data ?? response?.data?.pxResults ?? []))
34
- > .catch(() => setRows([]));
35
- > }
36
- > }, [referenceList]);
37
- > ```
18
+ > Do NOT initialize row state directly from `referenceList` (e.g. as the initial state value) — this crashes later with "rows.filter is not a function" because `referenceList` is a string, not an array. Instead, initialize rows as an empty array and populate them inside a lifecycle effect keyed on `referenceList`: if `referenceList` happens to already be an array, use it directly; otherwise resolve a `dataRef` from `referenceList` (falling back to `dataPageName`) and, when present, call `PCore.getDataApiUtils().getData(dataRef, payload ?? {})`, storing the resolved rows from `response?.data?.data ?? response?.data?.pxResults ?? []` on success, or an empty array on failure.
38
19
 
39
20
  ---
40
21
 
@@ -48,31 +29,7 @@ Full-featured list view template. Renders a data table with sorting, pagination,
48
29
  > 2. Get field definitions (labels, types) from metadata: `PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false)`
49
30
  > 3. Map each preset column to its field definition to build `{id, label, type, displayAsLink}` headers
50
31
  >
51
- > ```typescript
52
- > // ❌ WRONG — shows ALL raw data keys as columns (pzInsKey, pxRefObjectClass, etc.)
53
- > const fields = Object.keys(rows[0]).map((key) => ({ id: key, label: key }));
54
- >
55
- > // ✅ CORRECT — extract configured columns from PConnect presets + metadata
56
- > const componentConfig = getPConnect().getComponentConfig();
57
- > const columnFields = componentConfig.presets[0].children[0].children;
58
- > const metaResponse = await PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false);
59
- > const fieldDefs = metaResponse?.data?.fields ?? [];
60
- >
61
- > const columns = columnFields.map((field, index) => {
62
- > let fieldId = field.config.value.substring(field.config.value.indexOf(' ') + 1);
63
- > if (fieldId.startsWith('.')) fieldId = fieldId.substring(1);
64
- > const { additionalDetails = {} } = field.config;
65
- > const displayAsLink =
66
- > additionalDetails.type === 'DISPLAY_LINK' || ('displayAsLink' in field.config && field.config.displayAsLink);
67
- > return {
68
- > id: fieldId,
69
- > label: fieldDefs[index]?.label ?? field.config.label ?? fieldId,
70
- > type: field.type,
71
- > displayAsLink,
72
- > classID: fieldDefs.find((f) => f.name === fieldId)?.classID,
73
- > };
74
- > });
75
- > ```
32
+ > Do NOT derive columns by taking `Object.keys(rows[0])` and mapping each key to `{ id: key, label: key }` — that shows every raw data key, including internal fields like `pzInsKey` and `pxRefObjectClass`. Instead, extract the configured columns from PConnect presets plus the analytics metadata: read `componentConfig = getPConnect().getComponentConfig()`; read `columnFields = componentConfig.presets[0].children[0].children`; await `metaResponse = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false)` and take `fieldDefs = metaResponse?.data?.fields ?? []`; then map each entry in `columnFields` (with its index) to a column definition: strip the annotation prefix from `field.config.value` (format `"@P .pyID"`, take the substring after the first space, then strip a leading `.` if present) to get `fieldId`; read `additionalDetails` from `field.config` (default `{}`) and compute `displayAsLink` as true when `additionalDetails.type === 'DISPLAY_LINK'` or when `field.config.displayAsLink` is set; build `{ id: fieldId, label: fieldDefs[index]?.label ?? field.config.label ?? fieldId, type: field.type, displayAsLink, classID: fieldDefs.find(f => f.name === fieldId)?.classID }`.
76
33
  >
77
34
  > **Key points:**
78
35
  >
@@ -85,18 +42,7 @@ Full-featured list view template. Renders a data table with sorting, pagination,
85
42
 
86
43
  > ⚠️ **CRITICAL — Data fetching differs by `bInForm`**
87
44
  >
88
- > The data API to call depends on whether the ListView is inside a form or on a standalone page:
89
- >
90
- > ```typescript
91
- > // Page-level (bInForm = false) — e.g., worklist landing page
92
- > const result = await PCore.getDataApiUtils().getData(referenceList, payload ?? {});
93
- > const rows = result?.data?.data ?? [];
94
- >
95
- > // Form-level (bInForm = true) — e.g., embedded list in a case form
96
- > const context = getPConnect().getContextName();
97
- > const result = await PCore.getDataPageUtils().getDataAsync(referenceList, context, parameters, null, query);
98
- > const rows = result?.data ?? [];
99
- > ```
45
+ > The data API to call depends on whether the ListView is inside a form or on a standalone page: for page-level use (`bInForm = false`, e.g. a worklist landing page), await `PCore.getDataApiUtils().getData(referenceList, payload ?? {})` and read rows from `result?.data?.data ?? []`; for form-level use (`bInForm = true`, e.g. an embedded list in a case form), resolve `context = getPConnect().getContextName()`, await `PCore.getDataPageUtils().getDataAsync(referenceList, context, parameters, null, query)`, and read rows from `result?.data ?? []`.
100
46
  >
101
47
  > Using the wrong API will return empty data or fail silently.
102
48
 
@@ -108,11 +54,11 @@ The primary data table component. Renders a sortable, paginated, filterable, and
108
54
 
109
55
  ## Pega Metadata
110
56
 
111
- - **Registration key:** `ListView` (in `component-map.ts`)
57
+ - **Registration key:** `ListView` (in the project's component map)
112
58
  - **Category:** Data display template
113
- - **Extends:** `PConnProps`
59
+ - **Extends:** The project's base component interface
114
60
 
115
- ## Props
61
+ ## Inputs
116
62
 
117
63
  | Prop | Type | Required | Description |
118
64
  | ----------------------- | ---------- | -------- | ----------------------------------------------------------------------------- |
@@ -127,160 +73,43 @@ The primary data table component. Renders a sortable, paginated, filterable, and
127
73
  | `payload` | `object` | No | Query payload for data page requests |
128
74
  | `getPConnect` | `function` | Yes | PConnect getter |
129
75
 
130
- ## Component Skeleton
76
+ ## Implementation Structure
131
77
 
132
78
  > ⚠️ **CRITICAL — USE THE PROJECT'S DESIGN SYSTEM FOR TABLE RENDERING**
133
79
  >
134
80
  > This component MUST use the **installed design system's table components** — NOT plain HTML `<table>/<thead>/<tbody>`.
135
- > Check `package.json` for the installed design system and use its table primitives:
136
- >
137
- > | If installed DS is... | Import from... | Table components |
138
- > | --------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
139
- > | `@carbon/react` | `@carbon/react` | `Table, TableHead, TableRow, TableHeader, TableBody, TableCell, TableContainer, TableToolbar, TableToolbarSearch, Pagination, Link` |
140
- > | `@mui/material` | `@mui/material` | `Table, TableHead, TableRow, TableCell, TableBody, TableContainer, TablePagination, TableSortLabel, Link` |
141
- > | `antd` | `antd` | `Table` (with `columns` + `dataSource` props, built-in pagination) |
142
- > | `@chakra-ui/react` | `@chakra-ui/react` | `Table, Thead, Tbody, Tr, Th, Td, Link` + custom pagination |
143
- > | None / CSS-only | N/A | Plain `<table>/<thead>/<tbody>` with CSS classes |
144
- >
145
- > **The table MUST look like a proper data grid** with:
81
+ > Check the project's dependencies for the installed design system and use its table primitives. The table MUST look like a proper data grid with:
146
82
  >
147
83
  > - Column headers with field labels (from PConnect presets metadata)
148
84
  > - Paginated rows (not all rows at once)
149
85
  > - Clickable link cells for navigation
150
86
  > - Search toolbar (when `globalSearch !== false`)
151
87
  >
152
- > ❌ **NEVER** render raw `Object.values(row)` or dump all data keys as columns.
153
- > ❌ **NEVER** use plain HTML when a design system is installed.
154
-
155
- This is the largest template component. The implementation MUST include these critical sections:
156
-
157
- ```typescript
158
- import { useCallback, useEffect, useState } from 'react';
159
- import type { PConnProps } from '@pega/sdk-react';
160
-
161
- const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
162
-
163
- interface ListViewProps extends PConnProps {
164
- bInForm?: boolean;
165
- globalSearch?: boolean;
166
- referenceList?: any;
167
- selectionMode?: string;
168
- referenceType?: string;
169
- payload?: any;
170
- parameters?: any;
171
- compositeKeys?: any;
172
- localeReference?: string;
173
- }
174
-
175
- export default function ListView(props: ListViewProps) {
176
- const { getPConnect, bInForm = true, globalSearch, referenceList, payload, parameters, localeReference } = props;
177
-
178
- const [arRows, setRows] = useState<any[]>([]);
179
- const [arColumns, setColumns] = useState<any[]>([]);
180
- const [page, setPage] = useState(1);
181
- const [pageSize, setPageSize] = useState(10);
182
- const [searchValue, setSearchValue] = useState('');
183
- const [title, setTitle] = useState('');
184
-
185
- const thePConn = getPConnect();
186
- const componentConfig = thePConn.getComponentConfig();
187
- const resolvedConfigProps: any = thePConn.getConfigProps();
188
-
189
- // ═══════════════════════════════════════════════════════════════
190
- // CRITICAL: Extract column definitions from PConnect presets
191
- // ═══════════════════════════════════════════════════════════════
192
- const getHeaderCells = useCallback((columnFields: any[], fieldDefs: any[]) => {
193
- return columnFields.map((field: any, index: number) => {
194
- let theField = field.config.value.substring(field.config.value.indexOf(' ') + 1);
195
- if (theField.startsWith('.')) theField = theField.substring(1);
196
- const colIndex = fieldDefs.findIndex((ele) => ele.name === theField);
197
- const { additionalDetails = {} } = field.config;
198
- let displayAsLink = additionalDetails.type === 'DISPLAY_LINK';
199
- if (!displayAsLink) displayAsLink = 'displayAsLink' in field.config && field.config.displayAsLink;
200
- return {
201
- id: theField,
202
- type: field.type,
203
- displayAsLink,
204
- label: fieldDefs[index]?.label ?? field.config.label ?? theField,
205
- classID: colIndex > -1 ? fieldDefs[colIndex].classID : undefined,
206
- isAssignmentLink: displayAsLink && AssignDashObjects.includes(fieldDefs[colIndex]?.classID),
207
- };
208
- });
209
- }, []);
210
-
211
- // ═══════════════════════════════════════════════════════════════
212
- // CRITICAL: Fetch metadata + data in useEffect
213
- // ═══════════════════════════════════════════════════════════════
214
- useEffect(() => {
215
- let isActive = true;
216
- async function fetchData() {
217
- // Step 1: Get field definitions from metadata API
218
- const metaResponse: any = await PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false);
219
- const fieldDefs = metaResponse?.data?.fields ?? [];
220
-
221
- // Step 2: Get configured columns from presets
222
- const columnFields = componentConfig?.presets?.[0]?.children?.[0]?.children ?? [];
223
- if (columnFields.length) {
224
- const myColumns = getHeaderCells(columnFields, fieldDefs);
225
- myColumns.forEach((col) => {
226
- if (localeReference) col.label = PCore.getLocaleUtils().getLocaleValue(col.label, localeReference);
227
- });
228
- if (isActive) setColumns(myColumns);
229
- }
230
-
231
- // Step 3: Fetch data — API differs by bInForm
232
- let dataResult: any;
233
- if (!bInForm) {
234
- dataResult = await PCore.getDataApiUtils().getData(referenceList, payload ?? {});
235
- } else {
236
- const context = thePConn.getContextName();
237
- dataResult = await (PCore.getDataPageUtils() as any).getDataAsync(
238
- referenceList,
239
- context,
240
- parameters,
241
- null,
242
- null,
243
- );
244
- }
245
- const tableData = !bInForm ? (dataResult?.data?.data ?? []) : (dataResult?.data ?? []);
246
- if (isActive) setRows(Array.isArray(tableData) ? tableData : []);
247
- }
248
- fetchData();
249
- return () => {
250
- isActive = false;
251
- };
252
- }, [referenceList, bInForm, payload, parameters]);
253
-
254
- // ═══════════════════════════════════════════════════════════════
255
- // CRITICAL: Link click handlers for navigation
256
- // ═══════════════════════════════════════════════════════════════
257
- function handleLinkClick(row: any, column: any) {
258
- if (column.isAssignmentLink) {
259
- const { pxRefObjectClass, pzInsKey } = row;
260
- thePConn.getActionsApi().openAssignment(pzInsKey, pxRefObjectClass, {
261
- containerName: thePConn.getContainerName(),
262
- channelName: '',
263
- });
264
- } else {
265
- const pxRefObjectKey = row.pxRefObjectKey ?? row.pzInsKey;
266
- const pxRefObjectClass = row.pxRefObjectClass ?? row.pxObjClass;
267
- if (pxRefObjectClass && pxRefObjectKey) {
268
- thePConn.getActionsApi().openWorkByHandle(pxRefObjectKey, pxRefObjectClass);
269
- }
270
- }
271
- }
272
-
273
- // Search, pagination, sort, selection, render...
274
- }
275
- ```
276
-
277
- > **Note:** This skeleton shows the MANDATORY patterns. Full implementations will also include sorting, selection, filter dialog, column menus, and PubSub subscriptions for dashboard filters. But the three critical sections above (column extraction, data fetching, link handling) MUST be present for the table to render correctly.
88
+ > Do NOT render raw `Object.values(row)` or dump all data keys as columns, and do NOT use plain HTML when a design system is installed.
89
+
90
+ This is the largest template component. The implementation MUST include these critical sections.
91
+
92
+ **Module Setup:** The component depends on local state management, lifecycle effects, and a cached callback. Declare a constant `AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket']` (classes whose links should open as assignments rather than plain work items). Define the input contract as an extension of the project's base component interface with optional `bInForm`, `globalSearch`, `referenceList`, `selectionMode`, `referenceType`, `payload`, `parameters`, `compositeKeys`, and `localeReference` fields.
93
+
94
+ **Main Component Logic** — steps in order:
95
+
96
+ 1. Receive inputs: `getPConnect`, `bInForm` (default `true`), `globalSearch`, `referenceList`, `payload`, `parameters`, and `localeReference`. Declare local state: `arRows` (array, default `[]`), `arColumns` (array, default `[]`), `page` (default `1`), `pageSize` (default `10`), `searchValue` (default `''`), and `title` (default `''`).
97
+ 2. Call `getPConnect()` once into `thePConn`; read `componentConfig = thePConn.getComponentConfig()` and `resolvedConfigProps = thePConn.getConfigProps()`.
98
+ 3. **Extract column definitions from PConnect presets** — define a memoized/cached `getHeaderCells(columnFields, fieldDefs)` callback that maps each `columnFields` entry (with its index) to a header descriptor: strip the annotation prefix from `field.config.value` to get `theField` (take the substring after the first space, then strip a leading `.`); find the matching field definition's index in `fieldDefs` via `.findIndex(ele => ele.name === theField)` as `colIndex`; read `additionalDetails` from `field.config` (default `{}`) and compute `displayAsLink` as true when `additionalDetails.type === 'DISPLAY_LINK'` or when `field.config.displayAsLink` is set; return `{ id: theField, type: field.type, displayAsLink, label: fieldDefs[index]?.label ?? field.config.label ?? theField, classID: colIndex > -1 ? fieldDefs[colIndex].classID : undefined, isAssignmentLink: displayAsLink && AssignDashObjects.includes(fieldDefs[colIndex]?.classID) }`.
99
+ 4. **Fetch metadata + data** in a lifecycle effect keyed on `[referenceList, bInForm, payload, parameters]`, using an `isActive` flag to guard against updates after unmount:
100
+ - Await field definitions via `PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false)`, reading `fieldDefs` from `metaResponse?.data?.fields ?? []`.
101
+ - Read configured columns from `componentConfig?.presets?.[0]?.children?.[0]?.children ?? []`; when non-empty, build `myColumns` via `getHeaderCells(columnFields, fieldDefs)`, localize each column's `label` through `PCore.getLocaleUtils().getLocaleValue` when `localeReference` is set, and store the result via `setColumns`.
102
+ - Fetch the row data using the API appropriate to `bInForm` (see the CRITICAL note above): for `!bInForm`, await `PCore.getDataApiUtils().getData(referenceList, payload ?? {})`; for `bInForm`, resolve `context = thePConn.getContextName()` and await `PCore.getDataPageUtils().getDataAsync(referenceList, context, parameters, null, null)`. Extract `tableData` from `dataResult?.data?.data ?? []` (page mode) or `dataResult?.data ?? []` (form mode), and store it via `setRows` (defaulting to `[]` when not an array).
103
+ 5. **Link click handling** — define `handleLinkClick(row, column)`: when `column.isAssignmentLink`, destructure `pxRefObjectClass` and `pzInsKey` from `row` and call `thePConn.getActionsApi().openAssignment(pzInsKey, pxRefObjectClass, { containerName: thePConn.getContainerName(), channelName: '' })`; otherwise, resolve `pxRefObjectKey` from `row.pxRefObjectKey ?? row.pzInsKey` and `pxRefObjectClass` from `row.pxRefObjectClass ?? row.pxObjClass`, and when both are present, call `thePConn.getActionsApi().openWorkByHandle(pxRefObjectKey, pxRefObjectClass)`.
104
+ 6. Beyond these mandatory sections, a full implementation also needs search, pagination, sort, selection, and rendering logic (see the Behavioral Contract below for each).
105
+
106
+ > **Note:** The sections above show the MANDATORY patterns. Full implementations will also include sorting, selection, filter dialog, column menus, and PubSub subscriptions for dashboard filters. But the three critical sections above (column extraction, data fetching, link handling) MUST be present for the table to render correctly.
278
107
 
279
108
  ## Behavioral Contract
280
109
 
281
110
  ### Initialization
282
111
 
283
- `useInit(getPConnect, columns, dataPageName, payload)` hook:
112
+ The initialization utility (invoked with `getPConnect`, `columns`, `dataPageName`, and `payload`):
284
113
 
285
114
  1. Calls `initializeColumns(getPConnect, columns)` to build `configFields`.
286
115
  2. Calls `buildFieldsForTable(configFields)` to produce display column definitions.
@@ -336,15 +165,7 @@ Columns configured with `displayAsLink: true` (or `additionalDetails.type === 'D
336
165
 
337
166
  **Detection logic:**
338
167
 
339
- ```typescript
340
- const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
341
-
342
- // A column is a link if:
343
- const isLink = column.displayAsLink;
344
-
345
- // It's an assignment link if its classID is a worklist/workbasket class:
346
- const isAssignmentLink = AssignDashObjects.includes(column.classID);
347
- ```
168
+ A column is a link when `column.displayAsLink` is true. It's specifically an assignment link when its `classID` is one of the worklist/workbasket classes in `AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket']` (i.e. `AssignDashObjects.includes(column.classID)`).
348
169
 
349
170
  **Click handling:**
350
171
 
@@ -390,30 +211,24 @@ const isAssignmentLink = AssignDashObjects.includes(column.classID);
390
211
 
391
212
  ## Dependencies
392
213
 
393
- - `useInit`, `filterData`, `buildFieldsForTable`, `getConfigFields`, `initializeColumns` from `./utils`
394
- - `PCore.getDataApiUtils().getDataAsync()` — data fetching
395
- - MUI: `<Table>`, `<TableHead>`, `<TableBody>`, `<TableRow>`, `<TableCell>`, `<TableSortLabel>`, `<TablePagination>`, `<Checkbox>`, `<Radio>`, `<Dialog>`, `<TextField>`, `<Menu>`, `<MenuItem>`, `<Snackbar>`
214
+ - Local utility helpers: an initialization utility, `filterData`, `buildFieldsForTable`, `getConfigFields`, `initializeColumns`.
215
+ - `PCore.getDataApiUtils().getData()` and `PCore.getDataPageUtils().getDataAsync()` — data fetching.
216
+ - `PCore.getAnalyticsUtils().getDataViewMetadata()` — column metadata.
217
+ - The design system's table, pagination, dialog, search, and link components.
396
218
 
397
219
  ## Design System Mapping
398
220
 
399
221
  **UI control type:** Full-featured data table with sorting, pagination, search, selection, and filtering.
400
222
 
401
- Listed design systems are examples only.
402
-
403
- | Design System | Table | Pagination | Dialog | Search | Link |
404
- | ------------------ | -------------------------------------------------------------------------------------- | -------------------------- | ------------------ | ---------------- | ------------------- |
405
- | Default (CSS only) | `<table>/<thead>/<tbody>` | Custom pagination controls | `<dialog>` element | `<input>` | `<a>` |
406
- | MUI | `<Table>` + sub-components | `<TablePagination>` | `<Dialog>` | `<TextField>` | `<Link>` |
407
- | Carbon | `<DataTable>` + `<Table>/<TableHead>/<TableBody>/<TableRow>/<TableCell>/<TableHeader>` | `<Pagination>` | `<Modal>` | `<Search>` | `<Link>` |
408
- | Ant Design | `<Table>` | Built-in pagination prop | `<Modal>` | `<Input.Search>` | `<Typography.Link>` |
409
- | Chakra UI | `<Table>` | Custom or `react-table` | `<Modal>` | `<Input>` | `<Link>` |
410
- | Shadcn/ui | `<Table>` + TanStack Table | Custom pagination | `<Dialog>` | `<Input>` | `<a>` |
411
-
412
- When implementing in a specific design system:
223
+ When implementing in a specific design system, map the following:
413
224
 
414
- - **ALWAYS check `package.json`** to identify the installed design system BEFORE writing any render code
415
- - Import and use the DS's table/pagination/search/link components — do NOT fall back to plain HTML
416
- - If the DS provides a `DataTable` wrapper (e.g., Carbon), use it for built-in toolbar/search integration
417
- - `bInForm` prop affects layout — tighten spacing and remove outer chrome when `true`
225
+ - **Table** → use the DS's data table component with header/body/row/cell sub-components
226
+ - **Pagination** → use the DS's pagination component (page size selector + page navigation)
227
+ - **Search toolbar** → use the DS's search/text-input component in a toolbar area above the table
228
+ - **Link cells** → use the DS's link component for `displayAsLink` columns
229
+ - **Selection** → use radio (single) or checkbox (multi) components per row
230
+ - **Dialog/Modal** → use the DS's dialog for filter dialogs and column menu
231
+ - **Sorting** → use the DS's sort indicator on column headers (e.g., up/down arrows)
232
+ - `bInForm` affects layout — tighten spacing and remove outer chrome when `true`
418
233
  - Sorting, pagination, and search all trigger data re-fetches — do not filter client-side for server-paged data
419
234
  - Selection mode (`single`/`multi`) requires different controls and callbacks