diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..6546eabe --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [ "@babel/preset-env", "@babel/preset-react" ] +} diff --git a/Modula.php b/Modula.php index 4ca3e353..ad281fcf 100644 --- a/Modula.php +++ b/Modula.php @@ -4,7 +4,7 @@ * Plugin URI: https://wp-modula.com/ * Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks. * Author: WPChill -* Version: 2.8.13 +* Version: 2.8.14 * Author URI: https://www.wpchill.com/ * License: GPLv3 or later * License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -47,7 +47,7 @@ * @since 2.0.2 */ -define( 'MODULA_LITE_VERSION', '2.8.13' ); +define( 'MODULA_LITE_VERSION', '2.8.14' ); define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) ); define( 'MODULA_URL', plugin_dir_url( __FILE__ ) ); defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' ); diff --git a/assets/.DS_Store b/assets/.DS_Store index 6e23c02b..c9d8e416 100644 Binary files a/assets/.DS_Store and b/assets/.DS_Store differ diff --git a/assets/js/admin/wp-modula-gutenberg.js b/assets/js/admin/wp-modula-gutenberg.js index 88295e7b..f3629e84 100644 --- a/assets/js/admin/wp-modula-gutenberg.js +++ b/assets/js/admin/wp-modula-gutenberg.js @@ -1,1699 +1,956 @@ -!(function (t) { - var e = {}; - function a(n) { - if (e[n]) return e[n].exports; - var l = (e[n] = { i: n, l: !1, exports: {} }); - return t[n].call(l.exports, l, l.exports, a), (l.l = !0), l.exports; - } - (a.m = t), - (a.c = e), - (a.d = function (t, e, n) { - a.o(t, e) || - Object.defineProperty(t, e, { enumerable: !0, get: n }); - }), - (a.r = function (t) { - 'undefined' != typeof Symbol && - Symbol.toStringTag && - Object.defineProperty(t, Symbol.toStringTag, { - value: 'Module', - }), - Object.defineProperty(t, '__esModule', { value: !0 }); - }), - (a.t = function (t, e) { - if ((1 & e && (t = a(t)), 8 & e)) return t; - if (4 & e && 'object' == typeof t && t && t.__esModule) return t; - var n = Object.create(null); - if ( - (a.r(n), - Object.defineProperty(n, 'default', { - enumerable: !0, - value: t, - }), - 2 & e && 'string' != typeof t) - ) - for (var l in t) - a.d( - n, - l, - function (e) { - return t[e]; - }.bind(null, l) - ); - return n; - }), - (a.n = function (t) { - var e = - t && t.__esModule - ? function () { - return t.default; - } - : function () { - return t; - }; - return a.d(e, 'a', e), e; - }), - (a.o = function (t, e) { - return Object.prototype.hasOwnProperty.call(t, e); - }), - (a.p = ''), - a((a.s = 0)); -})([ - function (t, e, a) { - 'use strict'; - a.r(e); - var n = wp.element.useEffect, - l = function (t) { - var e = t.onIdChange, - a = t.id, - l = t.options, - o = t.galleries; - return ( - n(function () { - var t = []; - null != o && - 0 == t.length && - o.forEach(function (e) { - t.push({ - value: e.id, - label: e.title.rendered, - }); - }), - jQuery('.modula-gallery-input').selectize({ - valueField: 'value', - labelField: 'label', - searchField: ['label', 'value'], - create: !1, - maxItems: 1, - placeholder: 'Search for a gallery...', - preload: !0, - allowEmptyOptions: !0, - closeAfterSelect: !0, - options: l.concat(t), - render: { - option: function (t, e) { - return ( - '
' + - t.label + - ' (#' + - e(t.value) + - ')
' - ); - }, - }, - load: function (t, e) { - if (!t.length) return e(); - jQuery.ajax({ - url: modulaVars.ajaxURL, - type: 'GET', - data: { - action: 'modula_get_gallery', - nonce: modulaVars.nonce, - term: t, - }, - success: function (t) { - e(t); - }, - }); - }, - onChange: function (t) { - e(t); - }, - }); - }, []), - React.createElement('input', { - className: 'modula-gallery-input', - defaultValue: '0' == a ? '' : a, - }) - ); - }, - o = wp.i18n.__, - c = wp.element.Fragment, - i = wp.blockEditor.InspectorControls, - r = wp.components, - d = r.Button, - u = r.PanelBody, - s = wp.components.withFilters('modula.ModulaInspector')( - function (t) { - var e = t.attributes, - a = t.galleries, - n = t.onIdChange, - r = e.id, - s = e.currentSelectize; - return React.createElement( - c, - null, - React.createElement( - i, - null, - React.createElement( - u, - { - title: o( - 'Gallery Settings', - 'modula-best-grid-gallery' - ), - initialOpen: !0, - }, - a.length > 0 && - React.createElement( - c, - null, - React.createElement(l, { - id: r, - key: r, - value: r, - options: s, - onIdChange: n, - galleries: a, - }), - 0 != r && - React.createElement( - d, - { - target: '_blank', - href: - modulaVars.adminURL + - 'post.php?post=' + - r + - '&action=edit', - isSecondary: !0, - }, - o('Edit gallery') - ) - ) - ) - ) - ); - } - ), - m = {}; - (m.modula = React.createElement( - 'svg', - { - xmlns: 'http://www.w3.org/2000/svg', - x: '0px', - y: '0px', - viewBox: '364 242.9 312.2 357', - }, - React.createElement( - 'g', - null, - React.createElement('path', { - d: 'M528.1,242.9c8.5,16.9,17,33.8,25.6,50.6c13.4,26.4,26.9,52.7,39.9,79.7c-41.8-23.3-83.6-46.7-125.4-70.1 c0.3-1.9,1.7-2.6,2.7-3.5c17.7-17.7,35.4-35.4,53.1-53c1.1-1.1,2.6-2,3.1-3.7C527.4,242.9,527.8,242.9,528.1,242.9z', - }), - React.createElement('path', { - d: 'M602.3,463.3c11.3-6.9,22.6-13.9,33.9-20.8c5.5-3.4,11.1-6.7,16.5-10.3c2.2-1.4,2.9-1.1,3.5,1.5 c6.4,25.3,13,50.6,19.6,75.8c0.6,2.2,1,3.7-2.4,3.5c-46.7-2.1-93.5-4.1-140.2-6.1c-0.2,0-0.3-0.1-0.5-0.2c0.5-1.7,2.1-2,3.3-2.7 c20-12.3,39.9-24.7,60-36.8c3.4-2.1,5.1-3.7,4.8-8.5c-1.4-21.3-1.8-42.6-2.6-63.9c-0.9-24.1-1.8-48.3-2.8-72.4 c-0.2-6.1-0.2-6.1,5.5-4.6c23.8,6.2,47.6,12.5,71.5,18.5c3.9,1,4.2,1.9,2.1,5.4c-23.4,38.5-46.7,77.1-70,115.7c-1,1.7-2,3.4-3,5.1 C601.7,462.8,602,463,602.3,463.3z', - }), - React.createElement('path', { - d: 'M372.8,326.9c48,2.6,95.8,5.1,143.9,7.7c-0.9,2-2.5,2.3-3.7,3.1c-38.6,23.2-77.3,46.4-115.9,69.6c-3,1.8-4.3,2.6-5.4-1.9 c-5.9-24.9-12.2-49.7-18.3-74.6C373.1,329.6,373,328.4,372.8,326.9z', - }), - React.createElement('path', { - d: 'M517.6,599.9c-23.2-43.7-45.9-86.6-69.2-130.5c2.3,1.2,3.5,1.8,4.7,2.4c39.8,21.5,79.5,43.1,119.3,64.5 c3.2,1.7,4.1,2.5,1,5.6c-17.7,17.8-35.2,35.9-52.8,53.9C519.7,596.9,518.9,598.2,517.6,599.9z', - }), - React.createElement('path', { - d: 'M364.9,505.1c26.6-40.5,53.1-80.8,79.7-121.3c1.3,1.3,0.9,2.5,0.9,3.6c0,46-0.1,92-0.1,137.9c0,3.1-0.2,4.5-4,3.3 c-24.9-7.7-49.9-15.2-74.9-22.8C366,505.8,365.7,505.5,364.9,505.1z', - }) - ) - )), - (m.remove = React.createElement( - 'svg', - { - width: '24', - height: '24', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 24 24', - role: 'img', - 'aria-hidden': 'true', - focusable: 'false', - }, - React.createElement('path', { - d: 'M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z', - }) - )), - (m.replace = React.createElement( - 'svg', - { - width: '24', - height: '24', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 24 24', - role: 'img', - 'aria-hidden': 'true', - focusable: 'false', - }, - React.createElement('path', { - d: 'M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z', - }) - )), - (m.chevronLeft = React.createElement( - 'svg', - { - width: '24', - height: '24', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 24 24', - role: 'img', - 'aria-hidden': 'true', - focusable: 'false', - }, - React.createElement('path', { - d: 'M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z', - }) - )), - (m.chevronRight = React.createElement( - 'svg', - { - width: '24', - height: '24', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 24 24', - role: 'img', - 'aria-hidden': 'true', - focusable: 'false', - }, - React.createElement('path', { - d: 'M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z', - }) - )), - (m.twitter = React.createElement( - 'svg', - { - 'aria-hidden': 'true', - 'data-prefix': 'fab', - 'data-icon': 'twitter', - className: 'svg-inline--fa fa-twitter fa-w-16', - role: 'img', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 512 512', - }, - React.createElement('path', { - fill: 'currentColor', - d: 'M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z', - }) - )), - (m.facebook = React.createElement( - 'svg', - { - 'aria-hidden': 'true', - 'data-prefix': 'fab', - 'data-icon': 'facebook-f', - className: 'svg-inline--fa fa-facebook-f fa-w-9', - role: 'img', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 264 512', - }, - React.createElement('path', { - fill: 'currentColor', - d: 'M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229', - }) - )), - (m.whatsapp = React.createElement( - 'svg', - { - 'aria-hidden': 'true', - focusable: 'false', - preserveAspectRatio: 'xMidYMid meet', - viewBox: '0 0 1536 1600', - }, - React.createElement('path', { - d: 'M985 878q13 0 97.5 44t89.5 53q2 5 2 15q0 33-17 76q-16 39-71 65.5T984 1158q-57 0-190-62q-98-45-170-118T476 793q-72-107-71-194v-8q3-91 74-158q24-22 52-22q6 0 18 1.5t19 1.5q19 0 26.5 6.5T610 448q8 20 33 88t25 75q0 21-34.5 57.5T599 715q0 7 5 15q34 73 102 137q56 53 151 101q12 7 22 7q15 0 54-48.5t52-48.5zm-203 530q127 0 243.5-50t200.5-134t134-200.5t50-243.5t-50-243.5T1226 336t-200.5-134T782 152t-243.5 50T338 336T204 536.5T154 780q0 203 120 368l-79 233l242-77q158 104 345 104zm0-1382q153 0 292.5 60T1315 247t161 240.5t60 292.5t-60 292.5t-161 240.5t-240.5 161t-292.5 60q-195 0-365-94L0 1574l136-405Q28 991 28 780q0-153 60-292.5T249 247T489.5 86T782 26z', - fill: 'currentColor', - }) - )), - (m.pinterest = React.createElement( - 'svg', - { - 'aria-hidden': 'true', - 'data-prefix': 'fab', - 'data-icon': 'pinterest-p', - className: 'svg-inline--fa fa-pinterest-p fa-w-12', - role: 'img', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 384 512', - }, - React.createElement('path', { - fill: 'currentColor', - d: 'M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z', - }) - )), - (m.linkedin = React.createElement( - 'svg', - { - 'aria-hidden': 'true', - focusable: 'false', - 'data-prefix': 'fab', - 'data-icon': 'linkedin-in', - className: 'svg-inline--fa fa-linkedin-in fa-w-14', - role: 'img', - xmlns: 'http://www.w3.org/2000/svg', - viewBox: '0 0 448 512', - }, - React.createElement('path', { - fill: 'currentColor', - d: 'M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z', - }) - )), - (m.email = React.createElement( - 'svg', - { - xmlns: 'http://www.w3.org/2000/svg', - width: '24', - height: '24', - viewBox: '0 0 24 24', - }, - React.createElement('path', { - d: 'M0 3v18h24v-18h-24zm6.623 7.929l-4.623 5.712v-9.458l4.623 3.746zm-4.141-5.929h19.035l-9.517 7.713-9.518-7.713zm5.694 7.188l3.824 3.099 3.83-3.104 5.612 6.817h-18.779l5.513-6.812zm9.208-1.264l4.616-3.741v9.348l-4.616-5.607z', - fill: 'currentColor', - }) - )), - (m.chevronRightFancy = React.createElement( - 'svg', - { - xmlns: 'http://www.w3.org/2000/svg', - width: '16', - height: '16', - fill: 'currentColor', - className: 'bi bi-chevron-right', - viewBox: '0 0 16 16', - }, - React.createElement('path', { - fillRule: 'evenodd', - d: 'M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z', - }) - )); - var g = m, - f = wp.element.Fragment, - p = function (t) { - var e = t.settings, - a = t.img, - n = t.hideTitle, - l = t.hideDescription, - o = t.hideSocial; - return [ - React.createElement( - f, - null, - ['tilt_1', 'tilt_3', 'tilt_7'].includes(e.effect) && - React.createElement( - 'div', - { - className: - 'tilter__deco tilter__deco--shine', - }, - React.createElement('div', null) - ), - ['tilt_3', 'tilt_7'].includes(e.effect) && - React.createElement('div', { - className: 'tilter__deco tilter__deco--overlay', - }), - ['tilt_1', 'tilt_7'].includes(e.effect) && - React.createElement('div', { - className: 'tilter__deco tilter__deco--lines', - }), - React.createElement( - 'div', - { className: 'figc' }, - React.createElement( - 'div', - { className: 'figc-inner' }, - '0' == e.hide_title && - !n && - React.createElement( - 'div', - { className: 'jtg-title' }, - ' ', - a.title, - ' ' - ), - React.createElement( - 'div', - { - className: [ - 'lily', - 'centered-bottom', - 'sadie', - 'ruby', - 'bubba', - 'dexter', - 'chico', - 'ming', - ].includes(e.effect) - ? 'jtg-body' - : '', - }, - '0' == e.hide_description && - !l && - React.createElement( - 'p', - { className: 'description' }, - ' ', - 0 != a.description.length && - a.description, - ' ' - ), - !o && - '1' == e.enableSocial && - React.createElement( - 'div', - { className: 'jtg-social' }, - '1' == e.enableTwitter && - React.createElement( - 'a', - { - className: - 'modula-icon-twitter', - href: '#', - }, - ' ', - '$', - g.twitter, - ' ' - ), - '1' == e.enableFacebook && - React.createElement( - 'a', - { - className: - 'modula-icon-facebook', - href: '#', - }, - ' ', - '$', - g.facebook, - ' ' - ), - '1' == e.enableWhatsapp && - React.createElement( - 'a', - { - className: - 'modula-icon-whatsapp', - href: '#', - }, - ' ', - '$', - g.whatsapp, - ' ' - ), - '1' == e.enableLinkedin && - React.createElement( - 'a', - { - className: - 'modula-icon-linkedin', - href: '#', - }, - ' ', - '$', - g.linkedin, - ' ' - ), - '1' == e.enablePinterest && - React.createElement( - 'a', - { - className: - 'modula-icon-pinterest', - href: '#', - }, - ' ', - '$', - g.pinterest, - ' ' - ), - '1' == e.enableEmail && - React.createElement( - 'a', - { - className: - 'modula-icon-email', - href: '#', - }, - ' ', - '$', - g.email, - ' ' - ) - ) - ) - ) - ) - ), - ]; - }, - h = wp.components.withFilters('modula.ModulaGalleryImage')( - function (t) { - var e = t.attributes, - a = e.settings, - n = e.effectCheck, - l = t.img, - o = t.index; - return [ - React.createElement( - 'div', - { - className: 'modula-item effect-'.concat( - a.effect - ), - 'data-width': l['data-width'] - ? l['data-width'] - : '2', - 'data-height': l['data-height'] - ? l['data-height'] - : '2', - }, - React.createElement('div', { - className: 'modula-item-overlay', - }), - React.createElement( - 'div', - { className: 'modula-item-content' }, - React.createElement('img', { - className: 'modula-image pic', - 'data-id': l.id, - 'data-full': l.src, - 'data-src': l.src, - 'data-valign': 'middle', - 'data-halign': 'center', - src: l.src, - }), - 'slider' !== a.type && - React.createElement(p, { - settings: a, - img: l, - index: o, - hideTitle: null == n || 1 != n.title, - hideDescription: - null == n || 1 != n.description, - hideSocial: null == n || 1 != n.social, - effectCheck: n, - }) - ) - ), - ]; - } - ), - v = function (t) { - var e = t.id, - a = t.settings, - n = ''; - 'grid' == a.type && - 'automatic' != a.grid_type && - (n += '#jtg-' - .concat( - e, - '.modula-gallery .modula-item, .modula-gallery .modula-grid-sizer { width: calc(' - ) - .concat(100 / a.grid_type, '% - ') - .concat( - a.gutter - a.gutter / a.grid_type, - 'px) !important}' - )), - '0' != a.borderSize && - (n += '#jtg-' - .concat(e, ' .modula-item {\n\t\t\tborder: ') - .concat(a.borderSize, 'px solid ') - .concat(a.borderColor, ';\n\t\t}')), - '0' != a.borderRadius && - (n += '#jtg-' - .concat(e, ' .modula-item {\n\t\t\tborder-radius: ') - .concat(a.borderRadius, 'px;\n\t\t}')), - '0' != a.shadowSize && - (n += '#jtg-' - .concat(e, ' .modula-item {\n\t\t\tbox-shadow: ') - .concat(a.shadowColor, ' 0px 0px ') - .concat(a.shadowSize, 'px;\n\t\t}')), - '#ffffff' != a.socialIconColor && - (n += '#jtg-' - .concat( - e, - ' .modula-item .jtg-social a {\n\t\t\tcolor: ' - ) - .concat(a.socialIconColor, ';\n\t\t}')), - '16' != a.socialIconSize && - (n += '#jtg-' - .concat( - e, - ' .modula-item .jtg-social svg {\n\t\t\theight: ' - ) - .concat(a.socialIconSize, 'px;\n\t\t\twidth: ') - .concat(a.socialIconSize, 'px;\n\t\t}')), - '10' != a.socialIconPadding && - (n += '#jtg-' - .concat( - e, - ' .modula-item .jtg-social a:not(:last-child) {\n\t\t\tmargin-right: ' - ) - .concat(a.socialIconPadding, 'px;\n\t\t}')), - (n += '#jtg-' - .concat( - e, - ' .modula-item .caption {\n\t\tbackground-color: ' - ) - .concat(a.captionColor, ';\n\t}')), - '' != a.captionColor && - (n += '#jtg-' - .concat(e, ' .modula-item .figc {\n\t\t\tcolor: ') - .concat(a.captionColor, ';\n\t\t}')), - '' != a.titleFontSize && - '0' != a.titleFontSize && - (n += '#jtg-' - .concat( - e, - ' .modula-item .figc .jtg-title {\n\t\t\tfont-size: ' - ) - .concat(a.titleFontSize, 'px;\n\t\t}')), - '' != a.captionFontSize && - '0' != a.captionFontSize && - (n += '#jtg-' - .concat( - e, - ' .modula-item .figc p.description {\n\t\t\tfont-size: ' - ) - .concat(a.captionFontSize, 'px;\n\t\t}')), - (n += '#jtg-' - .concat( - e, - ' .modula-items .figc p.description {\n\t\t\tcolor: ' - ) - .concat(a.captionColor, ';\n\t}')), - '' != a.titleColor - ? (n += '#jtg-' - .concat( - e, - ' .modula-items .figc .jtg-title {\n\t\t\tcolor: ' - ) - .concat(a.titleColor, ';\n\t\t}')) - : (n += '#jtg-' - .concat( - e, - ' .modula-items .figc .jtg-title {\n\t\t\tcolor: ' - ) - .concat(a.captionColor, ';\n\t\t}')), - (n += '#jtg-' - .concat(e, '.modula-gallery .modula-item > a, #jtg-') - .concat(e, '.modula-gallery .modula-item, #jtg-') - .concat( - e, - '.modula-gallery .modula-item-content > a:not(.modula-no-follow){\n\t\tcursor: ' - ) - .concat(a.cursor, ';\n\t}')), - ('custom-grid' == a.type && 'slider' == a.type) || - ((n += '#jtg-' - .concat(e, ' {\n\t\twidth: ') - .concat(a.width, ';\n\t\tmargin : 0 auto;\n\t\t}')), - 0 == t.imagesCount - ? (n += '#jtg-'.concat( - e, - ' .modula-items {\n\t\t\t\theight: 100px;\n\t\t\t}' - )) - : 'grid' != a.type && 'slider' != a.type - ? (n += '#jtg-' - .concat( - e, - ' .modula-items {\n\t\t\t\theight: ' - ) - .concat(a.height, 'px;\n\t\t\t}')) - : 'slider' == a.type && - (n += '#jtg-'.concat( - e, - ' .modula-items {\n\t\t\t\theight: auto;\n\t\t\t}' - ))), - null != a.style && - 0 != a.style.length && - (n += ''.concat(a.style)); - var l = ''; - return ( - '' != a.mobileTitleFontSize && - 0 != a.mobileTitleFontSize && - (l += '#jtg-' - .concat( - e, - ' .modula-item .figc .jtg-title {\n\t\t\tfont-size: ' - ) - .concat(a.mobileTitleFontSize, 'px\n\t\t}')), - (l += '#jtg-' - .concat( - e, - ' .modula-items .figc p.description {\n\t\tcolor: ' - ) - .concat(a.captionColor, ';\n\t\tfont-size: ') - .concat(a.mobileCaptionFontSize, 'px;\n\t}')), - (n += '@media screen and (max-width:480px){\n\t\t'.concat( - l, - '\n\t\t}' - )), - 'none' == a.effect && - (n += '#jtg-'.concat( - e, - ' .modula-items .modula-item:hover img {\n\t\t\topacity: 1;\n\t\t}' - )), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item .modula-item-overlay, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-layla, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-ruby, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-bubba, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-sarah, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-milo, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-julia, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-hera, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-winston, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-selena, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-terry, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-phoebe, #jtg-' - ) - .concat( - e, - '.modula .modula-items} .modula-item.effect-apollo, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-steve, #jtg-' - ) - .concat( - e, - '.modula .modula-items .modula-item.effect-ming{ \n\t\tbackground-color: ' - ) - .concat(a.hoverColor, ';\n\t}')), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item.effect-oscar {\n\t\tbackground: -webkit-linear-gradient(45deg, ' - ) - .concat(a.hoverColor, ' 0, #9b4a1b 40%, ') - .concat( - a.hoverColor, - ' 100%);\n\t\tbackground: linear-gradient(45deg, ' - ) - .concat(a.hoverColor, ' 0, #9b4a1b 40%, ') - .concat(a.hoverColor, ' 100%);\n\t}')), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item.effect-roxy {\n\t\tbackground: -webkit-linear-gradient(45deg, ' - ) - .concat( - a.hoverColor, - ' 0, #05abe0 100%);\n\t\tbackground: linear-gradient(45deg, ' - ) - .concat(a.hoverColor, ' 0, #05abe0 100%);\n\t}')), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item.effect-dexter {\n\t\tbackground: -webkit-linear-gradient(top, ' - ) - .concat( - a.hoverColor, - ' 0, rgba(104,60,19,1) 100%);\n\t\tbackground: linear-gradient(top, ' - ) - .concat( - a.hoverColor, - ' 0, rgba(104,60,19,1) 100%);\n\t}' - )), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item.effect-jazz {\n\t\tbackground: -webkit-linear-gradient(-45deg, ' - ) - .concat( - a.hoverColor, - ' 0, #f33f58 100%);\n\t\tbackground: linear-gradient(-45deg, ' - ) - .concat(a.hoverColor, ' 0, #f33f58 100%);\n\t}')), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item.effect-lexi {\n\t\tbackground: -webkit-linear-gradient(-45deg, ' - ) - .concat( - a.hoverColor, - ' 0, #fff 100%);\n\t\tbackground: linear-gradient(-45deg, ' - ) - .concat(a.hoverColor, ' 0, #fff 100%);\n\t}')), - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item.effect-duke {\n\t\tbackground: -webkit-linear-gradient(-45deg, ' - ) - .concat( - a.hoverColor, - ' 0, #cc6055 100%);\n\t\tbackground: linear-gradient(-45deg, ' - ) - .concat(a.hoverColor, ' 0, #cc6055 100%);\n\t}')), - a.hoverOpacity <= 100 && - 'none' != a.effect && - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item:hover img {\n\t\t\topacity: ' - ) - .concat(1 - a.hoverOpacity / 100, ' ;\n\t\t}')), - 'default' != a.titleFontWeight && - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item .jtg-title {\n\t\t\tfont-weight : ' - ) - .concat(a.titleFontWeight, ';\n\t\t}')), - 'default' != a.captionFontWeight && - (n += '#jtg-' - .concat( - e, - '.modula .modula-items .modula-item p.description {\n\t\t\tfont-weight : ' - ) - .concat(a.captionFontWeight, ';\n\t\t}')), - (n += '#jtg-' - .concat( - e, - '.modula-gallery .modula-item.effect-terry .jtg-social a:not(:last-child) {\n\t\tmargin-bottom: ' - ) - .concat(a.socialIconPadding, 'px;\n\t}')), - 'slider' == a.type && - ('true' == - jQuery('[aria-label=Settings]').attr('aria-expanded') - ? (n += '#jtg-'.concat( - e, - ' {\n\t\t\t\t\twidth: 800px;\n\t\t\t\t\t}' - )) - : (n += '#jtg-'.concat( - e, - ' {\n\t\t\twidth: 1100px;\n\t\t\t}' - )), - (n += '#jtg-'.concat( - e, - ' .modula-items {\n\t\theight: auto;\n\t\t}' - )), - (n += '#jtg-'.concat( - e, - ' .modula-item {\n\t\tbackground-color: transparent;\n\t\ttransform: none;\n\t\t}' - ))), - null != a.filters && - a.filters.length > 1 && - (n += '#jtg-' - .concat( - e, - '.modula-gallery .filters {\n\t\t\ttext-align: ' - ) - .concat(a.filterTextAlignment, ';\n\t\t}')), - React.createElement('style', { - dangerouslySetInnerHTML: { - __html: '\n \t\t\t\t'.concat( - n, - '\n \t\t\t\t' - ), - }, - }) - ); - }, - y = wp.components.withFilters('modula.ModulaItemsExtraComponent')( - function (t) { - return null; - } - ); - function b() { - return (b = Object.assign - ? Object.assign.bind() - : function (t) { - for (var e = 1; e < arguments.length; e++) { - var a = arguments[e]; - for (var n in a) - Object.prototype.hasOwnProperty.call(a, n) && - (t[n] = a[n]); - } - return t; - }).apply(this, arguments); - } - var w = wp.element, - j = w.Fragment, - E = w.useEffect, - R = wp.components.withFilters('modula.modulaGallery')(function (t) { - var e = t.attributes, - a = e.images, - n = e.jsConfig, - l = e.id, - o = t.settings, - c = t.checkHoverEffect, - i = t.modulaRun, - r = t.modulaSlickRun; - E(function () { - void 0 !== o && c(o.effect), - 'slider' !== o.type ? i(n) : r(l); - }, []); - var d = 'modula modula-gallery ', - u = 'modula-items'; - return ( - 'creative-gallery' == o.type - ? (d += 'modula-creative-gallery') - : 'custom-grid' == o.type - ? (d += 'modula-custom-grid') - : 'slider' == o.type - ? (d = 'modula-slider') - : ((d += 'modula-columns'), - (u += ' grid-gallery'), - 'automatic' == o.grid_type && - (u += ' justified-gallery')), - [ - React.createElement( - j, - null, - React.createElement(v, { id: l, settings: o }), - React.createElement( - 'div', - { - id: 'jtg-'.concat(l), - className: '' - .concat(d, ' ') - .concat( - null != - t.attributes.modulaDivClassName - ? t.attributes - .modulaDivClassName - : '' - ), - 'data-config': JSON.stringify(n), - }, - 'grid' == o.type && - 'automatic' != o.grid_type && - React.createElement( - 'div', - { className: 'modula-grid-sizer' }, - ' ' - ), - React.createElement( - y, - b({}, t, { position: 'top' }) - ), - React.createElement( - 'div', - { className: u }, - a.length > 0 && - React.createElement( - j, - null, - React.createElement( - j, - null, - a.map(function (e, a) { - return [ - React.createElement( - h, - b({}, t, { - img: e, - key: a, - index: a, - }) - ), - ]; - }) - ) - ) - ), - React.createElement( - y, - b({}, t, { position: 'bottom' }) - ) - ) - ), - ] - ); - }); - function k() { - return (k = Object.assign - ? Object.assign.bind() - : function (t) { - for (var e = 1; e < arguments.length; e++) { - var a = arguments[e]; - for (var n in a) - Object.prototype.hasOwnProperty.call(a, n) && - (t[n] = a[n]); - } - return t; - }).apply(this, arguments); - } - function x(t, e) { - return ( - (function (t) { - if (Array.isArray(t)) return t; - })(t) || - (function (t, e) { - var a = - null == t - ? null - : ('undefined' != typeof Symbol && - t[Symbol.iterator]) || - t['@@iterator']; - if (null == a) return; - var n, - l, - o = [], - c = !0, - i = !1; - try { - for ( - a = a.call(t); - !(c = (n = a.next()).done) && - (o.push(n.value), !e || o.length !== e); - c = !0 - ); - } catch (t) { - (i = !0), (l = t); - } finally { - try { - c || null == a.return || a.return(); - } finally { - if (i) throw l; - } - } - return o; - })(t, e) || - (function (t, e) { - if (!t) return; - if ('string' == typeof t) return _(t, e); - var a = Object.prototype.toString.call(t).slice(8, -1); - 'Object' === a && t.constructor && (a = t.constructor.name); - if ('Map' === a || 'Set' === a) return Array.from(t); - if ( - 'Arguments' === a || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) - ) - return _(t, e); - })(t, e) || - (function () { - throw new TypeError( - 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' - ); - })() - ); - } - function _(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var a = 0, n = new Array(e); a < e; a++) n[a] = t[a]; - return n; - } - var C = wp.i18n.__, - z = wp.element, - S = z.Fragment, - N = z.useEffect, - T = z.useState, - M = wp.data.withSelect, - F = wp.components, - I = F.Button, - O = F.Spinner, - q = F.ToolbarGroup, - V = F.ToolbarItem, - B = wp.blockEditor.BlockControls, - L = (0, wp.compose.compose)( - M(function (t, e) { - return { - galleries: - (0, t('core').getEntityRecords)( - 'postType', - 'modula-gallery', - { post_status: 'publish', per_page: 5 } - ) || [], - }; - }), - wp.components.withFilters('modula.ModulaEdit') - )(function (t) { - var e = t.attributes, - a = t.galleries, - n = t.setAttributes, - o = e.id, - c = e.images, - i = e.status, - r = e.settings, - d = e.jsConfig, - u = e.galleryId, - m = (e.currentGallery, e.currentSelectize), - f = x(T(t.attributes.align), 2), - p = (f[0], f[1], x(T(o), 2)), - h = p[0]; - p[1]; - N(function () { - 0 !== o && v(o); - }, []), - N(function () { - jQuery(document).on( - 'modula_api_after_init', - function (e, a) { - t.setAttributes({ instance: a }); - } - ), - null != t.attributes.instance && - null != r && - 'grid' == r.type && - t.attributes.instance.reset( - t.attributes.instance - ); - }); - var v = function (t) { - isNaN(t) || - '' == t || - ((t = parseInt(t)), - wp - .apiFetch({ - path: 'wp/v2/modula-gallery/'.concat(t), - }) - .then(function (e) { - var a; - n({ currentGallery: e }), - n({ - currentSelectize: [ - { - value: t, - label: - '' === e.title.rendered - ? 'Unnamed' - : ((a = - e.title - .rendered), - a - .replace( - '’', - "'" - ) - .replace( - '“', - '"' - ) - .replace( - '‘', - "'" - )), - }, - ], - }), - jQuery.ajax({ - type: 'POST', - data: { - action: 'modula_get_gallery_meta', - id: t, - nonce: modulaVars.nonce, - }, - url: modulaVars.ajaxURL, - success: function (e) { - return y(t, e); - }, - }); - })); - }; - var y = function (t, e) { - !1 !== e.success - ? ((h == t && null != r) || b(t), - n({ id: t, images: e, status: 'ready' })) - : n({ id: t, status: 'ready' }); - }, - b = function (t) { - fetch( - '' - .concat( - modulaVars.restURL, - 'wp/v2/modula-gallery/' - ) - .concat(t) - ) - .then(function (t) { - return t.json(); - }) - .then(function (t) { - var e = t; - n({ status: 'loading' }), - jQuery.ajax({ - type: 'POST', - data: { - action: 'modula_get_jsconfig', - nonce: modulaVars.nonce, - settings: e.modulaSettings, - }, - url: modulaVars.ajaxURL, - success: function (t) { - var a = Math.floor( - 999 * Math.random() - ); - n({ - galleryId: a, - settings: e.modulaSettings, - jsConfig: t, - status: 'ready', - }); - }, - }); - }); - }, - w = React.createElement( - B, - null, - c && - c.length > 0 && - React.createElement( - q, - null, - React.createElement( - V, - null, - React.createElement(I, { - label: C( - 'Edit gallery', - 'modula-best-grid-gallery' - ), - icon: 'edit', - href: - modulaVars.adminURL + - 'post.php?post=' + - o + - '&action=edit', - target: '_blank', - }) - ) - ) - ); - return 0 == o && 'none' === e.galleryType - ? React.createElement( - S, - null, - React.createElement( - 'div', - { className: 'modula-block-preview' }, - React.createElement( - 'div', - { - className: - 'modula-block-preview__content', - }, - React.createElement('div', { - className: 'modula-block-preview__logo', - }), - React.createElement( - 'div', - { className: 'modula-button-group' }, - 0 == a.length && - React.createElement( - 'p', - null, - ' ', - C( - 'Sorry no galleries found', - 'modula-best-grid-gallery' - ), - ' ' - ), - a.length > 0 && - React.createElement( - I, - { - className: 'modula-button', - target: '_blank', - onClick: function (t) { - n({ - status: 'ready', - id: 0, - galleryType: - 'gallery', - }); - }, - }, - C( - 'Display An Existing Gallery', - 'modula-best-grid-gallery' - ), - g.chevronRightFancy - ), - null == t.attributes.proInstalled && - a.length > 0 && - React.createElement( - I, - { - href: 'https://wp-modula.com/pricing/?utm_source=modula-lite&utm_campaign=upsell', - className: - 'modula-button-upsell', - isSecondary: !0, - target: '_blank', - }, - C( - 'Upgrade to PRO to create galleries using a preset ( fastest way )', - 'modula-best-grid-gallery' - ) - ) - ) - ) - ) - ) - : 'loading' === i - ? React.createElement( - 'div', - { className: 'modula-block-preview' }, - React.createElement( - 'div', - { className: 'modula-block-preview__content' }, - React.createElement('div', { - className: 'modula-block-preview__logo', - }), - React.createElement(O, null) - ) - ) - : 0 == o || 0 === c.length - ? React.createElement( - S, - { key: '233' }, - React.createElement( - s, - k( - { - onIdChange: function (t) { - return v(t); - }, - selectOptions: function () { - var t = [ - { - value: 0, - label: C( - 'select a gallery', - 'modula-best-grid-gallery' - ), - }, - ]; - return ( - a.forEach(function (e) { - var a = e.title, - n = e.id; - 0 == a.rendered.length - ? t.push({ - value: n, - label: - C( - 'Unnamed Gallery', - 'modula-best-grid-gallery' - ) + n, - }) - : t.push({ - value: n, - label: a.rendered, - }); - }), - t - ); - }, - }, - t - ) - ), - React.createElement( - 'div', - { className: 'modula-block-preview' }, - React.createElement( - 'div', - { - className: - 'modula-block-preview__content', - }, - React.createElement('div', { - className: 'modula-block-preview__logo', - }), - a.length > 0 && - React.createElement( - S, - null, - React.createElement(l, { - id: o, - key: o, - value: o, - options: m, - onIdChange: v, - galleries: a, - }), - 0 != o && - React.createElement( - I, - { - target: '_blank', - href: - modulaVars.adminURL + - 'post.php?post=' + - o + - '&action=edit', - isPrimary: !0, - }, - C('Edit Gallery') - ) - ) - ) - ) - ) - : r - ? React.createElement( - S, - { key: '1' }, - w, - React.createElement( - s, - k( - { - onIdChange: function (t) { - v(t); - }, - }, - t - ) - ), - React.createElement( - R, - k({}, t, { - settings: r, - jsConfig: d, - modulaRun: function (t) { - if (null != t) { - n({ status: 'ready' }); - var e = jQuery( - '.modula.modula-gallery' - ); - jQuery.each(e, function () { - jQuery(this).attr('id'); - var t = - jQuery(this).data('config'); - (t.lazyLoad = 0), - jQuery(this).modulaGallery( - t - ); - }); - } - }, - modulaSlickRun: function (t) { - if ( - ((t = 'jtg-'.concat(t)), - n({ status: 'ready' }), - jQuery('.modula-slider').length > - 0 && void 0 !== jQuery.fn.slick) - ) { - var e = jQuery('#'.concat(t)).data( - 'config' - ), - a = jQuery('#'.concat(t)).find( - '.modula-slider-nav' - ), - l = jQuery('#'.concat(t)).find( - '.modula-items' - ); - if ( - (l.slick(e.slider_settings), - a.length) - ) { - var o = a.data('config'), - c = - l.slick( - 'slickCurrentSlide' - ); - a.on('init', function (t, e) { - a.find( - '.slick-slide[data-slick-index="' + - c + - '"]' - ).addClass('is-active'); - }), - a.slick(o), - l.on( - 'afterChange', - function (t, e, n) { - a.slick( - 'slickGoTo', - n - ); - var l = - '.slick-slide[data-slick-index="' + - n + - '"]'; - a - .find( - '.slick-slide.is-active' - ) - .removeClass( - 'is-active' - ), - a - .find(l) - .addClass( - 'is-active' - ); - } - ), - a.on( - 'click', - '.slick-slide', - function (t) { - t.preventDefault(); - var e = - jQuery( - this - ).data( - 'slick-index' - ); - l.slick( - 'slickGoTo', - e - ); - } - ); - } - } - }, - checkHoverEffect: function (t) { - jQuery.ajax({ - type: 'POST', - data: { - action: 'modula_check_hover_effect', - nonce: modulaVars.nonce, - effect: t, - }, - url: modulaVars.ajaxURL, - success: function (t) { - n({ effectCheck: t }); - }, - }); - }, - galleryId: u, - }) - ) - ) - : null; - }); - function P(t, e) { - for (var a = 0; a < e.length; a++) { - var n = e[a]; - (n.enumerable = n.enumerable || !1), - (n.configurable = !0), - 'value' in n && (n.writable = !0), - Object.defineProperty(t, n.key, n); - } - } - var Q = wp.i18n.__, - A = wp.blocks.registerBlockType; - new ((function () { - function t() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError( - 'Cannot call a class as a function' - ); - })(this, t), - this.registerBlock(); - } - var e, a, n; - return ( - (e = t), - (a = [ - { - key: 'registerBlock', - value: function () { - (this.blockName = 'modula/gallery'), - (this.blockAttributes = { - id: { type: 'number', default: 0 }, - images: { type: 'array', default: [] }, - status: { - type: 'string', - default: 'ready', - }, - galleryId: { type: 'number', default: 0 }, - defaultSettings: { - type: 'object', - default: [], - }, - galleryType: { - type: 'string', - default: 'none', - }, - currentGallery: { - type: 'object', - default: {}, - }, - currentSelectize: { - type: 'array', - default: [], - }, - }), - A(this.blockName, { - title: modulaVars.gutenbergTitle, - icon: g.modula, - description: Q( - 'Make your galleries stand out.', - 'modula-best-grid-gallery' - ), - keywords: [ - Q('gallery'), - Q('modula'), - Q('images'), - ], - category: 'common', - supports: { - align: !0, - customClassName: !1, - }, - attributes: this.blockAttributes, - edit: L, - save: function () { - return null; - }, - }); - }, - }, - ]) && P(e.prototype, a), - n && P(e, n), - Object.defineProperty(e, 'prototype', { writable: !1 }), - t - ); - })())(); - }, -]); +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; + +;// CONCATENATED MODULE: ./assets/src/js/components/ModulaGallerySearch.js +var useEffect = wp.element.useEffect; +var ModulaGallerySearch = function ModulaGallerySearch(props) { + var onIdChange = props.onIdChange, + id = props.id, + options = props.options, + galleries = props.galleries; + useEffect(function () { + var galleriesArray = []; + if (galleries != undefined && 0 == galleriesArray.length) { + galleries.forEach(function (gallery) { + galleriesArray.push({ + value: gallery.id, + label: gallery.title.rendered + }); + }); + } + jQuery('.modula-gallery-input').selectize({ + valueField: 'value', + labelField: 'label', + searchField: ['label', 'value'], + create: false, + maxItems: 1, + placeholder: 'Search for a gallery...', + preload: true, + allowEmptyOptions: true, + closeAfterSelect: true, + options: options.concat(galleriesArray), + render: { + option: function option(item, escape) { + return '
' + '' + item.label + ' (#' + escape(item.value) + ')' + '
'; + } + }, + load: function load(query, callback) { + if (!query.length) { + return callback(); + } + jQuery.ajax({ + url: modulaVars.ajaxURL, + type: 'GET', + data: { + action: 'modula_get_gallery', + nonce: modulaVars.nonce, + term: query + }, + success: function success(res) { + callback(res); + } + }); + }, + onChange: function onChange(value) { + onIdChange(value); + } + }); + }, []); + return /*#__PURE__*/React.createElement("input", { + className: "modula-gallery-input", + defaultValue: '0' == id ? '' : id + }); +}; +/* harmony default export */ const components_ModulaGallerySearch = (ModulaGallerySearch); +;// CONCATENATED MODULE: ./assets/src/js/components/inspector.js + + +/** + * WordPress dependencies + */ +var __ = wp.i18n.__; +var Fragment = wp.element.Fragment; +var InspectorControls = wp.blockEditor.InspectorControls; +var _wp$components = wp.components, + Button = _wp$components.Button, + PanelBody = _wp$components.PanelBody; + +/** + * Inspector controls + */ +var Inspector = function Inspector(props) { + var attributes = props.attributes, + galleries = props.galleries, + onIdChange = props.onIdChange; + var id = attributes.id, + currentSelectize = attributes.currentSelectize; + return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, { + title: __('Gallery Settings', 'modula-best-grid-gallery'), + initialOpen: true + }, galleries.length > 0 && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(components_ModulaGallerySearch, { + id: id, + key: id, + value: id, + options: currentSelectize, + onIdChange: onIdChange, + galleries: galleries + }), id != 0 && /*#__PURE__*/React.createElement(Button, { + target: "_blank", + href: modulaVars.adminURL + 'post.php?post=' + id + '&action=edit', + isSecondary: true + }, __('Edit gallery')))))); +}; +/* harmony default export */ const inspector = (wp.components.withFilters('modula.ModulaInspector')(Inspector)); +;// CONCATENATED MODULE: ./assets/src/js/utils/icons.js +var icons = {}; +icons.modula = /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", + x: "0px", + y: "0px", + viewBox: "364 242.9 312.2 357" +}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", { + d: "M528.1,242.9c8.5,16.9,17,33.8,25.6,50.6c13.4,26.4,26.9,52.7,39.9,79.7c-41.8-23.3-83.6-46.7-125.4-70.1\r c0.3-1.9,1.7-2.6,2.7-3.5c17.7-17.7,35.4-35.4,53.1-53c1.1-1.1,2.6-2,3.1-3.7C527.4,242.9,527.8,242.9,528.1,242.9z" +}), /*#__PURE__*/React.createElement("path", { + d: "M602.3,463.3c11.3-6.9,22.6-13.9,33.9-20.8c5.5-3.4,11.1-6.7,16.5-10.3c2.2-1.4,2.9-1.1,3.5,1.5\r c6.4,25.3,13,50.6,19.6,75.8c0.6,2.2,1,3.7-2.4,3.5c-46.7-2.1-93.5-4.1-140.2-6.1c-0.2,0-0.3-0.1-0.5-0.2c0.5-1.7,2.1-2,3.3-2.7\r c20-12.3,39.9-24.7,60-36.8c3.4-2.1,5.1-3.7,4.8-8.5c-1.4-21.3-1.8-42.6-2.6-63.9c-0.9-24.1-1.8-48.3-2.8-72.4\r c-0.2-6.1-0.2-6.1,5.5-4.6c23.8,6.2,47.6,12.5,71.5,18.5c3.9,1,4.2,1.9,2.1,5.4c-23.4,38.5-46.7,77.1-70,115.7c-1,1.7-2,3.4-3,5.1\r C601.7,462.8,602,463,602.3,463.3z" +}), /*#__PURE__*/React.createElement("path", { + d: "M372.8,326.9c48,2.6,95.8,5.1,143.9,7.7c-0.9,2-2.5,2.3-3.7,3.1c-38.6,23.2-77.3,46.4-115.9,69.6c-3,1.8-4.3,2.6-5.4-1.9\r c-5.9-24.9-12.2-49.7-18.3-74.6C373.1,329.6,373,328.4,372.8,326.9z" +}), /*#__PURE__*/React.createElement("path", { + d: "M517.6,599.9c-23.2-43.7-45.9-86.6-69.2-130.5c2.3,1.2,3.5,1.8,4.7,2.4c39.8,21.5,79.5,43.1,119.3,64.5\r c3.2,1.7,4.1,2.5,1,5.6c-17.7,17.8-35.2,35.9-52.8,53.9C519.7,596.9,518.9,598.2,517.6,599.9z" +}), /*#__PURE__*/React.createElement("path", { + d: "M364.9,505.1c26.6-40.5,53.1-80.8,79.7-121.3c1.3,1.3,0.9,2.5,0.9,3.6c0,46-0.1,92-0.1,137.9c0,3.1-0.2,4.5-4,3.3\r c-24.9-7.7-49.9-15.2-74.9-22.8C366,505.8,365.7,505.5,364.9,505.1z" +}))); +icons.remove = /*#__PURE__*/React.createElement("svg", { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + role: "img", + "aria-hidden": "true", + focusable: "false" +}, /*#__PURE__*/React.createElement("path", { + d: "M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z" +})); +icons.replace = /*#__PURE__*/React.createElement("svg", { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + role: "img", + "aria-hidden": "true", + focusable: "false" +}, /*#__PURE__*/React.createElement("path", { + d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z" +})); +icons.chevronLeft = /*#__PURE__*/React.createElement("svg", { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + role: "img", + "aria-hidden": "true", + focusable: "false" +}, /*#__PURE__*/React.createElement("path", { + d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" +})); +icons.chevronRight = /*#__PURE__*/React.createElement("svg", { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + role: "img", + "aria-hidden": "true", + focusable: "false" +}, /*#__PURE__*/React.createElement("path", { + d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" +})); +icons.twitter = /*#__PURE__*/React.createElement("svg", { + "aria-hidden": "true", + "data-prefix": "fab", + "data-icon": "twitter", + className: "svg-inline--fa fa-twitter fa-w-16", + role: "img", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 512 512" +}, /*#__PURE__*/React.createElement("path", { + fill: "currentColor", + d: "M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z" +})); +icons.facebook = /*#__PURE__*/React.createElement("svg", { + "aria-hidden": "true", + "data-prefix": "fab", + "data-icon": "facebook-f", + className: "svg-inline--fa fa-facebook-f fa-w-9", + role: "img", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 264 512" +}, /*#__PURE__*/React.createElement("path", { + fill: "currentColor", + d: "M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229" +})); +icons.whatsapp = /*#__PURE__*/React.createElement("svg", { + "aria-hidden": "true", + focusable: "false", + preserveAspectRatio: "xMidYMid meet", + viewBox: "0 0 1536 1600" +}, /*#__PURE__*/React.createElement("path", { + d: "M985 878q13 0 97.5 44t89.5 53q2 5 2 15q0 33-17 76q-16 39-71 65.5T984 1158q-57 0-190-62q-98-45-170-118T476 793q-72-107-71-194v-8q3-91 74-158q24-22 52-22q6 0 18 1.5t19 1.5q19 0 26.5 6.5T610 448q8 20 33 88t25 75q0 21-34.5 57.5T599 715q0 7 5 15q34 73 102 137q56 53 151 101q12 7 22 7q15 0 54-48.5t52-48.5zm-203 530q127 0 243.5-50t200.5-134t134-200.5t50-243.5t-50-243.5T1226 336t-200.5-134T782 152t-243.5 50T338 336T204 536.5T154 780q0 203 120 368l-79 233l242-77q158 104 345 104zm0-1382q153 0 292.5 60T1315 247t161 240.5t60 292.5t-60 292.5t-161 240.5t-240.5 161t-292.5 60q-195 0-365-94L0 1574l136-405Q28 991 28 780q0-153 60-292.5T249 247T489.5 86T782 26z", + fill: "currentColor" +})); +icons.pinterest = /*#__PURE__*/React.createElement("svg", { + "aria-hidden": "true", + "data-prefix": "fab", + "data-icon": "pinterest-p", + className: "svg-inline--fa fa-pinterest-p fa-w-12", + role: "img", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 384 512" +}, /*#__PURE__*/React.createElement("path", { + fill: "currentColor", + d: "M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z" +})); +icons.linkedin = /*#__PURE__*/React.createElement("svg", { + "aria-hidden": "true", + focusable: "false", + "data-prefix": "fab", + "data-icon": "linkedin-in", + className: "svg-inline--fa fa-linkedin-in fa-w-14", + role: "img", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 448 512" +}, /*#__PURE__*/React.createElement("path", { + fill: "currentColor", + d: "M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z" +})); +icons.email = /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + viewBox: "0 0 24 24" +}, /*#__PURE__*/React.createElement("path", { + d: "M0 3v18h24v-18h-24zm6.623 7.929l-4.623 5.712v-9.458l4.623 3.746zm-4.141-5.929h19.035l-9.517 7.713-9.518-7.713zm5.694 7.188l3.824 3.099 3.83-3.104 5.612 6.817h-18.779l5.513-6.812zm9.208-1.264l4.616-3.741v9.348l-4.616-5.607z", + fill: "currentColor" +})); +icons.chevronRightFancy = /*#__PURE__*/React.createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", + width: "16", + height: "16", + fill: "currentColor", + className: "bi bi-chevron-right", + viewBox: "0 0 16 16" +}, /*#__PURE__*/React.createElement("path", { + fillRule: "evenodd", + d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" +})); +/* harmony default export */ const utils_icons = (icons); +;// CONCATENATED MODULE: ./assets/src/js/components/ModulaGalleryImageInner.js + +var ModulaGalleryImageInner_Fragment = wp.element.Fragment; +var ModulaGalleryImageInner = function ModulaGalleryImageInner(props) { + var settings = props.settings, + img = props.img, + hideTitle = props.hideTitle, + hideDescription = props.hideDescription, + hideSocial = props.hideSocial; + var effectArray = ['tilt_1', 'tilt_3', 'tilt_7'], + overlayArray = ['tilt_3', 'tilt_7'], + svgArray = ['tilt_1', 'tilt_7'], + jtgBody = ['lily', 'centered-bottom', 'sadie', 'ruby', 'bubba', 'dexter', 'chico', 'ming']; + return [/*#__PURE__*/React.createElement(ModulaGalleryImageInner_Fragment, null, effectArray.includes(settings.effect) && /*#__PURE__*/React.createElement("div", { + className: "tilter__deco tilter__deco--shine" + }, /*#__PURE__*/React.createElement("div", null)), overlayArray.includes(settings.effect) && /*#__PURE__*/React.createElement("div", { + className: "tilter__deco tilter__deco--overlay" + }), svgArray.includes(settings.effect) && /*#__PURE__*/React.createElement("div", { + className: "tilter__deco tilter__deco--lines" + }), /*#__PURE__*/React.createElement("div", { + className: "figc" + }, /*#__PURE__*/React.createElement("div", { + className: "figc-inner" + }, '0' == settings.hide_title && !hideTitle && /*#__PURE__*/React.createElement("div", { + className: 'jtg-title' + }, " ", img.title, " "), /*#__PURE__*/React.createElement("div", { + className: jtgBody.includes(settings.effect) ? 'jtg-body' : '' + }, '0' == settings.hide_description && !hideDescription && /*#__PURE__*/React.createElement("p", { + className: "description" + }, ' ', 0 != img.description.length && img.description, ' '), !hideSocial && '1' == settings.enableSocial && /*#__PURE__*/React.createElement("div", { + className: "jtg-social" + }, '1' == settings.enableTwitter && /*#__PURE__*/React.createElement("a", { + className: "modula-icon-twitter", + href: "#" + }, ' ', "$", utils_icons.twitter, ' '), '1' == settings.enableFacebook && /*#__PURE__*/React.createElement("a", { + className: "modula-icon-facebook", + href: "#" + }, ' ', "$", utils_icons.facebook, ' '), '1' == settings.enableWhatsapp && /*#__PURE__*/React.createElement("a", { + className: "modula-icon-whatsapp", + href: "#" + }, ' ', "$", utils_icons.whatsapp, ' '), '1' == settings.enableLinkedin && /*#__PURE__*/React.createElement("a", { + className: "modula-icon-linkedin", + href: "#" + }, ' ', "$", utils_icons.linkedin, ' '), '1' == settings.enablePinterest && /*#__PURE__*/React.createElement("a", { + className: "modula-icon-pinterest", + href: "#" + }, ' ', "$", utils_icons.pinterest, ' '), '1' == settings.enableEmail && /*#__PURE__*/React.createElement("a", { + className: "modula-icon-email", + href: "#" + }, ' ', "$", utils_icons.email, ' '))))))]; +}; +/* harmony default export */ const components_ModulaGalleryImageInner = (ModulaGalleryImageInner); +;// CONCATENATED MODULE: ./assets/src/js/components/ModulaGalleryImage.js + +var ModulaGalleryImage = function ModulaGalleryImage(props) { + var _props$attributes = props.attributes, + settings = _props$attributes.settings, + effectCheck = _props$attributes.effectCheck; + var img = props.img, + index = props.index; + var itemClassNames = "modula-item effect-".concat(settings.effect); + if (settings.type === 'slider') { + itemClassNames = 'modula-item f-carousel__slide'; + } + var renderMedia = function renderMedia() { + if (!img.video_template || img.video_template !== '1' || !img.video_type) { + // Return image element if video_template is not defined or is not '1' + return /*#__PURE__*/React.createElement("img", { + className: "modula-image pic", + "data-id": img.id, + "data-full": img.src, + "data-src": img.src, + "data-valign": "middle", + "data-halign": "center", + src: img.src + }); + } else if (img.video_type === 'hosted') { + // Return video element if video_type is 'hosted' + return /*#__PURE__*/React.createElement("div", { + className: "video-sizer" + }, /*#__PURE__*/React.createElement("video", { + controls: true + }, /*#__PURE__*/React.createElement("source", { + src: img.src, + type: "video/mp4" + }), "Your browser does not support the video tag.")); + } else if (img.video_type === 'iframe') { + // Return iframe element if video_type is 'iframe' + return /*#__PURE__*/React.createElement("div", { + className: "video-sizer" + }, /*#__PURE__*/React.createElement("iframe", { + src: img.src, + frameBorder: "0", + allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", + allowFullScreen: true + })); + } + }; + return /*#__PURE__*/React.createElement("div", { + className: itemClassNames + }, /*#__PURE__*/React.createElement("div", { + className: "modula-item-overlay" + }), /*#__PURE__*/React.createElement("div", { + className: "modula-item-content" + }, renderMedia(), settings.type !== 'slider' && /*#__PURE__*/React.createElement(components_ModulaGalleryImageInner, { + settings: settings, + img: img, + index: index, + hideTitle: effectCheck && effectCheck.title ? false : true, + hideDescription: effectCheck && effectCheck.description ? false : true, + hideSocial: effectCheck && effectCheck.social ? false : true, + effectCheck: effectCheck + }))); +}; +/* harmony default export */ const components_ModulaGalleryImage = (wp.components.withFilters('modula.ModulaGalleryImage')(ModulaGalleryImage)); +;// CONCATENATED MODULE: ./assets/src/js/components/ModulaStyle.js +var ModulaStyle = function ModulaStyle(props) { + var id = props.id, + settings = props.settings; + var style = ""; + if ('grid' == settings.type) { + if ('automatic' != settings.grid_type) { + style += "#jtg-".concat(id, ".modula-gallery .modula-item, .modula-gallery .modula-grid-sizer { width: calc(").concat(100 / settings.grid_type, "% - ").concat(settings.gutter - settings.gutter / settings.grid_type, "px) !important}"); + } + } + if ('0' != settings.borderSize) { + style += "#jtg-".concat(id, " .modula-item {\n\t\t\tborder: ").concat(settings.borderSize, "px solid ").concat(settings.borderColor, ";\n\t\t}"); + } + if ('0' != settings.borderRadius) { + style += "#jtg-".concat(id, " .modula-item {\n\t\t\tborder-radius: ").concat(settings.borderRadius, "px;\n\t\t}"); + } + if ('0' != settings.shadowSize) { + style += "#jtg-".concat(id, " .modula-item {\n\t\t\tbox-shadow: ").concat(settings.shadowColor, " 0px 0px ").concat(settings.shadowSize, "px;\n\t\t}"); + } + if ('#ffffff' != settings.socialIconColor) { + style += "#jtg-".concat(id, " .modula-item .jtg-social a {\n\t\t\tcolor: ").concat(settings.socialIconColor, ";\n\t\t}"); + } + if ('16' != settings.socialIconSize) { + style += "#jtg-".concat(id, " .modula-item .jtg-social svg {\n\t\t\theight: ").concat(settings.socialIconSize, "px;\n\t\t\twidth: ").concat(settings.socialIconSize, "px;\n\t\t}"); + } + if ('10' != settings.socialIconPadding) { + style += "#jtg-".concat(id, " .modula-item .jtg-social a:not(:last-child) {\n\t\t\tmargin-right: ").concat(settings.socialIconPadding, "px;\n\t\t}"); + } + style += "#jtg-".concat(id, " .modula-item .caption {\n\t\tbackground-color: ").concat(settings.captionColor, ";\n\t}"); + if ('' != settings.captionColor) { + style += "#jtg-".concat(id, " .modula-item .figc {\n\t\t\tcolor: ").concat(settings.captionColor, ";\n\t\t}"); + } + if ('' != settings.titleFontSize && '0' != settings.titleFontSize) { + style += "#jtg-".concat(id, " .modula-item .figc .jtg-title {\n\t\t\tfont-size: ").concat(settings.titleFontSize, "px;\n\t\t}"); + } + if ('' != settings.captionFontSize && '0' != settings.captionFontSize) { + style += "#jtg-".concat(id, " .modula-item .figc p.description {\n\t\t\tfont-size: ").concat(settings.captionFontSize, "px;\n\t\t}"); + } + style += "#jtg-".concat(id, " .modula-items .figc p.description {\n\t\t\tcolor: ").concat(settings.captionColor, ";\n\t}"); + if ('' != settings.titleColor) { + style += "#jtg-".concat(id, " .modula-items .figc .jtg-title {\n\t\t\tcolor: ").concat(settings.titleColor, ";\n\t\t}"); + } else { + style += "#jtg-".concat(id, " .modula-items .figc .jtg-title {\n\t\t\tcolor: ").concat(settings.captionColor, ";\n\t\t}"); + } + style += "#jtg-".concat(id, ".modula-gallery .modula-item > a, #jtg-").concat(id, ".modula-gallery .modula-item, #jtg-").concat(id, ".modula-gallery .modula-item-content > a:not(.modula-no-follow){\n\t\tcursor: ").concat(settings.cursor, ";\n\t}"); + + // SEE ABOUT LOADED EFFECT IF WE NEED TO ADD OR NOTTTTTTTTTTTTTT #REMINDER + + if ('custom-grid' != settings.type || 'slider' != settings.type) { + style += "#jtg-".concat(id, " {\n\t\twidth: ").concat(settings.width, ";\n\t\tmargin : 0 auto;\n\t\t}"); + if (props.imagesCount == 0) { + style += "#jtg-".concat(id, " .modula-items {\n\t\t\t\theight: 100px;\n\t\t\t}"); + } else { + if ('grid' != settings.type && 'slider' != settings.type) { + style += "#jtg-".concat(id, " .modula-items {\n\t\t\t\theight: ").concat(settings.height, "px;\n\t\t\t}"); + } else if ('slider' == settings.type) { + style += "#jtg-".concat(id, " .modula-items {\n\t\t\t\theight: auto;\n\t\t\t}"); + } + } + } + if (undefined != settings.style && 0 != settings.style.length) { + style += "".concat(settings.style); + } + + //RESPONSIVE FIXES + var mobileStyle = ""; + if ('' != settings.mobileTitleFontSize && 0 != settings.mobileTitleFontSize) { + mobileStyle += "#jtg-".concat(id, " .modula-item .figc .jtg-title {\n\t\t\tfont-size: ").concat(settings.mobileTitleFontSize, "px\n\t\t}"); + } + mobileStyle += "#jtg-".concat(id, " .modula-items .figc p.description {\n\t\tcolor: ").concat(settings.captionColor, ";\n\t\tfont-size: ").concat(settings.mobileCaptionFontSize, "px;\n\t}"); + style += "@media screen and (max-width:480px){\n\t\t".concat(mobileStyle, "\n\t\t}"); + if ('none' == settings.effect) { + style += "#jtg-".concat(id, " .modula-items .modula-item:hover img {\n\t\t\topacity: 1;\n\t\t}"); + } + style += "#jtg-".concat(id, ".modula .modula-items .modula-item .modula-item-overlay, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-layla, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-ruby, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-bubba, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-sarah, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-milo, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-julia, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-hera, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-winston, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-selena, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-terry, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-phoebe, #jtg-").concat(id, ".modula .modula-items} .modula-item.effect-apollo, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-steve, #jtg-").concat(id, ".modula .modula-items .modula-item.effect-ming{ \n\t\tbackground-color: ").concat(settings.hoverColor, ";\n\t}"); + style += "#jtg-".concat(id, ".modula .modula-items .modula-item.effect-oscar {\n\t\tbackground: -webkit-linear-gradient(45deg, ").concat(settings.hoverColor, " 0, #9b4a1b 40%, ").concat(settings.hoverColor, " 100%);\n\t\tbackground: linear-gradient(45deg, ").concat(settings.hoverColor, " 0, #9b4a1b 40%, ").concat(settings.hoverColor, " 100%);\n\t}"); + style += "#jtg-".concat(id, ".modula .modula-items .modula-item.effect-roxy {\n\t\tbackground: -webkit-linear-gradient(45deg, ").concat(settings.hoverColor, " 0, #05abe0 100%);\n\t\tbackground: linear-gradient(45deg, ").concat(settings.hoverColor, " 0, #05abe0 100%);\n\t}"); + style += "#jtg-".concat(id, ".modula .modula-items .modula-item.effect-dexter {\n\t\tbackground: -webkit-linear-gradient(top, ").concat(settings.hoverColor, " 0, rgba(104,60,19,1) 100%);\n\t\tbackground: linear-gradient(top, ").concat(settings.hoverColor, " 0, rgba(104,60,19,1) 100%);\n\t}"); + style += "#jtg-".concat(id, ".modula .modula-items .modula-item.effect-jazz {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(settings.hoverColor, " 0, #f33f58 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(settings.hoverColor, " 0, #f33f58 100%);\n\t}"); + style += "#jtg-".concat(id, ".modula .modula-items .modula-item.effect-lexi {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(settings.hoverColor, " 0, #fff 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(settings.hoverColor, " 0, #fff 100%);\n\t}"); + style += "#jtg-".concat(id, ".modula .modula-items .modula-item.effect-duke {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(settings.hoverColor, " 0, #cc6055 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(settings.hoverColor, " 0, #cc6055 100%);\n\t}"); + if (settings.hoverOpacity <= 100 && 'none' != settings.effect) { + style += "#jtg-".concat(id, ".modula .modula-items .modula-item:hover img {\n\t\t\topacity: ").concat(1 - settings.hoverOpacity / 100, " ;\n\t\t}"); + } + if ('default' != settings.titleFontWeight) { + style += "#jtg-".concat(id, ".modula .modula-items .modula-item .jtg-title {\n\t\t\tfont-weight : ").concat(settings.titleFontWeight, ";\n\t\t}"); + } + if ('default' != settings.captionFontWeight) { + style += "#jtg-".concat(id, ".modula .modula-items .modula-item p.description {\n\t\t\tfont-weight : ").concat(settings.captionFontWeight, ";\n\t\t}"); + } + style += "#jtg-".concat(id, ".modula-gallery .modula-item.effect-terry .jtg-social a:not(:last-child) {\n\t\tmargin-bottom: ").concat(settings.socialIconPadding, "px;\n\t}"); + if ('slider' == settings['type']) { + if ('true' == jQuery('[aria-label=Settings]').attr('aria-expanded')) { + style += "#jtg-".concat(id, " {\n\t\t\t\t\twidth: 800px;\n\t\t\t\t\t}"); + } else { + style += "#jtg-".concat(id, " {\n\t\t\twidth: 1100px;\n\t\t\t}"); + } + style += "#jtg-".concat(id, " .modula-items {\n\t\theight: auto;\n\t\t}"); + style += "#jtg-".concat(id, " .modula-item {\n\t\tbackground-color: transparent;\n\t\ttransform: none;\n\t\t}"); + } + if (undefined != settings['filters'] && settings['filters'].length > 1) { + style += "#jtg-".concat(id, ".modula-gallery .filters {\n\t\t\ttext-align: ").concat(settings['filterTextAlignment'], ";\n\t\t}"); + } + return /*#__PURE__*/React.createElement("style", { + dangerouslySetInnerHTML: { + __html: "\n \t\t\t\t".concat(style, "\n \t\t\t\t") + } + }); +}; +/* harmony default export */ const components_ModulaStyle = (ModulaStyle); +;// CONCATENATED MODULE: ./assets/src/js/components/ModulaItemsExtraComponent.js +var ModulaItemsExtraComponent = function ModulaItemsExtraComponent(props) { + return null; +}; +/* harmony default export */ const components_ModulaItemsExtraComponent = (wp.components.withFilters('modula.ModulaItemsExtraComponent')(ModulaItemsExtraComponent)); +;// CONCATENATED MODULE: ./assets/src/js/components/ModulaGallery.js +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +var _wp$element = wp.element, + ModulaGallery_Fragment = _wp$element.Fragment, + ModulaGallery_useEffect = _wp$element.useEffect, + useRef = _wp$element.useRef; + + + +var ModulaGallery = function ModulaGallery(props) { + var _props$attributes = props.attributes, + images = _props$attributes.images, + jsConfig = _props$attributes.jsConfig, + id = _props$attributes.id; + var settings = props.settings, + checkHoverEffect = props.checkHoverEffect, + modulaRun = props.modulaRun, + modulaCarouselRun = props.modulaCarouselRun; + var galleryRef = useRef(null); + ModulaGallery_useEffect(function () { + if (galleryRef.current) { + galleryRef.current = true; + return; + } + if (settings !== undefined) { + checkHoverEffect(settings.effect); + } + if ('slider' !== settings.type) { + modulaRun(jsConfig); + } else { + modulaCarouselRun(id); + } + }, []); + var galleryClassNames = 'modula modula-gallery '; + var itemsClassNames = 'modula-items'; + if (settings.type == 'creative-gallery') { + galleryClassNames += 'modula-creative-gallery'; + } else if (settings.type == 'custom-grid') { + galleryClassNames += 'modula-custom-grid'; + } else if (settings.type == 'slider') { + galleryClassNames = 'modula-slider'; + } else { + galleryClassNames += 'modula-columns'; + itemsClassNames += ' grid-gallery'; + if (settings.grid_type == 'automatic') { + itemsClassNames += ' justified-gallery'; + } + } + return [/*#__PURE__*/React.createElement(ModulaGallery_Fragment, null, /*#__PURE__*/React.createElement(components_ModulaStyle, { + id: id, + settings: settings + }), /*#__PURE__*/React.createElement("div", { + id: "jtg-".concat(id), + className: "".concat(galleryClassNames, " ").concat(props.attributes.modulaDivClassName != undefined ? props.attributes.modulaDivClassName : ''), + "data-config": JSON.stringify(jsConfig) + }, settings.type == 'grid' && 'automatic' != settings.grid_type && /*#__PURE__*/React.createElement("div", { + className: "modula-grid-sizer" + }, " "), /*#__PURE__*/React.createElement(components_ModulaItemsExtraComponent, _extends({}, props, { + position: 'top' + })), /*#__PURE__*/React.createElement("div", { + className: itemsClassNames + }, images.length > 0 && /*#__PURE__*/React.createElement(ModulaGallery_Fragment, null, /*#__PURE__*/React.createElement(ModulaGallery_Fragment, null, images.map(function (img, index) { + return /*#__PURE__*/React.createElement(components_ModulaGalleryImage, _extends({}, props, { + img: img, + key: img.id, + index: index + })); + })))), /*#__PURE__*/React.createElement(components_ModulaItemsExtraComponent, _extends({}, props, { + position: 'bottom' + }))))]; +}; +/* harmony default export */ const components_ModulaGallery = (wp.components.withFilters('modula.modulaGallery')(ModulaGallery)); +;// CONCATENATED MODULE: ./assets/src/js/components/edit.js +function edit_extends() { return edit_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, edit_extends.apply(null, arguments); } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +/** + * Internal dependencies + */ + + + + +/** + * WordPress dependencies + */ +var edit_ = wp.i18n.__; +var edit_wp$element = wp.element, + edit_Fragment = edit_wp$element.Fragment, + edit_useEffect = edit_wp$element.useEffect, + useState = edit_wp$element.useState; +var withSelect = wp.data.withSelect; +var edit_wp$components = wp.components, + edit_Button = edit_wp$components.Button, + Spinner = edit_wp$components.Spinner, + ToolbarGroup = edit_wp$components.ToolbarGroup, + ToolbarItem = edit_wp$components.ToolbarItem; +var BlockControls = wp.blockEditor.BlockControls; +var compose = wp.compose.compose; +var ModulaEdit = function ModulaEdit(props) { + var attributes = props.attributes, + galleries = props.galleries, + setAttributes = props.setAttributes; + var id = attributes.id, + images = attributes.images, + status = attributes.status, + settings = attributes.settings, + jsConfig = attributes.jsConfig, + galleryId = attributes.galleryId, + currentGallery = attributes.currentGallery, + currentSelectize = attributes.currentSelectize; + + // Check when the alignmnent is changed so we can resize the instance + var _useState = useState(props.attributes.align), + _useState2 = _slicedToArray(_useState, 2), + alignmentCheck = _useState2[0], + setAlignment = _useState2[1]; + + // Check when id is changed and it is not a component rerender . Saves unnecessary fetch requests + var _useState3 = useState(id), + _useState4 = _slicedToArray(_useState3, 2), + idCheck = _useState4[0], + setIdCheck = _useState4[1]; + edit_useEffect(function () { + if (id !== 0) { + _onIdChange(id); + } + }, []); + edit_useEffect(function () { + //Grab the instance and set it as atribute to access it when we want + jQuery(document).on('modula_api_after_init', function (event, inst) { + props.setAttributes({ + instance: inst + }); + }); + if (props.attributes.instance != undefined && settings != undefined && settings.type == 'grid') { + props.attributes.instance.reset(props.attributes.instance); + } + }); + var _onIdChange = function onIdChange(id) { + if (isNaN(id) || '' == id) { + return; + } + id = parseInt(id); + wp.apiFetch({ + path: "wp/v2/modula-gallery/".concat(id) + }).then(function (res) { + setAttributes({ + currentGallery: res + }); + setAttributes({ + currentSelectize: [{ + value: id, + label: '' === res.title.rendered ? "Unnamed" : escapeHtml(res.title.rendered) + }] + }); + jQuery.ajax({ + type: 'POST', + data: { + action: 'modula_get_gallery_meta', + id: id, + nonce: modulaVars.nonce + }, + url: modulaVars.ajaxURL, + success: function success(result) { + return onGalleryLoaded(id, result); + } + }); + }); + }; + function escapeHtml(text) { + return text.replace('’', "'").replace('“', '"').replace('‘', "'"); + } + var onGalleryLoaded = function onGalleryLoaded(id, result) { + if (result.success === false) { + setAttributes({ + id: id, + status: 'ready' + }); + return; + } + if (idCheck != id || undefined == settings) { + getSettings(id); + } + setAttributes({ + id: id, + images: result, + status: 'ready' + }); + }; + var getSettings = function getSettings(id) { + fetch("".concat(modulaVars.restURL, "wp/v2/modula-gallery/").concat(id)).then(function (res) { + return res.json(); + }).then(function (result) { + var settings = result; + setAttributes({ + status: 'loading' + }); + jQuery.ajax({ + type: 'POST', + data: { + action: 'modula_get_jsconfig', + nonce: modulaVars.nonce, + settings: settings.modulaSettings + }, + url: modulaVars.ajaxURL, + success: function success(result) { + var galleryId = Math.floor(Math.random() * 999); + setAttributes({ + galleryId: galleryId, + settings: settings.modulaSettings, + jsConfig: result, + status: 'ready' + }); + } + }); + }); + }; + var modulaRun = function modulaRun(checker) { + if (checker != undefined) { + setAttributes({ + status: 'ready' + }); + var modulaGalleries = jQuery('.modula.modula-gallery'); + jQuery.each(modulaGalleries, function () { + var modulaID = jQuery(this).attr('id'), + modulaSettings = jQuery(this).data('config'); + modulaSettings.lazyLoad = 0; + jQuery(this).modulaGallery(modulaSettings); + }); + } + }; + var modulaCarouselRun = function modulaCarouselRun(id) { + id = "jtg-".concat(id); + setAttributes({ + status: 'ready' + }); + var modulaSliders = jQuery('.modula-slider'); + if (modulaSliders.length > 0 && 'function' == typeof ModulaCarousel) { + var config = jQuery("#".concat(id)).data('config'), + main = jQuery("#".concat(id)).find('.modula-items'); + new ModulaCarousel(main[0], config.slider_settings); + } else if (modulaSliders.length > 0 && 'undefined' != typeof jQuery.fn.slick) { + var _config = jQuery("#".concat(id)).data('config'), + _main = jQuery("#".concat(id)).find('.modula-items'); + _main.slick(_config.slider_settings); + } + }; + var checkHoverEffect = function checkHoverEffect(effect) { + jQuery.ajax({ + type: 'POST', + data: { + action: 'modula_check_hover_effect', + nonce: modulaVars.nonce, + effect: effect + }, + url: modulaVars.ajaxURL, + success: function success(result) { + setAttributes({ + effectCheck: result + }); + } + }); + }; + var selectOptions = function selectOptions() { + var options = [{ + value: 0, + label: edit_('select a gallery', 'modula-best-grid-gallery') + }]; + galleries.forEach(function (_ref) { + var title = _ref.title, + id = _ref.id; + if (title.rendered.length == 0) { + options.push({ + value: id, + label: edit_('Unnamed Gallery', 'modula-best-grid-gallery') + id + }); + } else { + options.push({ + value: id, + label: title.rendered + }); + } + }); + return options; + }; + var blockControls = /*#__PURE__*/React.createElement(BlockControls, null, images && images.length > 0 && /*#__PURE__*/React.createElement(ToolbarGroup, null, /*#__PURE__*/React.createElement(ToolbarItem, null, /*#__PURE__*/React.createElement(edit_Button, { + label: edit_('Edit gallery', 'modula-best-grid-gallery'), + icon: "edit", + href: modulaVars.adminURL + 'post.php?post=' + id + '&action=edit', + target: "_blank" + })))); + if (id == 0 && 'none' === attributes.galleryType) { + return /*#__PURE__*/React.createElement(edit_Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview" + }, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview__content" + }, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview__logo" + }), /*#__PURE__*/React.createElement("div", { + className: "modula-button-group" + }, galleries.length == 0 && /*#__PURE__*/React.createElement("p", null, ' ', edit_('Sorry no galleries found', 'modula-best-grid-gallery'), ' '), galleries.length > 0 && /*#__PURE__*/React.createElement(edit_Button, { + className: "modula-button", + target: "_blank", + onClick: function onClick(e) { + setAttributes({ + status: 'ready', + id: 0, + galleryType: 'gallery' + }); + } + }, edit_('Display An Existing Gallery', 'modula-best-grid-gallery'), utils_icons.chevronRightFancy), undefined == props.attributes.proInstalled && galleries.length > 0 && /*#__PURE__*/React.createElement(edit_Button, { + href: "https://wp-modula.com/pricing/?utm_source=modula-lite&utm_campaign=upsell", + className: "modula-button-upsell", + isSecondary: true, + target: "_blank" + }, edit_('Upgrade to PRO to create galleries using a preset ( fastest way )', 'modula-best-grid-gallery')))))); + } + if (status === 'loading') { + return /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview" + }, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview__content" + }, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview__logo" + }), /*#__PURE__*/React.createElement(Spinner, null))); + } + if (id == 0 || images.length === 0) { + return /*#__PURE__*/React.createElement(edit_Fragment, { + key: "233" + }, /*#__PURE__*/React.createElement(inspector, edit_extends({ + onIdChange: function onIdChange(id) { + return _onIdChange(id); + }, + selectOptions: selectOptions + }, props)), /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview" + }, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview__content" + }, /*#__PURE__*/React.createElement("div", { + className: "modula-block-preview__logo" + }), galleries.length > 0 && /*#__PURE__*/React.createElement(edit_Fragment, null, /*#__PURE__*/React.createElement(components_ModulaGallerySearch, { + id: id, + key: id, + value: id, + options: currentSelectize, + onIdChange: _onIdChange, + galleries: galleries + }), id != 0 && /*#__PURE__*/React.createElement(edit_Button, { + target: "_blank", + href: modulaVars.adminURL + 'post.php?post=' + id + '&action=edit', + isPrimary: true + }, edit_('Edit Gallery')))))); + } + if (settings) { + return /*#__PURE__*/React.createElement(edit_Fragment, { + key: "1" + }, blockControls, /*#__PURE__*/React.createElement(inspector, edit_extends({ + onIdChange: function onIdChange(id) { + _onIdChange(id); + } + }, props)), /*#__PURE__*/React.createElement(components_ModulaGallery, edit_extends({}, props, { + settings: settings, + jsConfig: jsConfig, + modulaRun: modulaRun, + modulaCarouselRun: modulaCarouselRun, + checkHoverEffect: checkHoverEffect, + galleryId: galleryId + }))); + } + return null; +}; +var applyWithSelect = withSelect(function (select, props) { + var _select = select('core'), + getEntityRecords = _select.getEntityRecords; + var query = { + post_status: 'publish', + per_page: 5 + }; + return { + galleries: getEntityRecords('postType', 'modula-gallery', query) || [] + }; +}); +var applyWithFilters = wp.components.withFilters('modula.ModulaEdit'); +/* harmony default export */ const edit = (compose(applyWithSelect, applyWithFilters)(ModulaEdit)); +;// CONCATENATED MODULE: ./assets/src/js/wp-modula-gutenberg.js +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +/** + * Internal dependencies + */ + + +// import style from '../scss/modula-gutenberg.scss'; + +/** + * WordPress dependencies + */ +var wp_modula_gutenberg_ = wp.i18n.__; +var registerBlockType = wp.blocks.registerBlockType; +var ModulaGutenberg = /*#__PURE__*/function () { + function ModulaGutenberg() { + _classCallCheck(this, ModulaGutenberg); + this.registerBlock(); + } + return _createClass(ModulaGutenberg, [{ + key: "registerBlock", + value: function registerBlock() { + this.blockName = 'modula/gallery'; + this.blockAttributes = { + id: { + type: 'number', + "default": 0 + }, + images: { + type: 'array', + "default": [] + }, + status: { + type: 'string', + "default": 'ready' + }, + galleryId: { + type: 'number', + "default": 0 + }, + defaultSettings: { + type: 'object', + "default": [] + }, + galleryType: { + type: 'string', + "default": 'none' + }, + // Attribute for current gallery + currentGallery: { + type: 'object', + "default": {} + }, + // Attribute for current gallery option in selectize + currentSelectize: { + type: 'array', + "default": [] + } + }; + registerBlockType(this.blockName, { + title: modulaVars.gutenbergTitle, + icon: utils_icons.modula, + description: wp_modula_gutenberg_('Make your galleries stand out.', 'modula-best-grid-gallery'), + keywords: [wp_modula_gutenberg_('gallery'), wp_modula_gutenberg_('modula'), wp_modula_gutenberg_('images')], + category: 'common', + supports: { + align: true, + customClassName: false + }, + attributes: this.blockAttributes, + // getEditWrapperProps() { + // return { + // 'data-align': 'full' + // }; + // }, + edit: edit, + save: function save() { + // Rendering in PHP + return null; + } + }); + } + }]); +}(); +var modulaGutenberg = new ModulaGutenberg(); +/******/ })() +; \ No newline at end of file diff --git a/assets/js/admin/wp-modula-gutenberg.min.js b/assets/js/admin/wp-modula-gutenberg.min.js index 7bae7384..6e837dc8 100644 --- a/assets/js/admin/wp-modula-gutenberg.min.js +++ b/assets/js/admin/wp-modula-gutenberg.min.js @@ -1 +1 @@ -!function(t){var e={};function a(n){if(e[n])return e[n].exports;var l=e[n]={i:n,l:!1,exports:{}};return t[n].call(l.exports,l,l.exports,a),l.l=!0,l.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var l in t)a.d(n,l,function(e){return t[e]}.bind(null,l));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=0)}([function(t,e,a){"use strict";a.r(e);var n=wp.element.useEffect,l=function(t){var e=t.onIdChange,a=t.id,l=t.options,o=t.galleries;return n((function(){var t=[];null!=o&&0==t.length&&o.forEach((function(e){t.push({value:e.id,label:e.title.rendered})})),jQuery(".modula-gallery-input").selectize({valueField:"value",labelField:"label",searchField:["label","value"],create:!1,maxItems:1,placeholder:"Search for a gallery...",preload:!0,allowEmptyOptions:!0,closeAfterSelect:!0,options:l.concat(t),render:{option:function(t,e){return'
'+t.label+' (#'+e(t.value)+")
"}},load:function(t,e){if(!t.length)return e();jQuery.ajax({url:modulaVars.ajaxURL,type:"GET",data:{action:"modula_get_gallery",nonce:modulaVars.nonce,term:t},success:function(t){e(t)}})},onChange:function(t){e(t)}})}),[]),React.createElement("input",{className:"modula-gallery-input",defaultValue:"0"==a?"":a})},o=wp.i18n.__,c=wp.element.Fragment,i=wp.blockEditor.InspectorControls,r=wp.components,d=r.Button,s=r.PanelBody,u=wp.components.withFilters("modula.ModulaInspector")((function(t){var e=t.attributes,a=t.galleries,n=t.onIdChange,r=e.id,u=e.currentSelectize;return React.createElement(c,null,React.createElement(i,null,React.createElement(s,{title:o("Gallery Settings","modula-best-grid-gallery"),initialOpen:!0},a.length>0&&React.createElement(c,null,React.createElement(l,{id:r,key:r,value:r,options:u,onIdChange:n,galleries:a}),0!=r&&React.createElement(d,{target:"_blank",href:modulaVars.adminURL+"post.php?post="+r+"&action=edit",isSecondary:!0},o("Edit gallery"))))))})),m={};m.modula=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"364 242.9 312.2 357"},React.createElement("g",null,React.createElement("path",{d:"M528.1,242.9c8.5,16.9,17,33.8,25.6,50.6c13.4,26.4,26.9,52.7,39.9,79.7c-41.8-23.3-83.6-46.7-125.4-70.1 c0.3-1.9,1.7-2.6,2.7-3.5c17.7-17.7,35.4-35.4,53.1-53c1.1-1.1,2.6-2,3.1-3.7C527.4,242.9,527.8,242.9,528.1,242.9z"}),React.createElement("path",{d:"M602.3,463.3c11.3-6.9,22.6-13.9,33.9-20.8c5.5-3.4,11.1-6.7,16.5-10.3c2.2-1.4,2.9-1.1,3.5,1.5 c6.4,25.3,13,50.6,19.6,75.8c0.6,2.2,1,3.7-2.4,3.5c-46.7-2.1-93.5-4.1-140.2-6.1c-0.2,0-0.3-0.1-0.5-0.2c0.5-1.7,2.1-2,3.3-2.7 c20-12.3,39.9-24.7,60-36.8c3.4-2.1,5.1-3.7,4.8-8.5c-1.4-21.3-1.8-42.6-2.6-63.9c-0.9-24.1-1.8-48.3-2.8-72.4 c-0.2-6.1-0.2-6.1,5.5-4.6c23.8,6.2,47.6,12.5,71.5,18.5c3.9,1,4.2,1.9,2.1,5.4c-23.4,38.5-46.7,77.1-70,115.7c-1,1.7-2,3.4-3,5.1 C601.7,462.8,602,463,602.3,463.3z"}),React.createElement("path",{d:"M372.8,326.9c48,2.6,95.8,5.1,143.9,7.7c-0.9,2-2.5,2.3-3.7,3.1c-38.6,23.2-77.3,46.4-115.9,69.6c-3,1.8-4.3,2.6-5.4-1.9 c-5.9-24.9-12.2-49.7-18.3-74.6C373.1,329.6,373,328.4,372.8,326.9z"}),React.createElement("path",{d:"M517.6,599.9c-23.2-43.7-45.9-86.6-69.2-130.5c2.3,1.2,3.5,1.8,4.7,2.4c39.8,21.5,79.5,43.1,119.3,64.5 c3.2,1.7,4.1,2.5,1,5.6c-17.7,17.8-35.2,35.9-52.8,53.9C519.7,596.9,518.9,598.2,517.6,599.9z"}),React.createElement("path",{d:"M364.9,505.1c26.6-40.5,53.1-80.8,79.7-121.3c1.3,1.3,0.9,2.5,0.9,3.6c0,46-0.1,92-0.1,137.9c0,3.1-0.2,4.5-4,3.3 c-24.9-7.7-49.9-15.2-74.9-22.8C366,505.8,365.7,505.5,364.9,505.1z"}))),m.remove=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})),m.replace=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),m.chevronLeft=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),m.chevronRight=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),m.twitter=React.createElement("svg",{"aria-hidden":"true","data-prefix":"fab","data-icon":"twitter",className:"svg-inline--fa fa-twitter fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{fill:"currentColor",d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})),m.facebook=React.createElement("svg",{"aria-hidden":"true","data-prefix":"fab","data-icon":"facebook-f",className:"svg-inline--fa fa-facebook-f fa-w-9",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 264 512"},React.createElement("path",{fill:"currentColor",d:"M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"})),m.whatsapp=React.createElement("svg",{"aria-hidden":"true",focusable:"false",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 1536 1600"},React.createElement("path",{d:"M985 878q13 0 97.5 44t89.5 53q2 5 2 15q0 33-17 76q-16 39-71 65.5T984 1158q-57 0-190-62q-98-45-170-118T476 793q-72-107-71-194v-8q3-91 74-158q24-22 52-22q6 0 18 1.5t19 1.5q19 0 26.5 6.5T610 448q8 20 33 88t25 75q0 21-34.5 57.5T599 715q0 7 5 15q34 73 102 137q56 53 151 101q12 7 22 7q15 0 54-48.5t52-48.5zm-203 530q127 0 243.5-50t200.5-134t134-200.5t50-243.5t-50-243.5T1226 336t-200.5-134T782 152t-243.5 50T338 336T204 536.5T154 780q0 203 120 368l-79 233l242-77q158 104 345 104zm0-1382q153 0 292.5 60T1315 247t161 240.5t60 292.5t-60 292.5t-161 240.5t-240.5 161t-292.5 60q-195 0-365-94L0 1574l136-405Q28 991 28 780q0-153 60-292.5T249 247T489.5 86T782 26z",fill:"currentColor"})),m.pinterest=React.createElement("svg",{"aria-hidden":"true","data-prefix":"fab","data-icon":"pinterest-p",className:"svg-inline--fa fa-pinterest-p fa-w-12",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},React.createElement("path",{fill:"currentColor",d:"M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z"})),m.linkedin=React.createElement("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"linkedin-in",className:"svg-inline--fa fa-linkedin-in fa-w-14",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},React.createElement("path",{fill:"currentColor",d:"M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"})),m.email=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("path",{d:"M0 3v18h24v-18h-24zm6.623 7.929l-4.623 5.712v-9.458l4.623 3.746zm-4.141-5.929h19.035l-9.517 7.713-9.518-7.713zm5.694 7.188l3.824 3.099 3.83-3.104 5.612 6.817h-18.779l5.513-6.812zm9.208-1.264l4.616-3.741v9.348l-4.616-5.607z",fill:"currentColor"})),m.chevronRightFancy=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"bi bi-chevron-right",viewBox:"0 0 16 16"},React.createElement("path",{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"}));var g=m,f=wp.element.Fragment,p=function(t){var e=t.settings,a=t.img,n=t.hideTitle,l=t.hideDescription,o=t.hideSocial;return[React.createElement(f,null,["tilt_1","tilt_3","tilt_7"].includes(e.effect)&&React.createElement("div",{className:"tilter__deco tilter__deco--shine"},React.createElement("div",null)),["tilt_3","tilt_7"].includes(e.effect)&&React.createElement("div",{className:"tilter__deco tilter__deco--overlay"}),["tilt_1","tilt_7"].includes(e.effect)&&React.createElement("div",{className:"tilter__deco tilter__deco--lines"}),React.createElement("div",{className:"figc"},React.createElement("div",{className:"figc-inner"},"0"==e.hide_title&&!n&&React.createElement("div",{className:"jtg-title"}," ",a.title," "),React.createElement("div",{className:["lily","centered-bottom","sadie","ruby","bubba","dexter","chico","ming"].includes(e.effect)?"jtg-body":""},"0"==e.hide_description&&!l&&React.createElement("p",{className:"description"}," ",0!=a.description.length&&a.description," "),!o&&"1"==e.enableSocial&&React.createElement("div",{className:"jtg-social"},"1"==e.enableTwitter&&React.createElement("a",{className:"modula-icon-twitter",href:"#"}," ","$",g.twitter," "),"1"==e.enableFacebook&&React.createElement("a",{className:"modula-icon-facebook",href:"#"}," ","$",g.facebook," "),"1"==e.enableWhatsapp&&React.createElement("a",{className:"modula-icon-whatsapp",href:"#"}," ","$",g.whatsapp," "),"1"==e.enableLinkedin&&React.createElement("a",{className:"modula-icon-linkedin",href:"#"}," ","$",g.linkedin," "),"1"==e.enablePinterest&&React.createElement("a",{className:"modula-icon-pinterest",href:"#"}," ","$",g.pinterest," "),"1"==e.enableEmail&&React.createElement("a",{className:"modula-icon-email",href:"#"}," ","$",g.email," "))))))]},h=wp.components.withFilters("modula.ModulaGalleryImage")((function(t){var e=t.attributes,a=e.settings,n=e.effectCheck,l=t.img,o=t.index;return[React.createElement("div",{className:"modula-item effect-".concat(a.effect),"data-width":l["data-width"]?l["data-width"]:"2","data-height":l["data-height"]?l["data-height"]:"2"},React.createElement("div",{className:"modula-item-overlay"}),React.createElement("div",{className:"modula-item-content"},React.createElement("img",{className:"modula-image pic","data-id":l.id,"data-full":l.src,"data-src":l.src,"data-valign":"middle","data-halign":"center",src:l.src}),"slider"!==a.type&&React.createElement(p,{settings:a,img:l,index:o,hideTitle:null==n||1!=n.title,hideDescription:null==n||1!=n.description,hideSocial:null==n||1!=n.social,effectCheck:n})))]})),v=function(t){var e=t.id,a=t.settings,n="";"grid"==a.type&&"automatic"!=a.grid_type&&(n+="#jtg-".concat(e,".modula-gallery .modula-item, .modula-gallery .modula-grid-sizer { width: calc(").concat(100/a.grid_type,"% - ").concat(a.gutter-a.gutter/a.grid_type,"px) !important}")),"0"!=a.borderSize&&(n+="#jtg-".concat(e," .modula-item {\n\t\t\tborder: ").concat(a.borderSize,"px solid ").concat(a.borderColor,";\n\t\t}")),"0"!=a.borderRadius&&(n+="#jtg-".concat(e," .modula-item {\n\t\t\tborder-radius: ").concat(a.borderRadius,"px;\n\t\t}")),"0"!=a.shadowSize&&(n+="#jtg-".concat(e," .modula-item {\n\t\t\tbox-shadow: ").concat(a.shadowColor," 0px 0px ").concat(a.shadowSize,"px;\n\t\t}")),"#ffffff"!=a.socialIconColor&&(n+="#jtg-".concat(e," .modula-item .jtg-social a {\n\t\t\tcolor: ").concat(a.socialIconColor,";\n\t\t}")),"16"!=a.socialIconSize&&(n+="#jtg-".concat(e," .modula-item .jtg-social svg {\n\t\t\theight: ").concat(a.socialIconSize,"px;\n\t\t\twidth: ").concat(a.socialIconSize,"px;\n\t\t}")),"10"!=a.socialIconPadding&&(n+="#jtg-".concat(e," .modula-item .jtg-social a:not(:last-child) {\n\t\t\tmargin-right: ").concat(a.socialIconPadding,"px;\n\t\t}")),n+="#jtg-".concat(e," .modula-item .caption {\n\t\tbackground-color: ").concat(a.captionColor,";\n\t}"),""!=a.captionColor&&(n+="#jtg-".concat(e," .modula-item .figc {\n\t\t\tcolor: ").concat(a.captionColor,";\n\t\t}")),""!=a.titleFontSize&&"0"!=a.titleFontSize&&(n+="#jtg-".concat(e," .modula-item .figc .jtg-title {\n\t\t\tfont-size: ").concat(a.titleFontSize,"px;\n\t\t}")),""!=a.captionFontSize&&"0"!=a.captionFontSize&&(n+="#jtg-".concat(e," .modula-item .figc p.description {\n\t\t\tfont-size: ").concat(a.captionFontSize,"px;\n\t\t}")),n+="#jtg-".concat(e," .modula-items .figc p.description {\n\t\t\tcolor: ").concat(a.captionColor,";\n\t}"),""!=a.titleColor?n+="#jtg-".concat(e," .modula-items .figc .jtg-title {\n\t\t\tcolor: ").concat(a.titleColor,";\n\t\t}"):n+="#jtg-".concat(e," .modula-items .figc .jtg-title {\n\t\t\tcolor: ").concat(a.captionColor,";\n\t\t}"),n+="#jtg-".concat(e,".modula-gallery .modula-item > a, #jtg-").concat(e,".modula-gallery .modula-item, #jtg-").concat(e,".modula-gallery .modula-item-content > a:not(.modula-no-follow){\n\t\tcursor: ").concat(a.cursor,";\n\t}"),"custom-grid"==a.type&&"slider"==a.type||(n+="#jtg-".concat(e," {\n\t\twidth: ").concat(a.width,";\n\t\tmargin : 0 auto;\n\t\t}"),0==t.imagesCount?n+="#jtg-".concat(e," .modula-items {\n\t\t\t\theight: 100px;\n\t\t\t}"):"grid"!=a.type&&"slider"!=a.type?n+="#jtg-".concat(e," .modula-items {\n\t\t\t\theight: ").concat(a.height,"px;\n\t\t\t}"):"slider"==a.type&&(n+="#jtg-".concat(e," .modula-items {\n\t\t\t\theight: auto;\n\t\t\t}"))),null!=a.style&&0!=a.style.length&&(n+="".concat(a.style));var l="";return""!=a.mobileTitleFontSize&&0!=a.mobileTitleFontSize&&(l+="#jtg-".concat(e," .modula-item .figc .jtg-title {\n\t\t\tfont-size: ").concat(a.mobileTitleFontSize,"px\n\t\t}")),l+="#jtg-".concat(e," .modula-items .figc p.description {\n\t\tcolor: ").concat(a.captionColor,";\n\t\tfont-size: ").concat(a.mobileCaptionFontSize,"px;\n\t}"),n+="@media screen and (max-width:480px){\n\t\t".concat(l,"\n\t\t}"),"none"==a.effect&&(n+="#jtg-".concat(e," .modula-items .modula-item:hover img {\n\t\t\topacity: 1;\n\t\t}")),n+="#jtg-".concat(e,".modula .modula-items .modula-item .modula-item-overlay, #jtg-").concat(e,".modula .modula-items .modula-item.effect-layla, #jtg-").concat(e,".modula .modula-items .modula-item.effect-ruby, #jtg-").concat(e,".modula .modula-items .modula-item.effect-bubba, #jtg-").concat(e,".modula .modula-items .modula-item.effect-sarah, #jtg-").concat(e,".modula .modula-items .modula-item.effect-milo, #jtg-").concat(e,".modula .modula-items .modula-item.effect-julia, #jtg-").concat(e,".modula .modula-items .modula-item.effect-hera, #jtg-").concat(e,".modula .modula-items .modula-item.effect-winston, #jtg-").concat(e,".modula .modula-items .modula-item.effect-selena, #jtg-").concat(e,".modula .modula-items .modula-item.effect-terry, #jtg-").concat(e,".modula .modula-items .modula-item.effect-phoebe, #jtg-").concat(e,".modula .modula-items} .modula-item.effect-apollo, #jtg-").concat(e,".modula .modula-items .modula-item.effect-steve, #jtg-").concat(e,".modula .modula-items .modula-item.effect-ming{ \n\t\tbackground-color: ").concat(a.hoverColor,";\n\t}"),n+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-oscar {\n\t\tbackground: -webkit-linear-gradient(45deg, ").concat(a.hoverColor," 0, #9b4a1b 40%, ").concat(a.hoverColor," 100%);\n\t\tbackground: linear-gradient(45deg, ").concat(a.hoverColor," 0, #9b4a1b 40%, ").concat(a.hoverColor," 100%);\n\t}"),n+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-roxy {\n\t\tbackground: -webkit-linear-gradient(45deg, ").concat(a.hoverColor," 0, #05abe0 100%);\n\t\tbackground: linear-gradient(45deg, ").concat(a.hoverColor," 0, #05abe0 100%);\n\t}"),n+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-dexter {\n\t\tbackground: -webkit-linear-gradient(top, ").concat(a.hoverColor," 0, rgba(104,60,19,1) 100%);\n\t\tbackground: linear-gradient(top, ").concat(a.hoverColor," 0, rgba(104,60,19,1) 100%);\n\t}"),n+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-jazz {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(a.hoverColor," 0, #f33f58 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(a.hoverColor," 0, #f33f58 100%);\n\t}"),n+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-lexi {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(a.hoverColor," 0, #fff 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(a.hoverColor," 0, #fff 100%);\n\t}"),n+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-duke {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(a.hoverColor," 0, #cc6055 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(a.hoverColor," 0, #cc6055 100%);\n\t}"),a.hoverOpacity<=100&&"none"!=a.effect&&(n+="#jtg-".concat(e,".modula .modula-items .modula-item:hover img {\n\t\t\topacity: ").concat(1-a.hoverOpacity/100," ;\n\t\t}")),"default"!=a.titleFontWeight&&(n+="#jtg-".concat(e,".modula .modula-items .modula-item .jtg-title {\n\t\t\tfont-weight : ").concat(a.titleFontWeight,";\n\t\t}")),"default"!=a.captionFontWeight&&(n+="#jtg-".concat(e,".modula .modula-items .modula-item p.description {\n\t\t\tfont-weight : ").concat(a.captionFontWeight,";\n\t\t}")),n+="#jtg-".concat(e,".modula-gallery .modula-item.effect-terry .jtg-social a:not(:last-child) {\n\t\tmargin-bottom: ").concat(a.socialIconPadding,"px;\n\t}"),"slider"==a.type&&("true"==jQuery("[aria-label=Settings]").attr("aria-expanded")?n+="#jtg-".concat(e," {\n\t\t\t\t\twidth: 800px;\n\t\t\t\t\t}"):n+="#jtg-".concat(e," {\n\t\t\twidth: 1100px;\n\t\t\t}"),n+="#jtg-".concat(e," .modula-items {\n\t\theight: auto;\n\t\t}"),n+="#jtg-".concat(e," .modula-item {\n\t\tbackground-color: transparent;\n\t\ttransform: none;\n\t\t}")),null!=a.filters&&a.filters.length>1&&(n+="#jtg-".concat(e,".modula-gallery .filters {\n\t\t\ttext-align: ").concat(a.filterTextAlignment,";\n\t\t}")),React.createElement("style",{dangerouslySetInnerHTML:{__html:"\n \t\t\t\t".concat(n,"\n \t\t\t\t")}})},y=wp.components.withFilters("modula.ModulaItemsExtraComponent")((function(t){return null}));function b(){return(b=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&React.createElement(j,null,React.createElement(j,null,a.map((function(e,a){return[React.createElement(h,b({},t,{img:e,key:a,index:a}))]}))))),React.createElement(y,b({},t,{position:"bottom"}))))]}));function k(){return(k=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var a=0,n=new Array(e);a0&&React.createElement(q,null,React.createElement(V,null,React.createElement(I,{label:C("Edit gallery","modula-best-grid-gallery"),icon:"edit",href:modulaVars.adminURL+"post.php?post="+o+"&action=edit",target:"_blank"}))));return 0==o&&"none"===e.galleryType?React.createElement(S,null,React.createElement("div",{className:"modula-block-preview"},React.createElement("div",{className:"modula-block-preview__content"},React.createElement("div",{className:"modula-block-preview__logo"}),React.createElement("div",{className:"modula-button-group"},0==a.length&&React.createElement("p",null," ",C("Sorry no galleries found","modula-best-grid-gallery")," "),a.length>0&&React.createElement(I,{className:"modula-button",target:"_blank",onClick:function(t){n({status:"ready",id:0,galleryType:"gallery"})}},C("Display An Existing Gallery","modula-best-grid-gallery"),g.chevronRightFancy),null==t.attributes.proInstalled&&a.length>0&&React.createElement(I,{href:"https://wp-modula.com/pricing/?utm_source=modula-lite&utm_campaign=upsell",className:"modula-button-upsell",isSecondary:!0,target:"_blank"},C("Upgrade to PRO to create galleries using a preset ( fastest way )","modula-best-grid-gallery")))))):"loading"===i?React.createElement("div",{className:"modula-block-preview"},React.createElement("div",{className:"modula-block-preview__content"},React.createElement("div",{className:"modula-block-preview__logo"}),React.createElement(O,null))):0==o||0===c.length?React.createElement(S,{key:"233"},React.createElement(u,k({onIdChange:function(t){return v(t)},selectOptions:function(){var t=[{value:0,label:C("select a gallery","modula-best-grid-gallery")}];return a.forEach((function(e){var a=e.title,n=e.id;0==a.rendered.length?t.push({value:n,label:C("Unnamed Gallery","modula-best-grid-gallery")+n}):t.push({value:n,label:a.rendered})})),t}},t)),React.createElement("div",{className:"modula-block-preview"},React.createElement("div",{className:"modula-block-preview__content"},React.createElement("div",{className:"modula-block-preview__logo"}),a.length>0&&React.createElement(S,null,React.createElement(l,{id:o,key:o,value:o,options:m,onIdChange:v,galleries:a}),0!=o&&React.createElement(I,{target:"_blank",href:modulaVars.adminURL+"post.php?post="+o+"&action=edit",isPrimary:!0},C("Edit Gallery")))))):r?React.createElement(S,{key:"1"},w,React.createElement(u,k({onIdChange:function(t){v(t)}},t)),React.createElement(R,k({},t,{settings:r,jsConfig:d,modulaRun:function(t){if(null!=t){n({status:"ready"});var e=jQuery(".modula.modula-gallery");jQuery.each(e,(function(){jQuery(this).attr("id");var t=jQuery(this).data("config");t.lazyLoad=0,jQuery(this).modulaGallery(t)}))}},modulaSlickRun:function(t){if(t="jtg-".concat(t),n({status:"ready"}),jQuery(".modula-slider").length>0&&void 0!==jQuery.fn.slick){var e=jQuery("#".concat(t)).data("config"),a=jQuery("#".concat(t)).find(".modula-slider-nav"),l=jQuery("#".concat(t)).find(".modula-items");if(l.slick(e.slider_settings),a.length){var o=a.data("config"),c=l.slick("slickCurrentSlide");a.on("init",(function(t,e){a.find('.slick-slide[data-slick-index="'+c+'"]').addClass("is-active")})),a.slick(o),l.on("afterChange",(function(t,e,n){a.slick("slickGoTo",n);var l='.slick-slide[data-slick-index="'+n+'"]';a.find(".slick-slide.is-active").removeClass("is-active"),a.find(l).addClass("is-active")})),a.on("click",".slick-slide",(function(t){t.preventDefault();var e=jQuery(this).data("slick-index");l.slick("slickGoTo",e)}))}}},checkHoverEffect:function(t){jQuery.ajax({type:"POST",data:{action:"modula_check_hover_effect",nonce:modulaVars.nonce,effect:t},url:modulaVars.ajaxURL,success:function(t){n({effectCheck:t})}})},galleryId:s}))):null}));function P(t,e){for(var a=0;a{"use strict";var t=wp.element.useEffect;const e=function(e){var a=e.onIdChange,l=e.id,n=e.options,o=e.galleries;return t((function(){var t=[];null!=o&&0==t.length&&o.forEach((function(e){t.push({value:e.id,label:e.title.rendered})})),jQuery(".modula-gallery-input").selectize({valueField:"value",labelField:"label",searchField:["label","value"],create:!1,maxItems:1,placeholder:"Search for a gallery...",preload:!0,allowEmptyOptions:!0,closeAfterSelect:!0,options:n.concat(t),render:{option:function(t,e){return'
'+t.label+' (#'+e(t.value)+")
"}},load:function(t,e){if(!t.length)return e();jQuery.ajax({url:modulaVars.ajaxURL,type:"GET",data:{action:"modula_get_gallery",nonce:modulaVars.nonce,term:t},success:function(t){e(t)}})},onChange:function(t){a(t)}})}),[]),React.createElement("input",{className:"modula-gallery-input",defaultValue:"0"==l?"":l})};var a=wp.i18n.__,l=wp.element.Fragment,n=wp.blockEditor.InspectorControls,o=wp.components,c=o.Button,r=o.PanelBody;const i=wp.components.withFilters("modula.ModulaInspector")((function(t){var o=t.attributes,i=t.galleries,d=t.onIdChange,m=o.id,s=o.currentSelectize;return React.createElement(l,null,React.createElement(n,null,React.createElement(r,{title:a("Gallery Settings","modula-best-grid-gallery"),initialOpen:!0},i.length>0&&React.createElement(l,null,React.createElement(e,{id:m,key:m,value:m,options:s,onIdChange:d,galleries:i}),0!=m&&React.createElement(c,{target:"_blank",href:modulaVars.adminURL+"post.php?post="+m+"&action=edit",isSecondary:!0},a("Edit gallery"))))))}));var d={};d.modula=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"364 242.9 312.2 357"},React.createElement("g",null,React.createElement("path",{d:"M528.1,242.9c8.5,16.9,17,33.8,25.6,50.6c13.4,26.4,26.9,52.7,39.9,79.7c-41.8-23.3-83.6-46.7-125.4-70.1\r c0.3-1.9,1.7-2.6,2.7-3.5c17.7-17.7,35.4-35.4,53.1-53c1.1-1.1,2.6-2,3.1-3.7C527.4,242.9,527.8,242.9,528.1,242.9z"}),React.createElement("path",{d:"M602.3,463.3c11.3-6.9,22.6-13.9,33.9-20.8c5.5-3.4,11.1-6.7,16.5-10.3c2.2-1.4,2.9-1.1,3.5,1.5\r c6.4,25.3,13,50.6,19.6,75.8c0.6,2.2,1,3.7-2.4,3.5c-46.7-2.1-93.5-4.1-140.2-6.1c-0.2,0-0.3-0.1-0.5-0.2c0.5-1.7,2.1-2,3.3-2.7\r c20-12.3,39.9-24.7,60-36.8c3.4-2.1,5.1-3.7,4.8-8.5c-1.4-21.3-1.8-42.6-2.6-63.9c-0.9-24.1-1.8-48.3-2.8-72.4\r c-0.2-6.1-0.2-6.1,5.5-4.6c23.8,6.2,47.6,12.5,71.5,18.5c3.9,1,4.2,1.9,2.1,5.4c-23.4,38.5-46.7,77.1-70,115.7c-1,1.7-2,3.4-3,5.1\r C601.7,462.8,602,463,602.3,463.3z"}),React.createElement("path",{d:"M372.8,326.9c48,2.6,95.8,5.1,143.9,7.7c-0.9,2-2.5,2.3-3.7,3.1c-38.6,23.2-77.3,46.4-115.9,69.6c-3,1.8-4.3,2.6-5.4-1.9\r c-5.9-24.9-12.2-49.7-18.3-74.6C373.1,329.6,373,328.4,372.8,326.9z"}),React.createElement("path",{d:"M517.6,599.9c-23.2-43.7-45.9-86.6-69.2-130.5c2.3,1.2,3.5,1.8,4.7,2.4c39.8,21.5,79.5,43.1,119.3,64.5\r c3.2,1.7,4.1,2.5,1,5.6c-17.7,17.8-35.2,35.9-52.8,53.9C519.7,596.9,518.9,598.2,517.6,599.9z"}),React.createElement("path",{d:"M364.9,505.1c26.6-40.5,53.1-80.8,79.7-121.3c1.3,1.3,0.9,2.5,0.9,3.6c0,46-0.1,92-0.1,137.9c0,3.1-0.2,4.5-4,3.3\r c-24.9-7.7-49.9-15.2-74.9-22.8C366,505.8,365.7,505.5,364.9,505.1z"}))),d.remove=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})),d.replace=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),d.chevronLeft=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),d.chevronRight=React.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),d.twitter=React.createElement("svg",{"aria-hidden":"true","data-prefix":"fab","data-icon":"twitter",className:"svg-inline--fa fa-twitter fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{fill:"currentColor",d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})),d.facebook=React.createElement("svg",{"aria-hidden":"true","data-prefix":"fab","data-icon":"facebook-f",className:"svg-inline--fa fa-facebook-f fa-w-9",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 264 512"},React.createElement("path",{fill:"currentColor",d:"M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"})),d.whatsapp=React.createElement("svg",{"aria-hidden":"true",focusable:"false",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 1536 1600"},React.createElement("path",{d:"M985 878q13 0 97.5 44t89.5 53q2 5 2 15q0 33-17 76q-16 39-71 65.5T984 1158q-57 0-190-62q-98-45-170-118T476 793q-72-107-71-194v-8q3-91 74-158q24-22 52-22q6 0 18 1.5t19 1.5q19 0 26.5 6.5T610 448q8 20 33 88t25 75q0 21-34.5 57.5T599 715q0 7 5 15q34 73 102 137q56 53 151 101q12 7 22 7q15 0 54-48.5t52-48.5zm-203 530q127 0 243.5-50t200.5-134t134-200.5t50-243.5t-50-243.5T1226 336t-200.5-134T782 152t-243.5 50T338 336T204 536.5T154 780q0 203 120 368l-79 233l242-77q158 104 345 104zm0-1382q153 0 292.5 60T1315 247t161 240.5t60 292.5t-60 292.5t-161 240.5t-240.5 161t-292.5 60q-195 0-365-94L0 1574l136-405Q28 991 28 780q0-153 60-292.5T249 247T489.5 86T782 26z",fill:"currentColor"})),d.pinterest=React.createElement("svg",{"aria-hidden":"true","data-prefix":"fab","data-icon":"pinterest-p",className:"svg-inline--fa fa-pinterest-p fa-w-12",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},React.createElement("path",{fill:"currentColor",d:"M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z"})),d.linkedin=React.createElement("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"linkedin-in",className:"svg-inline--fa fa-linkedin-in fa-w-14",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},React.createElement("path",{fill:"currentColor",d:"M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"})),d.email=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("path",{d:"M0 3v18h24v-18h-24zm6.623 7.929l-4.623 5.712v-9.458l4.623 3.746zm-4.141-5.929h19.035l-9.517 7.713-9.518-7.713zm5.694 7.188l3.824 3.099 3.83-3.104 5.612 6.817h-18.779l5.513-6.812zm9.208-1.264l4.616-3.741v9.348l-4.616-5.607z",fill:"currentColor"})),d.chevronRightFancy=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"bi bi-chevron-right",viewBox:"0 0 16 16"},React.createElement("path",{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"}));const m=d;var s=wp.element.Fragment;const u=function(t){var e=t.settings,a=t.img,l=t.hideTitle,n=t.hideDescription,o=t.hideSocial;return[React.createElement(s,null,["tilt_1","tilt_3","tilt_7"].includes(e.effect)&&React.createElement("div",{className:"tilter__deco tilter__deco--shine"},React.createElement("div",null)),["tilt_3","tilt_7"].includes(e.effect)&&React.createElement("div",{className:"tilter__deco tilter__deco--overlay"}),["tilt_1","tilt_7"].includes(e.effect)&&React.createElement("div",{className:"tilter__deco tilter__deco--lines"}),React.createElement("div",{className:"figc"},React.createElement("div",{className:"figc-inner"},"0"==e.hide_title&&!l&&React.createElement("div",{className:"jtg-title"}," ",a.title," "),React.createElement("div",{className:["lily","centered-bottom","sadie","ruby","bubba","dexter","chico","ming"].includes(e.effect)?"jtg-body":""},"0"==e.hide_description&&!n&&React.createElement("p",{className:"description"}," ",0!=a.description.length&&a.description," "),!o&&"1"==e.enableSocial&&React.createElement("div",{className:"jtg-social"},"1"==e.enableTwitter&&React.createElement("a",{className:"modula-icon-twitter",href:"#"}," ","$",m.twitter," "),"1"==e.enableFacebook&&React.createElement("a",{className:"modula-icon-facebook",href:"#"}," ","$",m.facebook," "),"1"==e.enableWhatsapp&&React.createElement("a",{className:"modula-icon-whatsapp",href:"#"}," ","$",m.whatsapp," "),"1"==e.enableLinkedin&&React.createElement("a",{className:"modula-icon-linkedin",href:"#"}," ","$",m.linkedin," "),"1"==e.enablePinterest&&React.createElement("a",{className:"modula-icon-pinterest",href:"#"}," ","$",m.pinterest," "),"1"==e.enableEmail&&React.createElement("a",{className:"modula-icon-email",href:"#"}," ","$",m.email," "))))))]};const g=wp.components.withFilters("modula.ModulaGalleryImage")((function(t){var e=t.attributes,a=e.settings,l=e.effectCheck,n=t.img,o=t.index,c="modula-item effect-".concat(a.effect);"slider"===a.type&&(c="modula-item f-carousel__slide");return React.createElement("div",{className:c},React.createElement("div",{className:"modula-item-overlay"}),React.createElement("div",{className:"modula-item-content"},n.video_template&&"1"===n.video_template&&n.video_type?"hosted"===n.video_type?React.createElement("div",{className:"video-sizer"},React.createElement("video",{controls:!0},React.createElement("source",{src:n.src,type:"video/mp4"}),"Your browser does not support the video tag.")):"iframe"===n.video_type?React.createElement("div",{className:"video-sizer"},React.createElement("iframe",{src:n.src,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})):void 0:React.createElement("img",{className:"modula-image pic","data-id":n.id,"data-full":n.src,"data-src":n.src,"data-valign":"middle","data-halign":"center",src:n.src}),"slider"!==a.type&&React.createElement(u,{settings:a,img:n,index:o,hideTitle:!l||!l.title,hideDescription:!l||!l.description,hideSocial:!l||!l.social,effectCheck:l})))}));const f=function(t){var e=t.id,a=t.settings,l="";"grid"==a.type&&"automatic"!=a.grid_type&&(l+="#jtg-".concat(e,".modula-gallery .modula-item, .modula-gallery .modula-grid-sizer { width: calc(").concat(100/a.grid_type,"% - ").concat(a.gutter-a.gutter/a.grid_type,"px) !important}")),"0"!=a.borderSize&&(l+="#jtg-".concat(e," .modula-item {\n\t\t\tborder: ").concat(a.borderSize,"px solid ").concat(a.borderColor,";\n\t\t}")),"0"!=a.borderRadius&&(l+="#jtg-".concat(e," .modula-item {\n\t\t\tborder-radius: ").concat(a.borderRadius,"px;\n\t\t}")),"0"!=a.shadowSize&&(l+="#jtg-".concat(e," .modula-item {\n\t\t\tbox-shadow: ").concat(a.shadowColor," 0px 0px ").concat(a.shadowSize,"px;\n\t\t}")),"#ffffff"!=a.socialIconColor&&(l+="#jtg-".concat(e," .modula-item .jtg-social a {\n\t\t\tcolor: ").concat(a.socialIconColor,";\n\t\t}")),"16"!=a.socialIconSize&&(l+="#jtg-".concat(e," .modula-item .jtg-social svg {\n\t\t\theight: ").concat(a.socialIconSize,"px;\n\t\t\twidth: ").concat(a.socialIconSize,"px;\n\t\t}")),"10"!=a.socialIconPadding&&(l+="#jtg-".concat(e," .modula-item .jtg-social a:not(:last-child) {\n\t\t\tmargin-right: ").concat(a.socialIconPadding,"px;\n\t\t}")),l+="#jtg-".concat(e," .modula-item .caption {\n\t\tbackground-color: ").concat(a.captionColor,";\n\t}"),""!=a.captionColor&&(l+="#jtg-".concat(e," .modula-item .figc {\n\t\t\tcolor: ").concat(a.captionColor,";\n\t\t}")),""!=a.titleFontSize&&"0"!=a.titleFontSize&&(l+="#jtg-".concat(e," .modula-item .figc .jtg-title {\n\t\t\tfont-size: ").concat(a.titleFontSize,"px;\n\t\t}")),""!=a.captionFontSize&&"0"!=a.captionFontSize&&(l+="#jtg-".concat(e," .modula-item .figc p.description {\n\t\t\tfont-size: ").concat(a.captionFontSize,"px;\n\t\t}")),l+="#jtg-".concat(e," .modula-items .figc p.description {\n\t\t\tcolor: ").concat(a.captionColor,";\n\t}"),""!=a.titleColor?l+="#jtg-".concat(e," .modula-items .figc .jtg-title {\n\t\t\tcolor: ").concat(a.titleColor,";\n\t\t}"):l+="#jtg-".concat(e," .modula-items .figc .jtg-title {\n\t\t\tcolor: ").concat(a.captionColor,";\n\t\t}"),l+="#jtg-".concat(e,".modula-gallery .modula-item > a, #jtg-").concat(e,".modula-gallery .modula-item, #jtg-").concat(e,".modula-gallery .modula-item-content > a:not(.modula-no-follow){\n\t\tcursor: ").concat(a.cursor,";\n\t}"),"custom-grid"==a.type&&"slider"==a.type||(l+="#jtg-".concat(e," {\n\t\twidth: ").concat(a.width,";\n\t\tmargin : 0 auto;\n\t\t}"),0==t.imagesCount?l+="#jtg-".concat(e," .modula-items {\n\t\t\t\theight: 100px;\n\t\t\t}"):"grid"!=a.type&&"slider"!=a.type?l+="#jtg-".concat(e," .modula-items {\n\t\t\t\theight: ").concat(a.height,"px;\n\t\t\t}"):"slider"==a.type&&(l+="#jtg-".concat(e," .modula-items {\n\t\t\t\theight: auto;\n\t\t\t}"))),null!=a.style&&0!=a.style.length&&(l+="".concat(a.style));var n="";return""!=a.mobileTitleFontSize&&0!=a.mobileTitleFontSize&&(n+="#jtg-".concat(e," .modula-item .figc .jtg-title {\n\t\t\tfont-size: ").concat(a.mobileTitleFontSize,"px\n\t\t}")),n+="#jtg-".concat(e," .modula-items .figc p.description {\n\t\tcolor: ").concat(a.captionColor,";\n\t\tfont-size: ").concat(a.mobileCaptionFontSize,"px;\n\t}"),l+="@media screen and (max-width:480px){\n\t\t".concat(n,"\n\t\t}"),"none"==a.effect&&(l+="#jtg-".concat(e," .modula-items .modula-item:hover img {\n\t\t\topacity: 1;\n\t\t}")),l+="#jtg-".concat(e,".modula .modula-items .modula-item .modula-item-overlay, #jtg-").concat(e,".modula .modula-items .modula-item.effect-layla, #jtg-").concat(e,".modula .modula-items .modula-item.effect-ruby, #jtg-").concat(e,".modula .modula-items .modula-item.effect-bubba, #jtg-").concat(e,".modula .modula-items .modula-item.effect-sarah, #jtg-").concat(e,".modula .modula-items .modula-item.effect-milo, #jtg-").concat(e,".modula .modula-items .modula-item.effect-julia, #jtg-").concat(e,".modula .modula-items .modula-item.effect-hera, #jtg-").concat(e,".modula .modula-items .modula-item.effect-winston, #jtg-").concat(e,".modula .modula-items .modula-item.effect-selena, #jtg-").concat(e,".modula .modula-items .modula-item.effect-terry, #jtg-").concat(e,".modula .modula-items .modula-item.effect-phoebe, #jtg-").concat(e,".modula .modula-items} .modula-item.effect-apollo, #jtg-").concat(e,".modula .modula-items .modula-item.effect-steve, #jtg-").concat(e,".modula .modula-items .modula-item.effect-ming{ \n\t\tbackground-color: ").concat(a.hoverColor,";\n\t}"),l+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-oscar {\n\t\tbackground: -webkit-linear-gradient(45deg, ").concat(a.hoverColor," 0, #9b4a1b 40%, ").concat(a.hoverColor," 100%);\n\t\tbackground: linear-gradient(45deg, ").concat(a.hoverColor," 0, #9b4a1b 40%, ").concat(a.hoverColor," 100%);\n\t}"),l+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-roxy {\n\t\tbackground: -webkit-linear-gradient(45deg, ").concat(a.hoverColor," 0, #05abe0 100%);\n\t\tbackground: linear-gradient(45deg, ").concat(a.hoverColor," 0, #05abe0 100%);\n\t}"),l+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-dexter {\n\t\tbackground: -webkit-linear-gradient(top, ").concat(a.hoverColor," 0, rgba(104,60,19,1) 100%);\n\t\tbackground: linear-gradient(top, ").concat(a.hoverColor," 0, rgba(104,60,19,1) 100%);\n\t}"),l+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-jazz {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(a.hoverColor," 0, #f33f58 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(a.hoverColor," 0, #f33f58 100%);\n\t}"),l+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-lexi {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(a.hoverColor," 0, #fff 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(a.hoverColor," 0, #fff 100%);\n\t}"),l+="#jtg-".concat(e,".modula .modula-items .modula-item.effect-duke {\n\t\tbackground: -webkit-linear-gradient(-45deg, ").concat(a.hoverColor," 0, #cc6055 100%);\n\t\tbackground: linear-gradient(-45deg, ").concat(a.hoverColor," 0, #cc6055 100%);\n\t}"),a.hoverOpacity<=100&&"none"!=a.effect&&(l+="#jtg-".concat(e,".modula .modula-items .modula-item:hover img {\n\t\t\topacity: ").concat(1-a.hoverOpacity/100," ;\n\t\t}")),"default"!=a.titleFontWeight&&(l+="#jtg-".concat(e,".modula .modula-items .modula-item .jtg-title {\n\t\t\tfont-weight : ").concat(a.titleFontWeight,";\n\t\t}")),"default"!=a.captionFontWeight&&(l+="#jtg-".concat(e,".modula .modula-items .modula-item p.description {\n\t\t\tfont-weight : ").concat(a.captionFontWeight,";\n\t\t}")),l+="#jtg-".concat(e,".modula-gallery .modula-item.effect-terry .jtg-social a:not(:last-child) {\n\t\tmargin-bottom: ").concat(a.socialIconPadding,"px;\n\t}"),"slider"==a.type&&("true"==jQuery("[aria-label=Settings]").attr("aria-expanded")?l+="#jtg-".concat(e," {\n\t\t\t\t\twidth: 800px;\n\t\t\t\t\t}"):l+="#jtg-".concat(e," {\n\t\t\twidth: 1100px;\n\t\t\t}"),l+="#jtg-".concat(e," .modula-items {\n\t\theight: auto;\n\t\t}"),l+="#jtg-".concat(e," .modula-item {\n\t\tbackground-color: transparent;\n\t\ttransform: none;\n\t\t}")),null!=a.filters&&a.filters.length>1&&(l+="#jtg-".concat(e,".modula-gallery .filters {\n\t\t\ttext-align: ").concat(a.filterTextAlignment,";\n\t\t}")),React.createElement("style",{dangerouslySetInnerHTML:{__html:"\n \t\t\t\t".concat(l,"\n \t\t\t\t")}})};const p=wp.components.withFilters("modula.ModulaItemsExtraComponent")((function(t){return null}));function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&React.createElement(y,null,React.createElement(y,null,a.map((function(e,a){return React.createElement(g,h({},t,{img:e,key:e.id,index:a}))}))))),React.createElement(p,h({},t,{position:"bottom"}))))]}));function R(){return R=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var a=0,l=Array(e);a0&&React.createElement(I,null,React.createElement(q,null,React.createElement(M,{label:_("Edit gallery","modula-best-grid-gallery"),icon:"edit",href:modulaVars.adminURL+"post.php?post="+o+"&action=edit",target:"_blank"}))));return 0==o&&"none"===a.galleryType?React.createElement(C,null,React.createElement("div",{className:"modula-block-preview"},React.createElement("div",{className:"modula-block-preview__content"},React.createElement("div",{className:"modula-block-preview__logo"}),React.createElement("div",{className:"modula-button-group"},0==l.length&&React.createElement("p",null," ",_("Sorry no galleries found","modula-best-grid-gallery")," "),l.length>0&&React.createElement(M,{className:"modula-button",target:"_blank",onClick:function(t){n({status:"ready",id:0,galleryType:"gallery"})}},_("Display An Existing Gallery","modula-best-grid-gallery"),m.chevronRightFancy),null==t.attributes.proInstalled&&l.length>0&&React.createElement(M,{href:"https://wp-modula.com/pricing/?utm_source=modula-lite&utm_campaign=upsell",className:"modula-button-upsell",isSecondary:!0,target:"_blank"},_("Upgrade to PRO to create galleries using a preset ( fastest way )","modula-best-grid-gallery")))))):"loading"===r?React.createElement("div",{className:"modula-block-preview"},React.createElement("div",{className:"modula-block-preview__content"},React.createElement("div",{className:"modula-block-preview__logo"}),React.createElement(F,null))):0==o||0===c.length?React.createElement(C,{key:"233"},React.createElement(i,R({onIdChange:function(t){return v(t)},selectOptions:function(){var t=[{value:0,label:_("select a gallery","modula-best-grid-gallery")}];return l.forEach((function(e){var a=e.title,l=e.id;0==a.rendered.length?t.push({value:l,label:_("Unnamed Gallery","modula-best-grid-gallery")+l}):t.push({value:l,label:a.rendered})})),t}},t)),React.createElement("div",{className:"modula-block-preview"},React.createElement("div",{className:"modula-block-preview__content"},React.createElement("div",{className:"modula-block-preview__logo"}),l.length>0&&React.createElement(C,null,React.createElement(e,{id:o,key:o,value:o,options:g,onIdChange:v,galleries:l}),0!=o&&React.createElement(M,{target:"_blank",href:modulaVars.adminURL+"post.php?post="+o+"&action=edit",isPrimary:!0},_("Edit Gallery")))))):d?React.createElement(C,{key:"1"},w,React.createElement(i,R({onIdChange:function(t){v(t)}},t)),React.createElement(E,R({},t,{settings:d,jsConfig:s,modulaRun:function(t){if(null!=t){n({status:"ready"});var e=jQuery(".modula.modula-gallery");jQuery.each(e,(function(){jQuery(this).attr("id");var t=jQuery(this).data("config");t.lazyLoad=0,jQuery(this).modulaGallery(t)}))}},modulaCarouselRun:function(t){t="jtg-".concat(t),n({status:"ready"});var e=jQuery(".modula-slider");if(e.length>0&&"function"==typeof ModulaCarousel){var a=jQuery("#".concat(t)).data("config"),l=jQuery("#".concat(t)).find(".modula-items");new ModulaCarousel(l[0],a.slider_settings)}else if(e.length>0&&void 0!==jQuery.fn.slick){var o=jQuery("#".concat(t)).data("config");jQuery("#".concat(t)).find(".modula-items").slick(o.slider_settings)}},checkHoverEffect:function(t){jQuery.ajax({type:"POST",data:{action:"modula_check_hover_effect",nonce:modulaVars.nonce,effect:t},url:modulaVars.ajaxURL,success:function(t){n({effectCheck:t})}})},galleryId:u}))):null}));function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function L(t,e){for(var a=0;a { const { images, jsConfig, id } = props.attributes; - const { settings, checkHoverEffect, modulaRun, modulaSlickRun } = props; + const { settings, checkHoverEffect, modulaRun, modulaCarouselRun } = props; + const galleryRef = useRef(null); useEffect(() => { + if (galleryRef.current) { + galleryRef.current = true; + return; + } if (settings !== undefined) { checkHoverEffect(settings.effect); } if ('slider' !== settings.type) { modulaRun(jsConfig); } else { - modulaSlickRun(id); + modulaCarouselRun(id); } }, []); @@ -55,16 +60,14 @@ export const ModulaGallery = (props) => { {images.length > 0 && ( - {images.map((img, index) => { - return [ - , - ]; - })} + {images.map((img, index) => ( + ) + )} )} diff --git a/assets/src/js/components/ModulaGalleryImage.js b/assets/src/js/components/ModulaGalleryImage.js index 8ce3fa5e..e700bab6 100644 --- a/assets/src/js/components/ModulaGalleryImage.js +++ b/assets/src/js/components/ModulaGalleryImage.js @@ -2,20 +2,19 @@ import ModulaGalleryImageInner from './ModulaGalleryImageInner'; const ModulaGalleryImage = (props) => { const { settings, effectCheck } = props.attributes; - const { img, index } = props; + + let itemClassNames = `modula-item effect-${settings.effect}`; + if (settings.type === 'slider') { + itemClassNames = 'modula-item f-carousel__slide'; + } - return [ -
-
- -
+ const renderMedia = () => { + if (!img.video_template || img.video_template !== '1' || !img.video_type) { + // Return image element if video_template is not defined or is not '1' + return ( { data-halign="center" src={img.src} /> - {'slider' !== settings.type && ( + ); + } else if (img.video_type === 'hosted') { + // Return video element if video_type is 'hosted' + return ( +
+ +
+ ); + } else if (img.video_type === 'iframe') { + // Return iframe element if video_type is 'iframe' + return ( +
+ +
+ ); + } + }; + + return ( +
+
+
+ {renderMedia()} + {settings.type !== 'slider' && ( )}
-
, - ]; +
+ ); }; + export default wp.components.withFilters('modula.ModulaGalleryImage')( ModulaGalleryImage ); diff --git a/assets/src/js/components/edit.js b/assets/src/js/components/edit.js index 33d993bb..997509a8 100644 --- a/assets/src/js/components/edit.js +++ b/assets/src/js/components/edit.js @@ -147,43 +147,20 @@ export const ModulaEdit = (props) => { } }; - const modulaSlickRun = (id) => { + const modulaCarouselRun = (id) => { id = `jtg-${id}`; setAttributes({ status: 'ready' }); const modulaSliders = jQuery('.modula-slider'); - if (modulaSliders.length > 0 && 'undefined' != typeof jQuery.fn.slick) { + if (modulaSliders.length > 0 && 'function' == typeof ModulaCarousel) { let config = jQuery(`#${id}`).data('config'), - nav = jQuery(`#${id}`).find('.modula-slider-nav'), main = jQuery(`#${id}`).find('.modula-items'); - main.slick(config.slider_settings); - - if (nav.length) { - let navConfig = nav.data('config'), - currentSlide = main.slick('slickCurrentSlide'); - - nav.on('init', function (event, slick) { - nav.find( - '.slick-slide[data-slick-index="' + currentSlide + '"]' - ).addClass('is-active'); - }); - - nav.slick(navConfig); - - main.on('afterChange', function (event, slick, currentSlide) { - nav.slick('slickGoTo', currentSlide); - let currrentNavSlideElem = - '.slick-slide[data-slick-index="' + currentSlide + '"]'; - nav.find('.slick-slide.is-active').removeClass('is-active'); - nav.find(currrentNavSlideElem).addClass('is-active'); - }); + new ModulaCarousel( main[0], config.slider_settings ); + } else if (modulaSliders.length > 0 && 'undefined' != typeof jQuery.fn.slick) { + let config = jQuery(`#${id}`).data('config'), + main = jQuery(`#${id}`).find('.modula-items'); - nav.on('click', '.slick-slide', function (event) { - event.preventDefault(); - let goToSingleSlide = jQuery(this).data('slick-index'); - main.slick('slickGoTo', goToSingleSlide); - }); - } + main.slick(config.slider_settings); } }; @@ -376,11 +353,12 @@ export const ModulaEdit = (props) => { settings={settings} jsConfig={jsConfig} modulaRun={modulaRun} - modulaSlickRun={modulaSlickRun} + modulaCarouselRun={modulaCarouselRun} checkHoverEffect={checkHoverEffect} galleryId={galleryId} /> + ); } diff --git a/changelog.txt b/changelog.txt index bca4b1ba..e708f8ca 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ += 2.8.14 - 08.07.2024 = +Added: Support for Modula Image SEO addon +Changed: Compatibility for Modula Slider with Fancybox Carousel & Guttenberg block + = 2.8.13 - 26.06.2024 = Changed: Optimize galleries DB count chech for onboarding display. Fixed: Removed lightbox double zoom button fancybox 5 compatibility. diff --git a/includes/admin/class-modula-admin.php b/includes/admin/class-modula-admin.php index 5e2055bc..982b7c9b 100644 --- a/includes/admin/class-modula-admin.php +++ b/includes/admin/class-modula-admin.php @@ -127,6 +127,11 @@ public function register_submenus() { 'label' => esc_html__('Roles', 'modula-best-grid-gallery'), 'priority' => 80, 'badge' => 'PRO' + ), + 'imageseo' => array( + 'label' => esc_html__('Image SEO', 'modula-best-grid-gallery'), + 'priority' => 85, + 'badge' => 'PRO' ), ); $this->tabs = apply_filters( 'modula_admin_page_tabs', $tabs ); diff --git a/includes/admin/class-modula-cpt.php b/includes/admin/class-modula-cpt.php index 0e3bf867..04fd09f8 100644 --- a/includes/admin/class-modula-cpt.php +++ b/includes/admin/class-modula-cpt.php @@ -22,7 +22,7 @@ public function __construct() { add_action( 'init', array( $this, 'register_cpt' ) ); //Bring the settings in Rest - add_action( 'rest_api_init', array( $this, 'register_post_meta_rest') ); + add_action( 'rest_api_init', array( $this, 'register_post_meta_rest' ) ); /* Fire our meta box setup function on the post editor screen. */ add_action( 'load-post.php', array( $this, 'meta_boxes_setup' ) ); @@ -52,58 +52,64 @@ public function __construct() { // Ajax for removing notices add_action( 'wp_ajax_modula-edit-notice', array( $this, 'dismiss_edit_notice' ) ); - } public function register_cpt() { - $this->labels = apply_filters( 'modula_cpt_labels', array( - 'name' => esc_html__( 'Modula Galleries', 'modula-best-grid-gallery' ), - 'singular_name' => esc_html__( 'Gallery', 'modula-best-grid-gallery' ), - 'menu_name' => esc_html__( 'Modula', 'modula-best-grid-gallery' ), - 'name_admin_bar' => esc_html__( 'Modula', 'modula-best-grid-gallery' ), - 'archives' => esc_html__( 'Item Archives', 'modula-best-grid-gallery' ), - 'attributes' => esc_html__( 'Item Attributes', 'modula-best-grid-gallery' ), - 'parent_item_colon' => esc_html__( 'Parent Item:', 'modula-best-grid-gallery' ), - 'all_items' => esc_html__( 'Galleries', 'modula-best-grid-gallery' ), - 'add_new_item' => esc_html__( 'Add New Item', 'modula-best-grid-gallery' ), - 'add_new' => esc_html__( 'Add New', 'modula-best-grid-gallery' ), - 'new_item' => esc_html__( 'New Item', 'modula-best-grid-gallery' ), - 'edit_item' => esc_html__( 'Edit Item', 'modula-best-grid-gallery' ), - 'update_item' => esc_html__( 'Update Item', 'modula-best-grid-gallery' ), - 'view_item' => esc_html__( 'View Item', 'modula-best-grid-gallery' ), - 'view_items' => esc_html__( 'View Items', 'modula-best-grid-gallery' ), - 'search_items' => esc_html__( 'Search Item', 'modula-best-grid-gallery' ), - 'not_found' => ''.esc_html__( 'Add your first gallery ','modula-best-grid-gallery').''.esc_html__('now or check out our ','modula-best-grid-gallery'). ''.esc_html__('documentation ','modula-best-grid-gallery').''.esc_html__('if you need help figuring things out.', 'modula-best-grid-gallery' ), - 'not_found_in_trash' => esc_html__( 'Not found in Trash', 'modula-best-grid-gallery' ), - 'featured_image' => esc_html__( 'Featured Image', 'modula-best-grid-gallery' ), - 'set_featured_image' => esc_html__( 'Set featured image', 'modula-best-grid-gallery' ), - 'remove_featured_image' => esc_html__( 'Remove featured image', 'modula-best-grid-gallery' ), - 'use_featured_image' => esc_html__( 'Use as featured image', 'modula-best-grid-gallery' ), - 'insert_into_item' => esc_html__( 'Insert into item', 'modula-best-grid-gallery' ), - 'uploaded_to_this_item' => esc_html__( 'Uploaded to this item', 'modula-best-grid-gallery' ), - 'items_list' => esc_html__( 'Items list', 'modula-best-grid-gallery' ), - 'items_list_navigation' => esc_html__( 'Items list navigation', 'modula-best-grid-gallery' ), - 'filter_items_list' => esc_html__( 'Filter items list', 'modula-best-grid-gallery' ), - ), $this->labels ); - - $this->args = apply_filters( 'modula_cpt_args', array( - 'label' => esc_html__( 'Modula Gallery', 'modula-best-grid-gallery' ), - 'description' => esc_html__( 'Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.', 'modula-best-grid-gallery' ), - 'supports' => array( 'title' ), - 'public' => false, - 'show_ui' => true, - 'show_in_menu' => true, - 'menu_position' => 25, - 'menu_icon' => MODULA_URL . 'assets/images/modula.png', - 'show_in_admin_bar' => true, - 'show_in_nav_menus' => false, - 'can_export' => true, - 'has_archive' => false, - 'exclude_from_search' => true, - 'rewrite' => false, - 'show_in_rest' => true, - ) ); + $this->labels = apply_filters( + 'modula_cpt_labels', + array( + 'name' => esc_html__( 'Modula Galleries', 'modula-best-grid-gallery' ), + 'singular_name' => esc_html__( 'Gallery', 'modula-best-grid-gallery' ), + 'menu_name' => esc_html__( 'Modula', 'modula-best-grid-gallery' ), + 'name_admin_bar' => esc_html__( 'Modula', 'modula-best-grid-gallery' ), + 'archives' => esc_html__( 'Item Archives', 'modula-best-grid-gallery' ), + 'attributes' => esc_html__( 'Item Attributes', 'modula-best-grid-gallery' ), + 'parent_item_colon' => esc_html__( 'Parent Item:', 'modula-best-grid-gallery' ), + 'all_items' => esc_html__( 'Galleries', 'modula-best-grid-gallery' ), + 'add_new_item' => esc_html__( 'Add New Item', 'modula-best-grid-gallery' ), + 'add_new' => esc_html__( 'Add New', 'modula-best-grid-gallery' ), + 'new_item' => esc_html__( 'New Item', 'modula-best-grid-gallery' ), + 'edit_item' => esc_html__( 'Edit Item', 'modula-best-grid-gallery' ), + 'update_item' => esc_html__( 'Update Item', 'modula-best-grid-gallery' ), + 'view_item' => esc_html__( 'View Item', 'modula-best-grid-gallery' ), + 'view_items' => esc_html__( 'View Items', 'modula-best-grid-gallery' ), + 'search_items' => esc_html__( 'Search Item', 'modula-best-grid-gallery' ), + 'not_found' => '' . esc_html__( 'Add your first gallery ', 'modula-best-grid-gallery' ) . '' . esc_html__( 'now or check out our ', 'modula-best-grid-gallery' ) . '' . esc_html__( 'documentation ', 'modula-best-grid-gallery' ) . '' . esc_html__( 'if you need help figuring things out.', 'modula-best-grid-gallery' ), + 'not_found_in_trash' => esc_html__( 'Not found in Trash', 'modula-best-grid-gallery' ), + 'featured_image' => esc_html__( 'Featured Image', 'modula-best-grid-gallery' ), + 'set_featured_image' => esc_html__( 'Set featured image', 'modula-best-grid-gallery' ), + 'remove_featured_image' => esc_html__( 'Remove featured image', 'modula-best-grid-gallery' ), + 'use_featured_image' => esc_html__( 'Use as featured image', 'modula-best-grid-gallery' ), + 'insert_into_item' => esc_html__( 'Insert into item', 'modula-best-grid-gallery' ), + 'uploaded_to_this_item' => esc_html__( 'Uploaded to this item', 'modula-best-grid-gallery' ), + 'items_list' => esc_html__( 'Items list', 'modula-best-grid-gallery' ), + 'items_list_navigation' => esc_html__( 'Items list navigation', 'modula-best-grid-gallery' ), + 'filter_items_list' => esc_html__( 'Filter items list', 'modula-best-grid-gallery' ), + ), + $this->labels + ); + + $this->args = apply_filters( + 'modula_cpt_args', + array( + 'label' => esc_html__( 'Modula Gallery', 'modula-best-grid-gallery' ), + 'description' => esc_html__( 'Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.', 'modula-best-grid-gallery' ), + 'supports' => array( 'title' ), + 'public' => false, + 'show_ui' => true, + 'show_in_menu' => true, + 'menu_position' => 25, + 'menu_icon' => MODULA_URL . 'assets/images/modula.png', + 'show_in_admin_bar' => true, + 'show_in_nav_menus' => false, + 'can_export' => true, + 'has_archive' => false, + 'exclude_from_search' => true, + 'rewrite' => false, + 'show_in_rest' => true, + ) + ); $this->metaboxes = array( 'modula-preview-gallery' => array( @@ -130,7 +136,6 @@ public function register_cpt() { $args['labels'] = $this->labels; register_post_type( $this->cpt_name, $args ); - } /** @@ -139,11 +144,15 @@ public function register_cpt() { * @since 2.5.0 */ public function register_post_meta_rest() { - register_rest_field( 'modula-gallery', 'modulaSettings', array( - 'get_callback' => function( $post_arr ) { - return get_post_meta( $post_arr['id'], 'modula-settings', true ); - }, - ) ); + register_rest_field( + 'modula-gallery', + 'modulaSettings', + array( + 'get_callback' => function ( $post_arr ) { + return get_post_meta( $post_arr['id'], 'modula-settings', true ); + }, + ) + ); } /** @@ -187,13 +196,12 @@ public function add_meta_boxes() { add_meta_box( $metabox_id, // Unique ID $metabox['title'], // Title - array( $this, $metabox['callback'] ), // Callback function + is_string( $metabox['callback'] ) ? array( $this, $metabox['callback'] ) : $metabox['callback'], // Callback function 'modula-gallery', // Admin page (or post type) $metabox['context'], // Context 'high' // Priority ); } - } public function output_gallery_images() { @@ -214,7 +222,7 @@ public function save_meta_boxes( $post_id, $post ) { $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) || 'modula-gallery' != $post_type->name ) { + if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) || 'modula-gallery' != $post_type->name ) { return $post_id; } @@ -231,8 +239,8 @@ public function save_meta_boxes( $post_id, $post ) { // We will iterate through all fields of current tab foreach ( $fields as $field_id => $field ) { - if ( isset( $_POST['modula-settings'][$field_id] ) ) { - + if ( isset( $_POST['modula-settings'][ $field_id ] ) ) { + // Values for selects $lightbox_values = apply_filters( 'modula_lightbox_values', array( 'no-link', 'direct', 'fancybox', 'external-url' ) ); $effect_values = apply_filters( 'modula_effect_values', array( 'none', 'pufrobo' ) ); @@ -240,7 +248,7 @@ public function save_meta_boxes( $post_id, $post ) { switch ( $field_id ) { case 'description': - $modula_settings[$field_id] = wp_filter_post_kses( $_POST['modula-settings'][$field_id] ); + $modula_settings[ $field_id ] = wp_filter_post_kses( $_POST['modula-settings'][ $field_id ] ); break; case 'randomFactor': case 'captionFontSize': @@ -252,113 +260,108 @@ public function save_meta_boxes( $post_id, $post ) { case 'shadowSize': case 'socialIconSize': case 'socialIconPadding': - $modula_settings[$field_id] = absint( $_POST['modula-settings'][$field_id] ); + $modula_settings[ $field_id ] = absint( $_POST['modula-settings'][ $field_id ] ); break; - case 'lightbox' : - if ( in_array( $_POST['modula-settings'][$field_id], $lightbox_values ) ) { - $modula_settings[$field_id] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][$field_id] ) ); + case 'lightbox': + if ( in_array( $_POST['modula-settings'][ $field_id ], $lightbox_values ) ) { + $modula_settings[ $field_id ] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); } else { - $modula_settings[$field_id] = 'fancybox'; + $modula_settings[ $field_id ] = 'fancybox'; } break; case 'enableSocial': - case 'enableTwitter' : + case 'enableTwitter': case 'enableWhatsapp': - case 'enableFacebook' : - case 'enablePinterest' : + case 'enableFacebook': + case 'enablePinterest': case 'enableEmail': - $modula_settings[$field_id] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][$field_id] ) ); + $modula_settings[ $field_id ] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); break; case 'imageMessage': - $modula_settings[$field_id] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][$field_id] ) ); + $modula_settings[ $field_id ] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); break; case 'galleryMessage': - $modula_settings[$field_id] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][$field_id] ) ); + $modula_settings[ $field_id ] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); break; - case 'shuffle' : - if ( isset( $_POST['modula-settings'][$field_id] ) ) { - $modula_settings[$field_id] = '1'; + case 'shuffle': + if ( isset( $_POST['modula-settings'][ $field_id ] ) ) { + $modula_settings[ $field_id ] = '1'; } else { - $modula_settings[$field_id] = '0'; + $modula_settings[ $field_id ] = '0'; } break; case 'captionColor': case 'socialIconColor': case 'borderColor': case 'shadowColor': - $modula_settings[$field_id] = Modula_Helper::sanitize_rgba_colour( wp_unslash( $_POST['modula-settings'][$field_id] ) ); + $modula_settings[ $field_id ] = Modula_Helper::sanitize_rgba_colour( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); break; - case 'effect' : - if ( in_array( $_POST['modula-settings'][$field_id], $effect_values ) ) { - $modula_settings[$field_id] = $_POST['modula-settings'][$field_id]; + case 'effect': + if ( in_array( $_POST['modula-settings'][ $field_id ], $effect_values ) ) { + $modula_settings[ $field_id ] = $_POST['modula-settings'][ $field_id ]; } else { - $modula_settings[$field_id] = 'pufrobo'; + $modula_settings[ $field_id ] = 'pufrobo'; } break; - case 'gutterInput' : - $modula_settings[$field_id] = absint( $_POST['modula-settings'][$field_id] ); + case 'gutterInput': + $modula_settings[ $field_id ] = absint( $_POST['modula-settings'][ $field_id ] ); break; - case 'height' : - $modula_settings[$field_id] = array_map( 'absint', $_POST['modula-settings'][$field_id] ); + case 'height': + $modula_settings[ $field_id ] = array_map( 'absint', $_POST['modula-settings'][ $field_id ] ); break; default: $data_type = isset( $field['data_type'] ) ? $field['data_type'] : 'default'; switch ( $data_type ) { case 'text': - if( is_array( $_POST['modula-settings'][$field_id] ) ){ - $modula_settings[$field_id] = array_map( 'sanitize_text_field', wp_unslash( $_POST['modula-settings'][$field_id] ) ); - }else{ - $modula_settings[$field_id] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][$field_id] ) ); + if ( is_array( $_POST['modula-settings'][ $field_id ] ) ) { + $modula_settings[ $field_id ] = array_map( 'sanitize_text_field', wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); + } else { + $modula_settings[ $field_id ] = sanitize_text_field( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); } break; case 'number': - if( is_array( $_POST['modula-settings'][$field_id] ) ){ - $modula_settings[$field_id] = array_map( 'absint', $_POST['modula-settings'][$field_id] ); - }else{ + if ( is_array( $_POST['modula-settings'][ $field_id ] ) ) { + $modula_settings[ $field_id ] = array_map( 'absint', $_POST['modula-settings'][ $field_id ] ); + } else { - $modula_settings[$field_id] = absint( $_POST['modula-settings'][$field_id] ); + $modula_settings[ $field_id ] = absint( $_POST['modula-settings'][ $field_id ] ); } break; case 'bool': - - if( is_array( $_POST['modula-settings'][$field_id] ) ){ - $modula_settings[$field_id] = array_map( 'rest_sanitize_boolean', $_POST['modula-settings'][$field_id] ); - }else{ - $modula_settings[$field_id] = rest_sanitize_boolean( $_POST['modula-settings'][$field_id] ); + if ( is_array( $_POST['modula-settings'][ $field_id ] ) ) { + $modula_settings[ $field_id ] = array_map( 'rest_sanitize_boolean', $_POST['modula-settings'][ $field_id ] ); + } else { + $modula_settings[ $field_id ] = rest_sanitize_boolean( $_POST['modula-settings'][ $field_id ] ); } break; default: - if ( is_array( $_POST['modula-settings'][$field_id] ) ) { - $sanitized = array_map( 'sanitize_text_field', wp_unslash( $_POST['modula-settings'][$field_id] ) ); - $modula_settings[$field_id] = apply_filters( 'modula_settings_field_sanitization', $sanitized, wp_unslash( $_POST['modula-settings'][$field_id] ), $field_id, $field ); - } else { - $modula_settings[$field_id] = apply_filters( 'modula_settings_field_sanitization', sanitize_text_field( wp_unslash( $_POST['modula-settings'][$field_id] ) ), $_POST['modula-settings'][$field_id], $field_id, $field ); - } - break; + if ( is_array( $_POST['modula-settings'][ $field_id ] ) ) { + $sanitized = array_map( 'sanitize_text_field', wp_unslash( $_POST['modula-settings'][ $field_id ] ) ); + $modula_settings[ $field_id ] = apply_filters( 'modula_settings_field_sanitization', $sanitized, wp_unslash( $_POST['modula-settings'][ $field_id ] ), $field_id, $field ); + } else { + $modula_settings[ $field_id ] = apply_filters( 'modula_settings_field_sanitization', sanitize_text_field( wp_unslash( $_POST['modula-settings'][ $field_id ] ) ), $_POST['modula-settings'][ $field_id ], $field_id, $field ); + } + break; } - break; + break; } - } else { if ( 'toggle' == $field['type'] ) { - $modula_settings[$field_id] = '0'; - } else if ( 'hidden' == $field['type'] ) { + $modula_settings[ $field_id ] = '0'; + } elseif ( 'hidden' == $field['type'] ) { $hidden_set = get_post_meta( $post_id, 'modula-settings', true ); if ( isset( $hidden_set['last_visited_tab'] ) && '' != $hidden_set['last_visited_tab'] ) { - $modula_settings[$field_id] = $hidden_set['last_visited_tab']; + $modula_settings[ $field_id ] = $hidden_set['last_visited_tab']; } else { - $modula_settings[$field_id] = 'modula-general'; + $modula_settings[ $field_id ] = 'modula-general'; } - } else { - $modula_settings[$field_id] = ''; + $modula_settings[ $field_id ] = ''; } } - } - } // Save the value of helpergrid @@ -374,11 +377,11 @@ public function save_meta_boxes( $post_id, $post ) { } if ( isset( $_POST['modula-images'] ) ) { - + $old_images = get_post_meta( $post_id, 'modula-images', true ); $images = json_decode( stripslashes( $_POST['modula-images'] ), true ); $new_images = array(); - + if ( is_array( $images ) ) { foreach ( $images as $image ) { $new_images[] = $this->sanitize_image( $image ); @@ -386,7 +389,6 @@ public function save_meta_boxes( $post_id, $post ) { } update_post_meta( $post_id, 'modula-images', $new_images ); } - } private function sanitize_image( $image ) { @@ -467,18 +469,17 @@ private function sanitize_image( $image ) { } return $new_image; - } public function add_extensions_tab_onboarding( $views ) { global $wpdb; $sql = "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'modula-gallery'"; - $res = $wpdb->get_var( $sql); + $res = $wpdb->get_var( $sql ); $this->display_extension_tab(); - if( '0' === $res ){ + if ( '0' === $res ) { global $wp_list_table; $wp_list_table = new Modula_Onboarding(); return array(); @@ -491,25 +492,25 @@ public function display_extension_tab() {
'; } - } public function dismiss_edit_notice() { @@ -554,7 +553,6 @@ public function dismiss_edit_notice() { $modula_options['edit-notice'] = 1; update_option( 'modula-checks', $modula_options ); die( '1' ); - } public function replace_submit_meta_box() { @@ -562,7 +560,6 @@ public function replace_submit_meta_box() { $post_type = 'modula-gallery'; remove_meta_box( 'submitdiv', $post_type, 'side' ); add_meta_box( 'submitdiv', __( 'Publish', 'modula-best-grid-gallery' ), array( $this, 'post_submit_meta_box' ), $post_type, 'side', 'high' ); - } public function post_submit_meta_box() { @@ -590,19 +587,19 @@ public function post_submit_meta_box() { } ?> type="submit" name="save" id="save-post" - value="" - class="button"/> + value="" + class="button"/> post_status && $can_publish ) { ?> + value="" class="button"/>
post_status ) { $preview_button_text = esc_html__( 'Preview Changes', 'modula-best-grid-gallery' ); } else { @@ -617,8 +614,8 @@ class="button"/> ); ?> + target="wp-preview-ID; ?>" + id="post-preview">
@@ -670,12 +667,12 @@ class="button"/> } ?> class="edit-post-status hide-if-no-js" - role="button">
+ value="post_status ) ? 'draft' : $post->post_status ); ?>"/> + class="save-post-status hide-if-no-js button"> + class="cancel-post-status hide-if-no-js button-cancel">
' . esc_html( number_format_i18n( $args['args']['revisions_count'] ) ) . '' ); ?>
- @@ -727,17 +724,19 @@ class="screen-reader-text">

