Initial commit: Atomaste website
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(globalThis.webpackChunkreally_simple_ssl_modal=globalThis.webpackChunkreally_simple_ssl_modal||[]).push([[433],{433:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var l=r(609),n=r(427),s=r(87),a=r(723),o=r(378),m=r.n(o);class c extends s.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null},this.resetError=this.resetError.bind(this)}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.log("ErrorBoundary",e,t)}resetError(){this.setState({hasError:!1,error:null,errorInfo:null})}render(){return this.state.hasError?(0,l.createElement)("div",null,(0,l.createElement)("h1",null,"Something went wrong."),(0,l.createElement)("p",null,this.props.fallback),(0,l.createElement)("button",{onClick:this.resetError},"Try Again")):this.props.children}}c.propTypes={children:m().node,fallback:m().node};const i=c,p=({title:e,subTitle:t,currentStep:o,buttons:m,content:c,list:p,confirmAction:u,confirmText:d,alternativeAction:E,alternativeText:h,alternativeClassName:f,isOpen:g,setOpen:y,className:w})=>{const[_,b]=(0,s.useState)(null);let C="undefined"!=typeof rsssl_modal?rsssl_modal.plugin_url:rsssl_settings.plugin_url;f=f||"rsssl-warning",(0,s.useEffect)((()=>{_||Promise.all([r.e(161),r.e(291)]).then(r.bind(r,291)).then((({default:e})=>{b((()=>e))}))}));let T=w?" "+w:"";return wp.element.createElement(l.Fragment,null,g&&wp.element.createElement(l.Fragment,null,wp.element.createElement(i,{fallback:"Error loading modal"},wp.element.createElement(n.Modal,{className:"rsssl-modal"+T,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,title:e,onRequestClose:()=>y(!1),open:g},wp.element.createElement("div",{className:"rsssl-modal-body"},t&&wp.element.createElement("p",{dangerouslySetInnerHTML:{__html:t}}),c&&wp.element.createElement(l.Fragment,null,c),p&&_&&wp.element.createElement("ul",null,p.map(((e,t)=>wp.element.createElement("li",{key:t},wp.element.createElement(_,{name:e.icon,color:e.color}),e.text))))),wp.element.createElement("div",{className:"rsssl-modal-footer"},wp.element.createElement("div",{className:"rsssl-modal-footer-image"},wp.element.createElement("img",{className:"rsssl-logo",src:C+"assets/img/really-simple-security-logo.svg",alt:"Really Simple Security"})),wp.element.createElement("div",{className:"rsssl-modal-footer-buttons"},wp.element.createElement(n.Button,{onClick:()=>y(!1)},(0,a.__)("Cancel","really-simple-ssl")),m&&wp.element.createElement(l.Fragment,null,m),!m&&wp.element.createElement(l.Fragment,null,h&&wp.element.createElement(n.Button,{className:f,onClick:()=>E()},h),d&&wp.element.createElement(n.Button,{isPrimary:!0,onClick:()=>u()},d))))))))}},572:(e,t,r)=>{"use strict";var l=r(808);function n(){}function s(){}s.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,s,a){if(a!==l){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:n};return r.PropTypes=r,r}},378:(e,t,r)=>{e.exports=r(572)()},808:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}}]);
|
||||
@@ -0,0 +1 @@
|
||||
:root{--rsp-spacing-xxs:5px;--rsp-spacing-xs:10px;--rsp-spacing-s:15px;--rsp-spacing-m:20px;--rsp-spacing-l:25px;--rsp-spacing-xl:30px;--rsp-grid-margin:var(--rsp-spacing-s);--rsp-grid-gap:var(--rsp-spacing-m);--rsp-border-radius:12px;--rsp-border-radius-s:8px;--rsp-border-radius-xs:3px;--rsp-border:1px solid var(--rsp-border-color);--rsp-box-shadow:rgba(0,0,0,.1) 0px 4px 6px -1px,rgba(0,0,0,.06) 0px 2px 4px -1px;--rsp-box-shadow-dark:rgba(0,0,0,.2) 0px 4px 6px -1px,rgba(0,0,0,.12) 1px 0px 4px 1px;--rsp-border-color:#dfdfdf;--rsp-black:#333;--rsp-white:#fff;--rsp-yellow:#fbc43e;--rsp-blue:#009fff;--rsp-dark-yellow:#e6a800;--rsp-dark-blue:#1e73be;--rsp-green:#2e8a37;--rsp-red:#d7263d;--rsp-dark-red:#9b0212;--rsp-pink:#e35899;--rsp-wp-blue:#007cba;--rsp-yellow-faded:#fdf4df;--rsp-blue-faded:#ecf8fe;--rsp-dark-blue-faded:#ebf2f9;--rsp-green-faded:#ecf4ed;--rsp-red-faded:#fbebed;--rsp-pink-faded:#fceff5;--rsp-wp-blue-faded:#c6e0ef;--rsp-background-block-color:var(--rsp-white);--rsp-background-color:#f0f0f1;--rsp-input-background-color:#fff;--rsp-input-text-color:var(--rsp-text-color);--rsp-input-border-color:var(--rsp-grey-400);--rsp-text-color:rgba(26,26,26,.9);--rsp-text-color-invert:hsla(0,0%,100%,.9);--rsp-text-color-white:hsla(0,0%,100%,.9);--rsp-text-color-light:rgba(69,69,82,.9);--rsp-text-color-hover:var(--rsp-green);--rsp-grey-100:#fafafa;--rsp-grey-200:#f7f7f7;--rsp-grey-300:#ededed;--rsp-grey-400:#c6c6c6;--rsp-grey-500:#737373;--rsp-grey-600:#696969;--rsp-color-success:var(--rsp-green);--rsp-color-error:var(--rsp-red);--rsp-color-warning:var(--rsp-yellow);--rsp-color-open:var(--rsp-yellow);--rsp-color-disabled:var(--rsp-grey-300);--rsp-fs-100:0.6875rem;--rsp-fs-200:0.75rem;--rsp-fs-300:0.8125rem;--rsp-fs-400:0.875rem;--rsp-fs-500:1rem;--rsp-fs-600:1.125rem;--rsp-fs-700:1.25rem;--rsp-fs-800:1.5rem;--rsp-fs-850:2.8rem;--rsp-fs-900:3.5rem}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.rsssl-modal{border-radius:var(--rsp-border-radius) var(--rsp-border-radius);border-top:1px solid var(--rsp-grey-300);box-shadow:var(--rsp-box-shadow);margin:auto;max-height:calc(100% - 120px);max-width:700px;overflow:visible;padding:var(--rsp-spacing-m) var(--rsp-spacing-l);width:700px}@media(max-width:768px){.rsssl-modal{width:100%}}.rsssl-modal .components-modal__content{margin-top:45px;min-height:250px;padding:0}.rsssl-modal .components-modal__content>div:nth-child(2){display:flex;flex-direction:column;height:100%}.rsssl-modal .rsssl-modal-body{flex-grow:1;padding:12px 8px 80px}@media(max-width:768px){.rsssl-modal .rsssl-modal-body{padding:12px 8px 180px}}.rsssl-modal .rsssl-modal-body p{margin-top:0}.rsssl-modal .rsssl-modal-body ul{-moz-column-count:2;column-count:2;-moz-column-gap:20px;column-gap:20px;margin-bottom:0}.rsssl-modal .rsssl-modal-body ul li{display:flex;padding-bottom:5px}.rsssl-modal .rsssl-modal-body ul li .rsssl-icon{margin-right:10px;margin-top:2px}.rsssl-modal .rsssl-modal-footer{align-items:center;background-color:var(--rsp-grey-200);border-bottom-left-radius:var(--rsp-border-radius) var(--rsp-border-radius);border-bottom-right-radius:var(--rsp-border-radius) var(--rsp-border-radius);border-top:1px solid var(--rsp-grey-400);bottom:0;display:flex;justify-content:space-between;left:0;padding:20px 32px;position:absolute;right:0}.rsssl-modal .rsssl-modal-footer .rsssl-modal-footer-buttons{display:flex}.rsssl-modal .rsssl-modal-footer .rsssl-modal-footer-buttons .rsssl-activate-license-text{color:var(--rsp-red);margin-right:10px}.rsssl-modal .rsssl-modal-footer img{width:150px}@media(max-width:768px){.rsssl-modal .rsssl-modal-footer .rsssl-modal-footer-image{display:none}.rsssl-modal .rsssl-modal-footer .rsssl-modal-footer-buttons{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.rsssl-modal .rsssl-modal-footer .rsssl-modal-footer-buttons button{margin:0;width:100%}}.rsssl-modal .rsssl-modal-footer button+a,.rsssl-modal .rsssl-modal-footer button+button{margin-left:10px}.rsssl-modal .rsssl-modal-footer button:not(.is-primary){background-color:transparent;border:1px solid var(--wp-admin-theme-color,#3858e9);color:var(--wp-admin-theme-color,#3858e9)}.rsssl-modal .rsssl-modal-footer button.rsssl-modal-warning{background-color:transparent;border:1px solid var(--rsp-red);color:var(--rsp-red)}
|
||||
@@ -0,0 +1 @@
|
||||
(globalThis.webpackChunkreally_simple_ssl_modal=globalThis.webpackChunkreally_simple_ssl_modal||[]).push([[433],{433:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var l=r(609),n=r(427),s=r(87),a=r(723),o=r(378),m=r.n(o);class c extends s.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null},this.resetError=this.resetError.bind(this)}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.log("ErrorBoundary",e,t)}resetError(){this.setState({hasError:!1,error:null,errorInfo:null})}render(){return this.state.hasError?(0,l.createElement)("div",null,(0,l.createElement)("h1",null,"Something went wrong."),(0,l.createElement)("p",null,this.props.fallback),(0,l.createElement)("button",{onClick:this.resetError},"Try Again")):this.props.children}}c.propTypes={children:m().node,fallback:m().node};const i=c,p=({title:e,subTitle:t,currentStep:o,buttons:m,content:c,list:p,confirmAction:u,confirmText:d,alternativeAction:E,alternativeText:h,alternativeClassName:f,isOpen:g,setOpen:y,className:w})=>{const[_,b]=(0,s.useState)(null);let C="undefined"!=typeof rsssl_modal?rsssl_modal.plugin_url:rsssl_settings.plugin_url;f=f||"rsssl-warning",(0,s.useEffect)((()=>{_||Promise.all([r.e(926),r.e(291)]).then(r.bind(r,291)).then((({default:e})=>{b((()=>e))}))}));let T=w?" "+w:"";return wp.element.createElement(l.Fragment,null,g&&wp.element.createElement(l.Fragment,null,wp.element.createElement(i,{fallback:"Error loading modal"},wp.element.createElement(n.Modal,{className:"rsssl-modal"+T,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,title:e,onRequestClose:()=>y(!1),open:g},wp.element.createElement("div",{className:"rsssl-modal-body"},t&&wp.element.createElement("p",{dangerouslySetInnerHTML:{__html:t}}),c&&wp.element.createElement(l.Fragment,null,c),p&&_&&wp.element.createElement("ul",null,p.map(((e,t)=>wp.element.createElement("li",{key:t},wp.element.createElement(_,{name:e.icon,color:e.color}),e.text))))),wp.element.createElement("div",{className:"rsssl-modal-footer"},wp.element.createElement("div",{className:"rsssl-modal-footer-image"},wp.element.createElement("img",{className:"rsssl-logo",src:C+"assets/img/really-simple-security-logo.svg",alt:"Really Simple Security"})),wp.element.createElement("div",{className:"rsssl-modal-footer-buttons"},wp.element.createElement(n.Button,{onClick:()=>y(!1)},(0,a.__)("Cancel","really-simple-ssl")),m&&wp.element.createElement(l.Fragment,null,m),!m&&wp.element.createElement(l.Fragment,null,h&&wp.element.createElement(n.Button,{className:f,onClick:()=>E()},h),d&&wp.element.createElement(n.Button,{isPrimary:!0,onClick:()=>u()},d))))))))}},572:(e,t,r)=>{"use strict";var l=r(808);function n(){}function s(){}s.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,s,a){if(a!==l){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:n};return r.PropTypes=r,r}},378:(e,t,r)=>{e.exports=r(572)()},808:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}}]);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd4bca8705bbc6e3e5777');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd6b3038dea3995c8535e');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! function_exists('rsssl_plugin_plugin_page_scripts')) {
|
||||
function rsssl_plugin_plugin_page_scripts($hook)
|
||||
{
|
||||
if ( $hook !== 'plugins.php' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$js_data = rsssl_get_chunk_translations( 'modal/build' );
|
||||
if (empty($js_data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style('wp-components');
|
||||
$handle = 'rsssl-modal';
|
||||
wp_enqueue_script(
|
||||
$handle,
|
||||
plugins_url('build/' . $js_data['js_file'], __FILE__),
|
||||
$js_data['dependencies'],
|
||||
$js_data['version'],
|
||||
true
|
||||
);
|
||||
wp_set_script_translations($handle, 'really-simple-ssl');
|
||||
$token = wp_create_nonce('rsssl_deactivate_plugin');
|
||||
$deactivate_keep_ssl_link = rsssl_admin_url([ 'action' => 'uninstall_keep_ssl', 'token' => $token ]);
|
||||
$deactivate_revert_ssl_link = rsssl_admin_url([ 'action' => 'uninstall_revert_ssl', 'token' => $token ]);
|
||||
|
||||
wp_localize_script(
|
||||
$handle,
|
||||
'rsssl_modal',
|
||||
apply_filters('rsssl_localize_script', [
|
||||
'json_translations' => $js_data['json_translations'],
|
||||
'plugin_url' => rsssl_url,
|
||||
'deactivate_keep_https' => $deactivate_keep_ssl_link,
|
||||
'deactivate_revert_https' => $deactivate_revert_ssl_link,
|
||||
'pro_plugin_active' => defined('rsssl_pro'),
|
||||
])
|
||||
);
|
||||
|
||||
function rsssl_add_modal_root_div()
|
||||
{
|
||||
// Check if we're on the plugins.php page
|
||||
$screen = get_current_screen();
|
||||
if ($screen && $screen->id === 'plugins') {
|
||||
echo '<div id="rsssl-modal-root"></div>';
|
||||
}
|
||||
}
|
||||
|
||||
add_action('admin_footer', 'rsssl_add_modal_root_div');
|
||||
}
|
||||
}
|
||||
add_action('admin_enqueue_scripts', 'rsssl_plugin_plugin_page_scripts');
|
||||
@@ -0,0 +1,137 @@
|
||||
import {__} from "@wordpress/i18n";
|
||||
import {useEffect, useState} from "@wordpress/element";
|
||||
|
||||
const DeactivationModal = () => {
|
||||
|
||||
const [isOpen, setOpen] = useState(false);
|
||||
const [RssslModal, setRssslModal] = useState(false);
|
||||
const [targetPluginLink, setTargetPluginLink] = useState(null);
|
||||
const isPremium = rsssl_modal.pro_plugin_active;
|
||||
|
||||
useEffect(() => {
|
||||
// Dynamically set the targetPluginLink based on isPremium
|
||||
const linkId = isPremium ? 'deactivate-really-simple-security-pro' : 'deactivate-really-simple-security';
|
||||
const linkElement = document.getElementById(linkId);
|
||||
setTargetPluginLink(linkElement);
|
||||
|
||||
const handleClick = (event) => {
|
||||
event.preventDefault();
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
if (linkElement) {
|
||||
linkElement.addEventListener('click', handleClick);
|
||||
}
|
||||
|
||||
// Clean up the event listener
|
||||
return () => {
|
||||
if (linkElement) {
|
||||
linkElement.removeEventListener('click', handleClick);
|
||||
}
|
||||
};
|
||||
}, [isPremium]); // Re-run this effect if isPremium changes
|
||||
|
||||
const deactivateKeepHttps = () => {
|
||||
setOpen(false);
|
||||
window.location.href = rsssl_modal.deactivate_keep_https;
|
||||
};
|
||||
|
||||
const deactivateAndRevert = () => {
|
||||
setOpen(false);
|
||||
window.location.href = rsssl_modal.deactivate_revert_https;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!RssslModal && isOpen) {
|
||||
import("../Modal/RssslModal").then(({default: LoadedRssslModal}) => {
|
||||
setRssslModal(() => LoadedRssslModal);
|
||||
});
|
||||
}
|
||||
}, [isOpen, RssslModal]);
|
||||
|
||||
const content = () => {
|
||||
return (
|
||||
<>
|
||||
{__("Please choose the correct deactivation method, and before you go; you will miss out on below and future features in Really Simple Security", "really-simple-ssl")}
|
||||
{isPremium && <> <b>Pro</b></>}
|
||||
!
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const list = isPremium ? [
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("SSL Encryption", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Firewall", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Vulnerability Management", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("WordPress Hardening", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Login Protection", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Two-Factor Authentication", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Limit Login Attempts", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Visitor Protection", "really-simple-ssl"),
|
||||
},
|
||||
] :
|
||||
[
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("SSL Encryption", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("Vulnerability Management", "really-simple-ssl"),
|
||||
},
|
||||
{
|
||||
'icon': 'circle-times',
|
||||
'color': 'red',
|
||||
'text': __("WordPress hardening", "really-simple-ssl"),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
{RssslModal && <RssslModal title={__("Are you sure?", "really-simple-ssl")}
|
||||
confirmText={__("Deactivate", "really-simple-ssl")}
|
||||
confirmAction={() => deactivateKeepHttps()}
|
||||
alternativeText={__("Deactivate and use HTTP", "really-simple-ssl")}
|
||||
alternativeAction={() => deactivateAndRevert()}
|
||||
alternativeClassName="rsssl-modal-warning"
|
||||
content={content()}
|
||||
list={list}
|
||||
isOpen={isOpen}
|
||||
setOpen={setOpen}/>
|
||||
}
|
||||
</>
|
||||
);
|
||||
}
|
||||
export default DeactivationModal;
|
||||
@@ -0,0 +1,88 @@
|
||||
/** @jsx wp.element.createElement */
|
||||
import { Modal, Button } from "@wordpress/components";
|
||||
import {useEffect, useState} from "@wordpress/element";
|
||||
import { __ } from "@wordpress/i18n";
|
||||
import './RssslModal.scss';
|
||||
import ErrorBoundary from "../../../../settings/src/utils/ErrorBoundary";
|
||||
// import useLicense from "../../../../settings/src/Settings/License/LicenseData";
|
||||
|
||||
const RssslModal = ({title, subTitle, currentStep, buttons, content, list, confirmAction, confirmText, alternativeAction, alternativeText, alternativeClassName, isOpen, setOpen, className}) => {
|
||||
const [Icon, setIcon] = useState(null);
|
||||
// const {licenseStatus} = useLicense();
|
||||
|
||||
let pluginUrl = typeof rsssl_modal !== 'undefined' ? rsssl_modal.plugin_url : rsssl_settings.plugin_url;
|
||||
alternativeClassName = alternativeClassName ? alternativeClassName : 'rsssl-warning';
|
||||
useEffect( () => {
|
||||
if (!Icon) {
|
||||
import ("../../../../settings/src/utils/Icon").then(({default: Icon}) => {
|
||||
setIcon(() => Icon);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
const handleLicenseClick = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
let modalCustomClass = className ? ' '+className : ""
|
||||
return (
|
||||
<>
|
||||
{isOpen && (
|
||||
<>
|
||||
<ErrorBoundary fallback={"Error loading modal"}>
|
||||
<Modal
|
||||
className={"rsssl-modal"+modalCustomClass}
|
||||
shouldCloseOnClickOutside={false}
|
||||
shouldCloseOnEsc={false}
|
||||
title={title}
|
||||
onRequestClose={() => setOpen(false)}
|
||||
open={isOpen}>
|
||||
<div className="rsssl-modal-body">
|
||||
{subTitle && (
|
||||
<p
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: subTitle
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{content && <>{content}</>}
|
||||
{list && Icon && <ul>
|
||||
{list.map((item, index) => <li key={index}><Icon name={item.icon} color={item.color}/>{item.text}</li>)}
|
||||
</ul>}
|
||||
</div>
|
||||
<div className="rsssl-modal-footer">
|
||||
<div className="rsssl-modal-footer-image">
|
||||
<img className="rsssl-logo" src={pluginUrl+"assets/img/really-simple-security-logo.svg"} alt="Really Simple Security" />
|
||||
</div>
|
||||
<div className="rsssl-modal-footer-buttons">
|
||||
{/*# If is last step of onboarding (pro), and license not valid*/}
|
||||
{/*{ rsssl_settings.pro_plugin_active && licenseStatus !== 'valid' && currentStep.id === 'pro' && (*/}
|
||||
{/* <p className={"rsssl-activate-license-text"}>*/}
|
||||
{/* {__("Please", "really-simple-ssl") + " "}*/}
|
||||
{/* <a href="#settings/license" onClick={handleLicenseClick}>*/}
|
||||
{/* {__('activate your license key', 'really-simple-ssl')}*/}
|
||||
{/* </a>*/}
|
||||
{/* {" " + __("to enable Pro features", "really-simple-ssl")}*/}
|
||||
{/* </p>*/}
|
||||
{/*)}*/}
|
||||
<Button onClick={() => setOpen(false)}>{__("Cancel", "really-simple-ssl")}</Button>
|
||||
{ buttons && <>{buttons}</>}
|
||||
{ !buttons && <>
|
||||
{alternativeText && <Button className={alternativeClassName} onClick={() => alternativeAction()}>{alternativeText}</Button>}
|
||||
{confirmText && <Button isPrimary onClick={()=> confirmAction() }>{confirmText}</Button>}
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Modal>
|
||||
</ErrorBoundary>
|
||||
</>
|
||||
|
||||
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default RssslModal;
|
||||
@@ -0,0 +1,120 @@
|
||||
@import '../../../../assets/css/variables.scss';
|
||||
.rsssl-modal {
|
||||
overflow: visible;
|
||||
width: 700px;
|
||||
max-width: 700px;
|
||||
//background:var(--rsp-grey-100);
|
||||
padding:var(--rsp-spacing-m) var(--rsp-spacing-l);
|
||||
box-shadow:var(--rsp-box-shadow);
|
||||
border-radius:var(--rsp-border-radius) var(--rsp-border-radius);
|
||||
border-top:1px solid var(--rsp-grey-300);
|
||||
max-height: calc(100% - 120px); //the default wp modal limits this to minimum 600px, but this creates an ugly modal.
|
||||
margin:auto;//the default wp modal limits this to minimum 600px, but this creates an ugly modal.
|
||||
@media (max-width: 768px) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.components-modal__content {
|
||||
min-height: 250px;
|
||||
//reset default padding so we can add a footer with background
|
||||
padding:0;
|
||||
margin-top:45px;
|
||||
|
||||
& > div:nth-child(2) {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.rsssl-modal-body {
|
||||
flex-grow: 1;
|
||||
padding: 12px 8px 80px 8px; //80 is for the complete footer height + margin
|
||||
@media (max-width: 768px) {
|
||||
padding: 12px 8px 180px 8px;
|
||||
|
||||
}
|
||||
p {
|
||||
margin-top:0;
|
||||
}
|
||||
ul {
|
||||
column-count: 2;
|
||||
column-gap: 20px;
|
||||
margin-bottom:0;
|
||||
li {
|
||||
display: flex;
|
||||
padding-bottom: 5px;
|
||||
|
||||
.rsssl-icon {
|
||||
margin-top: 2px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rsssl-modal-footer {
|
||||
background-color: var(--rsp-grey-200);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-top: 1px solid var(--rsp-grey-400);
|
||||
padding: 20px 32px;
|
||||
//ensure the footer doesn't scroll out of sight on smaller screens.
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
.rsssl-modal-footer-buttons {
|
||||
display: flex;
|
||||
.rsssl-activate-license-text {
|
||||
margin-right: 10px;
|
||||
color: var(--rsp-red);
|
||||
}
|
||||
}
|
||||
border-bottom-left-radius: var(--rsp-border-radius) var(--rsp-border-radius);
|
||||
border-bottom-right-radius: var(--rsp-border-radius) var(--rsp-border-radius);
|
||||
img {
|
||||
width: 150px;
|
||||
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.rsssl-modal-footer-image {
|
||||
display:none;
|
||||
}
|
||||
.rsssl-modal-footer-buttons {
|
||||
width:100%;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
button {
|
||||
width: 100%;
|
||||
margin:0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button + button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
button + a {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
button {
|
||||
&:not(.is-primary) {
|
||||
border: 1px solid var(--wp-admin-theme-color, #3858e9);
|
||||
color: var(--wp-admin-theme-color, #3858e9);
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&.rsssl-modal-warning {
|
||||
border: 1px solid var(--rsp-red);
|
||||
color: var(--rsp-red);
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import {
|
||||
render, createRoot
|
||||
} from '@wordpress/element';
|
||||
import DeactivationModal from "./components/DeactivationModal/DeactivationModal";
|
||||
document.addEventListener( 'DOMContentLoaded', () => {
|
||||
|
||||
const container = document.getElementById( 'rsssl-modal-root' );
|
||||
if ( container ) {
|
||||
if ( createRoot ) {
|
||||
createRoot( container ).render( <DeactivationModal/> );
|
||||
} else {
|
||||
render( <DeactivationModal/>, container );
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
const defaultConfig = require("@wordpress/scripts/config/webpack.config");
|
||||
|
||||
module.exports = {
|
||||
...defaultConfig,
|
||||
output: {
|
||||
...defaultConfig.output,
|
||||
filename: '[name].[contenthash].js',
|
||||
chunkFilename: '[name].[contenthash].js',
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user