@justanarthur/payload-plugin-seo 1.3.9 → 1.3.10

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 (43) hide show
  1. package/README.md +16 -16
  2. package/dist/defaults.js.map +1 -1
  3. package/dist/exports/client.js.map +1 -1
  4. package/dist/exports/fields-components.js.map +1 -1
  5. package/dist/exports/fields.js.map +1 -1
  6. package/dist/exports/types.js.map +1 -1
  7. package/dist/fields/MetaDescription/MetaDescriptionComponent.js.map +1 -1
  8. package/dist/fields/MetaDescription/index.js.map +1 -1
  9. package/dist/fields/MetaImage/MetaImageComponent.js.map +1 -1
  10. package/dist/fields/MetaImage/index.js.map +1 -1
  11. package/dist/fields/MetaTitle/MetaTitleComponent.js.map +1 -1
  12. package/dist/fields/MetaTitle/index.js.map +1 -1
  13. package/dist/fields/Overview/OverviewComponent.js.map +1 -1
  14. package/dist/fields/Overview/index.js.map +1 -1
  15. package/dist/fields/Preview/PreviewComponent.d.ts.map +1 -1
  16. package/dist/fields/Preview/PreviewComponent.js +1 -13
  17. package/dist/fields/Preview/PreviewComponent.js.map +1 -1
  18. package/dist/fields/Preview/index.js.map +1 -1
  19. package/dist/fields/index.scss +7 -7
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +86 -44
  22. package/dist/index.js.map +1 -1
  23. package/dist/openai/message.js.map +1 -1
  24. package/dist/translations/cs.js.map +1 -1
  25. package/dist/translations/de.js.map +1 -1
  26. package/dist/translations/en.js.map +1 -1
  27. package/dist/translations/es.js.map +1 -1
  28. package/dist/translations/fa.js.map +1 -1
  29. package/dist/translations/fr.js.map +1 -1
  30. package/dist/translations/index.js.map +1 -1
  31. package/dist/translations/it.js.map +1 -1
  32. package/dist/translations/nb.js.map +1 -1
  33. package/dist/translations/pl.js.map +1 -1
  34. package/dist/translations/ru.js.map +1 -1
  35. package/dist/translations/sv.js.map +1 -1
  36. package/dist/translations/tr.js.map +1 -1
  37. package/dist/translations/translation-schema.json +96 -96
  38. package/dist/translations/uk.js.map +1 -1
  39. package/dist/translations/vi.js.map +1 -1
  40. package/dist/types.js.map +1 -1
  41. package/dist/ui/LengthIndicator.js.map +1 -1
  42. package/dist/ui/Pill.js.map +1 -1
  43. package/package.json +1 -1
