@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,87 +1,44 @@
1
1
  # Skill: Template Components
2
2
 
3
- Create or replace template components (layouts and page structures) in the react-sdk-reference application. Template components arrange child components into visual layouts (columns, tabs, forms, pages).
3
+ Create or replace template components (layouts and page structures) in the project. Template components arrange child components into visual layouts (columns, tabs, forms, pages).
4
4
 
5
5
  ---
6
6
 
7
7
  ## Architecture Overview
8
8
 
9
- ```
10
- src/components/template/<ComponentName>/
11
- ├── <ComponentName>.tsx # Component implementation
12
- ├── index.tsx # Re-export (if present)
13
- ├── <ComponentName>.css # Styles (CSS file, optional)
14
- ├── utils.ts # Template-specific utilities (optional)
15
- └── config-ext.json # Metadata (optional)
16
- ```
9
+ Each template component lives under the project's template components directory in its own folder, named after the component. The folder typically contains: the component implementation file; an optional re-export module; an optional companion stylesheet; an optional utilities module for template-specific helpers; and an optional metadata file.
17
10
 
18
- Some templates have nested sub-templates:
19
-
20
- ```
21
- src/components/template/TwoColumn/
22
- ├── TwoColumn/TwoColumn.tsx
23
- ├── TwoColumnPage/TwoColumnPage.tsx
24
- └── TwoColumnTab/TwoColumnTab.tsx
25
- ```
11
+ Some templates have nested sub-templates instead of a flat structure. For example, `TwoColumn` organizes its three variants as separate sub-folders, each containing its own implementation file.
26
12
 
27
13
  ---
28
14
 
29
- ## Props Interface
30
-
31
- Template components extend `PConnProps`:
15
+ ## Input Contract
32
16
 
33
- ```typescript
34
- import type { PConnProps } from '@pega/sdk-react';
17
+ Template components extend the project's **base component interface**, which declares a single required member, `getPConnect` — a function returning the `PConnect` instance for the component.
35
18
 
36
- interface PConnProps {
37
- getPConnect: () => typeof PConnect;
38
- }
39
- ```
40
-
41
- Templates typically receive children through `getPConnect().getChildren()` rather than React `children` prop, though layout templates (TwoColumn, OneColumn) receive React children directly.
19
+ Templates typically receive children through `getPConnect().getChildren()` rather than via the framework's content projection mechanism, though layout templates (TwoColumn, OneColumn) receive children via content projection directly.
42
20
 
43
21
  ---
44
22
 
45
23
  ## Implementation Patterns
46
24
 
47
- ### Layout Template (renders React children in grid)
25
+ ### Layout Template (renders children in grid)
48
26
 
49
27
  Used for: TwoColumn, OneColumn, NarrowWide, WideNarrow
50
28
 
51
- This pattern is design-system agnostic. The `// [DS GRID]` section must be replaced with your design system's grid or flex layout primitive — see the "Design System Adaptation" section below.
52
-
53
- ```typescript
54
- import type { PropsWithChildren, ReactElement } from 'react';
55
- // Import your design system layout primitive here:
56
- // e.g. import { Grid } from 'antd';
57
- // e.g. import { SimpleGrid } from '@chakra-ui/react';
58
- import type { PConnProps } from '@pega/sdk-react';
59
-
60
- interface TwoColumnProps extends PConnProps {
61
- templateCol?: string; // e.g. '1fr 1fr', '2fr 1fr'
62
- }
63
-
64
- export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
65
- const { children, templateCol = '1fr 1fr' } = props;
66
- const childrenToRender = children as ReactElement[];
67
-
68
- // templateCol maps directly to CSS grid-template-columns — no conversion needed
69
- // Use plain CSS grid with width: 100% to guarantee the layout fills its parent
70
- // On mobile: use a media query or @container query to stack columns
71
- return (
72
- <div style={{ display: 'grid', gridTemplateColumns: templateCol, gap: '0.5rem', width: '100%' }}>
73
- <div style={{ display: 'grid', gap: '1rem', alignContent: 'baseline' }}>
74
- {childrenToRender[0]}
75
- </div>
76
- <div style={{ display: 'grid', gap: '1rem', alignContent: 'baseline' }}>
77
- {childrenToRender[1]}
78
- </div>
79
- </div>
80
- );
81
- }
82
- ```
83
-
84
- > ⚠️ **Do NOT use DS-specific grid components** (e.g., Carbon `<Grid>`, Ant Design `<Row>/<Col>`) for layout templates. Many DS grids have built-in `max-width` constraints that prevent the layout from filling its parent container. Use plain CSS grid with `grid-template-columns: templateCol` — this works with every design system and guarantees full-width rendering.
29
+ This pattern is design-system agnostic — the grid/flex section must be replaced with your design system's grid or flex layout primitive; see the "Design System Adaptation" section below.
30
+
31
+ **Module Setup:** Define the input contract as an extension of the project's base component interface, adding an optional `templateCol` string (e.g. `'1fr 1fr'`, `'2fr 1fr'`) representing the CSS grid column template. The component accepts children via the framework's content projection mechanism.
32
+
33
+ **Main Component Logic** — steps in order:
34
+
35
+ 1. Receive `children` and `templateCol` (defaulting to `'1fr 1fr'`) from inputs; treat `children` as an array of child elements.
36
+ 2. `templateCol` maps directly to CSS `grid-template-columns` — no conversion needed.
37
+ 3. Render an outer container with `display: grid`, `gridTemplateColumns: templateCol`, a `gap`, and `width: 100%` so the layout always fills its parent.
38
+ 4. Inside, render two inner wrapper elements — one per column — each with `display: grid`, a `gap`, and `alignContent: baseline`; the first wraps `children[0]`, the second wraps `children[1]`.
39
+ 5. On mobile, use a media query or container query to stack the columns into a single column.
40
+
41
+ > ⚠️ **Do NOT use DS-specific grid components** for layout templates. Many DS grids have built-in `max-width` constraints that prevent the layout from filling its parent container. Use plain CSS grid with `grid-template-columns: templateCol` — this works with every design system and guarantees full-width rendering.
85
42
 
