react-datocms 4.1.3 → 4.2.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.
Files changed (115) hide show
  1. package/README.md +34 -6
  2. package/dist/cjs/Image/index.js +68 -74
  3. package/dist/cjs/Image/index.js.map +1 -1
  4. package/dist/cjs/Image/useInView.js +3 -14
  5. package/dist/cjs/Image/useInView.js.map +1 -1
  6. package/dist/cjs/Seo/index.js +1 -1
  7. package/dist/cjs/Seo/nextUtils.js +28 -49
  8. package/dist/cjs/Seo/nextUtils.js.map +1 -1
  9. package/dist/cjs/Seo/remixUtils.js +6 -18
  10. package/dist/cjs/Seo/remixUtils.js.map +1 -1
  11. package/dist/cjs/Seo/renderMetaTags.js +6 -18
  12. package/dist/cjs/Seo/renderMetaTags.js.map +1 -1
  13. package/dist/cjs/Seo/renderMetaTagsToString.js +7 -7
  14. package/dist/cjs/Seo/renderMetaTagsToString.js.map +1 -1
  15. package/dist/cjs/Seo/types.js +31 -51
  16. package/dist/cjs/Seo/types.js.map +1 -1
  17. package/dist/cjs/StructuredText/index.js +40 -52
  18. package/dist/cjs/StructuredText/index.js.map +1 -1
  19. package/dist/cjs/VideoPlayer/index.js +67 -0
  20. package/dist/cjs/VideoPlayer/index.js.map +1 -0
  21. package/dist/cjs/index.js +4 -2
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/cjs/useQuerySubscription/index.js +25 -70
  24. package/dist/cjs/useQuerySubscription/index.js.map +1 -1
  25. package/dist/cjs/useSiteSearch/index.js +71 -123
  26. package/dist/cjs/useSiteSearch/index.js.map +1 -1
  27. package/dist/cjs/useVideoPlayer/index.js +31 -0
  28. package/dist/cjs/useVideoPlayer/index.js.map +1 -0
  29. package/dist/esm/Image/index.js +62 -68
  30. package/dist/esm/Image/index.js.map +1 -1
  31. package/dist/esm/Seo/nextUtils.js +26 -47
  32. package/dist/esm/Seo/nextUtils.js.map +1 -1
  33. package/dist/esm/Seo/remixUtils.js +5 -17
  34. package/dist/esm/Seo/remixUtils.js.map +1 -1
  35. package/dist/esm/Seo/renderMetaTags.js +4 -16
  36. package/dist/esm/Seo/renderMetaTags.js.map +1 -1
  37. package/dist/esm/Seo/renderMetaTagsToString.js +6 -6
  38. package/dist/esm/Seo/renderMetaTagsToString.js.map +1 -1
  39. package/dist/esm/Seo/types.js +30 -50
  40. package/dist/esm/Seo/types.js.map +1 -1
  41. package/dist/esm/StructuredText/index.js +33 -45
  42. package/dist/esm/StructuredText/index.js.map +1 -1
  43. package/dist/esm/VideoPlayer/index.js +38 -0
  44. package/dist/esm/VideoPlayer/index.js.map +1 -0
  45. package/dist/esm/index.js +3 -1
  46. package/dist/esm/index.js.map +1 -1
  47. package/dist/esm/useQuerySubscription/index.js +22 -67
  48. package/dist/esm/useQuerySubscription/index.js.map +1 -1
  49. package/dist/esm/useSiteSearch/index.js +65 -117
  50. package/dist/esm/useSiteSearch/index.js.map +1 -1
  51. package/dist/esm/useVideoPlayer/index.js +27 -0
  52. package/dist/esm/useVideoPlayer/index.js.map +1 -0
  53. package/dist/types/Seo/nextUtils.d.ts +1 -1
  54. package/dist/types/Seo/remixUtils.d.ts +1 -1
  55. package/dist/types/Seo/renderMetaTags.d.ts +1 -1
  56. package/dist/types/Seo/renderMetaTagsToString.d.ts +1 -1
  57. package/dist/types/StructuredText/index.d.ts +2 -2
  58. package/dist/types/VideoPlayer/index.d.ts +26 -0
  59. package/dist/types/index.d.ts +3 -1
  60. package/dist/types/useVideoPlayer/index.d.ts +17 -0
  61. package/package.json +41 -51
  62. package/src/Image/__tests__/__snapshots__/index.test.tsx.snap +91 -91
  63. package/src/Image/__tests__/index.test.tsx +2 -2
  64. package/src/Image/index.tsx +11 -9
  65. package/src/Seo/__tests__/__snapshots__/index.test.tsx.snap +53 -53
  66. package/src/Seo/__tests__/index.test.tsx +1 -1
  67. package/src/Seo/nextUtils.ts +1 -1
  68. package/src/Seo/remixUtils.ts +1 -1
  69. package/src/Seo/renderMetaTags.tsx +1 -1
  70. package/src/Seo/renderMetaTagsToString.tsx +1 -1
  71. package/src/StructuredText/__tests__/__snapshots__/index.test.tsx.snap +58 -58
  72. package/src/StructuredText/__tests__/index.test.tsx +5 -5
  73. package/src/StructuredText/index.tsx +10 -10
  74. package/src/VideoPlayer/index.tsx +107 -0
  75. package/src/{setupTests.ts → __tests__/setup.ts} +4 -1
  76. package/src/index.ts +4 -1
  77. package/src/useQuerySubscription/index.ts +6 -6
  78. package/src/useVideoPlayer/__tests__/index.test.tsx +98 -0
  79. package/src/useVideoPlayer/index.ts +68 -0
  80. package/dist/cjs/Image/__tests__/index.test.js +0 -99
  81. package/dist/cjs/Image/__tests__/index.test.js.map +0 -1
  82. package/dist/cjs/Seo/__tests__/index.test.js +0 -330
  83. package/dist/cjs/Seo/__tests__/index.test.js.map +0 -1
  84. package/dist/cjs/StructuredText/__tests__/index.test.js +0 -243
  85. package/dist/cjs/StructuredText/__tests__/index.test.js.map +0 -1
  86. package/dist/cjs/setupTests.js +0 -11
  87. package/dist/cjs/setupTests.js.map +0 -1
  88. package/dist/esm/Image/__tests__/index.test.d.ts +0 -1
  89. package/dist/esm/Image/__tests__/index.test.js +0 -74
  90. package/dist/esm/Image/__tests__/index.test.js.map +0 -1
  91. package/dist/esm/Image/index.d.ts +0 -93
  92. package/dist/esm/Image/useInView.d.ts +0 -1
  93. package/dist/esm/Seo/__tests__/index.test.d.ts +0 -1
  94. package/dist/esm/Seo/__tests__/index.test.js +0 -305
  95. package/dist/esm/Seo/__tests__/index.test.js.map +0 -1
  96. package/dist/esm/Seo/index.d.ts +0 -5
  97. package/dist/esm/Seo/nextUtils.d.ts +0 -48
  98. package/dist/esm/Seo/remixUtils.d.ts +0 -6
  99. package/dist/esm/Seo/renderMetaTags.d.ts +0 -3
  100. package/dist/esm/Seo/renderMetaTagsToString.d.ts +0 -2
  101. package/dist/esm/Seo/types.d.ts +0 -55
  102. package/dist/esm/StructuredText/__tests__/index.test.d.ts +0 -1
  103. package/dist/esm/StructuredText/__tests__/index.test.js +0 -218
  104. package/dist/esm/StructuredText/__tests__/index.test.js.map +0 -1
  105. package/dist/esm/StructuredText/index.d.ts +0 -52
  106. package/dist/esm/index.d.ts +0 -5
  107. package/dist/esm/setupTests.d.ts +0 -1
  108. package/dist/esm/setupTests.js +0 -6
  109. package/dist/esm/setupTests.js.map +0 -1
  110. package/dist/esm/useQuerySubscription/index.d.ts +0 -20
  111. package/dist/esm/useSiteSearch/index.d.ts +0 -83
  112. package/dist/types/Image/__tests__/index.test.d.ts +0 -1
  113. package/dist/types/Seo/__tests__/index.test.d.ts +0 -1
  114. package/dist/types/StructuredText/__tests__/index.test.d.ts +0 -1
  115. package/dist/types/setupTests.d.ts +0 -1
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
1
  import { mount } from 'enzyme';
