@prismicio/vue
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -1,2 +0,2 @@ | ||
const version = "5.0.0"; | ||
const version = "5.0.1"; | ||
export { | ||
@@ -3,0 +3,0 @@ version |
@@ -1,5 +0,3 @@ | ||
import { defineComponent, watchEffect, computed, openBlock, createBlock, resolveDynamicComponent, normalizeProps, guardReactiveProps, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue"; | ||
import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeProps, guardReactiveProps, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue"; | ||
import { asLinkAttrs } from "@prismicio/client"; | ||
import { DEV } from "esm-env"; | ||
import { devMsg } from "./lib/devMsg.js"; | ||
import { isInternalURL } from "./lib/isInternalURL.js"; | ||
@@ -24,36 +22,2 @@ import { usePrismic } from "./usePrismic.js"; | ||
const { options } = usePrismic(); | ||
if (DEV) { | ||
watchEffect(() => { | ||
if (props.field) { | ||
if (!props.field.link_type) { | ||
console.error( | ||
`[PrismicLink] This "field" prop value caused an error to be thrown. | ||
`, | ||
props.field | ||
); | ||
throw new Error( | ||
`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg( | ||
"missing-link-properties" | ||
)}` | ||
); | ||
} else if (("text" in props.field ? Object.keys(props.field).length > 2 : Object.keys(props.field).length > 1) && !("url" in props.field || "uid" in props.field || "id" in props.field)) { | ||
console.warn( | ||
`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg( | ||
"missing-link-properties" | ||
)}`, | ||
props.field | ||
); | ||
} | ||
} else if (props.document) { | ||
if (!("url" in props.document || "id" in props.document)) { | ||
console.warn( | ||
`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg( | ||
"missing-link-properties" | ||
)}`, | ||
props.document | ||
); | ||
} | ||
} | ||
}); | ||
} | ||
const rawAttrs = computed(() => { | ||
@@ -60,0 +24,0 @@ return asLinkAttrs(props.field || props.document, { |
{ | ||
"name": "@prismicio/vue", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Vue plugin, components, and composables 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
310948
4441