nuxt-graphql-middleware 5.0.0-alpha.2 → 5.0.0-alpha.20
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/README.md +101 -19
- package/dist/client/200.html +10 -10
- package/dist/client/404.html +10 -10
- package/dist/client/_nuxt/BM34SYth.js +1 -0
- package/dist/client/_nuxt/CROlboVl.js +1 -0
- package/dist/client/_nuxt/D5hBL5aZ.js +25 -0
- package/dist/client/_nuxt/FTbv7CO6.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/de61b0f7-ec5c-4f2f-addb-b5017c30afb1.json +1 -0
- package/dist/client/_nuxt/entry.Cn9qfNGa.css +1 -0
- package/dist/client/_nuxt/error-404.ehK72JOs.css +1 -0
- package/dist/client/_nuxt/error-500._g0akJim.css +1 -0
- package/dist/client/_nuxt/index.DGEN-H8t.css +1 -0
- package/dist/client/_nuxt/lIgCBhS_.js +2 -0
- package/dist/client/index.html +10 -10
- package/dist/client-options.d.mts +6 -0
- package/dist/client-options.mjs +5 -0
- package/dist/module.d.mts +74 -340
- package/dist/module.json +4 -4
- package/dist/module.mjs +1384 -589
- package/dist/runtime/components/CodeFrame.vue +52 -0
- package/dist/runtime/components/CodeFrame.vue.d.ts +7 -0
- package/dist/runtime/components/DevModeOverlay.vue +52 -0
- package/dist/runtime/components/DevModeOverlay.vue.d.ts +3 -0
- package/dist/runtime/components/ErrorExtensions.vue +21 -0
- package/dist/runtime/components/ErrorExtensions.vue.d.ts +5 -0
- package/dist/runtime/components/ErrorGroup.vue +78 -0
- package/dist/runtime/components/ErrorGroup.vue.d.ts +9 -0
- package/dist/runtime/composables/nuxtApp.d.ts +2 -2
- package/dist/runtime/composables/nuxtApp.js +21 -1
- package/dist/runtime/composables/useAsyncGraphqlQuery.d.ts +7 -7
- package/dist/runtime/composables/useAsyncGraphqlQuery.js +10 -2
- package/dist/runtime/composables/useGraphqlMutation.d.ts +4 -4
- package/dist/runtime/composables/useGraphqlMutation.js +1 -1
- package/dist/runtime/composables/useGraphqlQuery.d.ts +4 -4
- package/dist/runtime/composables/useGraphqlQuery.js +1 -1
- package/dist/runtime/composables/useGraphqlState.d.ts +1 -1
- package/dist/runtime/composables/useGraphqlState.js +1 -1
- package/dist/runtime/composables/useGraphqlUploadMutation.d.ts +4 -4
- package/dist/runtime/composables/useGraphqlUploadMutation.js +2 -2
- package/dist/runtime/css/output.css +1 -0
- package/dist/runtime/helpers/composables.d.ts +17 -20
- package/dist/runtime/helpers/composables.js +0 -5
- package/dist/runtime/plugins/devMode.d.ts +2 -0
- package/dist/runtime/plugins/devMode.js +23 -0
- package/dist/runtime/plugins/provideState.d.ts +1 -1
- package/dist/runtime/{serverHandler → server/api}/debug.js +3 -7
- package/dist/runtime/server/api/mutation.js +29 -0
- package/dist/runtime/server/api/query.js +30 -0
- package/dist/runtime/server/api/upload.d.ts +2 -0
- package/dist/runtime/{serverHandler → server/api}/upload.js +13 -11
- package/dist/runtime/{serverHandler → server}/helpers/index.d.ts +10 -12
- package/dist/runtime/{serverHandler → server}/helpers/index.js +9 -26
- package/dist/runtime/server/utils/doGraphqlRequest.d.ts +18 -0
- package/dist/runtime/server/utils/doGraphqlRequest.js +68 -0
- package/dist/runtime/server/utils/index.d.ts +1 -1
- package/dist/runtime/server/utils/index.js +1 -1
- package/dist/runtime/server/utils/useGraphqlMutation.d.ts +4 -4
- package/dist/runtime/server/utils/useGraphqlQuery.d.ts +4 -4
- package/dist/runtime/settings/index.d.ts +0 -14
- package/dist/runtime/settings/index.js +0 -6
- package/dist/runtime/types.d.ts +204 -3
- package/dist/server-options.d.mts +8 -0
- package/dist/server-options.mjs +5 -0
- package/dist/shared/nuxt-graphql-middleware.xfMm4rGk.d.mts +523 -0
- package/dist/types.d.mts +1 -7
- package/dist/utils.d.mts +15 -0
- package/dist/utils.mjs +18 -0
- package/package.json +64 -57
- package/dist/client/_nuxt/BS583yk8.js +0 -25
- package/dist/client/_nuxt/CZ2Qwgdk.js +0 -2
- package/dist/client/_nuxt/DpxjPVZy.js +0 -1
- package/dist/client/_nuxt/GOrnHr4p.js +0 -1
- package/dist/client/_nuxt/builds/meta/f823ebfd-daab-468f-8f6f-07a236da64bd.json +0 -1
- package/dist/client/_nuxt/entry.AjgXSF89.css +0 -1
- package/dist/client/_nuxt/error-404.BJkSn6RI.css +0 -1
- package/dist/client/_nuxt/error-500.TOCKLquH.css +0 -1
- package/dist/client/_nuxt/exxdaCPN.js +0 -1
- package/dist/client/_nuxt/index.D19Q16VT.css +0 -1
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -358
- package/dist/runtime/clientOptions/index.d.ts +0 -2
- package/dist/runtime/clientOptions/index.js +0 -3
- package/dist/runtime/serverHandler/index.js +0 -78
- package/dist/runtime/serverHandler/tsconfig.json +0 -3
- package/dist/runtime/serverOptions/defineGraphqlServerOptions.d.ts +0 -3
- package/dist/runtime/serverOptions/defineGraphqlServerOptions.js +0 -3
- package/dist/runtime/serverOptions/index.d.ts +0 -2
- package/dist/runtime/serverOptions/index.js +0 -2
- package/dist/types.d.ts +0 -7
- /package/dist/runtime/{serverHandler → server/api}/debug.d.ts +0 -0
- /package/dist/runtime/{serverHandler/index.d.ts → server/api/mutation.d.ts} +0 -0
- /package/dist/runtime/{serverHandler/upload.d.ts → server/api/query.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# nuxt-graphql-middleware
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
typed API routes.
|
|
5
|
+
A GraphQL client for Nuxt 3.
|
|
7
6
|
|
|
8
7
|
**[Documentation](https://nuxt-graphql-middleware.dulnan.net)** –
|
|
9
8
|
**[npm](https://www.npmjs.com/package/nuxt-graphql-middleware)** –
|
|
@@ -13,19 +12,20 @@ typed API routes.
|
|
|
13
12
|
|
|
14
13
|
## Features
|
|
15
14
|
|
|
16
|
-
- Exposes each query and mutation as an API route
|
|
17
|
-
- GraphQL requests are only
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
15
|
+
- Exposes each query and mutation as an **API route**
|
|
16
|
+
- GraphQL requests are done **only on the server side**
|
|
17
|
+
- Includes **composables** to perform queries or mutations
|
|
18
|
+
- **No GraphQL documents** in client bundle
|
|
19
|
+
- Super fast **TypeScript code generation** using
|
|
20
|
+
**[graphql-typescript-deluxe](https://github.com/dulnan/graphql-typescript-deluxe)**
|
|
21
|
+
- **HMR** for all GraphQL files
|
|
22
|
+
- Optional **Client side caching** for query operations
|
|
23
|
+
- Modify **request headers**, responses and handle errors
|
|
24
|
+
- Integration with **[Nuxt DevTools](https://devtools.nuxtjs.org)**
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## Setup
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
### Install
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
npx nuxi@latest module add nuxt-graphql-middleware
|
|
@@ -42,6 +42,9 @@ export default defineNuxtConfig({
|
|
|
42
42
|
})
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
See
|
|
46
|
+
[all configuration options](https://nuxt-graphql-middleware.dulnan.net/configuration/module)
|
|
47
|
+
|
|
45
48
|
## Usage
|
|
46
49
|
|
|
47
50
|
Write your first query, e.g. in pages/films.query.graphql:
|
|
@@ -59,7 +62,7 @@ query films {
|
|
|
59
62
|
Your query is now available via the useGraphqlQuery() composable:
|
|
60
63
|
|
|
61
64
|
```typescript
|
|
62
|
-
const { data } = await useGraphqlQuery('films')
|
|
65
|
+
const { data, errors } = await useGraphqlQuery('films')
|
|
63
66
|
console.log(data.allFilms.films)
|
|
64
67
|
```
|
|
65
68
|
|
|
@@ -70,12 +73,91 @@ const { data } = await useAsyncGraphqlQuery('films')
|
|
|
70
73
|
console.log(data.value.allFilms.films)
|
|
71
74
|
```
|
|
72
75
|
|
|
73
|
-
Alternatively you can also call
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
Alternatively you can also directly call the API route to get the same result:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const response = await $fetch('/api/graphql_middleware/query/films')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Or using `useFetch`:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const { data } = await useFetch('/api/graphql_middleware/query/films')
|
|
86
|
+
```
|
|
76
87
|
|
|
77
88
|
## Nuxt 2
|
|
78
89
|
|
|
79
90
|
The 3.x releases are only compatible with Nuxt 3. The
|
|
80
91
|
[2.x branch](https://github.com/dulnan/nuxt-graphql-middleware/tree/2.x) and
|
|
81
|
-
releases on npm are compatible with Nuxt 2.
|
|
92
|
+
releases on npm are compatible with Nuxt 2. However this version is not
|
|
93
|
+
maintained anymore.
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
The module uses the default Nuxt module authoring setup where the module itself
|
|
98
|
+
is located in `./src`, with a playground located in `./playground/`.
|
|
99
|
+
|
|
100
|
+
### Setup
|
|
101
|
+
|
|
102
|
+
#### Install dependencies
|
|
103
|
+
|
|
104
|
+
Install the dependencies of the module and playground:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
npm install
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### Prepare Types
|
|
111
|
+
|
|
112
|
+
This will generate all the types needed to start developing:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
npm run dev:prepare
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
#### Start Apollo Server
|
|
119
|
+
|
|
120
|
+
The playground uses an Apollo server that needs to be built separately.
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
cd apollo
|
|
124
|
+
npm install
|
|
125
|
+
npm run compile
|
|
126
|
+
npm run start
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Start the Playground
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
npm run dev
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
You can now open http://localhost:3000 to start developing.
|
|
136
|
+
|
|
137
|
+
### Testing
|
|
138
|
+
|
|
139
|
+
#### Lint / Code Style
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
npm run lint
|
|
143
|
+
npm run prettier
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### Unit Tests (Vitest)
|
|
147
|
+
|
|
148
|
+
Unit tests are done using Vitest.
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
npm run test:ci
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### E2E (Cypress)
|
|
155
|
+
|
|
156
|
+
We use Cypress to run some E2E tests. The tests are executed against the
|
|
157
|
+
playground **build**:
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
npm run dev:build
|
|
161
|
+
npm run dev:start
|
|
162
|
+
npm run cypress
|
|
163
|
+
```
|
package/dist/client/200.html
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<!DOCTYPE html><html
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
5
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-404.
|
|
6
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
10
|
-
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"
|
|
3
|
+
<link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cn9qfNGa.css" crossorigin>
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/D5hBL5aZ.js">
|
|
5
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-404.ehK72JOs.css">
|
|
6
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/BM34SYth.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/FTbv7CO6.js">
|
|
8
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500._g0akJim.css">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/CROlboVl.js">
|
|
10
|
+
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/D5hBL5aZ.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1745386817962,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"de61b0f7-ec5c-4f2f-addb-b5017c30afb1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<!DOCTYPE html><html
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
5
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-404.
|
|
6
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/
|
|
10
|
-
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"
|
|
3
|
+
<link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cn9qfNGa.css" crossorigin>
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/D5hBL5aZ.js">
|
|
5
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-404.ehK72JOs.css">
|
|
6
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/BM34SYth.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/FTbv7CO6.js">
|
|
8
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500._g0akJim.css">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/CROlboVl.js">
|
|
10
|
+
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/D5hBL5aZ.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1745386817962,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"de61b0f7-ec5c-4f2f-addb-b5017c30afb1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as P,d as B,r as R,a as N,o as T,b as H,c as I,e as U,f as M,h as q,g as A,p as V,i as z,j as x,k as O,l as F,m as D,n as $,w as W,q as G,s as K,_ as Q,t as J,v as X,x as S,y as C,z as Y,A as Z,B as ee}from"./D5hBL5aZ.js";import{u as te}from"./FTbv7CO6.js";async function E(t,n=P()){const{path:d,matched:h}=n.resolve(t);if(!h.length||(n._routePreloaded||(n._routePreloaded=new Set),n._routePreloaded.has(d)))return;const v=n._preloadPromises||(n._preloadPromises=[]);if(v.length>4)return Promise.all(v).then(()=>E(t,n));n._routePreloaded.add(d);const e=h.map(a=>{var u;return(u=a.components)==null?void 0:u.default}).filter(a=>typeof a=="function");for(const a of e){const u=Promise.resolve(a()).catch(()=>{}).finally(()=>v.splice(v.indexOf(u)));v.push(u)}await Promise.all(v)}const ne=(...t)=>t.find(n=>n!==void 0);function ae(t){const n=t.componentName||"NuxtLink";function d(e){return typeof e=="string"&&e.startsWith("#")}function h(e,a){if(!e||t.trailingSlash!=="append"&&t.trailingSlash!=="remove")return e;if(typeof e=="string")return j(e,t.trailingSlash);const u="path"in e&&e.path!==void 0?e.path:a(e).path;return{...e,name:void 0,path:j(u,t.trailingSlash)}}function v(e){const a=P(),u=D(),s=x(()=>!!e.target&&e.target!=="_self"),p=x(()=>{const f=e.to||e.href||"";return typeof f=="string"&&O(f,{acceptRelative:!0})}),_=A("RouterLink"),b=typeof _!="string"?_.useLink:void 0,m=x(()=>{if(e.external)return!0;const f=e.to||e.href||"";return typeof f=="object"?!1:f===""||p.value}),r=x(()=>{const f=e.to||e.href||"";return m.value?f:h(f,a.resolve)}),c=m.value||b==null?void 0:b({...e,to:r}),y=x(()=>{var f;if(!r.value||p.value||d(r.value))return r.value;if(m.value){const k=typeof r.value=="object"&&"path"in r.value?z(r.value):r.value,w=typeof k=="object"?a.resolve(k).href:k;return h(w,a.resolve)}return typeof r.value=="object"?((f=a.resolve(r.value))==null?void 0:f.href)??null:h(F(u.app.baseURL,r.value),a.resolve)});return{to:r,hasTarget:s,isAbsoluteUrl:p,isExternal:m,href:y,isActive:(c==null?void 0:c.isActive)??x(()=>r.value===a.currentRoute.value.path),isExactActive:(c==null?void 0:c.isExactActive)??x(()=>r.value===a.currentRoute.value.path),route:(c==null?void 0:c.route)??x(()=>a.resolve(r.value)),async navigate(f){await $(y.value,{replace:e.replace,external:m.value||s.value})}}}return B({name:n,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1}},useLink:v,setup(e,{slots:a}){const u=P(),{to:s,href:p,navigate:_,isExternal:b,hasTarget:m,isAbsoluteUrl:r}=v(e),c=R(!1),y=R(null),f=o=>{var l;y.value=e.custom?(l=o==null?void 0:o.$el)==null?void 0:l.nextElementSibling:o==null?void 0:o.$el};function k(o){var l,i;return!c.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===o:((l=e.prefetchOn)==null?void 0:l[o])??((i=t.prefetchOn)==null?void 0:i[o]))&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!se()}async function w(o=N()){if(c.value)return;c.value=!0;const l=typeof s.value=="string"?s.value:b.value?z(s.value):u.resolve(s.value).fullPath,i=b.value?new URL(l,window.location.href).href:l;await Promise.all([o.hooks.callHook("link:prefetch",i).catch(()=>{}),!b.value&&!m.value&&E(s.value,u).catch(()=>{})])}if(k("visibility")){const o=N();let l,i=null;T(()=>{const g=oe();H(()=>{l=I(()=>{var L;(L=y==null?void 0:y.value)!=null&&L.tagName&&(i=g.observe(y.value,async()=>{i==null||i(),i=null,await w(o)}))})})}),U(()=>{l&&M(l),i==null||i(),i=null})}return()=>{var i;if(!b.value&&!m.value&&!d(s.value)){const g={ref:f,to:s.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(k("interaction")&&(g.onPointerenter=w.bind(null,void 0),g.onFocus=w.bind(null,void 0)),c.value&&(g.class=e.prefetchedClass||t.prefetchedClass),g.rel=e.rel||void 0),q(A("RouterLink"),g,a.default)}const o=e.target||null,l=ne(e.noRel?"":e.rel,t.externalRelAttribute,r.value||m.value?"noopener noreferrer":"")||null;return e.custom?a.default?a.default({href:p.value,navigate:_,prefetch:w,get route(){if(!p.value)return;const g=new URL(p.value,window.location.href);return{path:g.pathname,fullPath:g.pathname,get query(){return V(g.search)},hash:g.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:p.value}},rel:l,target:o,isExternal:b.value||m.value,isActive:!1,isExactActive:!1}):null:q("a",{ref:y,href:p.value||null,rel:l,target:o},(i=a.default)==null?void 0:i.call(a))}}})}const re=ae(K);function j(t,n){const d=n==="append"?W:G;return O(t)&&!t.startsWith("http")?t:d(t,!0)}function oe(){const t=N();if(t._observer)return t._observer;let n=null;const d=new Map,h=(e,a)=>(n||(n=new IntersectionObserver(u=>{for(const s of u){const p=d.get(s.target);(s.isIntersecting||s.intersectionRatio>0)&&p&&p()}})),d.set(e,a),n.observe(e),()=>{d.delete(e),n==null||n.unobserve(e),d.size===0&&(n==null||n.disconnect(),n=null)});return t._observer={observe:h}}const ie=/2g/;function se(){const t=navigator.connection;return!!(t&&(t.saveData||ie.test(t.effectiveType)))}const le={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},ue={class:"max-w-520px text-center z-20"},ce=["textContent"],fe=["textContent"],de={class:"flex items-center justify-center w-full"},he={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const n=t;return te({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(d,h)=>{const v=re;return X(),J("div",le,[h[0]||(h[0]=S("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),S("div",ue,[S("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:C(t.statusCode)},null,8,ce),S("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:C(t.description)},null,8,fe),S("div",de,[Y(v,{to:"/",class:"cursor-pointer gradient-border px-4 py-2 sm:px-6 sm:py-3 sm:text-xl text-md"},{default:Z(()=>[ee(C(t.backHome),1)]),_:1})])])])}}},ge=Q(he,[["__scopeId","data-v-1c9f6778"]]);export{ge as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as s,t as a,v as i,x as e,y as o}from"./D5hBL5aZ.js";import{u}from"./FTbv7CO6.js";const l={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},c={class:"max-w-520px text-center"},d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const r=t;return u({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(g,n)=>(i(),a("div",l,[n[0]||(n[0]=e("div",{class:"-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight"},null,-1)),e("div",c,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:o(t.statusCode)},null,8,d),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:o(t.description)},null,8,p)])]))}},h=s(f,[["__scopeId","data-v-da29cbe1"]]);export{h as default};
|