From d0660f6fedd3d1141fb0887784e55bc706da4c6e Mon Sep 17 00:00:00 2001 From: Micah Wood Date: Wed, 17 Jan 2024 18:47:38 -0500 Subject: [PATCH 1/2] Fix a bug where the status of coming soon on the front end isn't displaying properly --- includes/ComingSoon.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/ComingSoon.php b/includes/ComingSoon.php index 5f213cb..8321838 100644 --- a/includes/ComingSoon.php +++ b/includes/ComingSoon.php @@ -61,6 +61,7 @@ public function __construct( Container $container ) { \add_action( 'admin_bar_menu', array( $this, 'newfold_site_status' ), 100 ); \add_action( 'wp_body_open', array( $this, 'site_preview_warning' ) ); \add_action( 'admin_head', array( $this, 'admin_bar_coming_soon_admin_styles' ) ); + \add_action( 'wp_head', array( $this, 'admin_bar_coming_soon_admin_styles' ) ); \add_filter( 'default_option_nfd_coming_soon', array( $this, 'filter_coming_soon_fallback' ) ); \add_action( 'update_option_nfd_coming_soon', array( $this, 'on_update_nfd_coming_soon' ), 10, 2 ); \add_action( 'update_option_mm_coming_soon', array( $this, 'on_update_mm_coming_soon' ), 10, 2 ); From 29287913a4f47999043e65cb8a8fba4a9e9bd0eb Mon Sep 17 00:00:00 2001 From: Micah Wood Date: Wed, 17 Jan 2024 18:49:19 -0500 Subject: [PATCH 2/2] Bump version and update build --- bootstrap.php | 2 +- build/1.1.16/coming-soon.css | 457 ------------- build/1.1.16/coming-soon.css.map | 1 - build/1.1.16/coming-soon.js | 616 ------------------ build/1.1.16/coming-soon.js.map | 1 - .../{1.1.16 => 1.1.17}/coming-soon.asset.php | 2 +- build/1.1.17/coming-soon.css | 1 + build/1.1.17/coming-soon.js | 1 + package.json | 2 +- 9 files changed, 5 insertions(+), 1078 deletions(-) delete mode 100644 build/1.1.16/coming-soon.css delete mode 100644 build/1.1.16/coming-soon.css.map delete mode 100644 build/1.1.16/coming-soon.js delete mode 100644 build/1.1.16/coming-soon.js.map rename build/{1.1.16 => 1.1.17}/coming-soon.asset.php (61%) create mode 100644 build/1.1.17/coming-soon.css create mode 100644 build/1.1.17/coming-soon.js diff --git a/bootstrap.php b/bootstrap.php index b728600..4a39e5e 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -17,7 +17,7 @@ return; } -define( 'NFD_COMING_SOON_MODULE_VERSION', '1.1.16' ); +define( 'NFD_COMING_SOON_MODULE_VERSION', '1.1.17' ); require __DIR__ . '/includes/functions.php'; diff --git a/build/1.1.16/coming-soon.css b/build/1.1.16/coming-soon.css deleted file mode 100644 index 5073261..0000000 --- a/build/1.1.16/coming-soon.css +++ /dev/null @@ -1,457 +0,0 @@ -/*!********************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/styles/app.scss ***! - \********************************************************************************************************************************************************************************************************************************************/ -/* -------------------------------------------------------------------------- */ -/* Mixins */ -/* -------------------------------------------------------------------------- */ -/** - * Responsive mixin - * @param {string} $breakpoint - breakpoint name. Possible values are: small -*/ -.modal-buttons { - display: flex; - justify-content: flex-end; - margin-top: 30px; -} -@media only screen and (max-width: 600px) { - .modal-buttons { - flex-direction: column; - align-items: stretch; - } -} -.modal-buttons svg { - margin-top: 5px; -} -.modal-buttons .is-primary { - margin-right: 5px; - box-shadow: none; -} -.modal-buttons .is-secondary { - box-shadow: none; -} -/* ! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com */ -/* -1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) -2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) -*/ -*, -::before, -::after { - box-sizing: border-box; /* 1 */ - border-width: 0; /* 2 */ - border-style: solid; /* 2 */ - border-color: #e5e7eb; /* 2 */ -} -::before, -::after { - --tw-content: ''; -} -/* -1. Use a consistent sensible line-height in all browsers. -2. Prevent adjustments of font size after orientation changes in iOS. -3. Use a more readable tab size. -4. Use the user's configured `sans` font-family by default. -5. Use the user's configured `sans` font-feature-settings by default. -6. Use the user's configured `sans` font-variation-settings by default. -7. Disable tap highlights on iOS -*/ -html, -:host { - line-height: 1.5; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - -moz-tab-size: 4; /* 3 */ - -o-tab-size: 4; - tab-size: 4; /* 3 */ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ - font-feature-settings: normal; /* 5 */ - font-variation-settings: normal; /* 6 */ - -webkit-tap-highlight-color: transparent; /* 7 */ -} -/* -1. Remove the margin in all browsers. -2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. -*/ -body { - margin: 0; /* 1 */ - line-height: inherit; /* 2 */ -} -/* -1. Add the correct height in Firefox. -2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) -3. Ensure horizontal rules are visible by default. -*/ -hr { - height: 0; /* 1 */ - color: inherit; /* 2 */ - border-top-width: 1px; /* 3 */ -} -/* -Add the correct text decoration in Chrome, Edge, and Safari. -*/ -abbr:where([title]) { - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; -} -/* -Remove the default font size and weight for headings. -*/ -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: inherit; - font-weight: inherit; -} -/* -Reset links to optimize for opt-in styling instead of opt-out. -*/ -a { - color: inherit; - text-decoration: inherit; -} -/* -Add the correct font weight in Edge and Safari. -*/ -b, -strong { - font-weight: bolder; -} -/* -1. Use the user's configured `mono` font-family by default. -2. Use the user's configured `mono` font-feature-settings by default. -3. Use the user's configured `mono` font-variation-settings by default. -4. Correct the odd `em` font sizing in all browsers. -*/ -code, -kbd, -samp, -pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */ - font-feature-settings: normal; /* 2 */ - font-variation-settings: normal; /* 3 */ - font-size: 1em; /* 4 */ -} -/* -Add the correct font size in all browsers. -*/ -small { - font-size: 80%; -} -/* -Prevent `sub` and `sup` elements from affecting the line height in all browsers. -*/ -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sub { - bottom: -0.25em; -} -sup { - top: -0.5em; -} -/* -1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) -2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) -3. Remove gaps between table borders by default. -*/ -table { - text-indent: 0; /* 1 */ - border-color: inherit; /* 2 */ - border-collapse: collapse; /* 3 */ -} -/* -1. Change the font styles in all browsers. -2. Remove the margin in Firefox and Safari. -3. Remove default padding in all browsers. -*/ -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-feature-settings: inherit; /* 1 */ - font-variation-settings: inherit; /* 1 */ - font-size: 100%; /* 1 */ - font-weight: inherit; /* 1 */ - line-height: inherit; /* 1 */ - color: inherit; /* 1 */ - margin: 0; /* 2 */ - padding: 0; /* 3 */ -} -/* -Remove the inheritance of text transform in Edge and Firefox. -*/ -button, -select { - text-transform: none; -} -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Remove default button styles. -*/ -button, -[type='button'], -[type='reset'], -[type='submit'] { - -webkit-appearance: button; /* 1 */ - background-color: transparent; /* 2 */ - background-image: none; /* 2 */ -} -/* -Use the modern Firefox focus style for all focusable elements. -*/ -:-moz-focusring { - outline: auto; -} -/* -Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) -*/ -:-moz-ui-invalid { - box-shadow: none; -} -/* -Add the correct vertical alignment in Chrome and Firefox. -*/ -progress { - vertical-align: baseline; -} -/* -Correct the cursor style of increment and decrement buttons in Safari. -*/ -::-webkit-inner-spin-button, -::-webkit-outer-spin-button { - height: auto; -} -/* -1. Correct the odd appearance in Chrome and Safari. -2. Correct the outline style in Safari. -*/ -[type='search'] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} -/* -Remove the inner padding in Chrome and Safari on macOS. -*/ -::-webkit-search-decoration { - -webkit-appearance: none; -} -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Change font properties to `inherit` in Safari. -*/ -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} -/* -Add the correct display in Chrome and Safari. -*/ -summary { - display: list-item; -} -/* -Removes the default spacing and border for appropriate elements. -*/ -blockquote, -dl, -dd, -h1, -h2, -h3, -h4, -h5, -h6, -hr, -figure, -p, -pre { - margin: 0; -} -fieldset { - margin: 0; - padding: 0; -} -legend { - padding: 0; -} -ol, -ul, -menu { - list-style: none; - margin: 0; - padding: 0; -} -/* -Reset default styling for dialogs. -*/ -dialog { - padding: 0; -} -/* -Prevent resizing textareas horizontally by default. -*/ -textarea { - resize: vertical; -} -/* -1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) -2. Set the default placeholder color to the user's configured gray 400 color. -*/ -input::-moz-placeholder, textarea::-moz-placeholder { - opacity: 1; /* 1 */ - color: #9ca3af; /* 2 */ -} -input::placeholder, -textarea::placeholder { - opacity: 1; /* 1 */ - color: #9ca3af; /* 2 */ -} -/* -Set the default cursor for buttons. -*/ -button, -[role="button"] { - cursor: pointer; -} -/* -Make sure disabled buttons don't get the pointer cursor. -*/ -:disabled { - cursor: default; -} -/* -1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) -2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) - This can trigger a poorly considered lint error in some tools but is included by design. -*/ -img, -svg, -video, -canvas, -audio, -iframe, -embed, -object { - display: block; /* 1 */ - vertical-align: middle; /* 2 */ -} -/* -Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) -*/ -img, -video { - max-width: 100%; - height: auto; -} -/* Make elements with the HTML hidden attribute stay hidden by default */ -[hidden] { - display: none; -} -*, ::before, ::after { - --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: rgb(59 130 246 / 0.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: rgb(59 130 246 / 0.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: ; -} - -/*# sourceMappingURL=coming-soon.css.map*/ \ No newline at end of file diff --git a/build/1.1.16/coming-soon.css.map b/build/1.1.16/coming-soon.css.map deleted file mode 100644 index ad1cc37..0000000 --- a/build/1.1.16/coming-soon.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"coming-soon.css","mappings":";;;AAAA;AACA;AACA;AAEA;;;CAAA;ACFA;EAOC;EACA;EACA;ACAD;AFDE;ECRF;IAGE;IACA;ECUA;AACF;ADJC;EACC;ACMF;ADHC;EACC;EACA;ACKF;ADFC;EACC;ACIF;AAzBA;AAAA;;;CAAA;AAAA;;;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA;;EAAA;AAAA;AAAA;;;;;;;;CAAA;AAAA;;EAAA;EAAA;EAAA;EAAA;KAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA;;;CAAA;AAAA;EAAA;EAAA;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;;EAAA;EAAA;AAAA;AAAA;AAAA;EAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,C","sources":["webpack://newfold.ComingSoon/./src/styles/_mixins.scss","webpack://newfold.ComingSoon/./src/styles/modal.scss","webpack://newfold.ComingSoon/./src/styles/app.scss"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Mixins */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Responsive mixin \n * @param {string} $breakpoint - breakpoint name. Possible values are: small\n*/\n@mixin responsive($breakpoint) {\n\t@if $breakpoint == small {\n\t\t@media only screen and (max-width: 600px) {\n\t\t\t@content;\n\t\t}\n\t}\n}\n","@use \"mixins\" as m;\n\n.modal-buttons {\n\n\t@include m.responsive(small) {\n\t\tflex-direction: column;\n\t\talign-items: stretch;\n\t}\n\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tmargin-top: 30px;\n\n\tsvg {\n\t\tmargin-top: 5px;\n\t}\n\n\t.is-primary {\n\t\tmargin-right: 5px;\n\t\tbox-shadow: none;\n\t}\n\n\t.is-secondary {\n\t\tbox-shadow: none;\n\t}\n}\n","@use \"modal\";\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/1.1.16/coming-soon.js b/build/1.1.16/coming-soon.js deleted file mode 100644 index 17b896d..0000000 --- a/build/1.1.16/coming-soon.js +++ /dev/null @@ -1,616 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/components/Icons/index.js": -/*!***************************************!*\ - !*** ./src/components/Icons/index.js ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ launch: () => (/* reexport safe */ _launch__WEBPACK_IMPORTED_MODULE_0__["default"]) -/* harmony export */ }); -/* harmony import */ var _launch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./launch */ "./src/components/Icons/launch.jsx"); - - -/***/ }), - -/***/ "./src/components/Icons/launch.jsx": -/*!*****************************************!*\ - !*** ./src/components/Icons/launch.jsx ***! - \*****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - -/** - * WordPress dependencies - */ - -const launch = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 22" -}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.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" -})); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (launch); - -/***/ }), - -/***/ "./src/components/Modal.jsx": -/*!**********************************!*\ - !*** ./src/components/Modal.jsx ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post"); -/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _Icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Icons */ "./src/components/Icons/index.js"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store */ "./src/store/index.js"); -/* harmony import */ var _utils_api_comingSoon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/api/comingSoon */ "./src/utils/api/comingSoon.js"); - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -const Modal = () => { - const { - setIsModalOpen - } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_store__WEBPACK_IMPORTED_MODULE_7__.store); - const [isComingSoonActive, setIsComingSoonActive] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true); - const { - isModalOpen - } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => ({ - isModalOpen: select(_store__WEBPACK_IMPORTED_MODULE_7__.store).isModalOpen() - })); - const handlePublishAndLaunch = () => { - (0,_utils_api_comingSoon__WEBPACK_IMPORTED_MODULE_8__.setComingSoon)(false); - setIsComingSoonActive(false); - setIsModalOpen(false); - }; - if (!isModalOpen || !isComingSoonActive) { - return null; - } - const title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Ready to launch your Site?', 'nfd-coming-soon'); - const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Pages and posts you publish will not be visible to the public until you launch your site.', 'nfd-coming-soon'); - const launchButtonText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Publish & Launch Site', 'nfd-coming-soon'); - const withoutLaunchButtonText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Publish without launching', 'nfd-coming-soon'); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Modal, { - title: title, - onRequestClose: () => setIsModalOpen(false) - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, heading), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "modal-buttons" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { - icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Icon, { - icon: _Icons__WEBPACK_IMPORTED_MODULE_6__.launch - }), - variant: "primary", - onClick: handlePublishAndLaunch - }, launchButtonText), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { - variant: "secondary", - onClick: () => setIsModalOpen(false) - }, withoutLaunchButtonText)))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Modal); - -/***/ }), - -/***/ "./src/constants.js": -/*!**************************!*\ - !*** ./src/constants.js ***! - \**************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ NFD_PRE_PUBLISH_MODAL_ID: () => (/* binding */ NFD_PRE_PUBLISH_MODAL_ID), -/* harmony export */ wpSettingsRestRoute: () => (/* binding */ wpSettingsRestRoute) -/* harmony export */ }); -const wpSettingsRestRoute = '/index.php?rest_route=/bluehost/v1/settings&_locale=user'; -const NFD_PRE_PUBLISH_MODAL_ID = 'nfd-pre-publish-modal'; - -/***/ }), - -/***/ "./src/store/actions.js": -/*!******************************!*\ - !*** ./src/store/actions.js ***! - \******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ setIsModalOpen: () => (/* binding */ setIsModalOpen) -/* harmony export */ }); -/** - * Toggles the pre publish modal. - * - * @param {boolean} isOpen Modal open state. - * @return {Object} Action object. - */ -function setIsModalOpen(isOpen) { - return { - type: 'SET_MODAL_OPEN', - isOpen - }; -} - -/***/ }), - -/***/ "./src/store/constants.js": -/*!********************************!*\ - !*** ./src/store/constants.js ***! - \********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ STORE_NAME: () => (/* binding */ STORE_NAME) -/* harmony export */ }); -/** - * Identifier for Newfold Coming Soon data store. - * - * @type {string} - */ -const STORE_NAME = 'newfold/coming-soon'; - -/***/ }), - -/***/ "./src/store/index.js": -/*!****************************!*\ - !*** ./src/store/index.js ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ nfdComingSoonStoreOptions: () => (/* binding */ nfdComingSoonStoreOptions), -/* harmony export */ store: () => (/* binding */ store) -/* harmony export */ }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./src/store/constants.js"); -/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "./src/store/actions.js"); -/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "./src/store/selectors.js"); -/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reducer */ "./src/store/reducer.js"); - - - - - -const nfdComingSoonStoreOptions = { - reducer: _reducer__WEBPACK_IMPORTED_MODULE_4__["default"], - actions: _actions__WEBPACK_IMPORTED_MODULE_2__, - selectors: _selectors__WEBPACK_IMPORTED_MODULE_3__ -}; -const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createReduxStore)(_constants__WEBPACK_IMPORTED_MODULE_1__.STORE_NAME, nfdComingSoonStoreOptions); -(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.register)(store); - -/***/ }), - -/***/ "./src/store/reducer.js": -/*!******************************!*\ - !*** ./src/store/reducer.js ***! - \******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ modal: () => (/* binding */ modal) -/* harmony export */ }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - -function modal(state = { - isOpen: false -}, action) { - switch (action.type) { - case 'SET_MODAL_OPEN': - return { - ...state, - isOpen: action.isOpen - }; - } - return state; -} -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)({ - modal -})); - -/***/ }), - -/***/ "./src/store/selectors.js": -/*!********************************!*\ - !*** ./src/store/selectors.js ***! - \********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ isModalOpen: () => (/* binding */ isModalOpen) -/* harmony export */ }); -/** - * Checks if the pre publish modal is open. - * - * @param {*} state - * @return {boolean} True if the modal is open, false otherwise. - */ -function isModalOpen(state) { - return state.modal.isOpen; -} - -/***/ }), - -/***/ "./src/utils/api/comingSoon.js": -/*!*************************************!*\ - !*** ./src/utils/api/comingSoon.js ***! - \*************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ setComingSoon: () => (/* binding */ setComingSoon) -/* harmony export */ }); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants */ "./src/constants.js"); -/* harmony import */ var _resolve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resolve */ "./src/utils/api/resolve.js"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__); - - - -async function setComingSoon(comingSoon) { - return await (0,_resolve__WEBPACK_IMPORTED_MODULE_1__.resolve)(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({ - url: _constants__WEBPACK_IMPORTED_MODULE_0__.wpSettingsRestRoute, - method: 'POST', - data: { - comingSoon - } - }).then()); -} - -/***/ }), - -/***/ "./src/utils/api/resolve.js": -/*!**********************************!*\ - !*** ./src/utils/api/resolve.js ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ resolve: () => (/* binding */ resolve) -/* harmony export */ }); -async function resolve(promise) { - const resolved = { - body: null, - error: null - }; - try { - resolved.body = await promise; - } catch (e) { - resolved.error = e; - } - return resolved; -} - -/***/ }), - -/***/ "./src/styles/app.scss": -/*!*****************************!*\ - !*** ./src/styles/app.scss ***! - \*****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "react": -/*!************************!*\ - !*** external "React" ***! - \************************/ -/***/ ((module) => { - -module.exports = window["React"]; - -/***/ }), - -/***/ "@wordpress/api-fetch": -/*!**********************************!*\ - !*** external ["wp","apiFetch"] ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["apiFetch"]; - -/***/ }), - -/***/ "@wordpress/components": -/*!************************************!*\ - !*** external ["wp","components"] ***! - \************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["components"]; - -/***/ }), - -/***/ "@wordpress/data": -/*!******************************!*\ - !*** external ["wp","data"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["data"]; - -/***/ }), - -/***/ "@wordpress/dom-ready": -/*!**********************************!*\ - !*** external ["wp","domReady"] ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["domReady"]; - -/***/ }), - -/***/ "@wordpress/edit-post": -/*!**********************************!*\ - !*** external ["wp","editPost"] ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["editPost"]; - -/***/ }), - -/***/ "@wordpress/element": -/*!*********************************!*\ - !*** external ["wp","element"] ***! - \*********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["element"]; - -/***/ }), - -/***/ "@wordpress/i18n": -/*!******************************!*\ - !*** external ["wp","i18n"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["i18n"]; - -/***/ }), - -/***/ "@wordpress/primitives": -/*!************************************!*\ - !*** external ["wp","primitives"] ***! - \************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["primitives"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -/*!****************************!*\ - !*** ./src/coming-soon.js ***! - \****************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _styles_app_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./styles/app.scss */ "./src/styles/app.scss"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store */ "./src/store/index.js"); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "./src/constants.js"); -/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/Modal */ "./src/components/Modal.jsx"); - -/** - * Styles. - */ - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default()(() => { - renderModal(_constants__WEBPACK_IMPORTED_MODULE_6__.NFD_PRE_PUBLISH_MODAL_ID); -}); - -/** - * This function creates a modal that is rendered on the page. - * - * @param {string} elementId It takes an elementId as an argument and creates a div with the given elementId. - */ -const renderModal = elementId => { - const modalRoot = document.createElement('div'); - modalRoot.id = elementId; - - // Append the modal container to the body if it hasn't been added already. - if (!document.getElementById(elementId)) { - document.body.append(modalRoot); - } - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.render)((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Modal__WEBPACK_IMPORTED_MODULE_7__["default"], null), modalRoot); -}; - -/** - * Displays the coming soon warning when the post/page is published and the "coming soon" feature is active. - * - * @param {string} postStatus The status of the post/page. - */ -const showComingSoonWarningOnPublish = postStatus => { - if ('publish' !== postStatus) { - const unssubscribe = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.subscribe)(() => { - const currentPostStatus = window.wp.data.select('core/editor').getEditedPostAttribute('status'); - if ('publish' === currentPostStatus) { - unssubscribe(); - const checkElementAvailability = () => { - const publishPanel = document.querySelector('.components-snackbar-list__notice-container'); - if (publishPanel) { - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.dispatch)(_store__WEBPACK_IMPORTED_MODULE_5__.store).setIsModalOpen(true); - } else { - setTimeout(checkElementAvailability, 50); - } - }; - checkElementAvailability(); - } - }); - } -}; - -/** - * Listens to changes in the post status and triggers the display of the coming soon modal when needed. - */ -const listenToPostStatus = () => { - const initialPostStatus = window.wp.data.select('core/editor').getEditedPostAttribute('status'); - if (typeof initialPostStatus !== 'undefined') { - showComingSoonWarningOnPublish(initialPostStatus); - } else { - setTimeout(listenToPostStatus, 50); - } -}; - -// Start listening to post status changes -listenToPostStatus(); -})(); - -((window.newfold = window.newfold || {}).ComingSoon = window.newfold.ComingSoon || {})["coming-soon"] = __webpack_exports__; -/******/ })() -; -//# sourceMappingURL=coming-soon.js.map \ No newline at end of file diff --git a/build/1.1.16/coming-soon.js.map b/build/1.1.16/coming-soon.js.map deleted file mode 100644 index 8904ce5..0000000 --- a/build/1.1.16/coming-soon.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"coming-soon.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACkD;AAElD,MAAMC,MAAM,GACXG,oDAAA,CAACD,sDAAG;EAACE,KAAK,EAAC,4BAA4B;EAACC,OAAO,EAAC;AAAW,GAC1DF,oDAAA,CAACF,uDAAI;EAACK,CAAC,EAAC,45CAA45C;EAACC,MAAM,EAAC,OAAO;EAAC,gBAAa,MAAM;EAAC,kBAAe,OAAO;EAAC,mBAAgB;AAAO,CAAE,CACp/C,CACL;AAED,iEAAeP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACXrB;AACA;AACA;AACiC;;AAEjC;AACA;AACA;AACwE;AACf;AACV;AACe;AACzB;AACrC;AACA;AACA;AACiC;AACsB;AACC;AAGxD,MAAMS,KAAK,GAAGA,CAAA,KAAM;EACnB,MAAM;IAAEY;EAAe,CAAC,GAAGR,4DAAW,CAACM,yCAAkB,CAAC;EAC1D,MAAM,CAACG,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGf,+CAAQ,CAAC,IAAI,CAAC;EAElE,MAAM;IAAEgB;EAAY,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CAAC;;AAED;AACAA,kBAAkB,CAAC,CAAC,C","sources":["webpack://newfold.ComingSoon/./src/components/Icons/index.js","webpack://newfold.ComingSoon/./src/components/Icons/launch.jsx","webpack://newfold.ComingSoon/./src/components/Modal.jsx","webpack://newfold.ComingSoon/./src/constants.js","webpack://newfold.ComingSoon/./src/store/actions.js","webpack://newfold.ComingSoon/./src/store/constants.js","webpack://newfold.ComingSoon/./src/store/index.js","webpack://newfold.ComingSoon/./src/store/reducer.js","webpack://newfold.ComingSoon/./src/store/selectors.js","webpack://newfold.ComingSoon/./src/utils/api/comingSoon.js","webpack://newfold.ComingSoon/./src/utils/api/resolve.js","webpack://newfold.ComingSoon/./src/styles/app.scss?ffac","webpack://newfold.ComingSoon/external window \"React\"","webpack://newfold.ComingSoon/external window [\"wp\",\"apiFetch\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"components\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"data\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"domReady\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"editPost\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"element\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"i18n\"]","webpack://newfold.ComingSoon/external window [\"wp\",\"primitives\"]","webpack://newfold.ComingSoon/webpack/bootstrap","webpack://newfold.ComingSoon/webpack/runtime/compat get default export","webpack://newfold.ComingSoon/webpack/runtime/define property getters","webpack://newfold.ComingSoon/webpack/runtime/hasOwnProperty shorthand","webpack://newfold.ComingSoon/webpack/runtime/make namespace object","webpack://newfold.ComingSoon/./src/coming-soon.js"],"sourcesContent":["export { default as launch } from './launch';\n","/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nconst launch = (\n\t\n\t\t\n\t\n);\n\nexport default launch;\n","/**\n * External dependencies\n */\nimport { useState } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Modal as WP2Modal, Button, Icon } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editPostStore } from '@wordpress/edit-post';\nimport { __ } from '@wordpress/i18n';\n/**\n * Internal dependencies\n */\nimport { launch } from './Icons';\nimport { store as nfdComingSoonStore } from '../store';\nimport { setComingSoon } from '../utils/api/comingSoon';\n\n\nconst Modal = () => {\n\tconst { setIsModalOpen } = useDispatch(nfdComingSoonStore);\n\tconst [isComingSoonActive, setIsComingSoonActive] = useState(true); \n\n\tconst { isModalOpen } = useSelect(\n\t\t(select) => ({\n\t\t\tisModalOpen: select(nfdComingSoonStore).isModalOpen(),\n\t\t})\n\t);\n\n\tconst handlePublishAndLaunch = () => {\n\t\tsetComingSoon(false);\n\t\tsetIsComingSoonActive(false);\n\t\tsetIsModalOpen(false);\n\t};\n\n\tif (!isModalOpen || !isComingSoonActive) {\n\t\treturn null;\n\t}\n\n\tconst title = __('Ready to launch your Site?', 'nfd-coming-soon');\n\tconst heading = __('Pages and posts you publish will not be visible to the public until you launch your site.', 'nfd-coming-soon');\n\tconst launchButtonText = __('Publish & Launch Site', 'nfd-coming-soon');\n\tconst withoutLaunchButtonText = __('Publish without launching', 'nfd-coming-soon');\n\n\treturn (\n\t\t setIsModalOpen(false)}\n\t\t>\n\t\t\t
\n\t\t\t\t

{heading}

\n\t\t\t\t
\n\t\t\t\t\t}\n\t\t\t\t\t\tvariant=\"primary\" onClick={handlePublishAndLaunch}>\n\t\t\t\t\t\t{launchButtonText}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default Modal;\n","export const wpSettingsRestRoute = '/index.php?rest_route=/bluehost/v1/settings&_locale=user';\nexport const NFD_PRE_PUBLISH_MODAL_ID = 'nfd-pre-publish-modal';\n","/**\n * Toggles the pre publish modal.\n *\n * @param {boolean} isOpen Modal open state.\n * @return {Object} Action object.\n */\nexport function setIsModalOpen(isOpen) {\n\treturn {\n\t\ttype: 'SET_MODAL_OPEN',\n\t\tisOpen,\n\t};\n}\n\n","/**\n * Identifier for Newfold Coming Soon data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'newfold/coming-soon';\n","import { createReduxStore, register } from '@wordpress/data';\n\nimport { STORE_NAME } from './constants';\n\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport reducer from './reducer';\n\nexport const nfdComingSoonStoreOptions = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore(STORE_NAME, nfdComingSoonStoreOptions);\nregister(store);\n","/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function modal(\n\tstate = {\n\t\tisOpen: false,\n\t},\n\taction\n) {\n\tswitch (action.type) {\n\t\tcase 'SET_MODAL_OPEN':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: action.isOpen,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers({\n\tmodal\n});\n","/**\n * Checks if the pre publish modal is open.\n *\n * @param {*} state\n * @return {boolean} True if the modal is open, false otherwise.\n */\nexport function isModalOpen(state) {\n\treturn state.modal.isOpen;\n}\n","import { wpSettingsRestRoute } from '../../constants';\nimport { resolve } from './resolve';\n\nimport apiFetch from '@wordpress/api-fetch';\n\nexport async function setComingSoon( comingSoon ) {\n\treturn await resolve(\n\t\tapiFetch( {\n\t\t\turl: wpSettingsRestRoute,\n\t\t\tmethod: 'POST',\n\t\t\tdata: {\n\t\t\t\tcomingSoon,\n\t\t\t},\n\t\t} ).then()\n\t);\n}\n","export async function resolve(promise) {\n const resolved = {\n body: null,\n error: null\n };\n\n try {\n resolved.body = await promise;\n } catch (e) {\n resolved.error = e;\n }\n\n return resolved;\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"editPost\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Styles.\n */\nimport './styles/app.scss';\n\n/**\n * WordPress dependencies\n */\nimport domReady from '@wordpress/dom-ready';\nimport { render } from '@wordpress/element';\nimport { subscribe } from '@wordpress/data';\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as nfdComingSoonStore } from './store';\nimport {\n\tNFD_PRE_PUBLISH_MODAL_ID,\n} from './constants';\nimport Modal from './components/Modal';\n\ndomReady(() => {\n\trenderModal(NFD_PRE_PUBLISH_MODAL_ID);\n});\n\n/**\n * This function creates a modal that is rendered on the page.\n *\n * @param {string} elementId It takes an elementId as an argument and creates a div with the given elementId.\n */\nconst renderModal = (elementId) => {\n\tconst modalRoot = document.createElement('div');\n\tmodalRoot.id = elementId;\n\n\t// Append the modal container to the body if it hasn't been added already.\n\tif (!document.getElementById(elementId)) {\n\t\tdocument.body.append(modalRoot);\n\t}\n\trender(, modalRoot);\n};\n\n/**\n * Displays the coming soon warning when the post/page is published and the \"coming soon\" feature is active.\n * \n * @param {string} postStatus The status of the post/page.\n */\nconst showComingSoonWarningOnPublish = (postStatus) => {\n\tif ('publish' !== postStatus) {\n\t\tconst unssubscribe = subscribe(() => {\n\t\t\tconst currentPostStatus = window.wp.data.select('core/editor').getEditedPostAttribute('status');\n\t\t\tif ('publish' === currentPostStatus) {\n\t\t\t\tunssubscribe();\n\t\t\t\tconst checkElementAvailability = () => {\n\t\t\t\t\tconst publishPanel = document.querySelector('.components-snackbar-list__notice-container');\n\t\t\t\t\tif (publishPanel) {\n\t\t\t\t\t\tdispatch(nfdComingSoonStore).setIsModalOpen(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetTimeout(checkElementAvailability, 50);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcheckElementAvailability();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * Listens to changes in the post status and triggers the display of the coming soon modal when needed.\n */\nconst listenToPostStatus = () => {\n\tconst initialPostStatus = window.wp.data.select('core/editor').getEditedPostAttribute('status');\n\tif (typeof initialPostStatus !== 'undefined') {\n\t\tshowComingSoonWarningOnPublish(initialPostStatus);\n\t} else {\n\t\tsetTimeout(listenToPostStatus, 50);\n\t}\n}\n\n// Start listening to post status changes\nlistenToPostStatus();\n"],"names":["default","launch","Path","SVG","createElement","xmlns","viewBox","d","stroke","useState","Modal","WP2Modal","Button","Icon","useDispatch","useSelect","useEffect","store","editPostStore","__","nfdComingSoonStore","setComingSoon","setIsModalOpen","isComingSoonActive","setIsComingSoonActive","isModalOpen","select","handlePublishAndLaunch","title","heading","launchButtonText","withoutLaunchButtonText","onRequestClose","className","icon","variant","onClick","wpSettingsRestRoute","NFD_PRE_PUBLISH_MODAL_ID","isOpen","type","STORE_NAME","createReduxStore","register","actions","selectors","reducer","nfdComingSoonStoreOptions","combineReducers","modal","state","action","resolve","apiFetch","comingSoon","url","method","data","then","promise","resolved","body","error","e","domReady","render","subscribe","dispatch","renderModal","elementId","modalRoot","document","id","getElementById","append","showComingSoonWarningOnPublish","postStatus","unssubscribe","currentPostStatus","window","wp","getEditedPostAttribute","checkElementAvailability","publishPanel","querySelector","setTimeout","listenToPostStatus","initialPostStatus"],"sourceRoot":""} \ No newline at end of file diff --git a/build/1.1.16/coming-soon.asset.php b/build/1.1.17/coming-soon.asset.php similarity index 61% rename from build/1.1.16/coming-soon.asset.php rename to build/1.1.17/coming-soon.asset.php index e8bb8a8..ec183a0 100644 --- a/build/1.1.16/coming-soon.asset.php +++ b/build/1.1.17/coming-soon.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7e3b27b25aa9f85ecd4a'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'f239b4d6b6524c513eac'); diff --git a/build/1.1.17/coming-soon.css b/build/1.1.17/coming-soon.css new file mode 100644 index 0000000..fe786bc --- /dev/null +++ b/build/1.1.17/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:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,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;-webkit-tap-highlight-color:transparent}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/1.1.17/coming-soon.js b/build/1.1.17/coming-soon.js new file mode 100644 index 0000000..66b31ca --- /dev/null +++ b/build/1.1.17/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/package.json b/package.json index 99fbe43..c4d6228 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@newfold-labs/wp-module-coming-soon", - "version": "1.1.16", + "version": "1.1.17", "description": "Coming Soon", "license": "GPL-2.0-or-later", "private": true,