@prismicio/vue 5.0.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PrismicTable/PrismicTable.vue.cjs +62 -0
- package/dist/PrismicTable/PrismicTable.vue.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue.d.ts +32 -0
- package/dist/PrismicTable/PrismicTable.vue.js +63 -0
- package/dist/PrismicTable/PrismicTable.vue.js.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue2.cjs +4 -0
- package/dist/PrismicTable/PrismicTable.vue2.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue2.js +5 -0
- package/dist/PrismicTable/PrismicTable.vue2.js.map +1 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs +44 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.d.ts +2 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.js +44 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue.cjs +52 -0
- package/dist/PrismicTable/PrismicTableRow.vue.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue.d.ts +26 -0
- package/dist/PrismicTable/PrismicTableRow.vue.js +53 -0
- package/dist/PrismicTable/PrismicTableRow.vue.js.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue2.cjs +4 -0
- package/dist/PrismicTable/PrismicTableRow.vue2.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue2.js +5 -0
- package/dist/PrismicTable/PrismicTableRow.vue2.js.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.cjs +30 -0
- package/dist/PrismicTable/getTableComponentProps.cjs.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.d.ts +128 -0
- package/dist/PrismicTable/getTableComponentProps.js +30 -0
- package/dist/PrismicTable/getTableComponentProps.js.map +1 -0
- package/dist/PrismicTable/index.d.ts +1 -0
- package/dist/PrismicTable/types.d.ts +30 -0
- package/dist/createPrismic.cjs +2 -0
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.js +5 -3
- package/dist/createPrismic.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +3 -3
- package/src/PrismicTable/PrismicTable.vue +80 -0
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +44 -0
- package/src/PrismicTable/PrismicTableRow.vue +51 -0
- package/src/PrismicTable/getTableComponentProps.ts +142 -0
- package/src/PrismicTable/index.ts +1 -0
- package/src/PrismicTable/types.ts +34 -0
- package/src/createPrismic.ts +2 -0
- package/src/index.ts +5 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const table = () => ({
|
|
2
|
+
table: { type: Object, required: true }
|
|
3
|
+
});
|
|
4
|
+
const thead = () => ({
|
|
5
|
+
head: { type: Object, required: true }
|
|
6
|
+
});
|
|
7
|
+
const tbody = () => ({
|
|
8
|
+
body: { type: Object, required: true }
|
|
9
|
+
});
|
|
10
|
+
const tr = () => ({
|
|
11
|
+
row: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const th = () => ({
|
|
17
|
+
cell: { type: Object, required: true }
|
|
18
|
+
});
|
|
19
|
+
const td = () => ({
|
|
20
|
+
cell: { type: Object, required: true }
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
table,
|
|
24
|
+
tbody,
|
|
25
|
+
td,
|
|
26
|
+
th,
|
|
27
|
+
thead,
|
|
28
|
+
tr
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=getTableComponentProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTableComponentProps.js","sources":["../../../src/PrismicTable/getTableComponentProps.ts"],"sourcesContent":["import type {\n\tTableField,\n\tTableFieldBody,\n\tTableFieldBodyRow,\n\tTableFieldDataCell,\n\tTableFieldHead,\n\tTableFieldHeadRow,\n\tTableFieldHeaderCell,\n} from \"@prismicio/client\"\nimport type { PropType } from \"vue\"\n\n/**\n * Gets native Vue props for a component rendering `table` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"table\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.table())\n * ```\n */\nexport const table = (): {\n\ttable: { type: PropType<TableField<\"filled\">>; required: true }\n} => ({\n\ttable: { type: Object as PropType<TableField<\"filled\">>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `thead` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"head\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.thead())\n * ```\n */\nexport const thead = (): {\n\thead: { type: PropType<TableFieldHead>; required: true }\n} => ({\n\thead: { type: Object as PropType<TableFieldHead>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `tbody` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"body\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.body())\n * ```\n */\nexport const tbody = (): {\n\tbody: { type: PropType<TableFieldBody>; required: true }\n} => ({\n\tbody: { type: Object as PropType<TableFieldBody>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `tr` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"row\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.tr())\n * ```\n */\nexport const tr = (): {\n\trow: {\n\t\ttype: PropType<TableFieldHeadRow | TableFieldBodyRow>\n\t\trequired: true\n\t}\n} => ({\n\trow: {\n\t\ttype: Object as PropType<TableFieldHeadRow | TableFieldBodyRow>,\n\t\trequired: true,\n\t},\n})\n\n/**\n * Gets native Vue props for a component rendering `th` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"cell\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.th())\n * ```\n */\nexport const th = (): {\n\tcell: { type: PropType<TableFieldHeaderCell>; required: true }\n} => ({\n\tcell: { type: Object as PropType<TableFieldHeaderCell>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `td` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"cell\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.td())\n * ```\n */\nexport const td = (): {\n\tcell: { type: PropType<TableFieldDataCell>; required: true }\n} => ({\n\tcell: { type: Object as PropType<TableFieldDataCell>, required: true },\n})\n"],"names":[],"mappings":"AA0BO,MAAM,QAAQ,OAEf;AAAA,EACL,OAAO,EAAE,MAAM,QAA0C,UAAU,KAAM;AACzE;AAiBM,MAAM,QAAQ,OAEf;AAAA,EACL,MAAM,EAAE,MAAM,QAAoC,UAAU,KAAM;AAClE;AAiBM,MAAM,QAAQ,OAEf;AAAA,EACL,MAAM,EAAE,MAAM,QAAoC,UAAU,KAAM;AAClE;AAiBM,MAAM,KAAK,OAKZ;AAAA,EACL,KAAK;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,EAAA;AAEX;AAiBM,MAAM,KAAK,OAEZ;AAAA,EACL,MAAM,EAAE,MAAM,QAA0C,UAAU,KAAM;AACxE;AAiBM,MAAM,KAAK,OAEZ;AAAA,EACL,MAAM,EAAE,MAAM,QAAwC,UAAU,KAAM;AACtE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as getTableComponentProps from "./getTableComponentProps";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, TableFieldHead, TableFieldHeadRow, TableFieldHeaderCell } from "@prismicio/client";
|
|
2
|
+
import type { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* A map of Table block types to Vue Components. It is used to render table
|
|
5
|
+
* fields.
|
|
6
|
+
*
|
|
7
|
+
* @see Templating Table fields from Prismic {@link https://prismic.io/docs/table}
|
|
8
|
+
*/
|
|
9
|
+
export type VueTableComponents = {
|
|
10
|
+
table?: VueComponent<{
|
|
11
|
+
table: TableField<"filled">;
|
|
12
|
+
}>;
|
|
13
|
+
thead?: VueComponent<{
|
|
14
|
+
head: TableFieldHead;
|
|
15
|
+
}>;
|
|
16
|
+
tbody?: VueComponent<{
|
|
17
|
+
body: TableFieldBody;
|
|
18
|
+
}>;
|
|
19
|
+
tr?: VueComponent<{
|
|
20
|
+
row: TableFieldBodyRow | TableFieldHeadRow;
|
|
21
|
+
}>;
|
|
22
|
+
th?: VueComponent<{
|
|
23
|
+
cell: TableFieldHeaderCell;
|
|
24
|
+
}>;
|
|
25
|
+
td?: VueComponent<{
|
|
26
|
+
cell: TableFieldDataCell;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
type VueComponent<TProps> = ReturnType<typeof defineAsyncComponent> | DefineComponent<TProps> | FunctionalComponent<TProps>;
|
|
30
|
+
export {};
|
package/dist/createPrismic.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const client = require("@prismicio/client");
|
|
4
4
|
const PrismicRichText_vue_vue_type_script_setup_true_lang = require("./PrismicRichText/PrismicRichText.vue.cjs");
|
|
5
|
+
const PrismicTable_vue_vue_type_script_setup_true_lang = require("./PrismicTable/PrismicTable.vue.cjs");
|
|
5
6
|
const SliceZone_vue_vue_type_script_setup_true_lang = require("./SliceZone/SliceZone.vue.cjs");
|
|
6
7
|
const PrismicEmbed_vue_vue_type_script_setup_true_lang = require("./PrismicEmbed.vue.cjs");
|
|
7
8
|
const PrismicImage_vue_vue_type_script_setup_true_lang = require("./PrismicImage.vue.cjs");
|
|
@@ -67,6 +68,7 @@ const createPrismic = (options) => {
|
|
|
67
68
|
app.component(PrismicLink_vue_vue_type_script_setup_true_lang.name, PrismicLink_vue_vue_type_script_setup_true_lang);
|
|
68
69
|
app.component(PrismicEmbed_vue_vue_type_script_setup_true_lang.name, PrismicEmbed_vue_vue_type_script_setup_true_lang);
|
|
69
70
|
app.component(PrismicImage_vue_vue_type_script_setup_true_lang.name, PrismicImage_vue_vue_type_script_setup_true_lang);
|
|
71
|
+
app.component(PrismicTable_vue_vue_type_script_setup_true_lang.name, PrismicTable_vue_vue_type_script_setup_true_lang);
|
|
70
72
|
app.component(PrismicText_vue_vue_type_script_setup_true_lang.name, PrismicText_vue_vue_type_script_setup_true_lang);
|
|
71
73
|
app.component(PrismicRichText_vue_vue_type_script_setup_true_lang.name, PrismicRichText_vue_vue_type_script_setup_true_lang);
|
|
72
74
|
app.component(SliceZone_vue_vue_type_script_setup_true_lang.name, SliceZone_vue_vue_type_script_setup_true_lang);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPrismic.cjs","sources":["../../src/createPrismic.ts"],"sourcesContent":["import type {\n\tClient,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/client\"\nimport {\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"\nimport type { App } from \"vue\"\n\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\"\n\nimport PrismicRichText from \"./PrismicRichText/PrismicRichText.vue\"\nimport SliceZone from \"./SliceZone/SliceZone.vue\"\n\nimport PrismicEmbed from \"./PrismicEmbed.vue\"\nimport PrismicImage from \"./PrismicImage.vue\"\nimport PrismicLink from \"./PrismicLink.vue\"\nimport PrismicText from \"./PrismicText.vue\"\nimport { prismicKey } from \"./usePrismic\"\n\n/**\n * Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.\n *\n * @param options - {@link PrismicPluginOptions}\n *\n * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}\n *\n * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}\n * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}\n */\nexport const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {\n\t// Create plugin client\n\tlet client: Client\n\tif (options.client) {\n\t\tclient = options.client\n\t} else {\n\t\tclient = createClient(options.endpoint, options.clientConfig)\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tfilter,\n\t\tcookie,\n\t}\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, ...config) => {\n\t\t\tconst [configOrLinkResolver, maybeHTMLSerializer] = config\n\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\ttypeof configOrLinkResolver === \"function\" ||\n\t\t\t\t\tconfigOrLinkResolver == null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tlinkResolver: configOrLinkResolver || options.linkResolver,\n\t\t\t\t\t\t\tserializer:\n\t\t\t\t\t\t\t\t(maybeHTMLSerializer as\n\t\t\t\t\t\t\t\t\t| HTMLRichTextFunctionSerializer\n\t\t\t\t\t\t\t\t\t| HTMLRichTextMapSerializer) || options.richTextSerializer,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\tserializer: options.richTextSerializer,\n\t\t\t\t\t\t\t...configOrLinkResolver,\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLink: (linkField, config) => {\n\t\t\treturn asLink(\n\t\t\t\tlinkField,\n\t\t\t\ttypeof config === \"function\"\n\t\t\t\t\t? { linkResolver: config }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t// TODO: For some reasons, TypeScript narrows the type to \"unknown\" where it's supposed to be a union\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\t...(config as any),\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLinkAttrs: (linkField, config) => {\n\t\t\treturn asLinkAttrs(linkField, {\n\t\t\t\t// TODO: We can't really retrieve the generic type here, this might cause some unexpected type error in some edge-case scenario\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tlinkResolver: options.linkResolver as LinkResolverFunction<any>,\n\t\t\t\t...config,\n\t\t\t})\n\t\t},\n\t\tasDate,\n\t\tasImageSrc,\n\t\tasImageWidthSrcSet,\n\t\tasImagePixelDensitySrcSet,\n\t\tisFilled,\n\t\tdocumentToLinkField,\n\t}\n\n\t// Create plugin interface\n\tconst prismic: PrismicPlugin = {\n\t\toptions,\n\n\t\t...prismicClient,\n\t\t...prismicHelpers,\n\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\n\t\t\tif (options.injectComponents !== false) {\n\t\t\t\tapp.component(PrismicLink.name!, PrismicLink)\n\t\t\t\tapp.component(PrismicEmbed.name!, PrismicEmbed)\n\t\t\t\tapp.component(PrismicImage.name!, PrismicImage)\n\t\t\t\tapp.component(PrismicText.name!, PrismicText)\n\t\t\t\tapp.component(PrismicRichText.name!, PrismicRichText)\n\t\t\t\tapp.component(SliceZone.name!, SliceZone)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn prismic\n}\n\ndeclare module \"vue\" {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * `@prismicio/vue` plugin interface exposed on `this`.\n\t\t *\n\t\t * @see `@prismicio/vue` plugin interface {@link PrismicPlugin}\n\t\t */\n\t\t$prismic: PrismicPlugin\n\t}\n}\n"],"names":["client","createClient","filter","cookie","asText","asHTML","asLink","asLinkAttrs","asDate","asImageSrc","asImageWidthSrcSet","asImagePixelDensitySrcSet","isFilled","documentToLinkField","prismicKey","PrismicLink","PrismicEmbed","PrismicImage","PrismicText","PrismicRichText","SliceZone"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createPrismic.cjs","sources":["../../src/createPrismic.ts"],"sourcesContent":["import type {\n\tClient,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/client\"\nimport {\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"\nimport type { App } from \"vue\"\n\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\"\n\nimport PrismicRichText from \"./PrismicRichText/PrismicRichText.vue\"\nimport PrismicTable from \"./PrismicTable/PrismicTable.vue\"\nimport SliceZone from \"./SliceZone/SliceZone.vue\"\n\nimport PrismicEmbed from \"./PrismicEmbed.vue\"\nimport PrismicImage from \"./PrismicImage.vue\"\nimport PrismicLink from \"./PrismicLink.vue\"\nimport PrismicText from \"./PrismicText.vue\"\nimport { prismicKey } from \"./usePrismic\"\n\n/**\n * Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.\n *\n * @param options - {@link PrismicPluginOptions}\n *\n * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}\n *\n * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}\n * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}\n */\nexport const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {\n\t// Create plugin client\n\tlet client: Client\n\tif (options.client) {\n\t\tclient = options.client\n\t} else {\n\t\tclient = createClient(options.endpoint, options.clientConfig)\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tfilter,\n\t\tcookie,\n\t}\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, ...config) => {\n\t\t\tconst [configOrLinkResolver, maybeHTMLSerializer] = config\n\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\ttypeof configOrLinkResolver === \"function\" ||\n\t\t\t\t\tconfigOrLinkResolver == null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tlinkResolver: configOrLinkResolver || options.linkResolver,\n\t\t\t\t\t\t\tserializer:\n\t\t\t\t\t\t\t\t(maybeHTMLSerializer as\n\t\t\t\t\t\t\t\t\t| HTMLRichTextFunctionSerializer\n\t\t\t\t\t\t\t\t\t| HTMLRichTextMapSerializer) || options.richTextSerializer,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\tserializer: options.richTextSerializer,\n\t\t\t\t\t\t\t...configOrLinkResolver,\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLink: (linkField, config) => {\n\t\t\treturn asLink(\n\t\t\t\tlinkField,\n\t\t\t\ttypeof config === \"function\"\n\t\t\t\t\t? { linkResolver: config }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t// TODO: For some reasons, TypeScript narrows the type to \"unknown\" where it's supposed to be a union\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\t...(config as any),\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLinkAttrs: (linkField, config) => {\n\t\t\treturn asLinkAttrs(linkField, {\n\t\t\t\t// TODO: We can't really retrieve the generic type here, this might cause some unexpected type error in some edge-case scenario\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tlinkResolver: options.linkResolver as LinkResolverFunction<any>,\n\t\t\t\t...config,\n\t\t\t})\n\t\t},\n\t\tasDate,\n\t\tasImageSrc,\n\t\tasImageWidthSrcSet,\n\t\tasImagePixelDensitySrcSet,\n\t\tisFilled,\n\t\tdocumentToLinkField,\n\t}\n\n\t// Create plugin interface\n\tconst prismic: PrismicPlugin = {\n\t\toptions,\n\n\t\t...prismicClient,\n\t\t...prismicHelpers,\n\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\n\t\t\tif (options.injectComponents !== false) {\n\t\t\t\tapp.component(PrismicLink.name!, PrismicLink)\n\t\t\t\tapp.component(PrismicEmbed.name!, PrismicEmbed)\n\t\t\t\tapp.component(PrismicImage.name!, PrismicImage)\n\t\t\t\tapp.component(PrismicTable.name!, PrismicTable)\n\t\t\t\tapp.component(PrismicText.name!, PrismicText)\n\t\t\t\tapp.component(PrismicRichText.name!, PrismicRichText)\n\t\t\t\tapp.component(SliceZone.name!, SliceZone)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn prismic\n}\n\ndeclare module \"vue\" {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * `@prismicio/vue` plugin interface exposed on `this`.\n\t\t *\n\t\t * @see `@prismicio/vue` plugin interface {@link PrismicPlugin}\n\t\t */\n\t\t$prismic: PrismicPlugin\n\t}\n}\n"],"names":["client","createClient","filter","cookie","asText","asHTML","asLink","asLinkAttrs","asDate","asImageSrc","asImageWidthSrcSet","asImagePixelDensitySrcSet","isFilled","documentToLinkField","prismicKey","PrismicLink","PrismicEmbed","PrismicImage","PrismicTable","PrismicText","PrismicRichText","SliceZone"],"mappings":";;;;;;;;;;;AAkDa,MAAA,gBAAgB,CAAC,YAAgD;AAEzE,MAAAA;AACJ,MAAI,QAAQ,QAAQ;AACnBA,eAAS,QAAQ;AAAA,EAAA,OACX;AACNA,eAASC,OAAAA,aAAa,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAAA;AAG7D,QAAM,gBAAqC;AAAA,IAAA,QAC1CD;AAAAA,IAAA,QACAE,OAAA;AAAA,IACAC,QAAAA,OAAAA;AAAAA;AAID,QAAM,iBAAuC;AAAA,IAAA,QAC5CC,OAAA;AAAA,IACA,QAAQ,CAAC,kBAAkB,WAAU;AAC9B,YAAA,CAAC,sBAAsB,mBAAmB,IAAI;AAEpD,aAAOC,OAAAA,OACN,eACA,OAAO,yBAAyB,cAC/B,wBAAwB,OACtB;AAAA,QACA,cAAc,wBAAwB,QAAQ;AAAA,QAC9C,YACE,uBAEgC,QAAQ;AAAA,MAAA,IAE1C;AAAA,QACA,cAAc,QAAQ;AAAA,QACtB,YAAY,QAAQ;AAAA,QACpB,GAAG;AAAA,MAAA,CACH;AAAA,IAEL;AAAA,IACA,QAAQ,CAAC,WAAW,WAAU;AACtB,aAAAC,OAAAA,OACN,WACA,OAAO,WAAW,aACf,EAAE,cAAc,WAChB;AAAA,QACA,cAAc,QAAQ;AAAA;AAAA;AAAA,QAGtB,GAAI;AAAA,MAAA,CACJ;AAAA,IAEL;AAAA,IACA,aAAa,CAAC,WAAW,WAAU;AAClC,aAAOC,OAAAA,YAAY,WAAW;AAAA;AAAA;AAAA,QAG7B,cAAc,QAAQ;AAAA,QACtB,GAAG;AAAA,MAAA,CACH;AAAA,IACF;AAAA,IAAA,QACAC,OAAA;AAAA,IAAA,YACAC,OAAA;AAAA,IAAA,oBACAC,OAAA;AAAA,IAAA,2BACAC,OAAA;AAAA,IAAA,UACAC,OAAA;AAAA,IACAC,qBAAAA,OAAAA;AAAAA;AAID,QAAM,UAAyB;AAAA,IAC9B;AAAA,IAEA,GAAG;AAAA,IACH,GAAG;AAAA,IAEH,QAAQ,KAAQ;AACX,UAAA,QAAQC,uBAAY,IAAI;AACxB,UAAA,OAAO,iBAAiB,WAAW;AAEnC,UAAA,QAAQ,qBAAqB,OAAO;AACnC,YAAA,UAAUC,gDAAY,MAAOA,+CAAW;AACxC,YAAA,UAAUC,iDAAa,MAAOA,gDAAY;AAC1C,YAAA,UAAUC,iDAAa,MAAOA,gDAAY;AAC1C,YAAA,UAAUC,iDAAa,MAAOA,gDAAY;AAC1C,YAAA,UAAUC,gDAAY,MAAOA,+CAAW;AACxC,YAAA,UAAUC,oDAAgB,MAAOA,mDAAe;AAChD,YAAA,UAAUC,8CAAU,MAAOA,6CAAS;AAAA,MAAA;AAAA,IACzC;AAAA;AAIK,SAAA;AACR;;"}
|
package/dist/createPrismic.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createClient, filter, cookie, asText, asHTML, asLink, asLinkAttrs, asDate, asImageSrc, asImageWidthSrcSet, asImagePixelDensitySrcSet, isFilled, documentToLinkField } from "@prismicio/client";
|
|
2
|
-
import _sfc_main$
|
|
3
|
-
import _sfc_main$
|
|
2
|
+
import _sfc_main$5 from "./PrismicRichText/PrismicRichText.vue.js";
|
|
3
|
+
import _sfc_main$3 from "./PrismicTable/PrismicTable.vue.js";
|
|
4
|
+
import _sfc_main$6 from "./SliceZone/SliceZone.vue.js";
|
|
4
5
|
import _sfc_main$1 from "./PrismicEmbed.vue.js";
|
|
5
6
|
import _sfc_main$2 from "./PrismicImage.vue.js";
|
|
6
7
|
import _sfc_main from "./PrismicLink.vue.js";
|
|
7
|
-
import _sfc_main$
|
|
8
|
+
import _sfc_main$4 from "./PrismicText.vue.js";
|
|
8
9
|
import { prismicKey } from "./usePrismic.js";
|
|
9
10
|
const createPrismic = (options) => {
|
|
10
11
|
let client;
|
|
@@ -68,6 +69,7 @@ const createPrismic = (options) => {
|
|
|
68
69
|
app.component(_sfc_main$3.name, _sfc_main$3);
|
|
69
70
|
app.component(_sfc_main$4.name, _sfc_main$4);
|
|
70
71
|
app.component(_sfc_main$5.name, _sfc_main$5);
|
|
72
|
+
app.component(_sfc_main$6.name, _sfc_main$6);
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPrismic.js","sources":["../../src/createPrismic.ts"],"sourcesContent":["import type {\n\tClient,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/client\"\nimport {\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"\nimport type { App } from \"vue\"\n\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\"\n\nimport PrismicRichText from \"./PrismicRichText/PrismicRichText.vue\"\nimport SliceZone from \"./SliceZone/SliceZone.vue\"\n\nimport PrismicEmbed from \"./PrismicEmbed.vue\"\nimport PrismicImage from \"./PrismicImage.vue\"\nimport PrismicLink from \"./PrismicLink.vue\"\nimport PrismicText from \"./PrismicText.vue\"\nimport { prismicKey } from \"./usePrismic\"\n\n/**\n * Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.\n *\n * @param options - {@link PrismicPluginOptions}\n *\n * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}\n *\n * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}\n * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}\n */\nexport const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {\n\t// Create plugin client\n\tlet client: Client\n\tif (options.client) {\n\t\tclient = options.client\n\t} else {\n\t\tclient = createClient(options.endpoint, options.clientConfig)\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tfilter,\n\t\tcookie,\n\t}\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, ...config) => {\n\t\t\tconst [configOrLinkResolver, maybeHTMLSerializer] = config\n\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\ttypeof configOrLinkResolver === \"function\" ||\n\t\t\t\t\tconfigOrLinkResolver == null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tlinkResolver: configOrLinkResolver || options.linkResolver,\n\t\t\t\t\t\t\tserializer:\n\t\t\t\t\t\t\t\t(maybeHTMLSerializer as\n\t\t\t\t\t\t\t\t\t| HTMLRichTextFunctionSerializer\n\t\t\t\t\t\t\t\t\t| HTMLRichTextMapSerializer) || options.richTextSerializer,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\tserializer: options.richTextSerializer,\n\t\t\t\t\t\t\t...configOrLinkResolver,\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLink: (linkField, config) => {\n\t\t\treturn asLink(\n\t\t\t\tlinkField,\n\t\t\t\ttypeof config === \"function\"\n\t\t\t\t\t? { linkResolver: config }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t// TODO: For some reasons, TypeScript narrows the type to \"unknown\" where it's supposed to be a union\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\t...(config as any),\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLinkAttrs: (linkField, config) => {\n\t\t\treturn asLinkAttrs(linkField, {\n\t\t\t\t// TODO: We can't really retrieve the generic type here, this might cause some unexpected type error in some edge-case scenario\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tlinkResolver: options.linkResolver as LinkResolverFunction<any>,\n\t\t\t\t...config,\n\t\t\t})\n\t\t},\n\t\tasDate,\n\t\tasImageSrc,\n\t\tasImageWidthSrcSet,\n\t\tasImagePixelDensitySrcSet,\n\t\tisFilled,\n\t\tdocumentToLinkField,\n\t}\n\n\t// Create plugin interface\n\tconst prismic: PrismicPlugin = {\n\t\toptions,\n\n\t\t...prismicClient,\n\t\t...prismicHelpers,\n\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\n\t\t\tif (options.injectComponents !== false) {\n\t\t\t\tapp.component(PrismicLink.name!, PrismicLink)\n\t\t\t\tapp.component(PrismicEmbed.name!, PrismicEmbed)\n\t\t\t\tapp.component(PrismicImage.name!, PrismicImage)\n\t\t\t\tapp.component(PrismicText.name!, PrismicText)\n\t\t\t\tapp.component(PrismicRichText.name!, PrismicRichText)\n\t\t\t\tapp.component(SliceZone.name!, SliceZone)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn prismic\n}\n\ndeclare module \"vue\" {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * `@prismicio/vue` plugin interface exposed on `this`.\n\t\t *\n\t\t * @see `@prismicio/vue` plugin interface {@link PrismicPlugin}\n\t\t */\n\t\t$prismic: PrismicPlugin\n\t}\n}\n"],"names":["PrismicLink","PrismicEmbed","PrismicImage","PrismicText","PrismicRichText","SliceZone"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createPrismic.js","sources":["../../src/createPrismic.ts"],"sourcesContent":["import type {\n\tClient,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/client\"\nimport {\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"\nimport type { App } from \"vue\"\n\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\"\n\nimport PrismicRichText from \"./PrismicRichText/PrismicRichText.vue\"\nimport PrismicTable from \"./PrismicTable/PrismicTable.vue\"\nimport SliceZone from \"./SliceZone/SliceZone.vue\"\n\nimport PrismicEmbed from \"./PrismicEmbed.vue\"\nimport PrismicImage from \"./PrismicImage.vue\"\nimport PrismicLink from \"./PrismicLink.vue\"\nimport PrismicText from \"./PrismicText.vue\"\nimport { prismicKey } from \"./usePrismic\"\n\n/**\n * Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.\n *\n * @param options - {@link PrismicPluginOptions}\n *\n * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}\n *\n * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}\n * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}\n */\nexport const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {\n\t// Create plugin client\n\tlet client: Client\n\tif (options.client) {\n\t\tclient = options.client\n\t} else {\n\t\tclient = createClient(options.endpoint, options.clientConfig)\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tfilter,\n\t\tcookie,\n\t}\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, ...config) => {\n\t\t\tconst [configOrLinkResolver, maybeHTMLSerializer] = config\n\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\ttypeof configOrLinkResolver === \"function\" ||\n\t\t\t\t\tconfigOrLinkResolver == null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tlinkResolver: configOrLinkResolver || options.linkResolver,\n\t\t\t\t\t\t\tserializer:\n\t\t\t\t\t\t\t\t(maybeHTMLSerializer as\n\t\t\t\t\t\t\t\t\t| HTMLRichTextFunctionSerializer\n\t\t\t\t\t\t\t\t\t| HTMLRichTextMapSerializer) || options.richTextSerializer,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\tserializer: options.richTextSerializer,\n\t\t\t\t\t\t\t...configOrLinkResolver,\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLink: (linkField, config) => {\n\t\t\treturn asLink(\n\t\t\t\tlinkField,\n\t\t\t\ttypeof config === \"function\"\n\t\t\t\t\t? { linkResolver: config }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t// TODO: For some reasons, TypeScript narrows the type to \"unknown\" where it's supposed to be a union\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\t...(config as any),\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLinkAttrs: (linkField, config) => {\n\t\t\treturn asLinkAttrs(linkField, {\n\t\t\t\t// TODO: We can't really retrieve the generic type here, this might cause some unexpected type error in some edge-case scenario\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tlinkResolver: options.linkResolver as LinkResolverFunction<any>,\n\t\t\t\t...config,\n\t\t\t})\n\t\t},\n\t\tasDate,\n\t\tasImageSrc,\n\t\tasImageWidthSrcSet,\n\t\tasImagePixelDensitySrcSet,\n\t\tisFilled,\n\t\tdocumentToLinkField,\n\t}\n\n\t// Create plugin interface\n\tconst prismic: PrismicPlugin = {\n\t\toptions,\n\n\t\t...prismicClient,\n\t\t...prismicHelpers,\n\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\n\t\t\tif (options.injectComponents !== false) {\n\t\t\t\tapp.component(PrismicLink.name!, PrismicLink)\n\t\t\t\tapp.component(PrismicEmbed.name!, PrismicEmbed)\n\t\t\t\tapp.component(PrismicImage.name!, PrismicImage)\n\t\t\t\tapp.component(PrismicTable.name!, PrismicTable)\n\t\t\t\tapp.component(PrismicText.name!, PrismicText)\n\t\t\t\tapp.component(PrismicRichText.name!, PrismicRichText)\n\t\t\t\tapp.component(SliceZone.name!, SliceZone)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn prismic\n}\n\ndeclare module \"vue\" {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * `@prismicio/vue` plugin interface exposed on `this`.\n\t\t *\n\t\t * @see `@prismicio/vue` plugin interface {@link PrismicPlugin}\n\t\t */\n\t\t$prismic: PrismicPlugin\n\t}\n}\n"],"names":["PrismicLink","PrismicEmbed","PrismicImage","PrismicTable","PrismicText","PrismicRichText","SliceZone"],"mappings":";;;;;;;;;AAkDa,MAAA,gBAAgB,CAAC,YAAgD;AAEzE,MAAA;AACJ,MAAI,QAAQ,QAAQ;AACnB,aAAS,QAAQ;AAAA,EAAA,OACX;AACN,aAAS,aAAa,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAAA;AAG7D,QAAM,gBAAqC;AAAA,IAC1C;AAAA,IACA;AAAA,IACA;AAAA;AAID,QAAM,iBAAuC;AAAA,IAC5C;AAAA,IACA,QAAQ,CAAC,kBAAkB,WAAU;AAC9B,YAAA,CAAC,sBAAsB,mBAAmB,IAAI;AAEpD,aAAO,OACN,eACA,OAAO,yBAAyB,cAC/B,wBAAwB,OACtB;AAAA,QACA,cAAc,wBAAwB,QAAQ;AAAA,QAC9C,YACE,uBAEgC,QAAQ;AAAA,MAAA,IAE1C;AAAA,QACA,cAAc,QAAQ;AAAA,QACtB,YAAY,QAAQ;AAAA,QACpB,GAAG;AAAA,MAAA,CACH;AAAA,IAEL;AAAA,IACA,QAAQ,CAAC,WAAW,WAAU;AACtB,aAAA,OACN,WACA,OAAO,WAAW,aACf,EAAE,cAAc,WAChB;AAAA,QACA,cAAc,QAAQ;AAAA;AAAA;AAAA,QAGtB,GAAI;AAAA,MAAA,CACJ;AAAA,IAEL;AAAA,IACA,aAAa,CAAC,WAAW,WAAU;AAClC,aAAO,YAAY,WAAW;AAAA;AAAA;AAAA,QAG7B,cAAc,QAAQ;AAAA,QACtB,GAAG;AAAA,MAAA,CACH;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAID,QAAM,UAAyB;AAAA,IAC9B;AAAA,IAEA,GAAG;AAAA,IACH,GAAG;AAAA,IAEH,QAAQ,KAAQ;AACX,UAAA,QAAQ,YAAY,IAAI;AACxB,UAAA,OAAO,iBAAiB,WAAW;AAEnC,UAAA,QAAQ,qBAAqB,OAAO;AACnC,YAAA,UAAUA,UAAY,MAAOA,SAAW;AACxC,YAAA,UAAUC,YAAa,MAAOA,WAAY;AAC1C,YAAA,UAAUC,YAAa,MAAOA,WAAY;AAC1C,YAAA,UAAUC,YAAa,MAAOA,WAAY;AAC1C,YAAA,UAAUC,YAAY,MAAOA,WAAW;AACxC,YAAA,UAAUC,YAAgB,MAAOA,WAAe;AAChD,YAAA,UAAUC,YAAU,MAAOA,WAAS;AAAA,MAAA;AAAA,IACzC;AAAA;AAIK,SAAA;AACR;"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const PrismicRichText_vue_vue_type_script_setup_true_lang = require("./PrismicRichText/PrismicRichText.vue.cjs");
|
|
4
|
+
const PrismicTable_vue_vue_type_script_setup_true_lang = require("./PrismicTable/PrismicTable.vue.cjs");
|
|
4
5
|
const SliceZone_vue_vue_type_script_setup_true_lang = require("./SliceZone/SliceZone.vue.cjs");
|
|
5
6
|
const PrismicEmbed_vue_vue_type_script_setup_true_lang = require("./PrismicEmbed.vue.cjs");
|
|
6
7
|
const PrismicImage_vue_vue_type_script_setup_true_lang = require("./PrismicImage.vue.cjs");
|
|
@@ -9,10 +10,12 @@ const PrismicText_vue_vue_type_script_setup_true_lang = require("./PrismicText.v
|
|
|
9
10
|
const createPrismic = require("./createPrismic.cjs");
|
|
10
11
|
const usePrismic = require("./usePrismic.cjs");
|
|
11
12
|
const getRichTextComponentProps = require("./PrismicRichText/getRichTextComponentProps.cjs");
|
|
13
|
+
const getTableComponentProps = require("./PrismicTable/getTableComponentProps.cjs");
|
|
12
14
|
const TODOSliceComponent = require("./SliceZone/TODOSliceComponent.cjs");
|
|
13
15
|
const defineSliceZoneComponents = require("./SliceZone/defineSliceZoneComponents.cjs");
|
|
14
16
|
const getSliceComponentProps = require("./SliceZone/getSliceComponentProps.cjs");
|
|
15
17
|
exports.PrismicRichText = PrismicRichText_vue_vue_type_script_setup_true_lang;
|
|
18
|
+
exports.PrismicTable = PrismicTable_vue_vue_type_script_setup_true_lang;
|
|
16
19
|
exports.SliceZone = SliceZone_vue_vue_type_script_setup_true_lang;
|
|
17
20
|
exports.PrismicEmbed = PrismicEmbed_vue_vue_type_script_setup_true_lang;
|
|
18
21
|
exports.PrismicImage = PrismicImage_vue_vue_type_script_setup_true_lang;
|
|
@@ -22,6 +25,7 @@ exports.createPrismic = createPrismic.createPrismic;
|
|
|
22
25
|
exports.prismicKey = usePrismic.prismicKey;
|
|
23
26
|
exports.usePrismic = usePrismic.usePrismic;
|
|
24
27
|
exports.getRichTextComponentProps = getRichTextComponentProps.getRichTextComponentProps;
|
|
28
|
+
exports.getTableComponentProps = getTableComponentProps;
|
|
25
29
|
exports.TODOSliceComponent = TODOSliceComponent.TODOSliceComponent;
|
|
26
30
|
exports.defineSliceZoneComponents = defineSliceZoneComponents.defineSliceZoneComponents;
|
|
27
31
|
exports.getSliceComponentProps = getSliceComponentProps.getSliceComponentProps;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PrismicRichText from "./PrismicRichText/PrismicRichText.vue";
|
|
2
|
+
import PrismicTable from "./PrismicTable/PrismicTable.vue";
|
|
2
3
|
import SliceZone from "./SliceZone/SliceZone.vue";
|
|
3
4
|
import PrismicEmbed from "./PrismicEmbed.vue";
|
|
4
5
|
import PrismicImage from "./PrismicImage.vue";
|
|
@@ -6,13 +7,15 @@ import PrismicLink from "./PrismicLink.vue";
|
|
|
6
7
|
import PrismicText from "./PrismicText.vue";
|
|
7
8
|
export type { SliceZoneProps } from "./SliceZone/SliceZone.vue";
|
|
8
9
|
export type { PrismicRichTextProps } from "./PrismicRichText/PrismicRichText.vue";
|
|
10
|
+
export type { PrismicTableProps } from "./PrismicTable/PrismicTable.vue";
|
|
9
11
|
export type { PrismicEmbedProps } from "./PrismicEmbed.vue";
|
|
10
12
|
export type { PrismicImageProps } from "./PrismicImage.vue";
|
|
11
13
|
export type { PrismicLinkProps } from "./PrismicLink.vue";
|
|
12
14
|
export type { PrismicTextProps } from "./PrismicText.vue";
|
|
13
|
-
export { SliceZone, PrismicEmbed, PrismicImage, PrismicLink, PrismicText, PrismicRichText, };
|
|
15
|
+
export { SliceZone, PrismicEmbed, PrismicImage, PrismicLink, PrismicTable, PrismicText, PrismicRichText, };
|
|
14
16
|
export { getRichTextComponentProps } from "./PrismicRichText";
|
|
15
17
|
export type { VueRichTextSerializer, RichTextComponentProps, } from "./PrismicRichText";
|
|
18
|
+
export { getTableComponentProps } from "./PrismicTable";
|
|
16
19
|
export { TODOSliceComponent, defineSliceZoneComponents, getSliceComponentProps, } from "./SliceZone";
|
|
17
20
|
export type { SliceComponentProps, SliceComponentType, SliceLike, SliceLikeGraphQL, SliceLikeRestV2, SliceZoneComponents, SliceZoneLike, } from "./SliceZone";
|
|
18
21
|
export type { PrismicPluginOptions, PrismicPlugin } from "./types";
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { default as default2 } from "./PrismicRichText/PrismicRichText.vue.js";
|
|
2
|
-
import { default as default3 } from "./
|
|
3
|
-
import { default as default4 } from "./
|
|
4
|
-
import { default as default5 } from "./
|
|
5
|
-
import { default as default6 } from "./
|
|
6
|
-
import { default as default7 } from "./
|
|
2
|
+
import { default as default3 } from "./PrismicTable/PrismicTable.vue.js";
|
|
3
|
+
import { default as default4 } from "./SliceZone/SliceZone.vue.js";
|
|
4
|
+
import { default as default5 } from "./PrismicEmbed.vue.js";
|
|
5
|
+
import { default as default6 } from "./PrismicImage.vue.js";
|
|
6
|
+
import { default as default7 } from "./PrismicLink.vue.js";
|
|
7
|
+
import { default as default8 } from "./PrismicText.vue.js";
|
|
7
8
|
import { createPrismic } from "./createPrismic.js";
|
|
8
9
|
import { prismicKey, usePrismic } from "./usePrismic.js";
|
|
9
10
|
import { getRichTextComponentProps } from "./PrismicRichText/getRichTextComponentProps.js";
|
|
11
|
+
import * as getTableComponentProps from "./PrismicTable/getTableComponentProps.js";
|
|
10
12
|
import { TODOSliceComponent } from "./SliceZone/TODOSliceComponent.js";
|
|
11
13
|
import { defineSliceZoneComponents } from "./SliceZone/defineSliceZoneComponents.js";
|
|
12
14
|
import { getSliceComponentProps } from "./SliceZone/getSliceComponentProps.js";
|
|
13
15
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
default5 as PrismicEmbed,
|
|
17
|
+
default6 as PrismicImage,
|
|
18
|
+
default7 as PrismicLink,
|
|
17
19
|
default2 as PrismicRichText,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
default3 as PrismicTable,
|
|
21
|
+
default8 as PrismicText,
|
|
22
|
+
default4 as SliceZone,
|
|
20
23
|
TODOSliceComponent,
|
|
21
24
|
createPrismic,
|
|
22
25
|
defineSliceZoneComponents,
|
|
23
26
|
getRichTextComponentProps,
|
|
24
27
|
getSliceComponentProps,
|
|
28
|
+
getTableComponentProps,
|
|
25
29
|
prismicKey,
|
|
26
30
|
usePrismic
|
|
27
31
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/dist/package.json.cjs
CHANGED
package/dist/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/vue",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Vue plugin, components, and composables to fetch and present Prismic content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"test": "npm run lint && npm run types && npm run unit && npm run build && npm run size"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@prismicio/client": "^7.
|
|
60
|
+
"@prismicio/client": "^7.16.1",
|
|
61
61
|
"esm-env": "^1.2.2",
|
|
62
62
|
"vue-router": "^4.5.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@eslint/js": "^9.18.0",
|
|
66
|
-
"@prismicio/mock": "^0.
|
|
66
|
+
"@prismicio/mock": "^0.7.1",
|
|
67
67
|
"@size-limit/preset-small-lib": "^11.1.6",
|
|
68
68
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
69
69
|
"@types/jsdom-global": "^3.0.7",
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { type TableField, isFilled } from "@prismicio/client"
|
|
3
|
+
import { computed } from "vue"
|
|
4
|
+
|
|
5
|
+
import type { ComponentOrTagName } from "../types"
|
|
6
|
+
import type { VueTableComponents } from "./types"
|
|
7
|
+
|
|
8
|
+
import type { VueRichTextSerializer } from "../PrismicRichText"
|
|
9
|
+
|
|
10
|
+
import { defaultTableComponents } from "./PrismicTableDefaultComponents"
|
|
11
|
+
import PrismicTableRow from "./PrismicTableRow.vue"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Props for `<PrismicTable />`.
|
|
15
|
+
*/
|
|
16
|
+
export type PrismicTableProps = {
|
|
17
|
+
/**
|
|
18
|
+
* The Prismic table field to render.
|
|
19
|
+
*/
|
|
20
|
+
field: TableField | undefined
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The value to be rendered when the field is empty. If a fallback is not
|
|
24
|
+
* given, `null` (nothing) will be rendered.
|
|
25
|
+
*/
|
|
26
|
+
fallback?: ComponentOrTagName
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An object that maps a table block type to a Vue component.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
*
|
|
33
|
+
* ```javascript
|
|
34
|
+
* {
|
|
35
|
+
* table: Table,
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
components?: VueTableComponents & VueRichTextSerializer
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const props = defineProps<PrismicTableProps>()
|
|
43
|
+
defineOptions({ name: "PrismicTable" })
|
|
44
|
+
|
|
45
|
+
const mergedComponents = computed(() => ({
|
|
46
|
+
...defaultTableComponents,
|
|
47
|
+
...props.components,
|
|
48
|
+
}))
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<component
|
|
53
|
+
v-if="isFilled.table(field)"
|
|
54
|
+
:is="mergedComponents.table"
|
|
55
|
+
:table="field"
|
|
56
|
+
v-bind="$attrs"
|
|
57
|
+
>
|
|
58
|
+
<component
|
|
59
|
+
v-if="field.head"
|
|
60
|
+
:is="mergedComponents.thead"
|
|
61
|
+
:head="field.head"
|
|
62
|
+
>
|
|
63
|
+
<PrismicTableRow
|
|
64
|
+
v-for="row in field.head.rows"
|
|
65
|
+
:key="JSON.stringify(row)"
|
|
66
|
+
:row="row"
|
|
67
|
+
:components="mergedComponents"
|
|
68
|
+
/>
|
|
69
|
+
</component>
|
|
70
|
+
<component :is="mergedComponents.tbody" :body="field.body">
|
|
71
|
+
<PrismicTableRow
|
|
72
|
+
v-for="row in field.body.rows"
|
|
73
|
+
:key="JSON.stringify(row)"
|
|
74
|
+
:row="row"
|
|
75
|
+
:components="mergedComponents"
|
|
76
|
+
/>
|
|
77
|
+
</component>
|
|
78
|
+
</component>
|
|
79
|
+
<component v-else :is="fallback" />
|
|
80
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue"
|
|
2
|
+
|
|
3
|
+
import type { VueTableComponents } from "./types"
|
|
4
|
+
|
|
5
|
+
import * as getTableComponentProps from "./getTableComponentProps"
|
|
6
|
+
|
|
7
|
+
export const defaultTableComponents: Required<VueTableComponents> = {
|
|
8
|
+
table: defineComponent({
|
|
9
|
+
props: getTableComponentProps.table(),
|
|
10
|
+
setup(props, { slots }) {
|
|
11
|
+
return () => h("table", slots.default ? slots.default() : [])
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
thead: defineComponent({
|
|
15
|
+
props: getTableComponentProps.thead(),
|
|
16
|
+
setup(props, { slots }) {
|
|
17
|
+
return () => h("thead", slots.default ? slots.default() : [])
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
tbody: defineComponent({
|
|
21
|
+
props: getTableComponentProps.tbody(),
|
|
22
|
+
setup(props, { slots }) {
|
|
23
|
+
return () => h("tbody", slots.default ? slots.default() : [])
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
tr: defineComponent({
|
|
27
|
+
props: getTableComponentProps.tr(),
|
|
28
|
+
setup(props, { slots }) {
|
|
29
|
+
return () => h("tr", slots.default ? slots.default() : [])
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
th: defineComponent({
|
|
33
|
+
props: getTableComponentProps.th(),
|
|
34
|
+
setup(props, { slots }) {
|
|
35
|
+
return () => h("th", slots.default ? slots.default() : [])
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
td: defineComponent({
|
|
39
|
+
props: getTableComponentProps.td(),
|
|
40
|
+
setup(props, { slots }) {
|
|
41
|
+
return () => h("td", slots.default ? slots.default() : [])
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { TableFieldBodyRow, TableFieldHeadRow } from "@prismicio/client"
|
|
3
|
+
|
|
4
|
+
import type { VueTableComponents } from "./types"
|
|
5
|
+
|
|
6
|
+
import type { VueRichTextSerializer } from "../PrismicRichText"
|
|
7
|
+
import PrismicRichText from "../PrismicRichText/PrismicRichText.vue"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for `<PrismicRowTable />`.
|
|
11
|
+
*/
|
|
12
|
+
export type PrismicTableRowProps = {
|
|
13
|
+
/**
|
|
14
|
+
* The Prismic table row to render.
|
|
15
|
+
*/
|
|
16
|
+
row: TableFieldHeadRow | TableFieldBodyRow
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* An object that maps a table block type to a Vue component.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
*
|
|
23
|
+
* ```javascript
|
|
24
|
+
* {
|
|
25
|
+
* tr: TableRow,
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
components: VueTableComponents & VueRichTextSerializer
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const props = defineProps<PrismicTableRowProps>()
|
|
33
|
+
defineOptions({ name: "PrismicTableRow" })
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<component :is="props.components.tr" :row="row">
|
|
38
|
+
<template v-for="cell in row.cells" :key="JSON.stringify(cell)">
|
|
39
|
+
<component
|
|
40
|
+
v-if="cell.type === 'header'"
|
|
41
|
+
:is="props.components.th"
|
|
42
|
+
:cell="cell"
|
|
43
|
+
>
|
|
44
|
+
<PrismicRichText :field="cell.content" :components="components" />
|
|
45
|
+
</component>
|
|
46
|
+
<component v-else :is="props.components.td" :cell="cell">
|
|
47
|
+
<PrismicRichText :field="cell.content" :components="props.components" />
|
|
48
|
+
</component>
|
|
49
|
+
</template>
|
|
50
|
+
</component>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TableField,
|
|
3
|
+
TableFieldBody,
|
|
4
|
+
TableFieldBodyRow,
|
|
5
|
+
TableFieldDataCell,
|
|
6
|
+
TableFieldHead,
|
|
7
|
+
TableFieldHeadRow,
|
|
8
|
+
TableFieldHeaderCell,
|
|
9
|
+
} from "@prismicio/client"
|
|
10
|
+
import type { PropType } from "vue"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Gets native Vue props for a component rendering `table` elements from a
|
|
14
|
+
* Prismic table field with `<PrismicTable />`.
|
|
15
|
+
*
|
|
16
|
+
* Props are: `["table"]`
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Defining a new rich text component
|
|
22
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
23
|
+
*
|
|
24
|
+
* defineProps(getTableComponentProps.table())
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const table = (): {
|
|
28
|
+
table: { type: PropType<TableField<"filled">>; required: true }
|
|
29
|
+
} => ({
|
|
30
|
+
table: { type: Object as PropType<TableField<"filled">>, required: true },
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Gets native Vue props for a component rendering `thead` elements from a
|
|
35
|
+
* Prismic table field with `<PrismicTable />`.
|
|
36
|
+
*
|
|
37
|
+
* Props are: `["head"]`
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* ```javascript
|
|
42
|
+
* // Defining a new rich text component
|
|
43
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
44
|
+
*
|
|
45
|
+
* defineProps(getTableComponentProps.thead())
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export const thead = (): {
|
|
49
|
+
head: { type: PropType<TableFieldHead>; required: true }
|
|
50
|
+
} => ({
|
|
51
|
+
head: { type: Object as PropType<TableFieldHead>, required: true },
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Gets native Vue props for a component rendering `tbody` elements from a
|
|
56
|
+
* Prismic table field with `<PrismicTable />`.
|
|
57
|
+
*
|
|
58
|
+
* Props are: `["body"]`
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
*
|
|
62
|
+
* ```javascript
|
|
63
|
+
* // Defining a new rich text component
|
|
64
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
65
|
+
*
|
|
66
|
+
* defineProps(getTableComponentProps.body())
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export const tbody = (): {
|
|
70
|
+
body: { type: PropType<TableFieldBody>; required: true }
|
|
71
|
+
} => ({
|
|
72
|
+
body: { type: Object as PropType<TableFieldBody>, required: true },
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Gets native Vue props for a component rendering `tr` elements from a Prismic
|
|
77
|
+
* table field with `<PrismicTable />`.
|
|
78
|
+
*
|
|
79
|
+
* Props are: `["row"]`
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
*
|
|
83
|
+
* ```javascript
|
|
84
|
+
* // Defining a new rich text component
|
|
85
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
86
|
+
*
|
|
87
|
+
* defineProps(getTableComponentProps.tr())
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export const tr = (): {
|
|
91
|
+
row: {
|
|
92
|
+
type: PropType<TableFieldHeadRow | TableFieldBodyRow>
|
|
93
|
+
required: true
|
|
94
|
+
}
|
|
95
|
+
} => ({
|
|
96
|
+
row: {
|
|
97
|
+
type: Object as PropType<TableFieldHeadRow | TableFieldBodyRow>,
|
|
98
|
+
required: true,
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Gets native Vue props for a component rendering `th` elements from a Prismic
|
|
104
|
+
* table field with `<PrismicTable />`.
|
|
105
|
+
*
|
|
106
|
+
* Props are: `["cell"]`
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* ```javascript
|
|
111
|
+
* // Defining a new rich text component
|
|
112
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
113
|
+
*
|
|
114
|
+
* defineProps(getTableComponentProps.th())
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export const th = (): {
|
|
118
|
+
cell: { type: PropType<TableFieldHeaderCell>; required: true }
|
|
119
|
+
} => ({
|
|
120
|
+
cell: { type: Object as PropType<TableFieldHeaderCell>, required: true },
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Gets native Vue props for a component rendering `td` elements from a Prismic
|
|
125
|
+
* table field with `<PrismicTable />`.
|
|
126
|
+
*
|
|
127
|
+
* Props are: `["cell"]`
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
*
|
|
131
|
+
* ```javascript
|
|
132
|
+
* // Defining a new rich text component
|
|
133
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
134
|
+
*
|
|
135
|
+
* defineProps(getTableComponentProps.td())
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export const td = (): {
|
|
139
|
+
cell: { type: PropType<TableFieldDataCell>; required: true }
|
|
140
|
+
} => ({
|
|
141
|
+
cell: { type: Object as PropType<TableFieldDataCell>, required: true },
|
|
142
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as getTableComponentProps from "./getTableComponentProps"
|