@prismicio/vue 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PrismicEmbed.cjs +36 -0
- package/dist/components/PrismicEmbed.cjs.map +1 -0
- package/dist/components/PrismicEmbed.d.ts +63 -0
- package/dist/components/PrismicEmbed.js +36 -0
- package/dist/components/PrismicEmbed.js.map +1 -0
- package/dist/components/PrismicImage.cjs +122 -0
- package/dist/components/PrismicImage.cjs.map +1 -0
- package/dist/components/PrismicImage.d.ts +162 -0
- package/dist/components/PrismicImage.js +122 -0
- package/dist/components/PrismicImage.js.map +1 -0
- package/dist/components/PrismicLink.cjs +115 -0
- package/dist/components/PrismicLink.cjs.map +1 -0
- package/dist/components/PrismicLink.d.ts +191 -0
- package/dist/components/PrismicLink.js +115 -0
- package/dist/components/PrismicLink.js.map +1 -0
- package/dist/components/PrismicRichText.cjs +103 -0
- package/dist/components/PrismicRichText.cjs.map +1 -0
- package/dist/components/PrismicRichText.d.ts +139 -0
- package/dist/components/PrismicRichText.js +103 -0
- package/dist/components/PrismicRichText.js.map +1 -0
- package/dist/components/PrismicText.cjs +57 -0
- package/dist/components/PrismicText.cjs.map +1 -0
- package/dist/components/PrismicText.d.ts +117 -0
- package/dist/components/PrismicText.js +57 -0
- package/dist/components/PrismicText.js.map +1 -0
- package/dist/components/SliceZone.cjs +134 -0
- package/dist/components/SliceZone.cjs.map +1 -0
- package/dist/components/SliceZone.d.ts +359 -0
- package/dist/components/SliceZone.js +134 -0
- package/dist/components/SliceZone.js.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/composables.cjs +40 -0
- package/dist/composables.cjs.map +1 -0
- package/dist/composables.d.ts +366 -0
- package/dist/composables.js +40 -0
- package/dist/composables.js.map +1 -0
- package/dist/createPrismic.cjs +87 -0
- package/dist/createPrismic.cjs.map +1 -0
- package/dist/createPrismic.d.ts +12 -0
- package/dist/createPrismic.js +69 -0
- package/dist/createPrismic.js.map +1 -0
- package/dist/globalExtensions.d.ts +11 -0
- package/dist/index.cjs +46 -764
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -1404
- package/dist/index.js +45 -707
- package/dist/index.js.map +1 -1
- package/dist/injectionSymbols.cjs +5 -0
- package/dist/injectionSymbols.cjs.map +1 -0
- package/dist/injectionSymbols.d.ts +9 -0
- package/dist/injectionSymbols.js +5 -0
- package/dist/injectionSymbols.js.map +1 -0
- package/dist/lib/__PRODUCTION__.cjs +8 -0
- package/dist/lib/__PRODUCTION__.cjs.map +1 -0
- package/dist/lib/__PRODUCTION__.d.ts +7 -0
- package/dist/lib/__PRODUCTION__.js +8 -0
- package/dist/lib/__PRODUCTION__.js.map +1 -0
- package/dist/lib/getSlots.cjs +19 -0
- package/dist/lib/getSlots.cjs.map +1 -0
- package/dist/lib/getSlots.d.ts +14 -0
- package/dist/lib/getSlots.js +19 -0
- package/dist/lib/getSlots.js.map +1 -0
- package/dist/lib/isInternalURL.cjs +9 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.d.ts +8 -0
- package/dist/lib/isInternalURL.js +9 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/lib/simplyResolveComponent.cjs +8 -0
- package/dist/lib/simplyResolveComponent.cjs.map +1 -0
- package/dist/lib/simplyResolveComponent.d.ts +12 -0
- package/dist/lib/simplyResolveComponent.js +8 -0
- package/dist/lib/simplyResolveComponent.js.map +1 -0
- package/dist/types.d.ts +357 -0
- package/dist/usePrismic.cjs +9 -0
- package/dist/usePrismic.cjs.map +1 -0
- package/dist/usePrismic.d.ts +21 -0
- package/dist/usePrismic.js +9 -0
- package/dist/usePrismic.js.map +1 -0
- package/dist/useStatefulPrismicClientMethod.cjs +36 -0
- package/dist/useStatefulPrismicClientMethod.cjs.map +1 -0
- package/dist/useStatefulPrismicClientMethod.d.ts +64 -0
- package/dist/useStatefulPrismicClientMethod.js +36 -0
- package/dist/useStatefulPrismicClientMethod.js.map +1 -0
- package/package.json +28 -28
- package/src/components/PrismicEmbed.ts +2 -1
- package/src/components/PrismicImage.ts +8 -5
- package/src/components/PrismicLink.ts +4 -2
- package/src/components/PrismicRichText.ts +4 -2
- package/src/components/PrismicText.ts +6 -3
- package/src/components/SliceZone.ts +12 -7
- package/src/composables.ts +56 -46
- package/src/injectionSymbols.ts +2 -1
- package/src/types.ts +14 -7
- package/src/useStatefulPrismicClientMethod.ts +6 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const simplyResolveComponent = require("../lib/simplyResolveComponent.cjs");
|
|
5
|
+
const defaultWrapper = "div";
|
|
6
|
+
const PrismicEmbedImpl = /* @__PURE__ */ vue.defineComponent({
|
|
7
|
+
name: "PrismicEmbed",
|
|
8
|
+
props: {
|
|
9
|
+
field: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
wrapper: {
|
|
14
|
+
type: [String, Object, Function],
|
|
15
|
+
default: void 0,
|
|
16
|
+
required: false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
if (!props.field) {
|
|
21
|
+
return () => null;
|
|
22
|
+
}
|
|
23
|
+
return () => {
|
|
24
|
+
return vue.h(simplyResolveComponent.simplyResolveComponent(props.wrapper || defaultWrapper), {
|
|
25
|
+
"data-oembed": props.field.embed_url,
|
|
26
|
+
"data-oembed-type": props.field.type,
|
|
27
|
+
"data-oembed-provider": props.field.provider_name,
|
|
28
|
+
innerHTML: props.field.html || null
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const PrismicEmbed = PrismicEmbedImpl;
|
|
34
|
+
exports.PrismicEmbed = PrismicEmbed;
|
|
35
|
+
exports.PrismicEmbedImpl = PrismicEmbedImpl;
|
|
36
|
+
//# sourceMappingURL=PrismicEmbed.cjs.map
|
|
@@ -0,0 +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;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue";
|
|
2
|
+
import { simplyResolveComponent } from "../lib/simplyResolveComponent.js";
|
|
3
|
+
const defaultWrapper = "div";
|
|
4
|
+
const PrismicEmbedImpl = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "PrismicEmbed",
|
|
6
|
+
props: {
|
|
7
|
+
field: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
wrapper: {
|
|
12
|
+
type: [String, Object, Function],
|
|
13
|
+
default: void 0,
|
|
14
|
+
required: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(props) {
|
|
18
|
+
if (!props.field) {
|
|
19
|
+
return () => null;
|
|
20
|
+
}
|
|
21
|
+
return () => {
|
|
22
|
+
return h(simplyResolveComponent(props.wrapper || defaultWrapper), {
|
|
23
|
+
"data-oembed": props.field.embed_url,
|
|
24
|
+
"data-oembed-type": props.field.type,
|
|
25
|
+
"data-oembed-provider": props.field.provider_name,
|
|
26
|
+
innerHTML: props.field.html || null
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const PrismicEmbed = PrismicEmbedImpl;
|
|
32
|
+
export {
|
|
33
|
+
PrismicEmbed,
|
|
34
|
+
PrismicEmbedImpl
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=PrismicEmbed.js.map
|
|
@@ -0,0 +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;"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const helpers = require("@prismicio/helpers");
|
|
5
|
+
const simplyResolveComponent = require("../lib/simplyResolveComponent.cjs");
|
|
6
|
+
const __PRODUCTION__ = require("../lib/__PRODUCTION__.cjs");
|
|
7
|
+
const usePrismic = require("../usePrismic.cjs");
|
|
8
|
+
const defaultImageComponent = "img";
|
|
9
|
+
const usePrismicImage = (props) => {
|
|
10
|
+
const { options } = usePrismic.usePrismic();
|
|
11
|
+
const asImage = vue.computed(() => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const field = vue.unref(props.field);
|
|
14
|
+
if (!helpers.isFilled.image(field)) {
|
|
15
|
+
return {
|
|
16
|
+
src: null,
|
|
17
|
+
srcset: null
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const imgixParams = vue.unref(props.imgixParams);
|
|
21
|
+
const widths = vue.unref(props.widths);
|
|
22
|
+
const pixelDensities = vue.unref(props.pixelDensities);
|
|
23
|
+
if (widths) {
|
|
24
|
+
if (!__PRODUCTION__.__PRODUCTION__ && pixelDensities) {
|
|
25
|
+
console.warn("[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.", props);
|
|
26
|
+
}
|
|
27
|
+
return helpers.asImageWidthSrcSet(field, {
|
|
28
|
+
...imgixParams,
|
|
29
|
+
widths: widths === "defaults" ? (_a = options.components) == null ? void 0 : _a.imageWidthSrcSetDefaults : widths
|
|
30
|
+
});
|
|
31
|
+
} else if (pixelDensities) {
|
|
32
|
+
return helpers.asImagePixelDensitySrcSet(field, {
|
|
33
|
+
...imgixParams,
|
|
34
|
+
pixelDensities: pixelDensities === "defaults" ? (_b = options.components) == null ? void 0 : _b.imagePixelDensitySrcSetDefaults : pixelDensities
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
return {
|
|
38
|
+
src: helpers.asImageSrc(field, imgixParams),
|
|
39
|
+
srcset: null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const src = vue.computed(() => {
|
|
44
|
+
return asImage.value.src;
|
|
45
|
+
});
|
|
46
|
+
const srcset = vue.computed(() => {
|
|
47
|
+
return asImage.value.srcset;
|
|
48
|
+
});
|
|
49
|
+
const alt = vue.computed(() => {
|
|
50
|
+
return vue.unref(props.field).alt || "";
|
|
51
|
+
});
|
|
52
|
+
const copyright = vue.computed(() => {
|
|
53
|
+
return vue.unref(props.field).copyright || null;
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
src,
|
|
57
|
+
srcset,
|
|
58
|
+
alt,
|
|
59
|
+
copyright
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const PrismicImageImpl = /* @__PURE__ */ vue.defineComponent({
|
|
63
|
+
name: "PrismicImage",
|
|
64
|
+
props: {
|
|
65
|
+
field: {
|
|
66
|
+
type: Object,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
imageComponent: {
|
|
70
|
+
type: [String, Object],
|
|
71
|
+
default: void 0,
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
74
|
+
imgixParams: {
|
|
75
|
+
type: Object,
|
|
76
|
+
default: void 0,
|
|
77
|
+
required: false
|
|
78
|
+
},
|
|
79
|
+
widths: {
|
|
80
|
+
type: [String, Object],
|
|
81
|
+
default: void 0,
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
pixelDensities: {
|
|
85
|
+
type: [String, Object],
|
|
86
|
+
default: void 0,
|
|
87
|
+
required: false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
setup(props) {
|
|
91
|
+
if (!props.field) {
|
|
92
|
+
return () => null;
|
|
93
|
+
}
|
|
94
|
+
const { options } = usePrismic.usePrismic();
|
|
95
|
+
const type = vue.computed(() => {
|
|
96
|
+
var _a;
|
|
97
|
+
return props.imageComponent || ((_a = options.components) == null ? void 0 : _a.imageComponent) || defaultImageComponent;
|
|
98
|
+
});
|
|
99
|
+
const { src, srcset, alt, copyright } = usePrismicImage(props);
|
|
100
|
+
return () => {
|
|
101
|
+
const attributes = {
|
|
102
|
+
src: src.value,
|
|
103
|
+
srcset: srcset.value,
|
|
104
|
+
alt: alt.value
|
|
105
|
+
};
|
|
106
|
+
switch (type.value) {
|
|
107
|
+
case "img":
|
|
108
|
+
return vue.h("img", attributes);
|
|
109
|
+
default:
|
|
110
|
+
return vue.h(simplyResolveComponent.simplyResolveComponent(type.value), {
|
|
111
|
+
...attributes,
|
|
112
|
+
copyright: copyright.value
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const PrismicImage = PrismicImageImpl;
|
|
119
|
+
exports.PrismicImage = PrismicImage;
|
|
120
|
+
exports.PrismicImageImpl = PrismicImageImpl;
|
|
121
|
+
exports.usePrismicImage = usePrismicImage;
|
|
122
|
+
//# sourceMappingURL=PrismicImage.cjs.map
|
|
@@ -0,0 +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,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,MAAK;AAC5B,WAAO,QAAQ,MAAM;AAAA,EAAA,CACrB;AACK,QAAA,MAAMA,IAAAA,SAAS,MAAK;AACzB,WAAOC,IAAM,MAAA,MAAM,KAAK,EAAE,OAAO;AAAA,EAAA,CACjC;AACK,QAAA,YAAYD,IAAAA,SAAS,MAAK;AAC/B,WAAOC,IAAM,MAAA,MAAM,KAAK,EAAE,aAAa;AAAA,EAAA,CACvC;AAEM,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;AAOO,MAAM,mBAAiDM,oBAAAA,gBAAA;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,MACT,UAAU;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;;;;"}
|
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { computed, unref, defineComponent, h } from "vue";
|
|
2
|
+
import { isFilled, asImageWidthSrcSet, asImagePixelDensitySrcSet, asImageSrc } from "@prismicio/helpers";
|
|
3
|
+
import { simplyResolveComponent } from "../lib/simplyResolveComponent.js";
|
|
4
|
+
import { __PRODUCTION__ } from "../lib/__PRODUCTION__.js";
|
|
5
|
+
import { usePrismic } from "../usePrismic.js";
|
|
6
|
+
const defaultImageComponent = "img";
|
|
7
|
+
const usePrismicImage = (props) => {
|
|
8
|
+
const { options } = usePrismic();
|
|
9
|
+
const asImage = computed(() => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const field = unref(props.field);
|
|
12
|
+
if (!isFilled.image(field)) {
|
|
13
|
+
return {
|
|
14
|
+
src: null,
|
|
15
|
+
srcset: null
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const imgixParams = unref(props.imgixParams);
|
|
19
|
+
const widths = unref(props.widths);
|
|
20
|
+
const pixelDensities = unref(props.pixelDensities);
|
|
21
|
+
if (widths) {
|
|
22
|
+
if (!__PRODUCTION__ && pixelDensities) {
|
|
23
|
+
console.warn("[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.", props);
|
|
24
|
+
}
|
|
25
|
+
return asImageWidthSrcSet(field, {
|
|
26
|
+
...imgixParams,
|
|
27
|
+
widths: widths === "defaults" ? (_a = options.components) == null ? void 0 : _a.imageWidthSrcSetDefaults : widths
|
|
28
|
+
});
|
|
29
|
+
} else if (pixelDensities) {
|
|
30
|
+
return asImagePixelDensitySrcSet(field, {
|
|
31
|
+
...imgixParams,
|
|
32
|
+
pixelDensities: pixelDensities === "defaults" ? (_b = options.components) == null ? void 0 : _b.imagePixelDensitySrcSetDefaults : pixelDensities
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
return {
|
|
36
|
+
src: asImageSrc(field, imgixParams),
|
|
37
|
+
srcset: null
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const src = computed(() => {
|
|
42
|
+
return asImage.value.src;
|
|
43
|
+
});
|
|
44
|
+
const srcset = computed(() => {
|
|
45
|
+
return asImage.value.srcset;
|
|
46
|
+
});
|
|
47
|
+
const alt = computed(() => {
|
|
48
|
+
return unref(props.field).alt || "";
|
|
49
|
+
});
|
|
50
|
+
const copyright = computed(() => {
|
|
51
|
+
return unref(props.field).copyright || null;
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
src,
|
|
55
|
+
srcset,
|
|
56
|
+
alt,
|
|
57
|
+
copyright
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const PrismicImageImpl = /* @__PURE__ */ defineComponent({
|
|
61
|
+
name: "PrismicImage",
|
|
62
|
+
props: {
|
|
63
|
+
field: {
|
|
64
|
+
type: Object,
|
|
65
|
+
required: true
|
|
66
|
+
},
|
|
67
|
+
imageComponent: {
|
|
68
|
+
type: [String, Object],
|
|
69
|
+
default: void 0,
|
|
70
|
+
required: false
|
|
71
|
+
},
|
|
72
|
+
imgixParams: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: void 0,
|
|
75
|
+
required: false
|
|
76
|
+
},
|
|
77
|
+
widths: {
|
|
78
|
+
type: [String, Object],
|
|
79
|
+
default: void 0,
|
|
80
|
+
required: false
|
|
81
|
+
},
|
|
82
|
+
pixelDensities: {
|
|
83
|
+
type: [String, Object],
|
|
84
|
+
default: void 0,
|
|
85
|
+
required: false
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
setup(props) {
|
|
89
|
+
if (!props.field) {
|
|
90
|
+
return () => null;
|
|
91
|
+
}
|
|
92
|
+
const { options } = usePrismic();
|
|
93
|
+
const type = computed(() => {
|
|
94
|
+
var _a;
|
|
95
|
+
return props.imageComponent || ((_a = options.components) == null ? void 0 : _a.imageComponent) || defaultImageComponent;
|
|
96
|
+
});
|
|
97
|
+
const { src, srcset, alt, copyright } = usePrismicImage(props);
|
|
98
|
+
return () => {
|
|
99
|
+
const attributes = {
|
|
100
|
+
src: src.value,
|
|
101
|
+
srcset: srcset.value,
|
|
102
|
+
alt: alt.value
|
|
103
|
+
};
|
|
104
|
+
switch (type.value) {
|
|
105
|
+
case "img":
|
|
106
|
+
return h("img", attributes);
|
|
107
|
+
default:
|
|
108
|
+
return h(simplyResolveComponent(type.value), {
|
|
109
|
+
...attributes,
|
|
110
|
+
copyright: copyright.value
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const PrismicImage = PrismicImageImpl;
|
|
117
|
+
export {
|
|
118
|
+
PrismicImage,
|
|
119
|
+
PrismicImageImpl,
|
|
120
|
+
usePrismicImage
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=PrismicImage.js.map
|
|
@@ -0,0 +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":"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"}
|