86
43
  ---
87
44
 
@@ -89,223 +46,112 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
89
46
 
90
47
  > Form templates and page templates use the PConnect bridge pattern and do **not** use any design system primitives. This section applies only to layout templates: TwoColumn, OneColumn, NarrowWide, WideNarrow, and their sub-variants.
91
48
  >
92
- > **Use plain CSS grid** (`display: grid; grid-template-columns; width: 100%`) for all layout templates. The `templateCol` prop value (e.g., `'1fr 1fr'`, `'2fr 1fr'`) maps directly to `grid-template-columns`. Do NOT use DS grid components — they may have max-width constraints.
49
+ > **Use plain CSS grid** (`display: grid; grid-template-columns; width: 100%`) for all layout templates. The `templateCol` input value (e.g., `'1fr 1fr'`, `'2fr 1fr'`) maps directly to `grid-template-columns`. Do NOT use DS grid components — they may have max-width constraints.
93
50
 
94
- **1. Check the component-specific skill file** — `{{SKILL_DIR}}/template-skills/<ComponentName>.md` contains a **Design System Mapping** table where available. Use it as a starting point.
51
+ **1. Check the component-specific skill file** — `{{SKILL_DIR}}/template-skills/<ComponentName>.md` contains a **Design System Mapping** section where available. Use it as a starting point.
95
52
 
96
- **2. If the chosen design system is not listed** — use the **component purpose** description to identify the appropriate DS layout primitive (grid, flex, columns).
53
+ **2. If the chosen design system is not covered** — use the **component purpose** description to identify the appropriate DS layout primitive (grid, flex, columns).
97
54
 
98
- **3. Discover the API from installed packages** — confirm layout component names and props from `.d.ts` before writing JSX:
55
+ **3. Discover the API from installed packages** — before writing the component's markup, confirm the layout component names and inputs by searching the installed design-system package's type declaration files for grid/column/flex primitives, then inspecting the exported input interface.
99
56
 
100
- ```bash
101
- find node_modules/<ds-package> -name "*.d.ts" | xargs grep -l "Grid\|Columns\|Flex" | head -5
102
- grep -A 30 "interface.*Props" <path-to-file>
103
- ```
57
+ **4. Column ratio mapping** — the `templateCol` input (e.g., `'2fr 1fr'`) gives you fractional widths. Map to your DS's column system:
104
58
 
105
- **4. Column ratio mapping** — the `templateCol` prop (e.g., `'2fr 1fr'`) gives you fractional widths. Map to your DS's column system:
59
+ | `templateCol` | Fraction | 12-col grid | CSS `grid-template-columns` |
60
+ | ------------- | --------- | ----------- | --------------------------- |
61
+ | `'1fr 1fr'` | 50% / 50% | 6 / 6 | `1fr 1fr` |
62
+ | `'2fr 1fr'` | 67% / 33% | 8 / 4 | `2fr 1fr` |
63
+ | `'1fr 2fr'` | 33% / 67% | 4 / 8 | `1fr 2fr` |
106
64
 
