@prismicio/vue 5.0.1 → 5.0.2
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.
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs +1 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs.map +1 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js +1 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +1 -1
|
@@ -24,7 +24,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
24
24
|
vue.onMounted(() => {
|
|
25
25
|
console.warn(
|
|
26
26
|
`[PrismicRichText] You're using the deprecated version of \`<PrismicRichText>\` because either the \`serializer\` prop or the plugin \`richTextSerializer\` option were provided. This API will be removed in a future major. For more details, see ${devMsg.devMsg(
|
|
27
|
-
"html-serialization-is-deprecated-with-prismic-rich-text
|
|
27
|
+
"html-serialization-is-deprecated-with-prismic-rich-text"
|
|
28
28
|
)}`
|
|
29
29
|
);
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeprecatedPrismicRichText.vue.cjs","sources":["../../src/PrismicRichText/DeprecatedPrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n// TODO: Remove in v6\nimport { asHTML, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport type { Component } from \"vue\"\nimport {\n\tcomputed,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\twatch,\n} from \"vue\"\nimport { routerKey } from \"vue-router\"\n\nimport { devMsg } from \"../lib/devMsg\"\nimport { isInternalURL } from \"../lib/isInternalURL\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport type { PrismicRichTextProps } from \"./PrismicRichText.vue\"\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\"\n\nconst props = defineProps<\n\tPick<\n\t\tPrismicRichTextProps,\n\t\t\"field\" | \"linkResolver\" | \"serializer\" | \"wrapper\"\n\t> & { fallback?: string }\n>()\ndefineOptions({ name: \"DeprecatedPrismicRichText\" })\n\nconst { options } = usePrismic()\n\nif (DEV) {\n\tonMounted(() => {\n\t\tconsole.warn(\n\t\t\t`[PrismicRichText] You're using the deprecated version of \\`<PrismicRichText>\\` because either the \\`serializer\\` prop or the plugin \\`richTextSerializer\\` option were provided. This API will be removed in a future major. For more details, see ${devMsg(\n\t\t\t\t\"html-serialization-is-deprecated-with-prismic-rich-text
|
|
1
|
+
{"version":3,"file":"DeprecatedPrismicRichText.vue.cjs","sources":["../../src/PrismicRichText/DeprecatedPrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n// TODO: Remove in v6\nimport { asHTML, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport type { Component } from \"vue\"\nimport {\n\tcomputed,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\twatch,\n} from \"vue\"\nimport { routerKey } from \"vue-router\"\n\nimport { devMsg } from \"../lib/devMsg\"\nimport { isInternalURL } from \"../lib/isInternalURL\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport type { PrismicRichTextProps } from \"./PrismicRichText.vue\"\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\"\n\nconst props = defineProps<\n\tPick<\n\t\tPrismicRichTextProps,\n\t\t\"field\" | \"linkResolver\" | \"serializer\" | \"wrapper\"\n\t> & { fallback?: string }\n>()\ndefineOptions({ name: \"DeprecatedPrismicRichText\" })\n\nconst { options } = usePrismic()\n\nif (DEV) {\n\tonMounted(() => {\n\t\tconsole.warn(\n\t\t\t`[PrismicRichText] You're using the deprecated version of \\`<PrismicRichText>\\` because either the \\`serializer\\` prop or the plugin \\`richTextSerializer\\` option were provided. This API will be removed in a future major. For more details, see ${devMsg(\n\t\t\t\t\"html-serialization-is-deprecated-with-prismic-rich-text\",\n\t\t\t)}`,\n\t\t)\n\t})\n}\n\nconst html = computed(() => {\n\tif (!isFilled.richText(props.field)) {\n\t\treturn props.fallback ?? \"\"\n\t}\n\n\tconst linkResolver = props.linkResolver ?? options.linkResolver\n\tconst serializer = props.serializer ?? options.richTextSerializer\n\n\treturn asHTML(props.field, { linkResolver, serializer })\n})\n\n// Internal links handling\nconst root = ref<HTMLElement | Comment | Component | null>(null)\n\nconst maybeRouter = inject(routerKey, null)\n\ntype InternalLink = {\n\telement: HTMLAnchorElement\n\tlistener: EventListener\n}\n\nlet links: InternalLink[] = []\n\nconst navigate: EventListener = function (\n\tthis: { href: string },\n\tevent: Event,\n) {\n\tevent.preventDefault()\n\tmaybeRouter?.push(this.href)\n}\n\nconst addListeners = () => {\n\tconst node: HTMLElement | Comment | null =\n\t\troot.value && \"$el\" in root.value ? root.value.$el : root.value\n\tif (node && \"querySelectorAll\" in node) {\n\t\t// Get all internal link tags and add listeners on them\n\t\tlinks = Array.from(node.querySelectorAll(\"a\"))\n\t\t\t.map((element) => {\n\t\t\t\tconst href = element.getAttribute(\"href\")\n\n\t\t\t\tif (href && isInternalURL(href)) {\n\t\t\t\t\tconst listener = navigate.bind({ href })\n\t\t\t\t\telement.addEventListener(\"click\", listener)\n\n\t\t\t\t\treturn { element, listener }\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((link): link is InternalLink => link as boolean)\n\t}\n}\n\nconst removeListeners = () => {\n\tlinks.forEach(({ element, listener }) =>\n\t\telement.removeEventListener(\"click\", listener),\n\t)\n\tlinks = []\n}\n\nwatch(\n\thtml,\n\t() => {\n\t\tremoveListeners()\n\t\tnextTick(addListeners)\n\t},\n\t{ immediate: true },\n)\n\nonBeforeUnmount(() => {\n\tremoveListeners()\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.richText(field) || fallback\"\n\t\tref=\"root\"\n\t\t:is=\"wrapper || defaultWrapper\"\n\t\tv-html=\"html\"\n\t/>\n</template>\n"],"names":["usePrismic","DEV","onMounted","devMsg","computed","isFilled","asHTML","ref","inject","routerKey","isInternalURL","watch","nextTick","onBeforeUnmount"],"mappings":";;;;;;;;AA0BA,MAAM,iBAAiB;;;;;;;;;;;;AAEvB,UAAM,QAAQ;AAQR,UAAA,EAAE,QAAQ,IAAIA,sBAAW;AAE/B,QAAIC,YAAK;AACRC,UAAAA,UAAU,MAAM;AACP,gBAAA;AAAA,UACP,sPAAsPC,OAAA;AAAA,YACrP;AAAA,UAAA,CACA;AAAA,QACF;AAAA,MAAA,CACA;AAAA,IAAA;AAGI,UAAA,OAAOC,IAAAA,SAAS,MAAM;AAC3B,UAAI,CAACC,OAAAA,SAAS,SAAS,MAAM,KAAK,GAAG;AACpC,eAAO,MAAM,YAAY;AAAA,MAAA;AAGpB,YAAA,eAAe,MAAM,gBAAgB,QAAQ;AAC7C,YAAA,aAAa,MAAM,cAAc,QAAQ;AAE/C,aAAOC,OAAAA,OAAO,MAAM,OAAO,EAAE,cAAc,YAAY;AAAA,IAAA,CACvD;AAGK,UAAA,OAAOC,QAA8C,IAAI;AAEzD,UAAA,cAAcC,IAAAA,OAAOC,UAAA,WAAW,IAAI;AAO1C,QAAI,QAAwB,CAAC;AAEvB,UAAA,WAA0B,SAE/B,OACC;AACD,YAAM,eAAe;AACR,iDAAA,KAAK,KAAK;AAAA,IACxB;AAEA,UAAM,eAAe,MAAM;AACpB,YAAA,OACL,KAAK,SAAS,SAAS,KAAK,QAAQ,KAAK,MAAM,MAAM,KAAK;AACvD,UAAA,QAAQ,sBAAsB,MAAM;AAE/B,gBAAA,MAAM,KAAK,KAAK,iBAAiB,GAAG,CAAC,EAC3C,IAAI,CAAC,YAAY;AACX,gBAAA,OAAO,QAAQ,aAAa,MAAM;AAEpC,cAAA,QAAQC,4BAAc,IAAI,GAAG;AAChC,kBAAM,WAAW,SAAS,KAAK,EAAE,MAAM;AAC/B,oBAAA,iBAAiB,SAAS,QAAQ;AAEnC,mBAAA,EAAE,SAAS,SAAS;AAAA,UAAA,OACrB;AACC,mBAAA;AAAA,UAAA;AAAA,QAER,CAAA,EACA,OAAO,CAAC,SAA+B,IAAe;AAAA,MAAA;AAAA,IAE1D;AAEA,UAAM,kBAAkB,MAAM;AACvB,YAAA;AAAA,QAAQ,CAAC,EAAE,SAAS,SAAA,MACzB,QAAQ,oBAAoB,SAAS,QAAQ;AAAA,MAC9C;AACA,cAAQ,CAAC;AAAA,IACV;AAEAC,QAAA;AAAA,MACC;AAAA,MACA,MAAM;AACW,wBAAA;AAChBC,YAAAA,SAAS,YAAY;AAAA,MACtB;AAAA,MACA,EAAE,WAAW,KAAK;AAAA,IACnB;AAEAC,QAAAA,gBAAgB,MAAM;AACL,sBAAA;AAAA,IAAA,CAChB;;;;;;;;;;;;"}
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
onMounted(() => {
|
|
24
24
|
console.warn(
|
|
25
25
|
`[PrismicRichText] You're using the deprecated version of \`<PrismicRichText>\` because either the \`serializer\` prop or the plugin \`richTextSerializer\` option were provided. This API will be removed in a future major. For more details, see ${devMsg(
|
|
26
|
-
"html-serialization-is-deprecated-with-prismic-rich-text
|
|
26
|
+
"html-serialization-is-deprecated-with-prismic-rich-text"
|
|
27
27
|
)}`
|
|
28
28
|
);
|
|
29
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeprecatedPrismicRichText.vue.js","sources":["../../src/PrismicRichText/DeprecatedPrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n// TODO: Remove in v6\nimport { asHTML, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport type { Component } from \"vue\"\nimport {\n\tcomputed,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\twatch,\n} from \"vue\"\nimport { routerKey } from \"vue-router\"\n\nimport { devMsg } from \"../lib/devMsg\"\nimport { isInternalURL } from \"../lib/isInternalURL\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport type { PrismicRichTextProps } from \"./PrismicRichText.vue\"\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\"\n\nconst props = defineProps<\n\tPick<\n\t\tPrismicRichTextProps,\n\t\t\"field\" | \"linkResolver\" | \"serializer\" | \"wrapper\"\n\t> & { fallback?: string }\n>()\ndefineOptions({ name: \"DeprecatedPrismicRichText\" })\n\nconst { options } = usePrismic()\n\nif (DEV) {\n\tonMounted(() => {\n\t\tconsole.warn(\n\t\t\t`[PrismicRichText] You're using the deprecated version of \\`<PrismicRichText>\\` because either the \\`serializer\\` prop or the plugin \\`richTextSerializer\\` option were provided. This API will be removed in a future major. For more details, see ${devMsg(\n\t\t\t\t\"html-serialization-is-deprecated-with-prismic-rich-text
|
|
1
|
+
{"version":3,"file":"DeprecatedPrismicRichText.vue.js","sources":["../../src/PrismicRichText/DeprecatedPrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n// TODO: Remove in v6\nimport { asHTML, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport type { Component } from \"vue\"\nimport {\n\tcomputed,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\twatch,\n} from \"vue\"\nimport { routerKey } from \"vue-router\"\n\nimport { devMsg } from \"../lib/devMsg\"\nimport { isInternalURL } from \"../lib/isInternalURL\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport type { PrismicRichTextProps } from \"./PrismicRichText.vue\"\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\"\n\nconst props = defineProps<\n\tPick<\n\t\tPrismicRichTextProps,\n\t\t\"field\" | \"linkResolver\" | \"serializer\" | \"wrapper\"\n\t> & { fallback?: string }\n>()\ndefineOptions({ name: \"DeprecatedPrismicRichText\" })\n\nconst { options } = usePrismic()\n\nif (DEV) {\n\tonMounted(() => {\n\t\tconsole.warn(\n\t\t\t`[PrismicRichText] You're using the deprecated version of \\`<PrismicRichText>\\` because either the \\`serializer\\` prop or the plugin \\`richTextSerializer\\` option were provided. This API will be removed in a future major. For more details, see ${devMsg(\n\t\t\t\t\"html-serialization-is-deprecated-with-prismic-rich-text\",\n\t\t\t)}`,\n\t\t)\n\t})\n}\n\nconst html = computed(() => {\n\tif (!isFilled.richText(props.field)) {\n\t\treturn props.fallback ?? \"\"\n\t}\n\n\tconst linkResolver = props.linkResolver ?? options.linkResolver\n\tconst serializer = props.serializer ?? options.richTextSerializer\n\n\treturn asHTML(props.field, { linkResolver, serializer })\n})\n\n// Internal links handling\nconst root = ref<HTMLElement | Comment | Component | null>(null)\n\nconst maybeRouter = inject(routerKey, null)\n\ntype InternalLink = {\n\telement: HTMLAnchorElement\n\tlistener: EventListener\n}\n\nlet links: InternalLink[] = []\n\nconst navigate: EventListener = function (\n\tthis: { href: string },\n\tevent: Event,\n) {\n\tevent.preventDefault()\n\tmaybeRouter?.push(this.href)\n}\n\nconst addListeners = () => {\n\tconst node: HTMLElement | Comment | null =\n\t\troot.value && \"$el\" in root.value ? root.value.$el : root.value\n\tif (node && \"querySelectorAll\" in node) {\n\t\t// Get all internal link tags and add listeners on them\n\t\tlinks = Array.from(node.querySelectorAll(\"a\"))\n\t\t\t.map((element) => {\n\t\t\t\tconst href = element.getAttribute(\"href\")\n\n\t\t\t\tif (href && isInternalURL(href)) {\n\t\t\t\t\tconst listener = navigate.bind({ href })\n\t\t\t\t\telement.addEventListener(\"click\", listener)\n\n\t\t\t\t\treturn { element, listener }\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((link): link is InternalLink => link as boolean)\n\t}\n}\n\nconst removeListeners = () => {\n\tlinks.forEach(({ element, listener }) =>\n\t\telement.removeEventListener(\"click\", listener),\n\t)\n\tlinks = []\n}\n\nwatch(\n\thtml,\n\t() => {\n\t\tremoveListeners()\n\t\tnextTick(addListeners)\n\t},\n\t{ immediate: true },\n)\n\nonBeforeUnmount(() => {\n\tremoveListeners()\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.richText(field) || fallback\"\n\t\tref=\"root\"\n\t\t:is=\"wrapper || defaultWrapper\"\n\t\tv-html=\"html\"\n\t/>\n</template>\n"],"names":[],"mappings":";;;;;;;AA0BA,MAAM,iBAAiB;;;;;;;;;;;;AAEvB,UAAM,QAAQ;AAQR,UAAA,EAAE,QAAQ,IAAI,WAAW;AAE/B,QAAI,KAAK;AACR,gBAAU,MAAM;AACP,gBAAA;AAAA,UACP,sPAAsP;AAAA,YACrP;AAAA,UAAA,CACA;AAAA,QACF;AAAA,MAAA,CACA;AAAA,IAAA;AAGI,UAAA,OAAO,SAAS,MAAM;AAC3B,UAAI,CAAC,SAAS,SAAS,MAAM,KAAK,GAAG;AACpC,eAAO,MAAM,YAAY;AAAA,MAAA;AAGpB,YAAA,eAAe,MAAM,gBAAgB,QAAQ;AAC7C,YAAA,aAAa,MAAM,cAAc,QAAQ;AAE/C,aAAO,OAAO,MAAM,OAAO,EAAE,cAAc,YAAY;AAAA,IAAA,CACvD;AAGK,UAAA,OAAO,IAA8C,IAAI;AAEzD,UAAA,cAAc,OAAO,WAAW,IAAI;AAO1C,QAAI,QAAwB,CAAC;AAEvB,UAAA,WAA0B,SAE/B,OACC;AACD,YAAM,eAAe;AACR,iDAAA,KAAK,KAAK;AAAA,IACxB;AAEA,UAAM,eAAe,MAAM;AACpB,YAAA,OACL,KAAK,SAAS,SAAS,KAAK,QAAQ,KAAK,MAAM,MAAM,KAAK;AACvD,UAAA,QAAQ,sBAAsB,MAAM;AAE/B,gBAAA,MAAM,KAAK,KAAK,iBAAiB,GAAG,CAAC,EAC3C,IAAI,CAAC,YAAY;AACX,gBAAA,OAAO,QAAQ,aAAa,MAAM;AAEpC,cAAA,QAAQ,cAAc,IAAI,GAAG;AAChC,kBAAM,WAAW,SAAS,KAAK,EAAE,MAAM;AAC/B,oBAAA,iBAAiB,SAAS,QAAQ;AAEnC,mBAAA,EAAE,SAAS,SAAS;AAAA,UAAA,OACrB;AACC,mBAAA;AAAA,UAAA;AAAA,QAER,CAAA,EACA,OAAO,CAAC,SAA+B,IAAe;AAAA,MAAA;AAAA,IAE1D;AAEA,UAAM,kBAAkB,MAAM;AACvB,YAAA;AAAA,QAAQ,CAAC,EAAE,SAAS,SAAA,MACzB,QAAQ,oBAAoB,SAAS,QAAQ;AAAA,MAC9C;AACA,cAAQ,CAAC;AAAA,IACV;AAEA;AAAA,MACC;AAAA,MACA,MAAM;AACW,wBAAA;AAChB,iBAAS,YAAY;AAAA,MACtB;AAAA,MACA,EAAE,WAAW,KAAK;AAAA,IACnB;AAEA,oBAAgB,MAAM;AACL,sBAAA;AAAA,IAAA,CAChB;;;;;;;;;;;"}
|
package/dist/package.json.cjs
CHANGED
package/dist/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ if (DEV) {
|
|
|
40
40
|
onMounted(() => {
|
|
41
41
|
console.warn(
|
|
42
42
|
`[PrismicRichText] You're using the deprecated version of \`<PrismicRichText>\` because either the \`serializer\` prop or the plugin \`richTextSerializer\` option were provided. This API will be removed in a future major. For more details, see ${devMsg(
|
|
43
|
-
"html-serialization-is-deprecated-with-prismic-rich-text
|
|
43
|
+
"html-serialization-is-deprecated-with-prismic-rich-text",
|
|
44
44
|
)}`,
|
|
45
45
|
)
|
|
46
46
|
})
|