@justanarthur/payload-plugin-seo 1.3.8 → 1.3.9
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 -16
- package/dist/defaults.js.map +1 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/fields-components.js.map +1 -1
- package/dist/exports/fields.js.map +1 -1
- package/dist/exports/types.js.map +1 -1
- package/dist/fields/MetaDescription/MetaDescriptionComponent.js.map +1 -1
- package/dist/fields/MetaDescription/index.js.map +1 -1
- package/dist/fields/MetaImage/MetaImageComponent.js.map +1 -1
- package/dist/fields/MetaImage/index.js.map +1 -1
- package/dist/fields/MetaTitle/MetaTitleComponent.js.map +1 -1
- package/dist/fields/MetaTitle/index.js.map +1 -1
- package/dist/fields/Overview/OverviewComponent.js.map +1 -1
- package/dist/fields/Overview/index.js.map +1 -1
- package/dist/fields/Preview/PreviewComponent.d.ts.map +1 -1
- package/dist/fields/Preview/PreviewComponent.js +13 -1
- package/dist/fields/Preview/PreviewComponent.js.map +1 -1
- package/dist/fields/Preview/index.js.map +1 -1
- package/dist/fields/index.scss +7 -7
- package/dist/index.js.map +1 -1
- package/dist/openai/message.js.map +1 -1
- package/dist/translations/cs.js.map +1 -1
- package/dist/translations/de.js.map +1 -1
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/es.js.map +1 -1
- package/dist/translations/fa.js.map +1 -1
- package/dist/translations/fr.js.map +1 -1
- package/dist/translations/index.js.map +1 -1
- package/dist/translations/it.js.map +1 -1
- package/dist/translations/nb.js.map +1 -1
- package/dist/translations/pl.js.map +1 -1
- package/dist/translations/ru.js.map +1 -1
- package/dist/translations/sv.js.map +1 -1
- package/dist/translations/tr.js.map +1 -1
- package/dist/translations/translation-schema.json +96 -96
- package/dist/translations/uk.js.map +1 -1
- package/dist/translations/vi.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/LengthIndicator.js.map +1 -1
- package/dist/ui/Pill.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
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,YAAY,CAAC,EAAEC,YAAY,CAAC,EAAEC,IAAI,EAAE,GAAGH;IAE/C,MAAM,CAACI,YAAYC,cAAc,GAAGR,SAAS;QAC3CS,iBAAiB;QACjBC,OAAO;IACT;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,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
|
+
{"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,GAA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B,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"}
|
package/dist/ui/Pill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/Pill.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nexport const Pill: React.FC<{\n backgroundColor: string\n color: string\n label: string\n}> = (props) => {\n const { backgroundColor, color, label } = props\n\n return (\n <div\n style={{\n backgroundColor,\n borderRadius: '2px',\n color,\n flexShrink: 0,\n lineHeight: 1,\n marginRight: '10px',\n padding: '4px 6px',\n whiteSpace: 'nowrap',\n }}\n >\n <small>{label}</small>\n </div>\n )\n}\n"],"names":["React","Pill","props","backgroundColor","color","label","div","style","borderRadius","flexShrink","lineHeight","marginRight","padding","whiteSpace","small"],"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'\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"}
|