@pega/sdk 0.0.5 → 0.0.7

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 (269) hide show
  1. package/README.md +10 -3
  2. package/dist/index.js +828 -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/mcp/claude-code.mcp.json +8 -0
  159. package/templates/react-sdk-reference/.ai-common/mcp/copilot.mcp.json +8 -0
  160. package/templates/react-sdk-reference/.ai-common/mcp/cursor.mcp.json +11 -0
  161. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
  162. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
  163. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
  164. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
  165. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
  166. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
  167. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
  168. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
  169. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
  170. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
  171. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
  172. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
  173. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
  174. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
  175. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
  176. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
  177. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
  178. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
  179. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
  180. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
  181. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
  182. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
  183. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
  184. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
  185. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
  186. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
  187. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
  188. package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
  189. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
  190. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
  191. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
  192. package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
  193. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
  194. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
  195. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
  196. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
  197. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
  198. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
  199. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
  200. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
  201. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
  202. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
  203. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
  204. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
  205. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
  206. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
  207. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
  208. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
  209. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
  210. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
  211. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
  212. package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
  213. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
  214. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
  215. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
  216. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
  217. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
  218. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
  219. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
  220. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
  221. package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
  222. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
  223. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
  224. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
  225. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
  226. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
  227. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
  228. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
  229. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
  230. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
  231. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
  232. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
  233. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
  234. package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
  235. package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
  236. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
  237. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
  238. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
  239. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
  240. package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
  241. package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
  242. package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
  243. package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
  244. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
  245. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
  246. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
  247. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
  248. package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
  249. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
  250. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
  251. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
  252. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
  253. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
  254. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
  255. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
  256. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
  257. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
  258. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
  259. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
  260. package/templates/react-sdk-reference/package.json +1 -1
  261. package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
  262. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  263. package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
  264. package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
  265. package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
  266. package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
  267. package/templates/react-native-sdk-reference/App.tsx +0 -49
  268. package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
  269. package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
@@ -1,22 +1,16 @@
1
1
  # Skill: DataReference
2
2
 
3
- Data reference template. Routes to field, table, or search renderers based on `selectionMode` and `displayAs` props. Handles deferred data source loading, dropdown options, and multi-select variants.
3
+ Data reference template. Routes to field, table, or search renderers based on `selectionMode` and `displayAs` inputs. Handles deferred data source loading, dropdown options, and multi-select variants.
4
4
 
5
5
  > **Prerequisite skill:** [`template-components.md`](../template-components.md) — covers architecture, child rendering patterns, and registration conventions common to ALL template components.
6
6
 
7
7
  ---
8
8
 
9
- > ⚠️ **CRITICAL — DataReference is a CHILDREN PASS-THROUGH**
9
+ > ⚠️ **CRITICAL — DataReference is a CONTENT-PROJECTION PASS-THROUGH**
10
10
  >
11
- > This component MUST render its React `children` directly. The PConnect bridge already resolves
12
- > the correct sub-components (Dropdown, AutoComplete, SingleReferenceReadOnly, etc.) and passes
13
- > them as `children`. DataReference just passes them through.
11
+ > This component MUST render children provided via content projection directly. The PConnect bridge already resolves the correct sub-components (Dropdown, AutoComplete, SingleReferenceReadOnly, etc.) and passes them as projected content. DataReference just passes them through.
14
12
  >
15
- > ```typescript
16
- > // ✅ CORRECT — simple children pass-through
17
- > const childArray = Array.isArray(children) ? children : [children].filter(Boolean);
18
- > return childArray.length === 1 ? childArray[0] : <div>{childArray}</div>;
19
- > ```
13
+ > The correct implementation is a simple pass-through: normalize the projected children to a list (if already a list use it directly, otherwise wrap the single item in a list filtering out empty entries), then return the single child directly if there is exactly one, otherwise wrap the list in a container element.
20
14
  >
21
15
  > ❌ **NEVER call `pConn.createComponent()`** — causes "Maximum call stack size exceeded" (infinite recursion back to form templates)
22
16
  > ❌ **NEVER call `firstChildPConnect().createComponent()`** — causes "getPConnect is not a function" when child PConnect isn't ready
@@ -33,13 +27,13 @@ Renders a data reference field that can be displayed as a dropdown, autocomplete
33
27
 
34
28
  ## Pega Metadata
35
29
 
