@devite/nuxt-sanity 2.11.2 → 2.12.1

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 (38) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +2 -2
  3. package/dist/module.mjs +3 -2
  4. package/dist/runtime/client/DefaultSanityClient.d.ts +2 -2
  5. package/dist/runtime/client/DefaultSanityClient.js +1 -3
  6. package/dist/runtime/components/SanityComponent.vue +40 -46
  7. package/dist/runtime/components/SanityComponent.vue.d.ts +19 -0
  8. package/dist/runtime/components/SanityImageAsset.vue +34 -38
  9. package/dist/runtime/components/SanityImageAsset.vue.d.ts +9 -0
  10. package/dist/runtime/components/SanityLinkExternal.vue +4 -4
  11. package/dist/runtime/components/SanityLinkExternal.vue.d.ts +16 -0
  12. package/dist/runtime/components/SanityLinkInternal.vue +6 -10
  13. package/dist/runtime/components/SanityLinkInternal.vue.d.ts +19 -0
  14. package/dist/runtime/components/SanityPage.vue +26 -76
  15. package/dist/runtime/components/SanityPage.vue.d.ts +12 -0
  16. package/dist/runtime/components/SanityPictureAsset.vue +38 -42
  17. package/dist/runtime/components/SanityPictureAsset.vue.d.ts +20 -0
  18. package/dist/runtime/components/SanityRichText.vue +30 -35
  19. package/dist/runtime/components/SanityRichText.vue.d.ts +7 -0
  20. package/dist/runtime/composables/query.d.ts +1 -1
  21. package/dist/runtime/composables/query.js +1 -1
  22. package/dist/runtime/composables/sanity_seo.d.ts +3 -0
  23. package/dist/runtime/composables/sanity_seo.js +46 -0
  24. package/dist/runtime/composables/{useSanityVisualEditingState.d.ts → visual_editing_state.d.ts} +1 -1
  25. package/dist/runtime/imageProviders/sanity.js +1 -1
  26. package/dist/runtime/plugins/visual-editing.client.d.ts +1 -1
  27. package/dist/runtime/plugins/visual-editing.client.js +1 -1
  28. package/dist/runtime/plugins/visual-editing.server.d.ts +1 -1
  29. package/dist/runtime/plugins/visual-editing.server.js +2 -2
  30. package/dist/runtime/server/routes/cache/asset.js +4 -1
  31. package/dist/runtime/server/routes/cache/query.js +4 -1
  32. package/dist/runtime/utils/visualEditing/fetchSanityData.d.ts +1 -1
  33. package/dist/types.d.mts +2 -6
  34. package/package.json +21 -21
  35. package/dist/module.cjs +0 -5
  36. package/dist/module.d.ts +0 -126
  37. package/dist/types.d.ts +0 -7
  38. /package/dist/runtime/composables/{useSanityVisualEditingState.js → visual_editing_state.js} +0 -0
package/dist/module.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { VisualEditingOptions as VisualEditingOptions$1, HistoryRefresh } from '@sanity/visual-editing';
2
+ import { HistoryRefresh, VisualEditingOptions as VisualEditingOptions$1 } from '@sanity/visual-editing';
3
3
  import { ClientConfig } from '@sanity/client';
4
4
  import { Slug, ImageAsset, PortableTextBlock } from '@sanity/types';
5
5
 
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@devite/nuxt-sanity",
3
- "version": "2.11.2",
3
+ "version": "2.12.1",
4
4
  "configKey": "sanity",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.4",
6
+ "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "unknown"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import { defineNuxtModule, createResolver, addPlugin, addServerHandler, addImpor
3
3
  import defu from 'defu';
4
4
 
5
5
  const name = "@devite/nuxt-sanity";
6
- const version = "2.11.2";
6
+ const version = "2.12.1";
7
7
 
8
8
  const CONFIG_KEY = "sanity";
