@payloadcms/plugin-seo 1.0.14 → 2.0.0

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.
Files changed (49) hide show
  1. package/README.md +6 -201
  2. package/dist/defaults.d.ts +5 -4
  3. package/dist/defaults.d.ts.map +1 -0
  4. package/dist/defaults.js +17 -9
  5. package/dist/fields/MetaDescription.d.ts +6 -7
  6. package/dist/fields/MetaDescription.d.ts.map +1 -0
  7. package/dist/fields/MetaDescription.js +151 -147
  8. package/dist/fields/MetaImage.d.ts +6 -5
  9. package/dist/fields/MetaImage.d.ts.map +1 -0
  10. package/dist/fields/MetaImage.js +156 -152
  11. package/dist/fields/MetaTitle.d.ts +6 -5
  12. package/dist/fields/MetaTitle.d.ts.map +1 -0
  13. package/dist/fields/MetaTitle.js +151 -148
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +141 -99
  17. package/dist/translations/en.json +22 -0
  18. package/dist/translations/es.json +22 -0
  19. package/dist/translations/fa.json +22 -0
  20. package/dist/translations/index.d.ts +70 -0
  21. package/dist/translations/index.d.ts.map +1 -0
  22. package/dist/translations/index.js +25 -0
  23. package/dist/translations/translation-schema.json +87 -0
  24. package/dist/types.d.ts +11 -10
  25. package/dist/types.d.ts.map +1 -0
  26. package/dist/types.js +5 -2
  27. package/dist/ui/LengthIndicator.d.ts +3 -2
  28. package/dist/ui/LengthIndicator.d.ts.map +1 -0
  29. package/dist/ui/LengthIndicator.js +126 -85
  30. package/dist/ui/Overview.d.ts +1 -0
  31. package/dist/ui/Overview.d.ts.map +1 -0
  32. package/dist/ui/Overview.js +92 -53
  33. package/dist/ui/Pill.d.ts +1 -0
  34. package/dist/ui/Pill.d.ts.map +1 -0
  35. package/dist/ui/Pill.js +29 -19
  36. package/dist/ui/Preview.d.ts +6 -5
  37. package/dist/ui/Preview.d.ts.map +1 -0
  38. package/dist/ui/Preview.js +124 -129
  39. package/package.json +24 -36
  40. package/dist/defaults.js.map +0 -1
  41. package/dist/fields/MetaDescription.js.map +0 -1
  42. package/dist/fields/MetaImage.js.map +0 -1
  43. package/dist/fields/MetaTitle.js.map +0 -1
  44. package/dist/index.js.map +0 -1
  45. package/dist/types.js.map +0 -1
  46. package/dist/ui/LengthIndicator.js.map +0 -1
  47. package/dist/ui/Overview.js.map +0 -1
  48. package/dist/ui/Pill.js.map +0 -1
  49. package/dist/ui/Preview.js.map +0 -1
