first commit

This commit is contained in:
2024-12-23 22:14:28 +01:00
commit f4cedfc60e
6641 changed files with 2890956 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
jQuery(function ($) {
var headerNavBoxBg = $('<div class="header-nav-box-bg"></div>');
headerNavBoxBg.css({
'position': 'absolute',
'top': '0',
'left': '50%',
'width': $('nav .header-nav-box > .e-con-inner > .elementor-element').width(),
'height': '100%',
'transform': 'translateX(-50%)',
'background': '#fff',
});
$('nav .header-nav-box > .e-con-inner').append(headerNavBoxBg)
$(window).on('scroll', function () {
var $headerNavBox = $('nav .header-nav-box');
if ($headerNavBox.hasClass('elementor-sticky')) {
var scrollTop = $(window).scrollTop();
var scrollThreshold = 100;
var stickyOffset = $headerNavBox.offset().top;
var maxScrollDistance = 300;
if (scrollTop > scrollThreshold) {
var scrollProgress = Math.min((scrollTop - scrollThreshold) / (maxScrollDistance - scrollThreshold), 1);
console.log(scrollProgress);
var newWidth = (50 + scrollProgress * 50) + 'vw';
headerNavBoxBg.css({
'width': newWidth,
});
}
if(scrollProgress == 1) {
headerNavBoxBg.css({
'box-shadow': '0px 10px 10px -4px rgba(0, 0, 0, 0.1)',
});
} else {
headerNavBoxBg.css({
'box-shadow': 'none',
});
}
} else {
headerNavBoxBg.css({
'width': $('nav .header-nav-box > .e-con-inner > .elementor-element').width(),
});
}
});
});

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-api', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => '57b704063cdbc7579acb');

View File

@@ -0,0 +1 @@
#hello-elementor-settings .components-placeholder{background:#f1f1f1}#hello-elementor-settings .hello_elementor__header{background-color:#fff;box-shadow:0 1px 0 hsla(0,0%,84%,.5),0 1px 2px #eee;margin-inline-start:-2em;padding:20px 10px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container{margin:0 auto;max-width:750px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title{align-items:center;display:flex;justify-content:center}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title .dashicon{color:#757575}#hello-elementor-settings .hello_elementor__main{margin-inline-end:auto;margin-inline-start:auto;max-width:750px}#hello-elementor-settings .hello_elementor__main .components-panel{background:none;border:none}#hello-elementor-settings .hello_elementor__main .components-panel__body{background:#fff;border:1px solid #e2e4e7;margin:1rem 0}#hello-elementor-settings .hello_elementor__main .components-notice{margin:0;margin-block-end:20px}#hello-elementor-settings .hello_elementor__main .components-notice .dashicon{color:#f0b849;padding-inline-end:10px}#hello-elementor-settings .hello_elementor__main .components-notice button{display:none}#hello-elementor-settings .hello_elementor__main .code-example{border-radius:4px;display:inline-block;font-size:10px;margin-block-end:.25rem}#hello-elementor-settings .hello_elementor__main .code-example+:not(.code-example){margin-block-start:1.25rem}#hello-elementor-settings .components-base-control__help{margin-block-start:.5rem}#hello-elementor-settings .hello_elementor__notices .components-snackbar{bottom:.5rem;position:fixed}#hello-elementor-settings .hello_elementor__action_links{margin-block-end:20px;margin-block-start:50px;text-align:center}#hello-elementor-settings .hello_elementor__action_links__title{font-weight:700}#hello-elementor-settings .hello_elementor__action_links__message{font-weight:400}

View File