3
2
  import 'intersection-observer';
4
- import { Image } from '../index.js';
3
+ import * as React from 'react';
5
4
  import { mockAllIsIntersecting } from 'react-intersection-observer/test-utils';
5
+ import { Image } from '../index.js';
6
6
 
7
7
  const data = {
8
8
  alt: 'DatoCMS swag',
@@ -1,22 +1,22 @@
1
1
  'use client';
2
2
 
3
3
  import React, {
4
- useState,
4
+ CSSProperties,
5
5
  forwardRef,
6
6
  useCallback,
7
- CSSProperties,
8
- useRef,
9
7
  useEffect,
8
+ useRef,
9
+ useState,
10
10
  version,
11
11
  } from 'react';
12
- import { useInView } from './useInView.js';
13
12
  import { encode } from 'universal-base64';
13
+ import { useInView } from './useInView.js';
14
14
 
15
15
  const isSsr = typeof window === 'undefined';
16
16
 
17
17
  const isIntersectionObserverAvailable = isSsr
18
18
  ? false
19
- : !!(window as any).IntersectionObserver;
19
+ : !!window.IntersectionObserver;
20
20
 
21
21
  function fetchPriorityProp(
22
22
  fetchPriority?: string,
@@ -375,10 +375,10 @@ export const Image = forwardRef<HTMLDivElement, ImagePropTypes>(
375
375
  ...(layout === 'fill'
376
376
  ? absolutePositioning
377
377
  : layout === 'intrinsic'
378
- ? { position: 'relative', width: '100%', maxWidth: width }
379
- : layout === 'fixed'
380
- ? { position: 'relative', width }
381
- : { position: 'relative', width: '100%' }),
378
+ ? { position: 'relative', width: '100%', maxWidth: width }
379
+ : layout === 'fixed'
380
+ ? { position: 'relative', width }
381
+ : { position: 'relative', width: '100%' }),
382
382
  ...style,
383
383
  }}
