react-datocms 1.6.7 → 2.1.0
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/README.md +144 -63
- package/dist/cjs/Image/__tests__/index.test.js +32 -28
- package/dist/cjs/Image/__tests__/index.test.js.map +1 -1
- package/dist/cjs/Image/index.js +37 -22
- package/dist/cjs/Image/index.js.map +1 -1
- package/dist/cjs/Seo/__tests__/index.test.js +277 -37
- package/dist/cjs/Seo/__tests__/index.test.js.map +1 -1
- package/dist/cjs/Seo/index.js +13 -60
- package/dist/cjs/Seo/index.js.map +1 -1
- package/dist/cjs/Seo/remixUtils.js +42 -0
- package/dist/cjs/Seo/remixUtils.js.map +1 -0
- package/dist/cjs/Seo/renderMetaTags.js +40 -0
- package/dist/cjs/Seo/renderMetaTags.js.map +1 -0
- package/dist/cjs/Seo/renderMetaTagsToString.js +22 -0
- package/dist/cjs/Seo/renderMetaTagsToString.js.map +1 -0
- package/dist/cjs/Seo/types.js +5 -0
- package/dist/cjs/Seo/types.js.map +1 -0
- package/dist/esm/Image/__tests__/index.test.js +36 -32
- package/dist/esm/Image/__tests__/index.test.js.map +1 -1
- package/dist/esm/Image/index.d.ts +23 -6
- package/dist/esm/Image/index.js +40 -24
- package/dist/esm/Image/index.js.map +1 -1
- package/dist/esm/Seo/__tests__/index.test.js +276 -36
- package/dist/esm/Seo/__tests__/index.test.js.map +1 -1
- package/dist/esm/Seo/index.d.ts +4 -12
- package/dist/esm/Seo/index.js +4 -55
- package/dist/esm/Seo/index.js.map +1 -1
- package/dist/esm/Seo/remixUtils.d.ts +24 -0
- package/dist/esm/Seo/remixUtils.js +37 -0
- package/dist/esm/Seo/remixUtils.js.map +1 -0
- package/dist/esm/Seo/renderMetaTags.d.ts +3 -0
- package/dist/esm/Seo/renderMetaTags.js +33 -0
- package/dist/esm/Seo/renderMetaTags.js.map +1 -0
- package/dist/esm/Seo/renderMetaTagsToString.d.ts +2 -0
- package/dist/esm/Seo/renderMetaTagsToString.js +18 -0
- package/dist/esm/Seo/renderMetaTagsToString.js.map +1 -0
- package/dist/esm/Seo/types.d.ts +37 -0
- package/dist/esm/Seo/types.js +4 -0
- package/dist/esm/Seo/types.js.map +1 -0
- package/dist/types/Image/index.d.ts +23 -6
- package/dist/types/Seo/index.d.ts +4 -12
- package/dist/types/Seo/remixUtils.d.ts +24 -0
- package/dist/types/Seo/renderMetaTags.d.ts +3 -0
- package/dist/types/Seo/renderMetaTagsToString.d.ts +2 -0
- package/dist/types/Seo/types.d.ts +37 -0
- package/package.json +1 -1
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { mount } from
|
|
3
|
-
import { Image } from
|
|
4
|
-
import { mockAllIsIntersecting } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import { Image } from '../index';
|
|
4
|
+
import { mockAllIsIntersecting } from 'react-intersection-observer/test-utils';
|
|
5
5
|
var data = {
|
|
6
|
-
alt:
|
|
6
|
+
alt: 'DatoCMS swag',
|
|
7
7
|
aspectRatio: 1.7777777777777777,
|
|
8
|
-
base64:
|
|
8
|
+
base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
|
|
9
9
|
height: 421,
|
|
10
|
-
sizes:
|
|
11
|
-
src:
|
|
12
|
-
srcSet:
|
|
13
|
-
title:
|
|
10
|
+
sizes: '(max-width: 750px) 100vw, 750px',
|
|
11
|
+
src: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&fit=crop&w=750',
|
|
12
|
+
srcSet: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=0.25&fit=crop&w=750 187w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=0.5&fit=crop&w=750 375w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=0.75&fit=crop&w=750 562w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=1&fit=crop&w=750 750w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=1.5&fit=crop&w=750 1125w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=2&fit=crop&w=750 1500w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=3&fit=crop&w=750 2250w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=4&fit=crop&w=750 3000w',
|
|
13
|
+
title: 'These are awesome, we know that.',
|
|
14
14
|
width: 750
|
|
15
15
|
};
|
|
16
|
-
describe(
|
|
16
|
+
describe('Image', function () {
|
|
17
17
|
// intersectionThreshold is an hack to make tests work
|
|
18
18
|
// we need the library to generate a different IntersectionObserver for each test
|
|
19
19
|
// otherwise the IntersectionObserver mocking won't work
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
['intrinsic', 'fixed', 'responsive', 'fill'].forEach(function (layout) {
|
|
21
|
+
describe("layout=" + layout, function () {
|
|
22
|
+
describe('not visible', function () {
|
|
23
|
+
it('renders the blur-up thumb', function () {
|
|
24
|
+
var wrapper = mount(React.createElement(Image, { data: data, layout: layout, intersectionThreshold: 0.1 }));
|
|
25
|
+
expect(wrapper).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe('visible', function () {
|
|
29
|
+
it('renders the image', function () {
|
|
30
|
+
var wrapper = mount(React.createElement(Image, { data: data, layout: layout, intersectionThreshold: 0.2 }));
|
|
31
|
+
mockAllIsIntersecting(true);
|
|
32
|
+
wrapper.update();
|
|
33
|
+
expect(wrapper).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
describe('image loaded', function () {
|
|
36
|
+
it('shows the image', function () {
|
|
37
|
+
var wrapper = mount(React.createElement(Image, { data: data, layout: layout, intersectionThreshold: 0.3 }));
|
|
38
|
+
mockAllIsIntersecting(true);
|
|
39
|
+
wrapper.update();
|
|
40
|
+
wrapper.find('img').last().simulate('load');
|
|
41
|
+
wrapper.update();
|
|
42
|
+
expect(wrapper).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
41
45
|
});
|
|
42
46
|
});
|
|
43
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/Image/__tests__/index.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,IAAM,IAAI,GAAG;IACX,GAAG,EAAE,cAAc;IACnB,WAAW,EAAE,kBAAkB;IA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CAAC;oBACF,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,SAAS,EAAE;gBAClB,EAAE,CAAC,mBAAmB,EAAE;oBACtB,IAAM,OAAO,GAAG,KAAK,CACnB,oBAAC,KAAK,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,GAAI,CAClE,CAAC;oBACF,qBAAqB,CAAC,IAAI,CAAC,CAAC;oBAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;oBACjB,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpC,CAAC,CAAC,CAAC;gBAEH,QAAQ,CAAC,cAAc,EAAE;oBACvB,EAAE,CAAC,iBAAiB,EAAE;wBACpB,IAAM,OAAO,GAAG,KAAK,CACnB,oBAAC,KAAK,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,GAAI,CAClE,CAAC;wBACF,qBAAqB,CAAC,IAAI,CAAC,CAAC;wBAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;wBACjB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;wBAC5C,OAAO,CAAC,MAAM,EAAE,CAAC;wBACjB,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAC;oBACpC,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import 'intersection-observer';
|
|
3
3
|
export declare type ResponsiveImageType = {
|
|
4
4
|
/** The aspect ratio (width/height) of the image */
|
|
5
5
|
aspectRatio: number;
|
|
@@ -39,14 +39,31 @@ declare type ImagePropTypes = {
|
|
|
39
39
|
intersectionThreshold?: number;
|
|
40
40
|
/** Margin around the placeholder. Can have values similar to the CSS margin property (top, right, bottom, left). The values can be percentages. This set of values serves to grow or shrink each side of the placeholder element's bounding box before computing intersections */
|
|
41
41
|
intersectionMargin?: string;
|
|
42
|
-
/**
|
|
42
|
+
/** Whether enable lazy loading or not */
|
|
43
43
|
lazyLoad?: boolean;
|
|
44
44
|
/** Additional CSS rules to add to the root node */
|
|
45
45
|
style?: React.CSSProperties;
|
|
46
46
|
/** Additional CSS rules to add to the image inside the `<picture />` tag */
|
|
47
47
|
pictureStyle?: React.CSSProperties;
|
|
48
|
-
/**
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The layout behavior of the image as the viewport changes size
|
|
50
|
+
*
|
|
51
|
+
* Possible values:
|
|
52
|
+
*
|
|
53
|
+
* * `intrinsic` (default): the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports
|
|
54
|
+
* * `fixed`: the image dimensions will not change as the viewport changes (no responsiveness) similar to the native img element
|
|
55
|
+
* * `responsive`: the image will scale the dimensions down for smaller viewports and scale up for larger viewports
|
|
56
|
+
* * `fill`: image will stretch both width and height to the dimensions of the parent element, provided the parent element is `relative`
|
|
57
|
+
* */
|
|
58
|
+
layout?: 'intrinsic' | 'fixed' | 'responsive' | 'fill';
|
|
59
|
+
/** Defines how the image will fit into its parent container when using layout="fill" */
|
|
60
|
+
objectFit?: CSSProperties['objectFit'];
|
|
61
|
+
/** Defines how the image is positioned within its parent element when using layout="fill". */
|
|
62
|
+
objectPosition?: CSSProperties['objectPosition'];
|
|
63
|
+
/** Triggered when the image finishes loading */
|
|
64
|
+
onLoad?(): void;
|
|
65
|
+
/** Whether the component should use a blurred image placeholder */
|
|
66
|
+
usePlaceholder?: boolean;
|
|
50
67
|
};
|
|
51
|
-
export declare const Image: React.
|
|
68
|
+
export declare const Image: React.ForwardRefExoticComponent<ImagePropTypes & React.RefAttributes<HTMLDivElement>>;
|
|
52
69
|
export {};
|
package/dist/esm/Image/index.js
CHANGED
|
@@ -9,12 +9,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import React, {
|
|
13
|
-
import
|
|
14
|
-
import { useInView } from
|
|
15
|
-
var isSsr = typeof window ===
|
|
12
|
+
import React, { useState, forwardRef, useCallback } from 'react';
|
|
13
|
+
import 'intersection-observer';
|
|
14
|
+
import { useInView } from 'react-intersection-observer';
|
|
15
|
+
var isSsr = typeof window === 'undefined';
|
|
16
16
|
var universalBtoa = isSsr
|
|
17
|
-
? function (str) { return Buffer.from(str.toString(),
|
|
17
|
+
? function (str) { return Buffer.from(str.toString(), 'binary').toString('base64'); }
|
|
18
18
|
: window.btoa;
|
|
19
19
|
var isIntersectionObserverAvailable = isSsr
|
|
20
20
|
? false
|
|
@@ -45,24 +45,30 @@ var imageShowStrategy = function (_a) {
|
|
|
45
45
|
}
|
|
46
46
|
return true;
|
|
47
47
|
};
|
|
48
|
-
export var Image = function (_a) {
|
|
48
|
+
export var Image = forwardRef(function (_a, ref) {
|
|
49
49
|
var _b;
|
|
50
|
-
var className = _a.className,
|
|
51
|
-
var
|
|
52
|
-
var handleLoad =
|
|
50
|
+
var className = _a.className, _c = _a.fadeInDuration, fadeInDuration = _c === void 0 ? 500 : _c, intersectionTreshold = _a.intersectionTreshold, intersectionThreshold = _a.intersectionThreshold, intersectionMargin = _a.intersectionMargin, pictureClassName = _a.pictureClassName, _d = _a.lazyLoad, lazyLoad = _d === void 0 ? true : _d, style = _a.style, pictureStyle = _a.pictureStyle, _e = _a.layout, layout = _e === void 0 ? 'intrinsic' : _e, objectFit = _a.objectFit, objectPosition = _a.objectPosition, data = _a.data, onLoad = _a.onLoad, _f = _a.usePlaceholder, usePlaceholder = _f === void 0 ? true : _f;
|
|
51
|
+
var _g = useState(false), loaded = _g[0], setLoaded = _g[1];
|
|
52
|
+
var handleLoad = function () {
|
|
53
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad();
|
|
53
54
|
setLoaded(true);
|
|
54
|
-
}
|
|
55
|
-
var
|
|
55
|
+
};
|
|
56
|
+
var _h = useInView({
|
|
56
57
|
threshold: intersectionThreshold || intersectionTreshold || 0,
|
|
57
|
-
rootMargin: intersectionMargin ||
|
|
58
|
+
rootMargin: intersectionMargin || '0px 0px 0px 0px',
|
|
58
59
|
triggerOnce: true
|
|
59
|
-
}),
|
|
60
|
+
}), viewRef = _h[0], inView = _h[1];
|
|
61
|
+
var callbackRef = useCallback(function (_ref) {
|
|
62
|
+
viewRef(_ref);
|
|
63
|
+
if (ref)
|
|
64
|
+
ref.current = _ref;
|
|
65
|
+
}, [viewRef]);
|
|
60
66
|
var absolutePositioning = {
|
|
61
|
-
position:
|
|
67
|
+
position: 'absolute',
|
|
62
68
|
left: 0,
|
|
63
69
|
top: 0,
|
|
64
|
-
width:
|
|
65
|
-
height:
|
|
70
|
+
width: '100%',
|
|
71
|
+
height: '100%'
|
|
66
72
|
};
|
|
67
73
|
var addImage = imageAddStrategy({
|
|
68
74
|
lazyLoad: lazyLoad,
|
|
@@ -76,25 +82,35 @@ export var Image = function (_a) {
|
|
|
76
82
|
});
|
|
77
83
|
var webpSource = data.webpSrcSet && (React.createElement("source", { srcSet: data.webpSrcSet, sizes: data.sizes, type: "image/webp" }));
|
|
78
84
|
var regularSource = data.srcSet && (React.createElement("source", { srcSet: data.srcSet, sizes: data.sizes }));
|
|
79
|
-
var transition =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
var transition = fadeInDuration > 0 ? "opacity " + fadeInDuration + "ms" : undefined;
|
|
86
|
+
var placeholder = usePlaceholder ? (React.createElement("img", { role: "presentation", src: data.base64, style: __assign({ backgroundColor: data.bgColor, opacity: showImage ? 0 : 1, transition: transition,
|
|
87
|
+
objectFit: objectFit,
|
|
88
|
+
objectPosition: objectPosition }, absolutePositioning) })) : null;
|
|
83
89
|
var width = data.width, aspectRatio = data.aspectRatio;
|
|
84
90
|
var height = data.height || width / aspectRatio;
|
|
85
91
|
var svg = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
|
|
86
|
-
var sizer = (React.createElement("img", { className: pictureClassName, style:
|
|
87
|
-
|
|
92
|
+
var sizer = layout !== 'fill' ? (React.createElement("img", { className: pictureClassName, style: {
|
|
93
|
+
display: 'block',
|
|
94
|
+
width: '100%'
|
|
95
|
+
}, src: "data:image/svg+xml;base64," + universalBtoa(svg), role: "presentation" })) : null;
|
|
96
|
+
return (React.createElement("div", { ref: callbackRef, className: className, style: __assign(__assign({ overflow: 'hidden' }, (layout === 'fill'
|
|
97
|
+
? absolutePositioning
|
|
98
|
+
: layout === 'intrinsic'
|
|
99
|
+
? { position: 'relative', width: '100%', maxWidth: width }
|
|
100
|
+
: layout === 'fixed'
|
|
101
|
+
? { position: 'relative', width: width }
|
|
102
|
+
: { position: 'relative', width: '100%' })), style) },
|
|
88
103
|
sizer,
|
|
89
104
|
placeholder,
|
|
90
105
|
addImage && (React.createElement("picture", null,
|
|
91
106
|
webpSource,
|
|
92
107
|
regularSource,
|
|
93
|
-
data.src && (React.createElement("img", { src: data.src, alt: data.alt, title: data.title, onLoad: handleLoad, className: pictureClassName, style: __assign(__assign(__assign({
|
|
108
|
+
data.src && (React.createElement("img", { src: data.src, alt: data.alt, title: data.title, onLoad: handleLoad, className: pictureClassName, style: __assign(__assign(__assign({ opacity: showImage ? 1 : 0, transition: transition }, absolutePositioning), { objectFit: objectFit,
|
|
109
|
+
objectPosition: objectPosition }), pictureStyle) })))),
|
|
94
110
|
React.createElement("noscript", null,
|
|
95
111
|
React.createElement("picture", null,
|
|
96
112
|
webpSource,
|
|
97
113
|
regularSource,
|
|
98
114
|
data.src && (React.createElement("img", { src: data.src, alt: (_b = data.alt) !== null && _b !== void 0 ? _b : '', title: data.title, className: pictureClassName, style: __assign(__assign({}, absolutePositioning), pictureStyle), loading: "lazy" }))))));
|
|
99
|
-
};
|
|
115
|
+
});
|
|
100
116
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Image/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Image/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAiB,MAAM,OAAO,CAAC;AAChF,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,IAAM,KAAK,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AAC5C,IAAM,aAAa,GAAG,KAAK;IACzB,CAAC,CAAC,UAAC,GAAW,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAxD,CAAwD;IAC3E,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;AAEhB,IAAM,+BAA+B,GAAG,KAAK;IAC3C,CAAC,CAAC,KAAK;IACP,CAAC,CAAC,CAAC,CAAE,MAAc,CAAC,oBAAoB,CAAC;AA2E3C,IAAM,gBAAgB,GAAG,UAAC,EAAmC;QAAjC,QAAQ,cAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA;IAClD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,IAAI,CAAC;KACb;IAED,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC;KACd;IAED,IAAI,+BAA+B,EAAE;QACnC,OAAO,MAAM,IAAI,MA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,IAAI,CAAC,GAAG,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,+BACH,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1B,UAAU,YAAA,IACP,mBAAmB,KACtB,SAAS,WAAA;oBACT,cAAc,gBAAA,KACX,YAAY,IAEjB,CACH,CACO,CACX;QACD;YACE;gBACG,UAAU;gBACV,aAAa;gBACb,IAAI,CAAC,GAAG,IAAI,CACX,6BACE,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,MAAA,IAAI,CAAC,GAAG,mCAAI,EAAE,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,wBAAO,mBAAmB,GAAK,YAAY,GAChD,OAAO,EAAC,MAAM,GACd,CACH,CACO,CACD,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,47 +1,284 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { shallow } from "enzyme";
|
|
3
|
-
import { renderMetaTags, renderMetaTagsToString } from "
|
|
3
|
+
import { renderMetaTags, renderMetaTagsToString, toRemixLinks, toRemixMeta } from "..";
|
|
4
4
|
var metaTags = [
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
tag: "title"
|
|
6
|
+
"content": "Remix CMS - The easiest way to manage content with Remix",
|
|
7
|
+
"attributes": null,
|
|
8
|
+
"tag": "title"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"content": null,
|
|
12
|
+
"attributes": {
|
|
13
|
+
"property": "og:title",
|
|
14
|
+
"content": "Remix CMS - The easiest way to manage content with Remix"
|
|
14
15
|
},
|
|
15
|
-
|
|
16
|
-
tag: "meta"
|
|
16
|
+
"tag": "meta"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"content": null,
|
|
20
|
+
"attributes": {
|
|
21
|
+
"name": "twitter:title",
|
|
22
|
+
"content": "Remix CMS - The easiest way to manage content with Remix"
|
|
22
23
|
},
|
|
23
|
-
|
|
24
|
-
tag: "meta"
|
|
24
|
+
"tag": "meta"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
href: "https://example.org/favicon.png?h=16&w=16"
|
|
27
|
+
"content": null,
|
|
28
|
+
"attributes": {
|
|
29
|
+
"name": "description",
|
|
30
|
+
"content": "Remix makes building scalable and fast React apps simple, pair it with a CMS that shares the same intuitiveness. Start a new Remix + Dato project now."
|
|
32
31
|
},
|
|
33
|
-
|
|
34
|
-
tag: "link"
|
|
32
|
+
"tag": "meta"
|
|
35
33
|
},
|
|
36
34
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
href: "https://example.org/favicon.png?h=32&w=32"
|
|
35
|
+
"content": null,
|
|
36
|
+
"attributes": {
|
|
37
|
+
"property": "og:description",
|
|
38
|
+
"content": "Remix makes building scalable and fast React apps simple, pair it with a CMS that shares the same intuitiveness. Start a new Remix + Dato project now."
|
|
42
39
|
},
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
"tag": "meta"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"content": null,
|
|
44
|
+
"attributes": {
|
|
45
|
+
"name": "twitter:description",
|
|
46
|
+
"content": "Remix makes building scalable and fast React apps simple, pair it with a CMS that shares the same intuitiveness. Start a new Remix + Dato project now."
|
|
47
|
+
},
|
|
48
|
+
"tag": "meta"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"content": null,
|
|
52
|
+
"attributes": {
|
|
53
|
+
"property": "og:image",
|
|
54
|
+
"content": "https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000"
|
|
55
|
+
},
|
|
56
|
+
"tag": "meta"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"content": null,
|
|
60
|
+
"attributes": {
|
|
61
|
+
"property": "og:image:width",
|
|
62
|
+
"content": "746"
|
|
63
|
+
},
|
|
64
|
+
"tag": "meta"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"content": null,
|
|
68
|
+
"attributes": {
|
|
69
|
+
"property": "og:image:height",
|
|
70
|
+
"content": "186"
|
|
71
|
+
},
|
|
72
|
+
"tag": "meta"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"content": null,
|
|
76
|
+
"attributes": {
|
|
77
|
+
"name": "twitter:image",
|
|
78
|
+
"content": "https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000"
|
|
79
|
+
},
|
|
80
|
+
"tag": "meta"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"content": null,
|
|
84
|
+
"attributes": {
|
|
85
|
+
"property": "og:locale",
|
|
86
|
+
"content": "en"
|
|
87
|
+
},
|
|
88
|
+
"tag": "meta"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"content": null,
|
|
92
|
+
"attributes": {
|
|
93
|
+
"property": "og:type",
|
|
94
|
+
"content": "article"
|
|
95
|
+
},
|
|
96
|
+
"tag": "meta"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"content": null,
|
|
100
|
+
"attributes": {
|
|
101
|
+
"property": "og:site_name",
|
|
102
|
+
"content": "DatoCMS"
|
|
103
|
+
},
|
|
104
|
+
"tag": "meta"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"content": null,
|
|
108
|
+
"attributes": {
|
|
109
|
+
"property": "article:modified_time",
|
|
110
|
+
"content": "2022-01-18T14:02:47Z"
|
|
111
|
+
},
|
|
112
|
+
"tag": "meta"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"content": null,
|
|
116
|
+
"attributes": {
|
|
117
|
+
"name": "twitter:card",
|
|
118
|
+
"content": "summary_large_image"
|
|
119
|
+
},
|
|
120
|
+
"tag": "meta"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"content": null,
|
|
124
|
+
"attributes": {
|
|
125
|
+
"name": "twitter:site",
|
|
126
|
+
"content": "@datocms"
|
|
127
|
+
},
|
|
128
|
+
"tag": "meta"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"attributes": {
|
|
132
|
+
"sizes": "16x16",
|
|
133
|
+
"type": "image/png",
|
|
134
|
+
"rel": "icon",
|
|
135
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=16&w=16"
|
|
136
|
+
},
|
|
137
|
+
"content": null,
|
|
138
|
+
"tag": "link"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"attributes": {
|
|
142
|
+
"sizes": "32x32",
|
|
143
|
+
"type": "image/png",
|
|
144
|
+
"rel": "icon",
|
|
145
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=32&w=32"
|
|
146
|
+
},
|
|
147
|
+
"content": null,
|
|
148
|
+
"tag": "link"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"attributes": {
|
|
152
|
+
"sizes": "96x96",
|
|
153
|
+
"type": "image/png",
|
|
154
|
+
"rel": "icon",
|
|
155
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=96&w=96"
|
|
156
|
+
},
|
|
157
|
+
"content": null,
|
|
158
|
+
"tag": "link"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"attributes": {
|
|
162
|
+
"sizes": "192x192",
|
|
163
|
+
"type": "image/png",
|
|
164
|
+
"rel": "icon",
|
|
165
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=192&w=192"
|
|
166
|
+
},
|
|
167
|
+
"content": null,
|
|
168
|
+
"tag": "link"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"attributes": {
|
|
172
|
+
"sizes": "57x57",
|
|
173
|
+
"rel": "apple-touch-icon",
|
|
174
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=57&w=57"
|
|
175
|
+
},
|
|
176
|
+
"content": null,
|
|
177
|
+
"tag": "link"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"attributes": {
|
|
181
|
+
"sizes": "60x60",
|
|
182
|
+
"rel": "apple-touch-icon",
|
|
183
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=60&w=60"
|
|
184
|
+
},
|
|
185
|
+
"content": null,
|
|
186
|
+
"tag": "link"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"attributes": {
|
|
190
|
+
"sizes": "72x72",
|
|
191
|
+
"rel": "apple-touch-icon",
|
|
192
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=72&w=72"
|
|
193
|
+
},
|
|
194
|
+
"content": null,
|
|
195
|
+
"tag": "link"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"attributes": {
|
|
199
|
+
"sizes": "76x76",
|
|
200
|
+
"rel": "apple-touch-icon",
|
|
201
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=76&w=76"
|
|
202
|
+
},
|
|
203
|
+
"content": null,
|
|
204
|
+
"tag": "link"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"attributes": {
|
|
208
|
+
"sizes": "114x114",
|
|
209
|
+
"rel": "apple-touch-icon",
|
|
210
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=114&w=114"
|
|
211
|
+
},
|
|
212
|
+
"content": null,
|
|
213
|
+
"tag": "link"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"attributes": {
|
|
217
|
+
"sizes": "120x120",
|
|
218
|
+
"rel": "apple-touch-icon",
|
|
219
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=120&w=120"
|
|
220
|
+
},
|
|
221
|
+
"content": null,
|
|
222
|
+
"tag": "link"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"attributes": {
|
|
226
|
+
"sizes": "144x144",
|
|
227
|
+
"rel": "apple-touch-icon",
|
|
228
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=144&w=144"
|
|
229
|
+
},
|
|
230
|
+
"content": null,
|
|
231
|
+
"tag": "link"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"attributes": {
|
|
235
|
+
"sizes": "152x152",
|
|
236
|
+
"rel": "apple-touch-icon",
|
|
237
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=152&w=152"
|
|
238
|
+
},
|
|
239
|
+
"content": null,
|
|
240
|
+
"tag": "link"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"attributes": {
|
|
244
|
+
"sizes": "180x180",
|
|
245
|
+
"rel": "apple-touch-icon",
|
|
246
|
+
"href": "https://www.datocms-assets.com/205/1525789775-dato.png?h=180&w=180"
|
|
247
|
+
},
|
|
248
|
+
"content": null,
|
|
249
|
+
"tag": "link"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"attributes": {
|
|
253
|
+
"name": "msapplication-square70x70logo",
|
|
254
|
+
"content": "https://www.datocms-assets.com/205/1525789775-dato.png?h=70&w=70"
|
|
255
|
+
},
|
|
256
|
+
"content": null,
|
|
257
|
+
"tag": "meta"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"attributes": {
|
|
261
|
+
"name": "msapplication-square150x150logo",
|
|
262
|
+
"content": "https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=150"
|
|
263
|
+
},
|
|
264
|
+
"content": null,
|
|
265
|
+
"tag": "meta"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"attributes": {
|
|
269
|
+
"name": "msapplication-square310x310logo",
|
|
270
|
+
"content": "https://www.datocms-assets.com/205/1525789775-dato.png?h=310&w=310"
|
|
271
|
+
},
|
|
272
|
+
"content": null,
|
|
273
|
+
"tag": "meta"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"attributes": {
|
|
277
|
+
"name": "msapplication-square310x150logo",
|
|
278
|
+
"content": "https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=310"
|
|
279
|
+
},
|
|
280
|
+
"content": null,
|
|
281
|
+
"tag": "meta"
|
|
45
282
|
}
|
|
46
283
|
];
|
|
47
284
|
describe("renderMetaTags", function () {
|
|
@@ -52,14 +289,17 @@ describe("renderMetaTags", function () {
|
|
|
52
289
|
});
|
|
53
290
|
describe("renderMetaTagsToString", function () {
|
|
54
291
|
it("generates an array of meta tags", function () {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
292
|
+
expect(renderMetaTagsToString(metaTags)).toMatchSnapshot();
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
describe("toRemixLinks", function () {
|
|
296
|
+
it("generates an array of link descriptors", function () {
|
|
297
|
+
expect(toRemixLinks(metaTags)).toMatchSnapshot();
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
describe("toRemixMeta", function () {
|
|
301
|
+
it("generates a meta descriptor", function () {
|
|
302
|
+
expect(toRemixMeta(metaTags)).toMatchSnapshot();
|
|
63
303
|
});
|
|
64
304
|
});
|
|
65
305
|
//# sourceMappingURL=index.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/Seo/__tests__/index.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/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