@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Individual item card for displaying an attachment, file, or link with an icon, name, metadata, and an actions menu. Also covers `SummaryList` — the container that renders multiple `SummaryItem` cards.
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture,
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, input contract, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -18,79 +18,34 @@ Individual item card for displaying an attachment, file, or link with an icon, n
|
|
|
18
18
|
- `SummaryItem` — the individual item card
|
|
19
19
|
- `SummaryList` — the container/list component
|
|
20
20
|
- **Category:** Widget — display / composition
|
|
21
|
-
- **Extends:**
|
|
21
|
+
- **Extends:** The project's base component interface
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Implementation Structure
|
|
26
26
|
|
|
27
27
|
### SummaryItem
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
menuIconOverride$: string;
|
|
37
|
-
menuIconOverrideAction$: any;
|
|
38
|
-
arItems$: any;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default function SummaryItem(props: SummaryItemProps) {
|
|
42
|
-
let { menuIconOverride$ } = props;
|
|
43
|
-
const item = props.arItems$;
|
|
44
|
-
const imagePath = Utils.getIconPath(Utils.getSDKStaticConentUrl());
|
|
45
|
-
const srcImg = `${imagePath}${item.visual.icon}.svg`;
|
|
46
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
47
|
-
if (menuIconOverride$) menuIconOverride$ = Utils.getImageSrc(menuIconOverride$, Utils.getSDKStaticConentUrl());
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className="psdk-utility-card">
|
|
51
|
-
<div className="psdk-utility-card-icon"><img src={srcImg} /></div>
|
|
52
|
-
<div className="psdk-utility-card-main">
|
|
53
|
-
{item.primary.type !== 'URL'
|
|
54
|
-
? <div className="primary-label">{item.primary.name}</div>
|
|
55
|
-
: <button className="link-button">{item.primary.name}</button>}
|
|
56
|
-
{item.secondary.text && <div style={{ color: item.secondary.error ? 'red' : undefined }}>{item.secondary.text}</div>}
|
|
57
|
-
</div>
|
|
58
|
-
<div className="psdk-utility-action">
|
|
59
|
-
{menuIconOverride$
|
|
60
|
-
? <button onClick={() => props.menuIconOverrideAction$(item)}><img src={menuIconOverride$} /></button>
|
|
61
|
-
: <IconButton onClick={e => setAnchorEl(e.currentTarget)}><MoreVertIcon /></IconButton>}
|
|
62
|
-
{!menuIconOverride$ && <Menu anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={() => setAnchorEl(null)}>
|
|
63
|
-
{item.actions?.map(opt => <MenuItem key={opt.id} onClick={opt.onClick}>{opt.text}</MenuItem>)}
|
|
64
|
-
</Menu>}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
29
|
+
**Module Setup:** The component depends on local state management and the project's SDK utility helpers for icon path resolution. Define the input contract as an extension of the project's base component interface with `menuIconOverride$`, `menuIconOverrideAction$`, and `arItems$` fields. Import a companion stylesheet.
|
|
30
|
+
|
|
31
|
+
**Main Component Logic** — steps in order:
|
|
32
|
+
|
|
33
|
+
1. Receive `menuIconOverride$` (as a reassignable variable) from inputs; read the single item into `item` from the `arItems$` input. Resolve `imagePath` via `Utils.getIconPath(Utils.getSDKStaticConentUrl())` and build `srcImg` by concatenating `imagePath`, `item.visual.icon`, and `.svg`. Declare `anchorEl` state (default `null`) for the actions menu.
|
|
34
|
+
2. When `menuIconOverride$` is provided, resolve it to a full image source via `Utils.getImageSrc(menuIconOverride$, Utils.getSDKStaticConentUrl())`.
|
|
35
|
+
3. **Render** a `psdk-utility-card` container with three sections: an icon block showing `srcImg`; a main content block showing the primary element (plain text when `item.primary.type !== 'URL'`, or a link-styled button element when it is a URL, both displaying `item.primary.name`) followed by the secondary metadata text (`item.secondary.text`, styled red when `item.secondary.error` is true); and an actions block that either renders a single override icon button (calling the `menuIconOverrideAction$` callback with the item on click, shown when `menuIconOverride$` is set) or an overflow menu icon button that opens a dropdown menu listing one menu item per entry in `item.actions` (shown when no override is set).
|
|
70
36
|
|
|
71
37
|
### SummaryList
|
|
72
38
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<div>
|
|
81
|
-
{arItems$.map(file => (
|
|
82
|
-
<SummaryItem key={file.id} arItems$={file}
|
|
83
|
-
menuIconOverride$={menuIconOverride$}
|
|
84
|
-
menuIconOverrideAction$={menuIconOverrideAction$} />
|
|
85
|
-
))}
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
```
|
|
39
|
+
**Module Setup:** The component depends on the project's component registry (to resolve `SummaryItem`).
|
|
40
|
+
|
|
41
|
+
**Main Component Logic** — steps in order:
|
|
42
|
+
|
|
43
|
+
1. Resolve `SummaryItem` from the project's component registry. Receive `arItems$`, `menuIconOverride$` (default `''`), and `menuIconOverrideAction$` from inputs.
|
|
44
|
+
2. Render a wrapping `div` containing one `SummaryItem` per entry in `arItems$`, keyed by `file.id`, passing that entry as `arItems$`, plus `menuIconOverride$` and `menuIconOverrideAction$`.
|
|
90
45
|
|
|
91
46
|
## SummaryItem
|
|
92
47
|
|
|
93
|
-
###
|
|
48
|
+
### Inputs
|
|
94
49
|
|
|
95
50
|
| Prop | Type | Required | Description |
|
|
96
51
|
| ------------------------- | ---------- | -------- | --------------------------------------------------------------------------------------- |
|
|
@@ -101,31 +56,7 @@ export default function SummaryList(props) {
|
|
|
101
56
|
|
|
102
57
|
### Item Structure (`arItems$`)
|
|
103
58
|
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
id: string;
|
|
107
|
-
visual: {
|
|
108
|
-
icon: string; // Icon identifier or URL
|
|
109
|
-
progress?: number; // Upload progress 0–100 (optional)
|
|
110
|
-
};
|
|
111
|
-
primary: {
|
|
112
|
-
type: 'FILE' | 'URL';
|
|
113
|
-
name: string; // Display name of the item
|
|
114
|
-
icon: string; // Icon for the primary element
|
|
115
|
-
click: () => void; // Download (FILE) or open in new tab (URL)
|
|
116
|
-
};
|
|
117
|
-
secondary: {
|
|
118
|
-
text: string; // Metadata text (e.g., "John Smith · 01/15/2025")
|
|
119
|
-
error?: boolean; // If true, render text in error/red color
|
|
120
|
-
};
|
|
121
|
-
actions: Array<{
|
|
122
|
-
id: string;
|
|
123
|
-
text: string; // Menu item label
|
|
124
|
-
icon: string; // Menu item icon identifier
|
|
125
|
-
onClick: () => void; // Action callback
|
|
126
|
-
}>;
|
|
127
|
-
}
|
|
128
|
-
```
|
|
59
|
+
Each item object has: `id` (string); a `visual` object with an `icon` (string identifier or URL) and an optional `progress` (number, upload progress 0–100); a `primary` object with `type` (`'FILE'` or `'URL'`), `name` (display name), `icon` (icon for the primary element), and `click` (a callback that downloads the file or opens the URL in a new tab); a `secondary` object with `text` (metadata, e.g. "John Smith · 01/15/2025") and an optional `error` boolean (renders the text in error/red color when true); and an `actions` array of `{ id, text, icon, onClick }` entries describing the menu items.
|
|
129
60
|
|
|
130
61
|
### Behavioral Contract
|
|
131
62
|
|
|
@@ -142,11 +73,7 @@ export default function SummaryList(props) {
|
|
|
142
73
|
|
|
143
74
|
### Item Layout
|
|
144
75
|
|
|
145
|
-
|
|
146
|
-
[File Icon] [Name (link if URL)]
|
|
147
|
-
[Secondary metadata text]
|
|
148
|
-
[Actions button (⋮ or override)]
|
|
149
|
-
```
|
|
76
|
+
The file icon sits on the left, followed by the name (rendered as a link when the item is a URL) with the secondary metadata text below it, and the actions button (the overflow `⋮` icon or the override icon) anchored to the far right.
|
|
150
77
|
|
|
151
78
|
| Element | Description |
|
|
152
79
|
| -------------- | --------------------------------------------- |
|
|
@@ -177,7 +104,7 @@ export default function SummaryList(props) {
|
|
|
177
104
|
|
|
178
105
|
## SummaryList
|
|
179
106
|
|
|
180
|
-
###
|
|
107
|
+
### Inputs
|
|
181
108
|
|
|
182
109
|
| Prop | Type | Required | Description |
|
|
183
110
|
| ------------------------- | ---------- | -------- | ---------------------------------------------------------------- |
|
|
@@ -188,44 +115,25 @@ export default function SummaryList(props) {
|
|
|
188
115
|
|
|
189
116
|
### Behavioral Contract
|
|
190
117
|
|
|
191
|
-
|
|
192
|
-
const SummaryItemComp = getComponentFromRegistry('SummaryItem');
|
|
193
|
-
|
|
194
|
-
return (
|
|
195
|
-
<div>
|
|
196
|
-
{arItems$.map((item, i) => (
|
|
197
|
-
<SummaryItemComp
|
|
198
|
-
key={item.id || i}
|
|
199
|
-
arItems$={item}
|
|
200
|
-
menuIconOverride$={menuIconOverride$}
|
|
201
|
-
menuIconOverrideAction$={menuIconOverrideAction$}
|
|
202
|
-
getPConnect={getPConnect}
|
|
203
|
-
/>
|
|
204
|
-
))}
|
|
205
|
-
</div>
|
|
206
|
-
);
|
|
207
|
-
```
|
|
118
|
+
Resolve `SummaryItem` from the project's component registry. Render a wrapping container with one `SummaryItem` instance per entry in `arItems$` (keyed by `item.id` or its index), passing that entry as `arItems$`, plus `menuIconOverride$`, `menuIconOverrideAction$`, and `getPConnect`.
|
|
208
119
|
|
|
209
120
|
No state, no data fetching — purely a mapping wrapper.
|
|
210
121
|
|
|
211
122
|
## Dependencies
|
|
212
123
|
|
|
213
|
-
- **SummaryItem:**
|
|
214
|
-
- **SummaryList:** `
|
|
124
|
+
- **SummaryItem:** The DS's icon button and menu/dropdown components, the project's SDK utility helpers for icon path resolution.
|
|
125
|
+
- **SummaryList:** The project's component registry, resolving `SummaryItem` — resolves the item component dynamically.
|
|
215
126
|
|
|
216
127
|
## Design System Mapping
|
|
217
128
|
|
|
218
129
|
**UI control type:** File/link item row with icon, name, metadata, and action menu.
|
|
219
130
|
|
|
220
|
-
|
|
131
|
+
When implementing in a specific design system, map the following:
|
|
221
132
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
| Ant Design | `<List.Item>` | `<Dropdown menu={{ items }}>` |
|
|
227
|
-
| Chakra UI | `<HStack>` | `<Menu>/<MenuButton>/<MenuList>` |
|
|
228
|
-
| Shadcn/ui | `<div>` flexbox | `<DropdownMenu>` |
|
|
133
|
+
- **Item row** → use the DS's list-item or flex-row container
|
|
134
|
+
- **Actions menu** → use the DS's overflow/dropdown menu with an icon button trigger
|
|
135
|
+
- **Override icon button** → render a single icon button with the override image when `menuIconOverride$` is set
|
|
136
|
+
- **URL item** → render as a link-styled button element
|
|
229
137
|
|
|
230
138
|
When implementing in a specific design system:
|
|
231
139
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Assignment worklist widget. Displays the current user's pending assignments with expand/collapse, click-to-open, priority indicators, badge counts, responsive layout, and snackbar error notifications.
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture,
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, input contract, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -12,11 +12,11 @@ Renders a compact to-do / worklist panel showing the user's pending assignments.
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `Todo` (note: lowercase `o` in the key
|
|
15
|
+
- **Registration key:** `Todo` (note: lowercase `o` in the key)
|
|
16
16
|
- **Category:** Widget — assignment / action
|
|
17
|
-
- **Extends:**
|
|
17
|
+
- **Extends:** The project's base component interface
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs
|
|
20
20
|
|
|
21
21
|
| Prop | Type | Required | Description |
|
|
22
22
|
| -------------- | ---------- | -------- | -------------------------------------------------------------------------------------------------- |
|
|
@@ -31,70 +31,19 @@ Renders a compact to-do / worklist panel showing the user's pending assignments.
|
|
|
31
31
|
| `isConfirm` | `boolean` | No | Confirmation mode — adjusts rendering for post-submit confirmation view |
|
|
32
32
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export default function ToDo(props: ToDoProps) {
|
|
49
|
-
const {
|
|
50
|
-
getPConnect, context, datasource = [], headerText = 'To do',
|
|
51
|
-
showTodoList = true, myWorkList = {}, type = 'worklist', isConfirm = false,
|
|
52
|
-
} = props;
|
|
53
|
-
const CONSTS = PCore.getConstants();
|
|
54
|
-
const thePConn = getPConnect();
|
|
55
|
-
const currentUser = PCore.getEnvironmentInfo().getOperatorName() ?? '';
|
|
56
|
-
const currentUserInitials = Utils.getInitials(currentUser);
|
|
57
|
-
|
|
58
|
-
// 1. Data: derive assignments from props OR fetch
|
|
59
|
-
const assignmentsSource = Array.isArray(datasource) ? datasource : Array.isArray(datasource?.source) ? datasource.source : Array.isArray(myWorkList?.source) ? myWorkList.source : null;
|
|
60
|
-
const [fetchedAssignments, setFetchedAssignments] = useState([]);
|
|
61
|
-
|
|
62
|
-
// 2. Only fetch for WORKLIST type — TODO type gets data from props directly
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (type === CONSTS.WORKLIST && myWorkList?.datapage && !assignmentsSource?.length) {
|
|
65
|
-
PCore.getDataPageUtils().getDataAsync(myWorkList.datapage, context || pConn.getContextName(), ...)
|
|
66
|
-
.then(response => setFetchedAssignments(response?.data || []));
|
|
67
|
-
}
|
|
68
|
-
}, [type, myWorkList?.datapage, context]);
|
|
69
|
-
|
|
70
|
-
// Use prop data if available, otherwise use fetched data
|
|
71
|
-
const assignments = assignmentsSource?.length ? assignmentsSource : fetchedAssignments;
|
|
72
|
-
|
|
73
|
-
// 3. clickGo — openAssignment with container options
|
|
74
|
-
// IMPORTANT: assignment ID field differs by type!
|
|
75
|
-
const CONSTS = PCore.getConstants();
|
|
76
|
-
const getAssignmentId = (assignment) => type === CONSTS.TODO ? assignment.ID : assignment.id;
|
|
77
|
-
|
|
78
|
-
function clickGo(assignment) {
|
|
79
|
-
const id = getAssignmentId(assignment);
|
|
80
|
-
let classname = assignment.classname || '';
|
|
81
|
-
if (!classname) classname = thePConn.getCaseInfo().getClassName();
|
|
82
|
-
const sTarget = thePConn.getContainerName() || '';
|
|
83
|
-
const options: any = { containerName: sTarget || CONSTS.APP.APP, channelName: '' };
|
|
84
|
-
if (sTarget === 'workarea') { options.isActionFromToDoList = true; options.target = ''; options.context = null; options.isChild = assignment.isChild; }
|
|
85
|
-
else { options.isActionFromToDoList = false; options.target = sTarget; }
|
|
86
|
-
thePConn.getActionsApi().openAssignment(id, classname, options)
|
|
87
|
-
.catch(() => { setSnackbarMessage('Submit failed!'); setShowSnackbar(true); });
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// 4. Show more/less toggle
|
|
91
|
-
function _showMore() { setBShowMore(false); /* fetch all or setAssignments(full list) */ }
|
|
92
|
-
function _showLess() { setBShowMore(true); setAssignments(a => a.slice(0, 3)); }
|
|
93
|
-
|
|
94
|
-
// 5. Render: WORKLIST and TODO have DIFFERENT render structures
|
|
95
|
-
// See the two render paths below — they MUST be separate.
|
|
96
|
-
}
|
|
97
|
-
```
|
|
34
|
+
## Implementation Structure
|
|
35
|
+
|
|
36
|
+
**Module Setup:** The component depends on cached callbacks, lifecycle effects, and local state management; the project's SDK utility helpers; and companion styles. Define the input contract as an extension of the project's base component interface with optional `datasource`, `myWorkList`, `caseInfoID`, `headerText`, `showTodoList`, `type`, `context`, and `isConfirm` fields.
|
|
37
|
+
|
|
38
|
+
**Main Component Logic** — steps in order:
|
|
39
|
+
|
|
40
|
+
1. Receive `getPConnect`, `context`, `datasource` (default `[]`), `headerText` (default `'To do'`), `showTodoList` (default `true`), `myWorkList` (default `{}`), `type` (default `'worklist'`), and `isConfirm` (default `false`) from inputs. Read `CONSTS = PCore.getConstants()`; call `getPConnect()` into `thePConn`; resolve `currentUser` via `PCore.getEnvironmentInfo().getOperatorName() ?? ''` and `currentUserInitials` via the SDK utility helper `getInitials(currentUser)`.
|
|
41
|
+
2. **Derive assignments from inputs OR fetch:** compute `assignmentsSource` by checking, in order, whether `datasource` is itself an array, whether `datasource?.source` is an array, or whether `myWorkList?.source` is an array — using whichever matches first, or `null` if none do. Declare `fetchedAssignments` local state (default `[]`).
|
|
42
|
+
3. **Only fetch for WORKLIST type** — TODO type gets its data from inputs directly. In a lifecycle effect keyed on `[type, myWorkList?.datapage, context]`: when `type === CONSTS.WORKLIST`, `myWorkList?.datapage` is set, and `assignmentsSource` has no length, call `PCore.getDataPageUtils().getDataAsync(myWorkList.datapage, context || pConn.getContextName(), ...)` and store the response's `data` (or `[]`) via `setFetchedAssignments`.
|
|
43
|
+
4. Resolve the final `assignments` array: use `assignmentsSource` when it has entries, otherwise fall back to `fetchedAssignments`.
|
|
44
|
+
5. **`clickGo` — open the assignment with container options.** The assignment ID field differs by type, so define `getAssignmentId(assignment)` to return `assignment.ID` (uppercase) when `type === CONSTS.TODO`, otherwise `assignment.id` (lowercase). Then define `clickGo(assignment)`: resolve `id` via `getAssignmentId`; resolve `classname` from `assignment.classname`, falling back to `thePConn.getCaseInfo().getClassName()` when empty; resolve `sTarget` from `thePConn.getContainerName() || ''`; build `options = { containerName: sTarget || CONSTS.APP.APP, channelName: '' }`; when `sTarget === 'workarea'`, additionally set `options.isActionFromToDoList = true`, `options.target = ''`, `options.context = null`, and `options.isChild = assignment.isChild`; otherwise set `options.isActionFromToDoList = false` and `options.target = sTarget`. Call `thePConn.getActionsApi().openAssignment(id, classname, options)`, and on failure, set a snackbar error message ("Submit failed!") and show the snackbar.
|
|
45
|
+
6. **Show more/less toggle:** define `_showMore()` to clear the `bShowMore` flag (revealing the full list, either by fetching all or using the already-available full list), and `_showLess()` to set the `bShowMore` flag back to true and slice the visible assignments back down to the first 3.
|
|
46
|
+
7. **Render:** WORKLIST and TODO have DIFFERENT render structures — the two render paths described below MUST be kept separate.
|
|
98
47
|
|
|
99
48
|
> ⚠️ **CRITICAL — WORKLIST AND TODO RENDER DIFFERENTLY**
|
|
100
49
|
>
|
|
@@ -118,145 +67,22 @@ export default function ToDo(props: ToDoProps) {
|
|
|
118
67
|
|
|
119
68
|
> ⚠️ **CRITICAL — USE THE PROJECT'S DESIGN SYSTEM**
|
|
120
69
|
>
|
|
121
|
-
> Check
|
|
70
|
+
> Check the project's installed design system and use its components for the card, badge/count indicator, chevron icon, and button elements. Do NOT use plain unstyled elements when a design system is available.
|
|
122
71
|
>
|
|
123
|
-
>
|
|
124
|
-
> | --------------------- | ------------------------ | --------------------------- | ----------------------------------------- | ------------------------ |
|
|
125
|
-
> | `@carbon/react` | `Tile` | `Tag type='blue' size='sm'` | `ChevronRight` from `@carbon/react/icons` | `Button kind='ghost'` |
|
|
126
|
-
> | `@mui/material` | `Card` + `CardHeader` | `Badge` | `ArrowForwardIosOutlinedIcon` | `Button` |
|
|
127
|
-
> | `antd` | `Card` | `Badge count={N}` | `RightOutlined` | `Button type='link'` |
|
|
128
|
-
> | `@chakra-ui/react` | `Card` | `Badge` | `ChevronRightIcon` | `Button variant='ghost'` |
|
|
129
|
-
> | None / CSS-only | `<div>` with card styles | `<span>` with badge CSS | `›` character | `<button>` |
|
|
130
|
-
>
|
|
131
|
-
> ❌ **NEVER** use plain `<button>` with inline styles for assignment rows.
|
|
72
|
+
> ❌ **NEVER** use plain unstyled elements for assignment rows when a DS is available.
|
|
132
73
|
> ❌ **NEVER** use text `›` when a DS chevron icon is available.
|
|
133
74
|
|
|
134
|
-
### WORKLIST Render Path
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{showTodoList && (
|
|
142
|
-
<div className="psdk-todo-header">
|
|
143
|
-
<Avatar>{currentUserInitials}</Avatar>
|
|
144
|
-
<h4 className="psdk-todo-title">{headerText}</h4>
|
|
145
|
-
<Badge>{getCount()}</Badge> {/* Badge IMMEDIATELY next to title */}
|
|
146
|
-
</div>
|
|
147
|
-
)}
|
|
148
|
-
<List>
|
|
149
|
-
{(bShowMore ? assignments.slice(0, 3) : assignments).map((assignment) => (
|
|
150
|
-
<ListItem
|
|
151
|
-
key={getAssignmentId(assignment)}
|
|
152
|
-
onClick={() => clickGo(assignment)}
|
|
153
|
-
disabled={assignment.canPerform === false}
|
|
154
|
-
>
|
|
155
|
-
<div>
|
|
156
|
-
<strong>{getAssignmentName(assignment)}</strong>
|
|
157
|
-
<span>
|
|
158
|
-
In {assignment.name} {getDisplayId(assignment)} • {assignment.status} • Urgency{' '}
|
|
159
|
-
{getPriority(assignment)}
|
|
160
|
-
</span>
|
|
161
|
-
</div>
|
|
162
|
-
<ChevronRightIcon />
|
|
163
|
-
</ListItem>
|
|
164
|
-
))}
|
|
165
|
-
</List>
|
|
166
|
-
{getCount() > 3 &&
|
|
167
|
-
(bShowMore ? (
|
|
168
|
-
<Button onClick={handleShowMore}>Show more</Button>
|
|
169
|
-
) : (
|
|
170
|
-
<Button onClick={handleShowLess}>Show less</Button>
|
|
171
|
-
))}
|
|
172
|
-
</Card>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### TODO Render Path (complete JSX)
|
|
178
|
-
|
|
179
|
-
```tsx
|
|
180
|
-
// ─── TODO MODE (case view) ───
|
|
181
|
-
const todoContent = (
|
|
182
|
-
<>
|
|
183
|
-
{showTodoList && (
|
|
184
|
-
<div className="psdk-todo-header">
|
|
185
|
-
<h4 className="psdk-todo-title">{headerText}</h4>
|
|
186
|
-
<Badge>{assignments.length}</Badge>
|
|
187
|
-
</div>
|
|
188
|
-
)}
|
|
189
|
-
<List>
|
|
190
|
-
{assignments.map((assignment) => (
|
|
191
|
-
<ListItem
|
|
192
|
-
key={getAssignmentId(assignment)}
|
|
193
|
-
onClick={() => clickGo(assignment)}
|
|
194
|
-
disabled={assignment.canPerform === false}
|
|
195
|
-
>
|
|
196
|
-
<Avatar>{currentUserInitials}</Avatar>
|
|
197
|
-
<div>
|
|
198
|
-
<strong>{getAssignmentName(assignment)}</strong>
|
|
199
|
-
<span>
|
|
200
|
-
In {getDisplayId(assignment)} • Urgency {getPriority(assignment)}
|
|
201
|
-
</span>
|
|
202
|
-
</div>
|
|
203
|
-
{(!isConfirm || canPerform) && <ChevronRightIcon />}
|
|
204
|
-
</ListItem>
|
|
205
|
-
))}
|
|
206
|
-
{assignments.length === 0 && showTodoList && <p>You're all caught up!</p>}
|
|
207
|
-
</List>
|
|
208
|
-
</>
|
|
209
|
-
);
|
|
210
|
-
if (isConfirm) return <div>{todoContent}</div>;
|
|
211
|
-
return <Card>{todoContent}</Card>;
|
|
212
|
-
```
|
|
75
|
+
### WORKLIST Render Path
|
|
76
|
+
|
|
77
|
+
When `type === CONSTS.WORKLIST`, render a `Card` (class `psdk-todo`). When `showTodoList` is true, render a `psdk-todo-header` div containing an `Avatar` with `currentUserInitials`, an `h4` title (`psdk-todo-title`) showing `headerText`, and a `Badge` showing the total count — the badge must sit immediately next to the title. Below the header, render a `List` of the visible assignments (`bShowMore ? assignments.slice(0, 3) : assignments`), each as a `ListItem` keyed by `getAssignmentId(assignment)`, clickable via `clickGo(assignment)`, and disabled when `assignment.canPerform === false`; each item shows the assignment name in bold plus a subtitle line "In {assignment.name} {getDisplayId(assignment)} • {assignment.status} • Urgency {getPriority(assignment)}", followed by a `ChevronRightIcon`. Below the list, when the total count exceeds 3, render either a "Show more" button (when collapsed) or a "Show less" button (when expanded), wired to the corresponding toggle handlers.
|
|
78
|
+
|
|
79
|
+
### TODO Render Path
|
|
80
|
+
|
|
81
|
+
Build a `todoContent` fragment: when `showTodoList` is true, render a `psdk-todo-header` div containing only the `h4` title (`psdk-todo-title`) and a `Badge` showing `assignments.length` (no avatar in the header). Below the header, render a `List` of all `assignments`, each as a `ListItem` keyed by `getAssignmentId(assignment)`, clickable via `clickGo(assignment)`, and disabled when `assignment.canPerform === false`; each item shows an `Avatar` with `currentUserInitials`, the assignment name in bold plus a subtitle line "In {getDisplayId(assignment)} • Urgency {getPriority(assignment)}", and a `ChevronRightIcon` (hidden when `isConfirm` is true and `canPerform` is false). When there are zero assignments and `showTodoList` is true, show the text "You're all caught up!" instead. Finally: when `isConfirm` is true, render `todoContent` inside a plain `div` (no card wrapper); otherwise wrap it in a `Card`.
|
|
213
82
|
|
|
214
83
|
### Required CSS (create `ToDo.css`)
|
|
215
84
|
|
|
216
|
-
|
|
217
|
-
.psdk-todo {
|
|
218
|
-
padding: 1rem;
|
|
219
|
-
}
|
|
220
|
-
.psdk-todo-header {
|
|
221
|
-
display: flex;
|
|
222
|
-
align-items: center;
|
|
223
|
-
gap: 0.75rem;
|
|
224
|
-
margin-bottom: 1rem;
|
|
225
|
-
}
|
|
226
|
-
.psdk-todo-title {
|
|
227
|
-
margin: 0;
|
|
228
|
-
font-size: 1.125rem;
|
|
229
|
-
font-weight: 500;
|
|
230
|
-
}
|
|
231
|
-
/* Do NOT use flex: 1 on title — badge must sit immediately next to text */
|
|
232
|
-
.psdk-todo-avatar {
|
|
233
|
-
width: 36px;
|
|
234
|
-
height: 36px;
|
|
235
|
-
border-radius: 50%;
|
|
236
|
-
background: #c6c6c6;
|
|
237
|
-
display: flex;
|
|
238
|
-
align-items: center;
|
|
239
|
-
justify-content: center;
|
|
240
|
-
font-size: 0.8125rem;
|
|
241
|
-
font-weight: 600;
|
|
242
|
-
flex-shrink: 0;
|
|
243
|
-
}
|
|
244
|
-
.psdk-todo-row {
|
|
245
|
-
display: flex;
|
|
246
|
-
align-items: center;
|
|
247
|
-
gap: 0.75rem;
|
|
248
|
-
padding: 0.75rem 0;
|
|
249
|
-
border-bottom: 1px solid #e0e0e0;
|
|
250
|
-
cursor: pointer;
|
|
251
|
-
}
|
|
252
|
-
.psdk-todo-row:hover {
|
|
253
|
-
background: #f4f4f4;
|
|
254
|
-
}
|
|
255
|
-
.psdk-todo-row--disabled {
|
|
256
|
-
opacity: 0.5;
|
|
257
|
-
cursor: not-allowed;
|
|
258
|
-
}
|
|
259
|
-
```
|
|
85
|
+
Define `.psdk-todo` with `1rem` padding. Define `.psdk-todo-header` as a flex row with `0.75rem` gap and `1rem` bottom margin. Define `.psdk-todo-title` with no margin, `1.125rem` font size, and medium (500) font weight — do NOT apply `flex: 1` to it, since the badge must sit immediately next to the text. Define `.psdk-todo-avatar` as a `36px` circle (`border-radius: 50%`) with a gray background (`#c6c6c6`), centered content, `0.8125rem` font size, semi-bold (600) weight, and `flex-shrink: 0`. Define `.psdk-todo-row` as a flex row with `0.75rem` gap, `0.75rem 0` padding, a `1px solid #e0e0e0` bottom border, and a pointer cursor; on hover, give it a light gray background (`#f4f4f4`). Define a `.psdk-todo-row--disabled` modifier with `0.5` opacity and a `not-allowed` cursor.
|
|
260
86
|
|
|
261
87
|
## Behavioral Contract
|
|
262
88
|
|
|
@@ -269,17 +95,7 @@ return <Card>{todoContent}</Card>;
|
|
|
269
95
|
|
|
270
96
|
**`type === 'worklist'` (personal work):**
|
|
271
97
|
|
|
272
|
-
- Fetch from `myWorkList.datapage` (e.g., `D_WorkList`)
|
|
273
|
-
```
|
|
274
|
-
PCore.getDataPageUtils().getDataAsync(
|
|
275
|
-
myWorkList.datapage,
|
|
276
|
-
context,
|
|
277
|
-
{},
|
|
278
|
-
{ pageNumber: 1, pageSize: 50 },
|
|
279
|
-
{ select: myWorkList.fields },
|
|
280
|
-
{ invalidateCache: true }
|
|
281
|
-
)
|
|
282
|
-
```
|
|
98
|
+
- Fetch from `myWorkList.datapage` (e.g., `D_WorkList`) by calling `PCore.getDataPageUtils().getDataAsync(myWorkList.datapage, context, {}, { pageNumber: 1, pageSize: 50 }, { select: myWorkList.fields }, { invalidateCache: true })`.
|
|
283
99
|
- Map the response to assignment objects.
|
|
284
100
|
|
|
285
101
|
### Top 3 + Show More
|
|
@@ -306,28 +122,7 @@ On item click:
|
|
|
306
122
|
>
|
|
307
123
|
> Using the wrong casing will pass `undefined` and produce "assignmentID is required parameter" error.
|
|
308
124
|
|
|
309
|
-
|
|
310
|
-
const CONSTS = PCore.getConstants();
|
|
311
|
-
const getAssignmentId = (assignment) => (type === CONSTS.TODO ? assignment.ID : assignment.id);
|
|
312
|
-
|
|
313
|
-
function clickGo(assignment) {
|
|
314
|
-
const id = getAssignmentId(assignment);
|
|
315
|
-
let classname = assignment.classname || '';
|
|
316
|
-
if (!classname) classname = pConn.getCaseInfo().getClassName(); // fallback
|
|
317
|
-
const sTarget = pConn.getContainerName() || '';
|
|
318
|
-
const options: any = { containerName: sTarget || PCore.getConstants().APP.APP, channelName: '' };
|
|
319
|
-
if (sTarget === 'workarea') {
|
|
320
|
-
options.isActionFromToDoList = true;
|
|
321
|
-
options.target = '';
|
|
322
|
-
options.context = null;
|
|
323
|
-
options.isChild = assignment.isChild;
|
|
324
|
-
} else {
|
|
325
|
-
options.isActionFromToDoList = false;
|
|
326
|
-
options.target = sTarget;
|
|
327
|
-
}
|
|
328
|
-
pConn.getActionsApi().openAssignment(id, classname, options);
|
|
329
|
-
}
|
|
330
|
-
```
|
|
125
|
+
Read `CONSTS = PCore.getConstants()` and define `getAssignmentId(assignment)` to return `assignment.ID` (uppercase) when `type === CONSTS.TODO`, otherwise `assignment.id` (lowercase). Then define `clickGo(assignment)`: resolve `id` via `getAssignmentId`; resolve `classname` from `assignment.classname`, falling back to `pConn.getCaseInfo().getClassName()` when empty; resolve `sTarget` from `pConn.getContainerName() || ''`; build `options = { containerName: sTarget || PCore.getConstants().APP.APP, channelName: '' }`; when `sTarget === 'workarea'`, additionally set `options.isActionFromToDoList = true`, `options.target = ''`, `options.context = null`, and `options.isChild = assignment.isChild`; otherwise set `options.isActionFromToDoList = false` and `options.target = sTarget`. Finally call `pConn.getActionsApi().openAssignment(id, classname, options)`.
|
|
331
126
|
|
|
332
127
|
### Assignment Item Rendering
|
|
333
128
|
|
|
@@ -335,17 +130,7 @@ function clickGo(assignment) {
|
|
|
335
130
|
|
|
336
131
|
#### Helper functions (MUST include):
|
|
337
132
|
|
|
338
|
-
|
|
339
|
-
const CONSTS = PCore.getConstants();
|
|
340
|
-
const getAssignmentId = (assignment) => (type === CONSTS.TODO ? assignment.ID : assignment.id);
|
|
341
|
-
const getDisplayId = (assignment) => {
|
|
342
|
-
const refKey = assignment.value || assignment.ID || assignment.id || '';
|
|
343
|
-
if (assignment.value) return refKey.substring(refKey.lastIndexOf(' ') + 1);
|
|
344
|
-
const parts = refKey.split('!')[0]?.split(' ');
|
|
345
|
-
return parts?.[2] || parts?.[parts.length - 1] || refKey;
|
|
346
|
-
};
|
|
347
|
-
const getPriority = (assignment) => (type === CONSTS.TODO ? assignment.urgency : assignment.priority);
|
|
348
|
-
```
|
|
133
|
+
Read `CONSTS = PCore.getConstants()`. Define `getAssignmentId(assignment)` to return `assignment.ID` (uppercase) when `type === CONSTS.TODO`, otherwise `assignment.id` (lowercase). Define `getDisplayId(assignment)`: resolve `refKey` from `assignment.value || assignment.ID || assignment.id || ''`; when `assignment.value` is present, return the substring of `refKey` after its last space; otherwise split `refKey` on `'!'` and take the first segment, split that on spaces into `parts`, and return `parts[2]` if present, else the last element of `parts`, else `refKey` itself. Define `getPriority(assignment)` to return `assignment.urgency` when `type === CONSTS.TODO`, otherwise `assignment.priority`.
|
|
349
134
|
|
|
350
135
|
#### Data source:
|
|
351
136
|
|
|
@@ -385,7 +170,7 @@ Use prop data directly when available (`assignmentsSource`), only fetch for WORK
|
|
|
385
170
|
|
|
386
171
|
### Responsive Layout
|
|
387
172
|
|
|
388
|
-
Use
|
|
173
|
+
Use the DS's responsive breakpoint utility or a CSS media query to detect mobile:
|
|
389
174
|
|
|
390
175
|
- **Desktop:** Show avatar, name, status, priority, and arrow in a horizontal row.
|
|
391
176
|
- **Mobile:** Stack or truncate elements for narrow display.
|
|
@@ -402,16 +187,7 @@ If an assignment has `canPerform === false`, render it as non-clickable (greyed
|
|
|
402
187
|
|
|
403
188
|
### Operator Avatar Initials
|
|
404
189
|
|
|
405
|
-
Extract initials from `PCore.getEnvironmentInfo().getOperatorName()`:
|
|
406
|
-
|
|
407
|
-
```typescript
|
|
408
|
-
const initials = operatorName
|
|
409
|
-
.split(' ')
|
|
410
|
-
.map((w) => w[0])
|
|
411
|
-
.join('')
|
|
412
|
-
.substring(0, 2)
|
|
413
|
-
.toUpperCase();
|
|
414
|
-
```
|
|
190
|
+
Extract initials from `PCore.getEnvironmentInfo().getOperatorName()`: split the operator name on spaces, take the first character of each word, join them together, take the first 2 characters, and uppercase the result.
|
|
415
191
|
|
|
416
192
|
## Visual Specifications
|
|
417
193
|
|
|
@@ -462,31 +238,24 @@ const initials = operatorName
|
|
|
462
238
|
- `PCore.getConstants()` — CASE_INFO, WORK_BASKET, TODO, APP constants
|
|
463
239
|
- `PCore.getLocaleUtils()` — assignment label localization
|
|
464
240
|
- `pConn.getActionsApi().openAssignment()` — opens the selected assignment
|
|
465
|
-
-
|
|
466
|
-
-
|
|
241
|
+
- The DS's card, avatar, badge, list, button, snackbar/toast, and icon components.
|
|
242
|
+
- The DS's responsive breakpoint utility or CSS media queries for mobile detection.
|
|
467
243
|
|
|
468
244
|
## Design System Mapping
|
|
469
245
|
|
|
470
246
|
**UI control type:** Assignment worklist widget with expand/collapse, click-to-open, badge count, and error toast.
|
|
471
247
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
| Design System | Card | List | Badge | Snackbar |
|
|
475
|
-
| ------------------ | ------------------------- | ------------------- | ------------------- | ----------------------------- |
|
|
476
|
-
| Default (CSS only) | `<div>` card | `<ul>/<li>` | CSS counter badge | Custom toast overlay |
|
|
477
|
-
| MUI | `<Card>` + `<CardHeader>` | `<List>/<ListItem>` | `<Badge>` | `<Snackbar>/<Alert>` |
|
|
478
|
-
| Ant Design | `<Card>` | `<List>` | `<Badge count={N}>` | `message.error()` |
|
|
479
|
-
| Chakra UI | `<Card>` | `<VStack>` | `<Badge>` | `useToast()` |
|
|
480
|
-
| Shadcn/ui | `<Card>` | `<ul>/<li>` | Custom badge | `<Toaster>` + `toast.error()` |
|
|
481
|
-
|
|
482
|
-
When implementing in a specific design system:
|
|
248
|
+
When implementing in a specific design system, map the following:
|
|
483
249
|
|
|
484
|
-
- **
|
|
485
|
-
-
|
|
250
|
+
- **Card** → use the DS's card component for the widget container
|
|
251
|
+
- **List** → use the DS's list or vertical stack component for assignment rows
|
|
252
|
+
- **Badge** → use the DS's badge/count indicator component next to the title
|
|
253
|
+
- **Snackbar/toast** → use the DS's notification/toast component for error messages
|
|
254
|
+
- **Avatar** → use the DS's avatar component (or a styled circle with initials)
|
|
255
|
+
- **Chevron icon** → use the DS's right-pointing arrow/chevron icon (not text `›`)
|
|
486
256
|
- **WORKLIST and TODO MUST have separate render paths** — they have different header layouts and subtitle formats
|
|
487
257
|
- **Badge/count MUST sit immediately next to the title** — do NOT use `flex: 1` on the title or push badge to far right
|
|
488
258
|
- Show top 3 items by default — `bShowMore ? assignments.slice(0, 3) : assignments` controls the slice
|
|
489
|
-
- Use the DS's chevron/arrow icon (not text `›`) for the row action indicator
|
|
490
259
|
- `canPerform === false` must make the row non-clickable — check this before calling `openAssignment`
|
|
491
260
|
- `type === 'worklist'` fetches from a data page; `type === 'todo'` uses the `datasource` prop — both paths must be implemented
|
|
492
261
|
- Operator initials for the avatar must be derived from `PCore.getEnvironmentInfo().getOperatorName()`
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@mui/material": "^9.2.0",
|
|
17
17
|
"@mui/styles": "^6.5.0",
|
|
18
18
|
"@mui/x-date-pickers": "^9.9.0",
|
|
19
|
-
"@pega/auth": "file:pega-auth-0.2.
|
|
19
|
+
"@pega/auth": "file:pega-auth-0.2.44.tgz",
|
|
20
20
|
"@pega/constellationjs": "file:pega-constellationjs-0.26.3-local.tgz",
|
|
21
21
|
"@pega/sdk-react": "file:pega-sdk-react-0.1.0.tgz",
|
|
22
22
|
"@pega/sdk-types": "file:pega-sdk-types-0.1.0.tgz",
|
|
Binary file
|
|
Binary file
|