107
- | `templateCol` | Fraction | MUI 12-col | CSS `grid-template-columns` |
108
- | ------------- | --------- | ---------- | --------------------------- |
109
- | `'1fr 1fr'` | 50% / 50% | 6 / 6 | `1fr 1fr` |
110
- | `'2fr 1fr'` | 67% / 33% | 8 / 4 | `2fr 1fr` |
111
- | `'1fr 2fr'` | 33% / 67% | 4 / 8 | `1fr 2fr` |
112
-
113
- **5. Responsive behavior** — on mobile, both columns must stack to full width. Use your DS's responsive breakpoint props or a CSS media query.
65
+ **5. Responsive behavior** — on mobile, both columns must stack to full width. Use your DS's responsive breakpoint mechanism or a CSS media query.
114
66
 
115
67
  ### Form Template (renders children via PConnect bridge)
116
68
 
117
69
  Used for: DefaultForm, HierarchicalForm
118
70
 
119
- > ⚠️ **CRITICAL:** Form templates MUST use the `connectToState` HOC pattern. Without it, form fields will not render because they won't be subscribed to the Redux store for visibility and prop updates.
120
-
121
- ```typescript
122
- import { createElement } from 'react';
123
- import { PConnectComponent } from '@pega/sdk-react';
124
- import connectToState from '../../helpers/state-utils';
125
- import { getKeyForMappedField, mapStateToProps } from './utils';
126
- import type { PConnProps } from '@pega/sdk-react';
127
-
128
- interface DefaultFormProps extends PConnProps {
129
- NumCols: string;
130
- instructions: string;
131
- }
71
+ > ⚠️ **CRITICAL:** Form templates MUST use the project's state-connection wrapper pattern. Without it, form fields will not render because they won't be subscribed to the application store for visibility and input updates.
132
72
 
133
- // MANDATORY: connectToState HOC wraps each field in Redux store subscription
134
- const Child = connectToState(mapStateToProps)((props) => {
135
- const { key, visibility, ...rest } = props;
136
- return createElement(PConnectComponent, { ...rest, key, visibility });
137
- });
73
+ **Module Setup:** The component depends on the framework's element-creation utility, the project's PConnect bridge utility, the project's state-connection wrapper (from the project's state utilities), and `getKeyForMappedField` / `mapStateToInputs` from the companion utilities module. Define the input contract as an extension of the project's base component interface with `NumCols: string` and `instructions: string`.
138
74
 
139
- export default function DefaultForm(props: DefaultFormProps) {
140
- const { getPConnect, NumCols = '1' } = props;
75
+ Outside the main component logic, define a `Child` wrapper using the project's state-connection wrapper invoked with `mapStateToInputs`. This is MANDATORY — it subscribes each field to the application store. Inside `Child`, receive `key`, `visibility`, and the remaining inputs, then render the project's PConnect bridge utility with those values.
141
76
 
142
- // Unwrap region children (first child is a region → get ITS children)
143
- const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
77
+ **Main Component Logic** — steps in order:
144
78
 
145
- // Each child MUST be wrapped in the connectToState HOC
146
- const dfChildren = arChildren?.map((kid) => (
147
- <Child key={getKeyForMappedField(kid)} {...kid} />
148
- ));
79
+ 1. Receive `getPConnect` and `NumCols` (defaulting to `'1'`) from inputs.
80
+ 2. Unwrap the region children: the first child returned by `getPConnect().getChildren()` is a region, so call `.getPConnect().getChildren()` on it to get the actual field children.
81
+ 3. Map each child through the `Child` wrapper defined above — every child MUST be rendered via the `Child` wrapper with `key` set to `getKeyForMappedField(kid)` and all field data spread, never directly through the PConnect bridge utility alone.
82
+ 4. Return a container element with a class name derived from `NumCols` (e.g. `form-${NumCols}-col`) containing the mapped children.
149
83
 
150
- return <div className={`form-${NumCols}-col`}>{dfChildren}</div>;
151
- }
152
- ```
153
-
154
- > ❌ **INCORRECT pattern** (will cause fields to not render):
155
- >
156
- > ```typescript
157
- > // DO NOT USE — fields won't be subscribed to store
158
- > arChildren.map((kid, i) => createElement(PConnectComponent, { ...kid, key: i }));
159
- > ```
84
+ > ❌ **INCORRECT pattern** (will cause fields to not render): mapping children directly through the PConnect bridge utility, bypassing the state-connection wrapper entirely. This causes fields to never subscribe to the application store, so they silently fail to render or update.
160
85
 
