@prismicio/vue 5.3.0-pr.86.81afa1a → 5.3.0-pr.88.ee9acb6

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.
Files changed (83) hide show
  1. package/dist/PrismicImage.vue.d.cts +4 -4
  2. package/dist/PrismicImage.vue.d.cts.map +1 -1
  3. package/dist/PrismicLink.vue.d.cts +4 -4
  4. package/dist/PrismicRichText/PrismicRichText.vue.d.cts +12 -36
  5. package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
  6. package/dist/PrismicRichText/types.d.cts +3 -3
  7. package/dist/PrismicRichText/types.d.cts.map +1 -1
  8. package/dist/PrismicTable/PrismicTable.vue.d.cts +2 -2
  9. package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
  10. package/dist/PrismicTable/types.d.cts +1 -2
  11. package/dist/PrismicTable/types.d.cts.map +1 -1
  12. package/dist/PrismicText.vue.d.cts +2 -2
  13. package/dist/SliceZone/SliceZone.vue.d.cts +2 -2
  14. package/dist/package.cjs +1 -1
  15. package/dist/package.cjs.map +1 -1
  16. package/dist/package.js +1 -1
  17. package/dist/package.js.map +1 -1
  18. package/dist/src/PrismicImage.vue.d.ts +4 -4
  19. package/dist/src/PrismicImage.vue.d.ts.map +1 -1
  20. package/dist/src/PrismicLink.vue.d.ts +4 -4
  21. package/dist/src/PrismicLink.vue.d.ts.map +1 -1
  22. package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
  23. package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
  24. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +16 -40
  25. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
  26. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +39 -22
  27. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  28. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +39 -22
  29. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
  31. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
  32. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +6 -26
  33. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  34. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +6 -26
  35. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
  37. package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
  38. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +7 -48
  39. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  40. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +7 -48
  41. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/src/PrismicRichText/types.d.ts +3 -3
  43. package/dist/src/PrismicRichText/types.d.ts.map +1 -1
  44. package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
  45. package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
  46. package/dist/src/PrismicTable/PrismicTable.vue.d.ts +2 -2
  47. package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
  48. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +42 -14
  49. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  50. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +42 -14
  51. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  52. package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
  53. package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
  54. package/dist/src/PrismicTable/PrismicTableRow.cjs.map +1 -1
  55. package/dist/src/PrismicTable/PrismicTableRow.js.map +1 -1
  56. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +13 -10
  57. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  58. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +14 -11
  59. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  60. package/dist/src/PrismicTable/types.d.ts +1 -2
  61. package/dist/src/PrismicTable/types.d.ts.map +1 -1
  62. package/dist/src/PrismicText.vue.d.ts +2 -2
  63. package/dist/src/PrismicText.vue.d.ts.map +1 -1
  64. package/dist/src/SliceZone/SliceZone.vue.d.ts +2 -2
  65. package/dist/src/types.cjs +9 -0
  66. package/dist/src/types.cjs.map +1 -0
  67. package/dist/src/types.d.ts +3 -2
  68. package/dist/src/types.d.ts.map +1 -1
  69. package/dist/src/types.js +8 -0
  70. package/dist/src/types.js.map +1 -0
  71. package/dist/types.d.cts +3 -2
  72. package/dist/types.d.cts.map +1 -1
  73. package/package.json +1 -1
  74. package/src/PrismicRichText/PrismicRichText.vue +62 -43
  75. package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +38 -22
  76. package/src/PrismicRichText/PrismicRichTextSerialize.vue +5 -51
  77. package/src/PrismicRichText/types.ts +17 -13
  78. package/src/PrismicTable/PrismicTable.vue +39 -12
  79. package/src/PrismicTable/PrismicTableDefaultComponents.ts +14 -8
  80. package/src/PrismicTable/PrismicTableRow.vue +17 -24
  81. package/src/PrismicTable/types.ts +14 -11
  82. package/src/types.ts +31 -1
  83. package/src/lib/Wrapper.vue +0 -22
