@ndlib/component-library 0.0.55 → 0.0.56
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/dist/components/composites/Seo/index.js +6 -6
- package/dist/components/composites/Seo/seo.test.js +2 -2
- package/dist/components/composites/Seo/{useSiteMetadata.d.ts → siteMetadata.d.ts} +1 -1
- package/dist/components/composites/Seo/{useSiteMetadata.js → siteMetadata.js} +1 -1
- package/dist/components/composites/StructuredData/StructuredData.stories.d.ts +6 -0
- package/dist/components/composites/StructuredData/StructuredData.stories.js +12 -0
- package/dist/components/composites/StructuredData/StructuredData.test.d.ts +1 -0
- package/dist/components/composites/StructuredData/StructuredData.test.js +18 -0
- package/dist/components/composites/StructuredData/StructuredDataDisplay/index.d.ts +2 -0
- package/dist/components/composites/StructuredData/StructuredDataDisplay/index.js +7 -0
- package/dist/components/composites/StructuredData/index.d.ts +14 -0
- package/dist/components/composites/StructuredData/index.js +60 -0
- package/dist/components/composites/StructuredData/sdEvent/index.d.ts +13 -0
- package/dist/components/composites/StructuredData/sdEvent/index.js +16 -0
- package/dist/components/composites/StructuredData/sdEvent/makeEventSchema.d.ts +15 -0
- package/dist/components/composites/StructuredData/sdEvent/makeEventSchema.js +16 -0
- package/dist/components/composites/StructuredData/sdNews/index.d.ts +11 -0
- package/dist/components/composites/StructuredData/sdNews/index.js +14 -0
- package/dist/components/composites/StructuredData/sdNews/makeNewsSchema.d.ts +12 -0
- package/dist/components/composites/StructuredData/sdNews/makeNewsSchema.js +11 -0
- package/dist/components/composites/StructuredData/sdWebsite/index.d.ts +8 -0
- package/dist/components/composites/StructuredData/sdWebsite/index.js +11 -0
- package/dist/components/composites/StructuredData/sdWebsite/makeWebPageSchema.d.ts +9 -0
- package/dist/components/composites/StructuredData/sdWebsite/makeWebPageSchema.js +9 -0
- package/dist/components/composites/StructuredData/siteMetadata.d.ts +35 -0
- package/dist/components/composites/StructuredData/siteMetadata.js +42 -0
- package/dist/components/providers/ui.d.ts +2 -0
- package/dist/components/providers/ui.js +3 -2
- package/package.json +3 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { siteMetadata } from './siteMetadata';
|
|
3
3
|
export const Seo = ({ title, description, image, nofollow, noindex, }) => {
|
|
4
|
-
const { title: defaultTitle, description: defaultDescription, image: defaultImage,
|
|
4
|
+
const { title: defaultTitle, description: defaultDescription, image: defaultImage, nofollow: defaultNoindex, noindex: defaultNofollow, siteUrl, twitterUsername, } = siteMetadata();
|
|
5
5
|
const seo = {
|
|
6
6
|
title: title || defaultTitle,
|
|
7
7
|
description: description || defaultDescription,
|
|
8
|
-
image: image ?
|
|
8
|
+
image: image ? image : defaultImage,
|
|
9
9
|
url: siteUrl + location.pathname || '',
|
|
10
|
-
twitterUsername,
|
|
11
10
|
nofollow: nofollow || defaultNofollow,
|
|
12
11
|
noindex: noindex || defaultNoindex,
|
|
12
|
+
twitterUsername,
|
|
13
13
|
};
|
|
14
|
-
return (_jsxs(
|
|
14
|
+
return (_jsxs("head", { children: [seo.title ? _jsx("title", Object.assign({ "data-testid": "seo-title" }, { children: seo.title })) : null, seo.title ? (_jsx("meta", { "data-testid": "seo-twitter-title", name: "twitter:title", content: seo.title })) : null, seo.title ? (_jsx("meta", { "data-testid": "seo-og-title", property: "og:title", content: seo.title })) : null, seo.url ? (_jsx("meta", { "data-testid": "seo-twitter-url", name: "twitter:url", content: seo.url })) : null, seo.url ? (_jsx("meta", { "data-testid": "seo-og-url", property: "og:url", content: seo.url })) : null, seo.description ? (_jsx("meta", { "data-testid": "seo-twitter-description", name: "twitter:description", content: seo.description })) : null, seo.description ? (_jsx("meta", { "data-testid": "seo-og-description", property: "og:description", content: seo.description })) : null, seo.image ? (_jsx("meta", { "data-testid": "seo-twitter-image", name: "twitter:image", content: seo.image })) : null, seo.image ? (_jsx("meta", { "data-testid": "seo-og-image", name: "og:image", content: seo.image })) : null, seo.twitterUsername ? (_jsx("meta", { "data-testid": "seo-twitter-creator", name: "twitter:creator", content: seo.twitterUsername })) : null, seo.nofollow ? (_jsx("meta", { "data-testid": "seo-nofollow", name: "robots", content: "nofollow" })) : null, seo.noindex ? (_jsx("meta", { "data-testid": "seo-noindex", name: "robots", content: "noindex" })) : null, _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" })] }));
|
|
15
15
|
};
|
|
16
16
|
export default Seo;
|
|
@@ -36,12 +36,12 @@ describe('Seo', () => {
|
|
|
36
36
|
it('renders meta tag for twitter image', () => {
|
|
37
37
|
render(_jsx(Seo, { image: image }));
|
|
38
38
|
const element = screen.getByTestId('seo-twitter-image');
|
|
39
|
-
expect(element).toContainHTML('
|
|
39
|
+
expect(element).toContainHTML('/image.png');
|
|
40
40
|
});
|
|
41
41
|
it('renders meta tag for og image', () => {
|
|
42
42
|
render(_jsx(Seo, { image: image }));
|
|
43
43
|
const element = screen.getByTestId('seo-og-image');
|
|
44
|
-
expect(element).toContainHTML('
|
|
44
|
+
expect(element).toContainHTML('/image.png');
|
|
45
45
|
});
|
|
46
46
|
it('renders meta tag for nofollow', () => {
|
|
47
47
|
render(_jsx(Seo, { nofollow: nofollow }));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import StructuredDataDisplay from './StructuredDataDisplay';
|
|
3
|
+
import StructuredData from './index';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Composites/StructuredData',
|
|
6
|
+
component: StructuredData,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (_jsx(_Fragment, { children: _jsx(StructuredDataDisplay, {}) })),
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getStructuredDataSchemas } from './';
|
|
2
|
+
describe('getStructuredDataSchemas', () => {
|
|
3
|
+
it('should generate structured data schemas with default data', () => {
|
|
4
|
+
const schemas = getStructuredDataSchemas({ events: [], news: [] });
|
|
5
|
+
expect(schemas).toHaveLength(3);
|
|
6
|
+
});
|
|
7
|
+
it('should generate structured data schemas with custom data', () => {
|
|
8
|
+
const customData = {
|
|
9
|
+
title: 'Custom Title',
|
|
10
|
+
description: 'Custom Description',
|
|
11
|
+
events: [],
|
|
12
|
+
news: [],
|
|
13
|
+
};
|
|
14
|
+
const schemas = getStructuredDataSchemas(customData);
|
|
15
|
+
expect(schemas).toHaveLength(3);
|
|
16
|
+
expect(schemas[0]).toContain('Custom Title');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { getStructuredDataSchemas } from '../index';
|
|
3
|
+
export const StructuredDataDisplay = () => {
|
|
4
|
+
const schemas = getStructuredDataSchemas({ events: [], news: [] });
|
|
5
|
+
return (_jsx(_Fragment, { children: schemas.map((schema, index) => (_jsxs("pre", { children: [_jsx("code", { children: schema }), _jsx("br", {})] }, index))) }));
|
|
6
|
+
};
|
|
7
|
+
export default StructuredDataDisplay;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type StructuredDataProps = {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
siteUrl?: string;
|
|
6
|
+
nofollow?: string;
|
|
7
|
+
noindex?: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
events?: [];
|
|
10
|
+
news?: [];
|
|
11
|
+
};
|
|
12
|
+
export declare const getStructuredDataSchemas: ({ title, description, nofollow, noindex, image, }: StructuredDataProps) => string[];
|
|
13
|
+
export declare const StructuredData: React.FC<StructuredDataProps>;
|
|
14
|
+
export default StructuredData;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { siteMetadata } from './siteMetadata';
|
|
3
|
+
import { stringifyWebpageSchema } from './sdWebsite';
|
|
4
|
+
import { stringifyEventSchema } from './sdEvent';
|
|
5
|
+
import { stringifyNewsSchema } from './sdNews';
|
|
6
|
+
export const getStructuredDataSchemas = ({ title, description, nofollow, noindex, image, }) => {
|
|
7
|
+
const { title: defaultTitle, description: defaultDescription, image: defaultImage, siteUrl, nofollow: defaultNofollow, noindex: defaultNoindex, events, news, } = siteMetadata();
|
|
8
|
+
const metadata = {
|
|
9
|
+
title: title || defaultTitle,
|
|
10
|
+
description: description || defaultDescription,
|
|
11
|
+
nofollow: nofollow || defaultNofollow,
|
|
12
|
+
noindex: noindex || defaultNoindex,
|
|
13
|
+
image: image || defaultImage,
|
|
14
|
+
url: `${siteUrl}${location.pathname || ''}`,
|
|
15
|
+
lang: 'en',
|
|
16
|
+
};
|
|
17
|
+
const schemas = [];
|
|
18
|
+
if (location.pathname !== '') {
|
|
19
|
+
schemas.push(stringifyWebpageSchema({
|
|
20
|
+
name: metadata.title,
|
|
21
|
+
description: metadata.description,
|
|
22
|
+
url: metadata.url,
|
|
23
|
+
lang: metadata.lang,
|
|
24
|
+
}));
|
|
25
|
+
if (location.pathname !== '') {
|
|
26
|
+
events === null || events === void 0 ? void 0 : events.map((event) => {
|
|
27
|
+
schemas.push(stringifyEventSchema({
|
|
28
|
+
title: event.name,
|
|
29
|
+
description: event.shortDescription,
|
|
30
|
+
image: event.representationalImage.url,
|
|
31
|
+
url: event.slug,
|
|
32
|
+
startDate: event.startDate,
|
|
33
|
+
endDate: event.endDate,
|
|
34
|
+
eventLocation: event.location.address,
|
|
35
|
+
eventLocationName: event.locationText.name,
|
|
36
|
+
siteUrl: siteUrl,
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (location.pathname !== '') {
|
|
41
|
+
news === null || news === void 0 ? void 0 : news.map((article) => {
|
|
42
|
+
schemas.push(stringifyNewsSchema({
|
|
43
|
+
title: article.title,
|
|
44
|
+
abstract: article.shortDescription,
|
|
45
|
+
author: article.author,
|
|
46
|
+
image: article.image.url,
|
|
47
|
+
url: article.slug,
|
|
48
|
+
publishedDate: article.publishedDate,
|
|
49
|
+
siteUrl: siteUrl,
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return schemas;
|
|
55
|
+
};
|
|
56
|
+
export const StructuredData = (props) => {
|
|
57
|
+
const schemas = getStructuredDataSchemas(props);
|
|
58
|
+
return (_jsx(_Fragment, { children: schemas.map((schema, index) => (_jsx("script", Object.assign({ type: "application/ld+json" }, { children: schema }), index))) }));
|
|
59
|
+
};
|
|
60
|
+
export default StructuredData;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface SdEventProps {
|
|
2
|
+
title: string;
|
|
3
|
+
startDate?: string;
|
|
4
|
+
endDate?: string;
|
|
5
|
+
description: string;
|
|
6
|
+
eventLocation?: string;
|
|
7
|
+
eventLocationName?: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
siteUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const stringifyEventSchema: (props: SdEventProps) => string;
|
|
13
|
+
export default stringifyEventSchema;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { makeEventSchema } from './makeEventSchema';
|
|
2
|
+
export const stringifyEventSchema = ({ title, description, startDate, endDate, eventLocation, eventLocationName, image, url, siteUrl, }) => {
|
|
3
|
+
const eventSchema = makeEventSchema({
|
|
4
|
+
title: title,
|
|
5
|
+
startDate: startDate,
|
|
6
|
+
endDate: endDate,
|
|
7
|
+
description: description,
|
|
8
|
+
image: image,
|
|
9
|
+
eventLocation: eventLocation,
|
|
10
|
+
eventLocationName: eventLocationName,
|
|
11
|
+
url: url,
|
|
12
|
+
siteUrl: siteUrl,
|
|
13
|
+
});
|
|
14
|
+
return JSON.stringify(eventSchema, null, 2);
|
|
15
|
+
};
|
|
16
|
+
export default stringifyEventSchema;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Event } from 'schema-dts';
|
|
2
|
+
type Params = {
|
|
3
|
+
title: string;
|
|
4
|
+
startDate?: string;
|
|
5
|
+
endDate?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
location?: string;
|
|
8
|
+
eventLocation?: string;
|
|
9
|
+
eventLocationName?: string;
|
|
10
|
+
image?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
siteUrl?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const makeEventSchema: (params: Params) => Event;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const makeEventSchema = (params) => {
|
|
2
|
+
return {
|
|
3
|
+
'@type': 'Event',
|
|
4
|
+
name: params.title,
|
|
5
|
+
startDate: params.startDate,
|
|
6
|
+
endDate: params.endDate,
|
|
7
|
+
description: params.description,
|
|
8
|
+
image: params.image,
|
|
9
|
+
url: params.siteUrl + '/event/' + params.url,
|
|
10
|
+
location: {
|
|
11
|
+
'@type': 'Place',
|
|
12
|
+
name: params.eventLocationName,
|
|
13
|
+
address: params.eventLocation,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface SdNewsProps {
|
|
2
|
+
title: string;
|
|
3
|
+
author: string;
|
|
4
|
+
abstract: string;
|
|
5
|
+
image?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
publishedDate?: string;
|
|
8
|
+
siteUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const stringifyNewsSchema: (props: SdNewsProps) => string;
|
|
11
|
+
export default stringifyNewsSchema;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { makeNewsSchema } from './makeNewsSchema';
|
|
2
|
+
export const stringifyNewsSchema = ({ title, author, abstract, image, url, publishedDate, siteUrl, }) => {
|
|
3
|
+
const newsSchema = makeNewsSchema({
|
|
4
|
+
title: title,
|
|
5
|
+
author: author,
|
|
6
|
+
abstract: abstract,
|
|
7
|
+
image: image,
|
|
8
|
+
url: url,
|
|
9
|
+
publishedDate: publishedDate,
|
|
10
|
+
siteUrl: siteUrl,
|
|
11
|
+
});
|
|
12
|
+
return JSON.stringify(newsSchema, null, 2);
|
|
13
|
+
};
|
|
14
|
+
export default stringifyNewsSchema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NewsArticle } from 'schema-dts';
|
|
2
|
+
type Params = {
|
|
3
|
+
title: string;
|
|
4
|
+
author: string;
|
|
5
|
+
abstract?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
publishedDate?: string;
|
|
9
|
+
siteUrl?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const makeNewsSchema: (params: Params) => NewsArticle;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const makeNewsSchema = (params) => {
|
|
2
|
+
return {
|
|
3
|
+
'@type': 'NewsArticle',
|
|
4
|
+
name: params.title,
|
|
5
|
+
creator: params.author,
|
|
6
|
+
abstract: params.abstract,
|
|
7
|
+
image: params.image,
|
|
8
|
+
url: params.siteUrl + '/news/' + params.url,
|
|
9
|
+
datePublished: params.publishedDate,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { makeWebPageSchema } from './makeWebPageSchema';
|
|
2
|
+
export const stringifyWebpageSchema = ({ lang, name, description, url, }) => {
|
|
3
|
+
const webpageSchema = makeWebPageSchema({
|
|
4
|
+
lang: lang,
|
|
5
|
+
name: name,
|
|
6
|
+
description: description,
|
|
7
|
+
url: url,
|
|
8
|
+
});
|
|
9
|
+
return JSON.stringify(webpageSchema, null, 2);
|
|
10
|
+
};
|
|
11
|
+
export default stringifyWebpageSchema;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const siteMetadata: () => {
|
|
2
|
+
title: string;
|
|
3
|
+
image: string;
|
|
4
|
+
description: string;
|
|
5
|
+
twitterUsername: string;
|
|
6
|
+
siteUrl: string;
|
|
7
|
+
nofollow: boolean;
|
|
8
|
+
noindex: boolean;
|
|
9
|
+
events: {
|
|
10
|
+
name: string;
|
|
11
|
+
startDate: string;
|
|
12
|
+
endDate: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
shortDescription: string;
|
|
15
|
+
representationalImage: {
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
18
|
+
location: {
|
|
19
|
+
address: string;
|
|
20
|
+
};
|
|
21
|
+
locationText: {
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
news: {
|
|
26
|
+
title: string;
|
|
27
|
+
author: string;
|
|
28
|
+
shortDescription: string;
|
|
29
|
+
image: {
|
|
30
|
+
url: string;
|
|
31
|
+
};
|
|
32
|
+
slug: string;
|
|
33
|
+
publishedDate: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const siteMetadata = () => {
|
|
2
|
+
const data = {
|
|
3
|
+
title: 'Hesburgh Component Library',
|
|
4
|
+
image: '/images/fakeimage.png',
|
|
5
|
+
description: 'Component library for the Hesburgh Libraries',
|
|
6
|
+
twitterUsername: 'hlibraries',
|
|
7
|
+
siteUrl: 'https://www.library.nd.edu',
|
|
8
|
+
nofollow: false,
|
|
9
|
+
noindex: false,
|
|
10
|
+
events: [
|
|
11
|
+
{
|
|
12
|
+
name: 'Archival Research Lab II: Inside the Archive',
|
|
13
|
+
startDate: '2021-10-13T14:00:00.000Z',
|
|
14
|
+
endDate: '2021-10-13T15:15:00.000Z',
|
|
15
|
+
slug: 'archival-research-lab-2-inside-the-archive-2021-10-13',
|
|
16
|
+
shortDescription: 'This two-session workshop provides an introduction to advanced archival research.',
|
|
17
|
+
representationalImage: {
|
|
18
|
+
url: 'https://strapi-prod-library-website-contentbucket52d4b12c-1whgwwl6746tz.s3.amazonaws.com/events_hl_workshop_1403f3079f.jpg?AWSAccessKeyId=AKIATLJDMPVTNRHRTTAL&Expires=1698764137&Signature=oDIw1iGhnDLsDcvvlSHOn5KSRrI%3D',
|
|
19
|
+
},
|
|
20
|
+
location: {
|
|
21
|
+
address: '103 Hesburgh Library, Rare Books & Special Collections',
|
|
22
|
+
},
|
|
23
|
+
locationText: {
|
|
24
|
+
name: 'Hesburgh Concourse',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
news: [
|
|
29
|
+
{
|
|
30
|
+
title: 'Preservation Week 2023: Tips from the Hesburgh Libraries Preservation Team',
|
|
31
|
+
author: 'Hesburgh Libraries Analog Preservation and Conservation Unit',
|
|
32
|
+
shortDescription: 'Hesburgh Libraries preservation experts offer some helpful tips on safely preserving your valued collections.',
|
|
33
|
+
image: {
|
|
34
|
+
url: 'https://strapi-prod-library-website-contentbucket52d4b12c-1whgwwl6746tz.s3.amazonaws.com/Preservation_Week_Rep_f85c55dd55.png?AWSAccessKeyId=AKIATLJDMPVTNRHRTTAL&Expires=1698764137&Signature=9jjAAAXWqJ7kBK4Tn5G7jvGK%2BfA%3D',
|
|
35
|
+
},
|
|
36
|
+
slug: 'preservation-week-2023',
|
|
37
|
+
publishedDate: '2023-04-30T04:00:00.000Z',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
return data;
|
|
42
|
+
};
|
|
@@ -2,7 +2,9 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ComponentConfigParam } from './componentConfig';
|
|
3
3
|
import { ENVIRONMENT } from './env';
|
|
4
4
|
import { AlertQueryParams } from './alerts';
|
|
5
|
+
import { StructuredDataProps } from '../composites/StructuredData';
|
|
5
6
|
export type UiConfig = {
|
|
7
|
+
structuredData?: StructuredDataProps;
|
|
6
8
|
env?: ENVIRONMENT;
|
|
7
9
|
components?: ComponentConfigParam;
|
|
8
10
|
alertsConfig?: AlertQueryParams;
|
|
@@ -7,9 +7,10 @@ import { FontLoader } from '../../FontLoader';
|
|
|
7
7
|
import { GlobalStyles } from '../../theme/GlobalStyles';
|
|
8
8
|
import { DialogsProvider } from './dialogs';
|
|
9
9
|
import { MediaSizeProvider } from './media';
|
|
10
|
+
import StructuredData from '../composites/StructuredData';
|
|
10
11
|
import { SnackBarProvider } from './snackBar';
|
|
11
12
|
import { UniqueIdProvider } from './uniqueIds';
|
|
12
|
-
export const UiProvider = ({ env, components, alertsConfig, children, includeTheme = true, loadFonts, loadGlobalStyles, }) => {
|
|
13
|
-
const core = (_jsxs(EnvironmentProvider, Object.assign({ env: env }, { children: [_jsx(MediaSizeProvider, { children: _jsx(ComponentConfigProvider, Object.assign({ config: components || {} }, { children: _jsx(UniqueIdProvider, { children: _jsx(SnackBarProvider, { children: _jsx(DialogsProvider, { children: _jsx(AlertsProvider, Object.assign({}, alertsConfig, { children: children })) }) }) }) })) }), loadGlobalStyles && _jsx(GlobalStyles, {}), loadFonts && _jsx(FontLoader, {})] })));
|
|
13
|
+
export const UiProvider = ({ structuredData, env, components, alertsConfig, children, includeTheme = true, loadFonts, loadGlobalStyles, }) => {
|
|
14
|
+
const core = (_jsxs(EnvironmentProvider, Object.assign({ env: env }, { children: [_jsx(MediaSizeProvider, { children: _jsx(ComponentConfigProvider, Object.assign({ config: components || {} }, { children: _jsx(UniqueIdProvider, { children: _jsx(SnackBarProvider, { children: _jsx(DialogsProvider, { children: _jsx(AlertsProvider, Object.assign({}, alertsConfig, { children: children })) }) }) }) })) }), loadGlobalStyles && _jsx(GlobalStyles, {}), loadFonts && _jsx(FontLoader, {}), structuredData && _jsx(StructuredData, Object.assign({}, structuredData))] })));
|
|
14
15
|
return includeTheme ? _jsx(ThemeProvider, { children: core }) : core;
|
|
15
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndlib/component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"react-markdown": "^8.0.7",
|
|
93
93
|
"react-modal": "^3.16.1",
|
|
94
94
|
"rehype-raw": "^6.1.1",
|
|
95
|
-
"sanitize-html": "^2.11.0"
|
|
95
|
+
"sanitize-html": "^2.11.0",
|
|
96
|
+
"schema-dts": "^1.1.2"
|
|
96
97
|
}
|
|
97
98
|
}
|