@pega/custom-dx-components 0.242.18 → 0.242.20

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 (73) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/src/constants.js +2 -1
  4. package/src/tasks/build-lib/index.js +52 -58
  5. package/src/tasks/bundle/builder/index.js +26 -19
  6. package/src/tasks/bundle/index.js +3 -2
  7. package/src/tasks/create/templates/Constellation/Field/Boolean/create-nonce.ts.mustache +6 -0
  8. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -0
  9. package/src/tasks/create/templates/Constellation/Field/Date/create-nonce.ts.mustache +6 -0
  10. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +1 -0
  11. package/src/tasks/create/templates/Constellation/Field/DateTime/create-nonce.ts.mustache +6 -0
  12. package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +1 -0
  13. package/src/tasks/create/templates/Constellation/Field/Decimal/create-nonce.ts.mustache +6 -0
  14. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -0
  15. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/create-nonce.ts.mustache +6 -0
  16. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +1 -0
  17. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/create-nonce.ts.mustache +6 -0
  18. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -0
  19. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/create-nonce.ts.mustache +6 -0
  20. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +15 -15
  21. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +1 -0
  22. package/src/tasks/create/templates/Constellation/Field/Integer/create-nonce.ts.mustache +6 -0
  23. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +1 -0
  24. package/src/tasks/create/templates/Constellation/Field/Picklist/create-nonce.ts.mustache +6 -0
  25. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +1 -0
  26. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/create-nonce.ts.mustache +6 -0
  27. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -0
  28. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/create-nonce.ts.mustache +6 -0
  29. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +1 -0
  30. package/src/tasks/create/templates/Constellation/Field/Text/create-nonce.ts.mustache +6 -0
  31. package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +1 -0
  32. package/src/tasks/create/templates/Constellation/Field/Text-Email/create-nonce.ts.mustache +6 -0
  33. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +1 -0
  34. package/src/tasks/create/templates/Constellation/Field/Text-Input/create-nonce.ts.mustache +6 -0
  35. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +1 -0
  36. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/create-nonce.ts.mustache +6 -0
  37. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +1 -0
  38. package/src/tasks/create/templates/Constellation/Field/Text-Phone/create-nonce.ts.mustache +6 -0
  39. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +1 -0
  40. package/src/tasks/create/templates/Constellation/Field/Text-URL/create-nonce.ts.mustache +6 -0
  41. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +1 -0
  42. package/src/tasks/create/templates/Constellation/Field/TimeofDay/create-nonce.ts.mustache +6 -0
  43. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +1 -0
  44. package/src/tasks/create/templates/Constellation/Template/DETAILS/create-nonce.ts.mustache +6 -0
  45. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +2 -0
  46. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/create-nonce.ts.mustache +6 -0
  47. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -0
  48. package/src/tasks/create/templates/Constellation/Template/FORM/create-nonce.ts.mustache +6 -0
  49. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +1 -0
  50. package/src/tasks/create/templates/Constellation/Template/FORM-region/create-nonce.ts.mustache +6 -0
  51. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +1 -0
  52. package/src/tasks/create/templates/Constellation/Template/PAGE/create-nonce.ts.mustache +6 -0
  53. package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +1 -0
  54. package/src/tasks/create/templates/Constellation/Widget/CASE/create-nonce.ts.mustache +6 -0
  55. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +23 -24
  56. package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +1 -0
  57. package/src/tasks/create/templates/Constellation/Widget/PAGE/create-nonce.ts.mustache +6 -0
  58. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +15 -17
  59. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +1 -0
  60. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/create-nonce.ts.mustache +6 -0
  61. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/create-nonce.ts.mustache +6 -0
  62. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +1 -0
  63. package/src/tasks/create/templates/Launchpad/Widget/CASE/create-nonce.ts.mustache +6 -0
  64. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +1 -0
  65. package/src/tasks/create/templates/Launchpad/Widget/PAGE/create-nonce.ts.mustache +6 -0
  66. package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +1 -0
  67. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/create-nonce.ts.mustache +6 -0
  68. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -0
  69. package/src/tasks/delete/helper.js +19 -3
  70. package/src/tasks/init/template/package.json.mustache +7 -6
  71. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +5 -3
  72. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +5 -3
  73. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +5 -3
