react-datocms 4.1.2 → 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 (123) 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 +6 -6
  7. package/dist/cjs/Seo/index.js.map +1 -1
  8. package/dist/cjs/Seo/nextUtils.js +34 -55
  9. package/dist/cjs/Seo/nextUtils.js.map +1 -1
  10. package/dist/cjs/Seo/remixUtils.js +6 -18
  11. package/dist/cjs/Seo/remixUtils.js.map +1 -1
  12. package/dist/cjs/Seo/renderMetaTags.js +6 -18
  13. package/dist/cjs/Seo/renderMetaTags.js.map +1 -1
  14. package/dist/cjs/Seo/renderMetaTagsToString.js +7 -7
  15. package/dist/cjs/Seo/renderMetaTagsToString.js.map +1 -1
  16. package/dist/cjs/Seo/types.js +31 -51
  17. package/dist/cjs/Seo/types.js.map +1 -1
  18. package/dist/cjs/StructuredText/index.js +40 -52
  19. package/dist/cjs/StructuredText/index.js.map +1 -1
  20. package/dist/cjs/VideoPlayer/index.js +67 -0
  21. package/dist/cjs/VideoPlayer/index.js.map +1 -0
  22. package/dist/cjs/index.js +8 -6
  23. package/dist/cjs/index.js.map +1 -1
  24. package/dist/cjs/useQuerySubscription/index.js +25 -70
  25. package/dist/cjs/useQuerySubscription/index.js.map +1 -1
  26. package/dist/cjs/useSiteSearch/index.js +71 -123
  27. package/dist/cjs/useSiteSearch/index.js.map +1 -1
  28. package/dist/cjs/useVideoPlayer/index.js +31 -0
  29. package/dist/cjs/useVideoPlayer/index.js.map +1 -0
  30. package/dist/esm/Image/index.js +62 -68
  31. package/dist/esm/Image/index.js.map +1 -1
  32. package/dist/esm/Image/useInView.js.map +1 -1
  33. package/dist/esm/Seo/index.js +5 -5
  34. package/dist/esm/Seo/index.js.map +1 -1
  35. package/dist/esm/Seo/nextUtils.js +27 -48
  36. package/dist/esm/Seo/nextUtils.js.map +1 -1
  37. package/dist/esm/Seo/remixUtils.js +5 -17
  38. package/dist/esm/Seo/remixUtils.js.map +1 -1
  39. package/dist/esm/Seo/renderMetaTags.js +4 -16
  40. package/dist/esm/Seo/renderMetaTags.js.map +1 -1
  41. package/dist/esm/Seo/renderMetaTagsToString.js +6 -6
  42. package/dist/esm/Seo/renderMetaTagsToString.js.map +1 -1
  43. package/dist/esm/Seo/types.js +30 -50
  44. package/dist/esm/Seo/types.js.map +1 -1
  45. package/dist/esm/StructuredText/index.js +33 -45
  46. package/dist/esm/StructuredText/index.js.map +1 -1
  47. package/dist/esm/VideoPlayer/index.js +38 -0
  48. package/dist/esm/VideoPlayer/index.js.map +1 -0
  49. package/dist/esm/index.js +7 -5
  50. package/dist/esm/index.js.map +1 -1
  51. package/dist/esm/useQuerySubscription/index.js +22 -67
  52. package/dist/esm/useQuerySubscription/index.js.map +1 -1
  53. package/dist/esm/useSiteSearch/index.js +65 -117
  54. package/dist/esm/useSiteSearch/index.js.map +1 -1
  55. package/dist/esm/useVideoPlayer/index.js +27 -0
  56. package/dist/esm/useVideoPlayer/index.js.map +1 -0
  57. package/dist/types/Seo/index.d.ts +5 -5
  58. package/dist/types/Seo/nextUtils.d.ts +1 -1
  59. package/dist/types/Seo/remixUtils.d.ts +1 -1
  60. package/dist/types/Seo/renderMetaTags.d.ts +1 -1
  61. package/dist/types/Seo/renderMetaTagsToString.d.ts +1 -1
  62. package/dist/types/StructuredText/index.d.ts +2 -2
  63. package/dist/types/VideoPlayer/index.d.ts +26 -0
  64. package/dist/types/index.d.ts +7 -5
  65. package/dist/types/useVideoPlayer/index.d.ts +17 -0
  66. package/package.json +41 -43
  67. package/src/Image/__tests__/__snapshots__/index.test.tsx.snap +91 -91
  68. package/src/Image/__tests__/index.test.tsx +2 -2
  69. package/src/Image/index.tsx +7 -5
  70. package/src/Seo/__tests__/__snapshots__/index.test.tsx.snap +53 -53
  71. package/src/Seo/__tests__/index.test.tsx +3 -3
  72. package/src/Seo/index.ts +5 -5
  73. package/src/Seo/nextUtils.ts +2 -2
  74. package/src/Seo/remixUtils.ts +1 -1
  75. package/src/Seo/renderMetaTags.tsx +1 -1
  76. package/src/Seo/renderMetaTagsToString.tsx +1 -1
  77. package/src/StructuredText/__tests__/__snapshots__/index.test.tsx.snap +58 -58
  78. package/src/StructuredText/__tests__/index.test.tsx +6 -6
  79. package/src/StructuredText/index.tsx +10 -10
  80. package/src/VideoPlayer/index.tsx +107 -0
  81. package/src/{setupTests.ts → __tests__/setup.ts} +4 -1
  82. package/src/index.ts +8 -5
  83. package/src/useQuerySubscription/index.ts +6 -6
  84. package/src/useVideoPlayer/__tests__/index.test.tsx +98 -0
  85. package/src/useVideoPlayer/index.ts +68 -0
  86. package/dist/cjs/Image/__tests__/index.test.js +0 -99
  87. package/dist/cjs/Image/__tests__/index.test.js.map +0 -1
  88. package/dist/cjs/Seo/__tests__/index.test.js +0 -330
  89. package/dist/cjs/Seo/__tests__/index.test.js.map +0 -1
  90. package/dist/cjs/StructuredText/__tests__/index.test.js +0 -243
  91. package/dist/cjs/StructuredText/__tests__/index.test.js.map +0 -1
  92. package/dist/cjs/setupTests.js +0 -11
  93. package/dist/cjs/setupTests.js.map +0 -1
  94. package/dist/esm/Image/__tests__/index.test.d.ts +0 -1
  95. package/dist/esm/Image/__tests__/index.test.js +0 -74
  96. package/dist/esm/Image/__tests__/index.test.js.map +0 -1
  97. package/dist/esm/Image/index.d.ts +0 -93
  98. package/dist/esm/Image/useInView.d.ts +0 -1
  99. package/dist/esm/Seo/__tests__/index.test.d.ts +0 -1
  100. package/dist/esm/Seo/__tests__/index.test.js +0 -305
  101. package/dist/esm/Seo/__tests__/index.test.js.map +0 -1
  102. package/dist/esm/Seo/index.d.ts +0 -5
  103. package/dist/esm/Seo/nextUtils.d.ts +0 -48
  104. package/dist/esm/Seo/remixUtils.d.ts +0 -6
  105. package/dist/esm/Seo/renderMetaTags.d.ts +0 -3
  106. package/dist/esm/Seo/renderMetaTagsToString.d.ts +0 -2
  107. package/dist/esm/Seo/types.d.ts +0 -55
  108. package/dist/esm/StructuredText/__tests__/index.test.d.ts +0 -1
  109. package/dist/esm/StructuredText/__tests__/index.test.js +0 -218
  110. package/dist/esm/StructuredText/__tests__/index.test.js.map +0 -1
  111. package/dist/esm/StructuredText/index.d.ts +0 -52
  112. package/dist/esm/index.d.ts +0 -5
  113. package/dist/esm/setupTests.d.ts +0 -1
  114. package/dist/esm/setupTests.js +0 -6
  115. package/dist/esm/setupTests.js.map +0 -1
  116. package/dist/esm/useQuerySubscription/index.d.ts +0 -20
  117. package/dist/esm/useSiteSearch/index.d.ts +0 -83
  118. package/dist/types/Image/__tests__/index.test.d.ts +0 -1
  119. package/dist/types/Seo/__tests__/index.test.d.ts +0 -1
  120. package/dist/types/StructuredText/__tests__/index.test.d.ts +0 -1
  121. package/dist/types/setupTests.d.ts +0 -1
  122. /package/src/Image/{useInView.tsx → useInView.ts} +0 -0
  123. /package/src/Seo/{types.tsx → types.ts} +0 -0
