@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
  Location input with Google Maps Places autocomplete, interactive map display, and optional geolocation (current location).
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,121 +14,41 @@ Renders a text input that integrates with Google Maps Places API for address/loc
14
14
 
15
15
  - **Pega Name:** `Location`
16
16
  - **Type / Subtype:** `Field` / `Text-Location`
17
- - **Registration key:** `Location` (in `component-map.ts`)
17
+ - **Registration key:** `Location` (in the project's component map)
18
18
 
19
- ## Props (component-specific)
19
+ ## Inputs (component-specific)
20
20
 
21
- | Prop | Type | Default | Description |
21
+ | Input | Type | Default | Description |
22
22
  | ----------------- | -------------------- | ------- | ------------------------------------------------------------------------ |
23
23
  | `coordinates` | `string` (optional) | `''` | Comma-separated lat/lng string (e.g., `'18.5204, 73.8567'`) |
24
24
  | `onlyCoordinates` | `boolean` (optional) | `false` | If `true`, store and display lat/lng coordinates instead of address text |
25
25
  | `showMap` | `boolean` (optional) | — | Show the interactive map in editable mode |
26
26
  | `showMapReadOnly` | `boolean` (optional) | — | Show the map in read-only mode |
27
27
 
28
- ## Component Skeleton
28
+ ## Implementation Structure
29
29
 
30
30
  Follow this exact structure. This component is complex — integrates Google Maps API for places autocomplete, geolocation, and optional map display.
31
31
 
32
- ```typescript
33
- import { useEffect, useState, useCallback, useRef } from 'react';
34
- import { getComponentFromRegistry } from '@pega/sdk-react';
35
- import type { PConnFieldProps } from '@pega/sdk-react';
36
- import handleEvent from '../../helpers/event-utils';
37
- import './Location.css';
38
-
39
- interface LocationProps extends PConnFieldProps {
40
- coordinates?: string;
41
- onlyCoordinates?: boolean;
42
- showMap?: boolean;
43
- showMapReadOnly?: boolean;
44
- }
45
-
46
- const mapContainerStyle = { width: '100%', height: '300px', marginTop: '0px' };
47
- const defaultCenter = { lat: 18.5204, lng: 73.8567 };
48
- const disabledMapOptions = {
49
- gestureHandling: 'none', keyboardShortcuts: false,
50
- disableDefaultUI: true, clickableIcons: false,
51
- };
52
-
53
- export default function Location(props: LocationProps) {
54
- // 1. Registry lookups
55
- const TextInput = getComponentFromRegistry('TextInput');
56
- const FieldValueList = getComponentFromRegistry('FieldValueList');
57
-
58
- // 2. Destructure props
59
- const {
60
- getPConnect, label, required = false, disabled = false, value = '',
61
- validatemessage, status, readOnly = false, testId, displayMode,
62
- hideLabel = false, placeholder, helperText,
63
- coordinates = '', onlyCoordinates = false, showMap, showMapReadOnly,
64
- } = props;
65
-
66
- // 3. PConnect setup — note TWO property names
67
- const pConn = getPConnect();
68
- const actions = pConn.getActionsApi();
69
- const propName = (pConn.getStateProps() as any).value;
70
- const coordPropName = (pConn.getStateProps() as any).coordinates;
71
-
72
- // 4. State
73
- const [inputValue, setInputValue] = useState<string>(value ?? '');
74
- const [mapCenter, setMapCenter] = useState(defaultCenter);
75
- const [markerPosition, setMarkerPosition] = useState<{lat:number,lng:number} | null>(null);
76
-
77
- // 5. Refs
78
- const inputRef = useRef<HTMLInputElement | null>(null);
79
- const autocompleteRef = useRef<google.maps.places.Autocomplete | null>(null);
80
-
81
- // 6. Load Google Maps API
82
- const { isLoaded } = useLoadScript({
83
- googleMapsApiKey: pConn.getGoogleMapsAPIKey?.() || '',
84
- libraries: ['places', 'geocoding'],
85
- });
86
-
87
- // 7. Error flag
88
- const hasError = status === 'error' && !!validatemessage && !disabled;
89
-
90
- // 8. useEffect: sync value + coordinates — deps: [value, coordinates, onlyCoordinates]
91
- // → see Behavioral Contract #3
92
-
93
- // 9. handleChange (manual text input) — useCallback
94
- // Commits immediately, clears coordinates if input emptied
95
-
96
- // 10. handlePlaceChanged — useCallback
97
- // Reads place from autocompleteRef, extracts lat/lng,
98
- // stores address or coordinates based on onlyCoordinates flag
99
-
100
- // 11. useEffect: init Places Autocomplete — deps: [isLoaded, handlePlaceChanged]
101
- // Guard: isLoaded && inputRef.current && !autocompleteRef.current
102
-
103
- // 12. handleGetCurrentLocation — useCallback
104
- // Uses navigator.geolocation.getCurrentPosition
105
- // If onlyCoordinates: store coords directly
106
- // Else: reverse geocode via google.maps.Geocoder
107
-
108
- // 13. Display mode returns
109
- if (displayMode === 'DISPLAY_ONLY') {
110
- return <FieldValueList name={hideLabel ? '' : label} value={value} />;
111
- }
112
- if (displayMode === 'STACKED_LARGE_VAL') {
113
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
114
- }
115
-
116
- // 14. Map element (shared between readOnly and editable)
117
- // opacity: disabled ? 0.7 : 1, options: disabled ? disabledMapOptions : undefined
118
-
119
- // 15. Read-only return
120
- if (readOnly) {
121
- return <div><TextInput {...props} />{isLoaded && showMapReadOnly && map}</div>;
122
- }
123
-
124
- // 16. Main render
125
- // - Error alert ABOVE input if hasError
126
- // - Guard: only render TextField when isLoaded
127
- // - TextField with inputRef, endAdornment location icon button
128
- // - Map below if isLoaded && showMap
129
- return <div>...</div>;
130
- }
131
- ```
32
+ **Module Setup:** The component depends on the project's component registry (to resolve `TextInput` and `FieldValueList`), the project's event-commit utility (for committing value changes to the store), and a Google Maps script loader capable of loading the `places` and `geocoding` libraries dynamically. A companion stylesheet is needed to fix the autocomplete dropdown z-index (see CSS section). Define the input contract as the project's field input contract extended with `coordinates?`, `onlyCoordinates?`, `showMap?`, and `showMapReadOnly?`. Define module-level constants: `mapContainerStyle` (`width: '100%'`, `height: '300px'`, `marginTop: '0px'`), `defaultCenter` (`{ lat: 18.5204, lng: 73.8567 }` — Pune, India), and `disabledMapOptions` (`gestureHandling: 'none'`, `keyboardShortcuts: false`, `disableDefaultUI: true`, `clickableIcons: false`).
33
+
34
+ **Main Component Logic** — steps in order:
35
+
36
+ 1. **Registry lookups** — resolve `TextInput` and `FieldValueList` via the project's component registry.
37
+ 2. **Receive inputs** — `getPConnect`, `label`, `required` (default `false`), `disabled` (default `false`), `value` (default `''`), `validatemessage`, `status`, `readOnly` (default `false`), `testId`, `displayMode`, `hideLabel` (default `false`), `placeholder`, `helperText`, `coordinates` (default `''`), `onlyCoordinates` (default `false`), `showMap`, `showMapReadOnly`.
38
+ 3. **PConnect setup** (note TWO property names) — `pConn`, `actions`, `propName` for the address/value, and a separate `coordPropName` for the coordinates property.
39
+ 4. **Local state** — `inputValue` (initialized from `value`), `mapCenter` (initialized to `defaultCenter`), and `markerPosition` (initialized to `null`).
40
+ 5. **Instance references** — `inputRef` for the text input element, `autocompleteRef` for the Google Places Autocomplete instance.
41
+ 6. **Load Google Maps API** — use a script-loading mechanism with the API key from `pConn.getGoogleMapsAPIKey?.() || ''` and the `places` and `geocoding` libraries. Track the loaded status via an `isLoaded` flag.
42
+ 7. **Error flag** — `hasError = status === 'error' && !!validatemessage && !disabled`.
43
+ 8. **Sync lifecycle effect** — watching `value`, `coordinates`, `onlyCoordinates`; see Behavioral Contract item 3.
44
+ 9. **`handleChange`** (manual text input, cached callback) — commits immediately, clears coordinates if the input is emptied.
45
+ 10. **`handlePlaceChanged`** (cached callback) — reads the selected place from the autocomplete instance reference, extracts `lat`/`lng`, and stores either the address or the coordinates depending on the `onlyCoordinates` flag.
46
+ 11. **Init Places Autocomplete** — a lifecycle effect watching `isLoaded` and the place-changed handler, guarded to run only once `isLoaded && inputRef is set && autocompleteRef is not yet set`.
47
+ 12. **`handleGetCurrentLocation`** (cached callback) — uses `navigator.geolocation.getCurrentPosition`; when `onlyCoordinates` is set, stores the coordinates directly, otherwise reverse-geocodes via `google.maps.Geocoder`.
48
+ 13. **Display mode returns** — `DISPLAY_ONLY` and `STACKED_LARGE_VAL` (the latter with a stacked variant) both return `FieldValueList` with the raw `value`.
49
+ 14. **Map element** (shared between read-only and editable rendering) — opacity reduced to `0.7` when `disabled`, and `disabledMapOptions` applied when `disabled`.
50
+ 15. **Read-only return** — render a wrapper containing `TextInput` with all inputs spread, plus the map (once loaded) when `showMapReadOnly` is set.
51
+ 16. **Main render** — render an error alert above the input when `hasError`; only render the text field once `isLoaded`; the text field carries the input reference and a trailing location-icon button that triggers `handleGetCurrentLocation`; render the map below when `isLoaded && showMap`.
132
52
 
133
53
  ## Behavioral Contract
134
54
 
@@ -139,19 +59,19 @@ export default function Location(props: LocationProps) {
139
59
  - `inputValue` (string): shown in the text input
140
60
  - `mapCenter` (`{lat, lng}`): default `{ lat: 18.5204, lng: 73.8567 }` (Pune, India)
141
61
  - `markerPosition` (`{lat, lng} | null`)
142
- 3. **Value sync:** `useEffect` watching `value`, `coordinates`, `onlyCoordinates`:
143
- - If `onlyCoordinates && coordinates`: `setInputValue(coordinates)`
144
- - Else: `setInputValue(value ?? '')`
62
+ 3. **Value sync:** A lifecycle effect watching `value`, `coordinates`, `onlyCoordinates`:
63
+ - If `onlyCoordinates && coordinates`: set `inputValue` to `coordinates`
64
+ - Else: set `inputValue` to `value ?? ''`
145
65
  - If `coordinates` exists: parse `lat, lng`, update `mapCenter` and `markerPosition`
146
- 4. **Places Autocomplete (init):** `useEffect` watching `isLoaded` — once Maps API loads and `inputRef.current` is set, attach `new google.maps.places.Autocomplete(inputRef.current)` and add `place_changed` listener.
66
+ 4. **Places Autocomplete (init):** A lifecycle effect watching `isLoaded` — once Maps API loads and the input element reference is set, attach `new google.maps.places.Autocomplete(inputElement)` and add `place_changed` listener.
147
67
  5. **On place changed:**
148
68
  - Get `place.geometry.location` → extract `lat`, `lng`
149
- - If `onlyCoordinates`: `inputValue = "${lat}, ${lng}"`, commit this as the value AND update `coordinates` property
150
- - Else: `inputValue = place.formatted_address`, commit address as value, update `coordinates` property separately: `actions.updateFieldValue(coordPropName, coordinateString)`
69
+ - If `onlyCoordinates`: set `inputValue` to `"lat, lng"` format, commit this as the value AND update the coordinates property
70
+ - Else: set `inputValue` to `place.formatted_address`, commit address as value, update coordinates property separately via `actions.updateFieldValue(coordPropName, coordinateString)`
151
71
  - Update `mapCenter` and `markerPosition`
152
72
  6. **On text change (manual):**
153
- - Update `inputValue` and commit immediately via `handleEvent(actions, 'changeNblur', propName, newValue)`
154
- - If input cleared and `coordPropName` exists: `actions.updateFieldValue(coordPropName, '')`; `setMarkerPosition(null)`
73
+ - Update `inputValue` and commit immediately via the project's event-commit utility with event type `'changeNblur'`, the property name, and the new value
74
+ - If input cleared and `coordPropName` exists: `actions.updateFieldValue(coordPropName, '')` and clear the marker position
155
75
  7. **Get current location button:**
156
76
  - Use `navigator.geolocation.getCurrentPosition()`
157
77
  - If `onlyCoordinates`: store `"lat, lng"` as value and coordinates
@@ -169,82 +89,54 @@ When `disabled`, map options disable all interactions:
169
89
 
170
90
  ### CSS for Google Maps autocomplete dropdown z-index:
171
91
 
172
- ```css
173
- /* Location.css */
174
- .pac-container {
175
- z-index: 2147483647;
176
- }
177
- ```
92
+ A companion stylesheet sets the `.pac-container` (the autocomplete dropdown) to the maximum z-index value, ensuring it appears above modal/dialog overlays.
178
93
 
179
94
  ## Display Mode Rendering
180
95
 
181
- - **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={value} />` — raw address/coordinates string.
182
- - **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />`.
96
+ - **`DISPLAY_ONLY`:** Render `FieldValueList` with `name` set to the label (empty string if `hideLabel`) and `value` set to the raw address/coordinates string.
97
+ - **`STACKED_LARGE_VAL`:** Render `FieldValueList` with the same name/value and a stacked variant.
183
98
 
184
99
  ## Read-Only Rendering
185
100
 
186
- ```
187
- <div>
188
- <TextInput {...props} />
189
- {isLoaded && showMapReadOnly && <GoogleMap ... />}
190
- </div>
191
- ```
101
+ A wrapper containing `TextInput` with all inputs spread, followed by the interactive map (once loaded) when `showMapReadOnly` is set.
192
102
 
193
103
  ## Visual Specifications
194
104
 
195
- | Property | Value |
196
- | -------------------- | -------------------------------------------------- |
197
- | Width | 100% |
198
- | Input variant | Default (outlined, from `TextField`) |
199
- | Trailing icon | Location pin icon button (for current location) |
200
- | Error alert | Alert banner ABOVE the input field when `hasError` |
201
- | Map container | `width: 100%`, `height: 300px`, `marginTop: 0px` |
202
- | Map render | Only shown when `isLoaded && (showMap | | showMapReadOnly)` |
203
- | Disabled map opacity | `0.7` |
105
+ | Property | Value |
106
+ | -------------------- | ------------------------------------------------------------ |
107
+ | Width | 100% |
108
+ | Input variant | Default outlined text field |
109
+ | Trailing icon | Location pin icon button (for current location) |
110
+ | Error alert | Alert banner ABOVE the input field when `hasError` |
111
+ | Map container | `width: 100%`, `height: 300px`, `marginTop: 0px` |
112
+ | Map render | Only shown when `isLoaded && (showMap \|\| showMapReadOnly)` |
113
+ | Disabled map opacity | `0.7` |
204
114
 
205
- **CSS companion file required:** `Location.css` with:
115
+ **CSS companion file required:** A stylesheet that sets `.pac-container` to the maximum z-index value, ensuring the Google Maps autocomplete dropdown appears above modal/dialog overlays.
206
116
 
207
- ```css
208
- .pac-container {
209
- z-index: 2147483647;
210
- }
211
- ```
212
-
213
- This ensures the Google Maps autocomplete dropdown appears above modal/dialog overlays.
214
-
215
- **CSS-only implementation notes:**
216
-
217
- - Location pin button: `<button>` with `position: absolute; right: 8px; top: 50%; transform: translateY(-50%);`
117
+ **Visual-only styling notes:** The location pin button is positioned at the trailing edge of the input, vertically centered.
218
118
 
219
119
  ## Edge Cases & Special Logic
220
120
 
221
- - **`isLoaded` guard:** Only render the `TextField` and map after Google Maps API is fully loaded.
121
+ - **`isLoaded` guard:** Only render the text field and map after Google Maps API is fully loaded.
222
122
  - **`onlyCoordinates` mode:** The stored `value` is `"lat, lng"` format; coordinates and address are the same.
223
123
  - **Dual property:** The component writes to TWO properties — `propName` (address or coordinates) and `coordPropName` (coordinates). `coordPropName` may be undefined if the Pega config doesn't include a coordinates property.
224
- - **Autocomplete ref lifecycle:** `autocompleteRef` is only initialized once (when `!autocompleteRef.current`). The `handlePlaceChanged` callback must be stable (`useCallback` with deps).
124
+ - **Autocomplete instance reference lifecycle:** The autocomplete instance is only initialized once (when the reference is not yet set). The `handlePlaceChanged` callback must be stable (cached with appropriate dependencies).
225
125
  - **Map default center:** Pune, India — `{ lat: 18.5204, lng: 73.8567 }`.
226
126
  - Google Maps Geocoder is only called in non-`onlyCoordinates` geolocation mode for reverse geocoding.
227
127
 
228
128
  ## Dependencies
229
129
 
230
- - Google Maps JavaScript API (loaded dynamically via `@react-google-maps/api` or equivalent loader).
231
- - `@react-google-maps/api` — `GoogleMap`, `Marker`, `useLoadScript`.
232
- - `handleEvent` from `../../helpers/event-utils`.
233
- - `getComponentFromRegistry('TextInput')` for read-only.
234
- - `getComponentFromRegistry('FieldValueList')` for display modes.
235
- - A location pin icon.
130
+ - Google Maps JavaScript API (loaded dynamically via a script loader).
131
+ - A Google Maps rendering library providing map display, marker, and script-loading capabilities.
132
+ - The project's event-commit utility for committing field value changes.
133
+ - The project's component registry to resolve `TextInput` (for read-only) and `FieldValueList` (for display modes).
134
+ - A location pin icon from the project's icon set.
236
135
 
237
- **CSS companion:** `Location.css` — must be imported to fix autocomplete z-index.
136
+ **CSS companion:** A stylesheet that fixes the autocomplete dropdown z-index (`.pac-container`).
238
137
 
239
138
  ## Design System Mapping
240
139
 
241
140
  **UI control type:** Text input with location autocomplete dropdown + optional map.
242
141
 
243
- Listed design systems are examples only.
244
-
245
- | Design System | Recommended Component |
246
- | ------------------ | ----------------------------------------------------------------------- |
247
- | Default (CSS only) | `<input type="text">` + Google Maps Autocomplete API + Google Map embed |
248
- | MUI | `<TextField>` + `InputAdornment` for icon + `@react-google-maps/api` |
249
- | Ant Design | `<Input suffix={<LocationIcon />}>` + Google Maps |
250
- | Chakra UI | `<InputGroup>` + `<InputRightElement>` + Google Maps |
142
+ When implementing in a specific design system, map the following: a full-width outlined text field with trailing icon adornment (for the current-location button), an alert/banner component for error display above the input, and a Google Maps embed component for the interactive map. The trailing icon should be a location/pin icon wrapped in a clickable button. The autocomplete functionality comes from the Google Maps Places API directly attached to the input element, not from the design system.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Multi-select autocomplete field supporting flat lists, grouped/hierarchical data, reference list binding, and debounced search.
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 multi-value typeahead input where users can search and select multiple
14
14
 
15
15
  - **Pega Name:** `Multiselect`
16
16
  - **Type / Subtype:** `Field` / `Picklist-Multi`
17
- - **Registration key:** `Multiselect` (in `component-map.ts`)
17
+ - **Registration key:** `Multiselect` (in the project's component map)
18
18
 
19
- > **Note:** `Multiselect` does NOT extend `PConnFieldProps` — it uses raw `props` (no typed interface in the reference implementation). Define props as needed for your implementation.
19
+ > **Note:** `Multiselect` does NOT extend the project's field input contract — it defines its own inputs directly.
20
20
 
21
- ## Props (component-specific)
21
+ ## Inputs (component-specific)
22
22
 
23
23
  | Prop | Type | Default | Description |
24
24
  | --------------------------- | ---------- | ------------ | ----------------------------------------------------------- |
@@ -44,75 +44,28 @@ Renders a multi-value typeahead input where users can search and select multiple
44
44
  | `maxResultsDisplay` | `string` | — | Max results to display (`'100'` default) |
45
45
  | `value` | `any` | — | Current value |
46
46
 
47
- ## Component Skeleton
48
-
49
- This is a complex component. Note: it does NOT extend `PConnFieldProps` — uses raw `props`.
50
-
51
- ```typescript
52
- import { useEffect, useMemo, useRef, useState } from 'react';
53
- import {
54
- doSearch, getDisplayFieldsMetaData, useDeepMemo,
55
- preProcessColumns, getGroupDataForItemsTree,
56
- } from './utils';
57
- import { insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';
58
- import { debounce } from 'throttle-debounce';
59
-
60
- export default function Multiselect(props) {
61
- // 1. Destructure props (use let for datasource/columns — may be reassigned)
62
- const {
63
- getPConnect, label, placeholder, referenceList, selectionKey,
64
- primaryField, initialCaseClass, showSecondaryInSearchOnly = false,
65
- listType = '', isGroupData = false, referenceType, secondaryFields,
66
- groupDataSource = [], parameters = {}, matchPosition = 'contains',
67
- maxResultsDisplay, groupColumnsConfig = [{}], selectionList, value,
68
- } = props;
69
- let { datasource = [], columns = [{}] } = props;
70
-
71
- // 2. Reference list mode override (if referenceList.length > 0)
72
- // → reassign datasource and columns
73
- // → see Behavioral Contract "Reference List Mode"
74
-
75
- // 3. State
76
- const [inputValue, setInputValue] = useState(value);
77
- const [selectedItems, setSelectedItems] = useState([]);
78
-
79
- // 4. dataConfig (memoized with deep comparison via useDeepMemo)
80
- // → see Behavioral Contract "Data Config"
81
-
82
- // 5. Display field metadata + items tree
83
- // → displayFieldMeta, groupsDisplayFieldMeta, itemsTreeBaseData, itemsTree state
84
-
85
- // 6. Refs
86
- const getCaseListBasedOnParamsDebounced: any = useRef();
87
- const dataApiObj: any = useRef();
88
- const pConn = getPConnect();
89
- const contextName = pConn.getContextName();
90
- const listActions = pConn.getListActions();
91
-
92
- // 7. getCaseListBasedOnParams — main search function
93
- // → see Behavioral Contract "Search"
94
-
95
- // 8. useEffect: setReferenceList — deps: [pConn]
96
- // 9. useEffect: init debounced ref — deps: []
97
- // 10. useEffect: init data API — deps: [dataConfig, ...]
98
- // → PCore.getDataApi().init(dataConfig, contextName)
99
-
100
- // 11. onSearchHandler — updates inputValue, triggers debounced search
101
- // 12. setSelectedItemsForReferenceList — insert/delete instruction
102
- // 13. handleChange — selection add/remove logic
103
- // → see Behavioral Contract "Selection Changes"
104
-
105
- // 14. Main render — multi-select autocomplete
106
- // Key props:
107
- // - multiple, fullWidth, disableCloseOnSelect
108
- // - options: itemsTree, value: selectedItems
109
- // - getOptionLabel: (option) => option?.primary
110
- // - onChange: handleChange
111
- // - renderInput: TextField with label, placeholder, size='small',
112
- // variant='outlined', onChange=onSearchHandler
113
- return <MultiSelectAutocomplete ... />;
114
- }
115
- ```
47
+ ## Implementation Structure
48
+
49
+ This is a complex component. Note: it does NOT extend the project's field input contract — it defines its own inputs directly.
50
+
51
+ **Module Setup:** The component depends on local utility helpers (`doSearch`, `getDisplayFieldsMetaData`, a deep-memoization hook, `preProcessColumns`, `getGroupDataForItemsTree`), the project's instruction helpers (`insertInstruction` and `deleteInstruction`), and a debounce utility. It does not use the standard field input contract or the project's event-commit utility — selection commits happen via the instruction helpers.
52
+
53
+ **Main Component Logic** — steps in order:
54
+
55
+ 1. **Receive inputs** (declare `datasource`/`columns` as reassignable since they may be overridden) — `getPConnect`, `label`, `placeholder`, `referenceList`, `selectionKey`, `primaryField`, `initialCaseClass`, `showSecondaryInSearchOnly` (default `false`), `listType` (default `''`), `isGroupData` (default `false`), `referenceType`, `secondaryFields`, `groupDataSource` (default `[]`), `parameters` (default `{}`), `matchPosition` (default `'contains'`), `maxResultsDisplay`, `groupColumnsConfig` (default `[{}]`), `selectionList`, `value`; separately destructure `datasource` (default `[]`) and `columns` (default `[{}]`) with `let`.
56
+ 2. **Reference list mode override** — when `referenceList.length > 0`, reassign `datasource` and `columns`; see the Behavioral Contract "Reference List Mode" section.
57
+ 3. **Local state** — `inputValue` initialized from `value`, and `selectedItems` initialized to `[]`.
58
+ 4. **`dataConfig`** (memoized with deep comparison via a deep-memoization utility) — see the Behavioral Contract "Data Config" section.
59
+ 5. **Display field metadata and items tree** — `displayFieldMeta`, `groupsDisplayFieldMeta`, `itemsTreeBaseData`, and an `itemsTree` state value; see the Behavioral Contract "Items Tree" section.
60
+ 6. **Instance references** — `getCaseListBasedOnParamsDebounced` and `dataApiObj` as instance references; also `pConn` via `getPConnect()`, `contextName` via `pConn.getContextName()`, and `listActions` via `pConn.getListActions()`.
61
+ 7. **`getCaseListBasedOnParams`** — the main search function; see the Behavioral Contract "Search" section.
62
+ 8. **Lifecycle effect: set reference list** — watching the PConnect instance.
63
+ 9. **Lifecycle effect: init debounced reference** — on mount.
64
+ 10. **Lifecycle effect: init data API** — watching `dataConfig` and related dependencies; calls `PCore.getDataApi().init(dataConfig, contextName)`.
65
+ 11. **`onSearchHandler`** — updates `inputValue` and triggers the debounced search.
66
+ 12. **`setSelectedItemsForReferenceList`** — inserts or deletes an instruction depending on selection state.
67
+ 13. **`handleChange`** — selection add/remove logic; see the Behavioral Contract "Selection Changes" section.
68
+ 14. **Main render** — a multi-select autocomplete widget with: `multiple`, `fullWidth`, `disableCloseOnSelect` set; `options={itemsTree}`, `value={selectedItems}`; `getOptionLabel` returning `option?.primary`; `onChange={handleChange}`; and a `renderInput` producing a text field with `label`, `placeholder`, `size='small'`, `variant='outlined'`, and `onChange={onSearchHandler}`.
116
69
 
117
70
  ## Behavioral Contract
118
71
 
@@ -140,16 +93,7 @@ Build a `dataConfig` object (memoized with deep comparison) containing:
140
93
 
141
94
  ### Data API Initialization
142
95
 
143
- In `useEffect` watching `dataConfig` (non-associated lists):
144
-
145
- ```
146
- PCore.getDataApi().init(dataConfig, contextName).then(dataObj => {
147
- dataApiObj.current = dataObj
148
- if (!isGroupData) {
149
- getCaseListBasedOnParamsDebounced.current(inputValue ?? '', '', [...selectedItems], [...itemsTree])
150
- }
151
- })
152
- ```
96
+ In a lifecycle effect watching `dataConfig` (non-associated lists), call `PCore.getDataApi().init(dataConfig, contextName)`. When the promise resolves with a data object: store it in the `dataApiObj` instance reference, and when `isGroupData` is false, invoke the debounced search function with the current `inputValue` (or `''`), an empty group, a copy of `selectedItems`, and a copy of `itemsTree`.
153
97
 
154
98
  ### Search
155
99
 
@@ -164,8 +108,8 @@ PCore.getDataApi().init(dataConfig, contextName).then(dataObj => {
164
108
 
165
109
  ### Mount Effects
166
110
 
167
- - `useEffect([pConn])`: if `referenceList.length > 0`, call `pConn.setReferenceList(selectionList)`.
168
- - `useEffect([])`: set up debounced search ref.
111
+ - A lifecycle effect watching the PConnect instance: if `referenceList.length > 0`, call `pConn.setReferenceList(selectionList)`.
112
+ - A mount lifecycle effect: set up the debounced search reference.
169
113
 
170
114
  ### Selection Changes (`handleChange`)
171
115
 
@@ -202,35 +146,11 @@ No explicit `displayMode` handling in the reference implementation — Multisele
202
146
  | Placeholder | From `placeholder` prop |
203
147
  | Error state | Red border + red helper text |
204
148
 
205
- **CSS-only notes:**
206
-
207
- ```css
208
- .multiselect-tags {
209
- display: flex;
210
- flex-wrap: wrap;
211
- gap: 4px;
212
- padding: 4px;
213
- border: 1px solid rgba(0, 0, 0, 0.23);
214
- border-radius: 4px;
215
- }
216
- .multiselect-tag {
217
- background: rgba(0, 0, 0, 0.08);
218
- border-radius: 16px;
219
- padding: 2px 8px;
220
- font-size: 0.8125rem;
221
- display: flex;
222
- align-items: center;
223
- gap: 4px;
224
- }
225
- .multiselect-tag-delete {
226
- cursor: pointer;
227
- font-size: 0.75rem;
228
- }
229
- ```
149
+ **Visual-only styling notes:** Selected values render as wrapping flex tags inside a bordered, rounded input container with a small gap and padding. Each tag has a light grey pill background, rounded corners, small padding, and a small font size, laid out as a flex row with a delete affordance at a slightly smaller font size and a pointer cursor.
230
150
 
231
151
  ## Edge Cases & Special Logic
232
152
 
233
- - **`dataConfig` deep memoization:** Use custom deep-equal hook (`useDeepMemo`) to avoid re-initializing data API on every render.
153
+ - **`dataConfig` deep memoization:** Use a deep-equality memoization utility to avoid re-initializing data API on every render.
234
154
  - `itemsTreeBaseData` is fixed at render time — used as the base for each fresh search.
235
155
  - When `isGroupData=false`: debounced search fires after data API init.
236
156
  - When `isGroupData=true`: groups are pre-populated from `groupDataSource`.
@@ -238,21 +158,20 @@ No explicit `displayMode` handling in the reference implementation — Multisele
238
158
 
239
159
  ## Dependencies
240
160
 
241
- - `doSearch`, `getDisplayFieldsMetaData`, `useDeepMemo`, `preProcessColumns`, `getGroupDataForItemsTree` from `./utils` (local utils file).
242
- - `insertInstruction`, `deleteInstruction` from `../../helpers/instructions-utils`.
243
- - `debounce` from `throttle-debounce` library (or any debounce utility).
161
+ - Local utility helpers: `doSearch`, `getDisplayFieldsMetaData`, a deep-memoization utility, `preProcessColumns`, `getGroupDataForItemsTree`.
162
+ - The project's instruction helpers (`insertInstruction`, `deleteInstruction`).
163
+ - A debounce utility.
244
164
  - `PCore.getDataApi()` — for data initialization.
245
- - Multi-select autocomplete UI widget.
165
+ - A multi-select autocomplete UI widget from the design system.
246
166
 
247
167
  ## Design System Mapping
248
168
 
249
169
  **UI control type:** Multi-select combobox with tags/chips and searchable dropdown.
250
170
 
251
- Listed design systems are examples only.
171
+ When implementing in a specific design system, map the following:
252
172
 
253
- | Design System | Recommended Component |
254
- | ------------------ | ---------------------------------------------------- |
255
- | Default (CSS only) | Custom tag input + filterable dropdown list |
256
- | MUI | `<Autocomplete multiple disableCloseOnSelect>` |
257
- | Ant Design | `<Select mode="multiple" showSearch>` |
258
- | Chakra UI | Third-party multi-select (e.g., Chakra React Select) |
173
+ - **Multi-select autocomplete** → use the DS's multi-select combobox with tag/chip display and searchable dropdown
174
+ - **Disable close on select** → the dropdown should stay open after each selection
175
+ - **Option label** → display `option.primary`
176
+ - **Selected items** → render as tags/chips inside the input area
177
+ - **Search input** → wired to the debounced search function