@prismicio/vue 3.1.4 → 3.2.1
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/components/PrismicEmbed.cjs.map +1 -1
- package/dist/components/PrismicEmbed.d.ts +57 -63
- package/dist/components/PrismicEmbed.js.map +1 -1
- package/dist/components/PrismicImage.cjs +2 -2
- package/dist/components/PrismicImage.cjs.map +1 -1
- package/dist/components/PrismicImage.d.ts +162 -162
- package/dist/components/PrismicImage.js +2 -2
- package/dist/components/PrismicImage.js.map +1 -1
- package/dist/components/PrismicLink.cjs +3 -3
- package/dist/components/PrismicLink.cjs.map +1 -1
- package/dist/components/PrismicLink.d.ts +191 -191
- package/dist/components/PrismicLink.js +3 -3
- package/dist/components/PrismicLink.js.map +1 -1
- package/dist/components/PrismicRichText.cjs +10 -5
- package/dist/components/PrismicRichText.cjs.map +1 -1
- package/dist/components/PrismicRichText.d.ts +160 -139
- package/dist/components/PrismicRichText.js +10 -5
- package/dist/components/PrismicRichText.js.map +1 -1
- package/dist/components/PrismicText.cjs +1 -1
- package/dist/components/PrismicText.cjs.map +1 -1
- package/dist/components/PrismicText.d.ts +117 -117
- package/dist/components/PrismicText.js +1 -1
- package/dist/components/PrismicText.js.map +1 -1
- package/dist/components/SliceZone.cjs +1 -1
- package/dist/components/SliceZone.cjs.map +1 -1
- package/dist/components/SliceZone.d.ts +357 -359
- package/dist/components/SliceZone.js +1 -1
- package/dist/components/SliceZone.js.map +1 -1
- package/dist/components/index.d.ts +12 -12
- package/dist/composables.cjs.map +1 -1
- package/dist/composables.d.ts +366 -366
- package/dist/composables.js.map +1 -1
- package/dist/createPrismic.cjs +3 -3
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.d.ts +12 -12
- package/dist/createPrismic.js +3 -3
- package/dist/createPrismic.js.map +1 -1
- package/dist/globalExtensions.d.ts +11 -11
- package/dist/index.cjs +16 -16
- package/dist/index.d.ts +10 -10
- package/dist/index.js +3 -3
- package/dist/injectionSymbols.cjs.map +1 -1
- package/dist/injectionSymbols.d.ts +9 -9
- package/dist/injectionSymbols.js.map +1 -1
- package/dist/lib/__PRODUCTION__.d.ts +7 -7
- package/dist/lib/getSlots.d.ts +14 -14
- package/dist/lib/isInternalURL.d.ts +8 -8
- package/dist/lib/simplyResolveComponent.cjs.map +1 -1
- package/dist/lib/simplyResolveComponent.d.ts +12 -12
- package/dist/lib/simplyResolveComponent.js.map +1 -1
- package/dist/types.d.ts +366 -357
- package/dist/usePrismic.cjs.map +1 -1
- package/dist/usePrismic.d.ts +21 -21
- package/dist/usePrismic.js.map +1 -1
- package/dist/useStatefulPrismicClientMethod.cjs.map +1 -1
- package/dist/useStatefulPrismicClientMethod.d.ts +64 -64
- package/dist/useStatefulPrismicClientMethod.js.map +1 -1
- package/package.json +31 -23
- package/src/components/PrismicEmbed.ts +10 -5
- package/src/components/PrismicImage.ts +20 -15
- package/src/components/PrismicLink.ts +23 -16
- package/src/components/PrismicRichText.ts +44 -18
- package/src/components/PrismicText.ts +13 -9
- package/src/components/SliceZone.ts +12 -8
- package/src/composables.ts +2 -5
- package/src/createPrismic.ts +18 -21
- package/src/injectionSymbols.ts +0 -2
- package/src/lib/simplyResolveComponent.ts +8 -2
- package/src/types.ts +24 -16
- package/src/usePrismic.ts +2 -1
- package/src/useStatefulPrismicClientMethod.ts +3 -3
- package/vetur/attributes.json +1 -6
- package/vetur/tags.json +17 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, watchEffect, h, markRaw } from "vue";
|
|
2
|
-
import { simplyResolveComponent } from "../lib/simplyResolveComponent.js";
|
|
3
2
|
import { __PRODUCTION__ } from "../lib/__PRODUCTION__.js";
|
|
3
|
+
import { simplyResolveComponent } from "../lib/simplyResolveComponent.js";
|
|
4
4
|
import { usePrismic } from "../usePrismic.js";
|
|
5
5
|
const getSliceComponentProps = (propsHint) => ({
|
|
6
6
|
slice: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceZone.js","sources":["../../../src/components/SliceZone.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tConcreteComponent,\n\tDefineComponent,\n\tdefineComponent,\n\tFunctionalComponent,\n\th,\n\tmarkRaw,\n\tPropType,\n\tVNodeProps,\n\twatchEffect,\n} from \"vue\";\n\nimport { Slice } from \"@prismicio/types\";\n\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { __PRODUCTION__ } from \"../lib/__PRODUCTION__\";\nimport { usePrismic } from \"../usePrismic\";\n\n/**\n * Returns the type of a `SliceLike` type.\n *\n * @typeParam TSlice - The Slice from which the type will be extracted.\n */\ntype ExtractSliceType<TSlice extends SliceLike> = TSlice extends SliceLikeRestV2\n\t? TSlice[\"slice_type\"]\n\t: TSlice extends SliceLikeGraphQL\n\t? TSlice[\"type\"]\n\t: never;\n\n/**\n * The minimum required properties to represent a Prismic Slice from the Prismic\n * Rest API V2 for the `<SliceZone>` component.\n *\n * If using Prismic's Rest API V2, use the `Slice` export from\n * `@prismicio/types` for a full interface.\n *\n * @typeParam TSliceType - Type name of the Slice.\n */\nexport type SliceLikeRestV2<TSliceType extends string = string> = {\n\tslice_type: Slice<TSliceType>[\"slice_type\"];\n\tid?: string;\n};\n\n/**\n * The minimum required properties to represent a Prismic Slice from the Prismic\n * GraphQL API for the `<SliceZone>` component.\n *\n * @typeParam TSliceType - Type name of the Slice.\n */\nexport type SliceLikeGraphQL<TSliceType extends string = string> = {\n\ttype: Slice<TSliceType>[\"slice_type\"];\n};\n\n/**\n * The minimum required properties to represent a Prismic Slice for the\n * `<SliceZone />` component.\n *\n * If using Prismic's REST API, use the `Slice` export from `@prismicio/types`\n * for a full interface.\n *\n * @typeParam TSliceType - Type name of the Slice\n */\nexport type SliceLike<TSliceType extends string = string> =\n\t| SliceLikeRestV2<TSliceType>\n\t| SliceLikeGraphQL<TSliceType>;\n\n/**\n * A looser version of the `SliceZone` type from `@prismicio/types` using\n * `SliceLike`.\n *\n * If using Prismic's REST API, use the `SliceZone` export from\n * `@prismicio/types` for the full type.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n */\nexport type SliceZoneLike<TSlice extends SliceLike = SliceLike> =\n\treadonly TSlice[];\n\n/**\n * Vue props for a component rendering content from a Prismic Slice using the\n * `<SliceZone />` component.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n */\nexport type SliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\t/**\n\t * Slice data for this component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\tindex: number;\n\n\t/**\n\t * All Slices from the Slice Zone to which the Slice belongs.\n\t */\n\t// TODO: We have to keep this list of Slices general due to circular\n\t// reference limtiations. If we had another generic to determine the full\n\t// union of Slice types, it would include TSlice. This causes TypeScript to\n\t// throw a compilation error.\n\tslices: SliceZoneLike<SliceLike>;\n\n\t/**\n\t * Arbitrary data passed to `<SliceZone />` and made available to all Slice\n\t * components.\n\t */\n\tcontext: TContext;\n};\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using\n * the `<SliceZone />` component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n */\nexport type DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>;\n\t\trequired: true;\n\t};\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>;\n\t\trequired: true;\n\t};\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>;\n\t\trequired: true;\n\t};\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>;\n\t\trequired: true;\n\t};\n};\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice\n * using the `<SliceZone />` component. Props are: `[\"slice\", \"index\", \"slices\",\n * \"context\"]`\n *\n * @example Defining a new slice component:\n *\n * ```javascript\n * import { getSliceComponentProps } from \"@prismicio/vue\";\n *\n * export default {\n * \tprops: getSliceComponentProps(),\n * };\n * ```\n *\n * @example Defining a new slice component with visual hint:\n *\n * ```javascript\n * import { getSliceComponentProps } from \"@prismicio/vue\";\n *\n * export default {\n * \tprops: getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n * };\n * ```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n * @param propsHint - An optional array of prop names used for the sole purpose\n * of having a visual hint of which props are made available to the slice,\n * this parameters doesn't have any effect\n *\n * @returns Props object to use with {@link defineComponent}\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<\n\t\t\tSliceComponentProps<TSlice, TContext>[\"context\"]\n\t\t>,\n\t\trequired: true,\n\t},\n});\n\n/**\n * A Vue component to be rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceComponentType<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> =\n\t// For reference within TypeScript files when `*.vue` type cannot be inferred\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types\n\t| DefineComponent<{}, {}, any>\n\t| DefineComponent<SliceComponentProps<TSlice, TContext>>\n\t| FunctionalComponent<SliceComponentProps<TSlice, TContext>>;\n\n/**\n * This Slice component can be used as a reminder to provide a proper\n * implementation.\n *\n * This is also the default Vue component rendered when a component mapping\n * cannot be found in `<SliceZone />`.\n */\nexport const TODOSliceComponent = __PRODUCTION__\n\t? ((() => null) as FunctionalComponent<SliceComponentProps>)\n\t: /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: getSliceComponentProps(),\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() =>\n\t\t\t\t\t\"slice_type\" in props.slice\n\t\t\t\t\t\t? props.slice.slice_type\n\t\t\t\t\t\t: props.slice.type,\n\t\t\t\t);\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t},\n\t }) as SliceComponentType);\n\n/**\n * A record of Slice types mapped to Vue components. Each components will be\n * rendered for each instance of their Slice type.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneComponents<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> =\n\t// This is purposely not wrapped in Partial to ensure a component is provided\n\t// for all Slice types. <SliceZone /> will render a default component if one is\n\t// not provided, but it *should* be a type error if an explicit component is\n\t// missing.\n\t//\n\t// If a developer purposely does not want to provide a component, they can\n\t// assign it to the TODOSliceComponent exported from this package. This\n\t// signals to future developers that it is a placeholder and should be\n\t// implemented.\n\t{\n\t\t[SliceType in ExtractSliceType<TSlice>]:\n\t\t\t| SliceComponentType<Extract<TSlice, SliceLike<SliceType>>, TContext>\n\t\t\t| string;\n\t};\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n * @example Defining a slice components:\n *\n * ```javascript\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n *\n * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>;\n\n\tlet type: keyof typeof components;\n\tfor (type in components) {\n\t\tconst component = components[type];\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t );\n\t}\n\n\treturn result;\n};\n\n/**\n * Arguments for a `<SliceZone>` `resolver` function.\n */\nexport type SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {\n\t/**\n\t * The Slice to resolve to a Vue component..\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The name of the Slice.\n\t */\n\tsliceName: ExtractSliceType<TSlice>;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\ti: number;\n};\n\n/**\n * A function that determines the rendered Vue component for each Slice in the\n * Slice Zone. If a nullish value is returned, the component will fallback to\n * the `components` or `defaultComponent` props to determine the rendered\n * component.\n *\n * @deprecated Use the `components` prop instead.\n *\n * @param args - Arguments for the resolver function.\n *\n * @returns The Vue component to render for a Slice.\n */\nexport type SliceZoneResolver<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = (\n\targs: SliceZoneResolverArgs<TSlice>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => SliceComponentType<any, TContext> | string | undefined | null;\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike;\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents?: SliceZoneComponents;\n\n\t/**\n\t * A function that determines the rendered Vue component for each Slice in the\n\t * Slice Zone.\n\t *\n\t * @deprecated Use the `components` prop instead.\n\t *\n\t * @param args - Arguments for the resolver function.\n\t *\n\t * @returns The Vue component to render for a Slice.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tresolver?: SliceZoneResolver<any, TContext>;\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext;\n\n\t/**\n\t * A component or a functional component rendered if a component mapping from\n\t * the `components` prop cannot be found.\n\t *\n\t * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the\n\t * output. The Slice Zone is not wrapped by default.\n\t */\n\twrapper?: string | ConcreteComponent;\n};\n\n/**\n * `<SliceZone />` implementation.\n *\n * @internal\n */\nexport const SliceZoneImpl = /*#__PURE__*/ defineComponent({\n\tname: \"SliceZone\",\n\tprops: {\n\t\tslices: {\n\t\t\ttype: Array as PropType<SliceZoneLike>,\n\t\t\trequired: true,\n\t\t},\n\t\tcomponents: {\n\t\t\ttype: Object as PropType<SliceZoneComponents>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tresolver: {\n\t\t\ttype: Function as PropType<SliceZoneResolver>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tcontext: {\n\t\t\ttype: null,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tdefaultComponent: {\n\t\t\ttype: Object as PropType<SliceComponentType>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twrapper: {\n\t\t\ttype: [String, Object, Function] as PropType<string | ConcreteComponent>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.slices) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\tconst { options } = usePrismic();\n\n\t\tconst renderedSlices = computed(() => {\n\t\t\treturn props.slices.map((slice, index) => {\n\t\t\t\tconst type = \"slice_type\" in slice ? slice.slice_type : slice.type;\n\n\t\t\t\tlet component =\n\t\t\t\t\tprops.components && type in props.components\n\t\t\t\t\t\t? props.components[type]\n\t\t\t\t\t\t: props.defaultComponent ||\n\t\t\t\t\t\t options.components?.sliceZoneDefaultComponent ||\n\t\t\t\t\t\t TODOSliceComponent;\n\n\t\t\t\t// TODO: Remove `resolver` in v3 in favor of `components`.\n\t\t\t\tif (props.resolver) {\n\t\t\t\t\tconst resolvedComponent = props.resolver({\n\t\t\t\t\t\tslice,\n\t\t\t\t\t\tsliceName: type,\n\t\t\t\t\t\ti: index,\n\t\t\t\t\t});\n\n\t\t\t\t\tif (resolvedComponent) {\n\t\t\t\t\t\tcomponent = resolvedComponent;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst key =\n\t\t\t\t\t\"id\" in slice && slice.id\n\t\t\t\t\t\t? slice.id\n\t\t\t\t\t\t: `${index}-${JSON.stringify(slice)}`;\n\n\t\t\t\tconst p = {\n\t\t\t\t\tkey,\n\t\t\t\t\tslice,\n\t\t\t\t\tindex,\n\t\t\t\t\tcontext: props.context,\n\t\t\t\t\tslices: props.slices,\n\t\t\t\t};\n\n\t\t\t\treturn h(simplyResolveComponent(component as ConcreteComponent), p);\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\tif (props.wrapper) {\n\t\t\t\tconst parent = simplyResolveComponent(props.wrapper);\n\n\t\t\t\tif (typeof parent === \"string\") {\n\t\t\t\t\treturn h(parent, null, renderedSlices.value);\n\t\t\t\t} else {\n\t\t\t\t\treturn h(parent, null, { default: () => renderedSlices.value });\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn renderedSlices.value;\n\t\t\t}\n\t\t};\n\t},\n});\n\n// export the public type for h/tsx inference\n// also to avoid inline import() in generated d.ts files\n/**\n * Component to render a Prismic Slice Zone.\n *\n * @see Component props {@link SliceZoneProps}\n * @see Templating Slice Zones {@link https://prismic.io/docs/technologies/vue-template-content#slices-and-groups}\n */\nexport const SliceZone = SliceZoneImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tSliceZoneProps;\n\t};\n};\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"SliceZone.js","sources":["../../../src/components/SliceZone.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tConcreteComponent,\n\tDefineComponent,\n\tFunctionalComponent,\n\tPropType,\n\tRaw,\n\tVNodeProps,\n\tcomputed,\n\tdefineComponent,\n\th,\n\tmarkRaw,\n\twatchEffect,\n} from \"vue\";\n\nimport { __PRODUCTION__ } from \"../lib/__PRODUCTION__\";\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\n\nimport { Slice } from \"@prismicio/types\";\n\nimport { usePrismic } from \"../usePrismic\";\n\n/**\n * Returns the type of a `SliceLike` type.\n *\n * @typeParam TSlice - The Slice from which the type will be extracted.\n */\ntype ExtractSliceType<TSlice extends SliceLike> = TSlice extends SliceLikeRestV2\n\t? TSlice[\"slice_type\"]\n\t: TSlice extends SliceLikeGraphQL\n\t? TSlice[\"type\"]\n\t: never;\n\n/**\n * The minimum required properties to represent a Prismic Slice from the Prismic\n * Rest API V2 for the `<SliceZone>` component.\n *\n * If using Prismic's Rest API V2, use the `Slice` export from\n * `@prismicio/types` for a full interface.\n *\n * @typeParam TSliceType - Type name of the Slice.\n */\nexport type SliceLikeRestV2<TSliceType extends string = string> = {\n\tslice_type: Slice<TSliceType>[\"slice_type\"];\n\tid?: string;\n};\n\n/**\n * The minimum required properties to represent a Prismic Slice from the Prismic\n * GraphQL API for the `<SliceZone>` component.\n *\n * @typeParam TSliceType - Type name of the Slice.\n */\nexport type SliceLikeGraphQL<TSliceType extends string = string> = {\n\ttype: Slice<TSliceType>[\"slice_type\"];\n};\n\n/**\n * The minimum required properties to represent a Prismic Slice for the\n * `<SliceZone />` component.\n *\n * If using Prismic's REST API, use the `Slice` export from `@prismicio/types`\n * for a full interface.\n *\n * @typeParam TSliceType - Type name of the Slice\n */\nexport type SliceLike<TSliceType extends string = string> =\n\t| SliceLikeRestV2<TSliceType>\n\t| SliceLikeGraphQL<TSliceType>;\n\n/**\n * A looser version of the `SliceZone` type from `@prismicio/types` using\n * `SliceLike`.\n *\n * If using Prismic's REST API, use the `SliceZone` export from\n * `@prismicio/types` for the full type.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n */\nexport type SliceZoneLike<TSlice extends SliceLike = SliceLike> =\n\treadonly TSlice[];\n\n/**\n * Vue props for a component rendering content from a Prismic Slice using the\n * `<SliceZone />` component.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n */\nexport type SliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\t/**\n\t * Slice data for this component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\tindex: number;\n\n\t/**\n\t * All Slices from the Slice Zone to which the Slice belongs.\n\t */\n\t// TODO: We have to keep this list of Slices general due to circular\n\t// reference limtiations. If we had another generic to determine the full\n\t// union of Slice types, it would include TSlice. This causes TypeScript to\n\t// throw a compilation error.\n\tslices: SliceZoneLike<SliceLike>;\n\n\t/**\n\t * Arbitrary data passed to `<SliceZone />` and made available to all Slice\n\t * components.\n\t */\n\tcontext: TContext;\n};\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using\n * the `<SliceZone />` component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n */\nexport type DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>;\n\t\trequired: true;\n\t};\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>;\n\t\trequired: true;\n\t};\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>;\n\t\trequired: true;\n\t};\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>;\n\t\trequired: true;\n\t};\n};\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice\n * using the `<SliceZone />` component. Props are: `[\"slice\", \"index\", \"slices\",\n * \"context\"]`\n *\n * @example Defining a new slice component:\n *\n * ```javascript\n * import { getSliceComponentProps } from \"@prismicio/vue\";\n *\n * export default {\n * \tprops: getSliceComponentProps(),\n * };\n * ```\n *\n * @example Defining a new slice component with visual hint:\n *\n * ```javascript\n * import { getSliceComponentProps } from \"@prismicio/vue\";\n *\n * export default {\n * \tprops: getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n * };\n * ```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n * @param propsHint - An optional array of prop names used for the sole purpose\n * of having a visual hint of which props are made available to the slice,\n * this parameters doesn't have any effect\n *\n * @returns Props object to use with {@link defineComponent}\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<\n\t\t\tSliceComponentProps<TSlice, TContext>[\"context\"]\n\t\t>,\n\t\trequired: true,\n\t},\n});\n\n/**\n * A Vue component to be rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceComponentType<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> =\n\t// For reference within TypeScript files when `*.vue` type cannot be inferred\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types\n\t| DefineComponent<{}, {}, any>\n\t| DefineComponent<SliceComponentProps<TSlice, TContext>>\n\t| FunctionalComponent<SliceComponentProps<TSlice, TContext>>;\n\n/**\n * This Slice component can be used as a reminder to provide a proper\n * implementation.\n *\n * This is also the default Vue component rendered when a component mapping\n * cannot be found in `<SliceZone />`.\n */\nexport const TODOSliceComponent = __PRODUCTION__\n\t? ((() => null) as FunctionalComponent<SliceComponentProps>)\n\t: /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: getSliceComponentProps(),\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() =>\n\t\t\t\t\t\"slice_type\" in props.slice\n\t\t\t\t\t\t? props.slice.slice_type\n\t\t\t\t\t\t: props.slice.type,\n\t\t\t\t);\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t},\n\t }) as SliceComponentType);\n\n/**\n * A record of Slice types mapped to Vue components. Each components will be\n * rendered for each instance of their Slice type.\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneComponents<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> =\n\t// This is purposely not wrapped in Partial to ensure a component is provided\n\t// for all Slice types. <SliceZone /> will render a default component if one is\n\t// not provided, but it *should* be a type error if an explicit component is\n\t// missing.\n\t//\n\t// If a developer purposely does not want to provide a component, they can\n\t// assign it to the TODOSliceComponent exported from this package. This\n\t// signals to future developers that it is a placeholder and should be\n\t// implemented.\n\t{\n\t\t[SliceType in ExtractSliceType<TSlice>]:\n\t\t\t| SliceComponentType<Extract<TSlice, SliceLike<SliceType>>, TContext>\n\t\t\t| string;\n\t};\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n * @example Defining a slice components:\n *\n * ```javascript\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n *\n * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>;\n\n\tlet type: keyof typeof components;\n\tfor (type in components) {\n\t\tconst component = components[type];\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t );\n\t}\n\n\treturn result;\n};\n\n/**\n * Arguments for a `<SliceZone>` `resolver` function.\n */\nexport type SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {\n\t/**\n\t * The Slice to resolve to a Vue component..\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The name of the Slice.\n\t */\n\tsliceName: ExtractSliceType<TSlice>;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\ti: number;\n};\n\n/**\n * A function that determines the rendered Vue component for each Slice in the\n * Slice Zone. If a nullish value is returned, the component will fallback to\n * the `components` or `defaultComponent` props to determine the rendered\n * component.\n *\n * @deprecated Use the `components` prop instead.\n *\n * @param args - Arguments for the resolver function.\n *\n * @returns The Vue component to render for a Slice.\n */\nexport type SliceZoneResolver<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = (\n\targs: SliceZoneResolverArgs<TSlice>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => SliceComponentType<any, TContext> | string | undefined | null;\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike;\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents?: SliceZoneComponents;\n\n\t/**\n\t * A function that determines the rendered Vue component for each Slice in the\n\t * Slice Zone.\n\t *\n\t * @deprecated Use the `components` prop instead.\n\t *\n\t * @param args - Arguments for the resolver function.\n\t *\n\t * @returns The Vue component to render for a Slice.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tresolver?: SliceZoneResolver<any, TContext>;\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext;\n\n\t/**\n\t * A component or a functional component rendered if a component mapping from\n\t * the `components` prop cannot be found.\n\t *\n\t * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the\n\t * output. The Slice Zone is not wrapped by default.\n\t */\n\twrapper?: string | ConcreteComponent | Raw<DefineComponent>;\n};\n\n/**\n * `<SliceZone />` implementation.\n *\n * @internal\n */\nexport const SliceZoneImpl = /*#__PURE__*/ defineComponent({\n\tname: \"SliceZone\",\n\tprops: {\n\t\tslices: {\n\t\t\ttype: Array as PropType<SliceZoneLike>,\n\t\t\trequired: true,\n\t\t},\n\t\tcomponents: {\n\t\t\ttype: Object as PropType<SliceZoneComponents>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tresolver: {\n\t\t\ttype: Function as PropType<SliceZoneResolver>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tcontext: {\n\t\t\ttype: null,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tdefaultComponent: {\n\t\t\ttype: Object as PropType<SliceComponentType>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twrapper: {\n\t\t\ttype: [String, Object, Function] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.slices) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\tconst { options } = usePrismic();\n\n\t\tconst renderedSlices = computed(() => {\n\t\t\treturn props.slices.map((slice, index) => {\n\t\t\t\tconst type = \"slice_type\" in slice ? slice.slice_type : slice.type;\n\n\t\t\t\tlet component =\n\t\t\t\t\tprops.components && type in props.components\n\t\t\t\t\t\t? props.components[type]\n\t\t\t\t\t\t: props.defaultComponent ||\n\t\t\t\t\t\t options.components?.sliceZoneDefaultComponent ||\n\t\t\t\t\t\t TODOSliceComponent;\n\n\t\t\t\t// TODO: Remove `resolver` in v3 in favor of `components`.\n\t\t\t\tif (props.resolver) {\n\t\t\t\t\tconst resolvedComponent = props.resolver({\n\t\t\t\t\t\tslice,\n\t\t\t\t\t\tsliceName: type,\n\t\t\t\t\t\ti: index,\n\t\t\t\t\t});\n\n\t\t\t\t\tif (resolvedComponent) {\n\t\t\t\t\t\tcomponent = resolvedComponent;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst key =\n\t\t\t\t\t\"id\" in slice && slice.id\n\t\t\t\t\t\t? slice.id\n\t\t\t\t\t\t: `${index}-${JSON.stringify(slice)}`;\n\n\t\t\t\tconst p = {\n\t\t\t\t\tkey,\n\t\t\t\t\tslice,\n\t\t\t\t\tindex,\n\t\t\t\t\tcontext: props.context,\n\t\t\t\t\tslices: props.slices,\n\t\t\t\t};\n\n\t\t\t\treturn h(simplyResolveComponent(component as ConcreteComponent), p);\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\tif (props.wrapper) {\n\t\t\t\tconst parent = simplyResolveComponent(props.wrapper);\n\n\t\t\t\tif (typeof parent === \"string\") {\n\t\t\t\t\treturn h(parent, null, renderedSlices.value);\n\t\t\t\t} else {\n\t\t\t\t\treturn h(parent, null, { default: () => renderedSlices.value });\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn renderedSlices.value;\n\t\t\t}\n\t\t};\n\t},\n});\n\n// export the public type for h/tsx inference\n// also to avoid inline import() in generated d.ts files\n/**\n * Component to render a Prismic Slice Zone.\n *\n * @see Component props {@link SliceZoneProps}\n * @see Templating Slice Zones {@link https://prismic.io/docs/technologies/vue-template-content#slices-and-groups}\n */\nexport const SliceZone = SliceZoneImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tSliceZoneProps;\n\t};\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { PrismicEmbedImpl, PrismicEmbed } from "./PrismicEmbed";
|
|
2
|
-
export type { PrismicEmbedProps } from "./PrismicEmbed";
|
|
3
|
-
export { usePrismicImage, PrismicImageImpl, PrismicImage, } from "./PrismicImage";
|
|
4
|
-
export type { UsePrismicImageOptions, PrismicImageProps } from "./PrismicImage";
|
|
5
|
-
export { usePrismicLink, PrismicLinkImpl, PrismicLink } from "./PrismicLink";
|
|
6
|
-
export type { UsePrismicLinkOptions, PrismicLinkProps } from "./PrismicLink";
|
|
7
|
-
export { usePrismicText, PrismicTextImpl, PrismicText } from "./PrismicText";
|
|
8
|
-
export type { UsePrismicTextOptions, PrismicTextProps } from "./PrismicText";
|
|
9
|
-
export { usePrismicRichText, PrismicRichTextImpl, PrismicRichText, } from "./PrismicRichText";
|
|
10
|
-
export type { UsePrismicRichTextOptions, PrismicRichTextProps, } from "./PrismicRichText";
|
|
11
|
-
export { getSliceComponentProps, TODOSliceComponent, defineSliceZoneComponents, SliceZoneImpl, SliceZone, } from "./SliceZone";
|
|
12
|
-
export type { DefineComponentSliceComponentProps, SliceComponentProps, SliceComponentType, SliceLikeRestV2, SliceLikeGraphQL, SliceLike, SliceZoneComponents, SliceZoneResolverArgs, SliceZoneResolver, SliceZoneLike, SliceZoneProps, } from "./SliceZone";
|
|
1
|
+
export { PrismicEmbedImpl, PrismicEmbed } from "./PrismicEmbed";
|
|
2
|
+
export type { PrismicEmbedProps } from "./PrismicEmbed";
|
|
3
|
+
export { usePrismicImage, PrismicImageImpl, PrismicImage, } from "./PrismicImage";
|
|
4
|
+
export type { UsePrismicImageOptions, PrismicImageProps } from "./PrismicImage";
|
|
5
|
+
export { usePrismicLink, PrismicLinkImpl, PrismicLink } from "./PrismicLink";
|
|
6
|
+
export type { UsePrismicLinkOptions, PrismicLinkProps } from "./PrismicLink";
|
|
7
|
+
export { usePrismicText, PrismicTextImpl, PrismicText } from "./PrismicText";
|
|
8
|
+
export type { UsePrismicTextOptions, PrismicTextProps } from "./PrismicText";
|
|
9
|
+
export { usePrismicRichText, PrismicRichTextImpl, PrismicRichText, } from "./PrismicRichText";
|
|
10
|
+
export type { UsePrismicRichTextOptions, PrismicRichTextProps, } from "./PrismicRichText";
|
|
11
|
+
export { getSliceComponentProps, TODOSliceComponent, defineSliceZoneComponents, SliceZoneImpl, SliceZone, } from "./SliceZone";
|
|
12
|
+
export type { DefineComponentSliceComponentProps, SliceComponentProps, SliceComponentType, SliceLikeRestV2, SliceLikeGraphQL, SliceLike, SliceZoneComponents, SliceZoneResolverArgs, SliceZoneResolver, SliceZoneLike, SliceZoneProps, } from "./SliceZone";
|
package/dist/composables.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composables.cjs","sources":["../../src/composables.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n// Imports for @link references:\n\nimport type { Client } from \"@prismicio/client\";\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport { PrismicDocument, Query } from \"@prismicio/types\";\n\nimport {\n\tClientMethodParameters,\n\tClientComposableReturnType,\n\tuseStatefulPrismicClientMethod,\n\tComposableOnlyParameters,\n} from \"./useStatefulPrismicClientMethod\";\n\n// Composables\n\n/**\n * A composable that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.get}\n */\nexport const usePrismicDocuments = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"get\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A composable that queries content from the Prismic repository and returns\n * only the first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getFirst}\n */\nexport const useFirstPrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"getFirst\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByID}\n */\nexport const usePrismicDocumentByID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByUID}\n */\nexport const usePrismicDocumentByUID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByUIDs\">[0],\n\t\tids: ClientMethodParameters<\"getAllByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getAllByUIDs\">[2] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A composable that queries a singleton document from the Prismic repository\n * for a specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getSingle}\n */\nexport const useSinglePrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A composable that queries documents from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByType}\n */\nexport const usePrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with a\n * specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTag}\n */\nexport const usePrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with a\n * specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with all of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with at least one of the queried\n * tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be\n * slower and require more resources than other composables. Prefer using other\n * composables that filter by predicates such as\n * `useAllPrismicDocumentsByType`.\n *\n * A composable that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be\n * fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAll}\n */\nexport const dangerouslyUseAllPrismicDocuments = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n"],"names":["useStatefulPrismicClientMethod"],"mappings":";;;AAiCO,MAAM,sBAAsB,IAC/B,SAIHA,+BAAAA,+BAA+B,OAAO,IAAI;AAiBpC,MAAM,0BAA0B,IACnC,SAIHA,+BAAAA,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,yBAAyB,IAClC,SAKHA,+BAAAA,+BAA+B,WAAW,IAAI;AAkBxC,MAAM,2BAA2B,IACpC,SAKHA,+BAAAA,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IACvC,SAMHA,+BAAAA,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,0BAA0B,IACnC,SAMHA,+BAAAA,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,4BAA4B,IACrC,SAMHA,+BAAAA,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,+BAA+B,IACxC,SAOHA,+BAAAA,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IACpC,SAKHA,+BAAAA,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,4BAA4B,IACrC,SAKHA,+BAAAA,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,+BAA+B,IACxC,SAMHA,+BAAAA,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IACpC,SAKHA,+BAAAA,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IACvC,SAMHA,+BAAAA,+BAA+B,eAAe,IAAI;AAkB5C,MAAM,gCAAgC,IAGzC,SAMHA,+BAAAA,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAMHA,+BAAAA,+BAA+B,oBAAoB,IAAI;AAmBjD,MAAM,gCAAgC,IAGzC,SAMHA,+BAAAA,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAMHA,+BAAAA,+BAA+B,oBAAoB,IAAI;AAuBjD,MAAM,oCAAoC,IAG7C,SAKHA,+BAAA,+BAA+B,qBAAqB,IAAI;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"composables.cjs","sources":["../../src/composables.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n// Imports for @link references:\nimport type { Client } from \"@prismicio/client\";\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\nimport { PrismicDocument, Query } from \"@prismicio/types\";\n\nimport {\n\tClientComposableReturnType,\n\tClientMethodParameters,\n\tComposableOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n// Composables\n\n/**\n * A composable that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.get}\n */\nexport const usePrismicDocuments = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"get\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A composable that queries content from the Prismic repository and returns\n * only the first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getFirst}\n */\nexport const useFirstPrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"getFirst\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByID}\n */\nexport const usePrismicDocumentByID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByUID}\n */\nexport const usePrismicDocumentByUID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByUIDs\">[0],\n\t\tids: ClientMethodParameters<\"getAllByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getAllByUIDs\">[2] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A composable that queries a singleton document from the Prismic repository\n * for a specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getSingle}\n */\nexport const useSinglePrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A composable that queries documents from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByType}\n */\nexport const usePrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with a\n * specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTag}\n */\nexport const usePrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with a\n * specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with all of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with at least one of the queried\n * tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be\n * slower and require more resources than other composables. Prefer using other\n * composables that filter by predicates such as\n * `useAllPrismicDocumentsByType`.\n *\n * A composable that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be\n * fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAll}\n */\nexport const dangerouslyUseAllPrismicDocuments = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n"],"names":["useStatefulPrismicClientMethod"],"mappings":";;;AA8BO,MAAM,sBAAsB,IAC/B,SAIHA,+BAAAA,+BAA+B,OAAO,IAAI;AAiBpC,MAAM,0BAA0B,IACnC,SAIHA,+BAAAA,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,yBAAyB,IAClC,SAKHA,+BAAAA,+BAA+B,WAAW,IAAI;AAkBxC,MAAM,2BAA2B,IACpC,SAKHA,+BAAAA,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IACvC,SAMHA,+BAAAA,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,0BAA0B,IACnC,SAMHA,+BAAAA,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,4BAA4B,IACrC,SAMHA,+BAAAA,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,+BAA+B,IACxC,SAOHA,+BAAAA,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IACpC,SAKHA,+BAAAA,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,4BAA4B,IACrC,SAKHA,+BAAAA,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,+BAA+B,IACxC,SAMHA,+BAAAA,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IACpC,SAKHA,+BAAAA,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IACvC,SAMHA,+BAAAA,+BAA+B,eAAe,IAAI;AAkB5C,MAAM,gCAAgC,IAGzC,SAMHA,+BAAAA,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAMHA,+BAAAA,+BAA+B,oBAAoB,IAAI;AAmBjD,MAAM,gCAAgC,IAGzC,SAMHA,+BAAAA,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAMHA,+BAAAA,+BAA+B,oBAAoB,IAAI;AAuBjD,MAAM,oCAAoC,IAG7C,SAKHA,+BAAA,+BAA+B,qBAAqB,IAAI;;;;;;;;;;;;;;;;;;;"}
|