@kausal/themes 0.8.0 → 0.8.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kausal/themes",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Themes for Kausal products",
5
5
  "type": "module",
6
6
  "main": "setup.cjs",
package/props.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
 
3
- const { number, exact, string, oneOfType, bool, array, object, arrayOf } =
3
+ const { number, exact, string, oneOfType, bool, array, object, oneOf, objectOf, arrayOf } =
4
4
  PropTypes;
5
5
 
6
6
  export function makeThemePropType(cssv = null) {
@@ -110,8 +110,8 @@ export function makeThemePropType(cssv = null) {
110
110
  }).isRequired,
111
111
  headingsColor: cssv('color'),
112
112
  headingsFontWeight: cssv('font-weight').isRequired,
113
- iconActionsUrl: string.isRequired,
114
- iconIndicatorsUrl: string.isRequired,
113
+ iconActionsUrl: cssv('path').allowEmpty,
114
+ iconIndicatorsUrl: cssv('path').allowEmpty,
115
115
  imageOverlay: string.isRequired,
116
116
  inputBg: string.isRequired,
117
117
  inputBorderRadius: string.isRequired,
@@ -151,8 +151,8 @@ export function makeThemePropType(cssv = null) {
151
151
  light: string.isRequired,
152
152
  white: string.isRequired,
153
153
  }).isRequired,
154
- themeLogoUrl: string.isRequired,
155
- themeLogoWhiteUrl: string.isRequired,
154
+ themeLogoUrl: cssv('hashedFile').isRequired,
155
+ themeLogoWhiteUrl: cssv('hashedFile').isRequired,
156
156
  phaseTimelineColor: string.isRequired,
157
157
  textColor: exact({
158
158
  primary: cssv('color').isRequired,
@@ -192,9 +192,19 @@ export function makeThemePropType(cssv = null) {
192
192
  categoryPageHideCategoryLabel: bool,
193
193
  }),
194
194
  hiddenLocales: arrayOf(string),
195
- fundingInstruments: array.isRequired,
195
+ fundingInstruments: arrayOf(exact({
196
+ id: string,
197
+ name: string,
198
+ logo: string,
199
+ link: string,
200
+ })).isRequired,
196
201
  leftAlignCategoryPages: bool,
197
- otherLogos: array.isRequired,
202
+ otherLogos: arrayOf(exact({
203
+ id: string,
204
+ name: string,
205
+ logo: string,
206
+ link: string,
207
+ })).isRequired,
198
208
  attentionBannerContent: object,
199
209
  footerLogoOnly: bool,
200
210
  footerStatement: string,
@@ -225,13 +235,13 @@ export function makeThemePropType(cssv = null) {
225
235
  showActionDescriptionHeader: bool,
226
236
  showFeedbackLink: bool,
227
237
  }),
228
- icons: object.isRequired,
238
+ icons: objectOf(cssv('hashedFile')).isRequired,
229
239
  favicons: exact({
230
- apple: string,
231
- ico: string,
232
- svg: string,
240
+ apple: cssv('hashedFile').isRequired,
241
+ ico: cssv('hashedFile').isRequired,
242
+ svg: cssv('hashedFile').isRequired,
233
243
  }),
234
- mainCssFile: string.isRequired,
244
+ mainCssFile: cssv('hashedFile').isRequired,
235
245
  };
236
246
  return exact(props);
237
247
  }
package/setup.cjs CHANGED
@@ -22,7 +22,10 @@ function generateThemeSymlinks(destPath, opts) {
22
22
  const themesPath = path.join(__dirname, 'dist', 'themes');
23
23
  const statRes = fs.lstatSync(destPath, { throwIfNoEntry: false });
24
24
  if (statRes) {
25
- if (!statRes.isSymbolicLink()) {
25
+ if (statRes.isDirectory()) {
26
+ fs.rmdirSync(destPath);
27
+ } else if (!statRes.isSymbolicLink()) {
28
+ console.error(statRes);
26
29
  throw new Error(`${destPath} already exists and is not a symlink`);
27
30
  }
28
31
  const existingTarget = fs.readlinkSync(destPath);
package/types.ts CHANGED
@@ -178,7 +178,10 @@ export interface Theme {
178
178
  };
179
179
  hiddenLocales?: string[];
180
180
  fundingInstruments: {
181
+ id: string;
182
+ name: string;
181
183
  logo: string;
184
+ link: string;
182
185
  }[];
183
186
  leftAlignCategoryPages?: boolean;
184
187
  otherLogos: {