Skip to content

Commit

Permalink
[FEATURE] Implemented latest yoast packages, currently (temporary) by…
Browse files Browse the repository at this point in the history
… using the wordpress-seo repository as submodule
  • Loading branch information
Riny van Tiggelen committed Dec 1, 2023
1 parent 77b5100 commit 000bba7
Show file tree
Hide file tree
Showing 18 changed files with 10,852 additions and 17,788 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ grunt/node_modules
vendor
composer.lock
.php_cs.cache
yarn.lock
*.LICENSE.txt
.Build/*
!.Build/ExcludeFromPackaging.php
!.Build/.php-cs-fixer.php
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "grunt/submodules/wordpress-seo"]
path = grunt/submodules/wordpress-seo
url = https://github.com/Yoast/wordpress-seo.git
branch = releasing-yoastseo
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Components/Analysis.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useEffect, useState} from 'react';
import {connect} from 'react-redux';
import LoadingIndicator from './LoadingIndicator';
import YoastContentAnalysis from 'yoast-components/composites/Plugin/ContentAnalysis/components/ContentAnalysis';
import YoastContentAnalysis from '@yoast/analysis-report/ContentAnalysis';
import {mapResults} from "../helpers/mapResults";
import getResult from '../helpers/getResult';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
import {connect} from 'react-redux';
import ProgressBar from '@yoast/components/ProgressBar';
import getProgressColor from '../helpers/progressColor';
import MetaDescriptionLengthAssessment from 'yoastseo/src/assessments/seo/MetaDescriptionLengthAssessment';
import MetaDescriptionLengthAssessment from 'yoastseo/scoring/assessments/seo/MetaDescriptionLengthAssessment';

/**
* Gets the description progress.
Expand Down
3 changes: 2 additions & 1 deletion Resources/Public/JavaScript/Components/SnippetPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const SnippetPreview = ({isFetching, title, url, faviconSrc, wordsToHighlight, d
}
return <>
<ModeSwitcher onChange={(newMode) => setMode(newMode)} active={mode}/>
<YoastSnippetPreview title={title} url={url} description={description} faviconSrc={faviconSrc} wordsToHighlight={wordsToHighlight} locale={locale} mode={mode} onMouseUp={() => {}} />
{/* TODO: set correct siteName and check functionality of the property */}
<YoastSnippetPreview siteName="" title={title} url={url} description={description} faviconSrc={faviconSrc} wordsToHighlight={wordsToHighlight} locale={locale} mode={mode} onMouseUp={() => {}} />
</>
}
return <LoadingIndicator />
Expand Down
4 changes: 2 additions & 2 deletions Resources/Public/JavaScript/Components/StatusIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { connect } from 'react-redux';
import SvgIcon from '@yoast/components/SvgIcon'

import { getIconForScore, getTextForScore } from "../helpers/mapResults";
import { helpers } from "yoastseo";
import { interpreters } from "yoastseo";
import getResult from "../helpers/getResult";

const StatusIcon = ({content, analysis, resultType, resultSubtype, text}) => {
const { scoreToRating } = helpers;
const { scoreToRating } = interpreters;

if (content.isFetching === false && analysis.isAnalyzing === false && getResult(analysis, resultType, resultSubtype)) {
let score = getResult(analysis, resultType, resultSubtype).score / 10;
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Components/TitleProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import ProgressBar from '@yoast/components/ProgressBar';
import getProgressColor from '../helpers/progressColor';
import measureTextWidth from '../helpers/measureTextWidth';
import PageTitleWidthAssessment from 'yoastseo/src/assessments/seo/PageTitleWidthAssessment';
import PageTitleWidthAssessment from 'yoastseo/scoring/assessments/seo/PageTitleWidthAssessment';

const getTitleProgress = (title) => {
const titleWidth = measureTextWidth(title);
Expand Down
119 changes: 2 additions & 117 deletions Resources/Public/JavaScript/dist/plugin.js

Large diffs are not rendered by default.

37 changes: 2 additions & 35 deletions Resources/Public/JavaScript/dist/worker.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Resources/Public/JavaScript/helpers/mapResults.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { helpers } from "yoastseo";
import { interpreters } from "yoastseo";
import { default as colors } from "../colors.json";

const { scoreToRating } = helpers;
const { scoreToRating } = interpreters;

/**
* Mapped result definition.
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/helpers/measureTextWidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export default function measureTextWidth( text ) {
if ( ! element ) {
element = createMeasurementElement();
}
element.innerHTML = text;
element.innerText = text;
return element.offsetWidth;
}
4 changes: 2 additions & 2 deletions Resources/Public/JavaScript/redux/actions/analysis.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {helpers} from 'yoastseo';
import {interpreters} from 'yoastseo';

export const ANALYZE_DATA_REQUEST = 'ANALYZE_DATA_REQUEST';
export const ANALYZE_DATA_SUCCESS = 'ANALYZE_DATA_SUCCESS';

const saveScores = (results) => {
const {scoreToRating} = helpers;
const {scoreToRating} = interpreters;

if (typeof YoastConfig.data !== "undefined" && typeof YoastConfig.urls.saveScores !== "undefined") {
fetch(YoastConfig.urls.saveScores, {
Expand Down
6 changes: 3 additions & 3 deletions Resources/Public/JavaScript/redux/actions/content.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {stripFullTags} from 'yoastseo/src/stringProcessing/stripHTMLTags';
import {stripHTMLTags} from '@yoast/helpers/strings';

export const GET_CONTENT_REQUEST = 'GET_CONTENT_REQUEST';
export const GET_CONTENT_SUCCESS = 'GET_CONTENT_SUCCESS';
Expand All @@ -24,10 +24,10 @@ export function getContent() {

export function updateContent(content) {
if (typeof content.title !== "undefined") {
content.title = stripFullTags(content.title);
content.title = stripHTMLTags(content.title);
}
if (typeof content.description !== "undefined") {
content.description = stripFullTags(content.description);
content.description = stripHTMLTags(content.description);
}
return {
type: UPDATE_CONTENT,
Expand Down
Loading

0 comments on commit 000bba7

Please sign in to comment.