package/README.md CHANGED
@@ -1,206 +1,11 @@
1
1
  # Payload SEO Plugin
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-seo)](https://www.npmjs.com/package/@payloadcms/plugin-seo)
3
+ A plugin for [Payload](https://github.com/payloadcms/payload) to manage SEO metadata from within your admin panel.
4
4
 
5
- A plugin for [Payload](https://github.com/payloadcms/payload) to auto-generate SEO meta data based on the content of your documents.
5
+ If you're using version 2.0.0 or higher of this plugin, you'll need to be using version 2.7.0 or higher of Payload.
6
6
 
7
- Core features:
7
+ If you're still on an older payload version, please use version 1.0.15.
8
8
 
9
- - Adds a `meta` field group to every SEO-enabled collection or global
10
- - Auto-generates meta data using your document's existing content
11
- - Displays hints and indicators to help content editor write effective meta
12
- - Renders a snippet of what a search engine might display
13
- - Extendable so you can define custom fields like `og:title` or `json-ld`
14
- - Soon will dynamic support variable injection
15
-
16
- ## Installation
17
-
18
- ```bash
19
- yarn add @payloadcms/plugin-seo
20
- # OR
21
- npm i @payloadcms/plugin-seo
22
- ```
23
-
24
- ## Basic Usage
25
-
26
- In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
27
-
28
- ```js
29
- import { buildConfig } from 'payload/config';
30
- import seo from '@payloadcms/plugin-seo';
31
-
32
- const config = buildConfig({
33
- collections: [
34
- {
35
- slug: 'pages',
36
- fields: []
37
- },
38
- {
39
- slug: 'media',
40
- upload: {
41
- staticDir: // path to your static directory,
42
- },
43
- fields: []
44
- }
45
- ],
46
- plugins: [
47
- seo({
48
- collections: [
49
- 'pages',
50
- ],
51
- uploadsCollection: 'media',
52
- generateTitle: ({ doc }) => `Website.com — ${doc.title.value}`,
53
- generateDescription: ({ doc }) => doc.excerpt
54
- })
55
- ]
56
- });
57
-
58
- export default config;
59
- ```
60
-
61
- ### Options
62
-
63
- - `collections` : string[] | optional
64
-
65
- An array of collections slugs to enable SEO. Enabled collections receive a `meta` field which is an object of title, description, and image subfields.
66
-
67
- - `globals` : string[] | optional
68
-
69
- An array of global slugs to enable SEO. Enabled globals receive a `meta` field which is an object of title, description, and image subfields.
70
-
71
- - `fields` Field[] | optional
72
-
73
- Append your own custom fields onto the `meta` field group. The following fields are provided by default:
74
-
75
- - `title`: text
76
- - `description`: textarea
77
- - `image`: upload (if an `uploadsCollection` is provided)
78
- - `preview`: ui
79
-
80
- - `uploadsCollection` : string | optional
81
-
82
- An upload-enabled collection slug, for the meta image to access.
83
-
84
- - `tabbedUI` : boolean | optional
85
-
86
- Appends an `SEO` tab onto your config using Payload's [Tabs Field](https://payloadcms.com/docs/fields/tabs). If your collection is not already tab-enabled, meaning the first field in your config is not of type `tabs`, then one will be created for you called `Content`. Defaults to `false`.
87
-
88
- > If you wish to continue to use top-level or sidebar fields with `tabbedUI`, you must not let the default `Content` tab get created for you (see the note above). Instead, you must define the first field of your config with type `tabs` and place all other fields adjacent to this one.
89
-
90
- - `generateTitle` : method | optional
91
-
92
- A function that allows you to return any meta title, including from document's content.
93
-
94
- ```js
95
- seo({
96
- ...
97
- generateTitle: ({ ...docInfo, doc, locale }) => `Website.com — ${doc?.title?.value}`,
98
- })
99
- ```
100
-
101
- - `generateDescription` : method | optional
102
-
103
- A function that allows you to return any meta description, including from document's content.
104
-
105
- ```js
106
- seo({
107
- ...
108
- generateDescription: ({ ...docInfo, doc, locale }) => doc?.excerpt?.value
109
- })
110
- ```
111
-
112
- - `generateImage` : method | optional
113
-
114
- A function that allows you to return any meta image, including from document's content.
115
-
116
- ```js
117
- seo({
118
- ...
119
- generateImage: ({ ...docInfo, doc, locale }) => doc?.featuredImage?.value
120
- })
121
- ```
122
-
123
- - `generateURL` : method | optional
124
-
125
- A function called by the search preview component to display the actual URL of your page.
126
-
127
- ```js
128
- seo({
129
- ...
130
- generateURL: ({ ...docInfo, doc, locale }) => `https://yoursite.com/${collection?.slug}/${doc?.slug?.value}`
131
- })
132
- ```
133
-
134
- ## TypeScript
135
-
136
- All types can be directly imported:
137
-
138
- ```js
139
- import {
140
- PluginConfig,
141
- GenerateTitle,
142
- GenerateDescription
143
- GenerateURL
144
- } from '@payloadcms/plugin-seo/types';
145
- ```
146
-
147
- ## Development
148
-
149
- To actively develop or debug this plugin you can either work directly within the demo directory of this repo, or link your own project.
150
-
151
- 1. #### Internal Demo
152
-
153
- This repo includes a fully working, self-seeding instance of Payload that installs the plugin directly from the source code. This is the easiest way to get started. To spin up this demo, follow these steps:
154
-
155
- 1. First clone the repo
156
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn && cd demo && yarn && yarn dev`
157
- 1. Now open `http://localhost:3000/admin` in your browser
158
- 1. Enter username `dev@payloadcms.com` and password `test`
159
-
160
- That's it! Changes made in `./src` will be reflected in your demo. Keep in mind that the demo database is automatically seeded on every startup, any changes you make to the data get destroyed each time you reboot the app.
161
-
162
- 1. #### Linked Project
163
-
164
- You can alternatively link your own project to the source code:
165
-
166
- 1. First clone the repo
167
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn && cd demo && cp env.example .env && yarn && yarn dev`
168
- 1. Now `cd` back into your own project and run, `yarn link @payloadcms/plugin-seo`
169
- 1. If this plugin using React in any way, continue to the next step. Otherwise skip to step 7.
170
- 1. From your own project, `cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../../`
171
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn link react react-dom`
172
-
173
- All set! You can now boot up your own project as normal, and your local copy of the plugin source code will be used. Keep in mind that changes to the source code require a rebuild, `yarn build`.
174
-
175
- You might also need to alias these modules in your Webpack config. To do this, open your project's Payload config and add the following:
176
-
177
- ```js
178
- import { buildConfig } from "payload/config";
179
-
180
- export default buildConfig({
181
- admin: {
182
- webpack: (config) => ({
183
- ...config,
184
- resolve: {
185
- ...config.resolve,
186
- alias: {
187
- ...config.resolve.alias,
188
- react: path.join(__dirname, "../node_modules/react"),
189
- "react-dom": path.join(__dirname, "../node_modules/react-dom"),
190
- payload: path.join(__dirname, "../node_modules/payload"),
191
- "@payloadcms/plugin-seo": path.join(
192
- __dirname,
193
- "../../payload/plugin-seo/src"
194
- ),
195
- },
196
- },
197
- }),
198
- },
199
- });
200
- ```
201
-
202
- ## Screenshots
203
-
204
- ![image](https://user-images.githubusercontent.com/70709113/163850633-f3da5f8e-2527-4688-bc79-17233307a883.png)
205
-
206
- <!-- ![screenshot 1](https://github.com/@payloadcms/plugin-seo/blob/main/images/screenshot-1.jpg?raw=true) -->
9
+ - [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-seo)
10
+ - [Documentation](https://payloadcms.com/docs/plugins/seo)
11
+ - [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/seo.mdx)
@@ -1,10 +1,11 @@
1
1
  export declare const defaults: {
2
- title: {
3
- minLength: number;
4
- maxLength: number;
5
- };
6
2
  description: {
3
+ maxLength: number;
7
4
  minLength: number;
5
+ };
6
+ title: {
8
7
  maxLength: number;
8
+ minLength: number;
9
9
  };
10
10
  };
11
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;CASpB,CAAA"}
package/dist/defaults.js CHANGED
@@ -1,14 +1,22 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaults = void 0;
4
- exports.defaults = {
5
- title: {
6
- minLength: 50,
7
- maxLength: 60,
8
- },
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "defaults", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return defaults;
9
+ }
10
+ });
11
+ const defaults = {
9
12
  description: {
10
- minLength: 100,
11
13
  maxLength: 150,
14
+ minLength: 100
12
15
  },
16
+ title: {
17
+ maxLength: 60,
18
+ minLength: 50
19
+ }
13
20
  };
14
- //# sourceMappingURL=defaults.js.map
21
+
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWZhdWx0cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZGVmYXVsdHMgPSB7XG4gIGRlc2NyaXB0aW9uOiB7XG4gICAgbWF4TGVuZ3RoOiAxNTAsXG4gICAgbWluTGVuZ3RoOiAxMDAsXG4gIH0sXG4gIHRpdGxlOiB7XG4gICAgbWF4TGVuZ3RoOiA2MCxcbiAgICBtaW5MZW5ndGg6IDUwLFxuICB9LFxufVxuIl0sIm5hbWVzIjpbImRlZmF1bHRzIiwiZGVzY3JpcHRpb24iLCJtYXhMZW5ndGgiLCJtaW5MZW5ndGgiLCJ0aXRsZSJdLCJtYXBwaW5ncyI6Ijs7OzsrQkFBYUE7OztlQUFBQTs7O0FBQU4sTUFBTUEsV0FBVztJQUN0QkMsYUFBYTtRQUNYQyxXQUFXO1FBQ1hDLFdBQVc7SUFDYjtJQUNBQyxPQUFPO1FBQ0xGLFdBQVc7UUFDWEMsV0FBVztJQUNiO0FBQ0YifQ==
@@ -1,12 +1,11 @@
1
+ import type { TextareaField } from 'payload/types';
1
2
  import React from 'react';
2
- import { TextareaField } from 'payload/dist/fields/config/types';
3
- import { PluginConfig } from '../types';
4
- type TextareaFieldWithProps = TextareaField & {
3
+ import type { PluginConfig } from '../types';
4
+ type MetaDescriptionProps = TextareaField & {
5
5
  path: string;
6
6
  pluginConfig: PluginConfig;
7
7
  };
8
- export declare const MetaDescription: React.FC<(TextareaFieldWithProps | {}) & {
9
- pluginConfig: PluginConfig;
10
- }>;
11
- export declare const getMetaDescriptionField: (props: any) => JSX.Element;
8
+ export declare const MetaDescription: React.FC<MetaDescriptionProps>;
9
+ export declare const getMetaDescriptionField: (props: MetaDescriptionProps) => React.JSX.Element;
12
10
  export {};
11
+ //# sourceMappingURL=MetaDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetaDescription.d.ts","sourceRoot":"","sources":["../../src/fields/MetaDescription.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAIlD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAQ5C,KAAK,oBAAoB,GAAG,aAAa,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8G1D,CAAA;AAED,eAAO,MAAM,uBAAuB,UAAW,oBAAoB,sBAElE,CAAA"}
@@ -1,154 +1,158 @@
1
- "use strict";
2
1
  'use client';
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
- Object.defineProperty(o, "default", { enumerable: true, value: v });
27
- }) : function(o, v) {
28
- o["default"] = v;
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
29
5
  });
