@depup/nuxt 4.2.2-depup.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.
Files changed (233) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/app.d.ts +1 -0
  4. package/bin/nuxt.mjs +2 -0
  5. package/config.cjs +7 -0
  6. package/config.d.ts +8 -0
  7. package/config.js +5 -0
  8. package/dist/app/compat/capi.d.ts +4 -0
  9. package/dist/app/compat/capi.js +19 -0
  10. package/dist/app/compat/idle-callback.d.ts +2 -0
  11. package/dist/app/compat/idle-callback.js +15 -0
  12. package/dist/app/compat/interval.d.ts +1 -0
  13. package/dist/app/compat/interval.js +11 -0
  14. package/dist/app/compat/vue-demi.d.ts +4 -0
  15. package/dist/app/compat/vue-demi.js +4 -0
  16. package/dist/app/components/client-fallback.client.d.ts +50 -0
  17. package/dist/app/components/client-fallback.client.js +50 -0
  18. package/dist/app/components/client-fallback.server.d.ts +57 -0
  19. package/dist/app/components/client-fallback.server.js +80 -0
  20. package/dist/app/components/client-only.d.ts +26 -0
  21. package/dist/app/components/client-only.js +130 -0
  22. package/dist/app/components/dev-only.d.ts +11 -0
  23. package/dist/app/components/dev-only.js +14 -0
  24. package/dist/app/components/error-404.d.vue.ts +51 -0
  25. package/dist/app/components/error-404.vue +48 -0
  26. package/dist/app/components/error-404.vue.d.ts +51 -0
  27. package/dist/app/components/error-500.d.vue.ts +51 -0
  28. package/dist/app/components/error-500.vue +46 -0
  29. package/dist/app/components/error-500.vue.d.ts +51 -0
  30. package/dist/app/components/index.d.ts +3 -0
  31. package/dist/app/components/index.js +1 -0
  32. package/dist/app/components/injections.d.ts +7 -0
  33. package/dist/app/components/injections.js +2 -0
  34. package/dist/app/components/island-renderer.d.ts +20 -0
  35. package/dist/app/components/island-renderer.js +28 -0
  36. package/dist/app/components/nuxt-error-boundary.d.vue.ts +24 -0
  37. package/dist/app/components/nuxt-error-boundary.vue +46 -0
  38. package/dist/app/components/nuxt-error-boundary.vue.d.ts +24 -0
  39. package/dist/app/components/nuxt-error-page.d.vue.ts +7 -0
  40. package/dist/app/components/nuxt-error-page.vue +27 -0
  41. package/dist/app/components/nuxt-error-page.vue.d.ts +7 -0
  42. package/dist/app/components/nuxt-island.d.ts +70 -0
  43. package/dist/app/components/nuxt-island.js +331 -0
  44. package/dist/app/components/nuxt-layout.d.ts +14 -0
  45. package/dist/app/components/nuxt-layout.js +171 -0
  46. package/dist/app/components/nuxt-link.d.ts +101 -0
  47. package/dist/app/components/nuxt-link.js +409 -0
  48. package/dist/app/components/nuxt-loading-indicator.d.ts +78 -0
  49. package/dist/app/components/nuxt-loading-indicator.js +75 -0
  50. package/dist/app/components/nuxt-root.d.vue.ts +3 -0
  51. package/dist/app/components/nuxt-root.vue +60 -0
  52. package/dist/app/components/nuxt-root.vue.d.ts +3 -0
  53. package/dist/app/components/nuxt-route-announcer.d.ts +26 -0
  54. package/dist/app/components/nuxt-route-announcer.js +48 -0
  55. package/dist/app/components/nuxt-stubs.d.ts +6 -0
  56. package/dist/app/components/nuxt-stubs.js +14 -0
  57. package/dist/app/components/nuxt-teleport-island-component.d.ts +22 -0
  58. package/dist/app/components/nuxt-teleport-island-component.js +38 -0
  59. package/dist/app/components/nuxt-teleport-island-slot.d.ts +32 -0
  60. package/dist/app/components/nuxt-teleport-island-slot.js +53 -0
  61. package/dist/app/components/nuxt-time.d.vue.ts +37 -0
  62. package/dist/app/components/nuxt-time.vue +148 -0
  63. package/dist/app/components/nuxt-time.vue.d.ts +37 -0
  64. package/dist/app/components/route-provider.d.ts +48 -0
  65. package/dist/app/components/route-provider.js +49 -0
  66. package/dist/app/components/server-placeholder.d.ts +2 -0
  67. package/dist/app/components/server-placeholder.js +7 -0
  68. package/dist/app/components/test-component-wrapper.d.ts +4 -0
  69. package/dist/app/components/test-component-wrapper.js +27 -0
  70. package/dist/app/components/utils.d.ts +48 -0
  71. package/dist/app/components/utils.js +126 -0
  72. package/dist/app/components/welcome.d.vue.ts +24 -0
  73. package/dist/app/components/welcome.vue +34 -0
  74. package/dist/app/components/welcome.vue.d.ts +24 -0
  75. package/dist/app/composables/asyncContext.d.ts +2 -0
  76. package/dist/app/composables/asyncContext.js +7 -0
  77. package/dist/app/composables/asyncData.d.ts +146 -0
  78. package/dist/app/composables/asyncData.js +491 -0
  79. package/dist/app/composables/chunk.d.ts +25 -0
  80. package/dist/app/composables/chunk.js +30 -0
  81. package/dist/app/composables/component.d.ts +4 -0
  82. package/dist/app/composables/component.js +82 -0
  83. package/dist/app/composables/cookie.d.ts +22 -0
  84. package/dist/app/composables/cookie.js +205 -0
  85. package/dist/app/composables/error.d.ts +25 -0
  86. package/dist/app/composables/error.js +39 -0
  87. package/dist/app/composables/fetch.d.ts +37 -0
  88. package/dist/app/composables/fetch.js +123 -0
  89. package/dist/app/composables/head.d.ts +1 -0
  90. package/dist/app/composables/head.js +1 -0
  91. package/dist/app/composables/hydrate.d.ts +9 -0
  92. package/dist/app/composables/hydrate.js +14 -0
  93. package/dist/app/composables/id.d.ts +3 -0
  94. package/dist/app/composables/id.js +2 -0
  95. package/dist/app/composables/index.d.ts +29 -0
  96. package/dist/app/composables/index.js +21 -0
  97. package/dist/app/composables/lazy-hydration.d.ts +40 -0
  98. package/dist/app/composables/lazy-hydration.js +2 -0
  99. package/dist/app/composables/loading-indicator.d.ts +39 -0
  100. package/dist/app/composables/loading-indicator.js +142 -0
  101. package/dist/app/composables/manifest.d.ts +20 -0
  102. package/dist/app/composables/manifest.js +59 -0
  103. package/dist/app/composables/once.d.ts +14 -0
  104. package/dist/app/composables/once.js +49 -0
  105. package/dist/app/composables/payload.d.ts +27 -0
  106. package/dist/app/composables/payload.js +137 -0
  107. package/dist/app/composables/preload.d.ts +20 -0
  108. package/dist/app/composables/preload.js +55 -0
  109. package/dist/app/composables/preview.d.ts +38 -0
  110. package/dist/app/composables/preview.js +61 -0
  111. package/dist/app/composables/ready.d.ts +2 -0
  112. package/dist/app/composables/ready.js +15 -0
  113. package/dist/app/composables/route-announcer.d.ts +19 -0
  114. package/dist/app/composables/route-announcer.js +55 -0
  115. package/dist/app/composables/router.d.ts +96 -0
  116. package/dist/app/composables/router.js +197 -0
  117. package/dist/app/composables/runtime-hook.d.ts +9 -0
  118. package/dist/app/composables/runtime-hook.js +7 -0
  119. package/dist/app/composables/script-stubs.d.ts +32 -0
  120. package/dist/app/composables/script-stubs.js +104 -0
  121. package/dist/app/composables/ssr.d.ts +33 -0
  122. package/dist/app/composables/ssr.js +113 -0
  123. package/dist/app/composables/state.d.ts +11 -0
  124. package/dist/app/composables/state.js +40 -0
  125. package/dist/app/composables/url.d.ts +3 -0
  126. package/dist/app/composables/url.js +8 -0
  127. package/dist/app/config.d.ts +14 -0
  128. package/dist/app/config.js +72 -0
  129. package/dist/app/entry-spa.d.ts +2 -0
  130. package/dist/app/entry-spa.js +2 -0
  131. package/dist/app/entry.async.d.ts +3 -0
  132. package/dist/app/entry.async.js +5 -0
  133. package/dist/app/entry.d.ts +7 -0
  134. package/dist/app/entry.js +78 -0
  135. package/dist/app/index.d.ts +12 -0
  136. package/dist/app/index.js +8 -0
  137. package/dist/app/middleware/manifest-route-rule.d.ts +2 -0
  138. package/dist/app/middleware/manifest-route-rule.js +17 -0
  139. package/dist/app/nuxt.d.ts +271 -0
  140. package/dist/app/nuxt.js +279 -0
  141. package/dist/app/plugins/browser-devtools-timing.client.d.ts +2 -0
  142. package/dist/app/plugins/browser-devtools-timing.client.js +23 -0
  143. package/dist/app/plugins/check-if-layout-used.d.ts +2 -0
  144. package/dist/app/plugins/check-if-layout-used.js +28 -0
  145. package/dist/app/plugins/check-outdated-build.client.d.ts +2 -0
  146. package/dist/app/plugins/check-outdated-build.client.js +39 -0
  147. package/dist/app/plugins/chunk-reload-immediate.client.d.ts +2 -0
  148. package/dist/app/plugins/chunk-reload-immediate.client.js +20 -0
  149. package/dist/app/plugins/chunk-reload.client.d.ts +2 -0
  150. package/dist/app/plugins/chunk-reload.client.js +30 -0
  151. package/dist/app/plugins/cross-origin-prefetch.client.d.ts +2 -0
  152. package/dist/app/plugins/cross-origin-prefetch.client.js +37 -0
  153. package/dist/app/plugins/debug-hooks.d.ts +2 -0
  154. package/dist/app/plugins/debug-hooks.js +9 -0
  155. package/dist/app/plugins/dev-server-logs.d.ts +2 -0
  156. package/dist/app/plugins/dev-server-logs.js +60 -0
  157. package/dist/app/plugins/navigation-repaint.client.d.ts +2 -0
  158. package/dist/app/plugins/navigation-repaint.client.js +16 -0
  159. package/dist/app/plugins/payload.client.d.ts +2 -0
  160. package/dist/app/plugins/payload.client.js +50 -0
  161. package/dist/app/plugins/preload.server.d.ts +2 -0
  162. package/dist/app/plugins/preload.server.js +13 -0
  163. package/dist/app/plugins/restore-state.client.d.ts +2 -0
  164. package/dist/app/plugins/restore-state.client.js +18 -0
  165. package/dist/app/plugins/revive-payload.client.d.ts +2 -0
  166. package/dist/app/plugins/revive-payload.client.js +44 -0
  167. package/dist/app/plugins/revive-payload.server.d.ts +2 -0
  168. package/dist/app/plugins/revive-payload.server.js +26 -0
  169. package/dist/app/plugins/router.d.ts +59 -0
  170. package/dist/app/plugins/router.js +222 -0
  171. package/dist/app/plugins/utils.d.ts +1 -0
  172. package/dist/app/plugins/utils.js +4 -0
  173. package/dist/app/plugins/view-transitions.client.d.ts +2 -0
  174. package/dist/app/plugins/view-transitions.client.js +55 -0
  175. package/dist/app/plugins/warn.dev.server.d.ts +2 -0
  176. package/dist/app/plugins/warn.dev.server.js +6 -0
  177. package/dist/app/types/augments.d.ts +49 -0
  178. package/dist/app/types/augments.js +0 -0
  179. package/dist/app/types.d.ts +39 -0
  180. package/dist/app/types.js +0 -0
  181. package/dist/app/utils.d.ts +13 -0
  182. package/dist/app/utils.js +34 -0
  183. package/dist/components/runtime/client-component.d.ts +2 -0
  184. package/dist/components/runtime/client-component.js +59 -0
  185. package/dist/components/runtime/lazy-hydrated-component.d.ts +124 -0
  186. package/dist/components/runtime/lazy-hydrated-component.js +101 -0
  187. package/dist/components/runtime/server-component.d.ts +20 -0
  188. package/dist/components/runtime/server-component.js +69 -0
  189. package/dist/head/runtime/components.d.ts +1058 -0
  190. package/dist/head/runtime/components.js +297 -0
  191. package/dist/head/runtime/composables.d.ts +25 -0
  192. package/dist/head/runtime/composables.js +47 -0
  193. package/dist/head/runtime/plugins/unhead.d.ts +2 -0
  194. package/dist/head/runtime/plugins/unhead.js +31 -0
  195. package/dist/head/runtime/types.d.ts +7 -0
  196. package/dist/head/runtime/types.js +0 -0
  197. package/dist/index.d.mts +9 -0
  198. package/dist/index.d.ts +9 -0
  199. package/dist/index.mjs +6974 -0
  200. package/dist/pages/runtime/app.d.vue.ts +3 -0
  201. package/dist/pages/runtime/app.vue +6 -0
  202. package/dist/pages/runtime/app.vue.d.ts +3 -0
  203. package/dist/pages/runtime/component-stub.d.ts +2 -0
  204. package/dist/pages/runtime/component-stub.js +1 -0
  205. package/dist/pages/runtime/composables.d.ts +58 -0
  206. package/dist/pages/runtime/composables.js +24 -0
  207. package/dist/pages/runtime/index.d.ts +3 -0
  208. package/dist/pages/runtime/index.js +1 -0
  209. package/dist/pages/runtime/page-placeholder.d.ts +4 -0
  210. package/dist/pages/runtime/page-placeholder.js +11 -0
  211. package/dist/pages/runtime/page.d.ts +30 -0
  212. package/dist/pages/runtime/page.js +212 -0
  213. package/dist/pages/runtime/plugins/check-if-page-unused.d.ts +2 -0
  214. package/dist/pages/runtime/plugins/check-if-page-unused.js +29 -0
  215. package/dist/pages/runtime/plugins/prefetch.client.d.ts +2 -0
  216. package/dist/pages/runtime/plugins/prefetch.client.js +41 -0
  217. package/dist/pages/runtime/plugins/prerender.server.d.ts +2 -0
  218. package/dist/pages/runtime/plugins/prerender.server.js +47 -0
  219. package/dist/pages/runtime/plugins/router.d.ts +6 -0
  220. package/dist/pages/runtime/plugins/router.js +236 -0
  221. package/dist/pages/runtime/router.options.d.ts +3 -0
  222. package/dist/pages/runtime/router.options.js +60 -0
  223. package/dist/pages/runtime/utils.d.ts +11 -0
  224. package/dist/pages/runtime/utils.js +18 -0
  225. package/dist/pages/runtime/validate.d.ts +2 -0
  226. package/dist/pages/runtime/validate.js +23 -0
  227. package/kit.d.ts +1 -0
  228. package/kit.js +1 -0
  229. package/package.json +156 -0
  230. package/schema.d.ts +1 -0
  231. package/schema.js +1 -0
  232. package/types.d.mts +14 -0
  233. package/types.d.ts +14 -0
