@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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
2
|
+
import { router } from 'expo-router';
|
|
3
|
+
import { LogBox, StyleSheet, View } from 'react-native';
|
|
4
|
+
import { Button } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
import { useLoader } from '@/context/LoaderContext';
|
|
7
|
+
import { authenticate } from '@/utils/auth';
|
|
8
|
+
import { initializePCore } from '@/utils/init-pcore';
|
|
9
|
+
|
|
10
|
+
// load polyfills before the constellation core js for React Native
|
|
11
|
+
import '@/utils/pcore-polyfills';
|
|
12
|
+
import '@pega/constellationjs/dist/constellation-core-react-native.js';
|
|
13
|
+
|
|
14
|
+
// ignore all logs notifications
|
|
15
|
+
LogBox.ignoreAllLogs();
|
|
16
|
+
|
|
17
|
+
export default function Index() {
|
|
18
|
+
const { showLoader, hideLoader } = useLoader();
|
|
19
|
+
|
|
20
|
+
const handleLogin = async () => {
|
|
21
|
+
showLoader();
|
|
22
|
+
try {
|
|
23
|
+
// Authenticate the user and get token info
|
|
24
|
+
const tokenInfo = await authenticate();
|
|
25
|
+
|
|
26
|
+
if (!tokenInfo) {
|
|
27
|
+
console.error('Authentication failed: No token info received');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Initialize PCore with the token info
|
|
31
|
+
await initializePCore(tokenInfo);
|
|
32
|
+
|
|
33
|
+
console.log('PCore initialized successfully');
|
|
34
|
+
|
|
35
|
+
// Navigate to the home screen after successful authentication
|
|
36
|
+
router.push('/home');
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error('Authentication error:', error);
|
|
39
|
+
} finally {
|
|
40
|
+
hideLoader();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View
|
|
46
|
+
style={{
|
|
47
|
+
flex: 1,
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<LinearGradient
|
|
53
|
+
// Background Linear Gradient
|
|
54
|
+
colors={['#3A53E9', '#0043C8', '#01153E']}
|
|
55
|
+
style={styles.background}
|
|
56
|
+
/>
|
|
57
|
+
<Button mode="outlined" textColor="#fff" onPress={handleLogin}>
|
|
58
|
+
Login
|
|
59
|
+
</Button>
|
|
60
|
+
</View>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const styles = StyleSheet.create({
|
|
65
|
+
background: {
|
|
66
|
+
position: 'absolute',
|
|
67
|
+
left: 0,
|
|
68
|
+
right: 0,
|
|
69
|
+
top: 0,
|
|
70
|
+
height: '100%',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { PaperProvider, Provider, MD3LightTheme } from 'react-native-paper';
|
|
5
|
+
import { router } from 'expo-router';
|
|
6
|
+
|
|
7
|
+
import { registerComponentCreator } from '@pega/sdk-react';
|
|
8
|
+
import { registerComponents } from '@/sdk-pega-component-map';
|
|
9
|
+
import ResolutionScreen from '@/mediaco/ResolutionScreen';
|
|
10
|
+
import RootComponent from '@/bridge/RootComponent';
|
|
11
|
+
import { useLoader } from '@/context/LoaderContext';
|
|
12
|
+
// MIGRATED: ../sdk-config.json -> ../../sdk-config.json after moving routes to src/app/*
|
|
13
|
+
import * as SDK_Config from '../../sdk-config.json';
|
|
14
|
+
|
|
15
|
+
// Paper theme that renders form field backgrounds as transparent.
|
|
16
|
+
// Outlined TextInputs use `colors.background` for their fill color.
|
|
17
|
+
const transparentFieldTheme = {
|
|
18
|
+
...MD3LightTheme,
|
|
19
|
+
colors: {
|
|
20
|
+
...MD3LightTheme.colors,
|
|
21
|
+
background: 'transparent',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// ===== WorkArea Component - Main workspace screen for rendering Pega assignments/portals =====
|
|
26
|
+
export default function WorkArea() {
|
|
27
|
+
const { showLoader, hideLoader, loading } = useLoader();
|
|
28
|
+
const [rootProps, setRootProps] = useState<{
|
|
29
|
+
getPConnect: () => typeof PConnect;
|
|
30
|
+
} | null>(null);
|
|
31
|
+
const [showResolution, setShowResolution] = useState(false);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
// Wire up sdk-react bridge before starting container rendering
|
|
35
|
+
try {
|
|
36
|
+
// @ts-ignore - getSdkCore() is available at runtime from constellationjs
|
|
37
|
+
const { createComponentRegistry } = PCore.getInitialiser().getSdkCore();
|
|
38
|
+
const registry = createComponentRegistry();
|
|
39
|
+
registerComponents(registry);
|
|
40
|
+
registerComponentCreator(registry); // calls PCore.registerComponentCreator internally
|
|
41
|
+
|
|
42
|
+
const renderObj = PCore.getInitialiser().initCoreContainers();
|
|
43
|
+
|
|
44
|
+
const { props } = renderObj;
|
|
45
|
+
|
|
46
|
+
setRootProps(props);
|
|
47
|
+
|
|
48
|
+
openCase();
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error('Error initializing PCore:', error);
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
console.log('WorkArea useEffect called');
|
|
56
|
+
// Subscribe to the EVENT_CANCEL event to handle the assignment cancellation
|
|
57
|
+
PCore.getPubSubUtils().subscribe(
|
|
58
|
+
PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
|
|
59
|
+
() => cancelAssignment(),
|
|
60
|
+
'cancelAssignment',
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Subscribe to the 'assignmentFinished' event to handle assignment completion
|
|
64
|
+
PCore.getPubSubUtils().subscribe(
|
|
65
|
+
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,
|
|
66
|
+
() => assignmentFinished(),
|
|
67
|
+
'assignmentFinished',
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
// unsubscribe to the events
|
|
72
|
+
PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'cancelAssignment');
|
|
73
|
+
PCore.getPubSubUtils().unsubscribe(
|
|
74
|
+
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,
|
|
75
|
+
'assignmentFinished',
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
|
|
80
|
+
function cancelAssignment() {
|
|
81
|
+
router.replace('/home');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function assignmentFinished() {
|
|
85
|
+
setShowResolution(true);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const openCase = () => {
|
|
89
|
+
showLoader();
|
|
90
|
+
let mashupCaseType = SDK_Config.serverConfig.appMashupCaseType;
|
|
91
|
+
|
|
92
|
+
// If mashupCaseType is null or undefined, get the first case type from the environment info
|
|
93
|
+
if (!mashupCaseType) {
|
|
94
|
+
const caseTypes: any = PCore.getEnvironmentInfo().environmentInfoObject?.pyCaseTypeList;
|
|
95
|
+
mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Create options object with default values
|
|
99
|
+
const options: any = {
|
|
100
|
+
pageName: 'pyEmbedAssignment',
|
|
101
|
+
startingFields: {},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// If mashupCaseType is 'DIXL-MediaCo-Work-NewService', add Package field to startingFields
|
|
105
|
+
if (mashupCaseType === 'DIXL-MediaCo-Work-NewService') {
|
|
106
|
+
options.startingFields.Package = 'Basic';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Create a new case using the mashup API
|
|
110
|
+
PCore.getMashupApi()
|
|
111
|
+
.createCase(mashupCaseType, PCore.getConstants().APP.APP, options)
|
|
112
|
+
.then(() => {
|
|
113
|
+
console.log('createCase rendering is complete');
|
|
114
|
+
})
|
|
115
|
+
.finally(() => {
|
|
116
|
+
hideLoader();
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
if (showResolution) {
|
|
121
|
+
return <ResolutionScreen />;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<SafeAreaView style={{ flex: 1, backgroundColor: '#01153d' }}>
|
|
126
|
+
<View style={{ flex: 1 }}>
|
|
127
|
+
<Provider>
|
|
128
|
+
<PaperProvider theme={transparentFieldTheme}>
|
|
129
|
+
{loading ? null : rootProps && <RootComponent {...(rootProps as object)} />}
|
|
130
|
+
</PaperProvider>
|
|
131
|
+
</Provider>
|
|
132
|
+
</View>
|
|
133
|
+
</SafeAreaView>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Re-export PegaStoreContext from @pega/sdk-react as the shared store context.
|
|
2
|
+
// RootComponent provides { store: PCore.getStore() }; consumers read it via useContext.
|
|
3
|
+
export { PegaStoreContext as default } from '@pega/sdk-react';
|
|
4
|
+
export { usePegaStore as useConstellationContext } from '@pega/sdk-react';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { PConnectComponent, PegaStoreContext } from '@pega/sdk-react';
|
|
3
|
+
|
|
4
|
+
export default function RootComponent(props: any) {
|
|
5
|
+
const contextValue = useMemo(() => ({ store: PCore.getStore() }), []);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<PegaStoreContext.Provider value={contextValue}>
|
|
9
|
+
<PConnectComponent {...props} />
|
|
10
|
+
</PegaStoreContext.Provider>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { connect, shallowEqual } from 'react-redux';
|
|
3
|
+
import ErrorBoundary from '../components/infra/ErrorBoundary';
|
|
4
|
+
|
|
5
|
+
import StoreContext from './Context/StoreContext';
|
|
6
|
+
|
|
7
|
+
import pegaSdkComponentMap from '../sdk-pega-component-map';
|
|
8
|
+
|
|
9
|
+
// Ensure PCore is available from the global scope if not imported
|
|
10
|
+
const PCore = typeof window !== 'undefined' ? window.PCore : undefined;
|
|
11
|
+
|
|
12
|
+
const isClassIDCompare = (key, prev, next) => {
|
|
13
|
+
return !(key === 'classID' && (!prev[key] || !next[key]));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const routingInfoCompare = (next, prev) => {
|
|
17
|
+
return (
|
|
18
|
+
'routingInfo' in next &&
|
|
19
|
+
(!shallowEqual(next.routingInfo, prev.routingInfo) || !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Generate unique id for elements */
|
|
24
|
+
const createUID = () => {
|
|
25
|
+
return `_${Math.random().toString(36).slice(2, 11)}`;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const setVisibilityForList = (c11nEnv, visibility) => {
|
|
29
|
+
const { selectionMode, selectionList, renderMode, referenceList } = c11nEnv.getComponentConfig();
|
|
30
|
+
// usecase:multiselect, fieldgroup, editable table
|
|
31
|
+
if (
|
|
32
|
+
(selectionMode === PCore.getConstants().LIST_SELECTION_MODE.MULTI && selectionList) ||
|
|
33
|
+
(renderMode === 'Editable' && referenceList)
|
|
34
|
+
) {
|
|
35
|
+
c11nEnv.getListActions().setVisibility(visibility);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
function withVisibility(WrappedComponent) {
|
|
40
|
+
return class extends Component {
|
|
41
|
+
render() {
|
|
42
|
+
const { visibility } = this.props;
|
|
43
|
+
|
|
44
|
+
if (visibility === false) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return <WrappedComponent {...this.props} />;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const connectRedux = (component, c11nEnv) => {
|
|
53
|
+
return connect(
|
|
54
|
+
(state, ownProps) => {
|
|
55
|
+
let addProps = {};
|
|
56
|
+
const obj = {};
|
|
57
|
+
// Need to use ownProps pconnect since c11nEnv is stale and prior to re-render
|
|
58
|
+
if (!ownProps.getPConnect) {
|
|
59
|
+
console.error('connectRedux ownProps are not defined');
|
|
60
|
+
} else {
|
|
61
|
+
c11nEnv = ownProps.getPConnect();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (typeof component.additionalProps === 'object') {
|
|
65
|
+
addProps = c11nEnv.resolveConfigProps(component.additionalProps);
|
|
66
|
+
} else if (typeof component.additionalProps === 'function') {
|
|
67
|
+
addProps = c11nEnv.resolveConfigProps(component.additionalProps(state, ownProps.getPConnect));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
c11nEnv.getConfigProps(obj);
|
|
71
|
+
|
|
72
|
+
// populate additional props which are component specific and not present in configurations
|
|
73
|
+
// This block can be removed once all these props will be added as part of configs
|
|
74
|
+
c11nEnv.populateAdditionalProps(obj);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
...obj,
|
|
78
|
+
...addProps,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
null,
|
|
82
|
+
null,
|
|
83
|
+
{
|
|
84
|
+
context: StoreContext,
|
|
85
|
+
areStatePropsEqual: (next, prev) => {
|
|
86
|
+
const allStateProps = c11nEnv.getStateProps();
|
|
87
|
+
for (const key of Object.keys(allStateProps)) {
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(allStateProps, key)) {
|
|
89
|
+
if (
|
|
90
|
+
key === 'inheritedProps' &&
|
|
91
|
+
next.inheritedProps &&
|
|
92
|
+
!PCore.isDeepEqual(next.inheritedProps, prev.inheritedProps)
|
|
93
|
+
) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (
|
|
97
|
+
key !== 'inheritedProps' &&
|
|
98
|
+
((isClassIDCompare(key, prev, next) && !shallowEqual(next[key], prev[key])) ||
|
|
99
|
+
(next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo)))
|
|
100
|
+
) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/* TODO For some rawConfig we are not getting routingInfo under allStateProps */
|
|
106
|
+
return !routingInfoCompare(next, prev);
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
)(component);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const getComponent = (c11nEnv) => {
|
|
113
|
+
// PCore is defined in pxBootstrapShell - eventually will be exported in place of constellationCore
|
|
114
|
+
const ComponentsRegistry = PCore.getComponentsRegistry();
|
|
115
|
+
const type = c11nEnv.getComponentName();
|
|
116
|
+
|
|
117
|
+
const componentObj = ComponentsRegistry.getComponent(type);
|
|
118
|
+
const componentType = (componentObj && componentObj.component) || type;
|
|
119
|
+
|
|
120
|
+
// JEA - modifying logic before bailing to RootContainer logic to work around async loading problem
|
|
121
|
+
const component = pegaSdkComponentMap[componentType] || ErrorBoundary; /* || window[componentType] */
|
|
122
|
+
|
|
123
|
+
if (c11nEnv.isConditionExist()) {
|
|
124
|
+
return connectRedux(withVisibility(component), c11nEnv);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return connectRedux(component, c11nEnv);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* JEA - add Type info via JSdoc syntax...
|
|
132
|
+
* @extends {React.Components<Props, State>}
|
|
133
|
+
* createPConnectComponent - Class to create/initialize a PConnect (c11nEnv) object
|
|
134
|
+
* to pre-process meta data of each componnet.
|
|
135
|
+
* - Wraps each child in a component with PConnect
|
|
136
|
+
* - Process all actions and make them avaiable in props
|
|
137
|
+
* - Filters all properties in metadata and keeps them
|
|
138
|
+
* __internal for re-render process through connect
|
|
139
|
+
*/
|
|
140
|
+
class PConnect extends Component {
|
|
141
|
+
constructor(props) {
|
|
142
|
+
super(props);
|
|
143
|
+
const { getPConnect } = this.props;
|
|
144
|
+
this.state = {
|
|
145
|
+
hasError: false,
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
this.eventHandler = this.eventHandler.bind(this);
|
|
149
|
+
this.changeHandler = this.changeHandler.bind(this);
|
|
150
|
+
|
|
151
|
+
this.c11nEnv = getPConnect();
|
|
152
|
+
|
|
153
|
+
this.Control = getComponent(this.c11nEnv);
|
|
154
|
+
this.actionsAPI = this.c11nEnv.getActionsApi();
|
|
155
|
+
|
|
156
|
+
this.processActions(this.c11nEnv);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static getDerivedStateFromError(error) {
|
|
160
|
+
// Update state so the next render will show the fallback UI.
|
|
161
|
+
return {
|
|
162
|
+
hasError: true,
|
|
163
|
+
error,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
componentDidMount() {
|
|
168
|
+
this.c11nEnv.addFormField();
|
|
169
|
+
setVisibilityForList(this.c11nEnv, true);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
componentDidCatch(error, info) {
|
|
173
|
+
console.error(`Error while Rendering the component ${this.componentName} : `, error, info.componentStack);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
componentWillUnmount() {
|
|
177
|
+
if (this.c11nEnv.removeFormField) {
|
|
178
|
+
this.c11nEnv.removeFormField();
|
|
179
|
+
setVisibilityForList(this.c11nEnv, false);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/*
|
|
184
|
+
* processActions to see all actions in meta and adds event in props.
|
|
185
|
+
* Attaches common handler (eventHandler) for all actions.
|
|
186
|
+
*/
|
|
187
|
+
processActions() {
|
|
188
|
+
if (this.c11nEnv.isEditable()) {
|
|
189
|
+
this.c11nEnv.setAction('onChange', this.changeHandler);
|
|
190
|
+
this.c11nEnv.setAction('onBlur', this.eventHandler);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Using separate handle for change as in case of dropdown, native click is mapped to react change
|
|
195
|
+
changeHandler(event) {
|
|
196
|
+
this.actionsAPI.changeHandler(this.c11nEnv, event);
|
|
197
|
+
// getActionProcessor().changeHandler(this.c11nEnv, event);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
eventHandler(event) {
|
|
201
|
+
this.actionsAPI.eventHandler(this.c11nEnv, event);
|
|
202
|
+
// getActionProcessor().eventHandler(this.c11nEnv, event);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
createChildren() {
|
|
206
|
+
const { getPConnect } = this.props;
|
|
207
|
+
if (getPConnect().hasChildren() && getPConnect().getChildren()) {
|
|
208
|
+
return getPConnect()
|
|
209
|
+
.getChildren()
|
|
210
|
+
|
|
211
|
+
.map((childProps, index) => <PConnect key={`${this.getKey(childProps)}_${index}`} {...childProps} />);
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
getKey(props = this.props) {
|
|
217
|
+
const { getPConnect } = props;
|
|
218
|
+
const viewName = getPConnect().getConfigProps().name || getPConnect().getCurrentView();
|
|
219
|
+
let key = !viewName ? createUID() : `${viewName}!${getPConnect().getCurrentClassID() || createUID()}`;
|
|
220
|
+
|
|
221
|
+
// In the case of pyDetails the key must be unique for each instance
|
|
222
|
+
if (viewName && viewName.toUpperCase() === 'PYDETAILS') {
|
|
223
|
+
key += `!${getPConnect().getCaseInfo().getID()}`;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return key.toUpperCase();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
render() {
|
|
230
|
+
const { hasError } = this.state;
|
|
231
|
+
const { getPConnect, additionalProps, ...otherProps } = this.props;
|
|
232
|
+
|
|
233
|
+
if (hasError) {
|
|
234
|
+
// You can render any custom fallback UI
|
|
235
|
+
// console.log(`react_pconnect error: used to return: <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />`);
|
|
236
|
+
return <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const props = this.c11nEnv.getConfigProps();
|
|
240
|
+
const actions = this.c11nEnv.getActions();
|
|
241
|
+
const finalProps = {
|
|
242
|
+
...props,
|
|
243
|
+
getPConnect,
|
|
244
|
+
...actions,
|
|
245
|
+
additionalProps,
|
|
246
|
+
...otherProps,
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// If the new component is a reference node then mark with a unique key
|
|
250
|
+
if (['reference', 'View'].includes(getPConnect().getComponentName()) && !finalProps.key) {
|
|
251
|
+
return (
|
|
252
|
+
<this.Control {...finalProps} key={this.getKey()}>
|
|
253
|
+
{this.createChildren()}
|
|
254
|
+
</this.Control>
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// console.log(`react_pconnect: used to return: <this.Control {...finalProps} />`);
|
|
259
|
+
|
|
260
|
+
return <this.Control {...finalProps}>{this.createChildren()}</this.Control>;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// PConnect.propTypes = {
|
|
265
|
+
// // __internal: PropTypes.object.isRequired,
|
|
266
|
+
// // meta: PropTypes.object.isRequired,
|
|
267
|
+
// // configObject: PropTypes.object.isRequired,
|
|
268
|
+
// getPConnect: PropTypes.func.isRequired,
|
|
269
|
+
// additionalProps: PropTypes.shape({
|
|
270
|
+
// noLabel: PropTypes.bool,
|
|
271
|
+
// readOnly: PropTypes.bool,
|
|
272
|
+
// }),
|
|
273
|
+
// validatemessage: PropTypes.string,
|
|
274
|
+
// };
|
|
275
|
+
|
|
276
|
+
PConnect.defaultProps = {
|
|
277
|
+
additionalProps: {},
|
|
278
|
+
validatemessage: '',
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// PCore.registerComponentCreator is now called by registerComponentCreator() from @pega/sdk-react
|
|
282
|
+
// during workarea bootstrap. This block is intentionally removed.
|
|
283
|
+
|
|
284
|
+
// PCore.getAssetLoader().register('component-loader', async (componentNames = []) => {
|
|
285
|
+
// const promises = [];
|
|
286
|
+
// componentNames.forEach(comp => {
|
|
287
|
+
// if (/^[A-Z]/.test(comp) && !LazyComponentMap[comp]) {
|
|
288
|
+
// if (!ComponentMap[comp]) {
|
|
289
|
+
// const srcUrl = `${PCore.getAssetLoader().getConstellationServiceUrl()}/v860/${PCore.getAssetLoader().getAppAlias()}/component/${comp}.js`;
|
|
290
|
+
// promises.push(PCore.getAssetLoader().getLoader()(srcUrl, 'script'));
|
|
291
|
+
// } else {
|
|
292
|
+
// if (ComponentMap[comp].modules && ComponentMap[comp].modules.length) {
|
|
293
|
+
// ComponentMap[comp].modules.forEach(module => {
|
|
294
|
+
// LazyComponentMap[comp] = module;
|
|
295
|
+
// });
|
|
296
|
+
// }
|
|
297
|
+
// if (ComponentMap[comp].scripts && ComponentMap[comp].scripts.length) {
|
|
298
|
+
// ComponentMap[comp].scripts.forEach(script => {
|
|
299
|
+
// promises.push(PCore.getAssetLoader().getLoader()(script, 'script'));
|
|
300
|
+
// });
|
|
301
|
+
// }
|
|
302
|
+
// }
|
|
303
|
+
// }
|
|
304
|
+
// });
|
|
305
|
+
// /* Promise.all rejects or accepts all or none. This causes entire component loader to fail
|
|
306
|
+
// in case there is a single failure.
|
|
307
|
+
// Using allSettled to allow Promise to be resolved even if there are failed components
|
|
308
|
+
// Note : This is a liberty taken at component loader and unwise to be used at
|
|
309
|
+
// asset loader which will still use Promise.all
|
|
310
|
+
// */
|
|
311
|
+
// await Promise.allSettled(promises);
|
|
312
|
+
// });
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
*
|
|
316
|
+
* @param {*} declarative
|
|
317
|
+
* @returns {React.Components<Props, State>}
|
|
318
|
+
|
|
319
|
+
*/
|
|
320
|
+
const createPConnectComponent = () => {
|
|
321
|
+
return PConnect;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export default createPConnectComponent;
|
|
325
|
+
|
|
326
|
+
/* These APIs need to be exposed for authoring bridge
|
|
327
|
+
Will be removed when pxbootstrap and constellation_bridge is cleaned up
|
|
328
|
+
to use single bootstrap file from constellation */
|
|
329
|
+
// window.authoringUtils = {
|
|
330
|
+
// createElement,
|
|
331
|
+
// render,
|
|
332
|
+
// unmountComponentAtNode,
|
|
333
|
+
// LazyComponentMap
|
|
334
|
+
// };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const DisplayField = ({ variant, label, hideLabel, value }) => {
|
|
4
|
+
return (
|
|
5
|
+
<View
|
|
6
|
+
style={[
|
|
7
|
+
styles.container,
|
|
8
|
+
variant === 'stacked' && { flexDirection: 'column', gap: 6 },
|
|
9
|
+
variant !== 'stacked' && { flexDirection: 'row' },
|
|
10
|
+
]}
|
|
11
|
+
>
|
|
12
|
+
{!hideLabel && <Text style={[styles.label, variant === 'stacked' && { width: '100%' }]}>{label}</Text>}
|
|
13
|
+
<Text style={[styles.value, variant === 'stacked' && { width: '100%' }]}>{value}</Text>
|
|
14
|
+
</View>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default DisplayField;
|
|
19
|
+
|
|
20
|
+
const styles = StyleSheet.create({
|
|
21
|
+
container: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
marginVertical: 8,
|
|
24
|
+
alignItems: 'flex-start',
|
|
25
|
+
justifyContent: 'flex-start',
|
|
26
|
+
},
|
|
27
|
+
label: { color: '#fff', width: '40%', fontSize: 16, fontWeight: '500' },
|
|
28
|
+
value: { color: '#fff', width: '60%', fontSize: 16 },
|
|
29
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HelperText as RNHelperText } from 'react-native-paper';
|
|
2
|
+
|
|
3
|
+
export default function HelperText({ value, type }) {
|
|
4
|
+
if (!value) return null;
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<RNHelperText type={type} visible={!!value} style={{ color: type === 'error' ? '#FF3B30' : '#ffffff' }}>
|
|
8
|
+
{value}
|
|
9
|
+
</RNHelperText>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LabelText = ({ label, required, style = {} }) => {
|
|
4
|
+
return (
|
|
5
|
+
<View style={{ flexDirection: 'row' }}>
|
|
6
|
+
<Text style={[styles.label, style]}>{label}</Text>
|
|
7
|
+
{required && <Text style={styles.requiredLabel}> *</Text>}
|
|
8
|
+
</View>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default LabelText;
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
label: {
|
|
16
|
+
fontSize: 18,
|
|
17
|
+
color: '#fff',
|
|
18
|
+
},
|
|
19
|
+
requiredLabel: {
|
|
20
|
+
color: 'red',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const FORM_INPUT_THEME = {
|
|
2
|
+
colors: {
|
|
3
|
+
primary: '#7C5CE6',
|
|
4
|
+
outline: 'rgba(255, 255, 255, 0.45)',
|
|
5
|
+
onSurface: '#FFFFFF',
|
|
6
|
+
onSurfaceVariant: 'rgba(255, 255, 255, 0.72)',
|
|
7
|
+
error: '#FF3B30',
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const FORM_INPUT_PROPS = {
|
|
12
|
+
mode: 'outlined' as const,
|
|
13
|
+
textColor: '#FFFFFF',
|
|
14
|
+
outlineColor: 'rgba(255, 255, 255, 0.45)',
|
|
15
|
+
activeOutlineColor: '#7C5CE6',
|
|
16
|
+
theme: FORM_INPUT_THEME,
|
|
17
|
+
};
|