@nuxtjs/prismic 5.1.0 → 5.1.1-canary.e008d4c
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/module.d.mts +14 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +65 -29
- package/dist/runtime/PrismicPreview.vue +37 -4
- package/package.json +5 -5
- package/src/module.ts +92 -31
- package/src/runtime/PrismicPreview.vue +37 -4
package/dist/module.d.mts
CHANGED
|
@@ -78,6 +78,20 @@ type PrismicModuleOptions = {
|
|
|
78
78
|
* @defaultValue `true`
|
|
79
79
|
*/
|
|
80
80
|
toolbar?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Controls which auto-imports are added by the module.
|
|
83
|
+
*
|
|
84
|
+
* - `"all"` will add all imports.
|
|
85
|
+
* - `["vue"]` will add `@nuxtjs/prismic` and `@prismicio/vue` imports.
|
|
86
|
+
* - `["javascript"]` will add `@prismicio/client` imports.
|
|
87
|
+
* - `["content"]` will add the `Content` type import.
|
|
88
|
+
* - `false` will not add any import.
|
|
89
|
+
*
|
|
90
|
+
* @defaultValue `["vue"]`
|
|
91
|
+
*
|
|
92
|
+
* @experimental
|
|
93
|
+
*/
|
|
94
|
+
imports?: false | "all" | ("vue" | "javascript" | "content")[];
|
|
81
95
|
/** Options used by Prismic Vue components. */
|
|
82
96
|
components?: {
|
|
83
97
|
/**
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { addDependency } from 'nypm';
|
|
|
7
7
|
import { readPackage } from 'pkg-types';
|
|
8
8
|
|
|
9
9
|
const name = "@nuxtjs/prismic";
|
|
10
|
-
const version = "5.1.
|
|
10
|
+
const version = "5.1.1-canary.e008d4c";
|
|
11
11
|
|
|
12
12
|
const logger = useLogger("nuxt:prismic");
|
|
13
13
|
async function addPrismicClient() {
|
|
@@ -47,6 +47,7 @@ const module$1 = defineNuxtModule({
|
|
|
47
47
|
linkResolver: "~/app/prismic/linkResolver",
|
|
48
48
|
preview: "/preview",
|
|
49
49
|
toolbar: true,
|
|
50
|
+
imports: ["vue"],
|
|
50
51
|
components: {
|
|
51
52
|
richTextComponents: "~/app/prismic/richTextComponents "
|
|
52
53
|
}
|
|
@@ -60,6 +61,7 @@ const module$1 = defineNuxtModule({
|
|
|
60
61
|
clientConfig: {},
|
|
61
62
|
preview: "/preview",
|
|
62
63
|
toolbar: true,
|
|
64
|
+
imports: ["vue"],
|
|
63
65
|
components: {
|
|
64
66
|
richTextComponents: "~/prismic/richTextComponents"
|
|
65
67
|
}
|
|
@@ -145,35 +147,69 @@ const module$1 = defineNuxtModule({
|
|
|
145
147
|
addPlugin(resolver.resolve("runtime/plugin.client"));
|
|
146
148
|
}
|
|
147
149
|
function addAutoImports() {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"PrismicLink",
|
|
151
|
-
"PrismicText",
|
|
152
|
-
"PrismicRichText",
|
|
153
|
-
"PrismicTable",
|
|
154
|
-
"SliceZone",
|
|
155
|
-
"SliceSimulator"
|
|
156
|
-
].forEach((entry) => {
|
|
157
|
-
addComponent({
|
|
158
|
-
name: entry,
|
|
159
|
-
export: entry,
|
|
160
|
-
filePath: "@prismicio/vue"
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
addImports(
|
|
150
|
+
if (!moduleOptions.imports) return;
|
|
151
|
+
if (moduleOptions.imports === "all" || moduleOptions.imports.includes("vue")) {
|
|
164
152
|
[
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
153
|
+
"PrismicImage",
|
|
154
|
+
"PrismicLink",
|
|
155
|
+
"PrismicText",
|
|
156
|
+
"PrismicRichText",
|
|
157
|
+
"PrismicTable",
|
|
158
|
+
"SliceZone",
|
|
159
|
+
"SliceSimulator"
|
|
160
|
+
].forEach((entry) => {
|
|
161
|
+
addComponent({
|
|
162
|
+
name: entry,
|
|
163
|
+
export: entry,
|
|
164
|
+
filePath: "@prismicio/vue"
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
addImports(
|
|
168
|
+
[
|
|
169
|
+
"usePrismic",
|
|
170
|
+
"getSliceComponentProps",
|
|
171
|
+
"defineSliceZoneComponents",
|
|
172
|
+
"getRichTextComponentProps",
|
|
173
|
+
"getTableComponentProps"
|
|
174
|
+
].map((entry) => ({
|
|
175
|
+
name: entry,
|
|
176
|
+
as: entry,
|
|
177
|
+
from: "@prismicio/vue"
|
|
178
|
+
}))
|
|
179
|
+
);
|
|
180
|
+
addImports({
|
|
181
|
+
name: "usePrismicPreview",
|
|
182
|
+
as: "usePrismicPreview",
|
|
183
|
+
from: resolver.resolve("runtime/usePrismicPreview")
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (moduleOptions.imports === "all" || moduleOptions.imports.includes("javascript")) {
|
|
187
|
+
addImports(
|
|
188
|
+
[
|
|
189
|
+
"asDate",
|
|
190
|
+
"asLink",
|
|
191
|
+
"asLinkAttrs",
|
|
192
|
+
"asText",
|
|
193
|
+
"asHTML",
|
|
194
|
+
"asImageSrc",
|
|
195
|
+
"asImageWidthSrcSet",
|
|
196
|
+
"asImagePixelDensitySrcSet",
|
|
197
|
+
"isFilled"
|
|
198
|
+
].map((entry) => ({
|
|
199
|
+
name: entry,
|
|
200
|
+
as: entry,
|
|
201
|
+
from: "@prismicio/client"
|
|
202
|
+
}))
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
if (moduleOptions.imports === "all" || moduleOptions.imports.includes("content")) {
|
|
206
|
+
addImports({
|
|
207
|
+
name: "Content",
|
|
208
|
+
from: "@prismicio/client",
|
|
209
|
+
typeFrom: "@prismicio/client",
|
|
210
|
+
type: true
|
|
211
|
+
});
|
|
212
|
+
}
|
|
177
213
|
}
|
|
178
214
|
function addPreviewRoute() {
|
|
179
215
|
if (moduleOptions.preview) {
|
|
@@ -5,10 +5,43 @@ usePrismicPreview();
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<section
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
<section
|
|
9
|
+
style="
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: 0;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
background: #ffffff;
|
|
16
|
+
"
|
|
17
|
+
>
|
|
18
|
+
<figure style="text-align: center">
|
|
19
|
+
<svg
|
|
20
|
+
style="height: 2rem"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
+
fill="none"
|
|
23
|
+
viewBox="0 0 109 28"
|
|
24
|
+
class="dark:text-gray-ee h-6 w-auto text-black md:h-7"
|
|
25
|
+
>
|
|
26
|
+
<path
|
|
27
|
+
fill="#000000"
|
|
28
|
+
fill-rule="evenodd"
|
|
29
|
+
d="m27.629 14.573-2.064-2.06a.869.869 0 0 1-.256-.616V9.376c0-2.33-.242-3.175-.699-4.026a4.753 4.753 0 0 0-1.98-1.976c-.853-.455-1.7-.698-4.033-.698h-3.339a.175.175 0 0 1-.123-.297l2.063-2.06a.877.877 0 0 1 .62-.256h1.16c3.112 0 4.24.323 5.378.93a6.337 6.337 0 0 1 2.64 2.635c.608 1.135.932 2.262.932 5.368v5.454a.175.175 0 0 1-.3.123ZM13.389 27.64l2.064-2.06a.876.876 0 0 1 .62-.256h2.524c2.334 0 3.18-.243 4.034-.698a4.754 4.754 0 0 0 1.979-1.976c.456-.851.7-1.696.7-4.026v-3.332a.174.174 0 0 1 .298-.123l2.064 2.06a.87.87 0 0 1 .255.616v1.159c0 3.106-.323 4.233-.932 5.368a6.338 6.338 0 0 1-2.64 2.634c-1.137.608-2.266.931-5.378.931h-5.464a.174.174 0 0 1-.124-.297ZM2.363 15.487l-2.064-2.06A.175.175 0 0 0 0 13.55v5.454c0 3.106.324 4.232.933 5.368a6.337 6.337 0 0 0 2.639 2.634c1.138.608 2.266.931 5.378.931h1.16a.877.877 0 0 0 .62-.256l2.063-2.06a.174.174 0 0 0-.124-.297H9.331c-2.334 0-3.18-.243-4.034-.698a4.753 4.753 0 0 1-1.98-1.976c-.456-.852-.699-1.696-.699-4.026v-2.522a.869.869 0 0 0-.255-.615ZM14.539.36l-2.064 2.06a.876.876 0 0 1-.62.256H9.332c-2.334 0-3.18.243-4.034.698a4.753 4.753 0 0 0-1.98 1.976c-.456.851-.699 1.696-.699 4.026v3.332a.175.175 0 0 1-.299.123L.256 10.77A.87.87 0 0 1 0 10.155V8.996C0 5.89.324 4.763.933 3.628A6.338 6.338 0 0 1 3.572.994C4.71.386 5.838.063 8.95.063h5.465a.175.175 0 0 1 .124.297Zm5.915 7.188 2.814 2.685a.175.175 0 0 0 .296-.126V7.902a3.488 3.488 0 0 0-3.491-3.484h-6.62a.877.877 0 0 0-.618.255l-2.066 2.06a.174.174 0 0 0 .124.298H19.2c.218 0 .426.04.617.112.233.084.45.22.637.405ZM17.737 23.29l2.69-2.81c.187-.186.322-.403.407-.635.072-.191.112-.399.112-.616v-8.291a.175.175 0 0 1 .299-.123l2.064 2.062a.87.87 0 0 1 .255.615V20.1a3.488 3.488 0 0 1-3.49 3.485h-2.21a.175.175 0 0 1-.127-.295ZM7.474 20.451 4.66 17.767a.175.175 0 0 0-.296.125v2.206a3.488 3.488 0 0 0 3.491 3.484h6.62a.876.876 0 0 0 .618-.256l2.066-2.06a.174.174 0 0 0-.124-.297H8.728c-.218 0-.426-.04-.618-.112a1.74 1.74 0 0 1-.636-.406Zm2.717-15.739-2.69 2.81a1.735 1.735 0 0 0-.406.635c-.073.192-.113.4-.113.616v8.292a.174.174 0 0 1-.299.122l-2.063-2.06a.87.87 0 0 1-.255-.615v-6.61a3.488 3.488 0 0 1 3.491-3.484h2.21a.175.175 0 0 1 .126.294ZM36.622 8.54h-.676c-.562 0-1.018.454-1.018 1.014v14.32c0 .561.456 1.015 1.018 1.015h.625c.563 0 1.019-.454 1.019-1.014V18.28c0-.037.03-.066.066-.066.134.184.304.373.51.565.208.193.46.374.755.543.296.17.636.308 1.02.416a4.99 4.99 0 0 0 1.332.161 4.823 4.823 0 0 0 3.716-1.685 5.737 5.737 0 0 0 1.053-1.848c.252-.708.377-1.47.377-2.286a7.17 7.17 0 0 0-.354-2.286 5.333 5.333 0 0 0-1.043-1.848 4.927 4.927 0 0 0-1.664-1.235c-.65-.3-1.383-.45-2.196-.45-.755 0-1.457.153-2.108.461-.65.308-1.168.8-1.553 1.478a.044.044 0 0 1-.044-.044V9.37a.833.833 0 0 0-.835-.831Zm6.925 4.295c.14.4.21.816.21 1.247 0 .431-.07.847-.21 1.247a3.102 3.102 0 0 1-1.608 1.801 2.988 2.988 0 0 1-1.31.277 2.985 2.985 0 0 1-2.296-1.016 3.155 3.155 0 0 1-.621-1.062c-.14-.4-.21-.816-.21-1.247 0-.431.07-.847.21-1.247a3.101 3.101 0 0 1 1.608-1.801 2.985 2.985 0 0 1 1.31-.277 2.984 2.984 0 0 1 2.295 1.016c.274.308.481.662.622 1.062Zm7.471-4.295h-.762c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014v-4.92c0-.155.033-.386.1-.694.067-.307.2-.615.4-.923.2-.308.487-.581.865-.82.377-.239.876-.358 1.497-.358.207 0 .418.02.632.058a.555.555 0 0 0 .654-.545v-1.52a.59.59 0 0 0-.476-.58 2.448 2.448 0 0 0-.477-.045c-.71 0-1.339.177-1.886.53-.547.355-.969.855-1.264 1.502a.044.044 0 0 1-.045-.045v-.833a.88.88 0 0 0-.88-.877Zm8.87 0h-.625c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014V9.553c0-.56-.456-1.014-1.018-1.014Zm-1.544-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.721.496 1.21.496.487 0 .898-.158 1.23-.473.333-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.743-.473-1.23-.473-.489 0-.892.165-1.21.496Zm9.55 6.87c.422 0 .903.197 1.443.593.396.29.943.257 1.301-.079l.332-.31a1.012 1.012 0 0 0-.059-1.53c-.31-.248-.59-.418-.842-.51a6.1 6.1 0 0 0-2.108-.381c-.532 0-1.057.069-1.575.207a4.093 4.093 0 0 0-1.375.647c-.4.292-.721.666-.965 1.12-.245.454-.366.99-.366 1.605 0 .708.14 1.262.421 1.663.281.4.636.712 1.065.935a5.23 5.23 0 0 0 1.386.485c.496.1.958.208 1.387.323.429.116.784.266 1.065.45.28.185.421.47.421.855a.976.976 0 0 1-.166.566c-.11.161-.255.296-.433.404-.177.108-.37.185-.576.23-.207.047-.407.07-.6.07-.561 0-1.038-.127-1.43-.381a3.795 3.795 0 0 1-.42-.328 1.022 1.022 0 0 0-1.386.037l-.276.27a1.012 1.012 0 0 0 .093 1.53c.38.29.707.484.98.58.694.247 1.456.37 2.284.37a7.46 7.46 0 0 0 1.642-.184 4.618 4.618 0 0 0 1.475-.6 3.29 3.29 0 0 0 1.065-1.098c.274-.454.41-1.012.41-1.674 0-.724-.14-1.293-.42-1.709a3.077 3.077 0 0 0-1.066-.981 5.32 5.32 0 0 0-1.386-.531 82.131 82.131 0 0 1-1.387-.335 4.536 4.536 0 0 1-1.065-.393c-.28-.154-.421-.4-.421-.739 0-.415.17-.716.51-.9a2.16 2.16 0 0 1 1.043-.277Zm7.989-1.94h-.492c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014v-5.036c0-.37.044-.724.133-1.062a2.52 2.52 0 0 1 .433-.901c.2-.262.45-.47.754-.623.303-.155.676-.231 1.12-.231.651 0 1.117.204 1.398.611.281.408.421.959.421 1.652v5.59c0 .56.457 1.014 1.02 1.014h.624c.563 0 1.019-.454 1.019-1.014v-4.99c0-.354.04-.704.122-1.05a2.71 2.71 0 0 1 .399-.924 2.09 2.09 0 0 1 .71-.647c.288-.162.64-.242 1.054-.242.399 0 .724.069.976.207a1.6 1.6 0 0 1 .599.566 2.4 2.4 0 0 1 .31.832c.06.315.09.642.09.981v5.267c0 .56.455 1.014 1.018 1.014h.625c.562 0 1.018-.454 1.018-1.014v-5.59c0-.662-.066-1.282-.2-1.86a4.265 4.265 0 0 0-.654-1.512 3.172 3.172 0 0 0-1.187-1.016c-.488-.246-1.087-.37-1.797-.37-.798 0-1.486.166-2.063.497-.577.331-1.057.85-1.442 1.559-.547-1.37-1.656-2.055-3.328-2.055-.887 0-1.593.204-2.118.611a4.342 4.342 0 0 0-1.187 1.398v-.718c0-.56-.456-1.014-1.019-1.014Zm19.922 0h-.625c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014V9.553c0-.56-.456-1.014-1.019-1.014Zm-1.543-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.72.496 1.209.496.488 0 .898-.158 1.23-.473.334-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.742-.473-1.23-.473-.489 0-.891.165-1.21.496Zm12.257 7.447a2.9 2.9 0 0 1 .289.201 1.02 1.02 0 0 0 1.364-.097l.411-.429a1.012 1.012 0 0 0-.127-1.515c-.356-.264-.666-.448-.928-.55a5.591 5.591 0 0 0-2.052-.404c-.799 0-1.553.138-2.263.415-.71.277-1.323.67-1.841 1.178a5.588 5.588 0 0 0-1.231 1.836c-.303.716-.455 1.512-.455 2.39 0 .878.151 1.674.455 2.39a5.585 5.585 0 0 0 1.231 1.836c.518.508 1.131.9 1.841 1.178.71.277 1.464.415 2.263.415.237 0 .518-.027.843-.08a6.222 6.222 0 0 0 2.074-.75.964.964 0 0 0 .24-1.479l-.405-.453a1.022 1.022 0 0 0-1.365-.143c-.084.061-.161.11-.233.146a2.55 2.55 0 0 1-1.154.265c-.488 0-.924-.092-1.309-.277a3.11 3.11 0 0 1-1.608-1.801 3.724 3.724 0 0 1-.211-1.247c0-.431.07-.847.211-1.247a3.11 3.11 0 0 1 1.608-1.801 2.987 2.987 0 0 1 1.309-.277c.355 0 .703.1 1.043.3Z"
|
|
30
|
+
clip-rule="evenodd"
|
|
31
|
+
></path>
|
|
32
|
+
</svg>
|
|
33
|
+
<figcaption
|
|
34
|
+
style="
|
|
35
|
+
font-family:
|
|
36
|
+
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
37
|
+
"Segoe UI Emoji", "Segoe UI Symbol",
|
|
38
|
+
"Noto Color Emoji";
|
|
39
|
+
font-size: 1rem;
|
|
40
|
+
margin-top: 0.5rem;
|
|
41
|
+
"
|
|
42
|
+
>
|
|
43
|
+
Loading preview...
|
|
44
|
+
</figcaption>
|
|
12
45
|
</figure>
|
|
13
46
|
</section>
|
|
14
47
|
</template>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/prismic",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1-canary.e008d4c",
|
|
4
4
|
"description": "Easily connect your Nuxt application to your content hosted on Prismic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@nuxt/kit": "^4.2.2",
|
|
56
|
-
"@prismicio/vue": "^6.1.
|
|
56
|
+
"@prismicio/vue": "^6.1.1",
|
|
57
57
|
"defu": "^6.1.4",
|
|
58
58
|
"nypm": "^0.6.2",
|
|
59
59
|
"pkg-types": "^2.3.0"
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"@nuxt/test-utils": "^3.23.0",
|
|
65
65
|
"@prismicio/client": "^7.21.3",
|
|
66
66
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
67
|
-
"@types/node": "^25.0.
|
|
67
|
+
"@types/node": "^25.0.9",
|
|
68
68
|
"@vitest/coverage-v8": "^4.0.17",
|
|
69
69
|
"nuxt": "^4.2.2",
|
|
70
|
-
"oxlint": "^1.
|
|
71
|
-
"prettier": "^3.
|
|
70
|
+
"oxlint": "^1.41.0",
|
|
71
|
+
"prettier": "^3.8.0",
|
|
72
72
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
73
73
|
"typescript": "^5.9.3",
|
|
74
74
|
"vitest": "^4.0.17",
|
package/src/module.ts
CHANGED
|
@@ -104,6 +104,21 @@ export type PrismicModuleOptions = {
|
|
|
104
104
|
*/
|
|
105
105
|
toolbar?: boolean
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Controls which auto-imports are added by the module.
|
|
109
|
+
*
|
|
110
|
+
* - `"all"` will add all imports.
|
|
111
|
+
* - `["vue"]` will add `@nuxtjs/prismic` and `@prismicio/vue` imports.
|
|
112
|
+
* - `["javascript"]` will add `@prismicio/client` imports.
|
|
113
|
+
* - `["content"]` will add the `Content` type import.
|
|
114
|
+
* - `false` will not add any import.
|
|
115
|
+
*
|
|
116
|
+
* @defaultValue `["vue"]`
|
|
117
|
+
*
|
|
118
|
+
* @experimental
|
|
119
|
+
*/
|
|
120
|
+
imports?: false | "all" | ("vue" | "javascript" | "content")[]
|
|
121
|
+
|
|
107
122
|
/** Options used by Prismic Vue components. */
|
|
108
123
|
components?: {
|
|
109
124
|
/**
|
|
@@ -180,6 +195,7 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
180
195
|
linkResolver: "~/app/prismic/linkResolver",
|
|
181
196
|
preview: "/preview",
|
|
182
197
|
toolbar: true,
|
|
198
|
+
imports: ["vue"],
|
|
183
199
|
components: {
|
|
184
200
|
richTextComponents: "~/app/prismic/richTextComponents ",
|
|
185
201
|
},
|
|
@@ -194,6 +210,7 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
194
210
|
clientConfig: {},
|
|
195
211
|
preview: "/preview",
|
|
196
212
|
toolbar: true,
|
|
213
|
+
imports: ["vue"],
|
|
197
214
|
components: {
|
|
198
215
|
richTextComponents: "~/prismic/richTextComponents",
|
|
199
216
|
},
|
|
@@ -304,38 +321,82 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
304
321
|
}
|
|
305
322
|
|
|
306
323
|
function addAutoImports() {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
324
|
+
if (!moduleOptions.imports) return
|
|
325
|
+
|
|
326
|
+
if (
|
|
327
|
+
moduleOptions.imports === "all" ||
|
|
328
|
+
moduleOptions.imports.includes("vue")
|
|
329
|
+
) {
|
|
330
|
+
;[
|
|
331
|
+
"PrismicImage",
|
|
332
|
+
"PrismicLink",
|
|
333
|
+
"PrismicText",
|
|
334
|
+
"PrismicRichText",
|
|
335
|
+
"PrismicTable",
|
|
336
|
+
"SliceZone",
|
|
337
|
+
"SliceSimulator",
|
|
338
|
+
].forEach((entry) => {
|
|
339
|
+
addComponent({
|
|
340
|
+
name: entry,
|
|
341
|
+
export: entry,
|
|
342
|
+
filePath: "@prismicio/vue",
|
|
343
|
+
})
|
|
321
344
|
})
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
345
|
+
|
|
346
|
+
addImports(
|
|
347
|
+
[
|
|
348
|
+
"usePrismic",
|
|
349
|
+
"getSliceComponentProps",
|
|
350
|
+
"defineSliceZoneComponents",
|
|
351
|
+
"getRichTextComponentProps",
|
|
352
|
+
"getTableComponentProps",
|
|
353
|
+
].map((entry) => ({
|
|
354
|
+
name: entry,
|
|
355
|
+
as: entry,
|
|
356
|
+
from: "@prismicio/vue",
|
|
357
|
+
})),
|
|
358
|
+
)
|
|
359
|
+
addImports({
|
|
360
|
+
name: "usePrismicPreview",
|
|
361
|
+
as: "usePrismicPreview",
|
|
362
|
+
from: resolver.resolve("runtime/usePrismicPreview"),
|
|
363
|
+
})
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (
|
|
367
|
+
moduleOptions.imports === "all" ||
|
|
368
|
+
moduleOptions.imports.includes("javascript")
|
|
369
|
+
) {
|
|
370
|
+
addImports(
|
|
371
|
+
[
|
|
372
|
+
"asDate",
|
|
373
|
+
"asLink",
|
|
374
|
+
"asLinkAttrs",
|
|
375
|
+
"asText",
|
|
376
|
+
"asHTML",
|
|
377
|
+
"asImageSrc",
|
|
378
|
+
"asImageWidthSrcSet",
|
|
379
|
+
"asImagePixelDensitySrcSet",
|
|
380
|
+
"isFilled",
|
|
381
|
+
].map((entry) => ({
|
|
382
|
+
name: entry,
|
|
383
|
+
as: entry,
|
|
384
|
+
from: "@prismicio/client",
|
|
385
|
+
})),
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
if (
|
|
390
|
+
moduleOptions.imports === "all" ||
|
|
391
|
+
moduleOptions.imports.includes("content")
|
|
392
|
+
) {
|
|
393
|
+
addImports({
|
|
394
|
+
name: "Content",
|
|
395
|
+
from: "@prismicio/client",
|
|
396
|
+
typeFrom: "@prismicio/client",
|
|
397
|
+
type: true,
|
|
398
|
+
})
|
|
399
|
+
}
|
|
339
400
|
}
|
|
340
401
|
|
|
341
402
|
function addPreviewRoute() {
|
|
@@ -6,10 +6,43 @@ usePrismicPreview()
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
<section
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<section
|
|
10
|
+
style="
|
|
11
|
+
position: fixed;
|
|
12
|
+
inset: 0;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background: #ffffff;
|
|
17
|
+
"
|
|
18
|
+
>
|
|
19
|
+
<figure style="text-align: center">
|
|
20
|
+
<svg
|
|
21
|
+
style="height: 2rem"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
fill="none"
|
|
24
|
+
viewBox="0 0 109 28"
|
|
25
|
+
class="dark:text-gray-ee h-6 w-auto text-black md:h-7"
|
|
26
|
+
>
|
|
27
|
+
<path
|
|
28
|
+
fill="#000000"
|
|
29
|
+
fill-rule="evenodd"
|
|
30
|
+
d="m27.629 14.573-2.064-2.06a.869.869 0 0 1-.256-.616V9.376c0-2.33-.242-3.175-.699-4.026a4.753 4.753 0 0 0-1.98-1.976c-.853-.455-1.7-.698-4.033-.698h-3.339a.175.175 0 0 1-.123-.297l2.063-2.06a.877.877 0 0 1 .62-.256h1.16c3.112 0 4.24.323 5.378.93a6.337 6.337 0 0 1 2.64 2.635c.608 1.135.932 2.262.932 5.368v5.454a.175.175 0 0 1-.3.123ZM13.389 27.64l2.064-2.06a.876.876 0 0 1 .62-.256h2.524c2.334 0 3.18-.243 4.034-.698a4.754 4.754 0 0 0 1.979-1.976c.456-.851.7-1.696.7-4.026v-3.332a.174.174 0 0 1 .298-.123l2.064 2.06a.87.87 0 0 1 .255.616v1.159c0 3.106-.323 4.233-.932 5.368a6.338 6.338 0 0 1-2.64 2.634c-1.137.608-2.266.931-5.378.931h-5.464a.174.174 0 0 1-.124-.297ZM2.363 15.487l-2.064-2.06A.175.175 0 0 0 0 13.55v5.454c0 3.106.324 4.232.933 5.368a6.337 6.337 0 0 0 2.639 2.634c1.138.608 2.266.931 5.378.931h1.16a.877.877 0 0 0 .62-.256l2.063-2.06a.174.174 0 0 0-.124-.297H9.331c-2.334 0-3.18-.243-4.034-.698a4.753 4.753 0 0 1-1.98-1.976c-.456-.852-.699-1.696-.699-4.026v-2.522a.869.869 0 0 0-.255-.615ZM14.539.36l-2.064 2.06a.876.876 0 0 1-.62.256H9.332c-2.334 0-3.18.243-4.034.698a4.753 4.753 0 0 0-1.98 1.976c-.456.851-.699 1.696-.699 4.026v3.332a.175.175 0 0 1-.299.123L.256 10.77A.87.87 0 0 1 0 10.155V8.996C0 5.89.324 4.763.933 3.628A6.338 6.338 0 0 1 3.572.994C4.71.386 5.838.063 8.95.063h5.465a.175.175 0 0 1 .124.297Zm5.915 7.188 2.814 2.685a.175.175 0 0 0 .296-.126V7.902a3.488 3.488 0 0 0-3.491-3.484h-6.62a.877.877 0 0 0-.618.255l-2.066 2.06a.174.174 0 0 0 .124.298H19.2c.218 0 .426.04.617.112.233.084.45.22.637.405ZM17.737 23.29l2.69-2.81c.187-.186.322-.403.407-.635.072-.191.112-.399.112-.616v-8.291a.175.175 0 0 1 .299-.123l2.064 2.062a.87.87 0 0 1 .255.615V20.1a3.488 3.488 0 0 1-3.49 3.485h-2.21a.175.175 0 0 1-.127-.295ZM7.474 20.451 4.66 17.767a.175.175 0 0 0-.296.125v2.206a3.488 3.488 0 0 0 3.491 3.484h6.62a.876.876 0 0 0 .618-.256l2.066-2.06a.174.174 0 0 0-.124-.297H8.728c-.218 0-.426-.04-.618-.112a1.74 1.74 0 0 1-.636-.406Zm2.717-15.739-2.69 2.81a1.735 1.735 0 0 0-.406.635c-.073.192-.113.4-.113.616v8.292a.174.174 0 0 1-.299.122l-2.063-2.06a.87.87 0 0 1-.255-.615v-6.61a3.488 3.488 0 0 1 3.491-3.484h2.21a.175.175 0 0 1 .126.294ZM36.622 8.54h-.676c-.562 0-1.018.454-1.018 1.014v14.32c0 .561.456 1.015 1.018 1.015h.625c.563 0 1.019-.454 1.019-1.014V18.28c0-.037.03-.066.066-.066.134.184.304.373.51.565.208.193.46.374.755.543.296.17.636.308 1.02.416a4.99 4.99 0 0 0 1.332.161 4.823 4.823 0 0 0 3.716-1.685 5.737 5.737 0 0 0 1.053-1.848c.252-.708.377-1.47.377-2.286a7.17 7.17 0 0 0-.354-2.286 5.333 5.333 0 0 0-1.043-1.848 4.927 4.927 0 0 0-1.664-1.235c-.65-.3-1.383-.45-2.196-.45-.755 0-1.457.153-2.108.461-.65.308-1.168.8-1.553 1.478a.044.044 0 0 1-.044-.044V9.37a.833.833 0 0 0-.835-.831Zm6.925 4.295c.14.4.21.816.21 1.247 0 .431-.07.847-.21 1.247a3.102 3.102 0 0 1-1.608 1.801 2.988 2.988 0 0 1-1.31.277 2.985 2.985 0 0 1-2.296-1.016 3.155 3.155 0 0 1-.621-1.062c-.14-.4-.21-.816-.21-1.247 0-.431.07-.847.21-1.247a3.101 3.101 0 0 1 1.608-1.801 2.985 2.985 0 0 1 1.31-.277 2.984 2.984 0 0 1 2.295 1.016c.274.308.481.662.622 1.062Zm7.471-4.295h-.762c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014v-4.92c0-.155.033-.386.1-.694.067-.307.2-.615.4-.923.2-.308.487-.581.865-.82.377-.239.876-.358 1.497-.358.207 0 .418.02.632.058a.555.555 0 0 0 .654-.545v-1.52a.59.59 0 0 0-.476-.58 2.448 2.448 0 0 0-.477-.045c-.71 0-1.339.177-1.886.53-.547.355-.969.855-1.264 1.502a.044.044 0 0 1-.045-.045v-.833a.88.88 0 0 0-.88-.877Zm8.87 0h-.625c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014V9.553c0-.56-.456-1.014-1.018-1.014Zm-1.544-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.721.496 1.21.496.487 0 .898-.158 1.23-.473.333-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.743-.473-1.23-.473-.489 0-.892.165-1.21.496Zm9.55 6.87c.422 0 .903.197 1.443.593.396.29.943.257 1.301-.079l.332-.31a1.012 1.012 0 0 0-.059-1.53c-.31-.248-.59-.418-.842-.51a6.1 6.1 0 0 0-2.108-.381c-.532 0-1.057.069-1.575.207a4.093 4.093 0 0 0-1.375.647c-.4.292-.721.666-.965 1.12-.245.454-.366.99-.366 1.605 0 .708.14 1.262.421 1.663.281.4.636.712 1.065.935a5.23 5.23 0 0 0 1.386.485c.496.1.958.208 1.387.323.429.116.784.266 1.065.45.28.185.421.47.421.855a.976.976 0 0 1-.166.566c-.11.161-.255.296-.433.404-.177.108-.37.185-.576.23-.207.047-.407.07-.6.07-.561 0-1.038-.127-1.43-.381a3.795 3.795 0 0 1-.42-.328 1.022 1.022 0 0 0-1.386.037l-.276.27a1.012 1.012 0 0 0 .093 1.53c.38.29.707.484.98.58.694.247 1.456.37 2.284.37a7.46 7.46 0 0 0 1.642-.184 4.618 4.618 0 0 0 1.475-.6 3.29 3.29 0 0 0 1.065-1.098c.274-.454.41-1.012.41-1.674 0-.724-.14-1.293-.42-1.709a3.077 3.077 0 0 0-1.066-.981 5.32 5.32 0 0 0-1.386-.531 82.131 82.131 0 0 1-1.387-.335 4.536 4.536 0 0 1-1.065-.393c-.28-.154-.421-.4-.421-.739 0-.415.17-.716.51-.9a2.16 2.16 0 0 1 1.043-.277Zm7.989-1.94h-.492c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014v-5.036c0-.37.044-.724.133-1.062a2.52 2.52 0 0 1 .433-.901c.2-.262.45-.47.754-.623.303-.155.676-.231 1.12-.231.651 0 1.117.204 1.398.611.281.408.421.959.421 1.652v5.59c0 .56.457 1.014 1.02 1.014h.624c.563 0 1.019-.454 1.019-1.014v-4.99c0-.354.04-.704.122-1.05a2.71 2.71 0 0 1 .399-.924 2.09 2.09 0 0 1 .71-.647c.288-.162.64-.242 1.054-.242.399 0 .724.069.976.207a1.6 1.6 0 0 1 .599.566 2.4 2.4 0 0 1 .31.832c.06.315.09.642.09.981v5.267c0 .56.455 1.014 1.018 1.014h.625c.562 0 1.018-.454 1.018-1.014v-5.59c0-.662-.066-1.282-.2-1.86a4.265 4.265 0 0 0-.654-1.512 3.172 3.172 0 0 0-1.187-1.016c-.488-.246-1.087-.37-1.797-.37-.798 0-1.486.166-2.063.497-.577.331-1.057.85-1.442 1.559-.547-1.37-1.656-2.055-3.328-2.055-.887 0-1.593.204-2.118.611a4.342 4.342 0 0 0-1.187 1.398v-.718c0-.56-.456-1.014-1.019-1.014Zm19.922 0h-.625c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014V9.553c0-.56-.456-1.014-1.019-1.014Zm-1.543-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.72.496 1.209.496.488 0 .898-.158 1.23-.473.334-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.742-.473-1.23-.473-.489 0-.891.165-1.21.496Zm12.257 7.447a2.9 2.9 0 0 1 .289.201 1.02 1.02 0 0 0 1.364-.097l.411-.429a1.012 1.012 0 0 0-.127-1.515c-.356-.264-.666-.448-.928-.55a5.591 5.591 0 0 0-2.052-.404c-.799 0-1.553.138-2.263.415-.71.277-1.323.67-1.841 1.178a5.588 5.588 0 0 0-1.231 1.836c-.303.716-.455 1.512-.455 2.39 0 .878.151 1.674.455 2.39a5.585 5.585 0 0 0 1.231 1.836c.518.508 1.131.9 1.841 1.178.71.277 1.464.415 2.263.415.237 0 .518-.027.843-.08a6.222 6.222 0 0 0 2.074-.75.964.964 0 0 0 .24-1.479l-.405-.453a1.022 1.022 0 0 0-1.365-.143c-.084.061-.161.11-.233.146a2.55 2.55 0 0 1-1.154.265c-.488 0-.924-.092-1.309-.277a3.11 3.11 0 0 1-1.608-1.801 3.724 3.724 0 0 1-.211-1.247c0-.431.07-.847.211-1.247a3.11 3.11 0 0 1 1.608-1.801 2.987 2.987 0 0 1 1.309-.277c.355 0 .703.1 1.043.3Z"
|
|
31
|
+
clip-rule="evenodd"
|
|
32
|
+
></path>
|
|
33
|
+
</svg>
|
|
34
|
+
<figcaption
|
|
35
|
+
style="
|
|
36
|
+
font-family:
|
|
37
|
+
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
38
|
+
"Segoe UI Emoji", "Segoe UI Symbol",
|
|
39
|
+
"Noto Color Emoji";
|
|
40
|
+
font-size: 1rem;
|
|
41
|
+
margin-top: 0.5rem;
|
|
42
|
+
"
|
|
43
|
+
>
|
|
44
|
+
Loading preview...
|
|
45
|
+
</figcaption>
|
|
13
46
|
</figure>
|
|
14
47
|
</section>
|
|
15
48
|
</template>
|