sanity-plugin-seofields 1.5.4 → 1.6.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 +4 -4
- package/dist/SeoHealthDashboard-7XMPVJRX.cjs +10 -0
- package/dist/{SeoHealthDashboard-KPBNXSL4.cjs.map → SeoHealthDashboard-7XMPVJRX.cjs.map} +1 -1
- package/dist/SeoHealthDashboard-UWPLB5DM.js +4 -0
- package/dist/{SeoHealthDashboard-QKVB5HK3.js.map → SeoHealthDashboard-UWPLB5DM.js.map} +1 -1
- package/dist/{SeoHealthTool-ON3SRXCF.cjs → SeoHealthTool-2H4XZR4I.cjs} +4 -4
- package/dist/{SeoHealthTool-ON3SRXCF.cjs.map → SeoHealthTool-2H4XZR4I.cjs.map} +1 -1
- package/dist/{SeoHealthTool-EPPOEDTW.js → SeoHealthTool-XCXINAQI.js} +3 -3
- package/dist/{SeoHealthTool-EPPOEDTW.js.map → SeoHealthTool-XCXINAQI.js.map} +1 -1
- package/dist/{SeoPreview-G3LPA7GV.js → SeoPreview-F6GGPZWI.js} +2 -2
- package/dist/SeoPreview-F6GGPZWI.js.map +1 -0
- package/dist/{SeoPreview-Y3CFDVBR.cjs → SeoPreview-JDROKZLP.cjs} +2 -2
- package/dist/SeoPreview-JDROKZLP.cjs.map +1 -0
- package/dist/chunk-6NIHHOVS.js +3918 -0
- package/dist/chunk-6NIHHOVS.js.map +1 -0
- package/dist/chunk-7HCP5O62.cjs +4027 -0
- package/dist/chunk-7HCP5O62.cjs.map +1 -0
- package/dist/{chunk-527WXITP.js → chunk-KWUITSHS.js} +218 -54
- package/dist/chunk-KWUITSHS.js.map +1 -0
- package/dist/{chunk-UCVSMPEJ.js → chunk-NHJBEV3A.js} +2 -2
- package/dist/{chunk-UCVSMPEJ.js.map → chunk-NHJBEV3A.js.map} +1 -1
- package/dist/chunk-WCLEWFAJ.cjs +669 -0
- package/dist/chunk-WCLEWFAJ.cjs.map +1 -0
- package/dist/{chunk-G2SVI2SP.cjs → chunk-Z74QPO75.cjs} +2 -2
- package/dist/{chunk-G2SVI2SP.cjs.map → chunk-Z74QPO75.cjs.map} +1 -1
- package/dist/cli.js +25 -25
- package/dist/component-7rqDvuy2.d.ts +534 -0
- package/dist/component-J2nEQkOw.d.cts +534 -0
- package/dist/index.cjs +159 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -51
- package/dist/index.d.ts +43 -51
- package/dist/index.js +159 -185
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +155 -51
- package/dist/next.d.cts +3 -3
- package/dist/next.d.ts +3 -3
- package/dist/next.js +2 -2
- package/dist/schema/next.cjs +171 -52
- package/dist/schema/next.cjs.map +1 -1
- package/dist/schema/next.d.cts +12 -428
- package/dist/schema/next.d.ts +12 -428
- package/dist/schema/next.js +20 -2
- package/dist/schema/next.js.map +1 -1
- package/dist/schema.cjs +831 -156
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +318 -41
- package/dist/schema.d.ts +318 -41
- package/dist/schema.js +567 -86
- package/dist/schema.js.map +1 -1
- package/dist/types-BRn3hfQb.d.ts +24 -0
- package/dist/types-BSgolLj3.d.cts +24 -0
- package/dist/{types-R3n9Fu4w.d.cts → types-BtSRRG6C.d.cts} +1 -1
- package/dist/{types-R3n9Fu4w.d.ts → types-BtSRRG6C.d.ts} +1 -1
- package/dist/types-DnVvOp3o.d.ts +1215 -0
- package/dist/types-DoUYMRVf.d.cts +1215 -0
- package/package.json +2 -1
- package/dist/SeoHealthDashboard-KPBNXSL4.cjs +0 -10
- package/dist/SeoHealthDashboard-QKVB5HK3.js +0 -4
- package/dist/SeoPreview-G3LPA7GV.js.map +0 -1
- package/dist/SeoPreview-Y3CFDVBR.cjs.map +0 -1
- package/dist/chunk-527WXITP.js.map +0 -1
- package/dist/chunk-6CYMVS3O.js +0 -1245
- package/dist/chunk-6CYMVS3O.js.map +0 -1
- package/dist/chunk-D2GWRRK5.cjs +0 -1293
- package/dist/chunk-D2GWRRK5.cjs.map +0 -1
- package/dist/chunk-L3L3FSPJ.cjs +0 -478
- package/dist/chunk-L3L3FSPJ.cjs.map +0 -1
- package/dist/types-CVaAX7uy.d.cts +0 -589
- package/dist/types-Ci-ZZT7A.d.ts +0 -589
package/dist/schema.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { S as SchemaOrgAggregateRatingConfig, a as SchemaOrgArticleConfig, b as SchemaOrgBlogPostingConfig, c as SchemaOrgBookConfig, d as SchemaOrgBrandConfig, e as SchemaOrgBreadcrumbListConfig, f as SchemaOrgContactPointConfig, g as SchemaOrgCountryConfig, h as SchemaOrgCourseConfig, i as SchemaOrgEventConfig, j as SchemaOrgFAQPageConfig, k as SchemaOrgHowToConfig, l as SchemaOrgImageObjectConfig, m as SchemaOrgItemListConfig, n as SchemaOrgJobPostingConfig, o as SchemaOrgLegalServiceConfig, p as SchemaOrgLocalBusinessConfig, q as SchemaOrgMovieConfig, r as SchemaOrgMusicAlbumConfig, s as SchemaOrgMusicRecordingConfig, t as SchemaOrgNewsArticleConfig, u as SchemaOrgOfferConfig, v as SchemaOrgOrganizationConfig, w as SchemaOrgPersonConfig, x as SchemaOrgPlaceConfig, y as SchemaOrgPostalAddressConfig, z as SchemaOrgProductConfig, A as SchemaOrgProfilePageConfig, B as SchemaOrgRecipeConfig, C as SchemaOrgRestaurantConfig, D as SchemaOrgReviewConfig, E as SchemaOrgServiceConfig, F as SchemaOrgSoftwareApplicationConfig, G as SchemaOrgVideoObjectConfig, H as SchemaOrgWebApplicationConfig, I as SchemaOrgWebPageConfig, J as SchemaOrgWebsiteConfig } from './types-DoUYMRVf.cjs';
|
|
2
|
+
export { O as OrganizationContactPoint, K as SchemaOrgAggregateRating, L as SchemaOrgAggregateRatingData, M as SchemaOrgArchivedAt, N as SchemaOrgArticleData, P as SchemaOrgBlogPostingData, Q as SchemaOrgBookData, R as SchemaOrgBrandData, T as SchemaOrgBreadcrumbListData, U as SchemaOrgContactPointData, V as SchemaOrgContentRating, W as SchemaOrgCopyrightYear, X as SchemaOrgCountryData, Y as SchemaOrgCourseData, Z as SchemaOrgCreativeWorkData, _ as SchemaOrgEventData, $ as SchemaOrgFAQPageData, a0 as SchemaOrgHowToData, a1 as SchemaOrgImageInput, a2 as SchemaOrgImageObjectData, a3 as SchemaOrgItemListData, a4 as SchemaOrgJobPostingData, a5 as SchemaOrgLegalServiceData, a6 as SchemaOrgLocalBusinessData, a7 as SchemaOrgMovieData, a8 as SchemaOrgMusicAlbumData, a9 as SchemaOrgMusicRecordingData, aa as SchemaOrgNewsArticleData, ab as SchemaOrgOfferData, ac as SchemaOrgOrganizationData, ad as SchemaOrgOrganizationInput, ae as SchemaOrgPersonData, af as SchemaOrgPersonOrOrganization, ag as SchemaOrgPlaceData, ah as SchemaOrgPostalAddressData, ai as SchemaOrgProductData, aj as SchemaOrgProfilePageData, ak as SchemaOrgRecipeData, al as SchemaOrgRestaurantData, am as SchemaOrgReviewData, an as SchemaOrgServiceData, ao as SchemaOrgSoftwareApplicationData, ap as SchemaOrgTextOrUrl, aq as SchemaOrgThingData, ar as SchemaOrgVideoObjectData, as as SchemaOrgWebApplicationData, at as SchemaOrgWebPageData, au as SchemaOrgWebsiteData } from './types-DoUYMRVf.cjs';
|
|
3
|
+
import React, { JSX } from 'react';
|
|
2
4
|
import * as sanity from 'sanity';
|
|
3
|
-
import { SchemaTypeDefinition } from 'sanity';
|
|
4
|
-
import { S as
|
|
5
|
-
export {
|
|
6
|
-
import './types-
|
|
5
|
+
import { SchemaTypeDefinition, InputProps } from 'sanity';
|
|
6
|
+
import { S as SchemaOrgSocialMediaPostingConfig } from './types-BSgolLj3.cjs';
|
|
7
|
+
export { a as SchemaOrgSocialMediaPostingData } from './types-BSgolLj3.cjs';
|
|
8
|
+
import './types-BtSRRG6C.cjs';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Dynamic Sanity schema generator for Schema.org types.
|
|
@@ -21,13 +23,27 @@ interface SchemaFieldOption {
|
|
|
21
23
|
title: string;
|
|
22
24
|
value: string;
|
|
23
25
|
}
|
|
26
|
+
interface SchemaFieldVariant {
|
|
27
|
+
/** Discriminator value, e.g. "url", "imageObject", "person" */
|
|
28
|
+
value: string;
|
|
29
|
+
/** Human-readable title for the radio option */
|
|
30
|
+
title: string;
|
|
31
|
+
/** Schema.org @type emitted in JSON-LD when this variant is active */
|
|
32
|
+
jsonLdType?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Fields shown when this variant is selected. If a single field with the
|
|
35
|
+
* variant's `value` as its name is provided, the variant collapses to that
|
|
36
|
+
* inline value in JSON-LD (e.g. plain url string).
|
|
37
|
+
*/
|
|
38
|
+
fields: SchemaFieldDef[];
|
|
39
|
+
}
|
|
24
40
|
interface SchemaFieldDef {
|
|
25
41
|
/** Sanity field name */
|
|
26
42
|
name: string;
|
|
27
43
|
/** Human-readable title shown in Studio */
|
|
28
44
|
title: string;
|
|
29
45
|
/** Sanity field type */
|
|
30
|
-
type: 'string' | 'url' | 'text' | 'array' | 'object' | 'image' | 'number' | 'date' | 'datetime';
|
|
46
|
+
type: 'string' | 'url' | 'text' | 'array' | 'object' | 'image' | 'number' | 'date' | 'datetime' | 'boolean' | 'select' | 'copyrightYear';
|
|
31
47
|
/** Help text shown below the field */
|
|
32
48
|
description?: string;
|
|
33
49
|
/** If set, field is required — key is the validation config key, message is the default */
|
|
@@ -51,16 +67,31 @@ interface SchemaFieldDef {
|
|
|
51
67
|
jsonLdType?: string;
|
|
52
68
|
/** JSON-LD key if different from the Sanity field name */
|
|
53
69
|
jsonLdKey?: string;
|
|
70
|
+
/** For url field: validation options */
|
|
71
|
+
urlValidation?: {
|
|
72
|
+
/** Allowed URL schemes. Defaults to ['http', 'https']. */
|
|
73
|
+
schemes?: string[];
|
|
74
|
+
/** If true, allow relative URLs. Defaults to false. */
|
|
75
|
+
allowRelative?: boolean;
|
|
76
|
+
};
|
|
77
|
+
/** For select type: discriminated union variants */
|
|
78
|
+
variants?: SchemaFieldVariant[];
|
|
79
|
+
/** For select type: default variant value (defaults to first variant) */
|
|
80
|
+
defaultVariant?: string;
|
|
81
|
+
/** For string fields with options: Sanity layout ('radio' | 'dropdown') */
|
|
82
|
+
layout?: 'radio' | 'dropdown';
|
|
54
83
|
}
|
|
55
84
|
interface SchemaTypeDef {
|
|
56
85
|
/** Sanity type name, e.g. "schemaOrgWebsite" */
|
|
57
86
|
name: string;
|
|
58
|
-
/** Title shown in Studio, e.g. "
|
|
87
|
+
/** Title shown in Studio, e.g. "Website" */
|
|
59
88
|
title: string;
|
|
60
89
|
/** Icon component shown in Studio and the array grid picker */
|
|
61
90
|
icon?: React.ComponentType;
|
|
62
91
|
/** Field definitions */
|
|
63
92
|
fields: SchemaFieldDef[];
|
|
93
|
+
/** Optional custom subtitle generator for the Studio preview */
|
|
94
|
+
customPrepareSubtitle?: (document: Record<string, unknown>) => string;
|
|
64
95
|
}
|
|
65
96
|
interface SchemaOrgConfig {
|
|
66
97
|
/** Custom validation error messages keyed by field config key */
|
|
@@ -82,6 +113,214 @@ declare function generateSchemaType(def: SchemaTypeDef, config?: SchemaOrgConfig
|
|
|
82
113
|
*/
|
|
83
114
|
declare function buildGenericJsonLd(schemaType: string, data: Record<string, unknown> | null | undefined, fieldDefs: SchemaFieldDef[], requiredFields?: string[]): Record<string, unknown> | null;
|
|
84
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Shared field collections reused across multiple Schema.org types.
|
|
118
|
+
*
|
|
119
|
+
* Includes:
|
|
120
|
+
* - polymorphic helpers (image, author, publisher, genre, keywords)
|
|
121
|
+
* - Thing common fields (name, alternateName, additionalType, etc.)
|
|
122
|
+
* - CreativeWork common fields (award, copyrightNotice, copyrightYear, etc.)
|
|
123
|
+
*
|
|
124
|
+
* These helpers keep the polymorphic UX consistent — editors get a `Type`
|
|
125
|
+
* selector and only see the relevant fields for the chosen variant.
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
interface PolymorphicOptions {
|
|
129
|
+
/** Override field name (defaults vary per helper) */
|
|
130
|
+
name?: string;
|
|
131
|
+
/** Override field title */
|
|
132
|
+
title?: string;
|
|
133
|
+
/** Help text */
|
|
134
|
+
description?: string;
|
|
135
|
+
}
|
|
136
|
+
/** Image: URL string OR full Schema.org ImageObject. */
|
|
137
|
+
declare function polymorphicImage(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
138
|
+
/** Author: Person OR Organization. */
|
|
139
|
+
declare function polymorphicAuthor(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
140
|
+
/** Publisher: Person OR Organization. */
|
|
141
|
+
declare function polymorphicPublisher(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
142
|
+
/** Genre: free text OR URL (e.g. linking to a Wikipedia genre page). */
|
|
143
|
+
declare function polymorphicGenre(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
144
|
+
/** Keywords: free text (comma-separated) OR URL. */
|
|
145
|
+
declare function polymorphicKeywords(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
146
|
+
/** additionalType: free text OR URL (linking to a Schema.org / Wikidata type). */
|
|
147
|
+
declare function polymorphicAdditionalType(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
148
|
+
/** Contributor: Person OR Organization. */
|
|
149
|
+
declare function polymorphicContributor(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
150
|
+
/** Creator: Person OR Organization. */
|
|
151
|
+
declare function polymorphicCreator(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
152
|
+
/** Maintainer: Person OR Organization. */
|
|
153
|
+
declare function polymorphicMaintainer(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
154
|
+
/** Funder: Person OR Organization. */
|
|
155
|
+
declare function polymorphicFunder(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
156
|
+
/** Copyright Holder: Person OR Organization. */
|
|
157
|
+
declare function polymorphicCopyrightHolder(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
158
|
+
/** Identifier: text (e.g. ISBN, GTIN) OR URL. */
|
|
159
|
+
declare function polymorphicIdentifier(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
160
|
+
/** Owner: Person OR Organization. */
|
|
161
|
+
declare function polymorphicOwner(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
162
|
+
/** Citation: text reference OR URL to the cited work. */
|
|
163
|
+
declare function polymorphicCitation(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
164
|
+
/** Content Rating: plain text OR structured Rating object. */
|
|
165
|
+
declare function polymorphicContentRating(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
166
|
+
/** archivedAt: URL or simplified WebPage reference. */
|
|
167
|
+
declare function polymorphicArchivedAt(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
168
|
+
/** isBasedOn: URL or text reference to the source CreativeWork/Product. */
|
|
169
|
+
declare function polymorphicIsBasedOn(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
170
|
+
/** isPartOf: URL or text reference to a parent CreativeWork. */
|
|
171
|
+
declare function polymorphicIsPartOf(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
172
|
+
/** License: URL to a license document or text name. */
|
|
173
|
+
declare function polymorphicLicense(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
174
|
+
/** locationCreated: text name or URL reference to a Place. */
|
|
175
|
+
declare function polymorphicLocationCreated(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
176
|
+
/** Material: text description OR URL to the material resource. */
|
|
177
|
+
declare function polymorphicMaterial(opts?: PolymorphicOptions): SchemaFieldDef;
|
|
178
|
+
/**
|
|
179
|
+
* IETF BCP 47 language options shown in the `inLanguage` dropdown.
|
|
180
|
+
* Add more via `extraOptions` in `inLanguageField()`.
|
|
181
|
+
*/
|
|
182
|
+
declare const IETF_LANGUAGE_OPTIONS: Array<{
|
|
183
|
+
title: string;
|
|
184
|
+
value: string;
|
|
185
|
+
}>;
|
|
186
|
+
interface SimpleFieldOptions {
|
|
187
|
+
/** Override field title */
|
|
188
|
+
title?: string;
|
|
189
|
+
/** Help text / description */
|
|
190
|
+
description?: string;
|
|
191
|
+
/** If provided, field is required with this validation config */
|
|
192
|
+
required?: {
|
|
193
|
+
key: string;
|
|
194
|
+
message: string;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
interface InLanguageFieldOptions {
|
|
198
|
+
/** Override field title (default: 'Language') */
|
|
199
|
+
title?: string;
|
|
200
|
+
/** Help text / description */
|
|
201
|
+
description?: string;
|
|
202
|
+
/** Default selected language (default: 'en') */
|
|
203
|
+
initialValue?: string;
|
|
204
|
+
/** Additional language options appended after the defaults */
|
|
205
|
+
extraOptions?: Array<{
|
|
206
|
+
title: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Reusable `inLanguage` field — renders a searchable dropdown of IETF BCP 47
|
|
212
|
+
* language codes (per https://schema.org/inLanguage), defaulting to English.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```ts
|
|
216
|
+
* inLanguageField() // 'Language' / default description
|
|
217
|
+
* inLanguageField({ description: 'The language of the page content.' })
|
|
218
|
+
* inLanguageField({ initialValue: 'fr', extraOptions: [{title: 'Catalan', value: 'ca'}] })
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare function inLanguageField(opts?: InLanguageFieldOptions): SchemaFieldDef;
|
|
222
|
+
/**
|
|
223
|
+
* Reusable `name` field — a simple string with configurable title, description,
|
|
224
|
+
* and optional required validation.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* nameField({ title: 'Website Name', description: 'The name of the website.' })
|
|
229
|
+
* nameField({ title: 'Page Name', required: { key: 'nameRequired', message: 'Name is required.' } })
|
|
230
|
+
* ```
|
|
231
|
+
* @see https://schema.org/name
|
|
232
|
+
*/
|
|
233
|
+
declare function nameField(opts?: SimpleFieldOptions): SchemaFieldDef;
|
|
234
|
+
/**
|
|
235
|
+
* Reusable `description` field — a text area with configurable title, description,
|
|
236
|
+
* and optional required validation.
|
|
237
|
+
* @param opts Options to customize the field's title, description, and validation.
|
|
238
|
+
* @returns A SchemaFieldDef for a description field with the specified options.
|
|
239
|
+
* @example
|
|
240
|
+
* ```ts
|
|
241
|
+
* descriptionField({ title: 'Website Description', description: 'A brief description of the website.' })
|
|
242
|
+
* descriptionField({ title: 'Page Description', required: { key: 'descriptionRequired', message: 'Description is required.' } })
|
|
243
|
+
* ```
|
|
244
|
+
* @see https://schema.org/description
|
|
245
|
+
*/
|
|
246
|
+
declare function descriptionField(opts?: SimpleFieldOptions): SchemaFieldDef;
|
|
247
|
+
/**
|
|
248
|
+
* Reusable `url` field — a URL type with configurable title, description,
|
|
249
|
+
* http/https validation, and optional required validation.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```ts
|
|
253
|
+
* urlField({ title: 'Website URL', description: 'The full URL of the website.' })
|
|
254
|
+
* urlField({ title: 'Page URL', required: { key: 'urlRequired', message: 'URL is required.' } })
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
declare function urlField(opts?: SimpleFieldOptions): SchemaFieldDef;
|
|
258
|
+
interface DatePublishedFieldOptions extends SimpleFieldOptions {
|
|
259
|
+
/** 'date' (default) or 'datetime' */
|
|
260
|
+
dateType?: 'date' | 'datetime';
|
|
261
|
+
name?: string;
|
|
262
|
+
title?: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Reusable `headline` field — a string type used for article-like content.
|
|
266
|
+
*/
|
|
267
|
+
declare function headlineField(opts?: SimpleFieldOptions): SchemaFieldDef;
|
|
268
|
+
/**
|
|
269
|
+
* Reusable `datePublished` field — a date or datetime type.
|
|
270
|
+
*/
|
|
271
|
+
declare function datePublishedField(opts?: DatePublishedFieldOptions): SchemaFieldDef;
|
|
272
|
+
/**
|
|
273
|
+
* Merge `thingCommonFields` into a schema's existing field list.
|
|
274
|
+
* Existing fields with the same `name` win (schema-specific titles/validation
|
|
275
|
+
* are preserved). Common fields not yet present are appended.
|
|
276
|
+
*/
|
|
277
|
+
declare function withThingCommons(fields: SchemaFieldDef[]): SchemaFieldDef[];
|
|
278
|
+
/**
|
|
279
|
+
* Merge `creativeWorkCommonFields` into a schema's existing field list.
|
|
280
|
+
* Existing fields with the same `name` win (schema-specific titles/validation
|
|
281
|
+
* are preserved). All common CW fields not already present are appended.
|
|
282
|
+
*/
|
|
283
|
+
declare function withCreativeWorkCommons(fields: SchemaFieldDef[]): SchemaFieldDef[];
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Metadata for Schema.org types — used by the TypePickerInput.
|
|
287
|
+
* Each entry describes a type for the visual picker UI.
|
|
288
|
+
*/
|
|
289
|
+
type SchemaTypeCategory = 'content' | 'commerce' | 'media' | 'people' | 'navigation' | 'location' | 'software' | 'education';
|
|
290
|
+
interface SchemaTypeInfo {
|
|
291
|
+
/** Internal Sanity type name, e.g. "schemaOrgArticle" */
|
|
292
|
+
type: string;
|
|
293
|
+
/** Display title */
|
|
294
|
+
title: string;
|
|
295
|
+
/** Short description shown in the picker */
|
|
296
|
+
description: string;
|
|
297
|
+
/** Category for grouping */
|
|
298
|
+
category: SchemaTypeCategory;
|
|
299
|
+
/** Search keywords (matched in addition to title) */
|
|
300
|
+
keywords: string[];
|
|
301
|
+
}
|
|
302
|
+
declare const CATEGORY_LABELS: Record<SchemaTypeCategory, string>;
|
|
303
|
+
declare const CATEGORY_ORDER: SchemaTypeCategory[];
|
|
304
|
+
declare const SCHEMA_TYPE_METADATA: SchemaTypeInfo[];
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Custom input component for the `schemaOrg` array type.
|
|
308
|
+
*
|
|
309
|
+
* Wraps the default array input and injects the `TypeArrayFunctions`
|
|
310
|
+
* component for a categorized, searchable type picker experience.
|
|
311
|
+
*
|
|
312
|
+
* @example Usage in `schemaOrg.ts`:
|
|
313
|
+
* ```ts
|
|
314
|
+
* defineType({
|
|
315
|
+
* name: 'schemaOrg',
|
|
316
|
+
* type: 'array',
|
|
317
|
+
* components: { input: TypePickerInput },
|
|
318
|
+
* // ...
|
|
319
|
+
* })
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
322
|
+
declare function TypePickerInput(props: InputProps): JSX.Element;
|
|
323
|
+
|
|
85
324
|
/** Per-type validation overrides for the combined `schemaOrg()` plugin. */
|
|
86
325
|
interface SchemaOrgCombinedConfig {
|
|
87
326
|
website?: SchemaOrgConfig;
|
|
@@ -108,6 +347,20 @@ interface SchemaOrgCombinedConfig {
|
|
|
108
347
|
place?: SchemaOrgConfig;
|
|
109
348
|
videoObject?: SchemaOrgConfig;
|
|
110
349
|
course?: SchemaOrgConfig;
|
|
350
|
+
recipe?: SchemaOrgConfig;
|
|
351
|
+
service?: SchemaOrgConfig;
|
|
352
|
+
socialMediaPosting?: SchemaOrgConfig;
|
|
353
|
+
legalService?: SchemaOrgConfig;
|
|
354
|
+
country?: SchemaOrgConfig;
|
|
355
|
+
jobPosting?: SchemaOrgConfig;
|
|
356
|
+
restaurant?: SchemaOrgConfig;
|
|
357
|
+
movie?: SchemaOrgConfig;
|
|
358
|
+
book?: SchemaOrgConfig;
|
|
359
|
+
newsArticle?: SchemaOrgConfig;
|
|
360
|
+
itemList?: SchemaOrgConfig;
|
|
361
|
+
profilePage?: SchemaOrgConfig;
|
|
362
|
+
musicRecording?: SchemaOrgConfig;
|
|
363
|
+
musicAlbum?: SchemaOrgConfig;
|
|
111
364
|
}
|
|
112
365
|
declare const schemaOrgWebsitePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
113
366
|
declare const schemaOrgOrganizationPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
@@ -133,6 +386,20 @@ declare const schemaOrgEventPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
|
133
386
|
declare const schemaOrgPlacePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
134
387
|
declare const schemaOrgVideoObjectPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
135
388
|
declare const schemaOrgCoursePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
389
|
+
declare const schemaOrgRecipePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
390
|
+
declare const schemaOrgServicePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
391
|
+
declare const schemaOrgSocialMediaPostingPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
392
|
+
declare const schemaOrgLegalServicePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
393
|
+
declare const schemaOrgCountryPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
394
|
+
declare const schemaOrgJobPostingPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
395
|
+
declare const schemaOrgRestaurantPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
396
|
+
declare const schemaOrgMoviePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
397
|
+
declare const schemaOrgBookPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
398
|
+
declare const schemaOrgNewsArticlePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
399
|
+
declare const schemaOrgItemListPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
400
|
+
declare const schemaOrgProfilePagePlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
401
|
+
declare const schemaOrgMusicRecordingPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
402
|
+
declare const schemaOrgMusicAlbumPlugin: sanity.Plugin<void | SchemaOrgConfig>;
|
|
136
403
|
/**
|
|
137
404
|
* Registers **all** Schema.org types as a single Sanity plugin.
|
|
138
405
|
* Includes a combined `schemaOrg` array type for multi-type fields.
|
|
@@ -164,16 +431,11 @@ declare function schemaOrgArticle(config?: SchemaOrgArticleConfig): SchemaTypeDe
|
|
|
164
431
|
|
|
165
432
|
/**
|
|
166
433
|
* Schema.org BlogPosting — Sanity object type.
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```ts
|
|
170
|
-
* import { schemaOrgBlogPosting } from 'sanity-plugin-seofields/schema/blogPosting'
|
|
171
|
-
*
|
|
172
|
-
* schemaOrgBlogPosting()
|
|
173
|
-
* ```
|
|
174
434
|
*/
|
|
175
435
|
declare function schemaOrgBlogPosting(config?: SchemaOrgBlogPostingConfig): SchemaTypeDefinition;
|
|
176
436
|
|
|
437
|
+
declare function schemaOrgBook(config?: SchemaOrgBookConfig): SchemaTypeDefinition;
|
|
438
|
+
|
|
177
439
|
declare function schemaOrgBrand(config?: SchemaOrgBrandConfig): SchemaTypeDefinition;
|
|
178
440
|
|
|
179
441
|
/**
|
|
@@ -190,22 +452,8 @@ declare function schemaOrgBreadcrumbList(config?: SchemaOrgBreadcrumbListConfig)
|
|
|
190
452
|
|
|
191
453
|
declare function schemaOrgContactPoint(config?: SchemaOrgContactPointConfig): SchemaTypeDefinition;
|
|
192
454
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
*
|
|
196
|
-
* @example
|
|
197
|
-
* ```ts
|
|
198
|
-
* import { schemaOrgCourse } from 'sanity-plugin-seofields/schema/course'
|
|
199
|
-
*
|
|
200
|
-
* // Default
|
|
201
|
-
* schemaOrgCourse()
|
|
202
|
-
*
|
|
203
|
-
* // Custom validation messages
|
|
204
|
-
* schemaOrgCourse({
|
|
205
|
-
* validation: { nameRequired: 'Please enter the course name.' },
|
|
206
|
-
* })
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
455
|
+
declare function schemaOrgCountry(config?: SchemaOrgCountryConfig): SchemaTypeDefinition;
|
|
456
|
+
|
|
209
457
|
declare function schemaOrgCourse(config?: SchemaOrgCourseConfig): SchemaTypeDefinition;
|
|
210
458
|
|
|
211
459
|
declare function schemaOrgEvent(config?: SchemaOrgEventConfig): SchemaTypeDefinition;
|
|
@@ -224,20 +472,27 @@ declare function schemaOrgFAQPage(config?: SchemaOrgFAQPageConfig): SchemaTypeDe
|
|
|
224
472
|
|
|
225
473
|
/**
|
|
226
474
|
* Schema.org HowTo — Sanity object type.
|
|
227
|
-
*
|
|
228
|
-
* @example
|
|
229
|
-
* ```ts
|
|
230
|
-
* import { schemaOrgHowTo } from 'sanity-plugin-seofields/schema/howTo'
|
|
231
|
-
*
|
|
232
|
-
* schemaOrgHowTo()
|
|
233
|
-
* ```
|
|
234
475
|
*/
|
|
235
476
|
declare function schemaOrgHowTo(config?: SchemaOrgHowToConfig): SchemaTypeDefinition;
|
|
236
477
|
|
|
237
478
|
declare function schemaOrgImageObject(config?: SchemaOrgImageObjectConfig): SchemaTypeDefinition;
|
|
238
479
|
|
|
480
|
+
declare function schemaOrgItemList(config?: SchemaOrgItemListConfig): SchemaTypeDefinition;
|
|
481
|
+
|
|
482
|
+
declare function schemaOrgJobPosting(config?: SchemaOrgJobPostingConfig): SchemaTypeDefinition;
|
|
483
|
+
|
|
484
|
+
declare function schemaOrgLegalService(config?: SchemaOrgLegalServiceConfig): SchemaTypeDefinition;
|
|
485
|
+
|
|
239
486
|
declare function schemaOrgLocalBusiness(config?: SchemaOrgLocalBusinessConfig): SchemaTypeDefinition;
|
|
240
487
|
|
|
488
|
+
declare function schemaOrgMovie(config?: SchemaOrgMovieConfig): SchemaTypeDefinition;
|
|
489
|
+
|
|
490
|
+
declare function schemaOrgMusicAlbum(config?: SchemaOrgMusicAlbumConfig): SchemaTypeDefinition;
|
|
491
|
+
|
|
492
|
+
declare function schemaOrgMusicRecording(config?: SchemaOrgMusicRecordingConfig): SchemaTypeDefinition;
|
|
493
|
+
|
|
494
|
+
declare function schemaOrgNewsArticle(config?: SchemaOrgNewsArticleConfig): SchemaTypeDefinition;
|
|
495
|
+
|
|
241
496
|
declare function schemaOrgOffer(config?: SchemaOrgOfferConfig): SchemaTypeDefinition;
|
|
242
497
|
|
|
243
498
|
/**
|
|
@@ -298,17 +553,39 @@ declare function schemaOrgPostalAddress(config?: SchemaOrgPostalAddressConfig):
|
|
|
298
553
|
*/
|
|
299
554
|
declare function schemaOrgProduct(config?: SchemaOrgProductConfig): SchemaTypeDefinition;
|
|
300
555
|
|
|
556
|
+
declare function schemaOrgProfilePage(config?: SchemaOrgProfilePageConfig): SchemaTypeDefinition;
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Schema.org Recipe — Sanity object type.
|
|
560
|
+
*/
|
|
561
|
+
declare function schemaOrgRecipe(config?: SchemaOrgRecipeConfig): SchemaTypeDefinition;
|
|
562
|
+
|
|
563
|
+
declare function schemaOrgRestaurant(config?: SchemaOrgRestaurantConfig): SchemaTypeDefinition;
|
|
564
|
+
|
|
301
565
|
/**
|
|
302
566
|
* Schema.org Review — Sanity object type.
|
|
567
|
+
*/
|
|
568
|
+
declare function schemaOrgReview(config?: SchemaOrgReviewConfig): SchemaTypeDefinition;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Schema.org Service — Sanity object type.
|
|
303
572
|
*
|
|
304
573
|
* @example
|
|
305
574
|
* ```ts
|
|
306
|
-
* import {
|
|
575
|
+
* import { schemaOrgService } from 'sanity-plugin-seofields/schema/service'
|
|
576
|
+
*
|
|
577
|
+
* // Default
|
|
578
|
+
* schemaOrgService()
|
|
307
579
|
*
|
|
308
|
-
*
|
|
580
|
+
* // Custom validation messages
|
|
581
|
+
* schemaOrgService({
|
|
582
|
+
* validation: { nameRequired: 'Please enter the service name.' },
|
|
583
|
+
* })
|
|
309
584
|
* ```
|
|
310
585
|
*/
|
|
311
|
-
declare function
|
|
586
|
+
declare function schemaOrgService(config?: SchemaOrgServiceConfig): SchemaTypeDefinition;
|
|
587
|
+
|
|
588
|
+
declare function schemaOrgSocialMediaPosting(config?: SchemaOrgSocialMediaPostingConfig): SchemaTypeDefinition;
|
|
312
589
|
|
|
313
590
|
/**
|
|
314
591
|
* Schema.org SoftwareApplication — Sanity object type.
|
|
@@ -384,4 +661,4 @@ declare function schemaOrgWebPage(config?: SchemaOrgWebPageConfig): SchemaTypeDe
|
|
|
384
661
|
*/
|
|
385
662
|
declare function schemaOrgWebsite(config?: SchemaOrgWebsiteConfig): SchemaTypeDefinition;
|
|
386
663
|
|
|
387
|
-
export { type SchemaFieldDef, type SchemaFieldOption, SchemaOrgAggregateRatingConfig, SchemaOrgArticleConfig, SchemaOrgBlogPostingConfig, SchemaOrgBrandConfig, SchemaOrgBreadcrumbListConfig, type SchemaOrgCombinedConfig, type SchemaOrgConfig, SchemaOrgContactPointConfig, SchemaOrgCourseConfig, SchemaOrgEventConfig, SchemaOrgFAQPageConfig, SchemaOrgHowToConfig, SchemaOrgImageObjectConfig, SchemaOrgLocalBusinessConfig, SchemaOrgOfferConfig, SchemaOrgOrganizationConfig, SchemaOrgPersonConfig, SchemaOrgPlaceConfig, SchemaOrgPostalAddressConfig, SchemaOrgProductConfig, SchemaOrgReviewConfig, SchemaOrgSoftwareApplicationConfig, SchemaOrgVideoObjectConfig, SchemaOrgWebApplicationConfig, SchemaOrgWebPageConfig, SchemaOrgWebsiteConfig, type SchemaTypeDef, buildGenericJsonLd, generateSchemaType, schemaOrg, schemaOrgAggregateRating, schemaOrgAggregateRatingPlugin, schemaOrgArticle, schemaOrgArticlePlugin, schemaOrgBlogPosting, schemaOrgBlogPostingPlugin, schemaOrgBrand, schemaOrgBrandPlugin, schemaOrgBreadcrumbList, schemaOrgBreadcrumbListPlugin, schemaOrgContactPoint, schemaOrgContactPointPlugin, schemaOrgCourse, schemaOrgCoursePlugin, schemaOrgEvent, schemaOrgEventPlugin, schemaOrgFAQPage, schemaOrgFAQPagePlugin, schemaOrgHowTo, schemaOrgHowToPlugin, schemaOrgImageObject, schemaOrgImageObjectPlugin, schemaOrgLocalBusiness, schemaOrgLocalBusinessPlugin, schemaOrgOffer, schemaOrgOfferPlugin, schemaOrgOrganization, schemaOrgOrganizationPlugin, schemaOrgPerson, schemaOrgPersonPlugin, schemaOrgPlace, schemaOrgPlacePlugin, schemaOrgPostalAddress, schemaOrgPostalAddressPlugin, schemaOrgProduct, schemaOrgProductPlugin, schemaOrgReview, schemaOrgReviewPlugin, schemaOrgSoftwareApplication, schemaOrgSoftwareApplicationPlugin, schemaOrgVideoObject, schemaOrgVideoObjectPlugin, schemaOrgWebApplication, schemaOrgWebApplicationPlugin, schemaOrgWebPage, schemaOrgWebPagePlugin, schemaOrgWebsite, schemaOrgWebsitePlugin };
|
|
664
|
+
export { CATEGORY_LABELS, CATEGORY_ORDER, type DatePublishedFieldOptions, IETF_LANGUAGE_OPTIONS, type InLanguageFieldOptions, type PolymorphicOptions, SCHEMA_TYPE_METADATA, type SchemaFieldDef, type SchemaFieldOption, SchemaOrgAggregateRatingConfig, SchemaOrgArticleConfig, SchemaOrgBlogPostingConfig, SchemaOrgBookConfig, SchemaOrgBrandConfig, SchemaOrgBreadcrumbListConfig, type SchemaOrgCombinedConfig, type SchemaOrgConfig, SchemaOrgContactPointConfig, SchemaOrgCountryConfig, SchemaOrgCourseConfig, SchemaOrgEventConfig, SchemaOrgFAQPageConfig, SchemaOrgHowToConfig, SchemaOrgImageObjectConfig, SchemaOrgItemListConfig, SchemaOrgJobPostingConfig, SchemaOrgLegalServiceConfig, SchemaOrgLocalBusinessConfig, SchemaOrgMovieConfig, SchemaOrgMusicAlbumConfig, SchemaOrgMusicRecordingConfig, SchemaOrgNewsArticleConfig, SchemaOrgOfferConfig, SchemaOrgOrganizationConfig, SchemaOrgPersonConfig, SchemaOrgPlaceConfig, SchemaOrgPostalAddressConfig, SchemaOrgProductConfig, SchemaOrgProfilePageConfig, SchemaOrgRecipeConfig, SchemaOrgRestaurantConfig, SchemaOrgReviewConfig, SchemaOrgServiceConfig, SchemaOrgSocialMediaPostingConfig, SchemaOrgSoftwareApplicationConfig, SchemaOrgVideoObjectConfig, SchemaOrgWebApplicationConfig, SchemaOrgWebPageConfig, SchemaOrgWebsiteConfig, type SchemaTypeCategory, type SchemaTypeDef, type SchemaTypeInfo, type SimpleFieldOptions, TypePickerInput, buildGenericJsonLd, datePublishedField, descriptionField, generateSchemaType, headlineField, inLanguageField, nameField, polymorphicAdditionalType, polymorphicArchivedAt, polymorphicAuthor, polymorphicCitation, polymorphicContentRating, polymorphicContributor, polymorphicCopyrightHolder, polymorphicCreator, polymorphicFunder, polymorphicGenre, polymorphicIdentifier, polymorphicImage, polymorphicIsBasedOn, polymorphicIsPartOf, polymorphicKeywords, polymorphicLicense, polymorphicLocationCreated, polymorphicMaintainer, polymorphicMaterial, polymorphicOwner, polymorphicPublisher, schemaOrg, schemaOrgAggregateRating, schemaOrgAggregateRatingPlugin, schemaOrgArticle, schemaOrgArticlePlugin, schemaOrgBlogPosting, schemaOrgBlogPostingPlugin, schemaOrgBook, schemaOrgBookPlugin, schemaOrgBrand, schemaOrgBrandPlugin, schemaOrgBreadcrumbList, schemaOrgBreadcrumbListPlugin, schemaOrgContactPoint, schemaOrgContactPointPlugin, schemaOrgCountry, schemaOrgCountryPlugin, schemaOrgCourse, schemaOrgCoursePlugin, schemaOrgEvent, schemaOrgEventPlugin, schemaOrgFAQPage, schemaOrgFAQPagePlugin, schemaOrgHowTo, schemaOrgHowToPlugin, schemaOrgImageObject, schemaOrgImageObjectPlugin, schemaOrgItemList, schemaOrgItemListPlugin, schemaOrgJobPosting, schemaOrgJobPostingPlugin, schemaOrgLegalService, schemaOrgLegalServicePlugin, schemaOrgLocalBusiness, schemaOrgLocalBusinessPlugin, schemaOrgMovie, schemaOrgMoviePlugin, schemaOrgMusicAlbum, schemaOrgMusicAlbumPlugin, schemaOrgMusicRecording, schemaOrgMusicRecordingPlugin, schemaOrgNewsArticle, schemaOrgNewsArticlePlugin, schemaOrgOffer, schemaOrgOfferPlugin, schemaOrgOrganization, schemaOrgOrganizationPlugin, schemaOrgPerson, schemaOrgPersonPlugin, schemaOrgPlace, schemaOrgPlacePlugin, schemaOrgPostalAddress, schemaOrgPostalAddressPlugin, schemaOrgProduct, schemaOrgProductPlugin, schemaOrgProfilePage, schemaOrgProfilePagePlugin, schemaOrgRecipe, schemaOrgRecipePlugin, schemaOrgRestaurant, schemaOrgRestaurantPlugin, schemaOrgReview, schemaOrgReviewPlugin, schemaOrgService, schemaOrgServicePlugin, schemaOrgSocialMediaPosting, schemaOrgSocialMediaPostingPlugin, schemaOrgSoftwareApplication, schemaOrgSoftwareApplicationPlugin, schemaOrgVideoObject, schemaOrgVideoObjectPlugin, schemaOrgWebApplication, schemaOrgWebApplicationPlugin, schemaOrgWebPage, schemaOrgWebPagePlugin, schemaOrgWebsite, schemaOrgWebsitePlugin, urlField, withCreativeWorkCommons, withThingCommons };
|