Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-datocms

Package Overview
Dependencies
Maintainers
6
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-datocms - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

1

dist/cjs/Image/index.js

@@ -8,2 +8,3 @@ "use strict";

exports.Image = void 0;
// biome-ignore lint/style/useImportType: wrong warning
const react_1 = __importDefault(require("react"));

@@ -10,0 +11,0 @@ const react_2 = require("react");

30

dist/cjs/Seo/nextUtils.js

@@ -11,3 +11,3 @@ "use strict";

if (tag === 'title') {
metadata['title'] = content;
metadata.title = content;
}

@@ -21,7 +21,7 @@ if ((0, types_js_1.isSeoOrFaviconTag)(datum) && (0, types_js_1.isSeoMetaTag)(datum)) {

if (parts[0] === 'image') {
metadata['openGraph'] || (metadata['openGraph'] = {});
metadata['openGraph']['images'] = Object.assign(Object.assign({}, metadata['openGraph']['images']), { url: content });
metadata.openGraph || (metadata.openGraph = {});
metadata.openGraph.images = Object.assign(Object.assign({}, metadata.openGraph.images), { url: content });
}
else {
metadata['openGraph'] = Object.assign(Object.assign({}, metadata['openGraph']), { [camelize(parts[0])]: content });
metadata.openGraph = Object.assign(Object.assign({}, metadata.openGraph), { [camelize(parts[0])]: content });
}

@@ -31,8 +31,8 @@ }

if (parts[0] === 'image' && parts[1] === 'width') {
metadata['openGraph'] || (metadata['openGraph'] = {});
metadata['openGraph']['images'] = Object.assign(Object.assign({}, metadata['openGraph']['images']), { width: content });
metadata.openGraph || (metadata.openGraph = {});
metadata.openGraph.images = Object.assign(Object.assign({}, metadata.openGraph.images), { width: content });
}
else if (parts[0] === 'image' && parts[1] === 'height') {
metadata['openGraph'] || (metadata['openGraph'] = {});
metadata['openGraph']['images'] = Object.assign(Object.assign({}, metadata['openGraph']['images']), { height: content });
metadata.openGraph || (metadata.openGraph = {});
metadata.openGraph.images = Object.assign(Object.assign({}, metadata.openGraph.images), { height: content });
}

@@ -50,3 +50,3 @@ }

if ((parts === null || parts === void 0 ? void 0 : parts.length) === 1) {
metadata['twitter'] = Object.assign(Object.assign({}, metadata['twitter']), { [camelize(parts[0])]: content });
metadata.twitter = Object.assign(Object.assign({}, metadata.twitter), { [camelize(parts[0])]: content });
}

@@ -62,5 +62,5 @@ }

const { sizes, href } = datum.attributes;
metadata['icons'] || (metadata['icons'] = {});
metadata['icons']['apple'] = [
...(metadata['icons']['apple'] || []),
metadata.icons || (metadata.icons = {});
metadata.icons.apple = [
...(metadata.icons.apple || []),
{ url: href, sizes },

@@ -71,5 +71,5 @@ ];

const { sizes, type, rel, href } = datum.attributes;
metadata['icons'] || (metadata['icons'] = {});
metadata['icons']['icon'] = [
...(metadata['icons']['icon'] || []),
metadata.icons || (metadata.icons = {});
metadata.icons.icon = [
...(metadata.icons.icon || []),
{ url: href, sizes, type, rel },

@@ -76,0 +76,0 @@ ];

@@ -10,3 +10,3 @@ "use strict";

return data.map(({ tag, attributes, content }) => {
let key = [tag];
const key = [tag];
if (attributes && 'property' in attributes) {

@@ -13,0 +13,0 @@ key.push(attributes.property);

@@ -7,2 +7,3 @@ "use strict";

exports.SRCImage = void 0;
// biome-ignore lint/style/useImportType: wrong warning
const react_1 = __importDefault(require("react"));

@@ -16,3 +17,3 @@ const utils_js_1 = require("./utils.js");

? {
backgroundImage: `url(${data.base64})`,
backgroundImage: `url("${data.base64}")`,
backgroundSize: 'cover',

@@ -42,5 +43,5 @@ backgroundRepeat: 'no-repeat',

// biome-ignore lint/a11y/useAltText: We do with alt the best we can
react_1.default.createElement("img", Object.assign({ src: data.src, alt: (_c = data.alt) !== null && _c !== void 0 ? _c : undefined, title: (_d = data.title) !== null && _d !== void 0 ? _d : undefined }, loadingBehaviourProps, { className: className, style: Object.assign(Object.assign(Object.assign({}, placeholderStyle), sizingStyle), style) })))));
react_1.default.createElement("img", Object.assign({ src: data.src, alt: (_c = data.alt) !== null && _c !== void 0 ? _c : '', title: (_d = data.title) !== null && _d !== void 0 ? _d : undefined }, loadingBehaviourProps, { className: className, style: Object.assign(Object.assign(Object.assign({}, placeholderStyle), sizingStyle), style) })))));
}
exports.SRCImage = SRCImage;
//# sourceMappingURL=index.js.map

