@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
@@ -2,7 +2,7 @@
2
2
 
3
3
  File upload/download widget for case attachments. Behaves like a form field — binds to a case attachment property, supports multiple files, validates extensions and size, tracks upload progress, and blocks form submission during active uploads.
4
4
 
5
- > **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
5
+ > **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, inputs interface, data-fetching patterns, and registration conventions common to ALL widget components.
6
6
 
7
7
  ---
8
8
 
@@ -12,84 +12,48 @@ Renders a file attachment control within a Pega form. Users can upload one or mu
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `Attachment` (in `component-map.ts`)
15
+ - **Registration key:** `Attachment` (registered in the project's component map)
16
16
  - **Category:** Widget — form field (file input)
17
- - **Extends:** `Omit<PConnFieldProps, 'value'>` (uses `value: any` instead of the standard string value)
18
-
19
- ## Props
20
-
21
- | Prop | Type | Required | Description |
22
- | ------------------ | ------------------- | -------------------------- | ---------------------------------------------------------------------------- |
23
- | `value` | `any` | Yes | Attachment list or single attachment object (from Pega property) |
24
- | `allowMultiple` | `boolean \| string` | No | Whether multiple files can be attached. Default `false` |
25
- | `extensions` | `string` | No | Comma-separated list of allowed file extensions (e.g., `".pdf,.doc,.jpg"`) |
26
- | `editMode` | `string` | No | `"tableRows"` for inline table edit mode (special multi-attachment handling) |
27
- | `isTableFormatter` | `boolean` | No | Whether this widget is used inside a table formatter |
28
- | `label` | `string` | Yes (from PConnFieldProps) | Field label |
29
- | `required` | `boolean` | No | Whether a file is required |
30
- | `disabled` | `boolean` | No | Whether the control is disabled |
31
- | `displayMode` | `string` | No | `"DISPLAY_ONLY"` for read-only rendering |
32
- | `validatemessage` | `string` | No | Validation error message to display |
33
- | `helperText` | `string` | No | Helper text shown below the control |
34
- | `getPConnect` | `function` | Yes | PConnect getter |
35
-
36
- ## Component Skeleton
17
+ - **Extends:** the project's base component interface (with `value` typed as `any` instead of the standard string value)
18
+
19
+ ## Inputs
20
+
21
+ | Input | Type | Required | Description |
22
+ | ------------------ | ------------------- | ------------------------- | ---------------------------------------------------------------------------- |
23
+ | `value` | `any` | Yes | Attachment list or single attachment object (from Pega property) |
24
+ | `allowMultiple` | `boolean \| string` | No | Whether multiple files can be attached. Default `false` |
25
+ | `extensions` | `string` | No | Comma-separated list of allowed file extensions (e.g., `".pdf,.doc,.jpg"`) |
26
+ | `editMode` | `string` | No | `"tableRows"` for inline table edit mode (special multi-attachment handling) |
27
+ | `isTableFormatter` | `boolean` | No | Whether this widget is used inside a table formatter |
28
+ | `label` | `string` | Yes (from base interface) | Field label |
29
+ | `required` | `boolean` | No | Whether a file is required |
30
+ | `disabled` | `boolean` | No | Whether the control is disabled |
31
+ | `displayMode` | `string` | No | `"DISPLAY_ONLY"` for read-only rendering |
32
+ | `validatemessage` | `string` | No | Validation error message to display |
33
+ | `helperText` | `string` | No | Helper text shown below the control |
34
+ | `getPConnect` | `function` | Yes | PConnect getter |
35
+
36
+ ## Implementation Structure
37
37
 
38
38
  This is a complex form-field widget (~400 lines). Key structural outline:
39
39
 
40
- ```typescript
41
- import { useState, useEffect, useCallback, useMemo, useRef } from 'react';
42
- import { validateMaxSize } from '../../helpers/attachmentShared';
43
- import { clearFieldErrorMessages, deleteAttachments, getIconFromFileType, insertAttachments,
44
- useDeepMemo, useFileDownload, validateFileExtension } from './AttachmentUtils';
45
- import type { PConnFieldProps } from '@pega/sdk-react';
46
- import './Attachment.css';
47
-
48
- interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
49
- value: any; allowMultiple: boolean | string; extensions: string;
50
- editMode: string; isTableFormatter: boolean;
51
- }
52
-
53
- export default function Attachment(props: AttachmentProps) {
54
- const { value, getPConnect, label, validatemessage, extensions, displayMode, helperText, editMode, isTableFormatter } = props;
55
- let { required, disabled, allowMultiple } = props;
56
- // Coerce string booleans
57
- [required, disabled, allowMultiple] = [required, disabled, allowMultiple].map(
58
- p => p === true || (typeof p === 'string' && p === 'true')
59
- );
60
- const pConn = getPConnect();
61
- const actionSequencer = useMemo(() => PCore.getActionsSequencer(), []);
62
- const contextName = pConn.getContextName();
63
-
64
- // 1. Normalize attachment data (old vs new format)
65
- const { attachments, isOldAttachment } = PCore.getAttachmentUtils().prepareAttachmentData(value);
66
- // 2. Set reference list
67
- let valueRef = (pConn.getStateProps() as any).value;
68
- pConn.setReferenceList(`.${valueRef}`);
69
-
70
- // 3. State: files array, error tracking, upload toggle
71
- const [files, setFiles] = useState(attachments);
72
- const [toggleUploadBegin, setToggleUploadBegin] = useState(false);
73
-
74
- // 4. deleteFile — removes from state, calls deleteAttachments, deregisters sequencer
75
- // 5. onFileAdded — validates extension + size, adds to files, sets toggleUploadBegin
76
- // 6. uploadFiles — registerBlockingAction, uploadAttachment per file, insertAttachments on success
77
- // 7. useEffect: trigger uploadFiles when toggleUploadBegin changes
78
- // 8. useEffect: subscribe to ASSIGNMENT_SUBMISSION for state override
79
-
80
- // 9. Render: label + upload button + validation message + file list with progress/delete
81
- return (
82
- <div className="file-upload-container">
83
- <label>{label}</label>
84
- {/* Upload button (hidden input + styled button) */}
85
- {/* Validation/helper text */}
86
- {/* File list: icon + name + meta + progress + delete button */}
87
- </div>
88
- );
89
- }
90
- ```
91
-
92
- > **Key patterns:** Action sequencer blocking (`registerBlockingAction`/`deRegisterBlockingAction`), `prepareAttachmentData` normalization, per-file progress tracking, `insertAttachments`/`deleteAttachments` helpers for Redux state.
40
+ **Module Setup:** The component requires local state, lifecycle effects, cached callbacks, memoized computations, and instance references. It depends on `validateMaxSize` from the project's attachment helpers, as well as `clearFieldErrorMessages`, `deleteAttachments`, `getIconFromFileType`, `insertAttachments`, a deep-memo utility, a file-download utility, and `validateFileExtension` from the component's own utility module. The component's inputs interface extends the project's base component interface (with `value` as `any`) plus `allowMultiple` (boolean or string), `extensions` (string), `editMode` (string), and `isTableFormatter` (boolean).
41
+
42
+ **Main Component Logic** — steps in order:
43
+
44
+ 1. Receive `value`, `getPConnect`, `label`, `validatemessage`, `extensions`, `displayMode`, `helperText`, `editMode`, and `isTableFormatter` from inputs; also receive `required`, `disabled`, and `allowMultiple` as mutable locals. Coerce each of `required`, `disabled`, and `allowMultiple` to a real boolean (true when the value is literally `true` or the string `'true'`), since these may arrive as string booleans.
45
+ 2. Call `getPConnect()` into `pConn`; store `actionSequencer = PCore.getActionsSequencer()` via a memoized computation (no dependencies); resolve `contextName = pConn.getContextName()`.
46
+ 3. **Normalize attachment data** (old vs. new format): call `PCore.getAttachmentUtils().prepareAttachmentData(value)` to get `{ attachments, isOldAttachment }`.
47
+ 4. **Set the reference list**: read `valueRef` from `(pConn.getStateProps() as any).value`, then call `pConn.setReferenceList('.' + valueRef)`.
48
+ 5. Declare local state: `files` (array, initialized from `attachments`) and `toggleUploadBegin` (boolean, default `false`).
49
+ 6. Define `deleteFile`: removes the file from local state, calls `deleteAttachments`, and deregisters it from the action sequencer.
50
+ 7. Define `onFileAdded`: validates the file's extension and size, adds it to `files`, and sets `toggleUploadBegin`.
51
+ 8. Define `uploadFiles`: registers a blocking action via the sequencer, uploads each file via `uploadAttachment`, and calls `insertAttachments` on success.
52
+ 9. In a lifecycle effect keyed on `toggleUploadBegin`, trigger `uploadFiles` when it changes.
53
+ 10. In another lifecycle effect, subscribe to the `ASSIGNMENT_SUBMISSION` event for state override (block submission while uploads are pending).
54
+ 11. **Render**: a container element with the field `label`, an upload button (hidden native file input plus a styled button), validation/helper text, and the file list — each row showing an icon, name, metadata, upload progress, and a delete button.
55
+
56
+ > **Key patterns:** Action sequencer blocking (`registerBlockingAction`/`deRegisterBlockingAction`), `prepareAttachmentData` normalization, per-file progress tracking, `insertAttachments`/`deleteAttachments` helpers for state management.
93
57
 
94
58
  ## Behavioral Contract
95
59
 
@@ -97,25 +61,17 @@ export default function Attachment(props: AttachmentProps) {
97
61
 
98
62
  Pega has two attachment data formats — detect which one is in use:
99
63
 
100
- **Old format (annotation-based):**
101
-
102
- ```typescript
103
- value = { pxResults: [...], pyAttachCount: N }
104
- ```
105
-
106
- **New standard format:**
64
+ **Old format (annotation-based):** `value` is an object shaped like `{ pxResults: [...], pyAttachCount: N }`.
107
65
 
108
- ```typescript
109
- value = [{ ID, name, mimeType, category, ... }] // array
110
- ```
66
+ **New standard format:** `value` is an array of attachment objects, each shaped like `{ ID, name, mimeType, category, ... }`.
111
67
 
112
68
  Call `PCore.getAttachmentUtils().prepareAttachmentData(value)` to normalize both formats into a unified `FileObject[]` array.
113
69
 
114
70
  ### File Validation
115
71
 
116
- On file selection (via `<input type='file'>`):
72
+ On file selection (via a file-picker control):
117
73
 
118
- 1. **Extension check:** Compare selected file's extension against `extensions` prop (split by comma). If not allowed, add an error to the file and do not upload.
74
+ 1. **Extension check:** Compare selected file's extension against the `extensions` input (split by comma). If not allowed, add an error to the file and do not upload.
119
75
  2. **Size check:** Compare file size against `PCore.getEnvironmentInfo().getMaxAttachmentSize()` (in bytes). If too large, add a size error.
120
76
  3. Valid files proceed to upload.
121
77
 
@@ -123,7 +79,7 @@ On file selection (via `<input type='file'>`):
123
79
 
124
80
  1. Call `PCore.getActionsSequencer().addAction('attachment_upload_' + fileId)` — blocks form submission.
125
81
  2. Call `PCore.getAttachmentUtils().uploadAttachment(file, onProgress, onError, context)`.
126
- 3. On progress: update per-file `progress` value (0–100) in state.
82
+ 3. On progress: update per-file `progress` value (0–100) in local state.
127
83
  4. On success: add the returned attachment metadata to the local file list; update the Pega property via `pConn.setReferenceList(newAttachmentList)`.
128
84
  5. Call `PCore.getActionsSequencer().removeAction('attachment_upload_' + fileId)` — unblocks form submission.
129
85
  6. On error: set file error state; call `PCore.getMessageManager().addMessages([errorMessage])`.
@@ -170,7 +126,7 @@ Compressed display for use inside a table cell. Show attachment count and a smal
170
126
  ## Edge Cases & Special Logic
171
127
 
172
128
  - `allowMultiple` may be a string `"true"` / `"false"` or a boolean — always coerce: `allowMultiple === true || allowMultiple === 'true'`.
173
- - Upload progress: track per-file progress in a `Map<fileId, number>` state object.
129
+ - Upload progress: track per-file progress in a map of `fileId → number` in local state.
174
130
  - `isTableFormatter`: when `true`, hide the label and reduce padding for compact table display.
175
131
  - Concurrent uploads: multiple files may upload simultaneously — the sequencer action must be keyed per-file.
176
132
  - Max size: call `PCore.getEnvironmentInfo().getMaxAttachmentSize()` at validation time (not at mount) — size config may be dynamic.
@@ -178,30 +134,28 @@ Compressed display for use inside a table cell. Show attachment count and a smal
178
134
 
179
135
  ## Dependencies
180
136
 
181
- - `AttachmentUtils.ts` — `validateExtension`, `validateSize`, `getFileTypeIcon`, `buildDownloadURL`, error handling helpers
182
- - `Attachment.types.ts` — `FileObject`, `AttachmentLinks`, `PageInstructionOptions` type definitions
137
+ - The project's attachment utility module — `validateExtension`, `validateSize`, `getFileTypeIcon`, `buildDownloadURL`, error handling helpers
138
+ - The project's attachment type definitions — `FileObject`, `AttachmentLinks`, `PageInstructionOptions`
183
139
  - `PCore.getAttachmentUtils()` — upload, download, prepareAttachmentData
184
140
  - `PCore.getActionsSequencer()` — block/unblock form submission during upload
185
141
  - `PCore.getEnvironmentInfo()` — max attachment size
186
142
  - `PCore.getMessageManager()` — error message display
187
143
  - `PCore.getPubSubUtils()` — before-submit subscription
188
- - `downloadjs` library — browser file download trigger
144
+ - A file-download utility — browser file download trigger
189
145
 
190
146
  ## Design System Mapping
191
147
 
192
148
  **UI control type:** File upload form field with progress tracking, validation, and attachment list.
193
149
 
194
- Listed design systems are examples only.
150
+ When implementing in a specific design system, map the following:
195
151
 
196
- | Design System | File Input | Progress | File List |
197
- | ------------------ | -------------------------------------------------- | ------------------------------- | ------------------------- |
198
- | Default (CSS only) | `<input type='file'>` + custom styled drop zone | `<progress>` element or CSS bar | `<ul>/<li>` rows |
199
- | MUI | Custom styled `<Box>` drop zone + hidden `<input>` | `<LinearProgress>` | `<List>/<ListItem>` |
200
- | Ant Design | `<Upload dragger>` | `<Progress>` | Built-in upload file list |
201
- | Chakra UI | Custom `<Box>` with `useDropzone` | `<Progress>` | `<VStack>` rows |
202
- | Shadcn/ui | Custom drop zone | Custom CSS progress bar | `<ul>/<li>` rows |
152
+ - **File input / drop zone:** A clickable upload area (optionally supporting drag-and-drop) backed by a hidden native file input. The design system's file-picker or upload component can replace the custom drop zone, but the hidden native input pattern works universally.
153
+ - **Progress indicator:** A linear progress bar (determinate, 0–100) shown per-file during upload. Use the design system's linear progress component or a CSS-based bar.
154
+ - **File list:** A vertical list of uploaded file rows. Each row contains: a file-type icon, the file name, file size metadata, the progress indicator (during upload), and a delete action button. Use the design system's list component or simple styled rows.
155
+ - **Error text:** Validation or upload error messages displayed below the control in an error color.
156
+ - **Helper text:** Secondary descriptive text below the control.
203
157
 
204
- When implementing in a specific design system:
158
+ Implementation notes:
205
159
 
206
160
  - Action sequencer blocking (`addAction`/`removeAction`) is mandatory — do not skip it; form submission must be blocked during uploads
207
161
  - Detect and normalize both old and new attachment formats via `prepareAttachmentData`
@@ -2,119 +2,61 @@
2
2
 
3
3
  Case history widget. Fetches and displays the full audit trail for the current case in a table with Date, Description, and Performer columns.
4
4
 
5
- > **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
5
+ > **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, the base component interface, data-fetching patterns, and registration conventions common to ALL widget components.
6
6
 
7
7
  ---
8
8
 
9
9
  ## Component Purpose
10
10
 
11
- Renders a table of case events sourced from the `D_pyWorkHistory` data page. Shows when each event happened (`pyUpdatedDateTime`), what happened (`pyMessageKey`), and who performed it (`pyPerformer`). Uses `fast-deep-equal` to skip unnecessary re-renders when data has not changed.
11
+ Renders a table of case events sourced from the `D_pyWorkHistory` data page. Shows when each event happened (`pxTimeCreated`), what happened (`pyMessageKey`), and who performed it (`pyPerformer`). Uses a deep-equality utility to skip unnecessary re-renders when data has not changed.
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `CaseHistory` (in `component-map.ts`)
15
+ - **Registration key:** `CaseHistory` (in the project's component map)
16
16
  - **Category:** Widget — case data display
17
- - **Extends:** `PConnProps`
17
+ - **Extends:** the project's base component interface
18
18
 
19
- ## Props
19
+ ## Inputs
20
20
 
21
- | Prop | Type | Required | Description |
21
+ | Input | Type | Required | Description |
22
22
  | ------------- | ---------- | -------- | ----------------------------------------------------- |
23
23
  | `getPConnect` | `function` | Yes | PConnect getter — used to resolve case ID and context |
24
24
 
25
- ## Component Skeleton
26
-
27
- ```typescript
28
- import { useEffect, useRef, useState } from 'react';
29
- import isDeepEqual from 'fast-deep-equal/react';
30
- import { Utils } from '../../helpers/utils';
31
- import type { PConnProps } from '@pega/sdk-react';
32
-
33
- interface CaseHistoryProps extends PConnProps {}
34
-
35
- export default function CaseHistory(props: CaseHistoryProps) {
36
- const { getPConnect } = props;
37
- const thePConn = getPConnect();
38
- const rowData = useRef([]);
39
- const [waitingForData, setWaitingForData] = useState(true);
40
-
41
- const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, '');
42
- const context = thePConn.getContextName();
43
-
44
- const displayedColumns = [
45
- { label: thePConn.getLocalizedValue('Date', '', ''), type: 'DateTime', fieldName: 'pxTimeCreated' },
46
- { label: thePConn.getLocalizedValue('Description', '', ''), type: 'TextInput', fieldName: 'pyMessageKey' },
47
- { label: thePConn.getLocalizedValue('Performed by', '', ''), type: 'TextInput', fieldName: 'pyPerformer' },
48
- ];
49
-
50
- // 1. Fetch D_pyWorkHistory on mount
51
- useEffect(() => {
52
- let active = true;
53
- PCore.getDataApiUtils().getData('D_pyWorkHistory',
54
- { dataViewParameters: [{ CaseInstanceKey: caseID }] }, context
55
- ).then((historyJSON: any) => {
56
- if (active) {
57
- computeRowData(historyJSON.data.data);
58
- setWaitingForData(false);
59
- }
60
- });
61
- return () => { active = false; };
62
- }, []);
63
-
64
- // 2. computeRowData — format dates, use isDeepEqual to prevent unnecessary updates
65
- function computeRowData(rows) {
66
- const theRowData = rows.map(row => displayedColumns.map(col =>
67
- col.type === 'DateTime' ? Utils.generateDateTime(row[col.fieldName], 'DateTime-Short') : row[col.fieldName]
68
- ));
69
- if (!isDeepEqual(theRowData, rowData.current)) rowData.current = theRowData;
70
- }
71
-
72
- // 3. Render: Table with 3 columns, '---' for missing values
73
- return (
74
- <TableContainer>
75
- <Table>
76
- <TableHead><TableRow>{displayedColumns.map(col => <TableCell key={col.fieldName}>{col.label}</TableCell>)}</TableRow></TableHead>
77
- <TableBody>
78
- {rowData.current.map((row, i) => (
79
- <TableRow key={i}>{row.map((cell, j) => <TableCell key={j}>{cell || '---'}</TableCell>)}</TableRow>
80
- ))}
81
- </TableBody>
82
- </Table>
83
- </TableContainer>
84
- );
85
- }
86
- ```
87
-
88
- No additional custom props. All data is fetched internally.
25
+ ## Implementation Structure
26
+
27
+ **Module Setup:** Requires local state, an instance reference, and a lifecycle effect. Also needs a deep-equality utility and the project's SDK utility helpers for date formatting. The component interface extends the project's base component interface (no additional custom inputs).
28
+
29
+ **Main Component Logic** — steps in order:
30
+
31
+ 1. Receive `getPConnect` from inputs; call it once into `thePConn`. Declare a `rowData` instance reference (initialized to an empty array) and a `waitingForData` local state boolean (default `true`).
32
+ 2. Resolve `caseID` via `thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, '')` and `context` via `thePConn.getContextName()`.
33
+ 3. Build a `displayedColumns` array of three column descriptors, each with a localized `label` (via `thePConn.getLocalizedValue`), a `type`, and a `fieldName`: Date (`'DateTime'`, `pxTimeCreated`), Description (`'TextInput'`, `pyMessageKey`), and Performed by (`'TextInput'`, `pyPerformer`).
34
+ 4. **Fetch `D_pyWorkHistory` on mount** — in a lifecycle effect that runs once on initialization, using a guard flag to prevent post-teardown state updates: call `PCore.getDataApiUtils().getData('D_pyWorkHistory', { dataViewParameters: [{ CaseInstanceKey: caseID }] }, context)`; on resolution, when still active, call `computeRowData` with `historyJSON.data.data` and set `waitingForData` to `false`. In the teardown callback, set the guard flag to `false` so the state setter is never called after the component is destroyed.
35
+ 5. Define `computeRowData(rows)`: map each row to an array of cell values, one per `displayedColumns` entry — formatting `DateTime`-type columns through the SDK utility helper `generateDateTime(row[col.fieldName], 'DateTime-Short')` and passing other column values through as-is. Compare the resulting `theRowData` against the current `rowData` instance reference using the deep-equality utility, and only update the instance reference when the data has actually changed (this avoids unnecessary re-renders).
36
+ 6. **Render** a table with three columns and `'---'` as the placeholder for missing or falsy cell values. The header row renders one cell per `displayedColumns` entry (using its `label`). The body renders one row per entry in the `rowData` instance reference, with one cell per value (falling back to `'---'` when the value is falsy).
37
+
38
+ No additional custom inputs. All data is fetched internally.
89
39
 
90
40
  ## Behavioral Contract
91
41
 
92
42
  ### Data Fetch
93
43
 
94
- On mount, fetch history from the `D_pyWorkHistory` data page:
95
-
96
- ```
97
- PCore.getDataApiUtils().getData(
98
- 'D_pyWorkHistory',
99
- { pyCaseInsKey: caseKey },
100
- context
101
- )
102
- ```
44
+ On mount, fetch history from the `D_pyWorkHistory` data page by calling `PCore.getDataApiUtils().getData('D_pyWorkHistory', { dataViewParameters: [{ CaseInstanceKey: caseID }] }, context)`.
103
45
 
104
- - `caseKey` = `pConn.getCaseInfo().getKey()` (the fully-qualified case key).
105
- - `context` = `pConn.getContextName()`.
106
- - Store result in `historyData` state array.
107
- - On error or empty response, `historyData` stays as `[]`.
46
+ - `caseID` = `thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, '')`.
47
+ - `context` = `thePConn.getContextName()`.
48
+ - Store result in a `rowData` instance reference.
49
+ - On error or empty response, `rowData` stays as `[]`.
108
50
 
109
51
  ### Re-render Optimization
110
52
 
111
- Use `fast-deep-equal/react` to compare new `historyData` with previous value — only call `setHistoryData` if the data has actually changed. This prevents unnecessary re-renders caused by reference inequality.
53
+ Use a deep-equality utility to compare new row data with the previous value — only update the stored data if it has actually changed. This prevents unnecessary re-renders caused by reference inequality.
112
54
 
113
55
  ### Data Transformation
114
56
 
115
57
  For each history row, map:
116
58
 
117
- - **Date column:** Format `pyUpdatedDateTime` using the SDK date formatter (e.g., `formatDateTime(row.pyUpdatedDateTime)`) or display as-is.
59
+ - **Date column:** Format `pxTimeCreated` using the SDK date formatting utility (e.g., `generateDateTime(row.pxTimeCreated, 'DateTime-Short')`).
118
60
  - **Description column:** `row.pyMessageKey` — the localized event description string.
119
61
  - **Performer column:** `row.pyPerformer` — the operator who performed the action.
120
62
  - Missing values: display `"---"` for any undefined/null field.
@@ -123,51 +65,26 @@ For each history row, map:
123
65
 
124
66
  ### Table Layout
125
67
 
126
- | Column | Field | Width |
127
- | ----------- | ------------------------------- | ----- |
128
- | Date | `pyUpdatedDateTime` (formatted) | ~25% |
129
- | Description | `pyMessageKey` | ~50% |
130
- | Performer | `pyPerformer` | ~25% |
131
-
132
- **CSS-only implementation notes:**
68
+ | Column | Field | Width |
69
+ | ------------ | --------------------------- | ----- |
70
+ | Date | `pxTimeCreated` (formatted) | ~25% |
71
+ | Description | `pyMessageKey` | ~50% |
72
+ | Performed by | `pyPerformer` | ~25% |
133
73
 
134
- - Table container: `width: 100%; overflow-x: auto`.
135
- - Table: `border-collapse: collapse; width: 100%`.
136
- - Header cells: `background: var(--table-header-bg); font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--divider-color)`.
137
- - Body cells: `padding: 8px 12px; border-bottom: 1px solid var(--divider-color)`.
138
- - Missing value placeholder `"---"`: `color: var(--secondary-text-color)`.
139
- - No pagination in the reference implementation — all rows shown.
74
+ The table header cells should have a distinct background color, bold text, and 1px solid borders. Body cells should have 1px solid borders in a silver/neutral tone. Missing-value placeholders (`"---"`) should be visually subdued. Use the design system's table component for consistent styling. No pagination in the reference implementation — all rows are shown.
140
75
 
141
76
  ## Edge Cases & Special Logic
142
77
 
143
78
  - `D_pyWorkHistory` may return an empty array for cases with no history events — render an empty table body (or an empty-state message like `"No history available"`).
144
- - `pyUpdatedDateTime` format varies — always run it through the SDK date formatter before display.
79
+ - `pxTimeCreated` format varies — always run it through the SDK date formatting utility before display.
145
80
  - `pyMessageKey` may be a locale key — resolve it via `PCore.getLocaleUtils().getLocaleValue()` if a localized string is required.
146
81
  - The widget has no pagination — for cases with very long history, the table may become very tall. Consider adding pagination if needed.
82
+ - The lifecycle effect teardown callback sets a guard flag to prevent calling state setters after component destruction, avoiding framework warnings about unmounted state updates.
147
83
 
148
84
  ## Dependencies
149
85
 
150
86
  - `PCore.getDataApiUtils().getData()` — fetches `D_pyWorkHistory` data page
151
- - `fast-deep-equal/react` — prevents unnecessary re-renders
87
+ - A deep-equality utility — prevents unnecessary re-renders by comparing row data before updating
152
88
  - `PCore.getConstants().CASE_INFO.CASE_INFO_ID` — resolves case ID constant
153
- - MUI: `<Table>`, `<TableBody>`, `<TableCell>`, `<TableContainer>`, `<TableHead>`, `<TableRow>`
154
-
155
- ## Design System Mapping
156
-
157
- **UI control type:** Read-only case audit table with 3 columns.
158
-
159
- Listed design systems are examples only.
160
-
161
- | Design System | Table |
162
- | ------------------ | --------------------------------------------------------------------------------- |
163
- | Default (CSS only) | `<table>/<thead>/<tbody>/<tr>/<td>` |
164
- | MUI | `<TableContainer>` + `<Table>` + `<TableHead>/<TableBody>/<TableRow>/<TableCell>` |
165
- | Ant Design | `<Table dataSource={historyData} columns={...}>` |
166
- | Chakra UI | `<Table>` + `<Thead>/<Tbody>/<Tr>/<Th>/<Td>` |
167
- | Shadcn/ui | `<Table>` + `<TableHeader>/<TableBody>/<TableRow>/<TableHead>/<TableCell>` |
168
-
169
- When implementing in a specific design system:
170
-
171
- - `fast-deep-equal` comparison is a performance optimization — include it to avoid redundant renders on re-subscription
172
- - Data page name `D_pyWorkHistory` is fixed — do not make it configurable
173
- - Missing field fallback `"---"` should be consistent across all three columns
89
+ - The project's SDK utility helpers — for date formatting (`generateDateTime`)
90
+ - The design system's table component (container, header, body, row, and cell elements)