@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.
- package/README.md +10 -3
- package/dist/index.js +764 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
User picker field that renders as either a search box (AutoComplete) or a dropdown, populated from the Pega operators data page.
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture,
|
|
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,15 +14,11 @@ Renders a user selection field. Can display as a typeahead search box or a dropd
|
|
|
14
14
|
|
|
15
15
|
- **Pega Name:** `UserReference`
|
|
16
16
|
- **Type / Subtype:** `Field` / `Text-UserReference`
|
|
17
|
-
- **Registration key:** `UserReference` (in
|
|
17
|
+
- **Registration key:** `UserReference` (in the project's component map)
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs (component-specific)
|
|
20
20
|
|
|
21
|
-
> Extends
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
import type { PConnProps } from '@pega/sdk-react';
|
|
25
|
-
```
|
|
21
|
+
> Extends the project's base component interface (NOT the field input contract — field-specific inputs are defined manually).
|
|
26
22
|
|
|
27
23
|
| Prop | Type | Default | Description |
|
|
28
24
|
| --------------------- | -------------------- | ---------- | ---------------------------------------------------------------- |
|
|
@@ -38,100 +34,27 @@ import type { PConnProps } from '@pega/sdk-react';
|
|
|
38
34
|
| `required` | `boolean` (optional) | `false` | |
|
|
39
35
|
| `validatemessage` | `string` (optional) | `''` | Validation error message |
|
|
40
36
|
| `showAsFormattedText` | `boolean` (optional) | `false` | When `true` in read-only mode, show formatted user name text |
|
|
41
|
-
| `additionalProps` | `object` (optional) | `{}` | Extra
|
|
37
|
+
| `additionalProps` | `object` (optional) | `{}` | Extra inputs forwarded to the child component |
|
|
42
38
|
| `hideLabel` | `boolean` (optional) | `false` | |
|
|
43
39
|
| `variant` | `string` (optional) | `'inline'` | Layout variant |
|
|
44
40
|
| `onChange` | `any` (optional) | — | Change handler (passed through to child) |
|
|
45
41
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
Orchestrator component — renders either AutoComplete, Dropdown, formatted text, or FieldValueList based on mode.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
label?: string;
|
|
63
|
-
value?: any;
|
|
64
|
-
testId?: string;
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
helperText?: string;
|
|
67
|
-
disabled?: boolean;
|
|
68
|
-
readOnly?: boolean;
|
|
69
|
-
required?: boolean;
|
|
70
|
-
validatemessage?: string;
|
|
71
|
-
showAsFormattedText?: boolean;
|
|
72
|
-
additionalProps?: object;
|
|
73
|
-
hideLabel?: boolean;
|
|
74
|
-
variant?: string;
|
|
75
|
-
onChange?: any;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const UserReference = (props: UserReferenceProps) => {
|
|
79
|
-
// 1. Registry lookups
|
|
80
|
-
const AutoComplete = getComponentFromRegistry('AutoComplete');
|
|
81
|
-
const Dropdown = getComponentFromRegistry('Dropdown');
|
|
82
|
-
const FieldValueList = getComponentFromRegistry('FieldValueList');
|
|
83
|
-
|
|
84
|
-
// 2. Destructure props (all with defaults)
|
|
85
|
-
const {
|
|
86
|
-
label = '',
|
|
87
|
-
displayAs = '',
|
|
88
|
-
displayMode = '',
|
|
89
|
-
getPConnect,
|
|
90
|
-
value = '',
|
|
91
|
-
testId = '',
|
|
92
|
-
helperText = '',
|
|
93
|
-
validatemessage = '',
|
|
94
|
-
placeholder = '',
|
|
95
|
-
showAsFormattedText = false,
|
|
96
|
-
additionalProps = {},
|
|
97
|
-
hideLabel = false,
|
|
98
|
-
readOnly = false,
|
|
99
|
-
required = false,
|
|
100
|
-
disabled = false,
|
|
101
|
-
onChange,
|
|
102
|
-
} = props;
|
|
103
|
-
|
|
104
|
-
// 3. State
|
|
105
|
-
const [dropDownDataSource, setDropDownDataSource] = useState([]);
|
|
106
|
-
const [userName, setUserName] = useState('');
|
|
107
|
-
|
|
108
|
-
// 4. Derived
|
|
109
|
-
const OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP();
|
|
110
|
-
const userId = getUserId(value);
|
|
111
|
-
|
|
112
|
-
// 5. useEffect — deps: [displayAs, readOnly, showAsFormattedText, value]
|
|
113
|
-
// Case 1: userId && readOnly && showAsFormattedText → resolve userName
|
|
114
|
-
// Case 2: displayAs === DROPDOWN_LIST → fetch user list via REST
|
|
115
|
-
|
|
116
|
-
// 6. Rendering decision tree
|
|
117
|
-
// displayMode DISPLAY_ONLY → FieldValueList(userName || '')
|
|
118
|
-
// displayMode STACKED → FieldValueList(userName || '', variant='stacked')
|
|
119
|
-
// readOnly && showAsFormattedText && userId → label + userName text
|
|
120
|
-
// displayAs SEARCH_BOX → <AutoComplete datasource={OPERATORS_DP} listType='datapage' ...>
|
|
121
|
-
// displayAs DROPDOWN_LIST → <Dropdown datasource={dropDownDataSource} listType='associated' ...>
|
|
122
|
-
return userReferenceComponent;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// 7. Memo with custom comparison
|
|
126
|
-
const comparisonFn = (prevProps, nextProps) =>
|
|
127
|
-
getUserId(prevProps.value) === getUserId(nextProps.value) &&
|
|
128
|
-
prevProps.validatemessage === nextProps.validatemessage &&
|
|
129
|
-
prevProps.required === nextProps.required &&
|
|
130
|
-
prevProps.disabled === nextProps.disabled &&
|
|
131
|
-
prevProps.readOnly === nextProps.readOnly;
|
|
132
|
-
|
|
133
|
-
export default memo(UserReference, comparisonFn);
|
|
134
|
-
```
|
|
42
|
+
## Implementation Structure
|
|
43
|
+
|
|
44
|
+
Orchestrator component — renders either AutoComplete, Dropdown, formatted text, or FieldValueList based on mode. Wrapped in a memoization wrapper with a custom comparison function.
|
|
45
|
+
|
|
46
|
+
**Module Setup:** The component depends on the project's component registry (to resolve `AutoComplete`, `Dropdown`, and `FieldValueList`) and local utility helpers (`getUserId` and `isUserNameAvailable`). It also uses `PCore.getUserApi()`, `PCore.getRestClient()`, and `PCore.getEnvironmentInfo()` for user data resolution. Define two constants: `DROPDOWN_LIST = 'Drop-down list'` and `SEARCH_BOX = 'Search box'`. Define the input contract as an extension of the project's base component interface with all the optional fields listed in the inputs table above.
|
|
47
|
+
|
|
48
|
+
**Main Component Logic** (defined as an arrow function, not a plain function declaration) — steps in order:
|
|
49
|
+
|
|
50
|
+
1. **Registry lookups** — resolve `AutoComplete`, `Dropdown`, and `FieldValueList` via the project's component registry.
|
|
51
|
+
2. **Receive inputs (all with defaults)** — `label` (default `''`), `displayAs` (default `''`), `displayMode` (default `''`), `getPConnect`, `value` (default `''`), `testId` (default `''`), `helperText` (default `''`), `validatemessage` (default `''`), `placeholder` (default `''`), `showAsFormattedText` (default `false`), `additionalProps` (default `{}`), `hideLabel` (default `false`), `readOnly` (default `false`), `required` (default `false`), `disabled` (default `false`), `onChange`.
|
|
52
|
+
3. **Local state** — `dropDownDataSource` (array, default `[]`) and `userName` (string, default `''`).
|
|
53
|
+
4. **Derived values** — `OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP()` (the default operators data page name) and `userId = getUserId(value)`.
|
|
54
|
+
5. **Mount/update effect** — a lifecycle effect with dependencies `[displayAs, readOnly, showAsFormattedText, value]`, handling two cases (see Behavioral Contract below for the exact branching logic): resolving the display username when in read-only formatted-text mode, or fetching the dropdown data source when `displayAs === 'Drop-down list'`.
|
|
55
|
+
6. **Rendering decision tree** (see Behavioral Contract below for the exact order): `DISPLAY_ONLY` returns `FieldValueList(userName || '')`; `STACKED_LARGE_VAL` returns the stacked variant; read-only formatted text mode returns a label + username text block; `'Search box'` mode renders `AutoComplete`; `'Drop-down list'` mode renders `Dropdown`.
|
|
56
|
+
|
|
57
|
+
**Export:** wrap the component in a memoization wrapper with a custom comparison function (see "Re-render optimization" below).
|
|
135
58
|
|
|
136
59
|
## Behavioral Contract
|
|
137
60
|
|
|
@@ -144,7 +67,7 @@ export default memo(UserReference, comparisonFn);
|
|
|
144
67
|
- `dropDownDataSource` (array): populated when `displayAs === 'Drop-down list'`
|
|
145
68
|
- `userName` (string): resolved display name for formatted text mode
|
|
146
69
|
|
|
147
|
-
### Mount effect: `
|
|
70
|
+
### Mount effect: lifecycle effect watching `[displayAs, readOnly, showAsFormattedText, value]`
|
|
148
71
|
|
|
149
72
|
**Case 1: `userId && readOnly && showAsFormattedText`**
|
|
150
73
|
|
|
@@ -161,33 +84,13 @@ export default memo(UserReference, comparisonFn);
|
|
|
161
84
|
|
|
162
85
|
### Rendering decision tree
|
|
163
86
|
|
|
164
|
-
|
|
165
|
-
if displayMode === 'DISPLAY_ONLY' → FieldValueList(userName || '')
|
|
166
|
-
if displayMode === 'STACKED_LARGE_VAL' → FieldValueList(userName || '', variant='stacked')
|
|
167
|
-
if readOnly && showAsFormattedText && userId → formatted text label+body
|
|
168
|
-
else if displayAs === 'Search box' → AutoComplete component
|
|
169
|
-
else if displayAs === 'Drop-down list' → Dropdown component
|
|
170
|
-
```
|
|
87
|
+
Evaluated in this order: if `displayMode === 'DISPLAY_ONLY'`, render `FieldValueList(userName || '')`; else if `displayMode === 'STACKED_LARGE_VAL'`, render the stacked `FieldValueList` variant; else if `readOnly && showAsFormattedText && userId`, render the formatted text block; else if `displayAs === 'Search box'`, render the `AutoComplete` component; else if `displayAs === 'Drop-down list'`, render the `Dropdown` component.
|
|
171
88
|
|
|
172
89
|
### Subsection: Search box mode (`displayAs === 'Search box'`)
|
|
173
90
|
|
|
174
|
-
Render `AutoComplete` with hardcoded columns for operator search:
|
|
91
|
+
Render `AutoComplete` with hardcoded columns for operator search: a primary column on `pyUserName` (displayed, used for search, marked primary), and a secondary key column on `pyUserIdentifier` (displayed, used for search, marked secondary, with `setProperty: 'Associated property'` and `key: 'true'`).
|
|
175
92
|
|
|
176
|
-
|
|
177
|
-
columns = [
|
|
178
|
-
{ value: 'pyUserName', display: 'true', useForSearch: true, primary: 'true' },
|
|
179
|
-
{
|
|
180
|
-
value: 'pyUserIdentifier',
|
|
181
|
-
setProperty: 'Associated property',
|
|
182
|
-
key: 'true',
|
|
183
|
-
display: 'true',
|
|
184
|
-
secondary: 'true',
|
|
185
|
-
useForSearch: 'true',
|
|
186
|
-
},
|
|
187
|
-
];
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Props: `datasource={OPERATORS_DP}`, `listType='datapage'`, `value={userId}`, plus label/placeholder/readOnly/disabled/required/helperText/validatemessage/hideLabel/onChange/additionalProps/testId.
|
|
93
|
+
Inputs: `datasource` set to `OPERATORS_DP`, `listType='datapage'`, `value` set to `userId`, plus label/placeholder/readOnly/disabled/required/helperText/validatemessage/hideLabel/onChange/additionalProps/testId.
|
|
191
94
|
|
|
192
95
|
### Subsection: Dropdown mode (`displayAs === 'Drop-down list'`)
|
|
193
96
|
|
|
@@ -196,33 +99,15 @@ Render `Dropdown` with:
|
|
|
196
99
|
- `datasource={dropDownDataSource}` (fetched user list)
|
|
197
100
|
- `listType='associated'`
|
|
198
101
|
- `value={userId}`
|
|
199
|
-
- Plus same field
|
|
102
|
+
- Plus same field inputs as above
|
|
200
103
|
|
|
201
104
|
### Subsection: Formatted text read-only (`readOnly && showAsFormattedText && userId`)
|
|
202
105
|
|
|
203
|
-
Render a label
|
|
204
|
-
|
|
205
|
-
```html
|
|
206
|
-
<div>
|
|
207
|
-
<caption-text>{label}</caption-text>
|
|
208
|
-
<body-text>{userName}</body-text>
|
|
209
|
-
</div>
|
|
210
|
-
```
|
|
106
|
+
Render a small wrapper containing a caption-style text element showing `label`, followed by a body-style text element showing `userName`.
|
|
211
107
|
|
|
212
108
|
### Re-render optimization
|
|
213
109
|
|
|
214
|
-
Export with
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
const comparisonFn = (prevProps, nextProps) =>
|
|
218
|
-
getUserId(prevProps.value) === getUserId(nextProps.value) &&
|
|
219
|
-
prevProps.validatemessage === nextProps.validatemessage &&
|
|
220
|
-
prevProps.required === nextProps.required &&
|
|
221
|
-
prevProps.disabled === nextProps.disabled &&
|
|
222
|
-
prevProps.readOnly === nextProps.readOnly;
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
`export default memo(UserReference, comparisonFn)`
|
|
110
|
+
Export with a memoization wrapper using a custom comparison function that returns `true` (skip re-render) only when all of the following are equal between previous and next inputs: `getUserId(value)` (resolved on both sides), `validatemessage`, `required`, `disabled`, and `readOnly`.
|
|
226
111
|
|
|
227
112
|
## Display Mode Rendering
|
|
228
113
|
|
|
@@ -247,18 +132,7 @@ The visual appearance is determined by the child component rendered:
|
|
|
247
132
|
| Name | Body text (normal size) |
|
|
248
133
|
| Spacing | Standard form field spacing |
|
|
249
134
|
|
|
250
|
-
**
|
|
251
|
-
|
|
252
|
-
```css
|
|
253
|
-
.user-reference-label {
|
|
254
|
-
font-size: 0.75rem;
|
|
255
|
-
color: rgba(0, 0, 0, 0.6);
|
|
256
|
-
margin-bottom: 4px;
|
|
257
|
-
}
|
|
258
|
-
.user-reference-name {
|
|
259
|
-
font-size: 1rem;
|
|
260
|
-
}
|
|
261
|
-
```
|
|
135
|
+
**Visual-only styling notes for formatted text:** The label is rendered in caption-size text (0.75rem) with a muted secondary color and a small bottom margin (4px) separating it from the name. The name is rendered in standard body text size (1rem).
|
|
262
136
|
|
|
263
137
|
## Edge Cases & Special Logic
|
|
264
138
|
|
|
@@ -270,11 +144,11 @@ The visual appearance is determined by the child component rendered:
|
|
|
270
144
|
|
|
271
145
|
## Dependencies
|
|
272
146
|
|
|
273
|
-
-
|
|
274
|
-
- `getUserId`, `isUserNameAvailable
|
|
275
|
-
- `
|
|
276
|
-
- `
|
|
277
|
-
- `
|
|
147
|
+
- A memoization wrapper from the framework.
|
|
148
|
+
- Local utility helpers: `getUserId`, `isUserNameAvailable`.
|
|
149
|
+
- The project's component registry, resolving `AutoComplete` — for search box mode.
|
|
150
|
+
- The project's component registry, resolving `Dropdown` — for dropdown mode.
|
|
151
|
+
- The project's component registry, resolving `FieldValueList` — for display modes.
|
|
278
152
|
- `PCore.getUserApi().getOperatorDetails()` — for async user name resolution.
|
|
279
153
|
- `PCore.getRestClient().invokeRestApi('getListData', ...)` — for dropdown data source.
|
|
280
154
|
- `PCore.getEnvironmentInfo().getDefaultOperatorDP()` — for operators data page name.
|
|
@@ -283,11 +157,10 @@ The visual appearance is determined by the child component rendered:
|
|
|
283
157
|
|
|
284
158
|
**UI control type:** User picker — delegates to AutoComplete or Dropdown for the actual input.
|
|
285
159
|
|
|
286
|
-
|
|
160
|
+
When implementing in a specific design system, map the following:
|
|
287
161
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
| Display mode | FieldValueList |
|
|
162
|
+
- **Search box mode** → render the `AutoComplete` component with operator columns
|
|
163
|
+
- **Dropdown mode** → render the `Dropdown` component with the fetched operator list
|
|
164
|
+
- **Formatted text read-only** → render a label + text display (caption + body text)
|
|
165
|
+
- **Display mode** → render `FieldValueList` with the resolved username
|
|
166
|
+
- **Memoization** → wrap the component with a custom comparison to avoid unnecessary re-renders
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Skill: Infrastructure (Chrome) Components
|
|
2
|
+
|
|
3
|
+
Create or replace infrastructure components in the project. Infrastructure components are the chrome the Pega runtime draws _around_ a case or an assignment — the action button row, the stage progress indicator, the step navigation — rather than the fields inside it. Most of them ship from the SDK adapter package and are never generated. Three are overridable, because they render inline with the form where SDK styling is the most visible mismatch.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Architecture Overview
|
|
8
|
+
|
|
9
|
+
Each infrastructure component lives in its own folder under the project's infrastructure components directory, named after the component. The folder typically contains: the component implementation file; optionally a re-export module; and optionally a companion stylesheet.
|
|
10
|
+
|
|
11
|
+
Infrastructure components differ from every other category in one important way: **they already exist**. Generating one produces an override that replaces the SDK's implementation. The Pega runtime keeps calling it with the contract it already uses, so the contract is not yours to design — only the markup and the styling are.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## What May Be Generated
|
|
16
|
+
|
|
17
|
+
| Component | Role | Generate? |
|
|
18
|
+
| ----------------- | ---------------------------------------------------- | --------- |
|
|
19
|
+
| `ActionButtons` | The Cancel / Save / Submit row beneath an assignment | Yes |
|
|
20
|
+
| `Stages` | The case stage progress indicator | Yes |
|
|
21
|
+
| `MultiStep` | Step navigation within a multi-step assignment | Yes |
|
|
22
|
+
| `NavBar` | Portal navigation shell | No |
|
|
23
|
+
| `DeferLoad` | Deferred content loader | No |
|
|
24
|
+
| `VerticalTabs` | Case view tab rail | No |
|
|
25
|
+
| `DashboardFilter` | Dashboard filtering controls | No |
|
|
26
|
+
|
|
27
|
+
The four marked "No" are structural plumbing tied to the SDK's own internals. Leave them to the SDK. If a request names one of them, skip it and say why.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Input Contract
|
|
32
|
+
|
|
33
|
+
**The three overridable components do not share an input shape.** This is the only category where that is true, so there is no single base contract to extend. Take each one's inputs from its own skill file.
|
|
34
|
+
|
|
35
|
+
| Component | Receives the PConnect accessor? | Other inputs |
|
|
36
|
+
| --------------- | ------------------------------- | -------------------------------------------------------------------- |
|
|
37
|
+
| `ActionButtons` | No | Two button-definition arrays and a press callback |
|
|
38
|
+
| `Stages` | Yes | The raw stage list |
|
|
39
|
+
| `MultiStep` | Yes | Child content, an item key, button definitions, and a press callback |
|
|
40
|
+
|
|
41
|
+
`ActionButtons` is the exception to the rule that every Pega component receives the PConnect accessor. It is handed plain display props by its parent and must not attempt to reach the runtime for its own data.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Implementation Patterns
|
|
46
|
+
|
|
47
|
+
### Display-Only Chrome (no PConnect accessor)
|
|
48
|
+
|
|
49
|
+
The component receives everything it needs as inputs and reports interaction back through a callback. It holds no local state and reads nothing from the store.
|
|
50
|
+
|
|
51
|
+
**Module Setup:** The component depends only on the design system's presentation primitives and the Pega locale utilities. Define the input contract as a plain input shape — it does not extend the project's base component interface, because no PConnect accessor is supplied.
|
|
52
|
+
|
|
53
|
+
**Main Component Logic** — steps in order:
|
|
54
|
+
|
|
55
|
+
1. Receive the input arrays and the callback. Treat every array input as optional and default it to empty.
|
|
56
|
+
2. Localize every label through the Pega locale utilities using the locale category the SDK component uses. Never render a raw input string as a label, and never hardcode label text.
|
|
57
|
+
3. Render the design system's primitives for each entry.
|
|
58
|
+
4. On interaction, invoke the supplied callback with exactly the arguments the SDK component passes. The callback signature is fixed by the runtime.
|
|
59
|
+
|
|
60
|
+
### Case-Aware Chrome (PConnect accessor, read-only)
|
|
61
|
+
|
|
62
|
+
The component receives the accessor so it can read case state and localize, but it never writes. It renders a derived view of data the runtime supplies.
|
|
63
|
+
|
|
64
|
+
**Module Setup:** The component depends on the design system's presentation primitives. Define the input contract as an extension of the project's base component interface.
|
|
65
|
+
|
|
66
|
+
**Main Component Logic** — steps in order:
|
|
67
|
+
|
|
68
|
+
1. Receive `getPConnect` plus the component's own inputs; call `getPConnect()` into `pConn`.
|
|
69
|
+
2. Normalize the raw input through the SDK utility the component is documented to use. The runtime supplies unfiltered data; the utility decides what is displayable.
|
|
70
|
+
3. Read any case-level state the component needs from `pConn`, using the runtime's constants rather than literal property names.
|
|
71
|
+
4. Derive a display model — one entry per item, carrying its localized label and its state flags — before rendering. Keep derivation separate from markup so the same logic survives a design system change.
|
|
72
|
+
5. Render the derived model. Do not commit anything to the store; this component is display-only.
|
|
73
|
+
|
|
74
|
+
### Container Chrome (renders children and resolves sub-components)
|
|
75
|
+
|
|
76
|
+
The component wraps the form content the runtime hands it and arranges other Pega components around it.
|
|
77
|
+
|
|
78
|
+
**Module Setup:** The component depends on the design system's presentation primitives and the project's component registry. Define the input contract as an extension of the project's base component interface.
|
|
79
|
+
|
|
80
|
+
**Main Component Logic** — steps in order:
|
|
81
|
+
|
|
82
|
+
1. Resolve every Pega sub-component from the project's component registry, never by direct import. The registry is what lets a customer's own version win.
|
|
83
|
+
2. Receive `getPConnect`, the child content, and the component's own inputs.
|
|
84
|
+
3. Derive which part of the structure is active from the state flags the runtime supplies, applying the documented fallback when nothing is marked active.
|
|
85
|
+
4. Render the surrounding structure, and render the child content only inside the active part.
|
|
86
|
+
5. Forward the accessor, the item key, the button definitions and the press callback to the resolved sub-component unchanged. Do not reshape them.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Localization
|
|
91
|
+
|
|
92
|
+
Every label an infrastructure component renders comes from Pega, not from the component.
|
|
93
|
+
|
|
94
|
+
- Button and action labels use `PCore.getLocaleUtils().getLocaleValue(name, category)` with the locale category the SDK component uses.
|
|
95
|
+
- Case and stage names use `pConn.getLocalizationService().getLocalizedText(name)`.
|
|
96
|
+
|
|
97
|
+
The value arriving in the input is a key, not display text. Rendering it directly will look correct in an English environment and break in every other one.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Resolving Other Components
|
|
102
|
+
|
|
103
|
+
When an infrastructure component renders another Pega component, resolve it through the project's component registry rather than importing it. An override only takes effect if the components that render it look it up by name — importing a sub-component directly pins it to the SDK's version and silently discards the customer's.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Design System Adaptation
|
|
108
|
+
|
|
109
|
+
The runtime contract — inputs, callback signatures, derivation logic, and localization — is identical regardless of design system. Only the rendered markup changes.
|
|
110
|
+
|
|
111
|
+
**1. Check the component-specific skill file** — `{{SKILL_DIR}}/infra-skills/<ComponentName>.md` contains a **Design System Mapping** section. Use it as a starting point.
|
|
112
|
+
|
|
113
|
+
**2. If the chosen design system is not covered** — use the component purpose description to identify the appropriate primitives (button, stepper, breadcrumb, divider, list).
|
|
114
|
+
|
|
115
|
+
**3. Discover the API from installed packages** — confirm component names and inputs from the design system's type declaration files before writing the render markup.
|
|
116
|
+
|
|
117
|
+
**4. Common chrome UI primitive mapping:**
|
|
118
|
+
|
|
119
|
+
| Chrome pattern | Typical DS equivalent |
|
|
120
|
+
| ----------------------------- | -------------------------------------------------------------------------- |
|
|
121
|
+
| Action row | Button group, Toolbar, or a flex row of Buttons |
|
|
122
|
+
| Primary / secondary buttons | The DS's emphasis or variant inputs |
|
|
123
|
+
| Separator above an action row | Divider, Separator, or a bordered container |
|
|
124
|
+
| Stage progression | Breadcrumbs, Steps, or Stepper |
|
|
125
|
+
| Step navigation | Stepper (horizontal and vertical variants) |
|
|
126
|
+
| Step state indicator | The stepper's own completed / active / pending states, or a numbered badge |
|
|
127
|
+
|
|
128
|
+
**5. Icons** — if the DS has a companion icon package, check its exports before using any icon name. Never guess icon names. Decorative icons must be hidden from assistive technology.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Registration
|
|
133
|
+
|
|
134
|
+
Register infrastructure overrides in the project's component map under the component's Pega name. Because the SDK's own components are contributed as a spread of built-in entries, **an override must appear after that spread** — an entry listed before it is replaced by the SDK's version and the override silently does nothing.
|
|
135
|
+
|
|
136
|
+
Never remove the spread. It supplies the infrastructure components that are not overridable, and removing it breaks rendering entirely.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Existing Infrastructure Components
|
|
141
|
+
|
|
142
|
+
| Component | Description | Key APIs |
|
|
143
|
+
| --------------- | ----------------------------- | ------------------------------------------------------- |
|
|
144
|
+
| ActionButtons | Assignment action button row | `PCore.getLocaleUtils()` |
|
|
145
|
+
| Stages | Case stage progress indicator | `PCore.getSDKUtils()`, `PCore.getConstants().CASE_INFO` |
|
|
146
|
+
| MultiStep | Assignment step navigation | `PCore.getSDKUtils()`, the project's component registry |
|
|
147
|
+
| NavBar | Portal navigation shell | SDK-provided — not generated |
|
|
148
|
+
| DeferLoad | Deferred content loader | SDK-provided — not generated |
|
|
149
|
+
| VerticalTabs | Case view tab rail | SDK-provided — not generated |
|
|
150
|
+
| DashboardFilter | Dashboard filter controls | SDK-provided — not generated |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Key Conventions
|
|
155
|
+
|
|
156
|
+
1. **Default export** — Each component is exported as the module's default export, except where the component's own skill file documents otherwise.
|
|
157
|
+
2. **The contract is fixed** — Inputs, callback signatures and localization come from the SDK component being replaced. Only markup and styling are yours to change.
|
|
158
|
+
3. **Not every chrome component gets the accessor** — `ActionButtons` receives plain display props. Do not add a PConnect accessor to it.
|
|
159
|
+
4. **Chrome is display-only** — These components report interaction through the callback they were given. None of them writes to the store directly.
|
|
160
|
+
5. **Localize everything** — Labels arrive as keys. Resolve them through the Pega locale utilities or the localization service.
|
|
161
|
+
6. **Resolve sub-components from the registry** — never by direct import, or customer overrides are discarded.
|
|
162
|
+
7. **Register after the SDK spread** — an override listed before the spread has no effect.
|
|
163
|
+
8. **Derive before rendering** — compute the display model from the runtime's raw inputs first, then render it. This is what keeps the component portable across design systems.
|
|
164
|
+
9. **Keep repeated elements stable** — every item in a rendered collection needs a stable identity so the runtime can update the list without reordering the wrong entries.
|
|
165
|
+
10. **Case chrome is not assignment chrome** — `Stages` belongs to the case view and never appears inside an embedded assignment. `ActionButtons` and `MultiStep` do.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Skill: ActionButtons
|
|
2
|
+
|
|
3
|
+
Assignment action button row. Renders the secondary and primary actions available on the current assignment — typically Cancel, Save for later, and Submit — beneath the form content.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`infra-components.md`](../infra-components.md) — covers architecture, the override contract, localization, and registration conventions common to ALL infrastructure components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Displays the actions the Pega runtime has determined are available on the current assignment, split into a secondary group and a primary group, and reports the chosen action back to its parent. It is a pure display component: it decides nothing about which actions exist, what they do, or whether they are permitted.
|
|
12
|
+
|
|
13
|
+
It renders wherever an assignment renders, which includes an embedded assignment. In an embedded flow it is the most visible piece of chrome, and therefore the one most worth generating in the customer's design system.
|
|
14
|
+
|
|
15
|
+
## Pega Metadata
|
|
16
|
+
|
|
17
|
+
- **Registration key:** `ActionButtons` (in the project's component map)
|
|
18
|
+
- **Category:** Infrastructure — case chrome, overridable
|
|
19
|
+
- **Extends:** Nothing. This component does **not** extend the project's base component interface and receives **no** PConnect accessor.
|
|
20
|
+
- **Rendered by:** The SDK's assignment card, which resolves it from the component registry and supplies every input.
|
|
21
|
+
|
|
22
|
+
> ⚠️ **CRITICAL — THIS COMPONENT RECEIVES NO PCONNECT ACCESSOR**
|
|
23
|
+
>
|
|
24
|
+
> Every other Pega component is handed `getPConnect`. This one is not. Do not add it to the input contract, do not attempt to read case state, and do not call the actions API. Everything the component needs arrives as a plain input, and the only thing it does with a user interaction is invoke the callback it was given.
|
|
25
|
+
|
|
26
|
+
## Inputs
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Required | Description |
|
|
29
|
+
| -------------------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------- |
|
|
30
|
+
| `arMainButtons` | `ActionButtonEntry[]` | No | Primary actions (e.g. Submit). Default empty array |
|
|
31
|
+
| `arSecondaryButtons` | `ActionButtonEntry[]` | No | Secondary actions (e.g. Cancel, Save for later). Default empty array |
|
|
32
|
+
| `onButtonPress` | `(action: string, buttonType: string) => void` | Yes | Invoked when any button is activated. See the callback contract below |
|
|
33
|
+
|
|
34
|
+
Each `ActionButtonEntry` carries:
|
|
35
|
+
|
|
36
|
+
| Field | Type | Required | Description |
|
|
37
|
+
| ---------- | -------- | -------- | -------------------------------------------------------------------------------------- |
|
|
38
|
+
| `name` | `string` | Yes | The label **key**, to be localized before display. Also serves as the entry's identity |
|
|
39
|
+
| `jsAction` | `string` | Yes | The action identifier passed back through the callback |
|
|
40
|
+
| `actionID` | `string` | No | Additional runtime identifier. Not needed for rendering |
|
|
41
|
+
|
|
42
|
+
## Implementation Structure
|
|
43
|
+
|
|
44
|
+
**Module Setup:** The component depends only on the design system's button and separator primitives. Define the input contract as a plain input shape with the two arrays and the callback — it does not extend the project's base component interface.
|
|
45
|
+
|
|
46
|
+
**Main Component Logic** — steps in order:
|
|
47
|
+
|
|
48
|
+
1. Receive `arMainButtons` (default empty array), `arSecondaryButtons` (default empty array), and `onButtonPress` from inputs.
|
|
49
|
+
2. Resolve the localization helper once: `PCore.getLocaleUtils().getLocaleValue`, to be called with the button's `name` and the locale category `'Assignment'`.
|
|
50
|
+
3. Render a horizontal separator above the button row.
|
|
51
|
+
4. Render the button row as two groups: the **secondary group first**, then the **primary group**. Within each group, render one button per entry in the order supplied, keyed by the entry's `name`.
|
|
52
|
+
5. Render each secondary entry using the design system's low-emphasis button treatment, and each primary entry using its high-emphasis treatment. The label is the localized value of the entry's `name`.
|
|
53
|
+
6. On activation, invoke `onButtonPress` with the entry's `jsAction` and the literal group discriminator — `'secondary'` for a secondary entry, `'primary'` for a main entry.
|
|
54
|
+
|
|
55
|
+
## Behavioral Contract
|
|
56
|
+
|
|
57
|
+
### Callback Contract
|
|
58
|
+
|
|
59
|
+
`onButtonPress(jsAction, buttonType)` — two positional string arguments, in this order:
|
|
60
|
+
|
|
61
|
+
1. The activated entry's `jsAction` value, passed through unchanged.
|
|
62
|
+
2. The group the entry belongs to: the literal `'primary'` for entries from `arMainButtons`, the literal `'secondary'` for entries from `arSecondaryButtons`.
|
|
63
|
+
|
|
64
|
+
Both arguments are fixed by the runtime. Do not pass the entry object, the event, the index, or the localized label. Do not substitute the entry's `actionID` for its `jsAction`.
|
|
65
|
+
|
|
66
|
+
### Localization
|
|
67
|
+
|
|
68
|
+
Every label is resolved through `PCore.getLocaleUtils().getLocaleValue(name, 'Assignment')`. The `name` field is a key, not display text — rendering it directly produces untranslated labels in any non-default locale. The locale category is the literal `'Assignment'`; it is not derived from the case or the assignment.
|
|
69
|
+
|
|
70
|
+
### Ordering
|
|
71
|
+
|
|
72
|
+
The secondary group renders before the primary group. Within each group, entries render in the order the runtime supplied them. Do not sort, deduplicate, or re-prioritize.
|
|
73
|
+
|
|
74
|
+
### Interaction Scope
|
|
75
|
+
|
|
76
|
+
The component performs no action itself. It does not submit, cancel, validate, confirm, or navigate. It reports the interaction and stops. Any confirmation dialog, disabled state during submission, or navigation belongs to the parent.
|
|
77
|
+
|
|
78
|
+
## Visual Specifications
|
|
79
|
+
|
|
80
|
+
| Element | Description |
|
|
81
|
+
| ---------------- | ------------------------------------------------------------------------------- |
|
|
82
|
+
| Separator | A full-width horizontal rule above the button row |
|
|
83
|
+
| Row | Secondary group aligned to the leading edge, primary group to the trailing edge |
|
|
84
|
+
| Secondary button | Low-emphasis treatment — text or ghost button, no fill |
|
|
85
|
+
| Primary button | High-emphasis treatment — filled, with the design system's accent colour |
|
|
86
|
+
|
|
87
|
+
**CSS-only implementation notes (if implementing without design system button components):**
|
|
88
|
+
|
|
89
|
+
- Separator: `border: none; border-top: 1px solid <divider colour>; margin-top: 1rem`.
|
|
90
|
+
- Row: `display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.5rem`.
|
|
91
|
+
- Group: `display: flex; flex-direction: row; gap: 0.5rem`.
|
|
92
|
+
- Secondary button: transparent background, no border, accent-coloured text, subtle tinted background on hover.
|
|
93
|
+
- Primary button: accent-coloured fill, contrasting text, raised surface treatment, darker fill on hover.
|
|
94
|
+
- Both buttons: `display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer`, with a transition on background colour.
|
|
95
|
+
|
|
96
|
+
## Edge Cases & Special Logic
|
|
97
|
+
|
|
98
|
+
- **Both arrays empty.** The parent already suppresses the component when there are no buttons at all, but the component must still tolerate empty or absent arrays and render nothing but its own container.
|
|
99
|
+
- **One array empty.** Render the other group and leave the empty group's slot in place, so the remaining group keeps its edge alignment rather than sliding across the row.
|
|
100
|
+
- **A single group with many entries.** Do not wrap, truncate, or collapse into an overflow menu. The runtime decides how many actions exist.
|
|
101
|
+
- **Duplicate `name` values.** The `name` doubles as the entry's identity in the rendered list. If the runtime supplies duplicates, fall back to combining the name with its position so the two entries stay distinct.
|
|
102
|
+
- **Missing `jsAction`.** Pass through whatever the entry carries. Do not substitute a default — a silently wrong action identifier is worse than a failed call the runtime can report.
|
|
103
|
+
- **Rapid repeated activation.** The component does not debounce or disable. If the parent needs that, the parent applies it.
|
|
104
|
+
|
|
105
|
+
## Dependencies
|
|
106
|
+
|
|
107
|
+
- `PCore.getLocaleUtils().getLocaleValue(name, 'Assignment')` — resolves every button label.
|
|
108
|
+
- The design system's button primitive, in two emphasis levels.
|
|
109
|
+
- The design system's separator or divider primitive.
|
|
110
|
+
|
|
111
|
+
No component registry lookups, no data page calls, no case info access.
|
|
112
|
+
|
|
113
|
+
## Design System Mapping
|
|
114
|
+
|
|
115
|
+
**UI control type:** An action bar — a divider followed by two opposed groups of buttons.
|
|
116
|
+
|
|
117
|
+
- **Primary button** → the DS's filled, contained, or solid button variant
|
|
118
|
+
- **Secondary button** → the DS's text, ghost, subtle, or tertiary variant
|
|
119
|
+
- **Row** → the DS's button group, toolbar, or a flex container with space between the two groups
|
|
120
|
+
- **Separator** → the DS's divider or separator component
|
|
121
|
+
|
|
122
|
+
Use native button semantics so the row is reachable and operable by keyboard. Buttons carry no explicit role or label attributes beyond their localized text content — the text is the accessible name, which is another reason the label must be localized rather than rendered from the raw key.
|