@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 +1 -1
- package/props.js +22 -12
- package/setup.cjs +4 -1
- package/types.ts +3 -0
package/package.json
CHANGED
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:
|
|
114
|
-
iconIndicatorsUrl:
|
|
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:
|
|
155
|
-
themeLogoWhiteUrl:
|
|
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:
|
|
195
|
+
fundingInstruments: arrayOf(exact({
|
|
196
|
+
id: string,
|
|
197
|
+
name: string,
|
|
198
|
+
logo: string,
|
|
199
|
+
link: string,
|
|
200
|
+
})).isRequired,
|
|
196
201
|
leftAlignCategoryPages: bool,
|
|
197
|
-
otherLogos:
|
|
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:
|
|
238
|
+
icons: objectOf(cssv('hashedFile')).isRequired,
|
|
229
239
|
favicons: exact({
|
|
230
|
-
apple:
|
|
231
|
-
ico:
|
|
232
|
-
svg:
|
|
240
|
+
apple: cssv('hashedFile').isRequired,
|
|
241
|
+
ico: cssv('hashedFile').isRequired,
|
|
242
|
+
svg: cssv('hashedFile').isRequired,
|
|
233
243
|
}),
|
|
234
|
-
mainCssFile:
|
|
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 (
|
|
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