File "custom-post-meta.min.js"

Full Path: /home/arielcor/public_html/wp-content/plugins/visual-portfolio/gutenberg/custom-post-meta.min.js
File size: 5.67 KB
MIME-type: text/plain
Charset: utf-8

!function(){var e={8180:function(){const{__:e}=wp.i18n,{withInstanceId:t,compose:o}=wp.compose,{withSelect:n,withDispatch:a}=wp.data,{Component:i}=wp.element,{PanelRow:r,FocalPointPicker:l}=wp.components,{addFilter:s}=wp.hooks,m=o([n((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getMedia:o}=e("core"),n=t("featured_media"),a=t("meta")||{};return{thumbnailData:n?o(n):null,getMeta:e=>a[e]}})),a((e=>({updateMeta(t,o){e("core/editor").editPost({meta:{[t]:o}})}}))),t])(class extends i{render(){const{getMeta:t,thumbnailData:o,updateMeta:n}=this.props;let a="";if(o){const e="post-thumbnail";if(a=o.source_url,!o.mime_type||"image/gif"!==o.mime_type)if(o.media_details&&o.media_details.sizes&&o.media_details.sizes[e])a=o.media_details.sizes[e].source_url;else{const e="thumbnail";o.media_details&&o.media_details.sizes&&o.media_details.sizes[e]&&(a=o.media_details.sizes[e].source_url)}}if(!a)return null;let i=t("_vp_image_focal_point");return i&&i.x&&i.y||(i={x:"0.5",y:"0.5"}),wp.element.createElement("div",{className:"vpf-post-image-focal-point-panel"},wp.element.createElement(r,null,wp.element.createElement("p",{className:"description"},e("Focal point will be used in Visual Portfolio layouts only.","visual-portfolio"))),wp.element.createElement(r,null,wp.element.createElement(l,{url:a,value:i,onChange:e=>{n("_vp_image_focal_point",e)}})))}});s("editor.PostFeaturedImage","vpf/post-featured-image-focal-point",(e=>function(t){return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(m,null),wp.element.createElement(e,t))}))}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}!function(){"use strict";function e(e,t,o,n){var a,i=!1,r=0;function l(){a&&clearTimeout(a)}function s(){for(var s=arguments.length,m=new Array(s),p=0;p<s;p++)m[p]=arguments[p];var d=this,c=Date.now()-r;function u(){r=Date.now(),o.apply(d,m)}function w(){a=void 0}i||(n&&!a&&u(),l(),void 0===n&&c>e?u():!0!==t&&(a=setTimeout(n?w:u,void 0===n?e-c:e)))}return"boolean"!=typeof t&&(n=o,o=t,t=void 0),s.cancel=function(){l(),i=!0},s}const{__:t,sprintf:n}=wp.i18n,{withInstanceId:a,compose:i}=wp.compose,{withSelect:r,withDispatch:l}=wp.data,{Component:s}=wp.element,{PanelRow:m,TextControl:p}=wp.components,{PluginDocumentSettingPanel:d}=wp.editPost||{},{registerPlugin:c}=wp.plugins,{jQuery:u,ajaxurl:w,VPGutenbergMetaVariables:h}=window,f=i([r((e=>({getMeta:t=>(e("core/editor").getEditedPostAttribute("meta")||{})[t],postFormat:e("core/editor").getEditedPostAttribute("format")}))),l((e=>({updateMeta(t,o){e("core/editor").editPost({meta:{[t]:o}})}}))),a])(class extends s{constructor(t){var o,n,a,i;super(t),this.state={oembedQuery:"",oembedHTML:""},this.maybePrepareOembed=(300,o=this.maybePrepareOembed.bind(this),n=[],a=null,i=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n=t,a||(a=requestAnimationFrame((function(){a=null,o.apply(void 0,n)})))},i.cancel=function(){a&&(cancelAnimationFrame(a),a=null)},e(300,i,!1))}componentDidMount(){this.maybePrepareOembed()}componentDidUpdate(){this.maybePrepareOembed()}maybePrepareOembed(){const{oembedQuery:e,oembedHTML:t}=this.state,{getMeta:o,postFormat:n}=this.props;if("video"!==n)return;const a=o("_vp_format_video_url");e!==a&&(this.oembedAjax&&this.oembedAjax.abort&&this.oembedAjax.abort(),e||!t?this.oembedAjax=u.ajax({url:w,method:"POST",dataType:"json",data:{action:"vp_find_oembed",q:a,nonce:h.nonce},complete:e=>{const t=e.responseJSON,o={oembedQuery:a,oembedHTML:""};t&&void 0!==t.html&&(o.oembedHTML=t.html),this.setState(o),this.oembedAjax=null}}):this.setState({oembedHTML:""}))}render(){const{getMeta:e,postFormat:o,updateMeta:a}=this.props,{oembedHTML:i}=this.state;return"video"!==o?null:wp.element.createElement(d,{name:"VPVideo",title:t("Video","visual-portfolio"),icon:wp.element.createElement("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M19.25 10C19.25 15.1086 15.1086 19.25 10 19.25C4.89137 19.25 0.75 15.1086 0.75 10C0.75 4.89137 4.89137 0.75 10 0.75C15.1086 0.75 19.25 4.89137 19.25 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}),wp.element.createElement("path",{d:"M8 12.6326V7.36671C8.00011 7.30082 8.01856 7.23618 8.05342 7.17955C8.08828 7.12293 8.13826 7.0764 8.19812 7.04485C8.25798 7.0133 8.32552 6.99789 8.39367 7.00023C8.46181 7.00257 8.52805 7.02258 8.58544 7.05816L12.8249 9.69035C12.8786 9.72358 12.9228 9.76933 12.9534 9.82337C12.984 9.87742 13 9.93803 13 9.99963C13 10.0612 12.984 10.1218 12.9534 10.1759C12.9228 10.2299 12.8786 10.2757 12.8249 10.3089L8.58544 12.9418C8.52805 12.9774 8.46181 12.9974 8.39367 12.9998C8.32552 13.0021 8.25798 12.9867 8.19812 12.9551C8.13826 12.9236 8.08828 12.8771 8.05342 12.8204C8.01856 12.7638 8.00011 12.6992 8 12.6333V12.6326Z",fill:"currentColor"})),className:"vpf-meta-video-panel"},wp.element.createElement(m,null,wp.element.createElement("p",{className:"description"},n(t("Video will be used in %s layouts only. Full list of supported links","visual-portfolio"),h.plugin_name)," ",wp.element.createElement("a",{href:"https://visualportfolio.co/docs/portfolio-items/video-portfolio-item/#supported-video-vendors",target:"_blank",rel:"noopener noreferrer"},t("see here","visual-portfolio")))),wp.element.createElement(m,null,wp.element.createElement(p,{label:t("Video URL","visual-portfolio"),value:e("_vp_format_video_url")||"",onChange:e=>{a("_vp_format_video_url",e)},type:"url",placeholder:"https://"})),wp.element.createElement(m,null,wp.element.createElement("div",{className:"vp-oembed-preview",dangerouslySetInnerHTML:{__html:i}})))}});wp.editPost&&c("vp-video",{render:f}),o(8180)}()}();