diff --git a/build/admin.asset.php b/build/admin.asset.php index 8ca20bd5d..ac8955958 100644 --- a/build/admin.asset.php +++ b/build/admin.asset.php @@ -1 +1 @@ - array('wp-blocks', 'wp-data', 'wp-dom-ready'), 'version' => 'bccff6cd671b0e947c21'); + array('wp-blocks', 'wp-data', 'wp-dom-ready'), 'version' => '3611bca17011dd4cf5be'); diff --git a/build/admin.js b/build/admin.js index 462aead8f..7e0fe851e 100644 --- a/build/admin.js +++ b/build/admin.js @@ -1,262 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/helpers/globals.js": -/*!********************************!*\ - !*** ./src/helpers/globals.js ***! - \********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ enableSave: () => (/* binding */ enableSave), -/* harmony export */ getFromGlobal: () => (/* binding */ getFromGlobal), -/* harmony export */ isSinglePostInEditor: () => (/* binding */ isSinglePostInEditor), -/* harmony export */ setToGlobal: () => (/* binding */ setToGlobal) -/* 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__); - - -/** - * Enable the Save buttons after making an update. - * - * This function uses a hacky approach to trigger a change in the post's meta, which prompts - * Gutenberg to recognize that changes have been made and enables the Save buttons. - * It dispatches an editPost action with a non-existing meta key. - * - * @since 1.0.0 - * - * @todo This is a hacky approach and relies on the behavior described in - * https://github.com/WordPress/gutenberg/issues/13774. - * Monitor the issue for any updates or changes in the Gutenberg behavior. - */ -function enableSave() { - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)('core/editor')?.editPost({ - meta: { - _non_existing_meta: true - } - }); -} - -/** - * Checks if the current editor session is editing a post type entity. - * - * This function determines if the current context within the WordPress editor - * is focused on editing an entity that is classified as a post type. This includes - * single posts, pages, and custom post types. It is particularly useful for distinguishing - * editor sessions that are editing post type entities from those editing other types of content, - * such as widget areas or templates in the full site editor, ensuring that specific actions or features - * are correctly applied only when editing post type entities. - * - * @return {boolean} True if the current editor session is for editing a post type entity, false otherwise. - */ -function isSinglePostInEditor() { - return 'string' === typeof (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/editor')?.getCurrentPostType(); -} - -/** - * Get a value from the global GatherPress object based on the provided dot-separated path. - * - * This function is designed to retrieve values from the global GatherPress object. - * It takes a dot-separated path as an argument and traverses the object to return the specified value. - * If the object or any level along the path is undefined, it returns undefined. - * - * @since 1.0.0 - * - * @param {string} args - Dot-separated path to the desired property in the GatherPress global object. - * @return {*} The value at the specified path in the GatherPress global object or undefined if not found. - */ -function getFromGlobal(args) { - // eslint-disable-next-line no-undef - if ('object' !== typeof GatherPress) { - return undefined; - } - return args.split('.').reduce( - // eslint-disable-next-line no-undef - (GatherPress, level) => GatherPress && GatherPress[level], - // eslint-disable-next-line no-undef - GatherPress); -} - -/** - * Set a value to a global object based on the provided path. - * - * This function allows setting values within a nested global object using a dot-separated path. - * If the global object (GatherPress) does not exist, it will be initialized. - * - * @since 1.0.0 - * - * @param {string} args - Dot-separated path to the property. - * @param {*} value - The value to set. - * - * @return {void} - */ -function setToGlobal(args, value) { - // eslint-disable-next-line no-undef - if ('object' !== typeof GatherPress) { - return; - } - const properties = args.split('.'); - const last = properties.pop(); - - // eslint-disable-next-line no-undef - properties.reduce((all, item) => { - var _all$item; - return (_all$item = all[item]) !== null && _all$item !== void 0 ? _all$item : all[item] = {}; - }, GatherPress)[last] = value; -} - -/***/ }), - -/***/ "@wordpress/blocks": -/*!********************************!*\ - !*** external ["wp","blocks"] ***! - \********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blocks"]; - -/***/ }), - -/***/ "@wordpress/data": -/*!******************************!*\ - !*** external ["wp","data"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["data"]; - -/***/ }), - -/***/ "@wordpress/dom-ready": -/*!**********************************!*\ - !*** external ["wp","domReady"] ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["domReady"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // 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/admin.js ***! - \**********************/ -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _helpers_globals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/globals */ "./src/helpers/globals.js"); -/** - * WordPress dependencies. - */ - - - -/** - * Internal dependencies. - */ - - -/** - * Remove Unwanted Blocks - * - * This script removes unwanted blocks from the localized array. - * It utilizes the `domReady` function to ensure the DOM is ready before execution. - * It iterates through the keys of the 'unregister_blocks' array obtained from the global scope, - * retrieves the block name, and unregisters the block using the `unregisterBlockType` function. - * - * @since 1.0.0 - */ - -// Execute the following code when the DOM is ready. -_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default()(() => { - // Iterate through keys of the 'unregister_blocks' array in the global scope. - Object.keys((0,_helpers_globals__WEBPACK_IMPORTED_MODULE_2__.getFromGlobal)('misc.unregisterBlocks')).forEach(key => { - // Retrieve the block name using the key. - const blockName = (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_2__.getFromGlobal)('misc.unregisterBlocks')[key]; - - // Check if the block name is defined and unregister the block. - if (blockName && 'undefined' !== typeof (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.getBlockType)(blockName)) { - (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.unregisterBlockType)(blockName); - } - }); -}); -})(); - -/******/ })() -; -//# sourceMappingURL=admin.js.map \ No newline at end of file +(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=window.wp.domReady;var t=e.n(r);const o=window.wp.blocks;function s(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,r)=>e&&e[r]),GatherPress)}window.wp.data,t()((()=>{Object.keys(s("misc.unregisterBlocks")).forEach((e=>{const r=s("misc.unregisterBlocks")[e];r&&void 0!==(0,o.getBlockType)(r)&&(0,o.unregisterBlockType)(r)}))}))})(); \ No newline at end of file diff --git a/build/admin_style.asset.php b/build/admin_style.asset.php index 10231999a..87d61e235 100644 --- a/build/admin_style.asset.php +++ b/build/admin_style.asset.php @@ -1 +1 @@ - array(), 'version' => '54ce19837a9ab5960801'); + array(), 'version' => '95d396adaa06c1b8356f'); diff --git a/build/admin_style.css b/build/admin_style.css index a98b91de7..c1d058eb4 100644 --- a/build/admin_style.css +++ b/build/admin_style.css @@ -1,14 +1 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** 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/admin.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ -.gp-admin__membership-check { - align-items: center; - display: flex; - gap: 1rem; - padding: 0.5rem; -} -.gp-admin__membership-check > div:last-child { - margin-left: auto; -} - -/*# sourceMappingURL=admin_style.css.map*/ \ No newline at end of file +.gatherpress-admin__membership-check{align-items:center;display:flex;gap:1rem;padding:.5rem}.gatherpress-admin__membership-check>div:last-child{margin-left:auto} diff --git a/build/admin_style.js b/build/admin_style.js index 0cbe9c75a..e69de29bb 100644 --- a/build/admin_style.js +++ b/build/admin_style.js @@ -1,28 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ // The require scope -/******/ var __webpack_require__ = {}; -/******/ -/************************************************************************/ -/******/ /* 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__ = {}; -/*!************************!*\ - !*** ./src/admin.scss ***! - \************************/ -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - -/******/ })() -; -//# sourceMappingURL=admin_style.js.map \ No newline at end of file diff --git a/build/blocks/add-to-calendar/add-to-calendar.asset.php b/build/blocks/add-to-calendar/add-to-calendar.asset.php index 90bd4a096..123a42d99 100644 --- a/build/blocks/add-to-calendar/add-to-calendar.asset.php +++ b/build/blocks/add-to-calendar/add-to-calendar.asset.php @@ -1 +1 @@ - array('wp-dom-ready'), 'version' => 'c5e07b505ee22c88a97a'); + array('wp-dom-ready'), 'version' => '31a497a09971bf95824e'); diff --git a/build/blocks/add-to-calendar/add-to-calendar.js b/build/blocks/add-to-calendar/add-to-calendar.js index 9eecda5b2..b4c2f26fc 100644 --- a/build/blocks/add-to-calendar/add-to-calendar.js +++ b/build/blocks/add-to-calendar/add-to-calendar.js @@ -1,163 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "@wordpress/dom-ready": -/*!**********************************!*\ - !*** external ["wp","domReady"] ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["domReady"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // 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/blocks/add-to-calendar/add-to-calendar.js ***! - \*******************************************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies. - */ - - -/** - * Toggle to Show/Hide Calendar options. - * - * @param {TouchEvent} e Event. - */ -const addToCalendarToggle = e => { - e.preventDefault(); - const currentListDisplay = e.target.nextElementSibling.style.display; - const lists = document.querySelectorAll('.gp-add-to-calendar__list'); - for (let i = 0; i < lists.length; i++) { - lists[i].style.display = 'none'; - } - e.target.nextElementSibling.style.display = 'none' === currentListDisplay ? 'flex' : 'none'; -}; - -/** - * Initialize all Add To Calendar blocks. - * - * This function initializes the behavior of Add To Calendar blocks on the page. - * It sets up event listeners for click and keydown events to toggle the display - * of the calendar options list. The function targets elements with the class - * 'gp-add-to-calendar' and adds event listeners to handle user interactions. - * - * @since 1.0.0 - * - * @return {void} - */ -const addToCalendarInit = () => { - const containers = document.querySelectorAll('.gp-add-to-calendar'); - for (let i = 0; i < containers.length; i++) { - containers[i].querySelector('.gp-add-to-calendar__init').addEventListener('click', addToCalendarToggle, false); - document.addEventListener('click', ({ - target - }) => { - if (!target.closest('.gp-add-to-calendar')) { - containers[i].querySelector('.gp-add-to-calendar__list').style.display = 'none'; - } - }); - document.addEventListener('keydown', ({ - key - }) => { - if ('Escape' === key) { - containers[i].querySelector('.gp-add-to-calendar__list').style.display = 'none'; - } - }); - } -}; - -/** - * Callback for when the DOM is ready. - * - * This callback function is executed when the DOM is fully loaded and ready for manipulation. - * It calls the `addToCalendarInit` function to initialize the behavior of Add To Calendar blocks - * on the page, setting up event listeners for user interactions. - * - * @since 1.0.0 - * - * @return {void} - */ -_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default()(() => { - addToCalendarInit(); -}); -})(); - -/******/ })() -; -//# sourceMappingURL=add-to-calendar.js.map \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady,r=e=>{e.preventDefault();const t=e.target.nextElementSibling.style.display,r=document.querySelectorAll(".gatherpress-add-to-calendar__list");for(let e=0;e{(()=>{const e=document.querySelectorAll(".gatherpress-add-to-calendar");for(let t=0;t{r.closest(".gatherpress-add-to-calendar")||(e[t].querySelector(".gatherpress-add-to-calendar__list").style.display="none")})),document.addEventListener("keydown",(({key:r})=>{"Escape"===r&&(e[t].querySelector(".gatherpress-add-to-calendar__list").style.display="none")}))})()}))})(); \ No newline at end of file diff --git a/build/blocks/add-to-calendar/index.asset.php b/build/blocks/add-to-calendar/index.asset.php index 8ff45f2a0..036257ee2 100644 --- a/build/blocks/add-to-calendar/index.asset.php +++ b/build/blocks/add-to-calendar/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'd99d220bb310f2294e02'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '7f1ef69571912d591507'); diff --git a/build/blocks/add-to-calendar/index.js b/build/blocks/add-to-calendar/index.js index 90532e7fa..18a3c583e 100644 --- a/build/blocks/add-to-calendar/index.js +++ b/build/blocks/add-to-calendar/index.js @@ -1,402 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/blocks/add-to-calendar/edit.js": -/*!********************************************!*\ - !*** ./src/blocks/add-to-calendar/edit.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 */ }); -/* 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_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _components_EditCover__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/EditCover */ "./src/components/EditCover.js"); - -/** - * WordPress dependencies. - */ - - - - -/** - * Internal dependencies. - */ - - -/** - * Edit component for the GatherPress Add to Calendar block. - * - * This component renders the edit view of the GatherPress Add to Calendar block. - * It provides an interface for users to add the event to their calendar. - * The component includes an icon and a link for adding the event to the calendar. - * - * @since 1.0.0 - * - * @return {JSX.Element} The rendered React component. - */ -const Edit = () => { - const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - ...blockProps - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_EditCover__WEBPACK_IMPORTED_MODULE_4__["default"], null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Flex, { - justify: "normal", - align: "center", - gap: "4" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.FlexItem, { - display: "flex", - className: "gp-event-date__icon" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Icon, { - icon: "calendar" - })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.FlexItem, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { - href: "#" - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Add to calendar', 'gatherpress')))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit); - -/***/ }), - -/***/ "./src/blocks/add-to-calendar/index.js": -/*!*********************************************!*\ - !*** ./src/blocks/add-to-calendar/index.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/blocks/add-to-calendar/edit.js"); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/blocks/add-to-calendar/block.json"); -/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/add-to-calendar/style.scss"); -/** - * WordPress dependencies. - */ - - -/** - * Internal dependencies. - */ - - - - -/** - * Register the GatherPress Add to Calendar block. - * - * This code registers the GatherPress Add to Calendar block in the WordPress block editor. - * It utilizes the block metadata from the 'block.json' file and associates it with the - * edit component for rendering in the editor. The 'save' function is set to null as - * the block doesn't have a front-end representation and is only used in the editor. - * - * @since 1.0.0 - * - * @return {void} - */ - -(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__, { - edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], - save: () => null -}); - -/***/ }), - -/***/ "./src/components/EditCover.js": -/*!*************************************!*\ - !*** ./src/components/EditCover.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 */ }); -/* 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__); - -/** - * EditCover component for GatherPress. - * - * This component is used to create an overlay cover for the block editor. - * It is typically used to visually distinguish the selected and unselected states - * of a block in the editor. - * - * @since 1.0.0 - * - * @param {Object} props - Component properties. - * @param {boolean} props.isSelected - Indicates whether the block is selected. - * - * @return {JSX.Element} The rendered React component. - */ -const EditCover = props => { - const { - isSelected - } = props; - const display = isSelected ? 'none' : 'block'; - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - style: { - position: 'relative' - } - }, props.children, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - style: { - position: 'absolute', - top: '0', - right: '0', - bottom: '0', - left: '0', - display - } - })); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditCover); - -/***/ }), - -/***/ "./src/blocks/add-to-calendar/style.scss": -/*!***********************************************!*\ - !*** ./src/blocks/add-to-calendar/style.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/block-editor": -/*!*************************************!*\ - !*** external ["wp","blockEditor"] ***! - \*************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blockEditor"]; - -/***/ }), - -/***/ "@wordpress/blocks": -/*!********************************!*\ - !*** external ["wp","blocks"] ***! - \********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blocks"]; - -/***/ }), - -/***/ "@wordpress/components": -/*!************************************!*\ - !*** external ["wp","components"] ***! - \************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["components"]; - -/***/ }), - -/***/ "@wordpress/i18n": -/*!******************************!*\ - !*** external ["wp","i18n"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["i18n"]; - -/***/ }), - -/***/ "./src/blocks/add-to-calendar/block.json": -/*!***********************************************!*\ - !*** ./src/blocks/add-to-calendar/block.json ***! - \***********************************************/ -/***/ ((module) => { - -module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/add-to-calendar","version":"1.0.0","title":"Add to Calendar","category":"gatherpress","icon":"calendar","example":{},"description":"Allows a member to add an event to their preferred calendar.","attributes":{"blockId":{"type":"string"}},"supports":{"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScript":"file:./add-to-calendar.js","render":"file:./render.php"}'); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // 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; -/******/ } -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = __webpack_modules__; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/chunk loaded */ -/******/ (() => { -/******/ var deferred = []; -/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { -/******/ if(chunkIds) { -/******/ priority = priority || 0; -/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; -/******/ deferred[i] = [chunkIds, fn, priority]; -/******/ return; -/******/ } -/******/ var notFulfilled = Infinity; -/******/ for (var i = 0; i < deferred.length; i++) { -/******/ var [chunkIds, fn, priority] = deferred[i]; -/******/ var fulfilled = true; -/******/ for (var j = 0; j < chunkIds.length; j++) { -/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { -/******/ chunkIds.splice(j--, 1); -/******/ } else { -/******/ fulfilled = false; -/******/ if(priority < notFulfilled) notFulfilled = priority; -/******/ } -/******/ } -/******/ if(fulfilled) { -/******/ deferred.splice(i--, 1) -/******/ var r = fn(); -/******/ if (r !== undefined) result = r; -/******/ } -/******/ } -/******/ return result; -/******/ }; -/******/ })(); -/******/ -/******/ /* 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 }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/jsonp chunk loading */ -/******/ (() => { -/******/ // no baseURI -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ "blocks/add-to-calendar/index": 0, -/******/ "blocks/add-to-calendar/style-index": 0 -/******/ }; -/******/ -/******/ // no chunk on demand loading -/******/ -/******/ // no prefetching -/******/ -/******/ // no preloaded -/******/ -/******/ // no HMR -/******/ -/******/ // no HMR manifest -/******/ -/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); -/******/ -/******/ // install a JSONP callback for chunk loading -/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime] = data; -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0; -/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) var result = runtime(__webpack_require__); -/******/ } -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ installedChunks[chunkId][0](); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ return __webpack_require__.O(result); -/******/ } -/******/ -/******/ var chunkLoadingGlobal = globalThis["webpackChunkgatherpress"] = globalThis["webpackChunkgatherpress"] || []; -/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); -/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module depends on other loaded chunks and execution need to be delayed -/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["blocks/add-to-calendar/style-index"], () => (__webpack_require__("./src/blocks/add-to-calendar/index.js"))) -/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); -/******/ -/******/ })() -; -//# sourceMappingURL=index.js.map \ No newline at end of file +(()=>{"use strict";var e,t={5358:()=>{const e=window.wp.blocks,t=window.React,r=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.components,l=e=>{const{isSelected:r}=e,n=r?"none":"block";return(0,t.createElement)("div",{style:{position:"relative"}},e.children,(0,t.createElement)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:n}}))},o=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/add-to-calendar","version":"1.0.0","title":"Add to Calendar","category":"gatherpress","icon":"calendar","example":{},"description":"Allows a member to add an event to their preferred calendar.","attributes":{"blockId":{"type":"string"}},"supports":{"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScript":"file:./add-to-calendar.js","render":"file:./render.php"}');(0,e.registerBlockType)(o,{edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(l,null,(0,t.createElement)(a.Flex,{justify:"normal",align:"center",gap:"4"},(0,t.createElement)(a.FlexItem,{display:"flex",className:"gatherpress-event-date__icon"},(0,t.createElement)(a.Icon,{icon:"calendar"})),(0,t.createElement)(a.FlexItem,null,(0,t.createElement)("a",{href:"#"},(0,r.__)("Add to calendar","gatherpress"))))))},save:()=>null})}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,r,a,l)=>{if(!r){var o=1/0;for(d=0;d=l)&&Object.keys(n.O).every((e=>n.O[e](r[i])))?r.splice(i--,1):(s=!1,l0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[r,a,l]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={181:0,129:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,l,[o,s,i]=r,c=0;if(o.some((t=>0!==e[t]))){for(a in s)n.o(s,a)&&(n.m[a]=s[a]);if(i)var d=i(n)}for(t&&t(r);cn(5358)));a=n.O(a)})(); \ No newline at end of file diff --git a/build/blocks/add-to-calendar/render.php b/build/blocks/add-to-calendar/render.php index 6d4574823..b5b045590 100644 --- a/build/blocks/add-to-calendar/render.php +++ b/build/blocks/add-to-calendar/render.php @@ -12,19 +12,19 @@ $gatherpress_event = new Event( get_the_ID() ); ?>
> -
-
-
-
+
+
+
+
-
- +
+ -