@pega/sdk 0.0.13 → 0.0.15

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.
Files changed (139) hide show
  1. package/README.md +46 -6
  2. package/dist/index.js +50 -24
  3. package/package.json +42 -3
  4. package/templates/angular-sdk-reference/extra-webpack.config.cjs +23 -0
  5. package/templates/angular-sdk-reference/index.html +12 -0
  6. package/templates/angular-sdk-reference/src/app/pconnect-renderer.component.ts +153 -0
  7. package/templates/angular-sdk-reference/src/components/component-map.ts +90 -0
  8. package/templates/angular-sdk-reference/src/components/fields/auto-complete/auto-complete.component.ts +304 -0
  9. package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts +89 -0
  10. package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts +112 -0
  11. package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts +101 -0
  12. package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts +118 -0
  13. package/templates/angular-sdk-reference/src/components/fields/email/email.component.ts +104 -0
  14. package/templates/angular-sdk-reference/src/components/fields/integer/integer.component.ts +106 -0
  15. package/templates/angular-sdk-reference/src/components/fields/phone/phone.component.ts +104 -0
  16. package/templates/angular-sdk-reference/src/components/fields/radio-buttons/radio-buttons.component.ts +113 -0
  17. package/templates/angular-sdk-reference/src/components/fields/text-area/text-area.component.ts +111 -0
  18. package/templates/angular-sdk-reference/src/components/fields/text-input/text-input.component.ts +110 -0
  19. package/templates/angular-sdk-reference/src/components/fields/url-input/url-input.component.ts +113 -0
  20. package/templates/angular-sdk-reference/src/components/helpers/sdk-helpers.ts +93 -0
  21. package/templates/angular-sdk-reference/src/components/infra/assignment/assignment.component.ts +206 -0
  22. package/templates/angular-sdk-reference/src/components/infra/case-summary/case-summary.component.ts +75 -0
  23. package/templates/angular-sdk-reference/src/components/infra/case-view/case-view.component.ts +126 -0
  24. package/templates/angular-sdk-reference/src/components/infra/flow-container/flow-container.component.ts +411 -0
  25. package/templates/angular-sdk-reference/src/components/infra/reference/reference.component.ts +158 -0
  26. package/templates/angular-sdk-reference/src/components/infra/region/region.component.ts +39 -0
  27. package/templates/angular-sdk-reference/src/components/infra/root-container/root-container.component.ts +199 -0
  28. package/templates/angular-sdk-reference/src/components/infra/stages/stages.component.ts +89 -0
  29. package/templates/angular-sdk-reference/src/components/infra/view/view.component.ts +144 -0
  30. package/templates/angular-sdk-reference/src/components/infra/view-container/view-container.component.ts +191 -0
  31. package/templates/angular-sdk-reference/src/components/templates/default-form/default-form.component.ts +105 -0
  32. package/templates/angular-sdk-reference/src/components/templates/narrow-wide/narrow-wide.component.ts +37 -0
  33. package/templates/angular-sdk-reference/src/components/templates/one-column/one-column.component.ts +37 -0
  34. package/templates/angular-sdk-reference/src/components/templates/two-column/two-column.component.ts +37 -0
  35. package/templates/angular-sdk-reference/src/components/templates/wide-narrow/wide-narrow.component.ts +37 -0
  36. package/templates/angular-sdk-reference/tsconfig.app.json +13 -0
  37. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +75 -34
  38. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +74 -38
  39. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +33 -1
  40. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +57 -22
  41. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +25 -10
  42. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +40 -19
  43. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +62 -1
  44. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +26 -4
  45. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +84 -33
  46. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +46 -26
  47. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +28 -15
  48. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +24 -6
  49. package/templates/react-sdk-reference/.ai-common/prompts/generate-infra-components.md +24 -6
  50. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +24 -6
  51. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +24 -6
  52. package/templates/react-sdk-reference/.ai-common/prompts/identify-components.md +2 -0
  53. package/templates/react-sdk-reference/.ai-common/prompts/replace-design-system.md +44 -17
  54. package/templates/react-sdk-reference/.ai-common/skills/connect-pega-server.md +14 -1
  55. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AssignmentHeader.md +79 -0
  56. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Toast.md +96 -0
  57. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +56 -35
  58. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +29 -3
  59. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +97 -37
  60. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +91 -60
  61. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +88 -30
  62. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +133 -101
  63. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedData.md +385 -0
  64. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedDataMulti.md +506 -0
  65. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +549 -86
  66. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +181 -83
  67. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +13 -1
  68. package/templates/react-sdk-reference/.ai-common/skills/portal-flow/run-and-verify-portal.md +290 -0
  69. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +13 -1
  70. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +125 -153
  71. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +90 -81
  72. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +13 -1
  73. package/templates/react-sdk-reference/assets/icons/trash.svg +3 -0
  74. package/templates/react-sdk-reference/index.html +0 -1
  75. package/templates/react-sdk-reference/package.json +2 -2
  76. package/templates/react-sdk-reference/package.minimal.json +2 -2
  77. package/templates/react-sdk-reference/sdk-config.json +3 -3
  78. package/templates/react-sdk-reference/src/FallbackComponent.tsx +1 -1
  79. package/templates/react-sdk-reference/src/MashupApp.tsx +33 -78
  80. package/templates/react-sdk-reference/src/PortalApp.tsx +23 -100
  81. package/templates/react-sdk-reference/src/components/component-map.ts +15 -1
  82. package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/AssignmentHeader.tsx +15 -0
  83. package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/index.tsx +1 -0
  84. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +1 -1
  85. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  86. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +16 -4
  87. package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/ModalDialog.tsx +26 -0
  88. package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/index.tsx +1 -0
  89. package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/Toast.tsx +35 -0
  90. package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/index.tsx +1 -0
  91. package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +362 -24
  92. package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +1 -1
  93. package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +3 -1
  94. package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +6 -3
  95. package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +2 -1
  96. package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +2 -1
  97. package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +4 -3
  98. package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +2 -0
  99. package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +2 -1
  100. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/EmbeddedDataMulti.tsx +121 -0
  101. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/config-ext.json +7 -0
  102. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/index.tsx +1 -0
  103. package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +2 -1
  104. package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +1 -1
  105. package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +40 -20
  106. package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +554 -49
  107. package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -20
  108. package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +4 -3
  109. package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +2 -1
  110. package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +2 -1
  111. package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +2 -1
  112. package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +2 -1
  113. package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +2 -1
  114. package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +2 -1
  115. package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +1 -1
  116. package/templates/react-sdk-reference/src/components/helpers/field-utils.ts +44 -0
  117. package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +19 -7
  118. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +97 -0
  119. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/index.tsx +1 -0
  120. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +53 -0
  121. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  122. package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +2 -2
  123. package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +3 -1
  124. package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +4 -4
  125. package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +2 -2
  126. package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +1 -1
  127. package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +7 -3
  128. package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +173 -99
  129. package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +63 -56
  130. package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +1 -1
  131. package/templates/react-sdk-reference/vite.config.ts +26 -4
  132. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +0 -47
  133. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +0 -50
  134. package/templates/react-sdk-reference/.ai-common/instructions/infra-component.md +0 -76
  135. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +0 -43
  136. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +0 -45
  137. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +0 -311
  138. package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
  139. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
