@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
@@ -8,212 +8,87 @@ Case actions dropdown menu. Renders an "Actions" button that opens a menu of loc
8
8
 
9
9
  ## Component Purpose
10
10
 
11
- Renders a button that opens a dropdown menu containing all available case actions. Distinguishes between local actions (UI flow) and process actions (server-side), invoking the appropriate API for each. Shows a Snackbar toast on process action error.
11
+ Renders a button that opens a dropdown menu containing all available case actions. Distinguishes between local actions (UI flow) and process actions (server-side), invoking the appropriate API for each. Shows a toast notification on process action error.
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `CaseViewActionsMenu` (in `component-map.ts`)
15
+ - **Registration key:** `CaseViewActionsMenu` (in the project's component map)
16
16
  - **Category:** Page template — action menu
17
- - **Extends:** `PConnProps`
17
+ - **Extends:** the project's base component interface
18
18
 
19
- ## Props
19
+ ## Inputs
20
20
 
21
- | Prop | Type | Required | Description |
22
- | ---------------- | ---------- | -------- | ---------------------------------------------- |
23
- | `localActions` | `array` | No | Array of `{ ID, name }` local action objects |
24
- | `processActions` | `array` | No | Array of `{ ID, name }` process action objects |
25
- | `caseTypeID` | `string` | Yes | Case type identifier for label localization |
26
- | `caseTypeName` | `string` | Yes | Case type display name for label localization |
27
- | `getPConnect` | `function` | Yes | PConnect getter |
21
+ | Name | Type | Required | Description |
22
+ | -------------------- | ---------- | -------- | ---------------------------------------------- |
23
+ | `availableActions` | `array` | No | Array of `{ ID, name }` local action objects |
24
+ | `availableProcesses` | `array` | No | Array of `{ ID, name }` process action objects |
25
+ | `caseTypeID` | `string` | Yes | Case type identifier for label localization |
26
+ | `caseTypeName` | `string` | Yes | Case type display name for label localization |
27
+ | `getPConnect` | `function` | Yes | PConnect getter |
28
28
 
29
- ## Component Skeleton
29
+ ## Implementation Structure
30
30
 
31
31
  > ⚠️ **CRITICAL — USE THE PROJECT'S DESIGN SYSTEM for the trigger button and menu items.**
32
32
  >
33
- > Check `package.json` for the installed design system. Use its button component (ghost/text variant) for the "Actions…" trigger. Use its menu/dropdown if available, otherwise use a positioned `<ul>/<li>` list with CSS.
33
+ > Check `package.json` for the installed design system. Use its button component (ghost/text variant) for the "Actions…" trigger. Use its menu/dropdown if available, otherwise use a positioned list with CSS.
34
34
  >
35
- > Examples of known design systems (check `package.json` for actual installed DS):
35
+ > When implementing in a specific design system, map the following: the trigger button should use a text or ghost variant button from the installed library; the menu should use the library's dropdown/menu component if available; the toast notification should use the library's snackbar or toast primitive. When no design system is installed, use plain styled elements with a positioned list dropdown.
36
36
  >
37
- > | DS | Trigger Button | Menu Items |
38
- > | ------------------ | --------------------------------- | -------------------------------------- |
39
- > | `@carbon/react` | `<Button kind="ghost" size="sm">` | `<ul>/<li>` with CSS or `OverflowMenu` |
40
- > | `@mui/material` | `<Button variant="text">` | `<Menu>` + `<MenuItem>` |
41
- > | `antd` | `<Button type="link">` | `<Dropdown>` + `<Menu>` |
42
- > | `@chakra-ui/react` | `<Button variant="ghost">` | `<Menu>` + `<MenuItem>` |
43
- > | None / CSS-only | `<button>` with styled class | `<ul>/<li>` with CSS |
37
+ > ❌ **NEVER** use unstyled HTML elements when a design system is installed.
44
38
  >
45
- > ❌ **NEVER** use unstyled HTML `<button>` elements when a DS is installed.
46
- >
47
- > The dropdown MUST include click-outside-to-close behavior via a `useRef` + `mousedown` listener.
48
-
49
- ```typescript
50
- import { useState, useRef, useEffect } from 'react';
51
- import type { PConnProps } from '@pega/sdk-react';
52
- // Import your DS button here — e.g.:
53
- // import { Button } from '@carbon/react';
54
- // import { Button } from '@mui/material';
55
- import './CaseViewActionsMenu.css';
56
-
57
- interface CaseViewActionsMenuProps extends PConnProps {
58
- availableActions?: any[];
59
- availableProcesses?: any[];
60
- caseTypeID?: string;
61
- caseTypeName?: string;
62
- }
63
-
64
- export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
65
- const { getPConnect, availableActions = [], availableProcesses = [], caseTypeID = '', caseTypeName = '' } = props;
66
- const thePConn = getPConnect();
67
- const [open, setOpen] = useState(false);
68
- const menuRef = useRef<HTMLDivElement>(null);
69
-
70
- // Click-outside-to-close — MANDATORY
71
- useEffect(() => {
72
- function handleClickOutside(event: MouseEvent) {
73
- if (menuRef.current && !menuRef.current.contains(event.target as Node)) {
74
- setOpen(false);
75
- }
76
- }
77
- if (open) document.addEventListener('mousedown', handleClickOutside);
78
- return () => document.removeEventListener('mousedown', handleClickOutside);
79
- }, [open]);
80
-
81
- // Local action click — openLocalAction with modal container
82
- function handleActionClick(action: any) {
83
- (thePConn.getActionsApi() as any).openLocalAction(action.ID, {
84
- ...action, containerName: 'modal', type: 'express',
85
- });
86
- setOpen(false);
87
- }
88
-
89
- // Process action click — openProcessAction
90
- function handleProcessClick(process: any) {
91
- (thePConn.getActionsApi() as any).openProcessAction(process.ID, { ...process });
92
- setOpen(false);
93
- }
94
-
95
- const hasItems = availableActions.length > 0 || availableProcesses.length > 0;
96
- if (!hasItems) return null;
97
-
98
- return (
99
- <div className='psdk-actions-menu' ref={menuRef}>
100
- {/* Use the installed DS button component (ghost/text variant) — NOT plain <button> */}
101
- <DSButton
102
- variant='ghost'
103
- size='sm'
104
- onClick={() => setOpen(!open)}
105
- aria-haspopup='true'
106
- aria-expanded={open}
107
- >
108
- Actions&hellip;
109
- </DSButton>
110
- {open && (
111
- <ul className='psdk-actions-menu-dropdown' role='menu'>
112
- {availableActions.map((action: any) => (
113
- <li className='psdk-actions-menu-item' role='menuitem'
114
- key={action.ID} onClick={() => handleActionClick(action)}
115
- onKeyDown={(e) => { if (e.key === 'Enter') handleActionClick(action); }}
116
- tabIndex={0}>{action.name}</li>
117
- ))}
118
- {availableActions.length > 0 && availableProcesses.length > 0 && (
119
- <li className='psdk-actions-menu-divider' role='separator' />
120
- )}
121
- {availableProcesses.map((process: any) => (
122
- <li className='psdk-actions-menu-item' role='menuitem'
123
- key={process.ID} onClick={() => handleProcessClick(process)}
124
- onKeyDown={(e) => { if (e.key === 'Enter') handleProcessClick(process); }}
125
- tabIndex={0}>{process.name}</li>
126
- ))}
127
- </ul>
128
- )}
129
- </div>
130
- );
131
- }
132
- ```
133
-
134
- ### Required CSS file (`CaseViewActionsMenu.css`)
135
-
136
- The following CSS MUST be created alongside the component:
137
-
138
- ```css
139
- .psdk-actions-menu {
140
- position: relative;
141
- display: inline-block;
142
- }
143
- /* No trigger button CSS needed — the DS button component handles its own styling */
144
- .psdk-actions-menu-dropdown {
145
- position: absolute;
146
- top: 100%;
147
- left: 0;
148
- z-index: 1000;
149
- min-width: 160px;
150
- background: #fff;
151
- border-radius: 4px;
152
- box-shadow:
153
- 0 2px 8px rgba(0, 0, 0, 0.15),
154
- 0 1px 3px rgba(0, 0, 0, 0.1);
155
- padding: 0.25rem 0;
156
- margin: 0;
157
- list-style: none;
158
- }
159
- .psdk-actions-menu-item {
160
- padding: 0.5rem 1rem;
161
- font-size: 0.875rem;
162
- color: #161616;
163
- cursor: pointer;
164
- }
165
- .psdk-actions-menu-item:hover {
166
- background-color: #e5e5e5;
167
- }
168
- .psdk-actions-menu-item:focus-visible {
169
- outline: 2px solid #0f62fe;
170
- outline-offset: -2px;
171
- }
172
- .psdk-actions-menu-divider {
173
- border-top: 1px solid #e0e0e0;
174
- margin: 0.25rem 0;
175
- }
176
- ```
39
+ > The dropdown MUST include click-outside-to-close behavior via an instance reference on the container plus a `mousedown` document listener.
40
+
41
+ **Module Setup:** The component needs local state (for menu open/closed and toast visibility), an instance reference (for click-outside detection), a lifecycle effect (for registering/cleaning up the outside-click listener), the project's base component interface, the installed design system's button component, and companion styles.
42
+
43
+ **Main Component Logic** — steps in order:
44
+
45
+ 1. Receive inputs: `getPConnect`, `availableActions` (default `[]`), `availableProcesses` (default `[]`), `caseTypeID` (default `''`), and `caseTypeName` (default `''`); call `getPConnect()` once into `thePConn`. Declare local state `open` (boolean, default `false`) and an instance reference for the menu container element.
46
+ 2. **Click-outside-to-close (mandatory):** in a lifecycle effect keyed on `open`, register a `mousedown` document listener while `open` is true that closes the menu when the click target falls outside the container reference; clean up the listener on unmount or when `open` changes.
47
+ 3. Define `handleActionClick(action)`: call `thePConn.getActionsApi().openLocalAction(action.ID, { ...action, containerName: 'modal', type: 'express' })`, then close the menu.
48
+ 4. Define `handleProcessClick(process)`: call `thePConn.getActionsApi().openProcessAction(process.ID, { ...process })` as a promise; on rejection show a toast with `"${process.name} Submit failed!"`; then close the menu.
49
+ 5. Compute `hasItems = availableActions.length > 0 || availableProcesses.length > 0`; render nothing when there are no items.
50
+ 6. Render a `psdk-actions-menu` container (attached to the instance reference) containing: the installed design system's button (ghost/text variant) labeled "Actions…", with `aria-haspopup="true"`, `aria-expanded` bound to `open`, and an `onClick` that toggles `open`; and, when `open` is true, a `psdk-actions-menu-dropdown` list (`role="menu"`) listing each `availableActions` entry as a `psdk-actions-menu-item` item (`role="menuitem"`, keyed by `action.ID`, showing the localized `action.name`, wired to `handleActionClick` on click and Enter keydown, with `tabIndex={0}`), followed by a `psdk-actions-menu-divider` separator when both action groups are non-empty, followed by each `availableProcesses` entry rendered the same way but wired to `handleProcessClick`.
51
+
52
+ ### Required companion styles (`CaseViewActionsMenu.css`)
53
+
54
+ Create this file alongside the component with the following rules: `.psdk-actions-menu` is `position: relative; display: inline-block` (no trigger-button CSS needed since the DS button handles its own styling); `.psdk-actions-menu-dropdown` is absolutely positioned below the trigger (`top: 100%; left: 0`), with `z-index: 1000`, `min-width: 160px`, white background, `4px` border radius, a two-layer drop shadow, `0.25rem 0` padding, no margin, and no list bullets; `.psdk-actions-menu-item` has `0.5rem 1rem` padding, `0.875rem` font size, dark text color, and a pointer cursor, with a light-gray hover background and a visible focus outline (`2px solid`, `-2px` offset) on `:focus-visible`; `.psdk-actions-menu-divider` is a thin top border with `0.25rem 0` margin.
177
55
 
178
56
  ## Behavioral Contract
179
57
 
180
58
  ### Button Label
181
59
 
182
- - Localized via `PCore.getLocaleUtils().getLocaleValue('Actions', 'CaseView', 'Actions')`.
60
+ - Localized via `PCore.getLocaleUtils().getLocaleValue('Actions...', 'CaseView')`.
183
61
  - Rendered as an outlined/secondary button with a dropdown indicator icon.
184
62
 
185
63
  ### Menu Items
186
64
 
187
65
  The menu combines:
188
66
 
189
- 1. **Local actions** — each item triggers `getPConnect().getActionsApi().openLocalAction(action.ID, { caseID: getPConnect().getCaseInfo().getID() })`.
190
- 2. **Process actions** — each item triggers `getPConnect().getActionsApi().openProcessAction(action.ID, { ... })`.
67
+ 1. **Local actions** — each item triggers `getPConnect().getActionsApi().openLocalAction(action.ID, { ...action, containerName: 'modal', type: 'express' })`.
68
+ 2. **Process actions** — each item triggers `getPConnect().getActionsApi().openProcessAction(process.ID, { ...process })`.
191
69
 
192
70
  If both groups exist, render a divider between them.
193
71
 
194
72
  ### Localized Action Labels
195
73
 
196
- For localized case type context:
197
-
198
- ```
199
- localeKey = `${caseTypeID}!CASE!${caseTypeName.toUpperCase()}`
200
- ```
74
+ For localized case type context, build a `localeKey` string as `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase().
201
75
 
202
- Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, localeKey, action.name)`.
76
+ Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, '', localeKey)`.
203
77
 
204
78
  ### Process Action Error Handling
205
79
 
206
- 1. On process action click, wrap in `try/catch`.
207
- 2. On error: show Snackbar toast with the error message.
208
- 3. Snackbar auto-hides after 3000ms.
80
+ 1. On process action click, invoke the API as a promise.
81
+ 2. On rejection: show a toast notification with `"${process.name} Submit failed!"`.
82
+ 3. Toast auto-hides after 3000ms.
83
+ 4. Toast should include a close/dismiss button.
209
84
 
210
85
  ### Menu State
211
86
 
212
- - `open` boolean state controls menu visibility.
213
- - A `useRef<HTMLDivElement>` wraps the entire menu container.
214
- - On `open === true`, add a `mousedown` document listener to detect clicks outside the `ref` and close.
87
+ - `open` boolean local state controls menu visibility.
88
+ - An instance reference wraps the entire menu container.
89
+ - On `open === true`, add a `mousedown` document listener to detect clicks outside the container reference and close.
215
90
  - Remove the listener on cleanup or when `open` becomes false.
216
- - **DO NOT** use `anchorEl` pattern unless the design system provides a `Menu` component (like MUI). For CSS-only, use the `open` boolean + absolute positioning.
91
+ - **DO NOT** use an anchor-element pattern unless the design system provides a dedicated menu component. For CSS-only, use the `open` boolean + absolute positioning.
217
92
 
218
93
  ## Visual Specifications
219
94
 
@@ -221,7 +96,7 @@ Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, lo
221
96
 
222
97
  | Property | Value |
223
98
  | -------- | ------------------------------- |
224
- | Label | Localized `"Actions"` |
99
+ | Label | Localized `"Actions..."` |
225
100
  | Variant | Outlined or secondary |
226
101
  | Icon | Dropdown chevron or expand_more |
227
102
 
@@ -240,43 +115,43 @@ Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, lo
240
115
  - Menu item: `padding: 8px 16px; cursor: pointer`. Hover: `background: var(--hover-bg)`.
241
116
  - Divider: `border-top: 1px solid var(--divider-color); margin: 4px 0`.
242
117
 
243
- ### Snackbar Toast
118
+ ### Toast Notification
244
119
 
245
120
  | Property | Value |
246
121
  | --------- | ----------------------------- |
247
122
  | Position | Bottom-center or bottom-right |
248
123
  | Auto-hide | 3000ms |
249
124
  | Severity | Error (red) |
125
+ | Dismiss | Close button |
250
126
 
251
127
  ## Edge Cases & Special Logic
252
128
 
253
- - If both `localActions` and `processActions` are empty, the "Actions" button may be hidden or disabled.
129
+ - If both `availableActions` and `availableProcesses` are empty, render nothing (return null).
254
130
  - `caseTypeName.toUpperCase()` — guard against `undefined`/`null` values.
255
- - Process action errors may include HTML — sanitize before displaying in the Snackbar message.
131
+ - Process action errors may include HTML — sanitize before displaying in the toast message.
256
132
  - Menu should close on any item click (both local and process).
257
133
 
258
134
  ## Dependencies
259
135
 
260
136
  - `PCore.getLocaleUtils().getLocaleValue()` — label localization
261
- - `PConnectComponent` from `@pega/sdk-react`
262
- - MUI: `<Button>`, `<Menu>`, `<MenuItem>`, `<Divider>`, `<Snackbar>`
137
+ - `getPConnect().getActionsApi()` — local action and process action invocation
138
+ - The project's base component interface
139
+ - The installed design system's button, menu, and toast components (check `package.json`)
263
140
 
264
141
  ## Design System Mapping
265
142
 
266
143
  **UI control type:** Dropdown action menu with button trigger and toast error notification.
267
144
 
268
- Listed design systems are examples only.
145
+ When implementing in a specific design system, map the following:
269
146
 
270
- | Design System | Button | Menu | Toast |
271
- | ------------------ | -------------------------------------- | -------------------- | ----------------------------- |
272
- | Default (CSS only) | `<button>` + custom dropdown | `<ul>/<li>` with CSS | Custom toast overlay |
273
- | MUI | `<Button>` + `<Menu>/<MenuItem>` | MUI Menu | `<Snackbar>/<Alert>` |
274
- | Ant Design | `<Dropdown menu={{ items }}>` | Ant Dropdown | `message.error()` |
275
- | Chakra UI | `<Menu>/<MenuButton>/<MenuList>` | Chakra Menu | `useToast()` |
276
- | Shadcn/ui | `<DropdownMenu>/<DropdownMenuTrigger>` | Shadcn DropdownMenu | `<Toaster>` + `toast.error()` |
147
+ - **Trigger button:** Use the design system's text or ghost-variant button. The button label is the localized "Actions..." string. It must support `aria-haspopup` and `aria-expanded` attributes.
148
+ - **Menu/Dropdown:** Use the design system's menu or dropdown primitive if available. If none exists, use a positioned list with CSS and manual open/close logic. Items must support click handlers and keyboard activation (Enter key).
149
+ - **Divider:** Use the design system's divider or separator between the local actions group and the process actions group.
150
+ - **Toast notification:** Use the design system's snackbar or toast component to surface process action errors. Must auto-hide after 3000ms and include a dismiss/close button.
151
+ - **Click-outside-to-close:** If the design system's menu handles this natively, rely on that. Otherwise implement manually with an instance reference and a document `mousedown` listener.
277
152
 
278
- When implementing in a specific design system:
153
+ Key constraints regardless of design system:
279
154
 
280
155
  - Local vs process action distinction must be preserved — they call different APIs
281
- - Localized labels via `localeKey = ${caseTypeID}!CASE!${caseTypeName.toUpperCase()}`
156
+ - Localized labels via `localeKey = ${caseTypeID}!CASE!${caseTypeName}`.toUpperCase()
282
157
  - Process action errors must be surfaced via a dismissible toast
@@ -15,13 +15,13 @@ Case confirmation template. Renders the post-submission confirmation view with a
15
15
  > 1. `PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget())` — gets active container item
16
16
  > 2. `PCore.getContainerUtils().getContainerItemData(target, activeItemID)` — gets root info for close event
17
17
  > 3. `PCore.getPubSubUtils().publish(CONSTS.PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo)` — proper close event with payload
18
- > 4. `getComponentFromRegistry('Details')` — for rendering case details in confirmation
18
+ > 4. Look up the `'Details'` component from the project's component registry — for rendering case details in confirmation
19
19
  > 5. `getToDoAssignments(getPConnect())` — from `PCore.getSDKUtils().getSDKContainerUtils()`
20
20
  > 6. Check `showDetails` before rendering Details component
21
21
  >
22
22
  > **Minimum Implementation Checklist:**
23
23
  >
24
- > - [ ] `PCore.getContainerUtils()` used for close event (NOT a simple `setShowConfirmView(false)`)
24
+ > - [ ] `PCore.getContainerUtils()` used for close event (NOT a simple toggle of local state)
25
25
  > - [ ] `rootInfo` passed to `CLOSE_CONFIRM_VIEW` pub/sub event
26
26
  > - [ ] Details component rendered when `showDetails` is true
27
27
  > - [ ] ToDo component rendered with `getToDoAssignments` when `showTasks` is true
@@ -35,111 +35,64 @@ Displayed after a case or assignment is submitted. Shows the confirmation view (
35
35
 
36
36
  ## Pega Metadata
37
37
 
38
- - **Registration key:** `Confirmation` (in `component-map.ts`)
38
+ - **Registration key:** `Confirmation` (in the project's component map)
39
39
  - **Category:** Page template — confirmation
40
- - **Extends:** `PConnProps`
41
-
42
- ## Props
43
-
44
- | Prop | Type | Required | Description |
45
- | ------------- | ------------- | -------- | ----------------------------------------------------------------------------- |
46
- | `children` | `ReactNode[]` | Yes | Region children: `[0]` = ToDo region, `[1]` = Details region (when available) |
47
- | `getPConnect` | `function` | Yes | PConnect getter |
48
-
49
- ## Component Skeleton
50
-
51
- ```typescript
52
- import { type PropsWithChildren, useState } from 'react';
53
- import { getComponentFromRegistry } from '@pega/sdk-react';
54
- import type { PConnProps } from '@pega/sdk-react';
55
-
56
- interface ConfirmationProps extends PConnProps {
57
- datasource: { source: any };
58
- label: string;
59
- showLabel: boolean;
60
- showTasks: boolean;
61
- }
62
-
63
- export default function Confirmation(props: PropsWithChildren<ConfirmationProps>) {
64
- const ToDo = getComponentFromRegistry('Todo'); // NOTE: 'Todo' not 'ToDo'
65
- const Details = getComponentFromRegistry('Details');
66
-
67
- const CONSTS = PCore.getConstants();
68
- const [showConfirmView, setShowConfirmView] = useState(true);
69
- const { showTasks, getPConnect, showLabel, label } = props;
70
-
71
- // 1. Get active container + root info
72
- const activeContainerItemID = PCore.getContainerUtils()
73
- .getActiveContainerItemName(getPConnect().getTarget() || '');
74
- const rootInfo = PCore.getContainerUtils()
75
- .getContainerItemData(getPConnect().getTarget(), activeContainerItemID);
76
-
77
- // 2. Get todo assignments
78
- const { getToDoAssignments } = PCore.getSDKUtils().getSDKContainerUtils();
79
- const toDoList = getToDoAssignments(getPConnect());
80
-
81
- // 3. Done button handler
82
- const onConfirmViewClose = () => {
83
- setShowConfirmView(false);
84
- PCore.getPubSubUtils().publish(
85
- PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo
86
- );
87
- };
88
-
89
- // 4. Show details check
90
- const showDetails = props.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;
91
-
92
- // 5. Render: confirm view OR todo view
93
- if (showConfirmView) {
94
- return (
95
- <Card>
96
- <h2>{showLabel ? label : ''}</h2>
97
- {showDetails && <Details {...props} showLabel={false} />}
98
- {showTasks && toDoList?.length > 0 && (
99
- <ToDo datasource={{ source: toDoList }} getPConnect={getPConnect}
100
- type={CONSTS.TODO} headerText="Open Tasks" isConfirm />
101
- )}
102
- <DoneButton onClick={onConfirmViewClose}>Done</DoneButton>
103
- </Card>
104
- );
105
- }
106
- return toDoList?.length > 0 ? (
107
- <Card>
108
- <ToDo datasource={{ source: toDoList }} getPConnect={getPConnect}
109
- type={CONSTS.TODO} headerText="Tasks" isConfirm />
110
- </Card>
111
- ) : null;
112
- }
113
- ```
40
+ - **Extends:** the project's base component interface
41
+
42
+ ## Inputs
43
+
44
+ | Input | Type | Required | Description |
45
+ | ------------- | ------------------ | -------- | ----------------------------------------------------------------------------- |
46
+ | `children` | child element list | Yes | Region children: `[0]` = ToDo region, `[1]` = Details region (when available) |
47
+ | `getPConnect` | function | Yes | PConnect getter |
48
+ | `datasource` | object | No | Shape `{ source: any }` — what's-next data source |
49
+ | `label` | string | No | Confirmation heading text |
50
+ | `showLabel` | boolean | No | Whether to render the heading label |
51
+ | `showTasks` | boolean | No | Whether to render outstanding ToDo assignments |
52
+
53
+ ## Implementation Structure
54
+
55
+ **Module Setup:** This component needs the project's base component interface for typing, the project's component registry for retrieving `ToDo` and `Details` dynamically, and a local state primitive for tracking the confirm-view toggle. Define a companion styles block with padding and margin (1 spacing unit on all sides) applied to the card wrapper.
56
+
57
+ **Main Component Logic** — steps in order:
58
+
59
+ 1. Retrieve `ToDo` from the project's component registry using the key `'Todo'` (note the capitalization — not `'ToDo'`), and `Details` similarly using `'Details'`.
60
+ 2. Set `CONSTS = PCore.getConstants()`; declare local state `showConfirmView` initialized to `true`; receive inputs `showTasks`, `getPConnect`, `showLabel`, and `label`.
61
+ 3. Get the active container and root info: `activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget() || '')`, then `rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID)`.
62
+ 4. Get pending ToDo assignments: destructure `getToDoAssignments` from `PCore.getSDKUtils().getSDKContainerUtils()`, then call `toDoList = getToDoAssignments(getPConnect())`.
63
+ 5. Define the Done-button handler `onConfirmViewClose`: set `showConfirmView` to `false`, then publish `PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo)`.
64
+ 6. Compute `showDetails` by checking whether the first child's nested PConnect has children: `children?.[0]` → get its `getPConnect()` → call `getChildren()` → check `length > 0`.
65
+ 7. **Render — confirm view:** if `showConfirmView` is true, render a card container (with companion styles) containing: a heading with the label (when `showLabel` is true); the Details component (with `showLabel` set to false) when `showDetails` is true; the ToDo component (with `datasource: { source: toDoList }`, `getPConnect`, `type: CONSTS.TODO`, `headerText: "Open Tasks"`, `isConfirm: true`) when `showTasks` is true and `toDoList` is non-empty; and a primary Done button aligned to the end, wired to `onConfirmViewClose`.
66
+ 8. **Render — post-close:** otherwise, if `toDoList` is non-empty, render a card container containing just the ToDo component (same inputs as above but `headerText: "Tasks"`); if `toDoList` is empty, render nothing.
114
67
 
115
68
  ## Behavioral Contract
116
69
 
117
70
  ### State
118
71
 
119
- - `showConfirmView`: boolean, initially `true`.
72
+ - `showConfirmView`: boolean local state, initially `true`.
120
73
  - `toDoAssignments`: array from `getToDoAssignments(getPConnect())` — pending assignments.
121
74
 
122
75
  ### Done Button Click
123
76
 
124
- 1. Call `getPConnect().getContainerManager().closeContainerItem(getPConnect().getContainerName())`.
125
- 2. OR call `PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getContainerName())`.
126
- 3. Check remaining `toDoAssignments`.
127
- 4. If assignments remain: `setShowConfirmView(false)` — show ToDo view instead.
128
- 5. If no assignments remain: publish `PCore.getPubSubUtils().publish(CLOSE_CONFIRM_VIEW, {})`.
77
+ 1. Set `showConfirmView` local state to `false`.
78
+ 2. Publish `PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo)`.
79
+ 3. The `rootInfo` payload is derived from `PCore.getContainerUtils().getContainerItemData(target, activeContainerItemID)` — this is mandatory for correct container closure.
129
80
 
130
81
  ### Show Details
131
82
 
132
- - `showDetails`: `children.length > 1` — true when a Details region is present.
83
+ - `showDetails`: true when the first child region's PConnect has children (i.e., there is content to display in the Details area).
133
84
 
134
- ### Render: Confirm View (`showConfirmView === true`)
85
+ ### Render: Confirm View (showConfirmView is true)
135
86
 
136
- 1. Confirmation message header (localized `"Your submission is confirmed"` or equivalent).
137
- 2. If `showDetails`: render `children[1]` (Details region) using `createElement(PConnectComponent, ...)`.
138
- 3. Done button (`localized "Done"`) — triggers done click handler above.
87
+ 1. Confirmation heading label (when `showLabel` is true).
88
+ 2. If `showDetails`: render the Details component retrieved from the project's component registry with `showLabel` set to false, passing the current component's inputs.
89
+ 3. If `showTasks` and `toDoList` is non-empty: render the ToDo component with `datasource: { source: toDoList }`, `type: CONSTS.TODO`, `headerText: "Open Tasks"`, `isConfirm: true`.
90
+ 4. Done button (primary action) — triggers `onConfirmViewClose`.
139
91
 
140
- ### Render: ToDo View (`showConfirmView === false`)
92
+ ### Render: Post-Close View (showConfirmView is false)
141
93
 
142
- - Render `children[0]` (ToDo region) using `createElement(PConnectComponent, ...)`.
94
+ - If `toDoList` is non-empty: render a card with the ToDo component (`headerText: "Tasks"`, same core inputs).
95
+ - If `toDoList` is empty: render nothing.
143
96
 
144
97
  ## Visual Specifications
145
98
 
@@ -147,52 +100,50 @@ export default function Confirmation(props: PropsWithChildren<ConfirmationProps>
147
100
 
148
101
  | Element | Description |
149
102
  | ------------------- | --------------------------------------------- |
150
- | Confirmation header | Success icon + heading text |
103
+ | Confirmation header | Heading text (label) when showLabel is true |
151
104
  | Details section | Optional — rendered below confirmation header |
152
- | Done button | Primary button, bottom of the form |
105
+ | Done button | Primary button, aligned to end of the form |
153
106
 
154
107
  **CSS-only implementation notes:**
155
108
 
156
- - Confirm view: `display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 2rem`.
157
- - Success icon: large checkmark or success indicator, centered.
158
- - Confirmation heading: `font-size: 1.5rem; font-weight: 600; text-align: center`.
159
- - Done button: `align-self: flex-end` or centered.
109
+ - Card wrapper: padding and margin of 1 spacing unit on all sides.
110
+ - Done button container: `display: flex; justify-content: flex-end`.
111
+ - Confirmation heading: rendered as a level-2 heading element.
160
112
 
161
113
  ### ToDo View
162
114
 
163
- - Full-width ToDo region rendered in place of confirmation.
115
+ - Full-width ToDo region rendered in place of confirmation inside a card wrapper.
164
116
  - No additional wrapping — render the region directly.
165
117
 
166
118
  ## Edge Cases & Special Logic
167
119
 
168
- - `getToDoAssignments(getPConnect())` — returns empty array if no assignments remain; triggers close publish immediately.
169
- - `children[1]` may not exist — always check `showDetails` before rendering.
120
+ - `getToDoAssignments(getPConnect())` — returns empty array if no assignments remain; when empty in post-close state, renders nothing.
121
+ - The first child region may not have Details content — always check `showDetails` before rendering the Details component.
170
122
  - `CLOSE_CONFIRM_VIEW` is a PubSub constant — ensure it matches the consuming container's subscription key.
171
123
  - The confirmation view should not be navigable backward — Done is the only exit.
124
+ - The ToDo registry key is `'Todo'` (capital T, lowercase odo) — this is the ConstellationJS Engine convention.
172
125
 
173
126
  ## Dependencies
174
127
 
175
- - `getToDoAssignments` from `../../helpers/case-utils` (or equivalent)
176
- - `PCore.getPubSubUtils().publish()` — for CLOSE_CONFIRM_VIEW event
177
- - `PCore.getContainerUtils()` — for container item management
178
- - `PConnectComponent` from `@pega/sdk-react`
128
+ - The project's component registry — for retrieving `'Todo'` and `'Details'` components dynamically at runtime
129
+ - `PCore.getSDKUtils().getSDKContainerUtils().getToDoAssignments` — for retrieving pending assignments
130
+ - `PCore.getPubSubUtils().publish()` — for the CLOSE_CONFIRM_VIEW event
131
+ - `PCore.getContainerUtils()` — for container item management (active item name + container item data)
132
+ - `PCore.getConstants()` — for PubSub event keys and TODO type constant
179
133
 
180
134
  ## Design System Mapping
181
135
 
182
136
  **UI control type:** Post-submission confirmation page with done action and optional todo view.
183
137
 
184
- Listed design systems are examples only.
138
+ When implementing in a specific design system, map the following:
185
139
 
186
- | Design System | Success Indicator | Done Button | Layout |
187
- | ------------------ | ------------------------------ | ------------------------------ | --------------------------------------------- |
188
- | Default (CSS only) | CSS checkmark SVG | `<button class='primary'>` | Centered flexbox column |
189
- | MUI | `<CheckCircleIcon>` | `<Button variant='contained'>` | `<Box display='flex' flexDirection='column'>` |
190
- | Ant Design | `<Result status='success'>` | `<Button type='primary'>` | Ant Result component |
191
- | Chakra UI | `<CheckCircleIcon>` + `<Text>` | `<Button colorScheme='blue'>` | `<VStack>` |
192
- | Shadcn/ui | Custom icon + `<h2>` | `<Button>` | Tailwind centered div |
140
+ - **Card wrapper:** Use the design system's card or surface container component with standard padding/margin.
141
+ - **Done button:** Use the design system's primary action button component.
142
+ - **Heading:** Use a level-2 heading or the design system's title typography component.
143
+ - **Layout:** A vertical flex column layout containing heading, optional details, optional todo list, and the done button at the end.
193
144
 
194
- When implementing in a specific design system:
145
+ Implementation constraints regardless of design system:
195
146
 
196
- - Done button must check remaining `toDoAssignments` before deciding whether to show ToDo view or close
197
- - `CLOSE_CONFIRM_VIEW` publish must happen only after confirming no assignments remain
198
- - `showDetails` check must guard `children[1]` access
147
+ - Done button must trigger `onConfirmViewClose` which both toggles local state and publishes the `CLOSE_CONFIRM_VIEW` event with `rootInfo`
148
+ - `showDetails` check must guard Details component rendering
149
+ - ToDo component receives `isConfirm: true` to signal it is rendered within a confirmation context