161
86
  ### Page Template (renders regions from PConnect children)
162
87
 
163
88
  Used for: CaseView, DefaultPage, ObjectPage, AppShell, Confirmation
164
89
 
165
- > ⚠️ **CRITICAL:** Page templates are NOT simple wrappers. They contain PCore API calls, useEffect hooks, state management, and complex prop drilling to infrastructure components. NEVER simplify a Page template to a single return statement. Always follow the component-specific skill file skeleton faithfully.
90
+ > ⚠️ **CRITICAL:** Page templates are NOT simple wrappers. They contain PCore API calls, lifecycle effects, state management, and complex input drilling to infrastructure components. NEVER simplify a Page template to a single return statement. Always follow the component-specific skill file's Implementation Structure faithfully.
166
91
  >
167
- > After generating a Page template, compare your output against the skill file skeleton. Every `useState`, `useEffect`, `getComponentFromRegistry`, `PCore.*` call, helper function, and utility import from the skeleton MUST appear in your generated output. If your output is significantly shorter than the skeleton, you have over-simplified.
92
+ > After generating a Page template, compare your output against the skill file's Implementation Structure. Every piece of state, every effect, every registry lookup, every PCore API call, helper function, and utility dependency described there MUST appear in your generated output. If your output is significantly shorter than what's described, you have over-simplified.
168
93
  >
169
- > ⚠️ **COMMON ERROR — `tabconfig` must be an array, NOT a React element:**
170
- > The `VerticalTabs` infrastructure component expects `tabconfig` to be `{ name: string; id: number }[]`. You MUST build this array by iterating the tab region's PConnect children (extracting `label` from each child's config props). NEVER pass the raw React region element to `<VerticalTabs tabconfig={...}>` — it causes `TypeError: tabconfig.map is not a function`.
171
-
172
- ```typescript
173
- import { type PropsWithChildren, type ReactElement, useEffect, useState } from 'react';
174
- import { getComponentFromRegistry, PConnectComponent } from '@pega/sdk-react';
175
- import type { PConnProps } from '@pega/sdk-react';
176
-
177
- export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
178
- // 1. Get infrastructure components from registry
179
- const VerticalTabs = getComponentFromRegistry('VerticalTabs');
180
- const DeferLoad = getComponentFromRegistry('DeferLoad');
181
-
182
- // 2. Destructure ALL props from the skill file skeleton
183
- const { getPConnect, children, header, ... } = props;
184
- const pConn = getPConnect();
94
+ > ⚠️ **COMMON ERROR — `tabconfig` must be an array, NOT a rendered element:**
95
+ > The `VerticalTabs` infrastructure component expects `tabconfig` to be an array of `{ name: string; id: number }` objects. You MUST use the `extractTabsInfo` SDK utility to build this array. NEVER pass a raw rendered region element to `VerticalTabs` — it causes `TypeError: tabconfig.map is not a function`.
96
+ >
97
+ > ⚠️ **CRITICAL — Do NOT call `child.getPConnect()` on framework-rendered children:**
98
+ > Children passed to page templates via the framework's content projection mechanism are **rendered elements** — they do NOT expose `getPConnect` as a direct method. Calling `child.getPConnect()` on them causes `TypeError: child.getPConnect is not a function`. For named region extraction, use `PCore.getSDKUtils().getSDKCaseUtils().getChildRegionByName(childArr, name)`. For tab info, use `PCore.getSDKUtils().getSDKCaseUtils().extractTabsInfo(tabsRegion)`. For field extraction in CaseSummary, use `PCore.getSDKUtils().getSDKCaseUtils().filterSummaryFields(getPConnect)`. If you need PConnect metadata access by index (e.g., SelfServiceCaseView), use `getPConnect().getChildren()` which returns PConnect child envs that DO have `getPConnect` methods. Render extracted regions directly in the template — do NOT pass them through the PConnect bridge component.
185
99
 
186
- // 3. Include ALL state, effects, and handlers from the skill file
187
- const [activeTab, setActiveTab] = useState(0);
188
- useEffect(() => { /* event listeners, pub/sub */ }, []);
100
+ **Module Setup:** The component depends on the project's component registry (to resolve infrastructure components like `VerticalTabs` and `DeferLoad`), SDK utilities from `PCore.getSDKUtils()`, local state management, and lifecycle effects. Define the input contract as an extension of the project's base component interface.
189
101
 
190
- // 4. Extract named regions (NOT by index — use metadata name)
191
- function getChildRegionByName(name: string) { ... }
102
+ **Main Component Logic** — general shape for any Page template:
192
103
 
193
- // 5. Render with full layout structure from skill file
194
- return ( /* full layout */ );
195
- }
196
- ```
104
+ 1. Look up infrastructure components from the project's component registry, e.g. `VerticalTabs` and `DeferLoad`.
105
+ 2. Receive ALL inputs described in the component-specific skill file (e.g. `getPConnect`, `children`, `header`, etc.), then call `getPConnect()` once and reuse the result.
106
+ 3. Declare ALL state, effects, and handlers described in the skill file — for example local state for active tab tracking, and lifecycle effects for event listeners or pub/sub subscriptions.
107
+ 4. Use SDK utilities from `PCore.getSDKUtils().getSDKCaseUtils()` for region extraction (e.g., `getChildRegionByName`, `extractTabsInfo`, `filterSummaryFields`). For positional child access needing metadata, use `getPConnect().getChildren()` (PConnect child envs). **NEVER implement custom region extraction that calls `child.getPConnect()` on framework-rendered children.**
108
+ 5. Render the full layout structure described in the skill file. Render extracted regions directly in the template — they are already renderable elements.
197
109
 