@@ -30,4 +30,4 @@ "use strict";

const [majorStr, minorStr] = react_1.version.split('.');
const major = parseInt(majorStr, 10);
const minor = parseInt(minorStr, 10);
const major = Number.parseInt(majorStr, 10);
const minor = Number.parseInt(minorStr, 10);
if (major > 18 || (major === 18 && minor >= 3)) {

@@ -57,6 +57,6 @@ // In React 18.3.0 or newer, we must use camelCase

if (maxH) {
url.searchParams.set('max-h', `${Math.floor(parseInt(maxH) * multiplier)}`);
url.searchParams.set('max-h', `${Math.floor(Number.parseInt(maxH) * multiplier)}`);
}
if (maxW) {
url.searchParams.set('max-w', `${Math.floor(parseInt(maxW) * multiplier)}`);
url.searchParams.set('max-w', `${Math.floor(Number.parseInt(maxW) * multiplier)}`);
}

@@ -63,0 +63,0 @@ }

"use strict";
'use client';
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -40,3 +17,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

exports.useSiteSearch = void 0;
const react_1 = __importStar(require("react"));
const react_1 = __importDefault(require("react"));
const react_2 = require("react");
const react_string_replace_1 = __importDefault(require("react-string-replace"));

@@ -49,3 +27,3 @@ const defaultHighlighter = (text, key) => (react_1.default.createElement("mark", { key: key }, text));

