wjec-one 4.0.21 → 4.0.22

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/config/utils.js CHANGED
@@ -9,7 +9,13 @@ const { overrides = {}, version } = require(packageFilePath);
9
9
 
10
10
  const currentTimestamp = Date.now();
11
11
 
12
- const generateFilename = (filename = '[name]') => {
12
+ const generateFilename = (filename = '[name]', extension = '.js') => {
13
+ const suffix = getFilenameSuffix();
14
+
15
+ return `${filename}${suffix}${extension}`;
16
+ };
17
+
18
+ const getFilenameSuffix = () => {
13
19
  const { filenameSuffix } = overrides;
14
20
  let suffix = filenameSuffix;
15
21
 
@@ -25,9 +31,7 @@ const generateFilename = (filename = '[name]') => {
25
31
  break;
26
32
  }
27
33
 
28
- return suffix
29
- ? `${filename}.${suffix}.js`
30
- : `${filename}.js`;
34
+ return suffix ? `.${suffix}` : '';
31
35
  };
32
36
 
33
37
  const getVersionNumber = () => {
@@ -44,5 +48,6 @@ const getVersionNumber = () => {
44
48
  };
45
49
 
46
50
  module.exports = {
47
- generateFilename
51
+ generateFilename,
52
+ getFilenameSuffix
48
53
  };
@@ -1,3 +1,4 @@
1
+ const { generateFilename } = require('./utils');
1
2
  const babelConfig = require('./babel.config');
2
3
 
3
4
  module.exports = (_env, { mode }) => ({
@@ -61,7 +62,7 @@ module.exports = (_env, { mode }) => ({
61
62
  use: {
62
63
  loader: 'file-loader',
63
64
  options: {
64
- name: './config/[name].json',
65
+ name: `./config/${generateFilename('[name]', '.json')}`,
65
66
  publicPath: '../'
66
67
  }
67
68
  }
@@ -5,7 +5,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
5
5
  const path = require('path');
6
6
  const webpack = require('webpack');
7
7
 
8
- const { generateFilename } = require('./utils');
8
+ const { generateFilename, getFilenameSuffix } = require('./utils');
9
9
 
10
10
  const appPath = path.resolve(__dirname, '../../../');
11
11
  const configPath = path.resolve(__dirname, './');
@@ -42,11 +42,12 @@ module.exports = () => ({
42
42
  patterns: [
43
43
  ...fs.readdirSync(path.join(appPath, 'config')).map((fileName) => ({
44
44
  from: path.join(appPath, 'config', fileName),
45
- to: 'config'
45
+ to: `config/${generateFilename('[name]', '.json')}`
46
46
  }))
47
47
  ].filter(Boolean)
48
48
  }),
49
49
  new webpack.DefinePlugin({
50
+ 'process.env.FILENAME_SUFFIX': JSON.stringify(getFilenameSuffix()),
50
51
  'process.env.NODE_DEBUG': JSON.stringify(process.env.NODE_DEBUG),
51
52
  'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
52
53
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wjec-one",
3
- "version": "4.0.21",
3
+ "version": "4.0.22",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": "./index.js",
package/portal/index.d.ts CHANGED
@@ -31,12 +31,12 @@ declare const DEFAULT_SECONDARY_ACCESS_GROUPS: readonly SecondaryAccessGroup$1[]
31
31
  declare const getAccountType: (centreNumber: string, centrePermissions?: Record<string, string>, groups?: string[]) => AccountType$1;
32
32
  declare const getNavigationPermissions: (centreNumber: string, groups?: string[], accountType?: AccountType$1) => readonly SecondaryAccessGroup$1[];
33
33
 
34
- type Props$b = {
34
+ type Props$c = {
35
35
  margin?: CSSProperties['margin'];
36
36
  };
37
- declare const Divider: FC<Props$b>;
37
+ declare const Divider: FC<Props$c>;
38
38
 
39
- type Props$a = {
39
+ type Props$b = {
40
40
  applicationVersion?: string;
41
41
  description?: string;
42
42
  options?: Array<{
@@ -47,18 +47,18 @@ type Props$a = {
47
47
  }>;
48
48
  title?: string;
49
49
  };
50
- declare const HelpMenu: FC<Props$a>;
50
+ declare const HelpMenu: FC<Props$b>;
51
51
 
52
52
  /** @jsx jsx */
53
53
 
54
- type Props$9 = {
54
+ type Props$a = {
55
55
  i18n?: {
56
56
  copyrightMessage: string;
57
57
  };
58
58
  logos?: Array<(props: react.SVGProps<SVGSVGElement>) => SVGComponent$1>;
59
59
  maxWidth?: number;
60
60
  };
61
- declare const Footer: FC<Props$9>;
61
+ declare const Footer: FC<Props$a>;
62
62
 
63
63
  type FormattedPart = React.ReactElement<{
64
64
  children?: Array<string | number | FormattedPart>;
@@ -89,19 +89,19 @@ declare const Header: FC<HeaderProps$1>;
89
89
 
90
90
  type FooterProps = react.ComponentProps<typeof Footer$1>;
91
91
  type HeaderProps = react.ComponentProps<typeof Header$1>;
92
- type Props$8 = {
92
+ type Props$9 = {
93
93
  footerProps?: FooterProps;
94
94
  headerProps?: Omit<HeaderProps, 'maxWidth'>;
95
95
  padding?: CSSProperties['padding'];
96
96
  maxWidth?: number;
97
97
  };
98
- declare const Page: FC<PropsWithChildren<Props$8>>;
98
+ declare const Page: FC<PropsWithChildren<Props$9>>;
99
99
 
100
100
  type Locale = ReturnType<typeof getLocales>[number];
101
101
  type IconsMap = {
102
102
  [key in Locale]: FC<SVGProps<SVGSVGElement>>;
103
103
  };
104
- type Props$7 = {
104
+ type Props$8 = {
105
105
  icons?: IconsMap;
106
106
  id?: string;
107
107
  keySuffix?: string;
@@ -109,7 +109,7 @@ type Props$7 = {
109
109
  showLocaleNameInList?: boolean;
110
110
  showSelectedLocaleName?: boolean;
111
111
  };
112
- declare const LocalizationMenu: FC<Props$7>;
112
+ declare const LocalizationMenu: FC<Props$8>;
113
113
 
114
114
  /** @jsx jsx */
115
115
 
@@ -129,6 +129,28 @@ type NavigationProps = {
129
129
  };
130
130
  declare const Navigation: FC<NavigationProps>;
131
131
 
132
+ type WjecOneComponentProps<P = {}> = react.PropsWithChildren<P & {
133
+ /** The identifier that will be passed through to the underlying HTML element */
134
+ id?: string;
135
+ }>;
136
+ type WjecOneComponent<P = {}> = react.FunctionComponent<WjecOneComponentProps<P>>;
137
+
138
+ type Props$7 = {
139
+ /**
140
+ * International localization strings
141
+ */
142
+ i18n?: {
143
+ showLess?: string;
144
+ showMore?: string;
145
+ };
146
+ /**
147
+ * Determines the amount of visible notifications before needing to expand the stack
148
+ * @default 3
149
+ */
150
+ visibleCount?: number;
151
+ };
152
+ declare const NotificationsStack: WjecOneComponent<Props$7>;
153
+
132
154
  /** @jsx jsx */
133
155
 
134
156
  declare const SigninForm: FC<SigninFormProps>;
@@ -279,4 +301,4 @@ type Props = {
279
301
  };
280
302
  declare const UserMenu: FC<Props>;
281
303
 
282
- export { AccountType, DEFAULT_SECONDARY_ACCESS_GROUPS, Divider, EmailMfaSetup, Footer, Header, HelpMenu, LocalizationMenu, MfaSetupSuccess, Navigation, Page, SecondaryAccessGroup, SigninForm, SkeletonBlock, SmsMfaSetup, TotpMfaSetup, TotpMfaUpdate, UserMenu, getAccountType, getNavigationPermissions, useAccountType, useNavigationPermissions };
304
+ export { AccountType, DEFAULT_SECONDARY_ACCESS_GROUPS, Divider, EmailMfaSetup, Footer, Header, HelpMenu, LocalizationMenu, MfaSetupSuccess, Navigation, NotificationsStack, Page, SecondaryAccessGroup, SigninForm, SkeletonBlock, SmsMfaSetup, TotpMfaSetup, TotpMfaUpdate, UserMenu, getAccountType, getNavigationPermissions, useAccountType, useNavigationPermissions };