@devite/nuxt-sanity 2.11.2 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +1 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +3 -2
- package/dist/runtime/components/SanityComponent.vue +24 -30
- package/dist/runtime/components/SanityComponent.vue.d.ts +19 -0
- package/dist/runtime/components/SanityImageAsset.vue +34 -38
- package/dist/runtime/components/SanityImageAsset.vue.d.ts +9 -0
- package/dist/runtime/components/SanityLinkExternal.vue +4 -4
- package/dist/runtime/components/SanityLinkExternal.vue.d.ts +16 -0
- package/dist/runtime/components/SanityLinkInternal.vue +6 -10
- package/dist/runtime/components/SanityLinkInternal.vue.d.ts +19 -0
- package/dist/runtime/components/SanityPage.vue +26 -76
- package/dist/runtime/components/SanityPage.vue.d.ts +12 -0
- package/dist/runtime/components/SanityPictureAsset.vue +38 -42
- package/dist/runtime/components/SanityPictureAsset.vue.d.ts +20 -0
- package/dist/runtime/components/SanityRichText.vue +26 -31
- package/dist/runtime/components/SanityRichText.vue.d.ts +7 -0
- package/dist/runtime/composables/query.js +1 -1
- package/dist/runtime/composables/sanity_seo.d.ts +3 -0
- package/dist/runtime/composables/sanity_seo.js +46 -0
- package/dist/runtime/imageProviders/sanity.js +1 -1
- package/dist/runtime/plugins/visual-editing.client.js +1 -1
- package/dist/runtime/plugins/visual-editing.server.js +2 -2
- package/dist/types.d.mts +2 -6
- package/package.json +20 -20
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -126
- package/dist/types.d.ts +0 -7
- /package/dist/runtime/composables/{useSanityVisualEditingState.d.ts → visual_editing_state.d.ts} +0 -0
- /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
|
|
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
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.
|
|
6
|
+
const version = "2.12.0";
|
|
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/
|
|
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") },
|
|
@@ -17,40 +17,34 @@
|
|
|
17
17
|
</component>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
|
-
<script setup
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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
|
|
37
|
-
return SanityLinkInternal
|
|
38
|
-
case
|
|
39
|
-
return SanityLinkExternal
|
|
40
|
-
case
|
|
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(
|
|
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
|
-
|
|
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
|
-
:
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
let unwatchFunc =
|
|
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 (
|
|
32
|
-
const assetRef = await resolveImageAssetById(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
13
|
-
import { computed
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
:
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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="imageAsset.mimeType === 'image/svg+xml' ? '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
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
let unwatchFunc =
|
|
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 (
|
|
36
|
-
const assetRef = await resolveImageAssetById(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
+
};
|
|
@@ -5,48 +5,43 @@
|
|
|
5
5
|
/>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
|
-
<script setup
|
|
9
|
-
import { PortableText
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
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 ===
|
|
26
|
+
if (child._type === "span") {
|
|
28
27
|
return {
|
|
29
28
|
...child,
|
|
30
|
-
text: replacePlaceholders(
|
|
31
|
-
}
|
|
29
|
+
text: replacePlaceholders(child.text)
|
|
30
|
+
};
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -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 "./
|
|
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,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
|
-
import { useSanityVisualEditingState } from "../composables/
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { useSanityVisualEditingState } from "../composables/
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import { useSanityVisualEditingState } from "../composables/
|
|
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
|
|
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;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from './module.mjs'
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Advanced Sanity integration for Nuxt.js.",
|
|
5
5
|
"repository": "devite-io/nuxt-sanity",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,33 +29,33 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nuxt/image": "^1.10.0",
|
|
31
31
|
"@portabletext/vue": "^1.0.12",
|
|
32
|
-
"@sanity/client": "^
|
|
33
|
-
"@sanity/core-loader": "^1.8.
|
|
34
|
-
"@sanity/preview-url-secret": "^2.1.
|
|
35
|
-
"@sanity/types": "^3.
|
|
36
|
-
"@sanity/visual-editing": "^2.13.
|
|
32
|
+
"@sanity/client": "^7.2.1",
|
|
33
|
+
"@sanity/core-loader": "^1.8.8",
|
|
34
|
+
"@sanity/preview-url-secret": "^2.1.11",
|
|
35
|
+
"@sanity/types": "^3.88.2",
|
|
36
|
+
"@sanity/visual-editing": "^2.13.21",
|
|
37
37
|
"defu": "^6.1.4",
|
|
38
38
|
"ofetch": "^1.4.1",
|
|
39
39
|
"ohash": "^1.1.6",
|
|
40
|
-
"unstorage": "^1.
|
|
40
|
+
"unstorage": "^1.16.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@nuxt/eslint-config": "^
|
|
44
|
-
"@nuxt/kit": "^3.
|
|
45
|
-
"@nuxt/module-builder": "^0.
|
|
46
|
-
"@nuxt/schema": "^3.
|
|
47
|
-
"@nuxt/test-utils": "^3.
|
|
43
|
+
"@nuxt/eslint-config": "^1.3.0",
|
|
44
|
+
"@nuxt/kit": "^3.17.2",
|
|
45
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
46
|
+
"@nuxt/schema": "^3.17.2",
|
|
47
|
+
"@nuxt/test-utils": "^3.18.0",
|
|
48
48
|
"@types/node": "latest",
|
|
49
|
-
"changelogen": "^0.
|
|
50
|
-
"eslint": "^9.
|
|
51
|
-
"h3": "^1.15.
|
|
52
|
-
"nuxt": "^3.
|
|
53
|
-
"typescript": "5.
|
|
54
|
-
"vite": "6.
|
|
55
|
-
"vitest": "^
|
|
49
|
+
"changelogen": "^0.6.1",
|
|
50
|
+
"eslint": "^9.26.0",
|
|
51
|
+
"h3": "^1.15.3",
|
|
52
|
+
"nuxt": "^3.17.2",
|
|
53
|
+
"typescript": "5.8.3",
|
|
54
|
+
"vite": "6.3.5",
|
|
55
|
+
"vitest": "^3.1.3",
|
|
56
56
|
"vitest-environment-nuxt": "1.0.1",
|
|
57
57
|
"vue": "3.5.13",
|
|
58
|
-
"vue-router": "^4.5.
|
|
58
|
+
"vue-router": "^4.5.1",
|
|
59
59
|
"vue-tsc": "^2.2.10"
|
|
60
60
|
},
|
|
61
61
|
"resolutions": {
|
package/dist/module.cjs
DELETED
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
/package/dist/runtime/composables/{useSanityVisualEditingState.d.ts → visual_editing_state.d.ts}
RENAMED
|
File without changes
|
/package/dist/runtime/composables/{useSanityVisualEditingState.js → visual_editing_state.js}
RENAMED
|
File without changes
|