diff --git a/assets/css/banner.css b/assets/css/banner.css new file mode 100644 index 00000000..8955e944 --- /dev/null +++ b/assets/css/banner.css @@ -0,0 +1,50 @@ +.tsdk-banner-cta { + position: relative; + display: inline-block; +} + +.tsdk-banner-urgency-text { + position: absolute; + top: 6%; + left: 1%; + color: white; + padding: 5px; + font-size: 16px; + z-index: 10; + text-transform: uppercase; + font-weight: 700; +} + +.tsdk-banner-img { + width: 100%; + height: auto; +} + +@media (max-width: 1100px) { + .tsdk-banner-urgency-text { + font-size: 10px; + top: 0; + left: 1%; + } +} + +@media (max-width: 950px) { + .tsdk-banner-urgency-text { + font-size: 10px; + left: 1%; + } +} + +@media (max-width: 500px) { + .tsdk-banner-urgency-text { + font-size: 6px; + top: -10%; + left: 1%; + } +} + +@media (max-width: 420px) { + .tsdk-banner-urgency-text { + left: 0%; + } +} \ No newline at end of file diff --git a/assets/js/build/about/about.asset.php b/assets/js/build/about/about.asset.php index 878d8508..2479fd8d 100644 --- a/assets/js/build/about/about.asset.php +++ b/assets/js/build/about/about.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-element'), 'version' => 'fc64a210bede1308e242'); + array('react', 'wp-components', 'wp-element'), 'version' => '7d782affa8469fa8f48d'); diff --git a/assets/js/build/about/about.css b/assets/js/build/about/about.css index 90d73702..7340054f 100644 --- a/assets/js/build/about/about.css +++ b/assets/js/build/about/about.css @@ -1 +1 @@ -#wpcontent{padding-left:0 !important}.ti-about{--border: 1px solid #ccc;--link-color: var(--wp-admin-theme-color);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:normal;display:grid;gap:30px}.ti-about .container{margin:0 auto;max-width:960px;padding:0 15px}.ti-about p{font-size:14px;line-height:1.6}.ti-about button{font-weight:600}.ti-about .spin{animation:spin 1s infinite linear}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.ti-about .head{background:#fff;border-bottom:var(--border);padding:18px 0}.ti-about .head .container{padding:0 15px;display:flex;flex-wrap:wrap;align-items:center}.ti-about .head img{max-height:55px}.ti-about .head p{margin-left:10px}.ti-about .head a{font-style:italic;font-weight:bold}.ti-about .nav{border-bottom:var(--border);display:flex;flex-wrap:wrap;font-size:16px;margin:0;font-weight:600;-moz-column-gap:20px;column-gap:20px}.ti-about .nav a{border-bottom:4px solid rgba(0,0,0,0);color:#868686;padding:20px 10px;text-decoration:none;margin-bottom:-1px;box-sizing:border-box}.ti-about .nav a:hover{color:#313233}.ti-about .nav li{display:flex;margin:0}.ti-about .nav li.active a{border-color:var(--link-color);color:#313233}.ti-about .story-card .footer,.ti-about .story-card .body{display:grid;grid-template-columns:var(--grid, 1fr);align-items:center}.ti-about .story-card{border:var(--border);border-radius:0 0 10px 10px}.ti-about .story-card .body{background:#fff;padding:35px 35px 10px 35px}.ti-about .story-card .body h2{font-size:30px;margin:0 0 30px;color:#1f1d1d}.ti-about .story-card .body p{color:#1e1e1e}.ti-about .story-card .body figure{order:0;margin:0}.ti-about .story-card .body figcaption{margin:10px 0;color:#797979;font-size:12px}.ti-about .story-card .body img{border-radius:8px;max-width:100%}.ti-about .story-card .footer{border-top:var(--border);padding:30px 40px}.ti-about .story-card .footer h2{margin:0 0 20px;text-align:center;font-size:21px}.ti-about .story-card form{display:flex;align-items:center}.ti-about .story-card form .dashicons-yes-alt{color:#609952}.ti-about .story-card input{height:36px;flex-grow:1;border:var(--border);border-radius:2px;font-size:12px;margin-right:15px}.ti-about .product-cards{display:grid;gap:30px}.ti-about .product-card{background:#fff;display:grid;border:var(--border)}.ti-about .product-card h2{font-size:21px;margin:0}.ti-about .product-card p{margin:0;color:#6c6c6c}.ti-about .product-card .header{padding:20px 15px 0;display:flex;align-items:center}.ti-about .product-card .body{padding:20px 15px}.ti-about .product-card img{max-width:50px;margin-right:15px;border-radius:6px}.ti-about .product-card .footer{border-top:var(--border);display:flex;align-items:center;padding:15px;align-self:flex-end;justify-content:space-between}.ti-about .product-card .footer p{margin:8px 0;font-weight:600;font-size:13px;color:#313233}.ti-about .product-card .footer .not-installed{color:#7e7e7e}.ti-about .product-card .footer .active{color:#609952}.ti-about .product-card button,.ti-about .product-card a,.ti-about .product-card .spin{margin-left:auto;text-decoration:none}.ti-about .product-page{margin:0 auto;padding:0;width:100%;max-width:960px;border:1px solid #ccc;border-radius:8px;background-color:#fff}.ti-about .product-page .hero{display:flex;flex-direction:column;align-items:center;padding:64px;border-bottom:1px solid #ccc}.ti-about .product-page .hero h1{font-size:30px;line-height:42px;max-width:500px;text-align:center}.ti-about .product-page .hero p{font-size:14px;line-height:24px;max-width:500px;text-align:center}.ti-about .product-page .hero .logo{width:64px;margin-bottom:24px}.ti-about .product-page .hero .label{font-size:10px;line-height:12px;color:#ed6f57;background-color:rgba(237,111,87,.1803921569);padding:8px 16px;border-radius:4px}.ti-about .product-page .col-3-highlights{display:flex;flex-direction:column;justify-content:space-evenly;padding:24px 0;border-bottom:1px solid #ccc;align-items:center;text-align:center}.ti-about .product-page .col-3-highlights .col{max-width:360px}.ti-about .product-page .col-3-highlights .col h3{font-size:21px;line-height:32px;margin-bottom:8px}.ti-about .product-page .col-3-highlights .col p{font-size:14px;line-height:24px}.ti-about .product-page .col-2-highlights{display:flex;flex-direction:column;justify-content:space-evenly;align-items:center;padding:24px 0;border-bottom:1px solid #ccc}.ti-about .product-page .col-2-highlights .col{width:90%}.ti-about .product-page .col-2-highlights .col img{max-width:450px;width:100%}.ti-about .product-page .col-2-highlights .col h2{font-size:24px;line-height:35px;margin-bottom:8px}.ti-about .product-page .col-2-highlights .col p{font-size:14px;line-height:24px}.ti-about .product-page .button-row{display:flex;gap:12px;margin-top:48px}.ti-about .otter-blocks .testimonial-nav{display:flex;gap:8px}.ti-about .otter-blocks .testimonial-nav .testimonial-button{width:10px;height:10px;background-color:#d9d9d9;margin:0;padding:0;border-radius:50%}.ti-about .otter-blocks .testimonial-nav .testimonial-button.active{background-color:#ed6f57}.ti-about .otter-blocks .testimonial-container{width:100%;max-width:450px;display:flex;overflow-x:scroll;scroll-behavior:smooth;margin:0;padding:0}.ti-about .otter-blocks .testimonial-container::-webkit-scrollbar{display:none}.ti-about .otter-blocks .testimonial-container .testimonial{width:100%;flex:1 0 100%;display:flex;flex-wrap:wrap;justify-content:left;gap:14px;align-items:center}.ti-about .otter-blocks .testimonial-container .testimonial p{width:100%;font-size:14px;line-height:24px}.ti-about .otter-blocks .testimonial-container .testimonial h3{font-size:16px;line-height:20px;font-weight:700;color:#1c1c1c}.ti-about .otter-blocks .testimonial-container .testimonial img{width:36px;height:36px;border-radius:50%}.ti-about .otter-blocks .otter-button.is-primary{background-color:#ed6f57}.ti-about .otter-blocks .otter-button.is-secondary{color:#ed6f57;box-shadow:inset 0 0 0 1px #ed6f57}.ti-about .otter-blocks .otter-button.is-loading{background-color:#6c6c6c;color:#fff}@media (min-width: 660px){.ti-about .product-cards{grid-template-columns:1fr 1fr}.ti-about .product-page .col-3-highlights,.ti-about .product-page .col-2-highlights{flex-direction:row;padding:64px 0}.ti-about .product-page .col-3-highlights{text-align:left}.ti-about .product-page .col-3-highlights .col{max-width:200px}.ti-about .product-page .col-2-highlights .col{width:45%}}@media (min-width: 992px){.ti-about .story-card .footer,.ti-about .story-card .body{gap:60px}.ti-about .story-card{--grid: 1.1fr 1fr}.ti-about .story-card .footer h2{margin:0;text-align:left}.ti-about .product-cards{grid-template-columns:1fr 1fr 1fr}} +#wpcontent{padding-left:0 !important}.ti-about{--border: 1px solid #ccc;--link-color: var(--wp-admin-theme-color);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:normal;display:grid;gap:30px}.ti-about .container{margin:0 auto;max-width:960px;padding:0 15px}.ti-about p{font-size:14px;line-height:1.6}.ti-about button{font-weight:600}.ti-about .spin{animation:spin 1s infinite linear}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.ti-about .head{background:#fff;border-bottom:var(--border);padding:18px 0}.ti-about .head .container{padding:0 15px;display:flex;flex-wrap:wrap;align-items:center}.ti-about .head img{max-height:55px}.ti-about .head p{margin-left:10px}.ti-about .head p.review-link{margin-left:auto}.ti-about .head a{font-style:italic;font-weight:bold}.ti-about .nav{border-bottom:var(--border);display:flex;flex-wrap:wrap;font-size:16px;margin:0;font-weight:600;-moz-column-gap:20px;column-gap:20px}.ti-about .nav a{border-bottom:4px solid rgba(0,0,0,0);color:#868686;padding:20px 10px;text-decoration:none;margin-bottom:-1px;box-sizing:border-box}.ti-about .nav a:hover{color:#313233}.ti-about .nav li{display:flex;margin:0}.ti-about .nav li.active a{border-color:var(--link-color);color:#313233}.ti-about .story-card .footer,.ti-about .story-card .body{display:grid;grid-template-columns:var(--grid, 1fr);align-items:center}.ti-about .story-card{border:var(--border);border-radius:0 0 10px 10px}.ti-about .story-card .body{background:#fff;padding:35px 35px 10px 35px}.ti-about .story-card .body h2{font-size:30px;margin:0 0 30px;color:#1f1d1d}.ti-about .story-card .body p{color:#1e1e1e}.ti-about .story-card .body figure{order:0;margin:0}.ti-about .story-card .body figcaption{margin:10px 0;color:#797979;font-size:12px}.ti-about .story-card .body img{border-radius:8px;max-width:100%}.ti-about .story-card .footer{border-top:var(--border);padding:30px 40px}.ti-about .story-card .footer h2{margin:0 0 20px;text-align:center;font-size:21px}.ti-about .story-card form{display:flex;align-items:center}.ti-about .story-card form .dashicons-yes-alt{color:#609952}.ti-about .story-card input{height:36px;flex-grow:1;border:var(--border);border-radius:2px;font-size:12px;margin-right:15px}.ti-about .product-cards{display:grid;gap:30px}.ti-about .product-card{background:#fff;border:var(--border);display:flex;flex-direction:column}.ti-about .product-card *{box-sizing:border-box}.ti-about .product-card h2{font-size:21px;margin:0}.ti-about .product-card p{margin:0;color:#6c6c6c}.ti-about .product-card .header{padding:20px 15px 0;display:flex;width:100%;align-items:center}.ti-about .product-card .body{padding:20px 15px;width:100%}.ti-about .product-card img{max-width:50px;margin-right:15px;border-radius:6px}.ti-about .product-card .footer{border-top:var(--border);display:flex;align-items:center;padding:15px;width:100%;margin-top:auto;align-self:flex-end;justify-content:space-between}.ti-about .product-card .footer p{margin:8px 0;font-weight:600;font-size:13px;color:#313233}.ti-about .product-card .footer .not-installed{color:#7e7e7e}.ti-about .product-card .footer .active{color:#609952}.ti-about .product-card button,.ti-about .product-card a,.ti-about .product-card .spin{margin-left:auto;text-decoration:none}.ti-about .product-page{margin:0 auto;padding:0;width:100%;max-width:960px;border:1px solid #ccc;border-radius:8px;background-color:#fff}.ti-about .product-page .hero{display:flex;flex-direction:column;align-items:center;padding:64px;border-bottom:1px solid #ccc}.ti-about .product-page .hero h1{font-size:30px;line-height:42px;max-width:500px;text-align:center}.ti-about .product-page .hero p{font-size:14px;line-height:24px;max-width:500px;text-align:center}.ti-about .product-page .hero .logo{width:64px;margin-bottom:24px}.ti-about .product-page .hero .label{font-size:10px;line-height:12px;color:#ed6f57;background-color:rgba(237,111,87,.1803921569);padding:8px 16px;border-radius:4px}.ti-about .product-page .col-3-highlights{display:flex;flex-direction:column;justify-content:space-evenly;padding:24px 0;border-bottom:1px solid #ccc;align-items:center;text-align:center}.ti-about .product-page .col-3-highlights .col{max-width:360px}.ti-about .product-page .col-3-highlights .col h3{font-size:21px;line-height:32px;margin-bottom:8px}.ti-about .product-page .col-3-highlights .col p{font-size:14px;line-height:24px}.ti-about .product-page .col-2-highlights{display:flex;flex-direction:column;justify-content:space-evenly;align-items:center;padding:24px 0;border-bottom:1px solid #ccc}.ti-about .product-page .col-2-highlights .col{width:90%}.ti-about .product-page .col-2-highlights .col img{max-width:450px;width:100%}.ti-about .product-page .col-2-highlights .col h2{font-size:24px;line-height:35px;margin-bottom:8px}.ti-about .product-page .col-2-highlights .col p{font-size:14px;line-height:24px}.ti-about .product-page .button-row{display:flex;gap:12px;margin-top:48px}.ti-about .otter-blocks .testimonial-nav{display:flex;gap:8px}.ti-about .otter-blocks .testimonial-nav .testimonial-button{width:10px;height:10px;background-color:#d9d9d9;margin:0;padding:0;border-radius:50%}.ti-about .otter-blocks .testimonial-nav .testimonial-button.active{background-color:#ed6f57}.ti-about .otter-blocks .testimonial-container{width:100%;max-width:450px;display:flex;overflow-x:scroll;scroll-behavior:smooth;margin:0;padding:0}.ti-about .otter-blocks .testimonial-container::-webkit-scrollbar{display:none}.ti-about .otter-blocks .testimonial-container .testimonial{width:100%;flex:1 0 100%;display:flex;flex-wrap:wrap;justify-content:left;gap:14px;align-items:center}.ti-about .otter-blocks .testimonial-container .testimonial p{width:100%;font-size:14px;line-height:24px}.ti-about .otter-blocks .testimonial-container .testimonial h3{font-size:16px;line-height:20px;font-weight:700;color:#1c1c1c}.ti-about .otter-blocks .testimonial-container .testimonial img{width:36px;height:36px;border-radius:50%}.ti-about .otter-blocks .otter-button.is-primary{background-color:#ed6f57}.ti-about .otter-blocks .otter-button.is-secondary{color:#ed6f57;box-shadow:inset 0 0 0 1px #ed6f57}.ti-about .otter-blocks .otter-button.is-loading{background-color:#6c6c6c;color:#fff}@media (min-width: 660px){.ti-about .product-cards{grid-template-columns:1fr 1fr}.ti-about .product-page .col-3-highlights,.ti-about .product-page .col-2-highlights{flex-direction:row;padding:64px 0}.ti-about .product-page .col-3-highlights{text-align:left}.ti-about .product-page .col-3-highlights .col{max-width:200px}.ti-about .product-page .col-2-highlights .col{width:45%}}@media (min-width: 992px){.ti-about .story-card .footer,.ti-about .story-card .body{gap:60px}.ti-about .story-card{--grid: 1.1fr 1fr}.ti-about .story-card .footer h2{margin:0;text-align:left}.ti-about .product-cards{grid-template-columns:repeat(3, minmax(0, 1fr))}} diff --git a/assets/js/build/about/about.js b/assets/js/build/about/about.js index f1b33bea..cfe9c6b2 100644 --- a/assets/js/build/about/about.js +++ b/assets/js/build/about/about.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.React,t=window.wp.element;function a({pages:t=[],selected:a=""}){const{currentProduct:n,logoUrl:l,strings:s,links:c}=window.tiSDKAboutData,i=(e="")=>e===a?"active":"";return(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"head"},(0,e.createElement)("div",{className:"container"},(0,e.createElement)("img",{src:l,alt:n.name}),(0,e.createElement)("p",null,"by ",(0,e.createElement)("a",{href:"https://themeisle.com"},"Themeisle")))),(c.length>0||t.length>0)&&(0,e.createElement)("div",{className:"container"},(0,e.createElement)("ul",{className:"nav"},(0,e.createElement)("li",{className:i()},(0,e.createElement)("a",{href:window.location},s.aboutUs)),t.map(((t,a)=>(0,e.createElement)("li",{className:i(t.hash),key:a},(0,e.createElement)("a",{href:t.hash},t.name)))),c.map(((t,a)=>(0,e.createElement)("li",{key:a},(0,e.createElement)("a",{href:t.url},t.text)))))))}const n=window.wp.components;function l(){const{strings:a,teamImage:l,homeUrl:s,pageSlug:c}=window.tiSDKAboutData,{heroHeader:i,heroTextFirst:r,heroTextSecond:o,teamImageCaption:m,newsHeading:d,emailPlaceholder:u,signMeUp:E}=a,[p,h]=(0,t.useState)(""),[g,v]=(0,t.useState)(!1),[N,b]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"container"},(0,e.createElement)("div",{className:"story-card"},(0,e.createElement)("div",{className:"body"},(0,e.createElement)("div",null,(0,e.createElement)("h2",null,i),(0,e.createElement)("p",null,r),(0,e.createElement)("p",null,o)),(0,e.createElement)("figure",null,(0,e.createElement)("img",{src:l,alt:m}),(0,e.createElement)("figcaption",null,m))),(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("h2",null,d),(0,e.createElement)("form",{onSubmit:e=>{e.preventDefault(),v(!0),fetch("https://api.themeisle.com/tracking/subscribe",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, */*;q=0.1","Cache-Control":"no-cache"},body:JSON.stringify({slug:"about-us",site:s,from:c,email:p})}).then((e=>e.json())).then((e=>{v(!1),"success"===e.code&&b(!0)}))?.catch((e=>{v(!1)}))}},(0,e.createElement)("input",{disabled:g||N,type:"email",value:p,onChange:e=>{h(e.target.value)},placeholder:u}),!g&&!N&&(0,e.createElement)(n.Button,{isPrimary:!0,type:"submit"},E),g&&(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),N&&(0,e.createElement)("span",{className:"dashicons dashicons-yes-alt"})))))}const s=(e,t=!1)=>new Promise((a=>{wp.updates.ajax(!0===t?"install-theme":"install-plugin",{slug:e,success:e=>{a({success:!0,data:e})},error:e=>{a({success:!1,code:e.errorCode})}})}));function c({product:a,slug:l}){const{icon:c,name:i,description:r,status:o,premiumUrl:m,activationLink:d}=a,{strings:u,canInstallPlugins:E,canActivatePlugins:p}=window.tiSDKAboutData,{installNow:h,installed:g,notInstalled:v,active:N,activate:b,learnMore:w}=u,f=!!m,[y,k]=(0,t.useState)(o),[S,T]=(0,t.useState)(!1),D=async()=>{T(!0),await s(l,"neve"===l).then((e=>{e.success&&k("installed")})),T(!1)},x=async()=>{T(!0),window.location.href=d},_=()=>"not-installed"===y&&f?(0,e.createElement)(n.Button,{isLink:!0,icon:"external",href:m,target:"_blank"},w):"not-installed"!==y||f?"installed"===y?(0,e.createElement)(n.Button,{isSecondary:!0,onClick:x,disabled:S||!p},b):null:(0,e.createElement)(n.Button,{isPrimary:!0,onClick:D,disabled:S||!E},h),C=!E&&"not-installed"===y||!p&&"installed"===y?(0,e.createElement)(n.Tooltip,{text:`Ask your admin to enable ${i} on your site`,position:"top center"},_()):_();return(0,e.createElement)("div",{className:"product-card"},(0,e.createElement)("div",{className:"header"},c&&(0,e.createElement)("img",{src:c,alt:i}),(0,e.createElement)("h2",null,i)),(0,e.createElement)("div",{className:"body"},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:r}})),(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("p",null,"Status:"," ",(0,e.createElement)("span",{className:y},"installed"===y&&g,"not-installed"===y&&v,"active"===y&&N)),"active"!==y&&!S&&C,S&&(0,e.createElement)("span",{className:"dashicons dashicons-update spin"})))}function i(){const{products:t}=window.tiSDKAboutData;return(0,e.createElement)("div",{className:"container"},(0,e.createElement)("div",{className:"product-cards"},Object.keys(t).map(((a,n)=>(0,e.createElement)(c,{key:a,slug:a,product:t[a]})))))}const r={"otter-page":function({page:a={}}){const{products:l,canInstallPlugins:c,canActivatePlugins:i}=window.tiSDKAboutData,{strings:r,plugin:o}=a,m=a&&a.product?a.product:"",d=m&&l[m]&&l[m].icon?l[m].icon:null,[u,E]=(0,t.useState)(r.testimonials.users[0]),[p,h]=(0,t.useState)(o.status),[g,v]=(0,t.useState)(!1),N="In Progress",b=async()=>{v(!0),await s(m,!1).then((e=>{e.success&&(h("installed"),w())}))},w=async()=>{v(!0),window.location.href=o.activationLink},f=(0,e.createElement)(n.Button,{variant:"primary",disabled:g||("not-installed"===p?!c:!i),className:"otter-button"+(g?" is-loading":""),onClick:"not-installed"===p?b:w},g?(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"dashicons dashicons-update spin"})," ",N):r.buttons.install_otter_free),y=(0,e.createElement)(n.Button,{variant:"primary",disabled:g||("not-installed"===p?!c:!i),className:"otter-button"+(g?" is-loading":""),onClick:"not-installed"===p?b:w},g?(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),N):r.buttons.install_now),k=!c&&"not-installed"===p||!i&&"installed"===p||!1,S=t=>k?(0,e.createElement)(n.Tooltip,{text:"Ask your admin to enable Otter on your site",position:"top center"},t):t;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"hero"},d&&(0,e.createElement)("img",{className:"logo",src:d,alt:a.name||""}),(0,e.createElement)("span",{className:"label"},"Neve + Otter = New Possibilities 🤝"),(0,e.createElement)("h1",null,r.heading),(0,e.createElement)("p",null,r.text),("not-installed"===p||"installed"===p)&&S(f)),(0,e.createElement)("div",{className:"col-3-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h3",null,r.features.advancedTitle),(0,e.createElement)("p",null,r.features.advancedDesc)),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h3",null,r.features.fastTitle),(0,e.createElement)("p",null,r.features.fastDesc)),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h3",null,r.features.mobileTitle),(0,e.createElement)("p",null,r.features.mobileDesc))),(0,e.createElement)("div",{className:"col-2-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("img",{src:r.details.s1Image,alt:r.details.s1Title})),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.details.s1Title),(0,e.createElement)("p",null,r.details.s1Text))),(0,e.createElement)("div",{className:"col-2-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.details.s2Title),(0,e.createElement)("p",null,r.details.s2Text)),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("img",{src:r.details.s2Image,alt:r.details.s1Title}))),(0,e.createElement)("div",{className:"col-2-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("img",{src:r.details.s3Image,alt:r.details.s1Title})),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.details.s3Title),(0,e.createElement)("p",null,r.details.s3Text))),(0,e.createElement)("div",{className:"col-2-highlights",style:{backgroundColor:"#F7F7F7",borderBottom:"none",borderBottomRightRadius:"8px",borderBottomLeftRadius:"8px"}},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.testimonials.heading),(0,e.createElement)("div",{className:"button-row"},("not-installed"===p||"installed"===p)&&S(y),(0,e.createElement)("a",{className:"components-button otter-button is-secondary",href:r.buttons.learn_more_link,target:"_blank",rel:"external noreferrer noopener"},r.buttons.learn_more))),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("div",{className:"testimonials"},(0,e.createElement)("ul",{id:"testimonial-container",className:"testimonial-container"},r.testimonials.users.map(((t,a)=>(0,e.createElement)("li",{className:"testimonial",id:"ts_"+a,key:"ts_"+a},(0,e.createElement)("p",null,'"',t.text,'"'),(0,e.createElement)("img",{src:t.avatar,alt:t.name}),(0,e.createElement)("h3",null,t.name))))),(0,e.createElement)("div",{className:"testimonial-nav"},r.testimonials.users.map(((t,a)=>(0,e.createElement)(n.Button,{className:"testimonial-button"+(t.name===u.name?" active":""),key:"button_"+a,onClick:()=>(e=>{const t=r.testimonials.users[e];document.getElementById("ts_"+e).scrollIntoView({behavior:"smooth"}),E(t)})(a)}))))))))}};function o(t){const a=r[t.id];return(0,e.createElement)(a,{page:t.page})}function m({page:t={}}){return(0,e.createElement)("div",{className:"product-page"+(t&&t.product?" "+t.product:"")},(0,e.createElement)(o,{id:t.id,page:t}))}const d=()=>{let e=window.location.hash;return"string"!=typeof window.location.hash?null:e};function u(){const{productPages:n}=window.tiSDKAboutData,s=n?Object.keys(n).map((e=>{const t=n[e];return t.id=e,t})):[],[c,r]=(0,t.useState)(d()),o=()=>{const e=d();null!==e&&r(e)};(0,t.useEffect)((()=>(o(),window.addEventListener("hashchange",o),()=>{window.removeEventListener("hashchange",o)})),[]);const u=s.filter((e=>e.hash===c));return u.length>0?(0,e.createElement)("div",{className:"ti-about"},(0,e.createElement)(a,{pages:s,selected:c}),(0,e.createElement)(m,{page:u[0]})):(0,e.createElement)("div",{className:"ti-about"},(0,e.createElement)(a,{pages:s}),(0,e.createElement)(l,null),(0,e.createElement)(i,null))}document.addEventListener("DOMContentLoaded",(()=>{const a=document.querySelector("#ti-sdk-about");a&&(0,t.render)((0,e.createElement)(u,null),a)}))})(); \ No newline at end of file +(()=>{"use strict";const e=window.React,t=window.wp.element;function a({pages:t=[],selected:a=""}){const{currentProduct:n,logoUrl:l,strings:s,links:c}=window.tiSDKAboutData,i=(e="")=>e===a?"active":"",r=`https://wordpress.org/support/${["neve","hestia"].indexOf(n.slug)>-1?"theme":"plugin"}/${n.slug?.replaceAll("_","-")}/reviews/#new-post`;return(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"head"},(0,e.createElement)("div",{className:"container"},(0,e.createElement)("img",{src:l,alt:n.name}),(0,e.createElement)("p",null,"by ",(0,e.createElement)("a",{href:"https://themeisle.com"},"Themeisle")),(0,e.createElement)("p",{className:"review-link"},"Enjoying ",n.name,"? ",(0,e.createElement)("a",{href:r,target:"_blank"},"Give us a rating!")))),(c.length>0||t.length>0)&&(0,e.createElement)("div",{className:"container"},(0,e.createElement)("ul",{className:"nav"},(0,e.createElement)("li",{className:i()},(0,e.createElement)("a",{href:window.location},s.aboutUs)),t.map(((t,a)=>(0,e.createElement)("li",{className:i(t.hash),key:a},(0,e.createElement)("a",{href:t.hash},t.name)))),c.map(((t,a)=>(0,e.createElement)("li",{key:a},(0,e.createElement)("a",{href:t.url},t.text)))))))}const n=window.wp.components;function l(){const{strings:a,teamImage:l,homeUrl:s,pageSlug:c}=window.tiSDKAboutData,{heroHeader:i,heroTextFirst:r,heroTextSecond:o,teamImageCaption:m,newsHeading:d,emailPlaceholder:u,signMeUp:E}=a,[p,h]=(0,t.useState)(""),[g,v]=(0,t.useState)(!1),[N,b]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"container"},(0,e.createElement)("div",{className:"story-card"},(0,e.createElement)("div",{className:"body"},(0,e.createElement)("div",null,(0,e.createElement)("h2",null,i),(0,e.createElement)("p",null,r),(0,e.createElement)("p",null,o)),(0,e.createElement)("figure",null,(0,e.createElement)("img",{src:l,alt:m}),(0,e.createElement)("figcaption",null,m))),(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("h2",null,d),(0,e.createElement)("form",{onSubmit:e=>{e.preventDefault(),v(!0),fetch("https://api.themeisle.com/tracking/subscribe",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, */*;q=0.1","Cache-Control":"no-cache"},body:JSON.stringify({slug:"about-us",site:s,from:c,email:p})}).then((e=>e.json())).then((e=>{v(!1),"success"===e.code&&b(!0)}))?.catch((e=>{v(!1)}))}},(0,e.createElement)("input",{disabled:g||N,type:"email",value:p,onChange:e=>{h(e.target.value)},placeholder:u}),!g&&!N&&(0,e.createElement)(n.Button,{isPrimary:!0,type:"submit"},E),g&&(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),N&&(0,e.createElement)("span",{className:"dashicons dashicons-yes-alt"})))))}const s=(e,t=!1)=>new Promise((a=>{wp.updates.ajax(!0===t?"install-theme":"install-plugin",{slug:e,success:e=>{a({success:!0,data:e})},error:e=>{a({success:!1,code:e.errorCode})}})}));function c({product:a,slug:l}){const{icon:c,name:i,description:r,status:o,premiumUrl:m,activationLink:d}=a,{strings:u,canInstallPlugins:E,canActivatePlugins:p}=window.tiSDKAboutData,{installNow:h,installed:g,notInstalled:v,active:N,activate:b,learnMore:w}=u,f=!!m,[y,k]=(0,t.useState)(o),[S,T]=(0,t.useState)(!1),D=async()=>{T(!0),await s(l,"neve"===l).then((e=>{e.success&&k("installed")})),T(!1)},x=async()=>{T(!0),window.location.href=d},_=()=>"not-installed"===y&&f?(0,e.createElement)(n.Button,{isLink:!0,icon:"external",href:m,target:"_blank"},w):"not-installed"!==y||f?"installed"===y?(0,e.createElement)(n.Button,{isSecondary:!0,onClick:x,disabled:S||!p},b):null:(0,e.createElement)(n.Button,{isPrimary:!0,onClick:D,disabled:S||!E},h),C=!E&&"not-installed"===y||!p&&"installed"===y?(0,e.createElement)(n.Tooltip,{text:`Ask your admin to enable ${i} on your site`,position:"top center"},_()):_();return(0,e.createElement)("div",{className:"product-card"},(0,e.createElement)("div",{className:"header"},c&&(0,e.createElement)("img",{src:c,alt:i}),(0,e.createElement)("h2",null,i)),(0,e.createElement)("div",{className:"body"},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:r}})),(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("p",null,"Status:"," ",(0,e.createElement)("span",{className:y},"installed"===y&&g,"not-installed"===y&&v,"active"===y&&N)),"active"!==y&&!S&&C,S&&(0,e.createElement)("span",{className:"dashicons dashicons-update spin"})))}function i(){const{products:t}=window.tiSDKAboutData;return(0,e.createElement)("div",{className:"container"},(0,e.createElement)("div",{className:"product-cards"},Object.keys(t).map(((a,n)=>(0,e.createElement)(c,{key:a,slug:a,product:t[a]})))))}const r={"otter-page":function({page:a={}}){const{products:l,canInstallPlugins:c,canActivatePlugins:i}=window.tiSDKAboutData,{strings:r,plugin:o}=a,m=a&&a.product?a.product:"",d=m&&l[m]&&l[m].icon?l[m].icon:null,[u,E]=(0,t.useState)(r.testimonials.users[0]),[p,h]=(0,t.useState)(o.status),[g,v]=(0,t.useState)(!1),N="In Progress",b=async()=>{v(!0),await s(m,!1).then((e=>{e.success&&(h("installed"),w())}))},w=async()=>{v(!0),window.location.href=o.activationLink},f=(0,e.createElement)(n.Button,{variant:"primary",disabled:g||("not-installed"===p?!c:!i),className:"otter-button"+(g?" is-loading":""),onClick:"not-installed"===p?b:w},g?(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"dashicons dashicons-update spin"})," ",N):r.buttons.install_otter_free),y=(0,e.createElement)(n.Button,{variant:"primary",disabled:g||("not-installed"===p?!c:!i),className:"otter-button"+(g?" is-loading":""),onClick:"not-installed"===p?b:w},g?(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),N):r.buttons.install_now),k=!c&&"not-installed"===p||!i&&"installed"===p||!1,S=t=>k?(0,e.createElement)(n.Tooltip,{text:"Ask your admin to enable Otter on your site",position:"top center"},t):t;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"hero"},d&&(0,e.createElement)("img",{className:"logo",src:d,alt:a.name||""}),(0,e.createElement)("span",{className:"label"},"Neve + Otter = New Possibilities 🤝"),(0,e.createElement)("h1",null,r.heading),(0,e.createElement)("p",null,r.text),("not-installed"===p||"installed"===p)&&S(f)),(0,e.createElement)("div",{className:"col-3-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h3",null,r.features.advancedTitle),(0,e.createElement)("p",null,r.features.advancedDesc)),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h3",null,r.features.fastTitle),(0,e.createElement)("p",null,r.features.fastDesc)),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h3",null,r.features.mobileTitle),(0,e.createElement)("p",null,r.features.mobileDesc))),(0,e.createElement)("div",{className:"col-2-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("img",{src:r.details.s1Image,alt:r.details.s1Title})),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.details.s1Title),(0,e.createElement)("p",null,r.details.s1Text))),(0,e.createElement)("div",{className:"col-2-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.details.s2Title),(0,e.createElement)("p",null,r.details.s2Text)),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("img",{src:r.details.s2Image,alt:r.details.s1Title}))),(0,e.createElement)("div",{className:"col-2-highlights"},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("img",{src:r.details.s3Image,alt:r.details.s1Title})),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.details.s3Title),(0,e.createElement)("p",null,r.details.s3Text))),(0,e.createElement)("div",{className:"col-2-highlights",style:{backgroundColor:"#F7F7F7",borderBottom:"none",borderBottomRightRadius:"8px",borderBottomLeftRadius:"8px"}},(0,e.createElement)("div",{className:"col"},(0,e.createElement)("h2",null,r.testimonials.heading),(0,e.createElement)("div",{className:"button-row"},("not-installed"===p||"installed"===p)&&S(y),(0,e.createElement)("a",{className:"components-button otter-button is-secondary",href:r.buttons.learn_more_link,target:"_blank",rel:"external noreferrer noopener"},r.buttons.learn_more))),(0,e.createElement)("div",{className:"col"},(0,e.createElement)("div",{className:"testimonials"},(0,e.createElement)("ul",{id:"testimonial-container",className:"testimonial-container"},r.testimonials.users.map(((t,a)=>(0,e.createElement)("li",{className:"testimonial",id:"ts_"+a,key:"ts_"+a},(0,e.createElement)("p",null,'"',t.text,'"'),(0,e.createElement)("img",{src:t.avatar,alt:t.name}),(0,e.createElement)("h3",null,t.name))))),(0,e.createElement)("div",{className:"testimonial-nav"},r.testimonials.users.map(((t,a)=>(0,e.createElement)(n.Button,{className:"testimonial-button"+(t.name===u.name?" active":""),key:"button_"+a,onClick:()=>(e=>{const t=r.testimonials.users[e];document.getElementById("ts_"+e).scrollIntoView({behavior:"smooth"}),E(t)})(a)}))))))))}};function o(t){const a=r[t.id];return(0,e.createElement)(a,{page:t.page})}function m({page:t={}}){return(0,e.createElement)("div",{className:"product-page"+(t&&t.product?" "+t.product:"")},(0,e.createElement)(o,{id:t.id,page:t}))}const d=()=>{let e=window.location.hash;return"string"!=typeof window.location.hash?null:e};function u(){const{productPages:n}=window.tiSDKAboutData,s=n?Object.keys(n).map((e=>{const t=n[e];return t.id=e,t})):[],[c,r]=(0,t.useState)(d()),o=()=>{const e=d();null!==e&&r(e)};(0,t.useEffect)((()=>(o(),window.addEventListener("hashchange",o),()=>{window.removeEventListener("hashchange",o)})),[]);const u=s.filter((e=>e.hash===c));return u.length>0?(0,e.createElement)("div",{className:"ti-about"},(0,e.createElement)(a,{pages:s,selected:c}),(0,e.createElement)(m,{page:u[0]})):(0,e.createElement)("div",{className:"ti-about"},(0,e.createElement)(a,{pages:s}),(0,e.createElement)(l,null),(0,e.createElement)(i,null))}document.addEventListener("DOMContentLoaded",(()=>{const a=document.querySelector("#ti-sdk-about");a&&(0,t.render)((0,e.createElement)(u,null),a)}))})(); \ No newline at end of file diff --git a/assets/js/build/banner/banner.asset.php b/assets/js/build/banner/banner.asset.php new file mode 100644 index 00000000..13b23d6e --- /dev/null +++ b/assets/js/build/banner/banner.asset.php @@ -0,0 +1 @@ + array(), 'version' => '9c795bb600f6ae533935'); diff --git a/assets/js/build/banner/banner.js b/assets/js/build/banner/banner.js new file mode 100644 index 00000000..be98c34e --- /dev/null +++ b/assets/js/build/banner/banner.js @@ -0,0 +1 @@ +document.addEventListener("DOMContentLoaded",(()=>{document.dispatchEvent(new Event("themeisle:banner:init"))})),document.addEventListener("themeisle:banner:init",(()=>{!function(){if(void 0===window.tsdk_banner_data)return;const n=document.getElementById("tsdk_banner");n&&(n.innerHTML=window.tsdk_banner_data.content)}()})); \ No newline at end of file diff --git a/assets/js/build/promos/index.asset.php b/assets/js/build/promos/index.asset.php index 6e674505..c03d81a8 100644 --- a/assets/js/build/promos/index.asset.php +++ b/assets/js/build/promos/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => 'f1180f80e1251b0f2d3e'); + array('react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => 'c57846e72deaa82a7a04'); diff --git a/assets/js/build/promos/index.js b/assets/js/build/promos/index.js index 8cdf5d86..6e8f366e 100644 --- a/assets/js/build/promos/index.js +++ b/assets/js/build/promos/index.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={678:()=>{const e=window.React,t=window.wp.blockEditor,n=window.wp.components,o=window.wp.compose,i=window.wp.data,s=window.wp.element,a=window.wp.hooks,r=()=>{const{createNotice:e}=(0,i.dispatch)("core/notices"),[t,n]=(0,s.useState)({}),[o,a]=(0,s.useState)("loading");return(0,i.useSelect)((e=>{if(Object.keys(t).length)return;const{getEntityRecord:o}=e("core"),i=o("root","site");i&&(a("loaded"),n(i))}),[]),[e=>t?.[e],async(t,o,i="Settings saved.")=>{const s={[t]:o};try{const t=await fetch("/wp-json/wp/v2/settings",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce},body:JSON.stringify(s)});t.ok||(a("error"),e("error","Could not save the settings.",{isDismissible:!0,type:"snackbar"}));const o=await t.json();a("loaded"),e("success",i,{isDismissible:!0,type:"snackbar"}),n(o)}catch(e){console.error("Error updating option:",e)}},o]},l=(e,t=!1)=>new Promise((n=>{wp.updates.ajax(!0===t?"install-theme":"install-plugin",{slug:e,success:e=>{n({success:!0,data:e})},error:e=>{n({success:!1,code:e.errorCode})}})})),c=e=>new Promise((t=>{jQuery.get(e).done((()=>{t({success:!0})})).fail((()=>{t({success:!1})}))})),m=(e,t)=>{const n={};return Object.keys(t).forEach((function(e){"innerBlocks"!==e&&(n[e]=t[e])})),e.push(n),Array.isArray(t.innerBlocks)?(n.innerBlocks=t.innerBlocks.map((e=>e.id)),t.innerBlocks.reduce(m,e)):e},d={button:{display:"flex",justifyContent:"center",width:"100%"},image:{padding:"20px 0"},skip:{container:{display:"flex",flexDirection:"column",alignItems:"center"},button:{fontSize:"9px"},poweredby:{fontSize:"9px",textTransform:"uppercase"}}},p={"blocks-css":{title:"Custom CSS",description:"Enable Otter Blocks to add Custom CSS for this block.",image:"css.jpg"},"blocks-animation":{title:"Animations",description:"Enable Otter Blocks to add Animations for this block.",image:"animation.jpg"},"blocks-conditions":{title:"Visibility Conditions",description:"Enable Otter Blocks to add Visibility Conditions for this block.",image:"conditions.jpg"}},u=({onClick:t})=>(0,e.createElement)("div",{style:d.skip.container},(0,e.createElement)(n.Button,{style:d.skip.button,variant:"tertiary",onClick:t},"Skip for now"),(0,e.createElement)("span",{style:d.skip.poweredby},"Recommended by ",window.themeisleSDKPromotions.product)),h=(0,o.createHigherOrderComponent)((o=>i=>{const[a,m]=(0,s.useState)(!1),[h,w]=(0,s.useState)("default"),[g,E]=(0,s.useState)(!1),[v,y,k]=r();if((0,s.useEffect)((()=>{g&&(()=>{const e={...window.themeisleSDKPromotions.option};e[window.themeisleSDKPromotions.showPromotion]=(new Date).getTime()/1e3|0,y("themeisle_sdk_promotions",JSON.stringify(e)),window.themeisleSDKPromotions.showPromotion=!1})()}),[g]),!i.isSelected||!Boolean(window.themeisleSDKPromotions.showPromotion))return(0,e.createElement)(o,{...i});const f=async()=>{m(!0),await l("otter-blocks"),y("themeisle_sdk_promotions_otter_installed",!Boolean(v("themeisle_sdk_promotions_otter_installed"))),await c(window.themeisleSDKPromotions.otterActivationUrl),m(!1),w("installed")},S=()=>"installed"===h?(0,e.createElement)("p",null,(0,e.createElement)("strong",null,"Awesome! Refresh the page to see Otter Blocks in action.")):(0,e.createElement)(n.Button,{variant:"secondary",onClick:f,isBusy:a,style:d.button},"Install & Activate Otter Blocks");return g?(0,e.createElement)(o,{...i}):(0,e.createElement)(s.Fragment,null,(0,e.createElement)(o,{...i}),(0,e.createElement)(t.InspectorControls,null,Object.keys(p).map((t=>{if(t===window.themeisleSDKPromotions.showPromotion){const o=p[t];return(0,e.createElement)(n.PanelBody,{key:t,title:o.title,initialOpen:!1},(0,e.createElement)("p",null,o.description),(0,e.createElement)(S,null),(0,e.createElement)("img",{style:d.image,src:window.themeisleSDKPromotions.assets+o.image}),(0,e.createElement)(u,{onClick:()=>E(!0)}))}}))))}),"withInspectorControl");(0,i.select)("core/edit-site")||(0,a.addFilter)("editor.BlockEdit","themeisle-sdk/with-inspector-controls",h);const w=window.wp.plugins,g=window.wp.editPost;function E({stacked:t=!1,type:o,onDismiss:i,onSuccess:a,initialStatus:m=null}){const{title:d,option:p,optionKey:u,labels:h,optimoleActivationUrl:w,optimoleDash:g}=window.themeisleSDKPromotions,[E,v]=(0,s.useState)(!1),[y,k]=(0,s.useState)(m),[f,S]=r(),P=async()=>{v(!0);const e={...p};e[o]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await S(u,JSON.stringify(e)),i&&i()},b=async e=>{e.preventDefault(),k("installing"),await l("optimole-wp"),k("activating"),await c(w),S("themeisle_sdk_promotions_optimole_installed",!0).then((()=>{k("done")}))};if(E)return null;const D=()=>"done"===y?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null," ",h.all_set),(0,e.createElement)(n.Button,{icon:"external",isPrimary:!0,href:g,target:"_blank"},h.optimole.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===y&&h.installing,"activating"===y&&h.activating,"…")),_=()=>(0,e.createElement)(n.Button,{disabled:y&&"done"!==y,onClick:P,isLink:!0,className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},h.optimole.dismisscta)),N=(t=!1)=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{isPrimary:!0,onClick:b,className:t?"cta":""},h.optimole.installOptimole),(0,e.createElement)(n.Button,{isLink:!0,target:"_blank",href:"https://wordpress.org/plugins/optimole-wp"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null," ",h.learnmore))),B=(0,e.createElement)("div",{className:"ti-om-stack-wrap ti-sdk-om-notice"},(0,e.createElement)("div",{className:"om-stack-notice"},_(),(0,e.createElement)("i",null,d),(0,e.createElement)("p",null,["om-editor","om-image-block"].includes(o)?h.optimole.message1:h.optimole.message2),y?D():N(!0))),K=(0,e.createElement)(e.Fragment,null,_(),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,d),(0,e.createElement)("p",{className:"description"},"om-media"===o?h.optimole.message3:h.optimole.message4),y?D():(0,e.createElement)("div",{className:"actions"},N()))));return t?B:K}const v=()=>{const[t,n]=(0,s.useState)(!0),{getBlocks:o}=(0,i.useSelect)((e=>{const{getBlocks:t}=e("core/block-editor");return{getBlocks:t}}));var a;if((a=o(),"core/image",a.reduce(m,[]).filter((e=>"core/image"===e.name))).length<2)return null;const r="ti-sdk-optimole-post-publish "+(t?"":"hidden");return(0,e.createElement)(g.PluginPostPublishPanel,{className:r},(0,e.createElement)(E,{stacked:!0,type:"om-editor",onDismiss:()=>{n(!1)}}))};new class{constructor(){const{showPromotion:e,debug:t}=window.themeisleSDKPromotions;this.promo=e,this.debug="1"===t,this.domRef=null,this.run()}run(){if(this.debug)this.runAll();else switch(this.promo){case"om-attachment":this.runAttachmentPromo();break;case"om-media":this.runMediaPromo();break;case"om-editor":this.runEditorPromo();break;case"om-image-block":this.runImageBlockPromo();break;case"om-elementor":this.runElementorPromo()}}runAttachmentPromo(){wp.media.view.Attachment.Details.prototype.on("ready",(()=>{setTimeout((()=>{this.removeAttachmentPromo(),this.addAttachmentPromo()}),100)})),wp.media.view.Modal.prototype.on("close",(()=>{setTimeout(this.removeAttachmentPromo,100)}))}runMediaPromo(){if(window.themeisleSDKPromotions.option["om-media"])return;const t=document.querySelector("#ti-optml-notice");t&&(0,s.render)((0,e.createElement)(E,{type:"om-media",onDismiss:()=>{t.style.opacity=0}}),t)}runImageBlockPromo(){if(window.themeisleSDKPromotions.option["om-image-block"])return;let n=!0,i=null;const r=(0,o.createHigherOrderComponent)((o=>a=>"core/image"===a.name&&n?(0,e.createElement)(s.Fragment,null,(0,e.createElement)(o,{...a}),(0,e.createElement)(t.InspectorControls,null,(0,e.createElement)(E,{stacked:!0,type:"om-image-block",initialStatus:i,onDismiss:()=>{n=!1},onSuccess:()=>{i="done"}}))):(0,e.createElement)(o,{...a})),"withImagePromo");(0,a.addFilter)("editor.BlockEdit","optimole-promo/image-promo",r,99)}runEditorPromo(){window.themeisleSDKPromotions.option["om-editor"]||(0,w.registerPlugin)("optimole-promo",{render:v})}runElementorPromo(){if(!window.elementor)return;const e=this;elementor.on("preview:loaded",(()=>{elementor.panel.currentView.on("set:page:editor",(t=>{e.domRef&&(0,s.unmountComponentAtNode)(e.domRef),t.activeSection&&"section_image"===t.activeSection&&e.runElementorActions(e)}))}))}addAttachmentPromo(){if(this.domRef&&(0,s.unmountComponentAtNode)(this.domRef),window.themeisleSDKPromotions.option["om-attachment"])return;const t=document.querySelector("#ti-optml-notice-helper");t&&(this.domRef=t,(0,s.render)((0,e.createElement)("div",{className:"notice notice-info ti-sdk-om-notice",style:{margin:0}},(0,e.createElement)(E,{type:"om-attachment",onDismiss:()=>{t.style.opacity=0}})),t))}removeAttachmentPromo(){const e=document.querySelector("#ti-optml-notice-helper");e&&(0,s.unmountComponentAtNode)(e)}runElementorActions(t){if(window.themeisleSDKPromotions.option["om-elementor"])return;const n=document.querySelector("#elementor-panel__editor__help"),o=document.createElement("div");o.id="ti-optml-notice",t.domRef=o,n&&(n.parentNode.insertBefore(o,n),(0,s.render)((0,e.createElement)(E,{stacked:!0,type:"om-elementor",onDismiss:()=>{o.style.opacity=0}}),o))}runAll(){this.runAttachmentPromo(),this.runMediaPromo(),this.runEditorPromo(),this.runImageBlockPromo(),this.runElementorPromo()}};const y=({onDismiss:t=(()=>{})})=>{const[o,i]=(0,s.useState)(""),[a,m]=r();return(0,e.createElement)(s.Fragment,null,(0,e.createElement)(n.Button,{disabled:"installing"===o,onClick:async()=>{const e={...window.themeisleSDKPromotions.option};e["rop-posts"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await m(window.themeisleSDKPromotions.optionKey,JSON.stringify(e)),t&&t()},variant:"link",className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},"Dismiss this notice.")),(0,e.createElement)("p",null,"Boost your content's reach effortlessly! Introducing ",(0,e.createElement)("b",null,"Revive Social"),", a cutting-edge plugin from the makers of ",window.themeisleSDKPromotions.product,". Seamlessly auto-share old & new content across social media, driving traffic like never before."),(0,e.createElement)("div",{className:"rop-notice-actions"},"installed"!==o?(0,e.createElement)(n.Button,{variant:"primary",isBusy:"installing"===o,onClick:async()=>{i("installing"),await l("tweet-old-post"),await c(window.themeisleSDKPromotions.ropActivationUrl),m("themeisle_sdk_promotions_rop_installed",!Boolean(a("themeisle_sdk_promotions_rop_installed"))),i("installed")}},"Install & Activate"):(0,e.createElement)(n.Button,{variant:"primary",href:window.themeisleSDKPromotions.ropDash},"Visit Dashboard"),(0,e.createElement)(n.Button,{variant:"link",target:"_blank",href:"https://wordpress.org/plugins/tweet-old-post/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null,"Learn more"))))};new class{constructor(){const{showPromotion:e,debug:t}=window.themeisleSDKPromotions;this.promo=e,this.debug="1"===t,this.domRef=null,this.run()}run(){if(window.themeisleSDKPromotions.option["rop-posts"])return;const t=document.querySelector("#ti-rop-notice");t&&(0,s.render)((0,e.createElement)(y,{onDismiss:()=>{t.style.display="none"}}),t)}};const k=({onDismiss:t=(()=>{})})=>{const{title:o,optionKey:i,labels:a,neveAction:c,activateNeveURL:m}=window.themeisleSDKPromotions,[d,p]=r(),[u,h]=(0,s.useState)(null);return(0,e.createElement)(s.Fragment,null,(0,e.createElement)(n.Button,{disabled:u&&"done"!==u,onClick:async()=>{const e={...window.themeisleSDKPromotions.option};e["neve-themes-popular"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await p(i,JSON.stringify(e)),t&&t()},isLink:!0,className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},a.redirectionCF7.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,o),(0,e.createElement)("p",{className:"description"},"Meet ",(0,e.createElement)("b",null,"Neve"),", from the creators of ",window.themeisleSDKPromotions.product,". A very fast and free theme, trusted by over 300,000 users for building their websites and rated 4.7 stars!"),!u&&(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{variant:"primary",onClick:e=>{if(e.preventDefault(),"activate"===c)return h("activating"),void p("themeisle_sdk_promotions_neve_installed",!0).then((()=>{window.location.href=m}));h("installing"),l("neve",!0).then((e=>{h("activating"),p("themeisle_sdk_promotions_neve_installed",!0).then((()=>{window.location.href=e.data.activateUrl}))}))}},"install"===c&&a.installActivate,"activate"===c&&a.activate),(0,e.createElement)(n.Button,{variant:"link",href:window.themeisleSDKPromotions.nevePreviewURL},a.preview)),u&&"done"!==u&&(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===u&&a.installing,"activating"===u&&a.activating,"…")))))};function f({type:t,onDismiss:o}){const{title:i,option:a,optionKey:m,labels:d,rfCF7ActivationUrl:p,cf7Dash:u}=window.themeisleSDKPromotions,[h,w]=(0,s.useState)(!1),[g,E]=(0,s.useState)(null),[v,y]=r();if(h)return null;const k=(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{isPrimary:!0,onClick:async e=>{e.preventDefault(),E("installing"),await l("wpcf7-redirect"),E("activating"),await c(p),y("themeisle_sdk_promotions_redirection_cf7_installed",!Boolean(v("themeisle_sdk_promotions_redirection_cf7_installed"))),E("done")}},d.redirectionCF7.gst),(0,e.createElement)(n.Button,{isLink:!0,target:"_blank",href:"https://wordpress.org/plugins/wpcf7-redirect/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null," ",d.learnmore)));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{disabled:g&&"done"!==g,onClick:async()=>{w(!0);const e={...a};e[t]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await y(m,JSON.stringify(e)),o&&o()},isLink:!0,className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},d.redirectionCF7.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,i),(0,e.createElement)("p",{className:"description"},d.redirectionCF7.message),g?"done"===g?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null," ",d.all_set),(0,e.createElement)(n.Button,{icon:"external",variant:"primary",href:u,target:"_blank"},d.redirectionCF7.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===g&&d.installing,"activating"===g&&d.activating,"…")):k)))}new class{constructor(){const{showPromotion:e,debug:t}=window.themeisleSDKPromotions;this.promo=e,this.debug="1"===t,this.domRef=null,this.run()}run(){if(window.themeisleSDKPromotions.option["neve-themes-popular"])return;const t=document.querySelector("#ti-neve-notice");t&&(0,s.render)((0,e.createElement)(k,{onDismiss:()=>{t.style.display="none"}}),t)}},new class{constructor(){this.run()}run(){if(window.themeisleSDKPromotions.option["redirection-cf7"])return;const t=document.querySelector("#ti-redirection-cf7-notice");t&&(0,s.render)((0,e.createElement)(f,{type:"redirection-cf7",onDismiss:()=>{t.style.display="none"}}),t)}};const S=({onDismiss:t=(()=>{})})=>{const{title:o,option:i,optionKey:a,labels:m,hyveActivationUrl:d,hyveDash:p}=window.themeisleSDKPromotions,[u,h]=(0,s.useState)(!1),[w,g]=(0,s.useState)(null),[E,v]=r();if(u)return null;const y=(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{variant:"primary",onClick:async e=>{e.preventDefault(),g("installing"),await l("hyve-lite"),g("activating"),await c(d),v("themeisle_sdk_promotions_hyve_installed",!Boolean(E("themeisle_sdk_promotions_hyve_installed"))),g("done")}},m.hyve.install),(0,e.createElement)(n.Button,{variant:"link",target:"_blank",href:"https://wordpress.org/plugins/hyve-lite/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null,m.learnmore)));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{disabled:w&&"done"!==w,onClick:async()=>{h(!0);const e={...i};e["hyve-plugins-install"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await v(a,JSON.stringify(e)),t&&t()},variant:"link",className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},m.hyve.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,o),(0,e.createElement)("p",{className:"description"},m.hyve.message),w?"done"===w?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null,m.all_set),(0,e.createElement)(n.Button,{icon:"external",variant:"primary",href:p,target:"_blank"},m.hyve.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===w&&m.installing,"activating"===w&&m.activating,"…")):y)))};(()=>{if(window.themeisleSDKPromotions.option["hyve-plugins-install"])return;const t=document.querySelector("#ti-hyve-notice");t&&(0,s.createRoot)(t).render((0,e.createElement)(S,{onDismiss:()=>{t.style.display="none"}}))})()}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,o),s.exports}o.m=t,e=[],o.O=(t,n,i,s)=>{if(!n){var a=1/0;for(m=0;m=s)&&Object.keys(o.O).every((e=>o.O[e](n[l])))?n.splice(l--,1):(r=!1,s0&&e[m-1][2]>s;m--)e[m]=e[m-1];e[m]=[n,i,s]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var i,s,[a,r,l]=n,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var m=l(o)}for(t&&t(n);co(678)));i=o.O(i)})(); \ No newline at end of file +(()=>{"use strict";var e,t={753:()=>{const e=window.React,t=window.wp.blockEditor,n=window.wp.components,o=window.wp.compose,s=window.wp.data,i=window.wp.element,a=window.wp.hooks,l=()=>{const{createNotice:e}=(0,s.dispatch)("core/notices"),[t,n]=(0,i.useState)({}),[o,a]=(0,i.useState)("loading");return(0,s.useSelect)((e=>{if(Object.keys(t).length)return;const{getEntityRecord:o}=e("core"),s=o("root","site");s&&(a("loaded"),n(s))}),[]),[e=>t?.[e],async(t,o,s="Settings saved.")=>{const i={[t]:o};try{const t=await fetch("/wp-json/wp/v2/settings",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce},body:JSON.stringify(i)});t.ok||(a("error"),e("error","Could not save the settings.",{isDismissible:!0,type:"snackbar"}));const o=await t.json();a("loaded"),e("success",s,{isDismissible:!0,type:"snackbar"}),n(o)}catch(e){console.error("Error updating option:",e)}},o]},r=(e,t=!1)=>new Promise((n=>{wp.updates.ajax(!0===t?"install-theme":"install-plugin",{slug:e,success:e=>{n({success:!0,data:e})},error:e=>{n({success:!1,code:e.errorCode})}})})),c=e=>new Promise((t=>{jQuery.get(e).done((()=>{t({success:!0})})).fail((()=>{t({success:!1})}))})),m=(e,t)=>{const n={};return Object.keys(t).forEach((function(e){"innerBlocks"!==e&&(n[e]=t[e])})),e.push(n),Array.isArray(t.innerBlocks)?(n.innerBlocks=t.innerBlocks.map((e=>e.id)),t.innerBlocks.reduce(m,e)):e},d={button:{display:"flex",justifyContent:"center",width:"100%"},image:{padding:"20px 0"},skip:{container:{display:"flex",flexDirection:"column",alignItems:"center"},button:{fontSize:"9px"},poweredby:{fontSize:"9px",textTransform:"uppercase"}}},p={"blocks-css":{title:"Custom CSS",description:"Enable Otter Blocks to add Custom CSS for this block.",image:"css.jpg"},"blocks-animation":{title:"Animations",description:"Enable Otter Blocks to add Animations for this block.",image:"animation.jpg"},"blocks-conditions":{title:"Visibility Conditions",description:"Enable Otter Blocks to add Visibility Conditions for this block.",image:"conditions.jpg"}},u=({onClick:t})=>(0,e.createElement)("div",{style:d.skip.container},(0,e.createElement)(n.Button,{style:d.skip.button,variant:"tertiary",onClick:t},"Skip for now"),(0,e.createElement)("span",{style:d.skip.poweredby},"Recommended by ",window.themeisleSDKPromotions.product)),h=(0,o.createHigherOrderComponent)((o=>s=>{const[a,m]=(0,i.useState)(!1),[h,w]=(0,i.useState)("default"),[g,E]=(0,i.useState)(!1),[y,v,f]=l();if((0,i.useEffect)((()=>{g&&(()=>{const e={...window.themeisleSDKPromotions.option};e[window.themeisleSDKPromotions.showPromotion]=(new Date).getTime()/1e3|0,v("themeisle_sdk_promotions",JSON.stringify(e)),window.themeisleSDKPromotions.showPromotion=!1})()}),[g]),!s.isSelected||!Boolean(window.themeisleSDKPromotions.showPromotion))return(0,e.createElement)(o,{...s});const k=async()=>{m(!0),await r("otter-blocks"),v("themeisle_sdk_promotions_otter_installed",!Boolean(y("themeisle_sdk_promotions_otter_installed"))),await c(window.themeisleSDKPromotions.otterActivationUrl),m(!1),w("installed")},S=()=>"installed"===h?(0,e.createElement)("p",null,(0,e.createElement)("strong",null,"Awesome! Refresh the page to see Otter Blocks in action.")):(0,e.createElement)(n.Button,{variant:"secondary",onClick:k,isBusy:a,style:d.button},"Install & Activate Otter Blocks");return g?(0,e.createElement)(o,{...s}):(0,e.createElement)(i.Fragment,null,(0,e.createElement)(o,{...s}),(0,e.createElement)(t.InspectorControls,null,Object.keys(p).map((t=>{if(t===window.themeisleSDKPromotions.showPromotion){const o=p[t];return(0,e.createElement)(n.PanelBody,{key:t,title:o.title,initialOpen:!1},(0,e.createElement)("p",null,o.description),(0,e.createElement)(S,null),(0,e.createElement)("img",{style:d.image,src:window.themeisleSDKPromotions.assets+o.image}),(0,e.createElement)(u,{onClick:()=>E(!0)}))}}))))}),"withInspectorControl");(0,s.select)("core/edit-site")||(0,a.addFilter)("editor.BlockEdit","themeisle-sdk/with-inspector-controls",h);const w=window.wp.plugins,g=window.wp.editPost;function E({stacked:t=!1,type:o,onDismiss:s,onSuccess:a,initialStatus:m=null}){const{title:d,option:p,optionKey:u,labels:h,optimoleActivationUrl:w,optimoleDash:g}=window.themeisleSDKPromotions,[E,y]=(0,i.useState)(!1),[v,f]=(0,i.useState)(m),[k,S]=l(),_=async()=>{y(!0);const e={...p};e[o]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await S(u,JSON.stringify(e)),s&&s()},P=async e=>{e.preventDefault(),f("installing"),await r("optimole-wp"),f("activating"),await c(w),S("themeisle_sdk_promotions_optimole_installed",!0).then((()=>{f("done")}))};if(E)return null;const b=()=>"done"===v?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null," ",h.all_set),(0,e.createElement)(n.Button,{icon:"external",isPrimary:!0,href:g,target:"_blank"},h.optimole.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===v&&h.installing,"activating"===v&&h.activating,"…")),D=()=>(0,e.createElement)(n.Button,{disabled:v&&"done"!==v,onClick:_,isLink:!0,className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},h.optimole.dismisscta)),N=(t=!1)=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{isPrimary:!0,onClick:P,className:t?"cta":""},h.optimole.installOptimole),(0,e.createElement)(n.Button,{isLink:!0,target:"_blank",href:"https://wordpress.org/plugins/optimole-wp"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null," ",h.learnmore))),B=(0,e.createElement)("div",{className:"ti-om-stack-wrap ti-sdk-om-notice"},(0,e.createElement)("div",{className:"om-stack-notice"},D(),(0,e.createElement)("i",null,d),(0,e.createElement)("p",null,["om-editor","om-image-block"].includes(o)?h.optimole.message1:h.optimole.message2),v?b():N(!0))),K=(0,e.createElement)(e.Fragment,null,D(),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,d),(0,e.createElement)("p",{className:"description"},"om-media"===o?h.optimole.message3:h.optimole.message4),v?b():(0,e.createElement)("div",{className:"actions"},N()))));return t?B:K}const y=()=>{const[t,n]=(0,i.useState)(!0),{getBlocks:o}=(0,s.useSelect)((e=>{const{getBlocks:t}=e("core/block-editor");return{getBlocks:t}}));var a;if((a=o(),"core/image",a.reduce(m,[]).filter((e=>"core/image"===e.name))).length<2)return null;const l="ti-sdk-optimole-post-publish "+(t?"":"hidden");return(0,e.createElement)(g.PluginPostPublishPanel,{className:l},(0,e.createElement)(E,{stacked:!0,type:"om-editor",onDismiss:()=>{n(!1)}}))};new class{constructor(){const{showPromotion:e,debug:t}=window.themeisleSDKPromotions;this.promo=e,this.debug="1"===t,this.domRef=null,this.run()}run(){if(this.debug)this.runAll();else switch(this.promo){case"om-attachment":this.runAttachmentPromo();break;case"om-media":this.runMediaPromo();break;case"om-editor":this.runEditorPromo();break;case"om-image-block":this.runImageBlockPromo();break;case"om-elementor":this.runElementorPromo()}}runAttachmentPromo(){wp.media.view.Attachment.Details.prototype.on("ready",(()=>{setTimeout((()=>{this.removeAttachmentPromo(),this.addAttachmentPromo()}),100)})),wp.media.view.Modal.prototype.on("close",(()=>{setTimeout(this.removeAttachmentPromo,100)}))}runMediaPromo(){if(window.themeisleSDKPromotions.option["om-media"])return;const t=document.querySelector("#ti-optml-notice");t&&(0,i.render)((0,e.createElement)(E,{type:"om-media",onDismiss:()=>{t.style.opacity=0}}),t)}runImageBlockPromo(){if(window.themeisleSDKPromotions.option["om-image-block"])return;let n=!0,s=null;const l=(0,o.createHigherOrderComponent)((o=>a=>"core/image"===a.name&&n?(0,e.createElement)(i.Fragment,null,(0,e.createElement)(o,{...a}),(0,e.createElement)(t.InspectorControls,null,(0,e.createElement)(E,{stacked:!0,type:"om-image-block",initialStatus:s,onDismiss:()=>{n=!1},onSuccess:()=>{s="done"}}))):(0,e.createElement)(o,{...a})),"withImagePromo");(0,a.addFilter)("editor.BlockEdit","optimole-promo/image-promo",l,99)}runEditorPromo(){window.themeisleSDKPromotions.option["om-editor"]||(0,w.registerPlugin)("optimole-promo",{render:y})}runElementorPromo(){if(!window.elementor)return;const e=this;elementor.on("preview:loaded",(()=>{elementor.panel.currentView.on("set:page:editor",(t=>{e.domRef&&(0,i.unmountComponentAtNode)(e.domRef),t.activeSection&&"section_image"===t.activeSection&&e.runElementorActions(e)}))}))}addAttachmentPromo(){if(this.domRef&&(0,i.unmountComponentAtNode)(this.domRef),window.themeisleSDKPromotions.option["om-attachment"])return;const t=document.querySelector("#ti-optml-notice-helper");t&&(this.domRef=t,(0,i.render)((0,e.createElement)("div",{className:"notice notice-info ti-sdk-om-notice",style:{margin:0}},(0,e.createElement)(E,{type:"om-attachment",onDismiss:()=>{t.style.opacity=0}})),t))}removeAttachmentPromo(){const e=document.querySelector("#ti-optml-notice-helper");e&&(0,i.unmountComponentAtNode)(e)}runElementorActions(t){if(window.themeisleSDKPromotions.option["om-elementor"])return;const n=document.querySelector("#elementor-panel__editor__help"),o=document.createElement("div");o.id="ti-optml-notice",t.domRef=o,n&&(n.parentNode.insertBefore(o,n),(0,i.render)((0,e.createElement)(E,{stacked:!0,type:"om-elementor",onDismiss:()=>{o.style.opacity=0}}),o))}runAll(){this.runAttachmentPromo(),this.runMediaPromo(),this.runEditorPromo(),this.runImageBlockPromo(),this.runElementorPromo()}};const v=({onDismiss:t=(()=>{})})=>{const[o,s]=(0,i.useState)(""),[a,m]=l();return(0,e.createElement)(i.Fragment,null,(0,e.createElement)(n.Button,{disabled:"installing"===o,onClick:async()=>{const e={...window.themeisleSDKPromotions.option};e["rop-posts"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await m(window.themeisleSDKPromotions.optionKey,JSON.stringify(e)),t&&t()},variant:"link",className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},"Dismiss this notice.")),(0,e.createElement)("p",null,"Boost your content's reach effortlessly! Introducing ",(0,e.createElement)("b",null,"Revive Social"),", a cutting-edge plugin from the makers of ",window.themeisleSDKPromotions.product,". Seamlessly auto-share old & new content across social media, driving traffic like never before."),(0,e.createElement)("div",{className:"rop-notice-actions"},"installed"!==o?(0,e.createElement)(n.Button,{variant:"primary",isBusy:"installing"===o,onClick:async()=>{s("installing"),await r("tweet-old-post"),await c(window.themeisleSDKPromotions.ropActivationUrl),m("themeisle_sdk_promotions_rop_installed",!Boolean(a("themeisle_sdk_promotions_rop_installed"))),s("installed")}},"Install & Activate"):(0,e.createElement)(n.Button,{variant:"primary",href:window.themeisleSDKPromotions.ropDash},"Visit Dashboard"),(0,e.createElement)(n.Button,{variant:"link",target:"_blank",href:"https://wordpress.org/plugins/tweet-old-post/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null,"Learn more"))))};new class{constructor(){const{showPromotion:e,debug:t}=window.themeisleSDKPromotions;this.promo=e,this.debug="1"===t,this.domRef=null,this.run()}run(){if(window.themeisleSDKPromotions.option["rop-posts"])return;const t=document.querySelector("#ti-rop-notice");t&&(0,i.render)((0,e.createElement)(v,{onDismiss:()=>{t.style.display="none"}}),t)}};const f=({onDismiss:t=(()=>{})})=>{const{title:o,optionKey:s,labels:a,neveAction:c,activateNeveURL:m}=window.themeisleSDKPromotions,[d,p]=l(),[u,h]=(0,i.useState)(null);return(0,e.createElement)(i.Fragment,null,(0,e.createElement)(n.Button,{disabled:u&&"done"!==u,onClick:async()=>{const e={...window.themeisleSDKPromotions.option};e["neve-themes-popular"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await p(s,JSON.stringify(e)),t&&t()},isLink:!0,className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},a.redirectionCF7.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,o),(0,e.createElement)("p",{className:"description"},"Meet ",(0,e.createElement)("b",null,"Neve"),", from the creators of ",window.themeisleSDKPromotions.product,". A very fast and free theme, trusted by over 300,000 users for building their websites and rated 4.7 stars!"),!u&&(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{variant:"primary",onClick:e=>{if(e.preventDefault(),"activate"===c)return h("activating"),void p("themeisle_sdk_promotions_neve_installed",!0).then((()=>{window.location.href=m}));h("installing"),r("neve",!0).then((e=>{h("activating"),p("themeisle_sdk_promotions_neve_installed",!0).then((()=>{window.location.href=e.data.activateUrl}))}))}},"install"===c&&a.installActivate,"activate"===c&&a.activate),(0,e.createElement)(n.Button,{variant:"link",href:window.themeisleSDKPromotions.nevePreviewURL},a.preview)),u&&"done"!==u&&(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===u&&a.installing,"activating"===u&&a.activating,"…")))))};function k({type:t,onDismiss:o}){const{title:s,option:a,optionKey:m,labels:d,rfCF7ActivationUrl:p,cf7Dash:u}=window.themeisleSDKPromotions,[h,w]=(0,i.useState)(!1),[g,E]=(0,i.useState)(null),[y,v]=l();if(h)return null;const f=(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{isPrimary:!0,onClick:async e=>{e.preventDefault(),E("installing"),await r("wpcf7-redirect"),E("activating"),await c(p),v("themeisle_sdk_promotions_redirection_cf7_installed",!Boolean(y("themeisle_sdk_promotions_redirection_cf7_installed"))),E("done")}},d.redirectionCF7.gst),(0,e.createElement)(n.Button,{isLink:!0,target:"_blank",href:"https://wordpress.org/plugins/wpcf7-redirect/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null," ",d.learnmore)));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{disabled:g&&"done"!==g,onClick:async()=>{w(!0);const e={...a};e[t]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await v(m,JSON.stringify(e)),o&&o()},isLink:!0,className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},d.redirectionCF7.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,s),(0,e.createElement)("p",{className:"description"},d.redirectionCF7.message),g?"done"===g?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null," ",d.all_set),(0,e.createElement)(n.Button,{icon:"external",variant:"primary",href:u,target:"_blank"},d.redirectionCF7.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===g&&d.installing,"activating"===g&&d.activating,"…")):f)))}new class{constructor(){const{showPromotion:e,debug:t}=window.themeisleSDKPromotions;this.promo=e,this.debug="1"===t,this.domRef=null,this.run()}run(){if(window.themeisleSDKPromotions.option["neve-themes-popular"])return;const t=document.querySelector("#ti-neve-notice");t&&(0,i.render)((0,e.createElement)(f,{onDismiss:()=>{t.style.display="none"}}),t)}},new class{constructor(){this.run()}run(){if(window.themeisleSDKPromotions.option["redirection-cf7"])return;const t=document.querySelector("#ti-redirection-cf7-notice");t&&(0,i.render)((0,e.createElement)(k,{type:"redirection-cf7",onDismiss:()=>{t.style.display="none"}}),t)}};const S=({onDismiss:t=(()=>{})})=>{const{title:o,option:s,optionKey:a,labels:m,hyveActivationUrl:d,hyveDash:p}=window.themeisleSDKPromotions,[u,h]=(0,i.useState)(!1),[w,g]=(0,i.useState)(null),[E,y]=l();if(u)return null;const v=(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{variant:"primary",onClick:async e=>{e.preventDefault(),g("installing"),await r("hyve-lite"),g("activating"),await c(d),y("themeisle_sdk_promotions_hyve_installed",!Boolean(E("themeisle_sdk_promotions_hyve_installed"))),g("done")}},m.hyve.install),(0,e.createElement)(n.Button,{variant:"link",target:"_blank",href:"https://wordpress.org/plugins/hyve-lite/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null,m.learnmore)));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{disabled:w&&"done"!==w,onClick:async()=>{h(!0);const e={...s};e["hyve-plugins-install"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await y(a,JSON.stringify(e)),t&&t()},variant:"link",className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},m.hyve.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,o),(0,e.createElement)("p",{className:"description"},m.hyve.message),w?"done"===w?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null,m.all_set),(0,e.createElement)(n.Button,{icon:"external",variant:"primary",href:p,target:"_blank"},m.hyve.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===w&&m.installing,"activating"===w&&m.activating,"…")):v)))};(()=>{if(window.themeisleSDKPromotions.option["hyve-plugins-install"])return;const t=document.querySelector("#ti-hyve-notice");t&&(0,i.createRoot)(t).render((0,e.createElement)(S,{onDismiss:()=>{t.style.display="none"}}))})();const _=({onDismiss:t=(()=>{})})=>{const{title:o,option:s,optionKey:a,labels:m,wpFullPayActivationUrl:d,wpFullPayDash:p}=window.themeisleSDKPromotions,[u,h]=(0,i.useState)(!1),[w,g]=(0,i.useState)(null),[E,y]=l();if(u)return null;const v=(0,e.createElement)("div",{className:"actions"},(0,e.createElement)(n.Button,{variant:"primary",onClick:async e=>{e.preventDefault(),g("installing"),await r("wp-full-stripe-free"),g("activating"),await c(d),y("themeisle_sdk_promotions_wp_full_pay_installed",!Boolean(E("themeisle_sdk_promotions_wp_full_pay_installed"))),g("done")}},m.wp_full_pay.install),(0,e.createElement)(n.Button,{variant:"link",target:"_blank",href:"https://wordpress.org/plugins/wp-full-stripe-free/"},(0,e.createElement)("span",{className:"dashicons dashicons-external"}),(0,e.createElement)("span",null,m.learnmore)));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Button,{disabled:w&&"done"!==w,onClick:async()=>{h(!0);const e={...s};e["wp-full-pay-plugins-install"]=(new Date).getTime()/1e3|0,window.themeisleSDKPromotions.option=e,await y(a,JSON.stringify(e)),t&&t()},variant:"link",className:"om-notice-dismiss"},(0,e.createElement)("span",{className:"dashicons-no-alt dashicons"}),(0,e.createElement)("span",{className:"screen-reader-text"},m.wp_full_pay.dismisscta)),(0,e.createElement)("div",{className:"content"},(0,e.createElement)("div",null,(0,e.createElement)("p",null,o),(0,e.createElement)("p",{className:"description"},m.wp_full_pay.message),w?"done"===w?(0,e.createElement)("div",{className:"done"},(0,e.createElement)("p",null,m.all_set),(0,e.createElement)(n.Button,{icon:"external",variant:"primary",href:p,target:"_blank"},m.wp_full_pay.gotodash)):(0,e.createElement)("p",{className:"om-progress"},(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),(0,e.createElement)("span",null,"installing"===w&&m.installing,"activating"===w&&m.activating,"…")):v)))};(()=>{if(window.themeisleSDKPromotions.option["wp-full-pay-plugins-install"])return;const t=document.querySelector("#ti-wp-full-pay-notice");t&&(0,i.createRoot)(t).render((0,e.createElement)(_,{onDismiss:()=>{t.style.display="none"}}))})()}},n={};function o(e){var s=n[e];if(void 0!==s)return s.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.m=t,e=[],o.O=(t,n,s,i)=>{if(!n){var a=1/0;for(m=0;m=i)&&Object.keys(o.O).every((e=>o.O[e](n[r])))?n.splice(r--,1):(l=!1,i0&&e[m-1][2]>i;m--)e[m]=e[m-1];e[m]=[n,s,i]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var s,i,[a,l,r]=n,c=0;if(a.some((t=>0!==e[t]))){for(s in l)o.o(l,s)&&(o.m[s]=l[s]);if(r)var m=r(o)}for(t&&t(n);co(753)));s=o.O(s)})(); \ No newline at end of file diff --git a/assets/js/src/banner.js b/assets/js/src/banner.js new file mode 100644 index 00000000..c6bcc976 --- /dev/null +++ b/assets/js/src/banner.js @@ -0,0 +1,21 @@ +document.addEventListener('DOMContentLoaded', () => { + document.dispatchEvent(new Event('themeisle:banner:init')); +}); + +// NOTE: use this event if you need to load the banner on an event other than DOMContentLoaded +document.addEventListener('themeisle:banner:init', () => { + initializeBanner(); +}); + +function initializeBanner() { + if ( 'undefined' === typeof window.tsdk_banner_data ) { + return; + } + + const bannerRoot = document.getElementById('tsdk_banner'); + if ( ! bannerRoot ) { + return; + } + + bannerRoot.innerHTML = window.tsdk_banner_data.content; +} \ No newline at end of file diff --git a/assets/js/src/index.js b/assets/js/src/index.js index 5f5b4c05..0f10bf94 100644 --- a/assets/js/src/index.js +++ b/assets/js/src/index.js @@ -4,3 +4,4 @@ import './rop.js'; import './neve.js'; import './redirection-for-cf7.js'; import './hyve.js'; +import './wp-full-pay.js'; diff --git a/assets/js/src/wp-full-pay.js b/assets/js/src/wp-full-pay.js new file mode 100644 index 00000000..268e2941 --- /dev/null +++ b/assets/js/src/wp-full-pay.js @@ -0,0 +1,139 @@ +import { createRoot, useState } from '@wordpress/element'; +import { Button } from '@wordpress/components'; +import useSettings from "./common/useSettings"; +import { activatePlugin, installPluginOrTheme } from './common/utils'; + +const WPFullPayNotice = ({ + onDismiss = () => {} +}) => { + const { + title, + option, + optionKey, + labels, + wpFullPayActivationUrl, + wpFullPayDash, + } = window.themeisleSDKPromotions; + + const [ dismissed, setDismissed ] = useState( false ); + const [ progress, setProgress ] = useState( null ); + const [ getOption, updateOption ] = useSettings(); + + const dismissNotice = async () => { + setDismissed( true ); + const newValue = { ...option }; + newValue['wp-full-pay-plugins-install'] = new Date().getTime() / 1000 | 0; + window.themeisleSDKPromotions.option = newValue; + await updateOption( optionKey, JSON.stringify( newValue ) ); + + if ( onDismiss ) { + onDismiss(); + } + }; + + const installPluginRequest = async e => { + e.preventDefault(); + setProgress( 'installing' ); + await installPluginOrTheme( 'wp-full-stripe-free' ); + + setProgress( 'activating' ); + await activatePlugin( wpFullPayActivationUrl ); + + updateOption( 'themeisle_sdk_promotions_wp_full_pay_installed', ! Boolean( getOption( 'themeisle_sdk_promotions_wp_full_pay_installed' ) ) ); + setProgress('done'); + }; + + if ( dismissed ) { + return null; + } + + const installPluginRequestStatus = () => { + return progress === 'done' ? ( +
+

{ labels.all_set }

+ + +
+ ) : ( +

+ + + { progress === 'installing' && labels.installing } + { progress === 'activating' && labels.activating } + … + +

+ ); + }; + + const actionButtons = ( +
+ + + +
+ ); + + return ( + <> + + +
+
+

{ title }

+

{labels.wp_full_pay.message}

+ { progress ? installPluginRequestStatus() : actionButtons } +
+
+ + ); +}; + +const renderWPFullPayNotice = () => { + if ( window.themeisleSDKPromotions.option['wp-full-pay-plugins-install']) { + return; + } + + const root = document.querySelector( '#ti-wp-full-pay-notice' ); + + if ( ! root ) { + return; + } + + createRoot( root ).render( + { + root.style.display = 'none'; + }} + /> + ); +}; + +renderWPFullPayNotice(); diff --git a/bin/setup-env-e2e.sh b/bin/setup-env-e2e.sh index 0c51fed3..159df317 100644 --- a/bin/setup-env-e2e.sh +++ b/bin/setup-env-e2e.sh @@ -14,4 +14,7 @@ npm run wp-env run tests-cli wp option set visualizer_logger_flag "yes" echo "[3] Install plugins" npm run wp-env run tests-cli wp plugin install visualizer -npm run wp-env run tests-cli wp plugin activate visualizer \ No newline at end of file +npm run wp-env run tests-cli wp plugin activate visualizer + +echo "[4] Activate SDK as plugin" +npm run wp-env run tests-cli wp plugin activate themeisle-sdk \ No newline at end of file diff --git a/package.json b/package.json index 4e874979..21fc122e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "npm run start", "start:promos": "wp-scripts start assets/js/src/index.js --output-path=assets/js/build/promos", "start:survey": "wp-scripts start assets/js/src/survey_deps.js --output-path=assets/js/build/survey --devtool inline-source-map", + "start:banner": "wp-scripts start assets/js/src/banner.js --output-path=assets/js/build/banner --devtool inline-source-map", "build:promos": "wp-scripts build assets/js/src/index.js --output-path=assets/js/build/promos", "start:about": "wp-scripts start assets/js/src/about/about.js --output-path=assets/js/build/about", "build:about": "wp-scripts build assets/js/src/about/about.js --output-path=assets/js/build/about", @@ -13,6 +14,7 @@ "build:float": "wp-scripts build assets/js/src/float_widget/float.js --output-path=assets/js/build/float_widget", "build:tracking": "wp-scripts build assets/js/src/tracking.js --output-path=assets/js/build/tracking", "build:survey": "wp-scripts build assets/js/src/survey_deps.js --output-path=assets/js/build/survey", + "build:banner": "wp-scripts build assets/js/src/banner.js --output-path=assets/js/build/banner", "start": "npm-run-all --parallel start:*", "build": "npm-run-all --parallel build:*", "release": "semantic-release --debug", diff --git a/src/Common/Abstract_module.php b/src/Common/Abstract_module.php index cbeb9b02..54b9a59d 100644 --- a/src/Common/Abstract_module.php +++ b/src/Common/Abstract_module.php @@ -40,6 +40,7 @@ abstract class Abstract_Module { 'sparks-for-woocommerce' => 'sparks-for-woocommerce/sparks-for-woocommerce.php', 'templates-patterns-collection' => 'templates-patterns-collection/templates-patterns-collection.php', 'wpcf7-redirect' => 'wpcf7-redirect/wpcf7-redirect.php', + 'wp-full-stripe-free' => 'wp-full-stripe-free/wp-full-stripe.php', ]; /** diff --git a/src/Loader.php b/src/Loader.php index c3d62fb5..6ea71ea6 100644 --- a/src/Loader.php +++ b/src/Loader.php @@ -159,6 +159,12 @@ final class Loader { 'dismisscta' => 'Dismiss this notice.', 'message' => 'Hyve is an AI-powered chatbot that turns your WordPress content into interactive conversations, helping you efficiently handle user inquiries.', ], + 'wp_full_pay' => [ + 'gotodash' => 'Go to WP Full Pay Settings', + 'install' => 'Install WP Full Pay', + 'dismisscta' => 'Dismiss this notice.', + 'message' => 'Enhance your donation page with WP Full Pay—create custom Stripe forms for one-time and recurring donations, manage transactions easily, and boost support with a seamless setup.', + ], ], 'welcome' => [ 'ctan' => 'No, thanks.', diff --git a/src/Modules/Announcements.php b/src/Modules/Announcements.php index f465be0f..68af82e6 100644 --- a/src/Modules/Announcements.php +++ b/src/Modules/Announcements.php @@ -35,6 +35,17 @@ class Announcements extends Abstract_Module { ), ); + /** + * Mark is a banner for a product was already loaded. + * + * @var array + */ + private static $banner_loaded = array(); + + const PLUGIN_PAGE = 'https://themeisle.com/plugins'; + const THEME_PAGE = 'https://themeisle.com/themes'; + const REVIVE_SOCIAL = 'https://revive.social/plugins'; + /** * Holds the option prefix for the announcements. * @@ -51,6 +62,17 @@ class Announcements extends Abstract_Module { */ public $time = ''; + /** + * Constructor for the Announcements module. + * + * @param array $timeline Optional. An array representing the timeline of announcements. Default is an empty array. + */ + public function __construct( $timeline = array() ) { + if ( is_array( $timeline ) && ! empty( $timeline ) ) { + self::$timeline = $timeline; + } + } + /** * Check if the module can be loaded. * @@ -83,6 +105,7 @@ public function load( $product ) { add_action( 'admin_init', array( $this, 'load_announcements' ) ); add_filter( 'themeisle_sdk_active_announcements', array( $this, 'get_active_announcements' ) ); add_filter( 'themeisle_sdk_announcements', array( $this, 'get_announcements_for_plugins' ) ); + add_action( 'themeisle_sdk_load_banner', array( $this, 'load_dashboard_banner_renderer' ) ); } /** @@ -143,9 +166,18 @@ public function get_announcements_for_plugins() { $announcements[ $announcement ]['active'] = $this->is_active( $dates ); // Dashboard banners URLs. - $announcements[ $announcement ]['feedzy_dashboard_url'] = tsdk_utmify( 'https://themeisle.com/plugins/feedzy-rss-feeds/blackfriday/', 'bfcm24', 'dashboard' ); - $announcements[ $announcement ]['neve_dashboard_url'] = tsdk_utmify( 'https://themeisle.com/themes/neve/blackfriday/', 'bfcm24', 'dashboard' ); - $announcements[ $announcement ]['otter_dashboard_url'] = tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['neve_dashboard_url'] = tsdk_utmify( self::THEME_PAGE . '/neve/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['hestia_dashboard_url'] = tsdk_utmify( self::THEME_PAGE . '/hestia/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['feedzy_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/feedzy-rss-feeds/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['otter_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/otter-blocks/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['mpg_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/multi-pages-generator/blackfriday', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['ppom_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/ppom-pro/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['rfc7r_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/wpcf7-redirect/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['hyve_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/hyve/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['spc_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/super-page-cache-pro/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['visualizer_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/visualizer-charts-and-graphs/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['feedzy_dashboard_url'] = tsdk_utmify( self::PLUGIN_PAGE . '/feedzy-rss-feeds/blackfriday/', 'bfcm24', 'dashboard' ); + $announcements[ $announcement ]['rop_dashboard_url'] = tsdk_utmify( self::REVIVE_SOCIAL . '/revive-old-post/', 'bfcm24', 'dashboard' ); // Customizer banners URLs. $announcements[ $announcement ]['hestia_customizer_url'] = tsdk_utmify( 'https://themeisle.com/black-friday/', 'bfcm24', 'hestiacustomizer' ); @@ -155,6 +187,22 @@ public function get_announcements_for_plugins() { $remaining_time = $this->get_remaining_time_for_event( $dates['end'] ); $announcements[ $announcement ]['remaining_time'] = $remaining_time; $announcements[ $announcement ]['urgency_text'] = ! empty( $remaining_time ) ? sprintf( Loader::$labels['announcements']['hurry_up'], $remaining_time ) : ''; + + $announcements[ $announcement ]['feedzy_banner_src'] = defined( 'FEEDZY_ABSURL' ) ? FEEDZY_ABSURL . 'img/black-friday.jpg' : ''; + $announcements[ $announcement ]['visualizer_banner_src'] = defined( 'VISUALIZER_ABSURL' ) ? VISUALIZER_ABSURL . 'images/black-friday.jpg' : ''; + $announcements[ $announcement ]['ppom_banner_src'] = defined( 'PPOM_URL' ) ? PPOM_URL . '/images/black-friday.jpg' : ''; + $announcements[ $announcement ]['mpg_banner_src'] = defined( 'MPG_BASE_IMG_PATH' ) ? MPG_BASE_IMG_PATH . '/black-friday.jpg' : ''; + $announcements[ $announcement ]['spc_banner_src'] = defined( 'SWCFPC_PLUGIN_URL' ) ? SWCFPC_PLUGIN_URL . 'assets/img/black-friday.jpg' : ''; + $announcements[ $announcement ]['hestia_banner_src'] = defined( 'HESTIA_ASSETS_URL' ) ? HESTIA_ASSETS_URL . 'img/black-friday.jpg' : ''; + $announcements[ $announcement ]['hyve_banner_src'] = defined( 'HYVE_LITE_URL' ) ? HYVE_LITE_URL . 'assets/images/black-friday.jpg' : ''; + $announcements[ $announcement ]['rfc7r_banner_src'] = defined( 'WPCF7_PRO_REDIRECT_ASSETS_PATH' ) ? WPCF7_PRO_REDIRECT_ASSETS_PATH . 'images/black-friday.jpg' : ''; + $announcements[ $announcement ]['rop_banner_src'] = defined( 'ROP_LITE_URL' ) ? ROP_LITE_URL . 'assets/img/black-friday.jpg' : ''; + + foreach ( $announcements[ $announcement ] as $key => $value ) { + if ( strpos( $key, '_url' ) !== false ) { + $announcements[ $announcement ][ $key ] = tsdk_translate_link( $value ); + } + } } } @@ -299,11 +347,10 @@ public function black_friday_notice_render() {

- > - - - . + + - . > + target="_blank">

@@ -359,4 +406,92 @@ public function black_friday_notice_render() { get_announcements_for_plugins() as $announcement ) { + if ( false === $announcement['active'] ) { + continue; + } + + $cta_key = $product_key . '_dashboard_url'; + $banner_src_key = $product_key . '_banner_src'; + + if ( + ! isset( $announcement[ $cta_key ] ) || + ! isset( $announcement[ $banner_src_key ] ) || + empty( $announcement[ $banner_src_key ] ) || + ! isset( $announcement['urgency_text'] ) + ) { + continue; + } + + $banner_data = array( + 'content' => $this->render_banner( + array( + 'cta_url' => $announcement[ $cta_key ], + 'img_src' => $announcement[ $banner_src_key ], + 'urgency_text' => $announcement['urgency_text'], + ) + ), + ); + + break; + } + + if ( empty( $banner_data ) ) { + return; + } + + do_action( 'themeisle_sdk_dependency_enqueue_script', 'banner' ); + wp_localize_script( $banner_handler, 'tsdk_banner_data', $banner_data ); + } + + /** + * Renders a banner with the provided settings. + * + * @param array $settings { + * Optional. An array of settings for the banner. + * + * @type string $cta_url The URL for the call-to-action link. + * @type string $img_src The source URL for the banner image. + * @type string $urgency_text The urgency text to display on the banner. + * } + * @return string The HTML output of the banner. + */ + public function render_banner( $settings = array() ) { + if ( empty( $settings ) ) { + return ''; + } + + return wp_kses_post( + wp_sprintf( + '
%s
', + esc_url_raw( $settings['cta_url'] ), + esc_url_raw( $settings['img_src'] ), + sanitize_text_field( $settings['urgency_text'] ) + ) + ); + } } diff --git a/src/Modules/Promotions.php b/src/Modules/Promotions.php index f3715a52..22d9905d 100644 --- a/src/Modules/Promotions.php +++ b/src/Modules/Promotions.php @@ -91,6 +91,13 @@ class Promotions extends Abstract_Module { */ private $option_hyve = 'themeisle_sdk_promotions_hyve_installed'; + /** + * Option key for WP Full Pay. + * + * @var string + */ + private $option_wp_full_pay = 'themeisle_sdk_promotions_wp_full_pay_installed'; + /** * Loaded promotion. * @@ -135,6 +142,7 @@ public function can_load( $product ) { $promotions_to_load[] = 'neve'; $promotions_to_load[] = 'redirection-cf7'; $promotions_to_load[] = 'hyve'; + $promotions_to_load[] = 'wp_full_pay'; $promotions_to_load = array_unique( $promotions_to_load ); @@ -234,6 +242,10 @@ public function register_reference() { if ( isset( $_GET['hyve_reference_key'] ) ) { update_option( 'hyve_reference_key', sanitize_key( $_GET['hyve_reference_key'] ) ); } + + if ( isset( $_GET['wp_full_pay_reference_key'] ) ) { + update_option( 'wp_full_pay_reference_key', sanitize_key( $_GET['wp_full_pay_reference_key'] ) ); + } } /** @@ -313,6 +325,16 @@ public function register_settings() { 'default' => false, ) ); + register_setting( + 'themeisle_sdk_settings', + $this->option_wp_full_pay, + array( + 'type' => 'boolean', + 'sanitize_callback' => 'rest_sanitize_boolean', + 'show_in_rest' => true, + 'default' => false, + ) + ); } /** @@ -369,6 +391,8 @@ private function get_promotions() { $has_hyve = defined( 'HYVE_LITE_VERSION' ) || $this->is_plugin_installed( 'hyve' ) || $this->is_plugin_installed( 'hyve-lite' ); $had_hyve_from_promo = get_option( $this->option_hyve, false ); $has_hyve_conditions = version_compare( get_bloginfo( 'version' ), '6.2', '>=' ) && $this->has_support_page(); + $has_wfp_full_pay = defined( 'WP_FULL_STRIPE_BASENAME' ) || $this->is_plugin_installed( 'wp-full-stripe-free' ); + $had_wfp_from_promo = get_option( $this->option_wp_full_pay, false ); $is_min_req_v = version_compare( get_bloginfo( 'version' ), '5.8', '>=' ); $current_theme = wp_get_theme(); $has_neve = $current_theme->template === 'neve' || $current_theme->parent() === 'neve'; @@ -464,6 +488,12 @@ private function get_promotions() { 'screen' => 'plugin-install', ], ], + 'wp_full_pay' => [ + 'wp-full-pay-plugins-install' => [ + 'env' => ! $has_wfp_full_pay && ! $had_wfp_from_promo, + 'screen' => 'plugin-install', + ], + ], ]; foreach ( $all as $slug => $data ) { @@ -648,6 +678,10 @@ private function load_promotion( $slug ) { add_action( 'admin_notices', [ $this, 'render_hyve_notice' ] ); } + if ( $this->get_upsells_dismiss_time( 'wp-full-pay-plugins-install' ) === false ) { + add_action( 'admin_notices', [ $this, 'render_wp_full_pay_notice' ] ); + } + $this->load_woo_promos(); return; @@ -702,6 +736,10 @@ private function load_promotion( $slug ) { add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); add_action( 'admin_notices', [ $this, 'render_hyve_notice' ] ); break; + case 'wp-full-pay-plugins-install': + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); + add_action( 'admin_notices', [ $this, 'render_wp_full_pay_notice' ] ); + break; } } @@ -738,31 +776,33 @@ public function enqueue() { $handle, 'themeisleSDKPromotions', [ - 'debug' => $this->debug, - 'labels' => Loader::$labels['promotions'], - 'email' => $user->user_email, - 'showPromotion' => $this->loaded_promo, - 'optionKey' => $this->option_main, - 'product' => $this->product->get_name(), - 'option' => empty( $saved ) ? new \stdClass() : $saved, - 'nonce' => wp_create_nonce( 'wp_rest' ), - 'assets' => $themeisle_sdk_src . 'assets/images/', - 'optimoleApi' => esc_url( rest_url( 'optml/v1/register_service' ) ), - 'optimoleActivationUrl' => $this->get_plugin_activation_link( 'optimole-wp' ), - 'otterActivationUrl' => $this->get_plugin_activation_link( 'otter-blocks' ), - 'ropActivationUrl' => $this->get_plugin_activation_link( 'tweet-old-post' ), - 'optimoleDash' => esc_url( add_query_arg( [ 'page' => 'optimole' ], admin_url( 'upload.php' ) ) ), - 'ropDash' => esc_url( add_query_arg( [ 'page' => 'TweetOldPost' ], admin_url( 'admin.php' ) ) ), + 'debug' => $this->debug, + 'labels' => Loader::$labels['promotions'], + 'email' => $user->user_email, + 'showPromotion' => $this->loaded_promo, + 'optionKey' => $this->option_main, + 'product' => $this->product->get_name(), + 'option' => empty( $saved ) ? new \stdClass() : $saved, + 'nonce' => wp_create_nonce( 'wp_rest' ), + 'assets' => $themeisle_sdk_src . 'assets/images/', + 'optimoleApi' => esc_url( rest_url( 'optml/v1/register_service' ) ), + 'optimoleActivationUrl' => $this->get_plugin_activation_link( 'optimole-wp' ), + 'otterActivationUrl' => $this->get_plugin_activation_link( 'otter-blocks' ), + 'ropActivationUrl' => $this->get_plugin_activation_link( 'tweet-old-post' ), + 'optimoleDash' => esc_url( add_query_arg( [ 'page' => 'optimole' ], admin_url( 'upload.php' ) ) ), + 'ropDash' => esc_url( add_query_arg( [ 'page' => 'TweetOldPost' ], admin_url( 'admin.php' ) ) ), // translators: %s is the product name. - 'title' => esc_html( sprintf( Loader::$labels['promotions']['recommended'], $this->product->get_name() ) ), - 'redirectionCF7MoreUrl' => tsdk_utmify( 'https://docs.themeisle.com/collection/2014-redirection-for-contact-form-7', 'redirection-for-contact-form-7', 'plugin-install' ), - 'rfCF7ActivationUrl' => $this->get_plugin_activation_link( 'wpcf7-redirect' ), - 'cf7Dash' => esc_url( add_query_arg( [ 'page' => 'wpcf7-new' ], admin_url( 'admin.php' ) ) ), - 'hyveActivationUrl' => $this->get_plugin_activation_link( 'hyve-lite' ), - 'hyveDash' => esc_url( add_query_arg( [ 'page' => 'hyve' ], admin_url( 'admin.php' ) ) ), - 'nevePreviewURL' => esc_url( add_query_arg( [ 'theme' => 'neve' ], admin_url( 'theme-install.php' ) ) ), - 'neveAction' => $neve_action, - 'activateNeveURL' => esc_url( + 'title' => esc_html( sprintf( Loader::$labels['promotions']['recommended'], $this->product->get_name() ) ), + 'redirectionCF7MoreUrl' => tsdk_utmify( 'https://docs.themeisle.com/collection/2014-redirection-for-contact-form-7', 'redirection-for-contact-form-7', 'plugin-install' ), + 'rfCF7ActivationUrl' => $this->get_plugin_activation_link( 'wpcf7-redirect' ), + 'cf7Dash' => esc_url( add_query_arg( [ 'page' => 'wpcf7-new' ], admin_url( 'admin.php' ) ) ), + 'hyveActivationUrl' => $this->get_plugin_activation_link( 'hyve-lite' ), + 'hyveDash' => esc_url( add_query_arg( [ 'page' => 'wpfs-settings-stripe' ], admin_url( 'admin.php' ) ) ), + 'wpFullPayActivationUrl' => $this->get_plugin_activation_link( 'wp-full-stripe-free' ), + 'wpFullPayDash' => esc_url( add_query_arg( [ 'page' => 'wpfs-settings-stripe' ], admin_url( 'admin.php' ) ) ), + 'nevePreviewURL' => esc_url( add_query_arg( [ 'theme' => 'neve' ], admin_url( 'theme-install.php' ) ) ), + 'neveAction' => $neve_action, + 'activateNeveURL' => esc_url( add_query_arg( [ 'action' => 'activate', @@ -805,6 +845,13 @@ public function render_hyve_notice() { echo '
'; } + /** + * Render WP Full Pay notice. + */ + public function render_wp_full_pay_notice() { + echo '
'; + } + /** * Render Redirection for CF7 notice. */ @@ -1251,4 +1298,31 @@ public function has_support_page() { return 'yes' === $has_support; } + + /** + * Check if the user has a donate page. + */ + public function has_donate_page() { + $transient_name = 'tisdk_has_donate_page'; + $has_donate = get_transient( $transient_name ); + + if ( false === $has_donate ) { + global $wpdb; + + $query = $wpdb->get_var( //phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $wpdb->prepare( + 'SELECT ID FROM ' . $wpdb->posts . ' WHERE post_type = %s AND post_status = %s AND post_title LIKE %s LIMIT 1', + 'page', + 'publish', + '%donate%' + ) + ); + + $has_donate = $query ? 'yes' : 'no'; + + set_transient( $transient_name, $has_donate, 7 * DAY_IN_SECONDS ); + } + + return 'yes' === $has_donate; + } } diff --git a/src/Modules/Script_loader.php b/src/Modules/Script_loader.php index 38b131b2..af8cf04f 100644 --- a/src/Modules/Script_loader.php +++ b/src/Modules/Script_loader.php @@ -78,7 +78,7 @@ public function get_script_handler( $slug ) { return ''; } - if ( 'tracking' !== $slug && 'survey' !== $slug ) { + if ( 'tracking' !== $slug && 'survey' !== $slug && 'banner' !== $slug ) { return ''; } @@ -100,6 +100,8 @@ public function enqueue_script( $slug ) { $this->load_tracking( $handler ); } elseif ( 'survey' === $slug ) { $this->load_survey( $handler ); + } elseif ( 'banner' === $slug ) { + $this->load_banner( $handler ); } } @@ -151,4 +153,31 @@ public function load_tracking( $handler ) { true ); } + + /** + * Load the banner script. + * + * @param string $handler The script handler. + * + * @return void + */ + public function load_banner( $handler ) { + global $themeisle_sdk_max_path; + $asset_file = require $themeisle_sdk_max_path . '/assets/js/build/banner/banner.asset.php'; + + wp_enqueue_script( + $handler, + $this->get_sdk_uri() . 'assets/js/build/banner/banner.js', + $asset_file['dependencies'], + $asset_file['version'], + true + ); + + wp_enqueue_style( + $handler . '_style', + $this->get_sdk_uri() . 'assets/css/banner.css', + [], + $asset_file['version'] + ); + } } diff --git a/tests/announcement-test.php b/tests/announcement-test.php index 9d9bd590..ca5b98a8 100644 --- a/tests/announcement-test.php +++ b/tests/announcement-test.php @@ -123,4 +123,61 @@ public function test_announcement_without_start_and_end_date() { $module->time = '2024-11-27 23:59:59'; $this->assertFalse( $module->is_active( $dates ) ); } + + public function test_get_announcements_for_plugins() { + // Setup dates using UTC time + $start = gmdate( 'Y-m-d H:i:s', strtotime( '-1 day', time() ) ); + $end = gmdate( 'Y-m-d H:i:s', strtotime( 'tomorrow', time() ) ); + + $module = new \ThemeisleSDK\Modules\Announcements( + array( + 'black_friday' => array( + 'start' => $start, + 'end' => $end, + 'rendered' => false, + ), + ) + ); + + // Get announcements and verify structure + $announcements = $module->get_announcements_for_plugins(); + + // Check if black friday announcement exists and is active + $this->assertArrayHasKey( 'black_friday', $announcements ); + $this->assertTrue( ! empty( $announcements['black_friday']['active'] ) ); + + // Verify required URL and banner fields exist for neve product + $this->assertArrayHasKey( 'neve_dashboard_url', $announcements['black_friday'] ); + + // Verify URLs are valid + foreach ( $announcements['black_friday'] as $key => $value ) { + if ( strpos( $key, '_url' ) !== false ) { + $this->assertNotEmpty( filter_var( $value, FILTER_VALIDATE_URL ) ); + } + } + } + + public function test_render_banner() { + $module = new \ThemeisleSDK\Modules\Announcements(); + + $test_settings = array( + 'cta_url' => 'https://example.com', + 'img_src' => 'https://example.com/image.jpg', + 'urgency_text' => 'Test urgency text', + ); + + $rendered = $module->render_banner( $test_settings ); + + $this->assertStringContainsString( 'href="' . $test_settings['cta_url'] . '"', $rendered ); + $this->assertStringContainsString( 'src="' . $test_settings['img_src'] . '"', $rendered ); + $this->assertStringContainsString( $test_settings['urgency_text'], $rendered ); + + $this->assertStringContainsString( 'class="tsdk-banner-cta"', $rendered ); + $this->assertStringContainsString( 'class="tsdk-banner-img"', $rendered ); + $this->assertStringContainsString( 'class="tsdk-banner-urgency-text"', $rendered ); + + // Test with empty settings + $empty_rendered = $module->render_banner(); + $this->assertEmpty( $empty_rendered ); + } }