sanity-plugin-seofields 1.6.0 → 1.6.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/dist/SeoHealthDashboard-FZTP4GS7.cjs +10 -0
- package/dist/{SeoHealthDashboard-7XMPVJRX.cjs.map → SeoHealthDashboard-FZTP4GS7.cjs.map} +1 -1
- package/dist/SeoHealthDashboard-PY5MKJCZ.js +4 -0
- package/dist/{SeoHealthDashboard-UWPLB5DM.js.map → SeoHealthDashboard-PY5MKJCZ.js.map} +1 -1
- package/dist/{SeoHealthTool-XCXINAQI.js → SeoHealthTool-SKY7FAKK.js} +3 -3
- package/dist/{SeoHealthTool-XCXINAQI.js.map → SeoHealthTool-SKY7FAKK.js.map} +1 -1
- package/dist/{SeoHealthTool-2H4XZR4I.cjs → SeoHealthTool-Z3O6NEKF.cjs} +4 -4
- package/dist/{SeoHealthTool-2H4XZR4I.cjs.map → SeoHealthTool-Z3O6NEKF.cjs.map} +1 -1
- package/dist/{SeoPreview-JDROKZLP.cjs → SeoPreview-PYYVZMY3.cjs} +41 -6
- package/dist/SeoPreview-PYYVZMY3.cjs.map +1 -0
- package/dist/{SeoPreview-F6GGPZWI.js → SeoPreview-XVAZYHCL.js} +43 -8
- package/dist/SeoPreview-XVAZYHCL.js.map +1 -0
- package/dist/{chunk-Z74QPO75.cjs → chunk-77U7CMJP.cjs} +12 -4
- package/dist/chunk-77U7CMJP.cjs.map +1 -0
- package/dist/{chunk-6NIHHOVS.js → chunk-IQG5JWVT.js} +2 -2
- package/dist/{chunk-6NIHHOVS.js.map → chunk-IQG5JWVT.js.map} +1 -1
- package/dist/{chunk-NHJBEV3A.js → chunk-KFFDQX22.js} +12 -4
- package/dist/chunk-KFFDQX22.js.map +1 -0
- package/dist/{chunk-KWUITSHS.js → chunk-ULFY5STC.js} +14 -14
- package/dist/chunk-ULFY5STC.js.map +1 -0
- package/dist/{chunk-WCLEWFAJ.cjs → chunk-XXQURVNE.cjs} +120 -120
- package/dist/chunk-XXQURVNE.cjs.map +1 -0
- package/dist/{chunk-7HCP5O62.cjs → chunk-YM3ZZ2HU.cjs} +2 -2
- package/dist/{chunk-7HCP5O62.cjs.map → chunk-YM3ZZ2HU.cjs.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/{component-7rqDvuy2.d.ts → component-CWZ0tlsq.d.ts} +7 -7
- package/dist/{component-J2nEQkOw.d.cts → component-DS-Ve_nw.d.cts} +7 -7
- package/dist/index.cjs +48 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -8
- package/dist/index.d.ts +57 -8
- package/dist/index.js +31 -20
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +87 -88
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +4 -4
- package/dist/next.d.ts +4 -4
- package/dist/next.js +12 -9
- package/dist/next.js.map +1 -1
- package/dist/schema/next.cjs +80 -80
- package/dist/schema/next.d.cts +3 -3
- package/dist/schema/next.d.ts +3 -3
- package/dist/schema/next.js +3 -3
- package/dist/schema.cjs +153 -153
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +6 -6
- package/dist/schema.d.ts +6 -6
- package/dist/schema.js +2 -2
- package/dist/schema.js.map +1 -1
- package/dist/{types-BSgolLj3.d.cts → types-BjVpmBAX.d.cts} +1 -1
- package/dist/{types-BRn3hfQb.d.ts → types-Dy7r5det.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/SeoHealthDashboard-7XMPVJRX.cjs +0 -10
- package/dist/SeoHealthDashboard-UWPLB5DM.js +0 -4
- package/dist/SeoPreview-F6GGPZWI.js.map +0 -1
- package/dist/SeoPreview-JDROKZLP.cjs.map +0 -1
- package/dist/chunk-KWUITSHS.js.map +0 -1
- package/dist/chunk-NHJBEV3A.js.map +0 -1
- package/dist/chunk-WCLEWFAJ.cjs.map +0 -1
- package/dist/chunk-Z74QPO75.cjs.map +0 -1
- package/dist/{types-DoUYMRVf.d.cts → types-BdaGoGQE.d.cts} +30 -30
- package/dist/{types-DnVvOp3o.d.ts → types-BwmZmt9I.d.ts} +30 -30
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as sanity from 'sanity';
|
|
2
2
|
import { SchemaTypeDefinition } from 'sanity';
|
|
3
|
-
import
|
|
3
|
+
import { ComponentType, ReactNode } from 'react';
|
|
4
4
|
import { D as DocumentWithSeoHealth, a as DeprecationWarning } from './types-BtSRRG6C.cjs';
|
|
5
5
|
export { S as SeoHealthMetrics, b as SeoHealthStatus } from './types-BtSRRG6C.cjs';
|
|
6
6
|
import { StructureBuilder, ComponentBuilder } from 'sanity/structure';
|
|
@@ -36,7 +36,7 @@ interface SeoFieldGroup {
|
|
|
36
36
|
*/
|
|
37
37
|
fields: SeoObjectFieldName[];
|
|
38
38
|
/** Optional icon displayed next to the tab title. Must be a React component. */
|
|
39
|
-
icon?:
|
|
39
|
+
icon?: ComponentType;
|
|
40
40
|
}
|
|
41
41
|
type ValidHiddenFieldKeys = Exclude<AllFieldKeys, 'openGraphImageUrl' | 'twitterImageUrl' | 'openGraphImageType' | 'twitterImageType'>;
|
|
42
42
|
interface FieldVisibilityConfig {
|
|
@@ -46,12 +46,17 @@ interface SeoFieldsPluginConfig {
|
|
|
46
46
|
/**
|
|
47
47
|
* Enable or configure the SEO preview feature.
|
|
48
48
|
* If set to `true`, the SEO preview will be enabled with default settings.
|
|
49
|
-
* If set to an object, you can provide a custom prefix function to modify the URL prefix
|
|
50
|
-
*
|
|
49
|
+
* If set to an object, you can provide a custom `prefix` function to modify the URL prefix
|
|
50
|
+
* and/or a `titleSuffix` to append text (e.g. a brand name) after the meta title in the preview.
|
|
51
|
+
* The plugin automatically adds a `|` separator — only provide the suffix text itself.
|
|
52
|
+
*
|
|
51
53
|
* Example:
|
|
52
54
|
* ```
|
|
53
55
|
* seoPreview: {
|
|
54
|
-
* prefix: (doc) => `/${doc.slug?.current || 'untitled'}
|
|
56
|
+
* prefix: (doc) => `/${doc.slug?.current || 'untitled'}`,
|
|
57
|
+
* titleSuffix: 'Acme Corp',
|
|
58
|
+
* // or dynamically:
|
|
59
|
+
* titleSuffix: (doc) => doc.brandName || 'Acme Corp',
|
|
55
60
|
* }
|
|
56
61
|
* ```
|
|
57
62
|
*/
|
|
@@ -59,6 +64,38 @@ interface SeoFieldsPluginConfig {
|
|
|
59
64
|
prefix?: (doc: {
|
|
60
65
|
_type?: string;
|
|
61
66
|
} & Record<string, unknown>) => string;
|
|
67
|
+
/**
|
|
68
|
+
* A static string or function appended to the meta title in the Live Preview.
|
|
69
|
+
* Useful for showing a brand suffix (e.g. `'Acme Corp'`) that is added
|
|
70
|
+
* via your Next.js title template but not stored in the Sanity field.
|
|
71
|
+
* The plugin automatically prepends a `|` separator so only provide the
|
|
72
|
+
* text itself. The suffix is rendered in a muted style so editors can
|
|
73
|
+
* distinguish it from the typed title. The combined length (including the
|
|
74
|
+
* separator) is checked against the 60-character SERP limit.
|
|
75
|
+
*/
|
|
76
|
+
titleSuffix?: string | ((doc: {
|
|
77
|
+
_type?: string;
|
|
78
|
+
} & Record<string, unknown>) => string);
|
|
79
|
+
/**
|
|
80
|
+
* When `true`, the `titleSuffix` is rendered in the same color and weight
|
|
81
|
+
* as the main title (`#1a0dab`, `fontWeight: 500`) instead of the default
|
|
82
|
+
* muted style (`#70757a`, `fontWeight: 400`).
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
titleSuffixInheritColor?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* A GROQ query string whose result is used as the title suffix in the Live Preview.
|
|
89
|
+
* The query runs against your dataset at Studio load time, making it useful for
|
|
90
|
+
* fetching a dynamic value from another document (e.g. a settings singleton).
|
|
91
|
+
* Takes priority over `titleSuffix` when both are provided.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* titleSuffixQuery: '*[_type == "siteSettings"][0].siteName'
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
titleSuffixQuery?: string;
|
|
62
99
|
};
|
|
63
100
|
/**
|
|
64
101
|
* A mapping of field keys to their configuration settings.
|
|
@@ -95,6 +132,12 @@ interface SeoFieldsPluginConfig {
|
|
|
95
132
|
* Defaults to 'https://www.example.com' if not provided.
|
|
96
133
|
*/
|
|
97
134
|
baseUrl?: string;
|
|
135
|
+
/**
|
|
136
|
+
* The Sanity API version to use for all plugin clients (SEO Preview, Health Dashboard).
|
|
137
|
+
* Defaults to '2024-01-01'.
|
|
138
|
+
* @example '2024-01-01'
|
|
139
|
+
*/
|
|
140
|
+
apiVersion?: string;
|
|
98
141
|
/**
|
|
99
142
|
* Enable or configure the SEO Health Dashboard tool.
|
|
100
143
|
* If set to `true`, the dashboard is enabled with all defaults.
|
|
@@ -171,6 +214,12 @@ interface SeoFieldsPluginConfig {
|
|
|
171
214
|
/**
|
|
172
215
|
* The Sanity API version to use for the client (e.g. '2023-01-01').
|
|
173
216
|
* Defaults to '2023-01-01'.
|
|
217
|
+
* @deprecated Use the root-level `apiVersion` option instead.
|
|
218
|
+
* @example
|
|
219
|
+
* // Before (deprecated):
|
|
220
|
+
* healthDashboard: { apiVersion: '2024-01-01' }
|
|
221
|
+
* // After:
|
|
222
|
+
* apiVersion: '2024-01-01'
|
|
174
223
|
*/
|
|
175
224
|
apiVersion?: string;
|
|
176
225
|
/**
|
|
@@ -383,17 +432,17 @@ interface SeoHealthDashboardProps {
|
|
|
383
432
|
* Custom text shown while the license key is being verified.
|
|
384
433
|
* Defaults to `"Verifying license…"`.
|
|
385
434
|
*/
|
|
386
|
-
loadingLicense?:
|
|
435
|
+
loadingLicense?: ReactNode;
|
|
387
436
|
/**
|
|
388
437
|
* Custom text shown while documents are being fetched.
|
|
389
438
|
* Defaults to `"Loading documents…"`.
|
|
390
439
|
*/
|
|
391
|
-
loadingDocuments?:
|
|
440
|
+
loadingDocuments?: ReactNode;
|
|
392
441
|
/**
|
|
393
442
|
* Custom text shown when the query returns zero results.
|
|
394
443
|
* Defaults to `"No documents found"`.
|
|
395
444
|
*/
|
|
396
|
-
noDocuments?:
|
|
445
|
+
noDocuments?: ReactNode;
|
|
397
446
|
/**
|
|
398
447
|
* Enable preview/demo mode to show dummy data.
|
|
399
448
|
* Useful for testing, documentation, or showcasing the dashboard.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as sanity from 'sanity';
|
|
2
2
|
import { SchemaTypeDefinition } from 'sanity';
|
|
3
|
-
import
|
|
3
|
+
import { ComponentType, ReactNode } from 'react';
|
|
4
4
|
import { D as DocumentWithSeoHealth, a as DeprecationWarning } from './types-BtSRRG6C.js';
|
|
5
5
|
export { S as SeoHealthMetrics, b as SeoHealthStatus } from './types-BtSRRG6C.js';
|
|
6
6
|
import { StructureBuilder, ComponentBuilder } from 'sanity/structure';
|
|
@@ -36,7 +36,7 @@ interface SeoFieldGroup {
|
|
|
36
36
|
*/
|
|
37
37
|
fields: SeoObjectFieldName[];
|
|
38
38
|
/** Optional icon displayed next to the tab title. Must be a React component. */
|
|
39
|
-
icon?:
|
|
39
|
+
icon?: ComponentType;
|
|
40
40
|
}
|
|
41
41
|
type ValidHiddenFieldKeys = Exclude<AllFieldKeys, 'openGraphImageUrl' | 'twitterImageUrl' | 'openGraphImageType' | 'twitterImageType'>;
|
|
42
42
|
interface FieldVisibilityConfig {
|
|
@@ -46,12 +46,17 @@ interface SeoFieldsPluginConfig {
|
|
|
46
46
|
/**
|
|
47
47
|
* Enable or configure the SEO preview feature.
|
|
48
48
|
* If set to `true`, the SEO preview will be enabled with default settings.
|
|
49
|
-
* If set to an object, you can provide a custom prefix function to modify the URL prefix
|
|
50
|
-
*
|
|
49
|
+
* If set to an object, you can provide a custom `prefix` function to modify the URL prefix
|
|
50
|
+
* and/or a `titleSuffix` to append text (e.g. a brand name) after the meta title in the preview.
|
|
51
|
+
* The plugin automatically adds a `|` separator — only provide the suffix text itself.
|
|
52
|
+
*
|
|
51
53
|
* Example:
|
|
52
54
|
* ```
|
|
53
55
|
* seoPreview: {
|
|
54
|
-
* prefix: (doc) => `/${doc.slug?.current || 'untitled'}
|
|
56
|
+
* prefix: (doc) => `/${doc.slug?.current || 'untitled'}`,
|
|
57
|
+
* titleSuffix: 'Acme Corp',
|
|
58
|
+
* // or dynamically:
|
|
59
|
+
* titleSuffix: (doc) => doc.brandName || 'Acme Corp',
|
|
55
60
|
* }
|
|
56
61
|
* ```
|
|
57
62
|
*/
|
|
@@ -59,6 +64,38 @@ interface SeoFieldsPluginConfig {
|
|
|
59
64
|
prefix?: (doc: {
|
|
60
65
|
_type?: string;
|
|
61
66
|
} & Record<string, unknown>) => string;
|
|
67
|
+
/**
|
|
68
|
+
* A static string or function appended to the meta title in the Live Preview.
|
|
69
|
+
* Useful for showing a brand suffix (e.g. `'Acme Corp'`) that is added
|
|
70
|
+
* via your Next.js title template but not stored in the Sanity field.
|
|
71
|
+
* The plugin automatically prepends a `|` separator so only provide the
|
|
72
|
+
* text itself. The suffix is rendered in a muted style so editors can
|
|
73
|
+
* distinguish it from the typed title. The combined length (including the
|
|
74
|
+
* separator) is checked against the 60-character SERP limit.
|
|
75
|
+
*/
|
|
76
|
+
titleSuffix?: string | ((doc: {
|
|
77
|
+
_type?: string;
|
|
78
|
+
} & Record<string, unknown>) => string);
|
|
79
|
+
/**
|
|
80
|
+
* When `true`, the `titleSuffix` is rendered in the same color and weight
|
|
81
|
+
* as the main title (`#1a0dab`, `fontWeight: 500`) instead of the default
|
|
82
|
+
* muted style (`#70757a`, `fontWeight: 400`).
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
titleSuffixInheritColor?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* A GROQ query string whose result is used as the title suffix in the Live Preview.
|
|
89
|
+
* The query runs against your dataset at Studio load time, making it useful for
|
|
90
|
+
* fetching a dynamic value from another document (e.g. a settings singleton).
|
|
91
|
+
* Takes priority over `titleSuffix` when both are provided.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* titleSuffixQuery: '*[_type == "siteSettings"][0].siteName'
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
titleSuffixQuery?: string;
|
|
62
99
|
};
|
|
63
100
|
/**
|
|
64
101
|
* A mapping of field keys to their configuration settings.
|
|
@@ -95,6 +132,12 @@ interface SeoFieldsPluginConfig {
|
|
|
95
132
|
* Defaults to 'https://www.example.com' if not provided.
|
|
96
133
|
*/
|
|
97
134
|
baseUrl?: string;
|
|
135
|
+
/**
|
|
136
|
+
* The Sanity API version to use for all plugin clients (SEO Preview, Health Dashboard).
|
|
137
|
+
* Defaults to '2024-01-01'.
|
|
138
|
+
* @example '2024-01-01'
|
|
139
|
+
*/
|
|
140
|
+
apiVersion?: string;
|
|
98
141
|
/**
|
|
99
142
|
* Enable or configure the SEO Health Dashboard tool.
|
|
100
143
|
* If set to `true`, the dashboard is enabled with all defaults.
|
|
@@ -171,6 +214,12 @@ interface SeoFieldsPluginConfig {
|
|
|
171
214
|
/**
|
|
172
215
|
* The Sanity API version to use for the client (e.g. '2023-01-01').
|
|
173
216
|
* Defaults to '2023-01-01'.
|
|
217
|
+
* @deprecated Use the root-level `apiVersion` option instead.
|
|
218
|
+
* @example
|
|
219
|
+
* // Before (deprecated):
|
|
220
|
+
* healthDashboard: { apiVersion: '2024-01-01' }
|
|
221
|
+
* // After:
|
|
222
|
+
* apiVersion: '2024-01-01'
|
|
174
223
|
*/
|
|
175
224
|
apiVersion?: string;
|
|
176
225
|
/**
|
|
@@ -383,17 +432,17 @@ interface SeoHealthDashboardProps {
|
|
|
383
432
|
* Custom text shown while the license key is being verified.
|
|
384
433
|
* Defaults to `"Verifying license…"`.
|
|
385
434
|
*/
|
|
386
|
-
loadingLicense?:
|
|
435
|
+
loadingLicense?: ReactNode;
|
|
387
436
|
/**
|
|
388
437
|
* Custom text shown while documents are being fetched.
|
|
389
438
|
* Defaults to `"Loading documents…"`.
|
|
390
439
|
*/
|
|
391
|
-
loadingDocuments?:
|
|
440
|
+
loadingDocuments?: ReactNode;
|
|
392
441
|
/**
|
|
393
442
|
* Custom text shown when the query returns zero results.
|
|
394
443
|
* Defaults to `"No documents found"`.
|
|
395
444
|
*/
|
|
396
|
-
noDocuments?:
|
|
445
|
+
noDocuments?: ReactNode;
|
|
397
446
|
/**
|
|
398
447
|
* Enable preview/demo mode to show dummy data.
|
|
399
448
|
* Useful for testing, documentation, or showcasing the dashboard.
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMetaTitleValidationMessages, getMetaDescriptionValidationMessages, getMetaImageValidation, getOgTitleValidation, getOgDescriptionValidation, getOgImageValidation, getOgImageUrlValidation, getTwitterTitleValidation, getTwitterDescriptionValidation, getTwitterImageValidation, getTwitterImageUrlValidation } from './chunk-25JLWVEU.js';
|
|
2
2
|
import { __spreadValues, __spreadProps, __objRest } from './chunk-2NMEKWO5.js';
|
|
3
|
-
import
|
|
3
|
+
import { lazy, createElement, Suspense, useMemo } from 'react';
|
|
4
4
|
import { defineType, defineField, definePlugin, useFormValue } from 'sanity';
|
|
5
5
|
import { Stack, Text } from '@sanity/ui';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -653,8 +653,8 @@ function twitter(config = {}) {
|
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
// src/schemas/index.ts
|
|
656
|
-
var LazySeoPreview =
|
|
657
|
-
var SeoPreviewWrapper = (props) =>
|
|
656
|
+
var LazySeoPreview = lazy(() => import('./SeoPreview-XVAZYHCL.js'));
|
|
657
|
+
var SeoPreviewWrapper = (props) => createElement(Suspense, { fallback: null }, createElement(LazySeoPreview, props));
|
|
658
658
|
function buildFieldGroupMap(groups) {
|
|
659
659
|
const map = /* @__PURE__ */ new Map();
|
|
660
660
|
for (const g of groups) {
|
|
@@ -715,9 +715,9 @@ function seoFieldsSchema(config = {}) {
|
|
|
715
715
|
title: "SEO Preview",
|
|
716
716
|
type: "string",
|
|
717
717
|
components: { input: SeoPreviewWrapper },
|
|
718
|
-
options: __spreadValues({
|
|
718
|
+
options: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
719
719
|
baseUrl: config.baseUrl || "https://www.example.com"
|
|
720
|
-
}, typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.prefix ? { prefix: config.seoPreview.prefix } : {}),
|
|
720
|
+
}, config.apiVersion ? { apiVersion: config.apiVersion } : {}), typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.prefix ? { prefix: config.seoPreview.prefix } : {}), typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.titleSuffix ? { titleSuffix: config.seoPreview.titleSuffix } : {}), typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.titleSuffixInheritColor ? { titleSuffixInheritColor: config.seoPreview.titleSuffixInheritColor } : {}), typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.titleSuffixQuery ? { titleSuffixQuery: config.seoPreview.titleSuffixQuery } : {}),
|
|
721
721
|
initialValue: "",
|
|
722
722
|
readOnly: true
|
|
723
723
|
}),
|
|
@@ -979,9 +979,20 @@ function types(config = {}) {
|
|
|
979
979
|
}
|
|
980
980
|
|
|
981
981
|
// src/plugin.ts
|
|
982
|
-
var resolveDashboardConfig = (healthDashboard) => {
|
|
983
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
982
|
+
var resolveDashboardConfig = (healthDashboard, rootApiVersion) => {
|
|
983
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
984
984
|
const cfg = typeof healthDashboard === "object" ? healthDashboard : void 0;
|
|
985
|
+
const deprecationWarnings = [];
|
|
986
|
+
if ((cfg == null ? void 0 : cfg.apiVersion) !== void 0) {
|
|
987
|
+
deprecationWarnings.push({
|
|
988
|
+
key: "healthDashboard.apiVersion \u2192 apiVersion",
|
|
989
|
+
version: "v1.6.1",
|
|
990
|
+
changelogUrl: "https://github.com/hardik-143/sanity-plugin-seofields/blob/main/CHANGELOG.md"
|
|
991
|
+
});
|
|
992
|
+
console.warn(
|
|
993
|
+
'[sanity-plugin-seofields] "healthDashboard.apiVersion" is deprecated. Move it to the root "apiVersion" option instead.'
|
|
994
|
+
);
|
|
995
|
+
}
|
|
985
996
|
return {
|
|
986
997
|
enabled: healthDashboard !== false,
|
|
987
998
|
toolTitle: (_b = (_a = cfg == null ? void 0 : cfg.tool) == null ? void 0 : _a.title) != null ? _b : "SEO Health",
|
|
@@ -994,15 +1005,15 @@ var resolveDashboardConfig = (healthDashboard) => {
|
|
|
994
1005
|
queryTypes: (_h = cfg == null ? void 0 : cfg.query) == null ? void 0 : _h.types,
|
|
995
1006
|
queryRequireSeo: (_i = cfg == null ? void 0 : cfg.query) == null ? void 0 : _i.requireSeo,
|
|
996
1007
|
queryGroq: (_j = cfg == null ? void 0 : cfg.query) == null ? void 0 : _j.groq,
|
|
997
|
-
apiVersion: cfg == null ? void 0 : cfg.apiVersion,
|
|
1008
|
+
apiVersion: (_k = cfg == null ? void 0 : cfg.apiVersion) != null ? _k : rootApiVersion,
|
|
998
1009
|
licenseKey: cfg == null ? void 0 : cfg.licenseKey,
|
|
999
1010
|
typeDisplayLabels: cfg == null ? void 0 : cfg.typeDisplayLabels,
|
|
1000
1011
|
typeColumnMode: cfg == null ? void 0 : cfg.typeColumnMode,
|
|
1001
1012
|
titleField: cfg == null ? void 0 : cfg.titleField,
|
|
1002
1013
|
getDocumentBadge: cfg == null ? void 0 : cfg.getDocumentBadge,
|
|
1003
|
-
loadingLicense: (
|
|
1004
|
-
loadingDocuments: (
|
|
1005
|
-
noDocuments: (
|
|
1014
|
+
loadingLicense: (_l = cfg == null ? void 0 : cfg.content) == null ? void 0 : _l.loadingLicense,
|
|
1015
|
+
loadingDocuments: (_m = cfg == null ? void 0 : cfg.content) == null ? void 0 : _m.loadingDocuments,
|
|
1016
|
+
noDocuments: (_n = cfg == null ? void 0 : cfg.content) == null ? void 0 : _n.noDocuments,
|
|
1006
1017
|
previewMode: cfg == null ? void 0 : cfg.previewMode,
|
|
1007
1018
|
structureTool: cfg == null ? void 0 : cfg.structureTool,
|
|
1008
1019
|
exportEnabled: (() => {
|
|
@@ -1017,18 +1028,18 @@ var resolveDashboardConfig = (healthDashboard) => {
|
|
|
1017
1028
|
if (typeof exportCfg === "object" && exportCfg.formats) return exportCfg.formats;
|
|
1018
1029
|
return ["csv", "json"];
|
|
1019
1030
|
})(),
|
|
1020
|
-
compactStats: (
|
|
1021
|
-
deprecationWarnings
|
|
1031
|
+
compactStats: (_o = cfg == null ? void 0 : cfg.compactStats) != null ? _o : false,
|
|
1032
|
+
deprecationWarnings
|
|
1022
1033
|
};
|
|
1023
1034
|
};
|
|
1024
1035
|
var seofields = definePlugin((config = {}) => {
|
|
1025
1036
|
const { healthDashboard = true } = config;
|
|
1026
|
-
const dash = resolveDashboardConfig(healthDashboard);
|
|
1027
|
-
const LazySeoHealthTool =
|
|
1028
|
-
const BoundSeoHealthTool = () =>
|
|
1029
|
-
|
|
1037
|
+
const dash = resolveDashboardConfig(healthDashboard, config.apiVersion);
|
|
1038
|
+
const LazySeoHealthTool = lazy(() => import('./SeoHealthTool-SKY7FAKK.js'));
|
|
1039
|
+
const BoundSeoHealthTool = () => createElement(
|
|
1040
|
+
Suspense,
|
|
1030
1041
|
{ fallback: null },
|
|
1031
|
-
|
|
1042
|
+
createElement(LazySeoHealthTool, {
|
|
1032
1043
|
icon: dash.icon,
|
|
1033
1044
|
title: dash.title,
|
|
1034
1045
|
description: dash.description,
|
|
@@ -1071,11 +1082,11 @@ var seofields = definePlugin((config = {}) => {
|
|
|
1071
1082
|
});
|
|
1072
1083
|
});
|
|
1073
1084
|
var plugin_default = seofields;
|
|
1074
|
-
var LazySeoHealthDashboard =
|
|
1085
|
+
var LazySeoHealthDashboard = lazy(() => import('./SeoHealthDashboard-PY5MKJCZ.js'));
|
|
1075
1086
|
function createSeoHealthPane(optionsOrS, optionsWhenS) {
|
|
1076
1087
|
const S = optionsOrS;
|
|
1077
1088
|
const _a = optionsWhenS != null ? optionsWhenS : {}, { query, openInPane = true, title: paneTitle } = _a, rest = __objRest(_a, ["query", "openInPane", "title"]);
|
|
1078
|
-
const SeoHealthPane = () => /* @__PURE__ */ jsx(
|
|
1089
|
+
const SeoHealthPane = () => /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
1079
1090
|
LazySeoHealthDashboard,
|
|
1080
1091
|
__spreadValues({
|
|
1081
1092
|
customQuery: query,
|