@pega/sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/index.js +764 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
|
@@ -1,49 +1,20 @@
|
|
|
1
1
|
# Skill: Widget Components
|
|
2
2
|
|
|
3
|
-
Create or replace widget components in the
|
|
3
|
+
Create or replace widget components in the project. Widgets are self-contained UI blocks that fetch their own data from Pega APIs (data pages, case info) and render interactive features (ToDo lists, attachments, case history, etc.).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Architecture Overview
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
src/components/widget/<ComponentName>/
|
|
11
|
-
├── <ComponentName>.tsx # Component implementation
|
|
12
|
-
├── index.tsx # Re-export (if present)
|
|
13
|
-
├── <ComponentName>.css # Styles (optional)
|
|
14
|
-
├── <ComponentName>Utils.ts # Widget-specific utilities (optional)
|
|
15
|
-
├── <ComponentName>.types.ts # Type definitions (optional)
|
|
16
|
-
└── config-ext.json # Metadata (optional)
|
|
17
|
-
```
|
|
9
|
+
Each widget lives in its own folder under the project's widget components directory, named after the component. The folder typically contains: the component implementation file; optionally a re-export module; optionally a companion stylesheet; optionally a widget-specific utilities module; optionally a types definition module; and optionally a metadata file.
|
|
18
10
|
|
|
19
11
|
---
|
|
20
12
|
|
|
21
|
-
##
|
|
13
|
+
## Input Contract
|
|
22
14
|
|
|
23
|
-
Widget components extend `
|
|
15
|
+
Widget components extend the project's **base component interface** (which provides `getPConnect`). A typical widget input contract adds widget-specific inputs provided by the platform, such as `datasource`, `headerText`, and `context`.
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
import type { PConnProps } from '../../../types/PConnProps';
|
|
27
|
-
|
|
28
|
-
interface MyWidgetProps extends PConnProps {
|
|
29
|
-
// Widget-specific props provided by the platform
|
|
30
|
-
datasource?: any;
|
|
31
|
-
headerText?: string;
|
|
32
|
-
context?: string;
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Some widgets extend `PConnFieldProps` when they behave like form fields (e.g., Attachment):
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
import type { PConnFieldProps } from '../../../types/PConnProps';
|
|
40
|
-
|
|
41
|
-
interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
|
|
42
|
-
value: any; // Attachment list (not a string)
|
|
43
|
-
allowMultiple: boolean;
|
|
44
|
-
extensions: string;
|
|
45
|
-
}
|
|
46
|
-
```
|
|
17
|
+
Some widgets extend the project's **field input contract** when they behave like form fields (e.g., Attachment): the Attachment input contract overrides `value` to be `any` (an attachment list rather than a string), and adds `allowMultiple` and `extensions`.
|
|
47
18
|
|
|
48
19
|
---
|
|
49
20
|
|
|
@@ -51,114 +22,47 @@ interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
51
22
|
|
|
52
23
|
### Data-Fetching Widget
|
|
53
24
|
|
|
54
|
-
Widgets typically fetch data from Pega data pages on mount. This pattern is design-system agnostic. The
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
datasource?: any;
|
|
65
|
-
headerText?: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default function MyWidget(props: MyWidgetProps) {
|
|
69
|
-
const { getPConnect, datasource, headerText = 'My Widget' } = props;
|
|
70
|
-
const pConn = getPConnect();
|
|
71
|
-
|
|
72
|
-
const [data, setData] = useState<any[]>([]);
|
|
73
|
-
const [loading, setLoading] = useState(true);
|
|
74
|
-
|
|
75
|
-
// 1. Fetch data from a Pega data page on mount
|
|
76
|
-
// This block is always the same regardless of design system
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
const context = pConn.getContextName();
|
|
79
|
-
PCore.getDataPageUtils()
|
|
80
|
-
.getDataAsync(
|
|
81
|
-
datasource?.source, // Data page name (e.g., 'D_WorkList')
|
|
82
|
-
context,
|
|
83
|
-
{}, // Parameters
|
|
84
|
-
{ pageNumber: 1, pageSize: 10 },
|
|
85
|
-
{ select: [{ field: 'pyID' }, { field: 'pyLabel' }] },
|
|
86
|
-
{ invalidateCache: true }
|
|
87
|
-
)
|
|
88
|
-
.then(response => {
|
|
89
|
-
setData(Array.isArray(response?.data) ? response.data : []);
|
|
90
|
-
setLoading(false);
|
|
91
|
-
})
|
|
92
|
-
.catch(() => setLoading(false));
|
|
93
|
-
}, []);
|
|
94
|
-
|
|
95
|
-
// 2. Loading state — replace with your DS loading indicator if available
|
|
96
|
-
if (loading) return <div>Loading...</div>;
|
|
97
|
-
|
|
98
|
-
// 3. [DS RENDER] — replace with your design system's card/list/table primitives
|
|
99
|
-
// See "Design System Adaptation" section below for guidance
|
|
100
|
-
return (
|
|
101
|
-
<YourDesignSystemCard>
|
|
102
|
-
<YourDesignSystemCardHeader title={headerText} />
|
|
103
|
-
<YourDesignSystemCardContent>
|
|
104
|
-
<YourDesignSystemList>
|
|
105
|
-
{data.map((item, i) => (
|
|
106
|
-
<YourDesignSystemListItem key={i}>{item.pyLabel}</YourDesignSystemListItem>
|
|
107
|
-
))}
|
|
108
|
-
</YourDesignSystemList>
|
|
109
|
-
</YourDesignSystemCardContent>
|
|
110
|
-
</YourDesignSystemCard>
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
```
|
|
25
|
+
Widgets typically fetch data from Pega data pages on mount. This pattern is design-system agnostic. The design-system render section must be replaced with your design system's presentation primitives (card, list, table, etc.) — see "Design System Adaptation" below.
|
|
26
|
+
|
|
27
|
+
**Module Setup:** The component depends on local state management and a lifecycle effect for data fetching, plus the design system's presentation components (card, list, etc.). Define the input contract as an extension of the project's base component interface with `datasource` and `headerText` fields.
|
|
28
|
+
|
|
29
|
+
**Main Component Logic** — steps in order:
|
|
30
|
+
|
|
31
|
+
1. Receive `getPConnect`, `datasource`, and `headerText` (default `'My Widget'`) from inputs; call `getPConnect()` into `pConn`. Declare `data` local state (array, default empty) and `loading` local state (boolean, default `true`).
|
|
32
|
+
2. **Fetch data from a Pega data page on mount** — this block is always the same regardless of design system. In a lifecycle effect that runs once on initialization: resolve `context` via `pConn.getContextName()`; call `PCore.getDataPageUtils().getDataAsync(datasource?.source, context, {}, { pageNumber: 1, pageSize: 10 }, { select: [{ field: 'pyID' }, { field: 'pyLabel' }] }, { invalidateCache: true })` — where `datasource?.source` is the data page name (e.g. `'D_WorkList'`); on success, set `data` to `response?.data` when it is an array (otherwise an empty array) and set `loading` to `false`; on failure, just set `loading` to `false`.
|
|
33
|
+
3. **Loading state** — while `loading` is true, render a simple loading placeholder (replace with the design system's loading indicator if available).
|
|
34
|
+
4. **Design-system render** — once loaded, render the design system's card/list primitives: a card with a header showing `headerText`, and inside the card content, a list where each `data` item (keyed by index) renders `item.pyLabel`. See "Design System Adaptation" below for guidance on choosing the actual DS components.
|
|
114
35
|
|
|
115
36
|
---
|
|
116
37
|
|
|
117
38
|
## Design System Adaptation
|
|
118
39
|
|
|
119
|
-
The PCore data-fetching logic (all `PCore.*` calls) is always identical regardless of design system. Only the
|
|
40
|
+
The PCore data-fetching logic (all `PCore.*` calls) is always identical regardless of design system. Only the design-system render section changes.
|
|
120
41
|
|
|
121
|
-
**1. Check the component-specific skill file** — `{{SKILL_DIR}}/widget-skills/<ComponentName>.md` contains a **Design System Mapping**
|
|
42
|
+
**1. Check the component-specific skill file** — `{{SKILL_DIR}}/widget-skills/<ComponentName>.md` contains a **Design System Mapping** section where available. Use it as a starting point.
|
|
122
43
|
|
|
123
|
-
**2. If the chosen design system is not
|
|
44
|
+
**2. If the chosen design system is not covered** — use the component purpose description to identify the appropriate DS primitives (card, list, table, button, badge, etc.).
|
|
124
45
|
|
|
125
|
-
**3. Discover the API from installed packages** — confirm component names and
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
find node_modules/<ds-package> -name "*.d.ts" | xargs grep -l "Card\|List\|Table" | head -5
|
|
129
|
-
grep -A 30 "interface.*Props" <path-to-file>
|
|
130
|
-
```
|
|
46
|
+
**3. Discover the API from installed packages** — confirm component names and inputs from the design system's type declaration files before writing the render markup.
|
|
131
47
|
|
|
132
48
|
**4. Common widget UI primitive mapping:**
|
|
133
49
|
|
|
134
50
|
| Widget pattern | Typical DS equivalent |
|
|
135
51
|
| -------------------- | ----------------------------------------------- |
|
|
136
|
-
| Container with title |
|
|
137
|
-
| Item list |
|
|
138
|
-
| Loading indicator |
|
|
139
|
-
| Action button |
|
|
140
|
-
| Status badge |
|
|
141
|
-
| Empty state | DS empty/placeholder component or plain
|
|
52
|
+
| Container with title | Card + header/title, or Panel, Box |
|
|
53
|
+
| Item list | List, or Table rows |
|
|
54
|
+
| Loading indicator | Spinner, Skeleton, Loading |
|
|
55
|
+
| Action button | Button with click handler |
|
|
56
|
+
| Status badge | Badge, Tag, Chip |
|
|
57
|
+
| Empty state | DS empty/placeholder component or plain element |
|
|
142
58
|
|
|
143
|
-
**5. Icons** — if the DS has a companion icon package,
|
|
59
|
+
**5. Icons** — if the DS has a companion icon package, check its exports before using any icon name. Never guess icon names.
|
|
144
60
|
|
|
145
61
|
---
|
|
146
62
|
|
|
147
63
|
### Action Widget (opens assignments/cases)
|
|
148
64
|
|
|
149
|
-
|
|
150
|
-
function openAssignment(assignment) {
|
|
151
|
-
const { classname, ID } = assignment;
|
|
152
|
-
const context = getPConnect().getContextName();
|
|
153
|
-
const options = { containerName: 'primary', channelName: '' };
|
|
154
|
-
|
|
155
|
-
PCore.getMashupApi().openAssignment(ID, classname, options);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function createCase(caseType) {
|
|
159
|
-
PCore.getMashupApi().createCase(caseType, PCore.getConstants().APP.APP);
|
|
160
|
-
}
|
|
161
|
-
```
|
|
65
|
+
Define `openAssignment(assignment)`: resolve `classname` and `ID` from `assignment`; resolve `context` via `getPConnect().getContextName()`; build `options = { containerName: 'primary', channelName: '' }`; then call `PCore.getMashupApi().openAssignment(ID, classname, options)`. Define `createCase(caseType)` to call `PCore.getMashupApi().createCase(caseType, PCore.getConstants().APP.APP)`.
|
|
162
66
|
|
|
163
67
|
---
|
|
164
68
|
|
|
@@ -166,69 +70,29 @@ function createCase(caseType) {
|
|
|
166
70
|
|
|
167
71
|
### Data Pages
|
|
168
72
|
|
|
169
|
-
|
|
170
|
-
// Fetch list data
|
|
171
|
-
PCore.getDataPageUtils().getDataAsync(dataPageName, context, params, paging, query, options);
|
|
172
|
-
|
|
173
|
-
// Get page data (single record)
|
|
174
|
-
PCore.getDataPageUtils().getPageDataAsync(dataPageName, context, params);
|
|
175
|
-
```
|
|
73
|
+
Fetch list data via `PCore.getDataPageUtils().getDataAsync(dataPageName, context, params, paging, query, options)`. Get a single-record page via `PCore.getDataPageUtils().getPageDataAsync(dataPageName, context, params)`.
|
|
176
74
|
|
|
177
75
|
### Case Info
|
|
178
76
|
|
|
179
|
-
|
|
180
|
-
const pConn = getPConnect();
|
|
181
|
-
const caseKey = pConn.getCaseInfo().getKey();
|
|
182
|
-
const caseID = pConn.getCaseInfo().getID();
|
|
183
|
-
const caseName = pConn.getCaseInfo().getName();
|
|
184
|
-
```
|
|
77
|
+
Call `getPConnect()` into `pConn`, then read `pConn.getCaseInfo().getKey()` for the case key, `pConn.getCaseInfo().getID()` for the case ID, and `pConn.getCaseInfo().getName()` for the case name.
|
|
185
78
|
|
|
186
79
|
### Attachments
|
|
187
80
|
|
|
188
|
-
|
|
189
|
-
PCore.getAttachmentUtils().prepareAttachmentData(value);
|
|
190
|
-
PCore.getAttachmentUtils().uploadAttachment(file, onProgress, errorHandler, context);
|
|
191
|
-
PCore.getAttachmentUtils().downloadAttachment(attachmentID, context);
|
|
192
|
-
```
|
|
81
|
+
Use `PCore.getAttachmentUtils().prepareAttachmentData(value)` to prepare attachment data, `PCore.getAttachmentUtils().uploadAttachment(file, onProgress, errorHandler, context)` to upload, and `PCore.getAttachmentUtils().downloadAttachment(attachmentID, context)` to download.
|
|
193
82
|
|
|
194
83
|
### Actions
|
|
195
84
|
|
|
196
|
-
|
|
197
|
-
const actionsApi = pConn.getActionsApi();
|
|
198
|
-
actionsApi.updateFieldValue(propName, value);
|
|
199
|
-
actionsApi.triggerFieldChange(propName, value);
|
|
200
|
-
actionsApi.openLocalAction(actionName, options);
|
|
201
|
-
```
|
|
85
|
+
Resolve `actionsApi` via `pConn.getActionsApi()`, then use `actionsApi.updateFieldValue(propName, value)` to update a field's value, `actionsApi.triggerFieldChange(propName, value)` to trigger a field change event, and `actionsApi.openLocalAction(actionName, options)` to open a local action.
|
|
202
86
|
|
|
203
87
|
### Container Management
|
|
204
88
|
|
|
205
|
-
|
|
206
|
-
const containerManager = pConn.getContainerManager();
|
|
207
|
-
containerManager.addContainerItem({
|
|
208
|
-
semanticURL,
|
|
209
|
-
key,
|
|
210
|
-
flowName,
|
|
211
|
-
caseViewMode,
|
|
212
|
-
resourceType,
|
|
213
|
-
data,
|
|
214
|
-
});
|
|
215
|
-
```
|
|
89
|
+
Resolve `containerManager` via `pConn.getContainerManager()`, then call `containerManager.addContainerItem({ semanticURL, key, flowName, caseViewMode, resourceType, data })` to add a container item.
|
|
216
90
|
|
|
217
91
|
---
|
|
218
92
|
|
|
219
93
|
## Registration
|
|
220
94
|
|
|
221
|
-
Register widgets in
|
|
222
|
-
|
|
223
|
-
```typescript
|
|
224
|
-
import MyWidget from './widget/MyWidget';
|
|
225
|
-
|
|
226
|
-
// In getSampleComponentMap():
|
|
227
|
-
{
|
|
228
|
-
...sdkComponents,
|
|
229
|
-
MyWidget, // Key must match the Pega component name
|
|
230
|
-
}
|
|
231
|
-
```
|
|
95
|
+
Register widgets in the project's component map: import the widget's default export from its folder under the widget components directory, then add it to the object returned by the project's component registration function. The key must match the Pega component name.
|
|
232
96
|
|
|
233
97
|
---
|
|
234
98
|
|
|
@@ -242,19 +106,19 @@ import MyWidget from './widget/MyWidget';
|
|
|
242
106
|
| FileUtility | File management utility | `PCore.getAttachmentUtils()` |
|
|
243
107
|
| Followers | Case followers list | `PCore.getDataPageUtils()` |
|
|
244
108
|
| QuickCreate | Quick case creation buttons | `PCore.getMashupApi().createCase()` |
|
|
245
|
-
| SummaryItem | Single summary card |
|
|
246
|
-
| SummaryList | List of summary cards |
|
|
109
|
+
| SummaryItem | Single summary card | Inputs from parent |
|
|
110
|
+
| SummaryList | List of summary cards | Inputs from parent |
|
|
247
111
|
| ToDo | Assignment worklist | `PCore.getDataPageUtils()`, `PCore.getMashupApi().openAssignment()` |
|
|
248
112
|
|
|
249
113
|
---
|
|
250
114
|
|
|
251
115
|
## Key Conventions
|
|
252
116
|
|
|
253
|
-
1. **Default export** —
|
|
117
|
+
1. **Default export** — Each component is exported as the module's default export.
|
|
254
118
|
2. **Self-contained data** — Widgets fetch their own data (don't rely on parent passing data down).
|
|
255
119
|
3. **Loading states** — Always handle loading/error states when fetching data.
|
|
256
|
-
4. **PCore globals** — Access `PCore` directly (declared globally by
|
|
120
|
+
4. **PCore globals** — Access `PCore` directly (declared globally by the Pega runtime type definitions).
|
|
257
121
|
5. **Localization** — Use `pConn.getLocalizationService()` for translated strings when available.
|
|
258
122
|
6. **Context** — Use `pConn.getContextName()` as the context parameter for data page calls.
|
|
259
|
-
7. **Card layout** — Widgets typically render inside
|
|
123
|
+
7. **Card layout** — Widgets typically render inside the design system's card component with a header and content area.
|
|
260
124
|
8. **Action handling** — Use `PCore.getMashupApi()` for case/assignment operations, `actionsApi` for field updates.
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Card-based announcement widget. Displays a system-wide or application announcement with an optional bullet list of items and a "See what's new" external link button.
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture,
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, inputs interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Component Purpose
|
|
10
10
|
|
|
11
|
-
Renders an announcement card with a heading, description text, optional bullet list of items sourced from a `datasource`
|
|
11
|
+
Renders an announcement card with a heading, description text, optional bullet list of items sourced from a `datasource` input, and an optional external link button. Styled with a left accent border to visually distinguish it from other cards.
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `AppAnnouncement` (in
|
|
15
|
+
- **Registration key:** `AppAnnouncement` (registered in the project's component map)
|
|
16
16
|
- **Category:** Widget — informational display
|
|
17
|
-
- **Extends:**
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs
|
|
20
20
|
|
|
21
|
-
|
|
|
21
|
+
| Input | Type | Required | Description |
|
|
22
22
|
| -------------- | ---------- | -------- | ---------------------------------------------------------------------- |
|
|
23
23
|
| `header` | `string` | No | Announcement card title |
|
|
24
24
|
| `description` | `string` | No | Announcement body text |
|
|
@@ -26,49 +26,22 @@ Renders an announcement card with a heading, description text, optional bullet l
|
|
|
26
26
|
| `whatsnewlink` | `string` | No | URL for the "See what's new" button; if absent, button is not rendered |
|
|
27
27
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
28
28
|
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
whatsnewlink?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default function AppAnnouncement(props: AppAnnouncementProps) {
|
|
42
|
-
const { header = '', description = '', datasource = [], whatsnewlink = '' } = props;
|
|
43
|
-
|
|
44
|
-
// 1. Extract item names from datasource
|
|
45
|
-
const details = datasource?.source?.map(item => item.name) || [];
|
|
46
|
-
|
|
47
|
-
// 2. Render: Card with left accent border + vertical margin for sibling spacing
|
|
48
|
-
// ⚠️ margin '0.5rem 0' is REQUIRED — without it the card has no top spacing
|
|
49
|
-
return (
|
|
50
|
-
<Card style={{ borderLeft: '6px solid var(--app-primary-light-color)', margin: '0.5rem 0' }}>
|
|
51
|
-
<CardHeader><h6>{header}</h6></CardHeader>
|
|
52
|
-
<CardContent>
|
|
53
|
-
<p>{description}</p>
|
|
54
|
-
{details.map((itm, idx) => <p key={idx}>- {itm}</p>)}
|
|
55
|
-
</CardContent>
|
|
56
|
-
{whatsnewlink && (
|
|
57
|
-
<CardActions>
|
|
58
|
-
<Button onClick={() => window.open(whatsnewlink, '_blank')}>See what's new</Button>
|
|
59
|
-
</CardActions>
|
|
60
|
-
)}
|
|
61
|
-
</Card>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
```
|
|
29
|
+
## Implementation Structure
|
|
30
|
+
|
|
31
|
+
**Module Setup:** The component's inputs interface extends the project's base component interface with optional `header` (string), `description` (string), `datasource` (any), and `whatsnewlink` (string).
|
|
32
|
+
|
|
33
|
+
**Main Component Logic** — steps in order:
|
|
34
|
+
|
|
35
|
+
1. Receive `header`, `description`, `datasource`, and `whatsnewlink` from inputs, each defaulting to an empty string (`datasource` defaulting to an empty array).
|
|
36
|
+
2. Extract item names from `datasource`: map `datasource?.source` to an array of each item's `name` property, defaulting to an empty array when `datasource.source` is absent.
|
|
37
|
+
3. Render a card with a left accent border (6px solid, using the primary light color token) and vertical margin (`0.5rem 0` top/bottom) so the card has proper spacing from sibling elements — this margin is required, without it the card has no top spacing. Inside, render a card header containing the `header` text as a heading, followed by a card content block containing the `description` paragraph and one paragraph per extracted item name (prefixed with a dash). When `whatsnewlink` is non-empty, render a card actions block with a button labeled "See what's new" that opens `whatsnewlink` in a new browser tab on click.
|
|
65
38
|
|
|
66
39
|
## Behavioral Contract
|
|
67
40
|
|
|
68
41
|
1. **Item list extraction:** If `datasource` is provided and `datasource.source` is a non-empty array, extract item names and render them as a bullet list. Each array item is expected to have a `name` property.
|
|
69
42
|
2. **Button:** If `whatsnewlink` is non-empty, render a button labeled `"See what's new"` (or localized equivalent). On click, open the URL in a new browser tab (`window.open(whatsnewlink, '_blank')`).
|
|
70
43
|
3. **Description:** Render the `description` string as plain text below the header.
|
|
71
|
-
4. **No data fetching:** This widget is purely
|
|
44
|
+
4. **No data fetching:** This widget is purely input-driven — it does not call any PCore data APIs.
|
|
72
45
|
|
|
73
46
|
## Visual Specifications
|
|
74
47
|
|
|
@@ -77,7 +50,7 @@ export default function AppAnnouncement(props: AppAnnouncementProps) {
|
|
|
77
50
|
| Element | Position |
|
|
78
51
|
| ----------------------- | --------------------------------------- |
|
|
79
52
|
| Left accent border | 6px solid, primary light color |
|
|
80
|
-
| Card header | `header`
|
|
53
|
+
| Card header | `header` input as title |
|
|
81
54
|
| Card content | Description text + optional bullet list |
|
|
82
55
|
| "See what's new" button | Below description / bullet list |
|
|
83
56
|
|
|
@@ -91,31 +64,31 @@ export default function AppAnnouncement(props: AppAnnouncementProps) {
|
|
|
91
64
|
|
|
92
65
|
## Edge Cases & Special Logic
|
|
93
66
|
|
|
94
|
-
- `datasource` may be `undefined` or `datasource.source` may be an empty array — in both cases, render no bullet list
|
|
67
|
+
- `datasource` may be `undefined` or `datasource.source` may be an empty array — in both cases, render no bullet list.
|
|
95
68
|
- `whatsnewlink` may be an empty string — treat the same as absent (no button rendered).
|
|
96
69
|
- `header` and `description` may both be absent — render the card with empty/placeholder content without crashing.
|
|
97
70
|
- Item objects in `datasource.source` are expected to have `name` — guard against items where `name` is `undefined`.
|
|
98
71
|
|
|
99
72
|
## Dependencies
|
|
100
73
|
|
|
101
|
-
-
|
|
74
|
+
- The design system's card component (with header, content, and actions regions)
|
|
75
|
+
- The design system's typography component
|
|
76
|
+
- The design system's button component
|
|
102
77
|
|
|
103
78
|
## Design System Mapping
|
|
104
79
|
|
|
105
80
|
**UI control type:** Announcement / informational card with bullet list and external link.
|
|
106
81
|
|
|
107
|
-
|
|
82
|
+
When implementing in a specific design system, map the following:
|
|
108
83
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
| Chakra UI | `<Card>` + `<CardHeader>` + `<CardBody>` | `<UnorderedList>/<ListItem>` | `<Button>` |
|
|
115
|
-
| Shadcn/ui | `<Card>` + `<CardHeader>` + `<CardContent>` | `<ul>/<li>` | `<Button>` |
|
|
84
|
+
- **Card container:** A card component with distinct header, content, and footer/actions regions. Apply a 6px solid left accent border using the primary light color token — this is the key visual identifier.
|
|
85
|
+
- **Card header:** Renders the `header` text as a heading-level element (typically h6 weight).
|
|
86
|
+
- **Card content:** Contains the `description` as body text, followed by the optional bullet list (one item per line, prefixed with a dash or rendered as a standard unordered list).
|
|
87
|
+
- **Card actions / footer:** Contains the "See what's new" button. This button must open the URL in a new tab with appropriate security attributes.
|
|
88
|
+
- **Button:** A primary-colored text or outlined button with no text transformation (no uppercase).
|
|
116
89
|
|
|
117
|
-
|
|
90
|
+
Implementation notes:
|
|
118
91
|
|
|
119
92
|
- Left accent border is a key visual identifier — implement it via CSS or the design system's border utilities
|
|
120
|
-
- "See what's new" must open in a new tab
|
|
121
|
-
- The widget is entirely
|
|
93
|
+
- "See what's new" must open in a new tab with `rel='noopener noreferrer'`
|
|
94
|
+
- The widget is entirely input-driven — no data fetching needed
|