@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,5 +1,5 @@
1
1
  import PrismicRichText_default from "../PrismicRichText/PrismicRichText.js";
2
- import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, openBlock, renderList, resolveDynamicComponent, withCtx } from "vue";
2
+ import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, withCtx } from "vue";
3
3
 
4
4
  //#region src/PrismicTable/PrismicTableRow.vue?vue&type=script&setup=true&lang.ts
5
5
  var PrismicTableRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -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 openBlock(), createBlock(resolveDynamicComponent(props.components.tr), { row: __props.row }, {
24
+ return openBlock(), createBlock(resolveDynamicComponent(__props.internalTableComponents.tr.is), mergeProps({ row: __props.row }, __props.internalTableComponents.tr.shorthand), {
22
25
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row.cells, (cell) => {
23
- return openBlock(), createElementBlock(Fragment, { key: cell.key }, [cell.type === "header" ? (openBlock(), createBlock(resolveDynamicComponent(props.components.th), {
26
+ return openBlock(), createElementBlock(Fragment, { key: cell.key }, [cell.type === "header" ? (openBlock(), createBlock(resolveDynamicComponent(__props.internalTableComponents.th.is), mergeProps({
24
27
  key: 0,
25
28
  cell
26
- }, {
29
+ }, { ref_for: true }, __props.internalTableComponents.th.shorthand), {
27
30
  default: withCtx(() => [createVNode(PrismicRichText_default, {
28
31
  field: cell.content,
29
32
  components: __props.components
30
33
  }, null, 8, ["field", "components"])]),
31
34
  _: 2
32
- }, 1032, ["cell"])) : (openBlock(), createBlock(resolveDynamicComponent(props.components.td), {
35
+ }, 1040, ["cell"])) : (openBlock(), createBlock(resolveDynamicComponent(__props.internalTableComponents.td.is), mergeProps({
33
36
  key: 1,
34
37
  cell
35
- }, {
38
+ }, { ref_for: true }, __props.internalTableComponents.td.shorthand), {
36
39
  default: withCtx(() => [createVNode(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.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":";;;;;;;;;;;;;;;;;;EA+BA,MAAM,QAAQ;;uBAKb,YAaY,wBAbI,MAAM,WAAW,GAAE,EAAA,EAAG,KAAK,QAAA,KAAG,EAAA;2BACV,mBAAnC,mBAWW,UAAA,MAAA,WAXc,QAAA,IAAI,QAAZ,SAAI;6DAAqB,KAAK,QAEvC,KAAK,SAAI,yBADhB,YAMY,wBAJN,MAAM,WAAW,GAAE,EAAA;;MACjB;;6BAE2D,CAAlE,YAAkE,yBAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;yCAErD,YAEY,wBAFW,MAAM,WAAW,GAAE,EAAA;;MAAS;;6BACsB,CAAxE,YAAwE,yBAAA;OAAtD,OAAO,KAAK;OAAU,YAAY,MAAM"}
1
+ {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.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":";;;;;;;;;;;;;;;;;;;;;;;uBAmBC,YAuBY,wBAtBN,QAAA,wBAAwB,GAAG,GAAE,EADnC,WAuBY,EArBV,KAAK,QAAA,KAAG,EACD,QAAA,wBAAwB,GAAG,UAAS,EAAA;2BAET,mBAAnC,mBAiBW,UAAA,MAAA,WAjBc,QAAA,IAAI,QAAZ,SAAI;6DAAqB,KAAK,QAEvC,KAAK,SAAI,yBADhB,YAOY,wBALN,QAAA,wBAAwB,GAAG,GAAE,EAFnC,WAOY;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;6BAEsB,CAAlE,YAAkE,yBAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;yCAErD,YAOY,wBALN,QAAA,wBAAwB,GAAG,GAAE,EAFnC,WAOY;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;6BAEsB,CAAlE,YAAkE,yBAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA"}
@@ -1,5 +1,5 @@
1
+ import { VueComponent } from "../types.js";
1
2
  import { VueShorthand } from "../PrismicRichText/types.js";
2
- import { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
3
3
  import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, TableFieldHead, TableFieldHeadRow, TableFieldHeaderCell } from "@prismicio/client";
4
4
 
5
5
  //#region src/PrismicTable/types.d.ts
@@ -30,7 +30,6 @@ type VueTableComponents = {
30
30
  cell: TableFieldDataCell;
31
31
  }> | VueShorthand;
32
32
  };
33
- type VueComponent<TProps> = ReturnType<typeof defineAsyncComponent> | DefineComponent<TProps> | FunctionalComponent<TProps>;
34
33
  //#endregion
35
34
  export { VueTableComponents };
36
35
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAsBA;;;;AAE8B,KAFlB,kBAAA,GAEkB;EAArB,KAAA,CAAA,EADA,YACA,CAAA;IAAyC,KAAA,EADnB,UACmB,CAAA,QAAA,CAAA;EACpB,CAAA,CAAA,GAF2B,YAE3B;EAArB,KAAA,CAAA,EADA,YACA,CAAA;IAAyC,IAAA,EADpB,cACoB;EACxB,CAAA,CAAA,GAFwB,YAExB;EAAoB,KAAA,CAAA,EADrC,YACqC,CAAA;IAAxC,IAAA,EADwB,cACxB;EAA+D,CAAA,CAAA,GADnB,YACmB;EAC1C,EAAA,CAAA,EADrB,YACqB,CAAA;IAArB,GAAA,EADoB,iBACpB,GADwC,iBACxC;EAA+C,CAAA,CAAA,GADgB,YAChB;EAC1B,EAAA,CAAA,EADrB,YACqB,CAAA;IAArB,IAAA,EADqB,oBACrB;EAA6C,CAAA,CAAA,GADE,YACF;EAAY,EAAA,CAAA,EAAzD,YAAyD,CAAA;IAY1D,IAAA,EAZsB,kBAYV;EACI,CAAA,CAAA,GAb8B,YAa9B;CAAlB;KADE,uBACF,kBAAkB,wBAClB,gBAAgB,UAChB,oBAAoB"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAmBA;;;;AAE8B,KAFlB,kBAAA,GAEkB;EAArB,KAAA,CAAA,EADA,YACA,CAAA;IAAyC,KAAA,EADnB,UACmB,CAAA,QAAA,CAAA;EACpB,CAAA,CAAA,GAF2B,YAE3B;EAArB,KAAA,CAAA,EADA,YACA,CAAA;IAAyC,IAAA,EADpB,cACoB;EAE1B,CAAA,CAAA,GAH0B,YAG1B;EAAoB,KAAA,CAAA,EAFnC,YAEmC,CAAA;IAAxC,IAAA,EAF0B,cAE1B;EACA,CAAA,CAAA,GAH8C,YAG9C;EACuB,EAAA,CAAA,EAFvB,YAEuB,CAAA;IAArB,GAAA,EAFkB,iBAElB,GAFsC,iBAEtC;EAA+C,CAAA,CAAA,GADjD,YACiD;EAC1B,EAAA,CAAA,EADrB,YACqB,CAAA;IAArB,IAAA,EADqB,oBACrB;EAA6C,CAAA,CAAA,GADE,YACF;EAAY,EAAA,CAAA,EAAzD,YAAyD,CAAA;UAApC;OAAwB"}
@@ -1,4 +1,4 @@
1
- import * as vue9 from "vue";
1
+ import * as vue21 from "vue";
2
2
  import { RichTextField } from "@prismicio/client";
3
3
 
4
4
  //#region src/PrismicText.vue.d.ts
@@ -22,7 +22,7 @@ type PrismicTextProps = {
22
22
  */
23
23
  separator?: string;
24
24
  };
25
- declare const __VLS_export: vue9.DefineComponent<PrismicTextProps, {}, {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<PrismicTextProps> & Readonly<{}>, {}, {}, {}, {}, string, vue9.ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: vue21.DefineComponent<PrismicTextProps, {}, {}, {}, {}, vue21.ComponentOptionsMixin, vue21.ComponentOptionsMixin, {}, string, vue21.PublicProps, Readonly<PrismicTextProps> & Readonly<{}>, {}, {}, {}, {}, string, vue21.ComponentProvideOptions, false, {}, any>;
26
26
  declare const _default: typeof __VLS_export;
27
27
  //#endregion
28
28
  export { PrismicTextProps, _default };
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;AA8DY,KAAA,gBAAA,GAAgB;EAuDtB;;;EAAY,KAAA,EAnDV,aAmDU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;AAAA;;;;;cAAZ,cAAY,IAAA,CAAA,gBAAA,kCAAA,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,cAAA,IAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,IAAA,CAAA,uBAAA;cAAA,iBAGU"}
1
+ {"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;AA8DY,KAAA,gBAAA,GAAgB;EAuDtB;;;EAAY,KAAA,EAnDV,aAmDU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;AAAA;;;;;cAAZ,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
@@ -1,5 +1,5 @@
1
1
  import { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from "./types.js";
2
- import * as vue14 from "vue";
2
+ import * as vue26 from "vue";
3
3
 
4
4
  //#region src/SliceZone/SliceZone.vue.d.ts
5
5
 
@@ -33,7 +33,7 @@ type SliceZoneProps<TContext = unknown> = {
33
33
  context?: TContext;
34
34
  };
35
35
  type __VLS_Props = SliceZoneProps;
36
- declare const __VLS_export: vue14.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue14.ComponentOptionsMixin, vue14.ComponentOptionsMixin, {}, string, vue14.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue14.ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: vue26.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue26.ComponentOptionsMixin, vue26.ComponentOptionsMixin, {}, string, vue26.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue26.ComponentProvideOptions, false, {}, any>;
37
37
  declare const _default: typeof __VLS_export;
38
38
  //#endregion
39
39
  export { SliceZoneProps, _default };
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/types.ts
3
+ const isVueComponent = (component) => {
4
+ return !!component && (typeof component === "function" || typeof component === "object" && ("render" in component && typeof component.render === "function" || "setup" in component && typeof component.setup === "function" || "__file" in component && !!component.__file || "__name" in component && !!component.__name || "props" in component && typeof component.props === "object"));
5
+ };
6
+
7
+ //#endregion
8
+ exports.isVueComponent = isVueComponent;
9
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {\n\tConcreteComponent,\n\tDefineComponent,\n\tFunctionalComponent,\n\tRaw,\n\tdefineAsyncComponent,\n} from \"vue\"\n\nexport type ComponentOrTagName =\n\t| string\n\t| ConcreteComponent\n\t| Raw<DefineComponent>\n\nexport type VueComponent<TProps> =\n\t// For reference within TypeScript files when `*.vue` type cannot be inferred\n\t// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any\n\t| DefineComponent<{}, {}, any>\n\t// Likewise, for reference with TypeScript files.\n\t| ReturnType<typeof defineAsyncComponent>\n\t| DefineComponent<TProps>\n\t| FunctionalComponent<TProps>\n\nexport const isVueComponent = <T>(\n\tcomponent: VueComponent<T> | unknown,\n): component is VueComponent<T> => {\n\treturn (\n\t\t!!component &&\n\t\t(typeof component === \"function\" ||\n\t\t\t(typeof component === \"object\" &&\n\t\t\t\t((\"render\" in component && typeof component.render === \"function\") ||\n\t\t\t\t\t(\"setup\" in component && typeof component.setup === \"function\") ||\n\t\t\t\t\t(\"__file\" in component && !!component.__file) ||\n\t\t\t\t\t(\"__name\" in component && !!component.__name) ||\n\t\t\t\t\t(\"props\" in component && typeof component.props === \"object\"))))\n\t)\n}\n"],"mappings":";;AAsBA,MAAa,kBACZ,cACkC;AAClC,QACC,CAAC,CAAC,cACD,OAAO,cAAc,cACpB,OAAO,cAAc,aACnB,YAAY,aAAa,OAAO,UAAU,WAAW,cACrD,WAAW,aAAa,OAAO,UAAU,UAAU,cACnD,YAAY,aAAa,CAAC,CAAC,UAAU,UACrC,YAAY,aAAa,CAAC,CAAC,UAAU,UACrC,WAAW,aAAa,OAAO,UAAU,UAAU"}
@@ -1,7 +1,8 @@
1
- import { ConcreteComponent, DefineComponent, Raw } from "vue";
1
+ import { ConcreteComponent, DefineComponent, FunctionalComponent, Raw, defineAsyncComponent } from "vue";
2
2
 
3
3
  //#region src/types.d.ts
4
4
  type ComponentOrTagName = string | ConcreteComponent | Raw<DefineComponent>;
5
+ type VueComponent<TProps> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<TProps> | FunctionalComponent<TProps>;
5
6
  //#endregion
6
- export { ComponentOrTagName };
7
+ export { ComponentOrTagName, VueComponent };
7
8
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,kBAAA,YAET,oBACA,IAAI"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;KAQY,kBAAA,YAET,oBACA,IAAI;KAEK,uBAGT,+BAEA,kBAAkB,wBAClB,gBAAgB,UAChB,oBAAoB"}
@@ -0,0 +1,8 @@
1
+ //#region src/types.ts
2
+ const isVueComponent = (component) => {
3
+ return !!component && (typeof component === "function" || typeof component === "object" && ("render" in component && typeof component.render === "function" || "setup" in component && typeof component.setup === "function" || "__file" in component && !!component.__file || "__name" in component && !!component.__name || "props" in component && typeof component.props === "object"));
4
+ };
5
+
6
+ //#endregion
7
+ export { isVueComponent };
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {\n\tConcreteComponent,\n\tDefineComponent,\n\tFunctionalComponent,\n\tRaw,\n\tdefineAsyncComponent,\n} from \"vue\"\n\nexport type ComponentOrTagName =\n\t| string\n\t| ConcreteComponent\n\t| Raw<DefineComponent>\n\nexport type VueComponent<TProps> =\n\t// For reference within TypeScript files when `*.vue` type cannot be inferred\n\t// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any\n\t| DefineComponent<{}, {}, any>\n\t// Likewise, for reference with TypeScript files.\n\t| ReturnType<typeof defineAsyncComponent>\n\t| DefineComponent<TProps>\n\t| FunctionalComponent<TProps>\n\nexport const isVueComponent = <T>(\n\tcomponent: VueComponent<T> | unknown,\n): component is VueComponent<T> => {\n\treturn (\n\t\t!!component &&\n\t\t(typeof component === \"function\" ||\n\t\t\t(typeof component === \"object\" &&\n\t\t\t\t((\"render\" in component && typeof component.render === \"function\") ||\n\t\t\t\t\t(\"setup\" in component && typeof component.setup === \"function\") ||\n\t\t\t\t\t(\"__file\" in component && !!component.__file) ||\n\t\t\t\t\t(\"__name\" in component && !!component.__name) ||\n\t\t\t\t\t(\"props\" in component && typeof component.props === \"object\"))))\n\t)\n}\n"],"mappings":";AAsBA,MAAa,kBACZ,cACkC;AAClC,QACC,CAAC,CAAC,cACD,OAAO,cAAc,cACpB,OAAO,cAAc,aACnB,YAAY,aAAa,OAAO,UAAU,WAAW,cACrD,WAAW,aAAa,OAAO,UAAU,UAAU,cACnD,YAAY,aAAa,CAAC,CAAC,UAAU,UACrC,YAAY,aAAa,CAAC,CAAC,UAAU,UACrC,WAAW,aAAa,OAAO,UAAU,UAAU"}
package/dist/types.d.cts CHANGED
@@ -1,7 +1,8 @@
1
- import { ConcreteComponent, DefineComponent, Raw } from "vue";
1
+ import { ConcreteComponent, DefineComponent, FunctionalComponent, Raw, defineAsyncComponent } from "vue";
2
2
 
3
3
  //#region src/types.d.ts
4
4
  type ComponentOrTagName = string | ConcreteComponent | Raw<DefineComponent>;
5
+ type VueComponent<TProps> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<TProps> | FunctionalComponent<TProps>;
5
6
  //#endregion
6
- export { ComponentOrTagName };
7
+ export { ComponentOrTagName, VueComponent };
7
8
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,kBAAA,YAET,oBACA,IAAI"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;KAQY,kBAAA,YAET,oBACA,IAAI;KAEK,uBAGT,+BAEA,kBAAkB,wBAClB,gBAAgB,UAChB,oBAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/vue",
3
- "version": "5.3.0-pr.86.81afa1a",
3
+ "version": "5.3.0-pr.88.ee9acb6",
4
4
  "description": "Vue plugin, components, and composables to fetch and present Prismic content",
5
5
  "keywords": [
6
6
  "typescript",
@@ -1,15 +1,21 @@
1
1
  <script lang="ts" setup>
2
- import {
3
- type LinkResolverFunction,
4
- type RichTextField,
2
+ import type {
3
+ LinkResolverFunction,
4
+ RichTextField,
5
+ RichTextNodeType,
5
6
  } from "@prismicio/client"
6
7
  import { asTree } from "@prismicio/client/richtext"
7
8
  import type { PropType } from "vue"
8
9
  import { computed } from "vue"
9
10
 
10
- import type { ComponentOrTagName } from "../types"
11
- import type { VueRichTextSerializer } from "./types"
11
+ import { type ComponentOrTagName, isVueComponent } from "../types"
12
+ import type {
13
+ InternalVueRichTextComponent,
14
+ VueRichTextSerializer,
15
+ VueShorthand,
16
+ } from "./types"
12
17
 
18
+ import PrismicRichTextDefaultComponent from "./PrismicRichTextDefaultComponent.vue"
13
19
  import PrismicRichTextSerialize from "./PrismicRichTextSerialize.vue"
14
20
 
15
21
  /**
@@ -21,19 +27,6 @@ export type PrismicRichTextProps = {
21
27
  */
22
28
  field: RichTextField | null | undefined
23
29
 
24
- /**
25
- * An object that maps a rich text block type to a Vue component.
26
- *
27
- * @example
28
- *
29
- * ```javascript
30
- * {
31
- * heading1: Heading1,
32
- * }
33
- * ```
34
- */
35
- components?: VueRichTextSerializer
36
-
37
30
  /**
38
31
  * A link resolver function used to resolve link when not using the route
39
32
  * resolver parameter with `@prismicio/client`.
@@ -45,18 +38,17 @@ export type PrismicRichTextProps = {
45
38
  linkResolver?: LinkResolverFunction
46
39
 
47
40
  /**
48
- * The Vue component rendered for links when the URL is internal.
41
+ * An object that maps a rich text block type to a Vue component.
49
42
  *
50
- * @defaultValue `<RouterLink>`
51
- */
52
- internalLinkComponent?: ComponentOrTagName
53
-
54
- /**
55
- * The Vue component rendered for links when the URL is external.
43
+ * @example
56
44
  *
57
- * @defaultValue `<a>`
45
+ * ```javascript
46
+ * {
47
+ * heading1: Heading1,
48
+ * }
49
+ * ```
58
50
  */
59
- externalLinkComponent?: ComponentOrTagName
51
+ components?: VueRichTextSerializer
60
52
 
61
53
  /**
62
54
  * The value to be rendered when the field is empty. If a fallback is not
@@ -71,21 +63,11 @@ const props = defineProps({
71
63
  field: {
72
64
  type: Array as unknown as PropType<PrismicRichTextProps["field"]>,
73
65
  },
74
- components: {
75
- type: Object as PropType<PrismicRichTextProps["components"]>,
76
- },
77
66
  linkResolver: {
78
67
  type: Function as PropType<PrismicRichTextProps["linkResolver"]>,
79
68
  },
80
- internalLinkComponent: {
81
- type: [String, Object, Function] as PropType<
82
- PrismicRichTextProps["internalLinkComponent"]
83
- >,
84
- },
85
- externalLinkComponent: {
86
- type: [String, Object, Function] as PropType<
87
- PrismicRichTextProps["externalLinkComponent"]
88
- >,
69
+ components: {
70
+ type: Object as PropType<PrismicRichTextProps["components"]>,
89
71
  },
90
72
  fallback: {
91
73
  type: [String, Object, Function] as PropType<
@@ -98,16 +80,53 @@ defineOptions({ name: "PrismicRichText" })
98
80
  const children = computed(() => {
99
81
  return asTree(props.field || []).children
100
82
  })
83
+
84
+ function getInternalComponent(type: keyof typeof RichTextNodeType) {
85
+ const maybeComponentOrShorthand = props.components?.[type]
86
+
87
+ if (isVueComponent(maybeComponentOrShorthand)) {
88
+ return { is: maybeComponentOrShorthand }
89
+ }
90
+
91
+ return {
92
+ is: PrismicRichTextDefaultComponent,
93
+ props: {
94
+ linkResolver: props.linkResolver,
95
+ shorthand: maybeComponentOrShorthand as VueShorthand,
96
+ },
97
+ }
98
+ }
99
+
100
+ const internalComponents = computed<InternalVueRichTextComponent>(() => {
101
+ return {
102
+ heading1: getInternalComponent("heading1"),
103
+ heading2: getInternalComponent("heading2"),
104
+ heading3: getInternalComponent("heading3"),
105
+ heading4: getInternalComponent("heading4"),
106
+ heading5: getInternalComponent("heading5"),
107
+ heading6: getInternalComponent("heading6"),
108
+ paragraph: getInternalComponent("paragraph"),
109
+ preformatted: getInternalComponent("preformatted"),
110
+ strong: getInternalComponent("strong"),
111
+ em: getInternalComponent("em"),
112
+ "list-item": getInternalComponent("listItem"),
113
+ "o-list-item": getInternalComponent("oListItem"),
114
+ "group-list-item": getInternalComponent("list"),
115
+ "group-o-list-item": getInternalComponent("oList"),
116
+ image: getInternalComponent("image"),
117
+ embed: getInternalComponent("embed"),
118
+ hyperlink: getInternalComponent("hyperlink"),
119
+ label: getInternalComponent("label"),
120
+ span: getInternalComponent("span"),
121
+ }
122
+ })
101
123
  </script>
102
124
 
103
125
  <template>
104
126
  <PrismicRichTextSerialize
105
127
  v-if="children.length"
106
128
  :children="children"
107
- :components="components"
108
- :link-resolver="linkResolver"
109
- :internal-link-component="internalLinkComponent"
110
- :external-link-component="externalLinkComponent"
129
+ :internal-components="internalComponents"
111
130
  />
112
131
  <component v-else-if="fallback" :is="fallback" />
113
132
  </template>
@@ -2,7 +2,6 @@
2
2
  import type { LinkResolverFunction } from "@prismicio/client"
3
3
  import { computed } from "vue"
4
4
 
5
- import type { ComponentOrTagName } from "../types"
6
5
  import type { RichTextComponentProps, VueShorthand } from "./types"
7
6
 
8
7
  import PrismicImage from "../PrismicImage.vue"
@@ -11,19 +10,21 @@ import PrismicLink from "../PrismicLink.vue"
11
10
  const props = defineProps<
12
11
  RichTextComponentProps & {
13
12
  linkResolver?: LinkResolverFunction
14
- internalLinkComponent?: ComponentOrTagName
15
- externalLinkComponent?: ComponentOrTagName
16
13
  shorthand?: VueShorthand
17
14
  }
18
15
  >()
19
16
  defineOptions({ name: "PrismicRichTextDefaultComponent" })
20
17
 
21
18
  const as = computed(() => {
22
- return props.node.type !== "image" && props.node.type !== "span" ? props.shorthand?.as : undefined
19
+ return props.node.type !== "image" && props.node.type !== "span"
20
+ ? props.shorthand?.as
21
+ : undefined
23
22
  })
24
23
 
25
24
  const attrs = computed(() => {
26
- return props.shorthand?.attrs ?? {}
25
+ const { as, ...attrs } = props.shorthand ?? {}
26
+
27
+ return attrs
27
28
  })
28
29
 
29
30
  const dir = computed(() => {
@@ -35,18 +36,36 @@ const dir = computed(() => {
35
36
 
36
37
  <template>
37
38
  <component v-if="as" :is="as" :dir="dir" v-bind="attrs"><slot /></component>
38
- <h1 v-else-if="node.type === 'heading1'" :dir="dir" v-bind="attrs"><slot /></h1>
39
- <h2 v-else-if="node.type === 'heading2'" :dir="dir" v-bind="attrs"><slot /></h2>
40
- <h3 v-else-if="node.type === 'heading3'" :dir="dir" v-bind="attrs"><slot /></h3>
41
- <h4 v-else-if="node.type === 'heading4'" :dir="dir" v-bind="attrs"><slot /></h4>
42
- <h5 v-else-if="node.type === 'heading5'" :dir="dir" v-bind="attrs"><slot /></h5>
43
- <h6 v-else-if="node.type === 'heading6'" :dir="dir" v-bind="attrs"><slot /></h6>
44
- <p v-else-if="node.type === 'paragraph'" :dir="dir" v-bind="attrs"><slot /></p>
39
+ <h1 v-else-if="node.type === 'heading1'" :dir="dir" v-bind="attrs">
40
+ <slot />
41
+ </h1>
42
+ <h2 v-else-if="node.type === 'heading2'" :dir="dir" v-bind="attrs">
43
+ <slot />
44
+ </h2>
45
+ <h3 v-else-if="node.type === 'heading3'" :dir="dir" v-bind="attrs">
46
+ <slot />
47
+ </h3>
48
+ <h4 v-else-if="node.type === 'heading4'" :dir="dir" v-bind="attrs">
49
+ <slot />
50
+ </h4>
51
+ <h5 v-else-if="node.type === 'heading5'" :dir="dir" v-bind="attrs">
52
+ <slot />
53
+ </h5>
54
+ <h6 v-else-if="node.type === 'heading6'" :dir="dir" v-bind="attrs">
55
+ <slot />
56
+ </h6>
57
+ <p v-else-if="node.type === 'paragraph'" :dir="dir" v-bind="attrs">
58
+ <slot />
59
+ </p>
45
60
  <pre v-else-if="node.type === 'preformatted'" v-bind="attrs"><slot /></pre>
46
61
  <strong v-else-if="node.type === 'strong'" v-bind="attrs"><slot /></strong>
47
62
  <em v-else-if="node.type === 'em'" v-bind="attrs"><slot /></em>
48
- <li v-else-if="node.type === 'list-item'" :dir="dir" v-bind="attrs"><slot /></li>
49
- <li v-else-if="node.type === 'o-list-item'" :dir="dir" v-bind="attrs"><slot /></li>
63
+ <li v-else-if="node.type === 'list-item'" :dir="dir" v-bind="attrs">
64
+ <slot />
65
+ </li>
66
+ <li v-else-if="node.type === 'o-list-item'" :dir="dir" v-bind="attrs">
67
+ <slot />
68
+ </li>
50
69
  <ul v-else-if="node.type === 'group-list-item'" v-bind="attrs">
51
70
  <slot />
52
71
  </ul>
@@ -54,11 +73,7 @@ const dir = computed(() => {
54
73
  <slot />
55
74
  </ol>
56
75
  <p class="block-img" v-else-if="node.type === 'image'">
57
- <PrismicLink
58
- v-if="node.linkTo"
59
- :field="node.linkTo"
60
- :internal-component="internalLinkComponent"
61
- :external-component="externalLinkComponent"
76
+ <PrismicLink v-if="node.linkTo" :field="node.linkTo"
62
77
  ><PrismicImage :field="node"
63
78
  /></PrismicLink>
64
79
  <PrismicImage v-else :field="node" v-bind="attrs" />
@@ -75,12 +90,13 @@ const dir = computed(() => {
75
90
  v-else-if="node.type === 'hyperlink'"
76
91
  :field="node.data"
77
92
  :link-resolver="linkResolver"
78
- :internal-component="internalLinkComponent"
79
- :external-component="externalLinkComponent"
80
93
  v-bind="attrs"
81
94
  ><slot
82
95
  /></PrismicLink>
83
- <span v-else-if="node.type === 'label'" :class="node.data.label" v-bind="attrs"
96
+ <span
97
+ v-else-if="node.type === 'label'"
98
+ :class="node.data.label"
99
+ v-bind="attrs"
84
100
  ><slot
85
101
  /></span>
86
102
  <template v-else v-for="(line, index) in node.text.split('\n')" :key="line"
@@ -1,73 +1,27 @@
1
1
  <script lang="ts" setup>
2
- import type { LinkResolverFunction } from "@prismicio/client"
3
2
  import type { asTree } from "@prismicio/client/richtext"
4
3
 
5
- import type { ComponentOrTagName } from "../types"
6
- import type { VueRichTextSerializer, VueShorthand } from "./types"
7
-
8
- import PrismicRichTextDefaultComponent from "./PrismicRichTextDefaultComponent.vue"
9
-
10
- const CHILD_TYPE_RENAMES = {
11
- "list-item": "listItem",
12
- "o-list-item": "oListItem",
13
- "group-list-item": "list",
14
- "group-o-list-item": "oList",
15
- } as const
4
+ import type { InternalVueRichTextComponent } from "./types"
16
5
 
17
6
  type PrismicRichTextSerializeProps = {
18
- components?: VueRichTextSerializer
19
7
  children: ReturnType<typeof asTree>["children"]
20
- linkResolver?: LinkResolverFunction
21
- internalLinkComponent?: ComponentOrTagName
22
- externalLinkComponent?: ComponentOrTagName
8
+ internalComponents: InternalVueRichTextComponent
23
9
  }
24
10
 
25
11
  const props = defineProps<PrismicRichTextSerializeProps>()
26
12
  defineOptions({ name: "PrismicRichTextSerialize" })
27
-
28
- function getComponent(child: ReturnType<typeof asTree>["children"][number]) {
29
- const maybeComponentOrShorthand =
30
- props.components?.[
31
- CHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||
32
- (child.type as keyof typeof props.components)
33
- ]
34
-
35
- if (
36
- typeof maybeComponentOrShorthand === "function" ||
37
- (typeof maybeComponentOrShorthand === "object" &&
38
- (typeof maybeComponentOrShorthand.render === "function" ||
39
- typeof maybeComponentOrShorthand.setup === "function" ||
40
- !!maybeComponentOrShorthand.__file ||
41
- !!maybeComponentOrShorthand.__name))
42
- ) {
43
- return { is: maybeComponentOrShorthand }
44
- }
45
-
46
- return {
47
- is: PrismicRichTextDefaultComponent,
48
- props: {
49
- linkResolver: props.linkResolver,
50
- internalLinkComponent: props.internalLinkComponent,
51
- externalLinkComponent: props.externalLinkComponent,
52
- shorthand: maybeComponentOrShorthand,
53
- },
54
- }
55
- }
56
13
  </script>
57
14
 
58
15
  <template>
59
16
  <component
60
17
  v-for="child in props.children"
61
18
  :key="JSON.stringify(child)"
62
- :is="getComponent(child).is"
19
+ :is="internalComponents[child.type].is"
63
20
  :node="child.node"
64
- v-bind="getComponent(child).props"
21
+ v-bind="internalComponents[child.type].props"
65
22
  ><PrismicRichTextSerialize
66
23
  v-if="child.children.length"
67
24
  :children="child.children"
68
- :components="components"
69
- :link-resolver="linkResolver"
70
- :internal-link-component="internalLinkComponent"
71
- :external-link-component="externalLinkComponent"
25
+ :internal-components="internalComponents"
72
26
  /></component>
73
27
  </template>
@@ -1,9 +1,10 @@
1
- import type { RTAnyNode, RichTextNodeType } from "@prismicio/client"
2
1
  import type {
3
- DefineComponent,
4
- FunctionalComponent,
5
- defineAsyncComponent,
6
- } from "vue"
2
+ LinkResolverFunction,
3
+ RTAnyNode,
4
+ RichTextNodeType,
5
+ } from "@prismicio/client"
6
+
7
+ import type { VueComponent } from "../types"
7
8
 
8
9
  /**
9
10
  * A map of Rich Text block types to Vue Components. It is used to render Rich
@@ -27,14 +28,9 @@ export type RichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {
27
28
  *
28
29
  * @typeParam TRTNode - The type of rich text node(s) this component handles
29
30
  */
30
- type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> =
31
- // For reference within TypeScript files when `*.vue` type cannot be inferred
32
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any
33
- | DefineComponent<{}, {}, any>
34
- // Likewise, for reference with TypeScript files.
35
- | ReturnType<typeof defineAsyncComponent>
36
- | DefineComponent<RichTextComponentProps<TRTNode>>
37
- | FunctionalComponent<RichTextComponentProps<TRTNode>>
31
+ type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = VueComponent<
32
+ RichTextComponentProps<TRTNode>
33
+ >
38
34
 
39
35
  /**
40
36
  * A shorthand definition for {@link VueRichTextSerializer} component types.
@@ -50,3 +46,11 @@ export type VueShorthand = {
50
46
  */
51
47
  [Attribute: string]: string | boolean | null | undefined
52
48
  }
49
+
50
+ export type InternalVueRichTextComponent = Record<
51
+ (typeof RichTextNodeType)[keyof typeof RichTextNodeType],
52
+ {
53
+ is: VueRichTextComponent
54
+ props?: { linkResolver?: LinkResolverFunction; shorthand?: VueShorthand }
55
+ }
56
+ >