@pega/sdk 0.0.5 → 0.0.7
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 +828 -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/mcp/claude-code.mcp.json +8 -0
- package/templates/react-sdk-reference/.ai-common/mcp/copilot.mcp.json +8 -0
- package/templates/react-sdk-reference/.ai-common/mcp/cursor.mcp.json +11 -0
- 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
package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md
CHANGED
|
@@ -8,212 +8,87 @@ Case actions dropdown menu. Renders an "Actions" button that opens a menu of loc
|
|
|
8
8
|
|
|
9
9
|
## Component Purpose
|
|
10
10
|
|
|
11
|
-
Renders a button that opens a dropdown menu containing all available case actions. Distinguishes between local actions (UI flow) and process actions (server-side), invoking the appropriate API for each. Shows a
|
|
11
|
+
Renders a button that opens a dropdown menu containing all available case actions. Distinguishes between local actions (UI flow) and process actions (server-side), invoking the appropriate API for each. Shows a toast notification on process action error.
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `CaseViewActionsMenu` (in
|
|
15
|
+
- **Registration key:** `CaseViewActionsMenu` (in the project's component map)
|
|
16
16
|
- **Category:** Page template — action menu
|
|
17
|
-
- **Extends:**
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs
|
|
20
20
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `caseTypeID`
|
|
26
|
-
| `caseTypeName`
|
|
27
|
-
| `getPConnect`
|
|
21
|
+
| Name | Type | Required | Description |
|
|
22
|
+
| -------------------- | ---------- | -------- | ---------------------------------------------- |
|
|
23
|
+
| `availableActions` | `array` | No | Array of `{ ID, name }` local action objects |
|
|
24
|
+
| `availableProcesses` | `array` | No | Array of `{ ID, name }` process action objects |
|
|
25
|
+
| `caseTypeID` | `string` | Yes | Case type identifier for label localization |
|
|
26
|
+
| `caseTypeName` | `string` | Yes | Case type display name for label localization |
|
|
27
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Implementation Structure
|
|
30
30
|
|
|
31
31
|
> ⚠️ **CRITICAL — USE THE PROJECT'S DESIGN SYSTEM for the trigger button and menu items.**
|
|
32
32
|
>
|
|
33
|
-
> Check `package.json` for the installed design system. Use its button component (ghost/text variant) for the "Actions…" trigger. Use its menu/dropdown if available, otherwise use a positioned
|
|
33
|
+
> Check `package.json` for the installed design system. Use its button component (ghost/text variant) for the "Actions…" trigger. Use its menu/dropdown if available, otherwise use a positioned list with CSS.
|
|
34
34
|
>
|
|
35
|
-
>
|
|
35
|
+
> When implementing in a specific design system, map the following: the trigger button should use a text or ghost variant button from the installed library; the menu should use the library's dropdown/menu component if available; the toast notification should use the library's snackbar or toast primitive. When no design system is installed, use plain styled elements with a positioned list dropdown.
|
|
36
36
|
>
|
|
37
|
-
>
|
|
38
|
-
> | ------------------ | --------------------------------- | -------------------------------------- |
|
|
39
|
-
> | `@carbon/react` | `<Button kind="ghost" size="sm">` | `<ul>/<li>` with CSS or `OverflowMenu` |
|
|
40
|
-
> | `@mui/material` | `<Button variant="text">` | `<Menu>` + `<MenuItem>` |
|
|
41
|
-
> | `antd` | `<Button type="link">` | `<Dropdown>` + `<Menu>` |
|
|
42
|
-
> | `@chakra-ui/react` | `<Button variant="ghost">` | `<Menu>` + `<MenuItem>` |
|
|
43
|
-
> | None / CSS-only | `<button>` with styled class | `<ul>/<li>` with CSS |
|
|
37
|
+
> ❌ **NEVER** use unstyled HTML elements when a design system is installed.
|
|
44
38
|
>
|
|
45
|
-
>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
caseTypeName?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
|
|
65
|
-
const { getPConnect, availableActions = [], availableProcesses = [], caseTypeID = '', caseTypeName = '' } = props;
|
|
66
|
-
const thePConn = getPConnect();
|
|
67
|
-
const [open, setOpen] = useState(false);
|
|
68
|
-
const menuRef = useRef<HTMLDivElement>(null);
|
|
69
|
-
|
|
70
|
-
// Click-outside-to-close — MANDATORY
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
function handleClickOutside(event: MouseEvent) {
|
|
73
|
-
if (menuRef.current && !menuRef.current.contains(event.target as Node)) {
|
|
74
|
-
setOpen(false);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (open) document.addEventListener('mousedown', handleClickOutside);
|
|
78
|
-
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
79
|
-
}, [open]);
|
|
80
|
-
|
|
81
|
-
// Local action click — openLocalAction with modal container
|
|
82
|
-
function handleActionClick(action: any) {
|
|
83
|
-
(thePConn.getActionsApi() as any).openLocalAction(action.ID, {
|
|
84
|
-
...action, containerName: 'modal', type: 'express',
|
|
85
|
-
});
|
|
86
|
-
setOpen(false);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Process action click — openProcessAction
|
|
90
|
-
function handleProcessClick(process: any) {
|
|
91
|
-
(thePConn.getActionsApi() as any).openProcessAction(process.ID, { ...process });
|
|
92
|
-
setOpen(false);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const hasItems = availableActions.length > 0 || availableProcesses.length > 0;
|
|
96
|
-
if (!hasItems) return null;
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<div className='psdk-actions-menu' ref={menuRef}>
|
|
100
|
-
{/* Use the installed DS button component (ghost/text variant) — NOT plain <button> */}
|
|
101
|
-
<DSButton
|
|
102
|
-
variant='ghost'
|
|
103
|
-
size='sm'
|
|
104
|
-
onClick={() => setOpen(!open)}
|
|
105
|
-
aria-haspopup='true'
|
|
106
|
-
aria-expanded={open}
|
|
107
|
-
>
|
|
108
|
-
Actions…
|
|
109
|
-
</DSButton>
|
|
110
|
-
{open && (
|
|
111
|
-
<ul className='psdk-actions-menu-dropdown' role='menu'>
|
|
112
|
-
{availableActions.map((action: any) => (
|
|
113
|
-
<li className='psdk-actions-menu-item' role='menuitem'
|
|
114
|
-
key={action.ID} onClick={() => handleActionClick(action)}
|
|
115
|
-
onKeyDown={(e) => { if (e.key === 'Enter') handleActionClick(action); }}
|
|
116
|
-
tabIndex={0}>{action.name}</li>
|
|
117
|
-
))}
|
|
118
|
-
{availableActions.length > 0 && availableProcesses.length > 0 && (
|
|
119
|
-
<li className='psdk-actions-menu-divider' role='separator' />
|
|
120
|
-
)}
|
|
121
|
-
{availableProcesses.map((process: any) => (
|
|
122
|
-
<li className='psdk-actions-menu-item' role='menuitem'
|
|
123
|
-
key={process.ID} onClick={() => handleProcessClick(process)}
|
|
124
|
-
onKeyDown={(e) => { if (e.key === 'Enter') handleProcessClick(process); }}
|
|
125
|
-
tabIndex={0}>{process.name}</li>
|
|
126
|
-
))}
|
|
127
|
-
</ul>
|
|
128
|
-
)}
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Required CSS file (`CaseViewActionsMenu.css`)
|
|
135
|
-
|
|
136
|
-
The following CSS MUST be created alongside the component:
|
|
137
|
-
|
|
138
|
-
```css
|
|
139
|
-
.psdk-actions-menu {
|
|
140
|
-
position: relative;
|
|
141
|
-
display: inline-block;
|
|
142
|
-
}
|
|
143
|
-
/* No trigger button CSS needed — the DS button component handles its own styling */
|
|
144
|
-
.psdk-actions-menu-dropdown {
|
|
145
|
-
position: absolute;
|
|
146
|
-
top: 100%;
|
|
147
|
-
left: 0;
|
|
148
|
-
z-index: 1000;
|
|
149
|
-
min-width: 160px;
|
|
150
|
-
background: #fff;
|
|
151
|
-
border-radius: 4px;
|
|
152
|
-
box-shadow:
|
|
153
|
-
0 2px 8px rgba(0, 0, 0, 0.15),
|
|
154
|
-
0 1px 3px rgba(0, 0, 0, 0.1);
|
|
155
|
-
padding: 0.25rem 0;
|
|
156
|
-
margin: 0;
|
|
157
|
-
list-style: none;
|
|
158
|
-
}
|
|
159
|
-
.psdk-actions-menu-item {
|
|
160
|
-
padding: 0.5rem 1rem;
|
|
161
|
-
font-size: 0.875rem;
|
|
162
|
-
color: #161616;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
}
|
|
165
|
-
.psdk-actions-menu-item:hover {
|
|
166
|
-
background-color: #e5e5e5;
|
|
167
|
-
}
|
|
168
|
-
.psdk-actions-menu-item:focus-visible {
|
|
169
|
-
outline: 2px solid #0f62fe;
|
|
170
|
-
outline-offset: -2px;
|
|
171
|
-
}
|
|
172
|
-
.psdk-actions-menu-divider {
|
|
173
|
-
border-top: 1px solid #e0e0e0;
|
|
174
|
-
margin: 0.25rem 0;
|
|
175
|
-
}
|
|
176
|
-
```
|
|
39
|
+
> The dropdown MUST include click-outside-to-close behavior via an instance reference on the container plus a `mousedown` document listener.
|
|
40
|
+
|
|
41
|
+
**Module Setup:** The component needs local state (for menu open/closed and toast visibility), an instance reference (for click-outside detection), a lifecycle effect (for registering/cleaning up the outside-click listener), the project's base component interface, the installed design system's button component, and companion styles.
|
|
42
|
+
|
|
43
|
+
**Main Component Logic** — steps in order:
|
|
44
|
+
|
|
45
|
+
1. Receive inputs: `getPConnect`, `availableActions` (default `[]`), `availableProcesses` (default `[]`), `caseTypeID` (default `''`), and `caseTypeName` (default `''`); call `getPConnect()` once into `thePConn`. Declare local state `open` (boolean, default `false`) and an instance reference for the menu container element.
|
|
46
|
+
2. **Click-outside-to-close (mandatory):** in a lifecycle effect keyed on `open`, register a `mousedown` document listener while `open` is true that closes the menu when the click target falls outside the container reference; clean up the listener on unmount or when `open` changes.
|
|
47
|
+
3. Define `handleActionClick(action)`: call `thePConn.getActionsApi().openLocalAction(action.ID, { ...action, containerName: 'modal', type: 'express' })`, then close the menu.
|
|
48
|
+
4. Define `handleProcessClick(process)`: call `thePConn.getActionsApi().openProcessAction(process.ID, { ...process })` as a promise; on rejection show a toast with `"${process.name} Submit failed!"`; then close the menu.
|
|
49
|
+
5. Compute `hasItems = availableActions.length > 0 || availableProcesses.length > 0`; render nothing when there are no items.
|
|
50
|
+
6. Render a `psdk-actions-menu` container (attached to the instance reference) containing: the installed design system's button (ghost/text variant) labeled "Actions…", with `aria-haspopup="true"`, `aria-expanded` bound to `open`, and an `onClick` that toggles `open`; and, when `open` is true, a `psdk-actions-menu-dropdown` list (`role="menu"`) listing each `availableActions` entry as a `psdk-actions-menu-item` item (`role="menuitem"`, keyed by `action.ID`, showing the localized `action.name`, wired to `handleActionClick` on click and Enter keydown, with `tabIndex={0}`), followed by a `psdk-actions-menu-divider` separator when both action groups are non-empty, followed by each `availableProcesses` entry rendered the same way but wired to `handleProcessClick`.
|
|
51
|
+
|
|
52
|
+
### Required companion styles (`CaseViewActionsMenu.css`)
|
|
53
|
+
|
|
54
|
+
Create this file alongside the component with the following rules: `.psdk-actions-menu` is `position: relative; display: inline-block` (no trigger-button CSS needed since the DS button handles its own styling); `.psdk-actions-menu-dropdown` is absolutely positioned below the trigger (`top: 100%; left: 0`), with `z-index: 1000`, `min-width: 160px`, white background, `4px` border radius, a two-layer drop shadow, `0.25rem 0` padding, no margin, and no list bullets; `.psdk-actions-menu-item` has `0.5rem 1rem` padding, `0.875rem` font size, dark text color, and a pointer cursor, with a light-gray hover background and a visible focus outline (`2px solid`, `-2px` offset) on `:focus-visible`; `.psdk-actions-menu-divider` is a thin top border with `0.25rem 0` margin.
|
|
177
55
|
|
|
178
56
|
## Behavioral Contract
|
|
179
57
|
|
|
180
58
|
### Button Label
|
|
181
59
|
|
|
182
|
-
- Localized via `PCore.getLocaleUtils().getLocaleValue('Actions', 'CaseView'
|
|
60
|
+
- Localized via `PCore.getLocaleUtils().getLocaleValue('Actions...', 'CaseView')`.
|
|
183
61
|
- Rendered as an outlined/secondary button with a dropdown indicator icon.
|
|
184
62
|
|
|
185
63
|
### Menu Items
|
|
186
64
|
|
|
187
65
|
The menu combines:
|
|
188
66
|
|
|
189
|
-
1. **Local actions** — each item triggers `getPConnect().getActionsApi().openLocalAction(action.ID, {
|
|
190
|
-
2. **Process actions** — each item triggers `getPConnect().getActionsApi().openProcessAction(
|
|
67
|
+
1. **Local actions** — each item triggers `getPConnect().getActionsApi().openLocalAction(action.ID, { ...action, containerName: 'modal', type: 'express' })`.
|
|
68
|
+
2. **Process actions** — each item triggers `getPConnect().getActionsApi().openProcessAction(process.ID, { ...process })`.
|
|
191
69
|
|
|
192
70
|
If both groups exist, render a divider between them.
|
|
193
71
|
|
|
194
72
|
### Localized Action Labels
|
|
195
73
|
|
|
196
|
-
For localized case type context
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
localeKey = `${caseTypeID}!CASE!${caseTypeName.toUpperCase()}`
|
|
200
|
-
```
|
|
74
|
+
For localized case type context, build a `localeKey` string as `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase().
|
|
201
75
|
|
|
202
|
-
Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name,
|
|
76
|
+
Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, '', localeKey)`.
|
|
203
77
|
|
|
204
78
|
### Process Action Error Handling
|
|
205
79
|
|
|
206
|
-
1. On process action click,
|
|
207
|
-
2. On
|
|
208
|
-
3.
|
|
80
|
+
1. On process action click, invoke the API as a promise.
|
|
81
|
+
2. On rejection: show a toast notification with `"${process.name} Submit failed!"`.
|
|
82
|
+
3. Toast auto-hides after 3000ms.
|
|
83
|
+
4. Toast should include a close/dismiss button.
|
|
209
84
|
|
|
210
85
|
### Menu State
|
|
211
86
|
|
|
212
|
-
- `open` boolean state controls menu visibility.
|
|
213
|
-
-
|
|
214
|
-
- On `open === true`, add a `mousedown` document listener to detect clicks outside the
|
|
87
|
+
- `open` boolean local state controls menu visibility.
|
|
88
|
+
- An instance reference wraps the entire menu container.
|
|
89
|
+
- On `open === true`, add a `mousedown` document listener to detect clicks outside the container reference and close.
|
|
215
90
|
- Remove the listener on cleanup or when `open` becomes false.
|
|
216
|
-
- **DO NOT** use
|
|
91
|
+
- **DO NOT** use an anchor-element pattern unless the design system provides a dedicated menu component. For CSS-only, use the `open` boolean + absolute positioning.
|
|
217
92
|
|
|
218
93
|
## Visual Specifications
|
|
219
94
|
|
|
@@ -221,7 +96,7 @@ Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, lo
|
|
|
221
96
|
|
|
222
97
|
| Property | Value |
|
|
223
98
|
| -------- | ------------------------------- |
|
|
224
|
-
| Label | Localized `"Actions"`
|
|
99
|
+
| Label | Localized `"Actions..."` |
|
|
225
100
|
| Variant | Outlined or secondary |
|
|
226
101
|
| Icon | Dropdown chevron or expand_more |
|
|
227
102
|
|
|
@@ -240,43 +115,43 @@ Action name localization: `PCore.getLocaleUtils().getLocaleValue(action.name, lo
|
|
|
240
115
|
- Menu item: `padding: 8px 16px; cursor: pointer`. Hover: `background: var(--hover-bg)`.
|
|
241
116
|
- Divider: `border-top: 1px solid var(--divider-color); margin: 4px 0`.
|
|
242
117
|
|
|
243
|
-
###
|
|
118
|
+
### Toast Notification
|
|
244
119
|
|
|
245
120
|
| Property | Value |
|
|
246
121
|
| --------- | ----------------------------- |
|
|
247
122
|
| Position | Bottom-center or bottom-right |
|
|
248
123
|
| Auto-hide | 3000ms |
|
|
249
124
|
| Severity | Error (red) |
|
|
125
|
+
| Dismiss | Close button |
|
|
250
126
|
|
|
251
127
|
## Edge Cases & Special Logic
|
|
252
128
|
|
|
253
|
-
- If both `
|
|
129
|
+
- If both `availableActions` and `availableProcesses` are empty, render nothing (return null).
|
|
254
130
|
- `caseTypeName.toUpperCase()` — guard against `undefined`/`null` values.
|
|
255
|
-
- Process action errors may include HTML — sanitize before displaying in the
|
|
131
|
+
- Process action errors may include HTML — sanitize before displaying in the toast message.
|
|
256
132
|
- Menu should close on any item click (both local and process).
|
|
257
133
|
|
|
258
134
|
## Dependencies
|
|
259
135
|
|
|
260
136
|
- `PCore.getLocaleUtils().getLocaleValue()` — label localization
|
|
261
|
-
- `
|
|
262
|
-
-
|
|
137
|
+
- `getPConnect().getActionsApi()` — local action and process action invocation
|
|
138
|
+
- The project's base component interface
|
|
139
|
+
- The installed design system's button, menu, and toast components (check `package.json`)
|
|
263
140
|
|
|
264
141
|
## Design System Mapping
|
|
265
142
|
|
|
266
143
|
**UI control type:** Dropdown action menu with button trigger and toast error notification.
|
|
267
144
|
|
|
268
|
-
|
|
145
|
+
When implementing in a specific design system, map the following:
|
|
269
146
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
| Chakra UI | `<Menu>/<MenuButton>/<MenuList>` | Chakra Menu | `useToast()` |
|
|
276
|
-
| Shadcn/ui | `<DropdownMenu>/<DropdownMenuTrigger>` | Shadcn DropdownMenu | `<Toaster>` + `toast.error()` |
|
|
147
|
+
- **Trigger button:** Use the design system's text or ghost-variant button. The button label is the localized "Actions..." string. It must support `aria-haspopup` and `aria-expanded` attributes.
|
|
148
|
+
- **Menu/Dropdown:** Use the design system's menu or dropdown primitive if available. If none exists, use a positioned list with CSS and manual open/close logic. Items must support click handlers and keyboard activation (Enter key).
|
|
149
|
+
- **Divider:** Use the design system's divider or separator between the local actions group and the process actions group.
|
|
150
|
+
- **Toast notification:** Use the design system's snackbar or toast component to surface process action errors. Must auto-hide after 3000ms and include a dismiss/close button.
|
|
151
|
+
- **Click-outside-to-close:** If the design system's menu handles this natively, rely on that. Otherwise implement manually with an instance reference and a document `mousedown` listener.
|
|
277
152
|
|
|
278
|
-
|
|
153
|
+
Key constraints regardless of design system:
|
|
279
154
|
|
|
280
155
|
- Local vs process action distinction must be preserved — they call different APIs
|
|
281
|
-
- Localized labels via `localeKey = ${caseTypeID}!CASE!${caseTypeName
|
|
156
|
+
- Localized labels via `localeKey = ${caseTypeID}!CASE!${caseTypeName}`.toUpperCase()
|
|
282
157
|
- Process action errors must be surfaced via a dismissible toast
|
|
@@ -15,13 +15,13 @@ Case confirmation template. Renders the post-submission confirmation view with a
|
|
|
15
15
|
> 1. `PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget())` — gets active container item
|
|
16
16
|
> 2. `PCore.getContainerUtils().getContainerItemData(target, activeItemID)` — gets root info for close event
|
|
17
17
|
> 3. `PCore.getPubSubUtils().publish(CONSTS.PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo)` — proper close event with payload
|
|
18
|
-
> 4. `
|
|
18
|
+
> 4. Look up the `'Details'` component from the project's component registry — for rendering case details in confirmation
|
|
19
19
|
> 5. `getToDoAssignments(getPConnect())` — from `PCore.getSDKUtils().getSDKContainerUtils()`
|
|
20
20
|
> 6. Check `showDetails` before rendering Details component
|
|
21
21
|
>
|
|
22
22
|
> **Minimum Implementation Checklist:**
|
|
23
23
|
>
|
|
24
|
-
> - [ ] `PCore.getContainerUtils()` used for close event (NOT a simple
|
|
24
|
+
> - [ ] `PCore.getContainerUtils()` used for close event (NOT a simple toggle of local state)
|
|
25
25
|
> - [ ] `rootInfo` passed to `CLOSE_CONFIRM_VIEW` pub/sub event
|
|
26
26
|
> - [ ] Details component rendered when `showDetails` is true
|
|
27
27
|
> - [ ] ToDo component rendered with `getToDoAssignments` when `showTasks` is true
|
|
@@ -35,111 +35,64 @@ Displayed after a case or assignment is submitted. Shows the confirmation view (
|
|
|
35
35
|
|
|
36
36
|
## Pega Metadata
|
|
37
37
|
|
|
38
|
-
- **Registration key:** `Confirmation` (in
|
|
38
|
+
- **Registration key:** `Confirmation` (in the project's component map)
|
|
39
39
|
- **Category:** Page template — confirmation
|
|
40
|
-
- **Extends:**
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
| ------------- |
|
|
46
|
-
| `children` |
|
|
47
|
-
| `getPConnect` |
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const CONSTS = PCore.getConstants();
|
|
68
|
-
const [showConfirmView, setShowConfirmView] = useState(true);
|
|
69
|
-
const { showTasks, getPConnect, showLabel, label } = props;
|
|
70
|
-
|
|
71
|
-
// 1. Get active container + root info
|
|
72
|
-
const activeContainerItemID = PCore.getContainerUtils()
|
|
73
|
-
.getActiveContainerItemName(getPConnect().getTarget() || '');
|
|
74
|
-
const rootInfo = PCore.getContainerUtils()
|
|
75
|
-
.getContainerItemData(getPConnect().getTarget(), activeContainerItemID);
|
|
76
|
-
|
|
77
|
-
// 2. Get todo assignments
|
|
78
|
-
const { getToDoAssignments } = PCore.getSDKUtils().getSDKContainerUtils();
|
|
79
|
-
const toDoList = getToDoAssignments(getPConnect());
|
|
80
|
-
|
|
81
|
-
// 3. Done button handler
|
|
82
|
-
const onConfirmViewClose = () => {
|
|
83
|
-
setShowConfirmView(false);
|
|
84
|
-
PCore.getPubSubUtils().publish(
|
|
85
|
-
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// 4. Show details check
|
|
90
|
-
const showDetails = props.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;
|
|
91
|
-
|
|
92
|
-
// 5. Render: confirm view OR todo view
|
|
93
|
-
if (showConfirmView) {
|
|
94
|
-
return (
|
|
95
|
-
<Card>
|
|
96
|
-
<h2>{showLabel ? label : ''}</h2>
|
|
97
|
-
{showDetails && <Details {...props} showLabel={false} />}
|
|
98
|
-
{showTasks && toDoList?.length > 0 && (
|
|
99
|
-
<ToDo datasource={{ source: toDoList }} getPConnect={getPConnect}
|
|
100
|
-
type={CONSTS.TODO} headerText="Open Tasks" isConfirm />
|
|
101
|
-
)}
|
|
102
|
-
<DoneButton onClick={onConfirmViewClose}>Done</DoneButton>
|
|
103
|
-
</Card>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
return toDoList?.length > 0 ? (
|
|
107
|
-
<Card>
|
|
108
|
-
<ToDo datasource={{ source: toDoList }} getPConnect={getPConnect}
|
|
109
|
-
type={CONSTS.TODO} headerText="Tasks" isConfirm />
|
|
110
|
-
</Card>
|
|
111
|
-
) : null;
|
|
112
|
-
}
|
|
113
|
-
```
|
|
40
|
+
- **Extends:** the project's base component interface
|
|
41
|
+
|
|
42
|
+
## Inputs
|
|
43
|
+
|
|
44
|
+
| Input | Type | Required | Description |
|
|
45
|
+
| ------------- | ------------------ | -------- | ----------------------------------------------------------------------------- |
|
|
46
|
+
| `children` | child element list | Yes | Region children: `[0]` = ToDo region, `[1]` = Details region (when available) |
|
|
47
|
+
| `getPConnect` | function | Yes | PConnect getter |
|
|
48
|
+
| `datasource` | object | No | Shape `{ source: any }` — what's-next data source |
|
|
49
|
+
| `label` | string | No | Confirmation heading text |
|
|
50
|
+
| `showLabel` | boolean | No | Whether to render the heading label |
|
|
51
|
+
| `showTasks` | boolean | No | Whether to render outstanding ToDo assignments |
|
|
52
|
+
|
|
53
|
+
## Implementation Structure
|
|
54
|
+
|
|
55
|
+
**Module Setup:** This component needs the project's base component interface for typing, the project's component registry for retrieving `ToDo` and `Details` dynamically, and a local state primitive for tracking the confirm-view toggle. Define a companion styles block with padding and margin (1 spacing unit on all sides) applied to the card wrapper.
|
|
56
|
+
|
|
57
|
+
**Main Component Logic** — steps in order:
|
|
58
|
+
|
|
59
|
+
1. Retrieve `ToDo` from the project's component registry using the key `'Todo'` (note the capitalization — not `'ToDo'`), and `Details` similarly using `'Details'`.
|
|
60
|
+
2. Set `CONSTS = PCore.getConstants()`; declare local state `showConfirmView` initialized to `true`; receive inputs `showTasks`, `getPConnect`, `showLabel`, and `label`.
|
|
61
|
+
3. Get the active container and root info: `activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget() || '')`, then `rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID)`.
|
|
62
|
+
4. Get pending ToDo assignments: destructure `getToDoAssignments` from `PCore.getSDKUtils().getSDKContainerUtils()`, then call `toDoList = getToDoAssignments(getPConnect())`.
|
|
63
|
+
5. Define the Done-button handler `onConfirmViewClose`: set `showConfirmView` to `false`, then publish `PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo)`.
|
|
64
|
+
6. Compute `showDetails` by checking whether the first child's nested PConnect has children: `children?.[0]` → get its `getPConnect()` → call `getChildren()` → check `length > 0`.
|
|
65
|
+
7. **Render — confirm view:** if `showConfirmView` is true, render a card container (with companion styles) containing: a heading with the label (when `showLabel` is true); the Details component (with `showLabel` set to false) when `showDetails` is true; the ToDo component (with `datasource: { source: toDoList }`, `getPConnect`, `type: CONSTS.TODO`, `headerText: "Open Tasks"`, `isConfirm: true`) when `showTasks` is true and `toDoList` is non-empty; and a primary Done button aligned to the end, wired to `onConfirmViewClose`.
|
|
66
|
+
8. **Render — post-close:** otherwise, if `toDoList` is non-empty, render a card container containing just the ToDo component (same inputs as above but `headerText: "Tasks"`); if `toDoList` is empty, render nothing.
|
|
114
67
|
|
|
115
68
|
## Behavioral Contract
|
|
116
69
|
|
|
117
70
|
### State
|
|
118
71
|
|
|
119
|
-
- `showConfirmView`: boolean, initially `true`.
|
|
72
|
+
- `showConfirmView`: boolean local state, initially `true`.
|
|
120
73
|
- `toDoAssignments`: array from `getToDoAssignments(getPConnect())` — pending assignments.
|
|
121
74
|
|
|
122
75
|
### Done Button Click
|
|
123
76
|
|
|
124
|
-
1.
|
|
125
|
-
2.
|
|
126
|
-
3.
|
|
127
|
-
4. If assignments remain: `setShowConfirmView(false)` — show ToDo view instead.
|
|
128
|
-
5. If no assignments remain: publish `PCore.getPubSubUtils().publish(CLOSE_CONFIRM_VIEW, {})`.
|
|
77
|
+
1. Set `showConfirmView` local state to `false`.
|
|
78
|
+
2. Publish `PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo)`.
|
|
79
|
+
3. The `rootInfo` payload is derived from `PCore.getContainerUtils().getContainerItemData(target, activeContainerItemID)` — this is mandatory for correct container closure.
|
|
129
80
|
|
|
130
81
|
### Show Details
|
|
131
82
|
|
|
132
|
-
- `showDetails`:
|
|
83
|
+
- `showDetails`: true when the first child region's PConnect has children (i.e., there is content to display in the Details area).
|
|
133
84
|
|
|
134
|
-
### Render: Confirm View (
|
|
85
|
+
### Render: Confirm View (showConfirmView is true)
|
|
135
86
|
|
|
136
|
-
1. Confirmation
|
|
137
|
-
2. If `showDetails`: render
|
|
138
|
-
3.
|
|
87
|
+
1. Confirmation heading label (when `showLabel` is true).
|
|
88
|
+
2. If `showDetails`: render the Details component retrieved from the project's component registry with `showLabel` set to false, passing the current component's inputs.
|
|
89
|
+
3. If `showTasks` and `toDoList` is non-empty: render the ToDo component with `datasource: { source: toDoList }`, `type: CONSTS.TODO`, `headerText: "Open Tasks"`, `isConfirm: true`.
|
|
90
|
+
4. Done button (primary action) — triggers `onConfirmViewClose`.
|
|
139
91
|
|
|
140
|
-
### Render:
|
|
92
|
+
### Render: Post-Close View (showConfirmView is false)
|
|
141
93
|
|
|
142
|
-
-
|
|
94
|
+
- If `toDoList` is non-empty: render a card with the ToDo component (`headerText: "Tasks"`, same core inputs).
|
|
95
|
+
- If `toDoList` is empty: render nothing.
|
|
143
96
|
|
|
144
97
|
## Visual Specifications
|
|
145
98
|
|
|
@@ -147,52 +100,50 @@ export default function Confirmation(props: PropsWithChildren<ConfirmationProps>
|
|
|
147
100
|
|
|
148
101
|
| Element | Description |
|
|
149
102
|
| ------------------- | --------------------------------------------- |
|
|
150
|
-
| Confirmation header |
|
|
103
|
+
| Confirmation header | Heading text (label) when showLabel is true |
|
|
151
104
|
| Details section | Optional — rendered below confirmation header |
|
|
152
|
-
| Done button | Primary button,
|
|
105
|
+
| Done button | Primary button, aligned to end of the form |
|
|
153
106
|
|
|
154
107
|
**CSS-only implementation notes:**
|
|
155
108
|
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
- Confirmation heading:
|
|
159
|
-
- Done button: `align-self: flex-end` or centered.
|
|
109
|
+
- Card wrapper: padding and margin of 1 spacing unit on all sides.
|
|
110
|
+
- Done button container: `display: flex; justify-content: flex-end`.
|
|
111
|
+
- Confirmation heading: rendered as a level-2 heading element.
|
|
160
112
|
|
|
161
113
|
### ToDo View
|
|
162
114
|
|
|
163
|
-
- Full-width ToDo region rendered in place of confirmation.
|
|
115
|
+
- Full-width ToDo region rendered in place of confirmation inside a card wrapper.
|
|
164
116
|
- No additional wrapping — render the region directly.
|
|
165
117
|
|
|
166
118
|
## Edge Cases & Special Logic
|
|
167
119
|
|
|
168
|
-
- `getToDoAssignments(getPConnect())` — returns empty array if no assignments remain;
|
|
169
|
-
-
|
|
120
|
+
- `getToDoAssignments(getPConnect())` — returns empty array if no assignments remain; when empty in post-close state, renders nothing.
|
|
121
|
+
- The first child region may not have Details content — always check `showDetails` before rendering the Details component.
|
|
170
122
|
- `CLOSE_CONFIRM_VIEW` is a PubSub constant — ensure it matches the consuming container's subscription key.
|
|
171
123
|
- The confirmation view should not be navigable backward — Done is the only exit.
|
|
124
|
+
- The ToDo registry key is `'Todo'` (capital T, lowercase odo) — this is the ConstellationJS Engine convention.
|
|
172
125
|
|
|
173
126
|
## Dependencies
|
|
174
127
|
|
|
175
|
-
- `
|
|
176
|
-
- `PCore.
|
|
177
|
-
- `PCore.
|
|
178
|
-
- `
|
|
128
|
+
- The project's component registry — for retrieving `'Todo'` and `'Details'` components dynamically at runtime
|
|
129
|
+
- `PCore.getSDKUtils().getSDKContainerUtils().getToDoAssignments` — for retrieving pending assignments
|
|
130
|
+
- `PCore.getPubSubUtils().publish()` — for the CLOSE_CONFIRM_VIEW event
|
|
131
|
+
- `PCore.getContainerUtils()` — for container item management (active item name + container item data)
|
|
132
|
+
- `PCore.getConstants()` — for PubSub event keys and TODO type constant
|
|
179
133
|
|
|
180
134
|
## Design System Mapping
|
|
181
135
|
|
|
182
136
|
**UI control type:** Post-submission confirmation page with done action and optional todo view.
|
|
183
137
|
|
|
184
|
-
|
|
138
|
+
When implementing in a specific design system, map the following:
|
|
185
139
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| Ant Design | `<Result status='success'>` | `<Button type='primary'>` | Ant Result component |
|
|
191
|
-
| Chakra UI | `<CheckCircleIcon>` + `<Text>` | `<Button colorScheme='blue'>` | `<VStack>` |
|
|
192
|
-
| Shadcn/ui | Custom icon + `<h2>` | `<Button>` | Tailwind centered div |
|
|
140
|
+
- **Card wrapper:** Use the design system's card or surface container component with standard padding/margin.
|
|
141
|
+
- **Done button:** Use the design system's primary action button component.
|
|
142
|
+
- **Heading:** Use a level-2 heading or the design system's title typography component.
|
|
143
|
+
- **Layout:** A vertical flex column layout containing heading, optional details, optional todo list, and the done button at the end.
|
|
193
144
|
|
|
194
|
-
|
|
145
|
+
Implementation constraints regardless of design system:
|
|
195
146
|
|
|
196
|
-
- Done button must
|
|
197
|
-
- `
|
|
198
|
-
- `
|
|
147
|
+
- Done button must trigger `onConfirmViewClose` which both toggles local state and publishes the `CLOSE_CONFIRM_VIEW` event with `rootInfo`
|
|
148
|
+
- `showDetails` check must guard Details component rendering
|
|
149
|
+
- ToDo component receives `isConfirm: true` to signal it is rendered within a confirmation context
|