package/README.md CHANGED
@@ -18,4 +18,4 @@ Ensure you have access to the following in your system:
18
18
 
19
19
  ## Latest Documentation
20
20
 
21
- Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/whats-new-constellation-dx-components-pega-infinity-23.html)
21
+ Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/whats-new-constellation-dx-component-builder.html)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.242.18",
3
+ "version": "0.242.20",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "@babel/plugin-transform-class-properties": "^7.23.3",
20
20
  "@babel/preset-react": "^7.23.3",
21
21
  "@pega/auth": "^0.1.6",
22
- "@pega/constellation-dx-components-build-utils": "^1.0.1-dev-0.13",
22
+ "@pega/constellation-dx-components-build-utils": "^1.0.1-dev-0.16",
23
23
  "ajv": "^8.12.0",
24
24
  "ajv-keywords": "^5.1.0",
25
25
  "archiver": "^7.0.1",
package/src/constants.js CHANGED
@@ -60,7 +60,8 @@ export const AUTHENTICATE_DEFAULTS = {
60
60
 
61
61
  export const SHARED_FILE_NAMES = [
62
62
  "suggestions-handler.ts",
63
- "PConnProps.d.ts"
63
+ "PConnProps.d.ts",
64
+ "create-nonce.ts"
64
65
  ];
65
66
 
66
67
  export const AUTHENTICATE_SCHEMA = {
@@ -1,54 +1,55 @@
1
- import inquirer from 'inquirer';
2
- import { Listr } from 'listr2';
3
- import chalk from 'chalk';
4
1
  import path from 'path';
5
2
  import fs from 'fs';
6
3
 
4
+ import inquirer from 'inquirer';
5
+ import { Listr } from 'listr2';
6
+ import chalk from 'chalk';
7
+ import { buildLib } from '@pega/constellation-dx-components-build-utils/index.js';
7
8
 
8
9
  import validate from '../validator/index.js';
9
10
  import { lintComponent } from '../linter/index.js';
10
- import { getComponentDirectoryPath, showVersion, getComponents, getLibraryBased, getC11NB2STokenAndStaticServer, updateComponentDefaultVersion, deleteLocalLibrary } from '../../util.js';
11
+ import {
12
+ getComponentDirectoryPath,
13
+ showVersion,
14
+ getComponents,
15
+ getLibraryBased,
16
+ getC11NB2STokenAndStaticServer,
17
+ updateComponentDefaultVersion
18
+ } from '../../util.js';
19
+ import bundleComponent from '../bundle/index.js';
11
20
 
12
21
  import { getBuildComponentQuestions, getOrgLib } from './helper.js';
13
- import { buildLib } from '@pega/constellation-dx-components-build-utils/index.js';
14
22
 
15
23
  const isLibraryBased = await getLibraryBased();
16
24
 
17
25
  export const updateConfigVersion = async (componentKey, buildVersion) => {
18
26
  const componentDirectory = await getComponentDirectoryPath(componentKey);
19
- let configFileName = "config.json";
27
+ const configFileName = 'config.json';
20
28
 
21
29
  const configFile = path.join(componentDirectory, configFileName);
22
30
  let configData;
23
31
  try {
24
32
  configData = fs.readFileSync(path.resolve(configFile), 'utf8');
25
- }
26
- catch (err) {
27
-
33
+ } catch (err) {
28
34
  // for now, if now file just end
29
- console.log(`${chalk.bold.yellow('Config file not availabe for: ' + componentToValidate)}`);
35
+ console.log(`${chalk.bold.yellow(`Config file not available for: ${componentKey}`)}`);
30
36
  return;
31
-
32
37
  }
33
38
 
34
39
  let data;
35
40
  try {
36
41
  data = JSON.parse(configData);
37
- }
38
- catch (er) {
42
+ } catch (er) {
39
43
  throw new Error(`Invalid schema json in config.json: ${er}`);
40
44
  }
41
45
 
42
46
  data.version = buildVersion;
43
47
 
44
48
  // write back file
45
- fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8' });
46
- }
47
-
48
-
49
- export function getCustomTasks(componentKey, devBuild, buildVersion, options) {
49
+ fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8' });
50
+ };
50
51
 
51
- const sDevBuild = devBuild ? '(dev build)' : '';
52
+ export function getCustomTasks(componentKey, devBuild, buildVersion) {
52
53
  return new Listr(
53
54
  [
54
55
  {
@@ -57,7 +58,7 @@ export function getCustomTasks(componentKey, devBuild, buildVersion, options) {
57
58
  await updateConfigVersion(componentKey, buildVersion);
58
59
  await validate(componentKey);
59
60
  },
60
- skip: () => (componentKey === "shared" ? true : false)
61
+ skip: () => componentKey === 'shared'
61
62
  },
62
63
  {
63
64
  title: 'Lint component',
@@ -67,32 +68,25 @@ export function getCustomTasks(componentKey, devBuild, buildVersion, options) {
67
68
  await lintComponent(targetDirectory);
68
69
  }
69
70
  }
70
-
71
71
  ],
72
72
  { concurrent: false, exitOnError: true }
73
73
  );
74
-
75
-
76
74
  }
77
75
 
78
-
79
-
80
-
81
- export default async (options) => {
76
+ export default async options => {
82
77
  if (!isLibraryBased) {
83
- console.log(`Command only supported for ${chalk.bold.green('library based')} components.`)
78
+ console.log(`Command only supported for ${chalk.bold.green('library based')} components.`);
84
79
  process.exit();
85
80
  }
86
81
 
87
82
  showVersion();
88
83
 
89
-
90
84
  const components = await getComponents();
91
85
 
92
86
  const compDef = await getOrgLib();
93
87
  const organization = compDef.organization;
94
88
  const library = compDef.library;
95
- const currentOrgLib = organization.concat("_").concat(library);
89
+ const currentOrgLib = organization.concat('_').concat(library);
96
90
 
97
91
  let version;
98
92
  let devBuild;
@@ -100,65 +94,65 @@ export default async (options) => {
100
94
  if (options.params.length >= 5) {
101
95
  version = options.params[3];
102
96
  const dBuild = options.params[4];
103
- devBuild = (dBuild === 'Y' ||
104
- dBuild === 'y' ||
105
- dBuild === true ||
106
- dBuild === 'true') ? true : false;
107
-
108
- }
109
- else {
110
-
111
- console.log(`\nLibrary ${chalk.bold.green(currentOrgLib)} `)
97
+ devBuild = !!(dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true');
98
+ } else {
99
+ console.log(`\nLibrary ${chalk.bold.green(currentOrgLib)} `);
112
100
  const questions = await getBuildComponentQuestions(compDef.version);
113
101
  const answers = await inquirer.prompt(questions);
114
102
  ({ version, devBuild } = answers);
115
103
  }
116
104
 
117
-
118
105
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
119
106
 
120
107
  if (tokenAndStaticServer.C11NB2S === undefined) {
121
- console.log(chalk.redBright("Need to authenticate, missing services token.\nBuilding a library requires authentication to acquire a token to build."));
108
+ console.log(
109
+ chalk.redBright(
110
+ 'Need to authenticate, missing services token.\nBuilding a library requires authentication to acquire a token to build.'
111
+ )
112
+ );
122
113
  process.exit(1);
123
-
124
114
  }
125
115
 
126
- const buildLibName = organization.concat("_").concat(library);
116
+ const buildLibName = organization.concat('_').concat(library);
127
117
 
128
118
  await updateComponentDefaultVersion(version);
129
119
 
130
- const buildVersion = devBuild && version.indexOf("-dev") < 0 ? version.concat("-dev") : version;
120
+ const buildVersion = devBuild && version.indexOf('-dev') < 0 ? version.concat('-dev') : version;
131
121
 
132
122
  for await (const componentKey of components) {
133
123
  console.log(chalk.bold.green(`Building ${componentKey}`));
134
124
 
135
- const myCustomTasks = getCustomTasks(componentKey, devBuild, buildVersion, options );
125
+ // eslint-disable-next-line sonarjs/no-extra-arguments
126
+ const myCustomTasks = getCustomTasks(componentKey, devBuild, buildVersion, options);
136
127
 
137
128
  try {
138
129
  await myCustomTasks.run();
139
- }
140
- catch (err) {
130
+ } catch (err) {
141
131
  console.log(chalk.bold.red(err.toString()));
142
132
  process.exit(1);
143
133
  }
144
-
145
- console.log(""); // line break
146
-
134
+ console.log(''); // line break
147
135
  }
148
136
 
149
- console.log(chalk.green.bold("Building Library... "));
137
+ // bundling the first component will actually compile all. We should
138
+ // compile to see if any errors, as buildLib doesn't catch all errors.
139
+ // Turning off stats (last param), so won't show warnings, as
140
+ // warnings are part of buildLib
141
+ console.log(chalk.green.bold('Compile check...'));
142
+ await bundleComponent(components[0], null, devBuild, false);
143
+ console.log('');
150
144
 
151
- // delete and rebuild library
152
- try {
153
- // await deleteLocalLibrary(currentOrgLib);
154
- }
155
- catch (ex) {}
145
+ console.log(chalk.green.bold('Building Library... '));
156
146
 
157
147
  // call constellation-dx-components-build-utils build library, which will create a directory of the "buildLibName"
158
148
  // with subdirectories for each version.
159
149
  // If "buildDev", we append to version "-dev". Currently, only "-dev" versions, when published, can be deleted.
160
- buildLib(buildLibName, buildVersion, tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
161
-
150
+ buildLib(
151
+ buildLibName,
152
+ buildVersion,
153
+ tokenAndStaticServer.C11NB2S,
154
+ tokenAndStaticServer.appStaticContentServer
155
+ );
162
156
 
163
157
  return true;
164
158
  };
@@ -47,7 +47,7 @@ const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
47
47
  let compilationErrors = null;
48
48
 
49
49
  // Create the build and print the deployment instructions.
50
- function build(config, previousFileSizes) {
50
+ function build(config, previousFileSizes, showStats = true) {
51
51
  console.log(`Creating a ${Env} build...`);
52
52
 
53
53
 
@@ -72,7 +72,10 @@ function build(config, previousFileSizes) {
72
72
  //store and print elsewhere
73
73
  compilationErrors = stats.compilation.errors;
74
74
 
75
- console.log("stats:" + stats);
75
+ if (showStats) {
76
+ console.log("stats:" + stats);
77
+ }
78
+
76
79
  }
77
80
 
78
81
  }
@@ -137,7 +140,8 @@ export default ({
137
140
  externals,
138
141
  globals,
139
142
  sourceMap,
140
- devBuild
143
+ devBuild,
144
+ showStats
141
145
  }) => {
142
146
  // Generate configuration
143
147
  const config = configFactory(Env, {
@@ -161,28 +165,31 @@ export default ({
161
165
  // if you're in it, you don't end up in Trash
162
166
  fs.emptyDirSync(paths.appBuild);
163
167
  // Start the webpack build
164
- return build(config, previousFileSizes);
168
+ return build(config, previousFileSizes, showStats);
165
169
  })
166
170
  .then(
167
171
  ({ stats, previousFileSizes, warnings }) => {
168
- if (warnings.length) {
169
- //console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
170
- console.log(chalk.yellow('Compiled with warnings.\n'));
171
- for (let warning in warnings) {
172
- console.log(chalk.yellow("Warning.."), warnings[warning].message);
172
+ if (showStats) {
173
+ if (warnings.length) {
174
+ //console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
175
+ console.log(chalk.yellow('Compiled with warnings.\n'));
176
+ for (let warning in warnings) {
177
+ console.log(chalk.yellow("Warning.."), warnings[warning].message);
178
+ }
179
+ } else {
180
+ console.log(chalk.green('Compiled successfully.\n'));
173
181
  }
174
- } else {
175
- console.log(chalk.green('Compiled successfully.\n'));
182
+
183
+ console.log('File sizes after gzip:\n');
184
+ printFileSizesAfterBuild(
185
+ stats,
186
+ previousFileSizes,
187
+ paths.appBuild,
188
+ WARN_AFTER_BUNDLE_GZIP_SIZE,
189
+ WARN_AFTER_CHUNK_GZIP_SIZE
190
+ );
176
191
  }
177
192
 
178
- console.log('File sizes after gzip:\n');
179
- printFileSizesAfterBuild(
180
- stats,
181
- previousFileSizes,
182
- paths.appBuild,
183
- WARN_AFTER_BUNDLE_GZIP_SIZE,
184
- WARN_AFTER_CHUNK_GZIP_SIZE
185
- );
186
193
  resolve('done emitting');
187
194
  },
188
195
  err => {
@@ -9,7 +9,7 @@ import buildComponent from './builder/index.js';
9
9
 
10
10
  const extensions = ['ts', 'tsx', 'js', 'jsx'];
11
11
 
12
- const bundleComponent = async (componentKey, sourceMap, devBuild) => {
12
+ const bundleComponent = async (componentKey, sourceMap, devBuild, showStats = true) => {
13
13
  const componentDirectory = await getComponentDirectoryPath(componentKey);
14
14
 
15
15
  const idx = (
@@ -58,7 +58,8 @@ const bundleComponent = async (componentKey, sourceMap, devBuild) => {
58
58
  externals,
59
59
  globals,
60
60
  sourceMap,
61
- devBuild
61
+ devBuild,
62
+ showStats
62
63
  });
63
64
  };
64
65
 
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -8,6 +8,7 @@ import {
8
8
  } from "@pega/cosmos-react-core";
9
9
 
10
10
  import type { PConnFieldProps } from './PConnProps';
11
+ import './create-nonce';
11
12
 
12
13
  // includes in bundle
13
14
  import handleEvent from "./event-utils";
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -3,6 +3,7 @@ import { DateInput, FieldValueList, DateTimeDisplay, Text, withConfiguration } f
3
3
  import FormattedText from "./FormattedText";
4
4
 
5
5
  import type { PConnFieldProps } from './PConnProps';
6
+ import './create-nonce';
6
7
 
7
8
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
8
9
 
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -1,6 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { DateTimeInput, FieldValueList, DateTimeDisplay, Text, withConfiguration } from "@pega/cosmos-react-core";
3
3
  import type { PConnFieldProps } from './PConnProps';
4
+ import './create-nonce';
4
5
 
5
6
  // includes in bundle
6
7
  import DateTimeFormatter from "./date-time";
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -2,6 +2,7 @@ import { useState, useEffect, useRef } from 'react';
2
2
  import { NumberInput, NumberDisplay, CurrencyDisplay, FieldValueList, Text, withConfiguration } from '@pega/cosmos-react-core';
3
3
 
4
4
  import type { PConnFieldProps } from './PConnProps';
5
+ import './create-nonce';
5
6
 
6
7
  // includes in bundle
7
8
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -11,6 +11,7 @@ import {
11
11
 
12
12
 
13
13
  import type { PConnFieldProps } from './PConnProps';
14
+ import './create-nonce';
14
15
 
15
16
  // includes in bundle
16
17
  import handleEvent from './event-utils';
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -10,6 +10,7 @@ import {
10
10
 
11
11
 
12
12
  import type { PConnFieldProps } from './PConnProps';
13
+ import './create-nonce';
13
14
 
14
15
  // includes in bundle
15
16
  import handleEvent from './event-utils';
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -35,23 +35,23 @@ const statelistData = {
35
35
  ]
36
36
  };
37
37
 
38
- window.PCore.getDataPageUtils = () => {
39
- return {
40
- getData: () => {
41
- return new Promise(resolve => {
42
- resolve(statelistData);
43
- });
44
- },
45
- getDataAsync: () => {
46
- return new Promise(resolve => {
47
- resolve(statelistData);
48
- });
49
- }
50
- };
51
- };
52
-
53
38
  export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
54
39
 
40
+ window.PCore.getDataPageUtils = () => {
41
+ return {
42
+ getData: () => {
43
+ return new Promise(resolve => {
44
+ resolve(statelistData);
45
+ });
46
+ },
47
+ getDataAsync: () => {
48
+ return new Promise(resolve => {
49
+ resolve(statelistData);
50
+ });
51
+ }
52
+ };
53
+ };
54
+
55
55
  const props = {
56
56
  countryCode: configProps.countryCode,
57
57
  getPConnect: () => {
@@ -10,6 +10,7 @@ import {
10
10
  URLDisplay
11
11
  } from '@pega/cosmos-react-core';
12
12
  import type { PConnFieldProps } from './PConnProps';
13
+ import './create-nonce';
13
14
 
14
15
  // IMPORTANT
15
16
  // To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -3,6 +3,7 @@ import { NumberInput, NumberDisplay, Slider, FieldValueList, CurrencyDisplay, Te
3
3
 
4
4
 
5
5
  import type { PConnFieldProps } from './PConnProps';
6
+ import './create-nonce';
6
7
 
7
8
  // includes in bundle
8
9
  import handleEvent from "./event-utils";
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -3,6 +3,7 @@ import { useState, useEffect, useRef, type Key } from 'react';
3
3
  import { Select, Option, FieldValueList, Text, withConfiguration } from '@pega/cosmos-react-core';
4
4
 
5
5
  import type { PConnFieldProps } from './PConnProps';
6
+ import './create-nonce';
6
7
 
7
8
  // includes in bundle
8
9
  import handleEvent from "./event-utils";
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -4,6 +4,7 @@ import { useEffect, useRef, useState, useMemo, type MutableRefObject, type SetSt
4
4
  import { ComboBox, menuHelpers, debounce, throttle, Button, Icon, withConfiguration, type MenuGroupProps, type MenuItemProps } from '@pega/cosmos-react-core';
5
5
  import get from 'lodash.get';
6
6
  import type { PConnFieldProps } from './PConnProps';
7
+ import './create-nonce';
7
8
 
8
9
  // includes in bundle
9
10
  import handleEvent from "./event-utils";
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -2,6 +2,7 @@
2
2
  import { useMemo } from 'react';
3
3
  import { RadioButton, RadioButtonGroup, withConfiguration } from '@pega/cosmos-react-core';
4
4
  import type { PConnFieldProps } from './PConnProps';
5
+ import './create-nonce';
5
6
 
6
7
  // includes in bundle
7
8
  import { formatExists, textFormatter } from './textformat-utils';
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -9,6 +9,7 @@ import {
9
9
  } from '@pega/cosmos-react-core';
10
10
 
11
11
  import type { PConnFieldProps } from './PConnProps';
12
+ import './create-nonce';
12
13
 
13
14
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
14
15
 
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -1,6 +1,7 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
2
  import { Input, EmailDisplay, FieldValueList, Text, URLDisplay, PhoneDisplay, withConfiguration } from '@pega/cosmos-react-core';
3
3
  import type { PConnFieldProps } from './PConnProps';
4
+ import './create-nonce';
4
5
 
5
6
  // includes in bundle
6
7
  import { suggestionsHandler } from './suggestions-handler';
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -1,6 +1,7 @@
1
1
  import { useEffect, useState, useRef } from 'react';
2
2
  import { Input, FieldValueList, Text, EmailDisplay, PhoneDisplay, URLDisplay, withConfiguration } from '@pega/cosmos-react-core';
3
3
  import type { PConnFieldProps } from './PConnProps';
4
+ import './create-nonce';
4
5
 
5
6
  // include in bundle
6
7
  import handleEvent from "./event-utils";
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }
@@ -2,6 +2,7 @@ import { useState, useEffect, useRef } from 'react';
2
2
  import { TextArea as CosmosTextArea, FieldValueList, ParagraphDisplay, Text, EmailDisplay, PhoneDisplay, URLDisplay, withConfiguration } from '@pega/cosmos-react-core';
3
3
 
4
4
  import type { PConnFieldProps } from './PConnProps';
5
+ import './create-nonce';
5
6
 
6
7
  // includes in bundle
7
8
  import { suggestionsHandler } from './suggestions-handler';
@@ -0,0 +1,6 @@
1
+ /* eslint-disable camelcase */
2
+ // @ts-ignore
3
+ if (window?.__webpack_nonce__) {
4
+ // @ts-ignore
5
+ __webpack_nonce__ = window.__webpack_nonce__;
6
+ }