@prismicio/vue 5.3.0-pr.85.0e554a8 → 5.3.0-pr.86.915aa0e
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/PrismicImage.vue.d.cts +4 -4
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +24 -104
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +27 -32
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +15 -2
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +6 -6
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.cts +7 -6
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts +2 -10
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +2 -10
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/index.cjs +3 -10
- package/dist/index.d.cts +9 -13
- package/dist/index.d.ts +11 -15
- package/dist/index.js +3 -6
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/src/PrismicImage.cjs.map +1 -1
- package/dist/src/PrismicImage.js.map +1 -1
- package/dist/src/PrismicImage.vue.d.ts +4 -4
- package/dist/src/PrismicImage.vue.d.ts.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +2 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js +2 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicLink.cjs.map +1 -1
- package/dist/src/PrismicLink.js.map +1 -1
- package/dist/src/PrismicLink.vue.d.ts +24 -104
- package/dist/src/PrismicLink.vue.d.ts.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -6
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +27 -32
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +19 -52
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +20 -53
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +75 -35
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +76 -36
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +29 -8
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +30 -9
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/types.d.ts +15 -2
- package/dist/src/PrismicRichText/types.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts +7 -7
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +5 -5
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/src/PrismicTable/types.d.ts +7 -6
- package/dist/src/PrismicTable/types.d.ts.map +1 -1
- package/dist/src/PrismicText.cjs.map +1 -1
- package/dist/src/PrismicText.js.map +1 -1
- package/dist/src/PrismicText.vue.d.ts +2 -10
- package/dist/src/PrismicText.vue.d.ts.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -12
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js +3 -14
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue.d.ts +2 -10
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +5 -17
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +6 -18
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/types.d.ts +2 -352
- package/dist/src/types.d.ts.map +1 -1
- package/dist/types.d.cts +2 -352
- package/dist/types.d.cts.map +1 -1
- package/package.json +6 -5
- package/src/PrismicImage.vue +2 -11
- package/src/PrismicLink.vue +9 -34
- package/src/PrismicRichText/PrismicRichText.vue +31 -101
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +46 -20
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +31 -10
- package/src/PrismicRichText/types.ts +16 -1
- package/src/PrismicTable/PrismicTable.vue +7 -7
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +39 -20
- package/src/PrismicTable/types.ts +16 -6
- package/src/PrismicText.vue +2 -15
- package/src/SliceZone/SliceZone.vue +9 -27
- package/src/index.ts +13 -21
- package/src/types.ts +1 -439
- package/dist/PrismicEmbed.vue.d.cts +0 -25
- package/dist/PrismicEmbed.vue.d.cts.map +0 -1
- package/dist/createPrismic.d.cts +0 -29
- package/dist/createPrismic.d.cts.map +0 -1
- package/dist/src/PrismicEmbed.cjs +0 -8
- package/dist/src/PrismicEmbed.cjs.map +0 -1
- package/dist/src/PrismicEmbed.js +0 -8
- package/dist/src/PrismicEmbed.js.map +0 -1
- package/dist/src/PrismicEmbed.vue.d.ts +0 -25
- package/dist/src/PrismicEmbed.vue.d.ts.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/createPrismic.cjs +0 -85
- package/dist/src/createPrismic.cjs.map +0 -1
- package/dist/src/createPrismic.d.ts +0 -29
- package/dist/src/createPrismic.d.ts.map +0 -1
- package/dist/src/createPrismic.js +0 -85
- package/dist/src/createPrismic.js.map +0 -1
- package/dist/src/lib/Wrapper.cjs +0 -8
- package/dist/src/lib/Wrapper.cjs.map +0 -1
- package/dist/src/lib/Wrapper.js +0 -8
- package/dist/src/lib/Wrapper.js.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/usePrismic.cjs +0 -38
- package/dist/src/usePrismic.cjs.map +0 -1
- package/dist/src/usePrismic.d.ts +0 -36
- package/dist/src/usePrismic.d.ts.map +0 -1
- package/dist/src/usePrismic.js +0 -37
- package/dist/src/usePrismic.js.map +0 -1
- package/dist/usePrismic.d.cts +0 -36
- package/dist/usePrismic.d.cts.map +0 -1
- package/src/PrismicEmbed.vue +0 -42
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +0 -146
- package/src/createPrismic.ts +0 -154
- package/src/usePrismic.ts +0 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type {
|
|
1
|
+
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { RichTextComponentProps, VueShorthand } from \"./types\"\n\nimport PrismicImage from \"../PrismicImage.vue\"\nimport PrismicLink from \"../PrismicLink.vue\"\n\nconst props = defineProps<\n\tRichTextComponentProps & {\n\t\tlinkResolver?: LinkResolverFunction\n\t\tinternalLinkComponent?: ComponentOrTagName\n\t\texternalLinkComponent?: ComponentOrTagName\n\t\tshorthand?: VueShorthand\n\t}\n>()\ndefineOptions({ name: \"PrismicRichTextDefaultComponent\" })\n\nconst as = computed(() => {\n\treturn props.node.type !== \"image\" && props.node.type !== \"span\" ? props.shorthand?.as : undefined\n})\n\nconst attrs = computed(() => {\n\treturn props.shorthand?.attrs ?? {}\n})\n\nconst dir = computed(() => {\n\treturn \"direction\" in props.node && props.node.direction === \"rtl\"\n\t\t? \"rtl\"\n\t\t: undefined\n})\n</script>\n\n<template>\n\t<component v-if=\"as\" :is=\"as\" :dir=\"dir\" v-bind=\"attrs\"><slot /></component>\n\t<h1 v-else-if=\"node.type === 'heading1'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h1>\n\t<h2 v-else-if=\"node.type === 'heading2'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h2>\n\t<h3 v-else-if=\"node.type === 'heading3'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h3>\n\t<h4 v-else-if=\"node.type === 'heading4'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h4>\n\t<h5 v-else-if=\"node.type === 'heading5'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h5>\n\t<h6 v-else-if=\"node.type === 'heading6'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h6>\n\t<p v-else-if=\"node.type === 'paragraph'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></p>\n\t<pre v-else-if=\"node.type === 'preformatted'\" v-bind=\"attrs\"><slot /></pre>\n\t<strong v-else-if=\"node.type === 'strong'\" v-bind=\"attrs\"><slot /></strong>\n\t<em v-else-if=\"node.type === 'em'\" v-bind=\"attrs\"><slot /></em>\n\t<li v-else-if=\"node.type === 'list-item'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></li>\n\t<li v-else-if=\"node.type === 'o-list-item'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></li>\n\t<ul v-else-if=\"node.type === 'group-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ul>\n\t<ol v-else-if=\"node.type === 'group-o-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ol>\n\t<p class=\"block-img\" v-else-if=\"node.type === 'image'\">\n\t\t<PrismicLink\n\t\t\tv-if=\"node.linkTo\"\n\t\t\t:field=\"node.linkTo\"\n\t\t\t:internal-component=\"internalLinkComponent\"\n\t\t\t:external-component=\"externalLinkComponent\"\n\t\t\t><PrismicImage :field=\"node\"\n\t\t/></PrismicLink>\n\t\t<PrismicImage v-else :field=\"node\" v-bind=\"attrs\" />\n\t</p>\n\t<div\n\t\tv-else-if=\"node.type === 'embed'\"\n\t\t:data-oembed=\"node.oembed.embed_url\"\n\t\t:data-oembed-type=\"node.oembed.type\"\n\t\t:data-oembed-provider=\"node.oembed.provider_name\"\n\t\tv-html=\"node.oembed.html\"\n\t\tv-bind=\"attrs\"\n\t/>\n\t<PrismicLink\n\t\tv-else-if=\"node.type === 'hyperlink'\"\n\t\t:field=\"node.data\"\n\t\t:link-resolver=\"linkResolver\"\n\t\t:internal-component=\"internalLinkComponent\"\n\t\t:external-component=\"externalLinkComponent\"\n\t\tv-bind=\"attrs\"\n\t\t><slot\n\t/></PrismicLink>\n\t<span v-else-if=\"node.type === 'label'\" :class=\"node.data.label\" v-bind=\"attrs\"\n\t\t><slot\n\t/></span>\n\t<template v-else v-for=\"(line, index) in node.text.split('\\n')\" :key=\"line\"\n\t\t><br v-if=\"index > 0\" />{{ line }}</template\n\t>\n</template>\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name) || typeof maybeComponentOrShorthand?.props === \"object\")\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name) || typeof maybeComponentOrShorthand?.props === \"object\")\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":""}
|
package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs
CHANGED
|
@@ -17,6 +17,14 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
17
17
|
linkResolver: {
|
|
18
18
|
type: Function,
|
|
19
19
|
required: false
|
|
20
|
+
},
|
|
21
|
+
internalLinkComponent: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
externalLinkComponent: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: false
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
setup(__props) {
|
|
@@ -28,28 +36,41 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
28
36
|
};
|
|
29
37
|
const props = __props;
|
|
30
38
|
function getComponent(child) {
|
|
31
|
-
|
|
39
|
+
const maybeComponentOrShorthand = props.components?.[CHILD_TYPE_RENAMES[child.type] || child.type];
|
|
40
|
+
if (typeof maybeComponentOrShorthand === "function" || typeof maybeComponentOrShorthand === "object" && (typeof maybeComponentOrShorthand.render === "function" || typeof maybeComponentOrShorthand.setup === "function" || !!maybeComponentOrShorthand.__file || !!maybeComponentOrShorthand.__name) || typeof maybeComponentOrShorthand?.props === "object") return { is: maybeComponentOrShorthand };
|
|
41
|
+
return {
|
|
42
|
+
is: require_PrismicRichTextDefaultComponent.default,
|
|
43
|
+
props: {
|
|
44
|
+
linkResolver: props.linkResolver,
|
|
45
|
+
internalLinkComponent: props.internalLinkComponent,
|
|
46
|
+
externalLinkComponent: props.externalLinkComponent,
|
|
47
|
+
shorthand: maybeComponentOrShorthand
|
|
48
|
+
}
|
|
49
|
+
};
|
|
32
50
|
}
|
|
33
51
|
return (_ctx, _cache) => {
|
|
34
52
|
const _component_PrismicRichTextSerialize = (0, vue.resolveComponent)("PrismicRichTextSerialize", true);
|
|
35
53
|
return (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(props.children, (child) => {
|
|
36
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(getComponent(child)), {
|
|
54
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(getComponent(child).is), (0, vue.mergeProps)({
|
|
37
55
|
key: JSON.stringify(child),
|
|
38
|
-
node: child.node
|
|
39
|
-
|
|
40
|
-
}, {
|
|
56
|
+
node: child.node
|
|
57
|
+
}, { ref_for: true }, getComponent(child).props), {
|
|
41
58
|
default: (0, vue.withCtx)(() => [child.children.length ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_PrismicRichTextSerialize, {
|
|
42
59
|
key: 0,
|
|
43
60
|
children: child.children,
|
|
44
61
|
components: __props.components,
|
|
45
|
-
"link-resolver": __props.linkResolver
|
|
62
|
+
"link-resolver": __props.linkResolver,
|
|
63
|
+
"internal-link-component": __props.internalLinkComponent,
|
|
64
|
+
"external-link-component": __props.externalLinkComponent
|
|
46
65
|
}, null, 8, [
|
|
47
66
|
"children",
|
|
48
67
|
"components",
|
|
49
|
-
"link-resolver"
|
|
68
|
+
"link-resolver",
|
|
69
|
+
"internal-link-component",
|
|
70
|
+
"external-link-component"
|
|
50
71
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
51
72
|
_: 2
|
|
52
|
-
},
|
|
73
|
+
}, 1040, ["node"]);
|
|
53
74
|
}), 128);
|
|
54
75
|
};
|
|
55
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name) || typeof maybeComponentOrShorthand?.props === \"object\")\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,qBAAqB;GAC1B,aAAa;GACb,eAAe;GACf,mBAAmB;GACnB,qBAAqB;GACrB;EAUD,MAAM,QAAQ;EAGd,SAAS,aAAa,OAAsD;GAC3E,MAAM,4BACL,MAAM,aACL,mBAAmB,MAAM,SACvB,MAAM;AAGV,OACC,OAAO,8BAA8B,cACpC,OAAO,8BAA8B,aACpC,OAAO,0BAA0B,WAAW,cAC5C,OAAO,0BAA0B,UAAU,cAC3C,CAAC,CAAC,0BAA0B,UAC5B,CAAC,CAAC,0BAA0B,WAAW,OAAO,2BAA2B,UAAU,SAErF,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,uBAAuB,MAAM;KAC7B,uBAAuB,MAAM;KAC7B,WAAW;KACX;IACF;;;;gEAkBc,cAAA,0BAZG,MAAM,WAAf,UAAK;uFAEP,aAAa,MAAK,CAAE,GAAE,sBAUd;KAXZ,KAAK,KAAK,UAAU,MAAK;KAEzB,MAAM,MAAM;0BACL,aAAa,MAAK,CAAE,MAAK,EAAA;qCAQhC,CANM,MAAM,SAAS,qDAMrB,qCAAA;;MALC,UAAU,MAAM;MAChB,YAAY,QAAA;MACZ,iBAAe,QAAA;MACf,2BAAyB,QAAA;MACzB,2BAAyB,QAAA"}
|
package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PrismicRichTextDefaultComponent_default from "./PrismicRichTextDefaultComponent.js";
|
|
2
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, renderList, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
|
|
2
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicRichText/PrismicRichTextSerialize.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -17,6 +17,14 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
17
17
|
linkResolver: {
|
|
18
18
|
type: Function,
|
|
19
19
|
required: false
|
|
20
|
+
},
|
|
21
|
+
internalLinkComponent: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
externalLinkComponent: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: false
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
setup(__props) {
|
|
@@ -28,28 +36,41 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
28
36
|
};
|
|
29
37
|
const props = __props;
|
|
30
38
|
function getComponent(child) {
|
|
31
|
-
|
|
39
|
+
const maybeComponentOrShorthand = props.components?.[CHILD_TYPE_RENAMES[child.type] || child.type];
|
|
40
|
+
if (typeof maybeComponentOrShorthand === "function" || typeof maybeComponentOrShorthand === "object" && (typeof maybeComponentOrShorthand.render === "function" || typeof maybeComponentOrShorthand.setup === "function" || !!maybeComponentOrShorthand.__file || !!maybeComponentOrShorthand.__name) || typeof maybeComponentOrShorthand?.props === "object") return { is: maybeComponentOrShorthand };
|
|
41
|
+
return {
|
|
42
|
+
is: PrismicRichTextDefaultComponent_default,
|
|
43
|
+
props: {
|
|
44
|
+
linkResolver: props.linkResolver,
|
|
45
|
+
internalLinkComponent: props.internalLinkComponent,
|
|
46
|
+
externalLinkComponent: props.externalLinkComponent,
|
|
47
|
+
shorthand: maybeComponentOrShorthand
|
|
48
|
+
}
|
|
49
|
+
};
|
|
32
50
|
}
|
|
33
51
|
return (_ctx, _cache) => {
|
|
34
52
|
const _component_PrismicRichTextSerialize = resolveComponent("PrismicRichTextSerialize", true);
|
|
35
53
|
return openBlock(true), createElementBlock(Fragment, null, renderList(props.children, (child) => {
|
|
36
|
-
return openBlock(), createBlock(resolveDynamicComponent(getComponent(child)), {
|
|
54
|
+
return openBlock(), createBlock(resolveDynamicComponent(getComponent(child).is), mergeProps({
|
|
37
55
|
key: JSON.stringify(child),
|
|
38
|
-
node: child.node
|
|
39
|
-
|
|
40
|
-
}, {
|
|
56
|
+
node: child.node
|
|
57
|
+
}, { ref_for: true }, getComponent(child).props), {
|
|
41
58
|
default: withCtx(() => [child.children.length ? (openBlock(), createBlock(_component_PrismicRichTextSerialize, {
|
|
42
59
|
key: 0,
|
|
43
60
|
children: child.children,
|
|
44
61
|
components: __props.components,
|
|
45
|
-
"link-resolver": __props.linkResolver
|
|
62
|
+
"link-resolver": __props.linkResolver,
|
|
63
|
+
"internal-link-component": __props.internalLinkComponent,
|
|
64
|
+
"external-link-component": __props.externalLinkComponent
|
|
46
65
|
}, null, 8, [
|
|
47
66
|
"children",
|
|
48
67
|
"components",
|
|
49
|
-
"link-resolver"
|
|
68
|
+
"link-resolver",
|
|
69
|
+
"internal-link-component",
|
|
70
|
+
"external-link-component"
|
|
50
71
|
])) : createCommentVNode("v-if", true)]),
|
|
51
72
|
_: 2
|
|
52
|
-
},
|
|
73
|
+
}, 1040, ["node"]);
|
|
53
74
|
}), 128);
|
|
54
75
|
};
|
|
55
76
|
}
|
package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name) || typeof maybeComponentOrShorthand?.props === \"object\")\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,qBAAqB;GAC1B,aAAa;GACb,eAAe;GACf,mBAAmB;GACnB,qBAAqB;GACrB;EAUD,MAAM,QAAQ;EAGd,SAAS,aAAa,OAAsD;GAC3E,MAAM,4BACL,MAAM,aACL,mBAAmB,MAAM,SACvB,MAAM;AAGV,OACC,OAAO,8BAA8B,cACpC,OAAO,8BAA8B,aACpC,OAAO,0BAA0B,WAAW,cAC5C,OAAO,0BAA0B,UAAU,cAC3C,CAAC,CAAC,0BAA0B,UAC5B,CAAC,CAAC,0BAA0B,WAAW,OAAO,2BAA2B,UAAU,SAErF,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,uBAAuB,MAAM;KAC7B,uBAAuB,MAAM;KAC7B,WAAW;KACX;IACF;;;;2BAKA,mBAac,UAAA,MAAA,WAZG,MAAM,WAAf,UAAK;wBADb,YAac,wBAVR,aAAa,MAAK,CAAE,GAAE,EAH5B,WAac;KAXZ,KAAK,KAAK,UAAU,MAAK;KAEzB,MAAM,MAAM;0BACL,aAAa,MAAK,CAAE,MAAK,EAAA;4BAQhC,CANM,MAAM,SAAS,uBADrB,YAOA,qCAAA;;MALC,UAAU,MAAM;MAChB,YAAY,QAAA;MACZ,iBAAe,QAAA;MACf,2BAAyB,QAAA;MACzB,2BAAyB,QAAA"}
|
|
@@ -9,7 +9,7 @@ import { RTAnyNode, RichTextNodeType } from "@prismicio/client";
|
|
|
9
9
|
*
|
|
10
10
|
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/rich-text}
|
|
11
11
|
*/
|
|
12
|
-
type VueRichTextSerializer = Partial<Record<keyof typeof RichTextNodeType, VueRichTextComponent>>;
|
|
12
|
+
type VueRichTextSerializer = Partial<Record<keyof typeof RichTextNodeType, VueRichTextComponent | VueShorthand>>;
|
|
13
13
|
/**
|
|
14
14
|
* Props for a component rendering nodes from a Prismic rich text field.
|
|
15
15
|
*/
|
|
@@ -22,6 +22,19 @@ type RichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {
|
|
|
22
22
|
* @typeParam TRTNode - The type of rich text node(s) this component handles
|
|
23
23
|
*/
|
|
24
24
|
type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<RichTextComponentProps<TRTNode>> | FunctionalComponent<RichTextComponentProps<TRTNode>>;
|
|
25
|
+
/**
|
|
26
|
+
* A shorthand definition for {@link VueRichTextSerializer} component types.
|
|
27
|
+
*/
|
|
28
|
+
type VueShorthand = {
|
|
29
|
+
/**
|
|
30
|
+
* The HTML element type rendered for this node type.
|
|
31
|
+
*/
|
|
32
|
+
as?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Other attributes to apply to the element type.
|
|
35
|
+
*/
|
|
36
|
+
[Attribute: string]: string | boolean | null | undefined;
|
|
37
|
+
};
|
|
25
38
|
//#endregion
|
|
26
|
-
export { RichTextComponentProps, VueRichTextSerializer };
|
|
39
|
+
export { RichTextComponentProps, VueRichTextSerializer, VueShorthand };
|
|
27
40
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;;AACC,KADW,qBAAA,GAAwB,OACnC,CAAA,MAAA,CAAA,MAAA,OAAoB,gBAApB,EAAsC,oBAAtC,GAA6D,YAA7D,CAAA,CAAA;;;AAMD;AAAmD,KAAvC,sBAAuC,CAAA,gBAAA,SAAA,GAAY,SAAZ,CAAA,GAAA;EAAY,IAAA,EACxD,OADwD;CACxD;;AACN;;;;KAOI,oBAKgB,CAAA,gBALqB,SAKrB,GALiC,SAKjC,CAAA,GAFlB,eAEkB,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA,GAAlB,UAAkB,CAAA,OAAA,oBAAA,CAAA,GAClB,eADkB,CACF,sBADE,CACqB,OADrB,CAAA,CAAA,GAElB,mBAFkB,CAEE,sBAFF,CAEyB,OAFzB,CAAA,CAAA;;;;AAClB,KAMS,YAAA,GANT;EAC2C;;;EAAxB,EAAA,CAAA,EAAA,MAAA;EAKV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { VueRichTextSerializer } from "../PrismicRichText/types.js";
|
|
2
1
|
import { ComponentOrTagName } from "../types.js";
|
|
3
|
-
import {
|
|
2
|
+
import { VueRichTextSerializer } from "../PrismicRichText/types.js";
|
|
4
3
|
import "../PrismicRichText/index.js";
|
|
4
|
+
import { VueTableComponents } from "./types.js";
|
|
5
5
|
import * as vue6 from "vue";
|
|
6
6
|
import { TableField } from "@prismicio/client";
|
|
7
7
|
|
|
@@ -14,11 +14,6 @@ type PrismicTableProps = {
|
|
|
14
14
|
* The Prismic table field to render.
|
|
15
15
|
*/
|
|
16
16
|
field: TableField | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* The value to be rendered when the field is empty. If a fallback is not
|
|
19
|
-
* given, `null` (nothing) will be rendered.
|
|
20
|
-
*/
|
|
21
|
-
fallback?: ComponentOrTagName;
|
|
22
17
|
/**
|
|
23
18
|
* An object that maps a table block type to a Vue component.
|
|
24
19
|
*
|
|
@@ -31,6 +26,11 @@ type PrismicTableProps = {
|
|
|
31
26
|
* ```
|
|
32
27
|
*/
|
|
33
28
|
components?: VueTableComponents & VueRichTextSerializer;
|
|
29
|
+
/**
|
|
30
|
+
* The value to be rendered when the field is empty. If a fallback is not
|
|
31
|
+
* given, `null` (nothing) will be rendered.
|
|
32
|
+
*/
|
|
33
|
+
fallback?: ComponentOrTagName;
|
|
34
34
|
};
|
|
35
35
|
declare const __VLS_export: vue6.DefineComponent<PrismicTableProps, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {}, string, vue6.PublicProps, Readonly<PrismicTableProps> & Readonly<{}>, {}, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAgGY,iBAAA;EAAA;;;
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAgGY,iBAAA;EAAA;;;EAiBuB,KAAA,EAb3B,UAa2B,GAAA,SAAA;EAMvB;;AACX;;;;;;;;;EAqHiB,UAAA,CAAA,EA5HJ,kBA4HI,GA5HiB,qBA4HjB;EAAA;AAAA;;;aAtHN;;cAsHN,cAAY,IAAA,CAAA,gBAAA,mCAAA,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,cAAA,IAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,IAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -12,13 +12,13 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
12
12
|
type: null,
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
-
fallback: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
15
|
components: {
|
|
20
16
|
type: Object,
|
|
21
17
|
required: false
|
|
18
|
+
},
|
|
19
|
+
fallback: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
setup(__props) {
|
|
@@ -55,7 +55,7 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
55
55
|
_: 1
|
|
56
56
|
}, 8, ["body"]))]),
|
|
57
57
|
_: 1
|
|
58
|
-
}, 16, ["table"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 }));
|
|
58
|
+
}, 16, ["table"])) : __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 })) : (0, vue.createCommentVNode)("v-if", true);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,QAAQ;EAGd,MAAM,4CAAmC;GACxC,GAAG;GACH,GAAG,MAAM;GACT,EAAC;;yBAKM,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,iBAAA,MAAiB,MAAK,sBAwBhB;;IAvBV,OAAO,QAAA;MACAA,KAAAA,OAAM,EAAA;oCAaF,CAVL,QAAA,MAAM,oFACP,iBAAA,MAAiB,MAAK,EAAA;;KAC1B,MAAM,QAAA,MAAM;;qCAGkB,wDAI7B,cAAA,0BAJa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAIT,iCAAA;OAHA,KAAK,IAAI;OACJ;OACL,YAAY,iBAAA;;;;+IAGC,iBAAA,MAAiB,MAAK,EAAA,EAAG,MAAM,QAAA,MAAM;qCAErB,wDAI7B,cAAA,0BAJa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAIT,iCAAA;OAHA,KAAK,IAAI;OACJ;OACL,YAAY,iBAAA;;;;;;wBAIM,QAAA,wFAAe,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
|
|
@@ -12,13 +12,13 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
12
12
|
type: null,
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
-
fallback: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
15
|
components: {
|
|
20
16
|
type: Object,
|
|
21
17
|
required: false
|
|
18
|
+
},
|
|
19
|
+
fallback: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
setup(__props) {
|
|
@@ -55,7 +55,7 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
55
55
|
_: 1
|
|
56
56
|
}, 8, ["body"]))]),
|
|
57
57
|
_: 1
|
|
58
|
-
}, 16, ["table"])) : (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), { key: 1 }));
|
|
58
|
+
}, 16, ["table"])) : __props.fallback ? (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), { key: 1 })) : createCommentVNode("v-if", true);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,QAAQ;EAGd,MAAM,mBAAmB,gBAAgB;GACxC,GAAG;GACH,GAAG,MAAM;GACT,EAAC;;UAKM,MAAA,SAAQ,CAAC,MAAM,QAAA,MAAK,iBAD3B,YA0BY,wBAxBN,iBAAA,MAAiB,MAAK,EAF5B,WA0BY;;IAvBV,OAAO,QAAA;MACAA,KAAAA,OAAM,EAAA;2BAaF,CAVL,QAAA,MAAM,qBADb,YAWY,wBATN,iBAAA,MAAiB,MAAK,EAAA;;KAC1B,MAAM,QAAA,MAAM;;4BAGkB,mBAD/B,mBAKE,UAAA,MAAA,WAJa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAKE,yBAAA;OAHA,KAAK,IAAI;OACJ;OACL,YAAY,iBAAA;;;;uEAGf,YAOY,wBAPI,iBAAA,MAAiB,MAAK,EAAA,EAAG,MAAM,QAAA,MAAM;4BAErB,mBAD/B,mBAKE,UAAA,MAAA,WAJa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAKE,yBAAA;OAHA,KAAK,IAAI;OACJ;OACL,YAAY,iBAAA;;;;;;wBAIM,QAAA,yBAAtB,YAAiD,wBAAZ,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
|
|
@@ -4,39 +4,57 @@ let vue = require("vue");
|
|
|
4
4
|
//#region src/PrismicTable/PrismicTableDefaultComponents.ts
|
|
5
5
|
const defaultTableComponents = {
|
|
6
6
|
table: (0, vue.defineComponent)({
|
|
7
|
-
props:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
props: {
|
|
8
|
+
...require_getTableComponentProps.table(),
|
|
9
|
+
as: { type: String }
|
|
10
|
+
},
|
|
11
|
+
setup(props, { attrs, slots }) {
|
|
12
|
+
return () => (0, vue.h)(props.as ?? "table", attrs, slots.default ? slots.default() : []);
|
|
10
13
|
}
|
|
11
14
|
}),
|
|
12
15
|
thead: (0, vue.defineComponent)({
|
|
13
|
-
props:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
props: {
|
|
17
|
+
...require_getTableComponentProps.thead(),
|
|
18
|
+
as: { type: String }
|
|
19
|
+
},
|
|
20
|
+
setup(props, { attrs, slots }) {
|
|
21
|
+
return () => (0, vue.h)(props.as ?? "thead", attrs, slots.default ? slots.default() : []);
|
|
16
22
|
}
|
|
17
23
|
}),
|
|
18
24
|
tbody: (0, vue.defineComponent)({
|
|
19
|
-
props:
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
props: {
|
|
26
|
+
...require_getTableComponentProps.tbody(),
|
|
27
|
+
as: { type: String }
|
|
28
|
+
},
|
|
29
|
+
setup(props, { attrs, slots }) {
|
|
30
|
+
return () => (0, vue.h)(props.as ?? "tbody", attrs, slots.default ? slots.default() : []);
|
|
22
31
|
}
|
|
23
32
|
}),
|
|
24
33
|
tr: (0, vue.defineComponent)({
|
|
25
|
-
props:
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
props: {
|
|
35
|
+
...require_getTableComponentProps.tr(),
|
|
36
|
+
as: { type: String }
|
|
37
|
+
},
|
|
38
|
+
setup(props, { attrs, slots }) {
|
|
39
|
+
return () => (0, vue.h)(props.as ?? "tr", attrs, slots.default ? slots.default() : []);
|
|
28
40
|
}
|
|
29
41
|
}),
|
|
30
42
|
th: (0, vue.defineComponent)({
|
|
31
|
-
props:
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
props: {
|
|
44
|
+
...require_getTableComponentProps.th(),
|
|
45
|
+
as: { type: String }
|
|
46
|
+
},
|
|
47
|
+
setup(props, { attrs, slots }) {
|
|
48
|
+
return () => (0, vue.h)(props.as ?? "th", attrs, slots.default ? slots.default() : []);
|
|
34
49
|
}
|
|
35
50
|
}),
|
|
36
51
|
td: (0, vue.defineComponent)({
|
|
37
|
-
props:
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
props: {
|
|
53
|
+
...require_getTableComponentProps.td(),
|
|
54
|
+
as: { type: String }
|
|
55
|
+
},
|
|
56
|
+
setup(props, { attrs, slots }) {
|
|
57
|
+
return () => (0, vue.h)(props.as ?? "td", attrs, slots.default ? slots.default() : []);
|
|
40
58
|
}
|
|
41
59
|
})
|
|
42
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTableDefaultComponents.cjs","names":["defaultTableComponents:
|
|
1
|
+
{"version":3,"file":"PrismicTableDefaultComponents.cjs","names":["defaultTableComponents: InternalVueTableComponents"],"sources":["../../../src/PrismicTable/PrismicTableDefaultComponents.ts"],"sourcesContent":["import { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport * as getTableComponentProps from \"./getTableComponentProps\"\n\nexport const defaultTableComponents: InternalVueTableComponents = {\n\ttable: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.table(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => h(props.as ?? \"table\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\tthead: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.thead(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => h(props.as ?? \"thead\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttbody: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.tbody(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => h(props.as ?? \"tbody\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttr: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.tr(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => h(props.as ?? \"tr\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\tth: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.th(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => h(props.as ?? \"th\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttd: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.td(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => h(props.as ?? \"td\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n}\n"],"mappings":";;;;AAOA,MAAaA,yBAAqD;CACjE,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BAAe,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAEjF,CAAC;CACF,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BAAe,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAEjF,CAAC;CACF,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BAAe,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAEjF,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BAAe,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAE9E,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BAAe,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAE9E,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BAAe,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAE9E,CAAC;CACF"}
|