@hestia-earth/ui-components 0.42.17 → 0.42.18
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/fesm2022/hestia-earth-ui-components-file-errors.mjs +8 -3
- package/fesm2022/hestia-earth-ui-components-file-errors.mjs.map +1 -1
- package/fesm2022/hestia-earth-ui-components.mjs +64 -29
- package/fesm2022/hestia-earth-ui-components.mjs.map +1 -1
- package/file-errors/README.md +6 -4
- package/package.json +1 -1
- package/types/hestia-earth-ui-components.d.ts +40 -4
|
@@ -511,7 +511,7 @@ const createErrorFormatter = ({ renderer: r, urls }) => {
|
|
|
511
511
|
const code = (text) => r.code(text);
|
|
512
512
|
const externalLink = (href, text) => r.link(href, text);
|
|
513
513
|
const glossaryLink = (text) => r.link(urls.glossaryBaseUrl(), text);
|
|
514
|
-
const externalNodeLink = ({ '@type': type, '@id': id, name }) =>
|
|
514
|
+
const externalNodeLink = ({ '@type': type, '@id': id, name }) => type && id ? r.link(`/${type.toLowerCase()}/${id}`, name || id) : null;
|
|
515
515
|
const schemaLink = (type, title = type) => r.link(`${urls.schemaBaseUrl()}/${type}`, title);
|
|
516
516
|
const contactUsLink = (text = 'contact us') => r.link(`mailto:${contactUsEmail}`, text, false);
|
|
517
517
|
const reportIssueLink = (repository, template, text = 'here') => r.link(reportIssueUrl(repository, template), text);
|
|
@@ -519,7 +519,10 @@ const createErrorFormatter = ({ renderer: r, urls }) => {
|
|
|
519
519
|
const glossaryTypeLink = (type, text = termTypeLabel(type)) => r.link(`${urls.glossaryBaseUrl()}?termType=${type}`, text);
|
|
520
520
|
const termLink = ({ id, name }) => r.link(`${urls.baseUrl()}/term/${id}`, name || id);
|
|
521
521
|
const listAsCode = (values) => (values ?? []).map(value => r.code(value)).join(', ');
|
|
522
|
-
const joinValues = (values) => (values || [])
|
|
522
|
+
const joinValues = (values) => (values || [])
|
|
523
|
+
.filter(Boolean)
|
|
524
|
+
.map(value => r.code(value))
|
|
525
|
+
.join(r.inlineSeparator);
|
|
523
526
|
const formatList = (values, style = 'disc') => r.list(values, style);
|
|
524
527
|
const threshold = (value) => r.code(`${value * 100}%`);
|
|
525
528
|
const dateFormatMessage = `Should follow the ISO 8601 date format, e.g. ${r.code(2000)}, or ${r.code('2000-12')}, or ${r.code('2000-12-30')}, and in some cases an optional time. Please refer to the schema for more details.`;
|
|
@@ -1160,7 +1163,9 @@ const createErrorFormatter = ({ renderer: r, urls }) => {
|
|
|
1160
1163
|
termType === TermTermType.liveAnimal
|
|
1161
1164
|
? `These properties influence energy requirements and are used for estimating grass intake.`
|
|
1162
1165
|
: null,
|
|
1163
|
-
termType === TermTermType.animalManagement
|
|
1166
|
+
termType === TermTermType.animalManagement
|
|
1167
|
+
? `These properties will be used for estimating grass intake.`
|
|
1168
|
+
: null,
|
|
1164
1169
|
'If not added, default values might be used.'
|
|
1165
1170
|
]
|
|
1166
1171
|
.filter(Boolean)
|