1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
(()=>{"use strict";var e={n:i=>{var a=i&&i.__esModule?()=>i.default:()=>i;return e.d(a,{a}),a},d:(i,a)=>{for(var l in a)e.o(a,l)&&!e.o(i,l)&&Object.defineProperty(i,l,{enumerable:!0,get:a[l]})},o:(e,i)=>Object.prototype.hasOwnProperty.call(e,i)};const i=window.React,a=window.wp.plugins,l=window.wp.components,r=window.wp.element,t=window.wp.i18n,n=window.yoast["social-metadata-previews"],o=window.yoast.propTypes;var c=e.n(o);const{applyReplaceUsingPlugin:s}=window.yoast.editorModules.helpers.replacementVariableHelpers,m=e=>{const{recommendedReplacementVariables:a,replacementVariables:l,description:r,descriptionInputPlaceholder:o,title:c,titleInputPlaceholder:m,onSelectImageClick:p,onRemoveImageClick:d,onDescriptionChange:g,onTitleChange:u,onReplacementVariableSearchChange:b,imageWarnings:w,imageUrl:P,imageFallbackUrl:h,isPremium:R,siteUrl:v,descriptionPreviewFallback:k,titlePreviewFallback:C,location:I,activeMetaTabId:F,alt:y}=e,U=(0,t.__)("Social share preview","wordpress-seo-premium");return(0,i.createElement)(n.SocialPreviewEditor,{socialMediumName:"Social",isPremium:R,recommendedReplacementVariables:a,replacementVariables:l,description:r,descriptionInputPlaceholder:o,descriptionPreviewFallback:k,title:c,titleInputPlaceholder:m,titlePreviewFallback:C,onSelectImageClick:p,onRemoveImageClick:d,onDescriptionChange:g,onTitleChange:u,imageWarnings:w,imageUrl:P,imageFallbackUrl:h,siteUrl:v,applyReplacementVariables:s,onReplacementVariableSearchChange:b,socialPreviewLabel:U,idSuffix:I,activeMetaTabId:F,alt:y})};m.propTypes={recommendedReplacementVariables:c().array.isRequired,replacementVariables:c().array.isRequired,description:c().string,title:c().string,onSelectImageClick:c().func.isRequired,onRemoveImageClick:c().func.isRequired,onDescriptionChange:c().func.isRequired,onTitleChange:c().func.isRequired,onReplacementVariableSearchChange:c().func,imageWarnings:c().array,imageUrl:c().string.isRequired,imageFallbackUrl:c().string.isRequired,isPremium:c().bool.isRequired,siteUrl:c().string,descriptionInputPlaceholder:c().string,titleInputPlaceholder:c().string,descriptionPreviewFallback:c().string,titlePreviewFallback:c().string,location:c().string,activeMetaTabId:c().string,alt:c().string},m.defaultProps={imageWarnings:[],title:null,titleInputPlaceholder:"",description:null,descriptionInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",siteUrl:"",location:"",activeMetaTabId:"",alt:"",onReplacementVariableSearchChange:null};const p=m,{applyReplaceUsingPlugin:d}=window.yoast.editorModules.helpers.replacementVariableHelpers,g=e=>{const{recommendedReplacementVariables:a,replacementVariables:l,description:r,descriptionInputPlaceholder:o,title:c,titleInputPlaceholder:s,onSelectImageClick:m,onRemoveImageClick:p,onDescriptionChange:g,onTitleChange:u,onReplacementVariableSearchChange:b,imageWarnings:w,imageUrl:P,imageFallbackUrl:h,isPremium:R,isLarge:v,siteUrl:k,descriptionPreviewFallback:C,titlePreviewFallback:I,location:F,alt:y}=e,U=(0,t.__)("X share preview","wordpress-seo-premium");return(0,i.createElement)(n.SocialPreviewEditor,{socialMediumName:"X",isPremium:R,recommendedReplacementVariables:a,replacementVariables:l,description:r,descriptionInputPlaceholder:o,descriptionPreviewFallback:C,title:c,titleInputPlaceholder:s,titlePreviewFallback:I,onSelectImageClick:m,onRemoveImageClick:p,onDescriptionChange:g,onTitleChange:u,onReplacementVariableSearchChange:b,imageWarnings:w,imageUrl:P,imageFallbackUrl:h,isLarge:v,siteUrl:k,applyReplacementVariables:d,socialPreviewLabel:U,idSuffix:F,alt:y})};g.propTypes={recommendedReplacementVariables:c().array.isRequired,replacementVariables:c().array.isRequired,description:c().string,title:c().string,onSelectImageClick:c().func.isRequired,onRemoveImageClick:c().func.isRequired,onDescriptionChange:c().func.isRequired,onTitleChange:c().func.isRequired,onReplacementVariableSearchChange:c().func,imageWarnings:c().array,imageUrl:c().string,imageFallbackUrl:c().string,isPremium:c().bool.isRequired,isLarge:c().bool,siteUrl:c().string,descriptionInputPlaceholder:c().string,titleInputPlaceholder:c().string,descriptionPreviewFallback:c().string,titlePreviewFallback:c().string,location:c().string,alt:c().string},g.defaultProps={imageWarnings:[],title:null,description:null,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",descriptionPreviewFallback:"",titleInputPlaceholder:"",titlePreviewFallback:"",imageUrl:"",imageFallbackUrl:"",location:"",alt:"",onReplacementVariableSearchChange:null};const u=g,b=window.yoast.editorModules.helpers.isBlockEditor,w=()=>(0,i.createElement)(r.Fragment,null,(0,i.createElement)(l.Fill,{name:"YoastFacebookPremiumMetabox"},(e=>(0,i.createElement)(p,{...e}))),(0,i.createElement)(l.Fill,{name:"YoastFacebookPremiumModal"},(e=>(0,i.createElement)(p,{...e}))),(0,i.createElement)(l.Fill,{name:"YoastTwitterPremiumMetabox"},(e=>(0,i.createElement)(u,{...e}))),(0,i.createElement)(l.Fill,{name:"YoastTwitterPremiumModal"},(e=>(0,i.createElement)(u,{...e}))));jQuery(window).on("YoastSEO:ready",(()=>{b()?(0,a.registerPlugin)("yoast-seo-premium-social-previews",{render:w}):YoastSEO._registerReactComponent("yoast-seo-premium-social-previews",w)}))})(); |