30
- var __importStar = (this && this.__importStar) || function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
38
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
39
- return new (P || (P = Promise))(function (resolve, reject) {
40
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
41
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
42
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
43
- step((generator = generator.apply(thisArg, _arguments || [])).next());
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
44
10
  });
45
- };
46
- var __generator = (this && this.__generator) || function (thisArg, body) {
47
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
48
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
49
- function verb(n) { return function (v) { return step([n, v]); }; }
50
- function step(op) {
51
- if (f) throw new TypeError("Generator is already executing.");
52
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
53
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
54
- if (y = 0, t) op = [op[0] & 2, t.value];
55
- switch (op[0]) {
56
- case 0: case 1: t = op; break;
57
- case 4: _.label++; return { value: op[1], done: false };
58
- case 5: _.label++; y = op[1]; op = [0]; continue;
59
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
60
- default:
61
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
62
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
63
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
64
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
65
- if (t[2]) _.ops.pop();
66
- _.trys.pop(); continue;
11
+ }
12
+ _export(exports, {
13
+ MetaDescription: function() {
14
+ return MetaDescription;
15
+ },
16
+ getMetaDescriptionField: function() {
17
+ return getMetaDescriptionField;
18
+ }
19
+ });
20
+ const _forms = require("payload/components/forms");
21
+ const _utilities = require("payload/components/utilities");
22
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
23
+ const _reacti18next = require("react-i18next");
24
+ const _defaults = require("../defaults");
25
+ const _LengthIndicator = require("../ui/LengthIndicator");
26
+ function _getRequireWildcardCache(nodeInterop) {
27
+ if (typeof WeakMap !== "function") return null;
28
+ var cacheBabelInterop = new WeakMap();
29
+ var cacheNodeInterop = new WeakMap();
30
+ return (_getRequireWildcardCache = function(nodeInterop) {
31
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
32
+ })(nodeInterop);
33
+ }
34
+ function _interop_require_wildcard(obj, nodeInterop) {
35
+ if (!nodeInterop && obj && obj.__esModule) {
36
+ return obj;
37
+ }
38
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
39
+ return {
40
+ default: obj
41
+ };
42
+ }
43
+ var cache = _getRequireWildcardCache(nodeInterop);
44
+ if (cache && cache.has(obj)) {
45
+ return cache.get(obj);
46
+ }
47
+ var newObj = {};
48
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
49
+ for(var key in obj){
50
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
51
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
52
+ if (desc && (desc.get || desc.set)) {
53
+ Object.defineProperty(newObj, key, desc);
54
+ } else {
55
+ newObj[key] = obj[key];
67
56
  }
68
- op = body.call(thisArg, _);
69
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
70
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
+ }
71
58
  }
72
- };
73
- var __importDefault = (this && this.__importDefault) || function (mod) {
74
- return (mod && mod.__esModule) ? mod : { "default": mod };
75
- };
76
- Object.defineProperty(exports, "__esModule", { value: true });
77
- exports.getMetaDescriptionField = exports.MetaDescription = void 0;
78
- var react_1 = __importStar(require("react"));
79
- var forms_1 = require("payload/components/forms");
80
- var utilities_1 = require("payload/components/utilities");
81
- var Input_1 = __importDefault(require("payload/dist/admin/components/forms/field-types/Textarea/Input"));
82
- var defaults_1 = require("../defaults");
83
- var LengthIndicator_1 = require("../ui/LengthIndicator");
84
- var _a = defaults_1.defaults.description, minLength = _a.minLength, maxLength = _a.maxLength;
85
- var MetaDescription = function (props) {
86
- var _a = props || {}, path = _a.path, label = _a.label, name = _a.name, pluginConfig = _a.pluginConfig; // TODO: this typing is temporary until payload types are updated for custom field props
87
- var locale = (0, utilities_1.useLocale)();
88
- var fields = (0, forms_1.useAllFormFields)()[0];
89
- var docInfo = (0, utilities_1.useDocumentInfo)();
90
- var field = (0, forms_1.useField)({
91
- label: label,
92
- name: name,
93
- path: path,
59
+ newObj.default = obj;
60
+ if (cache) {
61
+ cache.set(obj, newObj);
62
+ }
63
+ return newObj;
64
+ }
65
+ const { maxLength, minLength } = _defaults.defaults.description;
66
+ const MetaDescription = (props)=>{
67
+ const { name, label, path, pluginConfig } = props;
68
+ const { t } = (0, _reacti18next.useTranslation)('plugin-seo');
69
+ const locale = (0, _utilities.useLocale)();
70
+ const [fields] = (0, _forms.useAllFormFields)();
71
+ const docInfo = (0, _utilities.useDocumentInfo)();
72
+ const field = (0, _forms.useField)({
73
+ name,
74
+ label,
75
+ path
94
76
  });
95
- var value = field.value, setValue = field.setValue, showError = field.showError;
96
- var regenerateDescription = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
97
- var generateDescription, generatedDescription;
98
- return __generator(this, function (_a) {
99
- switch (_a.label) {
100
- case 0:
101
- generateDescription = pluginConfig.generateDescription;
102
- if (!(typeof generateDescription === 'function')) return [3 /*break*/, 2];
103
- return [4 /*yield*/, generateDescription(__assign(__assign({}, docInfo), { doc: __assign({}, fields), locale: locale }))];
104
- case 1:
105
- generatedDescription = _a.sent();
106
- _a.label = 2;
107
- case 2:
108
- setValue(generatedDescription);
109
- return [2 /*return*/];
110
- }
111
- });
112
- }); }, [fields, setValue, pluginConfig, locale, docInfo]);
113
- return (react_1.default.createElement("div", { style: {
114
- marginBottom: '20px',
115
- } },
116
- react_1.default.createElement("div", { style: {
117
- marginBottom: '5px',
118
- position: 'relative',
119
- } },
120
- react_1.default.createElement("div", null,
121
- label && typeof label === 'string' && label,
122
- typeof pluginConfig.generateDescription === 'function' && (react_1.default.createElement(react_1.default.Fragment, null,
123
- "\u00A0 \u2014 \u00A0",
124
- react_1.default.createElement("button", { onClick: regenerateDescription, type: "button", style: {
125
- padding: 0,
126
- background: 'none',
127
- border: 'none',
128
- backgroundColor: 'transparent',
129
- cursor: 'pointer',
130
- textDecoration: 'underline',
131
- color: 'currentcolor',
132
- } }, "Auto-generate")))),
133
- react_1.default.createElement("div", { style: {
134
- color: '#9A9A9A',
135
- } }, "This should be between ".concat(minLength, " and ").concat(maxLength, " characters. For help in writing quality meta descriptions, see "),
136
- react_1.default.createElement("a", { href: "https://developers.google.com/search/docs/advanced/appearance/snippet#meta-descriptions", rel: "noopener noreferrer", target: "_blank" }, "best practices"))),
137
- react_1.default.createElement("div", { style: {
138
- marginBottom: '10px',
139
- position: 'relative',
140
- } },
141
- react_1.default.createElement(Input_1.default, { path: name, name: name, onChange: setValue, value: value, showError: showError, style: {
142
- marginBottom: 0,
143
- } })),
144
- react_1.default.createElement("div", { style: {
145
- display: 'flex',
146
- alignItems: 'center',
147
- width: '100%',
148
- } },
149
- react_1.default.createElement(LengthIndicator_1.LengthIndicator, { text: value, minLength: minLength, maxLength: maxLength }))));
77
+ const { setValue, showError, value } = field;
78
+ const regenerateDescription = (0, _react.useCallback)(async ()=>{
79
+ const { generateDescription } = pluginConfig;
80
+ let generatedDescription;
81
+ if (typeof generateDescription === 'function') {
82
+ generatedDescription = await generateDescription({
83
+ ...docInfo,
84
+ doc: {
85
+ ...fields
86
+ },
87
+ locale: typeof locale === 'object' ? locale?.code : locale
88
+ });
89
+ }
90
+ setValue(generatedDescription);
91
+ }, [
92
+ fields,
93
+ setValue,
94
+ pluginConfig,
95
+ locale,
96
+ docInfo
97
+ ]);
98
+ return /*#__PURE__*/ _react.default.createElement("div", {
99
+ style: {
100
+ marginBottom: '20px'
101
+ }
102
+ }, /*#__PURE__*/ _react.default.createElement("div", {
103
+ style: {
104
+ marginBottom: '5px',
105
+ position: 'relative'
106
+ }
107
+ }, /*#__PURE__*/ _react.default.createElement("div", null, label && typeof label === 'string' && label, typeof pluginConfig.generateDescription === 'function' && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, "\xa0 — \xa0", /*#__PURE__*/ _react.default.createElement("button", {
108
+ onClick: regenerateDescription,
109
+ style: {
110
+ background: 'none',
111
+ backgroundColor: 'transparent',
112
+ border: 'none',
113
+ color: 'currentcolor',
114
+ cursor: 'pointer',
115
+ padding: 0,
116
+ textDecoration: 'underline'
117
+ },
118
+ type: "button"
119
+ }, t('autoGenerate')))), /*#__PURE__*/ _react.default.createElement("div", {
120
+ style: {
121
+ color: '#9A9A9A'
122
+ }
123
+ }, t('lengthTipDescription', {
124
+ maxLength,
125
+ minLength
126
+ }), /*#__PURE__*/ _react.default.createElement("a", {
127
+ href: "https://developers.google.com/search/docs/advanced/appearance/snippet#meta-descriptions",
128
+ rel: "noopener noreferrer",
129
+ target: "_blank"
130
+ }, t('bestPractices')))), /*#__PURE__*/ _react.default.createElement("div", {
131
+ style: {
132
+ marginBottom: '10px',
133
+ position: 'relative'
134
+ }
135
+ }, /*#__PURE__*/ _react.default.createElement(_forms.TextareaInput, {
136
+ name: name,
137
+ onChange: setValue,
138
+ path: name,
139
+ showError: showError,
140
+ style: {
141
+ marginBottom: 0
142
+ },
143
+ value: value
144
+ })), /*#__PURE__*/ _react.default.createElement("div", {
145
+ style: {
146
+ alignItems: 'center',
147
+ display: 'flex',
148
+ width: '100%'
149
+ }
150
+ }, /*#__PURE__*/ _react.default.createElement(_LengthIndicator.LengthIndicator, {
151
+ maxLength: maxLength,
152
+ minLength: minLength,
153
+ text: value
154
+ })));
150
155
  };
