@pega/sdk 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +10 -3
  2. package/dist/index.js +764 -165
  3. package/package.json +1 -1
  4. package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
  5. package/templates/react-native-sdk-reference/.prettierignore +17 -0
  6. package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
  7. package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
  8. package/templates/react-native-sdk-reference/AGENTS.md +3 -0
  9. package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
  10. package/templates/react-native-sdk-reference/README.md +56 -0
  11. package/templates/react-native-sdk-reference/app.json +40 -5
  12. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
  13. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
  14. package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
  15. package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
  16. package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
  17. package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
  18. package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
  19. package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
  20. package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
  21. package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
  22. package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
  23. package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
  24. package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
  25. package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
  26. package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
  27. package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
  28. package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
  29. package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
  30. package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
  31. package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
  32. package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
  33. package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
  34. package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
  35. package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
  36. package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
  37. package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
  38. package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
  39. package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
  40. package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
  41. package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
  42. package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
  43. package/templates/react-native-sdk-reference/package.json +59 -14
  44. package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
  45. package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  46. package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
  47. package/templates/react-native-sdk-reference/sdk-config.json +31 -9
  48. package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
  49. package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
  50. package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
  51. package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
  52. package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
  53. package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
  54. package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
  55. package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
  56. package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
  57. package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
  58. package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
  59. package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
  60. package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
  61. package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
  62. package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
  63. package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
  64. package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
  65. package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
  66. package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
  67. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
  68. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
  69. package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
  70. package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
  71. package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
  72. package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
  73. package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
  74. package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
  75. package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
  76. package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
  77. package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
  78. package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
  79. package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
  80. package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
  81. package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
  82. package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
  83. package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
  84. package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
  85. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
  86. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
  87. package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
  88. package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
  89. package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
  90. package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
  91. package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
  92. package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
  93. package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
  94. package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
  95. package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
  96. package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
  97. package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
  98. package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
  99. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
  100. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
  101. package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
  102. package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
  103. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
  104. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
  105. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
  106. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
  107. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
  108. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
  109. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
  110. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
  111. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
  112. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
  113. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
  114. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
  115. package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
  116. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
  117. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
  118. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
  119. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
  120. package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
  121. package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
  122. package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
  123. package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
  124. package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
  125. package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
  126. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
  127. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
  128. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
  129. package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
  130. package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
  131. package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
  132. package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
  133. package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
  134. package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
  135. package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
  136. package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
  137. package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
  138. package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
  139. package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
  140. package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
  141. package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
  142. package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
  143. package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
  144. package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
  145. package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
  146. package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
  147. package/templates/react-native-sdk-reference/tsconfig.json +9 -8
  148. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
  149. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
  150. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
  151. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
  152. package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
  153. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
  154. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
  155. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
  156. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
  157. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
  158. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
  159. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
  160. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
  161. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
  162. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
  163. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
  164. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
  165. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
  166. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
  167. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
  168. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
  169. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
  170. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
  171. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
  172. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
  173. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
  174. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
  175. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
  176. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
  177. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
  178. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
  179. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
  180. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
  181. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
  182. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
  183. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
  184. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
  185. package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
  186. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
  187. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
  188. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
  189. package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
  190. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
  191. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
  192. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
  193. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
  194. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
  195. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
  196. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
  197. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
  198. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
  199. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
  200. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
  201. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
  202. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
  203. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
  204. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
  205. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
  206. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
  207. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
  208. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
  209. package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
  210. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
  211. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
  212. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
  213. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
  214. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
  215. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
  216. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
  217. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
  218. package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
  219. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
  220. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
  221. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
  222. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
  223. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
  224. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
  225. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
  226. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
  227. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
  228. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
  229. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
  230. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
  231. package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
  232. package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
  233. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
  234. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
  235. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
  236. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
  237. package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
  238. package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
  239. package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
  240. package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
  241. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
  242. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
  243. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
  244. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
  245. package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
  246. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
  247. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
  248. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
  249. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
  250. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
  251. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
  252. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
  253. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
  254. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
  255. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
  256. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
  257. package/templates/react-sdk-reference/package.json +1 -1
  258. package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
  259. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  260. package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
  261. package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
  262. package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
  263. package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
  264. package/templates/react-native-sdk-reference/App.tsx +0 -49
  265. package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
  266. package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
@@ -1,6 +1,6 @@
1
1
  # Skill: AdvancedSearch
2
2
 
3
- Advanced search template. Renders grouped search field sections with deduplication, delegating each section to a `SearchGroups` sub-component. Also covers the `SearchGroups` sub-component.
3
+ Advanced search template. Renders grouped search field sections with deduplication, delegating each section to a SearchGroups sub-component. Also covers the SearchGroups sub-component.
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
 
@@ -8,98 +8,32 @@ Advanced search template. Renders grouped search field sections with deduplicati
8
8
 
9
9
  ## Component Purpose
10
10
 