198
110
  ---
199
111
 
200
112
  ## Rendering Children
201
113
 
202
- Templates use two patterns to render child components:
114
+ Templates use three patterns to render child components:
203
115
 
204
- ### 1. React children (layout templates)
116
+ ### 1. Children via content projection (layout templates)
205
117
 
206
- ```typescript
207
- // TwoColumn, OneColumn, etc. receive children as React props
208
- const { children } = props;
209
- const childrenToRender = children as ReactElement[];
210
- ```
118
+ TwoColumn, OneColumn, and similar layout templates receive children via the framework's content projection mechanism. Receive `children` from inputs and treat it as an array of child elements before indexing into it.
211
119
 
212
120
  ### 2. PConnect children (form/page templates)
213
121
 
214
- ```typescript
215
- import { createElement } from 'react';
216
- import { PConnectComponent } from '@pega/sdk-react';
217
-
218
- // Get child PConnect objects
219
- const children = getPConnect().getChildren();
220
-
221
- // Render each child through the PConnect bridge
222
- children.map((child, i) => createElement(PConnectComponent, { ...child, key: `child-${i}` }));
223
- ```
122
+ Get the child PConnect objects via `getPConnect().getChildren()`, then render each one through the project's PConnect bridge utility, passing the child's configuration object and a unique key for each child.
224
123
 
225
124
  ### 3. State-connected children (REQUIRED for Form templates)
226
125
 
227
126
  > ⚠️ This is the ONLY correct pattern for Form templates (DefaultForm, HierarchicalForm). Using pattern #2 above for form fields will result in fields not rendering.
228
127
 
