@prismicio/react
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -80,7 +80,7 @@ import * as React from 'react'; | ||
} | ||
const target = props.target || "field" in props && props.field && "target" in props.field && props.field.target || void 0; | ||
const isInternal = href && isInternalURL(href); | ||
const target = props.target || "field" in props && props.field && "target" in props.field && props.field.target || !isInternal && "_blank" || void 0; | ||
const rel = props.rel || (target === "_blank" ? "noopener noreferrer" : void 0); | ||
const InternalComponent = props.internalComponent || context.internalLinkComponent || defaultInternalComponent; | ||
const ExternalComponent = props.externalComponent || context.externalLinkComponent || defaultExternalComponent; | ||
const isInternal = href && isInternalURL(href); | ||
const Component = isInternal ? InternalComponent : ExternalComponent; | ||
@@ -258,3 +258,3 @@ const passthroughProps = Object.assign({}, props); | ||
var version = "2.3.0"; | ||
var version = "2.4.0"; | ||
@@ -277,9 +277,9 @@ const devMsg = (slug) => { | ||
if (typeof alt === "string" && props.alt !== "") { | ||
console.warn(`[PrismicImage] The alt prop can only be used to declare an image as decorative by passing an empty string (alt=""). For more details, see ${devMsg("alt-must-be-an-empty-string")}`); | ||
console.warn(`[PrismicImage] The "alt" prop can only be used to declare an image as decorative by passing an empty string (alt="") but was provided a non-empty string. You can resolve this warning by removing the "alt" prop or changing it to alt="". For more details, see ${devMsg("alt-must-be-an-empty-string")}`); | ||
} | ||
if (typeof fallbackAlt === "string" && fallbackAlt !== "") { | ||
console.warn(`[PrismicImage] The fallbackAlt prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=""). For more details, see ${devMsg("alt-must-be-an-empty-string")}`); | ||
console.warn(`[PrismicImage] The "fallbackAlt" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt="") but was provided a non-empty string. You can resolve this warning by removing the "fallbackAlt" prop or changing it to fallbackAlt="". For more details, see ${devMsg("alt-must-be-an-empty-string")}`); | ||
} | ||
if (widths && pixelDensities) { | ||
console.warn(`[PrismicImage] Only one of "widths" or "pixelDensities" props can be provided. "widths" will be used in this case.`); | ||
console.warn(`[PrismicImage] Only one of "widths" or "pixelDensities" props can be provided. You can resolve this warning by removing either the "widths" or "pixelDensities" prop. "widths" will be used in this case.`); | ||
} | ||
@@ -388,2 +388,5 @@ } | ||
script.dataset.type = type; | ||
if (process.env.NODE_ENV === "test") { | ||
script._evaluateScript = false; | ||
} | ||
document.body.appendChild(script); | ||
@@ -390,0 +393,0 @@ } |
{ | ||
"name": "@prismicio/react", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "React components and hooks to fetch and present Prismic content", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374424
4442
4