sanity-plugin-seofields 1.9.0 → 1.10.1
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 +71 -0
- package/dist/{SeoPreview-LMZAWWOE.cjs → SeoPreview-A2XZVMT2.cjs} +4 -4
- package/dist/{SeoPreview-LMZAWWOE.cjs.map → SeoPreview-A2XZVMT2.cjs.map} +1 -1
- package/dist/{SeoPreview-UNQBKTQO.js → SeoPreview-TATJQFMP.js} +2 -2
- package/dist/chunk-CRCXC45D.js +56 -0
- package/dist/chunk-CRCXC45D.js.map +1 -0
- package/dist/{chunk-HHO2AKAP.js → chunk-DB5MBPRK.js} +13 -13
- package/dist/chunk-DB5MBPRK.js.map +1 -0
- package/dist/{chunk-3OK3S2F7.cjs → chunk-EUG4MNRC.cjs} +60 -20
- package/dist/chunk-EUG4MNRC.cjs.map +1 -0
- package/dist/{chunk-Y46ACXM4.cjs → chunk-LHUFL5LS.cjs} +13 -13
- package/dist/chunk-LHUFL5LS.cjs.map +1 -0
- package/dist/{chunk-Z5AOUU4H.js → chunk-NLEB47UV.js} +60 -20
- package/dist/chunk-NLEB47UV.js.map +1 -0
- package/dist/{chunk-FUUWBQE2.cjs → chunk-OULUDJPI.cjs} +66 -7
- package/dist/chunk-OULUDJPI.cjs.map +1 -0
- package/dist/{chunk-KIEO6QG3.js → chunk-XD4HKLEA.js} +66 -7
- package/dist/chunk-XD4HKLEA.js.map +1 -0
- package/dist/chunk-XYAZJ3WX.cjs +56 -0
- package/dist/chunk-XYAZJ3WX.cjs.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/head.cjs +10 -2
- package/dist/head.cjs.map +1 -1
- package/dist/head.d.cts +61 -1
- package/dist/head.d.ts +61 -1
- package/dist/head.js +9 -1
- package/dist/hreflang-_VbSuWYD.d.cts +29 -0
- package/dist/hreflang-_VbSuWYD.d.ts +29 -0
- package/dist/index.cjs +173 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +336 -201
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +11 -3
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +2 -1
- package/dist/next.d.ts +2 -1
- package/dist/next.js +9 -1
- package/dist/next.js.map +1 -1
- package/dist/{plugin-DoGeZP79.d.cts → plugin-HFuWZsJu.d.cts} +68 -1
- package/dist/{plugin-DQdThyxG.d.ts → plugin-oQUCim56.d.ts} +68 -1
- package/dist/server.cjs +2 -2
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +6 -8
- package/dist/server.d.ts +6 -8
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-3OK3S2F7.cjs.map +0 -1
- package/dist/chunk-FUUWBQE2.cjs.map +0 -1
- package/dist/chunk-HHO2AKAP.js.map +0 -1
- package/dist/chunk-KIEO6QG3.js.map +0 -1
- package/dist/chunk-Y46ACXM4.cjs.map +0 -1
- package/dist/chunk-Z5AOUU4H.js.map +0 -1
- /package/dist/{SeoPreview-UNQBKTQO.js.map → SeoPreview-TATJQFMP.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildHreflangs
|
|
3
|
+
} from "./chunk-CRCXC45D.js";
|
|
1
4
|
import {
|
|
2
5
|
analyzeReadability,
|
|
3
6
|
generateSeoText,
|
|
4
7
|
pickTestOutput
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NLEB47UV.js";
|
|
6
9
|
import {
|
|
7
10
|
SchemaOrgJsonLdPreview,
|
|
8
11
|
tokenizeHtml
|
|
@@ -22,7 +25,7 @@ import {
|
|
|
22
25
|
getTwitterTitleValidation,
|
|
23
26
|
hasKeywordOveruse,
|
|
24
27
|
hasMatchingKeyword
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-DB5MBPRK.js";
|
|
26
29
|
import {
|
|
27
30
|
__spreadProps,
|
|
28
31
|
__spreadValues
|
|
@@ -611,16 +614,97 @@ var FocusKeywordInput = (props) => {
|
|
|
611
614
|
};
|
|
612
615
|
var FocusKeywordInput_default = FocusKeywordInput;
|
|
613
616
|
|
|
617
|
+
// src/components/meta/HreflangInput.tsx
|
|
618
|
+
import { TranslateIcon } from "@sanity/icons";
|
|
619
|
+
import { Button as Button2, Card as Card2, Flex as Flex2, Stack as Stack2, Text as Text3 } from "@sanity/ui";
|
|
620
|
+
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
621
|
+
import { PatchEvent as PatchEvent2, set as set2, useClient, useFormValue as useFormValue4 } from "sanity";
|
|
622
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
623
|
+
var DEFAULT_LOCALE_FIELD = "language";
|
|
624
|
+
var DEFAULT_API_VERSION = "2024-01-01";
|
|
625
|
+
function safeField(name) {
|
|
626
|
+
return name && /^[A-Za-z_][A-Za-z0-9_]*$/.test(name) ? name : DEFAULT_LOCALE_FIELD;
|
|
627
|
+
}
|
|
628
|
+
var HreflangInput = (props) => {
|
|
629
|
+
const { schemaType, onChange, renderDefault } = props;
|
|
630
|
+
const { options } = schemaType;
|
|
631
|
+
const { hreflang, baseUrl, apiVersion } = options != null ? options : {};
|
|
632
|
+
const rootDoc = useFormValue4([]);
|
|
633
|
+
const client = useClient({ apiVersion: apiVersion != null ? apiVersion : DEFAULT_API_VERSION });
|
|
634
|
+
const [state, setState] = useState3("idle");
|
|
635
|
+
const [message, setMessage] = useState3(null);
|
|
636
|
+
const localeField = safeField(hreflang == null ? void 0 : hreflang.localeField);
|
|
637
|
+
const handleSync = useCallback2(async () => {
|
|
638
|
+
var _a;
|
|
639
|
+
const rawId = rootDoc == null ? void 0 : rootDoc._id;
|
|
640
|
+
if (!rawId) {
|
|
641
|
+
setState("error");
|
|
642
|
+
setMessage("Save the document once before syncing translations.");
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
setState("loading");
|
|
646
|
+
setMessage(null);
|
|
647
|
+
try {
|
|
648
|
+
const publishedId = rawId.replace(/^drafts\./, "");
|
|
649
|
+
const query = `*[_type == "translation.metadata" && references($id)][0].translations[].value->{
|
|
650
|
+
"language": ${localeField},
|
|
651
|
+
"slug": slug.current
|
|
652
|
+
}`;
|
|
653
|
+
const translations = (_a = await client.fetch(query, { id: publishedId })) != null ? _a : [];
|
|
654
|
+
const entries = buildHreflangs(translations, {
|
|
655
|
+
baseUrl,
|
|
656
|
+
resolvePath: hreflang == null ? void 0 : hreflang.resolvePath
|
|
657
|
+
});
|
|
658
|
+
if (entries.length === 0) {
|
|
659
|
+
setState("error");
|
|
660
|
+
setMessage("No translations with a resolvable URL were found for this document.");
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
const items = entries.map((e) => ({
|
|
664
|
+
_type: "hreflangEntry",
|
|
665
|
+
_key: e.locale,
|
|
666
|
+
locale: e.locale,
|
|
667
|
+
url: e.url
|
|
668
|
+
}));
|
|
669
|
+
onChange(PatchEvent2.from(set2(items)));
|
|
670
|
+
setState("done");
|
|
671
|
+
setMessage(
|
|
672
|
+
`Synced ${items.length} alternate${items.length === 1 ? "" : "s"} from translations.`
|
|
673
|
+
);
|
|
674
|
+
} catch (err) {
|
|
675
|
+
setState("error");
|
|
676
|
+
setMessage(err instanceof Error ? err.message : "Failed to sync translations.");
|
|
677
|
+
}
|
|
678
|
+
}, [rootDoc == null ? void 0 : rootDoc._id, client, localeField, baseUrl, hreflang, onChange]);
|
|
679
|
+
return /* @__PURE__ */ jsxs4(Stack2, { space: 3, children: [
|
|
680
|
+
/* @__PURE__ */ jsx4(Flex2, { children: /* @__PURE__ */ jsx4(
|
|
681
|
+
Button2,
|
|
682
|
+
{
|
|
683
|
+
mode: "ghost",
|
|
684
|
+
tone: "primary",
|
|
685
|
+
fontSize: 1,
|
|
686
|
+
icon: TranslateIcon,
|
|
687
|
+
text: state === "loading" ? "Syncing\u2026" : "Sync from translations",
|
|
688
|
+
onClick: handleSync,
|
|
689
|
+
disabled: state === "loading"
|
|
690
|
+
}
|
|
691
|
+
) }),
|
|
692
|
+
message && /* @__PURE__ */ jsx4(Card2, { padding: 2, radius: 2, tone: state === "error" ? "critical" : "positive", children: /* @__PURE__ */ jsx4(Text3, { size: 1, children: message }) }),
|
|
693
|
+
renderDefault(props)
|
|
694
|
+
] });
|
|
695
|
+
};
|
|
696
|
+
var HreflangInput_default = HreflangInput;
|
|
697
|
+
|
|
614
698
|
// src/components/meta/KeywordsInput.tsx
|
|
615
|
-
import { Stack as
|
|
616
|
-
import { PatchEvent as
|
|
699
|
+
import { Stack as Stack4 } from "@sanity/ui";
|
|
700
|
+
import { PatchEvent as PatchEvent3, set as set3 } from "sanity";
|
|
617
701
|
|
|
618
702
|
// src/components/ai/KeywordSuggestions.tsx
|
|
619
703
|
import { SparklesIcon as SparklesIcon2 } from "@sanity/icons";
|
|
620
|
-
import { Badge, Box, Button as
|
|
621
|
-
import { useCallback as
|
|
622
|
-
import { useFormValue as
|
|
623
|
-
import { jsx as
|
|
704
|
+
import { Badge, Box, Button as Button3, Card as Card3, Flex as Flex3, Spinner, Stack as Stack3, Text as Text4 } from "@sanity/ui";
|
|
705
|
+
import { useCallback as useCallback3, useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
706
|
+
import { useFormValue as useFormValue5, useWorkspace as useWorkspace2 } from "sanity";
|
|
707
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
624
708
|
function KeywordSuggestions({
|
|
625
709
|
ai,
|
|
626
710
|
seoFieldPath,
|
|
@@ -629,17 +713,17 @@ function KeywordSuggestions({
|
|
|
629
713
|
onAddAll
|
|
630
714
|
}) {
|
|
631
715
|
var _a;
|
|
632
|
-
const [panelState, setPanelState] =
|
|
633
|
-
const [suggestions, setSuggestions] =
|
|
634
|
-
const [errorMsg, setErrorMsg] =
|
|
716
|
+
const [panelState, setPanelState] = useState4("idle");
|
|
717
|
+
const [suggestions, setSuggestions] = useState4([]);
|
|
718
|
+
const [errorMsg, setErrorMsg] = useState4(null);
|
|
635
719
|
const abortRef = useRef2(null);
|
|
636
|
-
const rootDoc =
|
|
720
|
+
const rootDoc = useFormValue5([]);
|
|
637
721
|
const workspace = useWorkspace2();
|
|
638
|
-
const seoObj =
|
|
722
|
+
const seoObj = useFormValue5([seoFieldPath]);
|
|
639
723
|
const focusKeyword = (_a = seoObj == null ? void 0 : seoObj.focusKeyword) != null ? _a : "";
|
|
640
724
|
const bodyField = resolveContentFields(ai == null ? void 0 : ai.content, rootDoc == null ? void 0 : rootDoc._type);
|
|
641
725
|
const content = rootDoc ? extractDocText(rootDoc, bodyField) : "";
|
|
642
|
-
const handleSuggest =
|
|
726
|
+
const handleSuggest = useCallback3(async () => {
|
|
643
727
|
var _a2;
|
|
644
728
|
if (!ai) return;
|
|
645
729
|
(_a2 = abortRef.current) == null ? void 0 : _a2.abort();
|
|
@@ -675,7 +759,7 @@ function KeywordSuggestions({
|
|
|
675
759
|
setPanelState("error");
|
|
676
760
|
}
|
|
677
761
|
}, [ai, content, focusKeyword, existing, workspace.projectId]);
|
|
678
|
-
const handleAdd =
|
|
762
|
+
const handleAdd = useCallback3(
|
|
679
763
|
(kw) => {
|
|
680
764
|
onAdd(kw);
|
|
681
765
|
setSuggestions((prev) => prev.filter((s) => s !== kw));
|
|
@@ -683,13 +767,13 @@ function KeywordSuggestions({
|
|
|
683
767
|
},
|
|
684
768
|
[onAdd, suggestions.length]
|
|
685
769
|
);
|
|
686
|
-
const handleAddAll =
|
|
770
|
+
const handleAddAll = useCallback3(() => {
|
|
687
771
|
const toAdd = suggestions.filter((kw) => !existing.includes(kw));
|
|
688
772
|
if (toAdd.length > 0) onAddAll(toAdd);
|
|
689
773
|
setSuggestions([]);
|
|
690
774
|
setPanelState("idle");
|
|
691
775
|
}, [suggestions, existing, onAddAll]);
|
|
692
|
-
const handleDismiss =
|
|
776
|
+
const handleDismiss = useCallback3(() => {
|
|
693
777
|
var _a2;
|
|
694
778
|
(_a2 = abortRef.current) == null ? void 0 : _a2.abort();
|
|
695
779
|
setSuggestions([]);
|
|
@@ -707,9 +791,9 @@ function KeywordSuggestions({
|
|
|
707
791
|
);
|
|
708
792
|
if (!isConfigured) return null;
|
|
709
793
|
if (panelState === "idle" || panelState === "error") {
|
|
710
|
-
return /* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
|
|
794
|
+
return /* @__PURE__ */ jsxs5(Stack3, { space: 2, children: [
|
|
795
|
+
/* @__PURE__ */ jsx5(
|
|
796
|
+
Button3,
|
|
713
797
|
{
|
|
714
798
|
mode: "ghost",
|
|
715
799
|
tone: "primary",
|
|
@@ -721,23 +805,23 @@ function KeywordSuggestions({
|
|
|
721
805
|
onClick: handleSuggest
|
|
722
806
|
}
|
|
723
807
|
),
|
|
724
|
-
panelState === "error" && errorMsg && /* @__PURE__ */
|
|
808
|
+
panelState === "error" && errorMsg && /* @__PURE__ */ jsx5(Card3, { padding: 2, tone: "critical", radius: 2, children: /* @__PURE__ */ jsx5(Text4, { size: 1, children: errorMsg }) })
|
|
725
809
|
] });
|
|
726
810
|
}
|
|
727
811
|
if (panelState === "loading") {
|
|
728
|
-
return /* @__PURE__ */
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ jsxs5(Flex3, { align: "center", gap: 2, paddingY: 2, children: [
|
|
813
|
+
/* @__PURE__ */ jsx5(Spinner, { muted: true }),
|
|
814
|
+
/* @__PURE__ */ jsx5(Text4, { size: 1, muted: true, children: "Finding keywords\u2026" })
|
|
731
815
|
] });
|
|
732
816
|
}
|
|
733
817
|
const pendingSuggestions = suggestions.filter((kw) => !existing.includes(kw));
|
|
734
818
|
const alreadyAdded = suggestions.filter((kw) => existing.includes(kw));
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
pendingSuggestions.length > 1 && /* @__PURE__ */
|
|
740
|
-
|
|
819
|
+
return /* @__PURE__ */ jsx5(Card3, { padding: 3, radius: 2, tone: "transparent", border: true, children: /* @__PURE__ */ jsxs5(Stack3, { space: 3, children: [
|
|
820
|
+
/* @__PURE__ */ jsxs5(Flex3, { align: "center", justify: "space-between", children: [
|
|
821
|
+
/* @__PURE__ */ jsx5(Text4, { size: 1, weight: "semibold", muted: true, children: "AI keyword suggestions" }),
|
|
822
|
+
/* @__PURE__ */ jsxs5(Flex3, { gap: 2, children: [
|
|
823
|
+
pendingSuggestions.length > 1 && /* @__PURE__ */ jsx5(
|
|
824
|
+
Button3,
|
|
741
825
|
{
|
|
742
826
|
mode: "ghost",
|
|
743
827
|
tone: "primary",
|
|
@@ -748,8 +832,8 @@ function KeywordSuggestions({
|
|
|
748
832
|
onClick: handleAddAll
|
|
749
833
|
}
|
|
750
834
|
),
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
|
|
835
|
+
/* @__PURE__ */ jsx5(
|
|
836
|
+
Button3,
|
|
753
837
|
{
|
|
754
838
|
mode: "ghost",
|
|
755
839
|
tone: "default",
|
|
@@ -762,9 +846,9 @@ function KeywordSuggestions({
|
|
|
762
846
|
)
|
|
763
847
|
] })
|
|
764
848
|
] }),
|
|
765
|
-
pendingSuggestions.length > 0 && /* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
849
|
+
pendingSuggestions.length > 0 && /* @__PURE__ */ jsxs5(Box, { children: [
|
|
850
|
+
/* @__PURE__ */ jsx5(Text4, { size: 0, muted: true, style: { marginBottom: 8 }, children: "Click to add:" }),
|
|
851
|
+
/* @__PURE__ */ jsx5(Flex3, { gap: 2, wrap: "wrap", style: { marginTop: 6 }, children: pendingSuggestions.map((kw) => /* @__PURE__ */ jsxs5(
|
|
768
852
|
"button",
|
|
769
853
|
{
|
|
770
854
|
type: "button",
|
|
@@ -796,34 +880,34 @@ function KeywordSuggestions({
|
|
|
796
880
|
kw
|
|
797
881
|
)) })
|
|
798
882
|
] }),
|
|
799
|
-
alreadyAdded.length > 0 && /* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
883
|
+
alreadyAdded.length > 0 && /* @__PURE__ */ jsxs5(Box, { children: [
|
|
884
|
+
/* @__PURE__ */ jsx5(Text4, { size: 0, muted: true, style: { marginBottom: 6 }, children: "Already added:" }),
|
|
885
|
+
/* @__PURE__ */ jsx5(Flex3, { gap: 2, wrap: "wrap", style: { marginTop: 4 }, children: alreadyAdded.map((kw) => /* @__PURE__ */ jsxs5(Badge, { tone: "positive", radius: 5, fontSize: 0, padding: 2, children: [
|
|
802
886
|
"\u2713 ",
|
|
803
887
|
kw
|
|
804
888
|
] }, kw)) })
|
|
805
889
|
] }),
|
|
806
|
-
pendingSuggestions.length === 0 && /* @__PURE__ */
|
|
890
|
+
pendingSuggestions.length === 0 && /* @__PURE__ */ jsx5(Text4, { size: 1, muted: true, children: "All suggested keywords added." })
|
|
807
891
|
] }) });
|
|
808
892
|
}
|
|
809
893
|
|
|
810
894
|
// src/components/meta/KeywordsInput.tsx
|
|
811
|
-
import { jsx as
|
|
895
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
812
896
|
var KeywordsInput = (props) => {
|
|
813
897
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
814
898
|
const { options } = schemaType;
|
|
815
899
|
const existing = value != null ? value : [];
|
|
816
900
|
const handleAdd = (kw) => {
|
|
817
901
|
if (existing.includes(kw)) return;
|
|
818
|
-
onChange(
|
|
902
|
+
onChange(PatchEvent3.from(set3([...existing, kw])));
|
|
819
903
|
};
|
|
820
904
|
const handleAddAll = (keywords) => {
|
|
821
905
|
const merged = [.../* @__PURE__ */ new Set([...existing, ...keywords])];
|
|
822
|
-
onChange(
|
|
906
|
+
onChange(PatchEvent3.from(set3(merged)));
|
|
823
907
|
};
|
|
824
|
-
return /* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ jsxs6(Stack4, { space: 3, children: [
|
|
825
909
|
renderDefault(props),
|
|
826
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ jsx6(
|
|
827
911
|
KeywordSuggestions,
|
|
828
912
|
{
|
|
829
913
|
ai: options == null ? void 0 : options.ai,
|
|
@@ -838,43 +922,51 @@ var KeywordsInput = (props) => {
|
|
|
838
922
|
var KeywordsInput_default = KeywordsInput;
|
|
839
923
|
|
|
840
924
|
// src/components/meta/MetaDescription.tsx
|
|
841
|
-
import { Stack as
|
|
925
|
+
import { Stack as Stack5, Text as Text5 } from "@sanity/ui";
|
|
842
926
|
import { useMemo as useMemo3 } from "react";
|
|
843
|
-
import { PatchEvent as
|
|
844
|
-
import { jsx as
|
|
927
|
+
import { PatchEvent as PatchEvent4, set as set4, useFormValue as useFormValue6 } from "sanity";
|
|
928
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
845
929
|
var MetaDescription = (props) => {
|
|
930
|
+
var _a, _b;
|
|
846
931
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
847
932
|
const { options } = schemaType;
|
|
848
|
-
const parent =
|
|
933
|
+
const parent = useFormValue6([path[0]]);
|
|
849
934
|
const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
|
|
850
935
|
const keywords = useMemo3(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
|
|
936
|
+
const rootDoc = useFormValue6([]);
|
|
937
|
+
const keywordsVisible = (_b = (_a = options == null ? void 0 : options.isKeywordsVisible) == null ? void 0 : _a.call(options, rootDoc == null ? void 0 : rootDoc._type)) != null ? _b : true;
|
|
851
938
|
const feedbackItems = useMemo3(
|
|
852
|
-
() => getMetaDescriptionValidationMessages(
|
|
853
|
-
|
|
939
|
+
() => getMetaDescriptionValidationMessages(
|
|
940
|
+
value || "",
|
|
941
|
+
keywords,
|
|
942
|
+
isParentseoField,
|
|
943
|
+
keywordsVisible
|
|
944
|
+
),
|
|
945
|
+
[value, keywords, isParentseoField, keywordsVisible]
|
|
854
946
|
);
|
|
855
947
|
const readability = useMemo3(() => analyzeReadability(value || ""), [value]);
|
|
856
|
-
return /* @__PURE__ */
|
|
948
|
+
return /* @__PURE__ */ jsxs7(Stack5, { space: 3, children: [
|
|
857
949
|
renderDefault(props),
|
|
858
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ jsx7(
|
|
859
951
|
SeoGenButton,
|
|
860
952
|
{
|
|
861
953
|
field: "description",
|
|
862
954
|
ai: options == null ? void 0 : options.ai,
|
|
863
955
|
seoFieldPath: String(path[0]),
|
|
864
|
-
onGenerate: (v) => onChange(
|
|
956
|
+
onGenerate: (v) => onChange(PatchEvent4.from(set4(v)))
|
|
865
957
|
}
|
|
866
958
|
),
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ jsx7(Stack5, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs7("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
960
|
+
/* @__PURE__ */ jsx7(
|
|
869
961
|
"div",
|
|
870
962
|
{
|
|
871
963
|
style: { width: 10, height: 10, borderRadius: "50%", backgroundColor: item.color }
|
|
872
964
|
}
|
|
873
965
|
),
|
|
874
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ jsx7(Text5, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
875
967
|
] }, item.text)) }),
|
|
876
|
-
readability && /* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
968
|
+
readability && /* @__PURE__ */ jsxs7("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
969
|
+
/* @__PURE__ */ jsx7(
|
|
878
970
|
"div",
|
|
879
971
|
{
|
|
880
972
|
style: {
|
|
@@ -885,7 +977,7 @@ var MetaDescription = (props) => {
|
|
|
885
977
|
}
|
|
886
978
|
}
|
|
887
979
|
),
|
|
888
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ jsxs7(Text5, { weight: "bold", muted: true, size: 14, children: [
|
|
889
981
|
"Readability: ",
|
|
890
982
|
readability.label,
|
|
891
983
|
" (Flesch ",
|
|
@@ -901,22 +993,22 @@ var MetaDescription = (props) => {
|
|
|
901
993
|
var MetaDescription_default = MetaDescription;
|
|
902
994
|
|
|
903
995
|
// src/components/meta/MetaImage.tsx
|
|
904
|
-
import { Stack as
|
|
996
|
+
import { Stack as Stack6, Text as Text6 } from "@sanity/ui";
|
|
905
997
|
import { useMemo as useMemo4 } from "react";
|
|
906
|
-
import { useFormValue as
|
|
907
|
-
import { jsx as
|
|
998
|
+
import { useFormValue as useFormValue7 } from "sanity";
|
|
999
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
908
1000
|
var MetaImage = (props) => {
|
|
909
1001
|
const { value, renderDefault, path } = props;
|
|
910
|
-
const seoParent =
|
|
1002
|
+
const seoParent = useFormValue7([path[0]]);
|
|
911
1003
|
const hasImage = !!(value == null ? void 0 : value.asset);
|
|
912
1004
|
const feedbackItems = useMemo4(
|
|
913
1005
|
() => getMetaImageValidation(hasImage, seoParent),
|
|
914
1006
|
[hasImage, seoParent]
|
|
915
1007
|
);
|
|
916
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ jsxs8(Stack6, { space: 3, children: [
|
|
917
1009
|
renderDefault(props),
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ jsx8(Stack6, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1011
|
+
/* @__PURE__ */ jsx8(
|
|
920
1012
|
"div",
|
|
921
1013
|
{
|
|
922
1014
|
style: {
|
|
@@ -927,17 +1019,17 @@ var MetaImage = (props) => {
|
|
|
927
1019
|
}
|
|
928
1020
|
}
|
|
929
1021
|
),
|
|
930
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ jsx8(Text6, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
931
1023
|
] }, item.text)) })
|
|
932
1024
|
] });
|
|
933
1025
|
};
|
|
934
1026
|
var MetaImage_default = MetaImage;
|
|
935
1027
|
|
|
936
1028
|
// src/components/meta/MetaTagsPreview.tsx
|
|
937
|
-
import { Box as Box2, Button as
|
|
938
|
-
import { useMemo as useMemo5, useState as
|
|
939
|
-
import { useClient, useColorScheme, useFormValue as
|
|
940
|
-
import { jsx as
|
|
1029
|
+
import { Box as Box2, Button as Button4, Card as Card4, Flex as Flex4, Stack as Stack7, Text as Text7 } from "@sanity/ui";
|
|
1030
|
+
import { useMemo as useMemo5, useState as useState5 } from "react";
|
|
1031
|
+
import { useClient as useClient2, useColorScheme, useFormValue as useFormValue8 } from "sanity";
|
|
1032
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
941
1033
|
function resolveImageUrl(asset, projectId, dataset) {
|
|
942
1034
|
const ref = asset == null ? void 0 : asset._ref;
|
|
943
1035
|
if (!ref) return null;
|
|
@@ -949,11 +1041,11 @@ function resolveImageUrl(asset, projectId, dataset) {
|
|
|
949
1041
|
}
|
|
950
1042
|
var MetaTagsPreview = (props) => {
|
|
951
1043
|
const { path } = props;
|
|
952
|
-
const [expanded, setExpanded] =
|
|
953
|
-
const [copyLabel, setCopyLabel] =
|
|
1044
|
+
const [expanded, setExpanded] = useState5(false);
|
|
1045
|
+
const [copyLabel, setCopyLabel] = useState5("Copy");
|
|
954
1046
|
const { scheme } = useColorScheme();
|
|
955
|
-
const seoFields =
|
|
956
|
-
const client =
|
|
1047
|
+
const seoFields = useFormValue8([path[0]]);
|
|
1048
|
+
const client = useClient2({ apiVersion: "2024-01-01" });
|
|
957
1049
|
const { projectId = "", dataset = "" } = client.config();
|
|
958
1050
|
const rawHtml = useMemo5(() => {
|
|
959
1051
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1025,16 +1117,16 @@ var MetaTagsPreview = (props) => {
|
|
|
1025
1117
|
const headerBg = isDark ? "#21262d" : "#f0f2f4";
|
|
1026
1118
|
const headerBorder = isDark ? "#30363d" : "#d0d7de";
|
|
1027
1119
|
const headerText = isDark ? "#e6edf3" : "#24292f";
|
|
1028
|
-
return /* @__PURE__ */
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ jsx9(Card4, { padding: 3, radius: 2, tone: "default", border: true, children: /* @__PURE__ */ jsxs9(Stack7, { space: 3, children: [
|
|
1121
|
+
/* @__PURE__ */ jsxs9(Flex4, { align: "center", justify: "space-between", gap: 3, children: [
|
|
1122
|
+
/* @__PURE__ */ jsx9(Text7, { weight: "semibold", size: 1, children: "Meta Tags Preview" }),
|
|
1123
|
+
/* @__PURE__ */ jsxs9(Flex4, { gap: 2, align: "center", children: [
|
|
1124
|
+
/* @__PURE__ */ jsxs9(Text7, { size: 0, muted: true, children: [
|
|
1033
1125
|
tagCount,
|
|
1034
1126
|
" tags generated"
|
|
1035
1127
|
] }),
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
|
|
1128
|
+
/* @__PURE__ */ jsx9(
|
|
1129
|
+
Button4,
|
|
1038
1130
|
{
|
|
1039
1131
|
text: copyLabel,
|
|
1040
1132
|
tone: "default",
|
|
@@ -1046,7 +1138,7 @@ var MetaTagsPreview = (props) => {
|
|
|
1046
1138
|
)
|
|
1047
1139
|
] })
|
|
1048
1140
|
] }),
|
|
1049
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsxs9(
|
|
1050
1142
|
"button",
|
|
1051
1143
|
{
|
|
1052
1144
|
type: "button",
|
|
@@ -1067,12 +1159,12 @@ var MetaTagsPreview = (props) => {
|
|
|
1067
1159
|
color: headerText
|
|
1068
1160
|
},
|
|
1069
1161
|
children: [
|
|
1070
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ jsx9("span", { style: { fontSize: 10 }, children: expanded ? "\u25B2" : "\u25BC" }),
|
|
1071
1163
|
expanded ? "Hide tags" : "Show tags"
|
|
1072
1164
|
]
|
|
1073
1165
|
}
|
|
1074
1166
|
),
|
|
1075
|
-
expanded && /* @__PURE__ */
|
|
1167
|
+
expanded && /* @__PURE__ */ jsxs9(
|
|
1076
1168
|
"div",
|
|
1077
1169
|
{
|
|
1078
1170
|
style: {
|
|
@@ -1081,7 +1173,7 @@ var MetaTagsPreview = (props) => {
|
|
|
1081
1173
|
overflow: "hidden"
|
|
1082
1174
|
},
|
|
1083
1175
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ jsxs9(
|
|
1085
1177
|
"div",
|
|
1086
1178
|
{
|
|
1087
1179
|
style: {
|
|
@@ -1093,7 +1185,7 @@ var MetaTagsPreview = (props) => {
|
|
|
1093
1185
|
gap: 6
|
|
1094
1186
|
},
|
|
1095
1187
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ jsx9(
|
|
1097
1189
|
"span",
|
|
1098
1190
|
{
|
|
1099
1191
|
style: {
|
|
@@ -1105,11 +1197,11 @@ var MetaTagsPreview = (props) => {
|
|
|
1105
1197
|
}
|
|
1106
1198
|
}
|
|
1107
1199
|
),
|
|
1108
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ jsx9("span", { style: { fontSize: 11, color: headerText, fontFamily: "monospace" }, children: "HTML" })
|
|
1109
1201
|
]
|
|
1110
1202
|
}
|
|
1111
1203
|
),
|
|
1112
|
-
/* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ jsx9(
|
|
1113
1205
|
Box2,
|
|
1114
1206
|
{
|
|
1115
1207
|
as: "pre",
|
|
@@ -1125,7 +1217,7 @@ var MetaTagsPreview = (props) => {
|
|
|
1125
1217
|
wordBreak: "break-word",
|
|
1126
1218
|
backgroundColor: codeBg
|
|
1127
1219
|
},
|
|
1128
|
-
children: tokens.map((token, idx) => /* @__PURE__ */
|
|
1220
|
+
children: tokens.map((token, idx) => /* @__PURE__ */ jsx9("span", { style: { color: token.color }, children: token.text }, idx))
|
|
1129
1221
|
}
|
|
1130
1222
|
)
|
|
1131
1223
|
]
|
|
@@ -1136,21 +1228,21 @@ var MetaTagsPreview = (props) => {
|
|
|
1136
1228
|
var MetaTagsPreview_default = MetaTagsPreview;
|
|
1137
1229
|
|
|
1138
1230
|
// src/components/meta/MetaTitle.tsx
|
|
1139
|
-
import { Stack as
|
|
1140
|
-
import { useEffect as useEffect3, useMemo as useMemo6, useState as
|
|
1141
|
-
import { PatchEvent as
|
|
1142
|
-
import { jsx as
|
|
1231
|
+
import { Stack as Stack8, Text as Text8 } from "@sanity/ui";
|
|
1232
|
+
import { useEffect as useEffect3, useMemo as useMemo6, useState as useState6 } from "react";
|
|
1233
|
+
import { PatchEvent as PatchEvent5, set as set5, useClient as useClient3, useFormValue as useFormValue9 } from "sanity";
|
|
1234
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1143
1235
|
var MetaTitle = (props) => {
|
|
1144
|
-
var _a, _b, _c;
|
|
1236
|
+
var _a, _b, _c, _d, _e;
|
|
1145
1237
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
1146
1238
|
const { options } = schemaType;
|
|
1147
|
-
const parent =
|
|
1239
|
+
const parent = useFormValue9([path[0]]);
|
|
1148
1240
|
const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
|
|
1149
1241
|
const keywords = useMemo6(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
|
|
1150
|
-
const rootDoc = (_a =
|
|
1151
|
-
const client =
|
|
1152
|
-
const [groqTitleSuffix, setGroqTitleSuffix] =
|
|
1153
|
-
const [isDuplicateTitle, setIsDuplicateTitle] =
|
|
1242
|
+
const rootDoc = (_a = useFormValue9([])) != null ? _a : {};
|
|
1243
|
+
const client = useClient3({ apiVersion: (_b = options == null ? void 0 : options.apiVersion) != null ? _b : "2024-01-01" });
|
|
1244
|
+
const [groqTitleSuffix, setGroqTitleSuffix] = useState6("");
|
|
1245
|
+
const [isDuplicateTitle, setIsDuplicateTitle] = useState6(false);
|
|
1154
1246
|
const titleSuffixQuery = options == null ? void 0 : options.titleSuffixQuery;
|
|
1155
1247
|
const titleSuffixOption = options == null ? void 0 : options.titleSuffix;
|
|
1156
1248
|
useEffect3(() => {
|
|
@@ -1185,24 +1277,31 @@ var MetaTitle = (props) => {
|
|
|
1185
1277
|
return titleSuffixOption;
|
|
1186
1278
|
}, [titleSuffixQuery, groqTitleSuffix, titleSuffixOption, rootDoc]);
|
|
1187
1279
|
const suffixLength = resolvedSuffix ? resolvedSuffix.length + 3 : 0;
|
|
1280
|
+
const keywordsVisible = (_e = (_d = options == null ? void 0 : options.isKeywordsVisible) == null ? void 0 : _d.call(options, rootDoc == null ? void 0 : rootDoc._type)) != null ? _e : true;
|
|
1188
1281
|
const feedbackItems = useMemo6(
|
|
1189
|
-
() => getMetaTitleValidationMessages(
|
|
1190
|
-
|
|
1282
|
+
() => getMetaTitleValidationMessages(
|
|
1283
|
+
value || "",
|
|
1284
|
+
keywords,
|
|
1285
|
+
isParentseoField,
|
|
1286
|
+
suffixLength,
|
|
1287
|
+
keywordsVisible
|
|
1288
|
+
),
|
|
1289
|
+
[value, keywords, isParentseoField, suffixLength, keywordsVisible]
|
|
1191
1290
|
);
|
|
1192
|
-
return /* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ jsxs10(Stack8, { space: 3, children: [
|
|
1193
1292
|
renderDefault(props),
|
|
1194
|
-
/* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ jsx10(
|
|
1195
1294
|
SeoGenButton,
|
|
1196
1295
|
{
|
|
1197
1296
|
field: "title",
|
|
1198
1297
|
ai: options == null ? void 0 : options.ai,
|
|
1199
1298
|
seoFieldPath: String(path[0]),
|
|
1200
|
-
onGenerate: (v) => onChange(
|
|
1299
|
+
onGenerate: (v) => onChange(PatchEvent5.from(set5(v)))
|
|
1201
1300
|
}
|
|
1202
1301
|
),
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
feedbackItems.map((item) => /* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ jsxs10(Stack8, { space: 2, children: [
|
|
1303
|
+
feedbackItems.map((item) => /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1304
|
+
/* @__PURE__ */ jsx10(
|
|
1206
1305
|
"div",
|
|
1207
1306
|
{
|
|
1208
1307
|
style: {
|
|
@@ -1213,10 +1312,10 @@ var MetaTitle = (props) => {
|
|
|
1213
1312
|
}
|
|
1214
1313
|
}
|
|
1215
1314
|
),
|
|
1216
|
-
/* @__PURE__ */
|
|
1315
|
+
/* @__PURE__ */ jsx10(Text8, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1217
1316
|
] }, item.text)),
|
|
1218
|
-
isDuplicateTitle && /* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1317
|
+
isDuplicateTitle && /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1318
|
+
/* @__PURE__ */ jsx10(
|
|
1220
1319
|
"div",
|
|
1221
1320
|
{
|
|
1222
1321
|
style: {
|
|
@@ -1227,7 +1326,7 @@ var MetaTitle = (props) => {
|
|
|
1227
1326
|
}
|
|
1228
1327
|
}
|
|
1229
1328
|
),
|
|
1230
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ jsx10(Text8, { weight: "bold", muted: true, size: 14, children: "Duplicate meta title \u2014 another published document uses this exact title." })
|
|
1231
1330
|
] })
|
|
1232
1331
|
] })
|
|
1233
1332
|
] });
|
|
@@ -1371,6 +1470,9 @@ var getFieldHiddenFunction = (fieldName, config) => {
|
|
|
1371
1470
|
return isFieldHidden(fieldName, config, documentType);
|
|
1372
1471
|
};
|
|
1373
1472
|
};
|
|
1473
|
+
var getKeywordsVisibilityChecker = (config) => {
|
|
1474
|
+
return (documentType) => !isFieldHidden("keywords", config, documentType);
|
|
1475
|
+
};
|
|
1374
1476
|
|
|
1375
1477
|
// src/utils/utils.ts
|
|
1376
1478
|
var isEmpty = (value) => {
|
|
@@ -1381,33 +1483,36 @@ var isEmpty = (value) => {
|
|
|
1381
1483
|
import { defineField, defineType } from "sanity";
|
|
1382
1484
|
|
|
1383
1485
|
// src/components/openGraph/OgDescription.tsx
|
|
1384
|
-
import { Stack as
|
|
1486
|
+
import { Stack as Stack9, Text as Text9 } from "@sanity/ui";
|
|
1385
1487
|
import { useMemo as useMemo7 } from "react";
|
|
1386
|
-
import { PatchEvent as
|
|
1387
|
-
import { jsx as
|
|
1488
|
+
import { PatchEvent as PatchEvent6, set as set6, useFormValue as useFormValue10 } from "sanity";
|
|
1489
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1388
1490
|
var OgDescription = (props) => {
|
|
1491
|
+
var _a, _b;
|
|
1389
1492
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
1390
1493
|
const { options } = schemaType;
|
|
1391
|
-
const parent =
|
|
1494
|
+
const parent = useFormValue10([path[0]]);
|
|
1392
1495
|
const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
|
|
1393
1496
|
const keywords = useMemo7(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
|
|
1497
|
+
const rootDoc = useFormValue10([]);
|
|
1498
|
+
const keywordsVisible = (_b = (_a = options == null ? void 0 : options.isKeywordsVisible) == null ? void 0 : _a.call(options, rootDoc == null ? void 0 : rootDoc._type)) != null ? _b : true;
|
|
1394
1499
|
const feedbackItems = useMemo7(
|
|
1395
|
-
() => getOgDescriptionValidation(value || "", keywords, isParentseoField),
|
|
1396
|
-
[value, keywords, isParentseoField]
|
|
1500
|
+
() => getOgDescriptionValidation(value || "", keywords, isParentseoField, keywordsVisible),
|
|
1501
|
+
[value, keywords, isParentseoField, keywordsVisible]
|
|
1397
1502
|
);
|
|
1398
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ jsxs11(Stack9, { space: 3, children: [
|
|
1399
1504
|
renderDefault(props),
|
|
1400
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ jsx11(
|
|
1401
1506
|
SeoGenButton,
|
|
1402
1507
|
{
|
|
1403
1508
|
field: "ogDescription",
|
|
1404
1509
|
ai: options == null ? void 0 : options.ai,
|
|
1405
1510
|
seoFieldPath: String(path[0]),
|
|
1406
|
-
onGenerate: (v) => onChange(
|
|
1511
|
+
onGenerate: (v) => onChange(PatchEvent6.from(set6(v)))
|
|
1407
1512
|
}
|
|
1408
1513
|
),
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ jsx11(Stack9, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1515
|
+
/* @__PURE__ */ jsx11(
|
|
1411
1516
|
"div",
|
|
1412
1517
|
{
|
|
1413
1518
|
style: {
|
|
@@ -1418,20 +1523,20 @@ var OgDescription = (props) => {
|
|
|
1418
1523
|
}
|
|
1419
1524
|
}
|
|
1420
1525
|
),
|
|
1421
|
-
/* @__PURE__ */
|
|
1526
|
+
/* @__PURE__ */ jsx11(Text9, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1422
1527
|
] }, item.text)) })
|
|
1423
1528
|
] });
|
|
1424
1529
|
};
|
|
1425
1530
|
var OgDescription_default = OgDescription;
|
|
1426
1531
|
|
|
1427
1532
|
// src/components/openGraph/OgImage.tsx
|
|
1428
|
-
import { Stack as
|
|
1533
|
+
import { Stack as Stack10, Text as Text10 } from "@sanity/ui";
|
|
1429
1534
|
import { useMemo as useMemo8 } from "react";
|
|
1430
|
-
import { useFormValue as
|
|
1431
|
-
import { jsx as
|
|
1535
|
+
import { useFormValue as useFormValue11 } from "sanity";
|
|
1536
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1432
1537
|
var OgImage = (props) => {
|
|
1433
1538
|
const { value, renderDefault, path } = props;
|
|
1434
|
-
const seoParent =
|
|
1539
|
+
const seoParent = useFormValue11([path[0]]);
|
|
1435
1540
|
const imgValue = value;
|
|
1436
1541
|
const hasImage = !!(imgValue == null ? void 0 : imgValue.asset);
|
|
1437
1542
|
const altText = imgValue == null ? void 0 : imgValue.alt;
|
|
@@ -1439,10 +1544,10 @@ var OgImage = (props) => {
|
|
|
1439
1544
|
() => getOgImageValidation(hasImage, altText, seoParent),
|
|
1440
1545
|
[hasImage, altText, seoParent]
|
|
1441
1546
|
);
|
|
1442
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ jsxs12(Stack10, { space: 3, children: [
|
|
1443
1548
|
renderDefault(props),
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ jsx12(Stack10, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1550
|
+
/* @__PURE__ */ jsx12(
|
|
1446
1551
|
"div",
|
|
1447
1552
|
{
|
|
1448
1553
|
style: {
|
|
@@ -1453,25 +1558,25 @@ var OgImage = (props) => {
|
|
|
1453
1558
|
}
|
|
1454
1559
|
}
|
|
1455
1560
|
),
|
|
1456
|
-
/* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ jsx12(Text10, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1457
1562
|
] }, item.text)) })
|
|
1458
1563
|
] });
|
|
1459
1564
|
};
|
|
1460
1565
|
var OgImage_default = OgImage;
|
|
1461
1566
|
|
|
1462
1567
|
// src/components/openGraph/OgImageUrl.tsx
|
|
1463
|
-
import { Stack as
|
|
1568
|
+
import { Stack as Stack11, Text as Text11 } from "@sanity/ui";
|
|
1464
1569
|
import { useMemo as useMemo9 } from "react";
|
|
1465
|
-
import { useFormValue as
|
|
1466
|
-
import { jsx as
|
|
1570
|
+
import { useFormValue as useFormValue12 } from "sanity";
|
|
1571
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1467
1572
|
var OgImageUrl = (props) => {
|
|
1468
1573
|
const { value, renderDefault, path } = props;
|
|
1469
|
-
const seoParent =
|
|
1574
|
+
const seoParent = useFormValue12([path[0]]);
|
|
1470
1575
|
const feedbackItems = useMemo9(() => getOgImageUrlValidation(value, seoParent), [value, seoParent]);
|
|
1471
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ jsxs13(Stack11, { space: 3, children: [
|
|
1472
1577
|
renderDefault(props),
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ jsx13(Stack11, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1579
|
+
/* @__PURE__ */ jsx13(
|
|
1475
1580
|
"div",
|
|
1476
1581
|
{
|
|
1477
1582
|
style: {
|
|
@@ -1482,40 +1587,43 @@ var OgImageUrl = (props) => {
|
|
|
1482
1587
|
}
|
|
1483
1588
|
}
|
|
1484
1589
|
),
|
|
1485
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsx13(Text11, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1486
1591
|
] }, item.text)) })
|
|
1487
1592
|
] });
|
|
1488
1593
|
};
|
|
1489
1594
|
var OgImageUrl_default = OgImageUrl;
|
|
1490
1595
|
|
|
1491
1596
|
// src/components/openGraph/OgTitle.tsx
|
|
1492
|
-
import { Stack as
|
|
1597
|
+
import { Stack as Stack12, Text as Text12 } from "@sanity/ui";
|
|
1493
1598
|
import { useMemo as useMemo10 } from "react";
|
|
1494
|
-
import { PatchEvent as
|
|
1495
|
-
import { jsx as
|
|
1599
|
+
import { PatchEvent as PatchEvent7, set as set7, useFormValue as useFormValue13 } from "sanity";
|
|
1600
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1496
1601
|
var OgTitle = (props) => {
|
|
1602
|
+
var _a, _b;
|
|
1497
1603
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
1498
1604
|
const { options } = schemaType;
|
|
1499
|
-
const parent =
|
|
1605
|
+
const parent = useFormValue13([path[0]]);
|
|
1500
1606
|
const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
|
|
1501
1607
|
const keywords = useMemo10(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
|
|
1608
|
+
const rootDoc = useFormValue13([]);
|
|
1609
|
+
const keywordsVisible = (_b = (_a = options == null ? void 0 : options.isKeywordsVisible) == null ? void 0 : _a.call(options, rootDoc == null ? void 0 : rootDoc._type)) != null ? _b : true;
|
|
1502
1610
|
const feedbackItems = useMemo10(
|
|
1503
|
-
() => getOgTitleValidation(value || "", keywords, isParentseoField),
|
|
1504
|
-
[value, keywords, isParentseoField]
|
|
1611
|
+
() => getOgTitleValidation(value || "", keywords, isParentseoField, keywordsVisible),
|
|
1612
|
+
[value, keywords, isParentseoField, keywordsVisible]
|
|
1505
1613
|
);
|
|
1506
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ jsxs14(Stack12, { space: 3, children: [
|
|
1507
1615
|
renderDefault(props),
|
|
1508
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ jsx14(
|
|
1509
1617
|
SeoGenButton,
|
|
1510
1618
|
{
|
|
1511
1619
|
field: "ogTitle",
|
|
1512
1620
|
ai: options == null ? void 0 : options.ai,
|
|
1513
1621
|
seoFieldPath: String(path[0]),
|
|
1514
|
-
onGenerate: (v) => onChange(
|
|
1622
|
+
onGenerate: (v) => onChange(PatchEvent7.from(set7(v)))
|
|
1515
1623
|
}
|
|
1516
1624
|
),
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ jsx14(Stack12, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1626
|
+
/* @__PURE__ */ jsx14(
|
|
1519
1627
|
"div",
|
|
1520
1628
|
{
|
|
1521
1629
|
style: {
|
|
@@ -1526,7 +1634,7 @@ var OgTitle = (props) => {
|
|
|
1526
1634
|
}
|
|
1527
1635
|
}
|
|
1528
1636
|
),
|
|
1529
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ jsx14(Text12, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1530
1638
|
] }, item.text)) })
|
|
1531
1639
|
] });
|
|
1532
1640
|
};
|
|
@@ -1554,7 +1662,9 @@ function openGraph(config = {}) {
|
|
|
1554
1662
|
components: {
|
|
1555
1663
|
input: OgTitle_default
|
|
1556
1664
|
},
|
|
1557
|
-
options: __spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {})
|
|
1665
|
+
options: __spreadProps(__spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {}), {
|
|
1666
|
+
isKeywordsVisible: getKeywordsVisibilityChecker(config)
|
|
1667
|
+
})
|
|
1558
1668
|
})),
|
|
1559
1669
|
defineField(__spreadProps(__spreadValues({
|
|
1560
1670
|
name: "description"
|
|
@@ -1565,7 +1675,9 @@ function openGraph(config = {}) {
|
|
|
1565
1675
|
components: {
|
|
1566
1676
|
input: OgDescription_default
|
|
1567
1677
|
},
|
|
1568
|
-
options: __spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {})
|
|
1678
|
+
options: __spreadProps(__spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {}), {
|
|
1679
|
+
isKeywordsVisible: getKeywordsVisibilityChecker(config)
|
|
1680
|
+
})
|
|
1569
1681
|
})),
|
|
1570
1682
|
defineField(__spreadProps(__spreadValues({
|
|
1571
1683
|
name: "siteName"
|
|
@@ -1652,33 +1764,36 @@ function openGraph(config = {}) {
|
|
|
1652
1764
|
import { defineField as defineField2, defineType as defineType2 } from "sanity";
|
|
1653
1765
|
|
|
1654
1766
|
// src/components/twitter/twitterDescription.tsx
|
|
1655
|
-
import { Stack as
|
|
1767
|
+
import { Stack as Stack13, Text as Text13 } from "@sanity/ui";
|
|
1656
1768
|
import { useMemo as useMemo11 } from "react";
|
|
1657
|
-
import { PatchEvent as
|
|
1658
|
-
import { jsx as
|
|
1769
|
+
import { PatchEvent as PatchEvent8, set as set8, useFormValue as useFormValue14 } from "sanity";
|
|
1770
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1659
1771
|
var TwitterDescription = (props) => {
|
|
1772
|
+
var _a, _b;
|
|
1660
1773
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
1661
1774
|
const { options } = schemaType;
|
|
1662
|
-
const parent =
|
|
1775
|
+
const parent = useFormValue14([path[0]]);
|
|
1663
1776
|
const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
|
|
1664
1777
|
const keywords = useMemo11(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
|
|
1778
|
+
const rootDoc = useFormValue14([]);
|
|
1779
|
+
const keywordsVisible = (_b = (_a = options == null ? void 0 : options.isKeywordsVisible) == null ? void 0 : _a.call(options, rootDoc == null ? void 0 : rootDoc._type)) != null ? _b : true;
|
|
1665
1780
|
const feedbackItems = useMemo11(
|
|
1666
|
-
() => getTwitterDescriptionValidation(value || "", keywords, isParentseoField),
|
|
1667
|
-
[value, keywords, isParentseoField]
|
|
1781
|
+
() => getTwitterDescriptionValidation(value || "", keywords, isParentseoField, keywordsVisible),
|
|
1782
|
+
[value, keywords, isParentseoField, keywordsVisible]
|
|
1668
1783
|
);
|
|
1669
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsxs15(Stack13, { space: 3, children: [
|
|
1670
1785
|
renderDefault(props),
|
|
1671
|
-
/* @__PURE__ */
|
|
1786
|
+
/* @__PURE__ */ jsx15(
|
|
1672
1787
|
SeoGenButton,
|
|
1673
1788
|
{
|
|
1674
1789
|
field: "twitterDescription",
|
|
1675
1790
|
ai: options == null ? void 0 : options.ai,
|
|
1676
1791
|
seoFieldPath: String(path[0]),
|
|
1677
|
-
onGenerate: (v) => onChange(
|
|
1792
|
+
onGenerate: (v) => onChange(PatchEvent8.from(set8(v)))
|
|
1678
1793
|
}
|
|
1679
1794
|
),
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ jsx15(Stack13, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1796
|
+
/* @__PURE__ */ jsx15(
|
|
1682
1797
|
"div",
|
|
1683
1798
|
{
|
|
1684
1799
|
style: {
|
|
@@ -1689,20 +1804,20 @@ var TwitterDescription = (props) => {
|
|
|
1689
1804
|
}
|
|
1690
1805
|
}
|
|
1691
1806
|
),
|
|
1692
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ jsx15(Text13, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1693
1808
|
] }, item.text)) })
|
|
1694
1809
|
] });
|
|
1695
1810
|
};
|
|
1696
1811
|
var twitterDescription_default = TwitterDescription;
|
|
1697
1812
|
|
|
1698
1813
|
// src/components/twitter/TwitterImage.tsx
|
|
1699
|
-
import { Stack as
|
|
1814
|
+
import { Stack as Stack14, Text as Text14 } from "@sanity/ui";
|
|
1700
1815
|
import { useMemo as useMemo12 } from "react";
|
|
1701
|
-
import { useFormValue as
|
|
1702
|
-
import { jsx as
|
|
1816
|
+
import { useFormValue as useFormValue15 } from "sanity";
|
|
1817
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1703
1818
|
var TwitterImage = (props) => {
|
|
1704
1819
|
const { value, renderDefault, path } = props;
|
|
1705
|
-
const seoParent =
|
|
1820
|
+
const seoParent = useFormValue15([path[0]]);
|
|
1706
1821
|
const imgValue = value;
|
|
1707
1822
|
const hasImage = !!(imgValue == null ? void 0 : imgValue.asset);
|
|
1708
1823
|
const altText = imgValue == null ? void 0 : imgValue.alt;
|
|
@@ -1710,10 +1825,10 @@ var TwitterImage = (props) => {
|
|
|
1710
1825
|
() => getTwitterImageValidation(hasImage, altText, seoParent),
|
|
1711
1826
|
[hasImage, altText, seoParent]
|
|
1712
1827
|
);
|
|
1713
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ jsxs16(Stack14, { space: 3, children: [
|
|
1714
1829
|
renderDefault(props),
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ jsx16(Stack14, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1831
|
+
/* @__PURE__ */ jsx16(
|
|
1717
1832
|
"div",
|
|
1718
1833
|
{
|
|
1719
1834
|
style: {
|
|
@@ -1724,28 +1839,28 @@ var TwitterImage = (props) => {
|
|
|
1724
1839
|
}
|
|
1725
1840
|
}
|
|
1726
1841
|
),
|
|
1727
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ jsx16(Text14, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1728
1843
|
] }, item.text)) })
|
|
1729
1844
|
] });
|
|
1730
1845
|
};
|
|
1731
1846
|
var TwitterImage_default = TwitterImage;
|
|
1732
1847
|
|
|
1733
1848
|
// src/components/twitter/TwitterImageUrl.tsx
|
|
1734
|
-
import { Stack as
|
|
1849
|
+
import { Stack as Stack15, Text as Text15 } from "@sanity/ui";
|
|
1735
1850
|
import { useMemo as useMemo13 } from "react";
|
|
1736
|
-
import { useFormValue as
|
|
1737
|
-
import { jsx as
|
|
1851
|
+
import { useFormValue as useFormValue16 } from "sanity";
|
|
1852
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1738
1853
|
var TwitterImageUrl = (props) => {
|
|
1739
1854
|
const { value, renderDefault, path } = props;
|
|
1740
|
-
const seoParent =
|
|
1855
|
+
const seoParent = useFormValue16([path[0]]);
|
|
1741
1856
|
const feedbackItems = useMemo13(
|
|
1742
1857
|
() => getTwitterImageUrlValidation(value, seoParent),
|
|
1743
1858
|
[value, seoParent]
|
|
1744
1859
|
);
|
|
1745
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsxs17(Stack15, { space: 3, children: [
|
|
1746
1861
|
renderDefault(props),
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ jsx17(Stack15, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1863
|
+
/* @__PURE__ */ jsx17(
|
|
1749
1864
|
"div",
|
|
1750
1865
|
{
|
|
1751
1866
|
style: {
|
|
@@ -1756,40 +1871,43 @@ var TwitterImageUrl = (props) => {
|
|
|
1756
1871
|
}
|
|
1757
1872
|
}
|
|
1758
1873
|
),
|
|
1759
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ jsx17(Text15, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1760
1875
|
] }, item.text)) })
|
|
1761
1876
|
] });
|
|
1762
1877
|
};
|
|
1763
1878
|
var TwitterImageUrl_default = TwitterImageUrl;
|
|
1764
1879
|
|
|
1765
1880
|
// src/components/twitter/twitterTitle.tsx
|
|
1766
|
-
import { Stack as
|
|
1881
|
+
import { Stack as Stack16, Text as Text16 } from "@sanity/ui";
|
|
1767
1882
|
import { useMemo as useMemo14 } from "react";
|
|
1768
|
-
import { PatchEvent as
|
|
1769
|
-
import { jsx as
|
|
1883
|
+
import { PatchEvent as PatchEvent9, set as set9, useFormValue as useFormValue17 } from "sanity";
|
|
1884
|
+
import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1770
1885
|
var TwitterTitle = (props) => {
|
|
1886
|
+
var _a, _b;
|
|
1771
1887
|
const { value, renderDefault, path, schemaType, onChange } = props;
|
|
1772
1888
|
const { options } = schemaType;
|
|
1773
|
-
const parent =
|
|
1889
|
+
const parent = useFormValue17([path[0]]);
|
|
1774
1890
|
const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
|
|
1775
1891
|
const keywords = useMemo14(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
|
|
1892
|
+
const rootDoc = useFormValue17([]);
|
|
1893
|
+
const keywordsVisible = (_b = (_a = options == null ? void 0 : options.isKeywordsVisible) == null ? void 0 : _a.call(options, rootDoc == null ? void 0 : rootDoc._type)) != null ? _b : true;
|
|
1776
1894
|
const feedbackItems = useMemo14(
|
|
1777
|
-
() => getTwitterTitleValidation(value || "", keywords, isParentseoField),
|
|
1778
|
-
[value, keywords, isParentseoField]
|
|
1895
|
+
() => getTwitterTitleValidation(value || "", keywords, isParentseoField, keywordsVisible),
|
|
1896
|
+
[value, keywords, isParentseoField, keywordsVisible]
|
|
1779
1897
|
);
|
|
1780
|
-
return /* @__PURE__ */
|
|
1898
|
+
return /* @__PURE__ */ jsxs18(Stack16, { space: 3, children: [
|
|
1781
1899
|
renderDefault(props),
|
|
1782
|
-
/* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ jsx18(
|
|
1783
1901
|
SeoGenButton,
|
|
1784
1902
|
{
|
|
1785
1903
|
field: "twitterTitle",
|
|
1786
1904
|
ai: options == null ? void 0 : options.ai,
|
|
1787
1905
|
seoFieldPath: String(path[0]),
|
|
1788
|
-
onGenerate: (v) => onChange(
|
|
1906
|
+
onGenerate: (v) => onChange(PatchEvent9.from(set9(v)))
|
|
1789
1907
|
}
|
|
1790
1908
|
),
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ jsx18(Stack16, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs18("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
1910
|
+
/* @__PURE__ */ jsx18(
|
|
1793
1911
|
"div",
|
|
1794
1912
|
{
|
|
1795
1913
|
style: {
|
|
@@ -1800,7 +1918,7 @@ var TwitterTitle = (props) => {
|
|
|
1800
1918
|
}
|
|
1801
1919
|
}
|
|
1802
1920
|
),
|
|
1803
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ jsx18(Text16, { weight: "bold", muted: true, size: 14, children: item.text })
|
|
1804
1922
|
] }, item.text)) })
|
|
1805
1923
|
] });
|
|
1806
1924
|
};
|
|
@@ -1849,7 +1967,9 @@ function twitter(config = {}) {
|
|
|
1849
1967
|
components: {
|
|
1850
1968
|
input: twitterTitle_default
|
|
1851
1969
|
},
|
|
1852
|
-
options: __spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {})
|
|
1970
|
+
options: __spreadProps(__spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {}), {
|
|
1971
|
+
isKeywordsVisible: getKeywordsVisibilityChecker(config)
|
|
1972
|
+
})
|
|
1853
1973
|
})),
|
|
1854
1974
|
defineField2(__spreadProps(__spreadValues({
|
|
1855
1975
|
name: "description",
|
|
@@ -1860,7 +1980,9 @@ function twitter(config = {}) {
|
|
|
1860
1980
|
components: {
|
|
1861
1981
|
input: twitterDescription_default
|
|
1862
1982
|
},
|
|
1863
|
-
options: __spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {})
|
|
1983
|
+
options: __spreadProps(__spreadValues({}, config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {}), {
|
|
1984
|
+
isKeywordsVisible: getKeywordsVisibilityChecker(config)
|
|
1985
|
+
})
|
|
1864
1986
|
})),
|
|
1865
1987
|
defineField2(__spreadProps(__spreadValues({
|
|
1866
1988
|
name: "imageType"
|
|
@@ -1919,7 +2041,7 @@ function twitter(config = {}) {
|
|
|
1919
2041
|
}
|
|
1920
2042
|
|
|
1921
2043
|
// src/schemas/index.ts
|
|
1922
|
-
var LazySeoPreview = lazy(() => import("./SeoPreview-
|
|
2044
|
+
var LazySeoPreview = lazy(() => import("./SeoPreview-TATJQFMP.js"));
|
|
1923
2045
|
var SeoPreviewWrapper = (props) => createElement(Suspense, { fallback: null }, createElement(LazySeoPreview, props));
|
|
1924
2046
|
function buildFieldGroupMap(groups) {
|
|
1925
2047
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1983,7 +2105,9 @@ function getAiOption(config) {
|
|
|
1983
2105
|
return config.ai ? { ai: withLicense(config.ai, config.licenseKey) } : {};
|
|
1984
2106
|
}
|
|
1985
2107
|
function getTitleFieldOptions(config) {
|
|
1986
|
-
return __spreadValues(__spreadValues(__spreadValues({}, config.apiVersion ? { apiVersion: config.apiVersion } : {}), getSeoPreviewSuffixOptions(config.seoPreview)), getAiOption(config))
|
|
2108
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, config.apiVersion ? { apiVersion: config.apiVersion } : {}), getSeoPreviewSuffixOptions(config.seoPreview)), getAiOption(config)), {
|
|
2109
|
+
isKeywordsVisible: getKeywordsVisibilityChecker(config)
|
|
2110
|
+
});
|
|
1987
2111
|
}
|
|
1988
2112
|
function buildGeoChecklistField(config, fieldGroupMap) {
|
|
1989
2113
|
if (config.geo === false) return [];
|
|
@@ -2023,6 +2147,7 @@ function buildMetaTagsPreviewField(config, fieldGroupMap) {
|
|
|
2023
2147
|
];
|
|
2024
2148
|
}
|
|
2025
2149
|
function seoFieldsSchema(config = {}) {
|
|
2150
|
+
var _a;
|
|
2026
2151
|
const groupsCfg = config.fieldGroups;
|
|
2027
2152
|
const fieldGroupMap = (groupsCfg == null ? void 0 : groupsCfg.length) ? buildFieldGroupMap(groupsCfg) : void 0;
|
|
2028
2153
|
const sanityGroups = (groupsCfg == null ? void 0 : groupsCfg.length) ? toSanityGroups(groupsCfg) : void 0;
|
|
@@ -2078,7 +2203,9 @@ function seoFieldsSchema(config = {}) {
|
|
|
2078
2203
|
components: {
|
|
2079
2204
|
input: MetaDescription_default
|
|
2080
2205
|
},
|
|
2081
|
-
options: getAiOption(config),
|
|
2206
|
+
options: __spreadProps(__spreadValues({}, getAiOption(config)), {
|
|
2207
|
+
isKeywordsVisible: getKeywordsVisibilityChecker(config)
|
|
2208
|
+
}),
|
|
2082
2209
|
hidden: getFieldHiddenFunction("description", config)
|
|
2083
2210
|
})),
|
|
2084
2211
|
fieldGroupMap
|
|
@@ -2147,12 +2274,20 @@ function seoFieldsSchema(config = {}) {
|
|
|
2147
2274
|
fieldGroupMap
|
|
2148
2275
|
),
|
|
2149
2276
|
withGroup(
|
|
2150
|
-
defineField3(__spreadProps(__spreadValues({
|
|
2277
|
+
defineField3(__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
2151
2278
|
name: "hreflangs"
|
|
2152
2279
|
}, getFieldInfo("hreflangs", config.fieldOverrides)), {
|
|
2153
2280
|
type: "array",
|
|
2154
2281
|
of: [{ type: "hreflangEntry" }],
|
|
2155
|
-
description: "Add alternate language/region versions. Include x-default for the fallback URL."
|
|
2282
|
+
description: "Add alternate language/region versions. Include x-default for the fallback URL."
|
|
2283
|
+
}), ((_a = config.hreflang) == null ? void 0 : _a.autoFill) ? {
|
|
2284
|
+
components: { input: HreflangInput_default },
|
|
2285
|
+
options: {
|
|
2286
|
+
hreflang: config.hreflang,
|
|
2287
|
+
baseUrl: config.baseUrl,
|
|
2288
|
+
apiVersion: config.apiVersion
|
|
2289
|
+
}
|
|
2290
|
+
} : {}), {
|
|
2156
2291
|
hidden: getFieldHiddenFunction("hreflangs", config)
|
|
2157
2292
|
})),
|
|
2158
2293
|
fieldGroupMap
|