var _a, _b, _c;
const [state, setState] = (0, react_1.useState)({
const [state, setState] = (0, react_2.useState)({
query: ((_a = config.initialState) === null || _a === void 0 ? void 0 : _a.query) || '',

@@ -55,6 +33,6 @@ page: ((_b = config.initialState) === null || _b === void 0 ? void 0 : _b.page) || 0,

});
const [error, setError] = (0, react_1.useState)();
const [response, setResponse] = (0, react_1.useState)();
const [error, setError] = (0, react_2.useState)();
const [response, setResponse] = (0, react_2.useState)();
const resultsPerPage = config.resultsPerPage || 8;
(0, react_1.useEffect)(() => {
(0, react_2.useEffect)(() => {
let isCancelled = false;

@@ -111,9 +89,9 @@ const run = () => __awaiter(this, void 0, void 0, function* () {

]);
const publicSetQuery = (0, react_1.useCallback)((newQuery) => {
const publicSetQuery = (0, react_2.useCallback)((newQuery) => {
setState((oldState) => (Object.assign(Object.assign({}, oldState), { query: newQuery, page: 0 })));
}, [setState]);
const publicSetPage = (0, react_1.useCallback)((newPage) => {
const publicSetPage = (0, react_2.useCallback)((newPage) => {
setState((oldState) => (Object.assign(Object.assign({}, oldState), { page: newPage })));
}, [setState]);
const publicSetLocale = (0, react_1.useCallback)((newLocale) => {
const publicSetLocale = (0, react_2.useCallback)((newLocale) => {
setState((oldState) => (Object.assign(Object.assign({}, oldState), { locale: newLocale, page: 0 })));

@@ -120,0 +98,0 @@ }, [setState]);

'use client';
// biome-ignore lint/style/useImportType: wrong warning
import React from 'react';

@@ -3,0 +4,0 @@ import { forwardRef, useRef } from 'react';

@@ -8,3 +8,3 @@ import { isAppleTouchIconAttributes, isFaviconAttributes, isOgMetaAttributes, isRegularMetaAttributes, isSeoLinkTag, isSeoMetaTag, isSeoOrFaviconTag, } from './types.js';

if (tag === 'title') {
metadata['title'] = content;
metadata.title = content;
}

@@ -18,7 +18,7 @@ if (isSeoOrFaviconTag(datum) && isSeoMetaTag(datum)) {

if (parts[0] === 'image') {
metadata['openGraph'] || (metadata['openGraph'] = {});
metadata['openGraph']['images'] = Object.assign(Object.assign({}, metadata['openGraph']['images']), { url: content });
metadata.openGraph || (metadata.openGraph = {});
metadata.openGraph.images = Object.assign(Object.assign({}, metadata.openGraph.images), { url: content });
}
else {
metadata['openGraph'] = Object.assign(Object.assign({}, metadata['openGraph']), { [camelize(parts[0])]: content });
metadata.openGraph = Object.assign(Object.assign({}, metadata.openGraph), { [camelize(parts[0])]: content });
}

@@ -28,8 +28,8 @@ }

if (parts[0] === 'image' && parts[1] === 'width') {
metadata['openGraph'] || (metadata['openGraph'] = {});
metadata['openGraph']['images'] = Object.assign(Object.assign({}, metadata['openGraph']['images']), { width: content });
metadata.openGraph || (metadata.openGraph = {});
metadata.openGraph.images = Object.assign(Object.assign({}, metadata.openGraph.images), { width: content });
}
else if (parts[0] === 'image' && parts[1] === 'height') {
metadata['openGraph'] || (metadata['openGraph'] = {});
metadata['openGraph']['images'] = Object.assign(Object.assign({}, metadata['openGraph']['images']), { height: content });
metadata.openGraph || (metadata.openGraph = {});
metadata.openGraph.images = Object.assign(Object.assign({}, metadata.openGraph.images), { height: content });
}

@@ -47,3 +47,3 @@ }

if ((parts === null || parts === void 0 ? void 0 : parts.length) === 1) {
metadata['twitter'] = Object.assign(Object.assign({}, metadata['twitter']), { [camelize(parts[0])]: content });
metadata.twitter = Object.assign(Object.assign({}, metadata.twitter), { [camelize(parts[0])]: content });
}

@@ -59,5 +59,5 @@ }

const { sizes, href } = datum.attributes;
metadata['icons'] || (metadata['icons'] = {});
metadata['icons']['apple'] = [
...(metadata['icons']['apple'] || []),
metadata.icons || (metadata.icons = {});
metadata.icons.apple = [
...(metadata.icons.apple || []),
{ url: href, sizes },

@@ -68,5 +68,5 @@ ];

const { sizes, type, rel, href } = datum.attributes;
metadata['icons'] || (metadata['icons'] = {});
metadata['icons']['icon'] = [
...(metadata['icons']['icon'] || []),
metadata.icons || (metadata.icons = {});
metadata.icons.icon = [
...(metadata.icons.icon || []),
{ url: href, sizes, type, rel },

@@ -73,0 +73,0 @@ ];

import React from 'react';
export function renderMetaTags(data) {
return data.map(({ tag, attributes, content }) => {
let key = [tag];
const key = [tag];
if (attributes && 'property' in attributes) {

@@ -6,0 +6,0 @@ key.push(attributes.property);

@@ -0,1 +1,2 @@

// biome-ignore lint/style/useImportType: wrong warning
import React from 'react';

@@ -9,3 +10,3 @@ import { buildRegularSource, buildWebpSource, priorityProp } from './utils.js';

? {
backgroundImage: `url(${data.base64})`,
backgroundImage: `url("${data.base64}")`,
backgroundSize: 'cover',

@@ -35,4 +36,4 @@ backgroundRepeat: 'no-repeat',

// biome-ignore lint/a11y/useAltText: We do with alt the best we can
React.createElement("img", Object.assign({ src: data.src, alt: (_c = data.alt) !== null && _c !== void 0 ? _c : undefined, title: (_d = data.title) !== null && _d !== void 0 ? _d : undefined }, loadingBehaviourProps, { className: className, style: Object.assign(Object.assign(Object.assign({}, placeholderStyle), sizingStyle), style) })))));
React.createElement("img", Object.assign({ src: data.src, alt: (_c = data.alt) !== null && _c !== void 0 ? _c : '', title: (_d = data.title) !== null && _d !== void 0 ? _d : undefined }, loadingBehaviourProps, { className: className, style: Object.assign(Object.assign(Object.assign({}, placeholderStyle), sizingStyle), style) })))));
}
//# sourceMappingURL=index.js.map
import React, { version } from 'react';
export function priorityProp(fetchPriority) {
const [majorStr, minorStr] = version.split('.');
const major = parseInt(majorStr, 10);
const minor = parseInt(minorStr, 10);
const major = Number.parseInt(majorStr, 10);
const minor = Number.parseInt(minorStr, 10);
if (major > 18 || (major === 18 && minor >= 3)) {

@@ -29,6 +29,6 @@ // In React 18.3.0 or newer, we must use camelCase

if (maxH) {
url.searchParams.set('max-h', `${Math.floor(parseInt(maxH) * multiplier)}`);
url.searchParams.set('max-h', `${Math.floor(Number.parseInt(maxH) * multiplier)}`);
}
if (maxW) {
url.searchParams.set('max-w', `${Math.floor(parseInt(maxW) * multiplier)}`);
url.searchParams.set('max-w', `${Math.floor(Number.parseInt(maxW) * multiplier)}`);
}

@@ -35,0 +35,0 @@ }

@@ -11,3 +11,4 @@ 'use client';

};
import React, { useCallback, useEffect, useState } from 'react';
import React from 'react';
import { useCallback, useEffect, useState } from 'react';
import reactStringReplace from 'react-string-replace';

@@ -14,0 +15,0 @@ const defaultHighlighter = (text, key) => (React.createElement("mark", { key: key }, text));

@@ -1,2 +0,2 @@

import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
import type { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
interface RemixV1HtmlMetaDescriptor {

@@ -3,0 +3,0 @@ [name: string]: string | string[];

/// <reference types="react" />
import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
import type { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
export declare function renderMetaTags(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): JSX.Element[];

@@ -1,2 +0,2 @@

import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
import type { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
export declare function renderMetaTagsToString(data: TitleMetaLinkTag[] | SeoOrFaviconTag[]): string;
/// <reference types="react" />
import { ResponsiveImageType } from '../Image';
import type { ResponsiveImageType } from '../Image';
export declare function priorityProp(fetchPriority?: string): Record<string, string | undefined>;

@@ -4,0 +4,0 @@ export declare const buildSrcSetFromSrc: (src: string | null | undefined, width: number | undefined, candidateMultipliers: number[]) => string | undefined;

@@ -1,4 +0,4 @@

import { RenderMarkRule, TransformMetaFn, TransformedMeta, renderMarkRule, renderNodeRule } from 'datocms-structured-text-generic-html-renderer';
import { Document as StructuredTextDocument, Node, Record as StructuredTextGraphQlResponseRecord, RenderError, RenderResult, RenderRule, StructuredText as StructuredTextGraphQlResponse } from 'datocms-structured-text-utils';
import { ReactElement } from 'react';
import { type RenderMarkRule, type TransformMetaFn, type TransformedMeta, renderMarkRule, renderNodeRule } from 'datocms-structured-text-generic-html-renderer';
import { type Node, RenderError, type RenderResult, type RenderRule, type Document as StructuredTextDocument, type StructuredText as StructuredTextGraphQlResponse, type Record as StructuredTextGraphQlResponseRecord } from 'datocms-structured-text-utils';
import { type ReactElement } from 'react';
export { renderNodeRule, renderMarkRule, RenderError };

@@ -5,0 +5,0 @@ export { renderNodeRule as renderRule };

@@ -1,2 +0,2 @@

import { ChannelErrorData, ConnectionStatus, Options } from 'datocms-listen';
import { type ChannelErrorData, type ConnectionStatus, type Options } from 'datocms-listen';
export type SubscribeToQueryOptions<QueryResult, QueryVariables> = Omit<Options<QueryResult, QueryVariables>, 'onStatusChange' | 'onUpdate' | 'onChannelError'>;

@@ -3,0 +3,0 @@ export type EnabledQueryListenerOptions<QueryResult, QueryVariables> = {

@@ -1,3 +0,3 @@

import { MuxPlayerProps } from '@mux/mux-player-react/.';
import { Video } from '../VideoPlayer';
import type { MuxPlayerProps } from '@mux/mux-player-react/.';
import type { Video } from '../VideoPlayer';
type Style = MuxPlayerProps['style'];

@@ -4,0 +4,0 @@ type Title = MuxPlayerProps['title'];

@@ -1,2 +0,2 @@

import { type MuxPlayerProps } from '@mux/mux-player-react/.';
import type { MuxPlayerProps } from '@mux/mux-player-react';
import MuxPlayer from '@mux/mux-player-react/lazy';

@@ -3,0 +3,0 @@ type Maybe<T> = T | null;

{
"name": "react-datocms",
"version": "6.0.0",
"version": "6.0.1",
"engines": {

@@ -123,3 +123,3 @@ "node": ">=8.0.0"

"build": "rimraf dist && npm run tsc:types && npm run tsc:cjs && npm run tsc:esm",
"format": "npm run toc && biome format --write src examples/src",
"format": "npm run toc && biome check --apply src && biome format --write src examples/src",
"watch": "rimraf dist && tsc --project ./tsconfig.commonjs.json --watch",

@@ -126,0 +126,0 @@ "prepare": "npm run test && npm run build",

@@ -79,3 +79,3 @@ import {

if (tag === 'title') {
metadata['title'] = content;
metadata.title = content;
}

@@ -92,11 +92,11 @@

if (parts[0] === 'image') {
metadata['openGraph'] ||= {};
metadata.openGraph ||= {};
metadata['openGraph']['images'] = {
...metadata['openGraph']['images'],
metadata.openGraph.images = {
...metadata.openGraph.images,
url: content,
};
} else {
metadata['openGraph'] = {
...metadata['openGraph'],
metadata.openGraph = {
...metadata.openGraph,
[camelize(parts[0])]: content,

@@ -109,13 +109,13 @@ };

if (parts[0] === 'image' && parts[1] === 'width') {
metadata['openGraph'] ||= {};
metadata.openGraph ||= {};
metadata['openGraph']['images'] = {
...metadata['openGraph']['images'],
metadata.openGraph.images = {
...metadata.openGraph.images,
width: content,
};
} else if (parts[0] === 'image' && parts[1] === 'height') {
metadata['openGraph'] ||= {};
metadata.openGraph ||= {};
metadata['openGraph']['images'] = {
...metadata['openGraph']['images'],
metadata.openGraph.images = {
...metadata.openGraph.images,
height: content,

@@ -137,4 +137,4 @@ };

if (parts?.length === 1) {
metadata['twitter'] = {
...metadata['twitter'],
metadata.twitter = {
...metadata.twitter,
[camelize(parts[0])]: content,

@@ -153,6 +153,6 @@ };

metadata['icons'] ||= {};
metadata.icons ||= {};
metadata['icons']['apple'] = [
...(metadata['icons']['apple'] || []),
metadata.icons.apple = [
...(metadata.icons.apple || []),
{ url: href, sizes },

@@ -165,6 +165,6 @@ ];

metadata['icons'] ||= {};
metadata.icons ||= {};
metadata['icons']['icon'] = [
...(metadata['icons']['icon'] || []),
metadata.icons.icon = [
...(metadata.icons.icon || []),
{ url: href, sizes, type, rel },

@@ -171,0 +171,0 @@ ];

@@ -1,2 +0,2 @@

import { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';
import type { SeoOrFaviconTag, TitleMetaLinkTag } from './types.js';

@@ -3,0 +3,0 @@ interface RemixV1HtmlMetaDescriptor {

'use client';
import {
ChannelErrorData,
ConnectionStatus,
Options,
UnsubscribeFn,
type ChannelErrorData,
type ConnectionStatus,
type Options,
type UnsubscribeFn,
subscribeToQuery,

@@ -9,0 +9,0 @@ } from 'datocms-listen';

@@ -1,4 +0,4 @@

import { MuxPlayerProps } from '@mux/mux-player-react/.';
import type { MuxPlayerProps } from '@mux/mux-player-react/.';
import { Video } from '../VideoPlayer';
import type { Video } from '../VideoPlayer';

@@ -5,0 +5,0 @@ type Maybe<T> = T | null;

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc