diff --git a/build/0.0.1/coming-soon.asset.php b/build/0.0.1/coming-soon.asset.php new file mode 100644 index 0000000..9a8f06f --- /dev/null +++ b/build/0.0.1/coming-soon.asset.php @@ -0,0 +1 @@ + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '13d2f9050a5557fafa9d'); diff --git a/build/0.0.1/coming-soon.css b/build/0.0.1/coming-soon.css new file mode 100644 index 0000000..38aa1a3 --- /dev/null +++ b/build/0.0.1/coming-soon.css @@ -0,0 +1 @@ +.modal-buttons{display:flex;justify-content:flex-end;margin-top:30px}@media only screen and (max-width:600px){.modal-buttons{align-items:stretch;flex-direction:column}}.modal-buttons svg{margin-top:5px}.modal-buttons .is-primary{box-shadow:none;margin-right:5px}.modal-buttons .is-secondary{box-shadow:none}*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: } diff --git a/build/0.0.1/coming-soon.js b/build/0.0.1/coming-soon.js new file mode 100644 index 0000000..66b31ca --- /dev/null +++ b/build/0.0.1/coming-soon.js @@ -0,0 +1 @@ +(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);var n={};e.r(n),e.d(n,{setIsModalOpen:()=>c});var o={};e.r(o),e.d(o,{isModalOpen:()=>l});const i=window.React,r=window.wp.domReady;var s=e.n(r);const d=window.wp.element,a=window.wp.data;function c(e){return{type:"SET_MODAL_OPEN",isOpen:e}}function l(e){return e.modal.isOpen}const u={reducer:(0,a.combineReducers)({modal:function(e={isOpen:!1},t){return"SET_MODAL_OPEN"===t.type?{...e,isOpen:t.isOpen}:e}}),actions:n,selectors:o},w=(0,a.createReduxStore)("newfold/coming-soon",u);(0,a.register)(w);const p=window.wp.components,m=(window.wp.editPost,window.wp.i18n),C=window.wp.primitives,b=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 22"},(0,i.createElement)(C.Path,{d:"M11.8667 10.975C12.0402 11.7092 12.0453 12.4732 11.8816 13.2097C11.718 13.9462 11.3898 14.6361 10.9216 15.2277C10.4534 15.8193 9.85744 16.2973 9.17829 16.6259C8.49915 16.9545 7.75445 17.1251 7 17.125V13.125M11.8667 10.975C13.4582 9.81565 14.753 8.29625 15.6451 6.5409C16.5373 4.78556 17.0016 2.84406 17 0.875003C15.0311 0.873581 13.0898 1.33791 11.3346 2.23006C9.57937 3.12221 8.0601 4.41688 6.90083 6.00834M11.8667 10.975C10.4183 12.0344 8.7586 12.7678 7 13.125M7 13.125C6.91417 13.1425 6.8275 13.1592 6.74083 13.175C5.98482 12.5755 5.30032 11.891 4.70083 11.135C4.71658 11.0482 4.73241 10.9615 4.75 10.875M6.90083 6.00834C6.16655 5.83467 5.40248 5.82944 4.66589 5.99304C3.9293 6.15664 3.23928 6.48483 2.64756 6.95301C2.05584 7.4212 1.57775 8.01723 1.24912 8.69645C0.9205 9.37567 0.749863 10.1205 0.75 10.875H4.75M6.90083 6.00834C5.84157 7.45652 5.10729 9.11671 4.75 10.875M2.88417 12.8667C2.33598 13.2743 1.90977 13.8242 1.65169 14.4567C1.3936 15.0892 1.31348 15.7802 1.42 16.455C2.09486 16.5614 2.78597 16.4812 3.41848 16.2229C4.05099 15.9647 4.6008 15.5383 5.00833 14.99M12.625 6.5C12.625 6.83152 12.4933 7.14947 12.2589 7.38389C12.0245 7.61831 11.7065 7.75 11.375 7.75C11.0435 7.75 10.7255 7.61831 10.4911 7.38389C10.2567 7.14947 10.125 6.83152 10.125 6.5C10.125 6.16848 10.2567 5.85054 10.4911 5.61612C10.7255 5.3817 11.0435 5.25 11.375 5.25C11.7065 5.25 12.0245 5.3817 12.2589 5.61612C12.4933 5.85054 12.625 6.16848 12.625 6.5Z",stroke:"white","stroke-width":"1.15","stroke-linecap":"round","stroke-linejoin":"round"})),y=window.wp.apiFetch;var h=e.n(y);const f=()=>{const{setIsModalOpen:e}=(0,a.useDispatch)(w),[t,n]=(0,i.useState)(!0),{isModalOpen:o}=(0,a.useSelect)((e=>({isModalOpen:e(w).isModalOpen()})));if(!o||!t)return null;const r=(0,m.__)("Ready to launch your Site?","nfd-coming-soon"),s=(0,m.__)("Pages and posts you publish will not be visible to the public until you launch your site.","nfd-coming-soon"),d=(0,m.__)("Publish & Launch Site","nfd-coming-soon"),c=(0,m.__)("Publish without launching","nfd-coming-soon");return(0,i.createElement)(p.Modal,{title:r,onRequestClose:()=>e(!1)},(0,i.createElement)("div",null,(0,i.createElement)("p",null,s),(0,i.createElement)("div",{className:"modal-buttons"},(0,i.createElement)(p.Button,{icon:(0,i.createElement)(p.Icon,{icon:b}),variant:"primary",onClick:()=>{!async function(e){await async function(e){const t={body:null,error:null};try{t.body=await e}catch(e){t.error=e}return t}(h()({url:"/index.php?rest_route=/bluehost/v1/settings&_locale=user",method:"POST",data:{comingSoon:!1}}).then())}(),n(!1),e(!1)}},d),(0,i.createElement)(p.Button,{variant:"secondary",onClick:()=>e(!1)},c))))};s()((()=>{g("nfd-pre-publish-modal")}));const g=e=>{const t=document.createElement("div");t.id=e,document.getElementById(e)||document.body.append(t),(0,d.render)((0,i.createElement)(f,null),t)},O=()=>{const e=window.wp.data.select("core/editor").getEditedPostAttribute("status");void 0!==e?(e=>{if("publish"!==e){const e=(0,a.subscribe)((()=>{if("publish"===window.wp.data.select("core/editor").getEditedPostAttribute("status")){e();const t=()=>{document.querySelector(".components-snackbar-list__notice-container")?(0,a.dispatch)(w).setIsModalOpen(!0):setTimeout(t,50)};t()}}))}})(e):setTimeout(O,50)};O(),((window.newfold=window.newfold||{}).ComingSoon=window.newfold.ComingSoon||{})["coming-soon"]=t})(); \ No newline at end of file diff --git a/includes/ComingSoon.php b/includes/ComingSoon.php index 029b198..594c43b 100644 --- a/includes/ComingSoon.php +++ b/includes/ComingSoon.php @@ -20,25 +20,28 @@ public function __construct( Container $container ) { $this->container = $container; // setup args $defaults = array( - 'option_name' => 'nfd_coming_soon', - 'admin_screen_id' => container()->plugin()->id, - 'admin_app_url' => \admin_url( 'admin.php?page=newfold' ), - 'admin_notice_text' => __( 'Your site has Coming Soon mode active.', 'newfold-module-coming-soon' ), - 'admin_bar_text' => '