36
- - **Registration key:** `DataReference` (in `component-map.ts`)
30
+ - **Registration key:** `DataReference` (in the project's component map)
37
31
  - **Category:** Form template — data selection
38
- - **Extends:** `PConnProps`
32
+ - **Extends:** the project's base component interface
39
33
 
40
- ## Props
34
+ ## Inputs
41
35
 
42
- | Prop | Type | Required | Description |
36
+ | Input | Type | Required | Description |
43
37
  | -------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------ |
44
38
  | `label` | `string` | Yes | Field label |
45
39
  | `displayAs` | `string` | Yes | UI variant: `'dropdown'`, `'autocomplete'`, `'checkbox'`, `'radiobutton'`, `'listview'`, `'searchbox'` |
@@ -57,34 +51,15 @@ Renders a data reference field that can be displayed as a dropdown, autocomplete
57
51
  | `fieldMetadata` | `object` | No | Extra field-level metadata |
58
52
  | `getPConnect` | `function` | Yes | PConnect getter |
59
53
 
60
- ## Component Skeleton
61
-
62
- ```typescript
63
- import { type PropsWithChildren, type ReactElement } from 'react';
64
- import type { PConnProps } from '@pega/sdk-react';
65
-
66
- interface DataReferenceProps extends PConnProps {
67
- displayMode?: string;
68
- selectionMode?: string;
69
- displayAs?: string;
70
- parameters?: any;
71
- hideLabel?: boolean;
72
- }
73
-
74
- export default function DataReference(props: PropsWithChildren<DataReferenceProps>) {
75
- // DataReference is a pass-through wrapper.
76
- // The PConnect bridge resolves the correct sub-components (Dropdown, AutoComplete,
77
- // SingleReferenceReadOnly, MultiReferenceReadOnly, etc.) and passes them as children.
78
- // ⚠️ DO NOT call pConn.createComponent() or firstChildPConnect().createComponent() here —
79
- // it causes "getPConnect is not a function" errors or infinite recursion.
80
- const { children } = props;
81
- const childArray = Array.isArray(children) ? children : [children].filter(Boolean);
82
-
83
- return childArray.length === 1
84
- ? (childArray[0] as ReactElement ?? null)
85
- : <div>{childArray}</div>;
86
- }
87
- ```
54
+ ## Implementation Structure
55
+
56
+ **Main Component Logic** — steps in order:
57
+
58
+ This component is a pure pass-through wrapper. The PConnect bridge resolves the correct sub-components (Dropdown, AutoComplete, SingleReferenceReadOnly, MultiReferenceReadOnly, etc.) and passes them as projected content. Do NOT call `pConn.createComponent()` or `firstChildPConnect().createComponent()` here — it causes "getPConnect is not a function" errors or infinite recursion.
59
+
60
+ 1. Receive inputs, including projected children content.
61
+ 2. Normalize the projected children into a list: if already a list use it directly, otherwise wrap the single item in a list filtering out empty entries.
62
+ 3. Return the single child directly if the list has exactly one element; otherwise wrap the full list in a container element.
88
63
 
89
64
  ## Behavioral Contract
90
65
 
@@ -92,9 +67,9 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
92
67
 
93
68
  If `displayMode === 'DISPLAY_ONLY'` or `readOnly === true`:
94
69
 
95
- - `selectionMode === 'single'` → render `<SingleReferenceReadOnly />`.
96
- - `selectionMode === 'multi'` → render `<MultiReferenceReadOnly />`.
97
- - Both receive all relevant props plus `getPConnect`.
70
+ - `selectionMode === 'single'` → render `SingleReferenceReadOnly`.
71
+ - `selectionMode === 'multi'` → render `MultiReferenceReadOnly`.
72
+ - Both receive all relevant inputs plus `getPConnect`.
98
73
 
99
74
  ### Edit Routing (by `displayAs`)
100
75
 
@@ -111,17 +86,17 @@ If `displayMode === 'DISPLAY_ONLY'` or `readOnly === true`:
111
86
  ### Deferred Data Source (`isDDSourceDeferred === true`)
112
87
 
113
88
  1. On mount, call `PCore.getDataApiUtils().getData(dataSourceName, parameters)`.
114
- 2. Store result in `dropDownDataSource` state.
115
- 3. Pass `dropDownDataSource` to the rendered field component as `datasource`.
89
+ 2. Store result in local state for the dropdown data source.
90
+ 3. Pass that data source to the rendered field component as `datasource`.
116
91
 
117
92
  ### Localized Placeholder
118
93
 
119
- - Generate a localized "Please select..." option via `localizedPlaceholderOption` using `PCore.getLocaleUtils().getLocaleValue(...)`.
120
- - Prepend this option to `dropDownDataSource` for dropdown/autocomplete variants.
94
+ - Generate a localized "Please select..." option via `PCore.getLocaleUtils().getLocaleValue(...)`.
95
+ - Prepend this option to the dropdown data source for dropdown/autocomplete variants.
121
96
 
122
97
  ### SearchForm Sub-Component
123
98
 
124
- When `displayAs === 'searchbox'`, renders an inline `<SearchForm>` sub-component that:
99
+ When `displayAs === 'searchbox'`, renders an inline SearchForm sub-component that:
125
100
 
126
101
  1. Shows a text input with search icon.
127
102
  2. On submit: calls `getPConnect().getListActions().search(searchText)`.
@@ -129,27 +104,25 @@ When `displayAs === 'searchbox'`, renders an inline `<SearchForm>` sub-component
129
104
 
130
105
  ## Visual Specifications
131
106
 
132
- **CSS-only implementation notes:**
133
-
134
- - Wrapper: `display: flex; flex-direction: column; gap: 4px`.
135
- - Label: `font-size: 0.875rem; font-weight: 500; margin-bottom: 4px`.
107
+ - Wrapper: vertical flex layout with 4px gap.
108
+ - Label: 0.875rem font size, weight 500, 4px bottom margin.
136
109
  - Dropdown/Autocomplete: standard select input, full-width.
137
110
  - Checkbox/Radio group: grid layout matching `numCols`.
138
- - SearchForm: `display: flex; gap: 8px` (input + search button).
111
+ - SearchForm: horizontal flex layout with 8px gap (input + search button).
139
112
 
140
113
  ## Edge Cases & Special Logic
141
114
 
142
- - `isDDSourceDeferred` — data is not available synchronously; show a loading indicator until `dropDownDataSource` resolves.
115
+ - `isDDSourceDeferred` — data is not available synchronously; show a loading indicator until the dropdown data source resolves.
143
116
  - `parameters` may contain property references — resolve them via `pConn.getValue(paramRef)` before passing to `getData`.
144
117
  - `listType === 'associated'` — use `pConn.getFieldMetadata().options` directly instead of fetching from data page.
145
- - Card variant (`displayAs === 'listview'`) — may include image props (`image`, `imagePlaceholder`) from `getComponentConfig()`.
118
+ - Card variant (`displayAs === 'listview'`) — may include image inputs (`image`, `imagePlaceholder`) from `getComponentConfig()`.
146
119
  - Multi-select with `displayAs === 'checkbox'` — values stored as comma-separated string in the property.
147
120
 
148
121
  ## Dependencies
149
122
 
150
123
  - `SingleReferenceReadOnly` (registered DSE or template component)
151
124
  - `MultiReferenceReadOnly` (registered template component)
152
- - Field components from registry: `Dropdown`, `AutoComplete`, `CheckboxGroup`, `RadioButtons`
125
+ - Field components from the project's component registry: `Dropdown`, `AutoComplete`, `CheckboxGroup`, `RadioButtons`
153
126
  - `PCore.getDataApiUtils().getData()` — for deferred data source fetch
154
127
  - `PCore.getLocaleUtils().getLocaleValue()` — for localized placeholder
155
128
 
@@ -157,17 +130,9 @@ When `displayAs === 'searchbox'`, renders an inline `<SearchForm>` sub-component
157
130
 
158
131
  **UI control type:** Polymorphic data selection field — dropdown, autocomplete, checkbox, radiobutton, or search variants.
159
132
 
160
- Listed design systems are examples only.
161
-
162
- | Design System | Dropdown | Autocomplete | Checkbox Group | Radio Group |
163
- | ------------------ | --------------------- | ---------------- | ------------------------------ | --------------------------- |
164
- | Default (CSS only) | `<select>` | Custom combobox | `<input type='checkbox'>` list | `<input type='radio'>` list |
165
- | MUI | `<Select>/<MenuItem>` | `<Autocomplete>` | `<FormGroup><Checkbox>` | `<RadioGroup><Radio>` |
166
- | Ant Design | `<Select>` | `<AutoComplete>` | `<Checkbox.Group>` | `<Radio.Group>` |
167
- | Chakra UI | `<Select>` | Custom | `<CheckboxGroup>` | `<RadioGroup>` |
168
- | Shadcn/ui | `<Select>` + combobox | `<Combobox>` | custom | `<RadioGroup>` |
133
+ When implementing in a specific design system, use the appropriate select/combobox component for dropdown and autocomplete variants, a checkbox group component for the checkbox variant, a radio group component for the radiobutton variant, and native or custom search input for the searchbox variant. Each design system will have its own equivalents for these control types.
169
134
 
170
- When implementing in a specific design system:
135
+ Design considerations:
171
136
 
172
137
  - Always check `displayMode`/`readOnly` first and route to read-only components before rendering editable variants
173
138
  - Deferred loading must be handled — show skeleton/spinner until data is ready
@@ -8,92 +8,50 @@ Standard form layout template supporting 1, 2, or 3 column arrangements. Renders
8
8
 
9
9
  > ⚠️ **CRITICAL — DO NOT SIMPLIFY THIS COMPONENT**
10
10
  >
11
- > This component REQUIRES the `connectToState` HOC to function. Without it, **form fields will NOT render** because they won't receive visibility and state props from the Redux store.
11
+ > This component REQUIRES the project's state-connection wrapper to function. Without it, **form fields will NOT render** because they won't receive visibility and state updates from the application store.
12
12
  >
13
- > **NEVER** replace the `connectToState` pattern with plain `createElement(PConnectComponent, ...)`. That pattern does not subscribe children to the store and results in invisible/non-functional form fields.
13
+ > **NEVER** replace the state-connection wrapper pattern with plain rendering of the project's PConnect bridge utility. That pattern does not subscribe children to the store and results in invisible/non-functional form fields.
14
14
  >
15
15
  > **MANDATORY artifacts when generating this component:**
16
16
  >
17
- > 1. `DefaultForm.tsx` — with `connectToState` HOC wrapping each child
18
- > 2. `utils/index.ts` — containing `mapStateToProps` and `getKeyForMappedField`
19
- > 3. `DefaultForm.css` — column layout styles (or DS equivalent)
20
- > 4. `index.tsx` — re-export
17
+ > 1. Main component file — with state-connection wrapper wrapping each child
18
+ > 2. A utilities module — containing `mapStateToProps` and `getKeyForMappedField`
19
+ > 3. Companion styles — column layout styles (or DS equivalent)
20
+ > 4. Re-export module
21
21
 
22
22
  ---
23
23
 
24
24
  ## Component Purpose
25
25
 
26
- Renders a form's fields in a 1, 2, or 3-column grid layout. Children come from a PConnect region (unwrapped one level). Each child field is connected to the Redux store via a `connectToState` HOC so visibility and prop updates flow reactively. Instruction HTML is displayed above the form when present.
26
+ Renders a form's fields in a 1, 2, or 3-column grid layout. Children come from a PConnect region (unwrapped one level). Each child field is connected to the application store via the project's state-connection wrapper so visibility and state updates flow reactively. Instruction HTML is displayed above the form when present.
27
27
 
28
28
  ## Pega Metadata
29
29
 
30
- - **Registration key:** `DefaultForm` (in `component-map.ts`)
30
+ - **Registration key:** `DefaultForm` (in the project's component map)
31
31
  - **Category:** Form template
32
- - **Extends:** `PConnProps`
32
+ - **Extends:** The project's base component interface
33
33
 
34
- ## Props
34
+ ## Inputs
35
35
 
36
- | Prop | Type | Required | Description |
36
+ | Input | Type | Required | Description |
37
37
  | -------------- | ---------- | -------- | -------------------------------------------------------- |
38
38
  | `NumCols` | `string` | No | Number of columns: `'1'`, `'2'`, or `'3'`. Default `'1'` |
39
39
  | `instructions` | `string` | No | HTML instruction text shown above the form |
40
40
  | `getPConnect` | `function` | Yes | PConnect getter |
41
41
 
42
- ## Component Skeleton
43
-
44
- ```typescript
45
- import { createElement } from 'react';
46
- import { getInstructions } from '../../helpers/template-utils';
47
- import { PConnectComponent } from '@pega/sdk-react';
48
- import connectToState from '../../helpers/state-utils';
49
- import { getKeyForMappedField, mapStateToProps } from './utils';
50
- import type { PConnProps } from '@pega/sdk-react';
51
- import './DefaultForm.css';
52
-
53
- interface DefaultFormProps extends PConnProps {
54
- NumCols: string;
55
- instructions: string;
56
- }
57
-
58
- // HOC: wraps each field in Redux store subscription
59
- const Child = connectToState(mapStateToProps)((props) => {
60
- const { key, visibility, ...rest } = props;
61
- return createElement(PConnectComponent, { ...rest, key, visibility });
62
- });
63
-
64
- export default function DefaultForm(props) {
65
- const { getPConnect, NumCols = '1' } = props;
66
- const instructions = getInstructions(getPConnect(), props.instructions);
67
-
68
- // 1. Determine CSS class from NumCols
69
- const numCols = NumCols || '1';
70
- let divClass;
71
- switch (numCols) {
72
- case '1': divClass = 'psdk-default-form-one-column'; break;
73
- case '2': divClass = 'psdk-default-form-two-column'; break;
74
- case '3': divClass = 'psdk-default-form-three-column'; break;
75
- default: divClass = 'psdk-default-form-one-column'; break;
76
- }
77
-
78
- // 2. Unwrap region children (first child is a region → get ITS children)
79
- const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
80
- const dfChildren = arChildren?.map(kid =>
81
- <Child key={getKeyForMappedField(kid)} {...kid} />
82
- );
83
-
84
- // 3. Render: optional instructions HTML + column grid of children
85
- return (
86
- <>
87
- {instructions && (
88
- <div className="psdk-default-form-instruction-text">
89
- <div dangerouslySetInnerHTML={{ __html: instructions }} />
90
- </div>
91
- )}
92
- <div className={divClass}>{dfChildren}</div>
93
- </>
94
- );
95
- }
96
- ```
42
+ ## Implementation Structure
43
+
44
+ **Module Setup:** This component needs: an element-creation utility from the framework; the project's template-utils helper (provides `getInstructions`); the project's PConnect bridge utility (renders each child field); the project's state-connection wrapper (connects fields to the application store); `getKeyForMappedField` and `mapStateToProps` from the companion utilities module; the project's base component interface (for typing); and companion styles for column layouts. The component's input contract extends the base component interface with `NumCols: string` and `instructions: string`.
45
+
46
+ Outside the main component logic, define a `Child` wrapper using the project's state-connection wrapper invoked with `mapStateToProps`. This wrapper receives `key`, `visibility`, and the remaining inputs, then renders the project's PConnect bridge utility with those values. Defining this outside the component ensures it isn't recreated on every render cycle.
47
+
48
+ **Main Component Logic** — steps in order:
49
+
50
+ 1. Receive inputs: extract `getPConnect` and `NumCols` (default `'1'`); compute `instructions = getInstructions(getPConnect(), inputs.instructions)`.
51
+ 2. **Resolve column count:** switch on `NumCols || '1'` to pick a CSS class: `'1'` → `psdk-default-form-one-column`, `'2'` → `psdk-default-form-two-column`, `'3'` → `psdk-default-form-three-column`, default → `psdk-default-form-one-column`.
52
+ 3. **Unwrap region children:** the first child is a region wrapper, so drill into it via `getPConnect().getChildren()[0].getPConnect().getChildren()` to get the actual array of form fields (`arChildren`).
53
+ 4. **Wrap each child:** map `arChildren` to a `Child` element with `key={getKeyForMappedField(kid)}` and all field data spread as inputs, producing `dfChildren`.
54
+ 5. **Render:** when `instructions` is truthy, render a `psdk-default-form-instruction-text` container holding another element with the instructions as raw inner HTML; always render a container with the resolved column class (`divClass`) containing `dfChildren`.
97
55
 
98
56
  ## Behavioral Contract
99
57
 
@@ -102,19 +60,16 @@ export default function DefaultForm(props) {
102
60
  - `'2'` → `psdk-default-form-two-column`
103
61
  - `'3'` → `psdk-default-form-three-column`
104
62
  - Default → `psdk-default-form-one-column`
105
- 2. **Get instructions:** Call `getInstructions(getPConnect(), props.instructions)` — returns sanitized HTML string or empty.
63
+ 2. **Get instructions:** Call `getInstructions(getPConnect(), inputs.instructions)` — returns sanitized HTML string or empty.
106
64
  3. **Unwrap region children:** `arChildren = getPConnect().getChildren()[0].getPConnect().getChildren()` — the first child is a region; its children are the actual form fields.
107
- 4. **Wrap each child:** Create a `Child` component using `connectToState(mapStateToProps)` HOC wrapping `PConnectComponent`. Map each field:
108
- ```
109
- arChildren.map((kid) => <Child key={getKeyForMappedField(kid)} {...kid} />)
110
- ```
65
+ 4. **Wrap each child:** Create a `Child` component using the project's state-connection wrapper invoked with `mapStateToProps`, which in turn renders the project's PConnect bridge utility. Map each field to a Child element with `key={getKeyForMappedField(kid)}` and all field data spread.
111
66
  5. **Render:**
112
- - If instructions, render `<div className='psdk-default-form-instruction-text'>` with `dangerouslySetInnerHTML={{ __html: instructions }}`.
113
- - Render `<div className={divClass}>{dfChildren}</div>`.
67
+ - If instructions, render a `psdk-default-form-instruction-text` container with raw HTML content of the instructions.
68
+ - Render a container with `divClass` holding `dfChildren`.
114
69
 
115
70
  ## Visual Specifications
116
71
 
117
- Derived from `DefaultForm.css`:
72
+ Derived from companion styles:
118
73
 
119
74
  ### Column Layouts
120
75
 
@@ -134,68 +89,42 @@ Derived from `DefaultForm.css`:
134
89
 
135
90
  ### Instruction Text
136
91
 
137
- | Property | Value |
138
- | --------- | ------------------------------------------------ |
139
- | CSS class | `psdk-default-form-instruction-text` |
140
- | Content | Raw HTML rendered with `dangerouslySetInnerHTML` |
92
+ | Property | Value |
93
+ | --------- | -------------------------------------------- |
94
+ | CSS class | `psdk-default-form-instruction-text` |
95
+ | Content | Raw HTML rendered as inner HTML of container |
141
96
 
142
97
  ## Edge Cases & Special Logic
143
98
 
144
99
  - `NumCols` is a string (not number) — always compare with string literals `'1'`, `'2'`, `'3'`.
145
100
  - The region unwrap (`getChildren()[0].getPConnect().getChildren()`) assumes the form metadata has exactly one region child. Guard against `undefined` if the region child is missing.
146
- - `connectToState(mapStateToProps)` HOC subscribes each field to the Redux store — if Redux is not available, fall back to rendering `PConnectComponent` directly without the HOC.
147
- - `getKeyForMappedField(kid)` generates a stable key for each field from the field's metadata path — import from `./utils`.
101
+ - The project's state-connection wrapper with `mapStateToProps` subscribes each field to the application store — if the store is not available, fall back to rendering the PConnect bridge utility directly without the wrapper.
102
+ - `getKeyForMappedField(kid)` generates a stable key for each field from the field's metadata path — provided by the companion utilities module.
148
103
  - Instructions HTML is server-sanitized (comment in source code) — do not sanitize again on the client.
149
104
 
150
105
  ## Dependencies
151
106
 
152
- - `getInstructions` from `../../helpers/template-utils` — extracts instruction text from PConnect metadata
153
- - `connectToState` from `../../helpers/state-utils` — HOC for Redux store subscription
154
- - `PConnectComponent` from `@pega/sdk-react` — renders each child field
155
- - `getKeyForMappedField`, `mapStateToProps` from `./utils` — key generation and state mapping
156
-
157
- ## Mandatory File: `utils/index.ts`
158
-
159
- You MUST create this file alongside `DefaultForm.tsx`. Without it, the component will not compile.
107
+ - The project's template-utils helper (provides `getInstructions`) — extracts instruction text from PConnect metadata
108
+ - The project's state-connection wrapper — connects each child to the application store for visibility and state updates
109
+ - The project's PConnect bridge utility — renders each child field
110
+ - `getKeyForMappedField`, `mapStateToProps` from the companion utilities module — key generation and state mapping
160
111
 
161
- ```typescript
162
- export const mapStateToProps: any = (_, ownProps) => {
163
- const { getPConnect } = ownProps;
112
+ ## Mandatory File: Utilities Module
164
113
 
165
- return {
166
- visibility: getPConnect().getComputedVisibility(),
167
- getPConnect,
168
- };
169
- };
114
+ You MUST create a utilities module alongside the main component file. Without it, the component will not compile. It must export two members:
170
115
 
171
- export const getKeyForMappedField = (field) => {
172
- if (Array.isArray(field)) {
173
- return field
174
- .map((item) => {
175
- return getKeyForMappedField(item);
176
- })
177
- .join('__');
178
- }
179
-
180
- const pConnect = field?.getPConnect?.();
181
-
182
- if (pConnect?.meta) {
183
- return JSON.stringify(pConnect.meta);
184
- }
185
-
186
- return crypto.randomUUID();
187
- };
188
- ```
116
+ - `mapStateToProps`: a function taking `(_, ownInputs)` that extracts `getPConnect` from `ownInputs` and returns `{ visibility: getPConnect().getComputedVisibility(), getPConnect }`.
117
+ - `getKeyForMappedField`: a function taking a `field` that generates a stable render key. If `field` is an array, recursively map `getKeyForMappedField` over each item and join the results with `'__'`. Otherwise, read `field?.getPConnect?.()`; if its `meta` is present, return `JSON.stringify(pConnect.meta)`; otherwise fall back to `crypto.randomUUID()`.
189
118
 
190
119
  ## Post-Generation Checklist
191
120
 
192
121
  After generating this component, verify ALL of the following:
193
122
 
194
- - [ ] `connectToState` is imported from `../../helpers/state-utils`
195
- - [ ] `mapStateToProps` and `getKeyForMappedField` are imported from `./utils`
196
- - [ ] `const Child = connectToState(mapStateToProps)(...)` is defined OUTSIDE the component function
197
- - [ ] Each child field is rendered via `<Child key={getKeyForMappedField(kid)} {...kid} />`
198
- - [ ] `utils/index.ts` file is created with `mapStateToProps` and `getKeyForMappedField`
123
+ - [ ] The project's state-connection wrapper is imported from the state-utils helper
124
+ - [ ] `mapStateToProps` and `getKeyForMappedField` are imported from the utilities module
125
+ - [ ] The state-connected `Child` wrapper is defined OUTSIDE the main component logic
126
+ - [ ] Each child field is rendered via the `Child` wrapper with `key={getKeyForMappedField(kid)}` and all field data spread
127
+ - [ ] The utilities module is created with `mapStateToProps` and `getKeyForMappedField`
199
128
  - [ ] Column count CSS classes or DS grid component is applied based on `NumCols`
200
129
 
201
130
  If ANY of these are missing, the form fields will NOT render at runtime.
@@ -204,18 +133,9 @@ If ANY of these are missing, the form fields will NOT render at runtime.
204
133
 
205
134
  **UI control type:** Multi-column form field grid with optional instruction text header.
206
135
 
207
- Listed design systems are examples only.
208
-
209
- | Design System | Recommended Component |
210
- | ------------------ | -------------------------------------------------------------- |
211
- | Default (CSS only) | CSS Grid with column count driven by `NumCols` |
212
- | MUI | CSS Grid via `sx` prop or makeStyles |
213
- | Ant Design | `<Form layout='vertical'>` with `<Row>/<Col>` for multi-column |
214
- | Chakra UI | `<SimpleGrid columns={N} spacing={4}>` |
215
- | Shadcn/ui | Tailwind `grid grid-cols-1/2/3 gap-4` |
216
-
217
- When implementing in a specific design system:
136
+ When implementing in a specific design system, map the following:
218
137
 
219
- - `NumCols` is always a string (`'1'`/`'2'`/`'3'`) — parse before use
220
- - Instructions HTML is rendered above the form, before any fields
221
- - Each child field must be subscribed to the store for reactive visibility/prop updates
138
+ - The column grid can be realized with CSS Grid driven by `NumCols`, a grid layout component from your design system, or utility-class-based grid layouts.
139
+ - `NumCols` is always a string (`'1'`/`'2'`/`'3'`) — parse before use if the grid API expects a number.
140
+ - Instructions HTML is rendered above the form, before any fields.
141
+ - Each child field must be subscribed to the store via the project's state-connection wrapper for reactive visibility and state updates.
@@ -8,20 +8,20 @@ Flexible page layout template that renders children in a configurable column lay
8
8
 
9
9
  ## Component Purpose
10
10
 
11
- Renders a page's child regions in a responsive grid layout. The number and proportions of columns are driven by the `layout` prop. When `enableBanner` is true, delegates to the `Banner` DSE component for a full-width hero section with the child columns below it.
11
+ Renders a page's child regions in a responsive grid layout. The number and proportions of columns are driven by the `layout` input. When `enableBanner` is true, delegates to the `Banner` DSE component for a full-width hero section with the child columns below it.
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `DefaultPage` (in `component-map.ts`)
15
+ - **Registration key:** `DefaultPage` (in the project's component map)
16
16
  - **Category:** Page template
17
- - **Extends:** `CommonPageProps` (does NOT directly extend `PConnProps` — no `getPConnect` in props)
17
+ - **Extends:** `CommonPageProps` (does NOT directly extend the base component interface — no `getPConnect` in inputs)
18
18
 
19
- ## Props
19
+ ## Inputs
20
20
 
21
- | Prop | Type | Required | Description |
21
+ | Input | Type | Required | Description |
22
22
  | ----------------- | ----------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- |
23
23
  | `layout` | `'one-column' \| 'two-column' \| 'narrow-wide' \| 'wide-narrow' \| 'dynamic'` | No | Column layout. Default `'one-column'` |
24
- | `children` | `ReactNode \| ReactNode[]` | Yes | Child region components to render in columns |
24
+ | `children` | renderable content (single or array) | Yes | Child region components to render in columns |
25
25
  | `title` | `string` | Yes | Page title (part of `CommonPageProps`, not directly rendered) |
26
26
  | `icon` | `string` | Yes | Page icon (part of `CommonPageProps`, not directly rendered) |
27
27
  | `localeReference` | `string` | Yes | Locale reference key |
@@ -33,86 +33,51 @@ Renders a page's child regions in a responsive grid layout. The number and propo
33
33
  | `backgroundColor` | `string` | No | Banner background color. Default `''` |
34
34
  | `tintImage` | `boolean` | No | Banner image tint flag |
35
35
 
36
- ## Component Skeleton
37
-
38
- ```typescript
39
- import { useMemo, Children } from 'react';
40
- import type { ReactNode } from 'react';
41
- import { getComponentFromRegistry } from '@pega/sdk-react';
42
-
43
- const COLUMNS_WIDTHS = {
44
- 'one-column': [12],
45
- 'two-column': [6, 6],
46
- 'narrow-wide': [4, 8],
47
- 'wide-narrow': [8, 4],
48
- };
49
-
50
- export default function DefaultPage({
51
- layout = 'one-column', children, enableBanner,
52
- heading = '', message = '', imageTheme, backgroundImage = '',
53
- backgroundColor = '', tintImage,
54
- }: DefaultPageProps) {
55
- const Banner = getComponentFromRegistry('Banner');
56
- const childArray = useMemo(() => Children.toArray(children), [children]);
57
-
58
- // 1. Banner mode
59
- if (enableBanner) {
60
- return (
61
- <Banner
62
- variant={layout === 'one-column' ? 'two-column' : layout}
63
- a={[childArray[0]]}
64
- b={[childArray[1]]}
65
- banner={{ variant: imageTheme, backgroundColor, title: heading, message, backgroundImage, tintImage }}
66
- />
67
- );
68
- }
69
-
70
- // 2. Standard grid mode
71
- return (
72
- <GridContainer spacing={1}>
73
- {childArray.map((child, index) => (
74
- <GridItem key={index} size={COLUMNS_WIDTHS[layout][index]}>
75
- {child}
76
- </GridItem>
77
- ))}
78
- </GridContainer>
79
- );
80
- }
81
- ```
82
-
83
- > **Note:** `DefaultPage` does NOT have a `getPConnect` prop — it extends `CommonPageProps`, not `PConnProps`.
36
+ ## Implementation Structure
37
+
38
+ **Module Setup:** This component needs: a children-to-array utility from the framework, and the project's component registry (provides `Banner` at runtime). Declare a constant `COLUMNS_WIDTHS` mapping each layout name to its column width array: `'one-column'` → `[12]`, `'two-column'` → `[6, 6]`, `'narrow-wide'` → `[4, 8]`, `'wide-narrow'` → `[8, 4]`.
39
+
40
+ **Main Component Logic** — steps in order:
41
+
42
+ 1. Receive inputs: extract `layout` (default `'one-column'`), `children`, `enableBanner`, `heading` (default `''`), `message` (default `''`), `imageTheme`, `backgroundImage` (default `''`), `backgroundColor` (default `''`), and `tintImage` from the component's inputs.
43
+ 2. Retrieve `Banner` from the project's component registry.
44
+ 3. Convert `children` to an array using the framework's children-to-array utility, as a memoized computation depending on `children`.
45
+ 4. **Banner mode:** if `enableBanner` is true, render a `Banner` with `variant` set to `layout` (substituting `'two-column'` when `layout === 'one-column'`), `a={[childArray[0]]}`, `b={[childArray[1]]}`, and a `banner` configuration object combining `variant: imageTheme`, `backgroundColor`, `title: heading`, `message`, `backgroundImage`, `tintImage`.
46
+ 5. **Standard grid mode:** otherwise, render a grid container with spacing of 1 unit containing one grid item per child, each sized according to `COLUMNS_WIDTHS[layout][index]`.
47
+
48
+ > **Note:** `DefaultPage` does NOT have a `getPConnect` input — it extends `CommonPageProps`, not the base component interface.
84
49
 
85
50
  ## Behavioral Contract
86
51
 
87
52
  ### Without Banner (`enableBanner` is falsy)
88
53
 
89
- 1. Convert children to an array using `Children.toArray(children)` (memoized).
54
+ 1. Convert children to an array using the framework's children-to-array utility (as a memoized computation).
90
55
  2. Look up column widths from `COLUMNS_WIDTHS` map using `layout`:
91
56
  - `'one-column'`: `[12]` (single column, full width)
92
57
  - `'two-column'`: `[6, 6]` (equal split)
93
58
  - `'narrow-wide'`: `[4, 8]`
94
59
  - `'wide-narrow'`: `[8, 4]`
95
- 3. Render a `<Grid container spacing={1}>`.
96
- 4. Map over children array: for each child at index `i`, render `<Grid key={i} size={COLUMNS_WIDTHS[layout][i]}>{child}</Grid>`.
60
+ 3. Render a grid container with spacing of 1 unit.
61
+ 4. Map over children array: for each child at index `i`, render a grid item sized to `COLUMNS_WIDTHS[layout][i]` containing the child.
97
62
 
98
63
  ### With Banner (`enableBanner` is true)
99
64
 
100
- 1. Retrieve `Banner` from the component registry.
65
+ 1. Retrieve `Banner` from the project's component registry.
101
66
  2. Determine banner variant:
102
67
  - If `layout === 'one-column'`, use `'two-column'` for the banner layout (equal split for `a`/`b`).
103
68
  - Otherwise use the `layout` value directly.
104
- 3. Render `<Banner variant={...} a={[childArray[0]]} b={[childArray[1]]} banner={{ variant: imageTheme, backgroundColor, title: heading, message, backgroundImage, tintImage }} />`.
69
+ 3. Render `Banner` with `variant`, `a={[childArray[0]]}`, `b={[childArray[1]]}`, and `banner` configuration: `{ variant: imageTheme, backgroundColor, title: heading, message, backgroundImage, tintImage }`.
105
70
 
106
71
  ## Visual Specifications
107
72
 
108
73
  ### Column Widths
109
74
 
110
- | `layout` | Column sizes (MUI 12-grid) |
111
- | --------------- | -------------------------- |
112
- | `'one-column'` | 12 |
113
- | `'two-column'` | 6, 6 |
114
- | `'narrow-wide'` | 4, 8 |
115
- | `'wide-narrow'` | 8, 4 |
75
+ | `layout` | Column sizes (12-unit grid) |
76
+ | --------------- | --------------------------- |
77
+ | `'one-column'` | 12 |
78
+ | `'two-column'` | 6, 6 |
79
+ | `'narrow-wide'` | 4, 8 |
80
+ | `'wide-narrow'` | 8, 4 |
116
81
 
117
82
  ### Grid Spacing
118
83
 
@@ -133,29 +98,21 @@ export default function DefaultPage({
133
98
 
134
99
  - `layout='dynamic'` is listed in the type union but has no entry in `COLUMNS_WIDTHS` — if accessed, it returns `undefined`, and no columns are rendered. This is a known stub.
135
100
  - When `enableBanner` is true and `layout === 'one-column'`, the banner layout is forced to `'two-column'` to provide a meaningful two-slot layout for `a` and `b`.
136
- - Children are memoized via `useMemo(() => Children.toArray(children), [children])` to avoid unnecessary re-renders.
101
+ - Children are converted to an array via a memoized computation to avoid unnecessary re-renders.
137
102
 
138
103
  ## Dependencies
139
104
 
140
- - When `enableBanner` is true: `getComponentFromRegistry('Banner')` from `@pega/sdk-react`
141
- - `Grid` from `@mui/material` (or equivalent CSS grid in non-MUI implementations)
105
+ - When `enableBanner` is true: the project's component registry (to retrieve `Banner` at runtime)
106
+ - A grid layout mechanism (CSS Grid, a design system grid component, or utility classes)
142
107
 
143
108
  ## Design System Mapping
144
109
 
145
110
  **UI control type:** Responsive multi-column page grid layout with optional banner hero.
146
111
 
147
- Listed design systems are examples only.
148
-
149
- | Design System | Recommended Component |
150
- | ------------------ | --------------------------------------------------------------- |
151
- | Default (CSS only) | CSS Grid with column template driven by `layout` prop |
152
- | MUI | `<Grid container spacing={1}>` with `<Grid size={N}>` per child |
153
- | Ant Design | `<Row gutter={8}>` with `<Col span={N * 2}>` (24-col grid) |
154
- | Chakra UI | `<SimpleGrid columns={{ base: 1, md: N }}>` |
155
- | Shadcn/ui | Tailwind grid utilities matching the layout |
156
-
157
- When implementing in a specific design system:
112
+ When implementing in a specific design system, map the following:
158
113
 
159
- - Map `layout` prop to the appropriate column template
160
- - Banner mode delegates to the `Banner` component — implement Banner first
161
- - All children are sized uniformly within their column (no per-child overrides)
114
+ - The `layout` input drives column proportions — translate to the appropriate column template or grid configuration for your chosen system.
115
+ - The 12-unit grid widths (`[12]`, `[6, 6]`, `[4, 8]`, `[8, 4]`) can map to any proportional grid (e.g., a 24-unit grid by doubling values, or fractional CSS Grid columns).
116
+ - Banner mode delegates to the `Banner` component — implement Banner first.
117
+ - All children are sized uniformly within their column (no per-child overrides).
118
+ - Grid spacing of 1 unit (≈ 8px) should be applied between columns.