@@ -1,74 +0,0 @@
1
- import * as React from 'react';
2
- import { mount } from 'enzyme';
3
- import 'intersection-observer';
4
- import { Image } from '../index';
5
- import { mockAllIsIntersecting } from 'react-intersection-observer/test-utils';
6
- var data = {
7
- alt: 'DatoCMS swag',
8
- aspectRatio: 1.7777777777777777,
9
- base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
10
- height: 421,
11
- sizes: '(max-width: 750px) 100vw, 750px',
12
- src: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&fit=crop&w=750',
13
- 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',
14
- title: 'These are awesome, we know that.',
15
- width: 750
16
- };
17
- var minimalData = {
18
- base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
19
- height: 421,
20
- src: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&fit=crop&w=750',
21
- width: 750
22
- };
23
- var minimalDataWithRelativeUrl = {
24
- base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
25
- height: 421,
26
- src: '/205/image.png?ar=16%3A9&fit=crop&w=750',
27
- width: 750
28
- };
29
- describe('Image', function () {
30
- // intersectionThreshold is an hack to make tests work
31
- // we need the library to generate a different IntersectionObserver for each test
32
- // otherwise the IntersectionObserver mocking won't work
33
- ['intrinsic', 'fixed', 'responsive', 'fill'].forEach(function (layout) {
34
- describe("layout=".concat(layout), function () {
35
- describe('not visible', function () {
36
- it('renders the blur-up thumb', function () {
37
- var wrapper = mount(React.createElement(Image, { data: data, layout: layout, intersectionThreshold: 0.1 }));
38
- expect(wrapper).toMatchSnapshot();
39
- });
40
- });
41
- describe('visible', function () {
42
- it('renders the image', function () {
43
- var wrapper = mount(React.createElement(Image, { data: data, layout: layout, intersectionThreshold: 0.2 }));
44
- mockAllIsIntersecting(true);
45
- wrapper.update();
46
- expect(wrapper).toMatchSnapshot();
47
- });
48
- it('renders the image (minimal data)', function () {
49
- var wrapper = mount(React.createElement(Image, { data: minimalData, layout: layout, intersectionThreshold: 0.2 }));
50
- mockAllIsIntersecting(true);
51
- wrapper.update();
52
- expect(wrapper).toMatchSnapshot();
53
- });
54
- it('renders the image (relative URL)', function () {
55
- var wrapper = mount(React.createElement(Image, { data: minimalDataWithRelativeUrl, layout: layout, intersectionThreshold: 0.2 }));
56
- mockAllIsIntersecting(true);
57
- wrapper.update();
58
- expect(wrapper).toMatchSnapshot();
59
- });
60
- describe('image loaded', function () {
61
- it('shows the image', function () {
62
- var wrapper = mount(React.createElement(Image, { data: data, layout: layout, intersectionThreshold: 0.3 }));
63
- mockAllIsIntersecting(true);
64
- wrapper.update();
65
- wrapper.find('img').last().simulate('load');
66
- wrapper.update();
67
- expect(wrapper).toMatchSnapshot();
68
- });
69
- });
70
- });
71
- });
72
- });
73
- });
74
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
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,uBAAuB,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;I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,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,93 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- type Maybe<T> = T | null;
3
- export type ResponsiveImageType = {
4
- /** A base64-encoded thumbnail to offer during image loading */
5
- base64?: Maybe<string>;
6
- /** The height of the image */
7
- height?: Maybe<number>;
8
- /** The width of the image */
9
- width: number;
10
- /** The aspect ratio (width/height) of the image */
11
- aspectRatio?: number;
12
- /** The HTML5 `sizes` attribute for the image */
13
- sizes?: Maybe<string>;
14
- /** The fallback `src` attribute for the image */
15
- src?: Maybe<string>;
16
- /** The HTML5 `srcSet` attribute for the image */
17
- srcSet?: Maybe<string>;
18
- /** The HTML5 `srcSet` attribute for the image in WebP format, for browsers that support the format */
19
- webpSrcSet?: Maybe<string>;
20
- /** The background color for the image placeholder */
21
- bgColor?: Maybe<string>;
22
- /** Alternate text (`alt`) for the image */
23
- alt?: Maybe<string>;
24
- /** Title attribute (`title`) for the image */
25
- title?: Maybe<string>;
26
- };
27
- export type ImagePropTypes = {
28
- /** The actual response you get from a DatoCMS `responsiveImage` GraphQL query */
29
- data: ResponsiveImageType;
30
- /** Additional CSS className for root node */
31
- className?: string;
32
- /** Additional CSS class for the image inside the `<picture />` tag */
33
- pictureClassName?: string;
34
- /** Additional CSS class for the placeholder image */
35
- placeholderClassName?: string;
36
- /** Duration (in ms) of the fade-in transition effect upoad image loading */
37
- fadeInDuration?: number;
38
- /** @deprecated Use the intersectionThreshold prop */
39
- intersectionTreshold?: number;
40
- /** Indicate at what percentage of the placeholder visibility the loading of the image should be triggered. A value of 0 means that as soon as even one pixel is visible, the callback will be run. A value of 1.0 means that the threshold isn't considered passed until every pixel is visible */
41
- intersectionThreshold?: number;
42
- /** 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 */
43
- intersectionMargin?: string;
44
- /** Whether enable lazy loading or not */
45
- lazyLoad?: boolean;
46
- /** Additional CSS rules to add to the root node */
47
- style?: React.CSSProperties;
48
- /** Additional CSS rules to add to the image inside the `<picture />` tag */
49
- pictureStyle?: React.CSSProperties;
50
- /** Additional CSS rules to add to the placeholder image */
51
- placeholderStyle?: React.CSSProperties;
52
- /**
53
- * The layout behavior of the image as the viewport changes size
54
- *
55
- * Possible values:
56
- *
57
- * * `intrinsic` (default): the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports
58
- * * `fixed`: the image dimensions will not change as the viewport changes (no responsiveness) similar to the native img element
59
- * * `responsive`: the image will scale the dimensions down for smaller viewports and scale up for larger viewports
60
- * * `fill`: image will stretch both width and height to the dimensions of the parent element, provided the parent element is `relative`
61
- **/
62
- layout?: 'intrinsic' | 'fixed' | 'responsive' | 'fill';
63
- /** Defines how the image will fit into its parent container when using layout="fill" */
64
- objectFit?: CSSProperties['objectFit'];
65
- /** Defines how the image is positioned within its parent element when using layout="fill". */
66
- objectPosition?: CSSProperties['objectPosition'];
67
- /** Triggered when the image finishes loading */
68
- onLoad?(): void;
69
- /** Whether the component should use a blurred image placeholder */
70
- usePlaceholder?: boolean;
71
- /**
72
- * The HTML5 `sizes` attribute for the image
73
- *
74
- * Learn more about srcset and sizes:
75
- * -> https://web.dev/learn/design/responsive-images/#sizes
76
- * -> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes
77
- **/
78
- sizes?: HTMLImageElement['sizes'];
79
- /**
80
- * When true, the image will be considered high priority. Lazy loading is automatically disabled, and fetchpriority="high" is added to the image.
81
- * You should use the priority property on any image detected as the Largest Contentful Paint (LCP) element. It may be appropriate to have multiple priority images, as different images may be the LCP element for different viewport sizes.
82
- * Should only be used when the image is visible above the fold.
83
- **/
84
- priority?: boolean;
85
- /**
86
- * If `data` does not contain `srcSet`, the candidates for the `srcset` of the image will be auto-generated based on these width multipliers
87
- *
88
- * Default candidate multipliers are [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
89
- **/
90
- srcSetCandidates?: number[];
91
- };
92
- export declare const Image: React.ForwardRefExoticComponent<ImagePropTypes & React.RefAttributes<HTMLDivElement>>;
93
- export {};
@@ -1 +0,0 @@
1
- export { useInView } from 'react-intersection-observer';
@@ -1 +0,0 @@
1
- export {};
@@ -1,305 +0,0 @@
1
- import * as React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { renderMetaTags, renderMetaTagsToString, toNextMetadata, toRemixMeta, } from '..';
4
- var metaTags = [
5
- {
6
- content: 'Remix CMS - The easiest way to manage content with Remix',
7
- attributes: null,
8
- tag: 'title'
9
- },
10
- {
11
- content: null,
12
- attributes: {
13
- property: 'og:title',
14
- content: 'Remix CMS - The easiest way to manage content with Remix'
15
- },
16
- tag: 'meta'
17
- },
18
- {
19
- content: null,
20
- attributes: {
21
- name: 'twitter:title',
22
- content: 'Remix CMS - The easiest way to manage content with Remix'
23
- },
24
- tag: 'meta'
25
- },
26
- {
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.'
31
- },
32
- tag: 'meta'
33
- },
34
- {
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.'
39
- },
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'
282
- },
283
- ];
284
- describe('renderMetaTags', function () {
285
- it('generates an array of meta tags', function () {
286
- var wrapper = shallow(React.createElement("head", null, renderMetaTags(metaTags)));
287
- expect(wrapper).toMatchSnapshot();
288
- });
289
- });
290
- describe('renderMetaTagsToString', function () {
291
- it('generates an array of meta tags', function () {
292
- expect(renderMetaTagsToString(metaTags)).toMatchSnapshot();
293
- });
294
- });
295
- describe('toRemixMeta', function () {
296
- it('generates a meta descriptor', function () {
297
- expect(toRemixMeta(metaTags)).toMatchSnapshot();
298
- });
299
- });
300
- describe('toNextMetadata', function () {
301
- it('generates a Next Metadata object', function () {
302
- expect(toNextMetadata(metaTags)).toMatchSnapshot();
303
- });
304
- });
305
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","s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AgB,EAAE;IACzB,EAAE,CAAC,iCAAiC,EAAE;QACpC,IAAM,OAAO,GAAG,OAAO,CAAC,kCAAO,cAAc,CAAC,QAAQ,CAAC,CAAQ,CAAC,CAAC;QAEjE,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,wBAAwB,EAAE;IACjC,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,aAAa,EAAE;IACtB,EAAE,CAAC,6BAA6B,EAAE;QAChC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gBAAgB,EAAE;IACzB,EAAE,CAAC,kCAAkC,EAAE;QACrC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './types';
2
- export * from './remixUtils';
3
- export * from './nextUtils';
4
- export * from './renderMetaTags';
5
- export * from './renderMetaTagsToString';
@@ -1,48 +0,0 @@
1
- import { type TitleMetaLinkTag, type SeoOrFaviconTag } from './types';
2
- export type AppleIcon = {
3
- sizes: string;
4
- url: string;
5
- };
6
- export type Icon = {
7
- rel: string;
8
- sizes: string;
9
- type: string;
10
- url: string;
11
- };
12
- export type Icons = {
13
- icon?: Icon[];
14
- apple?: AppleIcon[];
15
- };
16
- export type OpenGraph = {
17
- title?: string;
18
- description?: string;
19
- locale?: string;
20
- type?: string;
21
- siteName?: string;
22
- images?: OpenGraphImage[];
23
- };
24
- export type OpenGraphImage = {
25
- url: string;
26
- type?: string;
27
- width?: string;
28
- height?: string;
29
- };
30
- export type Twitter = {
31
- description?: string;
32
- title?: string;
33
- images?: TwitterImage[];
34
- };
35
- export type TwitterImage = {
36
- url: string;
37
- type?: string;
38
- width?: string;
39
- height?: string;
40
- };
41
- export type Metadata = {
42
- title?: string;
43
- description?: string;
44
- icons?: Icons;
45
- openGraph?: OpenGraph;
46
- twitter?: Twitter;
47
- };
48
- export declare function toNextMetadata(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): Metadata;
@@ -1,6 +0,0 @@
1
- import { TitleMetaLinkTag, SeoOrFaviconTag } from './types';
2
- interface RemixHtmlMetaDescriptor {
3
- [name: string]: string | string[];
4
- }
5
- export declare function toRemixMeta(metaTags: null | TitleMetaLinkTag[] | SeoOrFaviconTag[]): RemixHtmlMetaDescriptor;
6
- export {};
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { TitleMetaLinkTag, SeoOrFaviconTag } from './types';
3
- export declare function renderMetaTags(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): JSX.Element[];
@@ -1,2 +0,0 @@
1
- import { TitleMetaLinkTag, SeoOrFaviconTag } from './types';
2
- export declare function renderMetaTagsToString(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): string;
@@ -1,55 +0,0 @@
1
- export interface TitleMetaLinkTag {
2
- /** the tag for the meta information */
3
- tag: string;
4
- /** the inner content of the meta tag */
5
- content?: string | null | undefined;
6
- /** the HTML attributes to attach to the meta tag */
7
- attributes?: Record<string, string> | null | undefined;
8
- }
9
- export interface SeoTitleTag {
10
- tag: 'title';
11
- content: string | null;
12
- attributes?: null;
13
- }
14
- export interface RegularMetaAttributes {
15
- name: string;
16
- content: string;
17
- }
18
- export interface OgMetaAttributes {
19
- property: string;
20
- content: string;
21
- }
22
- export interface SeoMetaTag {
23
- tag: 'meta';
24
- content?: null;
25
- attributes: RegularMetaAttributes | OgMetaAttributes;
26
- }
27
- export interface FaviconAttributes {
28
- sizes: string;
29
- type: string;
30
- rel: string;
31
- href: string;
32
- }
33
- export interface AppleTouchIconAttributes {
34
- sizes: string;
35
- rel: 'apple-touch-icon';
36
- href: string;
37
- }
38
- export interface SeoLinkTag {
39
- tag: 'link';
40
- content?: null;
41
- attributes: FaviconAttributes | AppleTouchIconAttributes;
42
- }
43
- export type SeoTag = SeoTitleTag | SeoMetaTag;
44
- export type FaviconTag = SeoMetaTag | SeoLinkTag;
45
- export type SeoOrFaviconTag = SeoTag | FaviconTag;
46
- export declare const isSeoTitleTag: (tag: any) => tag is SeoTitleTag;
47
- export declare const isSeoTag: (tag: any) => tag is SeoTag;
48
- export declare const isFaviconAttributes: (tag: any) => tag is FaviconAttributes;
49
- export declare const isAppleTouchIconAttributes: (tag: any) => tag is AppleTouchIconAttributes;
50
- export declare const isSeoLinkTag: (tag: any) => tag is SeoLinkTag;
51
- export declare const isFaviconTag: (tag: any) => tag is FaviconTag;
52
- export declare const isSeoOrFaviconTag: (seoOrFaviconTag: TitleMetaLinkTag | SeoOrFaviconTag) => seoOrFaviconTag is SeoOrFaviconTag;
53
- export declare const isRegularMetaAttributes: (attributes: RegularMetaAttributes | OgMetaAttributes) => attributes is RegularMetaAttributes;
54
- export declare const isOgMetaAttributes: (attributes: RegularMetaAttributes | OgMetaAttributes) => attributes is OgMetaAttributes;
55
- export declare const isSeoMetaTag: (seoMetaTag: SeoOrFaviconTag) => seoMetaTag is SeoMetaTag;
@@ -1 +0,0 @@
1
- export {};