11
- Renders a multi-section advanced search form where search fields are organized into groups. Deduplicates search fields by value across groups. Each group is rendered by the `SearchGroups` sub-component. Shares search configuration via a React context (`DataReferenceAdvancedSearchContext`).
11
+ Renders a multi-section advanced search form where search fields are organized into groups. Deduplicates search fields by value across groups. Each group is rendered by the SearchGroups sub-component. Shares search configuration via a shared search-configuration context (provided by the parent DataReference component).
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `AdvancedSearch` (in `component-map.ts`)
15
+ - **Registration key:** `AdvancedSearch` (in the project's component map)
16
16
  - **Category:** Search / Filter template
17
- - **Extends:** `PConnProps`
18
-
19
- ## Props
20
-
21
- | Prop | Type | Required | Description |
22
- | -------------- | ---------- | -------- | ---------------------------------- |
23
- | `dataPageName` | `string` | Yes | Data page for search results |
24
- | `parameters` | `object` | No | Parameters passed to the data page |
25
- | `getPConnect` | `function` | Yes | PConnect getter |
26
-
27
- ## Component Skeleton
28
-
29
- ```typescript
30
- import { useContext, useState } from 'react';
31
- import { getComponentFromRegistry } from '@pega/sdk-react';
32
- import DataReferenceAdvancedSearchContext from '../DataReference/DataReferenceAdvancedSearchContext';
33
- import { getFirstChildConfig } from '../DataReference/utils';
34
-
35
- export default function AdvancedSearch(props) {
36
- const { getPConnect, targetObjectClass, localeReference } = props;
37
- const SearchGroups = getComponentFromRegistry('SearchGroups');
38
-
39
- // 1. Context — shared config from DataReference parent
40
- const {
41
- dataReferenceConfigToChild, isCreateNewReferenceEnabled,
42
- disableStartingFieldsForReference, pyID, searchSelectCacheKey,
43
- } = useContext(DataReferenceAdvancedSearchContext) as any;
44
-
45
- // 2. Selection state check
46
- const { selectionMode, value: singleSelectFieldValue, readonlyContextList: multiSelectField } =
47
- dataReferenceConfigToChild;
48
- const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
49
- const isSelectionExist = selectionMode === MULTI
50
- ? getPConnect().getValue(multiSelectField)?.length || false
51
- : getPConnect().getValue(singleSelectFieldValue) || false;
52
- const [showRecords, setShowRecords] = useState(isSelectionExist);
53
-
54
- // 3. Metadata + field deduplication
55
- const pConn = getPConnect();
56
- const rawViewMetadata = pConn.getRawMetadata();
57
- const searchFieldsSet = new Set();
58
- const searchFields: any = [];
59
- rawViewMetadata.config.searchGroups.forEach((group) => {
60
- group.children.forEach((child) => {
61
- if (!searchFieldsSet.has(child.config.value) && !child.config.validator) {
62
- searchFields.push(child);
63
- searchFieldsSet.add(child.config.value);
64
- }
65
- });
66
- });
67
-
68
- // 4. Create editable field component from first child
69
- const firstChildPConnect = getPConnect().getChildren()[0].getPConnect;
70
- const [firstChildMeta] = rawViewMetadata.children;
71
- const localizedVal = PCore.getLocaleUtils().getLocaleValue;
72
- const cache = PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey) ?? {};
73
-
74
- const editableFieldComp = firstChildPConnect().createComponent({
75
- type: firstChildMeta.type,
76
- config: {
77
- ...getFirstChildConfig({ firstChildMeta, getPConnect, rawViewMetadata,
78
- contextClass: targetObjectClass, dataReferenceConfigToChild,
79
- isCreateNewReferenceEnabled, disableStartingFieldsForReference, pyID }),
80
- searchFields, showRecords,
81
- label: localizedVal('Search results', 'DataReference'),
82
- searchSelectCacheKey, cache,
83
- },
84
- });
85
-
86
- // 5. Derive editable field path
87
- const { selectionList, dataRelationshipContext } =
88
- editableFieldComp.props.getPConnect().getConfigProps();
89
- const editableField = selectionMode === MULTI
90
- ? selectionList.substring(1) : dataRelationshipContext;
91
-
92
- // 6. Render: SearchGroups + editableFieldComp
93
- return (
94
- <>
95
- <SearchGroups getPConnect={getPConnect} editableField={editableField}
96
- localeReference={localeReference} setShowRecords={setShowRecords}
97
- searchSelectCacheKey={searchSelectCacheKey} cache={cache} />
98
- {editableFieldComp}
99
- </>
100
- );
101
- }
102
- ```
17
+
18
+ ## Inputs
19
+
20
+ | Input | Type | Required | Description |
21
+ | ------------------- | ---------- | -------- | ----------------------------------------- |
22
+ | `targetObjectClass` | `string` | Yes | Class of the target object being searched |
23
+ | `localeReference` | `string` | No | Locale reference for i18n labels |
24
+ | `getPConnect` | `function` | Yes | PConnect getter |
25
+
26
+ ## Main Component Logic
27
+
28
+ Steps in order:
29
+
30
+ 1. Receive inputs: `getPConnect`, `targetObjectClass`, and `localeReference`. Retrieve SearchGroups from the project's component registry.
31
+ 2. **Read shared context:** consume a shared search-configuration context (provided by the parent DataReference). From it, obtain `dataReferenceConfigToChild`, `isCreateNewReferenceEnabled`, `disableStartingFieldsForReference`, `pyID`, and `searchSelectCacheKey`.
32
+ 3. **Check for an existing selection:** from `dataReferenceConfigToChild`, obtain `selectionMode`, `value` (the single-select field value path), and `readonlyContextList` (the multi-select field path). Read the `MULTI` constant from `PCore.getConstants().LIST_SELECTION_MODE`. Compute whether a selection already exists — for multi-select, check if `getPConnect().getValue(multiSelectField)` has a non-zero length; for single-select, check if `getPConnect().getValue(singleSelectFieldValue)` is truthy. Initialize local state `showRecords` from this computed boolean.
33
+ 4. **Deduplicate search fields from metadata:** call `getPConnect()` into `pConn`. Read `rawViewMetadata = pConn.getRawMetadata()`. Iterate `rawViewMetadata.config.searchGroups`, and for each group's children, add the child to a `searchFields` collection only if its `config.value` hasn't been seen yet (tracked via a set of seen values) and it has no `config.validator`. This prevents duplicate fields from appearing across groups.
34
+ 5. **Create the editable field component from the first child:** get `firstChildPConnect` from `getPConnect().getChildren()[0].getPConnect`. Read `firstChildMeta` from `rawViewMetadata.children[0]`. Bind `localizedVal = PCore.getLocaleUtils().getLocaleValue`. Resolve `cache` via `PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey)` (default empty object). Call `firstChildPConnect().createComponent(...)` with `type: firstChildMeta.type` and a config that merges the output of `getFirstChildConfig(...)` (a utility from the DataReference helpers that assembles config from `firstChildMeta`, `getPConnect`, `rawViewMetadata`, `contextClass: targetObjectClass`, `dataReferenceConfigToChild`, `isCreateNewReferenceEnabled`, `disableStartingFieldsForReference`, and `pyID`) together with `searchFields`, `showRecords`, `label: localizedVal('Search results', 'DataReference')`, `searchSelectCacheKey`, and `cache`.
35
+ 6. **Derive the editable field path:** from the created component's PConnect config, obtain `selectionList` and `dataRelationshipContext`. Set `editableField` to `selectionList.substring(1)` for multi-select mode, or `dataRelationshipContext` otherwise.
36
+ 7. Render the SearchGroups component (passed `getPConnect`, `editableField`, `localeReference`, the `setShowRecords` state updater, `searchSelectCacheKey`, and `cache`) followed by the created editable field component.
103
37
 
104
38
  ## Behavioral Contract
105
39
 
@@ -107,121 +41,86 @@ export default function AdvancedSearch(props) {
107
41
 
108
42
  1. `rawViewMetadata = getPConnect().getRawMetadata()`.
109
43
  2. `searchGroups = rawViewMetadata.config.searchGroups` — array of group config objects.
110
- 3. Each group has a `label` and a `fields` array.
44
+ 3. Each group has a `label` and a `children` array containing field definitions.
111
45
 
112
46
  ### Field Deduplication
113
47
 
114
- - Track seen field values in a `Set`.
115
- - For each field across all groups: if `field.value` already in Set, skip it.
116
- - Else add `field.value` to Set and include the field.
48
+ - Track seen field values in a set.
49
+ - For each field across all groups: if `field.config.value` already in the set, skip it.
50
+ - Also skip fields that have a `config.validator` (these are validation-only fields, not user-visible search fields).
117
51
  - Deduplication is applied per-group in order — earlier groups take precedence.
118
52
 
119
- ### Context (`DataReferenceAdvancedSearchContext`)
120
-
121
- Provides shared config to `SearchGroups`:
53
+ ### Shared Search-Configuration Context
122
54
 
123
- ```tsx
124
- <DataReferenceAdvancedSearchContext.Provider value={{ dataPageName, parameters, getPConnect }}>
125
- {searchGroups.map((group) => (
126
- <SearchGroups key={group.label} group={group} />
127
- ))}
128
- </DataReferenceAdvancedSearchContext.Provider>
129
- ```
55
+ The parent DataReference provides a shared context (a framework-appropriate context or dependency injection mechanism). This context supplies: `dataReferenceConfigToChild` (containing `selectionMode`, `value`, `readonlyContextList`), `isCreateNewReferenceEnabled`, `disableStartingFieldsForReference`, `pyID`, and `searchSelectCacheKey`. The AdvancedSearch component consumes this context to configure its search behavior.
130
56
 
131
57
  ### Render Structure
132
58
 
133
- ```
134
- <div className="psdk-advanced-search">
135
- {searchGroups.map(group => (
136
- <SearchGroups group={group} key={group.label} />
137
- ))}
138
- </div>
139
- ```
59
+ The component renders two things sequentially: the SearchGroups sub-component (which manages search field inputs and group switching) followed by the dynamically created editable field component (which displays search results).
140
60
 
141
61
  ---
142
62
 
143
63
  ## Sub-Component: SearchGroups
144
64
 
145
- Renders a single search group section: a heading + a list of editable search fields.
65
+ Manages search group selection, transient data for filter state, and search execution. It handles group switching, field initialization, caching, and triggering search.
146
66
 
147
- ### Props
67
+ ### Inputs
148
68
 
149
- | Prop | Type | Description |
150
- | ------- | -------- | ---------------------------------- |
151
- | `group` | `object` | `{ label: string, fields: array }` |
69
+ | Input | Type | Description |
70
+ | ---------------------- | ---------- | --------------------------------------------------- |
71
+ | `getPConnect` | `function` | PConnect getter |
72
+ | `editableField` | `string` | The reference field name for search results binding |
73
+ | `localeReference` | `string` | Locale reference for i18n labels |
74
+ | `setShowRecords` | `function` | State updater to toggle search results visibility |
75
+ | `searchSelectCacheKey` | `string` | Cache key for persisting search state |
76
+ | `cache` | `object` | Previously cached search state (or empty object) |
152
77
 
153
78
  ### Behavioral Contract
154
79
 
155
- For each field in `group.fields`:
156
-
157
- 1. Get `firstChildPConnect = getPConnect().getChildren()[0]`.
158
- 2. Create an editable field component: `firstChildPConnect.createComponent({ type: field.type, config: { ...field.config } })`.
159
- 3. Render the created component alongside a `<SearchGroups>` label row.
80
+ 1. **Initialize search fields:** For each field in the active search group, resolve its initial value from (in priority order): cached values for the field, a property-annotation default, a literal default, or empty string. Also resolve nested classID metadata for compound property paths.
81
+ 2. **Manage transient data:** On mount, register a transient item with `getPConnect().getContainerManager().addTransientItem(...)` containing the initialized filter values plus the reference list classID. When the active group changes, replace the transient data via `PCore.getContainerUtils().replaceTransientData(...)`.
82
+ 3. **Group switching:** Maintain local state for the active group ID. When the user selects a different group, update the active group and reinitialize transient data.
83
+ 4. **Search execution:** On search trigger, gather form data from the transient context via `PCore.getFormUtils().getSubmitData(transientItemID, { isTransientContext: true, includeDisabledFields: true })`, flatten nested objects, and use the flattened values as filter parameters.
84
+ 5. **Caching:** Persist search state (active group, field values, results) via `PCore.getNavigationUtils()` component cache for restoration on re-entry.
160
85
 
161
86
  ### Render Structure
162
87
 
163
- ```
164
- <div className="psdk-search-group">
165
- <h4>{group.label}</h4>
166
- {group.fields.map((field, i) => (
167
- <div key={i} className="psdk-search-group-field">
168
- {createdFieldComponent[i]}
169
- </div>
170
- ))}
171
- </div>
172
- ```
88
+ The SearchGroups component renders: a group selector (when multiple groups exist), the search fields for the active group (created as live PConnect components), and a search action button.
173
89
 
174
90
  ## Visual Specifications
175
91
 
176
92
  ### AdvancedSearch Container
177
93
 
178
- | Element | Description |
179
- | --------------- | --------------------------------------- |
180
- | Outer container | Vertical stack of search group sections |
94
+ Vertical stack of sections: search groups control area followed by the editable results field.
181
95
 
182
96
  ### SearchGroups Section
183
97
 
184
- | Element | Description |
185
- | ------------- | ------------------------------------- |
186
- | Group heading | `<h4>` with group label |
187
- | Field rows | Each field rendered as a form control |
188
-
189
- **CSS-only implementation notes:**
98
+ - Group selector (dropdown or tabs when multiple groups exist).
99
+ - Search fields rendered as standard form controls in a vertical or grid layout.
100
+ - Search button to trigger the query.
190
101
 
191
- - Outer container: `display: flex; flex-direction: column; gap: 1.5rem`.
192
- - Group section: `display: flex; flex-direction: column; gap: 0.75rem`.
193
- - Group heading: `font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem`.
194
- - Field row: `display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 0.5rem`.
102
+ Use companion styles for layout: vertical flex with appropriate gap between sections, grid or stacked layout for search fields (label plus input), and standard button styling for the search action.
195
103
 
196
104
  ## Edge Cases & Special Logic
197
105
 
198
- - `rawViewMetadata.config.searchGroups` may be undefined if the view has no search groups — default to `[]`.
199
- - Field deduplication is by `field.value` (the property path), not by label.
200
- - `firstChildPConnect.createComponent` — must use the correct field type from `field.type`; the created component is a live PConnect view.
201
- - Context is required by `SearchGroups` — always wrap `SearchGroups` with the context provider.
106
+ - `rawViewMetadata.config.searchGroups` may be undefined if the view has no search groups — default to an empty array.
107
+ - Field deduplication is by `field.config.value` (the property path), not by label.
108
+ - `firstChildPConnect().createComponent(...)` — must use the correct field type from the first child metadata; the created component is a live PConnect view.
109
+ - The shared search-configuration context is required — SearchGroups depends on it for configuration. Always ensure the context is provided by the parent DataReference.
110
+ - The `getFirstChildConfig` utility (from the DataReference helpers) assembles configuration needed for the editable search results component.
111
+ - Cache retrieval via `PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey)` may return null — always default to an empty object.
202
112
 
203
113
  ## Dependencies
204
114
 
205
- - `DataReferenceAdvancedSearchContext` — shared context (defined in `./context` or inline)
206
- - `PConnectComponent` from `@pega/sdk-react` — renders created field components
207
- - `getRawMetadata()` — for search group config extraction
115
+ - A shared search-configuration context provided by the parent DataReference component
116
+ - A `getFirstChildConfig` utility from the DataReference helpers
117
+ - The project's component registry to retrieve SearchGroups
118
+ - The project's base component interface for rendering dynamically created PConnect components
119
+ - `PCore.getLocaleUtils().getLocaleValue` for i18n labels
120
+ - `PCore.getNavigationUtils().getComponentCache(...)` for search state caching
121
+ - `PCore.getContainerUtils().replaceTransientData(...)` for filter state management
122
+ - `PCore.getFormUtils().getSubmitData(...)` for collecting search form values
208
123
 
209
124
  ## Design System Mapping
210
125
 
211
- **UI control type:** Multi-section advanced search form with grouped field rows.
212
-
213
- Listed design systems are examples only.
214
-
215
- | Design System | Group Heading | Field Layout |
216
- | ------------------ | ------------------------------ | ------------------------------ |
217
- | Default (CSS only) | `<h4>` | CSS grid 2-col (label + input) |
218
- | MUI | `<Typography variant='h6'>` | `<Grid container>` |
219
- | Ant Design | `<Typography.Title level={5}>` | `<Form.Item>` |
220
- | Chakra UI | `<Heading size='sm'>` | `<FormControl>` rows |
221
- | Shadcn/ui | `<h4>` or `<Label>` | Tailwind grid |
222
-
223
- When implementing in a specific design system:
224
-
225
- - `DataReferenceAdvancedSearchContext` must be provided — `SearchGroups` consumes it via `useContext`
226
- - Field deduplication by `field.value` must happen before rendering
227
- - `createComponent` creates live editable fields — render via `createElement(PConnectComponent, fieldConfig)`
126
+ Use a vertical stacked layout for the overall advanced search form. The group selector (when multiple groups exist) can be a dropdown, tabs, or segmented control depending on the design system. Search fields should render in a two-column grid (label plus input) or vertical stack. The search button uses the design system's primary or secondary button style. The editable results component renders below the search controls. All layout should respect the shared search-configuration context for selection mode (single vs. multi-select) to determine how results are displayed and selected.
@@ -1,6 +1,6 @@
1
1
  # Skill: AppShell
2
2
 
3
- Top-level application shell template. Renders the outer portal/WSS portal frame: navigation bar, alert banners, operator avatar, portal logo, and case types. Provides NavContext to child components.
3
+ Top-level application shell template. Renders the outer portal/WSS portal frame: navigation bar, alert banners, operator avatar, portal logo, and case types. Provides a navigation store context to child components.
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
 
@@ -8,7 +8,7 @@ Top-level application shell template. Renders the outer portal/WSS portal frame:
8
8
 
9
9
  > ⚠️ **CRITICAL — DO NOT SIMPLIFY THIS COMPONENT**
10
10
  >
11
- > **NavBar requires `pConn` prop.** Without it, `pConn.resolveConfigProps()` throws `TypeError: Cannot read properties of undefined`. ALWAYS pass `pConn={pConn}` where `const pConn = getPConnect()`.
11
+ > **NavBar requires `pConn` input.** Without it, `pConn.resolveConfigProps()` throws `TypeError: Cannot read properties of undefined`. ALWAYS pass `pConn` where `const pConn = getPConnect()`.
12
12
  >
13
13
  > This component has **mandatory side effects** (portal logo loading, case type fetching from data page, WSS vs standard portal detection). Do NOT collapse to a single-line return statement.
14
14
  >
@@ -16,14 +16,14 @@ Top-level application shell template. Renders the outer portal/WSS portal frame:
16
16
  >
17
17
  > 1. `const pConn = getPConnect()` — and pass `pConn` to NavBar
18
18
  > 2. WSS vs standard portal detection (`portalTemplate === 'wss'`)
19
- > 3. `NavContext.Provider` wrapping the standard portal layout
19
+ > 3. Navigation store context wrapping the standard portal layout
20
20
  > 4. NavBar receiving: `getPConnect`, `pConn`, `appName`, `pages`, `caseTypes`
21
21
  > 5. AlertBanner rendering messages from `httpMessages` + `pageMessages`
22
22
  >
23
23
  > **Post-Generation Checklist:**
24
24
  >
25
25
  > - [ ] `pConn` passed to NavBar
26
- > - [ ] `NavContext.Provider` wrapping standard portal
26
+ > - [ ] Navigation store context wrapping standard portal
27
27
  > - [ ] WSS vs standard portal detection
28
28
  > - [ ] AlertBanner with combined messages
29
29
  > - [ ] Operator info from `PCore.getEnvironmentInfo()`
@@ -32,158 +32,70 @@ Top-level application shell template. Renders the outer portal/WSS portal frame:
32
32
 
33
33
  ## Component Purpose
34
34
 
35
- The outermost container for the Pega SDK React app. Determines whether the app is running in WSS portal or standard portal mode, renders the appropriate navigation bar, handles HTTP and page-level alert messages, loads the portal logo asynchronously, and passes navigation links and case types to the nav bar.
35
+ The outermost container for the application. Determines whether the app is running in WSS portal or standard portal mode, renders the appropriate navigation bar, handles HTTP and page-level alert messages, loads the portal logo asynchronously, and passes navigation links and case types to the nav bar.
36
36
 
37
37
  ## Pega Metadata
38
38
 
39
- - **Registration key:** `AppShell` (in `component-map.ts`)
39
+ - **Registration key:** `AppShell` (in the project's component map)
40
40
  - **Category:** Page template — application shell
41
- - **Extends:** `PConnProps`
42
-
43
- ## Props
44
-
45
- | Prop | Type | Required | Description |
46
- | ------------- | ----------- | -------- | ------------------------------------------------------------ |
47
- | `pages` | `array` | Yes | Array of portal page objects `{ name, pyLabel, linkUrl }` |
48
- | `caseTypes` | `array` | No | Fallback case types (overridden by data page fetch if empty) |
49
- | `portalName` | `string` | Yes | Portal identifier — determines WSS vs standard rendering |
50
- | `displayName` | `string` | No | Operator display name for avatar |
51
- | `getPConnect` | `function` | Yes | PConnect getter |
52
- | `children` | `ReactNode` | Yes | Main content area |
53
-
54
- ## Component Skeleton
55
-
56
- ```typescript
57
- import { type PropsWithChildren, useEffect, useState } from 'react';
58
- import { getComponentFromRegistry } from '@pega/sdk-react';
59
- import type { PConnProps } from '@pega/sdk-react';
60
- import { Utils } from '../../helpers/utils';
61
- import { NavContext } from '../../helpers/reactContextHelpers';
62
- import './AppShell.css';
63
-
64
- interface AppShellProps extends PConnProps {
65
- showAppName: boolean;
66
- pages: { pxPageViewIcon: string; pyClassName: string; pyLabel: string; pyRuleName: string; pyURLContent: string }[];
67
- caseTypes?: object[];
68
- portalTemplate: string;
69
- portalName: string;
70
- portalLogo: string;
71
- navDisplayOptions: { alignment: string; position: string };
72
- httpMessages: string[];
73
- pageMessages: string[];
74
- }
75
-
76
- export default function AppShell(props: PropsWithChildren<AppShellProps>) {
77
- // 1. Registry lookups
78
- const NavBar = getComponentFromRegistry('NavBar');
79
- const WssNavBar = getComponentFromRegistry('WssNavBar');
80
- const AlertBanner = getComponentFromRegistry('AlertBanner');
81
-
82
- // 2. Destructure props
83
- const {
84
- pages = [], caseTypes = [], showAppName, children = [],
85
- getPConnect, httpMessages = [], pageMessages = [],
86
- portalTemplate, portalName, portalLogo, navDisplayOptions,
87
- } = props;
88
-
89
- // 3. State + PConnect setup
90
- const [open, setOpen] = useState(true);
91
- const pConn = getPConnect();
92
- const envInfo = PCore.getEnvironmentInfo();
93
- const userName = envInfo.getOperatorName() || '';
94
- const currentUserInitials = Utils.getInitials(userName);
95
- const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
96
- const localizedVal = PCore.getLocaleUtils().getLocaleValue;
97
- const [iconURL, setIconURL] = useState('');
98
-
99
- // 4. Messages/banners
100
- const messages = [...httpMessages, ...pageMessages];
101
- const hasBanner = messages.length > 0;
102
-
103
- // 5. useEffect: load portal logo async
104
- // 6. useEffect: fetch case types from data page
105
- // 7. useEffect: set pyPortalTemplate for WSS
106
-
107
- // 8. Build nav links from pages
108
- const links = pages.map(page => ({
109
- text: localizedVal(page.pyLabel, '', ''),
110
- onClick: () => !page.pyURLContent
111
- ? pConn.getActionsApi().showPage(page.pyRuleName, page.pyClassName)
112
- : window.open(page.pyURLContent, '_blank'),
113
- }));
114
-
115
- // 9. Render: WSS portal vs standard portal
116
- if (portalTemplate === 'wss') {
117
- return (
118
- <div id="AppShell">
119
- <WssNavBar portalName={portalName} imageSrc={iconURL} navLinks={links}
120
- operator={{ name: userName, currentUserInitials }} navDisplayOptions={navDisplayOptions} />
121
- <div>{hasBanner && <AlertBanner messages={messages} />}{children}</div>
122
- </div>
123
- );
124
- }
125
- return (
126
- <NavContext.Provider value={{ open, setOpen }}>
127
- <div id="AppShell" style={{ display: 'flex' }}>
128
- <NavBar getPConnect={getPConnect} pConn={pConn}
129
- appName={appNameToDisplay} pages={pages} caseTypes={caseTypes} />
130
- <div>{hasBanner && <AlertBanner messages={messages} />}{children}</div>
131
- </div>
132
- </NavContext.Provider>
133
- );
134
- }
135
- ```
41
+ - **Extends:** the project's base component interface
42
+
43
+ ## Inputs
44
+
45
+ | Input | Type | Required | Description |
46
+ | ------------- | ---------- | -------- | ------------------------------------------------------------ |
47
+ | `pages` | `array` | Yes | Array of portal page objects `{ name, pyLabel, linkUrl }` |
48
+ | `caseTypes` | `array` | No | Fallback case types (overridden by data page fetch if empty) |
49
+ | `portalName` | `string` | Yes | Portal identifier — determines WSS vs standard rendering |
50
+ | `displayName` | `string` | No | Operator display name for avatar |
51
+ | `getPConnect` | `function` | Yes | PConnect getter |
52
+ | `children` | slot | Yes | Main content area |
53
+
54
+ ## Implementation Structure
55
+
56
+ **Module Setup:** Use the project's base component interface for typing. Bring in the utility module that provides `getInitials` (the project's shared helpers), the navigation store context (shared context for nav drawer state), and a companion styles file. Register the component under its key in the project's component map.
57
+
58
+ **Main Component Logic** — steps in order:
59
+
60
+ 1. Retrieve `NavBar`, `WssNavBar`, and `AlertBanner` from the project's component registry.
61
+ 2. Receive inputs: `pages` (default `[]`), `caseTypes` (default `[]`), `showAppName`, `children` (default `[]`), `getPConnect`, `httpMessages`/`pageMessages` (default `[]`), `portalTemplate`, `portalName`, `portalLogo`, and `navDisplayOptions`.
62
+ 3. Declare local state `open` (boolean, default `true`) for the nav drawer; call `getPConnect()` once into `pConn`; read `envInfo = PCore.getEnvironmentInfo()`, derive `userName = envInfo.getOperatorName() || ''`, `currentUserInitials = Utils.getInitials(userName)`, `appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : ''`, bind `localizedVal = PCore.getLocaleUtils().getLocaleValue`, and declare local state `iconURL` (string, default `''`) for the async-loaded logo.
63
+ 4. Combine `httpMessages` and `pageMessages` into a single `messages` array; compute `hasBanner = messages.length > 0`.
64
+ 5. Add three lifecycle effects: one to asynchronously load the portal logo and store its URL in `iconURL`; one to fetch case types from the environment-provided data page (see the Case Types section below); and one to set the `pyPortalTemplate` value for WSS detection.
65
+ 6. Build `links` from `pages`: for each page, the click handler either calls `pConn.getActionsApi().showPage(page.pyRuleName, page.pyClassName)` when there's no external URL, or opens `page.pyURLContent` in a new tab; the label is `localizedVal(page.pyLabel, '', '')`.
66
+ 7. **Render — WSS portal:** when `portalTemplate === 'wss'`, render a container `#AppShell` containing `WssNavBar` (passed `portalName`, `imageSrc` as `iconURL`, `navLinks` as `links`, `operator` as `{ name: userName, currentUserInitials }`, `navDisplayOptions`) followed by a content region showing the `AlertBanner` (when `hasBanner`) and `children`.
67
+ 8. **Render — standard portal:** otherwise, wrap everything in the navigation store context (providing `{ open, setOpen }`) containing a flex container `#AppShell` with `NavBar` (passed `getPConnect`, `pConn`, `appName` as `appNameToDisplay`, `pages`, `caseTypes`) followed by a content region showing the `AlertBanner` (when `hasBanner`) and `children`.
136
68
 
137
69
  ## Behavioral Contract
138
70
 
139
71
  ### Portal Type Detection
140
72
 
141
73
  - Check `portalName` (or metadata flag) against WSS portal identifier.
142
- - WSS portal → render `<WssNavBar>` component.
143
- - Standard portal → render `<NavBar>` component.
74
+ - WSS portal → render `WssNavBar` component.
75
+ - Standard portal → render `NavBar` component.
144
76
 
145
77
  ### Alert Banners
146
78
 
147
79
  1. Subscribe to `getPConnect()` for `httpMessages` and `pageMessages` updates.
148
- 2. If either array is non-empty, render `<AlertBanner>` DSE component above the main content.
80
+ 2. If either array is non-empty, render the `AlertBanner` component above the main content.
149
81
  3. `AlertBanner` receives the combined message array and a dismiss handler.
150
82
 
151
83
  ### Portal Logo
152
84
 
153
85
  1. On mount, call `PCore.getAssetLoader().getSvcImageUrl(logoAssetName)` asynchronously.
154
- 2. Store the resolved URL in `portalLogoUrl` state.
155
- 3. Pass `portalLogoUrl` to the nav bar as the `logo` prop.
86
+ 2. Store the resolved URL in local state `portalLogoUrl`.
87
+ 3. Pass `portalLogoUrl` to the nav bar as the `logo` input.
156
88
 
157
89
  ### Operator Avatar
158
90
 
159
- - Read `displayName` from `getPConnect().getValue('.pyUserName')` or the `displayName` prop.
160
- - Render operator avatar (initials) in the nav bar via the `operatorInfo` prop.
91
+ - Read `displayName` from `getPConnect().getValue('.pyUserName')` or the `displayName` input.
92
+ - Render operator avatar (initials) in the nav bar via the `operatorInfo` input.
161
93
 
162
94
  ### Case Types
163
95
 
164
96
  > ⚠️ **DO NOT hardcode `'D_pyPortalTypeList'`** — this data page does not exist in most environments and will 404.
165
97
 
166
- The correct pattern reads the data page name dynamically from the environment:
167
-
168
- ```typescript
169
- useEffect(() => {
170
- // @ts-expect-error - environmentInfoObject may not be in typedefs
171
- const caseTypesDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
172
- if (caseTypesDP) {
173
- const portalID = pConn.getValue('.pyOwner', '');
174
- PCore.getDataPageUtils()
175
- .getPageDataAsync(caseTypesDP, pConn.getContextName(), { PortalName: portalID })
176
- .then((response) => {
177
- if (response?.pyCaseTypesAvailableToCreate) {
178
- pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
179
- skipDirtyValidation: true,
180
- });
181
- }
182
- })
183
- .catch(() => undefined);
184
- }
185
- }, []);
186
- ```
98
+ The correct pattern reads the data page name dynamically from the environment, inside a lifecycle effect that runs once on mount: read `caseTypesDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP` (note this property may not appear in the type definitions, so a type suppression comment may be needed). When `caseTypesDP` is truthy, resolve `portalID = pConn.getValue('.pyOwner', '')`, then call `PCore.getDataPageUtils().getPageDataAsync(caseTypesDP, pConn.getContextName(), { PortalName: portalID })`; on success, if the response includes `pyCaseTypesAvailableToCreate`, store it via `pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, { skipDirtyValidation: true })`; swallow any errors silently.
187
99
 
188
100
  Key points:
189
101
 
@@ -192,39 +104,24 @@ Key points:
192
104
  3. Parameter `{ PortalName: portalID }` is required
193
105
  4. Result is stored via `pConn.replaceState('.pyCaseTypesAvailableToCreate', ...)` — this populates PConnect state for other consumers
194
106
 
195
- > ⚠️ **NavBar reads `caseTypes` from its PROP, not from PConnect state.** Do NOT shadow the `caseTypes` prop with `useState`. Pass the prop directly to NavBar:
196
- >
197
- > ```typescript
198
- > const { caseTypes = [] } = props; // direct from props, NO useState
199
- > <NavBar caseTypes={caseTypes} /> // pass the prop through
200
- > ```
107
+ > ⚠️ **NavBar reads `caseTypes` from its INPUT, not from PConnect state.** Do NOT shadow the `caseTypes` input with local state. Instead, receive `caseTypes` (default empty array) directly from inputs and pass that same value straight through to `NavBar caseTypes`.
201
108
  >
202
- > If you use `useState(caseTypes)`, NavBar will receive an empty array because the React state is never updated by `replaceState`.
109
+ > If you store `caseTypes` in local state, NavBar will receive an empty array because the local state is never updated by `replaceState`.
203
110
 
204
- ### NavContext
111
+ ### Navigation Store Context
205
112
 
206
- - Wrap children in `<NavContext.Provider value={{ open, setOpen }}>`.
113
+ - Wrap children in the navigation store context providing `{ open, setOpen }`.
207
114
 
208
115
  ### Render Structure
209
116
 
210
- ```
211
- <NavContext.Provider value={{ open, setOpen }}>
212
- <div id="AppShell" style={{ display: 'flex' }}>
213
- <NavBar caseTypes={caseTypes} ... />
214
- <main style={{ flexGrow: 1, height: '100vh', overflow: 'auto', margin: '0 1rem' }}>
215
- <AlertBanner (if messages) />
216
- {children}
217
- </main>
218
- </div>
219
- </NavContext.Provider>
220
- ```
221
-
222
- > ⚠️ The `<main>` element MUST have:
117
+ The navigation store context (providing `{ open, setOpen }`) wraps a flex container `#AppShell` containing `NavBar` (with `caseTypes` and other inputs) followed by a content region (`flexGrow: 1`, full viewport `height`, `overflow: auto`, horizontal `margin`) that shows the `AlertBanner` when there are messages, then `children`.
118
+
119
+ > ⚠️ The content region MUST have:
223
120
  >
224
121
  > - `flexGrow: 1` — fill remaining viewport width beside NavBar
225
122
  > - `height: 100vh` — full viewport height
226
123
  > - `overflow: auto` — scroll when content exceeds viewport
227
- > - `margin: '0 1rem'` — horizontal spacing between NavBar and content (matches reference's `theme.spacing(2)` = 16px)
124
+ > - `margin: 0 1rem` — horizontal spacing between NavBar and content (approximately 16px)
228
125
 
229
126
  ## Visual Specifications
230
127
 
@@ -238,17 +135,17 @@ Key points:
238
135
  ## Edge Cases & Special Logic
239
136
 
240
137
  - Logo loading is async — show fallback (app name or blank) until URL resolves.
241
- - Case types fetch may fail — catch errors and fall back to the `caseTypes` prop.
138
+ - Case types fetch may fail — catch errors and fall back to the `caseTypes` input.
242
139
  - `httpMessages` are transient (from API errors) — clear them after display or on next navigation.
243
140
  - `pageMessages` are persistent until explicitly dismissed.
244
141
  - If `pages` is empty, `links` array is empty — nav bar may render without page links.
245
142
 
246
143
  ## Dependencies
247
144
 
248
- - `NavBar` DSE component — standard portal navigation
145
+ - `NavBar` component — standard portal navigation (from the project's component registry)
249
146
  - `WssNavBar` template component — WSS portal navigation (see `WssNavBar.md`)
250
- - `AlertBanner` DSE component — message display
251
- - `NavContext` from `../../context/nav-context`
147
+ - `AlertBanner` component — message display (from the project's component registry)
148
+ - Navigation store context — shared nav drawer state for descendant components
252
149
  - `PCore.getAssetLoader().getSvcImageUrl()` — logo URL resolution
253
150
  - `PCore.getDataPageUtils().getPageDataAsync()` — case types data page
254
151
 
@@ -256,18 +153,8 @@ Key points:
256
153
 
257
154
  **UI control type:** Application shell layout — fixed nav + scrollable content area.
258
155
 
259
- Listed design systems are examples only.
260
-
261
- | Design System | Nav Bar | Alert Banner | Shell Layout |
262
- | ------------------ | ------------------------ | -------------------- | --------------------------------------------- |
263
- | Default (CSS only) | `<header>` + custom nav | `<div role='alert'>` | CSS flexbox column |
264
- | MUI | `<AppBar>` + `<Toolbar>` | `<Alert>` | `<Box display='flex' flexDirection='column'>` |
265
- | Ant Design | `<Layout.Header>` | `<Alert>` | `<Layout>` |
266
- | Chakra UI | `<Box as='header'>` | `<Alert>` | `<Flex direction='column'>` |
267
- | Shadcn/ui | Custom header | `<Alert>` | Tailwind `flex flex-col h-screen` |
268
-
269
- When implementing in a specific design system:
156
+ When implementing, choose the design system's shell, nav bar, and alert components that match the project's chosen library. The structure should provide a fixed-height navigation bar at top, an optional alert region below it, and a scrollable content area filling remaining space. All design systems must preserve:
270
157
 
271
- - WSS vs portal detection must remain — the nav bar component differs for each
272
- - Logo URL must be loaded asynchronously from `PCore.getAssetLoader()`
273
- - `NavContext.Provider` must wrap children so descendant nav-aware components can access links
158
+ - WSS vs portal detection — the nav bar component differs for each mode
159
+ - Logo URL loaded asynchronously from `PCore.getAssetLoader()`
160
+ - Navigation store context wrapping children so descendant nav-aware components can access drawer state and links