sanity-plugin-seofields 1.3.1 → 1.4.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.
@@ -0,0 +1,438 @@
1
+ import { JSX } from 'react';
2
+ import { x as SchemaOrgAggregateRatingData, y as SchemaOrgArticleData, z as SchemaOrgBlogPostingData, A as SchemaOrgBrandData, B as SchemaOrgBreadcrumbListData, C as SchemaOrgContactPointData, D as SchemaOrgCourseData, E as SchemaOrgEventData, F as SchemaOrgFAQPageData, G as SchemaOrgHowToData, H as SchemaOrgImageObjectData, I as SchemaOrgLocalBusinessData, J as SchemaOrgOfferData, K as SchemaOrgOrganizationData, L as SchemaOrgPersonData, M as SchemaOrgPlaceData, N as SchemaOrgPostalAddressData, P as SchemaOrgProductData, Q as SchemaOrgReviewData, R as SchemaOrgSoftwareApplicationData, T as SchemaOrgVideoObjectData, U as SchemaOrgWebApplicationData, V as SchemaOrgWebPageData, W as SchemaOrgWebsiteData } from '../types-CVaAX7uy.cjs';
3
+ import { S as SanityImage } from '../types-R3n9Fu4w.cjs';
4
+
5
+ /**
6
+ * <SchemaOrgScripts> — Renders multiple Schema.org JSON-LD script tags
7
+ * from a combined `schemaOrg` array field.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { SchemaOrgScripts } from 'sanity-plugin-seofields/next'
12
+ *
13
+ * const data = await sanityFetch({ query: `*[_type == "settings"][0]{ structuredData }` })
14
+ *
15
+ * <SchemaOrgScripts data={data.structuredData} />
16
+ * ```
17
+ */
18
+
19
+ interface SchemaOrgScriptsProps {
20
+ /** Array of Schema.org items from the combined `schemaOrg` field. */
21
+ data?: Array<Record<string, unknown>> | null;
22
+ }
23
+ /**
24
+ * Renders one `<script type="application/ld+json">` tag per Schema.org item.
25
+ * Skips items that fail validation (missing required fields).
26
+ */
27
+ declare function SchemaOrgScripts({ data }: SchemaOrgScriptsProps): JSX.Element | null;
28
+
29
+ interface AggregateRatingSchemaProps {
30
+ data?: SchemaOrgAggregateRatingData | null;
31
+ }
32
+ declare function buildAggregateRatingJsonLd(data?: SchemaOrgAggregateRatingData | null): Record<string, unknown> | null;
33
+ declare function AggregateRatingSchema({ data }: AggregateRatingSchemaProps): JSX.Element | null;
34
+
35
+ interface ArticleSchemaProps {
36
+ /** The Schema.org Article data from your Sanity GROQ query. */
37
+ data?: SchemaOrgArticleData | null;
38
+ }
39
+ /**
40
+ * Builds a Schema.org Article JSON-LD object from Sanity data.
41
+ * Returns `null` if required fields (headline) are missing.
42
+ */
43
+ declare function buildArticleJsonLd(data?: SchemaOrgArticleData | null): Record<string, unknown> | null;
44
+ /**
45
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Article data.
46
+ * Renders nothing if required fields are missing.
47
+ */
48
+ declare function ArticleSchema({ data }: ArticleSchemaProps): JSX.Element | null;
49
+
50
+ interface BlogPostingSchemaProps {
51
+ /** The Schema.org BlogPosting data from your Sanity GROQ query. */
52
+ data?: SchemaOrgBlogPostingData | null;
53
+ }
54
+ /**
55
+ * Builds a Schema.org BlogPosting JSON-LD object from Sanity data.
56
+ * Returns `null` if required fields (headline) are missing.
57
+ */
58
+ declare function buildBlogPostingJsonLd(data?: SchemaOrgBlogPostingData | null): Record<string, unknown> | null;
59
+ /**
60
+ * Renders a `<script type="application/ld+json">` tag with Schema.org BlogPosting data.
61
+ * Renders nothing if required fields are missing.
62
+ */
63
+ declare function BlogPostingSchema({ data }: BlogPostingSchemaProps): JSX.Element | null;
64
+
65
+ interface BrandSchemaProps {
66
+ data?: SchemaOrgBrandData | null;
67
+ }
68
+ declare function buildBrandJsonLd(data?: SchemaOrgBrandData | null): Record<string, unknown> | null;
69
+ declare function BrandSchema({ data }: BrandSchemaProps): JSX.Element | null;
70
+
71
+ interface BreadcrumbListSchemaProps {
72
+ /** The Schema.org BreadcrumbList data from your Sanity GROQ query. */
73
+ data?: SchemaOrgBreadcrumbListData | null;
74
+ }
75
+ /**
76
+ * Builds a Schema.org BreadcrumbList JSON-LD object from Sanity data.
77
+ * Returns `null` if data is missing.
78
+ */
79
+ declare function buildBreadcrumbListJsonLd(data?: SchemaOrgBreadcrumbListData | null): Record<string, unknown> | null;
80
+ /**
81
+ * Renders a `<script type="application/ld+json">` tag with Schema.org BreadcrumbList data.
82
+ * Renders nothing if data is missing.
83
+ */
84
+ declare function BreadcrumbListSchema({ data }: BreadcrumbListSchemaProps): JSX.Element | null;
85
+
86
+ interface ContactPointSchemaProps {
87
+ data?: SchemaOrgContactPointData | null;
88
+ }
89
+ declare function buildContactPointJsonLd(data?: SchemaOrgContactPointData | null): Record<string, unknown> | null;
90
+ declare function ContactPointSchema({ data }: ContactPointSchemaProps): JSX.Element | null;
91
+
92
+ /**
93
+ * <CourseSchema> — Renders Schema.org Course JSON-LD structured data.
94
+ *
95
+ * @example
96
+ * ```tsx
97
+ * import { CourseSchema } from 'sanity-plugin-seofields/next/course'
98
+ *
99
+ * const data = await sanityFetch({ query: `*[_type == "course"][0]{ seo }` })
100
+ *
101
+ * <CourseSchema data={data.seo} />
102
+ * ```
103
+ */
104
+
105
+ interface CourseSchemaProps {
106
+ /** The Schema.org Course data from your Sanity GROQ query. */
107
+ data?: SchemaOrgCourseData | null;
108
+ }
109
+ /**
110
+ * Builds a Schema.org Course JSON-LD object from Sanity data.
111
+ * Returns `null` if required fields (name) are missing.
112
+ */
113
+ declare function buildCourseJsonLd(data?: SchemaOrgCourseData | null): Record<string, unknown> | null;
114
+ /**
115
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Course data.
116
+ * Renders nothing if required fields are missing.
117
+ */
118
+ declare function CourseSchema({ data }: CourseSchemaProps): JSX.Element | null;
119
+
120
+ interface EventSchemaProps {
121
+ /** The Schema.org Event data from your Sanity GROQ query. */
122
+ data?: SchemaOrgEventData | null;
123
+ }
124
+ /**
125
+ * Builds a Schema.org Event JSON-LD object from Sanity data.
126
+ * Returns `null` if required fields (name) are missing.
127
+ */
128
+ declare function buildEventJsonLd(data?: SchemaOrgEventData | null): Record<string, unknown> | null;
129
+ /**
130
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Event data.
131
+ * Renders nothing if required fields are missing.
132
+ */
133
+ declare function EventSchema({ data }: EventSchemaProps): JSX.Element | null;
134
+
135
+ interface FAQPageSchemaProps {
136
+ /** The Schema.org FAQPage data from your Sanity GROQ query. */
137
+ data?: SchemaOrgFAQPageData | null;
138
+ }
139
+ /**
140
+ * Builds a Schema.org FAQPage JSON-LD object from Sanity data.
141
+ * Returns `null` if data is missing.
142
+ */
143
+ declare function buildFAQPageJsonLd(data?: SchemaOrgFAQPageData | null): Record<string, unknown> | null;
144
+ /**
145
+ * Renders a `<script type="application/ld+json">` tag with Schema.org FAQPage data.
146
+ * Renders nothing if data is missing.
147
+ */
148
+ declare function FAQPageSchema({ data }: FAQPageSchemaProps): JSX.Element | null;
149
+
150
+ interface HowToSchemaProps {
151
+ /** The Schema.org HowTo data from your Sanity GROQ query. */
152
+ data?: SchemaOrgHowToData | null;
153
+ }
154
+ /**
155
+ * Builds a Schema.org HowTo JSON-LD object from Sanity data.
156
+ * Returns `null` if required fields (name) are missing.
157
+ */
158
+ declare function buildHowToJsonLd(data?: SchemaOrgHowToData | null): Record<string, unknown> | null;
159
+ /**
160
+ * Renders a `<script type="application/ld+json">` tag with Schema.org HowTo data.
161
+ * Renders nothing if required fields are missing.
162
+ */
163
+ declare function HowToSchema({ data }: HowToSchemaProps): JSX.Element | null;
164
+
165
+ interface ImageObjectSchemaProps {
166
+ data?: SchemaOrgImageObjectData | null;
167
+ }
168
+ declare function buildImageObjectJsonLd(data?: SchemaOrgImageObjectData | null): Record<string, unknown> | null;
169
+ declare function ImageObjectSchema({ data }: ImageObjectSchemaProps): JSX.Element | null;
170
+
171
+ interface LocalBusinessSchemaProps {
172
+ /** The Schema.org LocalBusiness data from your Sanity GROQ query. */
173
+ data?: SchemaOrgLocalBusinessData | null;
174
+ }
175
+ /**
176
+ * Builds a Schema.org LocalBusiness JSON-LD object from Sanity data.
177
+ * Returns `null` if required fields (name) are missing.
178
+ */
179
+ declare function buildLocalBusinessJsonLd(data?: SchemaOrgLocalBusinessData | null): Record<string, unknown> | null;
180
+ /**
181
+ * Renders a `<script type="application/ld+json">` tag with Schema.org LocalBusiness data.
182
+ * Renders nothing if required fields are missing.
183
+ */
184
+ declare function LocalBusinessSchema({ data }: LocalBusinessSchemaProps): JSX.Element | null;
185
+
186
+ interface OfferSchemaProps {
187
+ data?: SchemaOrgOfferData | null;
188
+ }
189
+ declare function buildOfferJsonLd(data?: SchemaOrgOfferData | null): Record<string, unknown> | null;
190
+ declare function OfferSchema({ data }: OfferSchemaProps): JSX.Element | null;
191
+
192
+ /**
193
+ * <OrganizationSchema> — Renders Schema.org Organization JSON-LD structured data.
194
+ *
195
+ * @example
196
+ * ```tsx
197
+ * import { OrganizationSchema } from 'sanity-plugin-seofields/next/organization'
198
+ *
199
+ * const data = await sanityFetch({ query: `*[_type == "settings"][0]{ organization }` })
200
+ *
201
+ * <OrganizationSchema data={data.organization} />
202
+ * ```
203
+ */
204
+
205
+ interface OrganizationSchemaProps {
206
+ /** The Schema.org Organization data from your Sanity GROQ query. */
207
+ data?: SchemaOrgOrganizationData | null;
208
+ /**
209
+ * Resolve a Sanity image asset to a URL string (for the logo field).
210
+ * Only needed if you use the Sanity image upload field instead of logoUrl.
211
+ *
212
+ * @example
213
+ * imageUrlResolver={(img) => urlFor(img).width(600).url()}
214
+ */
215
+ imageUrlResolver?: (image: SanityImage) => string | null | undefined;
216
+ }
217
+ /**
218
+ * Builds a Schema.org Organization JSON-LD object from Sanity data.
219
+ * Returns `null` if required fields (name, url) are missing.
220
+ */
221
+ declare function buildOrganizationJsonLd(data?: SchemaOrgOrganizationData | null, imageUrlResolver?: (image: SanityImage) => string | null | undefined): Record<string, unknown> | null;
222
+ /**
223
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Organization data.
224
+ * Renders nothing if required fields are missing.
225
+ */
226
+ declare function OrganizationSchema({ data, imageUrlResolver, }: OrganizationSchemaProps): JSX.Element | null;
227
+
228
+ /**
229
+ * <PersonSchema> — Renders Schema.org Person JSON-LD structured data.
230
+ *
231
+ * @example
232
+ * ```tsx
233
+ * import { PersonSchema } from 'sanity-plugin-seofields/next/person'
234
+ *
235
+ * const data = await sanityFetch({ query: `*[_type == "teamMember"][0]{ person }` })
236
+ *
237
+ * <PersonSchema data={data.person} />
238
+ * ```
239
+ */
240
+
241
+ interface PersonSchemaProps {
242
+ /** The Schema.org Person data from your Sanity GROQ query. */
243
+ data?: SchemaOrgPersonData | null;
244
+ }
245
+ /**
246
+ * Builds a Schema.org Person JSON-LD object from Sanity data.
247
+ * Returns `null` if required fields (name) are missing.
248
+ */
249
+ declare function buildPersonJsonLd(data?: SchemaOrgPersonData | null): Record<string, unknown> | null;
250
+ /**
251
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Person data.
252
+ * Renders nothing if required fields are missing.
253
+ */
254
+ declare function PersonSchema({ data }: PersonSchemaProps): JSX.Element | null;
255
+
256
+ interface PlaceSchemaProps {
257
+ /** The Schema.org Place data from your Sanity GROQ query. */
258
+ data?: SchemaOrgPlaceData | null;
259
+ }
260
+ /**
261
+ * Builds a Schema.org Place JSON-LD object from Sanity data.
262
+ * Returns `null` if required fields (name) are missing.
263
+ */
264
+ declare function buildPlaceJsonLd(data?: SchemaOrgPlaceData | null): Record<string, unknown> | null;
265
+ /**
266
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Place data.
267
+ * Renders nothing if required fields are missing.
268
+ */
269
+ declare function PlaceSchema({ data }: PlaceSchemaProps): JSX.Element | null;
270
+
271
+ interface PostalAddressSchemaProps {
272
+ data?: SchemaOrgPostalAddressData | null;
273
+ }
274
+ declare function buildPostalAddressJsonLd(data?: SchemaOrgPostalAddressData | null): Record<string, unknown> | null;
275
+ declare function PostalAddressSchema({ data }: PostalAddressSchemaProps): JSX.Element | null;
276
+
277
+ /**
278
+ * <ProductSchema> — Renders Schema.org Product JSON-LD structured data.
279
+ *
280
+ * @example
281
+ * ```tsx
282
+ * import { ProductSchema } from 'sanity-plugin-seofields/next/product'
283
+ *
284
+ * const data = await sanityFetch({ query: `*[_type == "product"][0]{ seo }` })
285
+ *
286
+ * <ProductSchema data={data.seo} />
287
+ * ```
288
+ */
289
+
290
+ interface ProductSchemaProps {
291
+ /** The Schema.org Product data from your Sanity GROQ query. */
292
+ data?: SchemaOrgProductData | null;
293
+ }
294
+ /**
295
+ * Builds a Schema.org Product JSON-LD object from Sanity data.
296
+ * Returns `null` if required fields (name) are missing.
297
+ */
298
+ declare function buildProductJsonLd(data?: SchemaOrgProductData | null): Record<string, unknown> | null;
299
+ /**
300
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Product data.
301
+ * Renders nothing if required fields are missing.
302
+ */
303
+ declare function ProductSchema({ data }: ProductSchemaProps): JSX.Element | null;
304
+
305
+ interface ReviewSchemaProps {
306
+ /** The Schema.org Review data from your Sanity GROQ query. */
307
+ data?: SchemaOrgReviewData | null;
308
+ }
309
+ /**
310
+ * Builds a Schema.org Review JSON-LD object from Sanity data.
311
+ * Returns `null` if data is missing.
312
+ */
313
+ declare function buildReviewJsonLd(data?: SchemaOrgReviewData | null): Record<string, unknown> | null;
314
+ /**
315
+ * Renders a `<script type="application/ld+json">` tag with Schema.org Review data.
316
+ * Renders nothing if data is missing.
317
+ */
318
+ declare function ReviewSchema({ data }: ReviewSchemaProps): JSX.Element | null;
319
+
320
+ /**
321
+ * <SoftwareApplicationSchema> — Renders Schema.org SoftwareApplication JSON-LD structured data.
322
+ *
323
+ * @example
324
+ * ```tsx
325
+ * import { SoftwareApplicationSchema } from 'sanity-plugin-seofields/next/softwareApplication'
326
+ *
327
+ * const data = await sanityFetch({ query: `*[_type == "app"][0]{ seo }` })
328
+ *
329
+ * <SoftwareApplicationSchema data={data.seo} />
330
+ * ```
331
+ */
332
+
333
+ interface SoftwareApplicationSchemaProps {
334
+ /** The Schema.org SoftwareApplication data from your Sanity GROQ query. */
335
+ data?: SchemaOrgSoftwareApplicationData | null;
336
+ }
337
+ /**
338
+ * Builds a Schema.org SoftwareApplication JSON-LD object from Sanity data.
339
+ * Returns `null` if required fields (name) are missing.
340
+ */
341
+ declare function buildSoftwareApplicationJsonLd(data?: SchemaOrgSoftwareApplicationData | null): Record<string, unknown> | null;
342
+ /**
343
+ * Renders a `<script type="application/ld+json">` tag with Schema.org SoftwareApplication data.
344
+ * Renders nothing if required fields are missing.
345
+ */
346
+ declare function SoftwareApplicationSchema({ data, }: SoftwareApplicationSchemaProps): JSX.Element | null;
347
+
348
+ interface VideoObjectSchemaProps {
349
+ data?: SchemaOrgVideoObjectData | null;
350
+ }
351
+ declare function buildVideoObjectJsonLd(data?: SchemaOrgVideoObjectData | null): Record<string, unknown> | null;
352
+ declare function VideoObjectSchema({ data }: VideoObjectSchemaProps): JSX.Element | null;
353
+
354
+ /**
355
+ * <WebApplicationSchema> — Renders Schema.org WebApplication JSON-LD structured data.
356
+ *
357
+ * @example
358
+ * ```tsx
359
+ * import { WebApplicationSchema } from 'sanity-plugin-seofields/next/webApplication'
360
+ *
361
+ * const data = await sanityFetch({ query: `*[_type == "app"][0]{ seo }` })
362
+ *
363
+ * <WebApplicationSchema data={data.seo} />
364
+ * ```
365
+ */
366
+
367
+ interface WebApplicationSchemaProps {
368
+ /** The Schema.org WebApplication data from your Sanity GROQ query. */
369
+ data?: SchemaOrgWebApplicationData | null;
370
+ }
371
+ /**
372
+ * Builds a Schema.org WebApplication JSON-LD object from Sanity data.
373
+ * Returns `null` if required fields (name, url) are missing.
374
+ */
375
+ declare function buildWebApplicationJsonLd(data?: SchemaOrgWebApplicationData | null): Record<string, unknown> | null;
376
+ /**
377
+ * Renders a `<script type="application/ld+json">` tag with Schema.org WebApplication data.
378
+ * Renders nothing if required fields are missing.
379
+ */
380
+ declare function WebApplicationSchema({ data }: WebApplicationSchemaProps): JSX.Element | null;
381
+
382
+ /**
383
+ * <WebPageSchema> — Renders Schema.org WebPage JSON-LD structured data.
384
+ *
385
+ * @example
386
+ * ```tsx
387
+ * import { WebPageSchema } from 'sanity-plugin-seofields/next/webPage'
388
+ *
389
+ * const data = await sanityFetch({ query: `*[_type == "page"][0]{ seo }` })
390
+ *
391
+ * <WebPageSchema data={data.seo} />
392
+ * ```
393
+ */
394
+
395
+ interface WebPageSchemaProps {
396
+ /** The Schema.org WebPage data from your Sanity GROQ query. */
397
+ data?: SchemaOrgWebPageData | null;
398
+ }
399
+ /**
400
+ * Builds a Schema.org WebPage JSON-LD object from Sanity data.
401
+ * Returns `null` if required fields (name, url) are missing.
402
+ */
403
+ declare function buildWebPageJsonLd(data?: SchemaOrgWebPageData | null): Record<string, unknown> | null;
404
+ /**
405
+ * Renders a `<script type="application/ld+json">` tag with Schema.org WebPage data.
406
+ * Renders nothing if required fields are missing.
407
+ */
408
+ declare function WebPageSchema({ data }: WebPageSchemaProps): JSX.Element | null;
409
+
410
+ /**
411
+ * <WebsiteSchema> — Renders Schema.org WebSite JSON-LD structured data.
412
+ *
413
+ * @example
414
+ * ```tsx
415
+ * import { WebsiteSchema } from 'sanity-plugin-seofields/next/website'
416
+ *
417
+ * const data = await sanityFetch({ query: `*[_type == "settings"][0]{ website }` })
418
+ *
419
+ * <WebsiteSchema data={data.website} />
420
+ * ```
421
+ */
422
+
423
+ interface WebsiteSchemaProps {
424
+ /** The Schema.org Website data from your Sanity GROQ query. */
425
+ data?: SchemaOrgWebsiteData | null;
426
+ }
427
+ /**
428
+ * Builds a Schema.org WebSite JSON-LD object from Sanity data.
429
+ * Returns `null` if required fields (name, url) are missing.
430
+ */
431
+ declare function buildWebsiteJsonLd(data?: SchemaOrgWebsiteData | null): Record<string, unknown> | null;
432
+ /**
433
+ * Renders a `<script type="application/ld+json">` tag with Schema.org WebSite data.
434
+ * Renders nothing if required fields are missing.
435
+ */
436
+ declare function WebsiteSchema({ data }: WebsiteSchemaProps): JSX.Element | null;
437
+
438
+ export { AggregateRatingSchema, type AggregateRatingSchemaProps, ArticleSchema, type ArticleSchemaProps, BlogPostingSchema, type BlogPostingSchemaProps, BrandSchema, type BrandSchemaProps, BreadcrumbListSchema, type BreadcrumbListSchemaProps, ContactPointSchema, type ContactPointSchemaProps, CourseSchema, type CourseSchemaProps, EventSchema, type EventSchemaProps, FAQPageSchema, type FAQPageSchemaProps, HowToSchema, type HowToSchemaProps, ImageObjectSchema, type ImageObjectSchemaProps, LocalBusinessSchema, type LocalBusinessSchemaProps, OfferSchema, type OfferSchemaProps, OrganizationSchema, type OrganizationSchemaProps, PersonSchema, type PersonSchemaProps, PlaceSchema, type PlaceSchemaProps, PostalAddressSchema, type PostalAddressSchemaProps, ProductSchema, type ProductSchemaProps, ReviewSchema, type ReviewSchemaProps, SchemaOrgScripts, type SchemaOrgScriptsProps, SoftwareApplicationSchema, type SoftwareApplicationSchemaProps, VideoObjectSchema, type VideoObjectSchemaProps, WebApplicationSchema, type WebApplicationSchemaProps, WebPageSchema, type WebPageSchemaProps, WebsiteSchema, type WebsiteSchemaProps, buildAggregateRatingJsonLd, buildArticleJsonLd, buildBlogPostingJsonLd, buildBrandJsonLd, buildBreadcrumbListJsonLd, buildContactPointJsonLd, buildCourseJsonLd, buildEventJsonLd, buildFAQPageJsonLd, buildHowToJsonLd, buildImageObjectJsonLd, buildLocalBusinessJsonLd, buildOfferJsonLd, buildOrganizationJsonLd, buildPersonJsonLd, buildPlaceJsonLd, buildPostalAddressJsonLd, buildProductJsonLd, buildReviewJsonLd, buildSoftwareApplicationJsonLd, buildVideoObjectJsonLd, buildWebApplicationJsonLd, buildWebPageJsonLd, buildWebsiteJsonLd };