@pega/sdk 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +10 -3
  2. package/dist/index.js +764 -165
  3. package/package.json +1 -1
  4. package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
  5. package/templates/react-native-sdk-reference/.prettierignore +17 -0
  6. package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
  7. package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
  8. package/templates/react-native-sdk-reference/AGENTS.md +3 -0
  9. package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
  10. package/templates/react-native-sdk-reference/README.md +56 -0
  11. package/templates/react-native-sdk-reference/app.json +40 -5
  12. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
  13. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
  14. package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
  15. package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
  16. package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
  17. package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
  18. package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
  19. package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
  20. package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
  21. package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
  22. package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
  23. package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
  24. package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
  25. package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
  26. package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
  27. package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
  28. package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
  29. package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
  30. package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
  31. package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
  32. package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
  33. package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
  34. package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
  35. package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
  36. package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
  37. package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
  38. package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
  39. package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
  40. package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
  41. package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
  42. package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
  43. package/templates/react-native-sdk-reference/package.json +59 -14
  44. package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
  45. package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  46. package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
  47. package/templates/react-native-sdk-reference/sdk-config.json +31 -9
  48. package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
  49. package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
  50. package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
  51. package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
  52. package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
  53. package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
  54. package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
  55. package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
  56. package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
  57. package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
  58. package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
  59. package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
  60. package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
  61. package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
  62. package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
  63. package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
  64. package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
  65. package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
  66. package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
  67. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
  68. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
  69. package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
  70. package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
  71. package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
  72. package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
  73. package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
  74. package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
  75. package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
  76. package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
  77. package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
  78. package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
  79. package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
  80. package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
  81. package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
  82. package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
  83. package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
  84. package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
  85. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
  86. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
  87. package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
  88. package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
  89. package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
  90. package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
  91. package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
  92. package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
  93. package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
  94. package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
  95. package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
  96. package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
  97. package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
  98. package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
  99. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
  100. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
  101. package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
  102. package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
  103. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
  104. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
  105. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
  106. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
  107. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
  108. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
  109. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
  110. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
  111. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
  112. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
  113. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
  114. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
  115. package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
  116. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
  117. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
  118. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
  119. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
  120. package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
  121. package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
  122. package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
  123. package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
  124. package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
  125. package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
  126. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
  127. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
  128. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
  129. package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
  130. package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
  131. package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
  132. package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
  133. package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
  134. package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
  135. package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
  136. package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
  137. package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
  138. package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
  139. package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
  140. package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
  141. package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
  142. package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
  143. package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
  144. package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
  145. package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
  146. package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
  147. package/templates/react-native-sdk-reference/tsconfig.json +9 -8
  148. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
  149. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
  150. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
  151. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
  152. package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
  153. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
  154. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
  155. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
  156. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
  157. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
  158. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
  159. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
  160. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
  161. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
  162. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
  163. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
  164. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
  165. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
  166. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
  167. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
  168. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
  169. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
  170. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
  171. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
  172. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
  173. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
  174. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
  175. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
  176. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
  177. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
  178. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
  179. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
  180. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
  181. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
  182. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
  183. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
  184. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
  185. package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
  186. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
  187. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
  188. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
  189. package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
  190. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
  191. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
  192. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
  193. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
  194. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
  195. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
  196. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
  197. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
  198. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
  199. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
  200. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
  201. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
  202. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
  203. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
  204. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
  205. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
  206. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
  207. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
  208. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
  209. package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
  210. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
  211. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
  212. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
  213. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
  214. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
  215. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
  216. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
  217. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
  218. package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
  219. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
  220. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
  221. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
  222. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
  223. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
  224. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
  225. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
  226. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
  227. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
  228. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
  229. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
  230. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
  231. package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
  232. package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
  233. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
  234. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
  235. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
  236. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
  237. package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
  238. package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
  239. package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
  240. package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
  241. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
  242. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
  243. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
  244. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
  245. package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
  246. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
  247. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
  248. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
  249. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
  250. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
  251. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
  252. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
  253. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
  254. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
  255. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
  256. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
  257. package/templates/react-sdk-reference/package.json +1 -1
  258. package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
  259. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  260. package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
  261. package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
  262. package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
  263. package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
  264. package/templates/react-native-sdk-reference/App.tsx +0 -49
  265. package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
  266. package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  Typeahead / autocomplete search field that fetches options from a data page or associated list, binds to a Pega case property.
4
4
 
