@payloadcms/plugin-seo 3.0.0-canary.f6e77b8 → 3.0.0-canary.fb81f02
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/defaults.js.map +1 -1
- package/dist/exports/fields.d.ts +6 -0
- package/dist/exports/fields.d.ts.map +1 -0
- package/dist/exports/fields.js +7 -0
- package/dist/exports/fields.js.map +1 -0
- package/dist/exports/types.js.map +1 -1
- package/dist/fields/MetaDescription/MetaDescriptionComponent.d.ts +9 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.d.ts.map +1 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.js +138 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.js.map +1 -0
- package/dist/fields/MetaDescription/index.d.ts +12 -0
- package/dist/fields/MetaDescription/index.d.ts.map +1 -0
- package/dist/fields/MetaDescription/index.js +23 -0
- package/dist/fields/MetaDescription/index.js.map +1 -0
- package/dist/fields/MetaImage/MetaImageComponent.d.ts +8 -0
- package/dist/fields/MetaImage/MetaImageComponent.d.ts.map +1 -0
- package/dist/fields/MetaImage/MetaImageComponent.js +142 -0
- package/dist/fields/MetaImage/MetaImageComponent.js.map +1 -0
- package/dist/fields/MetaImage/index.d.ts +13 -0
- package/dist/fields/MetaImage/index.d.ts.map +1 -0
- package/dist/fields/MetaImage/index.js +26 -0
- package/dist/fields/MetaImage/index.js.map +1 -0
- package/dist/fields/MetaTitle/MetaTitleComponent.d.ts +9 -0
- package/dist/fields/MetaTitle/MetaTitleComponent.d.ts.map +1 -0
- package/dist/fields/MetaTitle/MetaTitleComponent.js +140 -0
- package/dist/fields/MetaTitle/MetaTitleComponent.js.map +1 -0
- package/dist/fields/MetaTitle/index.d.ts +12 -0
- package/dist/fields/MetaTitle/index.d.ts.map +1 -0
- package/dist/fields/MetaTitle/index.js +23 -0
- package/dist/fields/MetaTitle/index.js.map +1 -0
- package/dist/fields/Overview/OverviewComponent.d.ts +10 -0
- package/dist/fields/Overview/OverviewComponent.d.ts.map +1 -0
- package/dist/{ui/Overview.js → fields/Overview/OverviewComponent.js} +18 -12
- package/dist/fields/Overview/OverviewComponent.js.map +1 -0
- package/dist/fields/Overview/index.d.ts +26 -0
- package/dist/fields/Overview/index.d.ts.map +1 -0
- package/dist/fields/Overview/index.js +25 -0
- package/dist/fields/Overview/index.js.map +1 -0
- package/dist/fields/Preview/PreviewComponent.d.ts +10 -0
- package/dist/fields/Preview/PreviewComponent.d.ts.map +1 -0
- package/dist/fields/Preview/PreviewComponent.js +101 -0
- package/dist/fields/Preview/PreviewComponent.js.map +1 -0
- package/dist/fields/Preview/index.d.ts +24 -0
- package/dist/fields/Preview/index.d.ts.map +1 -0
- package/dist/fields/Preview/index.js +25 -0
- package/dist/fields/Preview/index.js.map +1 -0
- package/dist/fields/index.scss +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -42
- package/dist/index.js.map +1 -1
- package/dist/translations/index.d.ts +25 -0
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +22 -0
- package/dist/translations/index.js.map +1 -1
- package/dist/translations/ru.json +22 -0
- package/dist/types.d.ts +10 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/LengthIndicator.d.ts.map +1 -1
- package/dist/ui/LengthIndicator.js +62 -41
- package/dist/ui/LengthIndicator.js.map +1 -1
- package/dist/ui/Pill.js +7 -3
- package/dist/ui/Pill.js.map +1 -1
- package/package.json +30 -19
- package/dist/fields/MetaDescription.d.ts +0 -9
- package/dist/fields/MetaDescription.d.ts.map +0 -1
- package/dist/fields/MetaDescription.js +0 -116
- package/dist/fields/MetaDescription.js.map +0 -1
- package/dist/fields/MetaImage.d.ts +0 -8
- package/dist/fields/MetaImage.d.ts.map +0 -1
- package/dist/fields/MetaImage.js +0 -120
- package/dist/fields/MetaImage.js.map +0 -1
- package/dist/fields/MetaTitle.d.ts +0 -9
- package/dist/fields/MetaTitle.d.ts.map +0 -1
- package/dist/fields/MetaTitle.js +0 -117
- package/dist/fields/MetaTitle.js.map +0 -1
- package/dist/ui/Overview.d.ts +0 -3
- package/dist/ui/Overview.d.ts.map +0 -1
- package/dist/ui/Overview.js.map +0 -1
- package/dist/ui/Preview.d.ts +0 -8
- package/dist/ui/Preview.d.ts.map +0 -1
- package/dist/ui/Preview.js +0 -79
- package/dist/ui/Preview.js.map +0 -1
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { TextareaInput } from '@payloadcms/ui/fields/Textarea';
|
|
3
|
-
import { FieldLabel } from '@payloadcms/ui/forms/FieldLabel';
|
|
4
|
-
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
|
|
5
|
-
import { useAllFormFields } from '@payloadcms/ui/forms/Form';
|
|
6
|
-
import { useField } from '@payloadcms/ui/forms/useField';
|
|
7
|
-
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';
|
|
8
|
-
import { useLocale } from '@payloadcms/ui/providers/Locale';
|
|
9
|
-
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
10
|
-
import React, { useCallback } from 'react';
|
|
11
|
-
import { defaults } from '../defaults.js';
|
|
12
|
-
import { LengthIndicator } from '../ui/LengthIndicator.js';
|
|
13
|
-
const { maxLength, minLength } = defaults.description;
|
|
14
|
-
export const MetaDescription = (props)=>{
|
|
15
|
-
const { CustomLabel, hasGenerateDescriptionFn, label, labelProps, path, required } = props;
|
|
16
|
-
const { path: pathFromContext } = useFieldProps();
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
const locale = useLocale();
|
|
19
|
-
const [fields] = useAllFormFields();
|
|
20
|
-
const docInfo = useDocumentInfo();
|
|
21
|
-
const field = useField({
|
|
22
|
-
path
|
|
23
|
-
});
|
|
24
|
-
const { errorMessage, setValue, showError, value } = field;
|
|
25
|
-
const regenerateDescription = useCallback(async ()=>{
|
|
26
|
-
if (!hasGenerateDescriptionFn) return;
|
|
27
|
-
const genDescriptionResponse = await fetch('/api/plugin-seo/generate-description', {
|
|
28
|
-
body: JSON.stringify({
|
|
29
|
-
...docInfo,
|
|
30
|
-
doc: {
|
|
31
|
-
...fields
|
|
32
|
-
},
|
|
33
|
-
locale: typeof locale === 'object' ? locale?.code : locale
|
|
34
|
-
}),
|
|
35
|
-
credentials: 'include',
|
|
36
|
-
headers: {
|
|
37
|
-
'Content-Type': 'application/json'
|
|
38
|
-
},
|
|
39
|
-
method: 'POST'
|
|
40
|
-
});
|
|
41
|
-
const { result: generatedDescription } = await genDescriptionResponse.json();
|
|
42
|
-
setValue(generatedDescription || '');
|
|
43
|
-
}, [
|
|
44
|
-
fields,
|
|
45
|
-
setValue,
|
|
46
|
-
hasGenerateDescriptionFn,
|
|
47
|
-
locale,
|
|
48
|
-
docInfo
|
|
49
|
-
]);
|
|
50
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
51
|
-
style: {
|
|
52
|
-
marginBottom: '20px'
|
|
53
|
-
}
|
|
54
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
55
|
-
style: {
|
|
56
|
-
marginBottom: '5px',
|
|
57
|
-
position: 'relative'
|
|
58
|
-
}
|
|
59
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
60
|
-
className: "plugin-seo__field"
|
|
61
|
-
}, /*#__PURE__*/ React.createElement(FieldLabel, {
|
|
62
|
-
CustomLabel: CustomLabel,
|
|
63
|
-
label: label,
|
|
64
|
-
...labelProps || {}
|
|
65
|
-
}), hasGenerateDescriptionFn && /*#__PURE__*/ React.createElement(React.Fragment, null, " — ", /*#__PURE__*/ React.createElement("button", {
|
|
66
|
-
onClick: regenerateDescription,
|
|
67
|
-
style: {
|
|
68
|
-
background: 'none',
|
|
69
|
-
backgroundColor: 'transparent',
|
|
70
|
-
border: 'none',
|
|
71
|
-
color: 'currentcolor',
|
|
72
|
-
cursor: 'pointer',
|
|
73
|
-
padding: 0,
|
|
74
|
-
textDecoration: 'underline'
|
|
75
|
-
},
|
|
76
|
-
type: "button"
|
|
77
|
-
}, t('plugin-seo:autoGenerate')))), /*#__PURE__*/ React.createElement("div", {
|
|
78
|
-
style: {
|
|
79
|
-
color: '#9A9A9A'
|
|
80
|
-
}
|
|
81
|
-
}, t('plugin-seo:lengthTipDescription', {
|
|
82
|
-
maxLength,
|
|
83
|
-
minLength
|
|
84
|
-
}), /*#__PURE__*/ React.createElement("a", {
|
|
85
|
-
href: "https://developers.google.com/search/docs/advanced/appearance/snippet#meta-descriptions",
|
|
86
|
-
rel: "noopener noreferrer",
|
|
87
|
-
target: "_blank"
|
|
88
|
-
}, t('plugin-seo:bestPractices')))), /*#__PURE__*/ React.createElement("div", {
|
|
89
|
-
style: {
|
|
90
|
-
marginBottom: '10px',
|
|
91
|
-
position: 'relative'
|
|
92
|
-
}
|
|
93
|
-
}, /*#__PURE__*/ React.createElement(TextareaInput, {
|
|
94
|
-
CustomError: errorMessage,
|
|
95
|
-
onChange: setValue,
|
|
96
|
-
path: pathFromContext,
|
|
97
|
-
required: required,
|
|
98
|
-
showError: showError,
|
|
99
|
-
style: {
|
|
100
|
-
marginBottom: 0
|
|
101
|
-
},
|
|
102
|
-
value: value
|
|
103
|
-
})), /*#__PURE__*/ React.createElement("div", {
|
|
104
|
-
style: {
|
|
105
|
-
alignItems: 'center',
|
|
106
|
-
display: 'flex',
|
|
107
|
-
width: '100%'
|
|
108
|
-
}
|
|
109
|
-
}, /*#__PURE__*/ React.createElement(LengthIndicator, {
|
|
110
|
-
maxLength: maxLength,
|
|
111
|
-
minLength: minLength,
|
|
112
|
-
text: value
|
|
113
|
-
})));
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
//# sourceMappingURL=MetaDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fields/MetaDescription.tsx"],"sourcesContent":["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { FieldType, Options } from '@payloadcms/ui/forms/useField'\n\nimport { TextareaInput } from '@payloadcms/ui/fields/Textarea'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useAllFormFields } from '@payloadcms/ui/forms/Form'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useLocale } from '@payloadcms/ui/providers/Locale'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport React, { useCallback } from 'react'\n\nimport type { GenerateDescription } from '../types.js'\n\nimport { defaults } from '../defaults.js'\nimport { LengthIndicator } from '../ui/LengthIndicator.js'\n\nconst { maxLength, minLength } = defaults.description\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\ntype MetaDescriptionProps = FormFieldBase & {\n hasGenerateDescriptionFn: boolean\n path: string\n}\n\nexport const MetaDescription: React.FC<MetaDescriptionProps> = (props) => {\n const { CustomLabel, hasGenerateDescriptionFn, label, labelProps, path, required } = props\n const { path: pathFromContext } = useFieldProps()\n\n const { t } = useTranslation()\n\n const locale = useLocale()\n const [fields] = useAllFormFields()\n const docInfo = useDocumentInfo()\n\n const field: FieldType<string> = useField({\n path,\n } as Options)\n\n const { errorMessage, setValue, showError, value } = field\n\n const regenerateDescription = useCallback(async () => {\n if (!hasGenerateDescriptionFn) return\n\n const genDescriptionResponse = await fetch('/api/plugin-seo/generate-description', {\n body: JSON.stringify({\n ...docInfo,\n doc: { ...fields },\n locale: typeof locale === 'object' ? locale?.code : locale,\n } satisfies Parameters<GenerateDescription>[0]),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n })\n\n const { result: generatedDescription } = await genDescriptionResponse.json()\n\n setValue(generatedDescription || '')\n }, [fields, setValue, hasGenerateDescriptionFn, locale, docInfo])\n\n return (\n <div\n style={{\n marginBottom: '20px',\n }}\n >\n <div\n style={{\n marginBottom: '5px',\n position: 'relative',\n }}\n >\n <div className=\"plugin-seo__field\">\n <FieldLabel CustomLabel={CustomLabel} label={label} {...(labelProps || {})} />\n {hasGenerateDescriptionFn && (\n <React.Fragment>\n — \n <button\n onClick={regenerateDescription}\n style={{\n background: 'none',\n backgroundColor: 'transparent',\n border: 'none',\n color: 'currentcolor',\n cursor: 'pointer',\n padding: 0,\n textDecoration: 'underline',\n }}\n type=\"button\"\n >\n {t('plugin-seo:autoGenerate')}\n </button>\n </React.Fragment>\n )}\n </div>\n <div\n style={{\n color: '#9A9A9A',\n }}\n >\n {t('plugin-seo:lengthTipDescription', { maxLength, minLength })}\n <a\n href=\"https://developers.google.com/search/docs/advanced/appearance/snippet#meta-descriptions\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {t('plugin-seo:bestPractices')}\n </a>\n </div>\n </div>\n <div\n style={{\n marginBottom: '10px',\n position: 'relative',\n }}\n >\n <TextareaInput\n CustomError={errorMessage}\n onChange={setValue}\n path={pathFromContext}\n required={required}\n showError={showError}\n style={{\n marginBottom: 0,\n }}\n value={value}\n />\n </div>\n <div\n style={{\n alignItems: 'center',\n display: 'flex',\n width: '100%',\n }}\n >\n <LengthIndicator maxLength={maxLength} minLength={minLength} text={value} />\n </div>\n </div>\n )\n}\n"],"names":["TextareaInput","FieldLabel","useFieldProps","useAllFormFields","useField","useDocumentInfo","useLocale","useTranslation","React","useCallback","defaults","LengthIndicator","maxLength","minLength","description","MetaDescription","props","CustomLabel","hasGenerateDescriptionFn","label","labelProps","path","required","pathFromContext","t","locale","fields","docInfo","field","errorMessage","setValue","showError","value","regenerateDescription","genDescriptionResponse","fetch","body","JSON","stringify","doc","code","credentials","headers","method","result","generatedDescription","json","div","style","marginBottom","position","className","Fragment","button","onClick","background","backgroundColor","border","color","cursor","padding","textDecoration","type","a","href","rel","target","CustomError","onChange","alignItems","display","width","text"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAa;YACbC,SAAS;gBACP,gBAAgB;YAClB;YACAC,QAAQ;QACV;QAEA,MAAM,EAAEC,QAAQC,oBAAoB,EAAE,GAAG,MAAMX,uBAAuBY,IAAI;QAE1EhB,SAASe,wBAAwB;IACnC,GAAG;QAACnB;QAAQI;QAAUZ;QAA0BO;QAAQE;KAAQ;IAEhE,qBACE,oBAACoB;QACCC,OAAO;YACLC,cAAc;QAChB;qBAEA,oBAACF;QACCC,OAAO;YACLC,cAAc;YACdC,UAAU;QACZ;qBAEA,oBAACH;QAAII,WAAU;qBACb,oBAAClD;QAAWgB,aAAaA;QAAaE,OAAOA;QAAQ,GAAIC,cAAc,CAAC,CAAC;QACxEF,0CACC,oBAACV,MAAM4C,QAAQ,QAAC,uBAEd,oBAACC;QACCC,SAASrB;QACTe,OAAO;YACLO,YAAY;YACZC,iBAAiB;YACjBC,QAAQ;YACRC,OAAO;YACPC,QAAQ;YACRC,SAAS;YACTC,gBAAgB;QAClB;QACAC,MAAK;OAEJtC,EAAE,6CAKX,oBAACuB;QACCC,OAAO;YACLU,OAAO;QACT;OAEClC,EAAE,mCAAmC;QAAEZ;QAAWC;IAAU,kBAC7D,oBAACkD;QACCC,MAAK;QACLC,KAAI;QACJC,QAAO;OAEN1C,EAAE,8CAIT,oBAACuB;QACCC,OAAO;YACLC,cAAc;YACdC,UAAU;QACZ;qBAEA,oBAAClD;QACCmE,aAAatC;QACbuC,UAAUtC;QACVT,MAAME;QACND,UAAUA;QACVS,WAAWA;QACXiB,OAAO;YACLC,cAAc;QAChB;QACAjB,OAAOA;uBAGX,oBAACe;QACCC,OAAO;YACLqB,YAAY;YACZC,SAAS;YACTC,OAAO;QACT;qBAEA,oBAAC5D;QAAgBC,WAAWA;QAAWC,WAAWA;QAAW2D,MAAMxC;;AAI3E,EAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { UploadInputProps } from '@payloadcms/ui/fields/Upload';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type MetaImageProps = UploadInputProps & {
|
|
4
|
-
hasGenerateImageFn: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare const MetaImage: React.FC<MetaImageProps>;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=MetaImage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetaImage.d.ts","sourceRoot":"","sources":["../../src/fields/MetaImage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAWpE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,KAAK,cAAc,GAAG,gBAAgB,GAAG;IACvC,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAoI9C,CAAA"}
|
package/dist/fields/MetaImage.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { UploadInput } from '@payloadcms/ui/fields/Upload';
|
|
3
|
-
import { FieldLabel } from '@payloadcms/ui/forms/FieldLabel';
|
|
4
|
-
import { useAllFormFields } from '@payloadcms/ui/forms/Form';
|
|
5
|
-
import { useField } from '@payloadcms/ui/forms/useField';
|
|
6
|
-
import { useConfig } from '@payloadcms/ui/providers/Config';
|
|
7
|
-
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';
|
|
8
|
-
import { useLocale } from '@payloadcms/ui/providers/Locale';
|
|
9
|
-
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
10
|
-
import React, { useCallback } from 'react';
|
|
11
|
-
import { Pill } from '../ui/Pill.js';
|
|
12
|
-
export const MetaImage = (props)=>{
|
|
13
|
-
const { CustomLabel, hasGenerateImageFn, label, labelProps, relationTo, required } = props || {};
|
|
14
|
-
const field = useField(props);
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
const locale = useLocale();
|
|
17
|
-
const [fields] = useAllFormFields();
|
|
18
|
-
const docInfo = useDocumentInfo();
|
|
19
|
-
const { errorMessage, setValue, showError, value } = field;
|
|
20
|
-
const regenerateImage = useCallback(async ()=>{
|
|
21
|
-
if (!hasGenerateImageFn) return;
|
|
22
|
-
const genImageResponse = await fetch('/api/plugin-seo/generate-image', {
|
|
23
|
-
body: JSON.stringify({
|
|
24
|
-
...docInfo,
|
|
25
|
-
doc: {
|
|
26
|
-
...fields
|
|
27
|
-
},
|
|
28
|
-
locale: typeof locale === 'object' ? locale?.code : locale
|
|
29
|
-
}),
|
|
30
|
-
credentials: 'include',
|
|
31
|
-
headers: {
|
|
32
|
-
'Content-Type': 'application/json'
|
|
33
|
-
},
|
|
34
|
-
method: 'POST'
|
|
35
|
-
});
|
|
36
|
-
const { result: generatedImage } = await genImageResponse.json();
|
|
37
|
-
setValue(generatedImage || '');
|
|
38
|
-
}, [
|
|
39
|
-
fields,
|
|
40
|
-
setValue,
|
|
41
|
-
hasGenerateImageFn,
|
|
42
|
-
locale,
|
|
43
|
-
docInfo
|
|
44
|
-
]);
|
|
45
|
-
const hasImage = Boolean(value);
|
|
46
|
-
const config = useConfig();
|
|
47
|
-
const { collections, routes: { api } = {}, serverURL } = config;
|
|
48
|
-
const collection = collections?.find((coll)=>coll.slug === relationTo) || undefined;
|
|
49
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
50
|
-
style: {
|
|
51
|
-
marginBottom: '20px'
|
|
52
|
-
}
|
|
53
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
54
|
-
style: {
|
|
55
|
-
marginBottom: '5px',
|
|
56
|
-
position: 'relative'
|
|
57
|
-
}
|
|
58
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
59
|
-
className: "plugin-seo__field"
|
|
60
|
-
}, /*#__PURE__*/ React.createElement(FieldLabel, {
|
|
61
|
-
CustomLabel: CustomLabel,
|
|
62
|
-
label: label,
|
|
63
|
-
...labelProps || {}
|
|
64
|
-
}), hasGenerateImageFn && /*#__PURE__*/ React.createElement(React.Fragment, null, " — ", /*#__PURE__*/ React.createElement("button", {
|
|
65
|
-
onClick: regenerateImage,
|
|
66
|
-
style: {
|
|
67
|
-
background: 'none',
|
|
68
|
-
backgroundColor: 'transparent',
|
|
69
|
-
border: 'none',
|
|
70
|
-
color: 'currentcolor',
|
|
71
|
-
cursor: 'pointer',
|
|
72
|
-
padding: 0,
|
|
73
|
-
textDecoration: 'underline'
|
|
74
|
-
},
|
|
75
|
-
type: "button"
|
|
76
|
-
}, t('plugin-seo:autoGenerate')))), hasGenerateImageFn && /*#__PURE__*/ React.createElement("div", {
|
|
77
|
-
style: {
|
|
78
|
-
color: '#9A9A9A'
|
|
79
|
-
}
|
|
80
|
-
}, t('plugin-seo:imageAutoGenerationTip'))), /*#__PURE__*/ React.createElement("div", {
|
|
81
|
-
style: {
|
|
82
|
-
marginBottom: '10px',
|
|
83
|
-
position: 'relative'
|
|
84
|
-
}
|
|
85
|
-
}, /*#__PURE__*/ React.createElement(UploadInput, {
|
|
86
|
-
CustomError: errorMessage,
|
|
87
|
-
api: api,
|
|
88
|
-
collection: collection,
|
|
89
|
-
filterOptions: {},
|
|
90
|
-
label: undefined,
|
|
91
|
-
onChange: (incomingImage)=>{
|
|
92
|
-
if (incomingImage !== null) {
|
|
93
|
-
const { id: incomingID } = incomingImage;
|
|
94
|
-
setValue(incomingID);
|
|
95
|
-
} else {
|
|
96
|
-
setValue(null);
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
relationTo: relationTo,
|
|
100
|
-
required: required,
|
|
101
|
-
serverURL: serverURL,
|
|
102
|
-
showError: showError,
|
|
103
|
-
style: {
|
|
104
|
-
marginBottom: 0
|
|
105
|
-
},
|
|
106
|
-
value: value
|
|
107
|
-
})), /*#__PURE__*/ React.createElement("div", {
|
|
108
|
-
style: {
|
|
109
|
-
alignItems: 'center',
|
|
110
|
-
display: 'flex',
|
|
111
|
-
width: '100%'
|
|
112
|
-
}
|
|
113
|
-
}, /*#__PURE__*/ React.createElement(Pill, {
|
|
114
|
-
backgroundColor: hasImage ? 'green' : 'red',
|
|
115
|
-
color: "white",
|
|
116
|
-
label: hasImage ? t('plugin-seo:good') : t('plugin-seo:noImage')
|
|
117
|
-
})));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=MetaImage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fields/MetaImage.tsx"],"sourcesContent":["'use client'\n\nimport type { UploadInputProps } from '@payloadcms/ui/fields/Upload'\nimport type { FieldType, Options } from '@payloadcms/ui/forms/useField'\n\nimport { UploadInput } from '@payloadcms/ui/fields/Upload'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useAllFormFields } from '@payloadcms/ui/forms/Form'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useLocale } from '@payloadcms/ui/providers/Locale'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport React, { useCallback } from 'react'\n\nimport type { GenerateImage } from '../types.js'\n\nimport { Pill } from '../ui/Pill.js'\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\ntype MetaImageProps = UploadInputProps & {\n hasGenerateImageFn: boolean\n}\n\nexport const MetaImage: React.FC<MetaImageProps> = (props) => {\n const { CustomLabel, hasGenerateImageFn, label, labelProps, relationTo, required } = props || {}\n\n const field: FieldType<string> = useField(props as Options)\n\n const { t } = useTranslation()\n\n const locale = useLocale()\n const [fields] = useAllFormFields()\n const docInfo = useDocumentInfo()\n\n const { errorMessage, setValue, showError, value } = field\n\n const regenerateImage = useCallback(async () => {\n if (!hasGenerateImageFn) return\n\n const genImageResponse = await fetch('/api/plugin-seo/generate-image', {\n body: JSON.stringify({\n ...docInfo,\n doc: { ...fields },\n locale: typeof locale === 'object' ? locale?.code : locale,\n } satisfies Parameters<GenerateImage>[0]),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n })\n\n const { result: generatedImage } = await genImageResponse.json()\n\n setValue(generatedImage || '')\n }, [fields, setValue, hasGenerateImageFn, locale, docInfo])\n\n const hasImage = Boolean(value)\n\n const config = useConfig()\n\n const { collections, routes: { api } = {}, serverURL } = config\n\n const collection = collections?.find((coll) => coll.slug === relationTo) || undefined\n\n return (\n <div\n style={{\n marginBottom: '20px',\n }}\n >\n <div\n style={{\n marginBottom: '5px',\n position: 'relative',\n }}\n >\n <div className=\"plugin-seo__field\">\n <FieldLabel CustomLabel={CustomLabel} label={label} {...(labelProps || {})} />\n {hasGenerateImageFn && (\n <React.Fragment>\n — \n <button\n onClick={regenerateImage}\n style={{\n background: 'none',\n backgroundColor: 'transparent',\n border: 'none',\n color: 'currentcolor',\n cursor: 'pointer',\n padding: 0,\n textDecoration: 'underline',\n }}\n type=\"button\"\n >\n {t('plugin-seo:autoGenerate')}\n </button>\n </React.Fragment>\n )}\n </div>\n {hasGenerateImageFn && (\n <div\n style={{\n color: '#9A9A9A',\n }}\n >\n {t('plugin-seo:imageAutoGenerationTip')}\n </div>\n )}\n </div>\n <div\n style={{\n marginBottom: '10px',\n position: 'relative',\n }}\n >\n <UploadInput\n CustomError={errorMessage}\n api={api}\n collection={collection}\n filterOptions={{}}\n label={undefined}\n onChange={(incomingImage) => {\n if (incomingImage !== null) {\n const { id: incomingID } = incomingImage\n setValue(incomingID)\n } else {\n setValue(null)\n }\n }}\n relationTo={relationTo}\n required={required}\n serverURL={serverURL}\n showError={showError}\n style={{\n marginBottom: 0,\n }}\n value={value}\n />\n </div>\n <div\n style={{\n alignItems: 'center',\n display: 'flex',\n width: '100%',\n }}\n >\n <Pill\n backgroundColor={hasImage ? 'green' : 'red'}\n color=\"white\"\n label={hasImage ? t('plugin-seo:good') : t('plugin-seo:noImage')}\n />\n </div>\n </div>\n )\n}\n"],"names":["UploadInput","FieldLabel","useAllFormFields","useField","useConfig","useDocumentInfo","useLocale","useTranslation","React","useCallback","Pill","MetaImage","props","CustomLabel","hasGenerateImageFn","label","labelProps","relationTo","required","field","t","locale","fields","docInfo","errorMessage","setValue","showError","value","regenerateImage","genImageResponse","fetch","body","JSON","stringify","doc","code","credentials","headers","method","result","generatedImage","json","hasImage","Boolean","config","collections","routes","api","serverURL","collection","find","coll","slug","undefined","div","style","marginBottom","position","className","Fragment","button","onClick","background","backgroundColor","border","color","cursor","padding","textDecoration","type","CustomError","filterOptions","onChange","incomingImage","id","incomingID","alignItems","display","width"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAKA,SAASA,WAAW,QAAQ,+BAA8B;AAC1D,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,IAAI,QAAQ,gBAAe;AAOpC,OAAO,MAAMC,YAAsC,CAACC;IAClD,MAAM,EAAEC,WAAW,EAAEC,kBAAkB,EAAEC,KAAK,EAAEC,UAAU,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGN,SAAS,CAAC;IAE/F,MAAMO,QAA2BhB,SAASS;IAE1C,MAAM,EAAEQ,CAAC,EAAE,GAAGb;IAEd,MAAMc,SAASf;IACf,MAAM,CAACgB,OAAO,GAAGpB;IACjB,MAAMqB,UAAUlB;IAEhB,MAAM,EAAEmB,YAAY,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAG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dC,UAAU;QACZ;qBAEA,oBAACzD;QACCsE,aAAa9C;QACbuB,KAAKA;QACLE,YAAYA;QACZsB,eAAe,CAAC;QAChBxD,OAAOsC;QACPmB,UAAU,CAACC;YACT,IAAIA,kBAAkB,MAAM;gBAC1B,MAAM,EAAEC,IAAIC,UAAU,EAAE,GAAGF;gBAC3BhD,SAASkD;YACX,OAAO;gBACLlD,SAAS;YACX;QACF;QACAR,YAAYA;QACZC,UAAUA;QACV8B,WAAWA;QACXtB,WAAWA;QACX6B,OAAO;YACLC,cAAc;QAChB;QACA7B,OAAOA;uBAGX,oBAAC2B;QACCC,OAAO;YACLqB,YAAY;YACZC,SAAS;YACTC,OAAO;QACT;qBAEA,oBAACpE;QACCqD,iBAAiBrB,WAAW,UAAU;QACtCuB,OAAM;QACNlD,OAAO2B,WAAWtB,EAAE,qBAAqBA,EAAE;;AAKrD,EAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './index.scss';
|
|
4
|
-
type MetaTitleProps = FormFieldBase & {
|
|
5
|
-
hasGenerateTitleFn: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const MetaTitle: React.FC<MetaTitleProps>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=MetaTitle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetaTitle.d.ts","sourceRoot":"","sources":["../../src/fields/MetaTitle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAYjE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAM1C,OAAO,cAAc,CAAA;AAKrB,KAAK,cAAc,GAAG,aAAa,GAAG;IACpC,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAqH9C,CAAA"}
|
package/dist/fields/MetaTitle.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { TextInput } from '@payloadcms/ui/fields/Text';
|
|
3
|
-
import { FieldLabel } from '@payloadcms/ui/forms/FieldLabel';
|
|
4
|
-
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
|
|
5
|
-
import { useAllFormFields } from '@payloadcms/ui/forms/Form';
|
|
6
|
-
import { useField } from '@payloadcms/ui/forms/useField';
|
|
7
|
-
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';
|
|
8
|
-
import { useLocale } from '@payloadcms/ui/providers/Locale';
|
|
9
|
-
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
10
|
-
import React, { useCallback } from 'react';
|
|
11
|
-
import { defaults } from '../defaults.js';
|
|
12
|
-
import { LengthIndicator } from '../ui/LengthIndicator.js';
|
|
13
|
-
import './index.scss';
|
|
14
|
-
const { maxLength, minLength } = defaults.title;
|
|
15
|
-
export const MetaTitle = (props)=>{
|
|
16
|
-
const { CustomLabel, hasGenerateTitleFn, label, labelProps, path, required } = props || {};
|
|
17
|
-
const { path: pathFromContext } = useFieldProps();
|
|
18
|
-
const { t } = useTranslation();
|
|
19
|
-
const field = useField({
|
|
20
|
-
path
|
|
21
|
-
});
|
|
22
|
-
const locale = useLocale();
|
|
23
|
-
const [fields] = useAllFormFields();
|
|
24
|
-
const docInfo = useDocumentInfo();
|
|
25
|
-
const { errorMessage, setValue, showError, value } = field;
|
|
26
|
-
const regenerateTitle = useCallback(async ()=>{
|
|
27
|
-
if (!hasGenerateTitleFn) return;
|
|
28
|
-
const genTitleResponse = await fetch('/api/plugin-seo/generate-title', {
|
|
29
|
-
body: JSON.stringify({
|
|
30
|
-
...docInfo,
|
|
31
|
-
doc: {
|
|
32
|
-
...fields
|
|
33
|
-
},
|
|
34
|
-
locale: typeof locale === 'object' ? locale?.code : locale
|
|
35
|
-
}),
|
|
36
|
-
credentials: 'include',
|
|
37
|
-
headers: {
|
|
38
|
-
'Content-Type': 'application/json'
|
|
39
|
-
},
|
|
40
|
-
method: 'POST'
|
|
41
|
-
});
|
|
42
|
-
const { result: generatedTitle } = await genTitleResponse.json();
|
|
43
|
-
setValue(generatedTitle || '');
|
|
44
|
-
}, [
|
|
45
|
-
fields,
|
|
46
|
-
setValue,
|
|
47
|
-
hasGenerateTitleFn,
|
|
48
|
-
locale,
|
|
49
|
-
docInfo
|
|
50
|
-
]);
|
|
51
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
52
|
-
style: {
|
|
53
|
-
marginBottom: '20px'
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
56
|
-
style: {
|
|
57
|
-
marginBottom: '5px',
|
|
58
|
-
position: 'relative'
|
|
59
|
-
}
|
|
60
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
61
|
-
className: "plugin-seo__field"
|
|
62
|
-
}, /*#__PURE__*/ React.createElement(FieldLabel, {
|
|
63
|
-
CustomLabel: CustomLabel,
|
|
64
|
-
label: label,
|
|
65
|
-
...labelProps || {}
|
|
66
|
-
}), hasGenerateTitleFn && /*#__PURE__*/ React.createElement(React.Fragment, null, " — ", /*#__PURE__*/ React.createElement("button", {
|
|
67
|
-
onClick: regenerateTitle,
|
|
68
|
-
style: {
|
|
69
|
-
background: 'none',
|
|
70
|
-
backgroundColor: 'transparent',
|
|
71
|
-
border: 'none',
|
|
72
|
-
color: 'currentcolor',
|
|
73
|
-
cursor: 'pointer',
|
|
74
|
-
padding: 0,
|
|
75
|
-
textDecoration: 'underline'
|
|
76
|
-
},
|
|
77
|
-
type: "button"
|
|
78
|
-
}, t('plugin-seo:autoGenerate')))), /*#__PURE__*/ React.createElement("div", {
|
|
79
|
-
style: {
|
|
80
|
-
color: '#9A9A9A'
|
|
81
|
-
}
|
|
82
|
-
}, t('plugin-seo:lengthTipTitle', {
|
|
83
|
-
maxLength,
|
|
84
|
-
minLength
|
|
85
|
-
}), /*#__PURE__*/ React.createElement("a", {
|
|
86
|
-
href: "https://developers.google.com/search/docs/advanced/appearance/title-link#page-titles",
|
|
87
|
-
rel: "noopener noreferrer",
|
|
88
|
-
target: "_blank"
|
|
89
|
-
}, t('plugin-seo:bestPractices')), ".")), /*#__PURE__*/ React.createElement("div", {
|
|
90
|
-
style: {
|
|
91
|
-
marginBottom: '10px',
|
|
92
|
-
position: 'relative'
|
|
93
|
-
}
|
|
94
|
-
}, /*#__PURE__*/ React.createElement(TextInput, {
|
|
95
|
-
CustomError: errorMessage,
|
|
96
|
-
onChange: setValue,
|
|
97
|
-
path: pathFromContext,
|
|
98
|
-
required: required,
|
|
99
|
-
showError: showError,
|
|
100
|
-
style: {
|
|
101
|
-
marginBottom: 0
|
|
102
|
-
},
|
|
103
|
-
value: value
|
|
104
|
-
})), /*#__PURE__*/ React.createElement("div", {
|
|
105
|
-
style: {
|
|
106
|
-
alignItems: 'center',
|
|
107
|
-
display: 'flex',
|
|
108
|
-
width: '100%'
|
|
109
|
-
}
|
|
110
|
-
}, /*#__PURE__*/ React.createElement(LengthIndicator, {
|
|
111
|
-
maxLength: maxLength,
|
|
112
|
-
minLength: minLength,
|
|
113
|
-
text: value
|
|
114
|
-
})));
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
//# sourceMappingURL=MetaTitle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fields/MetaTitle.tsx"],"sourcesContent":["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { Options } from '@payloadcms/ui/forms/useField'\nimport type { FieldType } from '@payloadcms/ui/forms/useField'\n\nimport { TextInput } from '@payloadcms/ui/fields/Text'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useAllFormFields } from '@payloadcms/ui/forms/Form'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useLocale } from '@payloadcms/ui/providers/Locale'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport React, { useCallback } from 'react'\n\nimport type { GenerateTitle } from '../types.js'\n\nimport { defaults } from '../defaults.js'\nimport { LengthIndicator } from '../ui/LengthIndicator.js'\nimport './index.scss'\n\nconst { maxLength, minLength } = defaults.title\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\ntype MetaTitleProps = FormFieldBase & {\n hasGenerateTitleFn: boolean\n}\n\nexport const MetaTitle: React.FC<MetaTitleProps> = (props) => {\n const { CustomLabel, hasGenerateTitleFn, label, labelProps, path, required } = props || {}\n const { path: pathFromContext } = useFieldProps()\n\n const { t } = useTranslation()\n\n const field: FieldType<string> = useField({\n path,\n } as Options)\n\n const locale = useLocale()\n const [fields] = useAllFormFields()\n const docInfo = useDocumentInfo()\n\n const { errorMessage, setValue, showError, value } = field\n\n const regenerateTitle = useCallback(async () => {\n if (!hasGenerateTitleFn) return\n\n const genTitleResponse = await fetch('/api/plugin-seo/generate-title', {\n body: JSON.stringify({\n ...docInfo,\n doc: { ...fields },\n locale: typeof locale === 'object' ? locale?.code : locale,\n } satisfies Parameters<GenerateTitle>[0]),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n })\n\n const { result: generatedTitle } = await genTitleResponse.json()\n\n setValue(generatedTitle || '')\n }, [fields, setValue, hasGenerateTitleFn, locale, docInfo])\n\n return (\n <div\n style={{\n marginBottom: '20px',\n }}\n >\n <div\n style={{\n marginBottom: '5px',\n position: 'relative',\n }}\n >\n <div className=\"plugin-seo__field\">\n <FieldLabel CustomLabel={CustomLabel} label={label} {...(labelProps || {})} />\n {hasGenerateTitleFn && (\n <React.Fragment>\n — \n <button\n onClick={regenerateTitle}\n style={{\n background: 'none',\n backgroundColor: 'transparent',\n border: 'none',\n color: 'currentcolor',\n cursor: 'pointer',\n padding: 0,\n textDecoration: 'underline',\n }}\n type=\"button\"\n >\n {t('plugin-seo:autoGenerate')}\n </button>\n </React.Fragment>\n )}\n </div>\n <div\n style={{\n color: '#9A9A9A',\n }}\n >\n {t('plugin-seo:lengthTipTitle', { maxLength, minLength })}\n <a\n href=\"https://developers.google.com/search/docs/advanced/appearance/title-link#page-titles\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {t('plugin-seo:bestPractices')}\n </a>\n .\n </div>\n </div>\n <div\n style={{\n marginBottom: '10px',\n position: 'relative',\n }}\n >\n <TextInput\n CustomError={errorMessage}\n onChange={setValue}\n path={pathFromContext}\n required={required}\n showError={showError}\n style={{\n marginBottom: 0,\n }}\n value={value}\n />\n </div>\n <div\n style={{\n alignItems: 'center',\n display: 'flex',\n width: '100%',\n }}\n >\n <LengthIndicator maxLength={maxLength} minLength={minLength} text={value} />\n </div>\n </div>\n )\n}\n"],"names":["TextInput","FieldLabel","useFieldProps","useAllFormFields","useField","useDocumentInfo","useLocale","useTranslation","React","useCallback","defaults","LengthIndicator","maxLength","minLength","title","MetaTitle","props","CustomLabel","hasGenerateTitleFn","label","labelProps","path","required","pathFromContext","t","field","locale","fields","docInfo","errorMessage","setValue","showError","value","regenerateTitle","genTitleResponse","fetch","body","JSON","stringify","doc","code","credentials","headers","method","result","generatedTitle","json","div","style","marginBottom","position","className","Fragment","button","onClick","background","backgroundColor","border","color","cursor","padding","textDecoration","type","a","href","rel","target","CustomError","onChange","alignItems","display","width","text"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAMA,SAASA,SAAS,QAAQ,6BAA4B;AACtD,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,S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;IAE1D,qBACE,oBAACmB;QACCC,OAAO;YACLC,cAAc;QAChB;qBAEA,oBAACF;QACCC,OAAO;YACLC,cAAc;YACdC,UAAU;QACZ;qBAEA,oBAACH;QAAII,WAAU;qBACb,oBAAClD;QAAWgB,aAAaA;QAAaE,OAAOA;QAAQ,GAAIC,cAAc,CAAC,CAAC;QACxEF,oCACC,oBAACV,MAAM4C,QAAQ,QAAC,uBAEd,oBAACC;QACCC,SAASrB;QACTe,OAAO;YACLO,YAAY;YACZC,iBAAiB;YACjBC,QAAQ;YACRC,OAAO;YACPC,QAAQ;YACRC,SAAS;YACTC,gBAAgB;QAClB;QACAC,MAAK;OAEJtC,EAAE,6CAKX,oBAACuB;QACCC,OAAO;YACLU,OAAO;QACT;OAEClC,EAAE,6BAA6B;QAAEZ;QAAWC;IAAU,kBACvD,oBAACkD;QACCC,MAAK;QACLC,KAAI;QACJC,QAAO;OAEN1C,EAAE,8BACD,qBAIR,oBAACuB;QACCC,OAAO;YACLC,cAAc;YACdC,UAAU;QACZ;qBAEA,oBAAClD;QACCmE,aAAatC;QACbuC,UAAUtC;QACVT,MAAME;QACND,UAAUA;QACVS,WAAWA;QACXiB,OAAO;YACLC,cAAc;QAChB;QACAjB,OAAOA;uBAGX,oBAACe;QACCC,OAAO;YACLqB,YAAY;YACZC,SAAS;YACTC,OAAO;QACT;qBAEA,oBAAC5D;QAAgBC,WAAWA;QAAWC,WAAWA;QAAW2D,MAAMxC;;AAI3E,EAAC"}
|
package/dist/ui/Overview.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Overview.d.ts","sourceRoot":"","sources":["../../src/ui/Overview.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAS/D,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAoD5B,CAAA"}
|
package/dist/ui/Overview.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/Overview.tsx"],"sourcesContent":["'use client'\n\nimport type { FormField } from 'payload/types'\n\nimport { useAllFormFields, useForm } from '@payloadcms/ui/forms/Form'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { defaults } from '../defaults.js'\n\nconst {\n description: { maxLength: maxDesc, minLength: minDesc },\n title: { maxLength: maxTitle, minLength: minTitle },\n} = defaults\n\nexport const Overview: React.FC = () => {\n const {\n // dispatchFields,\n getFields,\n } = useForm()\n\n const [\n {\n 'meta.description': { value: metaDesc } = {} as FormField,\n 'meta.image': { value: metaImage } = {} as FormField,\n 'meta.title': { value: metaTitle } = {} as FormField,\n },\n ] = useAllFormFields()\n const { t } = useTranslation()\n\n const [titleIsValid, setTitleIsValid] = useState<boolean | undefined>()\n const [descIsValid, setDescIsValid] = useState<boolean | undefined>()\n const [imageIsValid, setImageIsValid] = useState<boolean | undefined>()\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const resetAll = useCallback(() => {\n const fields = getFields()\n const fieldsWithoutMeta = fields\n fieldsWithoutMeta['meta.title'].value = ''\n fieldsWithoutMeta['meta.description'].value = ''\n fieldsWithoutMeta['meta.image'].value = ''\n // dispatchFields(fieldsWithoutMeta);\n }, [getFields])\n\n useEffect(() => {\n if (typeof metaTitle === 'string')\n setTitleIsValid(metaTitle.length >= minTitle && metaTitle.length <= maxTitle)\n if (typeof metaDesc === 'string')\n setDescIsValid(metaDesc.length >= minDesc && metaDesc.length <= maxDesc)\n setImageIsValid(Boolean(metaImage))\n }, [metaTitle, metaDesc, metaImage])\n\n const testResults = [titleIsValid, descIsValid, imageIsValid]\n\n const numberOfPasses = testResults.filter(Boolean).length\n\n return (\n <div\n style={{\n marginBottom: '20px',\n }}\n >\n <div>\n {t('plugin-seo:checksPassing', { current: numberOfPasses, max: testResults.length })}\n </div>\n </div>\n )\n}\n"],"names":["useAllFormFields","useForm","useTranslation","React","useCallback","useEffect","useState","defaults","description","maxLength","maxDesc","minLength","minDesc","title","maxTitle","minTitle","Overview","getFields","value","metaDesc","metaImage","metaTitle","t","titleIsValid","setTitleIsValid","descIsValid","setDescIsValid","imageIsValid","setImageIsValid","resetAll","fields","fieldsWithoutMeta","length","Boolean","testResults","numberOfPasses","filter","div","style","marginBottom","current","max"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,gBAAgB,EAAEC,OAAO,QAAQ,4BAA2B;AACrE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,QAAQ,QAAQ,iBAAgB;AAEzC,MAAM,EACJC,aAAa,EAAEC,WAAWC,OAAO,EAAEC,WAAWC,OAAO,EAAE,EACvDC,OAAO,EAAEJ,WAAWK,QAAQ,EAAEH,WAAWI,QAAQ,EAAE,EACpD,GAAGR;AAEJ,OAAO,MAAMS,WAAqB;IAChC,MAAM,EACJ,mBAAmB;IACnBC,SAAS,EACV,GAAGhB;IAEJ,MAAM,CACJ,EACE,oBAAoB,EAAEiB,OAAOC,QAAQ,EAAE,GAAG,CAAC,CAAc,EACzD,cAAc,EAAED,OAAOE,SAAS,EAAE,GAAG,CAAC,CAAc,EACpD,cAAc,EAAEF,OAAOG,SAAS,EAAE,GAAG,CAAC,CAAc,EACrD,CACF,GAAGrB;IACJ,MAAM,EAAEsB,CAAC,EAAE,GAAGpB;IAEd,MAAM,CAACqB,cAAcC,gBAAgB,GAAGlB;IACxC,MAAM,CAACmB,aAAaC,eAAe,GAAGpB;IACtC,MAAM,CAACqB,cAAcC,gBAAgB,GAAGtB;IAExC,6DAA6D;IAC7D,MAAMuB,WAAWzB,YAAY;QAC3B,MAAM0B,SAASb;QACf,MAAMc,oBAAoBD;QAC1BC,iBAAiB,CAAC,aAAa,CAACb,KAAK,GAAG;QACxCa,iBAAiB,CAAC,mBAAmB,CAACb,KAAK,GAAG;QAC9Ca,iBAAiB,CAAC,aAAa,CAACb,KAAK,GAAG;IACxC,qCAAqC;IACvC,GAAG;QAACD;KAAU;IAEdZ,UAAU;QACR,IAAI,OAAOgB,cAAc,UACvBG,gBAAgBH,UAAUW,MAAM,IAAIjB,YAAYM,UAAUW,MAAM,IAAIlB;QACtE,IAAI,OAAOK,aAAa,UACtBO,eAAeP,SAASa,MAAM,IAAIpB,WAAWO,SAASa,MAAM,IAAItB;QAClEkB,gBAAgBK,QAAQb;IAC1B,GAAG;QAACC;QAAWF;QAAUC;KAAU;IAEnC,MAAMc,cAAc;QAACX;QAAcE;QAAaE;KAAa;IAE7D,MAAMQ,iBAAiBD,YAAYE,MAAM,CAACH,SAASD,MAAM;IAEzD,qBACE,oBAACK;QACCC,OAAO;YACLC,cAAc;QAChB;qBAEA,oBAACF,aACEf,EAAE,4BAA4B;QAAEkB,SAASL;QAAgBM,KAAKP,YAAYF,MAAM;IAAC;AAI1F,EAAC"}
|
package/dist/ui/Preview.d.ts
DELETED
package/dist/ui/Preview.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../src/ui/Preview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,eAAe,CAAA;AAMvD,OAAO,KAA8B,MAAM,OAAO,CAAA;AAKlD,KAAK,YAAY,GAAG,OAAO,GAAG;IAC5B,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA+F1C,CAAA"}
|
package/dist/ui/Preview.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useAllFormFields } from '@payloadcms/ui/forms/Form';
|
|
3
|
-
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';
|
|
4
|
-
import { useLocale } from '@payloadcms/ui/providers/Locale';
|
|
5
|
-
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
6
|
-
import React, { useEffect, useState } from 'react';
|
|
7
|
-
export const Preview = ({ hasGenerateURLFn })=>{
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
const locale = useLocale();
|
|
10
|
-
const [fields] = useAllFormFields();
|
|
11
|
-
const docInfo = useDocumentInfo();
|
|
12
|
-
const { 'meta.description': { value: metaDescription } = {}, 'meta.title': { value: metaTitle } = {} } = fields;
|
|
13
|
-
const [href, setHref] = useState();
|
|
14
|
-
useEffect(()=>{
|
|
15
|
-
const getHref = async ()=>{
|
|
16
|
-
const genURLResponse = await fetch('/api/plugin-seo/generate-url', {
|
|
17
|
-
body: JSON.stringify({
|
|
18
|
-
...docInfo,
|
|
19
|
-
doc: {
|
|
20
|
-
...fields
|
|
21
|
-
},
|
|
22
|
-
locale: typeof locale === 'object' ? locale?.code : locale
|
|
23
|
-
}),
|
|
24
|
-
credentials: 'include',
|
|
25
|
-
headers: {
|
|
26
|
-
'Content-Type': 'application/json'
|
|
27
|
-
},
|
|
28
|
-
method: 'POST'
|
|
29
|
-
});
|
|
30
|
-
const { result: newHref } = await genURLResponse.json();
|
|
31
|
-
setHref(newHref);
|
|
32
|
-
};
|
|
33
|
-
if (hasGenerateURLFn && !href) {
|
|
34
|
-
void getHref();
|
|
35
|
-
}
|
|
36
|
-
}, [
|
|
37
|
-
fields,
|
|
38
|
-
href,
|
|
39
|
-
locale,
|
|
40
|
-
docInfo,
|
|
41
|
-
hasGenerateURLFn
|
|
42
|
-
]);
|
|
43
|
-
return /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("div", null, t('plugin-seo:preview')), /*#__PURE__*/ React.createElement("div", {
|
|
44
|
-
style: {
|
|
45
|
-
color: '#9A9A9A',
|
|
46
|
-
marginBottom: '5px'
|
|
47
|
-
}
|
|
48
|
-
}, t('plugin-seo:previewDescription')), /*#__PURE__*/ React.createElement("div", {
|
|
49
|
-
style: {
|
|
50
|
-
background: 'var(--theme-elevation-50)',
|
|
51
|
-
borderRadius: '5px',
|
|
52
|
-
boxShadow: '0px 0px 10px rgba(0, 0, 0, 0.1)',
|
|
53
|
-
maxWidth: '600px',
|
|
54
|
-
padding: '20px',
|
|
55
|
-
pointerEvents: 'none',
|
|
56
|
-
width: '100%'
|
|
57
|
-
}
|
|
58
|
-
}, /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("a", {
|
|
59
|
-
href: href,
|
|
60
|
-
style: {
|
|
61
|
-
textDecoration: 'none'
|
|
62
|
-
}
|
|
63
|
-
}, href || 'https://...')), /*#__PURE__*/ React.createElement("h4", {
|
|
64
|
-
style: {
|
|
65
|
-
margin: 0
|
|
66
|
-
}
|
|
67
|
-
}, /*#__PURE__*/ React.createElement("a", {
|
|
68
|
-
href: "/",
|
|
69
|
-
style: {
|
|
70
|
-
textDecoration: 'none'
|
|
71
|
-
}
|
|
72
|
-
}, metaTitle)), /*#__PURE__*/ React.createElement("p", {
|
|
73
|
-
style: {
|
|
74
|
-
margin: 0
|
|
75
|
-
}
|
|
76
|
-
}, metaDescription)));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=Preview.js.map
|
package/dist/ui/Preview.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/Preview.tsx"],"sourcesContent":["'use client'\n\nimport type { FormField, UIField } from 'payload/types'\n\nimport { useAllFormFields } from '@payloadcms/ui/forms/Form'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useLocale } from '@payloadcms/ui/providers/Locale'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport React, { useEffect, useState } from 'react'\n\nimport type { GenerateURL } from '../types.js'\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\ntype PreviewProps = UIField & {\n hasGenerateURLFn: boolean\n}\n\nexport const Preview: React.FC<PreviewProps> = ({ hasGenerateURLFn }) => {\n const { t } = useTranslation()\n\n const locale = useLocale()\n const [fields] = useAllFormFields()\n const docInfo = useDocumentInfo()\n\n const {\n 'meta.description': { value: metaDescription } = {} as FormField,\n 'meta.title': { value: metaTitle } = {} as FormField,\n } = fields\n\n const [href, setHref] = useState<string>()\n\n useEffect(() => {\n const getHref = async () => {\n const genURLResponse = await fetch('/api/plugin-seo/generate-url', {\n body: JSON.stringify({\n ...docInfo,\n doc: { ...fields },\n locale: typeof locale === 'object' ? locale?.code : locale,\n } satisfies Parameters<GenerateURL>[0]),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n })\n\n const { result: newHref } = await genURLResponse.json()\n\n setHref(newHref)\n }\n\n if (hasGenerateURLFn && !href) {\n void getHref()\n }\n }, [fields, href, locale, docInfo, hasGenerateURLFn])\n\n return (\n <div>\n <div>{t('plugin-seo:preview')}</div>\n <div\n style={{\n color: '#9A9A9A',\n marginBottom: '5px',\n }}\n >\n {t('plugin-seo:previewDescription')}\n </div>\n <div\n style={{\n background: 'var(--theme-elevation-50)',\n borderRadius: '5px',\n boxShadow: '0px 0px 10px rgba(0, 0, 0, 0.1)',\n maxWidth: '600px',\n padding: '20px',\n pointerEvents: 'none',\n width: '100%',\n }}\n >\n <div>\n <a\n href={href}\n style={{\n textDecoration: 'none',\n }}\n >\n {href || 'https://...'}\n </a>\n </div>\n <h4\n style={{\n margin: 0,\n }}\n >\n <a\n href=\"/\"\n style={{\n textDecoration: 'none',\n }}\n >\n {metaTitle as string}\n </a>\n </h4>\n <p\n style={{\n margin: 0,\n }}\n >\n {metaDescription as string}\n </p>\n </div>\n </div>\n )\n}\n"],"names":["useAllFormFields","useDocumentInfo","useLocale","useTranslation","React","useEffect","useState","Preview","hasGenerateURLFn","t","locale","fields","docInfo","value","metaDescription","metaTitle","href","setHref","getHref","genURLResponse","fetch","body","JSON","stringify","doc","code","credentials","headers","method","result","newHref","json","div","style","color","marginBottom","background","borderRadius","boxShadow","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