229
- ```typescript
230
- import { createElement } from 'react';
231
- import { PConnectComponent } from '@pega/sdk-react';
232
- import connectToState from '../../helpers/state-utils';
233
- import { getKeyForMappedField, mapStateToProps } from './utils';
234
-
235
- // connectToState HOC subscribes to Redux store for visibility/props
236
- const Child = connectToState(mapStateToProps)((props) => {
237
- const { key, visibility, ...rest } = props;
238
- return createElement(PConnectComponent, { ...rest, key, visibility });
239
- });
240
-
241
- // Usage inside component:
242
- const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
243
- const dfChildren = arChildren?.map((kid) => (
244
- <Child key={getKeyForMappedField(kid)} {...kid} />
245
- ));
246
- ```
128
+ The component depends on the project's PConnect bridge utility, the project's state-connection wrapper (from the project's state utilities), and `getKeyForMappedField` / `mapStateToInputs` from the companion utilities module. Define a `Child` wrapper using the state-connection wrapper invoked with `mapStateToInputs` — this subscribes each field to the application store for visibility and dynamic input updates. Inside the wrapped component, receive `key`, `visibility`, and the remaining inputs, then render the PConnect bridge utility with those values.
129
+
130
+ To use it: unwrap the first region's children via `getPConnect().getChildren()[0].getPConnect().getChildren()`, then map each child through the `Child` wrapper with `key` set to `getKeyForMappedField(kid)` and all field data spread.
247
131
 
248
132
  ---
249
133
 
250
134
  ## Helper Utilities
251
135
 
252
- ### `PConnectComponent` (from `@pega/sdk-react`)
253
-
254
- The PConnect bridge component. Used to render child PConnect objects:
136
+ ### PConnect bridge utility
255
137
 
256
- ```typescript
257
- import { createElement } from 'react';
258
- import { PConnectComponent } from '@pega/sdk-react';
259
- createElement(PConnectComponent, { ...childPConnectProps, key });
260
- ```
138
+ The project's PConnect bridge component, used to render child PConnect objects. Use the framework's element-creation mechanism to create an instance of the bridge component for each child, passing the child's PConnect configuration and a unique key.
261
139
 
262
- ### `connectToState` (from `../../helpers/state-utils`)
140
+ ### State-connection wrapper
263
141
 
264
- HOC that connects a component to the Redux store for visibility and dynamic props:
142
+ A higher-order utility that connects a component to the application store for visibility and dynamic input updates. Apply it with a state-mapping function to produce a store-connected version of the child component. Located in the project's state utilities module.
265
143
 
266
- ```typescript
267
- import connectToState from '../../helpers/state-utils';
268
- const ConnectedChild = connectToState(mapStateToProps)(ChildComponent);
269
- ```
144
+ ### Instructions helper
270
145
 
271
- ### `getInstructions` (from `../../helpers/template-utils`)
272
-
273
- Extracts instruction text for forms:
274
-
275
- ```typescript
276
- import { getInstructions } from '../../helpers/template-utils';
277
- const instructions = getInstructions(getPConnect(), props.instructions);
278
- ```
146
+ Extracts instruction text for forms. Located in the project's template utilities module. Call it with `getPConnect()` and the component's `instructions` input to obtain the resolved instruction HTML string.
279
147
 
280
148
  ---
281
149
 
282
150
  ## Registration
283
151
 
284
- Register templates in `src/components/component-map.ts`:
285
-
286
- ```typescript
287
- import MyTemplate from './template/MyTemplate';
288
-
289
- // In getSampleComponentMap():
290
- {
291
- ...sdkComponents,
292
- MyTemplate, // Key must match Pega component name
293
- }
294
- ```
295
-
296
- For nested templates (e.g., TwoColumn/TwoColumnPage/TwoColumnTab), register each separately:
297
-
298
- ```typescript
299
- import TwoColumn from './template/TwoColumn/TwoColumn/TwoColumn';
300
- import TwoColumnPage from './template/TwoColumn/TwoColumnPage';
301
- import TwoColumnTab from './template/TwoColumn/TwoColumnTab';
152
+ Register templates in the project's component map by importing the template's default export from its folder under the template components directory and adding it to the object returned by the project's component registration function, using a key that matches the Pega component name.
302
153
 
303
- {
304
- TwoColumn,
305
- TwoColumnPage,
306
- TwoColumnTab,
307
- }
308
- ```
154
+ For nested templates (e.g., TwoColumn/TwoColumnPage/TwoColumnTab), import each sub-variant from its own nested path and register all variants as separate keys in the component map.
309
155
 
310
156
  ---
311
157
 
@@ -344,9 +190,9 @@ import TwoColumnTab from './template/TwoColumn/TwoColumnTab';
344
190
 
345
191
  ## Key Conventions
346
192
 
347
- 1. **Default export** — `export default function TemplateName`.
193
+ 1. **Default export** — Each component is exported as the module's default export.
348
194
  2. **Children from PConnect** — Use `getPConnect().getChildren()` to access child regions.
349
- 3. **createElement pattern** — Use `createElement(createPConnectComponent(), childProps)` to render PConnect children.
350
- 4. **CSS files** — Template-specific styles go in `<TemplateName>.css` alongside the component.
351
- 5. **Responsive** — Use MUI Grid with `xs: 12` for mobile and `md: <size>` for desktop breakpoints.
352
- 6. **templateCol** — Layout templates often receive a `templateCol` prop (e.g., `"1fr 1fr"`, `"2fr 1fr"`) to control column ratios.
195
+ 3. **PConnect bridge pattern** — Use the project's PConnect bridge utility to render PConnect children.
196
+ 4. **CSS files** — Template-specific styles go in a companion stylesheet alongside the component.
197
+ 5. **Responsive** — Use CSS grid with full-width on mobile and computed column widths on desktop breakpoints.
198
+ 6. **templateCol** — Layout templates often receive a `templateCol` input (e.g., `"1fr 1fr"`, `"2fr 1fr"`) to control column ratios.