@payloadcms/plugin-seo 3.0.0-canary.92e4997 → 3.0.0-canary.f1db24e
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/fields/MetaDescription.d.ts.map +1 -1
- package/dist/fields/MetaDescription.js +89 -61
- package/dist/fields/MetaDescription.js.map +1 -1
- package/dist/fields/MetaImage.d.ts.map +1 -1
- package/dist/fields/MetaImage.js +90 -66
- package/dist/fields/MetaImage.js.map +1 -1
- package/dist/fields/MetaTitle.d.ts.map +1 -1
- package/dist/fields/MetaTitle.js +90 -61
- package/dist/fields/MetaTitle.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/translations/index.d.ts +3 -0
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js.map +1 -1
- package/dist/ui/LengthIndicator.d.ts.map +1 -1
- package/dist/ui/LengthIndicator.js +61 -40
- package/dist/ui/LengthIndicator.js.map +1 -1
- package/dist/ui/Overview.d.ts.map +1 -1
- package/dist/ui/Overview.js +10 -6
- package/dist/ui/Overview.js.map +1 -1
- package/dist/ui/Pill.js +7 -3
- package/dist/ui/Pill.js.map +1 -1
- package/dist/ui/Preview.js +55 -34
- package/dist/ui/Preview.js.map +1 -1
- package/package.json +16 -10
package/dist/ui/Preview.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useAllFormFields } from '@payloadcms/ui/forms/Form';
|
|
3
4
|
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';
|
|
4
5
|
import { useLocale } from '@payloadcms/ui/providers/Locale';
|
|
@@ -40,40 +41,60 @@ export const Preview = ({ hasGenerateURLFn })=>{
|
|
|
40
41
|
docInfo,
|
|
41
42
|
hasGenerateURLFn
|
|
42
43
|
]);
|
|
43
|
-
return /*#__PURE__*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
44
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ _jsx("div", {
|
|
47
|
+
children: t('plugin-seo:preview')
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ _jsx("div", {
|
|
50
|
+
style: {
|
|
51
|
+
color: '#9A9A9A',
|
|
52
|
+
marginBottom: '5px'
|
|
53
|
+
},
|
|
54
|
+
children: t('plugin-seo:previewDescription')
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
57
|
+
style: {
|
|
58
|
+
background: 'var(--theme-elevation-50)',
|
|
59
|
+
borderRadius: '5px',
|
|
60
|
+
boxShadow: '0px 0px 10px rgba(0, 0, 0, 0.1)',
|
|
61
|
+
maxWidth: '600px',
|
|
62
|
+
padding: '20px',
|
|
63
|
+
pointerEvents: 'none',
|
|
64
|
+
width: '100%'
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ _jsx("div", {
|
|
68
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
69
|
+
href: href,
|
|
70
|
+
style: {
|
|
71
|
+
textDecoration: 'none'
|
|
72
|
+
},
|
|
73
|
+
children: href || 'https://...'
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ _jsx("h4", {
|
|
77
|
+
style: {
|
|
78
|
+
margin: 0
|
|
79
|
+
},
|
|
80
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
81
|
+
href: "/",
|
|
82
|
+
style: {
|
|
83
|
+
textDecoration: 'none'
|
|
84
|
+
},
|
|
85
|
+
children: metaTitle
|
|
86
|
+
})
|
|
87
|
+
}),
|
|
88
|
+
/*#__PURE__*/ _jsx("p", {
|
|
89
|
+
style: {
|
|
90
|
+
margin: 0
|
|
91
|
+
},
|
|
92
|
+
children: metaDescription
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
});
|
|
77
98
|
};
|
|
78
99
|
|
|
79
100
|
//# sourceMappingURL=Preview.js.map
|
package/dist/ui/Preview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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\
|
|
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 { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'\nimport type { GenerateURL } from '../types.js'\n\ntype PreviewProps = UIField & {\n hasGenerateURLFn: boolean\n}\n\nexport const Preview: React.FC<PreviewProps> = ({ hasGenerateURLFn }) => {\n const { t } = useTranslation<PluginSEOTranslations, PluginSEOTranslationKeys>()\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","maxWidth","padding","pointerEvents","width","a","textDecoration","h4","margin","p"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAOC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AASlD,OAAO,MAAMC,UAAkC,CAAC,EAAEC,gBAAgB,EAAE;IAClE,MAAM,EAAEC,CAAC,EAAE,GAAGN;IAEd,MAAMO,SAASR;IACf,MAAM,CAACS,OAAO,GAAGX;IACjB,MAAMY,UAAUX;IAEhB,MAAM,EACJ,oBAAoB,EAAEY,OAAOC,eAAe,EAAE,GAAG,CAAC,CAAc,EAChE,cAAc,EAAED,OAAOE,SAAS,EAAE,GAAG,CAAC,CAAc,EACrD,GAAGJ;IAEJ,MAAM,CAACK,MAAMC,QAAQ,GAAGX;IAExBD,UAAU;QACR,MAAMa,UAAU;YACd,MAAMC,iBAAiB,MAAMC,MAAM,gCAAgC;gBACjEC,MAAMC,KAAKC,SAAS,CAAC;oBACnB,GAAGX,OAAO;oBACVY,KAAK;wBAAE,GAAGb,MAAM;oBAAC;oBACjBD,QAAQ,OAAOA,WAAW,WAAWA,QAAQe,OAAOf;gBACtD;gBACAgB,aAAa;gBACbC,SAAS;oBACP,gBAAgB;gBAClB;gBACAC,QAAQ;YACV;YAEA,MAAM,EAAEC,QAAQC,OAAO,EAAE,GAAG,MAAMX,eAAeY,IAAI;YAErDd,QAAQa;QACV;QAEA,IAAItB,oBAAoB,CAACQ,MAAM;YAC7B,KAAKE;QACP;IACF,GAAG;QAACP;QAAQK;QAAMN;QAAQE;QAASJ;KAAiB;IAEpD,qBACE,MAACwB;;0BACC,KAACA;0BAAKvB,EAAE;;0BACR,KAACuB;gBACCC,OAAO;oBACLC,OAAO;oBACPC,cAAc;gBAChB;0BAEC1B,EAAE;;0BAEL,MAACuB;gBACCC,OAAO;oBACLG,YAAY;oBACZC,cAAc;oBACdC,WAAW;oBACXC,UAAU;oBACVC,SAAS;oBACTC,eAAe;oBACfC,OAAO;gBACT;;kCAEA,KAACV;kCACC,cAAA,KAACW;4BACC3B,MAAMA;4BACNiB,OAAO;gCACLW,gBAAgB;4BAClB;sCAEC5B,QAAQ;;;kCAGb,KAAC6B;wBACCZ,OAAO;4BACLa,QAAQ;wBACV;kCAEA,cAAA,KAACH;4BACC3B,MAAK;4BACLiB,OAAO;gCACLW,gBAAgB;4BAClB;sCAEC7B;;;kCAGL,KAACgC;wBACCd,OAAO;4BACLa,QAAQ;wBACV;kCAEChC;;;;;;AAKX,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.f1db24e",
|
|
4
4
|
"description": "SEO plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -37,23 +37,29 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/react": "
|
|
40
|
+
"@types/react": "npm:types-react@19.0.0-beta.2",
|
|
41
|
+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
|
|
41
42
|
"@payloadcms/eslint-config": "1.1.1",
|
|
42
|
-
"@payloadcms/
|
|
43
|
-
"@payloadcms/
|
|
44
|
-
"
|
|
45
|
-
"
|
|
43
|
+
"@payloadcms/next": "3.0.0-canary.f1db24e",
|
|
44
|
+
"@payloadcms/translations": "3.0.0-canary.f1db24e",
|
|
45
|
+
"payload": "3.0.0-canary.f1db24e",
|
|
46
|
+
"@payloadcms/ui": "3.0.0-canary.f1db24e"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"react": "^
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
49
|
+
"react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
|
|
50
|
+
"react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
|
|
51
|
+
"@payloadcms/translations": "3.0.0-canary.f1db24e",
|
|
52
|
+
"payload": "3.0.0-canary.f1db24e",
|
|
53
|
+
"@payloadcms/ui": "3.0.0-canary.f1db24e"
|
|
52
54
|
},
|
|
53
55
|
"publishConfig": {
|
|
54
56
|
"registry": "https://registry.npmjs.org/"
|
|
55
57
|
},
|
|
56
58
|
"homepage:": "https://payloadcms.com",
|
|
59
|
+
"overrides": {
|
|
60
|
+
"@types/react": "npm:types-react@19.0.0-beta.2",
|
|
61
|
+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
|
|
62
|
+
},
|
|
57
63
|
"scripts": {
|
|
58
64
|
"build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
|
|
59
65
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|