@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
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Pega SDK —
|
|
1
|
+
# Pega SDK — Reference App
|
|
2
2
|
|
|
3
|
-
You are assisting developers in a
|
|
3
|
+
You are assisting developers in a reference application that demonstrates the Pega Infinity SDK. Customers clone this repo and **replace the sample UI components with their own design system** (Ant Design, Chakra UI, Carbon, Radix UI, Shadcn/ui, MUI, or any other).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## 1. Repository Purpose
|
|
8
8
|
|
|
9
|
-
This is a **reference implementation** — not a framework. The UI components (fields, templates, widgets) are intentionally simple
|
|
9
|
+
This is a **reference implementation** — not a framework. The UI components (fields, templates, widgets) are intentionally simple sample implementations meant to be swapped out. The SDK wiring (bootstrap, PConnect bridge, component registry) is reusable infrastructure that should NOT be modified.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -14,22 +14,22 @@ This is a **reference implementation** — not a framework. The UI components (f
|
|
|
14
14
|
|
|
15
15
|
### Replaceable (customer modifies these)
|
|
16
16
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
17
|
+
| Area | Purpose |
|
|
18
|
+
| ----------------------------- | ----------------------------------------------------------- |
|
|
19
|
+
| Field components directory | Form field components (TextInput, Dropdown, Date, etc.) |
|
|
20
|
+
| Template components directory | Layout templates (OneColumn, TwoColumn, Details, etc.) |
|
|
21
|
+
| Widget components directory | Data widgets (ToDo, Attachment, CaseHistory, etc.) |
|
|
22
|
+
| DSE components directory | Extended UI (AlertBanner, FieldGroup, RichTextEditor, etc.) |
|
|
23
23
|
|
|
24
24
|
### Infrastructure (do NOT modify unless you know what you're doing)
|
|
25
25
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
26
|
+
| Area | Purpose |
|
|
27
|
+
| ---------------------------- | ----------------------------------------- |
|
|
28
|
+
| Application bootstrap module | Auth + bootstrap + root rendering |
|
|
29
|
+
| Component map file | Registry wiring (only add/remove entries) |
|
|
30
|
+
| Infrastructure components | ActionButtons, Stages, NavBar, etc. |
|
|
31
|
+
| Event handling helper module | PConnect event handler utility |
|
|
32
|
+
| SDK bridge package | SDK bridge — never modify |
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -37,150 +37,99 @@ This is a **reference implementation** — not a framework. The UI components (f
|
|
|
37
37
|
|
|
38
38
|
### The PConnect Bridge
|
|
39
39
|
|
|
40
|
-
Every component receives `getPConnect` as a prop. This is the bridge to the Pega platform
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
const pConn = getPConnect();
|
|
44
|
-
const actions = pConn.getActionsApi(); // For field updates
|
|
45
|
-
const propName = (pConn.getStateProps() as any).value; // Property path
|
|
46
|
-
```
|
|
40
|
+
Every component receives `getPConnect` as a prop. This is the bridge to the Pega platform. From it you obtain the PConnect instance, from which you access the actions API (for field updates) and state props (for the current property path).
|
|
47
41
|
|
|
48
42
|
### Event Handling Pattern
|
|
49
43
|
|
|
50
44
|
All field components use this pattern for two-way binding:
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// On change (local state only):
|
|
56
|
-
function handleChange(event) {
|
|
57
|
-
setInputValue(event.target.value);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// On blur (push to platform):
|
|
61
|
-
function handleBlur() {
|
|
62
|
-
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
63
|
-
}
|
|
64
|
-
```
|
|
46
|
+
- On **change**: update local component state only (do not push to the platform on every keystroke).
|
|
47
|
+
- On **blur**: call the project's event handling helper with the actions API, a `'changeNblur'` action type, the property name, and the current local value. This pushes the value to the Pega platform.
|
|
65
48
|
|
|
66
49
|
### Display Mode Handling
|
|
67
50
|
|
|
68
|
-
Field components must handle `displayMode` prop:
|
|
51
|
+
Field components must handle the `displayMode` prop:
|
|
69
52
|
|
|
70
|
-
- `undefined` → render editable input
|
|
71
|
-
- `'DISPLAY_ONLY'` → render read-only value via
|
|
72
|
-
- `'STACKED_LARGE_VAL'` → render
|
|
53
|
+
- `undefined` → render the editable input
|
|
54
|
+
- `'DISPLAY_ONLY'` → render a read-only label-value pair via the project's field-value display component
|
|
55
|
+
- `'STACKED_LARGE_VAL'` → render the same display component with a `stacked` variant
|
|
73
56
|
|
|
74
57
|
### Component Registry
|
|
75
58
|
|
|
76
|
-
Components are registered by name in
|
|
59
|
+
Components are registered by name in the project's component map file. The map function returns an object that spreads the SDK's built-in component set (providing infrastructure like View, Region, FlowContainer, etc.) and then adds the project's own components.
|
|
77
60
|
|
|
78
|
-
|
|
79
|
-
import { sdkComponents } from '@pega/sdk-react';
|
|
80
|
-
|
|
81
|
-
function getSampleComponentMap() {
|
|
82
|
-
return {
|
|
83
|
-
...sdkComponents, // Infrastructure (View, Region, FlowContainer, etc.)
|
|
84
|
-
TextInput, // Your field components
|
|
85
|
-
Dropdown,
|
|
86
|
-
// ...
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
To add a new component: add the import + add to the map object.
|
|
61
|
+
To add a new component: add the import and add an entry to the map object.
|
|
92
62
|
To replace a component: change the import to point to your new implementation.
|
|
93
63
|
|
|
94
64
|
---
|
|
95
65
|
|
|
96
66
|
## 4. Props Interfaces
|
|
97
67
|
|
|
98
|
-
### Field Components
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
import type { PConnProps } from '@pega/sdk-react';
|
|
126
|
-
|
|
127
|
-
interface PConnProps {
|
|
128
|
-
getPConnect: () => typeof PConnect;
|
|
129
|
-
}
|
|
130
|
-
```
|
|
68
|
+
### Field Components
|
|
69
|
+
|
|
70
|
+
Field components extend the SDK's field props interface. The standard props available to every field component are:
|
|
71
|
+
|
|
72
|
+
- `getPConnect` — function returning the PConnect accessor
|
|
73
|
+
- `label` — field label text
|
|
74
|
+
- `required` — whether the field is required
|
|
75
|
+
- `disabled` — whether the field is disabled
|
|
76
|
+
- `value` — current field value
|
|
77
|
+
- `validatemessage` — validation error message text
|
|
78
|
+
- `status` — `'error'` | `'warning'` | undefined
|
|
79
|
+
- `onChange` — change handler
|
|
80
|
+
- `onBlur` — blur handler
|
|
81
|
+
- `readOnly` — whether the field is read-only
|
|
82
|
+
- `testId` — test identifier to pass to the interactive element
|
|
83
|
+
- `helperText` — helper/hint text
|
|
84
|
+
- `displayMode` — `'DISPLAY_ONLY'` | `'STACKED_LARGE_VAL'` | undefined
|
|
85
|
+
- `hideLabel` — whether to suppress the label
|
|
86
|
+
- `placeholder` — placeholder text
|
|
87
|
+
|
|
88
|
+
### Template/Widget Components
|
|
89
|
+
|
|
90
|
+
Template and widget components extend the SDK's base props interface, which provides:
|
|
91
|
+
|
|
92
|
+
- `getPConnect` — function returning the PConnect accessor
|
|
131
93
|
|
|
132
94
|
---
|
|
133
95
|
|
|
134
96
|
## 5. Rules for Replacing Components
|
|
135
97
|
|
|
136
|
-
1. **Keep the same
|
|
137
|
-
2. **Keep `getPConnect` wiring intact** — extract props
|
|
138
|
-
3. **Handle `displayMode`** —
|
|
98
|
+
1. **Keep the same export convention** — the component map references it.
|
|
99
|
+
2. **Keep `getPConnect` wiring intact** — extract props and call the event handling helper on blur.
|
|
100
|
+
3. **Handle `displayMode`** — render the field-value display component for read-only modes.
|
|
139
101
|
4. **Handle validation** — show `validatemessage` when `status === 'error'`.
|
|
140
|
-
5. **Preserve
|
|
141
|
-
6. **Use
|
|
102
|
+
5. **Preserve the test id attribute** — pass `testId` to the root interactive element.
|
|
103
|
+
6. **Use the component registry** to render sub-components (e.g., the field-value display component) — don't hardcode imports for components that might also be replaced.
|
|
142
104
|
|
|
143
105
|
---
|
|
144
106
|
|
|
145
|
-
## 6. Build & Dev
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# From monorepo root (if developing locally with source packages):
|
|
149
|
-
npm run build # Build all packages + samples
|
|
150
|
-
npm run dev:react # Build + dev server
|
|
107
|
+
## 6. Build & Dev
|
|
151
108
|
|
|
152
|
-
|
|
153
|
-
npm run dev # Vite dev server (port 3500)
|
|
154
|
-
npm run build # Production build
|
|
155
|
-
```
|
|
109
|
+
Use the project's build script to compile the application and verify there are no errors. Use the project's dev script to start the development server for local testing. If working within the monorepo, run the build/dev commands from the monorepo root; if working standalone in this directory, run them locally.
|
|
156
110
|
|
|
157
111
|
---
|
|
158
112
|
|
|
159
|
-
## 7. Key
|
|
113
|
+
## 7. Key SDK Utilities
|
|
114
|
+
|
|
115
|
+
The SDK bridge package provides the following utilities (import from the package entry point only — never from internal paths):
|
|
160
116
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
registerComponentCreator,
|
|
167
|
-
getComponentFromRegistry,
|
|
168
|
-
sdkComponents,
|
|
169
|
-
} from '@pega/sdk-react';
|
|
170
|
-
import type { PConnProps, PConnFieldProps } from '@pega/sdk-react';
|
|
117
|
+
- **PConnect bridge component** — renders a PConnect-managed child component
|
|
118
|
+
- **Store context** — provides the SDK store to the component tree
|
|
119
|
+
- **Component creator registration** — registers custom component factories
|
|
120
|
+
- **Component registry lookup** — retrieves a registered component by its Pega name
|
|
121
|
+
- **Built-in SDK component set** — the infrastructure components that must always be spread into the component map
|
|
171
122
|
|
|
172
|
-
|
|
173
|
-
import handleEvent from '../../helpers/event-utils';
|
|
174
|
-
```
|
|
123
|
+
The project also provides an **event handling helper module** that wraps PConnect action calls for consistent field event handling (change + blur pattern).
|
|
175
124
|
|
|
176
125
|
---
|
|
177
126
|
|
|
178
127
|
## 8. Do NOT
|
|
179
128
|
|
|
180
|
-
- Modify
|
|
181
|
-
- Import from
|
|
182
|
-
- Hardcode component references — use
|
|
183
|
-
- Remove the
|
|
129
|
+
- Modify the application bootstrap module when replacing design system components.
|
|
130
|
+
- Import from internal SDK package paths — use the package entry point only.
|
|
131
|
+
- Hardcode component references — use the component registry for components that may be overridden.
|
|
132
|
+
- Remove the SDK's built-in component spread from the component map.
|
|
184
133
|
- Use `any` without justification — prefer `unknown` and narrow.
|
|
185
134
|
- Add `@ts-ignore` — use `@ts-expect-error` with explanation if truly needed.
|
|
186
135
|
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
ai-globs: **/component-map
|
|
2
|
+
ai-globs: **/component-map.*
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Component Map Rules
|
|
6
6
|
|
|
7
|
-
The component map
|
|
7
|
+
The component map is the registry that maps Pega component names to their framework-specific implementations.
|
|
8
8
|
|
|
9
9
|
## Structure
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
import { sdkComponents } from '@pega/sdk-react';
|
|
13
|
-
|
|
14
|
-
function getSampleComponentMap() {
|
|
15
|
-
return {
|
|
16
|
-
...sdkComponents, // NEVER remove this — provides infrastructure
|
|
17
|
-
// Your components below:
|
|
18
|
-
TextInput,
|
|
19
|
-
Dropdown,
|
|
20
|
-
// ...
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
```
|
|
11
|
+
The component map file exports a function that returns an object where each key is a Pega component name and each value is the corresponding component implementation. It spreads the SDK's built-in component set first, then adds project-specific components below.
|
|
24
12
|
|
|
25
13
|
## Rules
|
|
26
14
|
|
|
27
|
-
1. **NEVER remove
|
|
15
|
+
1. **NEVER remove the SDK's built-in component spread** — it provides infrastructure components (View, Region, Reference, RootContainer, FlowContainer, ViewContainer, Assignment, AssignmentCard, ErrorBoundary, MultiStep, CaseSummary, and their aliases).
|
|
28
16
|
|
|
29
|
-
2. **Map keys must match Pega component names exactly** — these are resolved at runtime by the platform. The key is what Pega sends; the value is your
|
|
17
|
+
2. **Map keys must match Pega component names exactly** — these are resolved at runtime by the platform. The key is what Pega sends; the value is your component implementation.
|
|
30
18
|
|
|
31
19
|
3. **To replace a component**: change its import path to your new implementation. Do NOT rename the key.
|
|
32
20
|
|
|
@@ -37,9 +25,9 @@ function getSampleComponentMap() {
|
|
|
37
25
|
- `URL: URLComponent` (URL is a global)
|
|
38
26
|
- `Todo: ToDo` (casing difference)
|
|
39
27
|
|
|
40
|
-
6. **Keep the
|
|
28
|
+
6. **Keep the registration function** — it registers all entries into the component registry instance used by the PConnect bridge.
|
|
41
29
|
|
|
42
|
-
7. **Sub-component registration** — Some template/widget components internally render sub-components via
|
|
30
|
+
7. **Sub-component registration** — Some template/widget components internally render sub-components via the component registry. These sub-components MUST also be registered in the component map or they will be `undefined` at runtime. Known sub-components:
|
|
43
31
|
- `SearchForm` — used by `DataReference` and `AdvancedSearch`
|
|
44
32
|
- `SearchGroups` — used by `AdvancedSearch`
|
|
45
33
|
- `ActionButtonsForFileUtil` — used by `FileUtility`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
ai-globs:
|
|
2
|
+
ai-globs: **/designSystemExtension/**/*
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Design System Extension Component Rules
|
|
@@ -8,7 +8,7 @@ When creating or modifying DSE components, follow these rules:
|
|
|
8
8
|
|
|
9
9
|
## What Are DSE Components?
|
|
10
10
|
|
|
11
|
-
Design System Extension components are display-focused presentational components. They sit between pure UI and data-fetching widgets. Some receive
|
|
11
|
+
Design System Extension components are display-focused presentational components. They sit between pure UI and data-fetching widgets. Some receive a PConnect accessor, others receive only display props.
|
|
12
12
|
|
|
13
13
|
## Patterns
|
|
14
14
|
|
|
@@ -16,49 +16,19 @@ Design System Extension components are display-focused presentational components
|
|
|
16
16
|
|
|
17
17
|
Used for: FieldValueList, CaseSummaryFields, DetailsFields
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
import type { PConnProps } from '@pega/sdk-react';
|
|
21
|
-
|
|
22
|
-
interface FieldValueListProps extends PConnProps {
|
|
23
|
-
name?: string;
|
|
24
|
-
value?: string;
|
|
25
|
-
variant?: 'stacked' | 'inline';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default function FieldValueList(props: FieldValueListProps) {
|
|
29
|
-
const { name, value, variant = 'inline' } = props;
|
|
30
|
-
// Render a label-value pair
|
|
31
|
-
}
|
|
32
|
-
```
|
|
19
|
+
These components extend the base PConnect props interface and receive a PConnect accessor. FieldValueList additionally accepts `name`, `value`, and an optional `variant` (`'stacked'` | `'inline'`) prop that controls its layout — it renders a label-value pair.
|
|
33
20
|
|
|
34
21
|
### Pattern B: Without PConnect (pure presentation)
|
|
35
22
|
|
|
36
23
|
Used for: AlertBanner, Banner, Operator
|
|
37
24
|
|
|
38
|
-
|
|
39
|
-
interface AlertBannerProps {
|
|
40
|
-
variant: 'urgent' | 'warning' | 'info' | 'success';
|
|
41
|
-
heading?: string;
|
|
42
|
-
messages: Array<string | { label?: string; description?: string }>;
|
|
43
|
-
onClose?: () => void;
|
|
44
|
-
}
|
|
25
|
+
These components receive only plain display props — no PConnect awareness. AlertBanner accepts a `variant` (`'urgent'` | `'warning'` | `'info'` | `'success'`), an optional `heading`, a `messages` array (strings or `{ label, description }` objects), and an optional `onClose` callback.
|
|
45
26
|
|
|
46
|
-
|
|
47
|
-
// Render an alert/notification banner
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Pattern C: Rich editor (extends PConnFieldProps)
|
|
27
|
+
### Pattern C: Rich editor (extends field props)
|
|
52
28
|
|
|
53
29
|
Used for: RichTextEditor
|
|
54
30
|
|
|
55
|
-
|
|
56
|
-
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
57
|
-
|
|
58
|
-
interface RichTextEditorProps extends PConnFieldProps {
|
|
59
|
-
content?: string;
|
|
60
|
-
}
|
|
61
|
-
```
|
|
31
|
+
This component extends the base field props interface (the same interface used by field components) and adds a `content` prop.
|
|
62
32
|
|
|
63
33
|
## Visual Preservation
|
|
64
34
|
|
|
@@ -66,12 +36,12 @@ The replacement must look the same as the original component:
|
|
|
66
36
|
|
|
67
37
|
1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
|
|
68
38
|
2. Replicate those styles via inline `style` props, the new design system's props/variants, or by keeping the CSS import — whichever produces the closest match.
|
|
69
|
-
3. Do NOT silently drop
|
|
39
|
+
3. Do NOT silently drop legacy styling utility classes — map each one to an equivalent style.
|
|
70
40
|
|
|
71
41
|
## Key Rules
|
|
72
42
|
|
|
73
|
-
- DSE components are the **most commonly referenced by other components** via
|
|
74
|
-
- Keep the same export
|
|
43
|
+
- DSE components are the **most commonly referenced by other components** via the project's component registry — every field uses FieldValueList for display modes
|
|
44
|
+
- Keep the same export convention and prop interface shape used elsewhere in the project
|
|
75
45
|
- If you replace FieldValueList, ensure it accepts `name`, `value`, and optional `variant` props
|
|
76
46
|
- AlertBanner must handle the `messages` array format (both strings and `{label, description}` objects)
|
|
77
|
-
- Do NOT drop visual styles when removing
|
|
47
|
+
- Do NOT drop visual styles when removing legacy styling utility classes — always map them to an equivalent
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
ai-globs: pega-components/**/*
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Embedded Component Rules
|
|
6
|
+
|
|
7
|
+
When generating or modifying Pega components in the `pega-components/` folder (components created for embedding into a customer's existing application), follow these rules.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Context
|
|
12
|
+
|
|
13
|
+
These components are different from the reference app's sample components. They are generated to live **inside a customer's existing project**, using the customer's design system so that they are visually indistinguishable from the rest of their UI. The Design Profile (`.design-profile.md`) in the same folder describes the customer's visual conventions.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Mandatory Behavioral Contract
|
|
18
|
+
|
|
19
|
+
Every generated component must satisfy the behavioral requirements defined in its type-level and component-specific skill files. These are non-negotiable regardless of the customer's framework or design system.
|
|
20
|
+
|
|
21
|
+
### All components must:
|
|
22
|
+
|
|
23
|
+
1. **Accept and use the PConnect accessor** — this is the bridge to the Pega runtime. Every component receives it and must use it to access state, actions, and child descriptors. Two things are exceptions and receive plain display props instead: a pure-presentation design system extension component (Pattern B in the DSE component rules) — see rule 11 — and the `ActionButtons` chrome component — see rule 14.
|
|
24
|
+
|
|
25
|
+
2. **Support the component registry** — when a component needs to render another Pega component (e.g., a display-mode renderer or a child component), it must resolve that component through the SDK's component registry, never through direct import of another generated component.
|
|
26
|
+
|
|
27
|
+
3. **Preserve the test identifier** — pass the provided test identifier through to the primary interactive or container element for automation purposes.
|
|
28
|
+
|
|
29
|
+
### Field components must additionally:
|
|
30
|
+
|
|
31
|
+
4. **Handle display modes** — at minimum, support an editable mode and a display-only mode. When in display-only mode, render the value using the display-mode renderer resolved from the registry.
|
|
32
|
+
|
|
33
|
+
5. **Wire value change and commit events** — local edits update internal state; on commit (blur or equivalent), propagate the value to the Pega store via the SDK actions API.
|
|
34
|
+
|
|
35
|
+
6. **Render validation feedback** — when validation messages are present, display them following the customer's validation display convention (from the Design Profile).
|
|
36
|
+
|
|
37
|
+
7. **Respect disabled and read-only states** — honor these flags from the input contract.
|
|
38
|
+
|
|
39
|
+
### Template components must additionally:
|
|
40
|
+
|
|
41
|
+
8. **Traverse and render children** — obtain child component descriptors from the PConnect accessor and render each via the SDK bridge component.
|
|
42
|
+
|
|
43
|
+
9. **Propagate inherited properties** — pass display mode, read-only state, and other inherited properties down to children via the PConnect accessor's inheritance mechanism.
|
|
44
|
+
|
|
45
|
+
### Widget components must additionally:
|
|
46
|
+
|
|
47
|
+
10. **Consume configuration from PConnect** — widgets receive their display data (headers, descriptions, data sources) as resolved properties from the PConnect accessor.
|
|
48
|
+
|
|
49
|
+
### Design system extension components must additionally:
|
|
50
|
+
|
|
51
|
+
11. **Follow their pattern's input contract** — the DSE component rules define three patterns and are the authority on which one each component belongs to. Pattern A in the DSE component rules (data-aware display, e.g. `FieldValueList`, `CaseSummaryFields`, `DetailsFields`) receives the PConnect accessor; Pattern B (pure presentation, e.g. `AlertBanner`, `Banner`, `Operator`) receives plain display props only; Pattern C (rich editor, `RichTextEditor`) extends the field input contract.
|
|
52
|
+
|
|
53
|
+
12. **Render display content only** — these components do not own field state, so they never wire value change or commit events.
|
|
54
|
+
|
|
55
|
+
13. **Keep the prop shape other components depend on** — DSE components are resolved through the registry by fields, templates, and widgets rather than imported directly. `FieldValueList` in particular backs every field component's display-only mode and must keep accepting `name`, `value`, and an optional `variant`.
|
|
56
|
+
|
|
57
|
+
### Infrastructure (chrome) components must additionally:
|
|
58
|
+
|
|
59
|
+
14. **Reproduce the SDK component's prop contract exactly** — `ActionButtons`, `MultiStep`, and `Stages` override components the SDK already provides, so Pega calls them with a contract that is already fixed. They do not share one shape: `ActionButtons` receives no PConnect accessor, only `arMainButtons`, `arSecondaryButtons`, and an `onButtonPress(action, buttonType)` callback; `Stages` receives the PConnect accessor plus `stages`; `MultiStep` receives the PConnect accessor plus `children`, `itemKey`, `actionButtons`, and `onButtonPress`. Read the component's skill file in `{{SKILL_DIR}}/infra-skills/` before generating.
|
|
60
|
+
|
|
61
|
+
15. **Localize labels through Pega** — button and step text comes from the Pega locale utilities using the locale category the SDK component uses, never from hardcoded strings. Only markup and styling are yours to change.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Customer Convention Compliance
|
|
66
|
+
|
|
67
|
+
**The customer owns how it looks. Pega owns how it behaves.** Generated components must be visually indistinguishable from the customer's own UI — their design system, styling mechanism, tokens, and theme are authoritative for appearance. Everything behavioural — state, events, prop contracts, paths, names, registry keys — follows the Pega contract, no matter how the customer does it in their own code.
|
|
68
|
+
|
|
69
|
+
The Design Profile documents both, but only its visual half is authoritative. Its Component Patterns and File Conventions sections describe how the customer writes _their_ components; they are context, not instructions.
|
|
70
|
+
|
|
71
|
+
### Styling
|
|
72
|
+
|
|
73
|
+
- Apply styles using the **same mechanism** the customer uses (utility classes, CSS modules, style objects, scoped styles, etc.)
|
|
74
|
+
- Reference the customer's **design tokens** (colors, spacing, typography) — never hardcode raw values that bypass their token system
|
|
75
|
+
- Handle conditional styling (error states, disabled states, focus states) the same way the customer's components do
|
|
76
|
+
|
|
77
|
+
### File Structure
|
|
78
|
+
|
|
79
|
+
- **Paths are fixed by Pega, not inferred from the customer.** Components live at `pega-components/{type}/{ComponentName}/{ComponentName}.{ext}`, where `{type}` is `field`, `template`, `widget`, `designSystemExtension`, or `infra`, and `{ComponentName}` is the component's canonical Pega name, verbatim, for both the folder and the implementation file — `Checkbox/Checkbox.*`, never `checkbox/CheckboxField.*`
|
|
80
|
+
- **Resolve the canonical name, never assume it.** Step 1 of `{{PROMPT_DIR}}/generate-embedded-components{{PROMPT_EXT}}` defines the resolution procedure — normalized name match, then alias lookup, then behaviour class, then ask the user — against `{{PROMPT_DIR}}/component-manifest.json`. It is the authority, and it forbids fuzzy "similar sounding" matching. Follow it when adding a component by hand, not only when running the prompt
|
|
81
|
+
- Use the customer's **file extension** for their framework
|
|
82
|
+
- Use the customer's **export pattern** (default export, named export, barrel file)
|
|
83
|
+
- Co-locate related files (styles, types, tests) according to the customer's convention
|
|
84
|
+
|
|
85
|
+
### Code Style
|
|
86
|
+
|
|
87
|
+
Behaviour is Pega's, not the customer's. Do **not** imitate how the customer handles:
|
|
88
|
+
|
|
89
|
+
- **State** — field values live in local component state and are committed to the Pega store via the SDK actions API. Never route Pega state through the customer's form library or global store, even though that is how they manage their own forms
|
|
90
|
+
- **Events** — change and commit are reported through the SDK actions API, not through the customer's event or form-submission idioms
|
|
91
|
+
- **Prop and type definitions** — the input contract comes from the SDK's types. Extend them where a component needs extra inputs; never restructure them to match the customer's typing style
|
|
92
|
+
|
|
93
|
+
The customer's platform still imposes constraints the generated code must satisfy in order to build and lint:
|
|
94
|
+
|
|
95
|
+
- **Module resolution** — import their UI primitives through their path aliases, not hand-built relative paths
|
|
96
|
+
- **Framework requirements** — include whatever their framework needs to run the component (client/server boundary directives, module format, language level)
|
|
97
|
+
- **Lint and format rules** — generated files must pass the customer's linter and formatter unmodified
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Prohibitions
|
|
102
|
+
|
|
103
|
+
1. **Never import from the customer's existing components** — generated Pega components are self-contained. If you need a UI primitive, import it from the customer's UI library package, not from their source components.
|
|
104
|
+
|
|
105
|
+
2. **Never modify the customer's existing files while generating components** — the `pega-components/` folder is additive, and component generation writes nothing outside it.
|
|
106
|
+
|
|
107
|
+
**Exception — integration seams.** Wiring a case flow into the customer's app necessarily edits their code, and that is expected. `{{SKILL_DIR}}/embedded-flow/wire-integration.md` defines the complete set of permitted touch points: the dependency manifest, the HTML and application entry points, the OAuth callback assets, `sdk-config.json`, a new bootstrap module, the control or event that launches the case, the element that hosts the Pega container, the lifecycle event subscriptions, and the verification tooling described in `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md` (an additive verification folder, its script entry, and the version-control ignore rule for its session-state directory). Confine edits to those seams — make the smallest change that connects the customer's existing control to the SDK, and never restructure, restyle, or refactor the surrounding code while you are in there.
|
|
108
|
+
|
|
109
|
+
Verification does not widen this exception. A failing check is not permission to edit customer code outside these seams to make it pass — see `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md` for what may be fixed and what must only be reported.
|
|
110
|
+
|
|
111
|
+
3. **Never introduce new dependencies** — only use packages already in the customer's dependency manifest plus the Pega SDK packages. If a needed package is missing, flag it to the user.
|
|
112
|
+
|
|
113
|
+
4. **Never hardcode design token values** — always reference the customer's token system. If a specific value is needed and no token exists, use the closest available token and note the deviation.
|
|
114
|
+
|
|
115
|
+
5. **Never skip display mode handling in field components** — even if the customer's equivalent doesn't have this concept, the Pega contract requires it.
|
|
116
|
+
|
|
117
|
+
6. **Never bypass the component registry** — do not directly import other Pega components for rendering. Always resolve through the registry.
|
|
118
|
+
|
|
119
|
+
7. **Never invent props or APIs** — the component's input interface is defined by the Pega behavioral contract (from skill files). Do not add extra required inputs that the SDK bridge won't provide.
|
|
120
|
+
|
|
121
|
+
8. **Never omit the validation display** — field components must always render validation feedback when it is present, even if the customer's equivalent handles validation differently.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Registry File Rules
|
|
126
|
+
|
|
127
|
+
The `component-map.*` file in the `pega-components/` folder:
|
|
128
|
+
|
|
129
|
+
1. Must export a registration function that accepts a component registry and registers all generated components
|
|
130
|
+
2. Must spread/include the SDK's built-in infrastructure components (NavBar, DeferLoad, VerticalTabs, DashboardFilter and the structural set), which ship with the SDK's own styling
|
|
131
|
+
3. May override three of them — `ActionButtons`, `MultiStep`, and `Stages`. These render inline with the case form, so they are generated in the customer's design system rather than left SDK-styled. `ActionButtons` and `MultiStep` are assignment chrome and belong in an embedded flow; `Stages` is case chrome and only applies to a case-view surface. Because an override replaces the spread entry, it must appear _after_ the spread
|
|
132
|
+
4. Keys must match Pega's canonical component names exactly (case-sensitive)
|
|
133
|
+
5. Must import each generated component and map it to its Pega name
|
|
134
|
+
6. Must never contain a non-canonical key. Aliases and design-system names are resolved away _before_ registration by Step 1 of `{{PROMPT_DIR}}/generate-embedded-components{{PROMPT_EXT}}`, so they never appear here — Pega would never request them at runtime
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
ai-globs:
|
|
2
|
+
ai-globs: **/field/**/*
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Field Component Rules
|
|
@@ -8,71 +8,43 @@ When creating or modifying field components, follow these rules:
|
|
|
8
8
|
|
|
9
9
|
## Required Structure
|
|
10
10
|
|
|
11
|
-
1. **
|
|
11
|
+
1. **Extend the base field props interface** — the project's standard field props type — when defining the component's prop interface.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. **Define a props interface extending `PConnFieldProps`**:
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
interface MyFieldProps extends PConnFieldProps {
|
|
21
|
-
// additional props specific to this field
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
3. **Export as default function component**:
|
|
26
|
-
```typescript
|
|
27
|
-
export default function MyField(props: MyFieldProps) { ... }
|
|
28
|
-
```
|
|
13
|
+
2. **Export the component** using the project's standard export convention (matching other field components in the project).
|
|
29
14
|
|
|
30
15
|
## Required Behaviors
|
|
31
16
|
|
|
32
17
|
1. **Extract standard props**: `getPConnect`, `label`, `required`, `disabled`, `value`, `validatemessage`, `status`, `readOnly`, `testId`, `helperText`, `displayMode`, `hideLabel`, `placeholder`
|
|
33
18
|
|
|
34
|
-
2. **Get PConnect APIs**:
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
const pConn = getPConnect();
|
|
38
|
-
const actions = pConn.getActionsApi();
|
|
39
|
-
const propName = (pConn.getStateProps() as any).value;
|
|
40
|
-
```
|
|
19
|
+
2. **Get PConnect APIs**: obtain the actions API and the current property name from the PConnect accessor (`getPConnect()` → actions API, state props).
|
|
41
20
|
|
|
42
21
|
3. **Handle displayMode** (MUST be before the main return):
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (displayMode === 'DISPLAY_ONLY') {
|
|
46
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
47
|
-
}
|
|
48
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
49
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
50
|
-
}
|
|
51
|
-
```
|
|
22
|
+
- When `displayMode` is `DISPLAY_ONLY`, render the value via the project's field-value display component (unlabeled if `hideLabel` is set).
|
|
23
|
+
- When `displayMode` is `STACKED_LARGE_VAL`, render the same display component with a `stacked` variant.
|
|
52
24
|
|
|
53
25
|
4. **Use local state + blur pattern**:
|
|
54
26
|
- `onChange` → update local state only
|
|
55
|
-
- `onBlur` → call `
|
|
27
|
+
- `onBlur` → call the event helper with a `changeNblur` action, the property name, and the local value
|
|
56
28
|
|
|
57
29
|
5. **Show validation**: Display `validatemessage` and apply error styling when `status === 'error'`
|
|
58
30
|
|
|
59
|
-
6. **Pass test ID**: Set
|
|
31
|
+
6. **Pass test ID**: Set the test id attribute on the interactive element using the `testId` prop
|
|
60
32
|
|
|
61
|
-
7. **Use
|
|
33
|
+
7. **Use the component registry to look up the field-value display component** — never hardcode its import
|
|
62
34
|
|
|
63
35
|
## Visual Preservation
|
|
64
36
|
|
|
65
37
|
The replacement must look the same as the original component:
|
|
66
38
|
|
|
67
39
|
1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
|
|
68
|
-
2. Replicate those styles via inline `style` props,
|
|
69
|
-
3. Do NOT silently drop
|
|
40
|
+
2. Replicate those styles via inline `style` props, the design system's component props/variants, or by keeping the CSS import — whichever produces the closest match.
|
|
41
|
+
3. Do NOT silently drop legacy styling utility classes — map each one to an equivalent style.
|
|
70
42
|
|
|
71
43
|
## Do NOT
|
|
72
44
|
|
|
73
45
|
- Skip `displayMode` handling — it breaks read-only views
|
|
74
|
-
- Call
|
|
46
|
+
- Call the blur handler on every keystroke — only on blur
|
|
75
47
|
- Hardcode component imports for components that exist in the registry
|
|
76
|
-
- Remove the
|
|
77
|
-
- Drop visual styles when removing
|
|
78
|
-
- **Import the same symbol twice from
|
|
48
|
+
- Remove the import of the event handling helper module
|
|
49
|
+
- Drop visual styles when removing legacy styling utility classes — always map them to an equivalent
|
|
50
|
+
- **Import the same symbol twice from the shared field utilities module** — if you import a type or helper in one import statement, do NOT add a separate import line for the same symbol elsewhere. This causes "already defined" errors. Use a single consolidated import.
|