prismic 1.7.2 → 1.8.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/auth-hgWfYVlQ.mjs +1 -0
- package/dist/{builders-hKD4IrLX-BqINnD6K.mjs → builders-hKD4IrLX-OKUYHMsz.mjs} +1 -1
- package/dist/core-DvI8OCsA.mjs +173 -0
- package/dist/index.mjs +55 -55
- package/dist/{nextjs-Cu_nlHvI.mjs → nextjs-qunlKbpH.mjs} +48 -48
- package/dist/nuxt-SaF4IAMg.mjs +90 -0
- package/dist/package-C8ZHSYR2.mjs +1 -0
- package/dist/{segment-BUye5-zL.mjs → segment-CusldEBw.mjs} +1 -1
- package/dist/subprocesses/refreshToken.mjs +1 -1
- package/dist/subprocesses/sendSegmentEvents.mjs +1 -1
- package/dist/subprocesses/updateVersionState.mjs +1 -1
- package/dist/{sveltekit-Bd2ybfqb.mjs → sveltekit-CiHFqDi2.mjs} +33 -33
- package/dist/{update-notifier-Co6-YCDF.mjs → update-notifier-CG7Szvo5.mjs} +1 -1
- package/package.json +1 -1
- package/dist/auth-ZyLmjkK2.mjs +0 -1
- package/dist/env-7YOoWh9b.mjs +0 -1
- package/dist/nuxt-noEyCWYu.mjs +0 -90
- package/dist/package-fv3JT9Fa.mjs +0 -1
- package/dist/string-suKEaYgy.mjs +0 -173
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from"./core-DvI8OCsA.mjs";import{d,f,s as p}from"./request-BX9m6W7p.mjs";import{i as m,n as h,r as g}from"./packageJson-XOWTfdbI.mjs";import{i as _,r as v}from"./auth-hgWfYVlQ.mjs";import{createRequire as y}from"node:module";import{fileURLToPath as b}from"node:url";import{relative as x}from"node:path";const S=c`
|
|
2
2
|
return (
|
|
3
3
|
<section
|
|
4
4
|
data-slice-type={slice.slice_type}
|
|
@@ -9,36 +9,36 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
9
9
|
<strong>You can edit this slice directly in your code editor.</strong>
|
|
10
10
|
</section>
|
|
11
11
|
)
|
|
12
|
-
`;function
|
|
12
|
+
`;function C(e){let{name:n,id:r,typescript:i}=e,a=t(n),o=t(r),s=c`
|
|
13
13
|
import { FC } from "react";
|
|
14
14
|
import { Content } from "@prismicio/client";
|
|
15
15
|
import { SliceComponentProps } from "@prismicio/react";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Props for \`${
|
|
18
|
+
* Props for \`${a}\`.
|
|
19
19
|
*/
|
|
20
|
-
export type ${
|
|
20
|
+
export type ${a}Props = SliceComponentProps<Content.${o}Slice>;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Component for "${n}" Slices.
|
|
24
24
|
*/
|
|
25
|
-
const ${
|
|
26
|
-
${
|
|
25
|
+
const ${a}: FC<${a}Props> = ({ slice }) => {
|
|
26
|
+
${S}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export default ${
|
|
30
|
-
`,l=
|
|
29
|
+
export default ${a}
|
|
30
|
+
`,l=c`
|
|
31
31
|
/**
|
|
32
|
-
* @typedef {import("@prismicio/client").Content.${
|
|
33
|
-
* @typedef {import("@prismicio/react").SliceComponentProps<${
|
|
34
|
-
* @type {import("react").FC<${
|
|
32
|
+
* @typedef {import("@prismicio/client").Content.${o}Slice} ${a}Slice
|
|
33
|
+
* @typedef {import("@prismicio/react").SliceComponentProps<${a}Slice>} ${a}Props
|
|
34
|
+
* @type {import("react").FC<${a}Props>}
|
|
35
35
|
*/
|
|
36
|
-
const ${
|
|
37
|
-
${
|
|
36
|
+
const ${a} = ({ slice }) => {
|
|
37
|
+
${S}
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export default ${
|
|
41
|
-
`;return i?
|
|
40
|
+
export default ${a};
|
|
41
|
+
`;return i?s:l}function w(e){let{model:t,routePath:n,typescript:r,appRouter:i}=e;return i?t.repeatable?r?c`
|
|
42
42
|
import { SliceZone } from "@prismicio/react";
|
|
43
43
|
import { createClient } from "@/prismicio";
|
|
44
44
|
import { components } from "@/slices";
|
|
@@ -50,7 +50,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
50
50
|
|
|
51
51
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
52
52
|
}
|
|
53
|
-
`:
|
|
53
|
+
`:c`
|
|
54
54
|
import { SliceZone } from "@prismicio/react";
|
|
55
55
|
import { createClient } from "@/prismicio";
|
|
56
56
|
import { components } from "@/slices";
|
|
@@ -65,7 +65,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
65
65
|
|
|
66
66
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
67
67
|
}
|
|
68
|
-
`:
|
|
68
|
+
`:c`
|
|
69
69
|
import { SliceZone } from "@prismicio/react";
|
|
70
70
|
import { createClient } from "@/prismicio";
|
|
71
71
|
import { components } from "@/slices";
|
|
@@ -76,7 +76,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
76
76
|
|
|
77
77
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
78
78
|
}
|
|
79
|
-
`:t.repeatable?r?
|
|
79
|
+
`:t.repeatable?r?c`
|
|
80
80
|
import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
|
|
81
81
|
import { SliceZone } from "@prismicio/react";
|
|
82
82
|
import { createClient } from "@/prismicio";
|
|
@@ -104,7 +104,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
104
104
|
fallback: false,
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
`:
|
|
107
|
+
`:c`
|
|
108
108
|
import { SliceZone } from "@prismicio/react";
|
|
109
109
|
import { createClient } from "@/prismicio";
|
|
110
110
|
import { components } from "@/slices";
|
|
@@ -132,7 +132,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
132
132
|
fallback: false,
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
`:r?
|
|
135
|
+
`:r?c`
|
|
136
136
|
import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
|
|
137
137
|
import { SliceZone } from "@prismicio/react";
|
|
138
138
|
import { createClient } from "@/prismicio";
|
|
@@ -148,7 +148,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
148
148
|
export default function Page({ page }: InferGetStaticPropsType<typeof getStaticProps>) {
|
|
149
149
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
150
150
|
}
|
|
151
|
-
`:
|
|
151
|
+
`:c`
|
|
152
152
|
import { SliceZone } from "@prismicio/react";
|
|
153
153
|
import { createClient } from "@/prismicio";
|
|
154
154
|
import { components } from "@/slices";
|
|
@@ -166,14 +166,14 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
166
166
|
|
|
167
167
|
return { props: { page } };
|
|
168
168
|
}
|
|
169
|
-
`}function
|
|
169
|
+
`}function T(e){let{typescript:t,appRouter:n,hasSrcDirectory:r}=e,i=`${r?`..`:`.`}/prismic.config.json`,a,o;return n?t?(a=c`
|
|
170
170
|
import {
|
|
171
171
|
createClient as baseCreateClient,
|
|
172
172
|
type ClientConfig,
|
|
173
173
|
} from "@prismicio/client";
|
|
174
174
|
import { enableAutoPreviews } from "@prismicio/next";
|
|
175
175
|
import prismicConfig from "${i}";
|
|
176
|
-
`,
|
|
176
|
+
`,o=c`
|
|
177
177
|
/**
|
|
178
178
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
179
179
|
* query content from the Prismic API.
|
|
@@ -194,11 +194,11 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
194
194
|
|
|
195
195
|
return client;
|
|
196
196
|
};
|
|
197
|
-
`):(
|
|
197
|
+
`):(a=c`
|
|
198
198
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
199
199
|
import { enableAutoPreviews } from "@prismicio/next";
|
|
200
200
|
import prismicConfig from "${i}";
|
|
201
|
-
`,
|
|
201
|
+
`,o=c`
|
|
202
202
|
/**
|
|
203
203
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
204
204
|
* query content from the Prismic API.
|
|
@@ -219,11 +219,11 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
219
219
|
|
|
220
220
|
return client;
|
|
221
221
|
};
|
|
222
|
-
`):t?(
|
|
222
|
+
`):t?(a=c`
|
|
223
223
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
224
224
|
import { enableAutoPreviews, type CreateClientConfig } from "@prismicio/next/pages";
|
|
225
225
|
import prismicConfig from "${i}";
|
|
226
|
-
`,
|
|
226
|
+
`,o=c`
|
|
227
227
|
/**
|
|
228
228
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
229
229
|
* query content from the Prismic API.
|
|
@@ -240,11 +240,11 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
240
240
|
|
|
241
241
|
return client;
|
|
242
242
|
};
|
|
243
|
-
`):(
|
|
243
|
+
`):(a=c`
|
|
244
244
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
245
245
|
import { enableAutoPreviews } from "@prismicio/next/pages";
|
|
246
246
|
import prismicConfig from "${i}";
|
|
247
|
-
`,
|
|
247
|
+
`,o=c`
|
|
248
248
|
/**
|
|
249
249
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
250
250
|
* query content from the Prismic API.
|
|
@@ -261,25 +261,25 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
261
261
|
|
|
262
262
|
return client;
|
|
263
263
|
};
|
|
264
|
-
`),t?
|
|
265
|
-
${
|
|
264
|
+
`),t?c`
|
|
265
|
+
${a}
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* The project's Prismic repository name.
|
|
269
269
|
*/
|
|
270
270
|
export const repositoryName = prismicConfig.repositoryName;
|
|
271
271
|
|
|
272
|
-
${
|
|
273
|
-
`:
|
|
274
|
-
${
|
|
272
|
+
${o}
|
|
273
|
+
`:c`
|
|
274
|
+
${a}
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
277
|
* The project's Prismic repository name.
|
|
278
278
|
*/
|
|
279
279
|
export const repositoryName = prismicConfig.repositoryName;
|
|
280
280
|
|
|
281
|
-
${
|
|
282
|
-
`}function
|
|
281
|
+
${o}
|
|
282
|
+
`}function E(e){let{typescript:t,appRouter:n}=e,r=c`
|
|
283
283
|
import { SliceSimulator, SliceSimulatorParams, getSlices } from "@prismicio/next";
|
|
284
284
|
import { SliceZone } from "@prismicio/react";
|
|
285
285
|
|
|
@@ -297,7 +297,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
297
297
|
</SliceSimulator>
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
`,i=
|
|
300
|
+
`,i=c`
|
|
301
301
|
import { SliceSimulator, getSlices } from "@prismicio/next";
|
|
302
302
|
import { SliceZone } from "@prismicio/react";
|
|
303
303
|
|
|
@@ -313,7 +313,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
313
313
|
</SliceSimulator>
|
|
314
314
|
);
|
|
315
315
|
}
|
|
316
|
-
`,
|
|
316
|
+
`,a=c`
|
|
317
317
|
import { SliceSimulator } from "@prismicio/next/pages";
|
|
318
318
|
import { SliceZone } from "@prismicio/react";
|
|
319
319
|
|
|
@@ -326,7 +326,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
326
326
|
/>
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
|
-
`;return n?t?r:i:
|
|
329
|
+
`;return n?t?r:i:a}function D(e){let{typescript:t,appRouter:n}=e,r=c`
|
|
330
330
|
import { NextRequest } from "next/server";
|
|
331
331
|
import { redirectToPreviewURL } from "@prismicio/next";
|
|
332
332
|
|
|
@@ -337,7 +337,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
337
337
|
|
|
338
338
|
return await redirectToPreviewURL({ client, request });
|
|
339
339
|
}
|
|
340
|
-
`,i=
|
|
340
|
+
`,i=c`
|
|
341
341
|
import { redirectToPreviewURL } from "@prismicio/next";
|
|
342
342
|
|
|
343
343
|
import { createClient } from "../../../prismicio";
|
|
@@ -347,7 +347,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
347
347
|
|
|
348
348
|
return await redirectToPreviewURL({ client, request });
|
|
349
349
|
}
|
|
350
|
-
`,
|
|
350
|
+
`,a=c`
|
|
351
351
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
352
352
|
import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
|
|
353
353
|
|
|
@@ -360,7 +360,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
360
360
|
|
|
361
361
|
return await redirectToPreviewURL({ req, res, client });
|
|
362
362
|
};
|
|
363
|
-
`,
|
|
363
|
+
`,o=c`
|
|
364
364
|
import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
|
|
365
365
|
|
|
366
366
|
import { createClient } from "../../prismicio";
|
|
@@ -372,26 +372,26 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
372
372
|
|
|
373
373
|
return await redirectToPreviewURL({ req, res, client });
|
|
374
374
|
};
|
|
375
|
-
`;return n?t?r:i:t?o
|
|
375
|
+
`;return n?t?r:i:t?a:o}function O(e){let{typescript:t,appRouter:n}=e,r=c`
|
|
376
376
|
import { exitPreview } from "@prismicio/next";
|
|
377
377
|
|
|
378
378
|
export function GET() {
|
|
379
379
|
return exitPreview();
|
|
380
380
|
}
|
|
381
|
-
`,i=
|
|
381
|
+
`,i=c`
|
|
382
382
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
383
383
|
import { exitPreview } from "@prismicio/next/pages";
|
|
384
384
|
|
|
385
385
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
386
386
|
return exitPreview({ req, res });
|
|
387
387
|
}
|
|
388
|
-
`,
|
|
388
|
+
`,a=c`
|
|
389
389
|
import { exitPreview } from "@prismicio/next/pages";
|
|
390
390
|
|
|
391
391
|
export default function handler(req, res) {
|
|
392
392
|
return exitPreview({ req, res });
|
|
393
393
|
}
|
|
394
|
-
`;return n?r:t?i:
|
|
394
|
+
`;return n?r:t?i:a}function k(e){let{supportsCacheLife:t}=e;return c`
|
|
395
395
|
import { NextResponse } from "next/server";
|
|
396
396
|
import { revalidateTag } from "next/cache";
|
|
397
397
|
|
|
@@ -400,7 +400,7 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
400
400
|
|
|
401
401
|
return NextResponse.json({ revalidated: true, now: Date.now() });
|
|
402
402
|
}
|
|
403
|
-
`}var
|
|
403
|
+
`}var A=class extends a{id=`next`;async setupProject(){await h({"@prismicio/client":`^${await m(`@prismicio/client`)}`,"@prismicio/react":`^${await m(`@prismicio/react`)}`,"@prismicio/next":`^${await m(`@prismicio/next`)}`}),await F(),await P(),await N(),await M(),await j()}async onProjectInitialized(){let t=await e(),n=await _(),r=await v();await i({repo:t,token:n,host:r})||await o(`http://localhost:3000/slice-simulator`,{repo:t,token:n,host:r}),(await s({repo:t,token:n,host:r})).length===0&&await l({name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/api/preview`},{repo:t,token:n,host:r})}async onSliceCreated(e,n){let r=t(e.name),i=new URL(r,f(n)),a=await B();await d(new URL(`index.${a}x`,f(i)),C({name:e.name,id:e.id,typescript:await u()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await I(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let n=(await this.getSlices()).filter(t=>t.library.href===e.href),r=n.map(n=>`import ${t(n.model.name)} from "./${x(b(e),b(n.directory))}";`),i=n.map(e=>{let n=t(e.model.name);return`${e.model.id}: ${n}`}),a=c`
|
|
404
404
|
// Code generated by Prismic. DO NOT EDIT.
|
|
405
405
|
|
|
406
406
|
${r.join(`
|
|
@@ -410,4 +410,4 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
|
|
|
410
410
|
${i.join(`,
|
|
411
411
|
`)}
|
|
412
412
|
};
|
|
413
|
-
`,
|
|
413
|
+
`,o=`index.${await B()}`;await d(new URL(o,e),a)}async getDefaultSliceLibrary(){let e=await n(),t=await z();return new URL(t?`src/slices/`:`slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await n();return new URL(`customtypes/`,e)}};async function j(){if(!await L())return;let e=await R(),t=await B(),n=new URL(`app/api/revalidate/route.${t}`,e);if(await p(n))return;let r=await V();await d(n,k({supportsCacheLife:Number.parseInt(r.split(`.`)[0])>=16}))}async function M(){let e=await L(),t=await R(),n=await B(),r=new URL(e?`app/api/exit-preview/route.${n}`:`pages/api/exit-preview.${n}`,t);await p(r)||await d(r,O({typescript:await u(),appRouter:e}))}async function N(){let e=await L(),t=await R(),n=await B(),r=new URL(e?`app/api/preview/route.${n}`:`pages/api/preview.${n}`,t);await p(r)||await d(r,D({typescript:await u(),appRouter:e}))}async function P(){let e=await L(),t=await R(),n=`${await B()}x`,r=new URL(e?`app/slice-simulator/page.${n}`:`pages/slice-simulator.${n}`,t);await p(r)||await d(r,E({typescript:await u(),appRouter:e}))}async function F(){let e=await B(),t=await R(),n=new URL(`prismicio.${e}`,t);await p(n)||await d(n,T({typescript:await u(),appRouter:await L(),hasSrcDirectory:await z()}))}async function I(e){let t=r(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),n=await R(),i=`${await B()}x`,a=await L(),o=a?new URL(`app/${t}/page.${i}`,n):new URL(`pages/${t||`index`}.${i}`,n);await p(o)||await d(o,w({model:e,routePath:t,typescript:await u(),appRouter:a}))}async function L(){let e=await R();return await p(new URL(`app/`,e))}async function R(){let e=await n();return await z()?new URL(`src/`,e):e}async function z(){let e=await n();return p(new URL(`src/`,e))}async function B(){return await u()?`ts`:`js`}async function V(){let{version:e}=y(await g())(`next/package.json`);return e}export{A as NextJsAdapter};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t as u,w as d,y as f}from"./core-DvI8OCsA.mjs";import{d as p,f as m,s as h}from"./request-BX9m6W7p.mjs";import{i as g,n as _}from"./packageJson-XOWTfdbI.mjs";import{i as v,r as y}from"./auth-hgWfYVlQ.mjs";import{n as b,t as x}from"./builders-hKD4IrLX-OKUYHMsz.mjs";import{readFile as S,rm as C}from"node:fs/promises";import{fileURLToPath as w}from"node:url";import{relative as T}from"node:path";function E(e){let{name:t,typescript:r}=e,i=n(t);return r?l`
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
import type { Content } from "@prismicio/client";
|
|
4
|
+
|
|
5
|
+
// The array passed to \`getSliceComponentProps\` is purely optional.
|
|
6
|
+
// Consider it as a visual hint for you when templating your slice.
|
|
7
|
+
defineProps(getSliceComponentProps<Content.${i}Slice>(
|
|
8
|
+
["slice", "index", "slices", "context"]
|
|
9
|
+
));
|
|
10
|
+
<\/script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<section
|
|
14
|
+
:data-slice-type="slice.slice_type"
|
|
15
|
+
:data-slice-variation="slice.variation"
|
|
16
|
+
>
|
|
17
|
+
Placeholder component for {{ slice.slice_type }} (variation: {{ slice.variation }}) slices.
|
|
18
|
+
<br />
|
|
19
|
+
<strong>You can edit this slice directly in your code editor.</strong>
|
|
20
|
+
</section>
|
|
21
|
+
</template>
|
|
22
|
+
`:l`
|
|
23
|
+
<script setup>
|
|
24
|
+
// The array passed to \`getSliceComponentProps\` is purely optional.
|
|
25
|
+
// Consider it as a visual hint for you when templating your slice.
|
|
26
|
+
defineProps(getSliceComponentProps(["slice", "index", "slices", "context"]));
|
|
27
|
+
<\/script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<section
|
|
31
|
+
:data-slice-type="slice.slice_type"
|
|
32
|
+
:data-slice-variation="slice.variation"
|
|
33
|
+
>
|
|
34
|
+
Placeholder component for {{ slice.slice_type }} (variation: {{ slice.variation }}) slices.
|
|
35
|
+
<br />
|
|
36
|
+
<strong>You can edit this slice directly in your code editor.</strong>
|
|
37
|
+
</section>
|
|
38
|
+
</template>
|
|
39
|
+
`}function D(e){let{model:t,typescript:n}=e,r=[`setup`];if(n&&r.push(`lang="ts"`),t.repeatable){let e=n?`route.params.uid as string`:`route.params.uid`;return l`
|
|
40
|
+
<script ${r.join(` `)}>
|
|
41
|
+
import { components } from "~/slices";
|
|
42
|
+
|
|
43
|
+
const prismic = usePrismic();
|
|
44
|
+
const route = useRoute();
|
|
45
|
+
const { data: page } = await useAsyncData(${e}, () =>
|
|
46
|
+
prismic.client.getByUID("${t.id}", ${e}),
|
|
47
|
+
);
|
|
48
|
+
<\/script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<main>
|
|
52
|
+
<SliceZone :slices="page?.data.slices ?? []" :components="components" />
|
|
53
|
+
</main>
|
|
54
|
+
</template>
|
|
55
|
+
`}return l`
|
|
56
|
+
<script ${r.join(` `)}>
|
|
57
|
+
import { components } from "~/slices";
|
|
58
|
+
|
|
59
|
+
const prismic = usePrismic();
|
|
60
|
+
const { data: page } = await useAsyncData("${t.id}", () =>
|
|
61
|
+
prismic.client.getSingle("${t.id}"),
|
|
62
|
+
);
|
|
63
|
+
<\/script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<main>
|
|
67
|
+
<SliceZone :slices="page?.data.slices ?? []" :components="components" />
|
|
68
|
+
</main>
|
|
69
|
+
</template>
|
|
70
|
+
`}function O(e){let{typescript:t}=e,n=[`setup`];return t&&n.push(`lang="ts"`),l`
|
|
71
|
+
<script ${n.join(` `)}>
|
|
72
|
+
import { components } from "~/slices";
|
|
73
|
+
<\/script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<SliceSimulator #default="{ slices }">
|
|
77
|
+
<SliceZone :slices="slices" :components="components" />
|
|
78
|
+
</SliceSimulator>
|
|
79
|
+
</template>
|
|
80
|
+
`}const k=`@nuxtjs/prismic`;var A=class extends o{id=`nuxt`;async setupProject(){await _({"@prismicio/client":`^${await g(`@prismicio/client`)}`,[k]:`^${await g(k)}`}),await M(),await P(),await F(),await I(this)}async onProjectInitialized(){let t=await e(),n=await v(),r=await y();await a({repo:t,token:n,host:r})||await s(`http://localhost:3000/slice-simulator`,{repo:t,token:n,host:r}),(await c({repo:t,token:n,host:r})).length===0&&await u({name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/preview`},{repo:t,token:n,host:r})}async onSliceCreated(e,t){let r=n(e.name),i=new URL(r,m(t));await p(new URL(`index.vue`,m(i)),E({name:e.name,typescript:await f()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await L(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let t=l`
|
|
81
|
+
// Code generated by Prismic. DO NOT EDIT.
|
|
82
|
+
|
|
83
|
+
import { defineAsyncComponent } from "vue";
|
|
84
|
+
import { defineSliceZoneComponents } from "@prismicio/vue";
|
|
85
|
+
|
|
86
|
+
export const components = defineSliceZoneComponents({
|
|
87
|
+
${(await this.getSlices()).filter(t=>t.library.href===e.href).map(t=>{let n=T(w(e),w(t.directory));return`${t.model.id}: defineAsyncComponent(() => import("./${n}/index.vue"))`}).join(`,
|
|
88
|
+
`)}
|
|
89
|
+
});
|
|
90
|
+
`,n=`index.${await R()}`;await p(new URL(n,e),t)}async getDefaultSliceLibrary(){let e=await j();return new URL(`slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await r();return new URL(`customtypes/`,e)}};async function j(){let e=await r(),t=new URL(`app/`,e);if(await h(t))return t;let n=new URL(`src/`,e);return await h(n)?n:e}async function M(){let e=await r(),t=new URL(`nuxt.config.js`,e);if(await h(t)||(t=new URL(`nuxt.config.ts`,e)),!await h(t))return;let n=w(t),i=await x(n),a=i.exports.default.$type===`function-call`?i.exports.default.$args[0]:i.exports.default;(a.modules||[]).find(e=>typeof e==`string`?e===k:Array.isArray(e)?e[0]===k:!1)||(a.modules||=[],a.modules.push(k)),await b(i,n)}async function N(){let e=await r(),t=new URL(`app/pages/`,e),n=new URL(`src/pages/`,e),i=new URL(`pages/`,e);return await h(t)?t:await h(n)?n:await h(i)?i:new URL(`pages/`,await j())}async function P(){let e=await f(),t=await N(),n=new URL(`slice-simulator.vue`,t);await h(n)||await p(n,O({typescript:e}))}async function F(){let e=await j(),t=new URL(`app.vue`,e);if(!await h(t))return;let n=await S(t,`utf8`);if(!n.includes(`<NuxtWelcome`))return;let r=new URL(`pages/index.vue`,e);await h(r)||await p(r,n),await C(t)}async function I(e){let n=await r(),i=await h(new URL(`app/`,n)),a=await h(new URL(`src/`,n));if(!i&&!a)return;let o;try{o=await d()}catch{return}let s=o.libraries;!s||JSON.stringify(s)!==JSON.stringify([`./slices`])||(await e.getSlices()).length>0||await t({libraries:[i?`./app/slices`:`./src/slices`]})}async function L(e){let t=i(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),n=await N(),r=new URL(`${t||`index`}.vue`,n);await h(r)||await p(r,D({model:e,typescript:await f()}))}async function R(){return await f()?`ts`:`js`}export{A as NuxtAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`prismic`,t=`1.8.0`;export{t as n,e as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./package-
|
|
1
|
+
import{n as e,t}from"./package-C8ZHSYR2.mjs";import{fileURLToPath as n}from"node:url";import{spawn as r}from"node:child_process";const i=[],a=[],o=crypto.randomUUID();let s;async function c(e){let{writeKey:t}=e;process.on(`exit`,()=>d({writeKey:t}))}function l(n){s=n.userId,a.push({userId:n.userId,anonymousId:o,integrations:{Intercom:{user_hash:n.intercomHash}},context:{app:{name:t,version:e}},timestamp:new Date().toISOString()})}function u(n,r={}){let{properties:a,groupId:c}=r;i.push({event:n,properties:{nodeVersion:process.versions.node,...a},context:{app:{name:t,version:e},groupId:c},userId:s,anonymousId:o,timestamp:new Date().toISOString()})}function d(e){let{writeKey:t}=e;if(!(i.length===0&&a.length===0)){try{let e=Buffer.from(JSON.stringify({trackEvents:i.map(e=>({...e,userId:e.userId||s})),identifyEvents:a,writeKey:t})).toString(`base64`),o=n(new URL(`./subprocesses/sendSegmentEvents.mjs`,import.meta.url));r(process.execPath,[o,e],{detached:!0,stdio:`ignore`}).unref()}catch{}i.length=0,a.length=0}}async function f(e,t,n){let r={"Content-Type":`application/json`,Authorization:`Basic ${btoa(n+`:`)}`};await Promise.allSettled([...e.map(e=>fetch(`https://api.segment.io/v1/track`,{method:`POST`,headers:r,body:JSON.stringify(e)}).catch(()=>{})),...t.map(e=>fetch(`https://api.segment.io/v1/identify`,{method:`POST`,headers:r,body:JSON.stringify(e)}).catch(()=>{}))])}export{l as i,f as n,u as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{o as e}from"../auth-hgWfYVlQ.mjs";try{await e()}catch{}export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../segment-
|
|
1
|
+
import{n as e}from"../segment-CusldEBw.mjs";const{trackEvents:t,identifyEvents:n,writeKey:r}=JSON.parse(Buffer.from(process.argv[2],`base64`).toString());try{await e(t,n,r)}catch{}export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../packageJson-XOWTfdbI.mjs";import{n as e}from"../update-notifier-
|
|
1
|
+
import"../packageJson-XOWTfdbI.mjs";import{n as e}from"../update-notifier-CG7Szvo5.mjs";const[t,n]=process.argv.slice(2);try{await e(t,new URL(n))}catch{}export{};
|