384
384
  >
@@ -389,6 +389,7 @@ export const Image = forwardRef<HTMLDivElement, ImagePropTypes>(
389
389
  {webpSource}
390
390
  {regularSource}
391
391
  {data.src && (
392
+ // biome-ignore lint/a11y/useAltText: We do support the `alt` attribute
392
393
  <img
393
394
  ref={imageRef}
394
395
  src={data.src}
@@ -414,6 +415,7 @@ export const Image = forwardRef<HTMLDivElement, ImagePropTypes>(
414
415
  {webpSource}
415
416
  {regularSource}
416
417
  {data.src && (
418
+ // biome-ignore lint/a11y/useAltText: We do support the `alt` attribute
417
419
  <img
418
420
  src={data.src}
419
421
  alt={data.alt ?? ''}
@@ -189,102 +189,102 @@ exports[`renderMetaTags generates an array of meta tags 1`] = `
189
189
 
190
190
  exports[`renderMetaTagsToString generates an array of meta tags 1`] = `
191
191
  "<title>Remix CMS - The easiest way to manage content with Remix</title>
192
- <meta property=\\"og:title\\" content=\\"Remix CMS - The easiest way to manage content with Remix\\" />
193
- <meta name=\\"twitter:title\\" content=\\"Remix CMS - The easiest way to manage content with Remix\\" />
194
- <meta name=\\"description\\" 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.\\" />
195
- <meta property=\\"og:description\\" 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.\\" />
196
- <meta name=\\"twitter:description\\" 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.\\" />
197
- <meta property=\\"og:image\\" content=\\"https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000\\" />
198
- <meta property=\\"og:image:width\\" content=\\"746\\" />
199
- <meta property=\\"og:image:height\\" content=\\"186\\" />
200
- <meta name=\\"twitter:image\\" content=\\"https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000\\" />
201
- <meta property=\\"og:locale\\" content=\\"en\\" />
202
- <meta property=\\"og:type\\" content=\\"article\\" />
203
- <meta property=\\"og:site_name\\" content=\\"DatoCMS\\" />
204
- <meta property=\\"article:modified_time\\" content=\\"2022-01-18T14:02:47Z\\" />
205
- <meta name=\\"twitter:card\\" content=\\"summary_large_image\\" />
206
- <meta name=\\"twitter:site\\" content=\\"@datocms\\" />
207
- <link sizes=\\"16x16\\" type=\\"image/png\\" rel=\\"icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=16&w=16\\" />
208
- <link sizes=\\"32x32\\" type=\\"image/png\\" rel=\\"icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=32&w=32\\" />
209
- <link sizes=\\"96x96\\" type=\\"image/png\\" rel=\\"icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=96&w=96\\" />
210
- <link sizes=\\"192x192\\" type=\\"image/png\\" rel=\\"icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=192&w=192\\" />
211
- <link sizes=\\"57x57\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=57&w=57\\" />
212
- <link sizes=\\"60x60\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=60&w=60\\" />
213
- <link sizes=\\"72x72\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=72&w=72\\" />
214
- <link sizes=\\"76x76\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=76&w=76\\" />
215
- <link sizes=\\"114x114\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=114&w=114\\" />
216
- <link sizes=\\"120x120\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=120&w=120\\" />
217
- <link sizes=\\"144x144\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=144&w=144\\" />
218
- <link sizes=\\"152x152\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=152&w=152\\" />
219
- <link sizes=\\"180x180\\" rel=\\"apple-touch-icon\\" href=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=180&w=180\\" />
220
- <meta name=\\"msapplication-square70x70logo\\" content=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=70&w=70\\" />
221
- <meta name=\\"msapplication-square150x150logo\\" content=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=150\\" />
222
- <meta name=\\"msapplication-square310x310logo\\" content=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=310&w=310\\" />
223
- <meta name=\\"msapplication-square310x150logo\\" content=\\"https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=310\\" />"
192
+ <meta property="og:title" content="Remix CMS - The easiest way to manage content with Remix" />
193
+ <meta name="twitter:title" content="Remix CMS - The easiest way to manage content with Remix" />
194
+ <meta name="description" 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." />
195
+ <meta property="og:description" 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." />
196
+ <meta name="twitter:description" 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." />
197
+ <meta property="og:image" content="https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000" />
198
+ <meta property="og:image:width" content="746" />
199
+ <meta property="og:image:height" content="186" />
200
+ <meta name="twitter:image" content="https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000" />
201
+ <meta property="og:locale" content="en" />
202
+ <meta property="og:type" content="article" />
203
+ <meta property="og:site_name" content="DatoCMS" />
204
+ <meta property="article:modified_time" content="2022-01-18T14:02:47Z" />
205
+ <meta name="twitter:card" content="summary_large_image" />
206
+ <meta name="twitter:site" content="@datocms" />
207
+ <link sizes="16x16" type="image/png" rel="icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=16&w=16" />
208
+ <link sizes="32x32" type="image/png" rel="icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=32&w=32" />
209
+ <link sizes="96x96" type="image/png" rel="icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=96&w=96" />
210
+ <link sizes="192x192" type="image/png" rel="icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=192&w=192" />
211
+ <link sizes="57x57" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=57&w=57" />
212
+ <link sizes="60x60" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=60&w=60" />
213
+ <link sizes="72x72" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=72&w=72" />
214
+ <link sizes="76x76" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=76&w=76" />
215
+ <link sizes="114x114" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=114&w=114" />
216
+ <link sizes="120x120" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=120&w=120" />
217
+ <link sizes="144x144" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=144&w=144" />
218
+ <link sizes="152x152" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=152&w=152" />
219
+ <link sizes="180x180" rel="apple-touch-icon" href="https://www.datocms-assets.com/205/1525789775-dato.png?h=180&w=180" />
220
+ <meta name="msapplication-square70x70logo" content="https://www.datocms-assets.com/205/1525789775-dato.png?h=70&w=70" />
221
+ <meta name="msapplication-square150x150logo" content="https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=150" />
222
+ <meta name="msapplication-square310x310logo" content="https://www.datocms-assets.com/205/1525789775-dato.png?h=310&w=310" />
223
+ <meta name="msapplication-square310x150logo" content="https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=310" />"
224
224
  `;
225
225
 
226
226
  exports[`toNextMetadata generates a Next Metadata object 1`] = `
227
- Object {
227
+ {
228
228
  "description": "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.",
229
- "icons": Object {
230
- "apple": Array [
231
- Object {
229
+ "icons": {
230
+ "apple": [
231
+ {
232
232
  "sizes": "57x57",
233
233
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=57&w=57",
234
234
  },
235
- Object {
235
+ {
236
236
  "sizes": "60x60",
237
237
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=60&w=60",
238
238
  },
239
- Object {
239
+ {
240
240
  "sizes": "72x72",
241
241
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=72&w=72",
242
242
  },
243
- Object {
243
+ {
244
244
  "sizes": "76x76",
245
245
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=76&w=76",
246
246
  },
247
- Object {
247
+ {
248
248
  "sizes": "114x114",
249
249
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=114&w=114",
250
250
  },
251
- Object {
251
+ {
252
252
  "sizes": "120x120",
253
253
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=120&w=120",
254
254
  },
255
- Object {
255
+ {
256
256
  "sizes": "144x144",
257
257
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=144&w=144",
258
258
  },
259
- Object {
259
+ {
260
260
  "sizes": "152x152",
261
261
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=152&w=152",
262
262
  },
263
- Object {
263
+ {
264
264
  "sizes": "180x180",
265
265
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=180&w=180",
266
266
  },
267
267
  ],
268
- "icon": Array [
269
- Object {
268
+ "icon": [
269
+ {
270
270
  "rel": "icon",
271
271
  "sizes": "16x16",
272
272
  "type": "image/png",
273
273
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=16&w=16",
274
274
  },
275
- Object {
275
+ {
276
276
  "rel": "icon",
277
277
  "sizes": "32x32",
278
278
  "type": "image/png",
279
279
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=32&w=32",
280
280
  },
281
- Object {
281
+ {
282
282
  "rel": "icon",
283
283
  "sizes": "96x96",
284
284
  "type": "image/png",
285
285
  "url": "https://www.datocms-assets.com/205/1525789775-dato.png?h=96&w=96",
286
286
  },
287
- Object {
287
+ {
288
288
  "rel": "icon",
289
289
  "sizes": "192x192",
290
290
  "type": "image/png",
@@ -292,9 +292,9 @@ Object {
292
292
  },
293
293
  ],
294
294
  },
295
- "openGraph": Object {
295
+ "openGraph": {
296
296
  "description": "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.",
297
- "images": Object {
297
+ "images": {
298
298
  "height": "186",
299
299
  "url": "https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000",
300
300
  "width": "746",
@@ -305,7 +305,7 @@ Object {
305
305
  "type": "article",
306
306
  },
307
307
  "title": "Remix CMS - The easiest way to manage content with Remix",
308
- "twitter": Object {
308
+ "twitter": {
309
309
  "card": "summary_large_image",
310
310
  "description": "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.",
311
311
  "image": "https://www.datocms-assets.com/205/1642515293-full-logo.svg?fit=max&fm=jpg&w=1000",
@@ -316,7 +316,7 @@ Object {
316
316
  `;
317
317
 
318
318
  exports[`toRemixMeta generates a meta descriptor 1`] = `
319
- Object {
319
+ {
320
320
  "article:modified_time": "2022-01-18T14:02:47Z",
321
321
  "description": "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.",
322
322
  "msapplication-square150x150logo": "https://www.datocms-assets.com/205/1525789775-dato.png?h=150&w=150",
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import { shallow } from 'enzyme';
2
+ import * as React from 'react';
3
3
  import {
4
4
  renderMetaTags,
5
5
  renderMetaTagsToString,
@@ -1,6 +1,6 @@
1
1
  import {
2
- type TitleMetaLinkTag,
3
2
  type SeoOrFaviconTag,
3
+ type TitleMetaLinkTag,
4
4
  isAppleTouchIconAttributes,
5
5
  isFaviconAttributes,
6
6
  isOgMetaAttributes,
@@ -1,4 +1,4 @@
1
- import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js';
1
+ import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
2
2
 
3
3
  interface RemixHtmlMetaDescriptor {
4
4
  [name: string]: string | string[];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js';
2
+ import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
3
3
 
4
4
  export function renderMetaTags(
5
5
  data: TitleMetaLinkTag[] | SeoOrFaviconTag[],
@@ -1,4 +1,4 @@
1
- import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js';
1
+ import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
2
2
 
3
3
  export function renderMetaTagsToString(
4
4
  data: TitleMetaLinkTag[] | SeoOrFaviconTag[],
@@ -3,26 +3,26 @@
3
3
  exports[`StructuredText simple dast /2 with custom mark rules renders the document 1`] = `
4
4
  <StructuredText
5
5
  customMarkRules={
6
- Array [
7
- Object {
6
+ [
7
+ {
8
8
  "appliable": [Function],
9
9
  "apply": [Function],
10
10
  },
11
11
  ]
12
12
  }
13
13
  data={
14
- Object {
15
- "document": Object {
16
- "children": Array [
17
- Object {
18
- "children": Array [
19
- Object {
14
+ {
15
+ "document": {
16
+ "children": [
17
+ {
18
+ "children": [
19
+ {
20
20
  "type": "span",
21
21
  "value": "This
22
22
  is a ",
23
23
  },
24
- Object {
25
- "marks": Array [
24
+ {
25
+ "marks": [
26
26
  "strong",
27
27
  ],
28
28
  "type": "span",
@@ -59,18 +59,18 @@ is a ",
59
59
  exports[`StructuredText simple dast /2 with default rules renders the document 1`] = `
60
60
  <StructuredText
61
61
  data={
62
- Object {
63
- "document": Object {
64
- "children": Array [
65
- Object {
66
- "children": Array [
67
- Object {
62
+ {
63
+ "document": {
64
+ "children": [
65
+ {
66
+ "children": [
67
+ {
68
68
  "type": "span",
69
69
  "value": "This
70
70
  is a ",
71
71
  },
72
- Object {
73
- "marks": Array [
72
+ {
73
+ "marks": [
74
74
  "strong",
75
75
  ],
76
76
  "type": "span",
@@ -107,27 +107,27 @@ is a ",
107
107
  exports[`StructuredText simple dast with no links/blocks with custom rules renders the document 1`] = `
108
108
  <StructuredText
109
109
  customNodeRules={
110
- Array [
111
- Object {
110
+ [
111
+ {
112
112
  "appliable": [Function],
113
113
  "apply": [Function],
114
114
  },
115
115
  ]
116
116
  }
117
117
  data={
118
- Object {
119
- "value": Object {
120
- "document": Object {
121
- "children": Array [
122
- Object {
123
- "children": Array [
124
- Object {
118
+ {
119
+ "value": {
120
+ "document": {
121
+ "children": [
122
+ {
123
+ "children": [
124
+ {
125
125
  "type": "span",
126
126
  "value": "This
127
127
  is a ",
128
128
  },
129
- Object {
130
- "marks": Array [
129
+ {
130
+ "marks": [
131
131
  "strong",
132
132
  ],
133
133
  "type": "span",
@@ -166,19 +166,19 @@ is a ",
166
166
  exports[`StructuredText simple dast with no links/blocks with default rules renders the document 1`] = `
167
167
  <StructuredText
168
168
  data={
169
- Object {
170
- "value": Object {
171
- "document": Object {
172
- "children": Array [
173
- Object {
174
- "children": Array [
175
- Object {
169
+ {
170
+ "value": {
171
+ "document": {
172
+ "children": [
173
+ {
174
+ "children": [
175
+ {
176
176
  "type": "span",
177
177
  "value": "This
178
178
  is a ",
179
179
  },
180
- Object {
181
- "marks": Array [
180
+ {
181
+ "marks": [
182
182
  "strong",
183
183
  ],
184
184
  "type": "span",
@@ -216,53 +216,53 @@ is a ",
216
216
  exports[`StructuredText with links/blocks with default rules renders the document 1`] = `
217
217
  <StructuredText
218
218
  data={
219
- Object {
220
- "blocks": Array [
221
- Object {
219
+ {
220
+ "blocks": [
221
+ {
222
222
  "__typename": "QuoteRecord",
223
223
  "author": "Mark Smith",
224
224
  "id": "456",
225
225
  "quote": "Foo bar.",
226
226
  },
227
227
  ],
228
- "links": Array [
229
- Object {
228
+ "links": [
229
+ {
230
230
  "__typename": "DocPageRecord",
231
231
  "id": "123",
232
232
  "slug": "how-to-code",
233
233
  "title": "How to code",
234
234
  },
235
235
  ],
236
- "value": Object {
237
- "document": Object {
238
- "children": Array [
239
- Object {
240
- "children": Array [
241
- Object {
236
+ "value": {
237
+ "document": {
238
+ "children": [
239
+ {
240
+ "children": [
241
+ {
242
242
  "type": "span",
243
243
  "value": "This is a",
244
244
  },
245
- Object {
246
- "marks": Array [
245
+ {
246
+ "marks": [
247
247
  "highlight",
248
248
  ],
249
249
  "type": "span",
250
250
  "value": "title",
251
251
  },
252
- Object {
252
+ {
253
253
  "item": "123",
254
254
  "type": "inlineItem",
255
255
  },
256
- Object {
257
- "children": Array [
258
- Object {
256
+ {
257
+ "children": [
258
+ {
259
259
  "type": "span",
260
260
  "value": "here!",
261
261
  },
262
262
  ],
263
263
  "item": "123",
264
- "meta": Array [
265
- Object {
264
+ "meta": [
265
+ {
266
266
  "id": "target",
267
267
  "value": "_blank",
268
268
  },
@@ -273,7 +273,7 @@ exports[`StructuredText with links/blocks with default rules renders the documen
273
273
  "level": 1,
274
274
  "type": "heading",
275
275
  },
276
- Object {
276
+ {
277
277
  "item": "456",
278
278
  "type": "block",
279
279
  },
@@ -1,14 +1,14 @@
1
- import { mount, shallow, render } from 'enzyme';
1
+ import { renderMarkRule } from 'datocms-structured-text-generic-html-renderer';
2
+ import { isHeading } from 'datocms-structured-text-utils';
3
+ import { mount, render, shallow } from 'enzyme';
2
4
  import * as React from 'react';
3
5
  import {
6
+ RenderError,
4
7
  StructuredText,
5
- StructuredTextGraphQlResponse,
6
8
  StructuredTextDocument,
7
- RenderError,
9
+ StructuredTextGraphQlResponse,
8
10
  renderNodeRule,
9
11
  } from '../index.js';
10
- import { isHeading } from 'datocms-structured-text-utils';
11
- import { renderMarkRule } from 'datocms-structured-text-generic-html-renderer';
12
12
 
13
13
  describe('StructuredText', () => {
14
14
  describe('with no value', () => {
@@ -1,26 +1,26 @@
1
1
  import {
2
+ RenderMarkRule,
3
+ TransformMetaFn,
4
+ TransformedMeta,
2
5
  defaultMetaTransformer,
3
6
  render,
4
- renderNodeRule,
5
7
  renderMarkRule,
6
- TransformedMeta,
7
- TransformMetaFn,
8
- RenderMarkRule,
8
+ renderNodeRule,
9
9
  } from 'datocms-structured-text-generic-html-renderer';
10
10
  import {
11
- isBlock,
12
- isInlineItem,
13
- isItemLink,
14
- Record as StructuredTextGraphQlResponseRecord,
15
11
  Document as StructuredTextDocument,
12
+ Node,
13
+ Record as StructuredTextGraphQlResponseRecord,
16
14
  RenderError,
17
15
  RenderResult,
18
16
  RenderRule,
19
- Node,
20
17
  StructuredText as StructuredTextGraphQlResponse,
18
+ isBlock,
19
+ isInlineItem,
20
+ isItemLink,
21
21
  isStructuredText,
22
22
  } from 'datocms-structured-text-utils';
23
- import React, { cloneElement, isValidElement, ReactElement } from 'react';
23
+ import React, { ReactElement, cloneElement, isValidElement } from 'react';
24
24
 
25
25
  export { renderNodeRule, renderMarkRule, RenderError };
26
26