unpublished customization changes. You can edit, but there’s no need to publish now. It will be published automatically with those changes.', 'modula-best-grid-gallery' ), - esc_url( - add_query_arg( - 'changeset_uuid', - rawurlencode( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ), - admin_url( 'customize.php' ) + echo wp_kses_post( + sprintf( + /* translators: %s: URL to the Customizer. */ + __( 'This draft comes from your unpublished customization changes. You can edit, but there’s no need to publish now. It will be published automatically with those changes.', 'modula-best-grid-gallery' ), + esc_url( + add_query_arg( + 'changeset_uuid', + rawurlencode( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ), + admin_url( 'customize.php' ) + ) ) ) - ) ); + ); ?>

@@ -758,7 +757,7 @@ class="screen-reader-text">
- +
CTRL/CMD + S @@ -780,14 +779,14 @@ class="screen-reader-text"> ID ) ) { - if ( !EMPTY_TRASH_DAYS ) { + if ( ! EMPTY_TRASH_DAYS ) { $delete_text = __( 'Delete Permanently', 'modula-best-grid-gallery' ); } else { $delete_text = __( 'Move to Trash', 'modula-best-grid-gallery' ); } ?> + href="ID ) ); ?>"> @@ -796,44 +795,45 @@ class="screen-reader-text"> post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) { + if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) { if ( $can_publish ) : - if ( !empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : + if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> + value=""/> post_status, array( 'draft' ) ) || 0 == $post->ID ) : ?> + value=""/> + value=""/> - + value=""/> - + value=""/>
- + 'failed' ) ); } @@ -884,18 +884,17 @@ public function modula_remember_tab_save() { update_post_meta( $id, 'modula-settings', $settings ); die(); - } public function output_upsell_albums() { - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; ?> '; @@ -207,7 +204,7 @@ private function _render_settings_metabox() { $current_tab_content .= '
'; $current_tab_content .= ''; foreach ( $fields as $field_id => $field ) { - $field['id'] = $field_id; + $field['id'] = $field_id; $current_tab_content .= $this->_render_row( $field ); } $current_tab_content .= '
'; @@ -215,12 +212,11 @@ private function _render_settings_metabox() { $current_tab_content .= apply_filters( 'modula_' . $tab_id . '_tab_content', '' ); $current_tab_content .= '
'; $current_tab_content .= ''; - $tabs_content_html .= $current_tab_content; + $tabs_content_html .= $current_tab_content; if ( $first ) { $first = false; } - } $html = '
%s
%s
'; @@ -234,17 +230,17 @@ private function _render_shortcode_metabox( $post ) { do_action( 'modula_admin_before_shortcode_metabox', $post ); echo '
'; - echo ''; - echo ''; - echo '

' . sprintf( esc_html__( 'You can use this to display your newly created gallery inside a %s post or a page %s', 'modula-best-grid-gallery'), '', '' ) . '

'; - echo '
'; + echo ''; + echo ''; + echo '

' . sprintf( esc_html__( 'You can use this to display your newly created gallery inside a %1$s post or a page %2$s', 'modula-best-grid-gallery' ), '', '' ) . '

'; + echo '
'; - do_action( 'modula_admin_after_shortcode_metabox', $post ); + do_action( 'modula_admin_after_shortcode_metabox', $post ); } /* Create HMTL for a tab */ private function _render_tab( $tab, $first = false ) { - $icon = ''; + $icon = ''; $badge = ''; if ( isset( $tab['icon'] ) ) { @@ -254,47 +250,45 @@ private function _render_tab( $tab, $first = false ) { if ( isset( $tab['badge'] ) ) { $badge = '' . esc_html( $tab['badge'] ) . ''; } - - return '
' . $icon . wp_kses_post( isset($tab['label']) ? $tab['label'] : '' ) . $badge . '
'; + + return '
' . $icon . wp_kses_post( isset( $tab['label'] ) ? $tab['label'] : '' ) . $badge . '
'; } /* Create HMTL for a row */ private function _render_row( $field ) { $child = ''; - $field_name = wp_kses_post( $field[ 'name' ] ); + $field_name = wp_kses_post( $field['name'] ); // Generate tooltip $tooltip = ''; - if ( isset( $field[ 'description' ] ) && '' != $field[ 'description' ] ) { + if ( isset( $field['description'] ) && '' != $field['description'] ) { $tooltip .= '
[?]'; - $tooltip .= '
' . wp_kses_post( $field[ 'description' ] ) . '
'; + $tooltip .= '
' . wp_kses_post( $field['description'] ) . '
'; $tooltip .= '
'; } - - if(isset($field['is_child']) && $field['is_child'] && is_bool($field['is_child'])){ + if ( isset( $field['is_child'] ) && $field['is_child'] && is_bool( $field['is_child'] ) ) { $child = 'child_setting'; } - if(isset($field['is_child']) && $field['is_child'] && is_string($field['is_child'])){ - $child = $field['is_child'].'_child_setting'; + if ( isset( $field['is_child'] ) && $field['is_child'] && is_string( $field['is_child'] ) ) { + $child = $field['is_child'] . '_child_setting'; } $format = '%s%s'; - if( isset( $field['children'] ) && is_array( $field['children'] ) && 0 < count( $field['children'] ) ){ + if ( isset( $field['children'] ) && is_array( $field['children'] ) && 0 < count( $field['children'] ) ) { - $children = htmlspecialchars(json_encode( $field['children'] ), ENT_QUOTES, 'UTF-8'); + $children = htmlspecialchars( json_encode( $field['children'] ), ENT_QUOTES, 'UTF-8' ); $parent = ''; - if( isset( $field['parent'] ) && '' != $field['parent'] ){ + if ( isset( $field['parent'] ) && '' != $field['parent'] ) { $parent = 'data-parent="' . $field['parent'] . '"'; } $format = '%s%s'; } - // Formats for General Gutter if ( 'gutterInput' == $field['type'] ) { @@ -352,20 +346,19 @@ private function _render_field( $field, $value = '' ) { $placeholder['width'] = ( isset( $field['placeholder'] ) && isset( $field['placeholder']['width'] ) ) ? $field['placeholder']['width'] : ''; $placeholder['height'] = ( isset( $field['placeholder'] ) && isset( $field['placeholder']['height'] ) ) ? $field['placeholder']['height'] : ''; - $html = '
'; - $html .= ''; + $html = '
'; + $html .= ''; $html .= 'x'; - $html .= ''; + $html .= ''; $html .= 'px'; $html .= '
'; break; - case 'text': - + case 'text': $placeholder = isset( $field['placeholder'] ) ? $field['placeholder'] : ''; - $html = ''; + $html = ''; - if(isset($field['afterrow'])){ - $html .= '

'. wp_kses_post( $field['afterrow'] ) .'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . wp_kses_post( $field['afterrow'] ) . '

'; } break; case 'number': @@ -374,8 +367,8 @@ private function _render_field( $field, $value = '' ) { $html .= '' . esc_html( $field['after'] ) . ''; } - if(isset($field['afterrow'])){ - $html .= '

'. wp_kses_post( $field['afterrow'] ) .'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . wp_kses_post( $field['afterrow'] ) . '

'; } break; case 'gutterInput': @@ -384,44 +377,44 @@ private function _render_field( $field, $value = '' ) { $html .= '' . esc_html( $field['after'] ) . ''; } - if(isset($field['afterrow'])){ - $html .= '

'. wp_kses_post( $field['afterrow'] ) .'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . wp_kses_post( $field['afterrow'] ) . '

'; } break; case 'responsiveInput': - $html = 'px'; + $html = 'px'; $html .= 'px'; $html .= 'px'; if ( isset( $field['after'] ) ) { $html .= '' . esc_html( $field['after'] ) . ''; } - if(isset($field['afterrow'])){ - $html .= '

'. wp_kses_post( $field['afterrow'] ) .'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . wp_kses_post( $field['afterrow'] ) . '

'; } break; - case 'select' : + case 'select': $html = ''; - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; - case 'icon-radio' : - $wpchill_upsell = false; - if ( class_exists( 'WPChill_Upsells' ) ) { - // Initialize WPChill upsell class - $args = apply_filters( 'modula_upsells_args', array( + case 'icon-radio': + $wpchill_upsell = false; + if ( class_exists( 'WPChill_Upsells' ) ) { + // Initialize WPChill upsell class + $args = apply_filters( + 'modula_upsells_args', + array( 'shop_url' => 'https://wp-modula.com', 'slug' => 'modula', - ) ); + ) + ); - $wpchill_upsell = WPChill_Upsells::get_instance( $args ); - } - $html .= '
'; - foreach ( $field['values'] as $key => $name ) { - $icon = esc_url( MODULA_URL .'assets/images/settings/' . $key . '.png' ); - $html .= ''; - $html .= ''; - - } + $wpchill_upsell = WPChill_Upsells::get_instance( $args ); + } + $html .= '
'; + foreach ( $field['values'] as $key => $name ) { + $icon = esc_url( MODULA_URL . 'assets/images/settings/' . $key . '.png' ); + $html .= ''; + $html .= ''; - foreach ( $field['disabled']['values'] as $key => $name ) { + } - if ( $wpchill_upsell && ! $wpchill_upsell->is_upgradable_addon( 'modula-' . $key ) ) { - $class = 'modula-radio-icon-install'; - } else { - $class = 'modula-radio-icon-disabled'; - } + foreach ( $field['disabled']['values'] as $key => $name ) { - $icon = esc_url( MODULA_URL .'assets/images/settings/' . $key . '-disabled.png' ); - $html .= ''; + if ( $wpchill_upsell && ! $wpchill_upsell->is_upgradable_addon( 'modula-' . $key ) ) { + $class = 'modula-radio-icon-install'; + } else { + $class = 'modula-radio-icon-disabled'; } - $html .= '
'; + $icon = esc_url( MODULA_URL . 'assets/images/settings/' . $key . '-disabled.png' ); + $html .= ''; + } - if ( isset( $field['afterrow'] ) ) { - $html .= '

' . esc_html( $field['afterrow'] ) . '

'; - } - break; + $html .= '
'; + + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; + } + break; case 'ui-slider': - $min = isset( $field['min'] ) ? floatval( $field['min'] ) : 0; - $max = isset( $field['max'] ) ? floatval( $field['max'] ) : 100; - $step = isset( $field['step'] ) ? absint( $field['step'] ) : 1; + $min = isset( $field['min'] ) ? floatval( $field['min'] ) : 0; + $max = isset( $field['max'] ) ? floatval( $field['max'] ) : 100; + $step = isset( $field['step'] ) ? absint( $field['step'] ) : 1; $value = floatval( $value ); - if ( '' === $value ){ + if ( '' === $value ) { if ( isset( $field['default'] ) ) { $value = $field['default']; - }else{ + } else { $value = $min; } - }elseif ( $value < $min ){ + } elseif ( $value < $min ) { $value = $min; - }elseif ( $value > $max ) { + } elseif ( $value > $max ) { $value = $max; } $attributes = 'data-min="' . esc_attr( $min ) . '" data-max="' . esc_attr( $max ) . '" data-step="' . esc_attr( $step ) . '"'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; break; - case 'color' : + case 'color': $html .= '
'; if ( isset( $field['alpha'] ) && $field['alpha'] ) { $html .= ''; - }else{ + } else { $html .= ''; } $html .= '
'; - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; - case "toggle": - $html .= '
'; - $html .= ''; - $html .= '
'; + case 'toggle': + $html .= '
'; + $html .= ''; + $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; - $html .= '
'; - $html .= '
'; - - if(isset($field['afterrow'])){ - $html .= '

'. wp_kses_post($field['afterrow'], array( 'a' => array( 'href' => array() ), 'target' => array() )).'

'; + $html .= '
'; + $html .= '
'; + + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . wp_kses_post( + $field['afterrow'], + array( + 'a' => array( 'href' => array() ), + 'target' => array(), + ) + ) . '

'; } break; - case "custom_code": - $html = '
'; - $html .= ''; + case 'custom_code': + $html = '
'; + $html .= ''; $html .= '
'; - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; - case "hover-effect": - $hovers = apply_filters( 'modula_available_hover_effects', array( - 'none' => esc_html__( 'None', 'modula-best-grid-gallery' ), - 'pufrobo' => esc_html__( 'Pufrobo', 'modula-best-grid-gallery' ), - ) ); - $pro_hovers = apply_filters( 'modula_pro_hover_effects', array( - 'fluid-up' => esc_html__( 'Fluid Up', 'modula-best-grid-gallery' ), - 'greyscale' => esc_html__( 'Greyscale', 'modula-best-grid-gallery' ), - 'under' => esc_html__( 'Under Image', 'modula-best-grid-gallery' ), - 'hide' => esc_html__( 'Hide', 'modula-best-grid-gallery' ), - 'quiet' => esc_html__( 'Quiet', 'modula-best-grid-gallery' ), - 'catinelle' => esc_html__( 'Catinelle', 'modula-best-grid-gallery' ), - 'reflex' => esc_html__( 'Reflex', 'modula-best-grid-gallery' ), - 'curtain' => esc_html__( 'Curtain', 'modula-best-grid-gallery' ), - 'lens' => esc_html__( 'Lens', 'modula-best-grid-gallery' ), - 'appear' => esc_html__( 'Appear', 'modula-best-grid-gallery' ), - 'crafty' => esc_html__( 'Crafty', 'modula-best-grid-gallery' ), - 'seemo' => esc_html__( 'Seemo', 'modula-best-grid-gallery' ), - 'comodo' => esc_html__( 'Comodo', 'modula-best-grid-gallery' ), - 'lily' => esc_html__( 'Lily', 'modula-best-grid-gallery' ), - 'sadie' => esc_html__( 'Sadie', 'modula-best-grid-gallery' ), - 'honey' => esc_html__( 'Honey', 'modula-best-grid-gallery' ), - 'layla' => esc_html__( 'Layla', 'modula-best-grid-gallery' ), - 'zoe' => esc_html__( 'Zoe', 'modula-best-grid-gallery' ), - 'oscar' => esc_html__( 'Oscar', 'modula-best-grid-gallery' ), - 'marley' => esc_html__( 'Marley', 'modula-best-grid-gallery' ), - 'ruby' => esc_html__( 'Ruby', 'modula-best-grid-gallery' ), - 'roxy' => esc_html__( 'Roxy', 'modula-best-grid-gallery' ), - 'bubba' => esc_html__( 'Bubba', 'modula-best-grid-gallery' ), - 'dexter' => esc_html__( 'Dexter', 'modula-best-grid-gallery' ), - 'sarah' => esc_html__( 'Sarah', 'modula-best-grid-gallery' ), - 'chico' => esc_html__( 'Chico', 'modula-best-grid-gallery' ), - 'milo' => esc_html__( 'Milo', 'modula-best-grid-gallery' ), - 'julia' => esc_html__( 'Julia', 'modula-best-grid-gallery' ), - 'hera' => esc_html__( 'Hera', 'modula-best-grid-gallery' ), - 'winston' => esc_html__( 'Winston', 'modula-best-grid-gallery' ), - 'selena' => esc_html__( 'Selena', 'modula-best-grid-gallery' ), - 'terry' => esc_html__( 'Terry', 'modula-best-grid-gallery' ), - 'phoebe' => esc_html__( 'Phoebe', 'modula-best-grid-gallery' ), - 'apollo' => esc_html__( 'Apollo', 'modula-best-grid-gallery' ), - 'steve' => esc_html__( 'Steve', 'modula-best-grid-gallery' ), - 'jazz' => esc_html__( 'Jazz', 'modula-best-grid-gallery' ), - 'ming' => esc_html__( 'Ming', 'modula-best-grid-gallery' ), - 'lexi' => esc_html__( 'Lexi', 'modula-best-grid-gallery' ), - 'duke' => esc_html__( 'Duke', 'modula-best-grid-gallery' ), - 'tilt_1' => esc_html__( 'Tilt Effect 1', 'modula-best-grid-gallery' ), - 'tilt_3' => esc_html__( 'Tilt Effect 2', 'modula-best-grid-gallery' ), - 'tilt_7' => esc_html__( 'Tilt Effect 3', 'modula-best-grid-gallery' ), - 'centered-bottom' => esc_html__( 'Center Bottom', 'modula-best-grid-gallery' ), - - ) ); + case 'hover-effect': + $hovers = apply_filters( + 'modula_available_hover_effects', + array( + 'none' => esc_html__( 'None', 'modula-best-grid-gallery' ), + 'pufrobo' => esc_html__( 'Pufrobo', 'modula-best-grid-gallery' ), + ) + ); + $pro_hovers = apply_filters( + 'modula_pro_hover_effects', + array( + 'fluid-up' => esc_html__( 'Fluid Up', 'modula-best-grid-gallery' ), + 'greyscale' => esc_html__( 'Greyscale', 'modula-best-grid-gallery' ), + 'under' => esc_html__( 'Under Image', 'modula-best-grid-gallery' ), + 'hide' => esc_html__( 'Hide', 'modula-best-grid-gallery' ), + 'quiet' => esc_html__( 'Quiet', 'modula-best-grid-gallery' ), + 'catinelle' => esc_html__( 'Catinelle', 'modula-best-grid-gallery' ), + 'reflex' => esc_html__( 'Reflex', 'modula-best-grid-gallery' ), + 'curtain' => esc_html__( 'Curtain', 'modula-best-grid-gallery' ), + 'lens' => esc_html__( 'Lens', 'modula-best-grid-gallery' ), + 'appear' => esc_html__( 'Appear', 'modula-best-grid-gallery' ), + 'crafty' => esc_html__( 'Crafty', 'modula-best-grid-gallery' ), + 'seemo' => esc_html__( 'Seemo', 'modula-best-grid-gallery' ), + 'comodo' => esc_html__( 'Comodo', 'modula-best-grid-gallery' ), + 'lily' => esc_html__( 'Lily', 'modula-best-grid-gallery' ), + 'sadie' => esc_html__( 'Sadie', 'modula-best-grid-gallery' ), + 'honey' => esc_html__( 'Honey', 'modula-best-grid-gallery' ), + 'layla' => esc_html__( 'Layla', 'modula-best-grid-gallery' ), + 'zoe' => esc_html__( 'Zoe', 'modula-best-grid-gallery' ), + 'oscar' => esc_html__( 'Oscar', 'modula-best-grid-gallery' ), + 'marley' => esc_html__( 'Marley', 'modula-best-grid-gallery' ), + 'ruby' => esc_html__( 'Ruby', 'modula-best-grid-gallery' ), + 'roxy' => esc_html__( 'Roxy', 'modula-best-grid-gallery' ), + 'bubba' => esc_html__( 'Bubba', 'modula-best-grid-gallery' ), + 'dexter' => esc_html__( 'Dexter', 'modula-best-grid-gallery' ), + 'sarah' => esc_html__( 'Sarah', 'modula-best-grid-gallery' ), + 'chico' => esc_html__( 'Chico', 'modula-best-grid-gallery' ), + 'milo' => esc_html__( 'Milo', 'modula-best-grid-gallery' ), + 'julia' => esc_html__( 'Julia', 'modula-best-grid-gallery' ), + 'hera' => esc_html__( 'Hera', 'modula-best-grid-gallery' ), + 'winston' => esc_html__( 'Winston', 'modula-best-grid-gallery' ), + 'selena' => esc_html__( 'Selena', 'modula-best-grid-gallery' ), + 'terry' => esc_html__( 'Terry', 'modula-best-grid-gallery' ), + 'phoebe' => esc_html__( 'Phoebe', 'modula-best-grid-gallery' ), + 'apollo' => esc_html__( 'Apollo', 'modula-best-grid-gallery' ), + 'steve' => esc_html__( 'Steve', 'modula-best-grid-gallery' ), + 'jazz' => esc_html__( 'Jazz', 'modula-best-grid-gallery' ), + 'ming' => esc_html__( 'Ming', 'modula-best-grid-gallery' ), + 'lexi' => esc_html__( 'Lexi', 'modula-best-grid-gallery' ), + 'duke' => esc_html__( 'Duke', 'modula-best-grid-gallery' ), + 'tilt_1' => esc_html__( 'Tilt Effect 1', 'modula-best-grid-gallery' ), + 'tilt_3' => esc_html__( 'Tilt Effect 2', 'modula-best-grid-gallery' ), + 'tilt_7' => esc_html__( 'Tilt Effect 3', 'modula-best-grid-gallery' ), + 'centered-bottom' => esc_html__( 'Center Bottom', 'modula-best-grid-gallery' ), + + ) + ); $html .= '

' . esc_html__( 'Select one of the below hover effects.', 'modula-best-grid-gallery' ) . '

'; @@ -602,15 +610,15 @@ private function _render_field( $field, $value = '' ) { $html .= '
'; - $effect_array = array( 'tilt_1', 'tilt_3', 'tilt_7', ); + $effect_array = array( 'tilt_1', 'tilt_3', 'tilt_7' ); $overlay_array = array( 'tilt_2', 'tilt_3', 'tilt_7' ); $svg_array = array( 'tilt_1', 'tilt_7' ); - $jtg_body = array( 'lily','centered-bottom', 'sadie', 'ruby', 'bubba', 'dexter', 'chico', 'ming' ); + $jtg_body = array( 'lily', 'centered-bottom', 'sadie', 'ruby', 'bubba', 'dexter', 'chico', 'ming' ); $effects_html = ''; foreach ( $hovers as $key => $name ) { - $class = array( 'modula-item' ); + $class = array( 'modula-item' ); $class[] = 'effect-' . $key; if ( $pro_hovers && array_key_exists( $key, $pro_hovers ) ) { $class[] = 'modula-preview-upsell'; @@ -618,7 +626,7 @@ private function _render_field( $field, $value = '' ) { $effect_elements = Modula_Helper::hover_effects_elements( $key ); $effect = ''; - $effect .= '
'; + $effect .= '
'; if ( ! $pro_hovers || ! array_key_exists( $key, $pro_hovers ) ) { $effect .= ''; @@ -626,11 +634,11 @@ private function _render_field( $field, $value = '' ) { $effect .= '
'; if ( $pro_hovers && array_key_exists( $key, $pro_hovers ) ) { - $effect .= '' . esc_html__( 'Premium', 'modula-best-grid-gallery' ) . ''; - $class[] = 'pro-only'; + $effect .= '' . esc_html__( 'Premium', 'modula-best-grid-gallery' ) . ''; + $class[] = 'pro-only'; } if ( $key === $value ) { - $effect .= '' . esc_html__( 'Currently Active', 'modula-best-grid-gallery' ) . ''; + $effect .= '' . esc_html__( 'Currently Active', 'modula-best-grid-gallery' ) . ''; } $effect .= '
'; @@ -648,14 +656,13 @@ private function _render_field( $field, $value = '' ) { if ( in_array( $key, $svg_array ) ) { $effect .= '
'; } - } if ( 'none' != $key ) { $effect .= '
'; - if ( $effect_elements[ 'title' ] ) { + if ( $effect_elements['title'] ) { $effect .= '
Lorem ipsum
'; } @@ -663,13 +670,13 @@ private function _render_field( $field, $value = '' ) { $effect .= '
'; } - if ( $effect_elements[ 'description' ] ) { + if ( $effect_elements['description'] ) { $effect .= '

Quisque diam erat, mollisvitae enim eget

'; } else { $effect .= '

'; } - if ( $effect_elements[ 'social' ] ) { + if ( $effect_elements['social'] ) { $effect .= '
'; $effect .= '' . Modula_Helper::get_icon( 'twitter' ) . ''; $effect .= '' . Modula_Helper::get_icon( 'facebook' ) . ''; @@ -688,25 +695,25 @@ private function _render_field( $field, $value = '' ) { $effect .= '
'; $effect .= '
'; $effect .= '

' . $name . '

'; - if ( $effect_elements[ 'title' ] || $effect_elements[ 'description' ] || $effect_elements[ 'social' ] || $effect_elements[ 'scripts' ] ) { - + if ( $effect_elements['title'] || $effect_elements['description'] || $effect_elements['social'] || $effect_elements['scripts'] ) { + $effect .= '
'; $effect .= '

' . esc_html__( 'This effect is compatible with:', 'modula-best-grid-gallery' ); - if ( $effect_elements[ 'title' ] ) { + if ( $effect_elements['title'] ) { $effect .= ' ' . esc_html__( 'Title', 'modula-best-grid-gallery' ) . ','; } - if ( $effect_elements[ 'description' ] ) { + if ( $effect_elements['description'] ) { $effect .= ' ' . esc_html__( 'Description', 'modula-best-grid-gallery' ) . ','; } - if ( $effect_elements[ 'social' ] ) { + if ( $effect_elements['social'] ) { $effect .= ' ' . esc_html__( 'Social Icons', 'modula-best-grid-gallery' ) . ''; } $effect .= '

'; - if ( $effect_elements[ 'scripts' ] ) { + if ( $effect_elements['scripts'] ) { $effect .= '

' . esc_html__( 'This effect will add an extra js script to your gallery', 'modula-best-grid-gallery' ) . '

'; } else { $effect .= '

 

'; @@ -715,14 +722,14 @@ private function _render_field( $field, $value = '' ) { $effect .= '
'; } - + $effect .= '
'; $effect .= '
'; $effect .= '
'; - if( $key === $value ){ + if ( $key === $value ) { $effects_html = $effect . $effects_html; - }else{ + } else { $effects_html .= $effect; } } @@ -730,60 +737,60 @@ private function _render_field( $field, $value = '' ) { $html .= $effects_html . '
'; // Hook to change how hover effects field is rendered - $html = apply_filters( "modula_render_hover_effect_field_type", $html, $field ); + $html = apply_filters( 'modula_render_hover_effect_field_type', $html, $field ); - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; - case 'dimensions-select' : + case 'dimensions-select': $sizes = Modula_Helper::get_image_sizes(); - $html = ''; $infos = ''; foreach ( $sizes as $key => $size ) { - $html .= ''; + $html .= ''; $infos .= '
' . esc_html__( 'Image Size', 'modula-best-grid-gallery' ) . ': ' . $size['width'] . 'x' . $size['height']; - $infos .= '. '.esc_html__('Crop','modula-best-grid-gallery').': ' . ( boolval( $size['crop'] ) ? 'true' : 'false' ) . '
'; + $infos .= '. ' . esc_html__( 'Crop', 'modula-best-grid-gallery' ) . ': ' . ( boolval( $size['crop'] ) ? 'true' : 'false' ) . '
'; } - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; $html .= ''; if ( '' != $infos ) { $html .= '
' . $infos . '
'; } break; - case 'textarea-placeholder' : - $html = '
'; + case 'textarea-placeholder': + $html = '
'; $html .= ''; $html .= '
'; $html .= '
'; foreach ( $field['values'] as $key => $value ) { - + $html .= ""; $html .= esc_html__( $value, 'modula-best-grid-gallery' ); $html .= ''; } $html .= '
'; - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; - case 'placeholder' : - $html = ''; + case 'placeholder': + $html = ''; $html .= '
'; foreach ( $field['values'] as $key => $value ) { - + $html .= ""; $html .= esc_html__( $value, 'modula-best-grid-gallery' ); $html .= ''; } $html .= '
'; - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; @@ -791,24 +798,23 @@ private function _render_field( $field, $value = '' ) { /* Filter for render custom field types */ $html = apply_filters( "modula_render_{$field['type']}_field_type", $html, $field, $value ); - if(isset($field['afterrow'])){ - $html .= '

'.esc_html($field['afterrow']).'

'; + if ( isset( $field['afterrow'] ) ) { + $html .= '

' . esc_html( $field['afterrow'] ) . '

'; } break; } - if( isset( $field['children'] ) && is_array( $field['children'] ) && 0 < count( $field['children'] ) ){ + if ( isset( $field['children'] ) && is_array( $field['children'] ) && 0 < count( $field['children'] ) ) { - $children = htmlspecialchars(json_encode( $field['children'] ), ENT_QUOTES, 'UTF-8'); - - $html .= '' . absint( count( $field['children'] ) ) . esc_html__(' other settings', 'modula-best-grid-gallery' ) . ' '; - } + $children = htmlspecialchars( json_encode( $field['children'] ), ENT_QUOTES, 'UTF-8' ); - return apply_filters( "modula_render_field_type", $html, $field, $value ); + $html .= '' . absint( count( $field['children'] ) ) . esc_html__( ' other settings', 'modula-best-grid-gallery' ) . ' '; + } + return apply_filters( 'modula_render_field_type', $html, $field, $value ); } public function print_modula_templates() { include 'modula-js-templates.php'; } -} \ No newline at end of file +} diff --git a/includes/admin/class-modula-upsells.php b/includes/admin/class-modula-upsells.php index b439e7e0..3fea51da 100644 --- a/includes/admin/class-modula-upsells.php +++ b/includes/admin/class-modula-upsells.php @@ -24,17 +24,20 @@ function __construct() { if ( class_exists( 'WPChill_Upsells' ) ) { // Initialize WPChill upsell class - $args = apply_filters( 'modula_upsells_args', array( + $args = apply_filters( + 'modula_upsells_args', + array( 'shop_url' => 'https://wp-modula.com', 'slug' => 'modula', - ) ); + ) + ); $wpchill_upsell = WPChill_Upsells::get_instance( $args ); // output wpchill lite vs pro page add_action( 'modula_lite_vs_premium_page', array( $wpchill_upsell, 'lite_vs_premium' ), 30, 1 ); - add_filter( 'modula_uninstall_transients', array( $wpchill_upsell, 'smart_upsells_transients' ) , 15 ); + add_filter( 'modula_uninstall_transients', array( $wpchill_upsell, 'smart_upsells_transients' ), 15 ); $this->wpchill_upsells = $wpchill_upsell; } @@ -68,39 +71,37 @@ function __construct() { add_filter( 'modula_image_licensing_tab_content', array( $this, 'image_licensing_tab_upsell' ) ); // Modula Advanced Shortcodes settings tab upsells - add_action('modula_admin_tab_compression', array( $this, 'render_speedup_tab' ) ); - add_action('modula_admin_tab_standalone', array( $this, 'render_albums_tab' ) ); - add_action('modula_admin_tab_shortcodes', array( $this, 'render_advanced_shortcodes_tab' ) ); - add_action('modula_admin_tab_watermark', array( $this, 'render_watermark_tab' ) ); - add_action('modula_admin_tab_roles', array( $this, 'render_roles_tab' ) ); - add_action('modula_admin_tab_whitelabel', array( $this, 'render_whitelabel_tab' ) ); + add_action( 'modula_admin_tab_imageseo', array( $this, 'imageseo_tab_upsell' ) ); + add_action( 'modula_admin_tab_compression', array( $this, 'render_speedup_tab' ) ); + add_action( 'modula_admin_tab_standalone', array( $this, 'render_albums_tab' ) ); + add_action( 'modula_admin_tab_shortcodes', array( $this, 'render_advanced_shortcodes_tab' ) ); + add_action( 'modula_admin_tab_watermark', array( $this, 'render_watermark_tab' ) ); + add_action( 'modula_admin_tab_roles', array( $this, 'render_roles_tab' ) ); + add_action( 'modula_admin_tab_whitelabel', array( $this, 'render_whitelabel_tab' ) ); // Remove upsells badge if user's license includes the addon - add_filter('modula_admin_page_tabs', array($this, 'remove_upsells_badge' ), 999 ); - - + add_filter( 'modula_admin_page_tabs', array( $this, 'remove_upsells_badge' ), 999 ); - if ( $this->wpchill_upsells && $this->wpchill_upsells->is_upgradable_addon( 'modula-albums' ) ) { + if ( $this->wpchill_upsells && $this->wpchill_upsells->is_upgradable_addon( 'modula-albums' ) ) { add_filter( 'modula_cpt_metaboxes', array( $this, 'albums_upsell_meta' ) ); } if ( $this->wpchill_upsells && $this->wpchill_upsells->is_upgradable_addon( 'modula-whitelabel' ) ) { - add_filter('modula_admin_page_tabs', array( $this, 'add_whitelabel_tab' ), 140 ); + add_filter( 'modula_admin_page_tabs', array( $this, 'add_whitelabel_tab' ), 140 ); } /* Fire our meta box setup function on the post editor screen. */ add_action( 'load-post.php', array( $this, 'meta_boxes_setup' ) ); add_action( 'load-post-new.php', array( $this, 'meta_boxes_setup' ) ); - $this->free_vs_pro_link = admin_url('edit.php?post_type=modula-gallery&page=modula-lite-vs-pro'); + $this->free_vs_pro_link = admin_url( 'edit.php?post_type=modula-gallery&page=modula-lite-vs-pro' ); // Upgrade to PRO plugin action link add_filter( 'plugin_action_links_' . MODULA_FILE, array( $this, 'filter_action_links' ), 60 ); // GO PRO admim menu link add_filter( 'modula_admin_page_link', array( $this, 'add_go_pro_menu_item' ) ); - add_action( 'admin_init', array( $this, 'go_pro_redirect' ) ); - + add_action( 'admin_init', array( $this, 'go_pro_redirect' ) ); } public function generate_upsell_box( $title, $description, $tab, $features = array() ) { @@ -116,7 +117,7 @@ public function generate_upsell_box( $title, $description, $tab, $features = arr $upsell_box .= '
[?]'; $upsell_box .= '
' . esc_html( $feature['tooltip'] ) . '
'; $upsell_box .= '
'; - $upsell_box .= "

" . esc_html( $feature['feature'] ) . "

"; + $upsell_box .= '

' . esc_html( $feature['feature'] ) . '

'; } else { $upsell_box .= '' . esc_html( $feature['feature'] ); } @@ -126,7 +127,7 @@ public function generate_upsell_box( $title, $description, $tab, $features = arr } $upsell_box .= ''; } - if( $description ){ + if ( $description ) { $upsell_box .= '

' . esc_html( $description ) . '

'; } @@ -135,7 +136,7 @@ public function generate_upsell_box( $title, $description, $tab, $features = arr public function loadingeffects_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) { return; } @@ -147,7 +148,7 @@ public function loadingeffects_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'loadingeffects' ); @@ -158,12 +159,11 @@ public function loadingeffects_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function hovereffects_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) { return; } @@ -175,7 +175,7 @@ public function hovereffects_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'hovereffects' ); @@ -186,12 +186,11 @@ public function hovereffects_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function video_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-video') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-video' ) ) { return; } @@ -203,7 +202,7 @@ public function video_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-video' ); @@ -214,12 +213,11 @@ public function video_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function speedup_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-speedup') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-speedup' ) ) { return; } @@ -231,7 +229,7 @@ public function speedup_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-speedup' ); @@ -242,12 +240,11 @@ public function speedup_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function filters_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) { return; } @@ -259,7 +256,7 @@ public function filters_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'filters' ); @@ -270,12 +267,11 @@ public function filters_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function lightboxes_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) { return; } @@ -284,82 +280,82 @@ public function lightboxes_tab_upsell( $tab_content ) { $tab = 'lightboxes'; $features = array( - array( - 'tooltip' => esc_html__( 'Enable this to allow loop navigation inside lightbox', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Loop Navigation', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Toggle on to show the image title in the lightbox above the caption.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Show Image Title', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Toggle on to show the image caption in the lightbox.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Show Image Caption', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Select the position of the caption and title inside the lightbox.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Title and Caption Position', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Enable or disable keyboard navigation inside lightbox', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Keyboard Navigation', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Enable or disable mousewheel navigation inside lightbox', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Mousewheel Navigation', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Display the toolbar which contains the action buttons on top right corner.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Toolbar', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Close the slide if user clicks/double clicks on slide( not image ).', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Close on slide click', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Display the counter at the top left corner.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Infobar', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Open the lightbox automatically in Full Screen mode.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Auto start in Fullscreen', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Place the thumbnails at the bottom of the lightbox. This will automatically put `y` axis for thumbnails.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Thumbnails at bottom ', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Select vertical or horizontal scrolling for thumbnails', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Thumb axis', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Display thumbnails on lightbox opening.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Auto start thumbnail ', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Choose the lightbox transition effect between slides.', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Transition Effect ', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Allow panning/swiping', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Allow Swiping ', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Toggle ON to show all images', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Show all images ', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Choose the open/close animation effect of the lightbox', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Open/Close animation', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Set the lightbox background color', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Lightbox background color', 'modula-best-grid-gallery' ), - ), - array( - 'tooltip' => esc_html__( 'Allow your visitors to share their favorite images from inside the lightbox', 'modula-best-grid-gallery' ), - 'feature' => esc_html__( 'Lightbox social share', 'modula-best-grid-gallery' ), - ) + array( + 'tooltip' => esc_html__( 'Enable this to allow loop navigation inside lightbox', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Loop Navigation', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Toggle on to show the image title in the lightbox above the caption.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Show Image Title', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Toggle on to show the image caption in the lightbox.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Show Image Caption', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Select the position of the caption and title inside the lightbox.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Title and Caption Position', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Enable or disable keyboard navigation inside lightbox', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Keyboard Navigation', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Enable or disable mousewheel navigation inside lightbox', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Mousewheel Navigation', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Display the toolbar which contains the action buttons on top right corner.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Toolbar', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Close the slide if user clicks/double clicks on slide( not image ).', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Close on slide click', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Display the counter at the top left corner.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Infobar', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Open the lightbox automatically in Full Screen mode.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Auto start in Fullscreen', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Place the thumbnails at the bottom of the lightbox. This will automatically put `y` axis for thumbnails.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Thumbnails at bottom ', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Select vertical or horizontal scrolling for thumbnails', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Thumb axis', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Display thumbnails on lightbox opening.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Auto start thumbnail ', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Choose the lightbox transition effect between slides.', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Transition Effect ', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Allow panning/swiping', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Allow Swiping ', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Toggle ON to show all images', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Show all images ', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Choose the open/close animation effect of the lightbox', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Open/Close animation', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Set the lightbox background color', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Lightbox background color', 'modula-best-grid-gallery' ), + ), + array( + 'tooltip' => esc_html__( 'Allow your visitors to share their favorite images from inside the lightbox', 'modula-best-grid-gallery' ), + 'feature' => esc_html__( 'Lightbox social share', 'modula-best-grid-gallery' ), + ), ); $tab_content .= '
'; @@ -367,7 +363,7 @@ public function lightboxes_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'lightboxes' ); @@ -378,7 +374,6 @@ public function lightboxes_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function misc_tab_upsell( $tab_content ) { @@ -409,7 +404,7 @@ public function misc_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'misc' ); @@ -420,12 +415,11 @@ public function misc_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function password_protect_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-password-protect') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-password-protect' ) ) { return; } @@ -437,7 +431,7 @@ public function password_protect_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-password-protect' ); @@ -448,12 +442,11 @@ public function password_protect_tab_upsell( $tab_content ) { $tab_content .= ''; return $tab_content; - } public function watermark_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-watermark') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-watermark' ) ) { return; } @@ -465,7 +458,7 @@ public function watermark_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-watermark' ); @@ -476,12 +469,11 @@ public function watermark_tab_upsell( $tab_content ) { $tab_content .= ''; return $tab_content; - } public function slideshow_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-slideshow') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-slideshow' ) ) { return; } @@ -493,7 +485,7 @@ public function slideshow_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-slideshow' ); @@ -504,12 +496,11 @@ public function slideshow_tab_upsell( $tab_content ) { $tab_content .= ''; return $tab_content; - } public function zoom_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-zoom') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-zoom' ) ) { return; } @@ -517,18 +508,18 @@ public function zoom_tab_upsell( $tab_content ) { $upsell_description = esc_html__( "With the Modula ZOOM extension you'll be able to allow your users to zoom in on your photos, using different zoom effects, making sure every little detail of your photo doesn't go unnoticed.", 'modula-best-grid-gallery' ); $features = array( - array( - 'feature' => 'Zoom in effect on images, inside the lightbox', - ), - array( - 'feature' => 'Multiple zooming effects, such as: basic, lens and inner', - ), - array( - 'feature' => "Control the zoom effect's shape, size, tint and opacity", - ), - array( - 'feature' => "Impress your potential clients with detail rich images that don't go unnoticed", - ), + array( + 'feature' => 'Zoom in effect on images, inside the lightbox', + ), + array( + 'feature' => 'Multiple zooming effects, such as: basic, lens and inner', + ), + array( + 'feature' => "Control the zoom effect's shape, size, tint and opacity", + ), + array( + 'feature' => "Impress your potential clients with detail rich images that don't go unnoticed", + ), ); $tab_content .= '

'; @@ -536,7 +527,7 @@ public function zoom_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-zoom' ); @@ -547,30 +538,29 @@ public function zoom_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function exif_tab_upsell( $tab_content ) { - if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-exif') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-exif' ) ) { return; } $upsell_title = esc_html__( 'Looking to add EXIF image info functionality to your lightbox?', 'modula-best-grid-gallery' ); $upsell_description = esc_html__( "With the Modula EXIF extension you'll be able to enrich your photos with the following metadata: camera model, lens, shutter speed, aperture, ISO and the date the photography was taken. More so, by using this extension, you can edit your EXIF metadata on the go, or add it to images that are missing it. ", 'modula-best-grid-gallery' ); $features = array( - array( - 'feature' => 'EXIF data is automatically read and displayed', - ), - array( - 'feature' => 'Manually add EXIF data on images that are missing it', - ), - array( - 'feature' => 'Control how you display your EXIF data in lighboxes', - ), - array( - 'feature' => 'On-the go editing for EXIF metadata', - ), + array( + 'feature' => 'EXIF data is automatically read and displayed', + ), + array( + 'feature' => 'Manually add EXIF data on images that are missing it', + ), + array( + 'feature' => 'Control how you display your EXIF data in lighboxes', + ), + array( + 'feature' => 'On-the go editing for EXIF metadata', + ), ); $tab_content .= '
'; @@ -578,7 +568,7 @@ public function exif_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-exif' ); @@ -589,12 +579,32 @@ public function exif_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; + } + + public function imageseo_tab_upsell( $tab_content ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-imageseo' ) ) { + return; + } + ?> +
+

+

+

+ free_vs_pro_link ) . '" class="button">' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; + + echo apply_filters( 'modula_upsell_buttons', $buttons, 'modula-imageseo' ); + ?> +

