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.
@@ -1,4 +1,4 @@
1
- import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";import{d as o,f as s,s as c}from"./request-BX9m6W7p.mjs";import{i as l,n as u,r as d}from"./packageJson-XOWTfdbI.mjs";import"./env-7YOoWh9b.mjs";import{t as f}from"./builders-hKD4IrLX-BqINnD6K.mjs";import{createRequire as p}from"node:module";import{writeFile as m}from"node:fs/promises";import{fileURLToPath as h}from"node:url";import{relative as g}from"node:path";function _(e){let{typescript:t}=e;return t?a`
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{t as y}from"./builders-hKD4IrLX-OKUYHMsz.mjs";import{createRequire as b}from"node:module";import{writeFile as x}from"node:fs/promises";import{fileURLToPath as S}from"node:url";import{relative as C}from"node:path";function w(e){let{typescript:t}=e;return t?c`
2
2
  import { createClient as baseCreateClient } from "@prismicio/client";
3
3
  import { type CreateClientConfig, enableAutoPreviews } from '@prismicio/svelte/kit';
4
4
  import prismicConfig from "../../prismic.config.json";
@@ -24,7 +24,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
24
24
 
25
25
  return client;
26
26
  };
27
- `:a`
27
+ `:c`
28
28
  import { createClient as baseCreateClient } from "@prismicio/client";
29
29
  import { enableAutoPreviews } from '@prismicio/svelte/kit';
30
30
  import prismicConfig from "../../prismic.config.json";
@@ -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 client;
52
52
  };
53
- `}function v(e){let{version:t}=e,n=a`
53
+ `}function T(e){let{version:t}=e,n=c`
54
54
  <script>
55
55
  import { SliceSimulator, SliceZone } from '@prismicio/svelte';
56
56
  import { components } from '$lib/slices';
@@ -60,7 +60,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
60
60
  <SliceSimulator let:slices>
61
61
  <SliceZone {slices} {components} />
62
62
  </SliceSimulator>
63
- `,r=a`
63
+ `,r=c`
64
64
  <script>
65
65
  import { SliceSimulator, SliceZone } from '@prismicio/svelte';
66
66
  import { components } from '$lib/slices';
@@ -69,7 +69,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
69
69
  <SliceSimulator let:slices>
70
70
  <SliceZone {slices} {components} />
71
71
  </SliceSimulator>
72
- `;return t<=4?r:n}function y(e){let{typescript:t}=e;return t?a`
72
+ `;return t<=4?r:n}function E(e){let{typescript:t}=e;return t?c`
73
73
  import { redirectToPreviewURL } from '@prismicio/svelte/kit';
74
74
  import { createClient } from '$lib/prismicio';
75
75
  import type { RequestHandler } from "./$types";
@@ -79,7 +79,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
79
79
 
80
80
  return await redirectToPreviewURL({ client, request, cookies });
81
81
  }
82
- `:a`
82
+ `:c`
83
83
  import { redirectToPreviewURL } from '@prismicio/svelte/kit';
84
84
  import { createClient } from '$lib/prismicio';
85
85
 
@@ -89,7 +89,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
89
89
 
90
90
  return await redirectToPreviewURL({ client, request, cookies });
91
91
  }
92
- `}function b(e){let{version:t}=e,n=a`
92
+ `}function D(e){let{version:t}=e,n=c`
93
93
  <script>
94
94
  import { isFilled, asImageSrc } from '@prismicio/client';
95
95
  import { PrismicPreview } from '@prismicio/svelte/kit';
@@ -112,7 +112,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
112
112
  </svelte:head>
113
113
  {@render children()}
114
114
  <PrismicPreview {repositoryName} />
115
- `,r=a`
115
+ `,r=c`
116
116
  <script>
117
117
  import { isFilled, asImageSrc } from '@prismicio/client';
118
118
  import { PrismicPreview } from '@prismicio/svelte/kit';
@@ -133,7 +133,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
133
133
  </svelte:head>
134
134
  <slot />
135
135
  <PrismicPreview {repositoryName} />
136
- `;return t<=4?r:n}function x(e){let{typescript:t}=e;return t?a`
136
+ `;return t<=4?r:n}function O(e){let{typescript:t}=e;return t?c`
137
137
  <script lang="ts">
138
138
  import { SliceZone } from "@prismicio/svelte";
139
139
  import { components } from "$lib/slices";
@@ -143,7 +143,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
143
143
  <\/script>
144
144
 
145
145
  <SliceZone slices={data.page.data.slices} {components} />
146
- `:a`
146
+ `:c`
147
147
  <script>
148
148
  import { SliceZone } from "@prismicio/svelte";
149
149
  import { components } from "$lib/slices";
@@ -152,7 +152,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
152
152
  <\/script>
153
153
 
154
154
  <SliceZone slices={data.page.data.slices} {components} />
155
- `}function S(e){let{model:t,typescript:n}=e;return t.repeatable?n?a`
155
+ `}function k(e){let{model:t,typescript:n}=e;return t.repeatable?n?c`
156
156
  import type { PageServerLoad } from "./$types";
157
157
  import { createClient } from "$lib/prismicio";
158
158
 
@@ -162,7 +162,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
162
162
 
163
163
  return { page };
164
164
  };
165
- `:a`
165
+ `:c`
166
166
  import { createClient } from "$lib/prismicio";
167
167
 
168
168
  /** @type {import("./$types").PageServerLoad} */
@@ -172,7 +172,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
172
172
 
173
173
  return { page };
174
174
  }
175
- `:n?a`
175
+ `:n?c`
176
176
  import type { PageServerLoad } from "./$types";
177
177
  import { createClient } from "$lib/prismicio";
178
178
 
@@ -182,7 +182,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
182
182
 
183
183
  return { page };
184
184
  };
185
- `:a`
185
+ `:c`
186
186
  import { createClient } from "$lib/prismicio";
187
187
 
188
188
  /* @type {import("./$types").PageServerLoad} */
@@ -192,49 +192,49 @@ import{T as e,d as t,g as n,p as r,r as i,t as a}from"./string-suKEaYgy.mjs";imp
192
192
 
193
193
  return { page };
194
194
  }
195
- `}const C=a`
195
+ `}const A=c`
196
196
  <section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>
197
197
  Placeholder component for {slice.slice_type} (variation: {slice.variation}) slices.
198
198
  <br />
199
199
  <strong>You can edit this slice directly in your code editor.</strong>
200
200
  </section>
201
- `;function w(t){let{name:n,typescript:r,version:i}=t,o=e(n),s=a`
201
+ `;function j(e){let{name:n,typescript:r,version:i}=e,a=t(n),o=c`
202
202
  <script lang="ts">
203
203
  import type { Content } from '@prismicio/client';
204
204
  import type { SliceComponentProps } from '@prismicio/svelte';
205
205
 
206
- type Props = SliceComponentProps<Content.${o}Slice>;
206
+ type Props = SliceComponentProps<Content.${a}Slice>;
207
207
 
208
208
  const { slice }: Props = $props();
209
209
  <\/script>
210
210
 
211
- ${C}
212
- `,c=a`
211
+ ${A}
212
+ `,s=c`
213
213
  <script>
214
214
  /* @typedef {import("@prismicio/client").Content} Content */
215
215
  /* @typedef {import("@prismicio/svelte").SliceComponentProps} SliceComponentProps */
216
216
 
217
- /* @type {SliceComponentProps<Content.${o}Slice>} */
217
+ /* @type {SliceComponentProps<Content.${a}Slice>} */
218
218
  const { slice } = $props();
219
219
  <\/script>
220
220
 
221
- ${C}
222
- `,l=a`
221
+ ${A}
222
+ `,l=c`
223
223
  <script lang="ts">
224
224
  import type { Content } from '@prismicio/client';
225
225
 
226
- export let slice: Content.${o}Slice;
226
+ export let slice: Content.${a}Slice;
227
227
  <\/script>
228
228
 
229
- ${C}
230
- `,u=a`
229
+ ${A}
230
+ `,u=c`
231
231
  <script>
232
- /** @type {import("@prismicio/client").Content.${o}Slice} */
232
+ /** @type {import("@prismicio/client").Content.${a}Slice} */
233
233
  export let slice;
234
234
  <\/script>
235
235
 
236
- ${C}
237
- `;return r?i<=4?l:s:i<=4?u:c}var T=class extends i{id=`sveltekit`;async setupProject(){await u({"@prismicio/client":`^${await l(`@prismicio/client`)}`,"@prismicio/svelte":`^${await l(`@prismicio/svelte`)}`}),await E(),await D(),await O(),await k(),await A(),await j(),await M(),await P()}onProjectInitialized(){}async onSliceCreated(t,n){let i=e(t.name),a=new URL(i,s(n));await o(new URL(`index.svelte`,s(a)),w({name:t.name,typescript:await r(),version:await I()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await N(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(t){let n=(await this.getSlices()).filter(e=>e.library.href===t.href),r=n.map(n=>`import ${e(n.model.name)} from "./${g(h(t),h(n.directory))}/index.svelte";`),i=n.map(t=>{let n=e(t.model.name);return`${t.model.id}: ${n}`}),s=a`
236
+ ${A}
237
+ `;return r?i<=4?l:o:i<=4?u:s}var M=class extends a{id=`sveltekit`;async setupProject(){await h({"@prismicio/client":`^${await m(`@prismicio/client`)}`,"@prismicio/svelte":`^${await m(`@prismicio/svelte`)}`}),await N(),await P(),await F(),await I(),await L(),await R(),await z(),await V()}async onProjectInitialized(){let t=await e(),n=await _(),r=await v();await i({repo:t,token:n,host:r})||await o(`http://localhost:5173/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:5173`,resolverPath:`/api/preview`},{repo:t,token:n,host:r})}async onSliceCreated(e,n){let r=t(e.name),i=new URL(r,f(n));await d(new URL(`index.svelte`,f(i)),j({name:e.name,typescript:await u(),version:await U()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await B(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 "./${C(S(e),S(n.directory))}/index.svelte";`),i=n.map(e=>{let n=t(e.model.name);return`${e.model.id}: ${n}`}),a=c`
238
238
  // Code generated by Prismic. DO NOT EDIT.
239
239
 
240
240
  ${r.join(`
@@ -244,11 +244,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
244
244
  ${i.join(`,
245
245
  `)}
246
246
  };
247
- `,c=`index.${await F()}`;await o(new URL(c,t),s)}async getDefaultSliceLibrary(){let e=await n();return new URL(`src/lib/slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await n();return new URL(`customtypes/`,e)}};async function E(){let e=await F(),t=await n(),i=new URL(`src/lib/prismicio.${e}`,t);await c(i)||await o(i,_({typescript:await r()}))}async function D(){let e=await n(),t=new URL(`src/routes/slice-simulator/+page.svelte`,e);await c(t)||await o(t,v({version:await I()}))}async function O(){let e=await F(),t=await n(),r=new URL(`src/params/preview.${e}`,t);await c(r)||await o(r,a`
247
+ `,o=`index.${await H()}`;await d(new URL(o,e),a)}async getDefaultSliceLibrary(){let e=await n();return new URL(`src/lib/slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await n();return new URL(`customtypes/`,e)}};async function N(){let e=await H(),t=await n(),r=new URL(`src/lib/prismicio.${e}`,t);await p(r)||await d(r,w({typescript:await u()}))}async function P(){let e=await n(),t=new URL(`src/routes/slice-simulator/+page.svelte`,e);await p(t)||await d(t,T({version:await U()}))}async function F(){let e=await H(),t=await n(),r=new URL(`src/params/preview.${e}`,t);await p(r)||await d(r,c`
248
248
  export function match(param) {
249
249
  return param === 'preview';
250
250
  }
251
- `)}async function k(){let e=await F(),t=await n(),i=new URL(`src/routes/api/preview/+server.${e}`,t);await c(i)||await o(i,y({typescript:await r()}))}async function A(){let e=await n(),t=new URL(`src/routes/[[preview=preview]]/README.md`,e);await c(t)||await o(t,a`
251
+ `)}async function I(){let e=await H(),t=await n(),r=new URL(`src/routes/api/preview/+server.${e}`,t);await p(r)||await d(r,E({typescript:await u()}))}async function L(){let e=await n(),t=new URL(`src/routes/[[preview=preview]]/README.md`,e);await p(t)||await d(t,c`
252
252
  This directory adds support for optional \`/preview\` routes. Do not remove this directory.
253
253
 
254
254
  All routes within this directory will be served using the following URLs:
@@ -257,7 +257,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
257
257
  - \`/preview/example-route\` (server-rendered)
258
258
 
259
259
  See <https://prismic.io/docs/svelte-preview> for more information.
260
- `)}async function j(){let e=await F(),t=await n(),r=new URL(`src/routes/+layout.server.${e}`,t);await c(r)||await o(r,a`
260
+ `)}async function R(){let e=await H(),t=await n(),r=new URL(`src/routes/+layout.server.${e}`,t);await p(r)||await d(r,c`
261
261
  export const prerender = "auto";
262
- `)}async function M(){let e=await n(),t=new URL(`src/routes/+layout.svelte`,e);await c(t)||await o(t,b({version:await I()}))}async function N(e){let i=t(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),a=await n(),s=await F(),l=new URL(`src/routes/[[preview=preview]]/${i}/`,a),u=new URL(`+page.svelte`,l);await c(u)||await o(u,x({typescript:await r()}));let d=new URL(`+page.server.${s}`,l);await c(d)||await o(d,S({model:e,typescript:await r()}))}async function P(){let e=await n(),t=new URL(`vite.config.js`,e);if(await c(t)||(t=new URL(`vite.config.ts`,e)),!await c(t))return;let r=t.pathname,i=await f(r);if(i.exports.default.$type!==`function-call`)return;let a=i.exports.default.$args[0];a.server??={},a.server.fs??={},a.server.fs.allow??=[],a.server.fs.allow.includes(`./prismic.config.json`)||a.server.fs.allow.push(`./prismic.config.json`);let o=i.generate().code.replace(/\n\s*\n(?=\s*server:)/,`
263
- `);await m(t,o)}async function F(){return await r()?`ts`:`js`}async function I(){let{version:e}=p(await d())(`svelte/package.json`),t=Number.parseInt(e.split(`.`)[0]);return Number.isNaN(t)?1/0:t}export{T as SvelteKitAdapter};
262
+ `)}async function z(){let e=await n(),t=new URL(`src/routes/+layout.svelte`,e);await p(t)||await d(t,D({version:await U()}))}async function B(e){let t=r(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),i=await n(),a=await H(),o=new URL(`src/routes/[[preview=preview]]/${t}/`,i),s=new URL(`+page.svelte`,o);await p(s)||await d(s,O({typescript:await u()}));let c=new URL(`+page.server.${a}`,o);await p(c)||await d(c,k({model:e,typescript:await u()}))}async function V(){let e=await n(),t=new URL(`vite.config.js`,e);if(await p(t)||(t=new URL(`vite.config.ts`,e)),!await p(t))return;let r=t.pathname,i=await y(r);if(i.exports.default.$type!==`function-call`)return;let a=i.exports.default.$args[0];a.server??={},a.server.fs??={},a.server.fs.allow??=[],a.server.fs.allow.includes(`./prismic.config.json`)||a.server.fs.allow.push(`./prismic.config.json`);let o=i.generate().code.replace(/\n\s*\n(?=\s*server:)/,`
263
+ `);await x(t,o)}async function H(){return await u()?`ts`:`js`}async function U(){let{version:e}=b(await g())(`svelte/package.json`),t=Number.parseInt(e.split(`.`)[0]);return Number.isNaN(t)?1/0:t}export{M as SvelteKitAdapter};
@@ -1 +1 @@
1
- import{n as e}from"./package-fv3JT9Fa.mjs";import{C as t,M as n,O as r,T as i,o as a,x as o}from"./request-BX9m6W7p.mjs";import{i as s}from"./packageJson-XOWTfdbI.mjs";import{mkdir as c,readFile as l,writeFile as u}from"node:fs/promises";import{fileURLToPath as d}from"node:url";import{dirname as f}from"node:path";import{spawn as p}from"node:child_process";const m=o({latestKnownVersion:i(r()),lastUpdateCheckAt:i(t())});async function h(t){try{if(g())return;let n=await _(t.statePath),r=e;if(n?.latestKnownVersion&&v(n.latestKnownVersion,r)){let e=`Update available: ${r} → ${n.latestKnownVersion}. Run \`npx ${t.npmPackageName}@latest --version\` to update.`;process.on(`exit`,()=>{try{console.error(`\n${e}`)}catch{}})}(!n?.lastUpdateCheckAt||Date.now()-n.lastUpdateCheckAt>864e5)&&process.on(`exit`,()=>{b(t.npmPackageName,t.statePath)})}catch{}}function g(){return process.env.NO_UPDATE_NOTIFIER===`0`?!1:!!(process.env.NO_UPDATE_NOTIFIER===`1`||process.env.CI||!process.stderr.isTTY)}async function _(e){try{let t=await l(e,`utf-8`);return n(m,JSON.parse(t))}catch{return}}function v(e,t){if(e.includes(`-`)||t.includes(`-`))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);if(n.length!==3||r.length!==3||n.some(e=>!Number.isFinite(e))||r.some(e=>!Number.isFinite(e)))return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}async function y(e,t){let n=await s(e),r=d(t);await c(f(r),{recursive:!0}),await u(r,a({latestKnownVersion:n,lastUpdateCheckAt:Date.now()}))}function b(e,t){try{let n=d(new URL(`./subprocesses/updateVersionState.mjs`,import.meta.url));p(process.execPath,[n,e,t.href],{detached:!0,stdio:`ignore`}).unref()}catch{}}export{y as n,h as t};
1
+ import{n as e}from"./package-C8ZHSYR2.mjs";import{C as t,M as n,O as r,T as i,o as a,x as o}from"./request-BX9m6W7p.mjs";import{i as s}from"./packageJson-XOWTfdbI.mjs";import{mkdir as c,readFile as l,writeFile as u}from"node:fs/promises";import{fileURLToPath as d}from"node:url";import{dirname as f}from"node:path";import{spawn as p}from"node:child_process";const m=o({latestKnownVersion:i(r()),lastUpdateCheckAt:i(t())});async function h(t){try{if(g())return;let n=await _(t.statePath),r=e;if(n?.latestKnownVersion&&v(n.latestKnownVersion,r)){let e=`Update available: ${r} → ${n.latestKnownVersion}. Run \`npx ${t.npmPackageName}@latest --version\` to update.`;process.on(`exit`,()=>{try{console.error(`\n${e}`)}catch{}})}(!n?.lastUpdateCheckAt||Date.now()-n.lastUpdateCheckAt>864e5)&&process.on(`exit`,()=>{b(t.npmPackageName,t.statePath)})}catch{}}function g(){return process.env.NO_UPDATE_NOTIFIER===`0`?!1:!!(process.env.NO_UPDATE_NOTIFIER===`1`||process.env.CI||!process.stderr.isTTY)}async function _(e){try{let t=await l(e,`utf-8`);return n(m,JSON.parse(t))}catch{return}}function v(e,t){if(e.includes(`-`)||t.includes(`-`))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);if(n.length!==3||r.length!==3||n.some(e=>!Number.isFinite(e))||r.some(e=>!Number.isFinite(e)))return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}async function y(e,t){let n=await s(e),r=d(t);await c(f(r),{recursive:!0}),await u(r,a({latestKnownVersion:n,lastUpdateCheckAt:Date.now()}))}function b(e,t){try{let n=d(new URL(`./subprocesses/updateVersionState.mjs`,import.meta.url));p(process.execPath,[n,e,t.href],{detached:!0,stdio:`ignore`}).unref()}catch{}}export{y as n,h as t};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismic",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "Prismic's official command line tool",
5
5
  "keywords": [
6
6
  "prismic",
@@ -1 +0,0 @@
1
- import{M as e,O as t,T as n,a as r,d as i,f as a,j as o,o as s,s as c,x as l}from"./request-BX9m6W7p.mjs";import{r as u,t as d}from"./env-7YOoWh9b.mjs";import{readFile as f,rm as p}from"node:fs/promises";import{fileURLToPath as m,pathToFileURL as h}from"node:url";import{spawn as g}from"node:child_process";import{createServer as _}from"node:http";import{homedir as v}from"node:os";async function y(e,n){let{host:i}=n,a=b(i),o=new URL(`refreshtoken`,a);return o.searchParams.set(`token`,e),await r(o,{schema:t()})}function b(e){return new URL(`https://auth.${e}/`)}function x(e,t){if(t)return a(h(t));if(process.platform===`win32`){let t=process.env.APPDATA;if(t)return new URL(`${e}/`,a(h(t)))}if(process.platform!==`darwin`){let t=process.env.XDG_CONFIG_HOME;if(t)return new URL(`${e}/`,a(h(t)))}let n=a(h(v()));return new URL(`.config/${e}/`,n)}const S=x(`prismic`,u.PRISMIC_CONFIG_DIR),C=new URL(`credentials.json`,S),w=new URL(`update-notifier.json`,S),T=l({token:n(t().check(o(1))),host:n(t().check(o(1)))});async function E(){return(await A())?.token}async function D(){return u.PRISMIC_HOST?u.PRISMIC_HOST:(await A())?.host||d}async function O(){let e=await E();if(!e)return;let t=await D(),n=await y(e,{host:t});return await j({token:n,host:t}),n}async function k(){if(!await c(C))return!0;try{return await p(C,{force:!0}),!0}catch{return!1}}async function A(){try{let t=await f(C,`utf-8`);return e(T,JSON.parse(t))}catch{return}}async function j(e){await i(C,s(e))}async function M(e){let t=await D(),n=`https://${t}`;return new Promise((r,i)=>{let a=_((e,i)=>{if(e.method===`OPTIONS`){i.writeHead(204,{"Access-Control-Allow-Origin":n,"Access-Control-Allow-Methods":`POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`}),i.end();return}if(e.method===`POST`){let s=``;e.on(`data`,e=>{s+=e.toString()}),e.on(`end`,async()=>{try{let{cookies:e,email:c}=JSON.parse(s),l=e.find(e=>e.startsWith(`prismic-auth=`))?.split(`;`)[0]?.replace(/^prismic-auth=/,``);if(!l){i.writeHead(400,{"Access-Control-Allow-Origin":n,"Content-Type":`application/json`}),i.end(JSON.stringify({error:`Invalid request`}));return}await j({token:l,host:t}),i.writeHead(200,{"Access-Control-Allow-Origin":n,"Content-Type":`application/json`}),i.end(JSON.stringify({success:!0})),clearTimeout(o),a.close(),r({email:c})}catch{i.writeHead(400,{"Access-Control-Allow-Origin":n,"Content-Type":`application/json`}),i.end(JSON.stringify({error:`Invalid request`}))}});return}i.writeHead(404),i.end()}),o=setTimeout(()=>{a.close(),i(Error(`Login timed out. Please try again.`))},18e4),s=async()=>{let n=a.address();if(!n||typeof n==`string`){clearTimeout(o),a.close(),i(Error(`Failed to start login server`));return}let r=await F(t,n.port);e?.onReady?.(r)};a.on(`error`,e=>{e.code===`EADDRINUSE`&&a.listening===!1?a.listen(0,`0.0.0.0`,s):(clearTimeout(o),i(e))}),a.listen(5555,`0.0.0.0`,s)})}const N=new URL(`.prismic`,a(h(v())));async function P(){let e;try{e=await f(N,`utf-8`)}catch{return}try{let t=JSON.parse(e);if(!t||t.latestKnownVersion===void 0&&t.lastUpdateCheckAt===void 0)return}catch{return}try{await p(N,{force:!0})}catch{}}async function F(e,t){let n=new URL(`dashboard/cli/login`,`https://${e}/`);return n.searchParams.set(`source`,`prismic-cli`),n.searchParams.set(`port`,t.toString()),n}function I(){try{let e=m(new URL(`./subprocesses/refreshToken.mjs`,import.meta.url));g(process.execPath,[e],{detached:!0,stdio:`ignore`}).unref()}catch{}}export{k as a,w as c,E as i,M as n,O as o,D as r,I as s,P as t};
@@ -1 +0,0 @@
1
- import{M as e,O as t,T as n,b as r,h as i,k as a,w as o}from"./request-BX9m6W7p.mjs";const s=`prismic.io`,c=`wroom.io`,l=e(o({MODE:t(),DEV:a(),PROD:a(),TEST:a(),PRISMIC_SENTRY_DSN:i(r(),`https://e1886b1775bd397cd1afc60bfd2ebfc8@o146123.ingest.us.sentry.io/4510445143588864`),PRISMIC_SENTRY_ENVIRONMENT:n(t()),PRISMIC_SENTRY_ENABLED:n(a()),PRISMIC_HOST:n(t()),PRISMIC_DOCS_HOST:n(t()),PRISMIC_CONFIG_DIR:n(t()),PRISMIC_TYPE_BUILDER_ENABLED:n(a())}),{...process.env,MODE:`production`,DEV:`false`,PROD:`true`,TEST:`false`});export{c as n,l as r,s as t};
@@ -1,90 +0,0 @@
1
- import{T as e,d as t,g as n,p as r,r as i,t as a,v as o,x as s}from"./string-suKEaYgy.mjs";import{d as c,f as l,s as u}from"./request-BX9m6W7p.mjs";import{i as d,n as f}from"./packageJson-XOWTfdbI.mjs";import"./env-7YOoWh9b.mjs";import{n as p,t as m}from"./builders-hKD4IrLX-BqINnD6K.mjs";import{readFile as h,rm as g}from"node:fs/promises";import{fileURLToPath as _}from"node:url";import{relative as v}from"node:path";function y(t){let{name:n,typescript:r}=t,i=e(n);return r?a`
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
- `:a`
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 b(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 a`
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 a`
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 x(e){let{typescript:t}=e,n=[`setup`];return t&&n.push(`lang="ts"`),a`
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 S=`@nuxtjs/prismic`;var C=class extends i{id=`nuxt`;async setupProject(){await f({"@prismicio/client":`^${await d(`@prismicio/client`)}`,[S]:`^${await d(S)}`}),await T(),await D(),await O(),await k(this)}onProjectInitialized(){}async onSliceCreated(t,n){let i=e(t.name),a=new URL(i,l(n));await c(new URL(`index.vue`,l(a)),y({name:t.name,typescript:await r()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await A(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let t=a`
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=v(_(e),_(t.directory));return`${t.model.id}: defineAsyncComponent(() => import("./${n}/index.vue"))`}).join(`,
88
- `)}
89
- });
90
- `,n=`index.${await j()}`;await c(new URL(n,e),t)}async getDefaultSliceLibrary(){let e=await w();return new URL(`slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await n();return new URL(`customtypes/`,e)}};async function w(){let e=await n(),t=new URL(`app/`,e);if(await u(t))return t;let r=new URL(`src/`,e);return await u(r)?r:e}async function T(){let e=await n(),t=new URL(`nuxt.config.js`,e);if(await u(t)||(t=new URL(`nuxt.config.ts`,e)),!await u(t))return;let r=_(t),i=await m(r),a=i.exports.default.$type===`function-call`?i.exports.default.$args[0]:i.exports.default;(a.modules||[]).find(e=>typeof e==`string`?e===S:Array.isArray(e)?e[0]===S:!1)||(a.modules||=[],a.modules.push(S)),await p(i,r)}async function E(){let e=await n(),t=new URL(`app/pages/`,e),r=new URL(`src/pages/`,e),i=new URL(`pages/`,e);return await u(t)?t:await u(r)?r:await u(i)?i:new URL(`pages/`,await w())}async function D(){let e=await r(),t=await E(),n=new URL(`slice-simulator.vue`,t);await u(n)||await c(n,x({typescript:e}))}async function O(){let e=await w(),t=new URL(`app.vue`,e);if(!await u(t))return;let n=await h(t,`utf8`);if(!n.includes(`<NuxtWelcome`))return;let r=new URL(`pages/index.vue`,e);await u(r)||await c(r,n),await g(t)}async function k(e){let t=await n(),r=await u(new URL(`app/`,t)),i=await u(new URL(`src/`,t));if(!r&&!i)return;let a;try{a=await o()}catch{return}let c=a.libraries;!c||JSON.stringify(c)!==JSON.stringify([`./slices`])||(await e.getSlices()).length>0||await s({libraries:[r?`./app/slices`:`./src/slices`]})}async function A(e){let n=t(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),i=await E(),a=new URL(`${n||`index`}.vue`,i);await u(a)||await c(a,b({model:e,typescript:await r()}))}async function j(){return await r()?`ts`:`js`}export{C as NuxtAdapter};
@@ -1 +0,0 @@
1
- var e=`prismic`,t=`1.7.2`;export{t as n,e as t};