axyseo 2.0.0-alpha.0.0.30 → 2.0.0-alpha.0.0.32
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,6 +54,7 @@ class SubHeadingsKeywordAssessment extends _assessment.default {
|
|
|
54
54
|
i18n
|
|
55
55
|
}) {
|
|
56
56
|
this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');
|
|
57
|
+
console.log(this._subHeadings);
|
|
57
58
|
const assessmentResult = new _AssessmentResult.default({
|
|
58
59
|
config: this._config
|
|
59
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubHeadingsKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SubHeadingsKeywordAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_subHeadings","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","match","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that checks if the keyword is present in one of the subheadings.\n */\nexport default class SubHeadingsKeywordAssessment 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: 'subheadingsKeyword',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-subheading',\n priority: 'medium',\n fixPosition: 'subheading',\n title: 'Keyword in Subheading',\n content: {\n good: 'Keywords are included in subheadings.',\n bad:\n 'Keyword not found in any subheadings. Include it in at least one subheading (H2, H3, etc.).',\n improve: ''\n }\n };\n\n this.identifier = 'subheadingsKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');\n
|
|
1
|
+
{"version":3,"file":"SubHeadingsKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SubHeadingsKeywordAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_subHeadings","getResearch","console","log","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","match","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that checks if the keyword is present in one of the subheadings.\n */\nexport default class SubHeadingsKeywordAssessment 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: 'subheadingsKeyword',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-subheading',\n priority: 'medium',\n fixPosition: 'subheading',\n title: 'Keyword in Subheading',\n content: {\n good: 'Keywords are included in subheadings.',\n bad:\n 'Keyword not found in any subheadings. Include it in at least one subheading (H2, H3, etc.).',\n improve: ''\n }\n };\n\n this.identifier = 'subheadingsKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');\n console.log(this._subHeadings);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n if (this._subHeadings.match > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\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 )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA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E/C,OAAOT,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,eAAeA,CAACV,KAAK,EAAEE,IAAI,EAAE;IAC3B,IAAIY,MAAM,GAAG,EAAE;IACf,IAAI,IAAI,CAACX,YAAY,CAACc,KAAK,GAAG,CAAC,EAAE;MAC/BH,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACM,QAAQ,CAAC,IAAI,CAACrB,OAAO,CAACR,QAAQ,EAAEyB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACF7C,MAAA,CAAAS,OAAA,CAAAuC,aAAA,CAAC7C,QAAA,CAAA8C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACxB,OAAO,CAACL,OAAO,CAACsB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACjB,OAAO,CAACT,MAAM,iBAClBjB,MAAA,CAAAS,OAAA,CAAAuC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACzB,OAAO,CAACT,MAAO;QAACmC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DtB,IAAI,GAAGA,IAAI,CAACuB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC1B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC2B,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAAhD,OAAA,GAAAC,4BAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axyseo",
|
|
3
|
-
"version": "2.0.0-alpha.0.0.
|
|
3
|
+
"version": "2.0.0-alpha.0.0.32",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"scripts": {
|
|
6
|
+
"prepublishOnly": "npm version prerelease --preid=alpha",
|
|
6
7
|
"build": "yarn clean && yarn build:js && yarn build:types",
|
|
7
8
|
"build:js": "babel src --copy-files --source-maps --out-dir build",
|
|
8
9
|
"build:types": "tsc",
|