151
- exports.MetaDescription = MetaDescription;
152
- var getMetaDescriptionField = function (props) { return react_1.default.createElement(exports.MetaDescription, __assign({}, props)); };
153
- exports.getMetaDescriptionField = getMetaDescriptionField;
154
- //# sourceMappingURL=MetaDescription.js.map
156
+ const getMetaDescriptionField = (props)=>/*#__PURE__*/ _react.default.createElement(MetaDescription, props);
157
+
158
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maWVsZHMvTWV0YURlc2NyaXB0aW9uLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIGNsaWVudCdcblxuaW1wb3J0IHR5cGUgeyBGaWVsZFR5cGUsIE9wdGlvbnMgfSBmcm9tICdwYXlsb2FkL2Rpc3QvYWRtaW4vY29tcG9uZW50cy9mb3Jtcy91c2VGaWVsZC90eXBlcydcbmltcG9ydCB0eXBlIHsgVGV4dGFyZWFGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IFRleHRhcmVhSW5wdXQsIHVzZUFsbEZvcm1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lxuICAgICAgPGRpdlxuICAgICAgICBzdHlsZT17e1xuICAgICAgICAgIG1hcmdpbkJvdHRvbTogJzVweCcsXG4gICAgICAgICAgcG9zaXRpb246ICdyZWxhdGl2ZScsXG4gICAgICAgIH19XG4gICAgICA+XG4gICAgICAgIDxkaXY+XG4gICAgICAgICAge2xhYmVsICYmIHR5cGVvZiBsYWJlbCA9PT0gJ3N0cmluZycgJiYgbGFiZWx9XG4gICAgICAgICAge3R5cGVvZiBwbHVnaW5Db25maWcuZ2VuZXJhdGVEZXNjcmlwdGlvbiA9PT0gJ2Z1bmN0aW9uJyAmJiAoXG4gICAgICAgICAgICA8UmVhY3QuRnJhZ21lbnQ+XG4gICAgICAgICAgICAgICZuYnNwOyAmbWRhc2g7ICZuYnNwO1xuICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgb25DbGljaz17cmVnZW5lcmF0ZURlc2NyaXB0aW9ufVxuICAgICAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiAnbm9uZScsXG4gICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgICAgICAgICAgICBib3JkZXI6ICdub25lJyxcbiAgICAgICAgICAgICAgICAgIGNvbG9yOiAnY3VycmVudGNvbG9yJyxcbiAgICAgICAgICAgICAgICAgIGN1cnNvcjogJ3BvaW50ZXInLFxuICAgICAgICAgICAgICAgICAgcGFkZGluZzogMCxcbiAgICAgICAgICAgICAgICAgIHRleHREZWNvcmF0aW9uOiAndW5kZXJsaW5lJyxcbiAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIlxuICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAge3QoJ2F1dG9HZW5lcmF0ZScpfVxuICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvUmVhY3QuRnJhZ21lbnQ+XG4gICAgICAgICAgKX1cbiAgICAgICAgPC9kaXY+XG4gICAgICAgIDxkaXZcbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgY29sb3I6ICcjOUE5QTlBJyxcbiAgICAgICAgICB9fVxuICAgICAgICA+XG4gICAgICAgICAge3QoJ2xlbmd0aFRpcERlc2NyaXB0aW9uJywgeyBtYXhMZW5ndGgsIG1pbkxlbmd0aCB9KX1cbiAgICAgICAgICA8YVxuICAgICAgICAgICAgaHJlZj1cImh0dHBzOi8vZGV2ZWxvcGVycy5nb29nbGUuY29tL3NlYXJjaC9kb2NzL2FkdmFuY2VkL2FwcGVhcmFuY2Uvc25pcHBldCNtZXRhLWRlc2NyaXB0aW9uc1wiXG4gICAgICAgICAgICByZWw9XCJub29wZW5lciBub3JlZmVycmVyXCJcbiAgICAgICAgICAgIHRhcmdldD1cIl9ibGFua1wiXG4gICAgICAgICAgPlxuICAgICAgICAgICAge3QoJ2Jlc3RQcmFjdGljZXMnKX1cbiAgICAgICAgICA8L2E+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9kaXY+XG4gICAgICA8ZGl2XG4gICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgbWFyZ2luQm90dG9tOiAnMTBweCcsXG4gICAgICAgICAgcG9zaXRpb246ICdyZWxhdGl2ZScsXG4gICAgICAgIH19XG4gICAgICA+XG4gICAgICAgIDxUZXh0YXJlYUlucHV0XG4gICAgICAgICAgbmFtZT17bmFtZX1cbiAgICAgICAgICBvbkNoYW5nZT17c2V0VmFsdWV9XG4gICAgICAgICAgcGF0aD17bmFtZX1cbiAgICAgICAgICBzaG93RXJyb3I9e3Nob3dFcnJvcn1cbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgbWFyZ2luQm90dG9tOiAwLFxuICAgICAgICAgIH19XG4gICAgICAgICAgdmFsdWU9e3ZhbHVlfVxuICAgICAgICAvPlxuICAgICAgPC9kaXY+XG4gICAgICA8ZGl2XG4gICAgICAgI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BSztRQUNMQyxLQUFJO1FBQ0pDLFFBQU87T0FFTnRDLEVBQUUsbUNBSVQsNkJBQUNtQjtRQUNDQyxPQUFPO1lBQ0xDLGNBQWM7WUFDZEMsVUFBVTtRQUNaO3FCQUVBLDZCQUFDaUIsb0JBQWE7UUFDWjNDLE1BQU1BO1FBQ040QyxVQUFVOUI7UUFDVlosTUFBTUY7UUFDTmUsV0FBV0E7UUFDWFMsT0FBTztZQUNMQyxjQUFjO1FBQ2hCO1FBQ0FULE9BQU9BO3VCQUdYLDZCQUFDTztRQUNDQyxPQUFPO1lBQ0xxQixZQUFZO1lBQ1pDLFNBQVM7WUFDVEMsT0FBTztRQUNUO3FCQUVBLDZCQUFDQyxnQ0FBZTtRQUFDckQsV0FBV0E7UUFBV0MsV0FBV0E7UUFBV3FELE1BQU1qQzs7QUFJM0U7QUFFTyxNQUFNdEIsMEJBQTBCLENBQUNLLHNCQUN0Qyw2QkFBQ04saUJBQW9CTSJ9
@@ -1,10 +1,11 @@
1
+ import type { Props as UploadInputProps } from 'payload/components/fields/Upload';
1
2
  import React from 'react';
2
- import { Props as UploadFieldType } from 'payload/dist/admin/components/forms/field-types/Upload/types';
3
- import { PluginConfig } from '../types';
4
- type UploadFieldWithProps = UploadFieldType & {
3
+ import type { PluginConfig } from '../types';
4
+ type MetaImageProps = UploadInputProps & {
5
5
  path: string;
6
6
  pluginConfig: PluginConfig;
7
7
  };
8
- export declare const MetaImage: React.FC<UploadFieldWithProps | {}>;
9
- export declare const getMetaImageField: (props: any) => JSX.Element;
8
+ export declare const MetaImage: React.FC<MetaImageProps>;
9
+ export declare const getMetaImageField: (props: MetaImageProps) => React.JSX.Element;
10
10
  export {};
11
+ //# sourceMappingURL=MetaImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetaImage.d.ts","sourceRoot":"","sources":["../../src/fields/MetaImage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAKjF,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAK5C,KAAK,cAAc,GAAG,gBAAgB,GAAG;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA+H9C,CAAA;AAED,eAAO,MAAM,iBAAiB,UAAW,cAAc,sBAA6B,CAAA"}