@@ -1,6 +1,8 @@
1
+ import { useLayoutEffect } from 'react';
1
2
  import { getComponentFromRegistry } from '@pega/sdk-react';
2
3
 
3
4
  import type { PConnProps } from '@pega/sdk-react';
5
+ import { getFieldMeta } from '../../DataReference/utils';
4
6
 
5
7
  interface SimpleTableSelectProps extends PConnProps {
6
8
  // If any, enter additional props that only exist on this component
@@ -13,110 +15,97 @@ interface SimpleTableSelectProps extends PConnProps {
13
15
  parameters: any;
14
16
  readonlyContextList: object[] | string;
15
17
  dataRelationshipContext: string;
18
+ defaultRowHeight: string | number;
19
+ showPromotedFilters: boolean;
20
+ displayAs: string;
21
+ contextPage: object;
22
+ toggleFieldVisibility: boolean;
16
23
  }
17
24
 
18
- const isSelfReferencedProperty = (param, referenceProp) => {
19
- const [, parentPropName] = param.split('.');
20
- return parentPropName === referenceProp;
21
- };
22
-
23
- /**
24
- * SimpleTable react component
25
- * @param {*} props - props
26
- */
27
- export default function SimpleTableSelect(props: SimpleTableSelectProps) {
25
+ function SelectableTable(props: SimpleTableSelectProps) {
28
26
  // Get emitted components from map (so we can get any override that may exist)
29
27
  const ListView = getComponentFromRegistry('ListView');
30
- const SimpleTable = getComponentFromRegistry('SimpleTable');
31
28
  const PromotedFilters = getComponentFromRegistry('PromotedFilters');
32
29
 
33
30
  const {
34
31
  label,
35
32
  getPConnect,
36
- renderMode = '',
37
33
  showLabel = true,
38
34
  viewName = '',
39
35
  parameters,
40
36
  dataRelationshipContext = null,
37
+ referenceList,
38
+ showPromotedFilters,
39
+ displayAs,
40
+ readonlyContextList,
41
+ contextPage,
42
+ toggleFieldVisibility,
41
43
  } = props;
42
44
 
45
+ const pConn = getPConnect();
46
+
43
47
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
44
48
  if (propsToUse.showLabel === false) {
45
49
  propsToUse.label = '';
46
50
  }
47
51
 
48
- const pConn = getPConnect();
52
+ const { compositeKeys, fieldMetadata } = getFieldMeta(getPConnect, dataRelationshipContext);
53
+ const { pageClass } = fieldMetadata;
54
+
49
55
  const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
50
56
  const { selectionMode, selectionList } = pConn.getConfigProps() as any;
51
57
  const isMultiSelectMode = selectionMode === MULTI;
52
58
 
53
- if (isMultiSelectMode && renderMode === 'ReadOnly') {
54
- return <SimpleTable {...props} showLabel={propsToUse.showLabel} />;
55
- }
56
-
57
- const pageReference = pConn.getPageReference();
58
- let referenceProp = isMultiSelectMode
59
- ? selectionList.substring(1)
60
- : pageReference.substring(pageReference.lastIndexOf('.') + 1);
61
- // Replace here to use the context name instead
62
- let contextPageReference: string | null = null;
63
- if (props.dataRelationshipContext !== null && selectionMode === 'single') {
64
- referenceProp = dataRelationshipContext;
65
- contextPageReference = pageReference.concat('.').concat(referenceProp);
66
- }
67
-
68
- // Need to get this written so typedefs work
69
- const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode
70
- ? pConn.getFieldMetadata(`@P .${referenceProp}`)
71
- : pConn.getCurrentPageFieldMetadata(contextPageReference);
72
-
73
- const compositeKeys: any[] = [];
74
- Object.values(fieldParameters).forEach((param: any) => {
75
- if (isSelfReferencedProperty(param, referenceProp)) {
76
- compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
59
+ useLayoutEffect(() => {
60
+ if (isMultiSelectMode) {
61
+ // register selectionList in c11nEnv stateProps for client side validation
62
+ (pConn as any).setStateProps({ selectionList });
63
+ (pConn.getListActions() as any).initDefaultPageInstructions(selectionList, compositeKeys);
77
64
  }
78
- });
79
-
80
- // setting default row height for select table
81
- const defaultRowHeight = '2';
82
-
83
- const additionalTableConfig = {
84
- rowDensity: false,
85
- enableFreezeColumns: false,
86
- autoSizeColumns: false,
87
- resetColumnWidths: false,
65
+ }, []);
66
+
67
+ const isFullTable = displayAs === 'table' || displayAs === 'advancedSearch';
68
+ const additionalTableConfig: any = {
69
+ rowDensity: isFullTable,
70
+ enableFreezeColumns: isFullTable,
71
+ autoSizeColumns: isFullTable,
72
+ resetColumnWidths: isFullTable,
88
73
  defaultFieldDef: {
89
- showMenu: false,
90
- noContextMenu: true,
91
- grouping: false,
74
+ aggregation: false,
92
75
  },
93
76
  itemKey: '$key',
94
- defaultRowHeight,
95
77
  };
96
78
 
79
+ const searchFields = (pConn as any).getRawConfigProps?.()?.searchFields ?? [];
80
+ let selectedValues: any = isMultiSelectMode ? readonlyContextList : contextPage;
81
+
82
+ if (displayAs === 'advancedSearch') {
83
+ selectedValues = null;
84
+ }
85
+
97
86
  const listViewProps = {
98
87
  ...props,
99
88
  title: propsToUse.label,
100
89
  personalization: false,
101
90
  grouping: false,
102
91
  expandGroups: false,
103
- reorderFields: false,
104
92
  showHeaderIcons: false,
105
93
  editing: false,
106
94
  globalSearch: true,
107
- toggleFieldVisibility: false,
95
+ toggleFieldVisibility: isFullTable && toggleFieldVisibility,
108
96
  basicMode: true,
109
97
  additionalTableConfig,
110
98
  compositeKeys,
111
99
  viewName,
112
100
  parameters,
101
+ searchFields,
102
+ selectedValues,
103
+ isAdvancedSearchAndSelect: displayAs === 'advancedSearch',
113
104
  };
114
105
 
115
106
  const filters = (getPConnect().getRawMetadata() as any).config.promotedFilters ?? [];
116
107
 
117
- const isSearchable = filters.length > 0;
118
-
119
- if (isSearchable) {
108
+ if (showPromotedFilters && filters.length > 0) {
120
109
  return (
121
110
  <PromotedFilters
122
111
  getPConnect={getPConnect}
@@ -125,8 +114,26 @@ export default function SimpleTableSelect(props: SimpleTableSelectProps) {
125
114
  listViewProps={listViewProps}
126
115
  pageClass={pageClass}
127
116
  parameters={parameters}
117
+ referenceList={referenceList}
128
118
  />
129
119
  );
130
120
  }
131
121
  return <ListView {...listViewProps} />;
132
122
  }
123
+
124
+ export default function SimpleTableSelect(props: SimpleTableSelectProps) {
125
+ const SimpleTableManual = getComponentFromRegistry('SimpleTableManual');
126
+
127
+ const { getPConnect, renderMode = '' } = props;
128
+
129
+ const pConn = getPConnect();
130
+ const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
131
+ const { selectionMode } = pConn.getConfigProps() as any;
132
+ const isMultiSelectMode = selectionMode === MULTI;
133
+
134
+ if (isMultiSelectMode && renderMode === 'ReadOnly') {
135
+ return <SimpleTableManual {...props} />;
136
+ }
137
+
138
+ return <SelectableTable {...props} />;
139
+ }
@@ -392,7 +392,7 @@ export default function ToDo(props: ToDoProps) {
392
392
  {type === CONSTS.TODO && isConfirm && <>{toDoContent}</>}
393
393
 
394
394
  {getCount() > 3 && (
395
- <Box display="flex" justifyContent="center">
395
+ <Box sx={{ display: 'flex', justifyContent: 'center' }}>
396
396
  {bShowMore ? (
397
397
  <Button color="primary" onClick={_showMore}>
398
398
  {showMoreLocalizedValue === 'show_more' ? 'Show more' : showMoreLocalizedValue}
@@ -25,9 +25,12 @@ export default defineConfig({
25
25
  const urlPath = (req.url ?? '').split('?')[0];
26
26
  let srcFile: string | undefined;
27
27
 
28
- // /constellation/<file> → constellationDist/<file>
29
- const constRoot = urlPath.match(/^\/constellation\/([^/]+)$/);
30
- if (constRoot) srcFile = path.join(constellationDist, constRoot[1]);
28
+ // /constellation/<path> → constellationDist/<path> (bootstrap-shell.js, core, lazy chunks)
29
+ const constAny = urlPath.match(/^\/constellation\/(.+)$/);
30
+ if (constAny) {
31
+ const resolved = path.join(constellationDist, constAny[1]);
32
+ if (resolved.startsWith(constellationDist + path.sep)) srcFile = resolved;
33
+ }
31
34
 
32
35
  // /constellation/prerequisite/<path> → constellationDist/<path>
33
36
  const constPre = urlPath.match(/^\/constellation\/prerequisite\/(.+)$/);
@@ -66,19 +69,38 @@ export default defineConfig({
66
69
  {
67
70
  src: path.join(authLibDir, 'authDone.html'),
68
71
  dest: '.',
69
- rename: 'auth.html',
72
+ rename: { stripBase: true, name: 'auth.html' },
70
73
  },
71
74
  {
72
75
  src: path.join(authLibDir, 'authDone.js'),
73
76
  dest: '.',
77
+ rename: { stripBase: true },
74
78
  },
75
79
  {
76
80
  src: 'sdk-config.json',
77
81
  dest: '.',
78
82
  },
83
+ // bootstrap-shell.js requests the core bundle and its lazy chunks from /constellation/prerequisite/
84
+ {
85
+ src: [path.join(constellationDist, 'bootstrap-shell.js'), path.join(constellationDist, 'lib_asset.json')],
86
+ dest: './constellation',
87
+ rename: { stripBase: true },
88
+ },
89
+ {
90
+ src: path.join(constellationDist, 'constellation-core.*.js'),
91
+ dest: './constellation/prerequisite',
92
+ rename: { stripBase: true },
93
+ },
94
+ {
95
+ // Keeps the js/ folder: strips node_modules/@pega/constellationjs/dist
96
+ src: path.join(constellationDist, 'js'),
97
+ dest: './constellation/prerequisite',
98
+ rename: { stripBase: 4 },
99
+ },
79
100
  {
80
101
  src: 'assets/**/*',
81
102
  dest: './constellation',
103
+ rename: { stripBase: 1 },
82
104
  },
83
105
  ],
84
106
  }),
@@ -1,47 +0,0 @@
1
- ---
2
- ai-globs: **/{AlertBanner,Banner,CaseSummaryFields,DetailsFields,FieldGroup,FieldGroupList,FieldValueList,Operator,Pulse,RichTextEditor,WssQuickCreate}/**/*
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 a PConnect accessor, 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
- These components extend the base PConnect props interface and receive a PConnect accessor. FieldValueList additionally accepts `name`, `value`, and an optional `variant` (`'stacked'` | `'inline'`) prop that controls its layout — it renders a label-value pair.
20
-
21
- ### Pattern B: Without PConnect (pure presentation)
22
-
23
- Used for: AlertBanner, Banner, Operator
24
-
25
- These components receive only plain display props — no PConnect awareness. AlertBanner accepts a `variant` (`'urgent'` | `'warning'` | `'info'` | `'success'`), an optional `heading`, a `messages` array (strings or `{ label, description }` objects), and an optional `onClose` callback.
26
-
27
- ### Pattern C: Rich editor (extends field props)
28
-
29
- Used for: RichTextEditor
30
-
31
- This component extends the base field props interface (the same interface used by field components) and adds a `content` prop.
32
-
33
- ## Visual Preservation
34
-
35
- The replacement must look the same as the original component:
36
-
37
- 1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
38
- 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.
39
- 3. Do NOT silently drop legacy styling utility classes — map each one to an equivalent style.
40
-
41
- ## Key Rules
42
-
43
- - DSE components are the **most commonly referenced by other components** via the project's component registry — every field uses FieldValueList for display modes
44
- - Keep the same export convention and prop interface shape used elsewhere in the project
45
- - If you replace FieldValueList, ensure it accepts `name`, `value`, and optional `variant` props
46
- - AlertBanner must handle the `messages` array format (both strings and `{label, description}` objects)
47
- - Do NOT drop visual styles when removing legacy styling utility classes — always map them to an equivalent
@@ -1,50 +0,0 @@
1
- ---
2
- ai-globs: **/{AutoComplete,CancelAlert,Checkbox,Currency,Date,DateTime,Decimal,Dropdown,Email,Group,Integer,Location,Multiselect,ObjectReference,Percentage,Phone,RadioButtons,RichText,ScalarList,SelectableCard,SemanticLink,TextArea,TextContent,TextInput,Time,URL,UserReference}/**/*
3
- ---
4
-
5
- # Field Component Rules
6
-
7
- When creating or modifying field components, follow these rules:
8
-
9
- ## Required Structure
10
-
11
- 1. **Extend the base field props interface** — the project's standard field props type — when defining the component's prop interface.
12
-
13
- 2. **Export the component** using the project's standard export convention (matching other field components in the project).
14
-
15
- ## Required Behaviors
16
-
17
- 1. **Extract standard props**: `getPConnect`, `label`, `required`, `disabled`, `value`, `validatemessage`, `status`, `readOnly`, `testId`, `helperText`, `displayMode`, `hideLabel`, `placeholder`
18
-
19
- 2. **Get PConnect APIs**: obtain the actions API and the current property name from the PConnect accessor (`getPConnect()` → actions API, state props).
20
-
21
- 3. **Handle displayMode** (MUST be before the main return):
22
- - When `displayMode` is `DISPLAY_ONLY`, render the value via the project's field-value display component (unlabeled if `hideLabel` is set).
23
- - When `displayMode` is `STACKED_LARGE_VAL`, render the same display component with a `stacked` variant.
24
-
25
- 4. **Use local state + blur pattern**:
26
- - `onChange` → update local state only
27
- - `onBlur` → call the event helper with a `changeNblur` action, the property name, and the local value
28
-
29
- 5. **Show validation**: Display `validatemessage` and apply error styling when `status === 'error'`
30
-
31
- 6. **Pass test ID**: Set the test id attribute on the interactive element using the `testId` prop
32
-
33
- 7. **Use the component registry to look up the field-value display component** — never hardcode its import
34
-
35
- ## Visual Preservation
36
-
37
- The replacement must look the same as the original component:
38
-
39
- 1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
40
- 2. Replicate those styles via inline `style` props, the design system's component props/variants, or by keeping the CSS import — whichever produces the closest match.
41
- 3. Do NOT silently drop legacy styling utility classes — map each one to an equivalent style.
42
-
43
- ## Do NOT
44
-
45
- - Skip `displayMode` handling — it breaks read-only views
46
- - Call the blur handler on every keystroke — only on blur
47
- - Hardcode component imports for components that exist in the registry
48
- - Remove the import of the event handling helper module
49
- - Drop visual styles when removing legacy styling utility classes — always map them to an equivalent
50
- - **Import the same symbol twice from the shared field utilities module** — if you import a type or helper in one import statement, do NOT add a separate import line for the same symbol elsewhere. This causes "already defined" errors. Use a single consolidated import.
@@ -1,76 +0,0 @@
1
- ---
2
- ai-globs: **/{ActionButtons,DashboardFilter,DeferLoad,MultiStep,NavBar,Stages,VerticalTabs}/**/*
3
- ---
4
-
5
- # Infrastructure (Chrome) Component Rules
6
-
7
- When creating or modifying infrastructure components, follow these rules:
8
-
9
- ## What Are Infrastructure Components?
10
-
11
- Infrastructure components are the chrome the Pega runtime draws _around_ a case or an assignment — the action button row, the stage progress indicator, the step navigation — rather than the fields inside it. They differ from every other category in one important way: **they already exist**. Generating one produces an override of the SDK's implementation.
12
-
13
- ## What May Be Generated
14
-
15
- | Component | Role | Generate? |
16
- | ------------- | ---------------------------------------------------- | --------- |
17
- | ActionButtons | The Cancel / Save / Submit row beneath an assignment | Yes |
18
- | Stages | The case stage progress indicator | Yes |
19
- | MultiStep | Step navigation within a multi-step assignment | Yes |
20
-
21
- ⛔ `NavBar`, `DeferLoad`, `VerticalTabs`, and `DashboardFilter` are structural plumbing tied to the SDK's own internals. They are always sourced from the SDK adapter package and are **never** generated. If a request names one, skip it and say why. This list never grows.
22
-
23
- ## Patterns
24
-
25
- ### Display-only chrome (no PConnect accessor)
26
-
27
- Used for: ActionButtons
28
-
29
- Receives everything it needs as plain display props and reports interaction through a supplied callback. It holds no local state and reads nothing from the store. This is the one exception to the rule that every Pega component receives the PConnect accessor — do not add one to it.
30
-
31
- ### Case-aware chrome (PConnect accessor, read-only)
32
-
33
- Used for: Stages
34
-
35
- Receives the accessor so it can read case state and localize, but never writes. Normalize the runtime's raw input through the SDK utility the component's skill file documents, read case-level state using the runtime's constants rather than literal property names, and derive a display model before rendering.
36
-
37
- ### Container chrome (renders children)
38
-
39
- Used for: MultiStep
40
-
41
- Wraps the form content the runtime hands it and arranges other Pega components around it. Resolve every Pega sub-component through the project's component registry, derive which part of the structure is active from the runtime's state flags (applying the documented fallback when nothing is marked active), and forward the accessor, item key, button definitions, and press callback to the resolved sub-component unchanged.
42
-
43
- ## The Contract Is Fixed
44
-
45
- Inputs, callback signatures, derivation logic, and localization come from the SDK component being replaced. **Only markup and styling are yours to change.**
46
-
47
- - Do not rename inputs or reshape callback signatures.
48
- - Treat every array input as optional and default it to empty.
49
- - Keep repeated elements stable — every item in a rendered collection needs a stable identity.
50
-
51
- ## Localization
52
-
53
- Every label an infrastructure component renders comes from Pega, not from the component. Button and action labels resolve through the Pega locale utilities using the locale category the SDK component uses; case and stage names resolve through the localization service on the PConnect accessor. The value arriving in the input is a key, not display text — rendering it directly looks correct in an English environment and breaks in every other one.
54
-
55
- ## Visual Preservation
56
-
57
- The replacement must look the same as the original component:
58
-
59
- 1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
60
- 2. Replicate those styles via the new design system's props/variants, inline styles, or by keeping the CSS import — whichever produces the closest match.
61
- 3. Do NOT silently drop legacy styling utility classes — map each one to an equivalent style.
62
-
63
- ## Registration
64
-
65
- ⛔ **Ordering is load-bearing for this category.** An infra entry is an override of a component the SDK already contributes, so it must be listed **after** the SDK's built-in component spread. Listed before it, the spread replaces it and the override silently does nothing.
66
-
67
- Never remove the spread — it supplies the infrastructure components that are not overridable, and removing it breaks rendering entirely.
68
-
69
- ## Key Rules
70
-
71
- - Only `ActionButtons`, `Stages`, and `MultiStep` may be generated
72
- - The three do not share an input shape — take each one's inputs from its own skill file
73
- - Chrome is display-only — these components report interaction through the callback they were given and never write to the store
74
- - Resolve sub-components from the registry, never by direct import, or customer overrides are discarded
75
- - Derive the display model from the runtime's raw inputs first, then render it — this is what keeps the component portable across design systems
76
- - Case chrome is not assignment chrome — `Stages` belongs to the case view and never appears inside an embedded assignment; `ActionButtons` and `MultiStep` do
@@ -1,43 +0,0 @@
1
- ---
2
- ai-globs: **/{AdvancedSearch,AppShell,BannerPage,CaseSummary,CaseView,CaseViewActionsMenu,Confirmation,DataReference,DefaultForm,DefaultPage,Details,FieldGroupTemplate,HierarchicalForm,InlineDashboard,InlineDashboardPage,ListPage,ListView,MultiReferenceReadOnly,NarrowWide,ObjectPage,OneColumn,PromotedFilters,SelfServiceCaseView,SimpleTable,SingleReferenceReadOnly,SubTabs,TwoColumn,WideNarrow,WssNavBar,SearchForm,SearchGroups}/**/*
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. **Extend the base template props interface** — the project's standard props type — when defining the component's prop interface.
12
-
13
- 2. **Export the component** using the project's standard export convention.
14
-
15
- ## Template Categories
16
-
17
- ### Layout Templates (TwoColumn, OneColumn, NarrowWide, WideNarrow)
18
-
19
- Receive child components directly via the props. Parse the `templateCol` prop (e.g. `"1fr 1fr"`, `"2fr 1fr"`) to compute column ratios, then render each child in its corresponding column.
20
-
21
- ### Form/View Templates (DefaultForm, Details, CaseView)
22
-
23
- Render children by retrieving them from the PConnect accessor (`getPConnect().getChildren()`) and rendering each child through the project's PConnect-bridge component.
24
-
25
- ### Page Templates (OneColumnPage, TwoColumnPage)
26
-
27
- Wrap a layout with page-level chrome (title, actions) — retrieve case/page metadata from the PConnect accessor and render it alongside the layout's children.
28
-
29
- ## Visual Preservation
30
-
31
- The replacement must look the same as the original component:
32
-
33
- 1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
34
- 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.
35
- 3. Do NOT silently drop legacy layout utility classes — map each one to an equivalent style.
36
-
37
- ## Key Rules
38
-
39
- - Use the project's PConnect-bridge component to render PConnect children
40
- - Grid proportions come from the `templateCol` prop — parse it to calculate column ratios
41
- - Templates must not call the event handling helper or interact with field state
42
- - Templates are layout-only — they arrange, not edit
43
- - Do NOT drop column gap, padding, or alignment styles when removing legacy layout primitives — replicate them in the replacement layout
@@ -1,45 +0,0 @@
1
- ---
2
- ai-globs: **/{AppAnnouncement,Attachment,CaseHistory,FileUtility,Followers,QuickCreate,SummaryItem,SummaryList,ToDo,ActionButtonsForFileUtil}/**/*
3
- ---
4
-
5
- # Widget Component Rules
6
-
7
- When creating or modifying widget components, follow these rules:
8
-
9
- ## Required Structure
10
-
11
- 1. **Extend the base widget props interface** — the project's standard props type, or the field props type if the widget behaves like a field (e.g. Attachment) — when defining the component's prop interface.
12
-
13
- 2. **Export the component** using the project's standard export convention.
14
-
15
- ## Widget Patterns
16
-
17
- ### Data-Fetching Widget (ToDo, CaseHistory, Followers)
18
-
19
- Fetches data from the platform's data pages on mount. Obtain the current context from the PConnect accessor, request the datasource via the platform's data page utility, and store the result in local state. Render the fetched data inside the widget's card/list presentation.
20
-
21
- ### Action Widget (ToDo)
22
-
23
- Triggers case actions. Retrieve the list of assignments using the platform's assignment helper (passing the PConnect accessor). Each assignment provides an `onClick` callback, urgency, name, and other display metadata.
24
-
25
- ### File Widget (Attachment, FileUtility)
26
-
27
- Handles file upload/download via the platform's attachment utility APIs — upload with progress/error callbacks and context, download by attachment id and context.
28
-
29
- ## Visual Preservation
30
-
31
- The replacement must look the same as the original component:
32
-
33
- 1. **Read any `.css` file in the directory first.** Note every class's visual intent (spacing, sizing, colors, layout).
34
- 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.
35
- 3. Do NOT silently drop legacy styling utility classes — map each one to an equivalent style.
36
-
37
- ## Key Rules
38
-
39
- - Widgets are self-contained — they manage their own data fetching
40
- - Use the platform's data page utility for data page access
41
- - Use the platform's attachment utility for file operations
42
- - Always handle loading and error states
43
- - Widgets may subscribe to platform events via the platform's pub/sub utility
44
- - Clean up subscriptions when the component unmounts
45
- - Do NOT drop card padding, list item spacing, or avatar sizing when removing legacy presentation components — replicate them in the replacement