sanity-plugin-seofields 1.8.0 → 1.9.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/README.md +437 -26
- package/dist/SeoHealthTool-2COI27KI.cjs +8 -0
- package/dist/SeoHealthTool-2COI27KI.cjs.map +1 -0
- package/dist/SeoHealthTool-CWI3KB2V.js +8 -0
- package/dist/SeoHealthTool-CWI3KB2V.js.map +1 -0
- package/dist/{SeoPreview-3EXR6FD4.cjs → SeoPreview-LMZAWWOE.cjs} +35 -38
- package/dist/SeoPreview-LMZAWWOE.cjs.map +1 -0
- package/dist/{SeoPreview-4PPAF4NO.js → SeoPreview-UNQBKTQO.js} +14 -11
- package/dist/SeoPreview-UNQBKTQO.js.map +1 -0
- package/dist/chunk-3OK3S2F7.cjs +673 -0
- package/dist/chunk-3OK3S2F7.cjs.map +1 -0
- package/dist/{chunk-B5IVI5LP.cjs → chunk-5XTQRILL.cjs} +286 -236
- package/dist/chunk-5XTQRILL.cjs.map +1 -0
- package/dist/{chunk-254YHUN3.cjs → chunk-7N4MLTMR.js} +8 -6
- package/dist/chunk-7N4MLTMR.js.map +1 -0
- package/dist/{chunk-DDAAVRWG.js → chunk-A57XNQC7.cjs} +9 -4
- package/dist/chunk-A57XNQC7.cjs.map +1 -0
- package/dist/chunk-BWLJDK5J.js +624 -0
- package/dist/chunk-BWLJDK5J.js.map +1 -0
- package/dist/chunk-FUUWBQE2.cjs +195 -0
- package/dist/chunk-FUUWBQE2.cjs.map +1 -0
- package/dist/{chunk-ZBHLMQTS.cjs → chunk-HHO2AKAP.js} +44 -17
- package/dist/chunk-HHO2AKAP.js.map +1 -0
- package/dist/chunk-KIEO6QG3.js +195 -0
- package/dist/chunk-KIEO6QG3.js.map +1 -0
- package/dist/chunk-R2U7JF7U.cjs +624 -0
- package/dist/chunk-R2U7JF7U.cjs.map +1 -0
- package/dist/{chunk-VR44E62I.js → chunk-XZKQWV2H.js} +204 -33
- package/dist/chunk-XZKQWV2H.js.map +1 -0
- package/dist/{chunk-HDZZQCH7.js → chunk-Y46ACXM4.cjs} +45 -5
- package/dist/chunk-Y46ACXM4.cjs.map +1 -0
- package/dist/chunk-Z5AOUU4H.js +673 -0
- package/dist/chunk-Z5AOUU4H.js.map +1 -0
- package/dist/cli.js +27 -27
- package/dist/{component-DEXwtemT.d.ts → component-CjT1hvxh.d.ts} +2 -2
- package/dist/{component-BzI-LHPw.d.cts → component-WYh0z8as.d.cts} +2 -2
- package/dist/define-cli.cjs +2 -4
- package/dist/define-cli.cjs.map +1 -1
- package/dist/define-cli.js +4 -4
- package/dist/define-cli.js.map +1 -1
- package/dist/head.cjs +14 -0
- package/dist/head.cjs.map +1 -0
- package/dist/head.d.cts +254 -0
- package/dist/head.d.ts +254 -0
- package/dist/head.js +14 -0
- package/dist/head.js.map +1 -0
- package/dist/index.cjs +978 -367
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -374
- package/dist/index.d.ts +6 -374
- package/dist/index.js +920 -286
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +204 -455
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +8 -206
- package/dist/next.d.ts +8 -206
- package/dist/next.js +181 -111
- package/dist/next.js.map +1 -1
- package/dist/plugin-DQdThyxG.d.ts +449 -0
- package/dist/plugin-DoGeZP79.d.cts +449 -0
- package/dist/schema/next.cjs +173 -327
- package/dist/schema/next.cjs.map +1 -1
- package/dist/schema/next.d.cts +4 -4
- package/dist/schema/next.d.ts +4 -4
- package/dist/schema/next.js +172 -8
- package/dist/schema/next.js.map +1 -1
- package/dist/schema.cjs +376 -517
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +5 -5
- package/dist/schema.d.ts +5 -5
- package/dist/schema.js +216 -11
- package/dist/schema.js.map +1 -1
- package/dist/server.cjs +149 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +102 -0
- package/dist/server.d.ts +102 -0
- package/dist/server.js +149 -0
- package/dist/server.js.map +1 -0
- package/dist/{types-CW8qFdAn.d.ts → types-BAdN1RMu.d.ts} +2 -2
- package/dist/{types-B_vjMPtM.d.cts → types-C5i3KMgs.d.cts} +2 -2
- package/dist/{types-BXSCbl6p.d.cts → types-DP-DiW6f.d.cts} +2 -2
- package/dist/{types-C19cQx5D.d.ts → types-DRLUGLtX.d.ts} +2 -2
- package/dist/{types-yVmQfby9.d.cts → types-DxlPXihz.d.cts} +1 -1
- package/dist/{types-yVmQfby9.d.ts → types-DxlPXihz.d.ts} +1 -1
- package/package.json +25 -4
- package/dist/SeoHealthDashboard-AEKVVMUR-7NWV3C3Y.js +0 -4
- package/dist/SeoHealthDashboard-AEKVVMUR-7NWV3C3Y.js.map +0 -1
- package/dist/SeoHealthDashboard-AEKVVMUR-XWKJUH24.cjs +0 -10
- package/dist/SeoHealthDashboard-AEKVVMUR-XWKJUH24.cjs.map +0 -1
- package/dist/SeoHealthTool-2KKQJLJL.cjs +0 -11
- package/dist/SeoHealthTool-2KKQJLJL.cjs.map +0 -1
- package/dist/SeoHealthTool-3CUKGADZ.js +0 -5
- package/dist/SeoHealthTool-3CUKGADZ.js.map +0 -1
- package/dist/SeoPreview-3EXR6FD4.cjs.map +0 -1
- package/dist/SeoPreview-4PPAF4NO.js.map +0 -1
- package/dist/chunk-254YHUN3.cjs.map +0 -1
- package/dist/chunk-27XSYENH.js +0 -2215
- package/dist/chunk-27XSYENH.js.map +0 -1
- package/dist/chunk-B5IVI5LP.cjs.map +0 -1
- package/dist/chunk-BNXMFD3T.cjs +0 -431
- package/dist/chunk-BNXMFD3T.cjs.map +0 -1
- package/dist/chunk-DDAAVRWG.js.map +0 -1
- package/dist/chunk-HDZZQCH7.js.map +0 -1
- package/dist/chunk-P6IOWIO2.cjs +0 -480
- package/dist/chunk-P6IOWIO2.cjs.map +0 -1
- package/dist/chunk-UOCZFYYP.js +0 -407
- package/dist/chunk-UOCZFYYP.js.map +0 -1
- package/dist/chunk-VR44E62I.js.map +0 -1
- package/dist/chunk-WKXHX3GO.js +0 -424
- package/dist/chunk-WKXHX3GO.js.map +0 -1
- package/dist/chunk-XZDLJ2N6.cjs +0 -2224
- package/dist/chunk-XZDLJ2N6.cjs.map +0 -1
- package/dist/chunk-ZBHLMQTS.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,380 +1,12 @@
|
|
|
1
|
+
import { S as SeoFieldsPluginConfig, s as seofields } from './plugin-DQdThyxG.js';
|
|
2
|
+
export { A as AiConfig, a as AiIndustry, b as AllFieldKeys, F as FieldVisibilityConfig, P as PublishGateRequiredField, c as SeoFieldConfig, d as SeoFieldGroup, e as SeoFieldKeys, f as SeoObjectFieldName, V as ValidHiddenFieldKeys, o as openGraphFieldKeys, t as twitterFieldKeys } from './plugin-DQdThyxG.js';
|
|
1
3
|
import * as sanity from 'sanity';
|
|
2
4
|
import { SchemaTypeDefinition } from 'sanity';
|
|
3
|
-
import { ComponentType } from 'react';
|
|
4
|
-
import { D as DocumentWithSeoHealth, S as SeoHealthMetrics } from './types-yVmQfby9.js';
|
|
5
|
-
export { a as SeoHealthStatus } from './types-yVmQfby9.js';
|
|
6
5
|
export { SeoHealthPaneOptions, createSeoHealthPane } from 'seofields-pro';
|
|
7
6
|
export { S as SchemaOrgDocumentJsonLdPreview, S as SchemaOrgJsonLdPreview, a as SchemaOrgJsonLdPreviewOptions, b as SchemaOrgJsonLdPreviewProps } from './SchemaOrgJsonLdPreview-DJLkIPq4.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
description?: string;
|
|
12
|
-
}
|
|
13
|
-
type SeoFieldKeys = 'title' | 'description' | 'canonicalUrl' | 'metaImage' | 'keywords' | 'metaAttributes' | 'robots' | 'focusKeyword' | 'hreflangs' | 'geoChecklist' | 'metaTagsPreview';
|
|
14
|
-
type openGraphFieldKeys = 'openGraphUrl' | 'openGraphTitle' | 'openGraphDescription' | 'openGraphSiteName' | 'openGraphType' | 'openGraphImageType' | 'openGraphImage' | 'openGraphImageUrl';
|
|
15
|
-
type twitterFieldKeys = 'twitterCard' | 'twitterSite' | 'twitterCreator' | 'twitterTitle' | 'twitterDescription' | 'twitterImageType' | 'twitterImage' | 'twitterImageUrl';
|
|
16
|
-
type AllFieldKeys = SeoFieldKeys | openGraphFieldKeys | twitterFieldKeys;
|
|
17
|
-
/**
|
|
18
|
-
* Names of top-level fields inside the `seoFields` object type.
|
|
19
|
-
* Use these when assigning fields to groups in `fieldGroups`.
|
|
20
|
-
*/
|
|
21
|
-
type SeoObjectFieldName = 'robots' | 'preview' | 'title' | 'description' | 'metaImage' | 'metaAttributes' | 'keywords' | 'canonicalUrl' | 'openGraph' | 'twitter' | 'focusKeyword' | 'hreflangs' | 'geoChecklist' | 'metaTagsPreview';
|
|
22
|
-
/**
|
|
23
|
-
* Defines a single tab/group within the `seoFields` object.
|
|
24
|
-
*/
|
|
25
|
-
interface SeoFieldGroup {
|
|
26
|
-
/** Unique key for this group (used internally by Sanity). */
|
|
27
|
-
name: string;
|
|
28
|
-
/** Human-readable label shown as the tab title. */
|
|
29
|
-
title: string;
|
|
30
|
-
/** Whether this tab is selected by default. Only one group should be `true`. */
|
|
31
|
-
default?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Field names to include in this group.
|
|
34
|
-
* Use the top-level seoFields field names: `'title'`, `'description'`, `'metaImage'`,
|
|
35
|
-
* `'keywords'`, `'canonicalUrl'`, `'metaAttributes'`, `'robots'`, `'preview'`,
|
|
36
|
-
* `'openGraph'`, `'twitter'`.
|
|
37
|
-
*/
|
|
38
|
-
fields: SeoObjectFieldName[];
|
|
39
|
-
/** Optional icon displayed next to the tab title. Must be a React component. */
|
|
40
|
-
icon?: ComponentType;
|
|
41
|
-
}
|
|
42
|
-
type ValidHiddenFieldKeys = Exclude<AllFieldKeys, 'openGraphImageUrl' | 'twitterImageUrl' | 'openGraphImageType' | 'twitterImageType'>;
|
|
43
|
-
interface FieldVisibilityConfig {
|
|
44
|
-
hiddenFields?: ValidHiddenFieldKeys[];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Individual SEO fields that must be non-empty before publishing.
|
|
48
|
-
* Dot-notation for nested fields (e.g. 'openGraph.title').
|
|
49
|
-
*/
|
|
50
|
-
type PublishGateRequiredField = 'title' | 'description' | 'metaImage' | 'keywords' | 'canonicalUrl' | 'openGraph.title' | 'openGraph.description' | 'openGraph.image' | 'openGraph.type' | 'twitter.title' | 'twitter.description' | 'twitter.image' | 'twitter.card';
|
|
51
|
-
interface SeoFieldsPluginConfig {
|
|
52
|
-
/**
|
|
53
|
-
* License key for pro features (SEO Health Dashboard, Publish Gate).
|
|
54
|
-
* Obtain at https://sanity-plugin-seofields.thehardik.in
|
|
55
|
-
*/
|
|
56
|
-
licenseKey?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Enable or configure the SEO preview feature.
|
|
59
|
-
* If set to `true`, the SEO preview will be enabled with default settings.
|
|
60
|
-
* If set to an object, you can provide a custom `prefix` function to modify the URL prefix
|
|
61
|
-
* and/or a `titleSuffix` to append text (e.g. a brand name) after the meta title in the preview.
|
|
62
|
-
* The plugin automatically adds a `|` separator — only provide the suffix text itself.
|
|
63
|
-
*
|
|
64
|
-
* Example:
|
|
65
|
-
* ```
|
|
66
|
-
* seoPreview: {
|
|
67
|
-
* prefix: (doc) => `/${doc.slug?.current || 'untitled'}`,
|
|
68
|
-
* titleSuffix: 'Acme Corp',
|
|
69
|
-
* // or dynamically:
|
|
70
|
-
* titleSuffix: (doc) => doc.brandName || 'Acme Corp',
|
|
71
|
-
* }
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
seoPreview?: boolean | {
|
|
75
|
-
prefix?: (doc: {
|
|
76
|
-
_type?: string;
|
|
77
|
-
} & Record<string, unknown>) => string;
|
|
78
|
-
/**
|
|
79
|
-
* A static string or function appended to the meta title in the Live Preview.
|
|
80
|
-
* Useful for showing a brand suffix (e.g. `'Acme Corp'`) that is added
|
|
81
|
-
* via your Next.js title template but not stored in the Sanity field.
|
|
82
|
-
* The plugin automatically prepends a `|` separator so only provide the
|
|
83
|
-
* text itself. The suffix is rendered in a muted style so editors can
|
|
84
|
-
* distinguish it from the typed title. The combined length (including the
|
|
85
|
-
* separator) is checked against the 60-character SERP limit.
|
|
86
|
-
*/
|
|
87
|
-
titleSuffix?: string | ((doc: {
|
|
88
|
-
_type?: string;
|
|
89
|
-
} & Record<string, unknown>) => string);
|
|
90
|
-
/**
|
|
91
|
-
* When `true`, the `titleSuffix` is rendered in the same color and weight
|
|
92
|
-
* as the main title (`#1a0dab`, `fontWeight: 500`) instead of the default
|
|
93
|
-
* muted style (`#70757a`, `fontWeight: 400`).
|
|
94
|
-
*
|
|
95
|
-
* @default false
|
|
96
|
-
*/
|
|
97
|
-
titleSuffixInheritColor?: boolean;
|
|
98
|
-
/**
|
|
99
|
-
* A GROQ query string whose result is used as the title suffix in the Live Preview.
|
|
100
|
-
* The query runs against your dataset at Studio load time, making it useful for
|
|
101
|
-
* fetching a dynamic value from another document (e.g. a settings singleton).
|
|
102
|
-
* Takes priority over `titleSuffix` when both are provided.
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```ts
|
|
106
|
-
* titleSuffixQuery: '*[_type == "siteSettings"][0].siteName'
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
titleSuffixQuery?: string;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* A mapping of field keys to their configuration settings.
|
|
113
|
-
* This allows customization of field titles and descriptions.
|
|
114
|
-
* For example, to change the title of the 'title' field:
|
|
115
|
-
*/
|
|
116
|
-
fieldOverrides?: Partial<Record<AllFieldKeys, SeoFieldConfig>>;
|
|
117
|
-
/**
|
|
118
|
-
* A mapping of document types to field visibility configurations.
|
|
119
|
-
* This allows you to specify which fields should be hidden for specific document types.
|
|
120
|
-
*/
|
|
121
|
-
fieldVisibility?: Record<string, FieldVisibilityConfig>;
|
|
122
|
-
/**
|
|
123
|
-
* A list of fields that should be hidden by default in all document types.
|
|
124
|
-
* This can be overridden by specific document type settings in `fieldVisibility`.
|
|
125
|
-
*/
|
|
126
|
-
defaultHiddenFields?: ValidHiddenFieldKeys[];
|
|
127
|
-
/**
|
|
128
|
-
* Group the SEO fields into tabbed sections inside the `seoFields` object.
|
|
129
|
-
* When configured, the Studio shows tabs (Sanity groups) so editors can
|
|
130
|
-
* switch between e.g. "Meta", "Open Graph", and "Twitter Card" panels.
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* fieldGroups: [
|
|
134
|
-
* { name: 'meta', title: 'Meta', default: true,
|
|
135
|
-
* fields: ['title', 'description', 'metaImage', 'keywords', 'canonicalUrl', 'metaAttributes', 'robots', 'preview'] },
|
|
136
|
-
* { name: 'openGraph', title: 'Open Graph', fields: ['openGraph'] },
|
|
137
|
-
* { name: 'twitter', title: 'Twitter Card', fields: ['twitter'] },
|
|
138
|
-
* ]
|
|
139
|
-
*/
|
|
140
|
-
fieldGroups?: SeoFieldGroup[];
|
|
141
|
-
/**
|
|
142
|
-
* Show the GEO / AI Overview readiness checklist inside seoFields.
|
|
143
|
-
* Defaults to `true`.
|
|
144
|
-
*/
|
|
145
|
-
geo?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Show the Meta Tags HTML preview inside seoFields.
|
|
148
|
-
* Defaults to `true`.
|
|
149
|
-
*/
|
|
150
|
-
metaTagsPreview?: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* The base URL of your website, used for generating full URLs in the SEO preview.
|
|
153
|
-
* Defaults to 'https://www.example.com' if not provided.
|
|
154
|
-
*/
|
|
155
|
-
baseUrl?: string;
|
|
156
|
-
/**
|
|
157
|
-
* The Sanity API version to use for all plugin clients (SEO Preview, Health Dashboard).
|
|
158
|
-
* Defaults to '2024-01-01'.
|
|
159
|
-
* @example '2024-01-01'
|
|
160
|
-
*/
|
|
161
|
-
apiVersion?: string;
|
|
162
|
-
/**
|
|
163
|
-
* Enable or configure the SEO Health Dashboard tool.
|
|
164
|
-
* If set to `true`, the dashboard is enabled with all defaults.
|
|
165
|
-
* If set to an object, you can customise the tool and dashboard settings.
|
|
166
|
-
* Defaults to `true`.
|
|
167
|
-
* Example:
|
|
168
|
-
* ```
|
|
169
|
-
* healthDashboard: {
|
|
170
|
-
* toolTitle: 'SEO Overview', // Studio nav tab label
|
|
171
|
-
* content: {
|
|
172
|
-
* icon: '🔍', // Emoji icon shown before the page heading
|
|
173
|
-
* title: 'My SEO Dashboard',// Page heading inside the tool (no emoji)
|
|
174
|
-
* description: 'Track SEO across all documents', // Subtitle under the heading
|
|
175
|
-
* },
|
|
176
|
-
* display: {
|
|
177
|
-
* typeColumn: false, // Hide the document type column (default: true)
|
|
178
|
-
* documentId: false, // Hide the document ID under titles (default: true)
|
|
179
|
-
* },
|
|
180
|
-
* query: {
|
|
181
|
-
* // Option 1 – filter by specific document types
|
|
182
|
-
* types: ['post', 'page'],
|
|
183
|
-
* // Option 2 – provide a full custom GROQ query (takes precedence over `types`)
|
|
184
|
-
* // Must return documents with at least: _id, _type, title, seo, _updatedAt
|
|
185
|
-
* groq: `*[seo != null && defined(slug.current)]{ _id, _type, title, slug, seo, _updatedAt }`,
|
|
186
|
-
* },
|
|
187
|
-
* }
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
healthDashboard?: boolean | {
|
|
191
|
-
tool?: {
|
|
192
|
-
title?: string;
|
|
193
|
-
name?: string;
|
|
194
|
-
};
|
|
195
|
-
toolTitle?: string;
|
|
196
|
-
content?: {
|
|
197
|
-
icon?: string;
|
|
198
|
-
title?: string;
|
|
199
|
-
description?: string;
|
|
200
|
-
/** Text shown while the license key is being verified. Defaults to "Verifying license…" */
|
|
201
|
-
loadingLicense?: string;
|
|
202
|
-
/** Text shown while documents are being fetched. Defaults to "Loading documents…" */
|
|
203
|
-
loadingDocuments?: string;
|
|
204
|
-
/** Text shown when the query returns zero results. Defaults to "No documents found" */
|
|
205
|
-
noDocuments?: string;
|
|
206
|
-
};
|
|
207
|
-
/**
|
|
208
|
-
* Show or hide the document type column in the results table.
|
|
209
|
-
* Defaults to `true`.
|
|
210
|
-
*/
|
|
211
|
-
showTypeColumn?: boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Show or hide the Sanity document `_id` under each title.
|
|
214
|
-
* Defaults to `true`.
|
|
215
|
-
*/
|
|
216
|
-
showDocumentId?: boolean;
|
|
217
|
-
query?: {
|
|
218
|
-
/**
|
|
219
|
-
* Limit the dashboard to specific document types.
|
|
220
|
-
* Example: `['post', 'page']`
|
|
221
|
-
*/
|
|
222
|
-
types?: string[];
|
|
223
|
-
/**
|
|
224
|
-
* When using `types`, also require the `seo` field to be non-null.
|
|
225
|
-
* Set to `false` to include documents of those types even if `seo` is missing.
|
|
226
|
-
* Defaults to `true`.
|
|
227
|
-
*/
|
|
228
|
-
requireSeo?: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Provide a fully custom GROQ query. Takes precedence over `types`.
|
|
231
|
-
* The query must return documents with at least: _id, _type, title, seo, _updatedAt
|
|
232
|
-
*/
|
|
233
|
-
groq?: string;
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* The Sanity API version to use for the client (e.g. '2023-01-01').
|
|
237
|
-
* Defaults to '2023-01-01'.
|
|
238
|
-
* @deprecated Use the root-level `apiVersion` option instead.
|
|
239
|
-
* @example
|
|
240
|
-
* // Before (deprecated):
|
|
241
|
-
* healthDashboard: { apiVersion: '2024-01-01' }
|
|
242
|
-
* // After:
|
|
243
|
-
* apiVersion: '2024-01-01'
|
|
244
|
-
*/
|
|
245
|
-
apiVersion?: string;
|
|
246
|
-
/**
|
|
247
|
-
* License key for the SEO Health Dashboard pro feature.
|
|
248
|
-
* @deprecated Use the root-level `licenseKey` option instead.
|
|
249
|
-
*/
|
|
250
|
-
licenseKey?: string;
|
|
251
|
-
/**
|
|
252
|
-
* Map raw `_type` values to human-readable display labels.
|
|
253
|
-
* Used in both the Type column and the Type filter dropdown.
|
|
254
|
-
* Any type without an entry falls back to the raw `_type` string.
|
|
255
|
-
*
|
|
256
|
-
* @example
|
|
257
|
-
* typeDisplayLabels: { productDrug: 'Products', singleCondition: 'Condition' }
|
|
258
|
-
*/
|
|
259
|
-
typeDisplayLabels?: Record<string, string>;
|
|
260
|
-
/**
|
|
261
|
-
* Controls how the document type is rendered in the Type column.
|
|
262
|
-
* - `'badge'` (default) — coloured pill
|
|
263
|
-
* - `'text'` — plain text, useful for dense layouts
|
|
264
|
-
*/
|
|
265
|
-
typeColumnMode?: 'badge' | 'text';
|
|
266
|
-
/**
|
|
267
|
-
* The document field to use as the display title in the dashboard.
|
|
268
|
-
*
|
|
269
|
-
* - `string` — use this field for every document type (e.g. `'name'`)
|
|
270
|
-
* - `Record<string, string>` — per-type mapping; unmapped types fall back to `title`
|
|
271
|
-
*
|
|
272
|
-
* @example
|
|
273
|
-
* titleField: 'name'
|
|
274
|
-
*
|
|
275
|
-
* @example
|
|
276
|
-
* titleField: { post: 'title', product: 'name', category: 'label' }
|
|
277
|
-
*/
|
|
278
|
-
titleField?: string | Record<string, string>;
|
|
279
|
-
/**
|
|
280
|
-
* Callback function to render a custom badge next to the document title.
|
|
281
|
-
* Receives the full document and should return badge data or undefined.
|
|
282
|
-
*
|
|
283
|
-
* @example
|
|
284
|
-
* getDocumentBadge: (doc) => {
|
|
285
|
-
* if (doc.services === 'NHS')
|
|
286
|
-
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
287
|
-
* if (doc.services === 'Private')
|
|
288
|
-
* return { label: 'Private', bgColor: '#fef3c7', textColor: '#92400e' }
|
|
289
|
-
* }
|
|
290
|
-
*/
|
|
291
|
-
getDocumentBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
292
|
-
label: string;
|
|
293
|
-
bgColor?: string;
|
|
294
|
-
textColor?: string;
|
|
295
|
-
fontSize?: string;
|
|
296
|
-
} | undefined;
|
|
297
|
-
/**
|
|
298
|
-
* The `name` of the Sanity structure tool that contains the monitored documents.
|
|
299
|
-
* Required when you have multiple structure tools and the documents live in a
|
|
300
|
-
* non-default one. Clicking a title will navigate to
|
|
301
|
-
* `/{basePath}/{structureTool}/intent/edit/…` directly.
|
|
302
|
-
*
|
|
303
|
-
* @example
|
|
304
|
-
* structureTool: 'common'
|
|
305
|
-
*/
|
|
306
|
-
structureTool?: string;
|
|
307
|
-
/**
|
|
308
|
-
* Enable preview/demo mode to show dummy data.
|
|
309
|
-
* Useful for testing, documentation, or showcasing the dashboard.
|
|
310
|
-
* When enabled, displays realistic sample documents with various SEO scores.
|
|
311
|
-
* Defaults to `false`.
|
|
312
|
-
*
|
|
313
|
-
* @example
|
|
314
|
-
* previewMode: true
|
|
315
|
-
*/
|
|
316
|
-
previewMode?: boolean;
|
|
317
|
-
/**
|
|
318
|
-
* Export options for the SEO Health Dashboard.
|
|
319
|
-
* Set to `true` (default) to enable both CSV and JSON export,
|
|
320
|
-
* or configure per-format.
|
|
321
|
-
*/
|
|
322
|
-
export?: boolean | {
|
|
323
|
-
enabled?: boolean;
|
|
324
|
-
formats?: Array<'csv' | 'json'>;
|
|
325
|
-
};
|
|
326
|
-
/**
|
|
327
|
-
* Show compact inline stat pills in the header row instead of the
|
|
328
|
-
* full 6-card stats grid. Useful for saving vertical space.
|
|
329
|
-
* Defaults to `false`.
|
|
330
|
-
*/
|
|
331
|
-
compactStats?: boolean;
|
|
332
|
-
};
|
|
333
|
-
/**
|
|
334
|
-
* Gate publishing based on SEO score or required field presence.
|
|
335
|
-
* Requires a valid root-level `licenseKey` — silently disabled if key is absent or invalid.
|
|
336
|
-
*
|
|
337
|
-
* @example
|
|
338
|
-
* ```ts
|
|
339
|
-
* publishGate: {
|
|
340
|
-
* mode: 'warn',
|
|
341
|
-
* minScore: 70,
|
|
342
|
-
* requiredFields: ['title', 'description', 'openGraph.title'],
|
|
343
|
-
* types: ['post', 'page'],
|
|
344
|
-
* }
|
|
345
|
-
* ```
|
|
346
|
-
*/
|
|
347
|
-
publishGate?: {
|
|
348
|
-
/**
|
|
349
|
-
* 'block' — disables the Publish button with a tooltip reason (default).
|
|
350
|
-
* 'warn' — shows a confirm dialog; editor can bypass and publish anyway.
|
|
351
|
-
* @default 'block'
|
|
352
|
-
*/
|
|
353
|
-
mode?: 'block' | 'warn';
|
|
354
|
-
/**
|
|
355
|
-
* Minimum overall SEO health score (0–100) required to publish.
|
|
356
|
-
* Gate fires when the document's score is below this threshold.
|
|
357
|
-
* @default 60
|
|
358
|
-
*/
|
|
359
|
-
minScore?: number;
|
|
360
|
-
/**
|
|
361
|
-
* Individual fields that MUST be non-empty. Gate fires if any are missing.
|
|
362
|
-
* Use dot-notation for nested fields: 'openGraph.title', 'twitter.image', etc.
|
|
363
|
-
*/
|
|
364
|
-
requiredFields?: PublishGateRequiredField[];
|
|
365
|
-
/**
|
|
366
|
-
* Restrict the gate to specific document types.
|
|
367
|
-
* Omit to apply to all document types that have an `seo` field.
|
|
368
|
-
*/
|
|
369
|
-
types?: string[];
|
|
370
|
-
/**
|
|
371
|
-
* Custom message shown in the block tooltip or warn dialog.
|
|
372
|
-
* Accepts a string or a function receiving (score, issues[]).
|
|
373
|
-
*/
|
|
374
|
-
message?: string | ((score: number, issues: string[]) => string);
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
declare const seofields: sanity.Plugin<void | SeoFieldsPluginConfig>;
|
|
7
|
+
import { c as SeoHealthMetrics } from './types-DxlPXihz.js';
|
|
8
|
+
export { D as DocumentWithSeoHealth, d as SeoHealthStatus } from './types-DxlPXihz.js';
|
|
9
|
+
import 'react';
|
|
378
10
|
|
|
379
11
|
declare function seoFieldsSchema(config?: SeoFieldsPluginConfig): SchemaTypeDefinition;
|
|
380
12
|
|
|
@@ -416,4 +48,4 @@ interface SeoDocument {
|
|
|
416
48
|
}
|
|
417
49
|
declare const calculateHealthScore: (doc: SeoDocument) => SeoHealthMetrics;
|
|
418
50
|
|
|
419
|
-
export {
|
|
51
|
+
export { SeoFieldsPluginConfig, SeoHealthMetrics, types as allSchemas, baseMeta as baseMetaSchema, calculateHealthScore, seofields as default, _default$2 as metaAttributeSchema, _default$1 as metaTagSchema, openGraph as openGraphSchema, _default as robotsSchema, seoFieldsSchema, twitter as twitterSchema };
|