@@ -0,0 +1,297 @@
1
+ import { defineComponent, inject, onUnmounted, provide, reactive } from "vue";
2
+ import { useHead } from "#app/composables/head";
3
+ const HeadComponentCtxSymbol = Symbol("head-component");
4
+ const TagPositionProps = {
5
+ /**
6
+ * @deprecated Use tagPosition
7
+ */
8
+ body: { type: Boolean, default: void 0 },
9
+ tagPosition: { type: String }
10
+ };
11
+ const normalizeProps = (_props) => {
12
+ const props = Object.fromEntries(
13
+ Object.entries(_props).filter(([_, value]) => value !== void 0)
14
+ );
15
+ if (typeof props.body !== "undefined") {
16
+ props.tagPosition = props.body ? "bodyClose" : "head";
17
+ }
18
+ if (typeof props.renderPriority !== "undefined") {
19
+ props.tagPriority = props.renderPriority;
20
+ }
21
+ return props;
22
+ };
23
+ function useHeadComponentCtx() {
24
+ return inject(HeadComponentCtxSymbol, createHeadComponentCtx, true);
25
+ }
26
+ function createHeadComponentCtx() {
27
+ const prev = inject(HeadComponentCtxSymbol, null);
28
+ if (prev) {
29
+ return prev;
30
+ }
31
+ const input = reactive({});
32
+ const entry = useHead(input);
33
+ const ctx = { input, entry };
34
+ provide(HeadComponentCtxSymbol, ctx);
35
+ return ctx;
36
+ }
37
+ const globalProps = {
38
+ accesskey: String,
39
+ autocapitalize: String,
40
+ autofocus: {
41
+ type: Boolean,
42
+ default: void 0
43
+ },
44
+ class: { type: [String, Object, Array], default: void 0 },
45
+ contenteditable: {
46
+ type: Boolean,
47
+ default: void 0
48
+ },
49
+ contextmenu: String,
50
+ dir: String,
51
+ draggable: {
52
+ type: Boolean,
53
+ default: void 0
54
+ },
55
+ enterkeyhint: String,
56
+ exportparts: String,
57
+ hidden: {
58
+ type: Boolean,
59
+ default: void 0
60
+ },
61
+ id: String,
62
+ inputmode: String,
63
+ is: String,
64
+ itemid: String,
65
+ itemprop: String,
66
+ itemref: String,
67
+ itemscope: String,
68
+ itemtype: String,
69
+ lang: String,
70
+ nonce: String,
71
+ part: String,
72
+ slot: String,
73
+ spellcheck: {
74
+ type: Boolean,
75
+ default: void 0
76
+ },
77
+ style: { type: [String, Object, Array], default: void 0 },
78
+ tabindex: String,
79
+ title: String,
80
+ translate: String,
81
+ /**
82
+ * @deprecated Use tagPriority
83
+ */
84
+ renderPriority: [String, Number],
85
+ /**
86
+ * Unhead prop to modify the priority of the tag.
87
+ */
88
+ tagPriority: { type: [String, Number] }
89
+ };
90
+ export const NoScript = defineComponent({
91
+ name: "NoScript",
92
+ inheritAttrs: false,
93
+ props: {
94
+ ...globalProps,
95
+ ...TagPositionProps,
96
+ title: String
97
+ },
98
+ setup(props, { slots }) {
99
+ const { input } = useHeadComponentCtx();
100
+ input.noscript ||= [];
101
+ const idx = input.noscript.push({}) - 1;
102
+ onUnmounted(() => input.noscript[idx] = null);
103
+ return () => {
104
+ const noscript = normalizeProps(props);
105
+ const slotVnodes = slots.default?.();
106
+ const textContent = [];
107
+ if (slotVnodes) {
108
+ for (const vnode of slotVnodes) {
109
+ if (vnode.children) {
110
+ textContent.push(vnode.children);
111
+ }
112
+ }
113
+ }
114
+ if (textContent.length > 0) {
115
+ noscript.innerHTML = textContent.join("");
116
+ }
117
+ input.noscript[idx] = noscript;
118
+ return null;
119
+ };
120
+ }
121
+ });
122
+ export const Link = defineComponent({
123
+ name: "Link",
124
+ inheritAttrs: false,
125
+ props: {
126
+ ...globalProps,
127
+ ...TagPositionProps,
128
+ as: String,
129
+ crossorigin: String,
130
+ disabled: Boolean,
131
+ fetchpriority: String,
132
+ href: String,
133
+ hreflang: String,
134
+ imagesizes: String,
135
+ imagesrcset: String,
136
+ integrity: String,
137
+ media: String,
138
+ prefetch: {
139
+ type: Boolean,
140
+ default: void 0
141
+ },
142
+ referrerpolicy: String,
143
+ rel: String,
144
+ sizes: String,
145
+ title: String,
146
+ type: String,
147
+ /** @deprecated **/
148
+ methods: String,
149
+ /** @deprecated **/
150
+ target: String
151
+ },
152
+ setup(props) {
153
+ const { input } = useHeadComponentCtx();
154
+ input.link ||= [];
155
+ const idx = input.link.push({}) - 1;
156
+ onUnmounted(() => input.link[idx] = null);
157
+ return () => {
158
+ input.link[idx] = normalizeProps(props);
159
+ return null;
160
+ };
161
+ }
162
+ });
163
+ export const Base = defineComponent({
164
+ name: "Base",
165
+ inheritAttrs: false,
166
+ props: {
167
+ ...globalProps,
168
+ href: String,
169
+ target: String
170
+ },
171
+ setup(props) {
172
+ const { input } = useHeadComponentCtx();
173
+ onUnmounted(() => input.base = null);
174
+ return () => {
175
+ input.base = normalizeProps(props);
176
+ return null;
177
+ };
178
+ }
179
+ });
180
+ export const Title = defineComponent({
181
+ name: "Title",
182
+ inheritAttrs: false,
183
+ setup(_, { slots }) {
184
+ const { input } = useHeadComponentCtx();
185
+ onUnmounted(() => input.title = null);
186
+ return () => {
187
+ const defaultSlot = slots.default?.();
188
+ input.title = defaultSlot?.[0]?.children ? String(defaultSlot?.[0]?.children) : void 0;
189
+ if (import.meta.dev) {
190
+ if (defaultSlot && (defaultSlot.length > 1 || defaultSlot[0] && typeof defaultSlot[0].children !== "string")) {
191
+ console.error("<Title> can take only one string in its default slot.");
192
+ }
193
+ }
194
+ return null;
195
+ };
196
+ }
197
+ });
198
+ export const Meta = defineComponent({
199
+ name: "Meta",
200
+ inheritAttrs: false,
201
+ props: {
202
+ ...globalProps,
203
+ charset: String,
204
+ content: String,
205
+ httpEquiv: String,
206
+ name: String,
207
+ property: String
208
+ },
209
+ setup(props) {
210
+ const { input } = useHeadComponentCtx();
211
+ input.meta ||= [];
212
+ const idx = input.meta.push({}) - 1;
213
+ onUnmounted(() => input.meta[idx] = null);
214
+ return () => {
215
+ const meta = { "http-equiv": props.httpEquiv, ...normalizeProps(props) };
216
+ if ("httpEquiv" in meta) {
217
+ delete meta.httpEquiv;
218
+ }
219
+ input.meta[idx] = meta;
220
+ return null;
221
+ };
222
+ }
223
+ });
224
+ export const Style = defineComponent({
225
+ name: "Style",
226
+ inheritAttrs: false,
227
+ props: {
228
+ ...globalProps,
229
+ ...TagPositionProps,
230
+ type: String,
231
+ media: String,
232
+ nonce: String,
233
+ title: String,
234
+ /** @deprecated **/
235
+ scoped: {
236
+ type: Boolean,
237
+ default: void 0
238
+ }
239
+ },
240
+ setup(props, { slots }) {
241
+ const { input } = useHeadComponentCtx();
242
+ input.style ||= [];
243
+ const idx = input.style.push({}) - 1;
244
+ onUnmounted(() => input.style[idx] = null);
245
+ return () => {
246
+ const style = normalizeProps(props);
247
+ const textContent = slots.default?.()?.[0]?.children;
248
+ if (textContent) {
249
+ if (import.meta.dev && typeof textContent !== "string") {
250
+ console.error("<Style> can only take a string in its default slot.");
251
+ }
252
+ input.style[idx] = style;
253
+ style.textContent = textContent;
254
+ }
255
+ return null;
256
+ };
257
+ }
258
+ });
259
+ export const Head = defineComponent({
260
+ name: "Head",
261
+ inheritAttrs: false,
262
+ setup: (_props, ctx) => {
263
+ createHeadComponentCtx();
264
+ return () => ctx.slots.default?.();
265
+ }
266
+ });
267
+ export const Html = defineComponent({
268
+ name: "Html",
269
+ inheritAttrs: false,
270
+ props: {
271
+ ...globalProps,
272
+ manifest: String,
273
+ version: String,
274
+ xmlns: String
275
+ },
276
+ setup(_props, ctx) {
277
+ const { input } = useHeadComponentCtx();
278
+ onUnmounted(() => input.htmlAttrs = null);
279
+ return () => {
280
+ input.htmlAttrs = { ..._props, ...ctx.attrs };
281
+ return ctx.slots.default?.();
282
+ };
283
+ }
284
+ });
285
+ export const Body = defineComponent({
286
+ name: "Body",
287
+ inheritAttrs: false,
288
+ props: globalProps,
289
+ setup(_props, ctx) {
290
+ const { input } = useHeadComponentCtx();
291
+ onUnmounted(() => input.bodyAttrs = null);
292
+ return () => {
293
+ input.bodyAttrs = { ..._props, ...ctx.attrs };
294
+ return ctx.slots.default?.();
295
+ };
296
+ }
297
+ });
@@ -0,0 +1,25 @@
1
+ import type { ActiveHeadEntry, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue/types';
2
+ import type { NuxtApp } from '#app/nuxt';
3
+ /**
4
+ * Injects the head client from the Nuxt context or Vue inject.
5
+ */
6
+ export declare function injectHead(nuxtApp?: NuxtApp): VueHeadClient;
7
+ interface NuxtUseHeadOptions extends UseHeadOptions {
8
+ nuxt?: NuxtApp;
9
+ }
10
+ export declare function useHead(input: UseHeadInput, options?: NuxtUseHeadOptions): ActiveHeadEntry<UseHeadInput>;
11
+ export declare function useHeadSafe(input: UseHeadSafeInput, options?: NuxtUseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
12
+ export declare function useSeoMeta(input: UseSeoMetaInput, options?: NuxtUseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
13
+ /**
14
+ * @deprecated Use `useHead` instead and wrap with `if (import.meta.server)`
15
+ */
16
+ export declare function useServerHead(input: UseHeadInput, options?: NuxtUseHeadOptions): ActiveHeadEntry<UseHeadInput>;
17
+ /**
18
+ * @deprecated Use `useHeadSafe` instead and wrap with `if (import.meta.server)`
19
+ */
20
+ export declare function useServerHeadSafe(input: UseHeadSafeInput, options?: NuxtUseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
21
+ /**
22
+ * @deprecated Use `useSeoMeta` instead and wrap with `if (import.meta.server)`
23
+ */
24
+ export declare function useServerSeoMeta(input: UseSeoMetaInput, options?: NuxtUseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
25
+ export {};
@@ -0,0 +1,47 @@
1
+ import { hasInjectionContext, inject } from "vue";
2
+ import {
3
+ useHead as headCore,
4
+ useHeadSafe as headSafe,
5
+ headSymbol,
6
+ useSeoMeta as seoMeta,
7
+ useServerHead as serverHead,
8
+ useServerHeadSafe as serverHeadSafe,
9
+ useServerSeoMeta as serverSeoMeta
10
+ } from "@unhead/vue";
11
+ import { useNuxtApp } from "#app/nuxt";
12
+ export function injectHead(nuxtApp) {
13
+ const nuxt = nuxtApp || useNuxtApp();
14
+ return nuxt.ssrContext?.head || nuxt.runWithContext(() => {
15
+ if (hasInjectionContext()) {
16
+ const head = inject(headSymbol);
17
+ if (!head) {
18
+ throw new Error("[nuxt] [unhead] Missing Unhead instance.");
19
+ }
20
+ return head;
21
+ }
22
+ });
23
+ }
24
+ export function useHead(input, options = {}) {
25
+ const head = options.head || injectHead(options.nuxt);
26
+ return headCore(input, { head, ...options });
27
+ }
28
+ export function useHeadSafe(input, options = {}) {
29
+ const head = options.head || injectHead(options.nuxt);
30
+ return headSafe(input, { head, ...options });
31
+ }
32
+ export function useSeoMeta(input, options = {}) {
33
+ const head = options.head || injectHead(options.nuxt);
34
+ return seoMeta(input, { head, ...options });
35
+ }
36
+ export function useServerHead(input, options = {}) {
37
+ const head = options.head || injectHead(options.nuxt);
38
+ return serverHead(input, { head, ...options });
39
+ }
40
+ export function useServerHeadSafe(input, options = {}) {
41
+ const head = options.head || injectHead(options.nuxt);
42
+ return serverHeadSafe(input, { head, ...options });
43
+ }
44
+ export function useServerSeoMeta(input, options = {}) {
45
+ const head = options.head || injectHead(options.nuxt);
46
+ return serverSeoMeta(input, { head, ...options });
47
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import { createHead as createClientHead, renderDOMHead } from "@unhead/vue/client";
2
+ import { defineNuxtPlugin } from "#app/nuxt";
3
+ import unheadOptions from "#build/unhead-options.mjs";
4
+ export default defineNuxtPlugin({
5
+ name: "nuxt:head",
6
+ enforce: "pre",
7
+ setup(nuxtApp) {
8
+ const head = import.meta.server ? nuxtApp.ssrContext.head : createClientHead(unheadOptions);
9
+ nuxtApp.vueApp.use(head);
10
+ if (import.meta.client) {
11
+ let pauseDOMUpdates = true;
12
+ const syncHead = async () => {
13
+ pauseDOMUpdates = false;
14
+ await renderDOMHead(head);
15
+ };
16
+ head.hooks.hook("dom:beforeRender", (context) => {
17
+ context.shouldRender = !pauseDOMUpdates;
18
+ });
19
+ nuxtApp.hooks.hook("page:start", () => {
20
+ pauseDOMUpdates = true;
21
+ });
22
+ nuxtApp.hooks.hook("page:finish", () => {
23
+ if (!nuxtApp.isHydrating) {
24
+ syncHead();
25
+ }
26
+ });
27
+ nuxtApp.hooks.hook("app:error", syncHead);
28
+ nuxtApp.hooks.hook("app:suspense:resolve", syncHead);
29
+ }
30
+ }
31
+ });
@@ -0,0 +1,7 @@
1
+ export type Props = Readonly<Record<string, any>>;
2
+ export type FetchPriority = 'high' | 'low' | 'auto';
3
+ export type CrossOrigin = '' | 'anonymous' | 'use-credentials';
4
+ export type HTTPEquiv = 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | 'x-ua-compatible';
5
+ export type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
6
+ export type LinkRelationship = 'alternate' | 'author' | 'canonical' | 'dns-prefetch' | 'help' | 'icon' | 'license' | 'manifest' | 'me' | 'modulepreload' | 'next' | 'pingback' | 'preconnect' | 'prefetch' | 'preload' | 'prerender' | 'prev' | 'search' | 'stylesheet' | (string & {});
7
+ export type Target = '_blank' | '_self' | '_parent' | '_top' | (string & {});
File without changes
@@ -0,0 +1,9 @@
1
+ import { LoadNuxtOptions } from '@nuxt/kit';
2
+ import { NuxtOptions, Nuxt } from 'nuxt/schema';
3
+
4
+ declare function createNuxt(options: NuxtOptions): Nuxt;
5
+ declare function loadNuxt(opts: LoadNuxtOptions): Promise<Nuxt>;
6
+
7
+ declare function build(nuxt: Nuxt): Promise<any>;
8
+
9
+ export { build, createNuxt, loadNuxt };
@@ -0,0 +1,9 @@
1
+ import { LoadNuxtOptions } from '@nuxt/kit';
2
+ import { NuxtOptions, Nuxt } from 'nuxt/schema';
3
+
4
+ declare function createNuxt(options: NuxtOptions): Nuxt;
5
+ declare function loadNuxt(opts: LoadNuxtOptions): Promise<Nuxt>;
6
+
7
+ declare function build(nuxt: Nuxt): Promise<any>;
8
+
9
+ export { build, createNuxt, loadNuxt };