react-datocms
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -29,3 +29,3 @@ "use strict"; | ||
require("intersection-observer"); | ||
var index_1 = require("../index"); | ||
var index_js_1 = require("../index.js"); | ||
var test_utils_1 = require("react-intersection-observer/test-utils"); | ||
@@ -63,3 +63,3 @@ var data = { | ||
it('renders the blur-up thumb', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.Image, { data: data, layout: layout, intersectionThreshold: 0.1 })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.Image, { data: data, layout: layout, intersectionThreshold: 0.1 })); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -70,3 +70,3 @@ }); | ||
it('renders the image', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.Image, { data: data, layout: layout, intersectionThreshold: 0.2 })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.Image, { data: data, layout: layout, intersectionThreshold: 0.2 })); | ||
(0, test_utils_1.mockAllIsIntersecting)(true); | ||
@@ -77,3 +77,3 @@ wrapper.update(); | ||
it('renders the image (minimal data)', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.Image, { data: minimalData, layout: layout, intersectionThreshold: 0.2 })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.Image, { data: minimalData, layout: layout, intersectionThreshold: 0.2 })); | ||
(0, test_utils_1.mockAllIsIntersecting)(true); | ||
@@ -84,3 +84,3 @@ wrapper.update(); | ||
it('renders the image (relative URL)', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.Image, { data: minimalDataWithRelativeUrl, layout: layout, intersectionThreshold: 0.2 })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.Image, { data: minimalDataWithRelativeUrl, layout: layout, intersectionThreshold: 0.2 })); | ||
(0, test_utils_1.mockAllIsIntersecting)(true); | ||
@@ -92,3 +92,3 @@ wrapper.update(); | ||
it('shows the image', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.Image, { data: data, layout: layout, intersectionThreshold: 0.3 })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.Image, { data: data, layout: layout, intersectionThreshold: 0.3 })); | ||
(0, test_utils_1.mockAllIsIntersecting)(true); | ||
@@ -95,0 +95,0 @@ wrapper.update(); |
@@ -40,3 +40,3 @@ 'use client'; | ||
var react_1 = __importStar(require("react")); | ||
var useInView_1 = require("./useInView"); | ||
var useInView_js_1 = require("./useInView.js"); | ||
var universal_base64_1 = require("universal-base64"); | ||
@@ -134,3 +134,3 @@ var isSsr = typeof window === 'undefined'; | ||
}, []); | ||
var _u = (0, useInView_1.useInView)({ | ||
var _u = (0, useInView_js_1.useInView)({ | ||
threshold: intersectionThreshold || intersectionTreshold || 0, | ||
@@ -137,0 +137,0 @@ rootMargin: intersectionMargin || '0px 0px 0px 0px', |
@@ -17,7 +17,7 @@ "use strict"; | ||
exports.__esModule = true; | ||
__exportStar(require("./Image"), exports); | ||
__exportStar(require("./Seo"), exports); | ||
__exportStar(require("./useQuerySubscription"), exports); | ||
__exportStar(require("./StructuredText"), exports); | ||
__exportStar(require("./useSiteSearch"), exports); | ||
__exportStar(require("./Image/index.js"), exports); | ||
__exportStar(require("./Seo/index.js"), exports); | ||
__exportStar(require("./useQuerySubscription/index.js"), exports); | ||
__exportStar(require("./StructuredText/index.js"), exports); | ||
__exportStar(require("./useSiteSearch/index.js"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -28,3 +28,3 @@ "use strict"; | ||
var enzyme_1 = require("enzyme"); | ||
var __1 = require(".."); | ||
var index_js_1 = require("../index.js"); | ||
var metaTags = [ | ||
@@ -312,3 +312,3 @@ { | ||
it('generates an array of meta tags', function () { | ||
var wrapper = (0, enzyme_1.shallow)(React.createElement("head", null, (0, __1.renderMetaTags)(metaTags))); | ||
var wrapper = (0, enzyme_1.shallow)(React.createElement("head", null, (0, index_js_1.renderMetaTags)(metaTags))); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -319,3 +319,3 @@ }); | ||
it('generates an array of meta tags', function () { | ||
expect((0, __1.renderMetaTagsToString)(metaTags)).toMatchSnapshot(); | ||
expect((0, index_js_1.renderMetaTagsToString)(metaTags)).toMatchSnapshot(); | ||
}); | ||
@@ -325,3 +325,3 @@ }); | ||
it('generates a meta descriptor', function () { | ||
expect((0, __1.toRemixMeta)(metaTags)).toMatchSnapshot(); | ||
expect((0, index_js_1.toRemixMeta)(metaTags)).toMatchSnapshot(); | ||
}); | ||
@@ -331,5 +331,5 @@ }); | ||
it('generates a Next Metadata object', function () { | ||
expect((0, __1.toNextMetadata)(metaTags)).toMatchSnapshot(); | ||
expect((0, index_js_1.toNextMetadata)(metaTags)).toMatchSnapshot(); | ||
}); | ||
}); | ||
//# sourceMappingURL=index.test.js.map |
@@ -17,7 +17,7 @@ "use strict"; | ||
exports.__esModule = true; | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./remixUtils"), exports); | ||
__exportStar(require("./nextUtils"), exports); | ||
__exportStar(require("./renderMetaTags"), exports); | ||
__exportStar(require("./renderMetaTagsToString"), exports); | ||
__exportStar(require("./types.js"), exports); | ||
__exportStar(require("./remixUtils.js"), exports); | ||
__exportStar(require("./nextUtils.js"), exports); | ||
__exportStar(require("./renderMetaTags.js"), exports); | ||
__exportStar(require("./renderMetaTagsToString.js"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -24,3 +24,3 @@ "use strict"; | ||
exports.toNextMetadata = void 0; | ||
var types_1 = require("./types"); | ||
var types_js_1 = require("./types.js"); | ||
var camelize = function (string) { | ||
@@ -37,4 +37,4 @@ return string.replace(/_([a-z])/g, function (_, letter) { return letter.toUpperCase(); }); | ||
} | ||
if ((0, types_1.isSeoOrFaviconTag)(datum) && (0, types_1.isSeoMetaTag)(datum)) { | ||
if ((0, types_1.isOgMetaAttributes)(datum.attributes)) { | ||
if ((0, types_js_1.isSeoOrFaviconTag)(datum) && (0, types_js_1.isSeoMetaTag)(datum)) { | ||
if ((0, types_js_1.isOgMetaAttributes)(datum.attributes)) { | ||
var _c = datum.attributes, property = _c.property, content_1 = _c.content; | ||
@@ -64,3 +64,3 @@ if (property.match(/^og:/)) { | ||
} | ||
if ((0, types_1.isRegularMetaAttributes)(datum.attributes)) { | ||
if ((0, types_js_1.isRegularMetaAttributes)(datum.attributes)) { | ||
var _e = datum.attributes, name_1 = _e.name, content_2 = _e.content; | ||
@@ -81,4 +81,4 @@ if (name_1.match(/^msapplication-/)) { | ||
} | ||
if ((0, types_1.isSeoLinkTag)(datum)) { | ||
if ((0, types_1.isAppleTouchIconAttributes)(datum.attributes)) { | ||
if ((0, types_js_1.isSeoLinkTag)(datum)) { | ||
if ((0, types_js_1.isAppleTouchIconAttributes)(datum.attributes)) { | ||
var _g = datum.attributes, sizes = _g.sizes, href = _g.href; | ||
@@ -90,3 +90,3 @@ metadata['icons'] || (metadata['icons'] = {}); | ||
} | ||
if ((0, types_1.isFaviconAttributes)(datum.attributes)) { | ||
if ((0, types_js_1.isFaviconAttributes)(datum.attributes)) { | ||
var _h = datum.attributes, sizes = _h.sizes, type = _h.type, rel = _h.rel, href = _h.href; | ||
@@ -93,0 +93,0 @@ metadata['icons'] || (metadata['icons'] = {}); |
@@ -39,3 +39,3 @@ "use strict"; | ||
var React = __importStar(require("react")); | ||
var index_1 = require("../index"); | ||
var index_js_1 = require("../index.js"); | ||
var datocms_structured_text_utils_1 = require("datocms-structured-text-utils"); | ||
@@ -46,3 +46,3 @@ var datocms_structured_text_generic_html_renderer_1 = require("datocms-structured-text-generic-html-renderer"); | ||
it('renders null', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.StructuredText, { data: null })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.StructuredText, { data: null })); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -77,3 +77,3 @@ }); | ||
it('renders the document', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.StructuredText, { data: structuredText })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.StructuredText, { data: structuredText })); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -84,3 +84,3 @@ }); | ||
it('renders the document', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.StructuredText, { data: structuredText, customMarkRules: [ | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.StructuredText, { data: structuredText, customMarkRules: [ | ||
(0, datocms_structured_text_generic_html_renderer_1.renderMarkRule)('strong', function (_a) { | ||
@@ -123,3 +123,3 @@ var children = _a.children, key = _a.key; | ||
it('renders the document', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.StructuredText, { data: structuredText })); | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.StructuredText, { data: structuredText })); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -130,6 +130,6 @@ }); | ||
it('renders the document', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.StructuredText, { data: structuredText, renderText: function (text, key) { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.StructuredText, { data: structuredText, renderText: function (text, key) { | ||
return (React.createElement(React.Fragment, { key: key }, text.replace(/This/, 'That'))); | ||
}, customNodeRules: [ | ||
(0, index_1.renderNodeRule)(datocms_structured_text_utils_1.isHeading, function (_a) { | ||
(0, index_js_1.renderNodeRule)(datocms_structured_text_utils_1.isHeading, function (_a) { | ||
var renderNode = _a.adapter.renderNode, node = _a.node, children = _a.children, key = _a.key; | ||
@@ -201,3 +201,3 @@ return renderNode("h".concat(node.level + 1), { key: key }, children); | ||
it('renders the document', function () { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_1.StructuredText, { data: structuredText, renderInlineRecord: function (_a) { | ||
var wrapper = (0, enzyme_1.mount)(React.createElement(index_js_1.StructuredText, { data: structuredText, renderInlineRecord: function (_a) { | ||
var record = _a.record; | ||
@@ -235,4 +235,4 @@ switch (record.__typename) { | ||
expect(function () { | ||
(0, enzyme_1.shallow)(React.createElement(index_1.StructuredText, { data: structuredText })); | ||
}).toThrow(index_1.RenderError); | ||
(0, enzyme_1.shallow)(React.createElement(index_js_1.StructuredText, { data: structuredText })); | ||
}).toThrow(index_js_1.RenderError); | ||
}); | ||
@@ -243,6 +243,6 @@ }); | ||
expect(function () { | ||
(0, enzyme_1.shallow)(React.createElement(index_1.StructuredText, { data: __assign(__assign({}, structuredText), { links: [] }), renderInlineRecord: function () { | ||
(0, enzyme_1.shallow)(React.createElement(index_js_1.StructuredText, { data: __assign(__assign({}, structuredText), { links: [] }), renderInlineRecord: function () { | ||
return null; | ||
} })); | ||
}).toThrow(index_1.RenderError); | ||
}).toThrow(index_js_1.RenderError); | ||
}); | ||
@@ -249,0 +249,0 @@ }); |
import * as React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import 'intersection-observer'; | ||
import { Image } from '../index'; | ||
import { Image } from '../index.js'; | ||
import { mockAllIsIntersecting } from 'react-intersection-observer/test-utils'; | ||
@@ -6,0 +6,0 @@ var data = { |
@@ -14,3 +14,3 @@ 'use client'; | ||
import React, { useState, forwardRef, useCallback, useRef, useEffect, version, } from 'react'; | ||
import { useInView } from './useInView'; | ||
import { useInView } from './useInView.js'; | ||
import { encode } from 'universal-base64'; | ||
@@ -17,0 +17,0 @@ var isSsr = typeof window === 'undefined'; |
@@ -1,5 +0,5 @@ | ||
export * from './Image'; | ||
export * from './Seo'; | ||
export * from './useQuerySubscription'; | ||
export * from './StructuredText'; | ||
export * from './useSiteSearch'; | ||
export * from './Image/index.js'; | ||
export * from './Seo/index.js'; | ||
export * from './useQuerySubscription/index.js'; | ||
export * from './StructuredText/index.js'; | ||
export * from './useSiteSearch/index.js'; |
@@ -1,6 +0,6 @@ | ||
export * from './Image'; | ||
export * from './Seo'; | ||
export * from './useQuerySubscription'; | ||
export * from './StructuredText'; | ||
export * from './useSiteSearch'; | ||
export * from './Image/index.js'; | ||
export * from './Seo/index.js'; | ||
export * from './useQuerySubscription/index.js'; | ||
export * from './StructuredText/index.js'; | ||
export * from './useSiteSearch/index.js'; | ||
//# sourceMappingURL=index.js.map |
import * as React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { renderMetaTags, renderMetaTagsToString, toNextMetadata, toRemixMeta, } from '..'; | ||
import { renderMetaTags, renderMetaTagsToString, toNextMetadata, toRemixMeta, } from '../index.js'; | ||
var metaTags = [ | ||
@@ -5,0 +5,0 @@ { |
@@ -1,5 +0,5 @@ | ||
export * from './types'; | ||
export * from './remixUtils'; | ||
export * from './nextUtils'; | ||
export * from './renderMetaTags'; | ||
export * from './renderMetaTagsToString'; | ||
export * from './types.js'; | ||
export * from './remixUtils.js'; | ||
export * from './nextUtils.js'; | ||
export * from './renderMetaTags.js'; | ||
export * from './renderMetaTagsToString.js'; |
@@ -1,6 +0,6 @@ | ||
export * from './types'; | ||
export * from './remixUtils'; | ||
export * from './nextUtils'; | ||
export * from './renderMetaTags'; | ||
export * from './renderMetaTagsToString'; | ||
export * from './types.js'; | ||
export * from './remixUtils.js'; | ||
export * from './nextUtils.js'; | ||
export * from './renderMetaTags.js'; | ||
export * from './renderMetaTagsToString.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { type TitleMetaLinkTag, type SeoOrFaviconTag } from './types'; | ||
import { type TitleMetaLinkTag, type SeoOrFaviconTag } from './types.js'; | ||
export type AppleIcon = { | ||
@@ -3,0 +3,0 @@ sizes: string; |
@@ -21,3 +21,3 @@ var __assign = (this && this.__assign) || function () { | ||
}; | ||
import { isAppleTouchIconAttributes, isFaviconAttributes, isOgMetaAttributes, isRegularMetaAttributes, isSeoLinkTag, isSeoMetaTag, isSeoOrFaviconTag, } from './types'; | ||
import { isAppleTouchIconAttributes, isFaviconAttributes, isOgMetaAttributes, isRegularMetaAttributes, isSeoLinkTag, isSeoMetaTag, isSeoOrFaviconTag, } from './types.js'; | ||
var camelize = function (string) { | ||
@@ -24,0 +24,0 @@ return string.replace(/_([a-z])/g, function (_, letter) { return letter.toUpperCase(); }); |
@@ -1,2 +0,2 @@ | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
interface RemixHtmlMetaDescriptor { | ||
@@ -3,0 +3,0 @@ [name: string]: string | string[]; |
/// <reference types="react" /> | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
export declare function renderMetaTags(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): JSX.Element[]; |
@@ -1,2 +0,2 @@ | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
export declare function renderMetaTagsToString(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): string; |
@@ -14,3 +14,3 @@ var __assign = (this && this.__assign) || function () { | ||
import * as React from 'react'; | ||
import { StructuredText, RenderError, renderNodeRule, } from '../index'; | ||
import { StructuredText, RenderError, renderNodeRule, } from '../index.js'; | ||
import { isHeading } from 'datocms-structured-text-utils'; | ||
@@ -17,0 +17,0 @@ import { renderMarkRule } from 'datocms-structured-text-generic-html-renderer'; |
@@ -1,5 +0,5 @@ | ||
export * from './Image'; | ||
export * from './Seo'; | ||
export * from './useQuerySubscription'; | ||
export * from './StructuredText'; | ||
export * from './useSiteSearch'; | ||
export * from './Image/index.js'; | ||
export * from './Seo/index.js'; | ||
export * from './useQuerySubscription/index.js'; | ||
export * from './StructuredText/index.js'; | ||
export * from './useSiteSearch/index.js'; |
@@ -1,5 +0,5 @@ | ||
export * from './types'; | ||
export * from './remixUtils'; | ||
export * from './nextUtils'; | ||
export * from './renderMetaTags'; | ||
export * from './renderMetaTagsToString'; | ||
export * from './types.js'; | ||
export * from './remixUtils.js'; | ||
export * from './nextUtils.js'; | ||
export * from './renderMetaTags.js'; | ||
export * from './renderMetaTagsToString.js'; |
@@ -1,2 +0,2 @@ | ||
import { type TitleMetaLinkTag, type SeoOrFaviconTag } from './types'; | ||
import { type TitleMetaLinkTag, type SeoOrFaviconTag } from './types.js'; | ||
export type AppleIcon = { | ||
@@ -3,0 +3,0 @@ sizes: string; |
@@ -1,2 +0,2 @@ | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
interface RemixHtmlMetaDescriptor { | ||
@@ -3,0 +3,0 @@ [name: string]: string | string[]; |
/// <reference types="react" /> | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
export declare function renderMetaTags(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): JSX.Element[]; |
@@ -1,2 +0,2 @@ | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
export declare function renderMetaTagsToString(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): string; |
{ | ||
"name": "react-datocms", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"engines": { | ||
@@ -118,3 +118,8 @@ "node": ">=8.0.0" | ||
"transform": { | ||
"\\.(ts|tsx)$": "ts-jest" | ||
"\\.(ts|tsx)$": [ | ||
"ts-jest", | ||
{ | ||
"useESM": true | ||
} | ||
] | ||
}, | ||
@@ -137,3 +142,6 @@ "setupFiles": [ | ||
"enzyme-to-json/serializer" | ||
] | ||
], | ||
"moduleNameMapper": { | ||
"^(\\.\\.?\\/.+)\\.js$": "$1" | ||
} | ||
}, | ||
@@ -140,0 +148,0 @@ "dependencies": { |
@@ -1,5 +0,5 @@ | ||
export * from './Image'; | ||
export * from './Seo'; | ||
export * from './useQuerySubscription'; | ||
export * from './StructuredText'; | ||
export * from './useSiteSearch'; | ||
export * from './Image/index.js'; | ||
export * from './Seo/index.js'; | ||
export * from './useQuerySubscription/index.js'; | ||
export * from './StructuredText/index.js'; | ||
export * from './useSiteSearch/index.js'; |
@@ -1,5 +0,5 @@ | ||
export * from './types'; | ||
export * from './remixUtils'; | ||
export * from './nextUtils'; | ||
export * from './renderMetaTags'; | ||
export * from './renderMetaTagsToString'; | ||
export * from './types.js'; | ||
export * from './remixUtils.js'; | ||
export * from './nextUtils.js'; | ||
export * from './renderMetaTags.js'; | ||
export * from './renderMetaTagsToString.js'; |
@@ -11,3 +11,3 @@ import { | ||
isSeoOrFaviconTag, | ||
} from './types'; | ||
} from './types.js'; | ||
@@ -14,0 +14,0 @@ export type AppleIcon = { |
@@ -1,2 +0,2 @@ | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types'; | ||
import { TitleMetaLinkTag, SeoOrFaviconTag } from './types.js'; | ||
@@ -3,0 +3,0 @@ interface RemixHtmlMetaDescriptor { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
410487