@prismicio/vue 5.3.0-canary.5d9ea4c → 5.3.0-canary.aa89de6
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/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +24 -104
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +31 -36
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +15 -2
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +8 -8
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.cts +7 -6
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts +2 -10
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +2 -10
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/index.cjs +3 -10
- package/dist/index.d.cts +9 -13
- package/dist/index.d.ts +11 -15
- package/dist/index.js +3 -6
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/src/PrismicImage.cjs.map +1 -1
- package/dist/src/PrismicImage.js.map +1 -1
- package/dist/src/PrismicImage.vue.d.ts +4 -4
- package/dist/src/PrismicImage.vue.d.ts.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +2 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js +2 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicLink.cjs.map +1 -1
- package/dist/src/PrismicLink.js.map +1 -1
- package/dist/src/PrismicLink.vue.d.ts +24 -104
- package/dist/src/PrismicLink.vue.d.ts.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -6
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +31 -36
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +19 -52
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +20 -53
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +75 -35
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +76 -36
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +29 -8
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +30 -9
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/types.d.ts +15 -2
- package/dist/src/PrismicRichText/types.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts +7 -7
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +5 -5
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/src/PrismicTable/types.d.ts +7 -6
- package/dist/src/PrismicTable/types.d.ts.map +1 -1
- package/dist/src/PrismicText.cjs.map +1 -1
- package/dist/src/PrismicText.js.map +1 -1
- package/dist/src/PrismicText.vue.d.ts +2 -10
- package/dist/src/PrismicText.vue.d.ts.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -12
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js +3 -14
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue.d.ts +2 -10
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +5 -17
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +6 -18
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/types.d.ts +2 -352
- package/dist/src/types.d.ts.map +1 -1
- package/dist/types.d.cts +2 -352
- package/dist/types.d.cts.map +1 -1
- package/package.json +6 -5
- package/src/PrismicImage.vue +2 -11
- package/src/PrismicLink.vue +9 -34
- package/src/PrismicRichText/PrismicRichText.vue +31 -101
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +46 -20
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +31 -10
- package/src/PrismicRichText/types.ts +16 -1
- package/src/PrismicTable/PrismicTable.vue +7 -7
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +39 -20
- package/src/PrismicTable/types.ts +16 -6
- package/src/PrismicText.vue +2 -15
- package/src/SliceZone/SliceZone.vue +9 -27
- package/src/index.ts +13 -21
- package/src/types.ts +1 -439
- package/dist/PrismicEmbed.vue.d.cts +0 -25
- package/dist/PrismicEmbed.vue.d.cts.map +0 -1
- package/dist/createPrismic.d.cts +0 -29
- package/dist/createPrismic.d.cts.map +0 -1
- package/dist/src/PrismicEmbed.cjs +0 -8
- package/dist/src/PrismicEmbed.cjs.map +0 -1
- package/dist/src/PrismicEmbed.js +0 -8
- package/dist/src/PrismicEmbed.js.map +0 -1
- package/dist/src/PrismicEmbed.vue.d.ts +0 -25
- package/dist/src/PrismicEmbed.vue.d.ts.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/createPrismic.cjs +0 -85
- package/dist/src/createPrismic.cjs.map +0 -1
- package/dist/src/createPrismic.d.ts +0 -29
- package/dist/src/createPrismic.d.ts.map +0 -1
- package/dist/src/createPrismic.js +0 -85
- package/dist/src/createPrismic.js.map +0 -1
- package/dist/src/lib/Wrapper.cjs +0 -8
- package/dist/src/lib/Wrapper.cjs.map +0 -1
- package/dist/src/lib/Wrapper.js +0 -8
- package/dist/src/lib/Wrapper.js.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/usePrismic.cjs +0 -38
- package/dist/src/usePrismic.cjs.map +0 -1
- package/dist/src/usePrismic.d.ts +0 -36
- package/dist/src/usePrismic.d.ts.map +0 -1
- package/dist/src/usePrismic.js +0 -37
- package/dist/src/usePrismic.js.map +0 -1
- package/dist/usePrismic.d.cts +0 -36
- package/dist/usePrismic.d.cts.map +0 -1
- package/src/PrismicEmbed.vue +0 -42
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +0 -146
- package/src/createPrismic.ts +0 -154
- package/src/usePrismic.ts +0 -36
package/src/index.ts
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
export { default as PrismicRichText } from "./PrismicRichText/PrismicRichText.vue"
|
|
2
|
-
export { default as PrismicTable } from "./PrismicTable/PrismicTable.vue"
|
|
3
|
-
export { default as SliceZone } from "./SliceZone/SliceZone.vue"
|
|
4
|
-
|
|
5
|
-
export { default as PrismicEmbed } from "./PrismicEmbed.vue"
|
|
6
|
-
export { default as PrismicImage } from "./PrismicImage.vue"
|
|
7
|
-
export { default as PrismicLink } from "./PrismicLink.vue"
|
|
8
|
-
export { default as PrismicText } from "./PrismicText.vue"
|
|
9
|
-
|
|
10
|
-
export type { SliceZoneProps } from "./SliceZone/SliceZone.vue"
|
|
11
2
|
export type { PrismicRichTextProps } from "./PrismicRichText/PrismicRichText.vue"
|
|
12
|
-
export type { PrismicTableProps } from "./PrismicTable/PrismicTable.vue"
|
|
13
|
-
|
|
14
|
-
export type { PrismicEmbedProps } from "./PrismicEmbed.vue"
|
|
15
|
-
export type { PrismicImageProps } from "./PrismicImage.vue"
|
|
16
|
-
export type { PrismicLinkProps } from "./PrismicLink.vue"
|
|
17
|
-
export type { PrismicTextProps } from "./PrismicText.vue"
|
|
18
|
-
|
|
19
3
|
export { getRichTextComponentProps } from "./PrismicRichText"
|
|
20
4
|
export type {
|
|
21
5
|
VueRichTextSerializer,
|
|
22
6
|
RichTextComponentProps,
|
|
23
7
|
} from "./PrismicRichText"
|
|
24
8
|
|
|
9
|
+
export { default as PrismicTable } from "./PrismicTable/PrismicTable.vue"
|
|
10
|
+
export type { PrismicTableProps } from "./PrismicTable/PrismicTable.vue"
|
|
25
11
|
export { getTableComponentProps } from "./PrismicTable"
|
|
26
12
|
|
|
13
|
+
export { default as PrismicImage } from "./PrismicImage.vue"
|
|
14
|
+
export type { PrismicImageProps } from "./PrismicImage.vue"
|
|
15
|
+
|
|
16
|
+
export { default as PrismicLink } from "./PrismicLink.vue"
|
|
17
|
+
export type { PrismicLinkProps } from "./PrismicLink.vue"
|
|
18
|
+
|
|
19
|
+
export { default as PrismicText } from "./PrismicText.vue"
|
|
20
|
+
export type { PrismicTextProps } from "./PrismicText.vue"
|
|
21
|
+
|
|
22
|
+
export { default as SliceZone } from "./SliceZone/SliceZone.vue"
|
|
23
|
+
export type { SliceZoneProps } from "./SliceZone/SliceZone.vue"
|
|
27
24
|
export {
|
|
28
25
|
TODOSliceComponent,
|
|
29
26
|
defineSliceZoneComponents,
|
|
@@ -38,8 +35,3 @@ export type {
|
|
|
38
35
|
SliceZoneComponents,
|
|
39
36
|
SliceZoneLike,
|
|
40
37
|
} from "./SliceZone"
|
|
41
|
-
|
|
42
|
-
export type { PrismicPluginOptions, PrismicPlugin } from "./types"
|
|
43
|
-
|
|
44
|
-
export { createPrismic } from "./createPrismic"
|
|
45
|
-
export { usePrismic, prismicKey } from "./usePrismic"
|
package/src/types.ts
CHANGED
|
@@ -1,443 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AsLinkAttrsConfig,
|
|
3
|
-
ClientConfig,
|
|
4
|
-
CreateClient,
|
|
5
|
-
HTMLRichTextFunctionSerializer,
|
|
6
|
-
HTMLRichTextMapSerializer,
|
|
7
|
-
LinkResolverFunction,
|
|
8
|
-
asDate,
|
|
9
|
-
asHTML,
|
|
10
|
-
asImagePixelDensitySrcSet,
|
|
11
|
-
asImageSrc,
|
|
12
|
-
asImageWidthSrcSet,
|
|
13
|
-
asLink,
|
|
14
|
-
asLinkAttrs,
|
|
15
|
-
asText,
|
|
16
|
-
cookie,
|
|
17
|
-
documentToLinkField,
|
|
18
|
-
filter,
|
|
19
|
-
isFilled,
|
|
20
|
-
} from "@prismicio/client"
|
|
21
|
-
import type { App, ConcreteComponent, DefineComponent, Raw, Ref } from "vue"
|
|
22
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
23
|
-
// Imports for @link references:
|
|
24
|
-
import type { RouterLink } from "vue-router"
|
|
1
|
+
import type { ConcreteComponent, DefineComponent, Raw } from "vue"
|
|
25
2
|
|
|
26
|
-
import type { VueRichTextSerializer } from "./PrismicRichText/types"
|
|
27
|
-
|
|
28
|
-
import type {
|
|
29
|
-
SliceComponentProps,
|
|
30
|
-
SliceComponentType,
|
|
31
|
-
TODOSliceComponent,
|
|
32
|
-
} from "./SliceZone"
|
|
33
|
-
|
|
34
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Options used by `@prismicio/vue` components.
|
|
38
|
-
*/
|
|
39
|
-
type PrismicPluginComponentsOptions = {
|
|
40
|
-
/**
|
|
41
|
-
* The `rel` attribute to apply on links. This prop can be provided a function
|
|
42
|
-
* to use the link's metadata to determine the `rel` value.
|
|
43
|
-
*
|
|
44
|
-
* @defaultValue `"noreferrer"` for external links.
|
|
45
|
-
*/
|
|
46
|
-
linkRel?: AsLinkAttrsConfig["rel"]
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* An HTML tag name or a component used to render internal links.
|
|
50
|
-
*
|
|
51
|
-
* @remarks
|
|
52
|
-
* HTML tag names will be rendered using the anchor tag interface (`href`,
|
|
53
|
-
* `target`, and `rel` attributes).
|
|
54
|
-
* @remarks
|
|
55
|
-
* Components will be rendered using Vue Router {@link RouterLink} interface
|
|
56
|
-
* (`to` props).
|
|
57
|
-
*
|
|
58
|
-
* @defaultValue {@link RouterLink}
|
|
59
|
-
*/
|
|
60
|
-
linkInternalComponent?: ComponentOrTagName
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* An HTML tag name or a component used to render external links.
|
|
64
|
-
*
|
|
65
|
-
* @remarks
|
|
66
|
-
* HTML tag names will be rendered using the anchor tag interface (`href`,
|
|
67
|
-
* `target`, and `rel` attributes).
|
|
68
|
-
* @remarks
|
|
69
|
-
* Components will be rendered using Vue Router {@link RouterLink} interface
|
|
70
|
-
* (`to` props).
|
|
71
|
-
*
|
|
72
|
-
* @defaultValue `"a"`
|
|
73
|
-
*/
|
|
74
|
-
linkExternalComponent?: ComponentOrTagName
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Default widths to use when rendering an image with `widths="defaults"`
|
|
78
|
-
*
|
|
79
|
-
* @remarks
|
|
80
|
-
* Consider configuring image widths within your content type definition and
|
|
81
|
-
* using `widths="auto"` instead to give content writers the ability to crop
|
|
82
|
-
* images in the editor.
|
|
83
|
-
*
|
|
84
|
-
* @defaultValue `@prismicio/client` defaults
|
|
85
|
-
*/
|
|
86
|
-
imageWidthSrcSetDefaults?: number[]
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Default pixel densities to use when rendering an image with
|
|
90
|
-
* `pixel-densities="defaults"`
|
|
91
|
-
*
|
|
92
|
-
* @defaultValue `@prismicio/client` defaults
|
|
93
|
-
*/
|
|
94
|
-
imagePixelDensitySrcSetDefaults?: number[]
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* An optional map of Rich Text block types to Vue Components. It is used to
|
|
98
|
-
* render rich text or title fields.
|
|
99
|
-
*
|
|
100
|
-
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/rich-text}
|
|
101
|
-
*/
|
|
102
|
-
richTextComponents?: VueRichTextSerializer
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* A component or a functional component rendered if a component mapping from
|
|
106
|
-
* the `components` prop cannot be found.
|
|
107
|
-
*
|
|
108
|
-
* @remarks
|
|
109
|
-
* Components will be rendered using the {@link SliceComponentProps} interface.
|
|
110
|
-
*
|
|
111
|
-
* @defaultValue `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}
|
|
112
|
-
*/
|
|
113
|
-
sliceZoneDefaultComponent?: SliceComponentType
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Common options supported by `@prismicio/vue` plugin.
|
|
118
|
-
*/
|
|
119
|
-
type PrismicPluginOptionsBase = {
|
|
120
|
-
/**
|
|
121
|
-
* An optional link resolver function used to resolve links to Prismic
|
|
122
|
-
* documents when not using the route resolver parameter with
|
|
123
|
-
* `@prismicio/client`.
|
|
124
|
-
*
|
|
125
|
-
* @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
|
|
126
|
-
*/
|
|
127
|
-
linkResolver?: LinkResolverFunction
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* An optional HTML serializer to customize the way rich text fields are
|
|
131
|
-
* rendered.
|
|
132
|
-
*
|
|
133
|
-
* @remarks
|
|
134
|
-
* To provide global components for the `<PrismicRichText />` component, use
|
|
135
|
-
* the `components.richTextComponents` option instead.
|
|
136
|
-
*
|
|
137
|
-
* @deprecated Use `components.richTextComponents` instead.
|
|
138
|
-
*
|
|
139
|
-
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
140
|
-
*/
|
|
141
|
-
richTextSerializer?:
|
|
142
|
-
| HTMLRichTextFunctionSerializer
|
|
143
|
-
| HTMLRichTextMapSerializer
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Whether or not to inject components globally.
|
|
147
|
-
*
|
|
148
|
-
* @defaultValue `true`
|
|
149
|
-
*/
|
|
150
|
-
injectComponents?: boolean
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Options used by Prismic Vue components.
|
|
154
|
-
*
|
|
155
|
-
* @see Components options {@link PrismicPluginComponentsOptions}
|
|
156
|
-
*/
|
|
157
|
-
components?: PrismicPluginComponentsOptions
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Options to init `@prismicio/vue` plugin with a client instance.
|
|
162
|
-
*
|
|
163
|
-
* @see {@link PrismicPluginOptionsBase} for shared options
|
|
164
|
-
*/
|
|
165
|
-
type PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {
|
|
166
|
-
/**
|
|
167
|
-
* A `@prismicio/client` instance used to fetch content from a Prismic
|
|
168
|
-
* repository to configure the plugin with.
|
|
169
|
-
*
|
|
170
|
-
* @remarks
|
|
171
|
-
* The client will be used by `@prismicio/vue` composables, such as
|
|
172
|
-
* {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
|
|
173
|
-
* `usePrismic().client`.
|
|
174
|
-
*
|
|
175
|
-
* @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
|
|
176
|
-
*/
|
|
177
|
-
client: ReturnType<CreateClient>
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Ensures type union is a strict or.
|
|
181
|
-
*
|
|
182
|
-
* @internal
|
|
183
|
-
*/
|
|
184
|
-
endpoint?: never
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Ensures type union is a strict or.
|
|
188
|
-
*
|
|
189
|
-
* @internal
|
|
190
|
-
*/
|
|
191
|
-
clientConfig?: never
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Options to init `@prismicio/vue` plugin with a repository ID or API endpoint.
|
|
196
|
-
*
|
|
197
|
-
* @see {@link PrismicPluginOptionsBase} for shared options
|
|
198
|
-
*/
|
|
199
|
-
type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
|
|
200
|
-
/**
|
|
201
|
-
* A Prismic repository endpoint to init the plugin's `@prismicio/client`
|
|
202
|
-
* instance used to fetch content from a Prismic repository with.
|
|
203
|
-
*
|
|
204
|
-
* @remarks
|
|
205
|
-
* Said client will be used by `@prismicio/vue` composables, such as
|
|
206
|
-
* {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
|
|
207
|
-
* `usePrismic().client`.
|
|
208
|
-
*
|
|
209
|
-
* @example
|
|
210
|
-
*
|
|
211
|
-
* ```javascript
|
|
212
|
-
* // A repository ID
|
|
213
|
-
* "my-repo"
|
|
214
|
-
*
|
|
215
|
-
* //A full repository endpoint
|
|
216
|
-
* "https://my-repo.cdn.prismic.io/api/v2"
|
|
217
|
-
* ```
|
|
218
|
-
*
|
|
219
|
-
* @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
|
|
220
|
-
*/
|
|
221
|
-
endpoint: string
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* An optional object to configure `@prismicio/client` instance further.
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
|
-
*
|
|
228
|
-
* ```javascript
|
|
229
|
-
* // Accessing a private private repository
|
|
230
|
-
* {
|
|
231
|
-
* "accessToken": "abc"
|
|
232
|
-
* }
|
|
233
|
-
* ```
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
*
|
|
237
|
-
* ```javascript
|
|
238
|
-
* // Using a route resolver
|
|
239
|
-
* {
|
|
240
|
-
* "defaultParams": {
|
|
241
|
-
* "routes": [
|
|
242
|
-
* {
|
|
243
|
-
* "type": "page",
|
|
244
|
-
* "path": "/:uid"
|
|
245
|
-
* },
|
|
246
|
-
* {
|
|
247
|
-
* "type": "post",
|
|
248
|
-
* "path": "/blog/:uid"
|
|
249
|
-
* }
|
|
250
|
-
* ]
|
|
251
|
-
* }
|
|
252
|
-
* }
|
|
253
|
-
* ```
|
|
254
|
-
*
|
|
255
|
-
* @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
|
|
256
|
-
* @see Route resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
257
|
-
*/
|
|
258
|
-
clientConfig?: ClientConfig
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Ensures type union is a strict or.
|
|
262
|
-
*
|
|
263
|
-
* @internal
|
|
264
|
-
*/
|
|
265
|
-
client?: never
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* `@prismicio/vue` plugin options.
|
|
270
|
-
*
|
|
271
|
-
* @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}
|
|
272
|
-
* @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}
|
|
273
|
-
*/
|
|
274
|
-
export type PrismicPluginOptions =
|
|
275
|
-
| PrismicPluginOptionsWithClient
|
|
276
|
-
| PrismicPluginOptionsWithEndpoint
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* `@prismicio/client` related methods and properties exposed by
|
|
280
|
-
* `@prismicio/vue` plugin and accessible through `this.$prismic` and
|
|
281
|
-
* `usePrismic()`.
|
|
282
|
-
*/
|
|
283
|
-
export type PrismicPluginClient = {
|
|
284
|
-
/**
|
|
285
|
-
* A `@prismicio/client` instance.
|
|
286
|
-
*/
|
|
287
|
-
client: ReturnType<CreateClient>
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Query filters from `@prismicio/client`.
|
|
291
|
-
*/
|
|
292
|
-
filter: typeof filter
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Prismic cookies from `@prismicio/client`.
|
|
296
|
-
*/
|
|
297
|
-
cookie: typeof cookie
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* `@prismicio/client` related methods exposed by `@prismicio/vue` plugin and
|
|
302
|
-
* accessible through `this.$prismic` and `usePrismic()`.
|
|
303
|
-
*/
|
|
304
|
-
export type PrismicPluginHelpers = {
|
|
305
|
-
/**
|
|
306
|
-
* Serializes a rich text or title field to a plain text string. This is
|
|
307
|
-
* `@prismicio/client` {@link asText} function.
|
|
308
|
-
*
|
|
309
|
-
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
310
|
-
*/
|
|
311
|
-
asText: typeof asText
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Serializes a rich text or title field to an HTML string. This is
|
|
315
|
-
* `@prismicio/client` {@link asHTML} function.
|
|
316
|
-
*
|
|
317
|
-
* @remarks
|
|
318
|
-
* If no `linkResolver` is provided the function will use the one provided to
|
|
319
|
-
* the plugin at {@link PrismicPluginOptions.linkResolver} if available.
|
|
320
|
-
* @remarks
|
|
321
|
-
* If no `htmlSerializer` is provided the function will use the one provided
|
|
322
|
-
* to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.
|
|
323
|
-
*
|
|
324
|
-
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
325
|
-
*/
|
|
326
|
-
asHTML: typeof asHTML
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Resolves any type of link field or document to a URL. This is
|
|
330
|
-
* `@prismicio/client` {@link asLink} function.
|
|
331
|
-
*
|
|
332
|
-
* @remarks
|
|
333
|
-
* If no `linkResolver` is provided the function will use the one provided to
|
|
334
|
-
* the plugin at {@link PrismicPluginOptions.linkResolver} if available.
|
|
335
|
-
*
|
|
336
|
-
* @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
|
|
337
|
-
*/
|
|
338
|
-
asLink: typeof asLink
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Resolves any type of link field or document to a set of link attributes.
|
|
342
|
-
* This is `@prismicio/client` {@link asLinkAttrs} function.
|
|
343
|
-
*
|
|
344
|
-
* @remarks
|
|
345
|
-
* If no `linkResolver` is provided the function will use the one provided to
|
|
346
|
-
* the plugin at {@link PrismicPluginOptions.linkResolver} if available.
|
|
347
|
-
*
|
|
348
|
-
* @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
|
|
349
|
-
*/
|
|
350
|
-
asLinkAttrs: typeof asLinkAttrs
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Transforms a date or timestamp field into a JavaScript Date object. This is
|
|
354
|
-
* `@prismicio/client` {@link asDate} function.
|
|
355
|
-
*/
|
|
356
|
-
asDate: typeof asDate
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Returns the URL of an image field with optional image transformations (via
|
|
360
|
-
* Imgix URL parameters). This is `@prismicio/client` {@link asImageSrc}
|
|
361
|
-
* function.
|
|
362
|
-
*/
|
|
363
|
-
asImageSrc: typeof asImageSrc
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Creates a width-based `srcset` from an image field with optional image
|
|
367
|
-
* transformations (via Imgix URL parameters). This is `@prismicio/client`
|
|
368
|
-
* {@link asImageWidthSrcSet} function.
|
|
369
|
-
*/
|
|
370
|
-
asImageWidthSrcSet: typeof asImageWidthSrcSet
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Creates a pixel-density-based `srcset` from an image field with optional
|
|
374
|
-
* image transformations (via Imgix URL parameters). This is
|
|
375
|
-
* `@prismicio/client` {@link asImagePixelDensitySrcSet} function.
|
|
376
|
-
*/
|
|
377
|
-
asImagePixelDensitySrcSet: typeof asImagePixelDensitySrcSet
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Helpers to determine if a field is filled. This is `@prismicio/client`
|
|
381
|
-
* {@link isFilled} object.
|
|
382
|
-
*/
|
|
383
|
-
isFilled: typeof isFilled
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Converts a document into a link field. This is `@prismicio/client`
|
|
387
|
-
* {@link documentToLinkField} function.
|
|
388
|
-
*
|
|
389
|
-
* @internal
|
|
390
|
-
*/
|
|
391
|
-
documentToLinkField: typeof documentToLinkField
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Methods and properties exposed by `@prismicio/vue` plugin and accessible
|
|
396
|
-
* through `this.$prismic` and `usePrismic()`.
|
|
397
|
-
*/
|
|
398
|
-
export type PrismicPlugin = {
|
|
399
|
-
/**
|
|
400
|
-
* Options uses to initialize the plugin.
|
|
401
|
-
*
|
|
402
|
-
* @see `@prismicio/vue` plugin options {@link PrismicPluginOptions}
|
|
403
|
-
*/
|
|
404
|
-
readonly options: PrismicPluginOptions
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* `@prismicio/vue` plugin install function used by Vue.
|
|
408
|
-
*
|
|
409
|
-
* @internal
|
|
410
|
-
*/
|
|
411
|
-
install: (app: App) => void
|
|
412
|
-
} & PrismicPluginClient &
|
|
413
|
-
PrismicPluginHelpers
|
|
414
|
-
|
|
415
|
-
// Helpers
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Type to transform a static object into one that allows passing Refs as
|
|
419
|
-
* values.
|
|
420
|
-
*
|
|
421
|
-
* @internal
|
|
422
|
-
*/
|
|
423
|
-
export type VueUseOptions<T> = {
|
|
424
|
-
[K in keyof T]: Ref<T[K]> | T[K]
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Type to transform a static tuple into one that allows passing Refs as values.
|
|
429
|
-
*
|
|
430
|
-
* @internal
|
|
431
|
-
*/
|
|
432
|
-
export type VueUseParameters<T> = {
|
|
433
|
-
[K in keyof T]: T extends number ? Ref<T[K]> | T[K] : T[K]
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* A component or a tag name to be used as props.
|
|
438
|
-
*
|
|
439
|
-
* @internal
|
|
440
|
-
*/
|
|
441
3
|
export type ComponentOrTagName =
|
|
442
4
|
| string
|
|
443
5
|
| ConcreteComponent
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentOrTagName } from "./types.cjs";
|
|
2
|
-
import * as vue16 from "vue";
|
|
3
|
-
import { EmbedField } from "@prismicio/client";
|
|
4
|
-
|
|
5
|
-
//#region src/PrismicEmbed.vue.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Props for `<PrismicEmbed />`.
|
|
8
|
-
*/
|
|
9
|
-
type PrismicEmbedProps = {
|
|
10
|
-
/**
|
|
11
|
-
* The Prismic EMbed field to render.
|
|
12
|
-
*/
|
|
13
|
-
field: EmbedField;
|
|
14
|
-
/**
|
|
15
|
-
* An HTML tag name or a component used to wrap the output.
|
|
16
|
-
*
|
|
17
|
-
* @defaultValue `"div"`
|
|
18
|
-
*/
|
|
19
|
-
wrapper?: ComponentOrTagName;
|
|
20
|
-
};
|
|
21
|
-
declare const __VLS_export: vue16.DefineComponent<PrismicEmbedProps, {}, {}, {}, {}, vue16.ComponentOptionsMixin, vue16.ComponentOptionsMixin, {}, string, vue16.PublicProps, Readonly<PrismicEmbedProps> & Readonly<{}>, {}, {}, {}, {}, string, vue16.ComponentProvideOptions, false, {}, any>;
|
|
22
|
-
declare const _default: typeof __VLS_export;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { PrismicEmbedProps, _default };
|
|
25
|
-
//# sourceMappingURL=PrismicEmbed.vue.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicEmbed.vue.d.cts","names":[],"sources":["../src/PrismicEmbed.vue"],"sourcesContent":[],"mappings":";;;;;;;;AAyDY,KAAA,iBAAA,GAAiB;EAwDvB;;;EAAY,KAAA,EApDV,UAoDU;EAAA;;;;;EAAA,OAAA,CAAA,EA7CP,kBA6CO;CAAA;AAAA,cAAZ,YAGkC,EAHtB,KAAA,CAAA,eAGsB,CAHtB,iBAGsB,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAHtB,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EAGsB,CAAA,CAAA,EAAA,MAAA,EAHtB,KAAA,CAAA,WAAA,EAAA,QAGsB,CAHtB,iBAGsB,CAAA,GAHtB,QAGsB,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAHtB,KAAA,CAAA,uBAAA,EAGsB,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAHtB,iBAGU"}
|
package/dist/createPrismic.d.cts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { PrismicPlugin, PrismicPluginOptions } from "./types.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/createPrismic.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.
|
|
7
|
-
*
|
|
8
|
-
* @param options - {@link PrismicPluginOptions}
|
|
9
|
-
*
|
|
10
|
-
* @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}
|
|
11
|
-
*
|
|
12
|
-
* @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}
|
|
13
|
-
* @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}
|
|
14
|
-
*/
|
|
15
|
-
declare const createPrismic: (options: PrismicPluginOptions) => PrismicPlugin;
|
|
16
|
-
declare module "vue" {
|
|
17
|
-
interface ComponentCustomProperties {
|
|
18
|
-
/**
|
|
19
|
-
* `@prismicio/vue` plugin interface exposed on `this`.
|
|
20
|
-
*
|
|
21
|
-
* @see `@prismicio/vue` plugin interface {@link PrismicPlugin}
|
|
22
|
-
*/
|
|
23
|
-
$prismic: PrismicPlugin;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=createPrismic.d.ts.map
|
|
27
|
-
//#endregion
|
|
28
|
-
export { createPrismic };
|
|
29
|
-
//# sourceMappingURL=createPrismic.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createPrismic.d.cts","names":[],"sources":["../src/createPrismic.ts"],"sourcesContent":[],"mappings":";;;;;;AAkDA;AA4FC;;;;;;;cA5FY,yBAA0B,yBAAuB;;;;;;;;cAqGlD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const require_PrismicEmbed_vue_vue_type_script_setup_true_lang = require('./PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/PrismicEmbed.vue
|
|
4
|
-
var PrismicEmbed_default = require_PrismicEmbed_vue_vue_type_script_setup_true_lang.default;
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
exports.default = PrismicEmbed_default;
|
|
8
|
-
//# sourceMappingURL=PrismicEmbed.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicEmbed.cjs","names":[],"sources":["../../src/PrismicEmbed.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { EmbedField } from \"@prismicio/client\"\nimport { isFilled } from \"@prismicio/client\"\n\nimport type { ComponentOrTagName } from \"./types\"\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 or a component used to wrap the output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: ComponentOrTagName\n}\n\ndefineProps<PrismicEmbedProps>()\ndefineOptions({ name: \"PrismicEmbed\" })\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.embed(field)\"\n\t\t:is=\"wrapper || defaultWrapper\"\n\t\t:data-oembed=\"field.embed_url\"\n\t\t:data-oembed-type=\"field.type\"\n\t\t:data-oembed-provider=\"field.provider_name\"\n\t\tv-html=\"field.html\"\n\t/>\n</template>\n"],"mappings":""}
|
package/dist/src/PrismicEmbed.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import PrismicEmbed_vue_vue_type_script_setup_true_lang_default from "./PrismicEmbed.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
3
|
-
//#region src/PrismicEmbed.vue
|
|
4
|
-
var PrismicEmbed_default = PrismicEmbed_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
export { PrismicEmbed_default as default };
|
|
8
|
-
//# sourceMappingURL=PrismicEmbed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicEmbed.js","names":[],"sources":["../../src/PrismicEmbed.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { EmbedField } from \"@prismicio/client\"\nimport { isFilled } from \"@prismicio/client\"\n\nimport type { ComponentOrTagName } from \"./types\"\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 or a component used to wrap the output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: ComponentOrTagName\n}\n\ndefineProps<PrismicEmbedProps>()\ndefineOptions({ name: \"PrismicEmbed\" })\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.embed(field)\"\n\t\t:is=\"wrapper || defaultWrapper\"\n\t\t:data-oembed=\"field.embed_url\"\n\t\t:data-oembed-type=\"field.type\"\n\t\t:data-oembed-provider=\"field.provider_name\"\n\t\tv-html=\"field.html\"\n\t/>\n</template>\n"],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentOrTagName } from "./types.js";
|
|
2
|
-
import * as vue6 from "vue";
|
|
3
|
-
import { EmbedField } from "@prismicio/client";
|
|
4
|
-
|
|
5
|
-
//#region src/PrismicEmbed.vue.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Props for `<PrismicEmbed />`.
|
|
8
|
-
*/
|
|
9
|
-
type PrismicEmbedProps = {
|
|
10
|
-
/**
|
|
11
|
-
* The Prismic EMbed field to render.
|
|
12
|
-
*/
|
|
13
|
-
field: EmbedField;
|
|
14
|
-
/**
|
|
15
|
-
* An HTML tag name or a component used to wrap the output.
|
|
16
|
-
*
|
|
17
|
-
* @defaultValue `"div"`
|
|
18
|
-
*/
|
|
19
|
-
wrapper?: ComponentOrTagName;
|
|
20
|
-
};
|
|
21
|
-
declare const __VLS_export: vue6.DefineComponent<PrismicEmbedProps, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {}, string, vue6.PublicProps, Readonly<PrismicEmbedProps> & Readonly<{}>, {}, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
|
|
22
|
-
declare const _default: typeof __VLS_export;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { PrismicEmbedProps, _default };
|
|
25
|
-
//# sourceMappingURL=PrismicEmbed.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicEmbed.vue.d.ts","names":[],"sources":["../../src/PrismicEmbed.vue"],"sourcesContent":[],"mappings":";;;;;;;;AAyDY,KAAA,iBAAA,GAAiB;EAwDvB;;;EAAY,KAAA,EApDV,UAoDU;EAAA;;;;;EAAA,OAAA,CAAA,EA7CP,kBA6CO;CAAA;AAAA,cAAZ,YAGsB,EAHV,IAAA,CAAA,eAGsB,CAHtB,iBAGsB,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAHtB,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,EAGsB,CAAA,CAAA,EAAA,MAAA,EAHtB,IAAA,CAAA,WAAA,EAAA,QAGsB,CAHtB,iBAGsB,CAAA,GAHtB,QAGsB,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAHtB,IAAA,CAAA,uBAAA,EAGsB,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAHtB,iBAGU"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
let vue = require("vue");
|
|
2
|
-
let __prismicio_client = require("@prismicio/client");
|
|
3
|
-
|
|
4
|
-
//#region src/PrismicEmbed.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
/**
|
|
6
|
-
* The default component rendered to wrap the embed.
|
|
7
|
-
*/
|
|
8
|
-
const defaultWrapper = "div";
|
|
9
|
-
var PrismicEmbed_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10
|
-
name: "PrismicEmbed",
|
|
11
|
-
__name: "PrismicEmbed",
|
|
12
|
-
props: {
|
|
13
|
-
field: {
|
|
14
|
-
type: null,
|
|
15
|
-
required: true
|
|
16
|
-
},
|
|
17
|
-
wrapper: {
|
|
18
|
-
type: null,
|
|
19
|
-
required: false
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
setup(__props) {
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
return (0, vue.unref)(__prismicio_client.isFilled).embed(__props.field) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.wrapper || defaultWrapper), {
|
|
25
|
-
key: 0,
|
|
26
|
-
"data-oembed": __props.field.embed_url,
|
|
27
|
-
"data-oembed-type": __props.field.type,
|
|
28
|
-
"data-oembed-provider": __props.field.provider_name,
|
|
29
|
-
innerHTML: __props.field.html
|
|
30
|
-
}, null, 8, [
|
|
31
|
-
"data-oembed",
|
|
32
|
-
"data-oembed-type",
|
|
33
|
-
"data-oembed-provider",
|
|
34
|
-
"innerHTML"
|
|
35
|
-
])) : (0, vue.createCommentVNode)("v-if", true);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.default = PrismicEmbed_vue_vue_type_script_setup_true_lang_default;
|
|
42
|
-
//# sourceMappingURL=PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicEmbed.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { EmbedField } from \"@prismicio/client\"\nimport { isFilled } from \"@prismicio/client\"\n\nimport type { ComponentOrTagName } from \"./types\"\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 or a component used to wrap the output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: ComponentOrTagName\n}\n\ndefineProps<PrismicEmbedProps>()\ndefineOptions({ name: \"PrismicEmbed\" })\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.embed(field)\"\n\t\t:is=\"wrapper || defaultWrapper\"\n\t\t:data-oembed=\"field.embed_url\"\n\t\t:data-oembed-type=\"field.type\"\n\t\t:data-oembed-provider=\"field.provider_name\"\n\t\tv-html=\"field.html\"\n\t/>\n</template>\n"],"mappings":";;;;;;;AASA,MAAM,iBAAiB;;;;;;;;;;;;;;;;yBAyBf,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,QAAA,WAAW,eAAc,EAAA;;IAC7B,eAAa,QAAA,MAAM;IACnB,oBAAkB,QAAA,MAAM;IACxB,wBAAsB,QAAA,MAAM;IAC7B,WAAQ,QAAA,MAAM"}
|