@pega/react-sdk-overrides 0.25.3 → 0.25.4

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.
@@ -1,12 +1,11 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Editor } from '@tinymce/tinymce-react';
3
- import { FormControl, FormHelperText, InputLabel } from '@mui/material';
3
+ import { FormControl, FormHelperText, InputLabel, useTheme } from '@mui/material';
4
4
  import makeStyles from '@mui/styles/makeStyles';
5
5
 
6
6
  import { useAfterInitialEffect, useConsolidatedRef, useUID } from '@pega/react-sdk-components/lib/hooks';
7
- import { theme } from '@pega/react-sdk-components/lib/components/designSystemExtensi/theme';
8
7
 
9
- const useStyles = makeStyles(() => ({
8
+ const useStyles = makeStyles(theme => ({
10
9
  fieldLabel: {
11
10
  position: 'relative',
12
11
  transform: 'translate(0, 0px) scale(1)',
@@ -32,6 +31,7 @@ interface RichTextEditorProps {
32
31
  }
33
32
 
34
33
  const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorProps, ref) {
34
+ const theme = useTheme();
35
35
  const classes = useStyles();
36
36
  const uid = useUID();
37
37
  const { id = uid, defaultValue, label, labelHidden, info, testId, placeholder, disabled, required, readOnly, error, onBlur, onChange } = props;
@@ -91,27 +91,27 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
91
91
  skin: 'oxide-dark', // or 'oxide' for light theme
92
92
  // ...other TinyMCE config...
93
93
  content_style: `
94
- body {
95
- font-family: ${theme.typography.fontFamily};
96
- font-size: ${theme.typography.fontSize}px;
97
- color: ${theme.palette.text.primary};
98
- background: ${theme.palette.background.paper};
99
- }
100
- a { color: ${theme.palette.primary.main}; }
101
- h1, h2, h3, h4, h5, h6 { color: ${theme.palette.text.primary}; font-family: ${theme.typography.fontFamily}; }
102
- blockquote { color: ${theme.palette.text.secondary}; border-left: 4px solid ${theme.palette.primary.light}; padding-left: 8px; }
103
- ul, ol { color: ${theme.palette.text.primary}; }
104
- input, textarea, select {
105
- background: ${theme.palette.background.paper};
106
- color: ${theme.palette.text.primary};
107
- border: 1px solid ${theme.palette.divider};
108
- border-radius: 4px;
109
- padding: 6px 10px;
110
- font-size: 1em;
111
- font-family: inherit;
112
- }
113
- /* Add more styles as needed */
114
- `,
94
+ body {
95
+ font-family: ${theme.typography.fontFamily};
96
+ font-size: ${theme.typography.fontSize}px;
97
+ color: ${theme.palette.text.primary};
98
+ background: ${theme.palette.background.paper};
99
+ }
100
+ a { color: ${theme.palette.primary.main}; }
101
+ h1, h2, h3, h4, h5, h6 { color: ${theme.palette.text.primary}; font-family: ${theme.typography.fontFamily}; }
102
+ blockquote { color: ${theme.palette.text.secondary}; border-left: 4px solid ${theme.palette.primary.light}; padding-left: 8px; }
103
+ ul, ol { color: ${theme.palette.text.primary}; }
104
+ input, textarea, select {
105
+ background: ${theme.palette.background.paper};
106
+ color: ${theme.palette.text.primary};
107
+ border: 1px solid ${theme.palette.divider};
108
+ border-radius: 4px;
109
+ padding: 6px 10px;
110
+ font-size: 1em;
111
+ font-family: inherit;
112
+ }
113
+ /* Add more styles as needed */
114
+ `,
115
115
  placeholder,
116
116
  menubar: false,
117
117
  statusbar: false,
@@ -238,7 +238,7 @@ export const buildFieldsForTable = (configFields, pConnect, showDeleteButton, op
238
238
 
239
239
  // get resolved field labels for primary fields raw config included in configFields
240
240
  const fieldsLabels = updateFieldLabels(fields, configFields, primaryFieldsViewIndex, pConnect, {
241
- columnsRawConfig: pConnect.getRawConfigProps()?.children.find(item => item?.name === 'Columns')?.children
241
+ columnsRawConfig: pConnect.getRawConfigProps()?.children?.find(item => item?.name === 'Columns')?.children
242
242
  });
243
243
 
244
244
  const fieldDefs = configFields.map((field, index) => {
@@ -0,0 +1,88 @@
1
+ import { useMemo, Children } from 'react';
2
+ import type { ReactNode } from 'react';
3
+ import Banner from '@pega/react-sdk-components/lib/components/designSystemExtension/Banner';
4
+
5
+ export interface CommonPageProps {
6
+ /** Page title */
7
+ title: string;
8
+
9
+ /** Page icon */
10
+ icon: string;
11
+
12
+ /** Region children */
13
+ children: ReactNode | ReactNode[];
14
+
15
+ /** Dynamic page pconnect object */
16
+ // getPConnect: () => PConnect;
17
+
18
+ /** Enable GetNextWork in page */
19
+ enableGetNextWork?: boolean;
20
+
21
+ /** GetAI coaches configured in page */
22
+ // coaches?: GenAICoach[];
23
+
24
+ /** Locale reference */
25
+ localeReference: string;
26
+ }
27
+ interface DefaultPageProps extends CommonPageProps {
28
+ /** Default page layout one or two columns */
29
+ layout: 'one-column' | 'two-column' | 'wide-narrow' | 'narrow-wide' | 'dynamic';
30
+
31
+ /** Flag to enable banner/hero */
32
+ enableBanner?: boolean;
33
+
34
+ /** Banner - Heading displayed */
35
+ heading?: string;
36
+
37
+ /** Banner - Message displayed */
38
+ message?: string;
39
+
40
+ /** Banner - Theme of the image */
41
+ imageTheme?: 'light' | 'dark' | undefined;
42
+
43
+ /** Banner - Background image */
44
+ backgroundImage?: string;
45
+
46
+ /** Banner - Background color */
47
+ backgroundColor?: string;
48
+
49
+ /** Banner - Tint image */
50
+ tintImage?: boolean;
51
+
52
+ /** Flag to enable layout model */
53
+ // layoutModel?: GridLayoutModel | undefined;
54
+ }
55
+
56
+ export default function DefaultPage({
57
+ layout = 'one-column',
58
+ children,
59
+ enableBanner,
60
+ heading = '',
61
+ message = '',
62
+ imageTheme,
63
+ backgroundImage = '',
64
+ backgroundColor = '',
65
+ tintImage
66
+ }: DefaultPageProps) {
67
+ const childArray = useMemo(() => {
68
+ return Children.toArray(children);
69
+ }, [children]);
70
+
71
+ if (enableBanner) {
72
+ return (
73
+ <Banner
74
+ variant={layout === 'one-column' ? 'two-column' : layout}
75
+ a={[childArray[0]]}
76
+ b={[childArray[1]]}
77
+ banner={{
78
+ variant: imageTheme,
79
+ backgroundColor,
80
+ title: heading,
81
+ message,
82
+ backgroundImage,
83
+ tintImage
84
+ }}
85
+ />
86
+ );
87
+ }
88
+ }
@@ -0,0 +1 @@
1
+ export { default } from './DefaultPage';
@@ -0,0 +1,3 @@
1
+ export default function SelfServiceCaseView(props) {
2
+ console.log('SelfServiceCaseView props:', props);
3
+ }
@@ -0,0 +1 @@
1
+ export { default } from './SelfServiceCaseView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/react-sdk-overrides",
3
- "version": "0.25.3",
3
+ "version": "0.25.4",
4
4
  "description": "React SDK - Code for overriding components",
5
5
  "_filesComment": "During packing, npm ignores everything NOT in the files list",
6
6
  "files": [