/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 696:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinks = void 0;
const ActionLinks = _ref => {
let {
image,
alt,
title,
message,
button,
link
} = _ref;
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(_components.Button, {
size: 'small',
variant: 'link',
onClick: () => {
const dialog = document.getElementById('hello-elementor-notifications-dialog');
if (dialog) {
dialog.showModal();
}
}
}, (0, _i18n.__)('Changelog', '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 Elementor’s "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 Elementor’s "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 = _ref => {
let {
SETTINGS,
settingsData,
updateSettings
} = _ref;
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"
}, " "), /*#__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"
}, " Skip to content "), /*#__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"
}, "