@@ -0,0 +1,428 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 696:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinks = void 0;
const ActionLinks = ({
image,
alt,
title,
message,
button,
link
}) => {
return /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__action_links"
}, /*#__PURE__*/React.createElement("img", {
src: image,
alt: alt
}), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__title"
}, title), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__message"
}, message), /*#__PURE__*/React.createElement("a", {
className: "components-button is-secondary",
href: link,
target: "_blank",
rel: "noreferrer"
}, button));
};
exports.ActionLinks = ActionLinks;
/***/ }),
/***/ 19:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(994);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPage = void 0;
var _react = __webpack_require__(609);
var _notices = __webpack_require__(692);
var _data = __webpack_require__(143);
var _i18n = __webpack_require__(723);
var _api = _interopRequireDefault(__webpack_require__(863));
var _components = __webpack_require__(427);
var _settingsPanel = __webpack_require__(425);
var _actionLinksPanel = __webpack_require__(442);
const Notices = () => {
const notices = (0, _data.useSelect)(select => select(_notices.store).getNotices().filter(notice => 'snackbar' === notice.type), []);
const {
removeNotice
} = (0, _data.useDispatch)(_notices.store);
return /*#__PURE__*/React.createElement(_components.SnackbarList, {
className: "edit-site-notices",
notices: notices,
onRemove: removeNotice
});
};
const SETTINGS = {
DESCRIPTION_META_TAG: '_description_meta_tag',
SKIP_LINK: '_skip_link',
HEADER_FOOTER: '_header_footer',
PAGE_TITLE: '_page_title',
HELLO_STYLE: '_hello_style',
HELLO_THEME: '_hello_theme'
};
const SettingsPage = () => {
const [hasLoaded, setHasLoaded] = (0, _react.useState)(false);
const [settingsData, setSettingsData] = (0, _react.useState)({});
const settingsPrefix = 'hello_elementor_settings';
/**
* Update settings data.
*
* @param {string} settingsName
* @param {string} settingsValue
*/
const updateSettings = (settingsName, settingsValue) => {
setSettingsData({
...settingsData,
[settingsName]: settingsValue
});
};
/**
* Save settings to server.
*/
const saveSettings = () => {
const data = {};
Object.values(SETTINGS).forEach(value => data[`${settingsPrefix}${value}`] = settingsData[value] ? 'true' : '');
const settings = new _api.default.models.Settings(data);
settings.save();
(0, _data.dispatch)('core/notices').createNotice('success', (0, _i18n.__)('Settings Saved', 'hello-elementor'), {
type: 'snackbar',
isDismissible: true
});
};
(0, _react.useEffect)(() => {
const fetchSettings = async () => {
try {
await _api.default.loadPromise;
const settings = new _api.default.models.Settings();
const response = await settings.fetch();
const data = {};
Object.values(SETTINGS).forEach(value => data[value] = response[`${settingsPrefix}${value}`]);
setSettingsData(data);
setHasLoaded(true);
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
};
if (hasLoaded) {
return;
}
fetchSettings();
}, [settingsData]);
if (!hasLoaded) {
return /*#__PURE__*/React.createElement(_components.Placeholder, null, /*#__PURE__*/React.createElement(_components.Spinner, null));
}
return /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__header"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__container"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__title"
}, /*#__PURE__*/React.createElement("h1", null, (0, _i18n.__)('Hello Theme Settings', 'hello-elementor'))))), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__main"
}, /*#__PURE__*/React.createElement(_components.Panel, null, /*#__PURE__*/React.createElement(_settingsPanel.SettingsPanel, {
SETTINGS,
settingsData,
updateSettings
}), /*#__PURE__*/React.createElement(_components.Button, {
isPrimary: true,
onClick: saveSettings
}, (0, _i18n.__)('Save Settings', 'hello-elementor'))), /*#__PURE__*/React.createElement(_actionLinksPanel.ActionLinksPanel, null)), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__notices"
}, /*#__PURE__*/React.createElement(Notices, null)));
};
exports.SettingsPage = SettingsPage;
/***/ }),
/***/ 442:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinksPanel = void 0;
var _i18n = __webpack_require__(723);
var _actionLinks = __webpack_require__(696);
const actionLinks = {
'install-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-header-footer-experiment': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style using Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Design your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Activate header & footer experiment', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'style-header-footer': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style cross-site header & footer', 'hello-elementor'),
message: (0, _i18n.__)('Customize your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Start Designing', 'hello-elementor'),
link: helloAdminData.actionLinkURL
}
};
const ActionLinksPanel = () => {
if (!helloAdminData.actionLinkType) {
return;
}
return /*#__PURE__*/React.createElement(_actionLinks.ActionLinks, actionLinks[helloAdminData.actionLinkType]);
};
exports.ActionLinksPanel = ActionLinksPanel;
/***/ }),
/***/ 425:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPanel = void 0;
var _i18n = __webpack_require__(723);
var _components = __webpack_require__(427);
const SettingsPanel = ({
SETTINGS,
settingsData,
updateSettings
}) => {
const protocol = window.location.protocol || 'https:';
const hostname = window.location.hostname || 'example.com';
const prefix = protocol + '//' + hostname;
return /*#__PURE__*/React.createElement(_components.PanelBody, {
title: (0, _i18n.__)('Hello Theme Settings', 'hello-elementor')
}, /*#__PURE__*/React.createElement(_components.Notice, {
status: "warning",
isDismissible: "false"
}, /*#__PURE__*/React.createElement(_components.Dashicon, {
icon: "flag"
}), (0, _i18n.__)('Be cautious, disabling some of the following options may break your website.', 'hello-elementor')), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable description meta tag', 'hello-elementor'),
help: (0, _i18n.__)('Remove the description meta tag in singular content pages that contain an excerpt.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.DESCRIPTION_META_TAG] || false,
onChange: value => updateSettings(SETTINGS.DESCRIPTION_META_TAG, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <meta name=\"description\" content=\"...\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable skip link', 'hello-elementor'),
help: (0, _i18n.__)('Remove the "Skip to content" link used by screen-readers and users navigating with a keyboard.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.SKIP_LINK] || false,
onChange: value => updateSettings(SETTINGS.SKIP_LINK, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <a class=\"skip-link screen-reader-text\" href=\"#content\"> Skip to content </a> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable cross-site header & footer', 'hello-elementor'),
help: (0, _i18n.__)('Remove the header & footer sections from all pages, and their CSS/JS files.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.HEADER_FOOTER] || false,
onChange: value => updateSettings(SETTINGS.HEADER_FOOTER, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <header id=\"site-header\" class=\"site-header\"> ... </header> "), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <footer id=\"site-footer\" class=\"site-footer\"> ... </footer> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable page title', 'hello-elementor'),
help: (0, _i18n.__)('Remove the section above the content that contains the main heading of the page.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.PAGE_TITLE] || false,
onChange: value => updateSettings(SETTINGS.PAGE_TITLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <div class=\"page-header\"> <h1 class=\"entry-title\"> Post title </h1> </div> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello style.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's style.css file which contains CSS reset rules for unified cross-browser view.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_STYLE] || false,
onChange: value => updateSettings(SETTINGS.HELLO_STYLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/style.min.css\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello theme.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's theme.css file which contains CSS rules that style WordPress elements.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_THEME] || false,
onChange: value => updateSettings(SETTINGS.HELLO_THEME, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/theme.min.css\" /> "));
};
exports.SettingsPanel = SettingsPanel;
/***/ }),
/***/ 374:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 609:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 863:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["api"];
/***/ }),
/***/ 427:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["components"];
/***/ }),
/***/ 143:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["data"];
/***/ }),
/***/ 87:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["element"];
/***/ }),
/***/ 723:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ 692:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["notices"];
/***/ }),
/***/ 994:
/***/ ((module) => {
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
__webpack_require__(374);
var _element = __webpack_require__(87);
var _settingsPage = __webpack_require__(19);
const App = () => {
return /*#__PURE__*/React.createElement(_settingsPage.SettingsPage, null);
};
document.addEventListener('DOMContentLoaded', () => {
const rootElement = document.getElementById('hello-elementor-settings');
if (rootElement) {
(0, _element.render)( /*#__PURE__*/React.createElement(App, null), rootElement);
}
});
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-api', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => '57b704063cdbc7579acb');

View File

@@ -0,0 +1 @@
#hello-elementor-settings .components-placeholder{background:#f1f1f1}#hello-elementor-settings .hello_elementor__header{background-color:#fff;box-shadow:0 1px 0 hsla(0,0%,84%,.5),0 1px 2px #eee;margin-inline-start:-2em;padding:20px 10px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container{margin:0 auto;max-width:750px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title{align-items:center;display:flex;justify-content:center}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title .dashicon{color:#757575}#hello-elementor-settings .hello_elementor__main{margin-inline-end:auto;margin-inline-start:auto;max-width:750px}#hello-elementor-settings .hello_elementor__main .components-panel{background:none;border:none}#hello-elementor-settings .hello_elementor__main .components-panel__body{background:#fff;border:1px solid #e2e4e7;margin:1rem 0}#hello-elementor-settings .hello_elementor__main .components-notice{margin:0;margin-block-end:20px}#hello-elementor-settings .hello_elementor__main .components-notice .dashicon{color:#f0b849;padding-inline-end:10px}#hello-elementor-settings .hello_elementor__main .components-notice button{display:none}#hello-elementor-settings .hello_elementor__main .code-example{border-radius:4px;display:inline-block;font-size:10px;margin-block-end:.25rem}#hello-elementor-settings .hello_elementor__main .code-example+:not(.code-example){margin-block-start:1.25rem}#hello-elementor-settings .components-base-control__help{margin-block-start:.5rem}#hello-elementor-settings .hello_elementor__notices .components-snackbar{bottom:.5rem;position:fixed}#hello-elementor-settings .hello_elementor__action_links{margin-block-end:20px;margin-block-start:50px;text-align:center}#hello-elementor-settings .hello_elementor__action_links__title{font-weight:700}#hello-elementor-settings .hello_elementor__action_links__message{font-weight:400}

View File

@@ -0,0 +1,428 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 696:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinks = void 0;
const ActionLinks = ({
image,
alt,
title,
message,
button,
link
}) => {
return /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__action_links"
}, /*#__PURE__*/React.createElement("img", {
src: image,
alt: alt
}), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__title"
}, title), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__message"
}, message), /*#__PURE__*/React.createElement("a", {
className: "components-button is-secondary",
href: link,
target: "_blank",
rel: "noreferrer"
}, button));
};
exports.ActionLinks = ActionLinks;
/***/ }),
/***/ 19:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(994);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPage = void 0;
var _react = __webpack_require__(609);
var _notices = __webpack_require__(692);
var _data = __webpack_require__(143);
var _i18n = __webpack_require__(723);
var _api = _interopRequireDefault(__webpack_require__(863));
var _components = __webpack_require__(427);
var _settingsPanel = __webpack_require__(425);
var _actionLinksPanel = __webpack_require__(442);
const Notices = () => {
const notices = (0, _data.useSelect)(select => select(_notices.store).getNotices().filter(notice => 'snackbar' === notice.type), []);
const {
removeNotice
} = (0, _data.useDispatch)(_notices.store);
return /*#__PURE__*/React.createElement(_components.SnackbarList, {
className: "edit-site-notices",
notices: notices,
onRemove: removeNotice
});
};
const SETTINGS = {
DESCRIPTION_META_TAG: '_description_meta_tag',
SKIP_LINK: '_skip_link',
HEADER_FOOTER: '_header_footer',
PAGE_TITLE: '_page_title',
HELLO_STYLE: '_hello_style',
HELLO_THEME: '_hello_theme'
};
const SettingsPage = () => {
const [hasLoaded, setHasLoaded] = (0, _react.useState)(false);
const [settingsData, setSettingsData] = (0, _react.useState)({});
const settingsPrefix = 'hello_elementor_settings';
/**
* Update settings data.
*
* @param {string} settingsName
* @param {string} settingsValue
*/
const updateSettings = (settingsName, settingsValue) => {
setSettingsData({
...settingsData,
[settingsName]: settingsValue
});
};
/**
* Save settings to server.
*/
const saveSettings = () => {
const data = {};
Object.values(SETTINGS).forEach(value => data[`${settingsPrefix}${value}`] = settingsData[value] ? 'true' : '');
const settings = new _api.default.models.Settings(data);
settings.save();
(0, _data.dispatch)('core/notices').createNotice('success', (0, _i18n.__)('Settings Saved', 'hello-elementor'), {
type: 'snackbar',
isDismissible: true
});
};
(0, _react.useEffect)(() => {
const fetchSettings = async () => {
try {
await _api.default.loadPromise;
const settings = new _api.default.models.Settings();
const response = await settings.fetch();
const data = {};
Object.values(SETTINGS).forEach(value => data[value] = response[`${settingsPrefix}${value}`]);
setSettingsData(data);
setHasLoaded(true);
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
};
if (hasLoaded) {
return;
}
fetchSettings();
}, [settingsData]);
if (!hasLoaded) {
return /*#__PURE__*/React.createElement(_components.Placeholder, null, /*#__PURE__*/React.createElement(_components.Spinner, null));
}
return /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__header"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__container"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__title"
}, /*#__PURE__*/React.createElement("h1", null, (0, _i18n.__)('Hello Theme Settings', 'hello-elementor'))))), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__main"
}, /*#__PURE__*/React.createElement(_components.Panel, null, /*#__PURE__*/React.createElement(_settingsPanel.SettingsPanel, {
SETTINGS,
settingsData,
updateSettings
}), /*#__PURE__*/React.createElement(_components.Button, {
isPrimary: true,
onClick: saveSettings
}, (0, _i18n.__)('Save Settings', 'hello-elementor'))), /*#__PURE__*/React.createElement(_actionLinksPanel.ActionLinksPanel, null)), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__notices"
}, /*#__PURE__*/React.createElement(Notices, null)));
};
exports.SettingsPage = SettingsPage;
/***/ }),
/***/ 442:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinksPanel = void 0;
var _i18n = __webpack_require__(723);
var _actionLinks = __webpack_require__(696);
const actionLinks = {
'install-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-header-footer-experiment': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style using Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Design your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Activate header & footer experiment', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'style-header-footer': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style cross-site header & footer', 'hello-elementor'),
message: (0, _i18n.__)('Customize your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Start Designing', 'hello-elementor'),
link: helloAdminData.actionLinkURL
}
};
const ActionLinksPanel = () => {
if (!helloAdminData.actionLinkType) {
return;
}
return /*#__PURE__*/React.createElement(_actionLinks.ActionLinks, actionLinks[helloAdminData.actionLinkType]);
};
exports.ActionLinksPanel = ActionLinksPanel;
/***/ }),
/***/ 425:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPanel = void 0;
var _i18n = __webpack_require__(723);
var _components = __webpack_require__(427);
const SettingsPanel = ({
SETTINGS,
settingsData,
updateSettings
}) => {
const protocol = window.location.protocol || 'https:';
const hostname = window.location.hostname || 'example.com';
const prefix = protocol + '//' + hostname;
return /*#__PURE__*/React.createElement(_components.PanelBody, {
title: (0, _i18n.__)('Hello Theme Settings', 'hello-elementor')
}, /*#__PURE__*/React.createElement(_components.Notice, {
status: "warning",
isDismissible: "false"
}, /*#__PURE__*/React.createElement(_components.Dashicon, {
icon: "flag"
}), (0, _i18n.__)('Be cautious, disabling some of the following options may break your website.', 'hello-elementor')), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable description meta tag', 'hello-elementor'),
help: (0, _i18n.__)('Remove the description meta tag in singular content pages that contain an excerpt.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.DESCRIPTION_META_TAG] || false,
onChange: value => updateSettings(SETTINGS.DESCRIPTION_META_TAG, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <meta name=\"description\" content=\"...\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable skip link', 'hello-elementor'),
help: (0, _i18n.__)('Remove the "Skip to content" link used by screen-readers and users navigating with a keyboard.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.SKIP_LINK] || false,
onChange: value => updateSettings(SETTINGS.SKIP_LINK, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <a class=\"skip-link screen-reader-text\" href=\"#content\"> Skip to content </a> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable cross-site header & footer', 'hello-elementor'),
help: (0, _i18n.__)('Remove the header & footer sections from all pages, and their CSS/JS files.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.HEADER_FOOTER] || false,
onChange: value => updateSettings(SETTINGS.HEADER_FOOTER, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <header id=\"site-header\" class=\"site-header\"> ... </header> "), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <footer id=\"site-footer\" class=\"site-footer\"> ... </footer> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable page title', 'hello-elementor'),
help: (0, _i18n.__)('Remove the section above the content that contains the main heading of the page.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.PAGE_TITLE] || false,
onChange: value => updateSettings(SETTINGS.PAGE_TITLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <div class=\"page-header\"> <h1 class=\"entry-title\"> Post title </h1> </div> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello style.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's style.css file which contains CSS reset rules for unified cross-browser view.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_STYLE] || false,
onChange: value => updateSettings(SETTINGS.HELLO_STYLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/style.min.css\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello theme.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's theme.css file which contains CSS rules that style WordPress elements.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_THEME] || false,
onChange: value => updateSettings(SETTINGS.HELLO_THEME, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/theme.min.css\" /> "));
};
exports.SettingsPanel = SettingsPanel;
/***/ }),
/***/ 374:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 609:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 863:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["api"];
/***/ }),
/***/ 427:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["components"];
/***/ }),
/***/ 143:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["data"];
/***/ }),
/***/ 87:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["element"];
/***/ }),
/***/ 723:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ 692:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["notices"];
/***/ }),
/***/ 994:
/***/ ((module) => {
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
__webpack_require__(374);
var _element = __webpack_require__(87);
var _settingsPage = __webpack_require__(19);
const App = () => {
return /*#__PURE__*/React.createElement(_settingsPage.SettingsPage, null);
};
document.addEventListener('DOMContentLoaded', () => {
const rootElement = document.getElementById('hello-elementor-settings');
if (rootElement) {
(0, _element.render)( /*#__PURE__*/React.createElement(App, null), rootElement);
}
});
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'b4d297e7938fe5a0c932');

View File

@@ -0,0 +1,389 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 706:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(994);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(__webpack_require__(693));
var _controlsHook = _interopRequireDefault(__webpack_require__(239));
class _default extends $e.modules.ComponentBase {
constructor(...args) {
super(...args);
(0, _defineProperty2.default)(this, "pages", {});
}
getNamespace() {
return 'hello-elementor';
}
defaultHooks() {
return this.importHooks({
ControlsHook: _controlsHook.default
});
}
}
exports["default"] = _default;
/***/ }),
/***/ 239:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class ControlsHook extends $e.modules.hookUI.After {
getCommand() {
// Command to listen.
return 'document/elements/settings';
}
getId() {
// Unique id for the hook.
return 'hello-elementor-editor-controls-handler';
}
/**
* Get Hello Elementor Theme Controls
*
* Returns an object in which the keys are control IDs, and the values are the selectors of the elements that need
* to be targeted in the apply() method.
*
* Example return value:
* {
* hello_elementor_show_logo: '.site-header .site-header-logo',
* hello_elementor_show_menu: '.site-header .site-header-menu',
* }
*/
getHelloThemeControls() {
return {
hello_header_logo_display: {
selector: '.site-header .site-logo, .site-header .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_logo_display);
}
},
hello_header_menu_display: {
selector: '.site-header .site-navigation, .site-header .site-navigation-toggle-holder',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_menu_display);
}
},
hello_header_tagline_display: {
selector: '.site-header .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_tagline_display);
}
},
hello_header_logo_type: {
selector: '.site-header .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_header_logo_type.options,
inputValue = args.settings.hello_header_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_layout.options,
inputValue = args.settings.hello_header_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_width: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_width.options,
inputValue = args.settings.hello_header_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-layout-',
inputOptions = args.container.controls.hello_header_menu_layout.options,
inputValue = args.settings.hello_header_menu_layout;
// No matter what, close the mobile menu
$element.find('.site-navigation-toggle-holder').removeClass('elementor-active');
$element.find('.site-navigation-dropdown').removeClass('show');
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_dropdown: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-dropdown-',
inputOptions = args.container.controls.hello_header_menu_dropdown.options,
inputValue = args.settings.hello_header_menu_dropdown;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_logo_display: {
selector: '.site-footer .site-logo, .site-footer .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_logo_display);
}
},
hello_footer_tagline_display: {
selector: '.site-footer .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_tagline_display);
}
},
hello_footer_menu_display: {
selector: '.site-footer .site-navigation',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_menu_display);
}
},
hello_footer_copyright_display: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const $footerContainer = $element.closest('#site-footer'),
inputValue = args.settings.hello_footer_copyright_display;
this.toggleShowHideClass($element, inputValue);
$footerContainer.toggleClass('footer-has-copyright', 'yes' === inputValue);
}
},
hello_footer_logo_type: {
selector: '.site-footer .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_footer_logo_type.options,
inputValue = args.settings.hello_footer_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_layout: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_layout.options,
inputValue = args.settings.hello_footer_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_width: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_width.options,
inputValue = args.settings.hello_footer_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_copyright_text: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const inputValue = args.settings.hello_footer_copyright_text;
$element.find('p').text(inputValue);
}
}
};
}
/**
* Toggle show and hide classes on containers
*
* This will remove the .show and .hide clases from the element, then apply the new class
*
* @param {jQuery} element
* @param {string} inputValue
*/
toggleShowHideClass(element, inputValue) {
element.removeClass('hide').removeClass('show').addClass(inputValue ? 'show' : 'hide');
}
/**
* Toggle layout classes on containers
*
* This will cleanly set classes onto which ever container we want to target, removing the old classes and adding the new one
*
* @param {jQuery} element
* @param {string} classPrefix
* @param {Object} inputOptions
* @param {string} inputValue
*
*/
toggleLayoutClass(element, classPrefix, inputOptions, inputValue) {
// Loop through the possible classes and remove the one that's not in use
Object.entries(inputOptions).forEach(([key]) => {
element.removeClass(classPrefix + key);
});
// Append the class which we want to use onto the element
if ('' !== inputValue) {
element.addClass(classPrefix + inputValue);
}
}
/**
* Set the conditions under which the hook will run.
*
* @param {Object} args
*/
getConditions(args) {
const isKit = 'kit' === elementor.documents.getCurrent().config.type,
changedControls = Object.keys(args.settings),
isSingleSetting = 1 === changedControls.length;
// If the document is not a kit, or there are no changed settings, or there is more than one single changed
// setting, don't run the hook.
if (!isKit || !args.settings || !isSingleSetting) {
return false;
}
// If the changed control is in the list of theme controls, return true to run the hook.
// Otherwise, return false so the hook doesn't run.
return !!Object.keys(this.getHelloThemeControls()).includes(changedControls[0]);
}
/**
* The hook logic.
*
* @param {Object} args
*/
apply(args) {
const allThemeControls = this.getHelloThemeControls(),
// Extract the control ID from the passed args
controlId = Object.keys(args.settings)[0],
controlConfig = allThemeControls[controlId],
// Find the element that needs to be targeted by the control.
$element = elementor.$previewContents.find(controlConfig.selector);
controlConfig.callback($element, args);
}
}
exports["default"] = ControlsHook;
/***/ }),
/***/ 693:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var toPropertyKey = __webpack_require__(736);
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 994:
/***/ ((module) => {
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 45:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(738)["default"]);
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);
}
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 736:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(738)["default"]);
var toPrimitive = __webpack_require__(45);
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 738:
/***/ ((module) => {
function _typeof(o) {
"@babel/helpers - typeof";
return (module.exports = _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;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
var _interopRequireDefault = __webpack_require__(994);
var _component = _interopRequireDefault(__webpack_require__(706));
$e.components.register(new _component.default());
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'b4d297e7938fe5a0c932');

View File

@@ -0,0 +1,389 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 706:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(994);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(__webpack_require__(693));
var _controlsHook = _interopRequireDefault(__webpack_require__(239));
class _default extends $e.modules.ComponentBase {
constructor(...args) {
super(...args);
(0, _defineProperty2.default)(this, "pages", {});
}
getNamespace() {
return 'hello-elementor';
}
defaultHooks() {
return this.importHooks({
ControlsHook: _controlsHook.default
});
}
}
exports["default"] = _default;
/***/ }),
/***/ 239:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class ControlsHook extends $e.modules.hookUI.After {
getCommand() {
// Command to listen.
return 'document/elements/settings';
}
getId() {
// Unique id for the hook.
return 'hello-elementor-editor-controls-handler';
}
/**
* Get Hello Elementor Theme Controls
*
* Returns an object in which the keys are control IDs, and the values are the selectors of the elements that need
* to be targeted in the apply() method.
*
* Example return value:
* {
* hello_elementor_show_logo: '.site-header .site-header-logo',
* hello_elementor_show_menu: '.site-header .site-header-menu',
* }
*/
getHelloThemeControls() {
return {
hello_header_logo_display: {
selector: '.site-header .site-logo, .site-header .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_logo_display);
}
},
hello_header_menu_display: {
selector: '.site-header .site-navigation, .site-header .site-navigation-toggle-holder',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_menu_display);
}
},
hello_header_tagline_display: {
selector: '.site-header .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_tagline_display);
}
},
hello_header_logo_type: {
selector: '.site-header .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_header_logo_type.options,
inputValue = args.settings.hello_header_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_layout.options,
inputValue = args.settings.hello_header_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_width: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_width.options,
inputValue = args.settings.hello_header_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-layout-',
inputOptions = args.container.controls.hello_header_menu_layout.options,
inputValue = args.settings.hello_header_menu_layout;
// No matter what, close the mobile menu
$element.find('.site-navigation-toggle-holder').removeClass('elementor-active');
$element.find('.site-navigation-dropdown').removeClass('show');
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_dropdown: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-dropdown-',
inputOptions = args.container.controls.hello_header_menu_dropdown.options,
inputValue = args.settings.hello_header_menu_dropdown;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_logo_display: {
selector: '.site-footer .site-logo, .site-footer .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_logo_display);
}
},
hello_footer_tagline_display: {
selector: '.site-footer .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_tagline_display);
}
},
hello_footer_menu_display: {
selector: '.site-footer .site-navigation',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_menu_display);
}
},
hello_footer_copyright_display: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const $footerContainer = $element.closest('#site-footer'),
inputValue = args.settings.hello_footer_copyright_display;
this.toggleShowHideClass($element, inputValue);
$footerContainer.toggleClass('footer-has-copyright', 'yes' === inputValue);
}
},
hello_footer_logo_type: {
selector: '.site-footer .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_footer_logo_type.options,
inputValue = args.settings.hello_footer_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_layout: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_layout.options,
inputValue = args.settings.hello_footer_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_width: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_width.options,
inputValue = args.settings.hello_footer_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_copyright_text: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const inputValue = args.settings.hello_footer_copyright_text;
$element.find('p').text(inputValue);
}
}
};
}
/**
* Toggle show and hide classes on containers
*
* This will remove the .show and .hide clases from the element, then apply the new class
*
* @param {jQuery} element
* @param {string} inputValue
*/
toggleShowHideClass(element, inputValue) {
element.removeClass('hide').removeClass('show').addClass(inputValue ? 'show' : 'hide');
}
/**
* Toggle layout classes on containers
*
* This will cleanly set classes onto which ever container we want to target, removing the old classes and adding the new one
*
* @param {jQuery} element
* @param {string} classPrefix
* @param {Object} inputOptions
* @param {string} inputValue
*
*/
toggleLayoutClass(element, classPrefix, inputOptions, inputValue) {
// Loop through the possible classes and remove the one that's not in use
Object.entries(inputOptions).forEach(([key]) => {
element.removeClass(classPrefix + key);
});
// Append the class which we want to use onto the element
if ('' !== inputValue) {
element.addClass(classPrefix + inputValue);
}
}
/**
* Set the conditions under which the hook will run.
*
* @param {Object} args
*/
getConditions(args) {
const isKit = 'kit' === elementor.documents.getCurrent().config.type,
changedControls = Object.keys(args.settings),
isSingleSetting = 1 === changedControls.length;
// If the document is not a kit, or there are no changed settings, or there is more than one single changed
// setting, don't run the hook.
if (!isKit || !args.settings || !isSingleSetting) {
return false;
}
// If the changed control is in the list of theme controls, return true to run the hook.
// Otherwise, return false so the hook doesn't run.
return !!Object.keys(this.getHelloThemeControls()).includes(changedControls[0]);
}
/**
* The hook logic.
*
* @param {Object} args
*/
apply(args) {
const allThemeControls = this.getHelloThemeControls(),
// Extract the control ID from the passed args
controlId = Object.keys(args.settings)[0],
controlConfig = allThemeControls[controlId],
// Find the element that needs to be targeted by the control.
$element = elementor.$previewContents.find(controlConfig.selector);
controlConfig.callback($element, args);
}
}
exports["default"] = ControlsHook;
/***/ }),
/***/ 693:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var toPropertyKey = __webpack_require__(736);
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 994:
/***/ ((module) => {
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 45:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(738)["default"]);
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);
}
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 736:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(738)["default"]);
var toPrimitive = __webpack_require__(45);
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 738:
/***/ ((module) => {
function _typeof(o) {
"@babel/helpers - typeof";
return (module.exports = _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;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
var _interopRequireDefault = __webpack_require__(994);
var _component = _interopRequireDefault(__webpack_require__(706));
$e.components.register(new _component.default());
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '2f03dc39ec58b53d53c8');

View File

@@ -0,0 +1,69 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
var __webpack_exports__ = {};
class elementorHelloThemeHandler {
constructor() {
this.initSettings();
this.initElements();
this.bindEvents();
}
initSettings() {
this.settings = {
selectors: {
menuToggle: '.site-header .site-navigation-toggle',
menuToggleHolder: '.site-header .site-navigation-toggle-holder',
dropdownMenu: '.site-header .site-navigation-dropdown'
}
};
}
initElements() {
this.elements = {
window,
menuToggle: document.querySelector(this.settings.selectors.menuToggle),
menuToggleHolder: document.querySelector(this.settings.selectors.menuToggleHolder),
dropdownMenu: document.querySelector(this.settings.selectors.dropdownMenu)
};
}
bindEvents() {
var _this$elements$menuTo;
if (!this.elements.menuToggleHolder || (_this$elements$menuTo = this.elements.menuToggleHolder) !== null && _this$elements$menuTo !== void 0 && _this$elements$menuTo.classList.contains('hide')) {
return;
}
this.elements.menuToggle.addEventListener('click', () => this.handleMenuToggle());
this.elements.dropdownMenu.querySelectorAll('.menu-item-has-children > a').forEach(anchorElement => anchorElement.addEventListener('click', event => this.handleMenuChildren(event)));
}
closeMenuItems() {
this.elements.menuToggleHolder.classList.remove('elementor-active');
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
handleMenuToggle() {
const isDropdownVisible = !this.elements.menuToggleHolder.classList.contains('elementor-active');
this.elements.menuToggle.setAttribute('aria-expanded', isDropdownVisible);
this.elements.dropdownMenu.setAttribute('aria-hidden', !isDropdownVisible);
this.elements.dropdownMenu.inert = !isDropdownVisible;
this.elements.menuToggleHolder.classList.toggle('elementor-active', isDropdownVisible);
// Always close all sub active items.
this.elements.dropdownMenu.querySelectorAll('.elementor-active').forEach(item => item.classList.remove('elementor-active'));
if (isDropdownVisible) {
this.elements.window.addEventListener('resize', () => this.closeMenuItems());
} else {
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
}
handleMenuChildren(event) {
const anchor = event.currentTarget;
const parentLi = anchor.parentElement;
if (!(parentLi !== null && parentLi !== void 0 && parentLi.classList)) {
return;
}
parentLi.classList.toggle('elementor-active');
}
}
document.addEventListener('DOMContentLoaded', () => {
new elementorHelloThemeHandler();
});
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '2f03dc39ec58b53d53c8');

View File

@@ -0,0 +1,69 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
var __webpack_exports__ = {};
class elementorHelloThemeHandler {
constructor() {
this.initSettings();
this.initElements();
this.bindEvents();
}
initSettings() {
this.settings = {
selectors: {
menuToggle: '.site-header .site-navigation-toggle',
menuToggleHolder: '.site-header .site-navigation-toggle-holder',
dropdownMenu: '.site-header .site-navigation-dropdown'
}
};
}
initElements() {
this.elements = {
window,
menuToggle: document.querySelector(this.settings.selectors.menuToggle),
menuToggleHolder: document.querySelector(this.settings.selectors.menuToggleHolder),
dropdownMenu: document.querySelector(this.settings.selectors.dropdownMenu)
};
}
bindEvents() {
var _this$elements$menuTo;
if (!this.elements.menuToggleHolder || (_this$elements$menuTo = this.elements.menuToggleHolder) !== null && _this$elements$menuTo !== void 0 && _this$elements$menuTo.classList.contains('hide')) {
return;
}
this.elements.menuToggle.addEventListener('click', () => this.handleMenuToggle());
this.elements.dropdownMenu.querySelectorAll('.menu-item-has-children > a').forEach(anchorElement => anchorElement.addEventListener('click', event => this.handleMenuChildren(event)));
}
closeMenuItems() {
this.elements.menuToggleHolder.classList.remove('elementor-active');
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
handleMenuToggle() {
const isDropdownVisible = !this.elements.menuToggleHolder.classList.contains('elementor-active');
this.elements.menuToggle.setAttribute('aria-expanded', isDropdownVisible);
this.elements.dropdownMenu.setAttribute('aria-hidden', !isDropdownVisible);
this.elements.dropdownMenu.inert = !isDropdownVisible;
this.elements.menuToggleHolder.classList.toggle('elementor-active', isDropdownVisible);
// Always close all sub active items.
this.elements.dropdownMenu.querySelectorAll('.elementor-active').forEach(item => item.classList.remove('elementor-active'));
if (isDropdownVisible) {
this.elements.window.addEventListener('resize', () => this.closeMenuItems());
} else {
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
}
handleMenuChildren(event) {
const anchor = event.currentTarget;
const parentLi = anchor.parentElement;
if (!(parentLi !== null && parentLi !== void 0 && parentLi.classList)) {
return;
}
parentLi.classList.toggle('elementor-active');
}
}
document.addEventListener('DOMContentLoaded', () => {
new elementorHelloThemeHandler();
});
/******/ })()
;