5
- > **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
5
+ > **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, input contract, display modes, event handling, and registration patterns common to ALL field components.
6
6
 
7
7
  ---
8
8
 
@@ -14,11 +14,11 @@ Renders a typeahead input that shows a dropdown of matching options as the user
14
14
 
15
15
  - **Pega Name:** `AutoComplete`
16
16
  - **Type / Subtype:** `Field` / `Picklist`
17
- - **Registration key:** `AutoComplete` (in `component-map.ts`)
17
+ - **Registration key:** `AutoComplete` (in the project's component map)
18
18
 
19
- ## Props (component-specific)
19
+ ## Inputs (component-specific)
20
20
 
21
- | Prop | Type | Description |
21
+ | Name | Type | Description |
22
22
  | -------------------- | -------------------- | -------------------------------------------------------------- |
23
23
  | `listType` | `string` | `'associated'` or `'datapage'` |
24
24
  | `datasource` | `any` | Datasource (array for associated, string name for datapage) |
@@ -27,168 +27,57 @@ Renders a typeahead input that shows a dropdown of matching options as the user
27
27
  | `deferDatasource` | `boolean` (optional) | If true, transform `datasourceMetadata` into datapage config |
28
28
  | `datasourceMetadata` | `any` (optional) | Metadata for deferred datasource |
29
29
  | `onRecordChange` | `any` (optional) | Callback fired on selection change |
30
- | `additionalProps` | `object` (optional) | Extra props passed through to the autocomplete |
31
-
32
- ## Component Skeleton
33
-
34
- Follow this exact structure when implementing. Replace `<AutocompleteWidget>` with the equivalent from your chosen design system.
35
-
36
- ```typescript
37
- import { useEffect, useState } from 'react';
38
- import isDeepEqual from 'fast-deep-equal/react';
39
-
40
- import Utils from '../../helpers/utils';
41
- import { getDataPage } from '../../helpers/data_page';
42
- import handleEvent from '../../helpers/event-utils';
43
- import { getComponentFromRegistry } from '@pega/sdk-react';
44
- import type { PConnFieldProps } from '@pega/sdk-react';
45
-
46
- // ── Option type ──────────────────────────────────────────────
47
- interface IOption {
48
- key: string;
49
- value: string;
50
- }
51
-
52
- // ── Helper functions (top-level, outside component) ──────────
53
- // preProcessColumns → see Helper Functions section
54
- // getDisplayFieldsMetaData → see Helper Functions section
55
- // flattenParameters → see Helper Functions section
56
-
57
- // ── Props interface ──────────────────────────────────────────
58
- interface AutoCompleteProps extends PConnFieldProps {
59
- displayMode?: string;
60
- deferDatasource?: boolean;
61
- datasourceMetadata?: any;
62
- status?: string;
63
- onRecordChange?: any;
64
- additionalProps?: object;
65
- listType: string;
66
- parameters?: any;
67
- datasource: any;
68
- columns: any[];
69
- }
70
-
71
- // ── Component ────────────────────────────────────────────────
72
- export default function AutoComplete(props: AutoCompleteProps) {
73
- // 1. Registry lookups
74
- const TextInput = getComponentFromRegistry('TextInput');
75
- const FieldValueList = getComponentFromRegistry('FieldValueList');
76
-
77
- // 2. Destructure props
78
- const {
79
- getPConnect, label, required, placeholder, value = '',
80
- validatemessage, readOnly, testId, displayMode,
81
- deferDatasource, datasourceMetadata, status,
82
- helperText, hideLabel, onRecordChange,
83
- } = props;
84
-
85
- // 3. PConnect setup
86
- const pConn = getPConnect();
87
- const context = pConn.getContextName();
88
- const actionsApi = pConn.getActionsApi();
89
- const propName = (pConn.getStateProps() as any).value;
90
-
91
- // 4. Props that may be reassigned (use let)
92
- let { listType, parameters, datasource = [], columns = [] } = props;
93
-
94
- // 5. State
95
- const [inputValue, setInputValue] = useState('');
96
- const [options, setOptions] = useState<IOption[]>([]);
97
- const [theDatasource, setDatasource] = useState(null);
98
-
99
- // 6. Derived values
100
- let selectedValue: any = '';
101
- const helperTextToDisplay = validatemessage || helperText;
102
-
103
- // 7. Render-time datasource comparison (NOT in useEffect)
104
- if (!isDeepEqual(datasource, theDatasource)) {
105
- setDatasource(datasource);
106
- }
107
-
108
- // 8. Deferred datasource transformation (reassigns let vars)
109
- // → see Behavioral Contract #5
110
-
111
- // 9. Column preprocessing
112
- columns = preProcessColumns(columns);
113
-
114
- // 10. useEffect: load associated options — deps: [theDatasource]
115
- // → see Behavioral Contract #7
116
-
117
- // 11. useEffect: load datapage options — deps: [] (mount only)
118
- // Guard: skip if displayMode is set OR listType === 'associated'
119
- // → see Behavioral Contract #8
120
-
121
- // 12. Display mode returns (MUST come before main render)
122
- if (displayMode === 'DISPLAY_ONLY') {
123
- return <FieldValueList name={hideLabel ? '' : label} value={value} />;
124
- }
125
- if (displayMode === 'STACKED_LARGE_VAL') {
126
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
127
- }
128
-
129
- // 13. Resolve selectedValue from options
130
- // → see Behavioral Contract #9
131
-
132
- // 14. Event handlers: handleChange, handleInputValue
133
- // → see Behavioral Contract #10, #11
134
-
135
- // 15. Read-only return
136
- if (readOnly) {
137
- const theValAsString = options?.find(opt => opt.key === value)?.value;
138
- return <TextInput {...props} value={theValAsString} />;
139
- }
140
-
141
- // 16. Main editable render — use your design system's autocomplete widget
142
- // Pass: options, getOptionLabel, value, inputValue, onChange, onInputChange,
143
- // label, placeholder, required, error state, helperTextToDisplay, testId
144
- return <AutocompleteWidget ... />;
145
- }
146
- ```
30
+ | `additionalProps` | `object` (optional) | Extra inputs passed through to the autocomplete |
31
+
32
+ All other inputs come from the project's field input contract (see prerequisite skill).
33
+
34
+ ## Implementation Structure
35
+
36
+ Follow this exact structure when implementing. Replace the autocomplete widget with the equivalent from your chosen design system.
37
+
38
+ **Module Setup:** The component depends on the project's component registry (to resolve `TextInput` and `FieldValueList`), the project's event-commit utility, a deep-equality utility (for datasource change detection), the project's utility helpers (for associated option list loading), and the project's data-page utility (for async data page fetching). Define an option type with `key: string` and `value: string`. Declare the top-level helper functions `preProcessColumns`, `getDisplayFieldsMetaData`, and `flattenParameters` (described in the Helper Functions section below). Define the input contract as an extension of the project's field input contract, adding `displayMode`, `deferDatasource`, `datasourceMetadata`, `status`, `onRecordChange`, `additionalProps`, `listType`, `parameters`, `datasource`, and `columns` fields.
39
+
40
+ **Main Component Logic** — steps in order:
41
+
42
+ 1. **Registry lookups** — resolve `TextInput` and `FieldValueList` via the project's component registry.
43
+ 2. **Receive inputs** — `getPConnect`, `label`, `required`, `placeholder`, `value` (default `''`), `validatemessage`, `readOnly`, `testId`, `displayMode`, `deferDatasource`, `datasourceMetadata`, `status`, `helperText`, `hideLabel`, `onRecordChange`.
44
+ 3. **PConnect setup** — obtain the PConnect instance, context name via `pConn.getContextName()`, actions API, and bound property name.
45
+ 4. **Inputs that may be reassigned** — receive `listType`, `parameters`, `datasource` (default `[]`), and `columns` (default `[]`) as reassignable since they get overridden by deferred datasource transformation.
46
+ 5. **Local state** — `inputValue` (default `''`), `options` (array of option objects, default `[]`), and `theDatasource` (default `null`).
47
+ 6. **Derived values** — a local (non-state) `selectedValue` variable initialized to `''`, and `helperTextToDisplay = validatemessage || helperText`.
48
+ 7. **Render-time datasource comparison (not in a lifecycle effect)** — if deep-equal comparison of incoming `datasource` vs cached `theDatasource` is false, update `theDatasource`.
49
+ 8. **Deferred datasource transformation** — reassigns the reassignable variables; see Behavioral Contract item 5.
50
+ 9. **Column preprocessing** — apply `preProcessColumns(columns)`.
51
+ 10. **Lifecycle effect: load associated options** — watching `theDatasource`; see Behavioral Contract item 7.
52
+ 11. **Lifecycle effect: load datapage options** — on mount only, guarded to skip when `displayMode` is set or `listType === 'associated'`; see Behavioral Contract item 8.
53
+ 12. **Display mode returns** (must come before the main render) — `DISPLAY_ONLY` and `STACKED_LARGE_VAL` (the latter with a stacked variant) both return `FieldValueList` with `value` set to the raw stored `value` (the key, not the resolved label).
54
+ 13. **Resolve `selectedValue` from options** — see Behavioral Contract item 9.
55
+ 14. **Event handlers** — the selection change handler and input change handler; see Behavioral Contract items 10 and 11.
56
+ 15. **Read-only return** — when `readOnly` is true, resolve the display label by finding the `options` entry whose `key` matches `value` and taking its `value` field, then render `TextInput` with all inputs passed through plus that resolved label as the `value` override.
57
+ 16. **Main editable render** — use the DS's autocomplete/combobox widget, passing `options`, a label-resolution function, `value` (`selectedValue`), `inputValue`, selection change handler, input change handler, `label`, `placeholder`, `required`, an error state, `helperTextToDisplay`, and `testId`.
147
58
 
148
59
  ## Behavioral Contract
149
60
 
150
- 1. **Options state:** Maintain `options` as `Array<{key: string, value: string}>`.
151
- 2. **Input value state:** Maintain `inputValue` (string) — the typed text in the input box. `selectedValue` is a **local variable** (not React state) recalculated on every render from `options` and `value`.
152
- 3. **Helper text:** Compute `helperTextToDisplay = validatemessage || helperText` — use this wherever helper/error text is rendered.
153
- 4. **Datasource change detection:** During render (not in an effect), use `isDeepEqual` to compare incoming `datasource` with cached `theDatasource`. If different, call `setDatasource(datasource)` to trigger the associated-list `useEffect`.
61
+ 1. **Options state:** Maintain `options` as an array of `{key: string, value: string}` objects.
62
+ 2. **Input value state:** Maintain `inputValue` (string) — the typed text in the input box. `selectedValue` is a **local variable** (not state) recalculated on every render from `options` and `value`.
63
+ 3. **Helper text:** Compute `helperTextToDisplay = validatemessage || helperText`.
64
+ 4. **Datasource change detection:** During render (not in an effect), use deep equality to compare incoming `datasource` with cached `theDatasource`. If different, update `theDatasource` to trigger the associated-list lifecycle effect.
154
65
  5. **Deferred datasource transformation:** If `deferDatasource && datasourceMetadata?.datasource?.name`:
155
- - `listType`, `parameters`, `datasource`, `columns` must be declared with **`let`** (not `const`) because this block reassigns them.
156
- - Set `listType = 'datapage'`, `datasource = datasourceMetadata.datasource.name`.
66
+ - `listType`, `parameters`, `datasource`, `columns` must be declared as **reassignable** because this block overrides them.
67
+ - Set `listType = 'datapage'`, `datasource` to the metadata's datasource name.
157
68
  - Flatten `parameters` using `flattenParameters()` (see Helper Functions).
158
- - Strip the `@P` prefix from property paths: `propertyForDisplayText.startsWith('@P') ? propertyForDisplayText.substring(3) : propertyForDisplayText` (same for `propertyForValue`).
159
- - Build `columns` as:
160
- ```
161
- [
162
- { key: 'true', setProperty: 'Associated property', value: valueProp },
163
- { display: 'true', primary: 'true', useForSearch: true, value: displayProp }
164
- ]
165
- ```
166
- 6. **Column preprocessing:** Apply `preProcessColumns(columns)` (see Helper Functions) — strips leading `.` from each column's `value` field.
167
- 7. **Loading options (`associated`):** `useEffect` with dependency array **`[theDatasource]`** — call `Utils.getOptionList(props, pConn.getDataObject(''))` and `setOptions(result)`.
168
- 8. **Loading options (`datapage`):** `useEffect` with dependency array **`[]`** (mount only, skipped when `displayMode` is set OR `listType === 'associated'`) — call `getDataPage(datasource, parameters, context)`. Map results:
169
- ```
170
- const displayColumn = getDisplayFieldsMetaData(columns);
171
- results.forEach(element => {
172
- optionsData.push({
173
- key: element[displayColumn.key] || element.pyGUID,
174
- value: element[displayColumn.primary]?.toString()
175
- });
176
- });
177
- setOptions(optionsData);
178
- ```
179
- 9. **Selected value resolution:** On render, find `selectedValue` by matching `value` (stored key) against `options`:
180
- ```
181
- index = options.findIndex(el => el.key === value)
182
- selectedValue = index > -1 ? options[index].value : value
183
- ```
69
+ - Strip the `@P` prefix from property paths.
70
+ - Build `columns` as a two-entry array: the first entry marks the key column, the second marks the display column.
71
+ 6. **Column preprocessing:** Apply `preProcessColumns(columns)` — strips leading `.` from each column's `value` field.
72
+ 7. **Loading options (`associated`):** Lifecycle effect watching `theDatasource` — load options via the project's utility helper and update `options` state.
73
+ 8. **Loading options (`datapage`):** Mount-only lifecycle effect (skipped when `displayMode` is set OR `listType === 'associated'`) — call the project's data-page utility, map results using `getDisplayFieldsMetaData(columns)` to extract `key` and `value` per row, and update `options` state.
74
+ 9. **Selected value resolution:** On render, find `selectedValue` by locating the option whose `key` matches `value` (the stored key); if found, `selectedValue` is that option's display text, otherwise it falls back to the raw `value`.
184
75
  10. **On selection change:**
185
-
186
- - `val = newValue ? newValue.key : ''`
187
- - Commit via `handleEvent(actionsApi, 'changeNblur', propName, val)`.
188
- - If `onRecordChange`, call it with the event.
189
-
76
+ - Extract the key from the selected option (or empty string if cleared).
77
+ - Commit via the project's event-commit utility with event type `'changeNblur'`, the property name, and the key.
78
+ - If `onRecordChange` is provided, call it with the event.
190
79
  11. **On input change:** Update `inputValue` state (typed text, does NOT commit to store).
191
- 12. **Read-only:** Resolve the option label (`options.find(opt => opt.key === value)?.value`), delegate to `TextInput` with resolved label: `return <TextInput {...props} value={theValAsString} />`.
80
+ 12. **Read-only:** Resolve the option label (`options.find(opt => opt.key === value)?.value`), delegate to `TextInput` with the resolved label as the `value` override.
192
81
 
193
82
  ## Helper Functions
194
83
 
@@ -196,55 +85,26 @@ These are **top-level pure functions** defined outside the component (design-sys
196
85
 
197
86
  ### `preProcessColumns(columnList)`
198
87
 
199
- Returns a new array where each column object's `.value` has a leading `.` stripped:
200
-
201
- ```
202
- columnList.map(col => {
203
- const temp = { ...col };
204
- temp.value = col.value?.startsWith('.') ? col.value.substring(1) : col.value;
205
- return temp;
206
- });
207
- ```
88
+ Returns a new array where each column object's `.value` has a leading `.` stripped (values not starting with `.` are left unchanged).
208
89
 
209
90
  ### `getDisplayFieldsMetaData(columnList)`
210
91
 
211
- Extracts key, primary display, and secondary display field names from column config:
212
-
213
- ```
214
- const displayColumns = columnList.filter(col => col.display === 'true');
215
- const keyCol = columnList.filter(col => col.key === 'true');
216
- const metaData = { key: '', primary: '', secondary: [] };
217
- metaData.key = keyCol.length > 0 ? keyCol[0].value : 'auto';
218
- for (const dc of displayColumns) {
219
- if (dc.primary === 'true') metaData.primary = dc.value;
220
- else metaData.secondary.push(dc.value);
221
- }
222
- return metaData;
223
- ```
92
+ Extracts key, primary display, and secondary display field names from column config: filter the column list to entries with `display === 'true'` (the display columns) and separately to entries with `key === 'true'` (the key column). Initialize a result object with `key: ''`, `primary: ''`, `secondary: []`. Set the key to the first key column's `value` if one exists, otherwise default to `'auto'`. For each display column, if it is marked `primary === 'true'` assign its `value` to primary, otherwise push its `value` onto secondary. Return the result.
224
93
 
225
94
  Return type: `{ key: string, primary: string, secondary: string[] }`.
226
95
 
227
96
  ### `flattenParameters(params)`
228
97
 
229
- Converts Pega's nested parameter format to a flat key-value map:
230
-
231
- ```
232
- const flat = {};
233
- Object.keys(params).forEach(key => {
234
- const { name, value } = params[key];
235
- flat[name] = value;
236
- });
237
- return flat;
238
- ```
98
+ Converts Pega's nested parameter format to a flat key-value map: for each key in the `params` object, read its `name` and `value` fields and assign `flat[name] = value`. Return the resulting flat map.
239
99
 
240
100
  ## Display Mode Rendering
241
101
 
242
- - **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={value} />` — raw stored value (key string).
243
- - **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />`.
102
+ - **`DISPLAY_ONLY`:** Render `FieldValueList` with `name` set to `label` (or empty when `hideLabel` is true) and `value` set to the raw stored `value` (key string).
103
+ - **`STACKED_LARGE_VAL`:** Render `FieldValueList` the same way, with a stacked layout variant.
244
104
 
245
105
  ## Read-Only Rendering
246
106
 
247
- Resolve the display label from options and delegate: `return <TextInput {...props} value={theValAsString} />`.
107
+ Resolve the display label from options and delegate to `TextInput` with the resolved label as the `value` override.
248
108
 
249
109
  ## Visual Specifications
250
110
 
@@ -257,42 +117,41 @@ Resolve the display label from options and delegate: `return <TextInput {...prop
257
117
  | Input | Combobox pattern — types to filter, click arrow to open all |
258
118
  | Error state | Red border + red helper text |
259
119
  | Label | Floating label |
260
- | Placeholder | From `placeholder` prop |
120
+ | Placeholder | From the `placeholder` input |
261
121
 
262
122
  **Autocomplete behavior:**
263
123
 
264
124
  - The controlled `value` is the selected option object (or `selectedValue` string).
265
125
  - The controlled `inputValue` is the typed text.
266
- - `getOptionLabel` returns `option.value` (the display label).
267
- - `isOptionEqualToValue` returns `option.value` (used for selection matching).
126
+ - The label-resolution function returns the option's display text (the `value` field).
127
+ - Option equality comparison uses the option's display text.
268
128
 
269
129
  ## Edge Cases & Special Logic
270
130
 
271
131
  - `inputValue || selectedValue` — the input displays `inputValue` when typing, `selectedValue` when a selection has been made and nothing is typed.
272
132
  - When `value` is a key that does not yet exist in `options` (e.g., options still loading), display `value` directly as `selectedValue`.
273
133
  - Options array uses `{key, value}` — `key` = stored value, `value` = display label.
274
- - `context` is obtained from `pConn.getContextName()` and passed to `getDataPage`.
134
+ - `context` is obtained from `pConn.getContextName()` and passed to the data-page utility.
275
135
  - **Render ordering matters:** display mode checks → `selectedValue` resolution → define event handlers → readOnly check → main editable render. Do not reorder.
276
136
 
277
137
  ## Dependencies
278
138
 
279
- - `isDeepEqual` from `fast-deep-equal/react`.
280
- - `Utils.getOptionList()` from `../../helpers/utils`.
281
- - `getDataPage()` from `../../helpers/data_page`.
282
- - `handleEvent` from `../../helpers/event-utils`.
283
- - `getComponentFromRegistry('TextInput')` for read-only.
284
- - `getComponentFromRegistry('FieldValueList')` for display modes.
285
- - Typeahead/autocomplete UI widget.
139
+ - A deep-equality utility — for datasource change detection.
140
+ - The project's utility helpers — for associated list option loading.
141
+ - The project's data-page utility — for async datapage fetch.
142
+ - The project's event-commit utility.
143
+ - The project's component registry, resolving `TextInput` — for read-only delegation.
144
+ - The project's component registry, resolving `FieldValueList` — for display modes.
145
+ - A typeahead/autocomplete UI widget from the design system.
286
146
 
287
147
  ## Design System Mapping
288
148
 
289
149
  **UI control type:** Combobox / typeahead autocomplete input.
290
150
 
291
- Listed design systems are examples only.
151
+ When implementing in a specific design system, map the following:
292
152
 
293
- | Design System | Recommended Component |
294
- | ------------------ | ------------------------------------------------------- |
295
- | Default (CSS only) | `<input>` + custom dropdown list with filtering |
296
- | MUI | `<Autocomplete>` with `renderInput` using `<TextField>` |
297
- | Ant Design | `<AutoComplete>` or `<Select showSearch>` |
298
- | Chakra UI | `<Combobox>` (Downshift) or third-party |
153
+ - **Autocomplete** → use the DS's combobox/autocomplete component with option filtering
154
+ - **Option format** → `{key, value}` where `key` is stored and `value` is displayed
155
+ - **Read-only mode** → resolve the display label and delegate to `TextInput`
156
+ - **Error state** → the DS's error/danger visual state
157
+ - **Combobox behavior** → controlled `value` (selected option) + controlled `inputValue` (typed text)