+
+ wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon('modula-download') ) { + if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-download' ) ) { return; } @@ -602,15 +612,15 @@ public function download_tab_upsell( $tab_content ) { $upsell_description = esc_html__( 'Give your users the ability to download your images, galleries or albums with an easy to use shortcode.', 'modula-best-grid-gallery' ); $features = array( - array( - 'feature' => 'Download entire galleries, albums or a single photo', - ), - array( - 'feature' => 'Select the image sizes the user can download (thumbnail, full size, or custom)', - ), - array( - 'feature' => 'Comes with a powerful shortcode that you can use to render the button anywhere', - ), + array( + 'feature' => 'Download entire galleries, albums or a single photo', + ), + array( + 'feature' => 'Select the image sizes the user can download (thumbnail, full size, or custom)', + ), + array( + 'feature' => 'Comes with a powerful shortcode that you can use to render the button anywhere', + ), ); $tab_content .= '
'; @@ -618,7 +628,7 @@ public function download_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-download' ); @@ -629,7 +639,6 @@ public function download_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } public function image_licensing_tab_upsell( $tab_content ) { @@ -639,23 +648,23 @@ public function image_licensing_tab_upsell( $tab_content ) { } $upsell_title = esc_html__( 'Trying to add image licenses to your gallery?', 'modula-best-grid-gallery' ); - $upsell_description = esc_html__( "Streamline licensing, protect your work, and monetize effortlessly with our extension.", 'modula-best-grid-gallery' ); + $upsell_description = esc_html__( 'Streamline licensing, protect your work, and monetize effortlessly with our extension.', 'modula-best-grid-gallery' ); $features = array( - array( - 'feature' => 'You simplify your image licensing process, saving time and effort, perfect for your regular licensing needs.', - ), - array( - 'feature' => 'You ensure proper attribution for all your images, protecting against copyright infringement and upholding your rights.', - ), - array( - 'feature' => 'You enjoy the flexibility to set different licensing terms for your images, catering to your unique needs and scenarios.', - ), - array( - 'feature' => 'You add a layer of professionalism to your portfolio, demonstrating your serious approach to copyright and image management.', - ), - array( - 'feature' => 'You open new revenue streams by monetizing your work directly through your portfolio, enhancing your earning potential', - ), + array( + 'feature' => 'You simplify your image licensing process, saving time and effort, perfect for your regular licensing needs.', + ), + array( + 'feature' => 'You ensure proper attribution for all your images, protecting against copyright infringement and upholding your rights.', + ), + array( + 'feature' => 'You enjoy the flexibility to set different licensing terms for your images, catering to your unique needs and scenarios.', + ), + array( + 'feature' => 'You add a layer of professionalism to your portfolio, demonstrating your serious approach to copyright and image management.', + ), + array( + 'feature' => 'You open new revenue streams by monetizing your work directly through your portfolio, enhancing your earning potential', + ), ); $tab_content .= '
'; @@ -663,7 +672,7 @@ public function image_licensing_tab_upsell( $tab_content ) { $tab_content .= '

'; - $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; + $buttons = '' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . ''; $buttons .= '' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . ''; $buttons = apply_filters( 'modula_upsell_buttons', $buttons, 'modula-image-licensing' ); @@ -674,20 +683,18 @@ public function image_licensing_tab_upsell( $tab_content ) { $tab_content .= '

'; return $tab_content; - } - + public function meta_boxes_setup() { /* Add meta boxes on the 'add_meta_boxes' hook. */ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 10 ); - } public function add_meta_boxes() { - if ( $this->wpchill_upsells && $this->wpchill_upsells->is_upgradable_addon('modula') ) { + if ( $this->wpchill_upsells && $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) { add_meta_box( 'modula-sorting-upsell', // Unique ID esc_html__( 'Gallery sorting', 'modula-best-grid-gallery' ), // Title @@ -704,7 +711,7 @@ public function output_sorting_upsell() {