@@ -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 { 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))\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,QAE9B,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"}
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 { asTree } from \"@prismicio/client/richtext\"\n\nimport type { InternalVueRichTextComponent } from \"./types\"\n\ntype PrismicRichTextSerializeProps = {\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tinternalComponents: InternalVueRichTextComponent\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\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=\"internalComponents[child.type].is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"internalComponents[child.type].props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:internal-components=\"internalComponents\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;;;gEAeC,cAAA,0BATG,MAAM,WAAf,UAAK;uFAEP,QAAA,mBAAmB,MAAM,MAAM,GAAE,sBAOzB;KARZ,KAAK,KAAK,UAAU,MAAK;KAEzB,MAAM,MAAM;0BACL,QAAA,mBAAmB,MAAM,MAAM,MAAK,EAAA;qCAK3C,CAHM,MAAM,SAAS,qDAGrB,qCAAA;;MAFC,UAAU,MAAM;MAChB,uBAAqB,QAAA"}
@@ -1,4 +1,3 @@
1
- import PrismicRichTextDefaultComponent_default from "./PrismicRichTextDefaultComponent.js";
2
1
  import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
3
2
 
4
3
  //#region src/PrismicRichText/PrismicRichTextSerialize.vue?vue&type=script&setup=true&lang.ts
@@ -6,69 +5,29 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
6
5
  name: "PrismicRichTextSerialize",
7
6
  __name: "PrismicRichTextSerialize",
8
7
  props: {
9
- components: {
10
- type: Object,
11
- required: false
12
- },
13
8
  children: {
14
9
  type: null,
15
10
  required: true
16
11
  },
17
- linkResolver: {
18
- type: Function,
19
- required: false
20
- },
21
- internalLinkComponent: {
22
- type: null,
23
- required: false
24
- },
25
- externalLinkComponent: {
26
- type: null,
27
- required: false
12
+ internalComponents: {
13
+ type: Object,
14
+ required: true
28
15
  }
29
16
  },
30
17
  setup(__props) {
31
- const CHILD_TYPE_RENAMES = {
32
- "list-item": "listItem",
33
- "o-list-item": "oListItem",
34
- "group-list-item": "list",
35
- "group-o-list-item": "oList"
36
- };
37
18
  const props = __props;
38
- function getComponent(child) {
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)) 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
- };
50
- }
51
19
  return (_ctx, _cache) => {
52
20
  const _component_PrismicRichTextSerialize = resolveComponent("PrismicRichTextSerialize", true);
53
21
  return openBlock(true), createElementBlock(Fragment, null, renderList(props.children, (child) => {
54
- return openBlock(), createBlock(resolveDynamicComponent(getComponent(child).is), mergeProps({
22
+ return openBlock(), createBlock(resolveDynamicComponent(__props.internalComponents[child.type].is), mergeProps({
55
23
  key: JSON.stringify(child),
56
24
  node: child.node
57
- }, { ref_for: true }, getComponent(child).props), {
25
+ }, { ref_for: true }, __props.internalComponents[child.type].props), {
58
26
  default: withCtx(() => [child.children.length ? (openBlock(), createBlock(_component_PrismicRichTextSerialize, {
59
27
  key: 0,
60
28
  children: child.children,
61
- components: __props.components,
62
- "link-resolver": __props.linkResolver,
63
- "internal-link-component": __props.internalLinkComponent,
64
- "external-link-component": __props.externalLinkComponent
65
- }, null, 8, [
66
- "children",
67
- "components",
68
- "link-resolver",
69
- "internal-link-component",
70
- "external-link-component"
71
- ])) : createCommentVNode("v-if", true)]),
29
+ "internal-components": __props.internalComponents
30
+ }, null, 8, ["children", "internal-components"])) : createCommentVNode("v-if", true)]),
72
31
  _: 2
73
32
  }, 1040, ["node"]);
74
33
  }), 128);
