axyseo 2.0.0-alpha.0.0.28.3 → 2.0.0-alpha.0.0.29

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.
@@ -54,7 +54,6 @@ class RelatedKeywordsAssessment extends _assessment.default {
54
54
  words,
55
55
  isWordUsedExceeding
56
56
  } = relatedKeywords;
57
- console.log('relatedKeywords', data, relatedKeywords);
58
57
  let status = 'good';
59
58
  if (!data?.related_keywords?.length || totalWordUsed <= 0) {
60
59
  status = 'bad';
@@ -67,7 +66,7 @@ class RelatedKeywordsAssessment extends _assessment.default {
67
66
  score,
68
67
  status,
69
68
  body: /*#__PURE__*/_react.default.createElement(_polaris.BlockStack, {
70
- gap: 100
69
+ gap: 200
71
70
  }, /*#__PURE__*/_react.default.createElement(_polaris.Text, {
72
71
  as: 'span'
73
72
  }, this._config.content[status], ' ', this._config.docUrl && /*#__PURE__*/_react.default.createElement("a", {
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedKeywordsAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_AssessmentResult","_assessment","_RelatedKeywordsDescription","_polaris","e","__esModule","default","RelatedKeywordsAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","merge","calculateResult","data","relatedKeywords","i18n","totalWordUsed","words","isWordUsedExceeding","console","log","status","related_keywords","length","score","getScore","body","createElement","BlockStack","gap","Text","as","href","target","rel","translate","getResult","paper","researcher","getResearch","getData","result","assessmentResult","AssessmentResult","setScore","setStatus","setBody","isApplicable","hasRelatedKeywords","exports"],"sources":["../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\n\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\nimport RelatedKeywordsDescription from '@axyseo/components/RelatedKeywordsDescription';\nimport {BlockStack, Text} from '@shopify/polaris';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'relatedKeywords',\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#duplicate-title',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keyword density is optimized',\n bad:\n 'Consider using at least a related keyword in your page to establish topical relevance.',\n improve: 'Too high related keyword density. Keep related keyword density from 0.5% - 1%.'\n }\n };\n\n this.identifier = 'relatedKeywords';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(data, relatedKeywords, i18n) {\n const {totalWordUsed, words, isWordUsedExceeding} = relatedKeywords;\n console.log('relatedKeywords', data, relatedKeywords);\n let status = 'good';\n if (!data?.related_keywords?.length || totalWordUsed <= 0) {\n status = 'bad';\n }\n\n if (isWordUsedExceeding) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <BlockStack gap={100}>\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n <RelatedKeywordsDescription {...{words, i18n}} />\n </BlockStack>\n )\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n\n const result = this.calculateResult(data, relatedKeywords, i18n);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setBody(result.body);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return paper.hasRelatedKeywords();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,2BAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAkD,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElD;AACA;AACA;AACe,MAAMG,yBAAyB,SAASC,mBAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,iBAAiB;MACrBC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,6FAA6F;MAC/FC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,kBAAkB;MACzBC,OAAO,EAAE;QACPC,IAAI,EAAE,sCAAsC;QAC5CC,GAAG,EACD,wFAAwF;QAC1FC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,iBAAiB;IACnC,IAAI,CAACC,OAAO,GAAG,IAAAC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A0B;QAAMwB,KAAK;QAAEF;MAAI,CAAI,CACtC;IAEhB,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEqB,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEvB;EAAI,CAAC,EAAE;IACnC,MAAMD,eAAe,GAAGwB,UAAU,CAACC,WAAW,CAAC,sBAAsB,CAAC;IACtE,MAAM1B,IAAI,GAAGwB,KAAK,CAACG,OAAO,CAAC,CAAC;IAE5B,MAAMC,MAAM,GAAG,IAAI,CAAC7B,eAAe,CAACC,IAAI,EAAEC,eAAe,EAAEC,IAAI,CAAC;IAChE,MAAM2B,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC9C,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErEgC,gBAAgB,CAACE,QAAQ,CAACH,MAAM,CAACjB,KAAK,CAAC;IACvCkB,gBAAgB,CAACG,SAAS,CAACJ,MAAM,CAACpB,MAAM,CAAC;IACzCqB,gBAAgB,CAACI,OAAO,CAACL,MAAM,CAACf,IAAI,CAAC;IAErC,OAAOgB,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,YAAYA,CAACV,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAACW,kBAAkB,CAAC,CAAC;EACnC;AACF;AAACC,OAAA,CAAAxD,OAAA,GAAAC,yBAAA","ignoreList":[]}
1
+ {"version":3,"file":"RelatedKeywordsAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_AssessmentResult","_assessment","_RelatedKeywordsDescription","_polaris","e","__esModule","default","RelatedKeywordsAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","merge","calculateResult","data","relatedKeywords","i18n","totalWordUsed","words","isWordUsedExceeding","status","related_keywords","length","score","getScore","body","createElement","BlockStack","gap","Text","as","href","target","rel","translate","getResult","paper","researcher","getResearch","getData","result","assessmentResult","AssessmentResult","setScore","setStatus","setBody","isApplicable","hasRelatedKeywords","exports"],"sources":["../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\n\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\nimport RelatedKeywordsDescription from '@axyseo/components/RelatedKeywordsDescription';\nimport {BlockStack, Text} from '@shopify/polaris';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'relatedKeywords',\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#duplicate-title',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keyword density is optimized',\n bad:\n 'Consider using at least a related keyword in your page to establish topical relevance.',\n improve: 'Too high related keyword density. Keep related keyword density from 0.5% - 1%.'\n }\n };\n\n this.identifier = 'relatedKeywords';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(data, relatedKeywords, i18n) {\n const {totalWordUsed, words, isWordUsedExceeding} = relatedKeywords;\n let status = 'good';\n if (!data?.related_keywords?.length || totalWordUsed <= 0) {\n status = 'bad';\n }\n\n if (isWordUsedExceeding) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <BlockStack gap={200}>\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n <RelatedKeywordsDescription {...{words, i18n}} />\n </BlockStack>\n )\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n\n const result = this.calculateResult(data, relatedKeywords, i18n);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setBody(result.body);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return paper.hasRelatedKeywords();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,2BAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAkD,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElD;AACA;AACA;AACe,MAAMG,yBAAyB,SAASC,mBAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,iBAAiB;MACrBC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,KAAK;M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,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DjB,IAAI,GAAGA,IAAI,CAACkB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED,CAAC,eACPhD,MAAA,CAAAQ,OAAA,CAAAgC,aAAA,CAACpC,2BAAA,CAAAI,OAA0B;QAAMwB,KAAK;QAAEF;MAAI,CAAI,CACtC;IAEhB,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEmB,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAErB;EAAI,CAAC,EAAE;IACnC,MAAMD,eAAe,GAAGsB,UAAU,CAACC,WAAW,CAAC,sBAAsB,CAAC;IACtE,MAAMxB,IAAI,GAAGsB,KAAK,CAACG,OAAO,CAAC,CAAC;IAE5B,MAAMC,MAAM,GAAG,IAAI,CAAC3B,eAAe,CAACC,IAAI,EAAEC,eAAe,EAAEC,IAAI,CAAC;IAChE,MAAMyB,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC5C,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE8B,gBAAgB,CAACE,QAAQ,CAACH,MAAM,CAACjB,KAAK,CAAC;IACvCkB,gBAAgB,CAACG,SAAS,CAACJ,MAAM,CAACpB,MAAM,CAAC;IACzCqB,gBAAgB,CAACI,OAAO,CAACL,MAAM,CAACf,IAAI,CAAC;IAErC,OAAOgB,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,YAAYA,CAACV,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAACW,kBAAkB,CAAC,CAAC;EACnC;AACF;AAACC,OAAA,CAAAtD,OAAA,GAAAC,yBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axyseo",
3
- "version": "2.0.0-alpha.0.0.28.3",
3
+ "version": "2.0.0-alpha.0.0.29",
4
4
  "main": "build/index.js",
5
5
  "scripts": {
6
6
  "build": "yarn clean && yarn build:js && yarn build:types",