sanity-plugin-seofields 1.3.0 → 1.3.2
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 +69 -40
- package/dist/index.cjs +297 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -7
- package/dist/index.d.ts +66 -7
- package/dist/index.js +298 -58
- package/dist/index.js.map +1 -1
- package/dist/next.d.cts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/{types-B91ena4g.d.cts → types-BtSRRG6C.d.cts} +16 -1
- package/dist/{types-B91ena4g.d.ts → types-BtSRRG6C.d.ts} +16 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as sanity from 'sanity';
|
|
2
2
|
import { SchemaTypeDefinition } from 'sanity';
|
|
3
|
-
import { D as DocumentWithSeoHealth } from './types-
|
|
4
|
-
export { S as SeoHealthMetrics,
|
|
3
|
+
import { D as DocumentWithSeoHealth, a as DeprecationWarning } from './types-BtSRRG6C.cjs';
|
|
4
|
+
export { S as SeoHealthMetrics, b as SeoHealthStatus } from './types-BtSRRG6C.cjs';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { StructureBuilder, ComponentBuilder } from 'sanity/structure';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -102,10 +102,28 @@ interface SeoFieldsPluginConfig {
|
|
|
102
102
|
/** Text shown when the query returns zero results. Defaults to "No documents found" */
|
|
103
103
|
noDocuments?: string;
|
|
104
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `showTypeColumn` instead. Will be removed in a future major version.
|
|
107
|
+
* @see https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md#132--2026-03-23
|
|
108
|
+
*/
|
|
105
109
|
display?: {
|
|
110
|
+
/** @deprecated Use top-level `showTypeColumn` instead. */
|
|
106
111
|
typeColumn?: boolean;
|
|
112
|
+
/** @deprecated Use top-level `showDocumentId` instead. */
|
|
107
113
|
documentId?: boolean;
|
|
108
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* Show or hide the document type column in the results table.
|
|
117
|
+
* Replaces the deprecated `display.typeColumn`.
|
|
118
|
+
* Defaults to `true`.
|
|
119
|
+
*/
|
|
120
|
+
showTypeColumn?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Show or hide the Sanity document `_id` under each title.
|
|
123
|
+
* Replaces the deprecated `display.documentId`.
|
|
124
|
+
* Defaults to `true`.
|
|
125
|
+
*/
|
|
126
|
+
showDocumentId?: boolean;
|
|
109
127
|
query?: {
|
|
110
128
|
/**
|
|
111
129
|
* Limit the dashboard to specific document types.
|
|
@@ -139,10 +157,23 @@ interface SeoFieldsPluginConfig {
|
|
|
139
157
|
* Used in both the Type column and the Type filter dropdown.
|
|
140
158
|
* Any type without an entry falls back to the raw `_type` string.
|
|
141
159
|
*
|
|
160
|
+
* @deprecated Use `typeDisplayLabels` instead. Will be removed in a future major version.
|
|
161
|
+
* @see https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md#132--2026-03-23
|
|
162
|
+
*
|
|
142
163
|
* @example
|
|
143
164
|
* typeLabels: { productDrug: 'Products', singleCondition: 'Condition' }
|
|
144
165
|
*/
|
|
145
166
|
typeLabels?: Record<string, string>;
|
|
167
|
+
/**
|
|
168
|
+
* Map raw `_type` values to human-readable display labels.
|
|
169
|
+
* Replaces the deprecated `typeLabels`.
|
|
170
|
+
* Used in both the Type column and the Type filter dropdown.
|
|
171
|
+
* Any type without an entry falls back to the raw `_type` string.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* typeDisplayLabels: { productDrug: 'Products', singleCondition: 'Condition' }
|
|
175
|
+
*/
|
|
176
|
+
typeDisplayLabels?: Record<string, string>;
|
|
146
177
|
/**
|
|
147
178
|
* Controls how the document type is rendered in the Type column.
|
|
148
179
|
* - `'badge'` (default) — coloured pill
|
|
@@ -166,15 +197,35 @@ interface SeoFieldsPluginConfig {
|
|
|
166
197
|
* Callback function to render a custom badge next to the document title.
|
|
167
198
|
* Receives the full document and should return badge data or undefined.
|
|
168
199
|
*
|
|
200
|
+
* @deprecated Use `getDocumentBadge` instead. Will be removed in a future major version.
|
|
201
|
+
* @see https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md#132--2026-03-23
|
|
202
|
+
*
|
|
169
203
|
* @example
|
|
170
204
|
* docBadge: (doc) => {
|
|
171
205
|
* if (doc.services === 'NHS')
|
|
172
206
|
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
207
|
+
* }
|
|
208
|
+
*/
|
|
209
|
+
docBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
210
|
+
label: string;
|
|
211
|
+
bgColor?: string;
|
|
212
|
+
textColor?: string;
|
|
213
|
+
fontSize?: string;
|
|
214
|
+
} | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Callback function to render a custom badge next to the document title.
|
|
217
|
+
* Replaces the deprecated `docBadge`.
|
|
218
|
+
* Receives the full document and should return badge data or undefined.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* getDocumentBadge: (doc) => {
|
|
222
|
+
* if (doc.services === 'NHS')
|
|
223
|
+
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
173
224
|
* if (doc.services === 'Private')
|
|
174
225
|
* return { label: 'Private', bgColor: '#fef3c7', textColor: '#92400e' }
|
|
175
226
|
* }
|
|
176
227
|
*/
|
|
177
|
-
|
|
228
|
+
getDocumentBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
178
229
|
label: string;
|
|
179
230
|
bgColor?: string;
|
|
180
231
|
textColor?: string;
|
|
@@ -273,12 +324,13 @@ interface SeoHealthDashboardProps {
|
|
|
273
324
|
/**
|
|
274
325
|
* Map raw `_type` values to human-readable display labels used in the
|
|
275
326
|
* Type column and the Type filter dropdown.
|
|
327
|
+
* Replaces the deprecated `typeLabels`.
|
|
276
328
|
* Any type without an entry falls back to the raw `_type` string.
|
|
277
329
|
*
|
|
278
330
|
* @example
|
|
279
|
-
*
|
|
331
|
+
* typeDisplayLabels={{ productDrug: 'Products', singleCondition: 'Condition' }}
|
|
280
332
|
*/
|
|
281
|
-
|
|
333
|
+
typeDisplayLabels?: Record<string, string>;
|
|
282
334
|
/**
|
|
283
335
|
* Controls how the type is rendered in the Type column.
|
|
284
336
|
* - `'badge'` (default) — coloured pill, consistent with score badges
|
|
@@ -302,17 +354,18 @@ interface SeoHealthDashboardProps {
|
|
|
302
354
|
titleField?: string | Record<string, string>;
|
|
303
355
|
/**
|
|
304
356
|
* Callback function to render a custom badge next to the document title.
|
|
357
|
+
* Replaces the deprecated `docBadge`.
|
|
305
358
|
* Receives the full document and should return badge data or undefined.
|
|
306
359
|
*
|
|
307
360
|
* @example
|
|
308
|
-
*
|
|
361
|
+
* getDocumentBadge: (doc) => {
|
|
309
362
|
* if (doc.services === 'NHS')
|
|
310
363
|
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
311
364
|
* if (doc.services === 'Private')
|
|
312
365
|
* return { label: 'Private', bgColor: '#fef3c7', textColor: '#92400e' }
|
|
313
366
|
* }
|
|
314
367
|
*/
|
|
315
|
-
|
|
368
|
+
getDocumentBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
316
369
|
label: string;
|
|
317
370
|
bgColor?: string;
|
|
318
371
|
textColor?: string;
|
|
@@ -365,6 +418,12 @@ interface SeoHealthDashboardProps {
|
|
|
365
418
|
* structureTool: 'common'
|
|
366
419
|
*/
|
|
367
420
|
structureTool?: string;
|
|
421
|
+
/**
|
|
422
|
+
* @internal — populated by the plugin when deprecated config keys are detected.
|
|
423
|
+
* Each entry carries the migration hint, the version it was deprecated in, and
|
|
424
|
+
* the matching changelog URL so the banner can group warnings by release.
|
|
425
|
+
*/
|
|
426
|
+
_deprecationWarnings?: DeprecationWarning[];
|
|
368
427
|
}
|
|
369
428
|
declare const SeoHealthDashboard: React.FC<SeoHealthDashboardProps>;
|
|
370
429
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as sanity from 'sanity';
|
|
2
2
|
import { SchemaTypeDefinition } from 'sanity';
|
|
3
|
-
import { D as DocumentWithSeoHealth } from './types-
|
|
4
|
-
export { S as SeoHealthMetrics,
|
|
3
|
+
import { D as DocumentWithSeoHealth, a as DeprecationWarning } from './types-BtSRRG6C.js';
|
|
4
|
+
export { S as SeoHealthMetrics, b as SeoHealthStatus } from './types-BtSRRG6C.js';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { StructureBuilder, ComponentBuilder } from 'sanity/structure';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -102,10 +102,28 @@ interface SeoFieldsPluginConfig {
|
|
|
102
102
|
/** Text shown when the query returns zero results. Defaults to "No documents found" */
|
|
103
103
|
noDocuments?: string;
|
|
104
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `showTypeColumn` instead. Will be removed in a future major version.
|
|
107
|
+
* @see https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md#132--2026-03-23
|
|
108
|
+
*/
|
|
105
109
|
display?: {
|
|
110
|
+
/** @deprecated Use top-level `showTypeColumn` instead. */
|
|
106
111
|
typeColumn?: boolean;
|
|
112
|
+
/** @deprecated Use top-level `showDocumentId` instead. */
|
|
107
113
|
documentId?: boolean;
|
|
108
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* Show or hide the document type column in the results table.
|
|
117
|
+
* Replaces the deprecated `display.typeColumn`.
|
|
118
|
+
* Defaults to `true`.
|
|
119
|
+
*/
|
|
120
|
+
showTypeColumn?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Show or hide the Sanity document `_id` under each title.
|
|
123
|
+
* Replaces the deprecated `display.documentId`.
|
|
124
|
+
* Defaults to `true`.
|
|
125
|
+
*/
|
|
126
|
+
showDocumentId?: boolean;
|
|
109
127
|
query?: {
|
|
110
128
|
/**
|
|
111
129
|
* Limit the dashboard to specific document types.
|
|
@@ -139,10 +157,23 @@ interface SeoFieldsPluginConfig {
|
|
|
139
157
|
* Used in both the Type column and the Type filter dropdown.
|
|
140
158
|
* Any type without an entry falls back to the raw `_type` string.
|
|
141
159
|
*
|
|
160
|
+
* @deprecated Use `typeDisplayLabels` instead. Will be removed in a future major version.
|
|
161
|
+
* @see https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md#132--2026-03-23
|
|
162
|
+
*
|
|
142
163
|
* @example
|
|
143
164
|
* typeLabels: { productDrug: 'Products', singleCondition: 'Condition' }
|
|
144
165
|
*/
|
|
145
166
|
typeLabels?: Record<string, string>;
|
|
167
|
+
/**
|
|
168
|
+
* Map raw `_type` values to human-readable display labels.
|
|
169
|
+
* Replaces the deprecated `typeLabels`.
|
|
170
|
+
* Used in both the Type column and the Type filter dropdown.
|
|
171
|
+
* Any type without an entry falls back to the raw `_type` string.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* typeDisplayLabels: { productDrug: 'Products', singleCondition: 'Condition' }
|
|
175
|
+
*/
|
|
176
|
+
typeDisplayLabels?: Record<string, string>;
|
|
146
177
|
/**
|
|
147
178
|
* Controls how the document type is rendered in the Type column.
|
|
148
179
|
* - `'badge'` (default) — coloured pill
|
|
@@ -166,15 +197,35 @@ interface SeoFieldsPluginConfig {
|
|
|
166
197
|
* Callback function to render a custom badge next to the document title.
|
|
167
198
|
* Receives the full document and should return badge data or undefined.
|
|
168
199
|
*
|
|
200
|
+
* @deprecated Use `getDocumentBadge` instead. Will be removed in a future major version.
|
|
201
|
+
* @see https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md#132--2026-03-23
|
|
202
|
+
*
|
|
169
203
|
* @example
|
|
170
204
|
* docBadge: (doc) => {
|
|
171
205
|
* if (doc.services === 'NHS')
|
|
172
206
|
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
207
|
+
* }
|
|
208
|
+
*/
|
|
209
|
+
docBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
210
|
+
label: string;
|
|
211
|
+
bgColor?: string;
|
|
212
|
+
textColor?: string;
|
|
213
|
+
fontSize?: string;
|
|
214
|
+
} | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Callback function to render a custom badge next to the document title.
|
|
217
|
+
* Replaces the deprecated `docBadge`.
|
|
218
|
+
* Receives the full document and should return badge data or undefined.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* getDocumentBadge: (doc) => {
|
|
222
|
+
* if (doc.services === 'NHS')
|
|
223
|
+
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
173
224
|
* if (doc.services === 'Private')
|
|
174
225
|
* return { label: 'Private', bgColor: '#fef3c7', textColor: '#92400e' }
|
|
175
226
|
* }
|
|
176
227
|
*/
|
|
177
|
-
|
|
228
|
+
getDocumentBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
178
229
|
label: string;
|
|
179
230
|
bgColor?: string;
|
|
180
231
|
textColor?: string;
|
|
@@ -273,12 +324,13 @@ interface SeoHealthDashboardProps {
|
|
|
273
324
|
/**
|
|
274
325
|
* Map raw `_type` values to human-readable display labels used in the
|
|
275
326
|
* Type column and the Type filter dropdown.
|
|
327
|
+
* Replaces the deprecated `typeLabels`.
|
|
276
328
|
* Any type without an entry falls back to the raw `_type` string.
|
|
277
329
|
*
|
|
278
330
|
* @example
|
|
279
|
-
*
|
|
331
|
+
* typeDisplayLabels={{ productDrug: 'Products', singleCondition: 'Condition' }}
|
|
280
332
|
*/
|
|
281
|
-
|
|
333
|
+
typeDisplayLabels?: Record<string, string>;
|
|
282
334
|
/**
|
|
283
335
|
* Controls how the type is rendered in the Type column.
|
|
284
336
|
* - `'badge'` (default) — coloured pill, consistent with score badges
|
|
@@ -302,17 +354,18 @@ interface SeoHealthDashboardProps {
|
|
|
302
354
|
titleField?: string | Record<string, string>;
|
|
303
355
|
/**
|
|
304
356
|
* Callback function to render a custom badge next to the document title.
|
|
357
|
+
* Replaces the deprecated `docBadge`.
|
|
305
358
|
* Receives the full document and should return badge data or undefined.
|
|
306
359
|
*
|
|
307
360
|
* @example
|
|
308
|
-
*
|
|
361
|
+
* getDocumentBadge: (doc) => {
|
|
309
362
|
* if (doc.services === 'NHS')
|
|
310
363
|
* return { label: 'NHS', bgColor: '#e0f2fe', textColor: '#0369a1' }
|
|
311
364
|
* if (doc.services === 'Private')
|
|
312
365
|
* return { label: 'Private', bgColor: '#fef3c7', textColor: '#92400e' }
|
|
313
366
|
* }
|
|
314
367
|
*/
|
|
315
|
-
|
|
368
|
+
getDocumentBadge?: (doc: DocumentWithSeoHealth & Record<string, unknown>) => {
|
|
316
369
|
label: string;
|
|
317
370
|
bgColor?: string;
|
|
318
371
|
textColor?: string;
|
|
@@ -365,6 +418,12 @@ interface SeoHealthDashboardProps {
|
|
|
365
418
|
* structureTool: 'common'
|
|
366
419
|
*/
|
|
367
420
|
structureTool?: string;
|
|
421
|
+
/**
|
|
422
|
+
* @internal — populated by the plugin when deprecated config keys are detected.
|
|
423
|
+
* Each entry carries the migration hint, the version it was deprecated in, and
|
|
424
|
+
* the matching changelog URL so the banner can group warnings by release.
|
|
425
|
+
*/
|
|
426
|
+
_deprecationWarnings?: DeprecationWarning[];
|
|
368
427
|
}
|
|
369
428
|
declare const SeoHealthDashboard: React.FC<SeoHealthDashboardProps>;
|
|
370
429
|
|