prismic 1.29.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters-DWhQeyDo.mjs +197 -0
- package/dist/index.mjs +103 -97
- package/dist/{nextjs-Cydao8so.mjs → nextjs-4lBT3LWb.mjs} +63 -63
- package/dist/{nuxt-DZlxcDTY.mjs → nuxt-CXMFa4cT.mjs} +10 -10
- package/dist/package-DZJSt_MI.mjs +1 -0
- package/dist/{packageJson-Du_fIYqH.mjs → packageJson-BEVwXn1i.mjs} +3 -3
- package/dist/{segment-B2JRNROf.mjs → segment-BpOvsf06.mjs} +1 -1
- package/dist/subprocesses/sendSegmentEvents.mjs +1 -1
- package/dist/subprocesses/updateVersionState.mjs +1 -1
- package/dist/sveltekit-B-_UPD7T.mjs +1 -0
- package/dist/{sveltekit-DCytYnBb.mjs → sveltekit-D7e5u5rg.mjs} +29 -29
- package/dist/{sveltekit2-DbVLruSc.mjs → sveltekit2-xFDbKhF_.mjs} +1 -1
- package/dist/{update-notifier-BGQNWIvh.mjs → update-notifier-B86qEI1j.mjs} +1 -1
- package/package.json +3 -3
- package/dist/adapters-C-tqRizJ.mjs +0 -197
- package/dist/package-CR69YEZ6.mjs +0 -1
- package/dist/sveltekit-B3tYQDoW.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$t as e,
|
|
1
|
+
import{$t as e,_ as t,_n as n,d as r,en as i,s as a,t as o,u as s,x as c}from"./adapters-DWhQeyDo.mjs";import{S as l,a as u,m as d,n as f,s as p}from"./packageJson-BEVwXn1i.mjs";import{readFile as m}from"node:fs/promises";import{relative as h}from"node:path";import{fileURLToPath as g}from"node:url";const _=e`
|
|
2
2
|
return (
|
|
3
3
|
<section
|
|
4
4
|
data-slice-type={slice.slice_type}
|
|
@@ -9,7 +9,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
9
9
|
<strong>You can edit this slice directly in your code editor.</strong>
|
|
10
10
|
</section>
|
|
11
11
|
)
|
|
12
|
-
`;function v({name:
|
|
12
|
+
`;function v({name:t,id:r,typescript:i}){let a=n(t),o=n(r),s=e`
|
|
13
13
|
import { FC } from "react";
|
|
14
14
|
import { Content } from "@prismicio/client";
|
|
15
15
|
import { SliceComponentProps } from "@prismicio/react";
|
|
@@ -20,14 +20,14 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
20
20
|
export type ${a}Props = SliceComponentProps<Content.${o}Slice>;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Component for "${
|
|
23
|
+
* Component for "${t}" Slices.
|
|
24
24
|
*/
|
|
25
25
|
const ${a}: FC<${a}Props> = ({ slice }) => {
|
|
26
26
|
${_}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export default ${a}
|
|
30
|
-
`,c=
|
|
30
|
+
`,c=e`
|
|
31
31
|
/**
|
|
32
32
|
* @typedef {import("@prismicio/client").Content.${o}Slice} ${a}Slice
|
|
33
33
|
* @typedef {import("@prismicio/react").SliceComponentProps<${a}Slice>} ${a}Props
|
|
@@ -38,7 +38,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export default ${a};
|
|
41
|
-
`;return
|
|
41
|
+
`;return i?s:c}function y({model:t,routePath:n,typescript:r,appRouter:i,cacheComponents:a}){return a?t.repeatable?r?e`
|
|
42
42
|
import { cacheLife } from "next/cache";
|
|
43
43
|
import { notFound } from "next/navigation";
|
|
44
44
|
import { SliceZone } from "@prismicio/react";
|
|
@@ -55,7 +55,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
55
55
|
|
|
56
56
|
export async function generateStaticParams() {
|
|
57
57
|
const client = createClient();
|
|
58
|
-
const pages = await client.getAllByType("${
|
|
58
|
+
const pages = await client.getAllByType("${t.id}");
|
|
59
59
|
|
|
60
60
|
return pages.map((page) => ({ uid: page.uid }));
|
|
61
61
|
}
|
|
@@ -64,11 +64,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
64
64
|
"use cache";
|
|
65
65
|
cacheLife("max");
|
|
66
66
|
const client = createClient();
|
|
67
|
-
const page = await client.getByUID("${
|
|
67
|
+
const page = await client.getByUID("${t.id}", uid, { ref }).catch(() => notFound());
|
|
68
68
|
cacheTagPrismicPages([page]);
|
|
69
69
|
return page;
|
|
70
70
|
}
|
|
71
|
-
`:
|
|
71
|
+
`:e`
|
|
72
72
|
import { cacheLife } from "next/cache";
|
|
73
73
|
import { notFound } from "next/navigation";
|
|
74
74
|
import { SliceZone } from "@prismicio/react";
|
|
@@ -88,7 +88,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
88
88
|
|
|
89
89
|
export async function generateStaticParams() {
|
|
90
90
|
const client = createClient();
|
|
91
|
-
const pages = await client.getAllByType("${
|
|
91
|
+
const pages = await client.getAllByType("${t.id}");
|
|
92
92
|
|
|
93
93
|
return pages.map((page) => ({ uid: page.uid }));
|
|
94
94
|
}
|
|
@@ -101,11 +101,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
101
101
|
"use cache";
|
|
102
102
|
cacheLife("max");
|
|
103
103
|
const client = createClient();
|
|
104
|
-
const page = await client.getByUID("${
|
|
104
|
+
const page = await client.getByUID("${t.id}", uid, { ref }).catch(() => notFound());
|
|
105
105
|
cacheTagPrismicPages([page]);
|
|
106
106
|
return page;
|
|
107
107
|
}
|
|
108
|
-
`:r?
|
|
108
|
+
`:r?e`
|
|
109
109
|
import { cacheLife } from "next/cache";
|
|
110
110
|
import { notFound } from "next/navigation";
|
|
111
111
|
import { SliceZone } from "@prismicio/react";
|
|
@@ -123,11 +123,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
123
123
|
"use cache";
|
|
124
124
|
cacheLife("max");
|
|
125
125
|
const client = createClient();
|
|
126
|
-
const page = await client.getSingle("${
|
|
126
|
+
const page = await client.getSingle("${t.id}", { ref }).catch(() => notFound());
|
|
127
127
|
cacheTagPrismicPages([page]);
|
|
128
128
|
return page;
|
|
129
129
|
}
|
|
130
|
-
`:
|
|
130
|
+
`:e`
|
|
131
131
|
import { cacheLife } from "next/cache";
|
|
132
132
|
import { notFound } from "next/navigation";
|
|
133
133
|
import { SliceZone } from "@prismicio/react";
|
|
@@ -148,11 +148,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
148
148
|
"use cache";
|
|
149
149
|
cacheLife("max");
|
|
150
150
|
const client = createClient();
|
|
151
|
-
const page = await client.getSingle("${
|
|
151
|
+
const page = await client.getSingle("${t.id}", { ref }).catch(() => notFound());
|
|
152
152
|
cacheTagPrismicPages([page]);
|
|
153
153
|
return page;
|
|
154
154
|
}
|
|
155
|
-
`:i?
|
|
155
|
+
`:i?t.repeatable?r?e`
|
|
156
156
|
import { SliceZone } from "@prismicio/react";
|
|
157
157
|
import { createClient } from "@/prismicio";
|
|
158
158
|
import { components } from "@/slices";
|
|
@@ -160,11 +160,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
160
160
|
export default async function Page({ params }: PageProps<"/${n}">) {
|
|
161
161
|
const { uid } = await params;
|
|
162
162
|
const client = createClient();
|
|
163
|
-
const page = await client.getByUID("${
|
|
163
|
+
const page = await client.getByUID("${t.id}", uid);
|
|
164
164
|
|
|
165
165
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
166
166
|
}
|
|
167
|
-
`:
|
|
167
|
+
`:e`
|
|
168
168
|
import { SliceZone } from "@prismicio/react";
|
|
169
169
|
import { createClient } from "@/prismicio";
|
|
170
170
|
import { components } from "@/slices";
|
|
@@ -175,22 +175,22 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
175
175
|
export default async function Page({ params }) {
|
|
176
176
|
const { uid } = await params;
|
|
177
177
|
const client = createClient();
|
|
178
|
-
const page = await client.getByUID("${
|
|
178
|
+
const page = await client.getByUID("${t.id}", uid);
|
|
179
179
|
|
|
180
180
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
181
181
|
}
|
|
182
|
-
`:
|
|
182
|
+
`:e`
|
|
183
183
|
import { SliceZone } from "@prismicio/react";
|
|
184
184
|
import { createClient } from "@/prismicio";
|
|
185
185
|
import { components } from "@/slices";
|
|
186
186
|
|
|
187
187
|
export default async function Page() {
|
|
188
188
|
const client = createClient();
|
|
189
|
-
const page = await client.getSingle("${
|
|
189
|
+
const page = await client.getSingle("${t.id}");
|
|
190
190
|
|
|
191
191
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
192
192
|
}
|
|
193
|
-
`:
|
|
193
|
+
`:t.repeatable?r?e`
|
|
194
194
|
import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
|
|
195
195
|
import { SliceZone } from "@prismicio/react";
|
|
196
196
|
import { createClient } from "@/prismicio";
|
|
@@ -200,7 +200,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
200
200
|
|
|
201
201
|
export async function getStaticProps({ params, previewData }: GetStaticPropsContext<Params>) {
|
|
202
202
|
const client = createClient({ previewData });
|
|
203
|
-
const page = await client.getByUID("${
|
|
203
|
+
const page = await client.getByUID("${t.id}", params.uid);
|
|
204
204
|
|
|
205
205
|
return { props: { page } };
|
|
206
206
|
}
|
|
@@ -211,14 +211,14 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
211
211
|
|
|
212
212
|
export async function getStaticPaths() {
|
|
213
213
|
const client = createClient();
|
|
214
|
-
const pages = await client.getAllByType("${
|
|
214
|
+
const pages = await client.getAllByType("${t.id}");
|
|
215
215
|
|
|
216
216
|
return {
|
|
217
217
|
paths: pages.map((page) => ({ params: { uid: page.uid } })),
|
|
218
218
|
fallback: false,
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
`:
|
|
221
|
+
`:e`
|
|
222
222
|
import { SliceZone } from "@prismicio/react";
|
|
223
223
|
import { createClient } from "@/prismicio";
|
|
224
224
|
import { components } from "@/slices";
|
|
@@ -232,21 +232,21 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
232
232
|
|
|
233
233
|
export async function getStaticProps({ params, previewData }) {
|
|
234
234
|
const client = createClient({ previewData });
|
|
235
|
-
const page = await client.getByUID("${
|
|
235
|
+
const page = await client.getByUID("${t.id}", params.uid);
|
|
236
236
|
|
|
237
237
|
return { props: { page } };
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
export async function getStaticPaths() {
|
|
241
241
|
const client = createClient();
|
|
242
|
-
const pages = await client.getAllByType("${
|
|
242
|
+
const pages = await client.getAllByType("${t.id}");
|
|
243
243
|
|
|
244
244
|
return {
|
|
245
245
|
paths: pages.map((page) => ({ params: { uid: page.uid } })),
|
|
246
246
|
fallback: false,
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
`:r?
|
|
249
|
+
`:r?e`
|
|
250
250
|
import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
|
|
251
251
|
import { SliceZone } from "@prismicio/react";
|
|
252
252
|
import { createClient } from "@/prismicio";
|
|
@@ -254,7 +254,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
254
254
|
|
|
255
255
|
export async function getStaticProps({ previewData }: GetStaticPropsContext) {
|
|
256
256
|
const client = createClient({ previewData });
|
|
257
|
-
const page = await client.getSingle("${
|
|
257
|
+
const page = await client.getSingle("${t.id}");
|
|
258
258
|
|
|
259
259
|
return { props: { page } };
|
|
260
260
|
}
|
|
@@ -262,7 +262,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
262
262
|
export default function Page({ page }: InferGetStaticPropsType<typeof getStaticProps>) {
|
|
263
263
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
264
264
|
}
|
|
265
|
-
`:
|
|
265
|
+
`:e`
|
|
266
266
|
import { SliceZone } from "@prismicio/react";
|
|
267
267
|
import { createClient } from "@/prismicio";
|
|
268
268
|
import { components } from "@/slices";
|
|
@@ -276,17 +276,17 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
276
276
|
|
|
277
277
|
export async function getStaticProps({ previewData }) {
|
|
278
278
|
const client = createClient({ previewData });
|
|
279
|
-
const page = await client.getSingle("${
|
|
279
|
+
const page = await client.getSingle("${t.id}");
|
|
280
280
|
|
|
281
281
|
return { props: { page } };
|
|
282
282
|
}
|
|
283
|
-
`}function b({typescript:
|
|
283
|
+
`}function b({typescript:t,appRouter:n,cacheComponents:r,hasSrcDirectory:i}){let a=`${i?`..`:`.`}/prismic.config.json`,o,s;return n&&r&&t?(o=e`
|
|
284
284
|
import {
|
|
285
285
|
createClient as baseCreateClient,
|
|
286
286
|
type ClientConfig,
|
|
287
287
|
} from "@prismicio/client";
|
|
288
288
|
import prismicConfig from "${a}";
|
|
289
|
-
`,s=
|
|
289
|
+
`,s=e`
|
|
290
290
|
/**
|
|
291
291
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
292
292
|
* query content from the Prismic API.
|
|
@@ -299,10 +299,10 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
299
299
|
...config,
|
|
300
300
|
});
|
|
301
301
|
};
|
|
302
|
-
`):n&&r?(o=
|
|
302
|
+
`):n&&r?(o=e`
|
|
303
303
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
304
304
|
import prismicConfig from "${a}";
|
|
305
|
-
`,s=
|
|
305
|
+
`,s=e`
|
|
306
306
|
/**
|
|
307
307
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
308
308
|
* query content from the Prismic API.
|
|
@@ -315,14 +315,14 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
315
315
|
...config,
|
|
316
316
|
});
|
|
317
317
|
};
|
|
318
|
-
`):n&&
|
|
318
|
+
`):n&&t?(o=e`
|
|
319
319
|
import {
|
|
320
320
|
createClient as baseCreateClient,
|
|
321
321
|
type ClientConfig,
|
|
322
322
|
} from "@prismicio/client";
|
|
323
323
|
import { enableAutoPreviews } from "@prismicio/next";
|
|
324
324
|
import prismicConfig from "${a}";
|
|
325
|
-
`,s=
|
|
325
|
+
`,s=e`
|
|
326
326
|
/**
|
|
327
327
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
328
328
|
* query content from the Prismic API.
|
|
@@ -343,11 +343,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
343
343
|
|
|
344
344
|
return client;
|
|
345
345
|
};
|
|
346
|
-
`):n?(o=
|
|
346
|
+
`):n?(o=e`
|
|
347
347
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
348
348
|
import { enableAutoPreviews } from "@prismicio/next";
|
|
349
349
|
import prismicConfig from "${a}";
|
|
350
|
-
`,s=
|
|
350
|
+
`,s=e`
|
|
351
351
|
/**
|
|
352
352
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
353
353
|
* query content from the Prismic API.
|
|
@@ -368,11 +368,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
368
368
|
|
|
369
369
|
return client;
|
|
370
370
|
};
|
|
371
|
-
`):
|
|
371
|
+
`):t?(o=e`
|
|
372
372
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
373
373
|
import { enableAutoPreviews, type CreateClientConfig } from "@prismicio/next/pages";
|
|
374
374
|
import prismicConfig from "${a}";
|
|
375
|
-
`,s=
|
|
375
|
+
`,s=e`
|
|
376
376
|
/**
|
|
377
377
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
378
378
|
* query content from the Prismic API.
|
|
@@ -389,11 +389,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
389
389
|
|
|
390
390
|
return client;
|
|
391
391
|
};
|
|
392
|
-
`):(o=
|
|
392
|
+
`):(o=e`
|
|
393
393
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
394
394
|
import { enableAutoPreviews } from "@prismicio/next/pages";
|
|
395
395
|
import prismicConfig from "${a}";
|
|
396
|
-
`,s=
|
|
396
|
+
`,s=e`
|
|
397
397
|
/**
|
|
398
398
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
399
399
|
* query content from the Prismic API.
|
|
@@ -410,7 +410,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
410
410
|
|
|
411
411
|
return client;
|
|
412
412
|
};
|
|
413
|
-
`),
|
|
413
|
+
`),e`
|
|
414
414
|
${o}
|
|
415
415
|
|
|
416
416
|
/**
|
|
@@ -420,11 +420,11 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
420
420
|
process.env.NEXT_PUBLIC_PRISMIC_ENVIRONMENT || prismicConfig.repositoryName;
|
|
421
421
|
|
|
422
422
|
${s}
|
|
423
|
-
`}function x(){return
|
|
423
|
+
`}function x(){return e`
|
|
424
424
|
export default function Loading() {
|
|
425
425
|
return null;
|
|
426
426
|
}
|
|
427
|
-
`}function S({typescript:
|
|
427
|
+
`}function S({typescript:t,appRouter:n}){let r=e`
|
|
428
428
|
import { SliceSimulator, SliceSimulatorParams, getSlices } from "@prismicio/next";
|
|
429
429
|
import { SliceZone } from "@prismicio/react";
|
|
430
430
|
|
|
@@ -442,7 +442,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
442
442
|
</SliceSimulator>
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
|
-
`,i=
|
|
445
|
+
`,i=e`
|
|
446
446
|
import { SliceSimulator, getSlices } from "@prismicio/next";
|
|
447
447
|
import { SliceZone } from "@prismicio/react";
|
|
448
448
|
|
|
@@ -458,7 +458,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
458
458
|
</SliceSimulator>
|
|
459
459
|
);
|
|
460
460
|
}
|
|
461
|
-
`,a=
|
|
461
|
+
`,a=e`
|
|
462
462
|
import { SliceSimulator } from "@prismicio/next/pages";
|
|
463
463
|
import { SliceZone } from "@prismicio/react";
|
|
464
464
|
|
|
@@ -471,7 +471,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
471
471
|
/>
|
|
472
472
|
);
|
|
473
473
|
}
|
|
474
|
-
`;return n?
|
|
474
|
+
`;return n?t?r:i:a}function C({typescript:t,appRouter:n}){let r=e`
|
|
475
475
|
import { NextRequest } from "next/server";
|
|
476
476
|
import { redirectToPreviewURL } from "@prismicio/next";
|
|
477
477
|
|
|
@@ -482,7 +482,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
482
482
|
|
|
483
483
|
return await redirectToPreviewURL({ client, request });
|
|
484
484
|
}
|
|
485
|
-
`,i=
|
|
485
|
+
`,i=e`
|
|
486
486
|
import { redirectToPreviewURL } from "@prismicio/next";
|
|
487
487
|
|
|
488
488
|
import { createClient } from "../../../prismicio";
|
|
@@ -492,7 +492,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
492
492
|
|
|
493
493
|
return await redirectToPreviewURL({ client, request });
|
|
494
494
|
}
|
|
495
|
-
`,a=
|
|
495
|
+
`,a=e`
|
|
496
496
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
497
497
|
import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
|
|
498
498
|
|
|
@@ -505,7 +505,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
505
505
|
|
|
506
506
|
return await redirectToPreviewURL({ req, res, client });
|
|
507
507
|
};
|
|
508
|
-
`,o=
|
|
508
|
+
`,o=e`
|
|
509
509
|
import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
|
|
510
510
|
|
|
511
511
|
import { createClient } from "../../prismicio";
|
|
@@ -517,26 +517,26 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
517
517
|
|
|
518
518
|
return await redirectToPreviewURL({ req, res, client });
|
|
519
519
|
};
|
|
520
|
-
`;return n?
|
|
520
|
+
`;return n?t?r:i:t?a:o}function w({typescript:t,appRouter:n}){let r=e`
|
|
521
521
|
import { exitPreview } from "@prismicio/next";
|
|
522
522
|
|
|
523
523
|
export function GET() {
|
|
524
524
|
return exitPreview();
|
|
525
525
|
}
|
|
526
|
-
`,i=
|
|
526
|
+
`,i=e`
|
|
527
527
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
528
528
|
import { exitPreview } from "@prismicio/next/pages";
|
|
529
529
|
|
|
530
530
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
531
531
|
return exitPreview({ req, res });
|
|
532
532
|
}
|
|
533
|
-
`,a=
|
|
533
|
+
`,a=e`
|
|
534
534
|
import { exitPreview } from "@prismicio/next/pages";
|
|
535
535
|
|
|
536
536
|
export default function handler(req, res) {
|
|
537
537
|
return exitPreview({ req, res });
|
|
538
538
|
}
|
|
539
|
-
`;return n?r:
|
|
539
|
+
`;return n?r:t?i:a}function T({supportsCacheLife:t,cacheComponents:n,typescript:r}){return n?e`
|
|
540
540
|
import { NextResponse } from "next/server";
|
|
541
541
|
import { revalidatePrismicPages } from "@prismicio/next";
|
|
542
542
|
|
|
@@ -546,22 +546,22 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
546
546
|
|
|
547
547
|
return NextResponse.json({ revalidated: true, now: Date.now() });
|
|
548
548
|
}
|
|
549
|
-
`:
|
|
549
|
+
`:e`
|
|
550
550
|
import { NextResponse } from "next/server";
|
|
551
551
|
import { revalidateTag } from "next/cache";
|
|
552
552
|
|
|
553
553
|
export async function POST() {
|
|
554
|
-
revalidateTag("prismic"${
|
|
554
|
+
revalidateTag("prismic"${t?`, "max"`:``});
|
|
555
555
|
|
|
556
556
|
return NextResponse.json({ revalidated: true, now: Date.now() });
|
|
557
557
|
}
|
|
558
|
-
`}var E=class extends o{id=`next`;environmentEnvVarName=`NEXT_PUBLIC_PRISMIC_ENVIRONMENT`;localPreviewConfig={name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/api/preview`};async setupProject(){await f({"@prismicio/client":`^${await p(`@prismicio/client`)}`,"@prismicio/react":`^${await p(`@prismicio/react`)}`,"@prismicio/next":`^${await p(`@prismicio/next`)}`});let e=await k(),
|
|
558
|
+
`}var E=class extends o{id=`next`;environmentEnvVarName=`NEXT_PUBLIC_PRISMIC_ENVIRONMENT`;localPreviewConfig={name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/api/preview`};async setupProject(){await f({"@prismicio/client":`^${await p(`@prismicio/client`)}`,"@prismicio/react":`^${await p(`@prismicio/react`)}`,"@prismicio/next":`^${await p(`@prismicio/next`)}`});let e=await k(),n=await s(),i=await t(),a=await D(),o=await O(),c=await u(`next`)>=16;await r(new URL(`prismicio.${n}`,e),b({typescript:i,appRouter:a,cacheComponents:o,hasSrcDirectory:await A()})),await r(new URL(a?`app/slice-simulator/page.${n}x`:`pages/slice-simulator.${n}x`,e),S({typescript:i,appRouter:a})),o&&await r(new URL(`app/slice-simulator/loading.${n}x`,e),x()),await r(new URL(a?`app/api/preview/route.${n}`:`pages/api/preview.${n}`,e),C({typescript:i,appRouter:a})),await r(new URL(a?`app/api/exit-preview/route.${n}`:`pages/api/exit-preview.${n}`,e),w({typescript:i,appRouter:a})),a&&await r(new URL(`app/api/revalidate/route.${n}`,e),T({supportsCacheLife:c,cacheComponents:o,typescript:i}))}async getSetupInstructions(){if(await a(`PrismicPreview`))return;let t=await A()?`src/`:``,n=`${await s()}x`;return await D()?e`
|
|
559
559
|
Action required: add <PrismicPreview> to your root layout.
|
|
560
560
|
|
|
561
561
|
Previews do not work until you do this, and the CLI cannot edit your
|
|
562
562
|
layout for you. Make the change now.
|
|
563
563
|
|
|
564
|
-
Add the lines marked + to ${
|
|
564
|
+
Add the lines marked + to ${t}app/layout.${n}:
|
|
565
565
|
|
|
566
566
|
+ import { PrismicPreview } from "@prismicio/next";
|
|
567
567
|
+ import { repositoryName } from "@/prismicio";
|
|
@@ -576,13 +576,13 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
Run \`prismic docs view nextjs\` for details.
|
|
579
|
-
`:
|
|
579
|
+
`:e`
|
|
580
580
|
Action required: add <PrismicPreview> to your app.
|
|
581
581
|
|
|
582
582
|
Previews do not work until you do this, and the CLI cannot edit your app
|
|
583
583
|
for you. Make the change now.
|
|
584
584
|
|
|
585
|
-
Add the lines marked + to ${
|
|
585
|
+
Add the lines marked + to ${t}pages/_app.${n}:
|
|
586
586
|
|
|
587
587
|
+ import { PrismicPreview } from "@prismicio/next/pages";
|
|
588
588
|
+ import { repositoryName } from "@/prismicio";
|
|
@@ -597,7 +597,7 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
Run \`prismic docs view nextjs\` for details.
|
|
600
|
-
`}async createSliceIndexFile(
|
|
600
|
+
`}async createSliceIndexFile(t){let r=(await this.getSlices()).filter(e=>e.library.href===t.href),a=r.map(e=>{let r=h(g(t),g(e.directory));return`import ${n(e.model.name)} from "./${r}";`}),o=r.map(e=>`${i(e.model.id)}: ${n(e.model.name)}`),c=e`
|
|
601
601
|
// Code generated by Prismic. DO NOT EDIT.
|
|
602
602
|
|
|
603
603
|
${a.join(`
|
|
@@ -607,4 +607,4 @@ import{$t as e,Qt as t,_ as n,d as r,gn as i,s as a,t as o,u as s,x as c}from"./
|
|
|
607
607
|
${o.join(`,
|
|
608
608
|
`)}
|
|
609
609
|
};
|
|
610
|
-
`;await l(new URL(`index.${await s()}`,
|
|
610
|
+
`;await l(new URL(`index.${await s()}`,t),c)}async getDefaultSliceLibrary(){return new URL(await A()?`src/slices/`:`slices/`,await c())}async createSliceComponent(e,n){let r=v({name:e.name,id:e.id,typescript:await t()});await l(new URL(`index.${await s()}x`,n),r)}async getPageFiles(e,n){let r=await k(),i=`${await s()}x`,a=await D(),o=a?`app/${n}/page`:`pages/${n||`index`}`,c=new URL(`${o}.${i}`,r);for(let e of[`js`,`jsx`,`ts`,`tsx`]){let t=new URL(`${o}.${e}`,r);await d(t)&&(c=t)}let l=await t(),u=await O();return[{path:c,contents:y({model:e,routePath:n,typescript:l,appRouter:a,cacheComponents:u})}]}};async function D(){return d(new URL(`app/`,await k()))}async function O(){if(!await D())return!1;let e=await c();for(let t of[`ts`,`mjs`,`js`]){let n=new URL(`next.config.${t}`,e),r=await m(n,`utf8`).catch(()=>``);if(/cacheComponents\s*:\s*true/.test(r))return!0}return!1}async function k(){let e=await c();return await A()?new URL(`src/`,e):e}async function A(){return d(new URL(`src/`,await c()))}export{E as NextJsAdapter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-
|
|
1
|
+
import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-BEVwXn1i.mjs";import{$t as a,C as o,T as s,_ as c,_n as l,d as u,en as d,t as f,u as p,x as m}from"./adapters-DWhQeyDo.mjs";import{t as h}from"./taggedTemplateLiteral-DygvE_Ih.mjs";import{readFile as g,rm as _}from"node:fs/promises";import{relative as v}from"node:path";import{fileURLToPath as y}from"node:url";var b,x,S,C,w;const T=a`
|
|
2
2
|
<template>
|
|
3
3
|
<section
|
|
4
4
|
:data-slice-type="slice.slice_type"
|
|
@@ -9,7 +9,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
9
9
|
<strong>You can edit this slice directly in your code editor.</strong>
|
|
10
10
|
</section>
|
|
11
11
|
</template>
|
|
12
|
-
`;function E({name:e,typescript:t}){return t?
|
|
12
|
+
`;function E({name:e,typescript:t}){return t?a(b||=h([`
|
|
13
13
|
<script setup lang="ts">
|
|
14
14
|
import type { Content } from "@prismicio/client";
|
|
15
15
|
|
|
@@ -33,7 +33,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
33
33
|
<\/script>
|
|
34
34
|
|
|
35
35
|
`,`
|
|
36
|
-
`]),
|
|
36
|
+
`]),l(e),T):a(x||=h([`
|
|
37
37
|
<script setup>
|
|
38
38
|
// The array passed to \`getSliceComponentProps\` is purely optional.
|
|
39
39
|
// Consider it as a visual hint for you when templating your slice.
|
|
@@ -49,7 +49,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
49
49
|
<\/script>
|
|
50
50
|
|
|
51
51
|
`,`
|
|
52
|
-
`]),T)}function D({model:e,typescript:t}){let n=t?`setup lang="ts"`:`setup`;if(e.repeatable){let r=t?`route.params.uid as string`:`route.params.uid`;return
|
|
52
|
+
`]),T)}function D({model:e,typescript:t}){let n=t?`setup lang="ts"`:`setup`;if(e.repeatable){let r=t?`route.params.uid as string`:`route.params.uid`;return a(S||=h([`
|
|
53
53
|
<script `,`>
|
|
54
54
|
import { components } from "~/slices";
|
|
55
55
|
|
|
@@ -65,7 +65,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
65
65
|
<SliceZone :slices="page?.data.slices ?? []" :components="components" />
|
|
66
66
|
</main>
|
|
67
67
|
</template>
|
|
68
|
-
`]),n,r,e.id,r)}return
|
|
68
|
+
`]),n,r,e.id,r)}return a(C||=h([`
|
|
69
69
|
<script `,`>
|
|
70
70
|
import { components } from "~/slices";
|
|
71
71
|
|
|
@@ -80,7 +80,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
80
80
|
<SliceZone :slices="page?.data.slices ?? []" :components="components" />
|
|
81
81
|
</main>
|
|
82
82
|
</template>
|
|
83
|
-
`]),n,e.id,e.id)}function O({typescript:e}){let t=e?`setup lang="ts"`:`setup`;return
|
|
83
|
+
`]),n,e.id,e.id)}function O({typescript:e}){let t=e?`setup lang="ts"`:`setup`;return a(w||=h([`
|
|
84
84
|
<script `,`>
|
|
85
85
|
import { components } from "~/slices";
|
|
86
86
|
<\/script>
|
|
@@ -90,7 +90,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
90
90
|
<SliceZone :slices="slices" :components="components" />
|
|
91
91
|
</SliceSimulator>
|
|
92
92
|
</template>
|
|
93
|
-
`]),t)}const k=`@nuxtjs/prismic`,A=[`<template><div><NuxtRouteAnnouncer/><NuxtWelcome/></div></template>`,`<template><div><NuxtWelcome/></div></template>`];var j=class extends f{id=`nuxt`;environmentEnvVarName=`NUXT_PUBLIC_PRISMIC_ENVIRONMENT`;localPreviewConfig={name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/preview`};async setupProject(){await r({"@prismicio/client":`^${await i(`@prismicio/client`)}`,[k]:`^${await i(k)}`}),await P(),await u(new URL(`slice-simulator.vue`,await N()),O({typescript:await
|
|
93
|
+
`]),t)}const k=`@nuxtjs/prismic`,A=[`<template><div><NuxtRouteAnnouncer/><NuxtWelcome/></div></template>`,`<template><div><NuxtWelcome/></div></template>`];var j=class extends f{id=`nuxt`;environmentEnvVarName=`NUXT_PUBLIC_PRISMIC_ENVIRONMENT`;localPreviewConfig={name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/preview`};async setupProject(){await r({"@prismicio/client":`^${await i(`@prismicio/client`)}`,[k]:`^${await i(k)}`}),await P(),await u(new URL(`slice-simulator.vue`,await N()),O({typescript:await c()})),await L(),await this.modifySliceLibraryPath()}async getSetupInstructions(){let e=[];await F()||e.push(a`
|
|
94
94
|
Action required: add "${k}" to modules in nuxt.config.
|
|
95
95
|
|
|
96
96
|
Prismic does not work until you do this. Make the change now.
|
|
@@ -100,7 +100,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
100
100
|
+ "${k}",
|
|
101
101
|
],
|
|
102
102
|
});
|
|
103
|
-
`);let t=await I();if(t!==void 0&&!t.includes(`<NuxtPage`)){let t=v(y(await m()),y(new URL(`app.vue`,await M())));e.push(
|
|
103
|
+
`);let t=await I();if(t!==void 0&&!t.includes(`<NuxtPage`)){let t=v(y(await m()),y(new URL(`app.vue`,await M())));e.push(a`
|
|
104
104
|
Action required: add <NuxtPage /> to ${t}.
|
|
105
105
|
|
|
106
106
|
Pages, including the slice simulator, do not render until you do
|
|
@@ -114,7 +114,7 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
114
114
|
</template>
|
|
115
115
|
`)}return e.join(`
|
|
116
116
|
|
|
117
|
-
`)||void 0}async createSliceIndexFile(t){let n=(await this.getSlices()).filter(e=>e.library.href===t.href).map(e=>{let n=v(y(t),y(e.directory));return`${
|
|
117
|
+
`)||void 0}async createSliceIndexFile(t){let n=(await this.getSlices()).filter(e=>e.library.href===t.href).map(e=>{let n=v(y(t),y(e.directory));return`${d(e.model.id)}: defineAsyncComponent(() => import("./${n}/index.vue"))`}),r=a`
|
|
118
118
|
// Code generated by Prismic. DO NOT EDIT.
|
|
119
119
|
|
|
120
120
|
import { defineAsyncComponent } from "vue";
|
|
@@ -124,4 +124,4 @@ import{S as e,f as t,m as n,n as r,s as i}from"./packageJson-Du_fIYqH.mjs";impor
|
|
|
124
124
|
${n.join(`,
|
|
125
125
|
`)}
|
|
126
126
|
});
|
|
127
|
-
`;await e(new URL(`index.${await p()}`,t),r)}async getDefaultSliceLibrary(){return new URL(`slices/`,await M())}async createSliceComponent(t,n){let r=E({name:t.name,typescript:await
|
|
127
|
+
`;await e(new URL(`index.${await p()}`,t),r)}async getDefaultSliceLibrary(){return new URL(`slices/`,await M())}async createSliceComponent(t,n){let r=E({name:t.name,typescript:await c()});await e(new URL(`index.vue`,n),r)}async getPageFiles(e,t){return[{path:new URL(`${t||`index`}.vue`,await N()),contents:D({model:e,typescript:await c()})}]}async modifySliceLibraryPath(){let e=await m(),t=await n(new URL(`app/`,e)),r=await n(new URL(`src/`,e));if(!t&&!r)return;let i;try{i=await o()}catch{return}JSON.stringify(i.libraries)===JSON.stringify([`./slices`])&&((await this.getSlices()).length>0||await s({libraries:[t?`./app/slices`:`./src/slices`]}))}};async function M(){let e=await m(),t=new URL(`app/`,e);if(await n(t))return t;let r=new URL(`src/`,e);return await n(r)?r:e}async function N(){let e=await m();for(let t of[`app/pages/`,`src/pages/`,`pages/`]){let r=new URL(t,e);if(await n(r))return r}return new URL(`pages/`,await M())}async function P(){if(!await F())try{await t(`nuxt`,[`module`,`add`,k,`--skipInstall`],{timeout:6e4,nodeOptions:{cwd:y(await m()),stdio:[`ignore`,`pipe`,`pipe`]}})}catch{}}async function F(){let e=await m();for(let t of[`ts`,`js`,`mts`,`mjs`,`cts`,`cjs`]){let n=new URL(`nuxt.config.${t}`,e);if((await g(n,`utf8`).catch(()=>``)).includes(k))return!0}return!1}async function I(){return await g(new URL(`app.vue`,await M()),`utf8`).catch(()=>void 0)}async function L(){let e=await I();A.includes(e?.replace(/\s/g,``)??``)&&await _(new URL(`app.vue`,await M()))}export{j as NuxtAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`prismic`,t=`1.30.0`;export{t as n,e as t};
|