@pega/sdk 0.0.1
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/LICENSE +201 -0
- package/README.md +111 -0
- package/SECURITY.md +10 -0
- package/dist/index.js +753 -0
- package/package.json +41 -0
- package/templates/angular-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/angular-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/angular-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/angular-sdk-reference/angular.json +34 -0
- package/templates/angular-sdk-reference/package.json +31 -0
- package/templates/angular-sdk-reference/sdk-config.json +26 -0
- package/templates/angular-sdk-reference/src/app/app.component.ts +54 -0
- package/templates/angular-sdk-reference/src/index.html +12 -0
- package/templates/angular-sdk-reference/src/main.ts +4 -0
- package/templates/angular-sdk-reference/src/styles.css +19 -0
- package/templates/angular-sdk-reference/tsconfig.json +32 -0
- package/templates/react-native-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/react-native-sdk-reference/App.tsx +51 -0
- package/templates/react-native-sdk-reference/app.json +11 -0
- package/templates/react-native-sdk-reference/package.json +22 -0
- package/templates/react-native-sdk-reference/sdk-config.json +14 -0
- package/templates/react-native-sdk-reference/tsconfig.json +12 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +185 -0
- package/templates/react-sdk-reference/.github/instructions/component-map.instructions.md +40 -0
- package/templates/react-sdk-reference/.github/instructions/dse-component.instructions.md +77 -0
- package/templates/react-sdk-reference/.github/instructions/field-component.instructions.md +73 -0
- package/templates/react-sdk-reference/.github/instructions/template-component.instructions.md +94 -0
- package/templates/react-sdk-reference/.github/instructions/widget-component.instructions.md +89 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +21 -0
- package/templates/react-sdk-reference/.github/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.github/prompts/identify-components.prompt.md +110 -0
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +48 -0
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +81 -0
- package/templates/react-sdk-reference/.github/prompts/replace-design-system.prompt.md +524 -0
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +41 -0
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +49 -0
- package/templates/react-sdk-reference/.github/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +249 -0
- package/templates/react-sdk-reference/.github/skills/field-components.md +262 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.github/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +105 -0
- package/templates/react-sdk-reference/.github/skills/template-components.md +285 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.github/skills/widget-components.md +234 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/AGENTS.md +59 -0
- package/templates/react-sdk-reference/assets/icons/analytics-good-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/cart-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/headset.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/mobile-phone-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/money-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/multi-device-solid.svg +3 -0
- package/templates/react-sdk-reference/index.html +36 -0
- package/templates/react-sdk-reference/package.json +52 -0
- package/templates/react-sdk-reference/sdk-config.json +26 -0
- package/templates/react-sdk-reference/src/AppSelector.tsx +18 -0
- package/templates/react-sdk-reference/src/FallbackComponent.tsx +40 -0
- package/templates/react-sdk-reference/src/MashupApp.styles.ts +105 -0
- package/templates/react-sdk-reference/src/MashupApp.tsx +254 -0
- package/templates/react-sdk-reference/src/PortalApp.tsx +175 -0
- package/templates/react-sdk-reference/src/components/component-map.ts +255 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.tsx +91 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.css +39 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.tsx +53 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +16 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +270 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/DetailsFields.tsx +164 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +79 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +58 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +84 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/Operator.tsx +220 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/Pulse.tsx +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/RichTextEditor.tsx +201 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +48 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +218 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.css +24 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +148 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +263 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +111 -0
- package/templates/react-sdk-reference/src/components/field/Currency/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Currency/currency-utils.ts +67 -0
- package/templates/react-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/Date/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +101 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +122 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +96 -0
- package/templates/react-sdk-reference/src/components/field/Email/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Group/Group.tsx +41 -0
- package/templates/react-sdk-reference/src/components/field/Group/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +100 -0
- package/templates/react-sdk-reference/src/components/field/Integer/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.css +4 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +258 -0
- package/templates/react-sdk-reference/src/components/field/Location/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Location/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/utils.ts +230 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +235 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +112 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +113 -0
- package/templates/react-sdk-reference/src/components/field/Phone/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Phone/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +158 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.css +79 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.tsx +98 -0
- package/templates/react-sdk-reference/src/components/field/RichText/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/RichText/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/ScalarList.tsx +63 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +189 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/utils.tsx +223 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/SemanticLink.tsx +208 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/utils.ts +49 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/TextContent.tsx +46 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +92 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +79 -0
- package/templates/react-sdk-reference/src/components/field/Time/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Time/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +89 -0
- package/templates/react-sdk-reference/src/components/field/URL/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +198 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReferenceUtils.ts +13 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/helpers/attachmentShared.ts +6 -0
- package/templates/react-sdk-reference/src/components/helpers/case-utils.tsx +99 -0
- package/templates/react-sdk-reference/src/components/helpers/common-utils.ts +26 -0
- package/templates/react-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/date-format-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/field-group-utils.ts +63 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Boolean.ts +21 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Currency.ts +77 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/CurrencyMap.ts +913 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Date.ts +71 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/common.ts +14 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +130 -0
- package/templates/react-sdk-reference/src/components/helpers/instructions-utils.ts +38 -0
- package/templates/react-sdk-reference/src/components/helpers/object-utils.ts +10 -0
- package/templates/react-sdk-reference/src/components/helpers/reactContextHelpers.ts +3 -0
- package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +452 -0
- package/templates/react-sdk-reference/src/components/helpers/state-utils.tsx +43 -0
- package/templates/react-sdk-reference/src/components/helpers/template-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/utils.ts +349 -0
- package/templates/react-sdk-reference/src/components/helpers/versionHelpers.ts +14 -0
- package/templates/react-sdk-reference/src/components/index.ts +8 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +329 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.css +35 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.tsx +259 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/BannerPage.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/CaseView.tsx +261 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +117 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/Confirmation.tsx +102 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/config-ext.json +11 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReference.tsx +590 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +213 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/utils.ts +90 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.css +34 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/utils/index.ts +26 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/DefaultPage.tsx +108 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/Details.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/config.json +36 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx +116 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/hooks.ts +293 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +72 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/InlineDashboardPage.tsx +39 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/ListPage.tsx +16 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/DefaultViewMeta.ts +220 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.css +10 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +1391 -0
- package/templates/react-sdk-reference/src/components/template/ListView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/ListView/hooks.ts +93 -0
- package/templates/react-sdk-reference/src/components/template/ListView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/utils.ts +781 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +52 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +85 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ObjectPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/OneColumn.tsx +32 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/OneColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/OneColumnTab.tsx +11 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.css +7 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.tsx +204 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx +126 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +985 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +122 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +207 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +71 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/SubTabs.tsx +46 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/tabUtils.ts +185 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +96 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.css +11 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.tsx +160 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/utils.tsx +58 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/AppAnnouncement.tsx +60 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.css +95 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.tsx +541 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.types.ts +96 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/AttachmentUtils.ts +316 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/CaseHistory.tsx +171 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +13 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +32 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.css +118 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.tsx +653 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/Followers.tsx +43 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/QuickCreate.tsx +88 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.css +76 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.tsx +89 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/SummaryList.tsx +23 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.css +81 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +507 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/index.tsx +1 -0
- package/templates/react-sdk-reference/src/main.tsx +13 -0
- package/templates/react-sdk-reference/src/mui-theme-augmentation.d.ts +6 -0
- package/templates/react-sdk-reference/tsconfig.json +24 -0
- package/templates/react-sdk-reference/vite.config.ts +65 -0
- package/templates/wc-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/wc-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/wc-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/wc-sdk-reference/index.html +21 -0
- package/templates/wc-sdk-reference/package.json +19 -0
- package/templates/wc-sdk-reference/sdk-config.json +19 -0
- package/templates/wc-sdk-reference/src/index.ts +98 -0
- package/templates/wc-sdk-reference/tsconfig.json +21 -0
- package/templates/wc-sdk-reference/vite.config.ts +8 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Copilot Instructions — React SDK Reference
|
|
2
|
+
|
|
3
|
+
You are assisting developers in a React reference application that demonstrates the Pega Infinity SDK. Customers clone this repo and **replace the sample UI components with their own design system** (MUI, Chakra, Radix, Shadcn, Ant Design, or any other).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Repository Purpose
|
|
8
|
+
|
|
9
|
+
This is a **reference implementation** — not a framework. The UI components (fields, templates, widgets) are intentionally simple MUI-based implementations meant to be swapped out. The SDK wiring (bootstrap, PConnect bridge, component registry) is reusable infrastructure that should NOT be modified.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2. What Is Replaceable vs. Infrastructure
|
|
14
|
+
|
|
15
|
+
### Replaceable (customer modifies these)
|
|
16
|
+
|
|
17
|
+
| Directory | Purpose |
|
|
18
|
+
| --------------------------------------- | ----------------------------------------------------------- |
|
|
19
|
+
| `src/components/field/` | Form field components (TextInput, Dropdown, Date, etc.) |
|
|
20
|
+
| `src/components/template/` | Layout templates (OneColumn, TwoColumn, Details, etc.) |
|
|
21
|
+
| `src/components/widget/` | Data widgets (ToDo, Attachment, CaseHistory, etc.) |
|
|
22
|
+
| `src/components/designSystemExtension/` | Extended UI (AlertBanner, FieldGroup, RichTextEditor, etc.) |
|
|
23
|
+
|
|
24
|
+
### Infrastructure (do NOT modify unless you know what you're doing)
|
|
25
|
+
|
|
26
|
+
| File/Directory | Purpose |
|
|
27
|
+
| --------------------------------------- | --------------------------------------------------------- |
|
|
28
|
+
| `src/MashupApp.tsx` | Auth + bootstrap + root rendering |
|
|
29
|
+
| `src/components/component-map.ts` | Registry wiring (only add/remove entries) |
|
|
30
|
+
| `src/components/infra/` | Infrastructure components (ActionButtons, Stages, NavBar) |
|
|
31
|
+
| `src/components/helpers/event-utils.ts` | PConnect event handler utility |
|
|
32
|
+
| `@pega/sdk-react` | SDK bridge — never modify |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 3. Component Architecture
|
|
37
|
+
|
|
38
|
+
### The PConnect Bridge
|
|
39
|
+
|
|
40
|
+
Every component receives `getPConnect` as a prop. This is the bridge to the Pega platform:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const pConn = getPConnect();
|
|
44
|
+
const actions = pConn.getActionsApi(); // For field updates
|
|
45
|
+
const propName = (pConn.getStateProps() as any).value; // Property path
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Event Handling Pattern
|
|
49
|
+
|
|
50
|
+
All field components use this pattern for two-way binding:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import handleEvent from '../../helpers/event-utils';
|
|
54
|
+
|
|
55
|
+
// On change (local state only):
|
|
56
|
+
function handleChange(event) {
|
|
57
|
+
setInputValue(event.target.value);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// On blur (push to platform):
|
|
61
|
+
function handleBlur() {
|
|
62
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Display Mode Handling
|
|
67
|
+
|
|
68
|
+
Field components must handle `displayMode` prop:
|
|
69
|
+
|
|
70
|
+
- `undefined` → render editable input
|
|
71
|
+
- `'DISPLAY_ONLY'` → render read-only value via `FieldValueList`
|
|
72
|
+
- `'STACKED_LARGE_VAL'` → render stacked read-only via `FieldValueList` with `variant='stacked'`
|
|
73
|
+
|
|
74
|
+
### Component Registry
|
|
75
|
+
|
|
76
|
+
Components are registered by name in `src/components/component-map.ts`:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { sdkComponents } from '@pega/sdk-react';
|
|
80
|
+
|
|
81
|
+
function getSampleComponentMap() {
|
|
82
|
+
return {
|
|
83
|
+
...sdkComponents, // Infrastructure (View, Region, FlowContainer, etc.)
|
|
84
|
+
TextInput, // Your field components
|
|
85
|
+
Dropdown,
|
|
86
|
+
// ...
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
To add a new component: add the import + add to the map object.
|
|
92
|
+
To replace a component: change the import to point to your new implementation.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 4. Props Interfaces
|
|
97
|
+
|
|
98
|
+
### Field Components (`PConnFieldProps`)
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
102
|
+
|
|
103
|
+
interface PConnFieldProps {
|
|
104
|
+
getPConnect: () => typeof PConnect;
|
|
105
|
+
label: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
disabled: boolean;
|
|
108
|
+
value?: string;
|
|
109
|
+
validatemessage: string;
|
|
110
|
+
status?: string; // 'error' | 'warning' | undefined
|
|
111
|
+
onChange: any;
|
|
112
|
+
onBlur?: any;
|
|
113
|
+
readOnly: boolean;
|
|
114
|
+
testId: string;
|
|
115
|
+
helperText: string;
|
|
116
|
+
displayMode?: string; // 'DISPLAY_ONLY' | 'STACKED_LARGE_VAL'
|
|
117
|
+
hideLabel: boolean;
|
|
118
|
+
placeholder?: string;
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Template/Widget Components (`PConnProps`)
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
126
|
+
|
|
127
|
+
interface PConnProps {
|
|
128
|
+
getPConnect: () => typeof PConnect;
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 5. Rules for Replacing Components
|
|
135
|
+
|
|
136
|
+
1. **Keep the same default export name** — the component-map references it.
|
|
137
|
+
2. **Keep `getPConnect` wiring intact** — extract props, call `handleEvent` on blur.
|
|
138
|
+
3. **Handle `displayMode`** — return `FieldValueList` for read-only modes.
|
|
139
|
+
4. **Handle validation** — show `validatemessage` when `status === 'error'`.
|
|
140
|
+
5. **Preserve `data-test-id`** — pass `testId` to the root interactive element.
|
|
141
|
+
6. **Use `getComponentFromRegistry`** to render sub-components (e.g., `FieldValueList`) — don't hardcode imports for components that might also be replaced.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 6. Build & Dev Commands
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# From monorepo root (if developing locally with source packages):
|
|
149
|
+
npm run build # Build all packages + samples
|
|
150
|
+
npm run dev:react # Build + dev server
|
|
151
|
+
|
|
152
|
+
# From this directory (standalone):
|
|
153
|
+
npm run dev # Vite dev server (port 3500)
|
|
154
|
+
npm run build # Production build
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 7. Key Imports
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
// From SDK (never modify these)
|
|
163
|
+
import {
|
|
164
|
+
PConnectComponent,
|
|
165
|
+
PegaStoreContext,
|
|
166
|
+
registerComponentCreator,
|
|
167
|
+
getComponentFromRegistry,
|
|
168
|
+
sdkComponents,
|
|
169
|
+
} from '@pega/sdk-react';
|
|
170
|
+
import type { PConnProps, PConnFieldProps } from '@pega/sdk-react';
|
|
171
|
+
|
|
172
|
+
// Event utility (preserve this)
|
|
173
|
+
import handleEvent from '../../helpers/event-utils';
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 8. Do NOT
|
|
179
|
+
|
|
180
|
+
- Modify `MashupApp.tsx` bootstrap flow when replacing design system components.
|
|
181
|
+
- Import from `@pega/sdk-react/src/...` — use the package entry point only.
|
|
182
|
+
- Hardcode component references — use `getComponentFromRegistry('Name')` for components that may be overridden.
|
|
183
|
+
- Remove the `...sdkComponents` spread from `component-map.ts`.
|
|
184
|
+
- Use `any` without justification — prefer `unknown` and narrow.
|
|
185
|
+
- Add `@ts-ignore` — use `@ts-expect-error` with explanation if truly needed.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/component-map.ts"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Component Map Rules
|
|
6
|
+
|
|
7
|
+
The component map (`src/components/component-map.ts`) is the registry that maps Pega component names to React implementations.
|
|
8
|
+
|
|
9
|
+
## Structure
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { sdkComponents } from '@pega/sdk-react';
|
|
13
|
+
|
|
14
|
+
function getSampleComponentMap() {
|
|
15
|
+
return {
|
|
16
|
+
...sdkComponents, // NEVER remove this — provides infrastructure
|
|
17
|
+
// Your components below:
|
|
18
|
+
TextInput,
|
|
19
|
+
Dropdown,
|
|
20
|
+
// ...
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
1. **NEVER remove `...sdkComponents`** — it provides View, Region, Reference, RootContainer, FlowContainer, ViewContainer, Assignment, AssignmentCard, ErrorBoundary, MultiStep, CaseSummary, and their aliases.
|
|
28
|
+
|
|
29
|
+
2. **Map keys must match Pega component names exactly** — these are resolved at runtime by the platform. The key is what Pega sends; the value is your React component.
|
|
30
|
+
|
|
31
|
+
3. **To replace a component**: change its import path to your new implementation. Do NOT rename the key.
|
|
32
|
+
|
|
33
|
+
4. **To add a new component**: add the import + add a new key-value entry.
|
|
34
|
+
|
|
35
|
+
5. **Key naming exceptions** (where key differs from variable name):
|
|
36
|
+
- `Date: DateField` (Date is reserved in JS)
|
|
37
|
+
- `URL: URLComponent` (URL is a global)
|
|
38
|
+
- `Todo: ToDo` (casing difference)
|
|
39
|
+
|
|
40
|
+
6. **Keep the `registerSampleComponents` function** — it registers all entries into the `ComponentRegistry` instance used by the PConnect bridge.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "src/components/designSystemExtension/**/*.tsx"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Design System Extension Component Rules
|
|
6
|
+
|
|
7
|
+
When creating or modifying DSE components, follow these rules:
|
|
8
|
+
|
|
9
|
+
## What Are DSE Components?
|
|
10
|
+
|
|
11
|
+
Design System Extension components are display-focused presentational components. They sit between pure UI and data-fetching widgets. Some receive `getPConnect`, others receive only display props.
|
|
12
|
+
|
|
13
|
+
## Patterns
|
|
14
|
+
|
|
15
|
+
### Pattern A: With PConnect (data-aware display)
|
|
16
|
+
|
|
17
|
+
Used for: FieldValueList, CaseSummaryFields, DetailsFields
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
21
|
+
|
|
22
|
+
interface FieldValueListProps extends PConnProps {
|
|
23
|
+
name?: string;
|
|
24
|
+
value?: string;
|
|
25
|
+
variant?: 'stacked' | 'inline';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function FieldValueList(props: FieldValueListProps) {
|
|
29
|
+
const { name, value, variant = 'inline' } = props;
|
|
30
|
+
// Render a label-value pair
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Pattern B: Without PConnect (pure presentation)
|
|
35
|
+
|
|
36
|
+
Used for: AlertBanner, Banner, Operator
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
interface AlertBannerProps {
|
|
40
|
+
variant: 'urgent' | 'warning' | 'info' | 'success';
|
|
41
|
+
heading?: string;
|
|
42
|
+
messages: Array<string | { label?: string; description?: string }>;
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default function AlertBanner(props: AlertBannerProps) {
|
|
47
|
+
// Render an alert/notification banner
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Pattern C: Rich editor (extends PConnFieldProps)
|
|
52
|
+
|
|
53
|
+
Used for: RichTextEditor
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
57
|
+
|
|
58
|
+
interface RichTextEditorProps extends PConnFieldProps {
|
|
59
|
+
content?: string;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Visual Preservation
|
|
64
|
+
|
|
65
|
+
The replacement must look the same as the original component:
|
|
66
|
+
|
|
67
|
+
1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
|
|
68
|
+
2. Replicate those styles via inline `style` props, the new design system's props/variants, or by keeping the CSS import — whichever produces the closest match.
|
|
69
|
+
3. Do NOT silently drop `makeStyles` classes — map each one to an equivalent style.
|
|
70
|
+
|
|
71
|
+
## Key Rules
|
|
72
|
+
|
|
73
|
+
- DSE components are the **most commonly referenced by other components** via `getComponentFromRegistry('FieldValueList')` — every field uses FieldValueList for display modes
|
|
74
|
+
- Keep the same export name (default export) and prop interface shape
|
|
75
|
+
- If you replace FieldValueList, ensure it accepts `name`, `value`, and optional `variant` props
|
|
76
|
+
- AlertBanner must handle the `messages` array format (both strings and `{label, description}` objects)
|
|
77
|
+
- Do NOT drop visual styles when removing `makeStyles` — always map them to an equivalent
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "src/components/field/**/*.tsx"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Field Component Rules
|
|
6
|
+
|
|
7
|
+
When creating or modifying field components, follow these rules:
|
|
8
|
+
|
|
9
|
+
## Required Structure
|
|
10
|
+
|
|
11
|
+
1. **Import types from `@pega/sdk-react`**:
|
|
12
|
+
```typescript
|
|
13
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
2. **Define a props interface extending `PConnFieldProps`**:
|
|
17
|
+
```typescript
|
|
18
|
+
interface MyFieldProps extends PConnFieldProps {
|
|
19
|
+
// additional props specific to this field
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. **Export as default function component**:
|
|
24
|
+
```typescript
|
|
25
|
+
export default function MyField(props: MyFieldProps) { ... }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Required Behaviors
|
|
29
|
+
|
|
30
|
+
1. **Extract standard props**: `getPConnect`, `label`, `required`, `disabled`, `value`, `validatemessage`, `status`, `readOnly`, `testId`, `helperText`, `displayMode`, `hideLabel`, `placeholder`
|
|
31
|
+
|
|
32
|
+
2. **Get PConnect APIs**:
|
|
33
|
+
```typescript
|
|
34
|
+
const pConn = getPConnect();
|
|
35
|
+
const actions = pConn.getActionsApi();
|
|
36
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **Handle displayMode** (MUST be before the main return):
|
|
40
|
+
```typescript
|
|
41
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
42
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
43
|
+
}
|
|
44
|
+
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
45
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
4. **Use local state + blur pattern**:
|
|
50
|
+
- `onChange` → update local state only
|
|
51
|
+
- `onBlur` → call `handleEvent(actions, 'changeNblur', propName, localValue)`
|
|
52
|
+
|
|
53
|
+
5. **Show validation**: Display `validatemessage` and apply error styling when `status === 'error'`
|
|
54
|
+
|
|
55
|
+
6. **Pass test ID**: Set `data-test-id={testId}` on the interactive element
|
|
56
|
+
|
|
57
|
+
7. **Use `getComponentFromRegistry('FieldValueList')`** — never hardcode FieldValueList import
|
|
58
|
+
|
|
59
|
+
## Visual Preservation
|
|
60
|
+
|
|
61
|
+
The replacement must look the same as the original component:
|
|
62
|
+
|
|
63
|
+
1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
|
|
64
|
+
2. Replicate those styles via inline `style` props, {{designSystem}} component props/variants, or by keeping the CSS import — whichever produces the closest match.
|
|
65
|
+
3. Do NOT silently drop `makeStyles` classes — map each one to an equivalent style.
|
|
66
|
+
|
|
67
|
+
## Do NOT
|
|
68
|
+
|
|
69
|
+
- Skip `displayMode` handling — it breaks read-only views
|
|
70
|
+
- Call `handleEvent` on every keystroke — only on blur
|
|
71
|
+
- Hardcode component imports for components that exist in the registry
|
|
72
|
+
- Remove the `handleEvent` import from `../../helpers/event-utils`
|
|
73
|
+
- Drop visual styles when removing `makeStyles` — always map them to an equivalent
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "src/components/template/**/*.tsx"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Template Component Rules
|
|
6
|
+
|
|
7
|
+
When creating or modifying template/layout components, follow these rules:
|
|
8
|
+
|
|
9
|
+
## Required Structure
|
|
10
|
+
|
|
11
|
+
1. **Import types from `@pega/sdk-react`**:
|
|
12
|
+
```typescript
|
|
13
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
2. **Export as default function component**:
|
|
17
|
+
```typescript
|
|
18
|
+
export default function MyTemplate(props: MyTemplateProps) { ... }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Template Categories
|
|
22
|
+
|
|
23
|
+
### Layout Templates (TwoColumn, OneColumn, NarrowWide, WideNarrow)
|
|
24
|
+
|
|
25
|
+
Receive React `children` directly:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
29
|
+
|
|
30
|
+
interface TwoColumnProps extends PConnProps {
|
|
31
|
+
templateCol?: string; // e.g. "1fr 1fr", "2fr 1fr"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
35
|
+
const { children, templateCol = '1fr 1fr' } = props;
|
|
36
|
+
const childrenToRender = children as ReactElement[];
|
|
37
|
+
// Render childrenToRender[0], childrenToRender[1], etc. in grid columns
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Form/View Templates (DefaultForm, Details, CaseView)
|
|
42
|
+
|
|
43
|
+
Render children via `getPConnect().getChildren()`:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
export default function DefaultForm(props: DefaultFormProps) {
|
|
47
|
+
const { getPConnect } = props;
|
|
48
|
+
const pConn = getPConnect();
|
|
49
|
+
const children = pConn.getChildren() as any[];
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div>
|
|
53
|
+
{children.map((child, i) => (
|
|
54
|
+
<PConnectComponent key={i} getPConnect={() => child.getPConnect()} />
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Page Templates (OneColumnPage, TwoColumnPage)
|
|
62
|
+
|
|
63
|
+
Wrap a layout with page-level chrome (title, actions):
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
export default function OneColumnPage(props: PageProps) {
|
|
67
|
+
const { getPConnect, children } = props;
|
|
68
|
+
const pConn = getPConnect();
|
|
69
|
+
const title = pConn.getDataObject('')?.caseInfo?.name;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<div>
|
|
73
|
+
<h1>{title}</h1>
|
|
74
|
+
{children}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Visual Preservation
|
|
81
|
+
|
|
82
|
+
The replacement must look the same as the original component:
|
|
83
|
+
|
|
84
|
+
1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
|
|
85
|
+
2. Replicate those styles via inline `style` props, the new design system's layout props, or by keeping the CSS import — whichever produces the closest match.
|
|
86
|
+
3. Do NOT silently drop `makeStyles` classes — map each one to an equivalent style.
|
|
87
|
+
|
|
88
|
+
## Key Rules
|
|
89
|
+
|
|
90
|
+
- Use `PConnectComponent` from `@pega/sdk-react` to render PConnect children
|
|
91
|
+
- Grid proportions come from `templateCol` prop — parse it to calculate column ratios
|
|
92
|
+
- Templates must not call `handleEvent` or interact with field state
|
|
93
|
+
- Templates are layout-only — they arrange, not edit
|
|
94
|
+
- Do NOT drop column gap, padding, or alignment styles when removing MUI `Grid` — replicate them in the replacement layout
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "src/components/widget/**/*.tsx"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Widget Component Rules
|
|
6
|
+
|
|
7
|
+
When creating or modifying widget components, follow these rules:
|
|
8
|
+
|
|
9
|
+
## Required Structure
|
|
10
|
+
|
|
11
|
+
1. **Import types from `@pega/sdk-react`**:
|
|
12
|
+
```typescript
|
|
13
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
14
|
+
// or PConnFieldProps if the widget behaves like a field (e.g., Attachment)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Export as default function component**:
|
|
18
|
+
```typescript
|
|
19
|
+
export default function MyWidget(props: MyWidgetProps) { ... }
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Widget Patterns
|
|
23
|
+
|
|
24
|
+
### Data-Fetching Widget (ToDo, CaseHistory, Followers)
|
|
25
|
+
|
|
26
|
+
Fetches data from Pega data pages on mount:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
export default function MyWidget(props: MyWidgetProps) {
|
|
30
|
+
const { getPConnect, datasource, headerText } = props;
|
|
31
|
+
const pConn = getPConnect();
|
|
32
|
+
const [data, setData] = useState<any[]>([]);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const context = pConn.getContextName();
|
|
36
|
+
PCore.getDataPageUtils()
|
|
37
|
+
.getDataAsync(datasource?.source, context, {})
|
|
38
|
+
.then((response: any) => {
|
|
39
|
+
setData(response.data || []);
|
|
40
|
+
});
|
|
41
|
+
}, []);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Card>
|
|
45
|
+
<CardHeader title={headerText} />
|
|
46
|
+
<CardContent>{/* render data */}</CardContent>
|
|
47
|
+
</Card>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Action Widget (ToDo)
|
|
53
|
+
|
|
54
|
+
Triggers case actions:
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// Get assignments and trigger actions
|
|
58
|
+
import { getToDoAssignments } from '@pega/sdk-react';
|
|
59
|
+
|
|
60
|
+
const assignments = getToDoAssignments(getPConnect);
|
|
61
|
+
// Each assignment has: onClick callback, urgency, name, etc.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### File Widget (Attachment, FileUtility)
|
|
65
|
+
|
|
66
|
+
Handles file upload/download via PCore attachment APIs:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
PCore.getAttachmentUtils().uploadAttachment(file, onUploadProgress, errorHandler, context);
|
|
70
|
+
PCore.getAttachmentUtils().downloadAttachment(attachmentId, context);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Visual Preservation
|
|
74
|
+
|
|
75
|
+
The replacement must look the same as the original component:
|
|
76
|
+
|
|
77
|
+
1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
|
|
78
|
+
2. Replicate those styles via inline `style` props, the new design system's component props/variants, or by keeping the CSS import — whichever produces the closest match.
|
|
79
|
+
3. Do NOT silently drop `makeStyles` classes — map each one to an equivalent style.
|
|
80
|
+
|
|
81
|
+
## Key Rules
|
|
82
|
+
|
|
83
|
+
- Widgets are self-contained — they manage their own data fetching
|
|
84
|
+
- Use `PCore.getDataPageUtils()` for data page access
|
|
85
|
+
- Use `PCore.getAttachmentUtils()` for file operations
|
|
86
|
+
- Always handle loading and error states
|
|
87
|
+
- Widgets may use `PCore.getPubSubUtils()` to subscribe to events
|
|
88
|
+
- Clean up subscriptions in `useEffect` return function
|
|
89
|
+
- Do NOT drop card padding, list item spacing, or avatar sizing when removing MUI components — replicate them in the replacement
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Add a new component type to the registry
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Add a new component called `{{componentName}}` of type **{{componentType}}** (field | template | widget | designSystemExtension).
|
|
7
|
+
|
|
8
|
+
## Steps:
|
|
9
|
+
|
|
10
|
+
1. Create the component directory: `src/components/{{componentType}}/{{componentName}}/`
|
|
11
|
+
2. Create `{{componentName}}.tsx` with the appropriate pattern:
|
|
12
|
+
- **field**: Extend `PConnFieldProps`, use `handleEvent`, handle `displayMode`
|
|
13
|
+
- **template**: Extend `PConnProps`, render children via grid/layout
|
|
14
|
+
- **widget**: Extend `PConnProps`, fetch data via `PCore.getDataPageUtils()`
|
|
15
|
+
- **designSystemExtension**: Pure display props or extend `PConnProps`
|
|
16
|
+
3. Create `index.tsx` with: `export { default } from './{{componentName}}';`
|
|
17
|
+
4. Register in `src/components/component-map.ts`:
|
|
18
|
+
- Add import at top
|
|
19
|
+
- Add entry in the appropriate section of `getSampleComponentMap()`
|
|
20
|
+
|
|
21
|
+
Ensure the build passes after adding the component.
|