react-datocms 4.0.4 → 4.0.6
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/cjs/Image/index.js +9 -16
- package/dist/cjs/Image/index.js.map +1 -1
- package/dist/cjs/Seo/__tests__/index.test.js +187 -187
- package/dist/cjs/Seo/__tests__/index.test.js.map +1 -1
- package/dist/cjs/StructuredText/__tests__/index.test.js.map +1 -1
- package/dist/cjs/StructuredText/index.js +3 -3
- package/dist/cjs/StructuredText/index.js.map +1 -1
- package/dist/cjs/setupTests.js.map +1 -1
- package/dist/cjs/useQuerySubscription/index.js.map +1 -1
- package/dist/esm/Image/index.d.ts +4 -0
- package/dist/esm/Image/index.js +9 -16
- package/dist/esm/Image/index.js.map +1 -1
- package/dist/esm/Seo/__tests__/index.test.js +190 -190
- package/dist/esm/Seo/__tests__/index.test.js.map +1 -1
- package/dist/esm/StructuredText/__tests__/index.test.js.map +1 -1
- package/dist/esm/StructuredText/index.js +3 -3
- package/dist/esm/StructuredText/index.js.map +1 -1
- package/dist/esm/setupTests.js.map +1 -1
- package/dist/esm/useQuerySubscription/index.js +1 -1
- package/dist/esm/useQuerySubscription/index.js.map +1 -1
- package/dist/types/Image/index.d.ts +4 -0
- package/package.json +3 -1
- package/src/Image/__tests__/__snapshots__/index.test.tsx.snap +64 -0
- package/src/Image/index.tsx +16 -2
- package/src/Seo/__tests__/index.test.tsx +202 -197
- package/src/Seo/index.ts +1 -1
- package/src/StructuredText/__tests__/index.test.tsx +2 -1
- package/src/StructuredText/index.tsx +3 -3
- package/src/setupTests.ts +2 -2
- package/src/useQuerySubscription/index.ts +3 -1
package/dist/cjs/Image/index.js
CHANGED
|
@@ -65,7 +65,7 @@ var imageShowStrategy = function (_a) {
|
|
|
65
65
|
return true;
|
|
66
66
|
};
|
|
67
67
|
var buildSrcSet = function (src, width, candidateMultipliers) {
|
|
68
|
-
if (!src
|
|
68
|
+
if (!(src && width)) {
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
71
71
|
return candidateMultipliers
|
|
@@ -93,7 +93,7 @@ var buildSrcSet = function (src, width, candidateMultipliers) {
|
|
|
93
93
|
};
|
|
94
94
|
exports.Image = (0, react_1.forwardRef)(function (_a, ref) {
|
|
95
95
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
96
|
-
var className = _a.className, _m = _a.fadeInDuration, fadeInDuration = _m === void 0 ? 500 : _m, intersectionTreshold = _a.intersectionTreshold, intersectionThreshold = _a.intersectionThreshold, intersectionMargin = _a.intersectionMargin, pictureClassName = _a.pictureClassName, _o = _a.lazyLoad, rawLazyLoad = _o === void 0 ? true : _o, style = _a.style, pictureStyle = _a.pictureStyle, _p = _a.layout, layout = _p === void 0 ? 'intrinsic' : _p, objectFit = _a.objectFit, objectPosition = _a.objectPosition, data = _a.data, onLoad = _a.onLoad, _q = _a.usePlaceholder, usePlaceholder = _q === void 0 ? true : _q, _r = _a.priority, priority = _r === void 0 ? false : _r, sizes = _a.sizes, _s = _a.srcSetCandidates, srcSetCandidates = _s === void 0 ? [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4] : _s;
|
|
96
|
+
var className = _a.className, _m = _a.fadeInDuration, fadeInDuration = _m === void 0 ? 500 : _m, intersectionTreshold = _a.intersectionTreshold, intersectionThreshold = _a.intersectionThreshold, intersectionMargin = _a.intersectionMargin, pictureClassName = _a.pictureClassName, _o = _a.lazyLoad, rawLazyLoad = _o === void 0 ? true : _o, style = _a.style, pictureStyle = _a.pictureStyle, _p = _a.layout, layout = _p === void 0 ? 'intrinsic' : _p, objectFit = _a.objectFit, objectPosition = _a.objectPosition, data = _a.data, onLoad = _a.onLoad, _q = _a.usePlaceholder, usePlaceholder = _q === void 0 ? true : _q, _r = _a.priority, priority = _r === void 0 ? false : _r, sizes = _a.sizes, _s = _a.srcSetCandidates, srcSetCandidates = _s === void 0 ? [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4] : _s, placeholderClassName = _a.placeholderClassName, placeholderStyle = _a.placeholderStyle;
|
|
97
97
|
var lazyLoad = priority ? false : rawLazyLoad;
|
|
98
98
|
var _t = (0, react_1.useState)(false), loaded = _t[0], setLoaded = _t[1];
|
|
99
99
|
var imageRef = (0, react_1.useRef)(null);
|
|
@@ -118,15 +118,18 @@ exports.Image = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
118
118
|
}), viewRef = _u[0], inView = _u[1];
|
|
119
119
|
var callbackRef = (0, react_1.useCallback)(function (_ref) {
|
|
120
120
|
viewRef(_ref);
|
|
121
|
-
if (ref)
|
|
121
|
+
if (ref) {
|
|
122
122
|
ref.current = _ref;
|
|
123
|
+
}
|
|
123
124
|
}, [viewRef]);
|
|
124
125
|
var absolutePositioning = {
|
|
125
126
|
position: 'absolute',
|
|
126
127
|
left: 0,
|
|
127
128
|
top: 0,
|
|
128
129
|
width: '100%',
|
|
129
|
-
height: '100%'
|
|
130
|
+
height: '100%',
|
|
131
|
+
maxWidth: 'none',
|
|
132
|
+
maxHeight: 'none'
|
|
130
133
|
};
|
|
131
134
|
var addImage = imageAddStrategy({
|
|
132
135
|
lazyLoad: lazyLoad,
|
|
@@ -141,22 +144,12 @@ exports.Image = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
141
144
|
var webpSource = data.webpSrcSet && (react_1["default"].createElement("source", { srcSet: data.webpSrcSet, sizes: (_b = sizes !== null && sizes !== void 0 ? sizes : data.sizes) !== null && _b !== void 0 ? _b : undefined, type: "image/webp" }));
|
|
142
145
|
var regularSource = (react_1["default"].createElement("source", { srcSet: (_c = data.srcSet) !== null && _c !== void 0 ? _c : buildSrcSet(data.src, data.width, srcSetCandidates), sizes: (_d = sizes !== null && sizes !== void 0 ? sizes : data.sizes) !== null && _d !== void 0 ? _d : undefined }));
|
|
143
146
|
var transition = fadeInDuration > 0 ? "opacity ".concat(fadeInDuration, "ms") : undefined;
|
|
144
|
-
var placeholder = usePlaceholder && (data.bgColor || data.base64) ? (react_1["default"].createElement("img", { role: "presentation", "aria-hidden": "true", alt: "", src: (_e = data.base64) !== null && _e !== void 0 ? _e : undefined, style: {
|
|
145
|
-
backgroundColor: (_f = data.bgColor) !== null && _f !== void 0 ? _f : undefined,
|
|
146
|
-
objectFit: objectFit,
|
|
147
|
-
objectPosition: objectPosition,
|
|
148
|
-
transition: transition,
|
|
149
|
-
opacity: showImage ? 0 : 1,
|
|
147
|
+
var placeholder = usePlaceholder && (data.bgColor || data.base64) ? (react_1["default"].createElement("img", { role: "presentation", "aria-hidden": "true", alt: "", src: (_e = data.base64) !== null && _e !== void 0 ? _e : undefined, className: placeholderClassName, style: __assign({ backgroundColor: (_f = data.bgColor) !== null && _f !== void 0 ? _f : undefined, objectFit: objectFit, objectPosition: objectPosition, transition: transition, opacity: showImage ? 0 : 1,
|
|
150
148
|
// During the opacity transition of the placeholder to the definitive version,
|
|
151
149
|
// hardware acceleration is triggered. This results in the browser trying to render the
|
|
152
150
|
// placeholder with your GPU, causing blurred edges. Solution: style the placeholder
|
|
153
151
|
// so the edges overflow the container
|
|
154
|
-
position: 'absolute',
|
|
155
|
-
left: '-5%',
|
|
156
|
-
top: '-5%',
|
|
157
|
-
width: '110%',
|
|
158
|
-
height: '110%'
|
|
159
|
-
} })) : null;
|
|
152
|
+
position: 'absolute', left: '-5%', top: '-5%', width: '110%', height: '110%', maxWidth: 'none', maxHeight: 'none' }, placeholderStyle) })) : null;
|
|
160
153
|
var width = data.width, aspectRatio = data.aspectRatio;
|
|
161
154
|
var height = (_g = data.height) !== null && _g !== void 0 ? _g : (aspectRatio ? width / aspectRatio : 0);
|
|
162
155
|
var svg = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(width, "\" height=\"").concat(height, "\"></svg>");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Image/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAOe;AACf,2EAAw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CAAC,CAAC,EAC1B,UAAU,YAAA,IACP,mBAAmB,KACtB,SAAS,WAAA,EACT,cAAc,gBAAA,KACX,YAAY,IAEjB,CACH,CACO,CACX;QACD;YACE;gBACG,UAAU;gBACV,aAAa;gBACb,IAAI,CAAC,GAAG,IAAI,CACX,0CACE,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,MAAA,IAAI,CAAC,GAAG,mCAAI,EAAE,EACnB,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,SAAS,EAC9B,SAAS,EAAE,gBAAgB,EAC3B,KAAK,iCACA,mBAAmB,KACtB,SAAS,WAAA,EACT,cAAc,gBAAA,KACX,YAAY,GAEjB,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GAC5C,CACH,CACO,CACD,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -24,297 +24,297 @@ var enzyme_1 = require("enzyme");
|
|
|
24
24
|
var __1 = require("..");
|
|
25
25
|
var metaTags = [
|
|
26
26
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
content: 'Remix CMS - The easiest way to manage content with Remix',
|
|
28
|
+
attributes: null,
|
|
29
|
+
tag: 'title'
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
content: null,
|
|
33
|
+
attributes: {
|
|
34
|
+
property: 'og:title',
|
|
35
|
+
content: 'Remix CMS - The easiest way to manage content with Remix'
|
|
36
36
|
},
|
|
37
|
-
|
|
37
|
+
tag: 'meta'
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
content: null,
|
|
41
|
+
attributes: {
|
|
42
|
+
name: 'twitter:title',
|
|
43
|
+
content: 'Remix CMS - The easiest way to manage content with Remix'
|
|
44
44
|
},
|
|
45
|
-
|
|
45
|
+
tag: 'meta'
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
content: null,
|
|
49
|
+
attributes: {
|
|
50
|
+
name: 'description',
|
|
51
|
+
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.'
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
tag: 'meta'
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
content: null,
|
|
57
|
+
attributes: {
|
|
58
|
+
property: 'og:description',
|
|
59
|
+
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.'
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
tag: 'meta'
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
content: null,
|
|
65
|
+
attributes: {
|
|
66
|
+
name: 'twitter:description',
|
|
67
|
+
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.'
|
|
68
68
|
},
|
|
69
|
-
|
|
69
|
+
tag: 'meta'
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
content: null,
|
|
73
|
+
attributes: {
|
|
74
|
+
property: 'og:image',
|
|
75
|
+
content: 'https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000'
|
|
76
76
|
},
|
|
77
|
-
|
|
77
|
+
tag: 'meta'
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
content: null,
|
|
81
|
+
attributes: {
|
|
82
|
+
property: 'og:image:width',
|
|
83
|
+
content: '746'
|
|
84
84
|
},
|
|
85
|
-
|
|
85
|
+
tag: 'meta'
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
content: null,
|
|
89
|
+
attributes: {
|
|
90
|
+
property: 'og:image:height',
|
|
91
|
+
content: '186'
|
|
92
92
|
},
|
|
93
|
-
|
|
93
|
+
tag: 'meta'
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
content: null,
|
|
97
|
+
attributes: {
|
|
98
|
+
name: 'twitter:image',
|
|
99
|
+
content: 'https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000'
|
|
100
100
|
},
|
|
101
|
-
|
|
101
|
+
tag: 'meta'
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
content: null,
|
|
105
|
+
attributes: {
|
|
106
|
+
property: 'og:locale',
|
|
107
|
+
content: 'en'
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
tag: 'meta'
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
content: null,
|
|
113
|
+
attributes: {
|
|
114
|
+
property: 'og:type',
|
|
115
|
+
content: 'article'
|
|
116
116
|
},
|
|
117
|
-
|
|
117
|
+
tag: 'meta'
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
content: null,
|
|
121
|
+
attributes: {
|
|
122
|
+
property: 'og:site_name',
|
|
123
|
+
content: 'DatoCMS'
|
|
124
124
|
},
|
|
125
|
-
|
|
125
|
+
tag: 'meta'
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
content: null,
|
|
129
|
+
attributes: {
|
|
130
|
+
property: 'article:modified_time',
|
|
131
|
+
content: '2022-01-18T14:02:47Z'
|
|
132
132
|
},
|
|
133
|
-
|
|
133
|
+
tag: 'meta'
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
content: null,
|
|
137
|
+
attributes: {
|
|
138
|
+
name: 'twitter:card',
|
|
139
|
+
content: 'summary_large_image'
|
|
140
140
|
},
|
|
141
|
-
|
|
141
|
+
tag: 'meta'
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
content: null,
|
|
145
|
+
attributes: {
|
|
146
|
+
name: 'twitter:site',
|
|
147
|
+
content: '@datocms'
|
|
148
148
|
},
|
|
149
|
-
|
|
149
|
+
tag: 'meta'
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
attributes: {
|
|
153
|
+
sizes: '16x16',
|
|
154
|
+
type: 'image/png',
|
|
155
|
+
rel: 'icon',
|
|
156
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=16&w=16'
|
|
157
157
|
},
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
content: null,
|
|
159
|
+
tag: 'link'
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
attributes: {
|
|
163
|
+
sizes: '32x32',
|
|
164
|
+
type: 'image/png',
|
|
165
|
+
rel: 'icon',
|
|
166
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=32&w=32'
|
|
167
167
|
},
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
content: null,
|
|
169
|
+
tag: 'link'
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
attributes: {
|
|
173
|
+
sizes: '96x96',
|
|
174
|
+
type: 'image/png',
|
|
175
|
+
rel: 'icon',
|
|
176
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=96&w=96'
|
|
177
177
|
},
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
content: null,
|
|
179
|
+
tag: 'link'
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
attributes: {
|
|
183
|
+
sizes: '192x192',
|
|
184
|
+
type: 'image/png',
|
|
185
|
+
rel: 'icon',
|
|
186
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=192&w=192'
|
|
187
187
|
},
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
content: null,
|
|
189
|
+
tag: 'link'
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
attributes: {
|
|
193
|
+
sizes: '57x57',
|
|
194
|
+
rel: 'apple-touch-icon',
|
|
195
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=57&w=57'
|
|
196
196
|
},
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
content: null,
|
|
198
|
+
tag: 'link'
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
attributes: {
|
|
202
|
+
sizes: '60x60',
|
|
203
|
+
rel: 'apple-touch-icon',
|
|
204
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=60&w=60'
|
|
205
205
|
},
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
content: null,
|
|
207
|
+
tag: 'link'
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
attributes: {
|
|
211
|
+
sizes: '72x72',
|
|
212
|
+
rel: 'apple-touch-icon',
|
|
213
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=72&w=72'
|
|
214
214
|
},
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
content: null,
|
|
216
|
+
tag: 'link'
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
attributes: {
|
|
220
|
+
sizes: '76x76',
|
|
221
|
+
rel: 'apple-touch-icon',
|
|
222
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=76&w=76'
|
|
223
223
|
},
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
content: null,
|
|
225
|
+
tag: 'link'
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
attributes: {
|
|
229
|
+
sizes: '114x114',
|
|
230
|
+
rel: 'apple-touch-icon',
|
|
231
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=114&w=114'
|
|
232
232
|
},
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
content: null,
|
|
234
|
+
tag: 'link'
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
attributes: {
|
|
238
|
+
sizes: '120x120',
|
|
239
|
+
rel: 'apple-touch-icon',
|
|
240
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=120&w=120'
|
|
241
241
|
},
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
content: null,
|
|
243
|
+
tag: 'link'
|
|
244
244
|
},
|
|
245
245
|
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
attributes: {
|
|
247
|
+
sizes: '144x144',
|
|
248
|
+
rel: 'apple-touch-icon',
|
|
249
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=144&w=144'
|
|
250
250
|
},
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
content: null,
|
|
252
|
+
tag: 'link'
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
attributes: {
|
|
256
|
+
sizes: '152x152',
|
|
257
|
+
rel: 'apple-touch-icon',
|
|
258
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=152&w=152'
|
|
259
259
|
},
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
content: null,
|
|
261
|
+
tag: 'link'
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
attributes: {
|
|
265
|
+
sizes: '180x180',
|
|
266
|
+
rel: 'apple-touch-icon',
|
|
267
|
+
href: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=180&w=180'
|
|
268
268
|
},
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
content: null,
|
|
270
|
+
tag: 'link'
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
attributes: {
|
|
274
|
+
name: 'msapplication-square70x70logo',
|
|
275
|
+
content: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=70&w=70'
|
|
276
276
|
},
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
content: null,
|
|
278
|
+
tag: 'meta'
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
281
|
+
attributes: {
|
|
282
|
+
name: 'msapplication-square150x150logo',
|
|
283
|
+
content: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=150'
|
|
284
284
|
},
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
content: null,
|
|
286
|
+
tag: 'meta'
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
attributes: {
|
|
290
|
+
name: 'msapplication-square310x310logo',
|
|
291
|
+
content: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=310&w=310'
|
|
292
292
|
},
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
content: null,
|
|
294
|
+
tag: 'meta'
|
|
295
295
|
},
|
|
296
296
|
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
attributes: {
|
|
298
|
+
name: 'msapplication-square310x150logo',
|
|
299
|
+
content: 'https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=310'
|
|
300
300
|
},
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
301
|
+
content: null,
|
|
302
|
+
tag: 'meta'
|
|
303
|
+
},
|
|
304
304
|
];
|
|
305
|
-
describe(
|
|
306
|
-
it(
|
|
305
|
+
describe('renderMetaTags', function () {
|
|
306
|
+
it('generates an array of meta tags', function () {
|
|
307
307
|
var wrapper = (0, enzyme_1.shallow)(React.createElement("head", null, (0, __1.renderMetaTags)(metaTags)));
|
|
308
308
|
expect(wrapper).toMatchSnapshot();
|
|
309
309
|
});
|
|
310
310
|
});
|
|
311
|
-
describe(
|
|
312
|
-
it(
|
|
311
|
+
describe('renderMetaTagsToString', function () {
|
|
312
|
+
it('generates an array of meta tags', function () {
|
|
313
313
|
expect((0, __1.renderMetaTagsToString)(metaTags)).toMatchSnapshot();
|
|
314
314
|
});
|
|
315
315
|
});
|
|
316
|
-
describe(
|
|
317
|
-
it(
|
|
316
|
+
describe('toRemixMeta', function () {
|
|
317
|
+
it('generates a meta descriptor', function () {
|
|
318
318
|
expect((0, __1.toRemixMeta)(metaTags)).toMatchSnapshot();
|
|
319
319
|
});
|
|
320
320
|
});
|