@@ -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 { 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))\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,QAE9B,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"}
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 { asTree } from \"@prismicio/client/richtext\"\n\nimport type { InternalVueRichTextComponent } from \"./types\"\n\ntype PrismicRichTextSerializeProps = {\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tinternalComponents: InternalVueRichTextComponent\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\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=\"internalComponents[child.type].is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"internalComponents[child.type].props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:internal-components=\"internalComponents\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;;;2BAKb,mBAUc,UAAA,MAAA,WATG,MAAM,WAAf,UAAK;wBADb,YAUc,wBAPR,QAAA,mBAAmB,MAAM,MAAM,GAAE,EAHvC,WAUc;KARZ,KAAK,KAAK,UAAU,MAAK;KAEzB,MAAM,MAAM;0BACL,QAAA,mBAAmB,MAAM,MAAM,MAAK,EAAA;4BAK3C,CAHM,MAAM,SAAS,uBADrB,YAIA,qCAAA;;MAFC,UAAU,MAAM;MAChB,uBAAqB,QAAA"}
@@ -1,5 +1,5 @@
1
- import { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
2
- import { RTAnyNode, RichTextNodeType } from "@prismicio/client";
1
+ import { VueComponent } from "../types.js";
2
+ import { LinkResolverFunction, RTAnyNode, RichTextNodeType } from "@prismicio/client";
3
3
 
4
4
  //#region src/PrismicRichText/types.d.ts
5
5
 
@@ -21,7 +21,7 @@ type RichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {
21
21
  *
22
22
  * @typeParam TRTNode - The type of rich text node(s) this component handles
23
23
  */
24
- type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<RichTextComponentProps<TRTNode>> | FunctionalComponent<RichTextComponentProps<TRTNode>>;
24
+ type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = VueComponent<RichTextComponentProps<TRTNode>>;
25
25
  /**
26
26
  * A shorthand definition for {@link VueRichTextSerializer} component types.
27
27
  */
@@ -1 +1 @@
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
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAcA;;;;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,oBACJ,CAAA,gBADyC,SACzC,GADqD,SACrD,CAAA,GADkE,YAClE,CAAA,sBAAA,CAAuB,OAAvB,CAAA,CAAA;;;AAMD;KAAY,YAAA"}
@@ -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 * 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
+ {"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 { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, 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\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\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 * 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
+ {"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 { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, 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\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
@@ -2,7 +2,7 @@ import { ComponentOrTagName } from "../types.js";
2
2
  import { VueRichTextSerializer } from "../PrismicRichText/types.js";
3
3
  import "../PrismicRichText/index.js";
4
4
  import { VueTableComponents } from "./types.js";
5
- import * as vue26 from "vue";
5
+ import * as vue6 from "vue";
6
6
  import { TableField } from "@prismicio/client";
7
7
 
8
8
  //#region src/PrismicTable/PrismicTable.vue.d.ts
@@ -32,7 +32,7 @@ type PrismicTableProps = {
32
32
  */
33
33
  fallback?: ComponentOrTagName;
34
34
  };
35
- declare const __VLS_export: vue26.DefineComponent<PrismicTableProps, {}, {}, {}, {}, vue26.ComponentOptionsMixin, vue26.ComponentOptionsMixin, {}, string, vue26.PublicProps, Readonly<PrismicTableProps> & Readonly<{}>, {}, {}, {}, {}, string, vue26.ComponentProvideOptions, false, {}, any>;
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;
37
37
  //#endregion
38
38
  export { PrismicTableProps, _default };
@@ -1 +1 @@
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,KAAA,CAAA,gBAAA,mCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
1
+ {"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KA4HY,iBAAA;EAAA;;;EAiBuB,KAAA,EAb3B,UAa2B,GAAA,SAAA;EAMvB;;AACX;;;;;;;;;EAiJiB,UAAA,CAAA,EAxJJ,kBAwJI,GAxJiB,qBAwJjB;EAAA;AAAA;;;aAlJN;;cAkJN,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"}
@@ -1,3 +1,4 @@
1
+ const require_types = require('../types.cjs');
1
2
  const require_PrismicTableDefaultComponents = require('./PrismicTableDefaultComponents.cjs');
2
3
  const require_PrismicTableRow = require('./PrismicTableRow.cjs');
3
4
  let vue = require("vue");
@@ -23,37 +24,64 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
23
24
  },
24
25
  setup(__props) {
25
26
  const props = __props;
26
- const mergedComponents = (0, vue.computed)(() => ({
27
- ...require_PrismicTableDefaultComponents.defaultTableComponents,
28
- ...props.components
29
- }));
27
+ function getInternalComponent(type) {
28
+ const maybeComponentOrShorthand = props.components?.[type];
29
+ if (require_types.isVueComponent(maybeComponentOrShorthand)) return { is: maybeComponentOrShorthand };
30
+ return {
31
+ is: require_PrismicTableDefaultComponents.defaultTableComponents[type],
32
+ shorthand: maybeComponentOrShorthand
33
+ };
34
+ }
35
+ const tableComponents = (0, vue.computed)(() => {
36
+ return {
37
+ table: getInternalComponent("table"),
38
+ thead: getInternalComponent("thead"),
39
+ tbody: getInternalComponent("tbody"),
40
+ tr: getInternalComponent("tr"),
41
+ th: getInternalComponent("th"),
42
+ td: getInternalComponent("td")
43
+ };
44
+ });
30
45
  return (_ctx, _cache) => {
31
- return (0, vue.unref)(__prismicio_client.isFilled).table(__props.field) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(mergedComponents.value.table), (0, vue.mergeProps)({
46
+ return (0, vue.unref)(__prismicio_client.isFilled).table(__props.field) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tableComponents.value.table.is), (0, vue.mergeProps)({
32
47
  key: 0,
33
48
  table: __props.field
34
- }, _ctx.$attrs), {
35
- default: (0, vue.withCtx)(() => [__props.field.head ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(mergedComponents.value.thead), {
49
+ }, {
50
+ ..._ctx.$attrs,
51
+ ...tableComponents.value.table.shorthand
52
+ }), {
53
+ default: (0, vue.withCtx)(() => [__props.field.head ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tableComponents.value.thead.is), (0, vue.mergeProps)({
36
54
  key: 0,
37
55
  head: __props.field.head
38
- }, {
56
+ }, tableComponents.value.thead.shorthand), {
39
57
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.field.head.rows, (row) => {
40
58
  return (0, vue.openBlock)(), (0, vue.createBlock)(require_PrismicTableRow.default, {
41
59
  key: row.key,
42
60
  row,
43
- components: mergedComponents.value
44
- }, null, 8, ["row", "components"]);
61
+ internalTableComponents: tableComponents.value,
62
+ components: __props.components
63
+ }, null, 8, [
64
+ "row",
65
+ "internalTableComponents",
66
+ "components"
67
+ ]);
45
68
  }), 128))]),
46
69
  _: 1
47
- }, 8, ["head"])) : (0, vue.createCommentVNode)("v-if", true), ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(mergedComponents.value.tbody), { body: __props.field.body }, {
70
+ }, 16, ["head"])) : (0, vue.createCommentVNode)("v-if", true), ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tableComponents.value.tbody.is), (0, vue.mergeProps)({ body: __props.field.body }, tableComponents.value.tbody.shorthand), {
48
71
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.field.body.rows, (row) => {
49
72
  return (0, vue.openBlock)(), (0, vue.createBlock)(require_PrismicTableRow.default, {
50
73
  key: row.key,
51
74
  row,
52
- components: mergedComponents.value
53
- }, null, 8, ["row", "components"]);
75
+ internalTableComponents: tableComponents.value,
76
+ components: __props.components
77
+ }, null, 8, [
78
+ "row",
79
+ "internalTableComponents",
80
+ "components"
81
+ ]);
54
82
  }), 128))]),
