@payloadcms/plugin-seo 3.0.0-canary.92e4997 → 3.0.0-canary.93a7bbd
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/client.d.ts +6 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +7 -0
- package/dist/exports/client.js.map +1 -0
- 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 +8 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.d.ts.map +1 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.js +143 -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 +20 -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 +146 -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 +23 -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 +145 -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 +20 -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 +22 -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 +22 -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 +33 -99
- 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 +35 -19
- package/dist/fields/MetaDescription.d.ts +0 -9
- package/dist/fields/MetaDescription.d.ts.map +0 -1
- package/dist/fields/MetaDescription.js +0 -115
- 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 -119
- 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 -116
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/LengthIndicator.tsx"],"sourcesContent":["'use client'\n\nimport { useTranslation } from '@payloadcms/ui
|
|
1
|
+
{"version":3,"sources":["../../src/ui/LengthIndicator.tsx"],"sourcesContent":["'use client'\n\nimport { useTranslation } from '@payloadcms/ui'\nimport React, { Fragment, useEffect, useState } from 'react'\n\nimport type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'\n\nimport { Pill } from './Pill.js'\n\nexport const LengthIndicator: React.FC<{\n maxLength?: number\n minLength?: number\n text?: string\n}> = (props) => {\n const { maxLength = 0, minLength = 0, text } = props\n\n const [labelStyle, setLabelStyle] = useState({\n backgroundColor: '',\n color: '',\n })\n\n const [label, setLabel] = useState('')\n const [barWidth, setBarWidth] = useState<number>(0)\n const { t } = useTranslation<PluginSEOTranslations, PluginSEOTranslationKeys>()\n\n useEffect(() => {\n const textLength = text?.length || 0\n\n if (textLength === 0) {\n setLabel('Missing')\n setLabelStyle({\n backgroundColor: 'red',\n color: 'white',\n })\n setBarWidth(0)\n } else {\n const progress = (textLength - minLength) / (maxLength - minLength)\n\n if (progress < 0) {\n const ratioUntilMin = textLength / minLength\n\n if (ratioUntilMin > 0.9) {\n setLabel(t('plugin-seo:almostThere'))\n setLabelStyle({\n backgroundColor: 'orange',\n color: 'white',\n })\n } else {\n setLabel(t('plugin-seo:tooShort'))\n setLabelStyle({\n backgroundColor: 'orangered',\n color: 'white',\n })\n }\n\n setBarWidth(ratioUntilMin)\n }\n\n if (progress >= 0 && progress <= 1) {\n setLabel(t('plugin-seo:good'))\n setLabelStyle({\n backgroundColor: 'green',\n color: 'white',\n })\n setBarWidth(progress)\n }\n\n if (progress > 1) {\n setLabel(t('plugin-seo:tooLong'))\n setLabelStyle({\n backgroundColor: 'red',\n color: 'white',\n })\n setBarWidth(1)\n }\n }\n }, [minLength, maxLength, text, t])\n\n const textLength = text?.length || 0\n\n const charsUntilMax = maxLength - textLength\n const charsUntilMin = minLength - textLength\n\n return (\n <div\n style={{\n alignItems: 'center',\n display: 'flex',\n width: '100%',\n }}\n >\n <Pill backgroundColor={labelStyle.backgroundColor} color={labelStyle.color} label={label} />\n <div\n style={{\n flexShrink: 0,\n lineHeight: 1,\n marginRight: '10px',\n whiteSpace: 'nowrap',\n }}\n >\n <small>\n {t('plugin-seo:characterCount', { current: text?.length || 0, maxLength, minLength })}\n {(textLength === 0 || charsUntilMin > 0) && (\n <Fragment>{t('plugin-seo:charactersToGo', { characters: charsUntilMin })}</Fragment>\n )}\n {charsUntilMin <= 0 && charsUntilMax >= 0 && (\n <Fragment>{t('plugin-seo:charactersLeftOver', { characters: charsUntilMax })}</Fragment>\n )}\n {charsUntilMax < 0 && (\n <Fragment>\n {t('plugin-seo:charactersTooMany', { characters: charsUntilMax * -1 })}\n </Fragment>\n )}\n </small>\n </div>\n <div\n style={{\n backgroundColor: '#F3F3F3',\n height: '2px',\n position: 'relative',\n width: '100%',\n }}\n >\n <div\n style={{\n backgroundColor: labelStyle.backgroundColor,\n height: '100%',\n left: 0,\n position: 'absolute',\n top: 0,\n width: `${barWidth * 100}%`,\n }}\n />\n </div>\n </div>\n )\n}\n"],"names":["useTranslation","React","Fragment","useEffect","useState","Pill","LengthIndicator","props","maxLength","minLength","text","labelStyle","setLabelStyle","backgroundColor","color","label","setLabel","barWidth","setBarWidth","t","textLength","length","progress","ratioUntilMin","charsUntilMax","charsUntilMin","div","style","alignItems","display","width","flexShrink","lineHeight","marginRight","whiteSpace","small","current","characters","height","position","left","top"],"mappings":"AAAA;;AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAI5D,SAASC,IAAI,QAAQ,YAAW;AAEhC,OAAO,MAAMC,kBAIR,CAACC;IACJ,MAAM,EAAEC,YAAY,CAAC,EAAEC,YAAY,CAAC,EAAEC,IAAI,EAAE,GAAGH;IAE/C,MAAM,CAACI,YAAYC,cAAc,GAAGR,SAAS;QAC3CS,iBAAiB;QACjBC,OAAO;IACT;IAEA,MAAM,CAACC,OAAOC,SAAS,GAAGZ,SAAS;IACnC,MAAM,CAACa,UAAUC,YAAY,GAAGd,SAAiB;IACjD,MAAM,EAAEe,CAAC,EAAE,GAAGnB;IAEdG,UAAU;QACR,MAAMiB,aAAaV,MAAMW,UAAU;QAEnC,IAAID,eAAe,GAAG;YACpBJ,SAAS;YACTJ,cAAc;gBACZC,iBAAiB;gBACjBC,OAAO;YACT;YACAI,YAAY;QACd,OAAO;YACL,MAAMI,WAAW,AAACF,CAAAA,aAAaX,SAAQ,IAAMD,CAAAA,YAAYC,SAAQ;YAEjE,IAAIa,WAAW,GAAG;gBAChB,MAAMC,gBAAgBH,aAAaX;gBAEnC,IAAIc,gBAAgB,KAAK;oBACvBP,SAASG,EAAE;oBACXP,cAAc;wBACZC,iBAAiB;wBACjBC,OAAO;oBACT;gBACF,OAAO;oBACLE,SAASG,EAAE;oBACXP,cAAc;wBACZC,iBAAiB;wBACjBC,OAAO;oBACT;gBACF;gBAEAI,YAAYK;YACd;YAEA,IAAID,YAAY,KAAKA,YAAY,GAAG;gBAClCN,SAASG,EAAE;gBACXP,cAAc;oBACZC,iBAAiB;oBACjBC,OAAO;gBACT;gBACAI,YAAYI;YACd;YAEA,IAAIA,WAAW,GAAG;gBA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
|
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
export const Pill = (props)=>{
|
|
4
5
|
const { backgroundColor, color, label } = props;
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
6
7
|
style: {
|
|
7
8
|
backgroundColor,
|
|
8
9
|
borderRadius: '2px',
|
|
@@ -12,8 +13,11 @@ export const Pill = (props)=>{
|
|
|
12
13
|
marginRight: '10px',
|
|
13
14
|
padding: '4px 6px',
|
|
14
15
|
whiteSpace: 'nowrap'
|
|
15
|
-
}
|
|
16
|
-
|
|
16
|
+
},
|
|
17
|
+
children: /*#__PURE__*/ _jsx("small", {
|
|
18
|
+
children: label
|
|
19
|
+
})
|
|
20
|
+
});
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
//# sourceMappingURL=Pill.js.map
|
package/dist/ui/Pill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/Pill.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nexport const Pill: React.FC<{\n backgroundColor: string\n color: string\n label: string\n}> = (props) => {\n const { backgroundColor, color, label } = props\n\n return (\n <div\n style={{\n backgroundColor,\n borderRadius: '2px',\n color,\n flexShrink: 0,\n lineHeight: 1,\n marginRight: '10px',\n padding: '4px 6px',\n whiteSpace: 'nowrap',\n }}\n >\n <small>{label}</small>\n </div>\n )\n}\n"],"names":["React","Pill","props","backgroundColor","color","label","div","style","borderRadius","flexShrink","lineHeight","marginRight","padding","whiteSpace","small"],"
|
|
1
|
+
{"version":3,"sources":["../../src/ui/Pill.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nexport const Pill: React.FC<{\n backgroundColor: string\n color: string\n label: string\n}> = (props) => {\n const { backgroundColor, color, label } = props\n\n return (\n <div\n style={{\n backgroundColor,\n borderRadius: '2px',\n color,\n flexShrink: 0,\n lineHeight: 1,\n marginRight: '10px',\n padding: '4px 6px',\n whiteSpace: 'nowrap',\n }}\n >\n <small>{label}</small>\n </div>\n )\n}\n"],"names":["React","Pill","props","backgroundColor","color","label","div","style","borderRadius","flexShrink","lineHeight","marginRight","padding","whiteSpace","small"],"mappings":"AAAA;;AAEA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,OAIR,CAACC;IACJ,MAAM,EAAEC,eAAe,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH;IAE1C,qBACE,KAACI;QACCC,OAAO;YACLJ;YACAK,cAAc;YACdJ;YACAK,YAAY;YACZC,YAAY;YACZC,aAAa;YACbC,SAAS;YACTC,YAAY;QACd;kBAEA,cAAA,KAACC;sBAAOT;;;AAGd,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-seo",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.93a7bbd",
|
|
4
4
|
"description": "SEO plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -22,13 +22,23 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"import": "./dist/index.js",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"import": "./dist/exports
|
|
30
|
-
"
|
|
31
|
-
"
|
|
28
|
+
"./types": {
|
|
29
|
+
"import": "./dist/exports/types.js",
|
|
30
|
+
"types": "./dist/exports/types.d.ts",
|
|
31
|
+
"default": "./dist/exports/types.js"
|
|
32
|
+
},
|
|
33
|
+
"./fields": {
|
|
34
|
+
"import": "./dist/exports/fields.js",
|
|
35
|
+
"types": "./dist/exports/fields.d.ts",
|
|
36
|
+
"default": "./dist/exports/fields.js"
|
|
37
|
+
},
|
|
38
|
+
"./client": {
|
|
39
|
+
"import": "./dist/exports/client.js",
|
|
40
|
+
"types": "./dist/exports/client.d.ts",
|
|
41
|
+
"default": "./dist/exports/client.js"
|
|
32
42
|
}
|
|
33
43
|
},
|
|
34
44
|
"main": "./dist/index.js",
|
|
@@ -37,26 +47,32 @@
|
|
|
37
47
|
"dist"
|
|
38
48
|
],
|
|
39
49
|
"devDependencies": {
|
|
40
|
-
"@types/react": "
|
|
41
|
-
"@
|
|
42
|
-
"@payloadcms/
|
|
43
|
-
"@payloadcms/
|
|
44
|
-
"@payloadcms/
|
|
45
|
-
"
|
|
50
|
+
"@types/react": "npm:types-react@19.0.0-rc.0",
|
|
51
|
+
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
|
|
52
|
+
"@payloadcms/eslint-config": "3.0.0-beta.59",
|
|
53
|
+
"@payloadcms/translations": "3.0.0-canary.93a7bbd",
|
|
54
|
+
"@payloadcms/next": "3.0.0-canary.93a7bbd",
|
|
55
|
+
"@payloadcms/ui": "3.0.0-canary.93a7bbd",
|
|
56
|
+
"payload": "3.0.0-canary.93a7bbd"
|
|
46
57
|
},
|
|
47
58
|
"peerDependencies": {
|
|
48
|
-
"react": "^
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
59
|
+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
|
|
60
|
+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
|
|
61
|
+
"@payloadcms/translations": "3.0.0-canary.93a7bbd",
|
|
62
|
+
"payload": "3.0.0-canary.93a7bbd",
|
|
63
|
+
"@payloadcms/ui": "3.0.0-canary.93a7bbd"
|
|
52
64
|
},
|
|
53
65
|
"publishConfig": {
|
|
54
66
|
"registry": "https://registry.npmjs.org/"
|
|
55
67
|
},
|
|
56
68
|
"homepage:": "https://payloadcms.com",
|
|
69
|
+
"overrides": {
|
|
70
|
+
"@types/react": "npm:types-react@19.0.0-rc.0",
|
|
71
|
+
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0"
|
|
72
|
+
},
|
|
57
73
|
"scripts": {
|
|
58
|
-
"build": "pnpm copyfiles && pnpm build:
|
|
59
|
-
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
|
74
|
+
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
|
|
75
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
60
76
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
61
77
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
62
78
|
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type MetaDescriptionProps = FormFieldBase & {
|
|
4
|
-
hasGenerateDescriptionFn: boolean;
|
|
5
|
-
path: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const MetaDescription: React.FC<MetaDescriptionProps>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=MetaDescription.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetaDescription.d.ts","sourceRoot":"","sources":["../../src/fields/MetaDescription.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAWjE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAU1C,KAAK,oBAAoB,GAAG,aAAa,GAAG;IAC1C,wBAAwB,EAAE,OAAO,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoH1D,CAAA"}
|
|
@@ -1,115 +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, 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
|
-
...labelProps || {}
|
|
64
|
-
}), hasGenerateDescriptionFn && /*#__PURE__*/ React.createElement(React.Fragment, null, " — ", /*#__PURE__*/ React.createElement("button", {
|
|
65
|
-
onClick: regenerateDescription,
|
|
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')))), /*#__PURE__*/ React.createElement("div", {
|
|
77
|
-
style: {
|
|
78
|
-
color: '#9A9A9A'
|
|
79
|
-
}
|
|
80
|
-
}, t('plugin-seo:lengthTipDescription', {
|
|
81
|
-
maxLength,
|
|
82
|
-
minLength
|
|
83
|
-
}), /*#__PURE__*/ React.createElement("a", {
|
|
84
|
-
href: "https://developers.google.com/search/docs/advanced/appearance/snippet#meta-descriptions",
|
|
85
|
-
rel: "noopener noreferrer",
|
|
86
|
-
target: "_blank"
|
|
87
|
-
}, t('plugin-seo:bestPractices')))), /*#__PURE__*/ React.createElement("div", {
|
|
88
|
-
style: {
|
|
89
|
-
marginBottom: '10px',
|
|
90
|
-
position: 'relative'
|
|
91
|
-
}
|
|
92
|
-
}, /*#__PURE__*/ React.createElement(TextareaInput, {
|
|
93
|
-
CustomError: errorMessage,
|
|
94
|
-
onChange: setValue,
|
|
95
|
-
path: pathFromContext,
|
|
96
|
-
required: required,
|
|
97
|
-
showError: showError,
|
|
98
|
-
style: {
|
|
99
|
-
marginBottom: 0
|
|
100
|
-
},
|
|
101
|
-
value: value
|
|
102
|
-
})), /*#__PURE__*/ React.createElement("div", {
|
|
103
|
-
style: {
|
|
104
|
-
alignItems: 'center',
|
|
105
|
-
display: 'flex',
|
|
106
|
-
width: '100%'
|
|
107
|
-
}
|
|
108
|
-
}, /*#__PURE__*/ React.createElement(LengthIndicator, {
|
|
109
|
-
maxLength: maxLength,
|
|
110
|
-
minLength: minLength,
|
|
111
|
-
text: value
|
|
112
|
-
})));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
//# 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, 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} {...(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","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAKA,SAASA,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAOC,SAASC,WAAW,QAAQ,QA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0CACC,oBAACV,MAAM2C,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;QAAEX;QAAWC;IAAU,kBAC7D,oBAACiD;QACCC,MAAK;QACLC,KAAI;QACJC,QAAO;OAEN1C,EAAE,8CAIT,oBAACuB;QACCC,OAAO;YACLC,cAAc;YACdC,UAAU;QACZ;qBAEA,oBAACjD;QACCkE,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,oBAAC3D;QAAgBC,WAAWA;QAAWC,WAAWA;QAAW0D,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,119 +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, 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
|
-
...labelProps || {}
|
|
63
|
-
}), hasGenerateImageFn && /*#__PURE__*/ React.createElement(React.Fragment, null, " — ", /*#__PURE__*/ React.createElement("button", {
|
|
64
|
-
onClick: regenerateImage,
|
|
65
|
-
style: {
|
|
66
|
-
background: 'none',
|
|
67
|
-
backgroundColor: 'transparent',
|
|
68
|
-
border: 'none',
|
|
69
|
-
color: 'currentcolor',
|
|
70
|
-
cursor: 'pointer',
|
|
71
|
-
padding: 0,
|
|
72
|
-
textDecoration: 'underline'
|
|
73
|
-
},
|
|
74
|
-
type: "button"
|
|
75
|
-
}, t('plugin-seo:autoGenerate')))), hasGenerateImageFn && /*#__PURE__*/ React.createElement("div", {
|
|
76
|
-
style: {
|
|
77
|
-
color: '#9A9A9A'
|
|
78
|
-
}
|
|
79
|
-
}, t('plugin-seo:imageAutoGenerationTip'))), /*#__PURE__*/ React.createElement("div", {
|
|
80
|
-
style: {
|
|
81
|
-
marginBottom: '10px',
|
|
82
|
-
position: 'relative'
|
|
83
|
-
}
|
|
84
|
-
}, /*#__PURE__*/ React.createElement(UploadInput, {
|
|
85
|
-
CustomError: errorMessage,
|
|
86
|
-
api: api,
|
|
87
|
-
collection: collection,
|
|
88
|
-
filterOptions: {},
|
|
89
|
-
label: undefined,
|
|
90
|
-
onChange: (incomingImage)=>{
|
|
91
|
-
if (incomingImage !== null) {
|
|
92
|
-
const { id: incomingID } = incomingImage;
|
|
93
|
-
setValue(incomingID);
|
|
94
|
-
} else {
|
|
95
|
-
setValue(null);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
relationTo: relationTo,
|
|
99
|
-
required: required,
|
|
100
|
-
serverURL: serverURL,
|
|
101
|
-
showError: showError,
|
|
102
|
-
style: {
|
|
103
|
-
marginBottom: 0
|
|
104
|
-
},
|
|
105
|
-
value: value
|
|
106
|
-
})), /*#__PURE__*/ React.createElement("div", {
|
|
107
|
-
style: {
|
|
108
|
-
alignItems: 'center',
|
|
109
|
-
display: 'flex',
|
|
110
|
-
width: '100%'
|
|
111
|
-
}
|
|
112
|
-
}, /*#__PURE__*/ React.createElement(Pill, {
|
|
113
|
-
backgroundColor: hasImage ? 'green' : 'red',
|
|
114
|
-
color: "white",
|
|
115
|
-
label: hasImage ? t('plugin-seo:good') : t('plugin-seo:noImage')
|
|
116
|
-
})));
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
//# 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, 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} {...(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","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","label","onChange","incomingImage","id","incomingID","alignItems","display","width"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M;QACNO,OAAO9B,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,116 +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, 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
|
-
...labelProps || {}
|
|
65
|
-
}), hasGenerateTitleFn && /*#__PURE__*/ React.createElement(React.Fragment, null, " — ", /*#__PURE__*/ React.createElement("button", {
|
|
66
|
-
onClick: regenerateTitle,
|
|
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:lengthTipTitle', {
|
|
82
|
-
maxLength,
|
|
83
|
-
minLength
|
|
84
|
-
}), /*#__PURE__*/ React.createElement("a", {
|
|
85
|
-
href: "https://developers.google.com/search/docs/advanced/appearance/title-link#page-titles",
|
|
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(TextInput, {
|
|
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=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, 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} {...(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","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,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,QAAQ,QAAQ,iBAAgB;AACzC,SAASC,eAAe,QAAQ,2BAA0B;AAC1D,OAAO,eAAc;AAErB,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGH,SAASI,KAAK;AAO/C,OAAO,MAAMC,YAAsC,CAACC;IAClD,MAAM,EAAEC,WAAW,EAAEC,kBAAkB,EAAEC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGL,SAAS,CAAC;IAClF,MAAM,EAAEI,MAAME,eAAe,EAAE,GAAGpB;IAElC,MAAM,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,QAAO;OAEN1C,EAAE,8BACD,qBAIR,oBAACuB;QACCC,OAAO;YACLC,cAAc;YACdC,UAAU;QACZ;qBAEA,oBAACjD;QACCkE,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,oBAAC3D;QAAgBC,WAAWA;QAAWC,WAAWA;QAAW0D,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"}
|