@prismicio/vue 3.0.0-alpha.1 → 3.0.0-alpha.5

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/index.mjs CHANGED
@@ -1,18 +1,14 @@
1
- import isomorphicUnfetch from 'isomorphic-unfetch';
2
- import { createClient, getEndpoint, predicate, cookie } from '@prismicio/client';
3
- import { documentAsLink, asLink, asText, asHTML, Element, asDate, documentToLinkField } from '@prismicio/helpers';
4
- import { resolveDynamicComponent, defineComponent, h, inject, computed, reactive, unref, ref, watch, nextTick, onBeforeUnmount, watchEffect, markRaw, shallowRef, isRef } from 'vue';
1
+ import { getEndpoint, createClient, predicate, cookie } from '@prismicio/client';
2
+ import { asLink, asText, asHTML, asDate, documentToLinkField } from '@prismicio/helpers';
3
+ import { resolveDynamicComponent, defineComponent, h, inject, computed, unref, reactive, ref, watch, nextTick, onBeforeUnmount, watchEffect, markRaw, shallowRef, isRef } from 'vue';
5
4
  import { routerKey } from 'vue-router';
6
- import escapeHTML from 'escape-html';
7
- import { LinkType } from '@prismicio/types';
8
- import { composeSerializers, wrapMapSerializer } from '@prismicio/richtext';
9
5
 
10
6
  const simplyResolveComponent = (component) => {
11
7
  return resolveDynamicComponent(component);
12
8
  };
13
9
 
14
10
  const defaultWrapper$2 = "div";