55
83
  _: 1
56
- }, 8, ["body"]))]),
84
+ }, 16, ["body"]))]),
57
85
  _: 1
58
86
  }, 16, ["table"])) : __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 })) : (0, vue.createCommentVNode)("v-if", true);
59
87
  };
@@ -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 * 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"}
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 { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, 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\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,6DAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,0CAA6D;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;yBAKO,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,gBAAA,MAAgB,MAAM,GAAE,sBA+BlB;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;oCAe3C,CAZL,QAAA,MAAM,oFACP,gBAAA,MAAgB,MAAM,GAAE,sBAWlB;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;gJAIT,gBAAA,MAAgB,MAAM,GAAE,sBAWlB,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,wFAAe,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { isVueComponent } from "../types.js";
1
2
  import { defaultTableComponents } from "./PrismicTableDefaultComponents.js";
2
3
  import PrismicTableRow_default from "./PrismicTableRow.js";
3
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, unref, withCtx } from "vue";
@@ -23,37 +24,64 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
23
24
  },
24
25
  setup(__props) {
25
26
  const props = __props;
26
- const mergedComponents = computed(() => ({
27
- ...defaultTableComponents,
28
- ...props.components
29
- }));
27
+ function getInternalComponent(type) {
28
+ const maybeComponentOrShorthand = props.components?.[type];
29
+ if (isVueComponent(maybeComponentOrShorthand)) return { is: maybeComponentOrShorthand };
30
+ return {
31
+ is: defaultTableComponents[type],
32
+ shorthand: maybeComponentOrShorthand
33
+ };
34
+ }
35
+ const tableComponents = computed(() => {
36
+ return {
37
+ table: getInternalComponent("table"),
38
+ thead: getInternalComponent("thead"),
39
+ tbody: getInternalComponent("tbody"),
40
+ tr: getInternalComponent("tr"),
41
+ th: getInternalComponent("th"),
42
+ td: getInternalComponent("td")
43
+ };
44
+ });
30
45
  return (_ctx, _cache) => {
31
- return unref(isFilled).table(__props.field) ? (openBlock(), createBlock(resolveDynamicComponent(mergedComponents.value.table), mergeProps({
46
+ return unref(isFilled).table(__props.field) ? (openBlock(), createBlock(resolveDynamicComponent(tableComponents.value.table.is), mergeProps({
32
47
  key: 0,
33
48
  table: __props.field
34
- }, _ctx.$attrs), {
35
- default: withCtx(() => [__props.field.head ? (openBlock(), createBlock(resolveDynamicComponent(mergedComponents.value.thead), {
49
+ }, {
50
+ ..._ctx.$attrs,
51
+ ...tableComponents.value.table.shorthand
52
+ }), {
53
+ default: withCtx(() => [__props.field.head ? (openBlock(), createBlock(resolveDynamicComponent(tableComponents.value.thead.is), mergeProps({
36
54
  key: 0,
37
55
  head: __props.field.head
38
- }, {
56
+ }, tableComponents.value.thead.shorthand), {
39
57
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.field.head.rows, (row) => {
40
58
  return openBlock(), createBlock(PrismicTableRow_default, {
41
59
  key: row.key,
42
60
  row,
43
- components: mergedComponents.value
44
- }, null, 8, ["row", "components"]);
61
+ internalTableComponents: tableComponents.value,
62
+ components: __props.components
63
+ }, null, 8, [
64
+ "row",
65
+ "internalTableComponents",
66
+ "components"
67
+ ]);
45
68
  }), 128))]),
46
69
  _: 1
47
- }, 8, ["head"])) : createCommentVNode("v-if", true), (openBlock(), createBlock(resolveDynamicComponent(mergedComponents.value.tbody), { body: __props.field.body }, {
70
+ }, 16, ["head"])) : createCommentVNode("v-if", true), (openBlock(), createBlock(resolveDynamicComponent(tableComponents.value.tbody.is), mergeProps({ body: __props.field.body }, tableComponents.value.tbody.shorthand), {
48
71
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.field.body.rows, (row) => {
49
72
  return openBlock(), createBlock(PrismicTableRow_default, {
50
73
  key: row.key,
51
74
  row,
52
- components: mergedComponents.value
53
- }, null, 8, ["row", "components"]);
75
+ internalTableComponents: tableComponents.value,
76
+ components: __props.components
77
+ }, null, 8, [
78
+ "row",
79
+ "internalTableComponents",
80
+ "components"
81
+ ]);
54
82
  }), 128))]),
55
83
  _: 1
56
- }, 8, ["body"]))]),
84
+ }, 16, ["body"]))]),
57
85
  _: 1