@@ -1,96 +1,96 @@
1
- {
2
- "type": "object",
3
- "$schema": "http://json-schema.org/draft-04/schema#",
4
- "additionalProperties": false,
5
- "properties": {
6
- "$schema": {
7
- "type": "string"
8
- },
9
- "plugin-seo": {
10
- "type": "object",
11
- "additionalProperties": false,
12
- "properties": {
13
- "missing": {
14
- "type": "string"
15
- },
16
- "almostThere": {
17
- "type": "string"
18
- },
19
- "autoGenerate": {
20
- "type": "string"
21
- },
22
- "generateAi": {
23
- "type": "string"
24
- },
25
- "bestPractices": {
26
- "type": "string"
27
- },
28
- "characterCount": {
29
- "type": "string"
30
- },
31
- "charactersLeftOver": {
32
- "type": "string"
33
- },
34
- "charactersToGo": {
35
- "type": "string"
36
- },
37
- "charactersTooMany": {
38
- "type": "string"
39
- },
40
- "checksPassing": {
41
- "type": "string"
42
- },
43
- "good": {
44
- "type": "string"
45
- },
46
- "imageAutoGenerationTip": {
47
- "type": "string"
48
- },
49
- "lengthTipDescription": {
50
- "type": "string"
51
- },
52
- "lengthTipTitle": {
53
- "type": "string"
54
- },
55
- "noImage": {
56
- "type": "string"
57
- },
58
- "preview": {
59
- "type": "string"
60
- },
61
- "previewDescription": {
62
- "type": "string"
63
- },
64
- "tooLong": {
65
- "type": "string"
66
- },
67
- "tooShort": {
68
- "type": "string"
69
- }
70
- },
71
- "required": [
72
- "autoGenerate",
73
- "imageAutoGenerationTip",
74
- "bestPractices",
75
- "lengthTipTitle",
76
- "lengthTipDescription",
77
- "good",
78
- "tooLong",
79
- "tooShort",
80
- "almostThere",
81
- "characterCount",
82
- "charactersToGo",
83
- "charactersLeftOver",
84
- "charactersTooMany",
85
- "noImage",
86
- "checksPassing",
87
- "preview",
88
- "previewDescription",
89
- "missing"
90
- ]
91
- }
92
- },
93
- "required": [
94
- "plugin-seo"
95
- ]
96
- }
1
+ {
2
+ "type": "object",
3
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
+ "additionalProperties": false,
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string"
8
+ },
9
+ "plugin-seo": {
10
+ "type": "object",
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "missing": {
14
+ "type": "string"
15
+ },
16
+ "almostThere": {
17
+ "type": "string"
18
+ },
19
+ "autoGenerate": {
20
+ "type": "string"
21
+ },
22
+ "generateAi": {
23
+ "type": "string"
24
+ },
25
+ "bestPractices": {
26
+ "type": "string"
27
+ },
28
+ "characterCount": {
29
+ "type": "string"
30
+ },
31
+ "charactersLeftOver": {
32
+ "type": "string"
33
+ },
34
+ "charactersToGo": {
35
+ "type": "string"
36
+ },
37
+ "charactersTooMany": {
38
+ "type": "string"
39
+ },
40
+ "checksPassing": {
41
+ "type": "string"
42
+ },
43
+ "good": {
44
+ "type": "string"
45
+ },
46
+ "imageAutoGenerationTip": {
47
+ "type": "string"
48
+ },
49
+ "lengthTipDescription": {
50
+ "type": "string"
51
+ },
52
+ "lengthTipTitle": {
53
+ "type": "string"
54
+ },
55
+ "noImage": {
56
+ "type": "string"
57
+ },
58
+ "preview": {
59
+ "type": "string"
60
+ },
61
+ "previewDescription": {
62
+ "type": "string"
63
+ },
64
+ "tooLong": {
65
+ "type": "string"
66
+ },
67
+ "tooShort": {
68
+ "type": "string"
69
+ }
70
+ },
71
+ "required": [
72
+ "autoGenerate",
73
+ "imageAutoGenerationTip",
74
+ "bestPractices",
75
+ "lengthTipTitle",
76
+ "lengthTipDescription",
77
+ "good",
78
+ "tooLong",
79
+ "tooShort",
80
+ "almostThere",
81
+ "characterCount",
82
+ "charactersToGo",
83
+ "charactersLeftOver",
84
+ "charactersTooMany",
85
+ "noImage",
86
+ "checksPassing",
87
+ "preview",
88
+ "previewDescription",
89
+ "missing"
90
+ ]
91
+ }
92
+ },
93
+ "required": [
94
+ "plugin-seo"
95
+ ]
96
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/translations/uk.ts"],"sourcesContent":["import type { GenericTranslationsObject } from '@payloadcms/translations'\r\n\r\nexport const uk: GenericTranslationsObject = {\r\n $schema: './translation-schema.json',\r\n 'plugin-seo': {\r\n almostThere: 'Ще трошки',\r\n autoGenerate: 'Згенерувати',\r\n bestPractices: 'найкращі практики',\r\n characterCount: '{{current}}/{{minLength}}-{{maxLength}} символів, ',\r\n charactersLeftOver: 'залишилось {{characters}} символів',\r\n charactersToGo: ' на {{characters}} символів коротше',\r\n charactersTooMany: 'на {{characters}} символів довше',\r\n checksPassing: '{{current}}/{{max}} перевірок пройдено',\r\n generateAi: 'Згенерувати ШІ',\r\n good: 'Чудово',\r\n imageAutoGenerationTip: 'Автоматична генерація використає зображення з головного блоку',\r\n lengthTipDescription:\r\n 'Має бути від {{minLength}} до {{maxLength}} символів. Щоб дізнатися, як писати якісні метаописи — перегляньте ',\r\n lengthTipTitle:\r\n 'Має бути від {{minLength}} до {{maxLength}} символів. Щоб дізнатися, як писати якісні метазаголовки — перегляньте ',\r\n missing: 'Відсутнє',\r\n noImage: 'Немає зображення',\r\n preview: 'Попередній перегляд',\r\n previewDescription:\r\n 'Реальне відображення може відрізнятися в залежності від вмісту та релевантності пошуку.',\r\n tooLong: 'Задовгий',\r\n tooShort: 'Закороткий',\r\n },\r\n}\r\n"],"names":["uk","$schema","almostThere","autoGenerate","bestPractices","characterCount","charactersLeftOver","charactersToGo","charactersTooMany","checksPassing","generateAi","good","imageAutoGenerationTip","lengthTipDescription","lengthTipTitle","missing","noImage","preview","previewDescription","tooLong","tooShort"],"mappings":"AAEA,OAAO,MAAMA,KAAgC;IAC3CC,SAAS;IACT,cAAc;QACZC,aAAa;QACbC,cAAc;QACdC,eAAe;QACfC,gBAAgB;QAChBC,oBAAoB;QACpBC,gBAAgB;QAChBC,mBAAmB;QACnBC,eAAe;QACfC,YAAY;QACZC,MAAM;QACNC,wBAAwB;QACxBC,sBACE;QACFC,gBACE;QACFC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,oBACE;QACFC,SAAS;QACTC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/translations/uk.ts"],"sourcesContent":["import type { GenericTranslationsObject } from '@payloadcms/translations'\n\nexport const uk: GenericTranslationsObject = {\n $schema: './translation-schema.json',\n 'plugin-seo': {\n almostThere: 'Ще трошки',\n autoGenerate: 'Згенерувати',\n bestPractices: 'найкращі практики',\n characterCount: '{{current}}/{{minLength}}-{{maxLength}} символів, ',\n charactersLeftOver: 'залишилось {{characters}} символів',\n charactersToGo: ' на {{characters}} символів коротше',\n charactersTooMany: 'на {{characters}} символів довше',\n checksPassing: '{{current}}/{{max}} перевірок пройдено',\n generateAi: 'Згенерувати ШІ',\n good: 'Чудово',\n imageAutoGenerationTip: 'Автоматична генерація використає зображення з головного блоку',\n lengthTipDescription:\n 'Має бути від {{minLength}} до {{maxLength}} символів. Щоб дізнатися, як писати якісні метаописи — перегляньте ',\n lengthTipTitle:\n 'Має бути від {{minLength}} до {{maxLength}} символів. Щоб дізнатися, як писати якісні метазаголовки — перегляньте ',\n missing: 'Відсутнє',\n noImage: 'Немає зображення',\n preview: 'Попередній перегляд',\n previewDescription:\n 'Реальне відображення може відрізнятися в залежності від вмісту та релевантності пошуку.',\n tooLong: 'Задовгий',\n tooShort: 'Закороткий',\n },\n}\n"],"names":["uk","$schema","almostThere","autoGenerate","bestPractices","characterCount","charactersLeftOver","charactersToGo","charactersTooMany","checksPassing","generateAi","good","imageAutoGenerationTip","lengthTipDescription","lengthTipTitle","missing","noImage","preview","previewDescription","tooLong","tooShort"],"mappings":"AAEA,OAAO,MAAMA,KAAgC;IAC3CC,SAAS;IACT,cAAc;QACZC,aAAa;QACbC,cAAc;QACdC,eAAe;QACfC,gBAAgB;QAChBC,oBAAoB;QACpBC,gBAAgB;QAChBC,mBAAmB;QACnBC,eAAe;QACfC,YAAY;QACZC,MAAM;QACNC,wBAAwB;QACxBC,sBACE;QACFC,gBACE;QACFC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,oBACE;QACFC,SAAS;QACTC,UAAU;IACZ;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/translations/vi.ts"],"sourcesContent":["import type { GenericTranslationsObject } from '@payloadcms/translations'\r\n\r\nexport const vi: GenericTranslationsObject = {\r\n $schema: './translation-schema.json',\r\n 'plugin-seo': {\r\n almostThere: 'Gần đạt',\r\n autoGenerate: 'Tự động tạo',\r\n bestPractices: 'các phương pháp hay nhất',\r\n characterCount: '{{current}}/{{minLength}}-{{maxLength}} kí tự, ',\r\n charactersLeftOver: 'còn lại {{characters}}',\r\n charactersToGo: 'Còn {{characters}} ký tự nữa',\r\n charactersTooMany: 'vượt quá {{characters}} ký tự',\r\n checksPassing: '{{current}}/{{max}} đã đạt',\r\n generateAi: 'Tạo AI',\r\n good: 'Tốt',\r\n imageAutoGenerationTip: 'Tính năng tự động tạo sẽ lấy ảnh đầu tiên được chọn.',\r\n lengthTipDescription:\r\n 'Độ dài nên từ {{minLength}}-{{maxLength}} kí tự. Để được hướng dẫn viết mô tả meta chất lượng, hãy xem ',\r\n lengthTipTitle:\r\n 'Độ dài nên từ {{minLength}}-{{maxLength}} kí tự. Để được hướng dẫn viết mô tả meta chất lượng, hãy xem ',\r\n missing: 'Không đạt',\r\n noImage: 'Chưa có ảnh',\r\n preview: 'Xem trước',\r\n previewDescription: 'Kết quả hiển thị có thể thay đổi tuỳ theo nội dung và công cụ tìm kiếm.',\r\n tooLong: 'Quá dài',\r\n tooShort: 'Quá ngắn',\r\n },\r\n}\r\n"],"names":["vi","$schema","almostThere","autoGenerate","bestPractices","characterCount","charactersLeftOver","charactersToGo","charactersTooMany","checksPassing","generateAi","good","imageAutoGenerationTip","lengthTipDescription","lengthTipTitle","missing","noImage","preview","previewDescription","tooLong","tooShort"],"mappings":"AAEA,OAAO,MAAMA,KAAgC;IAC3CC,SAAS;IACT,cAAc;QACZC,aAAa;QACbC,cAAc;QACdC,eAAe;QACfC,gBAAgB;QAChBC,oBAAoB;QACpBC,gBAAgB;QAChBC,mBAAmB;QACnBC,eAAe;QACfC,YAAY;QACZC,MAAM;QACNC,wBAAwB;QACxBC,sBACE;QACFC,gBACE;QACFC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,oBAAoB;QACpBC,SAAS;QACTC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/translations/vi.ts"],"sourcesContent":["import type { GenericTranslationsObject } from '@payloadcms/translations'\n\nexport const vi: GenericTranslationsObject = {\n $schema: './translation-schema.json',\n 'plugin-seo': {\n almostThere: 'Gần đạt',\n autoGenerate: 'Tự động tạo',\n bestPractices: 'các phương pháp hay nhất',\n characterCount: '{{current}}/{{minLength}}-{{maxLength}} kí tự, ',\n charactersLeftOver: 'còn lại {{characters}}',\n charactersToGo: 'Còn {{characters}} ký tự nữa',\n charactersTooMany: 'vượt quá {{characters}} ký tự',\n checksPassing: '{{current}}/{{max}} đã đạt',\n generateAi: 'Tạo AI',\n good: 'Tốt',\n imageAutoGenerationTip: 'Tính năng tự động tạo sẽ lấy ảnh đầu tiên được chọn.',\n lengthTipDescription:\n 'Độ dài nên từ {{minLength}}-{{maxLength}} kí tự. Để được hướng dẫn viết mô tả meta chất lượng, hãy xem ',\n lengthTipTitle:\n 'Độ dài nên từ {{minLength}}-{{maxLength}} kí tự. Để được hướng dẫn viết mô tả meta chất lượng, hãy xem ',\n missing: 'Không đạt',\n noImage: 'Chưa có ảnh',\n preview: 'Xem trước',\n previewDescription: 'Kết quả hiển thị có thể thay đổi tuỳ theo nội dung và công cụ tìm kiếm.',\n tooLong: 'Quá dài',\n tooShort: 'Quá ngắn',\n },\n}\n"],"names":["vi","$schema","almostThere","autoGenerate","bestPractices","characterCount","charactersLeftOver","charactersToGo","charactersTooMany","checksPassing","generateAi","good","imageAutoGenerationTip","lengthTipDescription","lengthTipTitle","missing","noImage","preview","previewDescription","tooLong","tooShort"],"mappings":"AAEA,OAAO,MAAMA,KAAgC;IAC3CC,SAAS;IACT,cAAc;QACZC,aAAa;QACbC,cAAc;QACdC,eAAe;QACfC,gBAAgB;QAChBC,oBAAoB;QACpBC,gBAAgB;QAChBC,mBAAmB;QACnBC,eAAe;QACfC,YAAY;QACZC,MAAM;QACNC,wBAAwB;QACxBC,sBACE;QACFC,gBACE;QACFC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,oBAAoB;QACpBC,SAAS;QACTC,UAAU;IACZ;AACF,EAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { DocumentInfoContext } from '@payloadcms/ui'\r\nimport type {\r\n CollectionConfig,\r\n CollectionSlug,\r\n Field,\r\n GlobalConfig,\r\n GlobalSlug,\r\n PayloadRequest,\r\n} from 'payload'\r\n\r\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\r\n\r\nexport type PartialDocumentInfoContext = Pick<\r\n DocumentInfoContext,\r\n | 'collectionSlug'\r\n | 'docPermissions'\r\n | 'globalSlug'\r\n | 'hasPublishPermission'\r\n | 'hasPublishedDoc'\r\n | 'hasSavePermission'\r\n | 'id'\r\n | 'initialData'\r\n | 'initialState'\r\n | 'preferencesKey'\r\n | 'title'\r\n | 'versionCount'\r\n>\r\n\r\nexport type GenerateTitle<T = any> = (\r\n args: {\r\n collectionConfig?: CollectionConfig\r\n doc: T\r\n globalConfig?: GlobalConfig\r\n locale?: string\r\n req: PayloadRequest\r\n } & PartialDocumentInfoContext,\r\n) => Promise<string> | string\r\n\r\nexport type GenerateDescription<T = any> = (\r\n args: {\r\n collectionConfig?: CollectionConfig\r\n doc: T\r\n globalConfig?: GlobalConfig\r\n locale?: string\r\n req: PayloadRequest\r\n } & PartialDocumentInfoContext,\r\n) => Promise<string> | string\r\n\r\nexport type GenerateImage<T = any> = (\r\n args: {\r\n collectionConfig?: CollectionConfig\r\n doc: T\r\n globalConfig?: GlobalConfig\r\n locale?: string\r\n req: PayloadRequest\r\n } & PartialDocumentInfoContext,\r\n) => Promise<string> | string\r\n\r\nexport type GenerateURL<T = any> = (\r\n args: {\r\n collectionConfig?: CollectionConfig\r\n doc: T\r\n globalConfig?: GlobalConfig\r\n locale?: string\r\n req: PayloadRequest\r\n } & PartialDocumentInfoContext,\r\n) => Promise<string> | string\r\n\r\nexport type SEOPluginConfig = {\r\n /**\r\n * Collections to include the SEO fields in\r\n */\r\n collections?: CollectionSlug[]\r\n /**\r\n * Override the default fields inserted by the SEO plugin via a function that receives the default fields and returns the new fields\r\n *\r\n * If you need more flexibility you can insert the fields manually as needed. @link https://payloadcms.com/docs/plugins/seo#direct-use-of-fields\r\n */\r\n fields?: FieldsOverride\r\n generateDescription?: GenerateDescription\r\n generateDescriptionAi?: GenerateDescription\r\n generateImage?: GenerateImage\r\n generateTitle?: GenerateTitle\r\n generateTitleAi?: GenerateTitle\r\n /**\r\n *\r\n */\r\n generateURL?: GenerateURL\r\n /**\r\n * Globals to include the SEO fields in\r\n */\r\n globals?: GlobalSlug[]\r\n interfaceName?: string\r\n /**\r\n * OpenAI API key for generating descriptions and titles\r\n * @link https://platform.openai.com/docs/guides/authentication\r\n */\r\n openaiApiKey?: string\r\n /**\r\n * Group fields into tabs, your content will be automatically put into a general tab and the SEO fields into an SEO tab\r\n *\r\n * If you need more flexibility you can insert the fields manually as needed. @link https://payloadcms.com/docs/plugins/seo#direct-use-of-fields\r\n */\r\n tabbedUI?: boolean\r\n\r\n /**\r\n * The slug of the collection used to handle image uploads\r\n */\r\n uploadsCollection?: CollectionSlug\r\n}\r\n\r\nexport type Meta = {\r\n description?: string\r\n image?: any // TODO: type this\r\n keywords?: string\r\n title?: string\r\n}\r\n"],"names":[],"mappings":"AA+GA,WAKC"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { DocumentInfoContext } from '@payloadcms/ui'\nimport type {\n CollectionConfig,\n CollectionSlug,\n Field,\n GlobalConfig,\n GlobalSlug,\n PayloadRequest,\n} from 'payload'\n\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\n\nexport type PartialDocumentInfoContext = Pick<\n DocumentInfoContext,\n | 'collectionSlug'\n | 'docPermissions'\n | 'globalSlug'\n | 'hasPublishPermission'\n | 'hasPublishedDoc'\n | 'hasSavePermission'\n | 'id'\n | 'initialData'\n | 'initialState'\n | 'preferencesKey'\n | 'title'\n | 'versionCount'\n>\n\nexport type GenerateTitle<T = any> = (\n args: {\n collectionConfig?: CollectionConfig\n doc: T\n globalConfig?: GlobalConfig\n locale?: string\n req: PayloadRequest\n } & PartialDocumentInfoContext,\n) => Promise<string> | string\n\nexport type GenerateDescription<T = any> = (\n args: {\n collectionConfig?: CollectionConfig\n doc: T\n globalConfig?: GlobalConfig\n locale?: string\n req: PayloadRequest\n } & PartialDocumentInfoContext,\n) => Promise<string> | string\n\nexport type GenerateImage<T = any> = (\n args: {\n collectionConfig?: CollectionConfig\n doc: T\n globalConfig?: GlobalConfig\n locale?: string\n req: PayloadRequest\n } & PartialDocumentInfoContext,\n) => Promise<string> | string\n\nexport type GenerateURL<T = any> = (\n args: {\n collectionConfig?: CollectionConfig\n doc: T\n globalConfig?: GlobalConfig\n locale?: string\n req: PayloadRequest\n } & PartialDocumentInfoContext,\n) => Promise<string> | string\n\nexport type SEOPluginConfig = {\n /**\n * Collections to include the SEO fields in\n */\n collections?: CollectionSlug[]\n /**\n * Override the default fields inserted by the SEO plugin via a function that receives the default fields and returns the new fields\n *\n * If you need more flexibility you can insert the fields manually as needed. @link https://payloadcms.com/docs/plugins/seo#direct-use-of-fields\n */\n fields?: FieldsOverride\n generateDescription?: GenerateDescription\n generateDescriptionAi?: GenerateDescription\n generateImage?: GenerateImage\n generateTitle?: GenerateTitle\n generateTitleAi?: GenerateTitle\n /**\n *\n */\n generateURL?: GenerateURL\n /**\n * Globals to include the SEO fields in\n */\n globals?: GlobalSlug[]\n interfaceName?: string\n /**\n * OpenAI API key for generating descriptions and titles\n * @link https://platform.openai.com/docs/guides/authentication\n */\n openaiApiKey?: string\n /**\n * Group fields into tabs, your content will be automatically put into a general tab and the SEO fields into an SEO tab\n *\n * If you need more flexibility you can insert the fields manually as needed. @link https://payloadcms.com/docs/plugins/seo#direct-use-of-fields\n */\n tabbedUI?: boolean\n\n /**\n * The slug of the collection used to handle image uploads\n */\n uploadsCollection?: CollectionSlug\n}\n\nexport type Meta = {\n description?: string\n image?: any // TODO: type this\n keywords?: string\n title?: string\n}\n"],"names":[],"mappings":"AA+GA,WAKC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/LengthIndicator.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { useTranslation } from '@payloadcms/ui'\r\nimport React, { Fragment, useEffect, useState } from 'react'\r\n\r\nimport type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'\r\nimport { Pill } from './Pill.js'\r\n\r\nexport const LengthIndicator: React.FC<{\r\n maxLength?: number\r\n minLength?: number\r\n text?: string\r\n}> = (props) => {\r\n const { maxLength = 0, minLength = 0, text } = props\r\n\r\n const [labelStyle, setLabelStyle] = useState({\r\n backgroundColor: '',\r\n color: '',\r\n })\r\n\r\n const [label, setLabel] = useState('')\r\n\r\n const [barWidth, setBarWidth] = useState<number>(0)\r\n\r\n const { t } = useTranslation<PluginSEOTranslations, PluginSEOTranslationKeys>()\r\n\r\n useEffect(() => {\r\n const textLength = text?.length || 0\r\n\r\n if (textLength === 0) {\r\n setLabel(t('plugin-seo:missing'))\r\n setLabelStyle({\r\n backgroundColor: 'red',\r\n color: 'white',\r\n })\r\n setBarWidth(0)\r\n } else {\r\n const progress = (textLength - minLength) / (maxLength - minLength)\r\n\r\n if (progress < 0) {\r\n const ratioUntilMin = textLength / minLength\r\n\r\n if (ratioUntilMin > 0.9) {\r\n setLabel(t('plugin-seo:almostThere'))\r\n setLabelStyle({\r\n backgroundColor: 'orange',\r\n color: 'white',\r\n })\r\n } else {\r\n setLabel(t('plugin-seo:tooShort'))\r\n setLabelStyle({\r\n backgroundColor: 'orangered',\r\n color: 'white',\r\n })\r\n }\r\n\r\n setBarWidth(ratioUntilMin)\r\n }\r\n\r\n if (progress >= 0 && progress <= 1) {\r\n setLabel(t('plugin-seo:good'))\r\n setLabelStyle({\r\n backgroundColor: 'green',\r\n color: 'white',\r\n })\r\n setBarWidth(progress)\r\n }\r\n\r\n if (progress > 1) {\r\n setLabel(t('plugin-seo:tooLong'))\r\n setLabelStyle({\r\n backgroundColor: 'red',\r\n color: 'white',\r\n })\r\n setBarWidth(1)\r\n }\r\n }\r\n }, [minLength, maxLength, text, t])\r\n\r\n const textLength = text?.length || 0\r\n\r\n const charsUntilMax = maxLength - textLength\r\n\r\n const charsUntilMin = minLength - textLength\r\n\r\n return (\r\n <div\r\n style={{\r\n alignItems: 'center',\r\n display: 'flex',\r\n width: '100%',\r\n }}\r\n >\r\n <Pill backgroundColor={labelStyle.backgroundColor} color={labelStyle.color} label={label} />\r\n <div\r\n style={{\r\n flexShrink: 0,\r\n lineHeight: 1,\r\n marginRight: '10px',\r\n whiteSpace: 'nowrap',\r\n }}\r\n >\r\n <small>\r\n {t('plugin-seo:characterCount', { current: text?.length || 0, maxLength, minLength })}\r\n {(textLength === 0 || charsUntilMin > 0) && (\r\n <Fragment>{t('plugin-seo:charactersToGo', { characters: charsUntilMin })}</Fragment>\r\n )}\r\n {charsUntilMin <= 0 && charsUntilMax >= 0 && (\r\n <Fragment>{t('plugin-seo:charactersLeftOver', { characters: charsUntilMax })}</Fragment>\r\n )}\r\n {charsUntilMax < 0 && (\r\n <Fragment>\r\n {t('plugin-seo:charactersTooMany', { characters: charsUntilMax * -1 })}\r\n </Fragment>\r\n )}\r\n </small>\r\n </div>\r\n <div\r\n style={{\r\n backgroundColor: '#F3F3F3',\r\n height: '2px',\r\n position: 'relative',\r\n width: '100%',\r\n }}\r\n >\r\n <div\r\n style={{\r\n backgroundColor: labelStyle.backgroundColor,\r\n height: '100%',\r\n left: 0,\r\n position: 'absolute',\r\n top: 0,\r\n width: `${barWidth * 100}%`,\r\n }}\r\n />\r\n </div>\r\n </div>\r\n )\r\n}\r\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;AAG5D,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;IAEnC,MAAM,CAACa,UAAUC,YAAY,GAAGd,SAAiB;IAEjD,MAAM,EAAEe,CAAC,EAAE,GAAGnB;IAEdG,UAAU;QACR,MAAMiB,aAAaV,MAAMW,UAAU;QAEnC,IAAID,eAAe,GAAG;YACpBJ,SAASG,EAAE;YACXP,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,SAAS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;oBACCC,OAAO;wBACLd,iBAAiBF,WAAWE,eAAe;wBAC3CyB,QAAQ;wBACRE,MAAM;wBACND,UAAU;wBACVE,KAAK;wBACLX,OAAO,GAAGb,WAAW,IAAI,CAAC,CAAC;oBAC7B;;;;;AAKV,EAAC"}
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'\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\n const [barWidth, setBarWidth] = useState<number>(0)\n\n const { t } = useTranslation<PluginSEOTranslations, PluginSEOTranslationKeys>()\n\n useEffect(() => {\n const textLength = text?.length || 0\n\n if (textLength === 0) {\n setLabel(t('plugin-seo: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\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;AAG5D,SAASC,IAAI,QAAQ,YAAW;AAEhC,OAAO,MAAMC,kBAIR,CAACC;IACJ,MAAM,EAAEC,YA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AEA,KAACzB;gBAAKQ,iBAAiBF,WAAWE,eAAe;gBAAEC,OAAOH,WAAWG,KAAK;gBAAEC,OAAOA;;0BACnF,KAACW;gBACCC,OAAO;oBACLI,YAAY;oBACZC,YAAY;oBACZC,aAAa;oBACbC,YAAY;gBACd;0BAEA,cAAA,MAACC;;wBACEhB,EAAE,6BAA6B;4BAAEiB,SAAS1B,MAAMW,UAAU;4BAAGb;4BAAWC;wBAAU;wBACjFW,CAAAA,eAAe,KAAKK,gBAAgB,CAAA,mBACpC,KAACvB;sCAAUiB,EAAE,6BAA6B;gCAAEkB,YAAYZ;4BAAc;;wBAEvEA,iBAAiB,KAAKD,iBAAiB,mBACtC,KAACtB;sCAAUiB,EAAE,iCAAiC;gCAAEkB,YAAYb;4BAAc;;wBAE3EA,gBAAgB,mBACf,KAACtB;sCACEiB,EAAE,gCAAgC;gCAAEkB,YAAYb,gBAAgB,CAAC;4BAAE;;;;;0BAK5E,KAACE;gBACCC,OAAO;oBACLd,iBAAiB;oBACjByB,QAAQ;oBACRC,UAAU;oBACVT,OAAO;gBACT;0BAEA,cAAA,KAACJ;oBACCC,OAAO;wBACLd,iBAAiBF,WAAWE,eAAe;wBAC3CyB,QAAQ;wBACRE,MAAM;wBACND,UAAU;wBACVE,KAAK;wBACLX,OAAO,GAAGb,WAAW,IAAI,CAAC,CAAC;oBAC7B;;;;;AAKV,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/Pill.tsx"],"sourcesContent":["'use client'\r\n\r\nimport React from 'react'\r\n\r\nexport const Pill: React.FC<{\r\n backgroundColor: string\r\n color: string\r\n label: string\r\n}> = (props) => {\r\n const { backgroundColor, color, label } = props\r\n\r\n return (\r\n <div\r\n style={{\r\n backgroundColor,\r\n borderRadius: '2px',\r\n color,\r\n flexShrink: 0,\r\n lineHeight: 1,\r\n marginRight: '10px',\r\n padding: '4px 6px',\r\n whiteSpace: 'nowrap',\r\n }}\r\n >\r\n <small>{label}</small>\r\n </div>\r\n )\r\n}\r\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"}
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": "@justanarthur/payload-plugin-seo",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "private": false,
5
5
  "bugs": "https://github.com/r1tsuu/payload-enchants/issues",
6
6
  "repository": "https://github.com/r1tsuu/payload-enchants",