@justanarthur/payload-plugin-seo 1.3.6
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/README.md +16 -0
- package/dist/defaults.d.ts +11 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/exports/client.d.ts +6 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/fields-components.d.ts +6 -0
- package/dist/exports/fields-components.d.ts.map +1 -0
- package/dist/exports/fields.d.ts +6 -0
- package/dist/exports/fields.d.ts.map +1 -0
- package/dist/exports/types.d.ts +2 -0
- package/dist/exports/types.d.ts.map +1 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.d.ts +9 -0
- package/dist/fields/MetaDescription/MetaDescriptionComponent.d.ts.map +1 -0
- package/dist/fields/MetaDescription/index.d.ts +16 -0
- package/dist/fields/MetaDescription/index.d.ts.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/index.d.ts +13 -0
- package/dist/fields/MetaImage/index.d.ts.map +1 -0
- package/dist/fields/MetaTitle/MetaTitleComponent.d.ts +10 -0
- package/dist/fields/MetaTitle/MetaTitleComponent.d.ts.map +1 -0
- package/dist/fields/MetaTitle/index.d.ts +16 -0
- package/dist/fields/MetaTitle/index.d.ts.map +1 -0
- package/dist/fields/Overview/OverviewComponent.d.ts +18 -0
- package/dist/fields/Overview/OverviewComponent.d.ts.map +1 -0
- package/dist/fields/Overview/index.d.ts +34 -0
- package/dist/fields/Overview/index.d.ts.map +1 -0
- package/dist/fields/Preview/PreviewComponent.d.ts +9 -0
- package/dist/fields/Preview/PreviewComponent.d.ts.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/index.scss +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/openai/message.d.ts +7 -0
- package/dist/openai/message.d.ts.map +1 -0
- package/dist/src/defaults.js +12 -0
- package/dist/src/defaults.js.map +1 -0
- package/dist/src/exports/client.js +7 -0
- package/dist/src/exports/client.js.map +1 -0
- package/dist/src/exports/fields-components.js +7 -0
- package/dist/src/exports/fields-components.js.map +1 -0
- package/dist/src/exports/fields.js +7 -0
- package/dist/src/exports/fields.js.map +1 -0
- package/dist/src/exports/types.js +3 -0
- package/dist/src/exports/types.js.map +1 -0
- package/dist/src/fields/MetaDescription/MetaDescriptionComponent.js +224 -0
- package/dist/src/fields/MetaDescription/MetaDescriptionComponent.js.map +1 -0
- package/dist/src/fields/MetaDescription/index.js +22 -0
- package/dist/src/fields/MetaDescription/index.js.map +1 -0
- package/dist/src/fields/MetaImage/MetaImageComponent.js +173 -0
- package/dist/src/fields/MetaImage/MetaImageComponent.js.map +1 -0
- package/dist/src/fields/MetaImage/index.js +24 -0
- package/dist/src/fields/MetaImage/index.js.map +1 -0
- package/dist/src/fields/MetaTitle/MetaTitleComponent.js +225 -0
- package/dist/src/fields/MetaTitle/MetaTitleComponent.js.map +1 -0
- package/dist/src/fields/MetaTitle/index.js +22 -0
- package/dist/src/fields/MetaTitle/index.js.map +1 -0
- package/dist/src/fields/Overview/OverviewComponent.js +67 -0
- package/dist/src/fields/Overview/OverviewComponent.js.map +1 -0
- package/dist/src/fields/Overview/index.js +25 -0
- package/dist/src/fields/Overview/index.js.map +1 -0
- package/dist/src/fields/Preview/PreviewComponent.js +117 -0
- package/dist/src/fields/Preview/PreviewComponent.js.map +1 -0
- package/dist/src/fields/Preview/index.js +23 -0
- package/dist/src/fields/Preview/index.js.map +1 -0
- package/dist/src/index.js +309 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/openai/message.js +28 -0
- package/dist/src/openai/message.js.map +1 -0
- package/dist/src/translations/cs.js +26 -0
- package/dist/src/translations/cs.js.map +1 -0
- package/dist/src/translations/de.js +26 -0
- package/dist/src/translations/de.js.map +1 -0
- package/dist/src/translations/en.js +27 -0
- package/dist/src/translations/en.js.map +1 -0
- package/dist/src/translations/es.js +26 -0
- package/dist/src/translations/es.js.map +1 -0
- package/dist/src/translations/fa.js +26 -0
- package/dist/src/translations/fa.js.map +1 -0
- package/dist/src/translations/fr.js +26 -0
- package/dist/src/translations/fr.js.map +1 -0
- package/dist/src/translations/index.js +30 -0
- package/dist/src/translations/index.js.map +1 -0
- package/dist/src/translations/it.js +26 -0
- package/dist/src/translations/it.js.map +1 -0
- package/dist/src/translations/nb.js +26 -0
- package/dist/src/translations/nb.js.map +1 -0
- package/dist/src/translations/pl.js +26 -0
- package/dist/src/translations/pl.js.map +1 -0
- package/dist/src/translations/ru.js +26 -0
- package/dist/src/translations/ru.js.map +1 -0
- package/dist/src/translations/sv.js +26 -0
- package/dist/src/translations/sv.js.map +1 -0
- package/dist/src/translations/tr.js +26 -0
- package/dist/src/translations/tr.js.map +1 -0
- package/dist/src/translations/uk.js +26 -0
- package/dist/src/translations/uk.js.map +1 -0
- package/dist/src/translations/vi.js +26 -0
- package/dist/src/translations/vi.js.map +1 -0
- package/dist/src/types.js +3 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/ui/LengthIndicator.js +135 -0
- package/dist/src/ui/LengthIndicator.js.map +1 -0
- package/dist/src/ui/Pill.js +23 -0
- package/dist/src/ui/Pill.js.map +1 -0
- package/dist/translations/cs.d.ts +3 -0
- package/dist/translations/cs.d.ts.map +1 -0
- package/dist/translations/de.d.ts +3 -0
- package/dist/translations/de.d.ts.map +1 -0
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.d.ts.map +1 -0
- package/dist/translations/es.d.ts +3 -0
- package/dist/translations/es.d.ts.map +1 -0
- package/dist/translations/fa.d.ts +3 -0
- package/dist/translations/fa.d.ts.map +1 -0
- package/dist/translations/fr.d.ts +3 -0
- package/dist/translations/fr.d.ts.map +1 -0
- package/dist/translations/index.d.ts +19 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/it.d.ts +3 -0
- package/dist/translations/it.d.ts.map +1 -0
- package/dist/translations/nb.d.ts +3 -0
- package/dist/translations/nb.d.ts.map +1 -0
- package/dist/translations/pl.d.ts +3 -0
- package/dist/translations/pl.d.ts.map +1 -0
- package/dist/translations/ru.d.ts +3 -0
- package/dist/translations/ru.d.ts.map +1 -0
- package/dist/translations/sv.d.ts +3 -0
- package/dist/translations/sv.d.ts.map +1 -0
- package/dist/translations/tr.d.ts +3 -0
- package/dist/translations/tr.d.ts.map +1 -0
- package/dist/translations/translation-schema.json +96 -0
- package/dist/translations/uk.d.ts +3 -0
- package/dist/translations/uk.d.ts.map +1 -0
- package/dist/translations/vi.d.ts +3 -0
- package/dist/translations/vi.d.ts.map +1 -0
- package/dist/types.d.ts +82 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/LengthIndicator.d.ts +7 -0
- package/dist/ui/LengthIndicator.d.ts.map +1 -0
- package/dist/ui/Pill.d.ts +7 -0
- package/dist/ui/Pill.d.ts.map +1 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Alternative version of official @payloadcms/plugin-seo package with AI generating improvements
|
|
2
|
+
|
|
3
|
+
[Official docs](https://payloadcms.com/docs/plugins/seo)
|
|
4
|
+
|
|
5
|
+
## List of the added options:
|
|
6
|
+
|
|
7
|
+
`openaiApiKey`
|
|
8
|
+
API key for OpenAI
|
|
9
|
+
|
|
10
|
+
`generateTitleAi`:
|
|
11
|
+
Should return prompt, example: `"Generate meta SEO title for <type of site> site in language=${data.locale}"`
|
|
12
|
+
|
|
13
|
+
`generateDescriptionAi`:
|
|
14
|
+
Should return prompt, example: "`Generate meta SEO description for <type of site> site in language=${data.locale}`"
|
|
15
|
+
|
|
16
|
+
The args are the same as `generateTitle` and `generateDescription`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;CASpB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MetaDescriptionComponent } from '../fields/MetaDescription/MetaDescriptionComponent';
|
|
2
|
+
export { MetaImageComponent } from '../fields/MetaImage/MetaImageComponent';
|
|
3
|
+
export { MetaTitleComponent } from '../fields/MetaTitle/MetaTitleComponent';
|
|
4
|
+
export { OverviewComponent } from '../fields/Overview/OverviewComponent';
|
|
5
|
+
export { PreviewComponent } from '../fields/Preview/PreviewComponent';
|
|
6
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/exports/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MetaDescriptionComponent } from '../fields/MetaDescription/MetaDescriptionComponent';
|
|
2
|
+
export { MetaImageComponent } from '../fields/MetaImage/MetaImageComponent';
|
|
3
|
+
export { MetaTitleComponent } from '../fields/MetaTitle/MetaTitleComponent';
|
|
4
|
+
export { OverviewComponent } from '../fields/Overview/OverviewComponent';
|
|
5
|
+
export { PreviewComponent } from '../fields/Preview/PreviewComponent';
|
|
6
|
+
//# sourceMappingURL=fields-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-components.d.ts","sourceRoot":"","sources":["../../src/exports/fields-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MetaDescriptionField } from '../fields/MetaDescription';
|
|
2
|
+
export { MetaImageField } from '../fields/MetaImage';
|
|
3
|
+
export { MetaTitleField } from '../fields/MetaTitle';
|
|
4
|
+
export { OverviewField } from '../fields/Overview';
|
|
5
|
+
export { PreviewField } from '../fields/Preview';
|
|
6
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/exports/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,WAAW,EACX,IAAI,EACJ,eAAe,GAChB,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TextareaFieldClientProps } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type MetaDescriptionProps = {
|
|
4
|
+
readonly hasGenerateDescriptionAi: boolean;
|
|
5
|
+
readonly hasGenerateDescriptionFn: boolean;
|
|
6
|
+
} & TextareaFieldClientProps;
|
|
7
|
+
export declare const MetaDescriptionComponent: React.FC<MetaDescriptionProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=MetaDescriptionComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetaDescriptionComponent.d.ts","sourceRoot":"","sources":["../../../src/fields/MetaDescription/MetaDescriptionComponent.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAS1C,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAA;IAC1C,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAA;CAC3C,GAAG,wBAAwB,CAAA;AAE5B,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwPnE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TextareaField } from 'payload';
|
|
2
|
+
type FieldFunctionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Tell the component if the generate AI function is available as configured in the plugin config
|
|
5
|
+
*/
|
|
6
|
+
hasGenerateAi?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Tell the component if the generate function is available as configured in the plugin config
|
|
9
|
+
*/
|
|
10
|
+
hasGenerateFn?: boolean;
|
|
11
|
+
overrides?: Omit<Partial<TextareaField>, 'admin'>;
|
|
12
|
+
};
|
|
13
|
+
type FieldFunction = ({ hasGenerateAi, hasGenerateFn, overrides, }: FieldFunctionProps) => TextareaField;
|
|
14
|
+
export declare const MetaDescriptionField: FieldFunction;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/MetaDescription/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,CAAA;CAClD,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,EACpB,aAAa,EACb,aAAa,EACb,SAAS,GACV,EAAE,kBAAkB,KAAK,aAAa,CAAA;AAEvC,eAAO,MAAM,oBAAoB,EAAE,aAsBlC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UploadFieldClientProps } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type MetaImageProps = {
|
|
4
|
+
readonly hasGenerateImageFn: boolean;
|
|
5
|
+
} & UploadFieldClientProps;
|
|
6
|
+
export declare const MetaImageComponent: React.FC<MetaImageProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=MetaImageComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetaImageComponent.d.ts","sourceRoot":"","sources":["../../../src/fields/MetaImage/MetaImageComponent.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAM1C,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;CACrC,GAAG,sBAAsB,CAAA;AAE1B,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAsMvD,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UploadField } from 'payload';
|
|
2
|
+
type FieldFunctionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Tell the component if the generate function is available as configured in the plugin config
|
|
5
|
+
*/
|
|
6
|
+
hasGenerateFn?: boolean;
|
|
7
|
+
overrides?: Partial<UploadField>;
|
|
8
|
+
relationTo: string;
|
|
9
|
+
};
|
|
10
|
+
type FieldFunction = ({ hasGenerateFn, overrides }: FieldFunctionProps) => UploadField;
|
|
11
|
+
export declare const MetaImageField: FieldFunction;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/MetaImage/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1D,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,kBAAkB,KAAK,WAAW,CAAA;AAEtF,eAAO,MAAM,cAAc,EAAE,aAoB5B,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '../index.scss';
|
|
2
|
+
import type { TextFieldClientProps } from 'payload';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
type MetaTitleProps = {
|
|
5
|
+
readonly hasGenerateTitleAi: boolean;
|
|
6
|
+
readonly hasGenerateTitleFn: boolean;
|
|
7
|
+
} & TextFieldClientProps;
|
|
8
|
+
export declare const MetaTitleComponent: React.FC<MetaTitleProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=MetaTitleComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetaTitleComponent.d.ts","sourceRoot":"","sources":["../../../src/fields/MetaTitle/MetaTitleComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AActB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAS1C,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;IACpC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;CACrC,GAAG,oBAAoB,CAAA;AAExB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA+OvD,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TextField } from 'payload';
|
|
2
|
+
type FieldFunctionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Tell the component if the generate AI function is available as configured in the plugin config
|
|
5
|
+
*/
|
|
6
|
+
hasGenerateAi?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Tell the component if the generate function is available as configured in the plugin config
|
|
9
|
+
*/
|
|
10
|
+
hasGenerateFn?: boolean;
|
|
11
|
+
overrides?: Partial<TextField>;
|
|
12
|
+
};
|
|
13
|
+
type FieldFunction = ({ hasGenerateAi, hasGenerateFn, overrides }: FieldFunctionProps) => TextField;
|
|
14
|
+
export declare const MetaTitleField: FieldFunction;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/MetaTitle/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC/B,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,kBAAkB,KAAK,SAAS,CAAA;AAEnG,eAAO,MAAM,cAAc,EAAE,aAsB5B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UIField } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type OverviewProps = {
|
|
4
|
+
descriptionOverrides?: {
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
minLength?: number;
|
|
7
|
+
};
|
|
8
|
+
descriptionPath?: string;
|
|
9
|
+
imagePath?: string;
|
|
10
|
+
titleOverrides?: {
|
|
11
|
+
maxLength?: number;
|
|
12
|
+
minLength?: number;
|
|
13
|
+
};
|
|
14
|
+
titlePath?: string;
|
|
15
|
+
} & UIField;
|
|
16
|
+
export declare const OverviewComponent: React.FC<OverviewProps>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=OverviewComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverviewComponent.d.ts","sourceRoot":"","sources":["../../../src/fields/Overview/OverviewComponent.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,KAA2C,MAAM,OAAO,CAAA;AAU/D,KAAK,aAAa,GAAG;IACnB,oBAAoB,CAAC,EAAE;QACrB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAA;AAEX,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8ErD,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { UIField } from 'payload';
|
|
2
|
+
type FieldFunctionProps = {
|
|
3
|
+
descriptionOverrides?: {
|
|
4
|
+
maxLength?: number;
|
|
5
|
+
minLength?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Path to the description field to use for the preview
|
|
9
|
+
*
|
|
10
|
+
* @default 'meta.description'
|
|
11
|
+
*/
|
|
12
|
+
descriptionPath?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Path to the image field to use for the preview
|
|
15
|
+
*
|
|
16
|
+
* @default 'meta.image'
|
|
17
|
+
*/
|
|
18
|
+
imagePath?: string;
|
|
19
|
+
overrides?: Partial<UIField>;
|
|
20
|
+
titleOverrides?: {
|
|
21
|
+
maxLength?: number;
|
|
22
|
+
minLength?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Path to the title field to use for the preview
|
|
26
|
+
*
|
|
27
|
+
* @default 'meta.title'
|
|
28
|
+
*/
|
|
29
|
+
titlePath?: string;
|
|
30
|
+
};
|
|
31
|
+
type FieldFunction = ({ overrides }: FieldFunctionProps) => UIField;
|
|
32
|
+
export declare const OverviewField: FieldFunction;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Overview/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,KAAK,kBAAkB,GAAG;IACxB,oBAAoB,CAAC,EAAE;QACrB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5B,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAA;AAEnE,eAAO,MAAM,aAAa,EAAE,aA4B3B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UIField } from 'payload';
|
|
2
|
+
type PreviewProps = {
|
|
3
|
+
readonly descriptionPath?: string;
|
|
4
|
+
readonly hasGenerateURLFn: boolean;
|
|
5
|
+
readonly titlePath?: string;
|
|
6
|
+
} & UIField;
|
|
7
|
+
export declare const PreviewComponent: React.FC<PreviewProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=PreviewComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewComponent.d.ts","sourceRoot":"","sources":["../../../src/fields/Preview/PreviewComponent.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,SAAS,CAAA;AAMjD,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,GAAG,OAAO,CAAA;AAEX,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAwInD,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { UIField } from 'payload';
|
|
2
|
+
type FieldFunctionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Path to the description field to use for the preview
|
|
5
|
+
*
|
|
6
|
+
* @default 'meta.description'
|
|
7
|
+
*/
|
|
8
|
+
descriptionPath?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Tell the component if the generate function is available as configured in the plugin config
|
|
11
|
+
*/
|
|
12
|
+
hasGenerateFn?: boolean;
|
|
13
|
+
overrides?: Partial<UIField>;
|
|
14
|
+
/**
|
|
15
|
+
* Path to the title field to use for the preview
|
|
16
|
+
*
|
|
17
|
+
* @default 'meta.title'
|
|
18
|
+
*/
|
|
19
|
+
titlePath?: string;
|
|
20
|
+
};
|
|
21
|
+
type FieldFunction = ({ hasGenerateFn, overrides }: FieldFunctionProps) => UIField;
|
|
22
|
+
export declare const PreviewField: FieldFunction;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Preview/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,KAAK,kBAAkB,GAAG;IACxB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAA;AAElF,eAAO,MAAM,YAAY,EAAE,aAwB1B,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,MAAM,EAA4C,MAAM,SAAS,CAAA;AAU/F,OAAO,KAAK,EAKV,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,SAAS,GACnB,cAAc,eAAe,MAC7B,QAAQ,MAAM,KAAG,MAsXjB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/openai/message.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAM7C,eAAO,MAAM,aAAa,GAAU,2BAIjC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,cAAc,CAAA;CACpB,oBA4BA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/defaults.ts"],"sourcesContent":["export const defaults = {\n description: {\n maxLength: 150,\n minLength: 100,\n },\n title: {\n maxLength: 60,\n minLength: 50,\n },\n}\n"],"names":["defaults","description","maxLength","minLength","title"],"mappings":"AAAA,OAAO,MAAMA,WAAW;IACtBC,aAAa;QACXC,WAAW;QACXC,WAAW;IACb;IACAC,OAAO;QACLF,WAAW;QACXC,WAAW;IACb;AACF,EAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { MetaDescriptionComponent } from '../fields/MetaDescription/MetaDescriptionComponent';
|
|
2
|
+
export { MetaImageComponent } from '../fields/MetaImage/MetaImageComponent';
|
|
3
|
+
export { MetaTitleComponent } from '../fields/MetaTitle/MetaTitleComponent';
|
|
4
|
+
export { OverviewComponent } from '../fields/Overview/OverviewComponent';
|
|
5
|
+
export { PreviewComponent } from '../fields/Preview/PreviewComponent';
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/exports/client.ts"],"sourcesContent":["export { MetaDescriptionComponent } from '../fields/MetaDescription/MetaDescriptionComponent'\nexport { MetaImageComponent } from '../fields/MetaImage/MetaImageComponent'\nexport { MetaTitleComponent } from '../fields/MetaTitle/MetaTitleComponent'\nexport { OverviewComponent } from '../fields/Overview/OverviewComponent'\nexport { PreviewComponent } from '../fields/Preview/PreviewComponent'\n"],"names":["MetaDescriptionComponent","MetaImageComponent","MetaTitleComponent","OverviewComponent","PreviewComponent"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,qDAAoD;AAC7F,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,gBAAgB,QAAQ,qCAAoC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { MetaDescriptionComponent } from '../fields/MetaDescription/MetaDescriptionComponent';
|
|
2
|
+
export { MetaImageComponent } from '../fields/MetaImage/MetaImageComponent';
|
|
3
|
+
export { MetaTitleComponent } from '../fields/MetaTitle/MetaTitleComponent';
|
|
4
|
+
export { OverviewComponent } from '../fields/Overview/OverviewComponent';
|
|
5
|
+
export { PreviewComponent } from '../fields/Preview/PreviewComponent';
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=fields-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/exports/fields-components.ts"],"sourcesContent":["export { MetaDescriptionComponent } from '../fields/MetaDescription/MetaDescriptionComponent'\nexport { MetaImageComponent } from '../fields/MetaImage/MetaImageComponent'\nexport { MetaTitleComponent } from '../fields/MetaTitle/MetaTitleComponent'\nexport { OverviewComponent } from '../fields/Overview/OverviewComponent'\nexport { PreviewComponent } from '../fields/Preview/PreviewComponent'\n"],"names":["MetaDescriptionComponent","MetaImageComponent","MetaTitleComponent","OverviewComponent","PreviewComponent"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,qDAAoD;AAC7F,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,gBAAgB,QAAQ,qCAAoC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { MetaDescriptionField } from '../fields/MetaDescription';
|
|
2
|
+
export { MetaImageField } from '../fields/MetaImage';
|
|
3
|
+
export { MetaTitleField } from '../fields/MetaTitle';
|
|
4
|
+
export { OverviewField } from '../fields/Overview';
|
|
5
|
+
export { PreviewField } from '../fields/Preview';
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/exports/fields.ts"],"sourcesContent":["export { MetaDescriptionField } from '../fields/MetaDescription'\nexport { MetaImageField } from '../fields/MetaImage'\nexport { MetaTitleField } from '../fields/MetaTitle'\nexport { OverviewField } from '../fields/Overview'\nexport { PreviewField } from '../fields/Preview'\n"],"names":["MetaDescriptionField","MetaImageField","MetaTitleField","OverviewField","PreviewField"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,YAAY,QAAQ,oBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/exports/types.ts"],"sourcesContent":["export type {\n GenerateDescription,\n GenerateImage,\n GenerateTitle,\n GenerateURL,\n Meta,\n SEOPluginConfig,\n} from '../types'\n"],"names":[],"mappings":"AAAA,WAOiB"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { FieldLabel, TextareaInput, useConfig, useDocumentInfo, useField, useForm, useLocale, useTranslation } from '@payloadcms/ui';
|
|
4
|
+
import { reduceToSerializableFields } from '@payloadcms/ui/shared';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
import { defaults } from '../../defaults';
|
|
7
|
+
import { LengthIndicator } from '../../ui/LengthIndicator';
|
|
8
|
+
const { maxLength: maxLengthDefault, minLength: minLengthDefault } = defaults.description;
|
|
9
|
+
export const MetaDescriptionComponent = (props)=>{
|
|
10
|
+
const { field: { label, localized, maxLength: maxLengthFromProps, minLength: minLengthFromProps, required }, hasGenerateDescriptionAi, hasGenerateDescriptionFn, path, readOnly } = props;
|
|
11
|
+
const { config: { routes: { api }, serverURL } } = useConfig();
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const locale = useLocale();
|
|
14
|
+
const { getData } = useForm();
|
|
15
|
+
const docInfo = useDocumentInfo();
|
|
16
|
+
const maxLength = maxLengthFromProps || maxLengthDefault;
|
|
17
|
+
const minLength = minLengthFromProps || minLengthDefault;
|
|
18
|
+
const { customComponents, errorMessage, setValue, showError, value } = useField({
|
|
19
|
+
path
|
|
20
|
+
});
|
|
21
|
+
const { AfterInput, BeforeInput, Label } = customComponents || {};
|
|
22
|
+
const regenerateDescription = useCallback(async ()=>{
|
|
23
|
+
if (!hasGenerateDescriptionFn) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const endpoint = `${serverURL}${api}/plugin-seo/generate-description`;
|
|
27
|
+
const genDescriptionResponse = await fetch(endpoint, {
|
|
28
|
+
body: JSON.stringify({
|
|
29
|
+
collectionSlug: docInfo.collectionSlug,
|
|
30
|
+
doc: getData(),
|
|
31
|
+
docPermissions: docInfo.docPermissions,
|
|
32
|
+
globalSlug: docInfo.globalSlug,
|
|
33
|
+
hasPublishPermission: docInfo.hasPublishPermission,
|
|
34
|
+
hasSavePermission: docInfo.hasSavePermission,
|
|
35
|
+
id: docInfo.id,
|
|
36
|
+
initialData: docInfo.initialData,
|
|
37
|
+
initialState: docInfo.initialState ? reduceToSerializableFields(docInfo.initialState) : undefined,
|
|
38
|
+
locale: typeof locale === 'object' ? locale?.code : locale,
|
|
39
|
+
title: docInfo.title
|
|
40
|
+
}),
|
|
41
|
+
credentials: 'include',
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json'
|
|
44
|
+
},
|
|
45
|
+
method: 'POST'
|
|
46
|
+
});
|
|
47
|
+
const { result: generatedDescription } = await genDescriptionResponse.json();
|
|
48
|
+
setValue(generatedDescription || '');
|
|
49
|
+
}, [
|
|
50
|
+
hasGenerateDescriptionFn,
|
|
51
|
+
serverURL,
|
|
52
|
+
api,
|
|
53
|
+
docInfo.id,
|
|
54
|
+
docInfo.collectionSlug,
|
|
55
|
+
docInfo.docPermissions,
|
|
56
|
+
docInfo.globalSlug,
|
|
57
|
+
docInfo.hasPublishPermission,
|
|
58
|
+
docInfo.hasSavePermission,
|
|
59
|
+
docInfo.initialData,
|
|
60
|
+
docInfo.initialState,
|
|
61
|
+
docInfo.title,
|
|
62
|
+
getData,
|
|
63
|
+
locale,
|
|
64
|
+
setValue
|
|
65
|
+
]);
|
|
66
|
+
const regenerateDescriptionAi = useCallback(async ()=>{
|
|
67
|
+
if (!hasGenerateDescriptionAi) return;
|
|
68
|
+
const genDescriptionResponse = await fetch('/api/plugin-seo/generate-description-ai', {
|
|
69
|
+
body: JSON.stringify({
|
|
70
|
+
collectionSlug: docInfo.collectionSlug,
|
|
71
|
+
doc: getData(),
|
|
72
|
+
docPermissions: docInfo.docPermissions,
|
|
73
|
+
globalSlug: docInfo.globalSlug,
|
|
74
|
+
hasPublishPermission: docInfo.hasPublishPermission,
|
|
75
|
+
hasSavePermission: docInfo.hasSavePermission,
|
|
76
|
+
id: docInfo.id,
|
|
77
|
+
initialData: docInfo.initialData,
|
|
78
|
+
initialState: docInfo.initialState ? reduceToSerializableFields(docInfo.initialState) : undefined,
|
|
79
|
+
locale: typeof locale === 'object' ? locale?.code : locale,
|
|
80
|
+
title: docInfo.title
|
|
81
|
+
}),
|
|
82
|
+
credentials: 'include',
|
|
83
|
+
headers: {
|
|
84
|
+
'Content-Type': 'application/json'
|
|
85
|
+
},
|
|
86
|
+
method: 'POST'
|
|
87
|
+
});
|
|
88
|
+
const { result: generatedDescription } = await genDescriptionResponse.json();
|
|
89
|
+
setValue(generatedDescription || '');
|
|
90
|
+
}, [
|
|
91
|
+
setValue,
|
|
92
|
+
hasGenerateDescriptionAi,
|
|
93
|
+
locale,
|
|
94
|
+
docInfo.id,
|
|
95
|
+
docInfo.collectionSlug,
|
|
96
|
+
docInfo.docPermissions,
|
|
97
|
+
docInfo.globalSlug,
|
|
98
|
+
docInfo.hasPublishPermission,
|
|
99
|
+
docInfo.hasSavePermission,
|
|
100
|
+
docInfo.initialData,
|
|
101
|
+
docInfo.initialState,
|
|
102
|
+
docInfo.title,
|
|
103
|
+
getData
|
|
104
|
+
]);
|
|
105
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
106
|
+
style: {
|
|
107
|
+
marginBottom: '20px'
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
111
|
+
style: {
|
|
112
|
+
marginBottom: '5px',
|
|
113
|
+
position: 'relative'
|
|
114
|
+
},
|
|
115
|
+
children: [
|
|
116
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
117
|
+
className: "plugin-seo__field",
|
|
118
|
+
children: [
|
|
119
|
+
Label ?? /*#__PURE__*/ _jsx(FieldLabel, {
|
|
120
|
+
label: label,
|
|
121
|
+
localized: localized,
|
|
122
|
+
path: path,
|
|
123
|
+
required: required
|
|
124
|
+
}),
|
|
125
|
+
hasGenerateDescriptionFn && /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
126
|
+
children: [
|
|
127
|
+
" — ",
|
|
128
|
+
/*#__PURE__*/ _jsx("button", {
|
|
129
|
+
disabled: readOnly,
|
|
130
|
+
onClick: ()=>{
|
|
131
|
+
void regenerateDescription();
|
|
132
|
+
},
|
|
133
|
+
style: {
|
|
134
|
+
background: 'none',
|
|
135
|
+
backgroundColor: 'transparent',
|
|
136
|
+
border: 'none',
|
|
137
|
+
color: 'currentcolor',
|
|
138
|
+
cursor: 'pointer',
|
|
139
|
+
padding: 0,
|
|
140
|
+
textDecoration: 'underline'
|
|
141
|
+
},
|
|
142
|
+
type: "button",
|
|
143
|
+
children: t('plugin-seo:autoGenerate')
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
}),
|
|
147
|
+
hasGenerateDescriptionAi && /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
148
|
+
children: [
|
|
149
|
+
" — ",
|
|
150
|
+
/*#__PURE__*/ _jsx("button", {
|
|
151
|
+
disabled: readOnly,
|
|
152
|
+
onClick: regenerateDescriptionAi,
|
|
153
|
+
style: {
|
|
154
|
+
background: 'none',
|
|
155
|
+
backgroundColor: 'transparent',
|
|
156
|
+
border: 'none',
|
|
157
|
+
color: 'currentcolor',
|
|
158
|
+
cursor: 'pointer',
|
|
159
|
+
padding: 0,
|
|
160
|
+
textDecoration: 'underline'
|
|
161
|
+
},
|
|
162
|
+
type: "button",
|
|
163
|
+
children: t('plugin-seo:generateAi')
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
}),
|
|
169
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
170
|
+
style: {
|
|
171
|
+
color: '#9A9A9A'
|
|
172
|
+
},
|
|
173
|
+
children: [
|
|
174
|
+
t('plugin-seo:lengthTipDescription', {
|
|
175
|
+
maxLength,
|
|
176
|
+
minLength
|
|
177
|
+
}),
|
|
178
|
+
/*#__PURE__*/ _jsx("a", {
|
|
179
|
+
href: "https://developers.google.com/search/docs/advanced/appearance/snippet#meta-descriptions",
|
|
180
|
+
rel: "noopener noreferrer",
|
|
181
|
+
target: "_blank",
|
|
182
|
+
children: t('plugin-seo:bestPractices')
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
}),
|
|
188
|
+
/*#__PURE__*/ _jsx("div", {
|
|
189
|
+
style: {
|
|
190
|
+
marginBottom: '10px',
|
|
191
|
+
position: 'relative'
|
|
192
|
+
},
|
|
193
|
+
children: /*#__PURE__*/ _jsx(TextareaInput, {
|
|
194
|
+
AfterInput: AfterInput,
|
|
195
|
+
BeforeInput: BeforeInput,
|
|
196
|
+
Error: errorMessage,
|
|
197
|
+
onChange: setValue,
|
|
198
|
+
path: path,
|
|
199
|
+
readOnly: readOnly,
|
|
200
|
+
required: required,
|
|
201
|
+
showError: showError,
|
|
202
|
+
style: {
|
|
203
|
+
marginBottom: 0
|
|
204
|
+
},
|
|
205
|
+
value: value
|
|
206
|
+
})
|
|
207
|
+
}),
|
|
208
|
+
/*#__PURE__*/ _jsx("div", {
|
|
209
|
+
style: {
|
|
210
|
+
alignItems: 'center',
|
|
211
|
+
display: 'flex',
|
|
212
|
+
width: '100%'
|
|
213
|
+
},
|
|
214
|
+
children: /*#__PURE__*/ _jsx(LengthIndicator, {
|
|
215
|
+
maxLength: maxLength,
|
|
216
|
+
minLength: minLength,
|
|
217
|
+
text: value
|
|
218
|
+
})
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
//# sourceMappingURL=MetaDescriptionComponent.js.map
|