58
86
  }, 16, ["table"])) : __props.fallback ? (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), { key: 1 })) : createCommentVNode("v-if", true);
59
87
  };
@@ -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 * 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"}
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 { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, 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\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\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:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,eAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,uBAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,kBAAkB,eAA2C;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;UAKO,MAAA,SAAQ,CAAC,MAAM,QAAA,MAAK,iBAD3B,YAiCY,wBA/BN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAiCY;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;2BAe3C,CAZL,QAAA,MAAM,qBADb,YAaY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAaY;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;wEAGf,YAYY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAD9B,WAYY,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,yBAAtB,YAAiD,wBAAZ,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"PrismicTableDefaultComponents.cjs","names":["defaultTableComponents: DefaultVueTableComponents"],"sources":["../../../src/PrismicTable/PrismicTableDefaultComponents.ts"],"sourcesContent":["import { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { DefaultVueTableComponents } from \"./types\"\n\nimport * as getTableComponentProps from \"./getTableComponentProps\"\n\nexport const defaultTableComponents: DefaultVueTableComponents = {\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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(props.as ?? \"td\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n}\n"],"mappings":";;;;AAOA,MAAaA,yBAAoD;CAChE,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTableDefaultComponents.js","names":["defaultTableComponents: InternalVueTableComponents","getTableComponentProps.table","getTableComponentProps.thead","getTableComponentProps.tbody","getTableComponentProps.tr","getTableComponentProps.th","getTableComponentProps.td"],"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,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBAAa,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAEjF,CAAC;CACF,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBAAa,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAEjF,CAAC;CACF,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBAAa,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAEjF,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBAAa,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAE9E,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBAAa,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAE9E,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBAAa,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAE9E,CAAC;CACF"}
1
+ {"version":3,"file":"PrismicTableDefaultComponents.js","names":["defaultTableComponents: DefaultVueTableComponents","getTableComponentProps.table","getTableComponentProps.thead","getTableComponentProps.tbody","getTableComponentProps.tr","getTableComponentProps.th","getTableComponentProps.td"],"sources":["../../../src/PrismicTable/PrismicTableDefaultComponents.ts"],"sourcesContent":["import { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { DefaultVueTableComponents } from \"./types\"\n\nimport * as getTableComponentProps from \"./getTableComponentProps\"\n\nexport const defaultTableComponents: DefaultVueTableComponents = {\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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(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 () =>\n\t\t\t\th(props.as ?? \"td\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n}\n"],"mappings":";;;;AAOA,MAAaA,yBAAoD;CAChE,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTableRow.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\n/**\n * Props for `<PrismicRowTable />`.\n */\nexport type PrismicTableRowProps = {\n\t/**\n\t * The Prismic table row to render.\n\t */\n\trow: TableFieldHeadRow | TableFieldBodyRow\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 * tr: TableRow,\n\t * }\n\t * ```\n\t */\n\tcomponents: VueTableComponents & VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component :is=\"props.components.tr\" :row=\"row\">\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"props.components.th\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component v-else :is=\"props.components.td\" :cell=\"cell\">\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"props.components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicTableRow.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTableRow.js","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\n/**\n * Props for `<PrismicRowTable />`.\n */\nexport type PrismicTableRowProps = {\n\t/**\n\t * The Prismic table row to render.\n\t */\n\trow: TableFieldHeadRow | TableFieldBodyRow\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 * tr: TableRow,\n\t * }\n\t * ```\n\t */\n\tcomponents: VueTableComponents & VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component :is=\"props.components.tr\" :row=\"row\">\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"props.components.th\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component v-else :is=\"props.components.td\" :cell=\"cell\">\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"props.components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicTableRow.js","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":""}
@@ -10,38 +10,41 @@ var PrismicTableRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
10
10
  type: Object,
11
11
  required: true
12
12
  },
13
- components: {
13
+ internalTableComponents: {
14
14
  type: Object,
15
15
  required: true
16
+ },
17
+ components: {
18
+ type: Object,
19
+ required: false
16
20
  }
17
21
  },
18
22
  setup(__props) {
19
- const props = __props;
20
23
  return (_ctx, _cache) => {
21
- return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.components.tr), { row: __props.row }, {
24
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.internalTableComponents.tr.is), (0, vue.mergeProps)({ row: __props.row }, __props.internalTableComponents.tr.shorthand), {
22
25
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.row.cells, (cell) => {
23
- return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: cell.key }, [cell.type === "header" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.components.th), {
26
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: cell.key }, [cell.type === "header" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.internalTableComponents.th.is), (0, vue.mergeProps)({
24
27
  key: 0,
25
28
  cell
26
- }, {
29
+ }, { ref_for: true }, __props.internalTableComponents.th.shorthand), {
27
30
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_PrismicRichText.default, {
28
31
  field: cell.content,
29
32
  components: __props.components
30
33
  }, null, 8, ["field", "components"])]),
31
34
  _: 2
32
- }, 1032, ["cell"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.components.td), {
35
+ }, 1040, ["cell"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.internalTableComponents.td.is), (0, vue.mergeProps)({
33
36
  key: 1,
34
37
  cell
35
- }, {
38
+ }, { ref_for: true }, __props.internalTableComponents.td.shorthand), {
36
39
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_PrismicRichText.default, {
37
40
  field: cell.content,
38
- components: props.components
41
+ components: __props.components
39
42
  }, null, 8, ["field", "components"])]),
40
43
  _: 2
41
- }, 1032, ["cell"]))], 64);
44
+ }, 1040, ["cell"]))], 64);
42
45
  }), 128))]),
43
46
  _: 1
44
- }, 8, ["row"]);
47
+ }, 16, ["row"]);
45
48
  };
46
49
  }
47
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\n/**\n * Props for `<PrismicRowTable />`.\n */\nexport type PrismicTableRowProps = {\n\t/**\n\t * The Prismic table row to render.\n\t */\n\trow: TableFieldHeadRow | TableFieldBodyRow\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 * tr: TableRow,\n\t * }\n\t * ```\n\t */\n\tcomponents: VueTableComponents & VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component :is=\"props.components.tr\" :row=\"row\">\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"props.components.th\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component v-else :is=\"props.components.td\" :cell=\"cell\">\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"props.components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA+BA,MAAM,QAAQ;;sFAKG,MAAM,WAAW,GAAE,EAAA,EAAG,KAAK,QAAA,KAAG,EAAA;oCACV,wDAWxB,cAAA,0BAXc,QAAA,IAAI,QAAZ,SAAI;mFAAqB,KAAK,QAEvC,KAAK,SAAI,wFACV,MAAM,WAAW,GAAE,EAAA;;MACjB;;sCAE2D,sBAAA,iCAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;wGAE9B,MAAM,WAAW,GAAE,EAAA;;MAAS;;sCACsB,sBAAA,iCAAA;OAAtD,OAAO,KAAK;OAAU,YAAY,MAAM"}
1
+ {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;sFAoBO,QAAA,wBAAwB,GAAG,GAAE,sBAsBvB,EArBV,KAAK,QAAA,KAAG,EACD,QAAA,wBAAwB,GAAG,UAAS,EAAA;oCAET,wDAiBxB,cAAA,0BAjBc,QAAA,IAAI,QAAZ,SAAI;mFAAqB,KAAK,QAEvC,KAAK,SAAI,wFACV,QAAA,wBAAwB,GAAG,GAAE,sBAKvB;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;sCAEsB,sBAAA,iCAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;wGAI/C,QAAA,wBAAwB,GAAG,GAAE,sBAKvB;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;sCAEsB,sBAAA,iCAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA"}