15
- const PrismicEmbedImpl = defineComponent({
11
+ const PrismicEmbedImpl = /* @__PURE__ */ defineComponent({
16
12
  name: "PrismicEmbed",
17
13
  props: {
18
14
  field: {
@@ -48,7 +44,7 @@ const usePrismic = () => {
48
44
  };
49
45
 
50
46
  const defaultImageComponent = "img";
51
- const PrismicImageImpl = defineComponent({
47
+ const PrismicImageImpl = /* @__PURE__ */ defineComponent({
52
48
  name: "PrismicImage",
53
49
  props: {
54
50
  field: {
@@ -129,10 +125,10 @@ const usePrismicLink = (props) => {
129
125
  return href.value && isInternalURL(href.value) && !target.value ? internalComponent : externalComponent;
130
126
  });
131
127
  const href = computed(() => {
132
- var _a, _b, _c;
128
+ var _a, _b;
133
129
  const field = unref(props.field);
134
130
  const linkResolver = (_a = unref(props.linkResolver)) != null ? _a : options.linkResolver;
135
- return "data" in field && field.data ? (_b = documentAsLink(field, linkResolver)) != null ? _b : "" : (_c = asLink(field, linkResolver)) != null ? _c : "";
131
+ return (_b = asLink(field, linkResolver)) != null ? _b : "";
136
132
  });
137
133
  const target = computed(() => {
138
134
  const field = unref(props.field);
@@ -140,8 +136,7 @@ const usePrismicLink = (props) => {
140
136
  });
141
137
  const rel = computed(() => {
142
138
  var _a;
143
- const field = unref(props.field);
144
- return unref(props.rel) || (target.value === "_blank" && field && "target" in field && field ? unref(props.blankTargetRelAttribute) || ((_a = options.components) == null ? void 0 : _a.linkBlankTargetRelAttribute) || defaultBlankTargetRelAttribute : null);
139
+ return unref(props.rel) || (target.value === "_blank" ? unref(props.blankTargetRelAttribute) || ((_a = options.components) == null ? void 0 : _a.linkBlankTargetRelAttribute) || defaultBlankTargetRelAttribute : null);
145
140
  });
146
141
  return {
147
142
  type,
@@ -150,7 +145,7 @@ const usePrismicLink = (props) => {
150
145
  rel
151
146
  };
152
147
  };
153
- const PrismicLinkImpl = defineComponent({
148
+ const PrismicLinkImpl = /* @__PURE__ */ defineComponent({
154
149
  name: "PrismicLink",
155
150
  props: {
156
151
  field: {
@@ -215,7 +210,7 @@ const usePrismicText = (props) => {
215
210
  text
216
211
  };
217
212
  };
218
- const PrismicTextImpl = defineComponent({
213
+ const PrismicTextImpl = /* @__PURE__ */ defineComponent({
219
214
  name: "PrismicText",
220
215
  props: {
221
216
  field: {
@@ -249,43 +244,19 @@ const PrismicTextImpl = defineComponent({
249
244
  const PrismicText = PrismicTextImpl;
250
245
 
251
246
  const defaultWrapper = "div";
252
- const serializeVueHyperlink = (linkResolver, node, children) => {
253
- switch (node.data.link_type) {
254
- case LinkType.Web: {
255
- return `<a href="${escapeHTML(node.data.url)}" target="${node.data.target}" rel="noopener noreferrer">${children.join("")}</a>`;
256
- }
257
- case LinkType.Document: {
258
- return `<a data-router-link href="${asLink(node.data, linkResolver)}">${children.join("")}</a>`;
259
- }
260
- case LinkType.Media: {
261
- return `<a href="${node.data.url}">${children.join("")}</a>`;
262
- }
263
- }
264
- };
265
247
  const usePrismicRichText = (props) => {
266
248
  const { options } = usePrismic();
267
249
  const html = computed(() => {
268
250
  var _a, _b;
269
251
  const linkResolver = (_a = unref(props.linkResolver)) != null ? _a : options.linkResolver;
270
- const maybeSerializer = (_b = unref(props.htmlSerializer)) != null ? _b : options.htmlSerializer;
271
- let serializer = (_type, node, _content, children, _key) => {
272
- switch (node.type) {
273
- case Element.hyperlink:
274
- return serializeVueHyperlink(linkResolver, node, children);
275
- default:
276
- return null;
277
- }
278
- };
279
- if (maybeSerializer) {
280
- serializer = composeSerializers(typeof maybeSerializer === "object" ? wrapMapSerializer(maybeSerializer) : maybeSerializer, serializer);
281
- }
282
- return asHTML(unref(props.field), linkResolver, serializer);
252
+ const htmlSerializer = (_b = unref(props.htmlSerializer)) != null ? _b : options.htmlSerializer;
253
+ return asHTML(unref(props.field), linkResolver, htmlSerializer);
283
254
  });
284
255
  return {
285
256
  html
286
257
  };
287
258
  };
288
- const PrismicRichTextImpl = defineComponent({
259
+ const PrismicRichTextImpl = /* @__PURE__ */ defineComponent({
289
260
  name: "PrismicRichText",
290
261
  props: {
291
262
  field: {
@@ -316,31 +287,29 @@ const PrismicRichTextImpl = defineComponent({
316
287
  const root = ref(null);
317
288
  const maybeRouter = inject(routerKey, null);
318
289
  if (maybeRouter) {
319
- let links = null;
320
- const navigate = (event) => {
321
- let target = event.target;
322
- let i = 0;
323
- while (i < 5 && target && !(target instanceof HTMLAnchorElement) && target.parentNode) {
324
- target = target.parentNode;
325
- i++;
326
- }
327
- if (!(target instanceof HTMLAnchorElement)) {
328
- return;
329
- }
330
- const href = target.getAttribute("href");
331
- if (href && isInternalURL(href)) {
332
- event.preventDefault();
333
- maybeRouter.push(href);
334
- }
290
+ let links = [];
291
+ const navigate = function(event) {
292
+ event.preventDefault();
293
+ maybeRouter.push(this.href);
335
294
  };
336
295
  const addListeners = () => {
337
296
  const node = root.value && "$el" in root.value ? root.value.$el : root.value;
338
- links = node && node.querySelectorAll && node.querySelectorAll("a[data-router-link]");
339
- links && links.forEach((link) => link.addEventListener("click", navigate));
297
+ if (node && "querySelectorAll" in node) {
298
+ links = Array.from(node.querySelectorAll("a")).map((element) => {
299
+ const href = element.getAttribute("href");
300
+ if (href && isInternalURL(href)) {
301
+ const listener = navigate.bind({ href });
302
+ element.addEventListener("click", listener);
303
+ return { element, listener };
304
+ } else {
305
+ return false;
306
+ }
307
+ }).filter((link) => link);
308
+ }
340
309
  };
341
310
  const removeListeners = () => {
342
- links == null ? void 0 : links.forEach((link) => link.removeEventListener("click", navigate));
343
- links = null;
311
+ links.forEach(({ element, listener }) => element.removeEventListener("click", listener));
312
+ links = [];
344
313
  };
345
314
  watch(html, () => {
346
315
  removeListeners();
@@ -365,7 +334,7 @@ if (typeof process === "undefined") {
365
334
  }
366
335
  const __PRODUCTION__ = process.env.NODE_ENV === "production";
367
336
 
368
- const getSliceComponentProps = () => ({
337
+ const getSliceComponentProps = (propsHint) => ({
369
338
  slice: {
370
339
  type: Object,
371
340
  required: true
@@ -383,7 +352,7 @@ const getSliceComponentProps = () => ({
383
352
  required: true
384
353
  }
385
354
  });
386
- const TODOSliceComponent = __PRODUCTION__ ? () => null : defineComponent({
355
+ const TODOSliceComponent = __PRODUCTION__ ? () => null : /* @__PURE__ */ defineComponent({
387
356
  name: "TODOSliceCOmponent",
388
357
  props: getSliceComponentProps(),
389
358
  setup(props) {
@@ -409,7 +378,7 @@ const getSliceZoneComponents = (components) => {
409
378
  }
410
379
  return result;
411
380
  };
412
- const SliceZoneImpl = defineComponent({
381
+ const SliceZoneImpl = /* @__PURE__ */ defineComponent({
413
382
  name: "SliceZone",
414
383
  props: {
415
384
  slices: {
@@ -471,11 +440,30 @@ const SliceZoneImpl = defineComponent({
471
440
  const SliceZone = SliceZoneImpl;
472
441
 
473
442
  const createPrismic = (options) => {
443
+ let client;
444
+ if (options.client) {
445
+ client = options.client;
446
+ } else {
447
+ const endpoint = /^(https?:)?\/\//gim.test(options.endpoint) ? options.endpoint : getEndpoint(options.endpoint);
448
+ if (options.clientConfig && typeof options.clientConfig.fetch === "function") {
449
+ client = createClient(endpoint, options.clientConfig);
450
+ } else {
451
+ client = createClient(endpoint, {
452
+ ...options.clientConfig,
453
+ fetch: async (endpoint2, options2) => {
454
+ let fetchFunction;
455
+ if (typeof globalThis.fetch === "function") {
456
+ fetchFunction = globalThis.fetch;
457
+ } else {
458
+ fetchFunction = (await import('isomorphic-unfetch')).default;
459
+ }
460
+ return await fetchFunction(endpoint2, options2);
461
+ }
462
+ });
463
+ }
464
+ }
474
465
  const prismicClient = {
475
- client: options.client ? options.client : createClient(/^(https?:)?\/\//gim.test(options.endpoint) ? options.endpoint : getEndpoint(options.endpoint), {
476
- fetch: isomorphicUnfetch,
477
- ...options.clientConfig
478
- }),
466
+ client,
479
467
  predicate,
480
468
  cookie
481
469
  };
@@ -488,10 +476,7 @@ const createPrismic = (options) => {
488
476
  return asLink(linkField, linkResolver || options.linkResolver);
489
477
  },
490
478
  asDate,
491
- documentToLinkField,
492
- documentAsLink: (prismicDocument, linkResolver) => {
493
- return documentAsLink(prismicDocument, linkResolver || options.linkResolver);
494
- }
479
+ documentToLinkField
495
480
  };
496
481
  const prismic = {
497
482
  options,
@@ -554,17 +539,22 @@ const useStatefulPrismicClientMethod = (methodName, args) => {
554
539
 
555
540
  const usePrismicDocuments = (...args) => useStatefulPrismicClientMethod("get", args);
556
541
  const useFirstPrismicDocument = (...args) => useStatefulPrismicClientMethod("getFirst", args);
557
- const useAllPrismicDocuments = (...args) => useStatefulPrismicClientMethod("getAll", args);
558
542
  const usePrismicDocumentByID = (...args) => useStatefulPrismicClientMethod("getByID", args);
559
543
  const usePrismicDocumentsByIDs = (...args) => useStatefulPrismicClientMethod("getByIDs", args);
560
544
  const useAllPrismicDocumentsByIDs = (...args) => useStatefulPrismicClientMethod("getAllByIDs", args);
561
545
  const usePrismicDocumentByUID = (...args) => useStatefulPrismicClientMethod("getByUID", args);
546
+ const usePrismicDocumentsByUIDs = (...args) => useStatefulPrismicClientMethod("getByUIDs", args);
547
+ const useAllPrismicDocumentsByUIDs = (...args) => useStatefulPrismicClientMethod("getAllByUIDs", args);
562
548
  const useSinglePrismicDocument = (...args) => useStatefulPrismicClientMethod("getSingle", args);
563
549
  const usePrismicDocumentsByType = (...args) => useStatefulPrismicClientMethod("getByType", args);
564
550
  const useAllPrismicDocumentsByType = (...args) => useStatefulPrismicClientMethod("getAllByType", args);
565
551
  const usePrismicDocumentsByTag = (...args) => useStatefulPrismicClientMethod("getByTag", args);
566
552
  const useAllPrismicDocumentsByTag = (...args) => useStatefulPrismicClientMethod("getAllByTag", args);
567
- const usePrismicDocumentsByTags = (...args) => useStatefulPrismicClientMethod("getByTags", args);
568
- const useAllPrismicDocumentsByTags = (...args) => useStatefulPrismicClientMethod("getAllByTags", args);
553
+ const usePrismicDocumentsByEveryTag = (...args) => useStatefulPrismicClientMethod("getByEveryTag", args);
554
+ const useAllPrismicDocumentsByEveryTag = (...args) => useStatefulPrismicClientMethod("getAllByEveryTag", args);
555
+ const usePrismicDocumentsBySomeTags = (...args) => useStatefulPrismicClientMethod("getBySomeTags", args);
556
+ const useAllPrismicDocumentsBySomeTags = (...args) => useStatefulPrismicClientMethod("getAllBySomeTags", args);
557
+ const dangerouslyUseAllPrismicDocuments = (...args) => useStatefulPrismicClientMethod("dangerouslyGetAll", args);
569
558
 
570
- export { PrismicClientComposableState, PrismicEmbed, PrismicImage, PrismicLink, PrismicRichText, PrismicText, SliceZone, SliceZoneImpl, TODOSliceComponent, createPrismic, getSliceComponentProps, getSliceZoneComponents, prismicKey, useAllPrismicDocuments, useAllPrismicDocumentsByIDs, useAllPrismicDocumentsByTag, useAllPrismicDocumentsByTags, useAllPrismicDocumentsByType, useFirstPrismicDocument, usePrismic, usePrismicDocumentByID, usePrismicDocumentByUID, usePrismicDocuments, usePrismicDocumentsByIDs, usePrismicDocumentsByTag, usePrismicDocumentsByTags, usePrismicDocumentsByType, usePrismicLink, usePrismicRichText, usePrismicText, useSinglePrismicDocument };
559
+ export { PrismicClientComposableState, PrismicEmbed, PrismicImage, PrismicLink, PrismicRichText, PrismicText, SliceZone, SliceZoneImpl, TODOSliceComponent, createPrismic, dangerouslyUseAllPrismicDocuments, getSliceComponentProps, getSliceZoneComponents, prismicKey, useAllPrismicDocumentsByEveryTag, useAllPrismicDocumentsByIDs, useAllPrismicDocumentsBySomeTags, useAllPrismicDocumentsByTag, useAllPrismicDocumentsByType, useAllPrismicDocumentsByUIDs, useFirstPrismicDocument, usePrismic, usePrismicDocumentByID, usePrismicDocumentByUID, usePrismicDocuments, usePrismicDocumentsByEveryTag, usePrismicDocumentsByIDs, usePrismicDocumentsBySomeTags, usePrismicDocumentsByTag, usePrismicDocumentsByType, usePrismicDocumentsByUIDs, usePrismicLink, usePrismicRichText, usePrismicText, useSinglePrismicDocument };
560
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/lib/simplyResolveComponent.ts","../src/components/PrismicEmbed.ts","../src/injectionSymbols.ts","../src/usePrismic.ts","../src/components/PrismicImage.ts","../src/lib/isInternalURL.ts","../src/lib/getSlots.ts","../src/components/PrismicLink.ts","../src/components/PrismicText.ts","../src/components/PrismicRichText.ts","../src/lib/__PRODUCTION__.ts","../src/components/SliceZone.ts","../src/createPrismic.ts","../src/types.ts","../src/useStatefulPrismicClientMethod.ts","../src/composables.ts"],"sourcesContent":["import { ConcreteComponent, resolveDynamicComponent, VNode } from \"vue\";\n\n/**\n * A stricter version of {@link resolveDynamicComponent} that resolves only type\n * {@link VNode} for existing components or provided `string`.\n *\n * @param component - An HTML tag name, a component, or a functional component\n *\n * @returns Resolved component as a {@link VNode} or provided `string`.\n * @internal\n */\nexport const simplyResolveComponent = (\n\tcomponent: string | ConcreteComponent,\n): string | VNode => {\n\treturn resolveDynamicComponent(component) as string | VNode;\n};\n","import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tConcreteComponent,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n} from \"vue\";\n\nimport { EmbedField } from \"@prismicio/types\";\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\n\n/**\n * The default component rendered to wrap the embed.\n */\nconst defaultWrapper = \"div\";\n\n/**\n * Props for `<PrismicEmbed />`.\n */\nexport type PrismicEmbedProps = {\n\t/**\n\t * The Prismic embed field to render.\n\t */\n\tfield: EmbedField;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent;\n};\n\n/**\n * `<PrismicEmbed />` implementation.\n *\n * @internal\n */\nexport const PrismicEmbedImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicEmbed\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Object as PropType<EmbedField>,\n\t\t\trequired: true,\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.field) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\treturn () => {\n\t\t\treturn h(simplyResolveComponent(props.wrapper || defaultWrapper), {\n\t\t\t\t\"data-oembed\": props.field.embed_url,\n\t\t\t\t\"data-oembed-type\": props.field.type,\n\t\t\t\t\"data-oembed-provider\": props.field.provider_name,\n\t\t\t\tinnerHTML: props.field.html || null,\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 embed field.\n *\n * @see Component props {@link PrismicEmbedProps}\n * @see Templating embed fields {@link https://prismic.io/docs/technologies/vue-template-content#embeds}\n */\nexport const PrismicEmbed = PrismicEmbedImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicEmbedProps;\n\t};\n};\n","import type { InjectionKey } from \"vue\";\n\nimport type { PrismicPlugin } from \"./types\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n// Imports for @link references:\n\nimport type { usePrismic } from \"./usePrismic\";\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * `@prismicio/vue` plugin interface interface location used for {@link usePrismic}.\n *\n * @internal\n */\nexport const prismicKey = Symbol(\"prismic\") as InjectionKey<PrismicPlugin>;\n","import { inject } from \"vue\";\n\nimport { prismicKey } from \"./injectionSymbols\";\nimport { PrismicPlugin } from \"./types\";\n\n/**\n * Accesses `@prismicio/vue` plugin interface.\n *\n * @example With the composition API:\n *\n * ```javascript\n * import { usePrismic } from \"@prismicio/vue\";\n *\n * export default {\n * \tsetup() {\n * \t\tconst prismic = usePrismic();\n *\n * \t\treturn {};\n * \t},\n * };\n * ```\n *\n * @returns The interface {@link PrismicPlugin}\n */\nexport const usePrismic = (): PrismicPlugin => {\n\treturn inject(prismicKey, { options: { endpoint: \"\" } } as PrismicPlugin);\n};\n","import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tConcreteComponent,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n} from \"vue\";\n\nimport { ImageField } from \"@prismicio/types\";\n\nimport { usePrismic } from \"../usePrismic\";\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\n\n/**\n * The default component rendered for images.\n */\nconst defaultImageComponent = \"img\";\n\n/**\n * Props for `<PrismicImage />`.\n */\nexport type PrismicImageProps = {\n\t/**\n\t * The Prismic image field to render.\n\t */\n\tfield: ImageField;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render images.\n\t *\n\t * @remarks\n\t * HTML tag names and components will be rendered using the `img` tag\n\t * interface (`src` and `alt` attribute). Components will also receive an\n\t * additional `copyright` props.\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"img\"` otherwise.\n\t */\n\timageComponent?: string | ConcreteComponent;\n\n\t/**\n\t * A map of additional props to pass to the component used to render images\n\t * when using one.\n\t */\n\timageComponentAdditionalProps?: Record<string, unknown>;\n};\n\n/**\n * `<PrismicImage />` implementation.\n *\n * @internal\n */\nexport const PrismicImageImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicImage\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Object as PropType<ImageField>,\n\t\t\trequired: true,\n\t\t},\n\t\timageComponent: {\n\t\t\ttype: [String, Object] as PropType<string | ConcreteComponent>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\timageComponentAdditionalProps: {\n\t\t\ttype: Object as PropType<Record<string, unknown>>,\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.field) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\tconst { options } = usePrismic();\n\n\t\tconst type = computed(() => {\n\t\t\treturn (\n\t\t\t\tprops.imageComponent ||\n\t\t\t\toptions.components?.imageComponent ||\n\t\t\t\tdefaultImageComponent\n\t\t\t);\n\t\t});\n\n\t\treturn () => {\n\t\t\tconst attributes = {\n\t\t\t\tsrc: props.field.url || null,\n\t\t\t\talt: props.field.alt || null,\n\t\t\t};\n\n\t\t\tswitch (type.value) {\n\t\t\t\tcase \"img\":\n\t\t\t\t\t// Fitting img tag interface\n\t\t\t\t\treturn h(\"img\", attributes);\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn h(simplyResolveComponent(type.value), {\n\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\tcopyright: props.field.copyright || null,\n\t\t\t\t\t\t...props.imageComponentAdditionalProps,\n\t\t\t\t\t});\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 image field.\n *\n * @see Component props {@link PrismicImageProps}\n * @see Templating image fields {@link https://prismic.io/docs/technologies/vue-template-content#images}\n */\nexport const PrismicImage = PrismicImageImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicImageProps;\n\t};\n};\n","/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external\n *\n * @returns `true` if `url` is internal, `false` otherwise\n */\n// TODO: This does not detect all relative URLs as internal, such as `about` or `./about`. This function assumes relative URLs start with a \"/\"`.\nexport const isInternalURL = (url: string): boolean => {\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/1y7iod/1}\n\t */\n\tconst isInternal = /^\\/(?!\\/)/.test(url);\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/RnUseS/1}\n\t */\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//i.test(url);\n\n\treturn isInternal && !isSpecialLink;\n};\n","import { ConcreteComponent, Slots, VNode } from \"vue\";\n\n/**\n * Get the appropriate `slots` object/array according to the provided parent,\n * fixing `Non-function value encountered for default slot.` warnings.\n *\n * @param parent - The parent inheriting slots\n * @param slots - The `slots` to transform for parent\n * @param defaultParams - The parameters to provide to the default slot\n *\n * @returns The appropriate slots object/array\n * @internal\n */\nexport const getSlots = (\n\tparent: string | ConcreteComponent,\n\tslots: Slots,\n\tdefaultPayload?: unknown,\n): VNode[] | undefined | Slots => {\n\tif (typeof parent === \"string\") {\n\t\treturn slots.default && slots.default(defaultPayload);\n\t} else {\n\t\tif (slots.default) {\n\t\t\tconst content = slots.default(defaultPayload);\n\n\t\t\treturn {\n\t\t\t\t...slots,\n\t\t\t\tdefault: () => content,\n\t\t\t};\n\t\t} else {\n\t\t\treturn slots;\n\t\t}\n\t}\n};\n","import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n\tunref,\n\treactive,\n\tConcreteComponent,\n\tcomputed,\n\tComputedRef,\n} from \"vue\";\n\nimport { asLink, LinkResolverFunction } from \"@prismicio/helpers\";\nimport { LinkField, PrismicDocument } from \"@prismicio/types\";\n\nimport { isInternalURL } from \"../lib/isInternalURL\";\nimport { usePrismic } from \"../usePrismic\";\nimport { VueUseOptions } from \"../types\";\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { getSlots } from \"../lib/getSlots\";\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\";\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\";\n\n/**\n * The default rel attribute rendered for blank target URLs.\n */\nconst defaultBlankTargetRelAttribute = \"noopener noreferrer\";\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The Prismic link field or document to render.\n\t */\n\tfield: LinkField | PrismicDocument;\n\n\t/**\n\t * A link resolver function used to resolve links when not using the route\n\t * resolver parameter with `@prismicio/client`.\n\t *\n\t * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.\n\t * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * An explicit `target` attribute to apply to the rendered link.\n\t */\n\ttarget?: string;\n\n\t/**\n\t * An explicit `rel` attribute to apply to the rendered link.\n\t */\n\trel?: string;\n\n\t/**\n\t * Value of the `rel` attribute to use on links rendered with `target=\"_blank\"`.\n\t *\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"noopener noreferrer\"` otherwise.\n\t */\n\tblankTargetRelAttribute?: string;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * internal links.\n\t *\n\t * @remarks\n\t * HTML tag names will be rendered using the anchor tag interface (`href`,\n\t * `target`, and `rel` attributes).\n\t * @remarks\n\t * Components will be rendered using Vue Router {@link RouterLink} interface\n\t * (`to` props).\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, {@link RouterLink} otherwise.\n\t */\n\tinternalComponent?: string | ConcreteComponent;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * external links.\n\t *\n\t * @remarks\n\t * HTML tag names will be rendered using the anchor tag interface (`href`,\n\t * `target`, and `rel` attributes).\n\t * @remarks\n\t * Components will be rendered using Vue Router {@link RouterLink} interface\n\t * (`to` props).\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"a\"` otherwise.\n\t */\n\texternalComponent?: string | ConcreteComponent;\n};\n\n/**\n * Options for {@link usePrismicLink}.\n */\nexport type UsePrismicLinkOptions = VueUseOptions<PrismicLinkProps>;\n\n/**\n * Return type of {@link usePrismicLink}.\n */\nexport type UsePrismicLinkReturnType = {\n\t/**\n\t * Suggested component to render for provided link field.\n\t */\n\ttype: ComputedRef<string | ConcreteComponent>;\n\n\t/**\n\t * Resolved anchor `href` value.\n\t */\n\thref: ComputedRef<string>;\n\n\t/**\n\t * Resolved anchor `target` value.\n\t */\n\ttarget: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved anchor `rel` value.\n\t */\n\trel: ComputedRef<string | null>;\n};\n\n/**\n * A low level composable that returns resolved information about a Prismic link field.\n *\n * @param props - {@link UsePrismicLinkOptions}\n *\n * @returns - Resolved link information {@link UsePrismicLinkReturnType}\n */\nexport const usePrismicLink = (\n\tprops: UsePrismicLinkOptions,\n): UsePrismicLinkReturnType => {\n\tconst { options } = usePrismic();\n\n\tconst type = computed(() => {\n\t\tconst internalComponent =\n\t\t\tunref(props.internalComponent) ||\n\t\t\toptions.components?.linkInternalComponent ||\n\t\t\tdefaultInternalComponent;\n\n\t\tconst externalComponent =\n\t\t\tunref(props.externalComponent) ||\n\t\t\toptions.components?.linkExternalComponent ||\n\t\t\tdefaultExternalComponent;\n\n\t\treturn href.value && isInternalURL(href.value) && !target.value\n\t\t\t? internalComponent\n\t\t\t: externalComponent;\n\t});\n\tconst href = computed(() => {\n\t\tconst field = unref(props.field);\n\t\tconst linkResolver = unref(props.linkResolver) ?? options.linkResolver;\n\n\t\treturn asLink(field, linkResolver) ?? \"\";\n\t});\n\tconst target = computed(() => {\n\t\tconst field = unref(props.field);\n\n\t\treturn (\n\t\t\tunref(props.target) ||\n\t\t\t(field && \"target\" in field && field.target ? field.target : null)\n\t\t);\n\t});\n\tconst rel = computed(() => {\n\t\treturn (\n\t\t\tunref(props.rel) ||\n\t\t\t(target.value === \"_blank\"\n\t\t\t\t? unref(props.blankTargetRelAttribute) ||\n\t\t\t\t options.components?.linkBlankTargetRelAttribute ||\n\t\t\t\t defaultBlankTargetRelAttribute\n\t\t\t\t: null)\n\t\t);\n\t});\n\n\treturn {\n\t\ttype,\n\t\thref,\n\t\ttarget,\n\t\trel,\n\t};\n};\n\n/**\n * `<PrismicLink />` implementation.\n *\n * @internal\n */\nexport const PrismicLinkImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicLink\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Object as PropType<LinkField | PrismicDocument>,\n\t\t\trequired: true,\n\t\t},\n\t\tlinkResolver: {\n\t\t\ttype: Function as PropType<LinkResolverFunction>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\ttarget: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\trel: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tblankTargetRelAttribute: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tinternalComponent: {\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\texternalComponent: {\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, { slots }) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.field) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\tconst { type, href, target, rel } = usePrismicLink(props);\n\n\t\treturn () => {\n\t\t\tconst parent =\n\t\t\t\ttype.value === \"a\" ? \"a\" : simplyResolveComponent(type.value);\n\t\t\tconst computedSlots = getSlots(\n\t\t\t\tparent,\n\t\t\t\tslots,\n\t\t\t\treactive({ href: href.value }),\n\t\t\t);\n\n\t\t\tif (typeof parent === \"string\") {\n\t\t\t\t// Fitting anchor tag interface\n\t\t\t\treturn h(\n\t\t\t\t\tparent,\n\t\t\t\t\t{ href: href.value, target: target.value, rel: rel.value },\n\t\t\t\t\tcomputedSlots,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Fitting Vue Router Link interface\n\t\t\t\treturn h(parent, { to: href.value }, computedSlots);\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 link field.\n *\n * @see Component props {@link PrismicLinkProps}\n * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}\n */\nexport const PrismicLink = PrismicLinkImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicLinkProps;\n\t};\n};\n","import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tComputedRef,\n\tConcreteComponent,\n\tdefineComponent,\n\th,\n\tPropType,\n\tunref,\n\tVNode,\n\tVNodeProps,\n} from \"vue\";\n\nimport { asText } from \"@prismicio/helpers\";\nimport { RichTextField } from \"@prismicio/types\";\n\nimport { VueUseOptions } from \"../types\";\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\n\n/**\n * The default component rendered to wrap the text output.\n */\nconst defaultWrapper = \"div\";\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text or title field to render.\n\t */\n\tfield: RichTextField;\n\n\t/**\n\t * Separator used to join each element.\n\t *\n\t * @defaultValue `\" \"` (a space)\n\t */\n\tseparator?: string;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent;\n};\n\n/**\n * Options for {@link usePrismicText}.\n */\nexport type UsePrismicTextOptions = VueUseOptions<\n\tOmit<PrismicTextProps, \"wrapper\">\n>;\n\n/**\n * Return type of {@link usePrismicText}.\n */\nexport type UsePrismicTextReturnType = {\n\t/**\n\t * Serialized rich text field as plain text.\n\t */\n\ttext: ComputedRef<string>;\n};\n\n/**\n * A low level composable that returns a serialized rich text field as plain text.\n *\n * @param props - {@link UsePrismicTextOptions}\n *\n * @returns - Serialized rich text field as plain text {@link UsePrismicTextReturnType}\n */\nexport const usePrismicText = (\n\tprops: UsePrismicTextOptions,\n): UsePrismicTextReturnType => {\n\tconst text = computed(() => {\n\t\treturn asText(unref(props.field), unref(props.separator));\n\t});\n\n\treturn {\n\t\ttext,\n\t};\n};\n\n/**\n * `<PrismicText />` implementation.\n *\n * @internal\n */\nexport const PrismicTextImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicText\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Array as unknown as PropType<RichTextField>,\n\t\t\trequired: true,\n\t\t},\n\t\tseparator: {\n\t\t\ttype: String as PropType<string>,\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.field) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\tconst { text } = usePrismicText(props);\n\n\t\treturn () => {\n\t\t\tconst parent = simplyResolveComponent(props.wrapper || defaultWrapper);\n\n\t\t\t// This works but is absurd\n\t\t\t// if (typeof parent === \"string\") {\n\t\t\t// \treturn h(parent, null, { default: () => text.value });\n\t\t\t// } else {\n\t\t\t// \treturn h(parent, null, { default: () => text.value });\n\t\t\t// }\n\n\t\t\treturn h(parent as VNode, null, {\n\t\t\t\tdefault: () => text.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 rich text field as plain text.\n *\n * @see Component props {@link PrismicTextProps}\n * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n */\nexport const PrismicText = PrismicTextImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicTextProps;\n\t};\n};\n","import {\n\tAllowedComponentProps,\n\tComponent,\n\tComponentCustomProps,\n\tcomputed,\n\tComputedRef,\n\tConcreteComponent,\n\tdefineComponent,\n\th,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tPropType,\n\tref,\n\tunref,\n\tVNodeProps,\n\twatch,\n} from \"vue\";\nimport { routerKey } from \"vue-router\";\n\nimport {\n\tasHTML,\n\tHTMLFunctionSerializer,\n\tHTMLMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/helpers\";\nimport { RichTextField } from \"@prismicio/types\";\n\nimport { VueUseOptions } from \"../types\";\nimport { usePrismic } from \"../usePrismic\";\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { isInternalURL } from \"../lib/isInternalURL\";\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\";\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text or title field to render.\n\t */\n\tfield: RichTextField;\n\n\t/**\n\t * A link resolver function used to resolve link when not using the route\n\t * resolver parameter with `@prismicio/client`.\n\t *\n\t * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.\n\t * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * An HTML serializer to customize the way rich text fields are rendered.\n\t *\n\t * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.\n\t * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent;\n};\n\n/**\n * Options for {@link usePrismicRichText}.\n */\nexport type UsePrismicRichTextOptions = VueUseOptions<\n\tOmit<PrismicRichTextProps, \"wrapper\">\n>;\n\n/**\n * Return type of {@link usePrismicRichText}.\n */\nexport type UsePrismicRichTextReturnType = {\n\t/**\n\t * Serialized rich text field as HTML.\n\t */\n\thtml: ComputedRef<string>;\n};\n\n/**\n * A low level composable that returns a serialized rich text field as HTML.\n *\n * @param props - {@link UsePrismicRichTextOptions}\n *\n * @returns - Serialized rich text field as HTML {@link UsePrismicRichTextReturnType}\n */\nexport const usePrismicRichText = (\n\tprops: UsePrismicRichTextOptions,\n): UsePrismicRichTextReturnType => {\n\tconst { options } = usePrismic();\n\n\tconst html = computed(() => {\n\t\tconst linkResolver = unref(props.linkResolver) ?? options.linkResolver;\n\t\tconst htmlSerializer =\n\t\t\tunref(props.htmlSerializer) ?? options.htmlSerializer;\n\n\t\treturn asHTML(unref(props.field), linkResolver, htmlSerializer);\n\t});\n\n\treturn {\n\t\thtml,\n\t};\n};\n\n/**\n * `<PrismicRichText />` implementation.\n *\n * @internal\n */\nexport const PrismicRichTextImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicRichText\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Array as unknown as PropType<RichTextField>,\n\t\t\trequired: true,\n\t\t},\n\t\tlinkResolver: {\n\t\t\ttype: Function as PropType<LinkResolverFunction>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\thtmlSerializer: {\n\t\t\ttype: [Function, Object] as PropType<\n\t\t\t\tHTMLFunctionSerializer | HTMLMapSerializer\n\t\t\t>,\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.field) {\n\t\t\treturn () => null;\n\t\t}\n\n\t\tconst { html } = usePrismicRichText(props);\n\n\t\tconst root = ref<HTMLElement | Comment | Component | null>(null);\n\n\t\tconst maybeRouter = inject(routerKey, null);\n\t\tif (maybeRouter) {\n\t\t\ttype InternalLink = {\n\t\t\t\telement: HTMLAnchorElement;\n\t\t\t\tlistener: EventListener;\n\t\t\t};\n\t\t\tlet links: InternalLink[] = [];\n\n\t\t\tconst navigate: EventListener = function (\n\t\t\t\tthis: { href: string },\n\t\t\t\tevent: Event,\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmaybeRouter.push(this.href);\n\t\t\t};\n\n\t\t\tconst addListeners = () => {\n\t\t\t\tconst node: HTMLElement | Comment | null =\n\t\t\t\t\troot.value && \"$el\" in root.value ? root.value.$el : root.value;\n\t\t\t\tif (node && \"querySelectorAll\" in node) {\n\t\t\t\t\t// Get all internal link tags and add listeners on them\n\t\t\t\t\tlinks = Array.from(node.querySelectorAll(\"a\"))\n\t\t\t\t\t\t.map((element) => {\n\t\t\t\t\t\t\tconst href = element.getAttribute(\"href\");\n\n\t\t\t\t\t\t\tif (href && isInternalURL(href)) {\n\t\t\t\t\t\t\t\tconst listener = navigate.bind({ href });\n\t\t\t\t\t\t\t\telement.addEventListener(\"click\", listener);\n\n\t\t\t\t\t\t\t\treturn { element, listener };\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter((link): link is InternalLink => link as boolean);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst removeListeners = () => {\n\t\t\t\tlinks.forEach(({ element, listener }) =>\n\t\t\t\t\telement.removeEventListener(\"click\", listener),\n\t\t\t\t);\n\t\t\t\tlinks = [];\n\t\t\t};\n\n\t\t\twatch(\n\t\t\t\thtml,\n\t\t\t\t() => {\n\t\t\t\t\tremoveListeners();\n\t\t\t\t\tnextTick(addListeners);\n\t\t\t\t},\n\t\t\t\t{ immediate: true },\n\t\t\t);\n\n\t\t\tonBeforeUnmount(() => {\n\t\t\t\tremoveListeners();\n\t\t\t});\n\t\t}\n\n\t\treturn () => {\n\t\t\treturn h(simplyResolveComponent(props.wrapper || defaultWrapper), {\n\t\t\t\tinnerHTML: html.value,\n\t\t\t\tref: root,\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 rich text field as HTML.\n *\n * @see Component props {@link PrismicRichTextProps}\n * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n */\nexport const PrismicRichText = PrismicRichTextImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicRichTextProps;\n\t};\n};\n","// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process;\n}\n\n/**\n * `true` if in the production environment, `false` otherwise.\n *\n * This boolean can be used to perform actions only in development environments,\n * such as logging.\n */\nexport const __PRODUCTION__ = process.env.NODE_ENV === \"production\";\n","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 * 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> = Pick<\n\tSlice<TSliceType>,\n\t\"slice_type\"\n>;\n\n/**\n * A looser version of the `SliceZone` type from `@prismicio/types` using `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> = readonly 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\tTSlice extends SliceLike = SliceLike,\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 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 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 DefineComponentSliceComponentProps<\n\tTSlice extends SliceLike = SliceLike,\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 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 * @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\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: string[],\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\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> =\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 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\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${props.slice.slice_type}\"`,\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\": props.slice.slice_type,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t`Could not find a component for Slice type \"${props.slice.slice_type}\"`,\n\t\t\t\t\t\t],\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 keyof Record<TSlice[\"slice_type\"], never>]:\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 { getSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: getSliceZoneComponents({\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 * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const getSliceZoneComponents = <\n\tTSlice extends SliceLike = SliceLike,\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 * Props for `<SliceZone />`.\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 SliceZoneProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<TSlice>;\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents: SliceZoneComponents;\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 * @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\tdefaultComponent?: SliceComponentType<TSlice, 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<SliceLike>>,\n\t\t\trequired: true,\n\t\t},\n\t\tcomponents: {\n\t\t\ttype: Object as PropType<SliceZoneComponents>,\n\t\t\trequired: true,\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 component =\n\t\t\t\t\tslice.slice_type in props.components\n\t\t\t\t\t\t? props.components[slice.slice_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\tconst p = {\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","import { App } from \"vue\";\n\nimport {\n\tcreateClient,\n\tgetEndpoint,\n\tpredicate,\n\tcookie,\n\tClient,\n\tFetchLike,\n} from \"@prismicio/client\";\nimport {\n\tasDate,\n\tasHTML,\n\tasLink,\n\tasText,\n\tdocumentToLinkField,\n} from \"@prismicio/helpers\";\n\nimport {\n\tPrismicEmbed,\n\tPrismicImage,\n\tPrismicLink,\n\tPrismicRichText,\n\tPrismicText,\n\tSliceZone,\n} from \"./components\";\nimport { prismicKey } from \"./injectionSymbols\";\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\";\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 * @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\tconst endpoint =\n\t\t\t/**\n\t\t\t * @see Regex101 expression: {@link https://regex101.com/r/GT2cl7/1}\n\t\t\t */\n\t\t\t/^(https?:)?\\/\\//gim.test(options.endpoint)\n\t\t\t\t? options.endpoint\n\t\t\t\t: getEndpoint(options.endpoint);\n\n\t\tif (\n\t\t\toptions.clientConfig &&\n\t\t\ttypeof options.clientConfig.fetch === \"function\"\n\t\t) {\n\t\t\tclient = createClient(endpoint, options.clientConfig);\n\t\t} else {\n\t\t\tclient = createClient(endpoint, {\n\t\t\t\t...options.clientConfig,\n\t\t\t\tfetch: async (endpoint, options) => {\n\t\t\t\t\tlet fetchFunction: FetchLike;\n\t\t\t\t\tif (typeof globalThis.fetch === \"function\") {\n\t\t\t\t\t\tfetchFunction = globalThis.fetch;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfetchFunction = (await import(\"isomorphic-unfetch\")).default;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn await fetchFunction(endpoint, options);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tpredicate,\n\t\tcookie,\n\t};\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, linkResolver, htmlSerializer) => {\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\tlinkResolver || options.linkResolver,\n\t\t\t\thtmlSerializer || options.htmlSerializer,\n\t\t\t);\n\t\t},\n\t\tasLink: (linkField, linkResolver) => {\n\t\t\treturn asLink(linkField, linkResolver || options.linkResolver);\n\t\t},\n\t\tasDate,\n\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","import type { App, ConcreteComponent, Ref } from \"vue\";\n\nimport type {\n\tClient,\n\tClientConfig,\n\tcookie,\n\tpredicate,\n} from \"@prismicio/client\";\nimport type {\n\tasText,\n\tasHTML,\n\tasLink,\n\tasDate,\n\tdocumentToLinkField,\n\tHTMLFunctionSerializer,\n\tHTMLMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/helpers\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n// Imports for @link references:\n\nimport type { RouterLink } from \"vue-router\";\n\nimport type {\n\tSliceComponentProps,\n\tTODOSliceComponent,\n} from \"./components/SliceZone\";\n\nimport type { usePrismicDocuments } from \"./composables\";\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Options used by `@prismicio/vue` components.\n */\ntype PrismicPluginComponentsOptions = {\n\t/**\n\t * Value of the `rel` attribute to use on links rendered with `target=\"_blank\"`\n\t *\n\t * @defaultValue `\"noopener noreferrer\"`\n\t */\n\tlinkBlankTargetRelAttribute?: string;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * internal links.\n\t *\n\t * @remarks\n\t * HTML tag names will be rendered using the anchor tag interface (`href`,\n\t * `target`, and `rel` attributes).\n\t * @remarks\n\t * Components will be rendered using Vue Router {@link RouterLink} interface\n\t * (`to` props).\n\t * @defaultValue {@link RouterLink}\n\t */\n\tlinkInternalComponent?: string | ConcreteComponent;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * external links.\n\t *\n\t * @remarks\n\t * HTML tag names will be rendered using the anchor tag interface (`href`,\n\t * `target`, and `rel` attributes).\n\t * @remarks\n\t * Components will be rendered using Vue Router {@link RouterLink} interface\n\t * (`to` props).\n\t * @defaultValue `\"a\"`\n\t */\n\tlinkExternalComponent?: string | ConcreteComponent;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render images.\n\t *\n\t * @remarks\n\t * HTML tag names and components will be rendered using the `img` tag\n\t * interface (`src` and `alt` attribute). Components will also receive an\n\t * additional `copyright` props.\n\t * @defaultValue `\"img\"`\n\t */\n\timageComponent?: string | ConcreteComponent;\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 * @defaultValue `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}\n\t */\n\tsliceZoneDefaultComponent?: string | ConcreteComponent;\n};\n\n/**\n * Common options supported by `@prismicio/vue` plugin.\n */\ntype PrismicPluginOptionsBase = {\n\t/**\n\t * An optional link resolver function used to resolve links to Prismic\n\t * documents when not using the route resolver parameter with `@prismicio/client`.\n\t *\n\t * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * An optional HTML serializer to customize the way rich text fields are rendered.\n\t *\n\t * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;\n\n\t/**\n\t * Whether or not to inject components globally.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinjectComponents?: boolean;\n\n\t/**\n\t * Options used by Prismic Vue components.\n\t *\n\t * @see Components options {@link PrismicPluginComponentsOptions}\n\t */\n\tcomponents?: PrismicPluginComponentsOptions;\n};\n\n/**\n * Options to init `@prismicio/vue` plugin with a client instance.\n *\n * @see {@link PrismicPluginOptionsBase} for shared options\n */\ntype PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {\n\t/**\n\t * A `@prismicio/client` instance used to fetch content from a Prismic\n\t * repository to configure the plugin with.\n\t *\n\t * @remarks\n\t * The client will be used by `@prismicio/vue` composables, such as\n\t * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and\n\t * `usePrismic().client`.\n\t * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}\n\t */\n\tclient: Client;\n\n\t/**\n\t * Ensures type union is a strict or.\n\t *\n\t * @internal\n\t */\n\tendpoint?: never;\n\n\t/**\n\t * Ensures type union is a strict or.\n\t *\n\t * @internal\n\t */\n\tclientConfig?: never;\n};\n\n/**\n * Options to init `@prismicio/vue` plugin with a repository ID or API endpoint.\n *\n * @see {@link PrismicPluginOptionsBase} for shared options\n */\ntype PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {\n\t/**\n\t * A Prismic repository endpoint to init the plugin's `@prismicio/client`\n\t * instance used to fetch content from a Prismic repository with.\n\t *\n\t * @remarks\n\t * Said client will be used by `@prismicio/vue` composables, such as\n\t * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and\n\t * `usePrismic().client`.\n\t * @example A repository ID:\n\t *\n\t * \"my-repo\";\n\t *\n\t * @example A full repository endpoint:\n\t *\n\t * \"https://my-repo.cdn.prismic.io/api/v2\";\n\t *\n\t * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}\n\t */\n\tendpoint: string;\n\n\t/**\n\t * An optional object to configure `@prismicio/client` instance further.\n\t *\n\t * @example Accessing a private private repository:\n\t *\n\t * ```javascript\n\t * {\n\t * \t\"accessToken\": \"abc\"\n\t * }\n\t * ```\n\t *\n\t * @example Using a route resolver:\n\t *\n\t * ```javascript\n\t * {\n\t * \t\"defaultParams\": {\n\t * \t\t\"routes\": [\n\t * \t\t\t{\n\t * \t\t\t\t\"type\": \"page\",\n\t * \t\t\t\t\"path\": \"/:uid\"\n\t * \t\t\t},\n\t * \t\t\t{\n\t * \t\t\t\t\"type\": \"post\",\n\t * \t\t\t\t\"path\": \"/blog/:uid\"\n\t * \t\t\t}\n\t * \t\t]\n\t * \t}\n\t * }\n\t * ```\n\t *\n\t * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}\n\t * @see Route resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}\n\t */\n\tclientConfig?: ClientConfig;\n\n\t/**\n\t * Ensures type union is a strict or.\n\t *\n\t * @internal\n\t */\n\tclient?: never;\n};\n\n/**\n * `@prismicio/vue` plugin options.\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 type PrismicPluginOptions =\n\t| PrismicPluginOptionsWithClient\n\t| PrismicPluginOptionsWithEndpoint;\n\n/**\n * `@prismicio/client` related methods and properties exposed by\n * `@prismicio/vue` plugin and accessible through `this.$prismic` and `usePrismic()`.\n */\nexport type PrismicPluginClient = {\n\t/**\n\t * A `@prismicio/client` instance.\n\t */\n\tclient: Client;\n\n\t/**\n\t * Query predicates from `@prismicio/client`.\n\t */\n\tpredicate: typeof predicate;\n\n\t/**\n\t * Prismic cookies from `@prismicio/client`.\n\t */\n\tcookie: typeof cookie;\n};\n\n/**\n * `@prismicio/helpers` related methods exposed by `@prismicio/vue` plugin and\n * accessible through `this.$prismic` and `usePrismic()`.\n */\nexport type PrismicPluginHelpers = {\n\t/**\n\t * Serializes a rich text or title field to a plain text string. This is\n\t * `@prismicio/helpers` {@link asText} function.\n\t *\n\t * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n\t */\n\tasText: typeof asText;\n\n\t/**\n\t * Serializes a rich text or title field to an HTML string. This is\n\t * `@prismicio/helpers` {@link asHTML} function.\n\t *\n\t * @remarks\n\t * If no `linkResolver` is provided the function will use the one provided to\n\t * the plugin at {@link PrismicPluginOptions.linkResolver} if available.\n\t * @remarks\n\t * If no `htmlSerializer` is provided the function will use the one provided\n\t * to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.\n\t * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n\t */\n\tasHTML: typeof asHTML;\n\n\t/**\n\t * Resolves any type of link field or document to a URL. This is\n\t * `@prismicio/helpers` {@link asLink} function.\n\t *\n\t * @remarks\n\t * If no `linkResolver` is provided the function will use the one provided to\n\t * the plugin at {@link PrismicPluginOptions.linkResolver} if available.\n\t * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}\n\t */\n\tasLink: (\n\t\tlinkField: Parameters<typeof asLink>[0],\n\t\tlinkResolver?: LinkResolverFunction,\n\t) => string | null;\n\n\t/**\n\t * Transforms a date or timestamp field into a JavaScript Date object. This is\n\t * `@prismicio/helpers` {@link asDate} function.\n\t */\n\tasDate: typeof asDate;\n\n\t/**\n\t * Converts a document into a link field. This is `@prismicio/helpers`\n\t * {@link documentToLinkField} function.\n\t *\n\t * @internal\n\t */\n\tdocumentToLinkField: typeof documentToLinkField;\n};\n\n/**\n * Methods and properties exposed by `@prismicio/vue` plugin and accessible\n * through `this.$prismic` and `usePrismic()`.\n */\nexport type PrismicPlugin = {\n\t/**\n\t * Options uses to initialize the plugin.\n\t *\n\t * @see `@prismicio/vue` plugin options {@link PrismicPluginOptions}\n\t */\n\treadonly options: PrismicPluginOptions;\n\n\t/**\n\t * `@prismicio/vue` plugin install function used by Vue.\n\t *\n\t * @internal\n\t */\n\tinstall: (app: App) => void;\n} & PrismicPluginClient &\n\tPrismicPluginHelpers;\n\n/**\n * States of a `@prismicio/client` composable.\n */\nexport const enum PrismicClientComposableState {\n\t/**\n\t * The composable has not started fetching.\n\t */\n\tIdle = \"idle\",\n\n\t/**\n\t * The composable is fetching data.\n\t */\n\tPending = \"pending\",\n\n\t/**\n\t * The composable sucessfully fetched data.\n\t */\n\tSuccess = \"success\",\n\n\t/**\n\t * The composable failed to fetch data.\n\t */\n\tError = \"error\",\n}\n\n// Helpers\n\n/**\n * Type to transform a static object into one that allows passing Refs as values.\n *\n * @internal\n */\nexport type VueUseOptions<T> = {\n\t[K in keyof T]: Ref<T[K]> | T[K];\n};\n\n/**\n * Type to transform a static tuple into one that allows passing Refs as values.\n *\n * @internal\n */\nexport type VueUseParameters<T> = {\n\t[K in keyof T]: T extends number ? Ref<T[K]> | T[K] : T[K];\n};\n","import { isRef, ref, Ref, shallowRef, unref, watch } from \"vue\";\n\nimport {\n\tClient,\n\tForbiddenError,\n\tParsingError,\n\tPrismicError,\n} from \"@prismicio/client\";\n\nimport { usePrismic } from \"./usePrismic\";\nimport { PrismicClientComposableState, VueUseParameters } from \"./types\";\n\n// Helpers\ntype UnwrapPromise<T> = T extends Promise<infer U> ? U : T;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ClientMethodLike = (...args: any[]) => Promise<any> | any;\ntype ClientMethods = typeof Client.prototype;\ntype ClientError = PrismicError<unknown> | ParsingError | ForbiddenError;\n\n// Interfaces\n\n/**\n * @internal\n */\nexport type ClientMethodParameters<TMethodName extends keyof ClientMethods> =\n\tClientMethods[TMethodName] extends ClientMethodLike\n\t\t? VueUseParameters<Parameters<ClientMethods[TMethodName]>>\n\t\t: never;\n\n/**\n * @internal\n */\nexport type ClientMethodReturnType<TMethodName extends keyof ClientMethods> =\n\tClientMethods[TMethodName] extends ClientMethodLike\n\t\t? ReturnType<ClientMethods[TMethodName]>\n\t\t: never;\n\n/**\n * @internal\n */\nexport type ComposableOnlyParameters = {\n\tclient?: Ref<Client> | Client;\n};\n\n/**\n * The return type of a `@prismicio/client` Vue composable.\n *\n * @typeParam TData - The expected format of the `data` property of the returned object\n */\nexport type ClientComposableReturnType<TData = unknown> = {\n\t/**\n\t * The current state of the composable's client method call.\n\t */\n\tstate: Ref<PrismicClientComposableState>;\n\n\t/**\n\t * Data returned by the client.\n\t */\n\tdata: Ref<TData | null>;\n\n\t/**\n\t * Error returned by the composable's client method call if in an errror state.\n\t */\n\terror: Ref<ClientError | Error | null>;\n\n\t/**\n\t * Perform the composable's client method call again.\n\t */\n\trefresh: () => Promise<void>;\n};\n\n/**\n * Determines if a value is a `@prismicio/client` params object.\n *\n * @param value - The value to check\n *\n * @returns `true` if `value` is a `@prismicio/client` params object, `false` otherwise\n */\nconst isParams = (\n\tvalue: unknown,\n): value is ClientMethodParameters<\"get\">[0] & ComposableOnlyParameters => {\n\t// This is a *very* naive check.\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * A low level Vue composable that uses provided method name on plugin or\n * provided client with given arguments. The composable has its own internal\n * state manager to report async status, such as pending or error statuses.\n *\n * @typeParam TClientMethodName - A method name from `@prismicio/client`\n * @typeParam TClientMethodArguments - The method expected arguments\n * @typeParam TClientMethodReturnType - The method expected return type\n * @param method - The `@prismicio/client` method name to use\n * @param args - The arguments to use with requested method\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n * @internal\n */\nexport const useStatefulPrismicClientMethod = <\n\tTClientMethodName extends keyof ClientMethods,\n\tTClientMethodArguments extends ClientMethodParameters<TClientMethodName>,\n\tTClientMethodReturnType extends UnwrapPromise<\n\t\tClientMethodReturnType<TClientMethodName>\n\t>,\n>(\n\tmethodName: TClientMethodName,\n\targs: TClientMethodArguments,\n): ClientComposableReturnType<TClientMethodReturnType> => {\n\tconst { client } = usePrismic();\n\n\tconst state = ref<PrismicClientComposableState>(\n\t\tPrismicClientComposableState.Idle,\n\t);\n\tconst data = shallowRef<TClientMethodReturnType | null>(null);\n\tconst error = ref<ClientError | Error | null>(null);\n\tconst refresh = async (): Promise<void> => {\n\t\tconst lastArg = unref(args[args.length - 1]);\n\t\tconst { client: explicitClient, ...params } = isParams(lastArg)\n\t\t\t? (lastArg as ClientMethodParameters<\"get\">[0] & ComposableOnlyParameters)\n\t\t\t: ({} as ComposableOnlyParameters);\n\t\tconst argsWithoutParams = isParams(lastArg) ? args.slice(0, -1) : args;\n\n\t\tstate.value = PrismicClientComposableState.Pending;\n\t\tdata.value = null;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tdata.value = await (\n\t\t\t\t(unref(explicitClient) || client)[methodName] as ClientMethodLike\n\t\t\t)(\n\t\t\t\t...argsWithoutParams.map((arg: Ref<unknown> | unknown) => unref(arg)),\n\t\t\t\tparams,\n\t\t\t);\n\t\t\tstate.value = PrismicClientComposableState.Success;\n\t\t} catch (err) {\n\t\t\tstate.value = PrismicClientComposableState.Error;\n\t\t\terror.value = err as ClientError | Error;\n\t\t}\n\t};\n\n\t// Watch reactive args\n\tconst refArgs = args.filter((arg) => isRef(arg));\n\tif (refArgs.length) {\n\t\twatch(refArgs, refresh, { deep: true });\n\t}\n\n\t// Fetch once\n\trefresh();\n\n\treturn { state, data, error, refresh };\n};\n","/* 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 `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\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 `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\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 specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\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 * @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 IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\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 * @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 UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 specific UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\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 * @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 `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 fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\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":["defaultWrapper"],"mappings":";;;;;MAWa,yBAAyB,CACrC,cACoB;AACpB,SAAO,wBAAwB;AAAA;;ACEhC,MAAMA,mBAAiB;MAwBV,mDAAiD;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA;AAAA,IAEX,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ;AAAA,MACvB,SAAS;AAAA,MACT,UAAU;AAAA;AAAA;AAAA,EAGZ,MAAM,OAAO;AAEZ,QAAI,CAAC,MAAM,OAAO;AACjB,aAAO,MAAM;AAAA;AAGd,WAAO,MAAM;AACZ,aAAO,EAAE,uBAAuB,MAAM,WAAWA,mBAAiB;AAAA,QACjE,eAAe,MAAM,MAAM;AAAA,QAC3B,oBAAoB,MAAM,MAAM;AAAA,QAChC,wBAAwB,MAAM,MAAM;AAAA,QACpC,WAAW,MAAM,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;MActB,eAAe;;MC7Df,aAAa,OAAO;;MCOpB,aAAa,MAAqB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AO,CAAC,QAAQ,MAAM;AAC3C,MAAI,QAAQ,QAAQ;AACnB,UAAM,SAAS,SAAS,EAAE,MAAM;AAAA;AAIjC;AAEA,SAAO,EAAE,OAAO,MAAM,OAAO;AAAA;;MCvHjB,sBAAsB,IAC/B,SAIH,+BAA+B,OAAO;MAc1B,0BAA0B,IACnC,SAIH,+BAA+B,YAAY;MAc/B,yBAAyB,IAClC,SAKH,+BAA+B,WAAW;MAc9B,2BAA2B,IACpC,SAKH,+BAA+B,YAAY;MAc/B,8BAA8B,IACvC,SAMH,+BAA+B,eAAe;MAgBlC,0BAA0B,IACnC,SAMH,+BAA+B,YAAY;MAe/B,4BAA4B,IACrC,SAMH,+BAA+B,aAAa;MAehC,+BAA+B,IACxC,SAOH,+BAA+B,gBAAgB;MAenC,2BAA2B,IACpC,SAKH,+BAA+B,aAAa;MAehC,4BAA4B,IACrC,SAKH,+BAA+B,aAAa;MAehC,+BAA+B,IACxC,SAMH,+BAA+B,gBAAgB;MAcnC,2BAA2B,IACpC,SAKH,+BAA+B,YAAY;MAe/B,8BAA8B,IACvC,SAMH,+BAA+B,eAAe;MAelC,gCAAgC,IAGzC,SAMH,+BAA+B,iBAAiB;MAepC,mCAAmC,IAG5C,SAMH,+BAA+B,oBAAoB;MAevC,gCAAgC,IAGzC,SAMH,+BAA+B,iBAAiB;MAgBpC,mCAAmC,IAG5C,SAMH,+BAA+B,oBAAoB;MAkBvC,oCAAoC,IAG7C,SAKH,+BAA+B,qBAAqB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/vue",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.5",
4
4
  "description": "Vue plugin, components, and composables to fetch and present Prismic content",
5
5
  "keywords": [
6
6
  "typescript",
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "license": "Apache-2.0",
16
16
  "author": "Prismic <contact@prismic.io> (https://prismic.io)",
17
+ "sideEffects": false,
17
18
  "type": "module",
18
19
  "exports": {
19
20
  ".": {
@@ -33,55 +34,54 @@
33
34
  "scripts": {
34
35
  "build": "siroc build",
35
36
  "dev": "siroc build --watch",
37
+ "format": "prettier --write .",
38
+ "lint": "eslint --ext .js,.ts .",
36
39
  "playground:build": "vite build playground",
37
40
  "playground:dev": "vite playground",
38
- "format": "prettier --write .",
39
41
  "prepare": "npm run build",
40
42
  "release": "npm run build && npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
41
- "release:dry": "standard-version --dry-run",
42
43
  "release:alpha": "npm run build && npm run test && standard-version --release-as major --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
43
44
  "release:alpha:dry": "standard-version --release-as major --prerelease alpha --dry-run",
44
- "lint": "eslint --ext .js,.ts .",
45
- "unit": "nyc --reporter=lcovonly --reporter=text --exclude-after-remap=false ava",
46
- "test": "npm run lint && npm run unit"
45
+ "release:dry": "standard-version --dry-run",
46
+ "test": "npm run lint && npm run unit",
47
+ "unit": "nyc --reporter=lcovonly --reporter=text --exclude-after-remap=false ava"
47
48
  },
48
49
  "dependencies": {
49
- "@prismicio/client": "alpha",
50
- "@prismicio/helpers": "alpha",
51
- "@prismicio/richtext": "alpha",
52
- "@prismicio/types": "^0.1.6",
53
- "escape-html": "^1.0.3",
50
+ "@prismicio/client": "^6.0.0-beta.3",
51
+ "@prismicio/helpers": "^2.0.0-beta.3",
52
+ "@prismicio/types": "^0.1.18",
54
53
  "isomorphic-unfetch": "3.1.0",
55
- "vue-router": "^4.0.10"
54
+ "vue-router": "^4.0.12"
56
55
  },
57
56
  "devDependencies": {
58
- "@prismicio/mock": "^0.0.2",
57
+ "@prismicio/mock": "^0.0.6",
59
58
  "@types/escape-html": "^1.0.1",
60
59
  "@types/jsdom-global": "3.0.2",
61
- "@types/sinon": "10.0.2",
62
- "@typescript-eslint/eslint-plugin": "^4.29.1",
63
- "@typescript-eslint/parser": "^4.29.1",
64
- "@vitejs/plugin-vue": "^1.4.0",
65
- "@vue/compiler-sfc": "^3.2.2",
66
- "@vue/eslint-config-typescript": "^7.0.0",
67
- "@vue/test-utils": "^2.0.0-rc",
60
+ "@types/sinon": "10.0.6",
61
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
62
+ "@typescript-eslint/parser": "^5.4.0",
63
+ "@vitejs/plugin-vue": "^1.9.4",
64
+ "@vue/compiler-sfc": "^3.2.22",
65
+ "@vue/eslint-config-typescript": "^9.1.0",
66
+ "@vue/test-utils": "^2.0.0-rc.16",
68
67
  "ava": "^3.15.0",
69
- "eslint": "^7.32.0",
68
+ "eslint": "^8.2.0",
70
69
  "eslint-config-prettier": "^8.3.0",
71
- "eslint-plugin-prettier": "^3.4.0",
70
+ "eslint-plugin-prettier": "^4.0.0",
72
71
  "eslint-plugin-tsdoc": "^0.2.14",
73
- "eslint-plugin-vue": "^7.16.0",
74
- "jsdom": "^16.7.0",
72
+ "eslint-plugin-vue": "^8.0.3",
73
+ "jsdom": "^18.1.0",
75
74
  "jsdom-global": "^3.0.2",
76
75
  "nyc": "^15.1.0",
77
- "prettier": "^2.3.2",
78
- "sinon": "^11.1.2",
79
- "siroc": "^0.15.0",
80
- "standard-version": "^9.3.1",
76
+ "prettier": "^2.4.1",
77
+ "prettier-plugin-jsdoc": "^0.3.30",
78
+ "sinon": "^12.0.1",
79
+ "siroc": "^0.16.0",
80
+ "standard-version": "^9.3.2",
81
81
  "ts-eager": "^2.0.2",
82
- "typescript": "^4.3.5",
83
- "vite": "^2.4.4",
84
- "vue": "^3.2.1"
82
+ "typescript": "^4.4.4",
83
+ "vite": "^2.6.14",
84
+ "vue": "^3.2.22"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "vue": "^3.0.0"
@@ -20,7 +20,9 @@ const defaultWrapper = "div";
20
20
  * Props for `<PrismicEmbed />`.
21
21
  */
22
22
  export type PrismicEmbedProps = {
23
- /** The Prismic embed field to render. */
23
+ /**
24
+ * The Prismic embed field to render.
25
+ */
24
26
  field: EmbedField;
25
27
 
26
28
  /**
@@ -36,7 +38,7 @@ export type PrismicEmbedProps = {
36
38
  *
37
39
  * @internal
38
40
  */
39
- export const PrismicEmbedImpl = defineComponent({
41
+ export const PrismicEmbedImpl = /*#__PURE__*/ defineComponent({
40
42
  name: "PrismicEmbed",
41
43
  props: {
42
44
  field: {