@prismicio/vue 3.1.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/components/PrismicEmbed.cjs.map +1 -1
  2. package/dist/components/PrismicEmbed.d.ts +57 -63
  3. package/dist/components/PrismicEmbed.js.map +1 -1
  4. package/dist/components/PrismicImage.cjs.map +1 -1
  5. package/dist/components/PrismicImage.d.ts +162 -162
  6. package/dist/components/PrismicImage.js.map +1 -1
  7. package/dist/components/PrismicLink.cjs.map +1 -1
  8. package/dist/components/PrismicLink.d.ts +191 -191
  9. package/dist/components/PrismicLink.js.map +1 -1
  10. package/dist/components/PrismicRichText.cjs +7 -2
  11. package/dist/components/PrismicRichText.cjs.map +1 -1
  12. package/dist/components/PrismicRichText.d.ts +160 -139
  13. package/dist/components/PrismicRichText.js +7 -2
  14. package/dist/components/PrismicRichText.js.map +1 -1
  15. package/dist/components/PrismicText.cjs.map +1 -1
  16. package/dist/components/PrismicText.d.ts +117 -117
  17. package/dist/components/PrismicText.js.map +1 -1
  18. package/dist/components/SliceZone.cjs.map +1 -1
  19. package/dist/components/SliceZone.d.ts +357 -359
  20. package/dist/components/SliceZone.js.map +1 -1
  21. package/dist/components/index.d.ts +12 -12
  22. package/dist/composables.d.ts +366 -366
  23. package/dist/createPrismic.cjs +3 -3
  24. package/dist/createPrismic.cjs.map +1 -1
  25. package/dist/createPrismic.d.ts +12 -12
  26. package/dist/createPrismic.js +3 -3
  27. package/dist/createPrismic.js.map +1 -1
  28. package/dist/globalExtensions.d.ts +11 -11
  29. package/dist/index.cjs +16 -16
  30. package/dist/index.d.ts +10 -10
  31. package/dist/index.js +3 -3
  32. package/dist/injectionSymbols.d.ts +9 -9
  33. package/dist/lib/__PRODUCTION__.d.ts +7 -7
  34. package/dist/lib/getSlots.d.ts +14 -14
  35. package/dist/lib/isInternalURL.d.ts +8 -8
  36. package/dist/lib/simplyResolveComponent.cjs.map +1 -1
  37. package/dist/lib/simplyResolveComponent.d.ts +12 -12
  38. package/dist/lib/simplyResolveComponent.js.map +1 -1
  39. package/dist/types.d.ts +366 -357
  40. package/dist/usePrismic.d.ts +21 -21
  41. package/dist/useStatefulPrismicClientMethod.d.ts +64 -64
  42. package/package.json +13 -13
  43. package/src/components/PrismicEmbed.ts +6 -2
  44. package/src/components/PrismicImage.ts +6 -2
  45. package/src/components/PrismicLink.ts +11 -5
  46. package/src/components/PrismicRichText.ts +30 -5
  47. package/src/components/PrismicText.ts +6 -2
  48. package/src/components/SliceZone.ts +5 -2
  49. package/src/createPrismic.ts +3 -6
  50. package/src/lib/simplyResolveComponent.ts +8 -2
  51. package/src/types.ts +15 -4
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicEmbed.cjs","sources":["../../../src/components/PrismicEmbed.ts"],"sourcesContent":["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\n\t * 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"],"names":["defineComponent","h","simplyResolveComponent"],"mappings":";;;;AAgBA,MAAM,iBAAiB;AAyBhB,MAAM,mBAAiDA,oBAAAA,gBAAA;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ,QAAQ;AAAA,MAC/B,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,MAAM,OAAK;AAEN,QAAA,CAAC,MAAM,OAAO;AACjB,aAAO,MAAM;AAAA,IACb;AAED,WAAO,MAAK;AACX,aAAOC,IAAE,EAAAC,uBAAA,uBAAuB,MAAM,WAAW,cAAc,GAAG;AAAA,QACjE,eAAe,MAAM,MAAM;AAAA,QAC3B,oBAAoB,MAAM,MAAM;AAAA,QAChC,wBAAwB,MAAM,MAAM;AAAA,QACpC,WAAW,MAAM,MAAM,QAAQ;AAAA,MAAA,CAC/B;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;;;"}
1
+ {"version":3,"file":"PrismicEmbed.cjs","sources":["../../../src/components/PrismicEmbed.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tConcreteComponent,\n\tDefineComponent,\n\tdefineComponent,\n\th,\n\tPropType,\n\tRaw,\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\n\t * output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent | Raw<DefineComponent>;\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<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.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"],"names":["defineComponent","h","simplyResolveComponent"],"mappings":";;;;AAkBA,MAAM,iBAAiB;AAyBhB,MAAM,mBAAiDA,oBAAAA,gBAAA;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ,QAAQ;AAAA,MAG/B,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,MAAM,OAAK;AAEN,QAAA,CAAC,MAAM,OAAO;AACjB,aAAO,MAAM;AAAA,IACb;AAED,WAAO,MAAK;AACX,aAAOC,IAAE,EAAAC,uBAAA,uBAAuB,MAAM,WAAW,cAAc,GAAG;AAAA,QACjE,eAAe,MAAM,MAAM;AAAA,QAC3B,oBAAoB,MAAM,MAAM;AAAA,QAChC,wBAAwB,MAAM,MAAM;AAAA,QACpC,WAAW,MAAM,MAAM,QAAQ;AAAA,MAAA,CAC/B;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;;;"}
@@ -1,63 +1,57 @@
1
- import { AllowedComponentProps, ComponentCustomProps, ConcreteComponent, PropType, VNodeProps } from "vue";
2
- import { EmbedField } from "@prismicio/types";
3
- /**
4
- * Props for `<PrismicEmbed />`.
5
- */
6
- export type PrismicEmbedProps = {
7
- /**
8
- * The Prismic embed field to render.
9
- */
10
- field: EmbedField;
11
- /**
12
- * An HTML tag name, a component, or a functional component used to wrap the
13
- * output.
14
- *
15
- * @defaultValue `"div"`
16
- */
17
- wrapper?: string | ConcreteComponent;
18
- };
19
- /**
20
- * `<PrismicEmbed />` implementation.
21
- *
22
- * @internal
23
- */
24
- export declare const PrismicEmbedImpl: import("vue").DefineComponent<{
25
- field: {
26
- type: PropType<import("@prismicio/types/dist/value/types").EmptyObjectField | ((import("@prismicio/types").AnyOEmbed & import("@prismicio/types").OEmbedExtra) & {
27
- embed_url: string;
28
- html: string | null;
29
- })>;
30
- required: true;
31
- };
32
- wrapper: {
33
- type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
34
- default: undefined;
35
- required: false;
36
- };
37
- }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
- [key: string]: any;
39
- }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
40
- field: {
41
- type: PropType<import("@prismicio/types/dist/value/types").EmptyObjectField | ((import("@prismicio/types").AnyOEmbed & import("@prismicio/types").OEmbedExtra) & {
42
- embed_url: string;
43
- html: string | null;
44
- })>;
45
- required: true;
46
- };
47
- wrapper: {
48
- type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
49
- default: undefined;
50
- required: false;
51
- };
52
- }>>, {
53
- wrapper: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
54
- }>;
55
- /**
56
- * Component to render a Prismic embed field.
57
- *
58
- * @see Component props {@link PrismicEmbedProps}
59
- * @see Templating embed fields {@link https://prismic.io/docs/technologies/vue-template-content#embeds}
60
- */
61
- export declare const PrismicEmbed: new () => {
62
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicEmbedProps;
63
- };
1
+ import { AllowedComponentProps, ComponentCustomProps, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
2
+ import { EmbedField } from "@prismicio/types";
3
+ /**
4
+ * Props for `<PrismicEmbed />`.
5
+ */
6
+ export type PrismicEmbedProps = {
7
+ /**
8
+ * The Prismic embed field to render.
9
+ */
10
+ field: EmbedField;
11
+ /**
12
+ * An HTML tag name, a component, or a functional component used to wrap the
13
+ * output.
14
+ *
15
+ * @defaultValue `"div"`
16
+ */
17
+ wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
18
+ };
19
+ /**
20
+ * `<PrismicEmbed />` implementation.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare const PrismicEmbedImpl: DefineComponent<{
25
+ field: {
26
+ type: PropType<EmbedField>;
27
+ required: true;
28
+ };
29
+ wrapper: {
30
+ type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
31
+ default: undefined;
32
+ required: false;
33
+ };
34
+ }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
35
+ [key: string]: any;
36
+ }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
+ field: {
38
+ type: PropType<EmbedField>;
39
+ required: true;
40
+ };
41
+ wrapper: {
42
+ type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
43
+ default: undefined;
44
+ required: false;
45
+ };
46
+ }>>, {
47
+ wrapper: string | ConcreteComponent | Raw<DefineComponent>;
48
+ }>;
49
+ /**
50
+ * Component to render a Prismic embed field.
51
+ *
52
+ * @see Component props {@link PrismicEmbedProps}
53
+ * @see Templating embed fields {@link https://prismic.io/docs/technologies/vue-template-content#embeds}
54
+ */
55
+ export declare const PrismicEmbed: new () => {
56
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicEmbedProps;
57
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicEmbed.js","sources":["../../../src/components/PrismicEmbed.ts"],"sourcesContent":["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\n\t * 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"],"names":[],"mappings":";;AAgBA,MAAM,iBAAiB;AAyBhB,MAAM,mBAAiD,gCAAA;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ,QAAQ;AAAA,MAC/B,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,MAAM,OAAK;AAEN,QAAA,CAAC,MAAM,OAAO;AACjB,aAAO,MAAM;AAAA,IACb;AAED,WAAO,MAAK;AACX,aAAO,EAAE,uBAAuB,MAAM,WAAW,cAAc,GAAG;AAAA,QACjE,eAAe,MAAM,MAAM;AAAA,QAC3B,oBAAoB,MAAM,MAAM;AAAA,QAChC,wBAAwB,MAAM,MAAM;AAAA,QACpC,WAAW,MAAM,MAAM,QAAQ;AAAA,MAAA,CAC/B;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;"}
1
+ {"version":3,"file":"PrismicEmbed.js","sources":["../../../src/components/PrismicEmbed.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tConcreteComponent,\n\tDefineComponent,\n\tdefineComponent,\n\th,\n\tPropType,\n\tRaw,\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\n\t * output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent | Raw<DefineComponent>;\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<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.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"],"names":[],"mappings":";;AAkBA,MAAM,iBAAiB;AAyBhB,MAAM,mBAAiD,gCAAA;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ,QAAQ;AAAA,MAG/B,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,MAAM,OAAK;AAEN,QAAA,CAAC,MAAM,OAAO;AACjB,aAAO,MAAM;AAAA,IACb;AAED,WAAO,MAAK;AACX,aAAO,EAAE,uBAAuB,MAAM,WAAW,cAAc,GAAG;AAAA,QACjE,eAAe,MAAM,MAAM;AAAA,QAC3B,oBAAoB,MAAM,MAAM;AAAA,QAChC,wBAAwB,MAAM,MAAM;AAAA,QACpC,WAAW,MAAM,MAAM,QAAQ;AAAA,MAAA,CAC/B;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.cjs","sources":["../../../src/components/PrismicImage.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tConcreteComponent,\n\tComputedRef,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n\tunref,\n} from \"vue\";\n\nimport { ImageField } from \"@prismicio/types\";\nimport {\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasImagePixelDensitySrcSet,\n\tisFilled,\n} from \"@prismicio/helpers\";\n\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { __PRODUCTION__ } from \"../lib/__PRODUCTION__\";\nimport { usePrismic } from \"../usePrismic\";\nimport { VueUseOptions } from \"../types\";\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 | ImageField<string>;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * images.\n\t *\n\t * @remarks\n\t * HTML tag names and components will be rendered using the `img` tag\n\t * interface (`src`, `srcset`, and `alt` attribute). Components will also\n\t * receive an 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 * An object of Imgix URL API parameters.\n\t *\n\t * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1];\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following given widths.\n\t *\n\t * @remarks\n\t * A special value of `\"thumbnails\"` is accepted to automatically use image\n\t * widths coming from the API.\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * widths coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `pixelDensities` prop. When both are\n\t * used the `pixelDensities` prop will be ignored.\n\t */\n\twidths?:\n\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t| \"thumbnails\"\n\t\t| \"defaults\";\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following giving pixel\n\t * densities.\n\t *\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * pixel densities coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `widths` prop. When both are used, the\n\t * `pixelDensities` prop will be ignored.\n\t */\n\tpixelDensities?:\n\t\t| NonNullable<\n\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t >[\"pixelDensities\"]\n\t\t| \"defaults\";\n};\n\n/**\n * Options for {@link usePrismicImage}.\n */\nexport type UsePrismicImageOptions = VueUseOptions<\n\tOmit<PrismicImageProps, \"imageComponent\">\n>;\n\n/**\n * Return type of {@link usePrismicImage}.\n */\nexport type UsePrismicImageReturnType = {\n\t/**\n\t * Resolved image `src` value.\n\t */\n\tsrc: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `srcset` value.\n\t */\n\tsrcset: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `alt` value.\n\t */\n\talt: ComputedRef<string>;\n\n\t/**\n\t * Resolved image `copyright` value.\n\t */\n\tcopyright: ComputedRef<string | null>;\n};\n\n/**\n * A low level composable that returns a resolved information about a Prismic\n * image field.\n *\n * @param props - {@link UsePrismicImageOptions}\n *\n * @returns - Resolved image information {@link UsePrismicImageReturnType}\n */\nexport const usePrismicImage = (\n\tprops: UsePrismicImageOptions,\n): UsePrismicImageReturnType => {\n\tconst { options } = usePrismic();\n\n\tconst asImage = computed(() => {\n\t\tconst field = unref(props.field);\n\n\t\tif (!isFilled.image(field)) {\n\t\t\treturn {\n\t\t\t\tsrc: null,\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\n\t\tconst imgixParams = unref(props.imgixParams);\n\t\tconst widths = unref(props.widths);\n\t\tconst pixelDensities = unref(props.pixelDensities);\n\n\t\tif (widths) {\n\t\t\tif (!__PRODUCTION__ && pixelDensities) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[PrismicImage] Only one of `widths` or `pixelDensities` props can be provided. You can resolve this warning by removing either the `widths` or `pixelDensities` prop. `widths` will be used in this case.\",\n\t\t\t\t\tprops,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths:\n\t\t\t\t\twidths === \"defaults\"\n\t\t\t\t\t\t? options.components?.imageWidthSrcSetDefaults\n\t\t\t\t\t\t: widths,\n\t\t\t});\n\t\t} else if (pixelDensities) {\n\t\t\treturn asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\"\n\t\t\t\t\t\t? options.components?.imagePixelDensitySrcSetDefaults\n\t\t\t\t\t\t: pixelDensities,\n\t\t\t});\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tsrc: asImageSrc(field, imgixParams),\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\t});\n\n\tconst src = computed(() => {\n\t\treturn asImage.value.src;\n\t});\n\tconst srcset = computed(() => {\n\t\treturn asImage.value.srcset;\n\t});\n\tconst alt = computed(() => {\n\t\treturn unref(props.field).alt || \"\";\n\t});\n\tconst copyright = computed(() => {\n\t\treturn unref(props.field).copyright || null;\n\t});\n\n\treturn {\n\t\tsrc,\n\t\tsrcset,\n\t\talt,\n\t\tcopyright,\n\t};\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 | ImageField<string>>,\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\timgixParams: {\n\t\t\ttype: Object as PropType<Parameters<typeof asImageSrc>[1]>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twidths: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tpixelDensities: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.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\tconst { src, srcset, alt, copyright } = usePrismicImage(props);\n\n\t\treturn () => {\n\t\t\tconst attributes = {\n\t\t\t\tsrc: src.value,\n\t\t\t\tsrcset: srcset.value,\n\t\t\t\talt: alt.value,\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: copyright.value,\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"],"names":["usePrismic","computed","unref","isFilled","__PRODUCTION__","asImageWidthSrcSet","asImagePixelDensitySrcSet","asImageSrc","defineComponent","h","simplyResolveComponent"],"mappings":";;;;;;;AA6BA,MAAM,wBAAwB;AA0GjB,MAAA,kBAAkB,CAC9B,UAC8B;AACxB,QAAA,EAAE,YAAYA,WAAAA;AAEd,QAAA,UAAUC,IAAAA,SAAS,MAAK;;AACvB,UAAA,QAAQC,IAAAA,MAAM,MAAM,KAAK;AAE/B,QAAI,CAACC,QAAA,SAAS,MAAM,KAAK,GAAG;AACpB,aAAA;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IAET;AAEK,UAAA,cAAcD,IAAAA,MAAM,MAAM,WAAW;AACrC,UAAA,SAASA,IAAAA,MAAM,MA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;AAAA,IACV;AAAA,IACD,aAAa;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,QAAQ;AAAA,MACP,MAAM,CAAC,QAAQ,MAAM;AAAA,MAKrB,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM,CAAC,QAAQ,MAAM;AAAA,MAMrB,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,MAAM,OAAK;AAEN,QAAA,CAAC,MAAM,OAAO;AACjB,aAAO,MAAM;AAAA,IACb;AAEK,UAAA,EAAE,YAAYR,WAAAA;AAEd,UAAA,OAAOC,IAAAA,SAAS,MAAK;;AAC1B,aACC,MAAM,oBACN,aAAQ,eAAR,mBAAoB,mBACpB;AAAA,IAAA,CAED;AAED,UAAM,EAAE,KAAK,QAAQ,KAAK,cAAc,gBAAgB,KAAK;AAE7D,WAAO,MAAK;AACX,YAAM,aAAa;AAAA,QAClB,KAAK,IAAI;AAAA,QACT,QAAQ,OAAO;AAAA,QACf,KAAK,IAAI;AAAA,MAAA;AAGV,cAAQ,KAAK,OAAO;AAAA,QACnB,KAAK;AAEG,iBAAAQ,IAAA,EAAE,OAAO,UAAU;AAAA,QAE3B;AACC,iBAAOA,MAAEC,uBAAAA,uBAAuB,KAAK,KAAK,GAAG;AAAA,YAC5C,GAAG;AAAA,YACH,WAAW,UAAU;AAAA,UAAA,CACrB;AAAA,MACF;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;;;;"}
1
+ {"version":3,"file":"PrismicImage.cjs","sources":["../../../src/components/PrismicImage.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tConcreteComponent,\n\tComputedRef,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n\tunref,\n\tDefineComponent,\n\tRaw,\n} from \"vue\";\n\nimport { ImageField } from \"@prismicio/types\";\nimport {\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasImagePixelDensitySrcSet,\n\tisFilled,\n} from \"@prismicio/helpers\";\n\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { __PRODUCTION__ } from \"../lib/__PRODUCTION__\";\nimport { usePrismic } from \"../usePrismic\";\nimport { VueUseOptions } from \"../types\";\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 | ImageField<string>;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * images.\n\t *\n\t * @remarks\n\t * HTML tag names and components will be rendered using the `img` tag\n\t * interface (`src`, `srcset`, and `alt` attribute). Components will also\n\t * receive an additional `copyright` props.\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"img\"` otherwise.\n\t */\n\timageComponent?: string | ConcreteComponent | Raw<DefineComponent>;\n\n\t/**\n\t * An object of Imgix URL API parameters.\n\t *\n\t * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1];\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following given widths.\n\t *\n\t * @remarks\n\t * A special value of `\"thumbnails\"` is accepted to automatically use image\n\t * widths coming from the API.\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * widths coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `pixelDensities` prop. When both are\n\t * used the `pixelDensities` prop will be ignored.\n\t */\n\twidths?:\n\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t| \"thumbnails\"\n\t\t| \"defaults\";\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following giving pixel\n\t * densities.\n\t *\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * pixel densities coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `widths` prop. When both are used, the\n\t * `pixelDensities` prop will be ignored.\n\t */\n\tpixelDensities?:\n\t\t| NonNullable<\n\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t >[\"pixelDensities\"]\n\t\t| \"defaults\";\n};\n\n/**\n * Options for {@link usePrismicImage}.\n */\nexport type UsePrismicImageOptions = VueUseOptions<\n\tOmit<PrismicImageProps, \"imageComponent\">\n>;\n\n/**\n * Return type of {@link usePrismicImage}.\n */\nexport type UsePrismicImageReturnType = {\n\t/**\n\t * Resolved image `src` value.\n\t */\n\tsrc: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `srcset` value.\n\t */\n\tsrcset: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `alt` value.\n\t */\n\talt: ComputedRef<string>;\n\n\t/**\n\t * Resolved image `copyright` value.\n\t */\n\tcopyright: ComputedRef<string | null>;\n};\n\n/**\n * A low level composable that returns a resolved information about a Prismic\n * image field.\n *\n * @param props - {@link UsePrismicImageOptions}\n *\n * @returns - Resolved image information {@link UsePrismicImageReturnType}\n */\nexport const usePrismicImage = (\n\tprops: UsePrismicImageOptions,\n): UsePrismicImageReturnType => {\n\tconst { options } = usePrismic();\n\n\tconst asImage = computed(() => {\n\t\tconst field = unref(props.field);\n\n\t\tif (!isFilled.image(field)) {\n\t\t\treturn {\n\t\t\t\tsrc: null,\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\n\t\tconst imgixParams = unref(props.imgixParams);\n\t\tconst widths = unref(props.widths);\n\t\tconst pixelDensities = unref(props.pixelDensities);\n\n\t\tif (widths) {\n\t\t\tif (!__PRODUCTION__ && pixelDensities) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[PrismicImage] Only one of `widths` or `pixelDensities` props can be provided. You can resolve this warning by removing either the `widths` or `pixelDensities` prop. `widths` will be used in this case.\",\n\t\t\t\t\tprops,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths:\n\t\t\t\t\twidths === \"defaults\"\n\t\t\t\t\t\t? options.components?.imageWidthSrcSetDefaults\n\t\t\t\t\t\t: widths,\n\t\t\t});\n\t\t} else if (pixelDensities) {\n\t\t\treturn asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\"\n\t\t\t\t\t\t? options.components?.imagePixelDensitySrcSetDefaults\n\t\t\t\t\t\t: pixelDensities,\n\t\t\t});\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tsrc: asImageSrc(field, imgixParams),\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\t});\n\n\tconst src = computed(() => {\n\t\treturn asImage.value.src;\n\t});\n\tconst srcset = computed(() => {\n\t\treturn asImage.value.srcset;\n\t});\n\tconst alt = computed(() => {\n\t\treturn unref(props.field).alt || \"\";\n\t});\n\tconst copyright = computed(() => {\n\t\treturn unref(props.field).copyright || null;\n\t});\n\n\treturn {\n\t\tsrc,\n\t\tsrcset,\n\t\talt,\n\t\tcopyright,\n\t};\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 | ImageField<string>>,\n\t\t\trequired: true,\n\t\t},\n\t\timageComponent: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\timgixParams: {\n\t\t\ttype: Object as PropType<Parameters<typeof asImageSrc>[1]>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twidths: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tpixelDensities: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.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\tconst { src, srcset, alt, copyright } = usePrismicImage(props);\n\n\t\treturn () => {\n\t\t\tconst attributes = {\n\t\t\t\tsrc: src.value,\n\t\t\t\tsrcset: srcset.value,\n\t\t\t\talt: alt.value,\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: copyright.value,\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"],"names":["usePrismic","computed","unref","isFilled","__PRODUCTION__","asImageWidthSrcSet","asImagePixelDensitySrcSet","asImageSrc","defineComponent","h","simplyResolveComponent"],"mappings":";;;;;;;AA+BA,MAAM,wBAAwB;AA0GjB,MAAA,kBAAkB,CAC9B,UAC8B;AACxB,QAAA,EAAE,YAAYA,WAAAA;AAEd,QAAA,UAAUC,IAAAA,SAAS,MAAK;;AACvB,UAAA,QAAQC,IAAAA,MAAM,MAAM,KAAK;AAE/B,QAAI,CAACC,QAAA,SAAS,MAAM,KAAK,GAAG;AACpB,aAAA;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IAET;AAEK,UAAA,cAAcD,IAAAA,MAAM,MAAM,WAAW;AACrC,UAAA,SAASA,IAAAA,MAAM,MAAM,MAAM;AAC3B,UAAA,iBAAiBA,IAAAA,MAAM,MAAM,cAAc;AAEjD,QAAI,QAAQ;AACP,UAAA,CAACE,iCAAkB,gBAAgB;AAC9B,gBAAA,KACP,6MACA,KAAK;AAAA,MAEN;AAED,aAAOC,QAAAA,mBAAmB,OAAO;AAAA,QAChC,GAAG;AAAA,QACH,QACC,WAAW,cACR,aAAQ,eAAR,mBAAoB,2BACpB;AAAA,MAAA,CACJ;AAAA,eACS,gBAAgB;AAC1B,aAAOC,QAAAA,0BAA0B,OAAO;AAAA,QACvC,GAAG;AAAA,QACH,gBACC,mBAAmB,cAChB,aAAQ,eAAR,mBAAoB,kCACpB;AAAA,MAAA,CACJ;AAAA,IAAA,OACK;AACC,aAAA;AAAA,QACN,KAAKC,QAAAA,WAAW,OAAO,WAAW;AAAA,QAClC,QAAQ;AAAA,MAAA;AAAA,IAET;AAAA,EAAA,CACD;AAEK,QAAA,MAAMN,IAAAA,SAAS,MAAK;AACzB,WAAO,QAAQ,MAAM;AAAA,EAAA,CACrB;AACK,QAAA,SAASA,IAAAA,SAAS,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AA,QACf,KAAK,IAAI;AAAA,MAAA;AAGV,cAAQ,KAAK,OAAO;AAAA,QACnB,KAAK;AAEG,iBAAAQ,IAAA,EAAE,OAAO,UAAU;AAAA,QAE3B;AACC,iBAAOA,MAAEC,uBAAAA,uBAAuB,KAAK,KAAK,GAAG;AAAA,YAC5C,GAAG;AAAA,YACH,WAAW,UAAU;AAAA,UAAA,CACrB;AAAA,MACF;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;;;;"}
@@ -1,162 +1,162 @@
1
- import { AllowedComponentProps, ComponentCustomProps, ConcreteComponent, ComputedRef, PropType, VNodeProps } from "vue";
2
- import { ImageField } from "@prismicio/types";
3
- import { asImageSrc, asImageWidthSrcSet, asImagePixelDensitySrcSet } from "@prismicio/helpers";
4
- import { VueUseOptions } from "../types";
5
- /**
6
- * Props for `<PrismicImage />`.
7
- */
8
- export type PrismicImageProps = {
9
- /**
10
- * The Prismic image field to render.
11
- */
12
- field: ImageField | ImageField<string>;
13
- /**
14
- * An HTML tag name, a component, or a functional component used to render
15
- * images.
16
- *
17
- * @remarks
18
- * HTML tag names and components will be rendered using the `img` tag
19
- * interface (`src`, `srcset`, and `alt` attribute). Components will also
20
- * receive an additional `copyright` props.
21
- * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"img"` otherwise.
22
- */
23
- imageComponent?: string | ConcreteComponent;
24
- /**
25
- * An object of Imgix URL API parameters.
26
- *
27
- * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering
28
- */
29
- imgixParams?: Parameters<typeof asImageSrc>[1];
30
- /**
31
- * Adds an additional `srcset` attribute to the image following given widths.
32
- *
33
- * @remarks
34
- * A special value of `"thumbnails"` is accepted to automatically use image
35
- * widths coming from the API.
36
- * @remarks
37
- * A special value of `"defaults"` is accepted to automatically use image
38
- * widths coming from the plugin configuration.
39
- * @remarks
40
- * This prop is not compatible with the `pixelDensities` prop. When both are
41
- * used the `pixelDensities` prop will be ignored.
42
- */
43
- widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
44
- /**
45
- * Adds an additional `srcset` attribute to the image following giving pixel
46
- * densities.
47
- *
48
- * @remarks
49
- * A special value of `"defaults"` is accepted to automatically use image
50
- * pixel densities coming from the plugin configuration.
51
- * @remarks
52
- * This prop is not compatible with the `widths` prop. When both are used, the
53
- * `pixelDensities` prop will be ignored.
54
- */
55
- pixelDensities?: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
56
- };
57
- /**
58
- * Options for {@link usePrismicImage}.
59
- */
60
- export type UsePrismicImageOptions = VueUseOptions<Omit<PrismicImageProps, "imageComponent">>;
61
- /**
62
- * Return type of {@link usePrismicImage}.
63
- */
64
- export type UsePrismicImageReturnType = {
65
- /**
66
- * Resolved image `src` value.
67
- */
68
- src: ComputedRef<string | null>;
69
- /**
70
- * Resolved image `srcset` value.
71
- */
72
- srcset: ComputedRef<string | null>;
73
- /**
74
- * Resolved image `alt` value.
75
- */
76
- alt: ComputedRef<string>;
77
- /**
78
- * Resolved image `copyright` value.
79
- */
80
- copyright: ComputedRef<string | null>;
81
- };
82
- /**
83
- * A low level composable that returns a resolved information about a Prismic
84
- * image field.
85
- *
86
- * @param props - {@link UsePrismicImageOptions}
87
- *
88
- * @returns - Resolved image information {@link UsePrismicImageReturnType}
89
- */
90
- export declare const usePrismicImage: (props: UsePrismicImageOptions) => UsePrismicImageReturnType;
91
- /**
92
- * `<PrismicImage />` implementation.
93
- *
94
- * @internal
95
- */
96
- export declare const PrismicImageImpl: import("vue").DefineComponent<{
97
- field: {
98
- type: PropType<import("@prismicio/types/dist/value/types").Simplify<(import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage) & Record<never, import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage>> | import("@prismicio/types/dist/value/types").Simplify<(import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage) & Record<string, import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage>>>;
99
- required: true;
100
- };
101
- imageComponent: {
102
- type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
103
- default: undefined;
104
- required: false;
105
- };
106
- imgixParams: {
107
- type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
108
- default: undefined;
109
- required: false;
110
- };
111
- widths: {
112
- type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
113
- default: undefined;
114
- required: false;
115
- };
116
- pixelDensities: {
117
- type: PropType<number[] | "defaults" | undefined>;
118
- default: undefined;
119
- required: false;
120
- };
121
- }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
122
- [key: string]: any;
123
- }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
124
- field: {
125
- type: PropType<import("@prismicio/types/dist/value/types").Simplify<(import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage) & Record<never, import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage>> | import("@prismicio/types/dist/value/types").Simplify<(import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage) & Record<string, import("@prismicio/types").EmptyImageFieldImage | import("@prismicio/types").FilledImageFieldImage>>>;
126
- required: true;
127
- };
128
- imageComponent: {
129
- type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
130
- default: undefined;
131
- required: false;
132
- };
133
- imgixParams: {
134
- type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
135
- default: undefined;
136
- required: false;
137
- };
138
- widths: {
139
- type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
140
- default: undefined;
141
- required: false;
142
- };
143
- pixelDensities: {
144
- type: PropType<number[] | "defaults" | undefined>;
145
- default: undefined;
146
- required: false;
147
- };
148
- }>>, {
149
- widths: number[] | "thumbnails" | "defaults" | undefined;
150
- pixelDensities: number[] | "defaults" | undefined;
151
- imageComponent: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
152
- imgixParams: import("imgix-url-builder").ImgixURLParams | undefined;
153
- }>;
154
- /**
155
- * Component to render a Prismic image field.
156
- *
157
- * @see Component props {@link PrismicImageProps}
158
- * @see Templating image fields {@link https://prismic.io/docs/technologies/vue-template-content#images}
159
- */
160
- export declare const PrismicImage: new () => {
161
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicImageProps;
162
- };
1
+ import { AllowedComponentProps, ComponentCustomProps, ConcreteComponent, ComputedRef, PropType, VNodeProps, DefineComponent, Raw } from "vue";
2
+ import { ImageField } from "@prismicio/types";
3
+ import { asImageSrc, asImageWidthSrcSet, asImagePixelDensitySrcSet } from "@prismicio/helpers";
4
+ import { VueUseOptions } from "../types";
5
+ /**
6
+ * Props for `<PrismicImage />`.
7
+ */
8
+ export type PrismicImageProps = {
9
+ /**
10
+ * The Prismic image field to render.
11
+ */
12
+ field: ImageField | ImageField<string>;
13
+ /**
14
+ * An HTML tag name, a component, or a functional component used to render
15
+ * images.
16
+ *
17
+ * @remarks
18
+ * HTML tag names and components will be rendered using the `img` tag
19
+ * interface (`src`, `srcset`, and `alt` attribute). Components will also
20
+ * receive an additional `copyright` props.
21
+ * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"img"` otherwise.
22
+ */
23
+ imageComponent?: string | ConcreteComponent | Raw<DefineComponent>;
24
+ /**
25
+ * An object of Imgix URL API parameters.
26
+ *
27
+ * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering
28
+ */
29
+ imgixParams?: Parameters<typeof asImageSrc>[1];
30
+ /**
31
+ * Adds an additional `srcset` attribute to the image following given widths.
32
+ *
33
+ * @remarks
34
+ * A special value of `"thumbnails"` is accepted to automatically use image
35
+ * widths coming from the API.
36
+ * @remarks
37
+ * A special value of `"defaults"` is accepted to automatically use image
38
+ * widths coming from the plugin configuration.
39
+ * @remarks
40
+ * This prop is not compatible with the `pixelDensities` prop. When both are
41
+ * used the `pixelDensities` prop will be ignored.
42
+ */
43
+ widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
44
+ /**
45
+ * Adds an additional `srcset` attribute to the image following giving pixel
46
+ * densities.
47
+ *
48
+ * @remarks
49
+ * A special value of `"defaults"` is accepted to automatically use image
50
+ * pixel densities coming from the plugin configuration.
51
+ * @remarks
52
+ * This prop is not compatible with the `widths` prop. When both are used, the
53
+ * `pixelDensities` prop will be ignored.
54
+ */
55
+ pixelDensities?: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
56
+ };
57
+ /**
58
+ * Options for {@link usePrismicImage}.
59
+ */
60
+ export type UsePrismicImageOptions = VueUseOptions<Omit<PrismicImageProps, "imageComponent">>;
61
+ /**
62
+ * Return type of {@link usePrismicImage}.
63
+ */
64
+ export type UsePrismicImageReturnType = {
65
+ /**
66
+ * Resolved image `src` value.
67
+ */
68
+ src: ComputedRef<string | null>;
69
+ /**
70
+ * Resolved image `srcset` value.
71
+ */
72
+ srcset: ComputedRef<string | null>;
73
+ /**
74
+ * Resolved image `alt` value.
75
+ */
76
+ alt: ComputedRef<string>;
77
+ /**
78
+ * Resolved image `copyright` value.
79
+ */
80
+ copyright: ComputedRef<string | null>;
81
+ };
82
+ /**
83
+ * A low level composable that returns a resolved information about a Prismic
84
+ * image field.
85
+ *
86
+ * @param props - {@link UsePrismicImageOptions}
87
+ *
88
+ * @returns - Resolved image information {@link UsePrismicImageReturnType}
89
+ */
90
+ export declare const usePrismicImage: (props: UsePrismicImageOptions) => UsePrismicImageReturnType;
91
+ /**
92
+ * `<PrismicImage />` implementation.
93
+ *
94
+ * @internal
95
+ */
96
+ export declare const PrismicImageImpl: DefineComponent<{
97
+ field: {
98
+ type: PropType<ImageField | ImageField<string>>;
99
+ required: true;
100
+ };
101
+ imageComponent: {
102
+ type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
103
+ default: undefined;
104
+ required: false;
105
+ };
106
+ imgixParams: {
107
+ type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
108
+ default: undefined;
109
+ required: false;
110
+ };
111
+ widths: {
112
+ type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
113
+ default: undefined;
114
+ required: false;
115
+ };
116
+ pixelDensities: {
117
+ type: PropType<number[] | "defaults" | undefined>;
118
+ default: undefined;
119
+ required: false;
120
+ };
121
+ }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
122
+ [key: string]: any;
123
+ }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
124
+ field: {
125
+ type: PropType<ImageField | ImageField<string>>;
126
+ required: true;
127
+ };
128
+ imageComponent: {
129
+ type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
130
+ default: undefined;
131
+ required: false;
132
+ };
133
+ imgixParams: {
134
+ type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
135
+ default: undefined;
136
+ required: false;
137
+ };
138
+ widths: {
139
+ type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
140
+ default: undefined;
141
+ required: false;
142
+ };
143
+ pixelDensities: {
144
+ type: PropType<number[] | "defaults" | undefined>;
145
+ default: undefined;
146
+ required: false;
147
+ };
148
+ }>>, {
149
+ widths: number[] | "thumbnails" | "defaults" | undefined;
150
+ pixelDensities: number[] | "defaults" | undefined;
151
+ imageComponent: string | ConcreteComponent | Raw<DefineComponent>;
152
+ imgixParams: import("imgix-url-builder").ImgixURLParams | undefined;
153
+ }>;
154
+ /**
155
+ * Component to render a Prismic image field.
156
+ *
157
+ * @see Component props {@link PrismicImageProps}
158
+ * @see Templating image fields {@link https://prismic.io/docs/technologies/vue-template-content#images}
159
+ */
160
+ export declare const PrismicImage: new () => {
161
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicImageProps;
162
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.js","sources":["../../../src/components/PrismicImage.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tConcreteComponent,\n\tComputedRef,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n\tunref,\n} from \"vue\";\n\nimport { ImageField } from \"@prismicio/types\";\nimport {\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasImagePixelDensitySrcSet,\n\tisFilled,\n} from \"@prismicio/helpers\";\n\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { __PRODUCTION__ } from \"../lib/__PRODUCTION__\";\nimport { usePrismic } from \"../usePrismic\";\nimport { VueUseOptions } from \"../types\";\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 | ImageField<string>;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * images.\n\t *\n\t * @remarks\n\t * HTML tag names and components will be rendered using the `img` tag\n\t * interface (`src`, `srcset`, and `alt` attribute). Components will also\n\t * receive an 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 * An object of Imgix URL API parameters.\n\t *\n\t * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1];\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following given widths.\n\t *\n\t * @remarks\n\t * A special value of `\"thumbnails\"` is accepted to automatically use image\n\t * widths coming from the API.\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * widths coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `pixelDensities` prop. When both are\n\t * used the `pixelDensities` prop will be ignored.\n\t */\n\twidths?:\n\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t| \"thumbnails\"\n\t\t| \"defaults\";\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following giving pixel\n\t * densities.\n\t *\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * pixel densities coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `widths` prop. When both are used, the\n\t * `pixelDensities` prop will be ignored.\n\t */\n\tpixelDensities?:\n\t\t| NonNullable<\n\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t >[\"pixelDensities\"]\n\t\t| \"defaults\";\n};\n\n/**\n * Options for {@link usePrismicImage}.\n */\nexport type UsePrismicImageOptions = VueUseOptions<\n\tOmit<PrismicImageProps, \"imageComponent\">\n>;\n\n/**\n * Return type of {@link usePrismicImage}.\n */\nexport type UsePrismicImageReturnType = {\n\t/**\n\t * Resolved image `src` value.\n\t */\n\tsrc: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `srcset` value.\n\t */\n\tsrcset: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `alt` value.\n\t */\n\talt: ComputedRef<string>;\n\n\t/**\n\t * Resolved image `copyright` value.\n\t */\n\tcopyright: ComputedRef<string | null>;\n};\n\n/**\n * A low level composable that returns a resolved information about a Prismic\n * image field.\n *\n * @param props - {@link UsePrismicImageOptions}\n *\n * @returns - Resolved image information {@link UsePrismicImageReturnType}\n */\nexport const usePrismicImage = (\n\tprops: UsePrismicImageOptions,\n): UsePrismicImageReturnType => {\n\tconst { options } = usePrismic();\n\n\tconst asImage = computed(() => {\n\t\tconst field = unref(props.field);\n\n\t\tif (!isFilled.image(field)) {\n\t\t\treturn {\n\t\t\t\tsrc: null,\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\n\t\tconst imgixParams = unref(props.imgixParams);\n\t\tconst widths = unref(props.widths);\n\t\tconst pixelDensities = unref(props.pixelDensities);\n\n\t\tif (widths) {\n\t\t\tif (!__PRODUCTION__ && pixelDensities) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[PrismicImage] Only one of `widths` or `pixelDensities` props can be provided. You can resolve this warning by removing either the `widths` or `pixelDensities` prop. `widths` will be used in this case.\",\n\t\t\t\t\tprops,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths:\n\t\t\t\t\twidths === \"defaults\"\n\t\t\t\t\t\t? options.components?.imageWidthSrcSetDefaults\n\t\t\t\t\t\t: widths,\n\t\t\t});\n\t\t} else if (pixelDensities) {\n\t\t\treturn asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\"\n\t\t\t\t\t\t? options.components?.imagePixelDensitySrcSetDefaults\n\t\t\t\t\t\t: pixelDensities,\n\t\t\t});\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tsrc: asImageSrc(field, imgixParams),\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\t});\n\n\tconst src = computed(() => {\n\t\treturn asImage.value.src;\n\t});\n\tconst srcset = computed(() => {\n\t\treturn asImage.value.srcset;\n\t});\n\tconst alt = computed(() => {\n\t\treturn unref(props.field).alt || \"\";\n\t});\n\tconst copyright = computed(() => {\n\t\treturn unref(props.field).copyright || null;\n\t});\n\n\treturn {\n\t\tsrc,\n\t\tsrcset,\n\t\talt,\n\t\tcopyright,\n\t};\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 | ImageField<string>>,\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\timgixParams: {\n\t\t\ttype: Object as PropType<Parameters<typeof asImageSrc>[1]>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twidths: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tpixelDensities: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.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\tconst { src, srcset, alt, copyright } = usePrismicImage(props);\n\n\t\treturn () => {\n\t\t\tconst attributes = {\n\t\t\t\tsrc: src.value,\n\t\t\t\tsrcset: srcset.value,\n\t\t\t\talt: alt.value,\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: copyright.value,\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"],"names":[],"mappings":";;;;;AA6BA,MAAM,wBAAwB;AA0GjB,MAAA,kBAAkB,CAC9B,UAC8B;AACxB,QAAA,EAAE,YAAY;AAEd,QAAA,UAAU,SAAS,MAAK;;AACvB,UAAA,QAAQ,MAAM,MAAM,KAAK;AAE/B,QAAI,CAAC,SAAS,MAAM,KAAK,GAAG;AACpB,aAAA;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IAET;AAEK,UAAA,cAAc,MAAM,MAAM,WAAW;AACrC,UAAA,SAAS,MAAM,MAAM,MAAM;AAC3B,UAAA,iBAAiB,MAAM,MAAM,cAAc;AAEjD,QAAI,QAAQ;AACP,UAAA,CAAC,kBAAkB,gBAAgB;AAC9B,gBAAA,KACP,6MACA,KAAK;AAAA,MAEN;AAED,aAAO,mBAAmB,OAAO;AAAA,QAChC,GAAG;AAAA,QACH,QACC,WAAW,cACR,aAAQ,eAAR,mBAAoB,2BACpB;AAAA,MAAA,CACJ;AAAA,eACS,gBAAgB;AAC1B,aAAO,0BAA0B,OAAO;AAAA,QACvC,GAAG;AAAA,QACH,gBACC,mBAAmB,cAChB,aAAQ,eAAR,mBAAoB,kCACpB;AAAA,MAAA,CACJ;AAAA,IAAA,OACK;AACC,aAAA;AAAA,QACN,KAAK,WAAW,OAAO,WAAW;AAAA,QAClC,QAAQ;AAAA,M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K;AACX,YAAM,aAAa;AAAA,QAClB,KAAK,IAAI;AAAA,QACT,QAAQ,OAAO;AAAA,QACf,KAAK,IAAI;AAAA,MAAA;AAGV,cAAQ,KAAK,OAAO;AAAA,QACnB,KAAK;AAEG,iBAAA,EAAE,OAAO,UAAU;AAAA,QAE3B;AACC,iBAAO,EAAE,uBAAuB,KAAK,KAAK,GAAG;AAAA,YAC5C,GAAG;AAAA,YACH,WAAW,UAAU;AAAA,UAAA,CACrB;AAAA,MACF;AAAA,IAAA;AAAA,EAEH;AACA,CAAA;AAUM,MAAM,eAAe;"}
1
+ {"version":3,"file":"PrismicImage.js","sources":["../../../src/components/PrismicImage.ts"],"sourcesContent":["import {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tcomputed,\n\tConcreteComponent,\n\tComputedRef,\n\tdefineComponent,\n\th,\n\tPropType,\n\tVNodeProps,\n\tunref,\n\tDefineComponent,\n\tRaw,\n} from \"vue\";\n\nimport { ImageField } from \"@prismicio/types\";\nimport {\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasImagePixelDensitySrcSet,\n\tisFilled,\n} from \"@prismicio/helpers\";\n\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\";\nimport { __PRODUCTION__ } from \"../lib/__PRODUCTION__\";\nimport { usePrismic } from \"../usePrismic\";\nimport { VueUseOptions } from \"../types\";\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 | ImageField<string>;\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * images.\n\t *\n\t * @remarks\n\t * HTML tag names and components will be rendered using the `img` tag\n\t * interface (`src`, `srcset`, and `alt` attribute). Components will also\n\t * receive an additional `copyright` props.\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"img\"` otherwise.\n\t */\n\timageComponent?: string | ConcreteComponent | Raw<DefineComponent>;\n\n\t/**\n\t * An object of Imgix URL API parameters.\n\t *\n\t * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1];\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following given widths.\n\t *\n\t * @remarks\n\t * A special value of `\"thumbnails\"` is accepted to automatically use image\n\t * widths coming from the API.\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * widths coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `pixelDensities` prop. When both are\n\t * used the `pixelDensities` prop will be ignored.\n\t */\n\twidths?:\n\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t| \"thumbnails\"\n\t\t| \"defaults\";\n\n\t/**\n\t * Adds an additional `srcset` attribute to the image following giving pixel\n\t * densities.\n\t *\n\t * @remarks\n\t * A special value of `\"defaults\"` is accepted to automatically use image\n\t * pixel densities coming from the plugin configuration.\n\t * @remarks\n\t * This prop is not compatible with the `widths` prop. When both are used, the\n\t * `pixelDensities` prop will be ignored.\n\t */\n\tpixelDensities?:\n\t\t| NonNullable<\n\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t >[\"pixelDensities\"]\n\t\t| \"defaults\";\n};\n\n/**\n * Options for {@link usePrismicImage}.\n */\nexport type UsePrismicImageOptions = VueUseOptions<\n\tOmit<PrismicImageProps, \"imageComponent\">\n>;\n\n/**\n * Return type of {@link usePrismicImage}.\n */\nexport type UsePrismicImageReturnType = {\n\t/**\n\t * Resolved image `src` value.\n\t */\n\tsrc: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `srcset` value.\n\t */\n\tsrcset: ComputedRef<string | null>;\n\n\t/**\n\t * Resolved image `alt` value.\n\t */\n\talt: ComputedRef<string>;\n\n\t/**\n\t * Resolved image `copyright` value.\n\t */\n\tcopyright: ComputedRef<string | null>;\n};\n\n/**\n * A low level composable that returns a resolved information about a Prismic\n * image field.\n *\n * @param props - {@link UsePrismicImageOptions}\n *\n * @returns - Resolved image information {@link UsePrismicImageReturnType}\n */\nexport const usePrismicImage = (\n\tprops: UsePrismicImageOptions,\n): UsePrismicImageReturnType => {\n\tconst { options } = usePrismic();\n\n\tconst asImage = computed(() => {\n\t\tconst field = unref(props.field);\n\n\t\tif (!isFilled.image(field)) {\n\t\t\treturn {\n\t\t\t\tsrc: null,\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\n\t\tconst imgixParams = unref(props.imgixParams);\n\t\tconst widths = unref(props.widths);\n\t\tconst pixelDensities = unref(props.pixelDensities);\n\n\t\tif (widths) {\n\t\t\tif (!__PRODUCTION__ && pixelDensities) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[PrismicImage] Only one of `widths` or `pixelDensities` props can be provided. You can resolve this warning by removing either the `widths` or `pixelDensities` prop. `widths` will be used in this case.\",\n\t\t\t\t\tprops,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths:\n\t\t\t\t\twidths === \"defaults\"\n\t\t\t\t\t\t? options.components?.imageWidthSrcSetDefaults\n\t\t\t\t\t\t: widths,\n\t\t\t});\n\t\t} else if (pixelDensities) {\n\t\t\treturn asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\"\n\t\t\t\t\t\t? options.components?.imagePixelDensitySrcSetDefaults\n\t\t\t\t\t\t: pixelDensities,\n\t\t\t});\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tsrc: asImageSrc(field, imgixParams),\n\t\t\t\tsrcset: null,\n\t\t\t};\n\t\t}\n\t});\n\n\tconst src = computed(() => {\n\t\treturn asImage.value.src;\n\t});\n\tconst srcset = computed(() => {\n\t\treturn asImage.value.srcset;\n\t});\n\tconst alt = computed(() => {\n\t\treturn unref(props.field).alt || \"\";\n\t});\n\tconst copyright = computed(() => {\n\t\treturn unref(props.field).copyright || null;\n\t});\n\n\treturn {\n\t\tsrc,\n\t\tsrcset,\n\t\talt,\n\t\tcopyright,\n\t};\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 | ImageField<string>>,\n\t\t\trequired: true,\n\t\t},\n\t\timageComponent: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\timgixParams: {\n\t\t\ttype: Object as PropType<Parameters<typeof asImageSrc>[1]>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twidths: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tpixelDensities: {\n\t\t\ttype: [String, Object] as PropType<\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.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\tconst { src, srcset, alt, copyright } = usePrismicImage(props);\n\n\t\treturn () => {\n\t\t\tconst attributes = {\n\t\t\t\tsrc: src.value,\n\t\t\t\tsrcset: srcset.value,\n\t\t\t\talt: alt.value,\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: copyright.value,\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"],"names":[],"mappings":";;;;;AA+BA,MAAM,wBAAwB;AA0GjB,MAAA,kBAAkB,CAC9B,UAC8B;AACxB,QAAA,EAAE,YAAY;AAEd,QAAA,UAAU,SAAS,MAAK;;AACvB,UAAA,QAAQ,MAAM,MAAM,KAAK;AAE/B,QAAI,CAAC,SAAS,MAAM,KAAK,GAAG;AACpB,aAAA;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IAET;AAEK,UAAA,cAAc,MAAM,MAAM,WAAW;AACrC,UAAA,SAAS,MAAM,MAAM,MAAM;AAC3B,UAAA,iBAAiB,MAAM,MAAM,cAAc;AAEjD,QAAI,QAAQ;AACP,UAAA,CAAC,kBAAkB,gBAAgB;AAC9B,gBAAA,KACP,6MACA,KAAK;AAAA,MAEN;AAED,aAAO,mBAAmB,OAAO;AAAA,QAChC,GAAG;AAAA,QACH,QACC,WAAW,c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