From 1a1cf3dfcade845e6e5f4f7ec81b619487493538 Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Wed, 3 Mar 2021 12:16:46 +0100 Subject: [PATCH 01/22] introduce StarRating component --- apps/components/ComponentsExample.js | 11 ++++++- packages/components/src/index.js | 1 + .../components/src/star-rating/StarRating.js | 30 +++++++++++++++++++ packages/components/src/star-rating/index.js | 3 ++ .../src/star-rating/star-rating.css | 23 ++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 packages/components/src/star-rating/StarRating.js create mode 100644 packages/components/src/star-rating/index.js create mode 100644 packages/components/src/star-rating/star-rating.css diff --git a/apps/components/ComponentsExample.js b/apps/components/ComponentsExample.js index 5a450da704..f5947a0a02 100644 --- a/apps/components/ComponentsExample.js +++ b/apps/components/ComponentsExample.js @@ -1,6 +1,6 @@ import { __ } from "@wordpress/i18n"; -import { Alert, CourseDetails, FullHeightCard, Warning } from "@yoast/components"; +import { Alert, CourseDetails, FullHeightCard, StarRating, Warning } from "@yoast/components"; import { getCourseFeed, getDirectionalStyle, makeOutboundLink } from "@yoast/helpers"; import React from "react"; import styled from "styled-components"; @@ -138,6 +138,12 @@ export default class ComponentsExample extends React.Component { ; } + updateStars( event ) { + this.setState({ + input: event.target.value + } ); + } + /** * Renders all the Component examples. * @@ -171,6 +177,9 @@ export default class ComponentsExample extends React.Component {

This spans to multiple lines.

, ] } /> +

Star rating

+ Accepts a rating from 0-5 and colors the stars yellow accordingly +

Outbound links

example.org diff --git a/packages/components/src/index.js b/packages/components/src/index.js index 977f70b6cc..095e062db1 100644 --- a/packages/components/src/index.js +++ b/packages/components/src/index.js @@ -12,6 +12,7 @@ export * from "./inputs"; export * from "./insights-card"; export * from "./radiobutton"; export * from "./select"; +export * from "./star-rating"; export * from "./help-icon"; export * from "./tables"; diff --git a/packages/components/src/star-rating/StarRating.js b/packages/components/src/star-rating/StarRating.js new file mode 100644 index 0000000000..0a8ec751ce --- /dev/null +++ b/packages/components/src/star-rating/StarRating.js @@ -0,0 +1,30 @@ +import React from "react"; +import PropTypes from "prop-types"; + +/** + * Renders StarRating component. + * + * @param {Object} props The props. + * + * @returns {React.Component} The StarRating Component. + */ +function StarRating( props ) { + const ratingPercentage = props.rating * 20; + + return ( +

+ + + +
+ ); +} + +export default StarRating; + +StarRating.propTypes = { + rating: PropTypes.number.isRequired, +}; diff --git a/packages/components/src/star-rating/index.js b/packages/components/src/star-rating/index.js new file mode 100644 index 0000000000..de1e9a1feb --- /dev/null +++ b/packages/components/src/star-rating/index.js @@ -0,0 +1,3 @@ +import "./star-rating.css"; + +export { default as StarRating } from "./StarRating.js"; diff --git a/packages/components/src/star-rating/star-rating.css b/packages/components/src/star-rating/star-rating.css new file mode 100644 index 0000000000..605e49f3af --- /dev/null +++ b/packages/components/src/star-rating/star-rating.css @@ -0,0 +1,23 @@ +.yoast-star-rating { + width: 65px; + height: 13px; +} + +.yoast-star-rating span { + height: 100%; + width: 100%; + background-size: 13px 12px; + background-repeat: repeat-x; +} + +.yoast-star-rating__placeholder { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAmCAQAAAAYCMGrAAAA+klEQVR4AcWV4cbtMBBFF0MIVUopoVSrhDDv/3gf/RFRpzdNOty1HiBO99mzeYWgCMZMKCPGrCgrxiSUhCkDeukxJKCXAUMiehkxw6FZhxEzmp0x4kCzByYISqlYdal0supS6WrVpdLEK0YSamJiJOPY0c/uOG4s6CcXfuKJaJcRzyNCQJsNiF1sRTR1hP11NNJ8RCrONOPRf+r7J+TZgQ5CNfMOYvW/2YxDqzqA/57+gVY9eiakrnyZEGXDsaE3p/4JScwPX3rtnZATDxnPWT7X16XAHaH8HWNrlxJD9TyGti5tCM84zpZe+RxNjeX9tZqLaGoMxN/P/wHP5Vw+8ZxnEQAAAABJRU5ErkJggg==); + display: inline-block; + overflow: hidden; + position: relative; +} + +.yoast-star-rating__fill { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAmBAMAAABALxQTAAAAFVBMVEVMaXH4twP4twP4twP4twP4twP4twP7w8S/AAAAB3RSTlMAFv5uPpvQloUsTQAAAMFJREFUeAGE0TEOgzAMQFEXoDNiYC6/wFxxAsTADDkB5f6HqNRENXUi8TYiRfnY8lNXkjBOkuBWSeAhsYJOYiW9xO4MEqshkTbCSyIH7GLdgFasHHgmwkikZQD6OROZRG4Hxju8o/TNhbNhCqkOxaZDVKdxNnq/EjUS/A2o0PuXpyVeb9bjDWY9QSWXDQfBbtbjtWY9bM4sqfx+5yYt8wNcAFEzrGGkk5668KsFrKewPtQ3aFqh8WOnYZ+lIBQkgykAWk8rlAqcHfQAAAAASUVORK5CYII=); + display: block; +} From 7109bf85f7c09714a38f28f0915d843c59a6b42b Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 16 Mar 2021 12:08:52 +0100 Subject: [PATCH 02/22] Introduce ProductData components --- .../src/snippet-preview/ProductDataDesktop.js | 31 ++++++++++++++ .../src/snippet-preview/ProductDataMobile.js | 42 +++++++++++++++++++ .../src/snippet-preview/SnippetPreview.js | 39 +++++++++++++++++ .../src/snippet-preview/product-data.css | 8 ++++ 4 files changed, 120 insertions(+) create mode 100644 packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js create mode 100644 packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js create mode 100644 packages/search-metadata-previews/src/snippet-preview/product-data.css diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js new file mode 100644 index 0000000000..54eae04b3f --- /dev/null +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js @@ -0,0 +1,31 @@ +import React, { Fragment } from "react"; +import PropTypes from "prop-types"; +import { StarRating } from "@yoast/components"; +import "./product-data.css"; + +/** + * Renders ProductData component. + * + * @param {Object} props The props. + * + * @returns {React.Component} The StarRating Component. + */ +function ProductDataDesktop( props ) { + const { shoppingData } = props; + + return ( + + + Rating: { shoppingData.rating * 2 }/10 · ‎ + { shoppingData.reviewCount } reviews · ‎ + · ‎ + { shoppingData.availability } + + ); +} + +export default ProductDataDesktop; + +ProductDataDesktop.propTypes = { + shoppingData: PropTypes.object.isRequired, +}; diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js new file mode 100644 index 0000000000..0387380f95 --- /dev/null +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js @@ -0,0 +1,42 @@ +import React, { Fragment } from "react"; +import PropTypes from "prop-types"; +import { StarRating } from "@yoast/components"; +import "./product-data.css"; + +/** + * Renders ProductData component. + * + * @param {Object} props The props. + * + * @returns {React.Component} The StarRating Component. + */ +function ProductDataMobile( props ) { + const { shoppingData } = props; + + return ( + +
+
Rating
+
+ { shoppingData.rating * 2 }/10 + + { shoppingData.reviewCount } +
+
+
+
Price
+
+
+
+
Availability
+
{ shoppingData.availability }
+
+ + ); +} + +export default ProductDataMobile; + +ProductDataMobile.propTypes = { + shoppingData: PropTypes.object.isRequired, +}; diff --git a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js index 21e3066236..579e4b9a20 100644 --- a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js +++ b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js @@ -21,6 +21,8 @@ const { // Internal dependencies. import FixedWidthContainer from "./FixedWidthContainer"; +import ProductDataDesktop from "./ProductDataDesktop"; +import ProductDataMobile from "./ProductDataMobile"; import { DEFAULT_MODE, MODE_DESKTOP, MODE_MOBILE, MODES } from "./constants"; /* @@ -729,6 +731,30 @@ export default class SnippetPreview extends PureComponent { return null; } + /** + * Renders the product / shopping data, in mobile or desktop view, based on the mode. + * + * @returns {ReactElement} The rendered description. + */ + renderProductData() { + const { mode, shoppingData } = this.props; + + if ( mode === MODE_DESKTOP && shoppingData !== null ) { + return ( + + ); + } else if ( mode === MODE_MOBILE && shoppingData !== null ) { + return ( + + ); + } + return null; + } + /** * Renders the snippet preview. * @@ -792,12 +818,24 @@ export default class SnippetPreview extends PureComponent { { isDesktopMode && this.renderUrl() } { downArrow } + + + { __( "Shopping data preview", "yoast-components" ) + ":" } + + { isDesktopMode && this.renderProductData() } + { __( "Meta description preview", "yoast-components" ) + ":" } { this.renderDescription() } + + + { __( "Shopping data preview", "yoast-components" ) + ":" } + + { ! isDesktopMode && this.renderProductData() } + ); @@ -846,6 +884,7 @@ SnippetPreview.propTypes = { isAmp: PropTypes.bool, faviconSrc: PropTypes.string, mobileImageSrc: PropTypes.string, + shoppingData: PropTypes.object.isRequired, onMouseUp: PropTypes.func.isRequired, onHover: PropTypes.func, diff --git a/packages/search-metadata-previews/src/snippet-preview/product-data.css b/packages/search-metadata-previews/src/snippet-preview/product-data.css new file mode 100644 index 0000000000..1649403bf7 --- /dev/null +++ b/packages/search-metadata-previews/src/snippet-preview/product-data.css @@ -0,0 +1,8 @@ +.yoast-shopping-data-preview--desktop { + display: flex; + color: var(--yoast-color-inactive-text); +} + +.yoast-shopping-data-preview--desktop .yoast-star-rating { + margin-right: 0.4em; +} From bb1398e6e3e094be5f32c5d82f48a53a27e61651 Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 16 Mar 2021 12:09:28 +0100 Subject: [PATCH 03/22] pass shoppingData to Preview --- .../src/snippet-editor/SnippetEditor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/search-metadata-previews/src/snippet-editor/SnippetEditor.js b/packages/search-metadata-previews/src/snippet-editor/SnippetEditor.js index 3897117897..062fda44c6 100644 --- a/packages/search-metadata-previews/src/snippet-editor/SnippetEditor.js +++ b/packages/search-metadata-previews/src/snippet-editor/SnippetEditor.js @@ -518,6 +518,7 @@ class SnippetEditor extends React.Component { faviconSrc, mobileImageSrc, idSuffix, + shoppingData, } = this.props; const { @@ -556,6 +557,7 @@ class SnippetEditor extends React.Component { locale={ locale } faviconSrc={ faviconSrc } mobileImageSrc={ mobileImageSrc } + shoppingData={ shoppingData } { ...mappedData } /> @@ -601,6 +603,7 @@ SnippetEditor.propTypes = { faviconSrc: PropTypes.string, mobileImageSrc: PropTypes.string, idSuffix: PropTypes.string, + shoppingData: PropTypes.object.isRequired, }; SnippetEditor.defaultProps = { From 96d74c365c4f9e16977a3bb8b03d948fd78bf360 Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 16 Mar 2021 12:09:47 +0100 Subject: [PATCH 04/22] update export --- packages/search-metadata-previews/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/search-metadata-previews/src/index.js b/packages/search-metadata-previews/src/index.js index 93e159e089..f6eab82630 100644 --- a/packages/search-metadata-previews/src/index.js +++ b/packages/search-metadata-previews/src/index.js @@ -1,7 +1,7 @@ // Snippet preview exports. export { default as FixedWidthContainer } from "./snippet-preview/FixedWidthContainer"; export { default as HelpTextWrapper } from "./snippet-preview/HelpTextWrapper"; -export { default as SnippetPreview } from "./snippet-preview/SnippetPreview"; +export * from "./snippet-preview/SnippetPreview"; // Snippet editor exports. export { From b279617a3baf2f690768acdde055f76855489afd Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 16 Mar 2021 12:10:01 +0100 Subject: [PATCH 05/22] fix typo --- packages/components/src/star-rating/StarRating.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/star-rating/StarRating.js b/packages/components/src/star-rating/StarRating.js index 0a8ec751ce..8fbad23f12 100644 --- a/packages/components/src/star-rating/StarRating.js +++ b/packages/components/src/star-rating/StarRating.js @@ -13,7 +13,7 @@ function StarRating( props ) { return ( +
+ + Shopping data preview: + + +

+ + + +

+
@@ -396,7 +478,7 @@ exports[`SnippetPreview highlights a keyword in different morphological forms 1` Meta description preview:
+
+ + Shopping data preview: + +
@@ -435,6 +535,12 @@ exports[`SnippetPreview highlights keywords even if they are transliterated 1`] width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -500,7 +606,7 @@ exports[`SnippetPreview highlights keywords even if they are transliterated 1`] color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -595,6 +701,32 @@ exports[`SnippetPreview highlights keywords even if they are transliterated 1`] className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -613,7 +745,7 @@ exports[`SnippetPreview highlights keywords even if they are transliterated 1`] Meta description preview:
+
+ + Shopping data preview: + +
@@ -643,6 +793,12 @@ exports[`SnippetPreview highlights keywords inside the description and url 1`] = width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -708,7 +864,7 @@ exports[`SnippetPreview highlights keywords inside the description and url 1`] = color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -803,6 +959,32 @@ exports[`SnippetPreview highlights keywords inside the description and url 1`] = className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -821,7 +1003,7 @@ exports[`SnippetPreview highlights keywords inside the description and url 1`] = Meta description preview:
+
+ + Shopping data preview: + +
@@ -851,6 +1051,12 @@ exports[`SnippetPreview highlights separate words from the keyphrase 1`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -916,7 +1122,7 @@ exports[`SnippetPreview highlights separate words from the keyphrase 1`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -1011,6 +1217,32 @@ exports[`SnippetPreview highlights separate words from the keyphrase 1`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -1029,7 +1261,7 @@ exports[`SnippetPreview highlights separate words from the keyphrase 1`] = ` Meta description preview:
+
+ + Shopping data preview: + +
`; exports[`SnippetPreview mobile mode renders an AMP logo when isAmp is true 1`] = ` +.c11 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + .c0 { border-bottom: 1px hidden #fff; border-radius: 8px; @@ -1256,6 +1513,24 @@ exports[`SnippetPreview mobile mode renders an AMP logo when isAmp is true 1`] = className="c9" /> +
+ + Shopping data preview: + +
@@ -1286,6 +1561,31 @@ exports[`SnippetPreview mobile mode renders an AMP logo when isAmp is true 1`] = Description
+ + +
+ + Shopping data preview: + +
+ + +
@@ -1293,6 +1593,13 @@ exports[`SnippetPreview mobile mode renders an AMP logo when isAmp is true 1`] = `; exports[`SnippetPreview mobile mode renders differently than desktop 1`] = ` +.c10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + .c0 { border-bottom: 1px hidden #fff; border-radius: 8px; @@ -1473,6 +1780,24 @@ exports[`SnippetPreview mobile mode renders differently than desktop 1`] = ` +
+ + Shopping data preview: + +
@@ -1503,6 +1828,31 @@ exports[`SnippetPreview mobile mode renders differently than desktop 1`] = ` Description
+ + +
+ + Shopping data preview: + +
+ + +
@@ -1510,6 +1860,13 @@ exports[`SnippetPreview mobile mode renders differently than desktop 1`] = ` `; exports[`SnippetPreview renders a SnippetPreview in the default mode 1`] = ` +.c10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + .c0 { border-bottom: 1px hidden #fff; border-radius: 8px; @@ -1690,6 +2047,24 @@ exports[`SnippetPreview renders a SnippetPreview in the default mode 1`] = ` +
+ + Shopping data preview: + +
@@ -1720,6 +2095,31 @@ exports[`SnippetPreview renders a SnippetPreview in the default mode 1`] = ` Description
+ + +
+ + Shopping data preview: + +
+ + +
@@ -1739,6 +2139,12 @@ exports[`SnippetPreview renders a SnippetPreview that looks like Google 1`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -1804,7 +2210,7 @@ exports[`SnippetPreview renders a SnippetPreview that looks like Google 1`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -1899,6 +2305,32 @@ exports[`SnippetPreview renders a SnippetPreview that looks like Google 1`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -1917,7 +2349,7 @@ exports[`SnippetPreview renders a SnippetPreview that looks like Google 1`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -1944,6 +2394,12 @@ exports[`SnippetPreview renders a caret on activation 1`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -2004,7 +2460,7 @@ exports[`SnippetPreview renders a caret on activation 1`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -2118,6 +2574,32 @@ exports[`SnippetPreview renders a caret on activation 1`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -2136,7 +2618,7 @@ exports[`SnippetPreview renders a caret on activation 1`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -2163,6 +2663,12 @@ exports[`SnippetPreview renders a caret on activation 2`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -2238,7 +2744,7 @@ exports[`SnippetPreview renders a caret on activation 2`] = ` vertical-align: top; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -2248,7 +2754,7 @@ exports[`SnippetPreview renders a caret on activation 2`] = ` line-height: 1.57; } -.c10::before { +.c11::before { display: block; position: absolute; top: 0; @@ -2337,6 +2843,32 @@ exports[`SnippetPreview renders a caret on activation 2`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -2355,7 +2887,7 @@ exports[`SnippetPreview renders a caret on activation 2`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -2382,6 +2932,12 @@ exports[`SnippetPreview renders a caret on activation 3`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -2437,7 +2993,7 @@ exports[`SnippetPreview renders a caret on activation 3`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -2556,6 +3112,32 @@ exports[`SnippetPreview renders a caret on activation 3`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -2574,7 +3156,7 @@ exports[`SnippetPreview renders a caret on activation 3`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -2601,6 +3201,12 @@ exports[`SnippetPreview renders a caret on hover 1`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -2661,7 +3267,7 @@ exports[`SnippetPreview renders a caret on hover 1`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -2775,6 +3381,32 @@ exports[`SnippetPreview renders a caret on hover 1`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -2793,7 +3425,7 @@ exports[`SnippetPreview renders a caret on hover 1`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -2820,6 +3470,12 @@ exports[`SnippetPreview renders a caret on hover 2`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -2895,7 +3551,7 @@ exports[`SnippetPreview renders a caret on hover 2`] = ` vertical-align: top; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -2905,7 +3561,7 @@ exports[`SnippetPreview renders a caret on hover 2`] = ` line-height: 1.57; } -.c10::before { +.c11::before { display: block; position: absolute; top: 0; @@ -2994,6 +3650,32 @@ exports[`SnippetPreview renders a caret on hover 2`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -3012,7 +3694,7 @@ exports[`SnippetPreview renders a caret on hover 2`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -3039,6 +3739,12 @@ exports[`SnippetPreview renders a caret on hover 3`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -3094,7 +3800,7 @@ exports[`SnippetPreview renders a caret on hover 3`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -3213,6 +3919,32 @@ exports[`SnippetPreview renders a caret on hover 3`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -3231,7 +3963,7 @@ exports[`SnippetPreview renders a caret on hover 3`] = ` Meta description preview:
+
+ + Shopping data preview: + +
@@ -3258,6 +4008,12 @@ exports[`SnippetPreview shows the date if a date is passed 1`] = ` width: 600px; } +.c10 { + display: inline; + margin-left: 0.3em; + color: #70757a; +} + .c1 { background-color: #fff; font-family: arial,sans-serif; @@ -3323,7 +4079,7 @@ exports[`SnippetPreview shows the date if a date is passed 1`] = ` color: #006621; } -.c10 { +.c11 { color: #545454; cursor: pointer; position: relative; @@ -3343,7 +4099,7 @@ exports[`SnippetPreview shows the date if a date is passed 1`] = ` vertical-align: top; } -.c11 { +.c12 { color: #777; } @@ -3422,6 +4178,32 @@ exports[`SnippetPreview shows the date if a date is passed 1`] = ` className="c9" /> +
+ + Shopping data preview: + + +

+ + + +

+
@@ -3440,13 +4222,13 @@ exports[`SnippetPreview shows the date if a date is passed 1`] = ` Meta description preview:
Today @@ -3456,6 +4238,24 @@ exports[`SnippetPreview shows the date if a date is passed 1`] = ` Description
+
+ + Shopping data preview: + +
From b9ab21122c6d14f333a1a0433fd88f6e5ad0432a Mon Sep 17 00:00:00 2001 From: Maarten Leenders <26220788+maartenleenders@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:53:33 +0100 Subject: [PATCH 11/22] Update snaps --- .../__snapshots__/SnippetEditorTest.js.snap | 2642 ++++++++++++++--- 1 file changed, 2154 insertions(+), 488 deletions(-) diff --git a/packages/search-metadata-previews/tests/__snapshots__/SnippetEditorTest.js.snap b/packages/search-metadata-previews/tests/__snapshots__/SnippetEditorTest.js.snap index 71b5a401ab..5a552fccbb 100644 --- a/packages/search-metadata-previews/tests/__snapshots__/SnippetEditorTest.js.snap +++ b/packages/search-metadata-previews/tests/__snapshots__/SnippetEditorTest.js.snap @@ -1,6 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SnippetEditor accepts a custom data mapping function 1`] = ` +.c14 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + .c4 { border-bottom: 1px hidden #fff; border-radius: 8px; @@ -133,7 +140,7 @@ exports[`SnippetEditor accepts a custom data mapping function 1`] = ` cursor: pointer; } -.c14 { +.c15 { color: #555; border-color: #ccc; background: #f7f7f7; @@ -175,17 +182,17 @@ exports[`SnippetEditor accepts a custom data mapping function 1`] = ` padding-left: 8px; } -.c14:active { +.c15:active { color: #000; background-color: #f7f7f7; box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); } -.c14::-moz-focus-inner { +.c15::-moz-focus-inner { border-width: 0; } -.c14:focus { +.c15:focus { outline: none; border-color: #0066cd; color: #000; @@ -193,24 +200,24 @@ exports[`SnippetEditor accepts a custom data mapping function 1`] = ` box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); } -.c14:hover { +.c15:hover { color: #000; background-color: #fff; border-color: var(--yoast-color-border--default); } -.c14 svg { +.c15 svg { -webkit-align-self: center; -ms-flex-item-align: center; align-self: center; } -.c14 svg { +.c15 svg { margin-right: 7px; } @media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c14::after { + .c15::after { display: inline-block; content: ""; min-height: 22px; @@ -335,6 +342,24 @@ exports[`SnippetEditor accepts a custom data mapping function 1`] = ` +
+ + Shopping data preview: + +
@@ -365,13 +390,38 @@ exports[`SnippetEditor accepts a custom data mapping function 1`] = ` Totally different description
+ + +
+ + Shopping data preview: + +
+ + +
- -`; - -exports[`SnippetEditor activates a field on onMouseUp() and opens the editor 1`] = ` - -
- - - - - Edit snippet - - - - Close snippet editor - -
-
-`; - -exports[`SnippetEditor closes when calling close() 1`] = ` -.c18 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c17 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c17::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c17::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c17::-moz-progress-bar { - background-color: #dc3232; -} - -.c17::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c21 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c21::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c21::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c21::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c21::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c16 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c20 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c20:focus { - outline: 0; -} - -.c19 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c19::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -.c22 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c22:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c22::-moz-focus-inner { - border-width: 0; -} - -.c22:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c22:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c22 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c22::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor closes when calling close() 2`] = ` -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor colored progress bars can handle a score of 6 1`] = ` -.c18 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c17 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c17::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c17::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c17::-moz-progress-bar { - background-color: #dc3232; -} - -.c17::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c21 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c21::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c21::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c21::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c21::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c16 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c20 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c20:focus { - outline: 0; -} - -.c19 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c19::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -.c22 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c22:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c22::-moz-focus-inner { - border-width: 0; -} - -.c22:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c22:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c22 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c22::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor colored progress bars can handle scores of 3 and 9 1`] = ` -.c18 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c17 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c17::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c17::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c17::-moz-progress-bar { - background-color: #dc3232; -} - -.c17::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c21 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c21::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c21::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c21::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c21::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c16 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c20 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c20:focus { - outline: 0; -} - -.c19 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c19::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -.c22 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c22:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c22::-moz-focus-inner { - border-width: 0; -} - -.c22:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c22:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c22 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c22::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor highlights a focused field 1`] = ` -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -
-
- - Preview as: - - - - - -
-
-
-
- - Url preview: - -
-
- - - - example.org - - › test-slug - -
-
- - SEO title preview: - -
-
- - Test title - -
-
-
-
- - Shopping data preview: - -
-
- - Meta description preview: - -
-
- - - Test description, %%replacement_variable%% -
-
-
-
- - Shopping data preview: - -
- - - -
-
-
-
- -
-`; - -exports[`SnippetEditor highlights a hovered field 1`] = ` -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -
-
- - Preview as: - - - - - -
-
-
-
- - Url preview: - -
-
- - - - example.org - - › test-slug - -
-
- - SEO title preview: - -
-
- - Test title - -
-
-
-
- - Shopping data preview: - -
-
- - Meta description preview: - -
-
- - - Test description, %%replacement_variable%% -
-
-
-
- - Shopping data preview: - -
- - - -
-
-
-
- -
-`; - -exports[`SnippetEditor highlights the active ReplacementVariableEditor when calling setFieldFocus 1`] = ` -.c19 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c18 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c18::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c18::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c18::-moz-progress-bar { - background-color: #dc3232; -} - -.c18::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c22 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c22::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c22::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c22::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c22::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c17 { - padding: 0 20px; -} - -.c15 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c15 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c15:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c21 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c21:focus { - outline: 0; -} - -.c20 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c20::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c16 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c16:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c16::-moz-focus-inner { - border-width: 0; -} - -.c16:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c16:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c16 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c16 svg { - margin-right: 7px; -} - -.c23 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c23:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c23::-moz-focus-inner { - border-width: 0; -} - -.c23:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c23:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c23 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c14::before { - display: block; - position: absolute; - top: 0; - left: -40px; - width: 22px; - height: 22px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 24px; - background-repeat: no-repeat; - background-position: center; - content: ""; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c16::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c23::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor highlights the hovered field when onMouseEnter() is called 1`] = ` -.c19 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c18 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c18::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c18::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c18::-moz-progress-bar { - background-color: #dc3232; -} - -.c18::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c22 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c22::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c22::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c22::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c22::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c17 { - padding: 0 20px; -} - -.c15 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c15 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c15:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c21 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c21:focus { - outline: 0; -} - -.c20 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c20::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c16 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c16:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c16::-moz-focus-inner { - border-width: 0; -} - -.c16:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c16:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c16 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c16 svg { - margin-right: 7px; -} - -.c23 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c23:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c23::-moz-focus-inner { - border-width: 0; -} - -.c23:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c23:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c23 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c14::before { - display: block; - position: absolute; - top: 0; - left: -40px; - width: 22px; - height: 22px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 24px; - background-repeat: no-repeat; - background-position: center; - content: ""; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c16::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c23::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor opens when calling open() 1`] = ` -.c18 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c17 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c17::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c17::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c17::-moz-progress-bar { - background-color: #dc3232; -} - -.c17::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c21 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c21::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c21::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c21::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c21::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c16 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c20 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c20:focus { - outline: 0; -} - -.c19 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c19::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -.c22 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c22:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c22::-moz-focus-inner { - border-width: 0; -} - -.c22:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c22:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c22 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c22::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor passes replacement variables to the title and description editor 1`] = ` -.c18 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c17 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c17::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c17::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c17::-moz-progress-bar { - background-color: #dc3232; -} - -.c17::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c21 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c21::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c21::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c21::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c21::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c16 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c20 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c20:focus { - outline: 0; -} - -.c19 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c19::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -.c22 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c22:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c22::-moz-focus-inner { - border-width: 0; -} - -.c22:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c22:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c22 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c22::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor passes the date prop 1`] = ` -.c15 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c15 { - color: #70757a; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c16 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c16:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c16::-moz-focus-inner { - border-width: 0; -} - -.c16:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c16:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c16 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c16 svg { - margin-right: 7px; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c16::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -
-
- - Preview as: - - - - - -
-
-
-
- - Url preview: - -
-
- - - - example.org - - › test-slug - -
-
- - SEO title preview: - -
-
- - Test title - -
-
-
-
- - Shopping data preview: - -
-
- - Meta description preview: - -
-
- - - date string - - ⋅ - - - Test description, %%replacement_variable%% -
-
-
-
- - Shopping data preview: - -
- - - -
-
-
-
- -
-`; - -exports[`SnippetEditor removes the highlight from the hovered field on calling onMouseLeave() 1`] = ` - -
- - - - - Edit snippet - - - - Close snippet editor - -
-
-`; - -exports[`SnippetEditor removes the highlight when calling unsetFieldFocus 1`] = ` -.c18 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c17 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c17::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c17::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c17::-moz-progress-bar { - background-color: #dc3232; -} - -.c17::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c21 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c21::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c21::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c21::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c21::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c16 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c20 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c20:focus { - outline: 0; -} - -.c19 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c19::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -.c22 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin-top: 24px; -} - -.c22:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c22::-moz-focus-inner { - border-width: 0; -} - -.c22:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c22:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c22 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c22::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - - - -
- - - -
- - - - Preview as: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
- - - - - - - - -
- -
- - - - -
- Slug -
-
-
- - -
- - - - - -
-
-
- -
- - -
-
-
-
- - - - - -
-
-
-`; - -exports[`SnippetEditor renders in desktop mode 1`] = ` -.c4 { - overflow: auto; - width: 640px; - padding: 0 20px; - max-width: 100%; - box-sizing: border-box; -} - -.c6 { - width: 600px; -} - -.c14 { - display: inline; - margin-left: 0.3em; - color: #70757a; -} - -.c5 { - background-color: #fff; - font-family: arial,sans-serif; - box-sizing: border-box; -} - -.c12 { - cursor: pointer; - position: relative; -} - -.c13 { - color: #1a0dab; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 20px; - line-height: 1.3; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c14 { - white-space: nowrap; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c8 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 0; - padding-top: 1px; - line-height: 1.5; - vertical-align: baseline; -} - -.c9 { - font-size: 14px; - line-height: 1.3; - color: #5f6368; -} - -.c15 { - color: #545454; - cursor: pointer; - position: relative; - max-width: 600px; - padding-top: 1px; - font-size: 14px; - line-height: 1.58; -} - -.c11 { - display: inline-block; - margin-top: 9px; - margin-left: 6px; - border-top: 5px solid #70757a; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - vertical-align: top; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c16 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c16:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c16::-moz-focus-inner { - border-width: 0; -} - -.c16:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c16:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c16 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c16 svg { - margin-right: 7px; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c16::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -
-
- - Preview as: - - - - - -
-
-
-
-
- - Url preview: - -
-
- - - example.org - - › test-slug - -
-
-
- - SEO title preview: - -
-
- - Test title - -
-
-
-
- - Shopping data preview: - - -

- - - -

-
-
- - Meta description preview: - -
- - Test description, %%replacement_variable%% -
-
-
- - Shopping data preview: - -
-
-
-
- -
-`; - -exports[`SnippetEditor renders the snippet editor without a close button when showCloseButton is false 1`] = ` -.c17 { - -webkit-flex: 1 1 200px; - -ms-flex: 1 1 200px; - flex: 1 1 200px; - min-width: 200px; - cursor: pointer; - font-size: 14px; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - margin: 4px 0; - color: #303030; - font-weight: 500; -} - -.c16 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c16::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c16::-webkit-progress-value { - background-color: #dc3232; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c16::-moz-progress-bar { - background-color: #dc3232; -} - -.c16::-ms-fill { - background-color: #dc3232; - border: 0; -} - -.c20 { - box-sizing: border-box; - width: 100%; - height: 8px; - display: block; - margin-top: 8px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #f7f7f7; - border: 1px solid #ddd; -} - -.c20::-webkit-progress-bar { - background-color: #f7f7f7; -} - -.c20::-webkit-progress-value { - background-color: #ee7c1b; - -webkit-transition: width 250ms; - transition: width 250ms; -} - -.c20::-moz-progress-bar { - background-color: #ee7c1b; -} - -.c20::-ms-fill { - background-color: #ee7c1b; - border: 0; -} - -.c15 { - padding: 0 20px; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c19 { - border: none; - width: 100%; - height: inherit; - line-height: inherit; - font-family: inherit; - font-size: inherit; - color: inherit; -} - -.c19:focus { - outline: 0; -} - -.c18 { - -webkit-flex: 0 1 100%; - -ms-flex: 0 1 100%; - flex: 0 1 100%; - border: 1px solid #ddd; - padding: 3px 5px; - box-sizing: border-box; - box-shadow: inset 0 1px 2px rgba(0,0,0,.07); - background-color: #fff; - color: #32373c; - outline: 0; - -webkit-transition: 50ms border-color ease-in-out; - transition: 50ms border-color ease-in-out; - position: relative; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; - font-size: 14px; - cursor: text; -} - -.c18::before { - display: block; - position: absolute; - top: -1px; - left: -25px; - width: 24px; - height: 24px; - background-image: url( data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22transparent%22%20d%3D%22M1152%20896q0%2026-19%2045l-448%20448q-19%2019-45%2019t-45-19-19-45v-896q0-26%2019-45t45-19%2045%2019l448%20448q19%2019%2019%2045z%22%20%2F%3E%3C%2Fsvg%3E ); - background-size: 25px; - content: ""; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -
-
- - Preview as: - - - - - -
-
-
-
- - Url preview: - -
-
- - - - example.org - - › test-slug - -
-
- - SEO title preview: - -
-
- - Test title - -
-
-
-
- - Shopping data preview: - -
-
- - Meta description preview: - -
-
- - - Test description, %%replacement_variable%% -
-
-
-
- - Shopping data preview: - -
- - - -
-
-
-
-
-
-
-
-`; - -exports[`SnippetEditor shows the editor 1`] = ` -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c4 { - border-bottom: 1px hidden #fff; - border-radius: 8px; - box-shadow: 0 1px 6px rgba(32,33,36,0.28); - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - max-width: 400px; - box-sizing: border-box; - font-size: 14px; -} - -.c11 { - cursor: pointer; - position: relative; -} - -.c12 { - color: #1967d2; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 16px; - line-height: 20px; - font-weight: normal; - margin: 0; - display: inline-block; - overflow: hidden; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; - max-width: 600px; - vertical-align: top; - text-overflow: ellipsis; -} - -.c13 { - display: inline-block; - max-height: 40px; - padding-top: 1px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; -} - -.c6 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; -} - -.c7 { - display: inline-block; - cursor: pointer; - position: relative; - max-width: 90%; - white-space: nowrap; - font-size: 14px; - vertical-align: top; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - margin-bottom: 12px; - padding-top: 1px; - line-height: 20px; - vertical-align: top; -} - -.c9 { - font-size: 12px; - line-height: 20px; - color: #3c4043; -} - -.c10 { - color: #3c4043; -} - -.c14 { - color: #3c4043; - font-size: 14px; - line-height: 20px; - cursor: pointer; - position: relative; - max-width: 600px; -} - -.c14:after { - display: table; - content: ""; - clear: both; -} - -.c5 { - padding: 12px 16px; -} - -.c5:first-child { - margin-bottom: -16px; -} - -.c8 { - width: 16px; - height: 16px; - margin-right: 12px; - vertical-align: middle; -} - -.c0 { - border: 0; - padding: 0; - margin: 0 0 16px; -} - -.c1 { - margin: 8px 0; - padding: 0; - color: #555; - font-size: 14px; - font-weight: 600; -} - -.c3 { - margin-right: 16px; - color: inherit; - font-size: 14px; - line-height: 1.71428571; - cursor: pointer; - display: inline-block; -} - -.c2.c2 { - margin: 0 8px 0 0; - cursor: pointer; -} - -.c15 { - color: #555; - border-color: #ccc; - background: #f7f7f7; - box-shadow: 0 1px 0 rgba( 204,204,204,1 ); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - vertical-align: middle; - border-width: 1px; - border-style: solid; - margin: 0; - padding: 4px 10px; - border-radius: 3px; - cursor: pointer; - box-sizing: border-box; - font-size: inherit; - font-family: inherit; - font-weight: inherit; - text-align: left; - overflow: visible; - min-height: 32px; - -webkit-transition: var(--yoast-transition-default); - transition: var(--yoast-transition-default); - height: 33px; - border: 1px solid #dbdbdb; - box-shadow: none; - font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; - margin: 10px 0 0 4px; - fill: #555; - padding-left: 8px; -} - -.c15:active { - color: #000; - background-color: #f7f7f7; - box-shadow: inset 0 2px 5px -3px rgba( 0,0,0,0.5 ); -} - -.c15::-moz-focus-inner { - border-width: 0; -} - -.c15:focus { - outline: none; - border-color: #0066cd; - color: #000; - background-color: #fff; - box-shadow: 0 0 3px rgba( 8,74,103,0.8 ); -} - -.c15:hover { - color: #000; - background-color: #fff; - border-color: var(--yoast-color-border--default); -} - -.c15 svg { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} - -.c15 svg { - margin-right: 7px; -} - -@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) { - .c15::after { - display: inline-block; - content: ""; - min-height: 22px; - } -} - -
-
- - Preview as: - - - - - -
-
-
-
- - Url preview: - -
-
- - - - example.org - - › test-slug - -
-
- - SEO title preview: - -
-
- - Test title - -
-
-
-
- - Shopping data preview: - -
-
- - Meta description preview: - -
-
- - - Test description, %%replacement_variable%% -
-
-
-
- - Shopping data preview: - -
- - - -
-
-
-
- -
-`; From fb4ca072761cc53449991df05e90e490a672d258 Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Thu, 1 Apr 2021 13:51:29 +0200 Subject: [PATCH 16/22] limit rating input between 0 and 5 --- packages/components/src/star-rating/StarRating.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/components/src/star-rating/StarRating.js b/packages/components/src/star-rating/StarRating.js index 8fbad23f12..a763b36e66 100644 --- a/packages/components/src/star-rating/StarRating.js +++ b/packages/components/src/star-rating/StarRating.js @@ -6,10 +6,21 @@ import PropTypes from "prop-types"; * * @param {Object} props The props. * - * @returns {React.Component} The StarRating Component. + * @returns {React.Component} The StarRating Component displays a number between 0 and 5 as (partly) colored stars. */ function StarRating( props ) { - const ratingPercentage = props.rating * 20; + let rating = props.rating; + + // As we have 5 stars, the rating should be between 0 and 5. + if ( rating < 0 ) { + rating = 0; + } + + if ( rating > 5 ) { + rating = 5; + } + + const ratingPercentage = rating * 20; return (
Date: Tue, 6 Apr 2021 12:01:33 +0200 Subject: [PATCH 17/22] update translateability and replace ternary's --- .../src/snippet-preview/ProductDataDesktop.js | 35 ++++++++++--------- .../src/snippet-preview/ProductDataMobile.js | 15 ++++---- .../src/snippet-preview/SnippetPreview.js | 6 ++-- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js index d3d95aa554..d3822b5197 100644 --- a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js @@ -1,14 +1,11 @@ import React, { Fragment } from "react"; import PropTypes from "prop-types"; import styled from "styled-components"; -import { __ } from "@wordpress/i18n"; +import { __, sprintf } from "@wordpress/i18n"; import { round } from "lodash"; - import { StarRating } from "@yoast/components"; -const ProductData = styled.p` - display: inline; - margin-left: 0.3em; +const ProductData = styled.span` color: #70757a; `; @@ -22,25 +19,29 @@ const ProductData = styled.p` function ProductDataDesktop( props ) { const { shoppingData } = props; + /* Translators: %s expands to the actual rating. */ + const ratingPart = sprintf( __( "Rating: %s", "yoast-components" ), round( ( shoppingData.rating * 2 ), 1 ) + "/10" ); + + /* Translators: %s expands to the actual rating. */ + const reviewPart = sprintf( __( "%s reviews", "yoast-components" ), shoppingData.reviewCount ); + return ( - - { ( shoppingData.reviewCount > 0 ) ? : "" } - { ( shoppingData.reviewCount > 0 ) - ? - { __( "Rating: ", "yoast-components" ) + round( ( shoppingData.rating * 2 ), 1 ) } /10 · - { shoppingData.reviewCount } { __( "reviews", "yoast-components" ) } · + { ( shoppingData.reviewCount > 0 ) && + + + { ratingPart } · + { reviewPart } · - : "" } - { ( shoppingData.price ) - ? + } + { shoppingData.price && + - : "" } - { ( shoppingData.availability ) ? · { shoppingData.availability } : "" } + { shoppingData.availability && + · { shoppingData.availability } } - ); } diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js index c8eac25575..4f2fb30ecc 100644 --- a/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js @@ -36,8 +36,8 @@ function ProductDataMobile( props ) { return ( - { ( shoppingData.rating > 0 ) - ? + { ( shoppingData.rating > 0 ) && +
{ __( "Rating", "yoast-components" ) }
{ round( ( shoppingData.rating * 2 ), 1 ) }/10 @@ -45,26 +45,23 @@ function ProductDataMobile( props ) { ({ shoppingData.reviewCount })
- : "" } - { ( shoppingData.price ) - ? + { ( shoppingData.price ) && +
{ __( "Price", "yoast-components" ) }
- : "" } - { ( shoppingData.availability ) - ? + { ( shoppingData.availability ) && +
{ __( "Availability", "yoast-components" ) }
{ shoppingData.availability }
- : "" }
); diff --git a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js index 1af0940380..bc9fb2737d 100644 --- a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js +++ b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js @@ -811,19 +811,19 @@ export default class SnippetPreview extends PureComponent { - { __( "Shopping data preview", "yoast-components" ) + ":" } + { __( "Shopping data preview:", "yoast-components" ) } { isDesktopMode && this.renderProductData() } - { __( "Meta description preview", "yoast-components" ) + ":" } + { __( "Meta description preview:", "yoast-components" ) } { this.renderDescription() } - { __( "Shopping data preview", "yoast-components" ) + ":" } + { __( "Shopping data preview:", "yoast-components" ) } { ! isDesktopMode && this.renderProductData() } From 74e8ba7ea81e6544ea3e779de09534160c5326c1 Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 6 Apr 2021 12:02:02 +0200 Subject: [PATCH 18/22] define PropType shape --- .../src/snippet-preview/ProductDataDesktop.js | 19 ++++++++++++------- .../src/snippet-preview/ProductDataMobile.js | 7 ++++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js index d3822b5197..198c393c37 100644 --- a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js @@ -26,27 +26,32 @@ function ProductDataDesktop( props ) { const reviewPart = sprintf( __( "%s reviews", "yoast-components" ), shoppingData.reviewCount ); return ( - + { ( shoppingData.reviewCount > 0 ) && { ratingPart } · { reviewPart } · - + } { shoppingData.price && - ‎ - - } + ‎ + + } { shoppingData.availability && · { shoppingData.availability } } - + ); } export default ProductDataDesktop; ProductDataDesktop.propTypes = { - shoppingData: PropTypes.object.isRequired, + shoppingData: PropTypes.shape( { + rating: PropTypes.number, + reviewCount: PropTypes.number, + availability: PropTypes.string, + price: PropTypes.string, + } ).isRequired, }; diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js index 4f2fb30ecc..f1a6e644aa 100644 --- a/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataMobile.js @@ -70,5 +70,10 @@ function ProductDataMobile( props ) { export default ProductDataMobile; ProductDataMobile.propTypes = { - shoppingData: PropTypes.object.isRequired, + shoppingData: PropTypes.shape( { + rating: PropTypes.number, + reviewCount: PropTypes.number, + availability: PropTypes.string, + price: PropTypes.string, + } ).isRequired, }; From e487a15232ac13663e7cfe3d8e80136b3a774ac8 Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 6 Apr 2021 12:14:52 +0200 Subject: [PATCH 19/22] simplify existence check --- .../src/snippet-preview/SnippetPreview.js | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js index bc9fb2737d..d114d0e55d 100644 --- a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js +++ b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js @@ -732,20 +732,25 @@ export default class SnippetPreview extends PureComponent { renderProductData() { const { mode, shoppingData } = this.props; - if ( mode === MODE_DESKTOP && shoppingData !== null ) { - return ( - - ); - } else if ( mode === MODE_MOBILE && shoppingData !== null ) { - return ( - - ); - } - return null; + if ( shoppingData !== {} ) { + + if ( mode === MODE_DESKTOP ) { + return ( + + ); + } + + if ( mode === MODE_MOBILE ) { + return ( + + ); + } + + return null; } /** From bc4cba5e3563f264174734a6e44479464912bcca Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Tue, 6 Apr 2021 12:47:15 +0200 Subject: [PATCH 20/22] fix typo --- .../src/snippet-preview/SnippetPreview.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js index d114d0e55d..c5d4d9567f 100644 --- a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js +++ b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js @@ -733,7 +733,6 @@ export default class SnippetPreview extends PureComponent { const { mode, shoppingData } = this.props; if ( shoppingData !== {} ) { - if ( mode === MODE_DESKTOP ) { return ( ); } - + if ( mode === MODE_MOBILE ) { return ( Date: Wed, 7 Apr 2021 10:52:39 +0200 Subject: [PATCH 21/22] Apply suggestions from code review Co-authored-by: Igor <35524806+igorschoester@users.noreply.github.com> --- .../src/snippet-preview/ProductDataDesktop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js index 198c393c37..4db094cf29 100644 --- a/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js +++ b/packages/search-metadata-previews/src/snippet-preview/ProductDataDesktop.js @@ -19,10 +19,10 @@ const ProductData = styled.span` function ProductDataDesktop( props ) { const { shoppingData } = props; - /* Translators: %s expands to the actual rating. */ + /* Translators: %s expands to the actual rating, e.g. 8/10. */ const ratingPart = sprintf( __( "Rating: %s", "yoast-components" ), round( ( shoppingData.rating * 2 ), 1 ) + "/10" ); - /* Translators: %s expands to the actual rating. */ + /* Translators: %s expands to the review count. */ const reviewPart = sprintf( __( "%s reviews", "yoast-components" ), shoppingData.reviewCount ); return ( From f90465904f24dc5d43bc8dd52c6bdac0291b9f9a Mon Sep 17 00:00:00 2001 From: marijnyoast Date: Wed, 7 Apr 2021 10:55:55 +0200 Subject: [PATCH 22/22] fix object empty check --- .../src/snippet-preview/SnippetPreview.js | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js index c5d4d9567f..9ad2c1de9b 100644 --- a/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js +++ b/packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js @@ -732,25 +732,27 @@ export default class SnippetPreview extends PureComponent { renderProductData() { const { mode, shoppingData } = this.props; - if ( shoppingData !== {} ) { - if ( mode === MODE_DESKTOP ) { - return ( - - ); - } + if ( Object.values( shoppingData ).length === 0 ) { + return null; + } - if ( mode === MODE_MOBILE ) { - return ( - - ); - } + if ( mode === MODE_DESKTOP ) { + return ( + + ); + } - return null; + if ( mode === MODE_MOBILE ) { + return ( + + ); } + + return null; } /**