9
9
  const module = defineNuxtModule({
@@ -169,7 +169,8 @@ const module = defineNuxtModule({
169
169
  // composables
170
170
  { name: "useSanityQuery", from: resolve("runtime/composables/query") },
171
171
  { name: "useLazySanityQuery", from: resolve("runtime/composables/query") },
172
- { name: "useSanityVisualEditingState", from: resolve("runtime/composables/useSanityVisualEditingState") },
172
+ { name: "useSanityVisualEditingState", from: resolve("runtime/composables/visual_editing_state") },
173
+ { name: "useSanitySEO", from: resolve("runtime/composables/sanity_seo") },
173
174
  // helper methods
174
175
  { name: "resolveImageAssetById", from: resolve("runtime/utils/resolveImageAssetById") },
175
176
  { name: "resolveInternalLink", from: resolve("runtime/utils/resolveInternalLink") },
@@ -1,6 +1,6 @@
1
- import { type ClientPerspective, type QueryParams, type SanityClient as SanityClientType } from '@sanity/client';
1
+ import type { ClientPerspective, QueryParams, SanityClient as SanityClientType } from '@sanity/client';
2
2
  import type { ModuleOptions } from '@devite/nuxt-sanity';
3
- import { type QueryStore } from '@sanity/core-loader';
3
+ import type { QueryStore } from '@sanity/core-loader';
4
4
  import { SanityClient } from '#imports';
5
5
  declare class DefaultSanityClient extends SanityClient {
6
6
  readonly client: SanityClientType;
@@ -1,6 +1,4 @@
1
- import {
2
- createClient
3
- } from "@sanity/client";
1
+ import { createClient } from "@sanity/client";
4
2
  import { createQueryStore as createCoreQueryStore } from "@sanity/core-loader";
5
3
  import { SanityClient } from "#imports";
6
4
  class DefaultSanityClient extends SanityClient {
@@ -1,56 +1,50 @@
1
1
  <template>
2
- <component
3
- :is="component"
4
- v-if="data"
5
- ref="componentRef"
6
- v-bind="{ ...$props, ...$attrs }"
7
- >
8
- <template
9
- v-for="(_, slotName) in $slots"
10
- #[slotName]="slotProps"
11
- >
12
- <slot
13
- :name="slotName"
14
- v-bind="slotProps ?? {}"
15
- />
16
- </template>
17
- </component>
2
+ <component
3
+ :is="component"
4
+ v-if="data"
5
+ ref="componentRef"
6
+ v-bind="{ ...$props, ...$attrs }"
7
+ >
8
+ <template
9
+ v-for="(_, slotName) in $slots"
10
+ #[slotName]="slotProps"
11
+ >
12
+ <slot
13
+ :name="slotName"
14
+ v-bind="slotProps ?? {}"
15
+ />
16
+ </template>
17
+ </component>
18
18
  </template>
19
19
 
20
- <script setup lang="ts">
21
- import { type Component, computed, ref, resolveComponent } from 'vue'
22
- import type { SanityModule } from '@devite/nuxt-sanity'
23
- import { SanityImageAsset, SanityLinkExternal, SanityLinkInternal, SanityRichText } from '#components'
24
-
25
- const { data } = defineProps<{ data?: SanityModule | Array<SanityModule> }>()
26
-
27
- const component = computed<Component | null>(() => {
28
- if (Array.isArray(data) && data.every((item) => item._type === 'block')) {
29
- return SanityRichText
20
+ <script setup>
21
+ import { computed, ref, resolveComponent } from "vue";
22
+ import { SanityImageAsset, SanityLinkExternal, SanityLinkInternal, SanityRichText } from "#components";
23
+ const { data } = defineProps({
24
+ data: { type: null, required: false }
25
+ });
26
+ const component = computed(() => {
27
+ if (Array.isArray(data) && data.every((item) => item._type === "block")) {
28
+ return SanityRichText;
30
29
  }
31
-
32
- if (data && typeof data === 'object' && '_type' in data) {
33
- const type = data._type as string
34
-
30
+ if (data && typeof data === "object" && "_type" in data) {
31
+ const type = data._type;
35
32
  switch (type) {
36
- case 'linkInternal':
37
- return SanityLinkInternal
38
- case 'linkExternal':
39
- return SanityLinkExternal
40
- case 'sanity.imageAsset':
41
- return SanityImageAsset
33
+ case "linkInternal":
34
+ return SanityLinkInternal;
35
+ case "linkExternal":
36
+ return SanityLinkExternal;
37
+ case "sanity.imageAsset":
38
+ return SanityImageAsset;
42
39
  default: {
43
- const upperCamelCase = type.charAt(0).toUpperCase() + type.slice(1)
44
- const resolvedComponent = resolveComponent('Sanity' + upperCamelCase)
45
-
46
- return resolvedComponent ? (resolvedComponent as Component) : null
40
+ const upperCamelCase = type.charAt(0).toUpperCase() + type.slice(1);
41
+ const resolvedComponent = resolveComponent("Sanity" + upperCamelCase);
42
+ return resolvedComponent ? resolvedComponent : null;
47
43
  }
48
44
  }
49
45
  }
50
-
51
- return null
52
- })
53
-
54
- const componentRef = ref<Component>()
55
- defineExpose({ componentRef })
46
+ return null;
47
+ });
48
+ const componentRef = ref();
49
+ defineExpose({ componentRef });
56
50
  </script>
@@ -0,0 +1,19 @@
1
+ import type { Component } from 'vue';
2
+ import type { SanityModule } from '@devite/nuxt-sanity';
3
+ type __VLS_Props = {
4
+ data?: SanityModule | Array<SanityModule>;
5
+ };
6
+ declare var __VLS_8: any, __VLS_9: any;
7
+ type __VLS_Slots = {} & {
8
+ [K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
9
+ };
10
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
11
+ componentRef: import("vue").Ref<Component | undefined, Component | undefined>;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -1,45 +1,41 @@
1
1
  <template>
2
- <NuxtImg
3
- v-if="imageAsset?._id"
4
- densities="x1 x2"
5
- :src="imageAsset._id"
6
- :width="imageAsset.metadata.dimensions.width"
7
- :height="imageAsset.metadata.dimensions.height"
8
- :alt="imageAsset.altText as (string | undefined)"
9
- :placeholder="loading === 'eager' || !lqip ? undefined : imageAsset.metadata.lqip"
10
- :loading="loading || 'lazy'"
11
- :format="imageAsset.mimeType === 'image/svg+xml' ? 'svg+xml' : 'webp'"
12
- draggable="false"
13
- provider="cachedSanity"
14
- />
2
+ <NuxtImg
3
+ v-if="imageAsset?._id"
4
+ densities="x1 x2"
5
+ :src="imageAsset._id"
6
+ :sizes="isSvg ? (imageAsset.metadata.dimensions.width ?? 64) + 'px' : sizes"
7
+ :width="imageAsset.metadata.dimensions.width"
8
+ :height="imageAsset.metadata.dimensions.height"
9
+ :alt="imageAsset.altText"
10
+ :placeholder="loading === 'eager' || !lqip ? void 0 : imageAsset.metadata.lqip"
11
+ :loading="loading || 'lazy'"
12
+ :format="isSvg ? 'svg+xml' : 'webp'"
13
+ draggable="false"
14
+ provider="cachedSanity"
15
+ />
15
16
  </template>
16
17
 
17
- <script setup lang="ts">
18
- import type { ImageAsset, Reference } from '@sanity/types'
19
- import { ref, watch } from 'vue'
20
- import { resolveImageAssetById } from '#imports'
21
-
22
- const props = defineProps<{
23
- asset?: ImageAsset | Reference | null
24
- loading?: 'eager' | 'lazy'
25
- lqip?: boolean
26
- }>()
27
- const imageAsset = ref<ImageAsset | null>(null)
28
- let unwatchFunc = undefined as (() => void) | undefined
29
-
18
+ <script setup>
19
+ import { computed, ref, watch } from "vue";
20
+ import { resolveImageAssetById } from "#imports";
21
+ const { asset, lqip } = defineProps({
22
+ asset: { type: [Object, null], required: false },
23
+ sizes: { type: String, required: false },
24
+ loading: { type: String, required: false },
25
+ lqip: { type: Boolean, required: false }
26
+ });
27
+ const imageAsset = ref(null);
28
+ const isSvg = computed(() => imageAsset.value?.mimeType === "image/svg+xml");
29
+ let unwatchFunc = void 0;
30
30
  async function resolveImageAsset() {
31
- if (props.asset?._ref) {
32
- const assetRef = await resolveImageAssetById((props.asset as Reference)._ref, props.lqip || false)
33
-
34
- imageAsset.value = assetRef.value
35
-
36
- unwatchFunc?.()
37
- unwatchFunc = watch(assetRef, (updatedAsset) => imageAsset.value = updatedAsset)
38
- return
31
+ if (asset?._ref) {
32
+ const assetRef = await resolveImageAssetById(asset._ref, lqip || false);
33
+ imageAsset.value = assetRef.value;
34
+ unwatchFunc?.();
35
+ unwatchFunc = watch(assetRef, (updatedAsset) => imageAsset.value = updatedAsset);
36
+ return;
39
37
  }
40
-
41
- imageAsset.value = (props.asset || null) as ImageAsset | null
38
+ imageAsset.value = asset || null;
42
39
  }
43
-
44
- await resolveImageAsset()
40
+ await resolveImageAsset();
45
41
  </script>
@@ -0,0 +1,9 @@
1
+ import type { ImageAsset, Reference } from '@sanity/types';
2
+ type __VLS_Props = {
3
+ asset?: ImageAsset | Reference | null;
4
+ sizes?: string;
5
+ loading?: 'eager' | 'lazy';
6
+ lqip?: boolean;
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -10,8 +10,8 @@
10
10
  </NuxtLink>
11
11
  </template>
12
12
 
13
- <script setup lang="ts">
14
- import type { LinkExternal } from '@devite/nuxt-sanity'
15
-
16
- defineProps<{ data: LinkExternal }>()
13
+ <script setup>
14
+ defineProps({
15
+ data: { type: null, required: true }
16
+ });
17
17
  </script>
@@ -0,0 +1,16 @@
1
+ import type { LinkExternal } from '@devite/nuxt-sanity';
2
+ type __VLS_Props = {
3
+ data: LinkExternal;
4
+ };
5
+ declare var __VLS_6: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_6) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -8,14 +8,10 @@
8
8
  </NuxtLink>
9
9
  </template>
10
10
 
11
- <script setup lang="ts">
12
- import type { Reference } from '@sanity/types'
13
- import type { LinkInternal } from '@devite/nuxt-sanity'
14
- import type { Ref } from 'vue'
15
- import { resolveInternalLink } from '#imports'
16
-
17
- const { data } = defineProps<{ data: LinkInternal | { reference: Reference } }>()
18
- const resolvedLink: Ref<LinkInternal | null> | LinkInternal = 'reference' in data
19
- ? await resolveInternalLink(data.reference)
20
- : data as LinkInternal
11
+ <script setup>
12
+ import { resolveInternalLink } from "#imports";
13
+ const { data } = defineProps({
14
+ data: { type: null, required: true }
15
+ });
16
+ const resolvedLink = "reference" in data ? await resolveInternalLink(data.reference) : data;
21
17
  </script>
@@ -0,0 +1,19 @@
1
+ import type { Reference } from '@sanity/types';
2
+ import type { LinkInternal } from '@devite/nuxt-sanity';
3
+ type __VLS_Props = {
4
+ data: LinkInternal | {
5
+ reference: Reference;
6
+ };
7
+ };
8
+ declare var __VLS_6: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_6) => any;
11
+ };
12
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -1,83 +1,33 @@
1
1
  <template>
2
- <main v-if="sanityData?.modules?.length">
3
- <SanityComponent
4
- v-for="module in sanityData.modules"
5
- :key="module._key"
6
- :data="module"
7
- />
8
- <slot />
9
- </main>
2
+ <main v-if="sanityData?.modules?.length">
3
+ <SanityComponent
4
+ v-for="module in sanityData.modules"
5
+ :key="module._key"
6
+ :data="module"
7
+ />
8
+ <slot />
9
+ </main>
10
10
  </template>
11
11
 
12
- <script setup lang="ts">
13
- import { computed, type ComputedRef } from 'vue'
14
- import type { ImageAsset } from '@sanity/types'
15
- import type { GlobalSEO, Home, NotFound, Page } from '@devite/nuxt-sanity'
16
- import { setResponseStatus } from 'h3'
17
- import { IMAGE_WITHOUT_PREVIEW_PROJECTION, groq, useHead, useRequestEvent, useRoute, useRuntimeConfig, useSanityQuery, useSeoMeta } from '#imports'
18
-
19
- const path = useRoute().path
20
- const groqFilter = path === '/' ? '_type == "home"' : `_type == "page" && slug.current == $slug`
21
- const { data: sanityData } = await useSanityQuery<Home | Page | NotFound>(
12
+ <script setup>
13
+ import { computed } from "vue";
14
+ import { setResponseStatus } from "h3";
15
+ import { groq, IMAGE_WITHOUT_PREVIEW_PROJECTION, useRequestEvent, useRoute, useRuntimeConfig, useSanityQuery, useSanitySEO } from "#imports";
16
+ const path = useRoute().path;
17
+ const groqFilter = path === "/" ? '_type == "home"' : `_type == "page" && slug.current == $slug`;
18
+ const { data: sanityData } = await useSanityQuery(
22
19
  groq`*[(${groqFilter}) || _type == "notFound"][0] { _id, _type, title, modules, seo { _type, indexable, title, shortTitle, description, image ${IMAGE_WITHOUT_PREVIEW_PROJECTION} } }`,
23
- { slug: path.substring(1) },
24
- )
25
-
26
- if (sanityData.value?._type === 'notFound' && import.meta.server) {
27
- const event = useRequestEvent()
28
-
20
+ { slug: path.substring(1) }
21
+ );
22
+ if (sanityData.value?._type === "notFound" && import.meta.server) {
23
+ const event = useRequestEvent();
29
24
  if (event)
30
- setResponseStatus(event, 404)
25
+ setResponseStatus(event, 404);
31
26
  }
32
-
33
- const { baseUrl } = useRuntimeConfig().public
34
- const seo = computed(() => sanityData.value?.seo)
35
- const url = computed(
36
- () =>
37
- ((baseUrl as string) || '')
38
- + ((sanityData.value && ('slug' in sanityData.value ? sanityData.value.slug.current : null)) || '/'),
39
- )
40
-
41
- const { data: globalSEO } = await useSanityQuery<GlobalSEO>(
42
- groq`*[_type == 'settings'][0].seo { siteName, image ${IMAGE_WITHOUT_PREVIEW_PROJECTION} }`,
43
- )
44
- const image: ComputedRef<ImageAsset | undefined> = computed(
45
- () => sanityData.value?.seo.image?.asset || globalSEO.value?.image?.asset,
46
- )
47
- const imageUrl = computed(() => image.value?.url)
48
- const imageDimensions = computed(() => image.value?.metadata.dimensions)
49
- const imageMimeType = computed(() => image.value?.mimeType as 'image/gif' | 'image/jpeg' | 'image/png' | undefined)
50
- const imageAlt = computed(() => image.value?.altText as string | undefined)
51
-
52
- useHead({
53
- meta: [
54
- { name: 'og:url', content: () => url.value },
55
- { name: 'twitter:url', content: () => url.value },
56
- ],
57
- link: [{ rel: 'canonical', href: () => url.value }],
58
- })
59
-
60
- useSeoMeta({
61
- // indexing
62
- robots: () => `${seo.value?.indexable ? '' : 'no'}index,follow`,
63
- // title
64
- title: () => seo.value?.title || '',
65
- ogTitle: () => seo.value?.shortTitle,
66
- twitterTitle: () => seo.value?.shortTitle,
67
- // description
68
- description: () => seo.value?.description,
69
- ogDescription: () => seo.value?.description,
70
- twitterDescription: () => seo.value?.description,
71
- // OpenGraph site name
72
- ogSiteName: () => globalSEO.value?.siteName,
73
- // OpenGraph Image
74
- ogImage: () => imageUrl.value,
75
- ogImageWidth: () => imageDimensions.value?.width,
76
- ogImageHeight: () => imageDimensions.value?.height,
77
- ogImageType: () => imageMimeType.value,
78
- ogImageAlt: () => imageAlt.value,
79
- // Twitter Image
80
- twitterImage: () => imageUrl.value,
81
- twitterImageAlt: () => imageAlt.value,
82
- })
27
+ const { baseUrl } = useRuntimeConfig().public;
28
+ const seo = computed(() => sanityData.value?.seo);
29
+ useSanitySEO(
30
+ (baseUrl || "") + (sanityData.value && ("slug" in sanityData.value ? sanityData.value.slug.current : null) || "/"),
31
+ seo
32
+ );
83
33
  </script>
@@ -0,0 +1,12 @@
1
+ declare var __VLS_5: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_5) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -1,49 +1,45 @@
1
1
  <template>
2
- <NuxtPicture
3
- v-if="imageAsset?._id"
4
- densities="x1 x2"
5
- :src="imageAsset._id"
6
- :width="imageAsset.metadata.dimensions.width"
7
- :height="imageAsset.metadata.dimensions.height"
8
- :alt="imageAsset.altText as (string | undefined)"
9
- :placeholder="loading === 'eager' || !lqip ? undefined : imageAsset.metadata.lqip"
10
- :loading="loading || 'lazy'"
11
- :format="imageAsset.mimeType === 'image/svg+xml' ? 'svg+xml' : 'webp'"
12
- legacy-format="png"
13
- :img-attrs="{ ...imgAttrs, draggable: false }"
14
- provider="cachedSanity"
15
- >
16
- <slot />
17
- </NuxtPicture>
2
+ <NuxtPicture
3
+ v-if="imageAsset?._id"
4
+ densities="x1 x2"
5
+ :src="imageAsset._id"
6
+ :sizes="isSvg ? (imageAsset.metadata.dimensions.width ?? 64) + 'px' : sizes"
7
+ :width="imageAsset.metadata.dimensions.width"
8
+ :height="imageAsset.metadata.dimensions.height"
9
+ :alt="imageAsset.altText"
10
+ :placeholder="loading === 'eager' || !lqip ? void 0 : imageAsset.metadata.lqip"
11
+ :loading="loading || 'lazy'"
12
+ :format="isSvg ? 'svg+xml' : 'webp'"
13
+ legacy-format="png"
14
+ :img-attrs="{ ...imgAttrs, draggable: false }"
15
+ provider="cachedSanity"
16
+ >
17
+ <slot />
18
+ </NuxtPicture>
18
19
  </template>
19
20
 
20
- <script setup lang="ts">
21
- import type { ImageAsset, Reference } from '@sanity/types'
22
- import { ref, watch } from 'vue'
23
- import { resolveImageAssetById } from '#imports'
24
-
25
- const props = defineProps<{
26
- asset?: ImageAsset | Reference | null
27
- loading?: 'eager' | 'lazy'
28
- lqip?: boolean
29
- imgAttrs?: Record<string, unknown>
30
- }>()
31
- const imageAsset = ref<ImageAsset | null>(null)
32
- let unwatchFunc = undefined as (() => void) | undefined
33
-
21
+ <script setup>
22
+ import { computed, ref, watch } from "vue";
23
+ import { resolveImageAssetById } from "#imports";
24
+ const { asset } = defineProps({
25
+ asset: { type: [Object, null], required: false },
26
+ sizes: { type: String, required: false },
27
+ loading: { type: String, required: false },
28
+ lqip: { type: Boolean, required: false },
29
+ imgAttrs: { type: Object, required: false }
30
+ });
31
+ const imageAsset = ref(null);
32
+ const isSvg = computed(() => imageAsset.value?.mimeType === "image/svg+xml");
33
+ let unwatchFunc = void 0;
34
34
  async function resolveImageAsset() {
35
- if (props.asset?._ref) {
36
- const assetRef = await resolveImageAssetById((props.asset as Reference)._ref, false)
37
-
38
- imageAsset.value = assetRef.value
39
-
40
- unwatchFunc?.()
41
- unwatchFunc = watch(assetRef, (updatedAsset) => imageAsset.value = updatedAsset)
42
- return
35
+ if (asset?._ref) {
36
+ const assetRef = await resolveImageAssetById(asset._ref, false);
37
+ imageAsset.value = assetRef.value;
38
+ unwatchFunc?.();
39
+ unwatchFunc = watch(assetRef, (updatedAsset) => imageAsset.value = updatedAsset);
40
+ return;
43
41
  }
44
-
45
- imageAsset.value = (props.asset || null) as ImageAsset | null
42
+ imageAsset.value = asset || null;
46
43
  }
47
-
48
- await resolveImageAsset()
44
+ await resolveImageAsset();
49
45
  </script>
@@ -0,0 +1,20 @@
1
+ import type { ImageAsset, Reference } from '@sanity/types';
2
+ type __VLS_Props = {
3
+ asset?: ImageAsset | Reference | null;
4
+ sizes?: string;
5
+ loading?: 'eager' | 'lazy';
6
+ lqip?: boolean;
7
+ imgAttrs?: Record<string, unknown>;
8
+ };
9
+ declare var __VLS_6: {};
10
+ type __VLS_Slots = {} & {
11
+ default?: (props: typeof __VLS_6) => any;
12
+ };
13
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -1,52 +1,47 @@
1
1
  <template>
2
- <PortableText
3
- :value="currentData"
4
- :components="richTextSerializer"
5
- />
2
+ <PortableText
3
+ :value="currentData"
4
+ :components="richTextSerializer"
5
+ />
6
6
  </template>
7
7
 
8
- <script setup lang="ts">
9
- import { PortableText, type PortableTextComponents } from '@portabletext/vue'
10
- import type { PortableTextChild, PortableTextSpan } from '@sanity/types'
11
- import type { RichText } from '@devite/nuxt-sanity'
12
- import { computed, h } from 'vue'
13
- import { SanityLinkExternal, SanityLinkInternal } from '#components'
14
-
15
- const props = defineProps<{ data: RichText, placeholders?: Record<string, string> }>()
8
+ <script setup>
9
+ import { PortableText } from "@portabletext/vue";
10
+ import { computed, h } from "vue";
11
+ import { SanityLinkExternal, SanityLinkInternal } from "#components";
12
+ const props = defineProps({
13
+ data: { type: null, required: true },
14
+ placeholders: { type: Object, required: false }
15
+ });
16
16
  const currentData = computed(() => {
17
17
  return props.data.map((block) => {
18
18
  return {
19
19
  ...block,
20
- children: replaceChildren(block.children as PortableTextChild[]),
21
- }
22
- })
23
- })
24
-
25
- function replaceChildren(children: PortableTextChild[]): PortableTextChild[] {
20
+ children: replaceChildren(block.children)
21
+ };
22
+ });
23
+ });
24
+ function replaceChildren(children) {
26
25
  return children.map((child) => {
27
- if (child._type === 'span') {
26
+ if (child._type === "span") {
28
27
  return {
29
28
  ...child,
30
- text: replacePlaceholders((child as PortableTextSpan).text),
31
- }
29
+ text: replacePlaceholders(child.text)
30
+ };
32
31
  }
33
-
34
- return child
35
- })
32
+ return child;
33
+ });
36
34
  }
37
-
38
- function replacePlaceholders(text: string) {
35
+ function replacePlaceholders(text) {
39
36
  return text.replace(/\{\{(.*?)}}/g, (match, key) => {
40
- if (!props.placeholders || !Object.prototype.hasOwnProperty.call(props.placeholders, key)) return match
41
-
42
- return props.placeholders[key]
43
- })
37
+ if (!props.placeholders || !Object.prototype.hasOwnProperty.call(props.placeholders, key)) return match;
38
+ return props.placeholders[key];
39
+ });
44
40
  }
45
-
46
- const richTextSerializer: PortableTextComponents = {
41
+ const richTextSerializer = {
47
42
  marks: {
48
43
  linkExternal: ({ value }, { slots }) => h(SanityLinkExternal, { data: value }, slots.default),
49
- linkInternal: ({ value }, { slots }) => h(SanityLinkInternal, { data: value }, slots.default),
50
- },
51
- }
44
+ linkInternal: ({ value }, { slots }) => h(SanityLinkInternal, { data: value }, slots.default)
45
+ }
46
+ };
52
47
  </script>
@@ -0,0 +1,7 @@
1
+ import type { RichText } from '@devite/nuxt-sanity';
2
+ type __VLS_Props = {
3
+ data: RichText;
4
+ placeholders?: Record<string, string>;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import type { AsyncDataOptions, AsyncDataRequestStatus } from 'nuxt/app';
2
2
  import type { ContentSourceMap, QueryParams } from '@sanity/client';
3
3
  import type { EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
4
- import { type Ref } from 'vue';
4
+ import type { Ref } from 'vue';
5
5
  export interface UseSanityQueryOptions<T> extends AsyncDataOptions<T> {
6
6
  client?: 'default' | 'minimal';
7
7
  perspective?: 'drafts' | 'published' | 'raw';
@@ -3,7 +3,7 @@ import { useAsyncData, useLazyAsyncData } from "nuxt/app";
3
3
  import { reactive, ref } from "vue";
4
4
  import defu from "defu";
5
5
  import useSanityClient from "../utils/useSanityClient.js";
6
- import { useSanityVisualEditingState } from "./useSanityVisualEditingState.js";
6
+ import { useSanityVisualEditingState } from "./visual_editing_state.js";
7
7
  import { useRuntimeConfig } from "#imports";
8
8
  export function useLazySanityQuery(query, params = {}, options = {}) {
9
9
  return useSanityQuery(query, params, options, true);
@@ -0,0 +1,3 @@
1
+ import type { SEO } from '@devite/nuxt-sanity';
2
+ import type { Ref } from 'vue';
3
+ export declare const useSanitySEO: (url: string, seo: Ref<SEO | undefined>) => void;
@@ -0,0 +1,46 @@
1
+ import { computed } from "vue";
2
+ import { groq, IMAGE_WITHOUT_PREVIEW_PROJECTION, useHead, useSanityQuery, useSeoMeta } from "#imports";
3
+ export const useSanitySEO = (url, seo) => {
4
+ const { data: globalSEO } = useSanityQuery(
5
+ groq`*[_type == 'settings'][0].seo { siteName, image ${IMAGE_WITHOUT_PREVIEW_PROJECTION} }`
6
+ );
7
+ const image = computed(
8
+ () => seo.value?.image?.asset ?? globalSEO.value?.image?.asset
9
+ );
10
+ const imageUrl = computed(() => image.value?.url);
11
+ const imageDimensions = computed(() => image.value?.metadata.dimensions);
12
+ const imageMimeType = computed(
13
+ () => image.value?.mimeType
14
+ );
15
+ const imageAlt = computed(() => image.value?.altText);
16
+ useHead({
17
+ meta: [
18
+ { name: "og:url", content: () => url },
19
+ { name: "twitter:url", content: () => url }
20
+ ],
21
+ link: [{ rel: "canonical", href: () => url }]
22
+ });
23
+ useSeoMeta({
24
+ // indexing
25
+ robots: () => (seo.value?.indexable ? "" : "no") + `index,follow`,
26
+ // title
27
+ title: () => seo.value?.title ?? "",
28
+ ogTitle: () => seo.value?.shortTitle,
29
+ twitterTitle: () => seo.value?.shortTitle,
30
+ // description
31
+ description: () => seo.value?.description,
32
+ ogDescription: () => seo.value?.description,
33
+ twitterDescription: () => seo.value?.description,
34
+ // OpenGraph site name
35
+ ogSiteName: () => globalSEO.value?.siteName,
36
+ // OpenGraph Image
37
+ ogImage: () => imageUrl.value,
38
+ ogImageWidth: () => imageDimensions.value?.width,
39
+ ogImageHeight: () => imageDimensions.value?.height,
40
+ ogImageType: () => imageMimeType.value,
41
+ ogImageAlt: () => imageAlt.value,
42
+ // Twitter Image
43
+ twitterImage: () => imageUrl.value,
44
+ twitterImageAlt: () => imageAlt.value
45
+ });
46
+ };
@@ -1,4 +1,4 @@
1
1
  export declare const useSanityVisualEditingState: () => {
2
- enabled: boolean;
2
+ enabled: any;
3
3
  isInFrame: () => boolean | undefined;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { useSanityVisualEditingState } from "../composables/useSanityVisualEditingState.js";
1
+ import { useSanityVisualEditingState } from "../composables/visual_editing_state.js";
2
2
  import { getImage as getSanityImage } from "#image/providers/sanity";
3
3
  export function getImage(src, { modifiers = {}, projectId, dataset, cacheEndpoint }, context) {
4
4
  modifiers.format = modifiers.format === "svg+xml" ? void 0 : modifiers.format;
@@ -1,2 +1,2 @@
1
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- import { useSanityVisualEditingState } from "../composables/useSanityVisualEditingState.js";
1
+ import { useSanityVisualEditingState } from "../composables/visual_editing_state.js";
2
2
  import useSanityClient from "../utils/useSanityClient.js";
3
3
  import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
4
4
  export default defineNuxtPlugin(() => {
@@ -1,2 +1,2 @@
1
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -1,9 +1,9 @@
1
- import { useSanityVisualEditingState } from "../composables/useSanityVisualEditingState.js";
1
+ import { useSanityVisualEditingState } from "../composables/visual_editing_state.js";
2
2
  import { defineNuxtPlugin, useCookie, useRuntimeConfig } from "#imports";
3
3
  export default defineNuxtPlugin(() => {
4
4
  const visualEditingState = useSanityVisualEditingState();
5
5
  const $config = useRuntimeConfig();
6
- const previewModeId = $config.sanity.visualEditing.previewModeId;
6
+ const previewModeId = $config.sanity.visualEditing?.previewModeId;
7
7
  if ($config.public.sanity.visualEditing?.previewMode && previewModeId) {
8
8
  const previewModeCookie = useCookie("__sanity_preview");
9
9
  visualEditingState.enabled = previewModeId === previewModeCookie.value;
@@ -41,7 +41,10 @@ export default defineEventHandler(async (event) => {
41
41
  const assetId = src.split("/").pop();
42
42
  if (assetId) {
43
43
  const sanityDocumentDeps = useStorage("sanityDocumentDeps");
44
- const documentDeps = await sanityDocumentDeps.getItem(assetId) || [];
44
+ let documentDeps = await sanityDocumentDeps.getItem(assetId);
45
+ if (!documentDeps || !Array.isArray(documentDeps)) {
46
+ documentDeps = [];
47
+ }
45
48
  documentDeps.push(hashedPath);
46
49
  await sanityDocumentDeps.setItem(assetId, documentDeps);
47
50
  if (import.meta.dev) {
@@ -51,7 +51,10 @@ export default defineEventHandler(async (event) => {
51
51
  await Promise.all(referencedIds.map((ref) => new Promise((resolve) => {
52
52
  const id = ref.split('"')[3];
53
53
  sanityDocumentDeps.getItem(id).then((deps) => {
54
- const documentDeps = deps || [];
54
+ let documentDeps = deps;
55
+ if (!documentDeps || !Array.isArray(documentDeps)) {
56
+ documentDeps = [];
57
+ }
55
58
  documentDeps.push(hashedQuery);
56
59
  sanityDocumentDeps.setItem(id, documentDeps).then(resolve);
57
60
  });
@@ -1,5 +1,5 @@
1
1
  import type { ClientPerspective, ContentSourceMap, QueryParams } from '@sanity/client';
2
2
  import type { Reactive } from 'vue';
3
- import { type EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
3
+ import type { EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
4
4
  import type { SanityClient } from '#imports';
5
5
  export declare function fetchSanityData<T>(query: string, params: Reactive<QueryParams> | undefined, client: SanityClient, perspective: ClientPerspective, callback: (data: T | null, sourceMap?: ContentSourceMap, encodeDataAttribute?: EncodeDataAttributeFunction) => void): Promise<void>;
package/dist/types.d.mts CHANGED
@@ -1,7 +1,3 @@
1
- import type { NuxtModule } from '@nuxt/schema'
1
+ export { default } from './module.mjs'
2
2
 
3
- import type { default as Module } from './module.js'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { default } from './module.js'
3
+ export { type GlobalSEO, type Home, type LinkExternal, type LinkInternal, type ModuleOptions, type NotFound, type Page, type RichText, type SEO, type SanityArray, type SanityModule, type SanityVisualEditingMode, type SanityVisualEditingRefreshHandler, type VisualEditingOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/nuxt-sanity",
3
- "version": "2.11.2",
3
+ "version": "2.12.1",
4
4
  "description": "Advanced Sanity integration for Nuxt.js.",
5
5
  "repository": "devite-io/nuxt-sanity",
6
6
  "license": "MIT",
@@ -29,34 +29,34 @@
29
29
  "dependencies": {
30
30
  "@nuxt/image": "^1.10.0",
31
31
  "@portabletext/vue": "^1.0.12",
32
- "@sanity/client": "^6.29.0",
33
- "@sanity/core-loader": "^1.8.5",
34
- "@sanity/preview-url-secret": "^2.1.8",
35
- "@sanity/types": "^3.86.0",
36
- "@sanity/visual-editing": "^2.13.18",
32
+ "@sanity/client": "^7.6.0",
33
+ "@sanity/core-loader": "^1.8.10",
34
+ "@sanity/preview-url-secret": "^2.1.11",
35
+ "@sanity/types": "^3.96.0",
36
+ "@sanity/visual-editing": "^2.15.0",
37
37
  "defu": "^6.1.4",
38
38
  "ofetch": "^1.4.1",
39
39
  "ohash": "^1.1.6",
40
- "unstorage": "^1.15.0"
40
+ "unstorage": "^1.16.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@nuxt/eslint-config": "^0.7.6",
44
- "@nuxt/kit": "^3.16.2",
45
- "@nuxt/module-builder": "^0.8.4",
46
- "@nuxt/schema": "^3.16.2",
47
- "@nuxt/test-utils": "^3.17.2",
43
+ "@nuxt/eslint-config": "^1.5.2",
44
+ "@nuxt/kit": "^3.17.6",
45
+ "@nuxt/module-builder": "^1.0.1",
46
+ "@nuxt/schema": "^3.17.6",
47
+ "@nuxt/test-utils": "^3.19.2",
48
48
  "@types/node": "latest",
49
- "changelogen": "^0.5.7",
50
- "eslint": "^9.25.1",
51
- "h3": "^1.15.1",
52
- "nuxt": "^3.16.2",
53
- "typescript": "5.6.3",
54
- "vite": "6.0.1",
55
- "vitest": "^2.1.9",
49
+ "changelogen": "^0.6.1",
50
+ "eslint": "^9.30.1",
51
+ "h3": "^1.15.3",
52
+ "nuxt": "^3.17.6",
53
+ "typescript": "5.8.3",
54
+ "vite": "6.3.5",
55
+ "vitest": "^3.2.4",
56
56
  "vitest-environment-nuxt": "1.0.1",
57
57
  "vue": "3.5.13",
58
- "vue-router": "^4.5.0",
59
- "vue-tsc": "^2.2.10"
58
+ "vue-router": "^4.5.1",
59
+ "vue-tsc": "^2.2.12"
60
60
  },
61
61
  "resolutions": {
62
62
  "@devite/nuxt-sanity": "link:."
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
package/dist/module.d.ts DELETED
@@ -1,126 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
- import { VisualEditingOptions as VisualEditingOptions$1, HistoryRefresh } from '@sanity/visual-editing';
3
- import { ClientConfig } from '@sanity/client';
4
- import { Slug, ImageAsset, PortableTextBlock } from '@sanity/types';
5
-
6
- type ModuleOptions = ClientConfig & {
7
- projectId?: string;
8
- /** @default "production" */
9
- dataset?: string;
10
- /** @default { cachingEnabled: true, cacheBaseUrl: "http://localhost:3000", assetEndpoint: "/_sanity/cache/asset", queryEndpoint: "/_sanity/cache/query", webhookEndpoint: "/_sanity/cache/invalidate" } */
11
- minimalClient?: boolean | {
12
- cachingEnabled?: boolean;
13
- /**
14
- * This is the base url for fetching data after hydration
15
- * @default 'http://localhost:3000'
16
- */
17
- cacheClientBaseUrl?: string;
18
- /**
19
- * This is the base url for fetching data during SSR
20
- * @default 'http://localhost:3000'
21
- */
22
- cacheServerBaseUrl?: string;
23
- assetEndpoint?: string;
24
- queryEndpoint?: string;
25
- webhookEndpoint?: string;
26
- webhookSecret?: string;
27
- };
28
- /** @default true */
29
- useCdn?: boolean;
30
- /** @default "2024-08-08" */
31
- apiVersion?: string;
32
- visualEditing?: VisualEditingOptions;
33
- };
34
- interface VisualEditingOptions {
35
- /** @default { enableEndpoint: "/_sanity/preview/enable", disableEndpoint: "/_sanity/preview/disable" } */
36
- previewMode?: boolean | {
37
- enableEndpoint?: string;
38
- disableEndpoint?: string;
39
- };
40
- previewModeId?: string;
41
- /** @default "live-visual-editing" */
42
- mode?: SanityVisualEditingMode;
43
- /** @default "/_sanity/fetch" */
44
- proxyEndpoint?: string;
45
- token?: string;
46
- studioUrl?: string;
47
- /** @default true */
48
- stega?: boolean;
49
- /** This function is only required if `mode` is set to 'visual-editing' */
50
- refresh?: SanityVisualEditingRefreshHandler;
51
- /** @default 100 */
52
- zIndex?: VisualEditingOptions$1['zIndex'];
53
- }
54
- type SanityVisualEditingMode = 'live-visual-editing' | 'visual-editing' | 'custom';
55
- type SanityVisualEditingRefreshHandler = (payload: HistoryRefresh, refreshDefault: () => false | Promise<void>) => false | Promise<void>;
56
-
57
- interface Page {
58
- _id: string;
59
- _type: 'page';
60
- title: string;
61
- slug: Slug;
62
- modules: SanityArray<SanityModule>;
63
- seo: SEO;
64
- }
65
-
66
- interface GlobalSEO {
67
- siteName: string;
68
- image: {
69
- asset: ImageAsset;
70
- };
71
- }
72
-
73
- interface LinkExternal {
74
- _type: 'linkExternal';
75
- url: string;
76
- newWindow: boolean;
77
- linkTitle?: string;
78
- relationship?: string;
79
- }
80
-
81
- interface LinkInternal {
82
- _type: 'linkInternal';
83
- slug: string;
84
- linkTitle?: string;
85
- relationship?: string;
86
- }
87
-
88
- interface SEO {
89
- _type: 'seo';
90
- indexable: boolean;
91
- priority: number;
92
- changeFreq: 'always' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
93
- title: string;
94
- shortTitle: string;
95
- description: string;
96
- image?: {
97
- asset: ImageAsset;
98
- };
99
- }
100
-
101
- type RichText = PortableTextBlock[];
102
-
103
- interface Home {
104
- _type: 'home';
105
- modules: SanityArray<SanityModule>;
106
- seo: SEO;
107
- }
108
-
109
- interface NotFound {
110
- _type: 'notFound';
111
- modules: SanityArray<SanityModule>;
112
- seo: SEO;
113
- }
114
-
115
- type SanityModule = {
116
- _type?: string;
117
- };
118
-
119
- type SanityArray<T> = Array<T & {
120
- _key: string;
121
- }>;
122
-
123
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
124
-
125
- export { _default as default };
126
- export type { GlobalSEO, Home, LinkExternal, LinkInternal, ModuleOptions, NotFound, Page, RichText, SEO, SanityArray, SanityModule, SanityVisualEditingMode, SanityVisualEditingRefreshHandler, VisualEditingOptions };
package/dist/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { default } from './module'