packages
1 week ago
012778ff5828d0d1739f.bundle.js
2 weeks ago
02ab54a3328c55e115ea.bundle.min.js
2 weeks ago
0352e30f394e8e1dd4dc.bundle.js
2 months ago
06dbd869189450c5db6c.bundle.js
2 weeks ago
0982f37bec0944fbcb10.bundle.js
4 months ago
0bc41c4656ca54cf2aca.bundle.min.js
4 months ago
14bcbc91620c14a7112c.bundle.min.js
2 weeks ago
1564d2bfa4591bf857f3.bundle.min.js
4 months ago
197583acd246fea0e25d.bundle.js
5 months ago
20866d9d9e34bf3cb0a7.bundle.min.js
2 weeks ago
2140afa714e988f1069e.bundle.js
2 months ago
220e9c3d1caa01726b1a.bundle.js
2 weeks ago
29c342e9c10e3f13f498.bundle.js
2 weeks ago
2bac2875cdf51a1f8140.bundle.min.js
2 weeks ago
32f7c5e8db4c8976b254.bundle.js
2 months ago
35423d812dc1d52fdb27.bundle.min.js
4 months ago
397f2d183c19202777d6.bundle.min.js
3 months ago
397f2d183c19202777d6.bundle.min.js.LICENSE.txt
3 months ago
3c838288a9b7ddd2aea4.bundle.min.js
4 months ago
3d410a099008411bb011.bundle.js
5 months ago
3df4dbb5d612dbdab477.bundle.min.js
2 months ago
40d841f4b4ce7b1928f5.bundle.js
4 months ago
435080452e81c388e779.bundle.min.js
2 months ago
4927500be197e062162e.bundle.min.js
2 months ago
4c96eab5a48ee097dcb2.bundle.js
2 weeks ago
59845ab5a628d2b79f57.bundle.js
2 weeks ago
5b575dffd21b0cec15a5.bundle.js
2 weeks ago
6117d083decd13b6ed73.bundle.js
2 months ago
6844b6c0a66040e3ca12.bundle.js
2 months ago
687979ffbcfd58352c29.bundle.min.js
2 weeks ago
6936b079b4e7c28cd901.bundle.min.js
2 weeks ago
6a19e86dd8c1f9165dbe.bundle.js
5 months ago
6caa76d2f6eec6c4e665.bundle.js
3 months ago
6d09ff0398a56a60654b.bundle.min.js
3 months ago
6f779545aaa23e951088.bundle.min.js
2 months ago
73f63f9507c306870586.bundle.min.js
2 weeks ago
7698e0d50a8ad7ecc822.bundle.js
2 weeks ago
77b60be7dc925a32f560.bundle.min.js
2 weeks ago
78dd4dee6173d40eb75a.bundle.min.js
2 months ago
7dae73b622bebe8a5d94.bundle.js
4 months ago
8277989eebcfba278cb0.bundle.min.js
7 months ago
831aea236b1ddda24f0c.bundle.js
2 weeks ago
845418a5488e9937fc99.bundle.min.js
2 weeks ago
8ad22e7ba800b096313c.bundle.min.js
2 weeks ago
8c20eb5e96967d3016b2.bundle.js
2 weeks ago
8e5b42844d27eada9b53.bundle.min.js
2 months ago
8e80438d29fc79b648e5.bundle.js
2 months ago
8e8b47ad5b4e4d038c80.bundle.js
4 months ago
8ecfd8495b7ec419862a.bundle.js
4 months ago
979a9c03fe10da23400d.bundle.js
2 months ago
9b0cc3aa93cf287cd0a2.bundle.min.js
2 weeks ago
9b97a73ee8fdc5fb7dc3.bundle.js
3 months ago
9bd390911e34b349d8cb.bundle.min.js
2 months ago
9dcd9e88237da6496816.bundle.min.js
4 months ago
9e7e356552c03a622b0f.bundle.js
2 months ago
9ffe53753902b9aca176.bundle.js
2 weeks ago
a0f667abb781daab8e48.bundle.js
2 weeks ago
a9c3d5b02d26399aebfb.bundle.js
2 weeks ago
accordion.8b0db5058afeb74622f5.bundle.min.js
7 months ago
accordion.b9a0ab19c7c872c405d7.bundle.js
5 months ago
admin-feedback.js
7 months ago
admin-feedback.min.js
7 months ago
admin-feedback.strings.js
2 weeks ago
admin-modules.js
5 months ago
admin-modules.min.js
5 months ago
admin-modules.min.js.LICENSE.txt
9 months ago
admin-modules.strings.js
1 month ago
admin-notifications.js
7 months ago
admin-notifications.min.js
7 months ago
admin-notifications.strings.js
5 months ago
admin-top-bar.js
2 months ago
admin-top-bar.min.js
2 months ago
admin-top-bar.strings.js
5 months ago
admin.js
2 weeks ago
admin.min.js
2 weeks ago
admin.min.js.LICENSE.txt
9 months ago
admin.strings.js
5 months ago
aee13673e923469c3275.bundle.min.js
4 months ago
af05aac2eb23e7438265.bundle.js
2 weeks ago
ai-admin.js
5 months ago
ai-admin.min.js
5 months ago
ai-admin.min.js.LICENSE.txt
9 months ago
ai-admin.strings.js
5 months ago
ai-gutenberg.js
5 months ago
ai-gutenberg.min.js
5 months ago
ai-gutenberg.min.js.LICENSE.txt
9 months ago
ai-gutenberg.strings.js
5 months ago
ai-layout.js
3 months ago
ai-layout.min.js
3 months ago
ai-layout.min.js.LICENSE.txt
9 months ago
ai-layout.strings.js
1 week ago
ai-media-library.js
5 months ago
ai-media-library.min.js
5 months ago
ai-media-library.min.js.LICENSE.txt
9 months ago
ai-media-library.strings.js
5 months ago
ai-unify-product-images.js
5 months ago
ai-unify-product-images.min.js
5 months ago
ai-unify-product-images.min.js.LICENSE.txt
9 months ago
ai-unify-product-images.strings.js
5 months ago
ai.js
5 months ago
ai.min.js
5 months ago
ai.min.js.LICENSE.txt
9 months ago
ai.strings.js
1 week ago
alert.b4336601ffdb6086d1b5.bundle.min.js
2 weeks ago
alert.fd509aa768e7b35a8e32.bundle.js
5 months ago
announcements-app.js
2 weeks ago
announcements-app.min.js
2 weeks ago
announcements-app.min.js.LICENSE.txt
9 months ago
announcements-app.strings.js
5 months ago
app-loader.js
5 months ago
app-loader.min.js
7 months ago
app-loader.strings.js
1 week ago
app-packages.js
4 months ago
app-packages.min.js
4 months ago
app-packages.min.js.LICENSE.txt
9 months ago
app-packages.strings.js
1 week ago
app.js
2 weeks ago
app.min.js
2 weeks ago
app.min.js.LICENSE.txt
9 months ago
app.strings.js
1 week ago
atomic-widgets-action-link-handler.js
2 weeks ago
atomic-widgets-action-link-handler.min.js
2 weeks ago
atomic-widgets-editor.js
2 weeks ago
atomic-widgets-editor.min.js
2 weeks ago
atomic-widgets-editor.min.js.LICENSE.txt
4 months ago
atomic-widgets-editor.strings.js
2 months ago
atomic-widgets-form-handler.js
1 week ago
atomic-widgets-form-handler.min.js
1 week ago
atomic-widgets-form-handler.min.js.LICENSE.txt
2 weeks ago
b4d39e5186d768f79598.bundle.js
2 weeks ago
b96d70044d0d67c2df19.bundle.min.js
7 months ago
bcb5135af6b817bc9708.bundle.min.js
2 months ago
beta-tester.js
7 months ago
beta-tester.min.js
7 months ago
beta-tester.strings.js
5 months ago
bf2fa9f81b3d78f5858f.bundle.min.js
2 weeks ago
c13d205fa26f8af1ce7c.bundle.js
5 months ago
c73a7d15e48e3305780a.bundle.min.js
2 weeks ago
cf6ec600fcf4e08ba6d3.bundle.js
4 months ago
checklist.js
5 months ago
checklist.min.js
5 months ago
checklist.min.js.LICENSE.txt
9 months ago
checklist.strings.js
5 months ago
cloud-library-screenshot.js
5 months ago
cloud-library-screenshot.min.js
5 months ago
cloud-library-screenshot.min.js.LICENSE.txt
7 months ago
cloud-library-screenshot.strings.js
5 months ago
common-modules.js
2 months ago
common-modules.min.js
2 months ago
common-modules.strings.js
5 months ago
common.js
2 weeks ago
common.min.js
2 weeks ago
common.min.js.LICENSE.txt
9 months ago
common.strings.js
5 months ago
contact-buttons.086261d3e9c4d8037686.bundle.js
5 months ago
contact-buttons.e98d0220ce8c38404e7e.bundle.min.js
7 months ago
container-converter.js
7 months ago
container-converter.min.js
7 months ago
container-converter.strings.js
5 months ago
container-editor-handlers.a2e8e48d28c5544fb183.bundle.min.js
4 months ago
container-editor-handlers.e7e069c4e656425c51f8.bundle.js
4 months ago
counter.12335f45aaa79d244f24.bundle.min.js
7 months ago
counter.7310c276bc7865a3d438.bundle.js
5 months ago
d39cd4cb3d5b09b11c14.bundle.min.js
2 weeks ago
d42de03ef4a0f50e39ca.bundle.min.js
4 months ago
d4c67aa71d8173f6201f.bundle.js
2 months ago
d52aa05c75af56327744.bundle.js
5 months ago
d67ddd6f08b08392c42f.bundle.js
5 months ago
d8a330693f9211e2166e.bundle.min.js
2 weeks ago
daedc6797eaad5c82711.bundle.min.js
7 months ago
de7511b88f9ec0968921.bundle.js
2 weeks ago
design-system-sync.js
1 month ago
design-system-sync.min.js
1 month ago
design-system-sync.strings.js
2 months ago
dev-tools.js
7 months ago
dev-tools.min.js
7 months ago
dev-tools.strings.js
5 months ago
df2f2a2ae20e0181ec2d.bundle.js
2 months ago
df4ff09f2b412abf0cd3.bundle.js
2 weeks ago
dff865a4d52c12bcf996.bundle.min.js
2 weeks ago
e-home-screen.js
2 weeks ago
e-home-screen.min.js
2 weeks ago
e-home-screen.min.js.LICENSE.txt
2 weeks ago
e-home-screen.strings.js
2 weeks ago
e-react-promotions.js
1 month ago
e-react-promotions.min.js
1 month ago
e-react-promotions.min.js.LICENSE.txt
1 month ago
e-react-promotions.strings.js
5 months ago
e-wc-product-editor.js
5 months ago
e-wc-product-editor.min.js
7 months ago
e-wc-product-editor.min.js.LICENSE.txt
1 year ago
e-wc-product-editor.strings.js
5 months ago
e1cb4d726bb59646c677.bundle.min.js
7 months ago
e459c6c89c0c0899c850.bundle.js
5 months ago
e9a764dcd37c06162942.bundle.js
2 weeks ago
eb5018119ee87fd6a7fc.bundle.min.js
2 months ago
ec1ee92b2a471389c7b9.bundle.min.js
2 weeks ago
editor-document.js
5 months ago
editor-document.min.js
7 months ago
editor-document.strings.js
1 week ago
editor-environment-v2.js
7 months ago
editor-environment-v2.min.js
7 months ago
editor-environment-v2.strings.js
5 months ago
editor-interactions.js
2 weeks ago
editor-interactions.min.js
2 weeks ago
editor-interactions.strings.js
5 months ago
editor-loader-v1.js
7 months ago
editor-loader-v1.min.js
7 months ago
editor-loader-v1.strings.js
5 months ago
editor-loader-v2.js
7 months ago
editor-loader-v2.min.js
7 months ago
editor-loader-v2.strings.js
5 months ago
editor-modules.js
2 months ago
editor-modules.min.js
2 months ago
editor-modules.min.js.LICENSE.txt
9 months ago
editor-modules.strings.js
1 week ago
editor-notifications.js
7 months ago
editor-notifications.min.js
7 months ago
editor-notifications.strings.js
5 months ago
editor-one-admin.js
5 months ago
editor-one-admin.min.js
5 months ago
editor-one-admin.strings.js
5 months ago
editor-one-menu.js
4 months ago
editor-one-menu.min.js
4 months ago
editor-one-menu.strings.js
5 months ago
editor-one-sidebar-navigation.js
2 months ago
editor-one-sidebar-navigation.min.js
2 months ago
editor-one-sidebar-navigation.min.js.LICENSE.txt
5 months ago
editor-one-sidebar-navigation.strings.js
5 months ago
editor-one-top-bar.js
2 weeks ago
editor-one-top-bar.min.js
2 weeks ago
editor-one-top-bar.min.js.LICENSE.txt
4 months ago
editor-one-top-bar.strings.js
4 months ago
editor-v4-opt-in-alphachip.js
2 months ago
editor-v4-opt-in-alphachip.min.js
2 months ago
editor-v4-opt-in-alphachip.strings.js
2 months ago
editor-v4-opt-in.js
2 months ago
editor-v4-opt-in.min.js
2 months ago
editor-v4-opt-in.min.js.LICENSE.txt
5 months ago
editor-v4-opt-in.strings.js
2 months ago
editor.js
2 weeks ago
editor.min.js
2 weeks ago
editor.min.js.LICENSE.txt
5 months ago
editor.strings.js
2 weeks ago
ef2100ac3eda1a957819.bundle.min.js
7 months ago
ef35c83e4628f0a5c328.bundle.js
4 months ago
element-manager-admin.js
2 months ago
element-manager-admin.min.js
2 months ago
element-manager-admin.min.js.LICENSE.txt
9 months ago
element-manager-admin.strings.js
2 months ago
elementor-admin-bar.js
7 months ago
elementor-admin-bar.min.js
7 months ago
elementor-admin-bar.strings.js
5 months ago
f3b4453f66034a6655a7.bundle.min.js
2 weeks ago
f56b0d1257a5346afe64.bundle.min.js
2 months ago
fdda4547e887fbda71b3.bundle.js
2 months ago
fdf69f4e1f300fb27472.bundle.min.js
2 months ago
floating-bars.740d06d17cea5cebdb61.bundle.min.js
7 months ago
floating-bars.a6e6a043444b62f64f82.bundle.js
5 months ago
floating-elements-modal.js
2 months ago
floating-elements-modal.min.js
2 months ago
floating-elements-modal.strings.js
5 months ago
frontend-modules.js
2 months ago
frontend-modules.min.js
2 months ago
frontend.js
2 weeks ago
frontend.min.js
2 weeks ago
gutenberg.js
7 months ago
gutenberg.min.js
7 months ago
gutenberg.strings.js
2 months ago
image-carousel.6167d20b95b33386757b.bundle.min.js
7 months ago
image-carousel.8b25f3674c29b829a867.bundle.js
5 months ago
import-export-admin.js
5 months ago
import-export-admin.min.js
5 months ago
import-export-admin.strings.js
1 week ago
import-export-customization-admin.js
2 weeks ago
import-export-customization-admin.min.js
2 weeks ago
import-export-customization-admin.min.js.LICENSE.txt
7 months ago
import-export-customization-admin.strings.js
1 week ago
interactions-shared-utils.js
2 weeks ago
interactions-shared-utils.min.js
2 weeks ago
interactions-shared-utils.strings.js
2 months ago
interactions.js
2 weeks ago
interactions.min.js
2 weeks ago
interactions.strings.js
5 months ago
kit-elements-defaults-editor.js
5 months ago
kit-elements-defaults-editor.min.js
5 months ago
kit-elements-defaults-editor.min.js.LICENSE.txt
9 months ago
kit-elements-defaults-editor.strings.js
5 months ago
kit-library.a394510096bc447f636d.bundle.min.js
2 months ago
kit-library.b768952e1d4177aa68d8.bundle.js
2 months ago
lightbox.570c05c5a283cfb6b223.bundle.min.js
3 months ago
lightbox.d9ea72d232a14f514ee2.bundle.js
3 months ago
media-hints.js
7 months ago
media-hints.min.js
7 months ago
media-hints.strings.js
5 months ago
nested-accordion.294d40984397351fd0f5.bundle.min.js
4 months ago
nested-accordion.4340b64226322f36bcc0.bundle.js
4 months ago
nested-accordion.js
5 months ago
nested-accordion.min.js
5 months ago
nested-accordion.min.js.LICENSE.txt
9 months ago
nested-accordion.strings.js
5 months ago
nested-elements.js
3 months ago
nested-elements.min.js
3 months ago
nested-elements.strings.js
5 months ago
nested-tabs.7a338e6d7e060c473993.bundle.js
5 months ago
nested-tabs.a2401356d329f179475e.bundle.min.js
5 months ago
nested-tabs.js
5 months ago
nested-tabs.min.js
5 months ago
nested-tabs.min.js.LICENSE.txt
9 months ago
nested-tabs.strings.js
5 months ago
nested-title-keyboard-handler.0c2b498e3e0695a1dc19.bundle.js
5 months ago
nested-title-keyboard-handler.2a67d3cc630e11815acc.bundle.min.js
5 months ago
new-template.js
4 months ago
new-template.min.js
4 months ago
new-template.strings.js
5 months ago
notes.js
7 months ago
notes.min.js
7 months ago
notes.strings.js
5 months ago
pro-free-trial-popup.js
7 months ago
pro-free-trial-popup.min.js
7 months ago
pro-free-trial-popup.strings.js
5 months ago
pro-install-events.js
7 months ago
pro-install-events.min.js
7 months ago
pro-install-events.strings.js
5 months ago
progress.0ea083b809812c0e3aa1.bundle.min.js
7 months ago
progress.b1057ba870016558bce1.bundle.js
5 months ago
responsive-bar.js
7 months ago
responsive-bar.min.js
7 months ago
responsive-bar.strings.js
5 months ago
section-editor-handlers.53ffedef32043348b99b.bundle.min.js
7 months ago
section-editor-handlers.d65899d232b5339510d7.bundle.js
5 months ago
section-frontend-handlers.c3950c6b190ca134bc8d.bundle.js
5 months ago
section-frontend-handlers.d85ab872da118940910d.bundle.min.js
7 months ago
shared-editor-handlers.3023894100138e442ab0.bundle.js
4 months ago
shared-editor-handlers.cacdcbed391abf4b48b0.bundle.min.js
4 months ago
shared-frontend-handlers.03caa53373b56d3bab67.bundle.min.js
7 months ago
shared-frontend-handlers.3b079824c37a5fe2bdaa.bundle.js
5 months ago
styleguide-app-initiator.js
5 months ago
styleguide-app-initiator.min.js
5 months ago
styleguide-app-initiator.min.js.LICENSE.txt
9 months ago
styleguide-app-initiator.strings.js
5 months ago
styleguide-app.04340244193733d78622.bundle.min.js
7 months ago
styleguide-app.36ecabae74d9b87fc5a8.bundle.js
5 months ago
styleguide.js
7 months ago
styleguide.min.js
7 months ago
styleguide.strings.js
3 months ago
tabs-handler.js
2 weeks ago
tabs-handler.min.js
2 weeks ago
tabs-preview-handler.js
2 weeks ago
tabs-preview-handler.min.js
2 weeks ago
tabs.18344b05d8d1ea0702bc.bundle.min.js
7 months ago
tabs.40498fa771d612162c53.bundle.js
5 months ago
text-editor.0c9960167105139d27c9.bundle.js
5 months ago
text-editor.45609661e409413f1cef.bundle.min.js
7 months ago
text-path.6db73cc0a10a70f128eb.bundle.js
3 months ago
text-path.a67c1f3a78d208bc7e1b.bundle.min.js
3 months ago
toggle.2a177a3ef4785d3dfbc5.bundle.min.js
7 months ago
toggle.b75e66d2aca6f6ee742e.bundle.js
5 months ago
video.6e96510afa701d1f2ebc.bundle.js
5 months ago
video.86d44e46e43d0807e708.bundle.min.js
7 months ago
web-cli.js
5 months ago
web-cli.min.js
5 months ago
web-cli.min.js.LICENSE.txt
9 months ago
web-cli.strings.js
5 months ago
webpack.runtime.js
2 weeks ago
webpack.runtime.min.js
2 weeks ago
wp-audio.0ba9114964acf4c37ca2.bundle.js
5 months ago
wp-audio.c9624cb6e5dc9de86abd.bundle.min.js
7 months ago
youtube-handler.js
5 months ago
youtube-handler.min.js
5 months ago
styleguide.js
2238 lines
| 1 | /******/ (() => { // webpackBootstrap |
| 2 | /******/ var __webpack_modules__ = ({ |
| 3 | |
| 4 | /***/ "../assets/dev/js/editor/components/dynamic-tags/control-behavior.js": |
| 5 | /*!***************************************************************************!*\ |
| 6 | !*** ../assets/dev/js/editor/components/dynamic-tags/control-behavior.js ***! |
| 7 | \***************************************************************************/ |
| 8 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9 | |
| 10 | "use strict"; |
| 11 | /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 12 | |
| 13 | |
| 14 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 15 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 16 | var TagPanelView = __webpack_require__(/*! elementor-dynamic-tags/tag-panel-view */ "../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js"); |
| 17 | module.exports = Marionette.Behavior.extend({ |
| 18 | tagView: null, |
| 19 | listenerAttached: false, |
| 20 | initialize: function initialize() { |
| 21 | if (!this.listenerAttached) { |
| 22 | this.listenTo(this.view.options.container.settings, 'change:external:__dynamic__', this.onAfterExternalChange); |
| 23 | this.listenerAttached = true; |
| 24 | } |
| 25 | }, |
| 26 | shouldRenderTools: function shouldRenderTools() { |
| 27 | var hasDefault = this.getOption('dynamicSettings').default; |
| 28 | if (hasDefault) { |
| 29 | return false; |
| 30 | } |
| 31 | var isFeatureAvailableToUser = elementor.helpers.hasPro() && !elementor.helpers.hasProAndNotConnected(), |
| 32 | hasTags = this.getOption('tags').length > 0; |
| 33 | return !isFeatureAvailableToUser || hasTags; |
| 34 | }, |
| 35 | renderTools: function renderTools() { |
| 36 | var _this = this; |
| 37 | if (!this.shouldRenderTools()) { |
| 38 | return; |
| 39 | } |
| 40 | var $dynamicSwitcher = jQuery(Marionette.Renderer.render('#tmpl-elementor-control-dynamic-switcher')); |
| 41 | $dynamicSwitcher.on('click', function (event) { |
| 42 | return _this.onDynamicSwitcherClick(event); |
| 43 | }); |
| 44 | this.$el.find('.elementor-control-dynamic-switcher-wrapper').append($dynamicSwitcher); |
| 45 | this.ui.dynamicSwitcher = $dynamicSwitcher; |
| 46 | if ('color' === this.view.model.get('type')) { |
| 47 | if (this.view.colorPicker) { |
| 48 | this.moveDynamicSwitcherToColorPicker(); |
| 49 | } else { |
| 50 | setTimeout(function () { |
| 51 | return _this.moveDynamicSwitcherToColorPicker(); |
| 52 | }); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // Add a Tipsy Tooltip to the Dynamic Switcher |
| 57 | this.ui.dynamicSwitcher.tipsy({ |
| 58 | title: function title() { |
| 59 | return this.getAttribute('data-tooltip'); |
| 60 | }, |
| 61 | gravity: 's' |
| 62 | }); |
| 63 | }, |
| 64 | moveDynamicSwitcherToColorPicker: function moveDynamicSwitcherToColorPicker() { |
| 65 | var $colorPickerToolsContainer = this.view.colorPicker.$pickerToolsContainer; |
| 66 | this.ui.dynamicSwitcher.removeClass('elementor-control-unit-1').addClass('e-control-tool'); |
| 67 | var $eyedropper = $colorPickerToolsContainer.find('.elementor-control-element-color-picker'); |
| 68 | if ($eyedropper.length) { |
| 69 | this.ui.dynamicSwitcher.insertBefore($eyedropper); |
| 70 | } else { |
| 71 | $colorPickerToolsContainer.append(this.ui.dynamicSwitcher); |
| 72 | } |
| 73 | }, |
| 74 | toggleDynamicClass: function toggleDynamicClass() { |
| 75 | this.$el.toggleClass('elementor-control-dynamic-value', this.isDynamicMode()); |
| 76 | }, |
| 77 | isDynamicMode: function isDynamicMode() { |
| 78 | var dynamicSettings = this.view.container.settings.get('__dynamic__'); |
| 79 | return !!(dynamicSettings && dynamicSettings[this.view.model.get('name')]); |
| 80 | }, |
| 81 | createTagsList: function createTagsList() { |
| 82 | var tags = _.groupBy(this.getOption('tags'), 'group'), |
| 83 | groups = elementor.dynamicTags.getConfig('groups'), |
| 84 | $tagsList = this.ui.tagsList = jQuery('<div>', { |
| 85 | class: 'elementor-tags-list' |
| 86 | }), |
| 87 | $tagsListInner = jQuery('<div>', { |
| 88 | class: 'elementor-tags-list__inner' |
| 89 | }); |
| 90 | $tagsList.append($tagsListInner); |
| 91 | jQuery.each(groups, function (groupName) { |
| 92 | var groupTags = tags[groupName]; |
| 93 | if (!groupTags) { |
| 94 | return; |
| 95 | } |
| 96 | var group = this, |
| 97 | $groupTitle = jQuery('<div>', { |
| 98 | class: 'elementor-tags-list__group-title' |
| 99 | }).text(group.title); |
| 100 | $tagsListInner.append($groupTitle); |
| 101 | groupTags.forEach(function (tag) { |
| 102 | var $tag = jQuery('<div>', { |
| 103 | class: 'elementor-tags-list__item' |
| 104 | }); |
| 105 | $tag.text(tag.title).attr('data-tag-name', tag.name); |
| 106 | $tagsListInner.append($tag); |
| 107 | }); |
| 108 | }); |
| 109 | |
| 110 | // Create and inject pro dynamic teaser template if Pro is not installed |
| 111 | if (!elementor.helpers.hasPro() && Object.keys(tags).length) { |
| 112 | var proTeaser = Marionette.Renderer.render('#tmpl-elementor-dynamic-tags-promo', { |
| 113 | promotionUrl: elementor.config.dynamicPromotionURL.replace('%s', this.view.model.get('name')) |
| 114 | }); |
| 115 | $tagsListInner.append(proTeaser); |
| 116 | } |
| 117 | $tagsListInner.on('click', '.elementor-tags-list__item', this.onTagsListItemClick.bind(this)); |
| 118 | elementorCommon.elements.$body.append($tagsList); |
| 119 | }, |
| 120 | getTagsList: function getTagsList() { |
| 121 | if (!this.ui.tagsList) { |
| 122 | this.createTagsList(); |
| 123 | } |
| 124 | return this.ui.tagsList; |
| 125 | }, |
| 126 | toggleTagsList: function toggleTagsList() { |
| 127 | var $tagsList = this.getTagsList(); |
| 128 | if ($tagsList.is(':visible')) { |
| 129 | $tagsList.hide(); |
| 130 | return; |
| 131 | } |
| 132 | var direction = elementorCommon.config.isRTL ? 'left' : 'right'; |
| 133 | $tagsList.show().position({ |
| 134 | my: "".concat(direction, " top"), |
| 135 | at: "".concat(direction, " bottom+5"), |
| 136 | of: this.ui.dynamicSwitcher |
| 137 | }); |
| 138 | }, |
| 139 | setTagView: function setTagView(id, name, settings) { |
| 140 | if (this.tagView) { |
| 141 | this.tagView.destroy(); |
| 142 | } |
| 143 | var tagView = this.tagView = new TagPanelView({ |
| 144 | id: id, |
| 145 | name: name, |
| 146 | settings: settings, |
| 147 | controlName: this.view.model.get('name'), |
| 148 | dynamicSettings: this.getOption('dynamicSettings') |
| 149 | }), |
| 150 | elementContainer = this.view.options.container, |
| 151 | tagViewLabel = elementContainer.controls[tagView.options.controlName].label; |
| 152 | tagView.options.container = new elementorModules.editor.Container({ |
| 153 | type: 'dynamic', |
| 154 | id: id, |
| 155 | model: tagView.model, |
| 156 | settings: tagView.model, |
| 157 | view: tagView, |
| 158 | parent: elementContainer, |
| 159 | label: elementContainer.label + ' ' + tagViewLabel, |
| 160 | controls: tagView.model.options.controls, |
| 161 | renderer: elementContainer |
| 162 | }); |
| 163 | tagView.render(); |
| 164 | this.$el.find('.elementor-control-tag-area').after(tagView.el); |
| 165 | this.listenTo(tagView, 'remove', this.onTagViewRemove.bind(this)); |
| 166 | }, |
| 167 | setDefaultTagView: function setDefaultTagView() { |
| 168 | var tagData = elementor.dynamicTags.tagTextToTagData(this.getDynamicValue()); |
| 169 | this.setTagView(tagData.id, tagData.name, tagData.settings); |
| 170 | }, |
| 171 | tagViewToTagText: function tagViewToTagText() { |
| 172 | var tagView = this.tagView; |
| 173 | return elementor.dynamicTags.tagDataToTagText(tagView.getOption('id'), tagView.getOption('name'), tagView.model); |
| 174 | }, |
| 175 | getDynamicValue: function getDynamicValue() { |
| 176 | return this.view.container.dynamic.get(this.view.model.get('name')); |
| 177 | }, |
| 178 | destroyTagView: function destroyTagView() { |
| 179 | if (this.tagView) { |
| 180 | this.tagView.destroy(); |
| 181 | this.tagView = null; |
| 182 | } |
| 183 | }, |
| 184 | showPromotion: function showPromotion() { |
| 185 | var hasProAndNotConnected = elementor.helpers.hasProAndNotConnected(), |
| 186 | dialogOptions = { |
| 187 | title: __('Dynamic Content', 'elementor'), |
| 188 | content: __('Create more personalized and dynamic sites by populating data from various sources with dozens of dynamic tags to choose from.', 'elementor'), |
| 189 | targetElement: this.ui.dynamicSwitcher, |
| 190 | position: { |
| 191 | blockStart: '-10' |
| 192 | }, |
| 193 | actionButton: { |
| 194 | url: hasProAndNotConnected ? elementorProEditorConfig.urls.connect : elementor.config.dynamicPromotionURL.replace('%s', this.view.model.get('name')), |
| 195 | text: hasProAndNotConnected ? __('Connect & Activate', 'elementor') : __('Upgrade', 'elementor') |
| 196 | } |
| 197 | }; |
| 198 | elementor.promotion.showDialog(dialogOptions); |
| 199 | }, |
| 200 | onRender: function onRender() { |
| 201 | this.$el.addClass('elementor-control-dynamic'); |
| 202 | this.renderTools(); |
| 203 | this.toggleDynamicClass(); |
| 204 | if (this.isDynamicMode()) { |
| 205 | this.setDefaultTagView(); |
| 206 | } |
| 207 | }, |
| 208 | onDynamicSwitcherClick: function onDynamicSwitcherClick(event) { |
| 209 | event.stopPropagation(); |
| 210 | if (this.getOption('tags').length) { |
| 211 | this.toggleTagsList(); |
| 212 | } else { |
| 213 | this.showPromotion(); |
| 214 | } |
| 215 | }, |
| 216 | onTagsListItemClick: function onTagsListItemClick(event) { |
| 217 | var $tag = jQuery(event.currentTarget); |
| 218 | this.setTagView(elementorCommon.helpers.getUniqueId(), $tag.data('tagName'), {}); |
| 219 | |
| 220 | // If an element has an active global value, disable it before applying the dynamic value. |
| 221 | if (this.view.getGlobalKey()) { |
| 222 | this.view.triggerMethod('unset:global:value'); |
| 223 | } |
| 224 | if (this.isDynamicMode()) { |
| 225 | $e.run('document/dynamic/settings', { |
| 226 | container: this.view.options.container, |
| 227 | settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) |
| 228 | }); |
| 229 | } else { |
| 230 | $e.run('document/dynamic/enable', { |
| 231 | container: this.view.options.container, |
| 232 | settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) |
| 233 | }); |
| 234 | } |
| 235 | this.toggleDynamicClass(); |
| 236 | this.toggleTagsList(); |
| 237 | if (this.tagView.getTagConfig().settings_required) { |
| 238 | this.tagView.showSettingsPopup(); |
| 239 | } |
| 240 | }, |
| 241 | onTagViewRemove: function onTagViewRemove() { |
| 242 | $e.run('document/dynamic/disable', { |
| 243 | container: this.view.options.container, |
| 244 | settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText()) |
| 245 | }); |
| 246 | this.toggleDynamicClass(); |
| 247 | }, |
| 248 | onAfterExternalChange: function onAfterExternalChange() { |
| 249 | this.destroyTagView(); |
| 250 | if (this.isDynamicMode()) { |
| 251 | this.setDefaultTagView(); |
| 252 | } |
| 253 | this.toggleDynamicClass(); |
| 254 | }, |
| 255 | onDestroy: function onDestroy() { |
| 256 | this.destroyTagView(); |
| 257 | if (this.ui.tagsList) { |
| 258 | this.ui.tagsList.remove(); |
| 259 | } |
| 260 | } |
| 261 | }); |
| 262 | |
| 263 | /***/ }), |
| 264 | |
| 265 | /***/ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js": |
| 266 | /*!***********************************************************************************!*\ |
| 267 | !*** ../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js ***! |
| 268 | \***********************************************************************************/ |
| 269 | /***/ ((module) => { |
| 270 | |
| 271 | "use strict"; |
| 272 | |
| 273 | |
| 274 | module.exports = Marionette.ItemView.extend({ |
| 275 | className: 'elementor-tag-controls-stack-empty', |
| 276 | template: '#tmpl-elementor-tag-controls-stack-empty' |
| 277 | }); |
| 278 | |
| 279 | /***/ }), |
| 280 | |
| 281 | /***/ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js": |
| 282 | /*!*****************************************************************************!*\ |
| 283 | !*** ../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js ***! |
| 284 | \*****************************************************************************/ |
| 285 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 286 | |
| 287 | "use strict"; |
| 288 | |
| 289 | |
| 290 | var EmptyView = __webpack_require__(/*! elementor-dynamic-tags/tag-controls-stack-empty */ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js"); |
| 291 | module.exports = elementorModules.editor.views.ControlsStack.extend({ |
| 292 | activeTab: 'content', |
| 293 | template: _.noop, |
| 294 | emptyView: EmptyView, |
| 295 | isEmpty: function isEmpty() { |
| 296 | // Ignore the section control |
| 297 | return this.collection.length < 2; |
| 298 | }, |
| 299 | childViewOptions: function childViewOptions() { |
| 300 | return { |
| 301 | container: this.options.container |
| 302 | }; |
| 303 | }, |
| 304 | getNamespaceArray: function getNamespaceArray() { |
| 305 | var currentPageView = elementor.getPanelView().getCurrentPageView(), |
| 306 | eventNamespace = currentPageView.getNamespaceArray(); |
| 307 | eventNamespace.push(currentPageView.activeSection); |
| 308 | eventNamespace.push(this.getOption('controlName')); |
| 309 | eventNamespace.push(this.getOption('name')); |
| 310 | return eventNamespace; |
| 311 | }, |
| 312 | onRenderTemplate: function onRenderTemplate() { |
| 313 | this.activateFirstSection(); |
| 314 | } |
| 315 | }); |
| 316 | |
| 317 | /***/ }), |
| 318 | |
| 319 | /***/ "../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js": |
| 320 | /*!*************************************************************************!*\ |
| 321 | !*** ../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js ***! |
| 322 | \*************************************************************************/ |
| 323 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 324 | |
| 325 | "use strict"; |
| 326 | |
| 327 | |
| 328 | var TagControlsStack = __webpack_require__(/*! elementor-dynamic-tags/tag-controls-stack */ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js"); |
| 329 | module.exports = Marionette.ItemView.extend({ |
| 330 | className: 'elementor-dynamic-cover e-input-style', |
| 331 | tagControlsStack: null, |
| 332 | templateHelpers: function templateHelpers() { |
| 333 | var helpers = {}; |
| 334 | if (this.model) { |
| 335 | helpers.controls = this.model.options.controls; |
| 336 | } |
| 337 | return helpers; |
| 338 | }, |
| 339 | ui: { |
| 340 | remove: '.elementor-dynamic-cover__remove' |
| 341 | }, |
| 342 | events: function events() { |
| 343 | var events = { |
| 344 | 'click @ui.remove': 'onRemoveClick' |
| 345 | }; |
| 346 | if (this.hasSettings()) { |
| 347 | events.click = 'onClick'; |
| 348 | } |
| 349 | return events; |
| 350 | }, |
| 351 | getTemplate: function getTemplate() { |
| 352 | var config = this.getTagConfig(), |
| 353 | templateFunction = Marionette.TemplateCache.get('#tmpl-elementor-control-dynamic-cover'), |
| 354 | renderedTemplate = Marionette.Renderer.render(templateFunction, { |
| 355 | hasSettings: this.hasSettings(), |
| 356 | isRemovable: !this.getOption('dynamicSettings').default, |
| 357 | title: config.title, |
| 358 | content: config.panel_template |
| 359 | }); |
| 360 | return Marionette.TemplateCache.prototype.compileTemplate(renderedTemplate.trim()); |
| 361 | }, |
| 362 | getTagConfig: function getTagConfig() { |
| 363 | return elementor.dynamicTags.getConfig('tags.' + this.getOption('name')); |
| 364 | }, |
| 365 | initSettingsPopup: function initSettingsPopup() { |
| 366 | var settingsPopupOptions = { |
| 367 | className: 'elementor-tag-settings-popup', |
| 368 | position: { |
| 369 | my: 'left top+5', |
| 370 | at: 'left bottom', |
| 371 | of: this.$el, |
| 372 | autoRefresh: true |
| 373 | }, |
| 374 | hide: { |
| 375 | ignore: '.select2-container' |
| 376 | } |
| 377 | }; |
| 378 | var settingsPopup = elementorCommon.dialogsManager.createWidget('buttons', settingsPopupOptions); |
| 379 | this.getSettingsPopup = function () { |
| 380 | return settingsPopup; |
| 381 | }; |
| 382 | }, |
| 383 | hasSettings: function hasSettings() { |
| 384 | return !!Object.values(this.getTagConfig().controls).length; |
| 385 | }, |
| 386 | showSettingsPopup: function showSettingsPopup() { |
| 387 | if (!this.tagControlsStack) { |
| 388 | this.initTagControlsStack(); |
| 389 | } |
| 390 | var settingsPopup = this.getSettingsPopup(); |
| 391 | if (settingsPopup.isVisible()) { |
| 392 | return; |
| 393 | } |
| 394 | settingsPopup.show(); |
| 395 | }, |
| 396 | initTagControlsStack: function initTagControlsStack() { |
| 397 | this.tagControlsStack = new TagControlsStack({ |
| 398 | model: this.model, |
| 399 | controls: this.model.controls, |
| 400 | name: this.options.name, |
| 401 | controlName: this.options.controlName, |
| 402 | container: this.options.container, |
| 403 | el: this.getSettingsPopup().getElements('message')[0] |
| 404 | }); |
| 405 | this.tagControlsStack.render(); |
| 406 | }, |
| 407 | initModel: function initModel() { |
| 408 | this.model = new elementorModules.editor.elements.models.BaseSettings(this.getOption('settings'), { |
| 409 | controls: this.getTagConfig().controls |
| 410 | }); |
| 411 | }, |
| 412 | initialize: function initialize() { |
| 413 | // The `model` should always be available. |
| 414 | this.initModel(); |
| 415 | if (!this.hasSettings()) { |
| 416 | return; |
| 417 | } |
| 418 | this.initSettingsPopup(); |
| 419 | this.listenTo(this.model, 'change', this.render); |
| 420 | }, |
| 421 | onClick: function onClick() { |
| 422 | this.showSettingsPopup(); |
| 423 | }, |
| 424 | onRemoveClick: function onRemoveClick(event) { |
| 425 | event.stopPropagation(); |
| 426 | this.destroy(); |
| 427 | this.trigger('remove'); |
| 428 | }, |
| 429 | onDestroy: function onDestroy() { |
| 430 | if (this.hasSettings()) { |
| 431 | this.getSettingsPopup().destroy(); |
| 432 | } |
| 433 | if (this.tagControlsStack) { |
| 434 | this.tagControlsStack.destroy(); |
| 435 | } |
| 436 | } |
| 437 | }); |
| 438 | |
| 439 | /***/ }), |
| 440 | |
| 441 | /***/ "../assets/dev/js/editor/components/validator/base.js": |
| 442 | /*!************************************************************!*\ |
| 443 | !*** ../assets/dev/js/editor/components/validator/base.js ***! |
| 444 | \************************************************************/ |
| 445 | /***/ ((module) => { |
| 446 | |
| 447 | "use strict"; |
| 448 | |
| 449 | |
| 450 | module.exports = elementorModules.Module.extend({ |
| 451 | errors: [], |
| 452 | __construct: function __construct(settings) { |
| 453 | var customValidationMethod = settings.customValidationMethod; |
| 454 | if (customValidationMethod) { |
| 455 | this.validationMethod = customValidationMethod; |
| 456 | } |
| 457 | }, |
| 458 | getDefaultSettings: function getDefaultSettings() { |
| 459 | return { |
| 460 | validationTerms: {} |
| 461 | }; |
| 462 | }, |
| 463 | isValid: function isValid() { |
| 464 | var validationErrors = this.validationMethod.apply(this, arguments); |
| 465 | if (validationErrors.length) { |
| 466 | this.errors = validationErrors; |
| 467 | return false; |
| 468 | } |
| 469 | return true; |
| 470 | }, |
| 471 | validationMethod: function validationMethod(newValue) { |
| 472 | var validationTerms = this.getSettings('validationTerms'), |
| 473 | errors = []; |
| 474 | if (validationTerms.required) { |
| 475 | if (!('' + newValue).length) { |
| 476 | errors.push('Required value is empty'); |
| 477 | } |
| 478 | } |
| 479 | return errors; |
| 480 | } |
| 481 | }); |
| 482 | |
| 483 | /***/ }), |
| 484 | |
| 485 | /***/ "../assets/dev/js/editor/components/validator/breakpoint.js": |
| 486 | /*!******************************************************************!*\ |
| 487 | !*** ../assets/dev/js/editor/components/validator/breakpoint.js ***! |
| 488 | \******************************************************************/ |
| 489 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 490 | |
| 491 | "use strict"; |
| 492 | |
| 493 | |
| 494 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 495 | Object.defineProperty(exports, "__esModule", ({ |
| 496 | value: true |
| 497 | })); |
| 498 | exports["default"] = void 0; |
| 499 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 500 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 501 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 502 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 503 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 504 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 505 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 506 | var NumberValidator = __webpack_require__(/*! elementor-validator/number */ "../assets/dev/js/editor/components/validator/number.js"); |
| 507 | var BreakpointValidator = exports["default"] = /*#__PURE__*/function (_NumberValidator) { |
| 508 | function BreakpointValidator() { |
| 509 | (0, _classCallCheck2.default)(this, BreakpointValidator); |
| 510 | return _callSuper(this, BreakpointValidator, arguments); |
| 511 | } |
| 512 | (0, _inherits2.default)(BreakpointValidator, _NumberValidator); |
| 513 | return (0, _createClass2.default)(BreakpointValidator, [{ |
| 514 | key: "getDefaultSettings", |
| 515 | value: function getDefaultSettings() { |
| 516 | return { |
| 517 | validationTerms: { |
| 518 | // Max width we allow in general |
| 519 | max: 5120 |
| 520 | } |
| 521 | }; |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * Get Panel Active Breakpoints |
| 526 | * |
| 527 | * Since the active kit used in the Site Settings panel could be a draft, we need to use the panel's active |
| 528 | * breakpoints settings and not the elementorFrontend.config values (which come from the DB). |
| 529 | * |
| 530 | * @return {*} Object |
| 531 | */ |
| 532 | }, { |
| 533 | key: "getPanelActiveBreakpoints", |
| 534 | value: function getPanelActiveBreakpoints() { |
| 535 | var panelBreakpoints = elementor.documents.currentDocument.config.settings.settings.active_breakpoints.map(function (breakpointName) { |
| 536 | return breakpointName.replace('viewport_', ''); |
| 537 | }), |
| 538 | panelActiveBreakpoints = {}; |
| 539 | panelBreakpoints.forEach(function (breakpointName) { |
| 540 | panelActiveBreakpoints[breakpointName] = elementorFrontend.config.responsive.breakpoints[breakpointName]; |
| 541 | }); |
| 542 | return panelActiveBreakpoints; |
| 543 | } |
| 544 | }, { |
| 545 | key: "initBreakpointProperties", |
| 546 | value: function initBreakpointProperties() { |
| 547 | var _activeBreakpoints$br, _activeBreakpoints$br2; |
| 548 | var validationTerms = this.getSettings('validationTerms'), |
| 549 | activeBreakpoints = this.getPanelActiveBreakpoints(), |
| 550 | breakpointKeys = Object.keys(activeBreakpoints); |
| 551 | this.breakpointIndex = breakpointKeys.indexOf(validationTerms.breakpointName); |
| 552 | this.topBreakpoint = (_activeBreakpoints$br = activeBreakpoints[breakpointKeys[this.breakpointIndex + 1]]) === null || _activeBreakpoints$br === void 0 ? void 0 : _activeBreakpoints$br.value; |
| 553 | this.bottomBreakpoint = (_activeBreakpoints$br2 = activeBreakpoints[breakpointKeys[this.breakpointIndex - 1]]) === null || _activeBreakpoints$br2 === void 0 ? void 0 : _activeBreakpoints$br2.value; |
| 554 | } |
| 555 | }, { |
| 556 | key: "validationMethod", |
| 557 | value: function validationMethod(newValue) { |
| 558 | var validationTerms = this.getSettings('validationTerms'), |
| 559 | errors = NumberValidator.prototype.validationMethod.call(this, newValue); |
| 560 | |
| 561 | // Validate both numeric and empty values, since breakpoints utilize default values when empty. |
| 562 | if (_.isFinite(newValue) || '' === newValue) { |
| 563 | if (!this.validateMinMaxForBreakpoint(newValue, validationTerms)) { |
| 564 | errors.push('Value is not between the breakpoints above or under the edited breakpoint'); |
| 565 | } |
| 566 | } |
| 567 | return errors; |
| 568 | } |
| 569 | }, { |
| 570 | key: "validateMinMaxForBreakpoint", |
| 571 | value: function validateMinMaxForBreakpoint(newValue, validationTerms) { |
| 572 | var breakpointDefaultValue = elementorFrontend.config.responsive.breakpoints[validationTerms.breakpointName].default_value; |
| 573 | var isValid = true; |
| 574 | this.initBreakpointProperties(); |
| 575 | |
| 576 | // Since the following comparison is <=, allow usage of the 320px value for the mobile breakpoint. |
| 577 | if ('mobile' === validationTerms.breakpointName && 320 === this.bottomBreakpoint) { |
| 578 | this.bottomBreakpoint -= 1; |
| 579 | } |
| 580 | |
| 581 | // If there is a breakpoint below the currently edited breakpoint |
| 582 | if (this.bottomBreakpoint) { |
| 583 | // Check that the new value is not under the bottom breakpoint's value. |
| 584 | if ('' !== newValue && newValue <= this.bottomBreakpoint) { |
| 585 | isValid = false; |
| 586 | } |
| 587 | |
| 588 | // If the new value is empty, check that the default breakpoint value is not below the bottom breakpoint. |
| 589 | if ('' === newValue && breakpointDefaultValue <= this.bottomBreakpoint) { |
| 590 | isValid = false; |
| 591 | } |
| 592 | } |
| 593 | |
| 594 | // If there is a breakpoint above the currently edited breakpoint. |
| 595 | if (this.topBreakpoint) { |
| 596 | // Check that the value is not above the top breakpoint's value. |
| 597 | if ('' !== newValue && newValue >= this.topBreakpoint) { |
| 598 | isValid = false; |
| 599 | } |
| 600 | |
| 601 | // If the new value is empty, check that the default breakpoint value is not above the top breakpoint. |
| 602 | if ('' === newValue && breakpointDefaultValue >= this.topBreakpoint) { |
| 603 | isValid = false; |
| 604 | } |
| 605 | } |
| 606 | return isValid; |
| 607 | } |
| 608 | }]); |
| 609 | }(NumberValidator); |
| 610 | |
| 611 | /***/ }), |
| 612 | |
| 613 | /***/ "../assets/dev/js/editor/components/validator/number.js": |
| 614 | /*!**************************************************************!*\ |
| 615 | !*** ../assets/dev/js/editor/components/validator/number.js ***! |
| 616 | \**************************************************************/ |
| 617 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 618 | |
| 619 | "use strict"; |
| 620 | |
| 621 | |
| 622 | var Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js"); |
| 623 | module.exports = Validator.extend({ |
| 624 | validationMethod: function validationMethod(newValue) { |
| 625 | var validationTerms = this.getSettings('validationTerms'), |
| 626 | errors = []; |
| 627 | if (_.isFinite(newValue)) { |
| 628 | if (undefined !== validationTerms.min && newValue < validationTerms.min) { |
| 629 | errors.push('Value is less than minimum'); |
| 630 | } |
| 631 | if (undefined !== validationTerms.max && newValue > validationTerms.max) { |
| 632 | errors.push('Value is greater than maximum'); |
| 633 | } |
| 634 | } |
| 635 | return errors; |
| 636 | } |
| 637 | }); |
| 638 | |
| 639 | /***/ }), |
| 640 | |
| 641 | /***/ "../assets/dev/js/editor/controls/base-data.js": |
| 642 | /*!*****************************************************!*\ |
| 643 | !*** ../assets/dev/js/editor/controls/base-data.js ***! |
| 644 | \*****************************************************/ |
| 645 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 646 | |
| 647 | "use strict"; |
| 648 | |
| 649 | |
| 650 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 651 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 652 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 653 | var _breakpoint = _interopRequireDefault(__webpack_require__(/*! elementor-validator/breakpoint */ "../assets/dev/js/editor/components/validator/breakpoint.js")); |
| 654 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } |
| 655 | 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; } } |
| 656 | 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; } |
| 657 | var ControlBaseView = __webpack_require__(/*! elementor-controls/base */ "../assets/dev/js/editor/controls/base.js"), |
| 658 | TagsBehavior = __webpack_require__(/*! elementor-dynamic-tags/control-behavior */ "../assets/dev/js/editor/components/dynamic-tags/control-behavior.js"), |
| 659 | Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js"), |
| 660 | NumberValidator = __webpack_require__(/*! elementor-validator/number */ "../assets/dev/js/editor/components/validator/number.js"), |
| 661 | ControlBaseDataView; |
| 662 | ControlBaseDataView = ControlBaseView.extend({ |
| 663 | validatorTypes: { |
| 664 | Base: Validator, |
| 665 | Number: NumberValidator, |
| 666 | Breakpoint: _breakpoint.default |
| 667 | }, |
| 668 | ui: function ui() { |
| 669 | var ui = ControlBaseView.prototype.ui.apply(this, arguments); |
| 670 | _.extend(ui, { |
| 671 | input: 'input[data-setting][type!="checkbox"][type!="radio"]', |
| 672 | checkbox: 'input[data-setting][type="checkbox"]', |
| 673 | radio: 'input[data-setting][type="radio"]', |
| 674 | select: 'select[data-setting]', |
| 675 | textarea: 'textarea[data-setting]', |
| 676 | responsiveSwitchersSibling: "".concat(ui.controlTitle, "[data-e-responsive-switcher-sibling!=\"false\"]"), |
| 677 | responsiveSwitchers: '.elementor-responsive-switcher', |
| 678 | contentEditable: '[contenteditable="true"]' |
| 679 | }); |
| 680 | return ui; |
| 681 | }, |
| 682 | templateHelpers: function templateHelpers() { |
| 683 | var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments); |
| 684 | controlData.data.controlValue = this.getControlValue(); |
| 685 | return controlData; |
| 686 | }, |
| 687 | events: function events() { |
| 688 | return { |
| 689 | 'input @ui.input': 'onBaseInputTextChange', |
| 690 | 'change @ui.checkbox': 'onBaseInputChange', |
| 691 | 'change @ui.radio': 'onBaseInputChange', |
| 692 | 'input @ui.textarea': 'onBaseInputTextChange', |
| 693 | 'change @ui.select': 'onBaseInputChange', |
| 694 | 'input @ui.contentEditable': 'onBaseInputTextChange', |
| 695 | 'click @ui.responsiveSwitchers': 'onResponsiveSwitchersClick' |
| 696 | }; |
| 697 | }, |
| 698 | behaviors: function behaviors() { |
| 699 | var behaviors = ControlBaseView.prototype.behaviors.apply(this, arguments), |
| 700 | dynamicSettings = this.options.model.get('dynamic'); |
| 701 | if (dynamicSettings && dynamicSettings.active) { |
| 702 | var tags = _.filter(elementor.dynamicTags.getConfig('tags'), function (tag) { |
| 703 | return tag.editable && _.intersection(tag.categories, dynamicSettings.categories).length; |
| 704 | }); |
| 705 | if (tags.length || elementor.config.user.is_administrator) { |
| 706 | behaviors.tags = { |
| 707 | behaviorClass: TagsBehavior, |
| 708 | tags: tags, |
| 709 | dynamicSettings: dynamicSettings |
| 710 | }; |
| 711 | } |
| 712 | } |
| 713 | return behaviors; |
| 714 | }, |
| 715 | initialize: function initialize() { |
| 716 | ControlBaseView.prototype.initialize.apply(this, arguments); |
| 717 | this.registerValidators(); |
| 718 | if (this.model.get('responsive')) { |
| 719 | this.setPlaceholderFromParent(); |
| 720 | } |
| 721 | if (undefined === this.model.get('inherit_placeholders')) { |
| 722 | this.model.set('inherit_placeholders', true); |
| 723 | } |
| 724 | |
| 725 | // TODO: this.elementSettingsModel is deprecated since 2.8.0. |
| 726 | var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 727 | this.listenTo(settings, 'change:external:' + this.model.get('name'), this.onAfterExternalChange); |
| 728 | }, |
| 729 | getControlValue: function getControlValue() { |
| 730 | return this.container.settings.get(this.model.get('name')); |
| 731 | }, |
| 732 | getGlobalKey: function getGlobalKey() { |
| 733 | return this.container.globals.get(this.model.get('name')); |
| 734 | }, |
| 735 | getGlobalValue: function getGlobalValue() { |
| 736 | return this.globalValue; |
| 737 | }, |
| 738 | getGlobalDefault: function getGlobalDefault() { |
| 739 | var controlGlobalArgs = this.model.get('global'); |
| 740 | if (controlGlobalArgs !== null && controlGlobalArgs !== void 0 && controlGlobalArgs.default) { |
| 741 | // If the control is a color/typography control and default colors/typography are disabled, don't return the global value. |
| 742 | if (!elementor.config.globals.defaults_enabled[this.getGlobalMeta().controlType]) { |
| 743 | return ''; |
| 744 | } |
| 745 | var _$e$data$commandExtra = $e.data.commandExtractArgs(controlGlobalArgs.default), |
| 746 | command = _$e$data$commandExtra.command, |
| 747 | args = _$e$data$commandExtra.args, |
| 748 | result = $e.data.getCache($e.components.get('globals'), command, args.query); |
| 749 | return result === null || result === void 0 ? void 0 : result.value; |
| 750 | } |
| 751 | |
| 752 | // No global default. |
| 753 | return ''; |
| 754 | }, |
| 755 | getCurrentValue: function getCurrentValue() { |
| 756 | if (this.getGlobalKey() && !this.globalValue) { |
| 757 | return ''; |
| 758 | } |
| 759 | if (this.globalValue) { |
| 760 | return this.globalValue; |
| 761 | } |
| 762 | var controlValue = this.getControlValue(); |
| 763 | if (controlValue) { |
| 764 | return controlValue; |
| 765 | } |
| 766 | return this.getGlobalDefault(); |
| 767 | }, |
| 768 | isGlobalActive: function isGlobalActive() { |
| 769 | var _this$options$model$g; |
| 770 | return (_this$options$model$g = this.options.model.get('global')) === null || _this$options$model$g === void 0 ? void 0 : _this$options$model$g.active; |
| 771 | }, |
| 772 | setValue: function setValue(value) { |
| 773 | this.setSettingsModel(value); |
| 774 | }, |
| 775 | setSettingsModel: function setSettingsModel(value) { |
| 776 | var key = this.model.get('name'); |
| 777 | $e.run('document/elements/settings', { |
| 778 | container: this.options.container, |
| 779 | settings: (0, _defineProperty2.default)({}, key, value) |
| 780 | }); |
| 781 | this.triggerMethod('settings:change'); |
| 782 | }, |
| 783 | applySavedValue: function applySavedValue() { |
| 784 | this.setInputValue('[data-setting="' + this.model.get('name') + '"]', this.getControlValue()); |
| 785 | }, |
| 786 | getEditSettings: function getEditSettings(setting) { |
| 787 | var settings = this.getOption('elementEditSettings').toJSON(); |
| 788 | if (setting) { |
| 789 | return settings[setting]; |
| 790 | } |
| 791 | return settings; |
| 792 | }, |
| 793 | setEditSetting: function setEditSetting(settingKey, settingValue) { |
| 794 | var settings = this.getOption('elementEditSettings') || this.getOption('container').settings; |
| 795 | settings.set(settingKey, settingValue); |
| 796 | }, |
| 797 | /** |
| 798 | * Get the placeholder for the current control. |
| 799 | * |
| 800 | * @return {*} placeholder |
| 801 | */ |
| 802 | getControlPlaceholder: function getControlPlaceholder() { |
| 803 | var placeholder = this.model.get('placeholder'); |
| 804 | if (this.model.get('responsive') && this.model.get('inherit_placeholders')) { |
| 805 | placeholder = placeholder || this.container.placeholders[this.model.get('name')]; |
| 806 | } |
| 807 | return placeholder; |
| 808 | }, |
| 809 | /** |
| 810 | * Get the responsive parent view if exists. |
| 811 | * |
| 812 | * @return {ControlBaseDataView|undefined} responsive parent view if exists |
| 813 | */ |
| 814 | getResponsiveParentView: function getResponsiveParentView() { |
| 815 | var parent = this.model.get('parent'); |
| 816 | try { |
| 817 | return parent && this.container.panel.getControlView(parent); |
| 818 | // eslint-disable-next-line no-empty |
| 819 | } catch (e) {} |
| 820 | }, |
| 821 | /** |
| 822 | * Get the responsive children views if exists. |
| 823 | * |
| 824 | * @return {ControlBaseDataView|null} responsive children views if exists |
| 825 | */ |
| 826 | getResponsiveChildrenViews: function getResponsiveChildrenViews() { |
| 827 | var children = this.model.get('inheritors'), |
| 828 | views = []; |
| 829 | try { |
| 830 | var _iterator = _createForOfIteratorHelper(children), |
| 831 | _step; |
| 832 | try { |
| 833 | for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 834 | var child = _step.value; |
| 835 | views.push(this.container.panel.getControlView(child)); |
| 836 | } |
| 837 | // eslint-disable-next-line no-empty |
| 838 | } catch (err) { |
| 839 | _iterator.e(err); |
| 840 | } finally { |
| 841 | _iterator.f(); |
| 842 | } |
| 843 | } catch (e) {} |
| 844 | return views; |
| 845 | }, |
| 846 | /** |
| 847 | * Get prepared placeholder from the responsive parent, and put it into current |
| 848 | * control model as placeholder. |
| 849 | */ |
| 850 | setPlaceholderFromParent: function setPlaceholderFromParent() { |
| 851 | var parent = this.getResponsiveParentView(); |
| 852 | if (parent) { |
| 853 | this.container.placeholders[this.model.get('name')] = parent.preparePlaceholderForChildren(); |
| 854 | } |
| 855 | }, |
| 856 | /** |
| 857 | * Returns the value of the current control if exists, or the parent value if not, |
| 858 | * so responsive children can set it as their placeholder. When there are multiple |
| 859 | * inputs, the inputs which are empty on this control will inherit their values |
| 860 | * from the responsive parent. |
| 861 | * For example, if on desktop the padding of all edges is 10, and on tablet only |
| 862 | * padding right and left is set to 15, the mobile control placeholder will |
| 863 | * eventually be: { top: 10, right: 15, left: 15, bottom: 10 }, because of the |
| 864 | * inheritance of multiple values. |
| 865 | * |
| 866 | * @return {*} value of the current control if exists, or the parent value if not |
| 867 | */ |
| 868 | preparePlaceholderForChildren: function preparePlaceholderForChildren() { |
| 869 | var _this$getResponsivePa; |
| 870 | var cleanValue = this.getCleanControlValue(), |
| 871 | parentValue = (_this$getResponsivePa = this.getResponsiveParentView()) === null || _this$getResponsivePa === void 0 ? void 0 : _this$getResponsivePa.preparePlaceholderForChildren(); |
| 872 | if (cleanValue instanceof Object) { |
| 873 | return Object.assign({}, parentValue, cleanValue); |
| 874 | } |
| 875 | return cleanValue || parentValue; |
| 876 | }, |
| 877 | /** |
| 878 | * Start the re-rendering recursive chain from the responsive child of this |
| 879 | * control. It's useful when the current control value is changed and we want |
| 880 | * to update all responsive children. In this case, the re-rendering is supposed |
| 881 | * to be applied only from the responsive child of this control and on. |
| 882 | */ |
| 883 | propagatePlaceholder: function propagatePlaceholder() { |
| 884 | var children = this.getResponsiveChildrenViews(); |
| 885 | var _iterator2 = _createForOfIteratorHelper(children), |
| 886 | _step2; |
| 887 | try { |
| 888 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { |
| 889 | var child = _step2.value; |
| 890 | child.renderWithChildren(); |
| 891 | } |
| 892 | } catch (err) { |
| 893 | _iterator2.e(err); |
| 894 | } finally { |
| 895 | _iterator2.f(); |
| 896 | } |
| 897 | }, |
| 898 | /** |
| 899 | * Re-render current control and trigger this method on the responsive child. |
| 900 | * The purpose of those actions is to recursively re-render all responsive |
| 901 | * children. |
| 902 | */ |
| 903 | renderWithChildren: function renderWithChildren() { |
| 904 | this.render(); |
| 905 | this.propagatePlaceholder(); |
| 906 | }, |
| 907 | /** |
| 908 | * Get control value without empty properties, and without default values. |
| 909 | * |
| 910 | * @return {{}} control value without empty properties, and without default values |
| 911 | */ |
| 912 | getCleanControlValue: function getCleanControlValue() { |
| 913 | var value = this.getControlValue(); |
| 914 | return value && value !== this.model.get('default') ? value : undefined; |
| 915 | }, |
| 916 | onAfterChange: function onAfterChange(control) { |
| 917 | if (Object.keys(control.changed).includes(this.model.get('name'))) { |
| 918 | this.propagatePlaceholder(); |
| 919 | } |
| 920 | ControlBaseView.prototype.onAfterChange.apply(this, arguments); |
| 921 | }, |
| 922 | getInputValue: function getInputValue(input) { |
| 923 | var $input = this.$(input); |
| 924 | if ($input.is('[contenteditable="true"]')) { |
| 925 | return $input.html(); |
| 926 | } |
| 927 | var inputValue = $input.val(), |
| 928 | inputType = $input.attr('type'); |
| 929 | if (-1 !== ['radio', 'checkbox'].indexOf(inputType)) { |
| 930 | return $input.prop('checked') ? inputValue : ''; |
| 931 | } |
| 932 | if ('number' === inputType && _.isFinite(inputValue)) { |
| 933 | return +inputValue; |
| 934 | } |
| 935 | |
| 936 | // Temp fix for jQuery (< 3.0) that return null instead of empty array |
| 937 | if ('SELECT' === input.tagName && $input.prop('multiple') && null === inputValue) { |
| 938 | inputValue = []; |
| 939 | } |
| 940 | return inputValue; |
| 941 | }, |
| 942 | setInputValue: function setInputValue(input, value) { |
| 943 | var $input = this.$(input), |
| 944 | inputType = $input.attr('type'); |
| 945 | if ('checkbox' === inputType) { |
| 946 | $input.prop('checked', !!value); |
| 947 | } else if ('radio' === inputType) { |
| 948 | $input.filter('[value="' + value + '"]').prop('checked', true); |
| 949 | } else { |
| 950 | $input.val(value); |
| 951 | } |
| 952 | }, |
| 953 | addValidator: function addValidator(validator) { |
| 954 | this.validators.push(validator); |
| 955 | }, |
| 956 | registerValidators: function registerValidators() { |
| 957 | var _this = this; |
| 958 | this.validators = []; |
| 959 | var validationTerms = {}; |
| 960 | if (this.model.get('required')) { |
| 961 | validationTerms.required = true; |
| 962 | } |
| 963 | if (!jQuery.isEmptyObject(validationTerms)) { |
| 964 | this.addValidator(new this.validatorTypes.Base({ |
| 965 | validationTerms: validationTerms |
| 966 | })); |
| 967 | } |
| 968 | var validators = this.model.get('validators'); |
| 969 | if (validators) { |
| 970 | Object.entries(validators).forEach(function (_ref) { |
| 971 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 972 | key = _ref2[0], |
| 973 | args = _ref2[1]; |
| 974 | _this.addValidator(new _this.validatorTypes[key]({ |
| 975 | validationTerms: args |
| 976 | })); |
| 977 | }); |
| 978 | } |
| 979 | }, |
| 980 | onBeforeRender: function onBeforeRender() { |
| 981 | this.setPlaceholderFromParent(); |
| 982 | }, |
| 983 | onRender: function onRender() { |
| 984 | ControlBaseView.prototype.onRender.apply(this, arguments); |
| 985 | if (this.model.get('responsive')) { |
| 986 | this.renderResponsiveSwitchers(); |
| 987 | } |
| 988 | this.applySavedValue(); |
| 989 | this.triggerMethod('ready'); |
| 990 | this.toggleControlVisibility(); |
| 991 | this.addTooltip(); |
| 992 | }, |
| 993 | onBaseInputTextChange: function onBaseInputTextChange(event) { |
| 994 | this.onBaseInputChange(event); |
| 995 | }, |
| 996 | onBaseInputChange: function onBaseInputChange(event) { |
| 997 | clearTimeout(this.correctionTimeout); |
| 998 | var input = event.currentTarget, |
| 999 | value = this.getInputValue(input), |
| 1000 | validators = this.validators.slice(0), |
| 1001 | settingsValidators = this.container.settings.validators[this.model.get('name')]; |
| 1002 | if (settingsValidators) { |
| 1003 | validators = validators.concat(settingsValidators); |
| 1004 | } |
| 1005 | if (validators) { |
| 1006 | var oldValue = this.getControlValue(input.dataset.setting); |
| 1007 | var isValidValue = validators.every(function (validator) { |
| 1008 | return validator.isValid(value, oldValue); |
| 1009 | }); |
| 1010 | if (!isValidValue) { |
| 1011 | this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200); |
| 1012 | return; |
| 1013 | } |
| 1014 | } |
| 1015 | this.updateElementModel(value, input); |
| 1016 | this.triggerMethod('input:change', event); |
| 1017 | }, |
| 1018 | onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) { |
| 1019 | var $switcher = jQuery(event.currentTarget), |
| 1020 | device = $switcher.data('device'), |
| 1021 | $switchersWrapper = this.ui.responsiveSwitchersWrapper, |
| 1022 | selectedOption = $switcher.index(); |
| 1023 | $switchersWrapper.toggleClass('elementor-responsive-switchers-open'); |
| 1024 | $switchersWrapper[0].style.setProperty('--selected-option', selectedOption); |
| 1025 | this.triggerMethod('responsive:switcher:click', device); |
| 1026 | elementor.changeDeviceMode(device); |
| 1027 | }, |
| 1028 | renderResponsiveSwitchers: function renderResponsiveSwitchers() { |
| 1029 | var templateHtml = Marionette.Renderer.render('#tmpl-elementor-control-responsive-switchers', this.model.attributes); |
| 1030 | this.ui.responsiveSwitchersSibling.after(templateHtml); |
| 1031 | this.ui.responsiveSwitchersWrapper = this.$el.find('.elementor-control-responsive-switchers'); |
| 1032 | }, |
| 1033 | onAfterExternalChange: function onAfterExternalChange() { |
| 1034 | this.hideTooltip(); |
| 1035 | this.applySavedValue(); |
| 1036 | }, |
| 1037 | addTooltip: function addTooltip() { |
| 1038 | this.ui.tooltipTargets = this.$el.find('.tooltip-target'); |
| 1039 | if (!this.ui.tooltipTargets.length) { |
| 1040 | return; |
| 1041 | } |
| 1042 | |
| 1043 | // Create tooltip on controls |
| 1044 | this.ui.tooltipTargets.tipsy({ |
| 1045 | gravity: function gravity() { |
| 1046 | // `n` for down, `s` for up |
| 1047 | var gravity = jQuery(this).data('tooltip-pos'); |
| 1048 | if (undefined !== gravity) { |
| 1049 | return gravity; |
| 1050 | } |
| 1051 | return 's'; |
| 1052 | }, |
| 1053 | title: function title() { |
| 1054 | return this.getAttribute('data-tooltip'); |
| 1055 | } |
| 1056 | }); |
| 1057 | }, |
| 1058 | hideTooltip: function hideTooltip() { |
| 1059 | if (this.ui.tooltipTargets.length) { |
| 1060 | this.ui.tooltipTargets.tipsy('hide'); |
| 1061 | } |
| 1062 | }, |
| 1063 | updateElementModel: function updateElementModel(value) { |
| 1064 | this.setValue(value); |
| 1065 | } |
| 1066 | }, { |
| 1067 | // Static methods |
| 1068 | getStyleValue: function getStyleValue(placeholder, controlValue, controlData) { |
| 1069 | if ('DEFAULT' === placeholder) { |
| 1070 | return controlData.default; |
| 1071 | } |
| 1072 | return controlValue; |
| 1073 | }, |
| 1074 | onPasteStyle: function onPasteStyle() { |
| 1075 | return true; |
| 1076 | } |
| 1077 | }); |
| 1078 | module.exports = ControlBaseDataView; |
| 1079 | |
| 1080 | /***/ }), |
| 1081 | |
| 1082 | /***/ "../assets/dev/js/editor/controls/base.js": |
| 1083 | /*!************************************************!*\ |
| 1084 | !*** ../assets/dev/js/editor/controls/base.js ***! |
| 1085 | \************************************************/ |
| 1086 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1087 | |
| 1088 | "use strict"; |
| 1089 | |
| 1090 | |
| 1091 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1092 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 1093 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } |
| 1094 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } |
| 1095 | var ControlBaseView; |
| 1096 | ControlBaseView = Marionette.CompositeView.extend({ |
| 1097 | ui: function ui() { |
| 1098 | return { |
| 1099 | controlTitle: '.elementor-control-title' |
| 1100 | }; |
| 1101 | }, |
| 1102 | behaviors: function behaviors() { |
| 1103 | var behaviors = {}; |
| 1104 | return elementor.hooks.applyFilters('controls/base/behaviors', behaviors, this); |
| 1105 | }, |
| 1106 | getBehavior: function getBehavior(name) { |
| 1107 | return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; |
| 1108 | }, |
| 1109 | className: function className() { |
| 1110 | // TODO: Any better classes for that? |
| 1111 | var classes = 'elementor-control elementor-control-' + this.model.get('name') + ' elementor-control-type-' + this.model.get('type'), |
| 1112 | modelClasses = this.model.get('classes'), |
| 1113 | responsive = this.model.get('responsive'); |
| 1114 | if (!_.isEmpty(modelClasses)) { |
| 1115 | classes += ' ' + modelClasses; |
| 1116 | } |
| 1117 | if (!_.isEmpty(responsive)) { |
| 1118 | var responsiveControlName = responsive.max || responsive.min; |
| 1119 | classes += ' elementor-control-responsive-' + responsiveControlName; |
| 1120 | } |
| 1121 | return classes; |
| 1122 | }, |
| 1123 | templateHelpers: function templateHelpers() { |
| 1124 | var controlData = { |
| 1125 | _cid: this.model.cid |
| 1126 | }; |
| 1127 | return { |
| 1128 | view: this, |
| 1129 | data: _.extend({}, this.model.toJSON(), controlData) |
| 1130 | }; |
| 1131 | }, |
| 1132 | getTemplate: function getTemplate() { |
| 1133 | return Marionette.TemplateCache.get('#tmpl-elementor-control-' + this.model.get('type') + '-content'); |
| 1134 | }, |
| 1135 | initialize: function initialize(options) { |
| 1136 | var label = this.model.get('label'); |
| 1137 | |
| 1138 | // TODO: Temp backwards compatibility. since 2.8.0. |
| 1139 | Object.defineProperty(this, 'container', { |
| 1140 | get: function get() { |
| 1141 | if (!options.container) { |
| 1142 | var settingsModel = options.elementSettingsModel, |
| 1143 | view = $e.components.get('document').utils.findViewById(settingsModel.id); |
| 1144 | |
| 1145 | // Element control. |
| 1146 | if (view && view.getContainer) { |
| 1147 | options.container = view.getContainer(); |
| 1148 | } else { |
| 1149 | if (!settingsModel.id) { |
| 1150 | settingsModel.id = 'bc-' + elementorCommon.helpers.getUniqueId(); |
| 1151 | } |
| 1152 | |
| 1153 | // Document/General/Other control. |
| 1154 | options.container = new elementorModules.editor.Container({ |
| 1155 | type: 'bc-container', |
| 1156 | id: settingsModel.id, |
| 1157 | model: settingsModel, |
| 1158 | settings: settingsModel, |
| 1159 | label: label, |
| 1160 | view: false, |
| 1161 | parent: false, |
| 1162 | renderer: false, |
| 1163 | controls: settingsModel.options.controls |
| 1164 | }); |
| 1165 | } |
| 1166 | } |
| 1167 | return options.container; |
| 1168 | } |
| 1169 | }); |
| 1170 | |
| 1171 | // Use `defineProperty` because `get elementSettingsModel()` fails during the `Marionette.CompositeView.extend`. |
| 1172 | Object.defineProperty(this, 'elementSettingsModel', { |
| 1173 | get: function get() { |
| 1174 | elementorDevTools.deprecation.deprecated('elementSettingsModel', '2.8.0', 'container.settings'); |
| 1175 | return options.container ? options.container.settings : options.elementSettingsModel; |
| 1176 | } |
| 1177 | }); |
| 1178 | var controlType = this.model.get('type'), |
| 1179 | controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes); |
| 1180 | this.model.set(controlSettings); |
| 1181 | |
| 1182 | // TODO: this.elementSettingsModel is deprecated since 2.8.0. |
| 1183 | var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 1184 | this.listenTo(settings, 'change', this.onAfterChange); |
| 1185 | if (this.model.attributes.responsive) { |
| 1186 | this.onDeviceModeChange = this.onDeviceModeChange.bind(this); |
| 1187 | elementor.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange); |
| 1188 | } |
| 1189 | }, |
| 1190 | onDestroy: function onDestroy() { |
| 1191 | elementor.stopListening(elementor.channels.deviceMode, 'change', this.onDeviceModeChange); |
| 1192 | }, |
| 1193 | onDeviceModeChange: function onDeviceModeChange() { |
| 1194 | this.toggleControlVisibility(); |
| 1195 | }, |
| 1196 | onAfterChange: function onAfterChange() { |
| 1197 | this.toggleControlVisibility(); |
| 1198 | }, |
| 1199 | toggleControlVisibility: function toggleControlVisibility() { |
| 1200 | // TODO: this.elementSettingsModel is deprecated since 2.8.0. |
| 1201 | var settings = this.container ? this.container.settings : this.elementSettingsModel; |
| 1202 | var isVisible = elementor.helpers.isActiveControl(this.model, settings.attributes, settings.controls); |
| 1203 | this.$el.toggleClass('elementor-hidden-control', !isVisible); |
| 1204 | elementor.getPanelView().updateScrollbar(); |
| 1205 | }, |
| 1206 | onRender: function onRender() { |
| 1207 | var layoutType = this.model.get('label_block') ? 'block' : 'inline', |
| 1208 | showLabel = this.model.get('show_label'), |
| 1209 | elClasses = 'elementor-label-' + layoutType; |
| 1210 | elClasses += ' elementor-control-separator-' + this.model.get('separator'); |
| 1211 | if (!showLabel) { |
| 1212 | elClasses += ' elementor-control-hidden-label'; |
| 1213 | } |
| 1214 | this.$el.addClass(elClasses); |
| 1215 | this.toggleControlVisibility(); |
| 1216 | }, |
| 1217 | reRoute: function reRoute(controlActive) { |
| 1218 | $e.route($e.routes.getCurrent('panel'), this.getControlInRouteArgs(controlActive ? this.getControlPath() : ''), { |
| 1219 | history: false |
| 1220 | }); |
| 1221 | }, |
| 1222 | getControlInRouteArgs: function getControlInRouteArgs(path) { |
| 1223 | return _objectSpread(_objectSpread({}, $e.routes.getCurrentArgs('panel')), {}, { |
| 1224 | activeControl: path |
| 1225 | }); |
| 1226 | }, |
| 1227 | getControlPath: function getControlPath() { |
| 1228 | var controlPath = this.model.get('name'), |
| 1229 | parent = this._parent; |
| 1230 | while (!parent.$el.hasClass('elementor-controls-stack')) { |
| 1231 | var parentName = parent.model.get('name') || parent.model.get('_id'); |
| 1232 | controlPath = parentName + '/' + controlPath; |
| 1233 | parent = parent._parent; |
| 1234 | } |
| 1235 | return controlPath; |
| 1236 | } |
| 1237 | }); |
| 1238 | module.exports = ControlBaseView; |
| 1239 | |
| 1240 | /***/ }), |
| 1241 | |
| 1242 | /***/ "../assets/dev/js/editor/controls/switcher.js": |
| 1243 | /*!****************************************************!*\ |
| 1244 | !*** ../assets/dev/js/editor/controls/switcher.js ***! |
| 1245 | \****************************************************/ |
| 1246 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1247 | |
| 1248 | "use strict"; |
| 1249 | |
| 1250 | |
| 1251 | var ControlBaseDataView = __webpack_require__(/*! elementor-controls/base-data */ "../assets/dev/js/editor/controls/base-data.js"); |
| 1252 | module.exports = ControlBaseDataView.extend({ |
| 1253 | setInputValue: function setInputValue(input, value) { |
| 1254 | this.$(input).prop('checked', this.model.get('return_value') === value); |
| 1255 | } |
| 1256 | }, { |
| 1257 | onPasteStyle: function onPasteStyle(control, clipboardValue) { |
| 1258 | return !clipboardValue || clipboardValue === control.return_value; |
| 1259 | } |
| 1260 | }); |
| 1261 | |
| 1262 | /***/ }), |
| 1263 | |
| 1264 | /***/ "../modules/styleguide/assets/js/commands/enable.js": |
| 1265 | /*!**********************************************************!*\ |
| 1266 | !*** ../modules/styleguide/assets/js/commands/enable.js ***! |
| 1267 | \**********************************************************/ |
| 1268 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1269 | |
| 1270 | "use strict"; |
| 1271 | |
| 1272 | |
| 1273 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1274 | Object.defineProperty(exports, "__esModule", ({ |
| 1275 | value: true |
| 1276 | })); |
| 1277 | exports["default"] = exports.Enable = void 0; |
| 1278 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1279 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1280 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1281 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1282 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1283 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1284 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1285 | var Enable = exports.Enable = /*#__PURE__*/function (_$e$modules$CommandBa) { |
| 1286 | function Enable() { |
| 1287 | (0, _classCallCheck2.default)(this, Enable); |
| 1288 | return _callSuper(this, Enable, arguments); |
| 1289 | } |
| 1290 | (0, _inherits2.default)(Enable, _$e$modules$CommandBa); |
| 1291 | return (0, _createClass2.default)(Enable, [{ |
| 1292 | key: "apply", |
| 1293 | value: function apply(args) { |
| 1294 | $e.components.get('preview/styleguide').enableStyleguidePreview(args); |
| 1295 | } |
| 1296 | }]); |
| 1297 | }($e.modules.CommandBase); |
| 1298 | var _default = exports["default"] = Enable; |
| 1299 | |
| 1300 | /***/ }), |
| 1301 | |
| 1302 | /***/ "../modules/styleguide/assets/js/commands/global-colors.js": |
| 1303 | /*!*****************************************************************!*\ |
| 1304 | !*** ../modules/styleguide/assets/js/commands/global-colors.js ***! |
| 1305 | \*****************************************************************/ |
| 1306 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1307 | |
| 1308 | "use strict"; |
| 1309 | |
| 1310 | |
| 1311 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1312 | Object.defineProperty(exports, "__esModule", ({ |
| 1313 | value: true |
| 1314 | })); |
| 1315 | exports["default"] = exports.GlobalColors = void 0; |
| 1316 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1317 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1318 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1319 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1320 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1321 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1322 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1323 | var GlobalColors = exports.GlobalColors = /*#__PURE__*/function (_$e$modules$CommandBa) { |
| 1324 | function GlobalColors() { |
| 1325 | (0, _classCallCheck2.default)(this, GlobalColors); |
| 1326 | return _callSuper(this, GlobalColors, arguments); |
| 1327 | } |
| 1328 | (0, _inherits2.default)(GlobalColors, _$e$modules$CommandBa); |
| 1329 | return (0, _createClass2.default)(GlobalColors, [{ |
| 1330 | key: "apply", |
| 1331 | value: function apply() { |
| 1332 | $e.components.get('preview/styleguide').showStyleguidePreview(); |
| 1333 | } |
| 1334 | }]); |
| 1335 | }($e.modules.CommandBase); |
| 1336 | var _default = exports["default"] = GlobalColors; |
| 1337 | |
| 1338 | /***/ }), |
| 1339 | |
| 1340 | /***/ "../modules/styleguide/assets/js/commands/global-typography.js": |
| 1341 | /*!*********************************************************************!*\ |
| 1342 | !*** ../modules/styleguide/assets/js/commands/global-typography.js ***! |
| 1343 | \*********************************************************************/ |
| 1344 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1345 | |
| 1346 | "use strict"; |
| 1347 | |
| 1348 | |
| 1349 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1350 | Object.defineProperty(exports, "__esModule", ({ |
| 1351 | value: true |
| 1352 | })); |
| 1353 | exports["default"] = exports.GlobalTypography = void 0; |
| 1354 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1355 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1356 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1357 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1358 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1359 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1360 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1361 | var GlobalTypography = exports.GlobalTypography = /*#__PURE__*/function (_$e$modules$CommandBa) { |
| 1362 | function GlobalTypography() { |
| 1363 | (0, _classCallCheck2.default)(this, GlobalTypography); |
| 1364 | return _callSuper(this, GlobalTypography, arguments); |
| 1365 | } |
| 1366 | (0, _inherits2.default)(GlobalTypography, _$e$modules$CommandBa); |
| 1367 | return (0, _createClass2.default)(GlobalTypography, [{ |
| 1368 | key: "apply", |
| 1369 | value: function apply() { |
| 1370 | $e.components.get('preview/styleguide').showStyleguidePreview(); |
| 1371 | } |
| 1372 | }]); |
| 1373 | }($e.modules.CommandBase); |
| 1374 | var _default = exports["default"] = GlobalTypography; |
| 1375 | |
| 1376 | /***/ }), |
| 1377 | |
| 1378 | /***/ "../modules/styleguide/assets/js/commands/hide.js": |
| 1379 | /*!********************************************************!*\ |
| 1380 | !*** ../modules/styleguide/assets/js/commands/hide.js ***! |
| 1381 | \********************************************************/ |
| 1382 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1383 | |
| 1384 | "use strict"; |
| 1385 | |
| 1386 | |
| 1387 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1388 | Object.defineProperty(exports, "__esModule", ({ |
| 1389 | value: true |
| 1390 | })); |
| 1391 | exports["default"] = exports.Hide = void 0; |
| 1392 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1393 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1394 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1395 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1396 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1397 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1398 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1399 | var Hide = exports.Hide = /*#__PURE__*/function (_$e$modules$CommandBa) { |
| 1400 | function Hide() { |
| 1401 | (0, _classCallCheck2.default)(this, Hide); |
| 1402 | return _callSuper(this, Hide, arguments); |
| 1403 | } |
| 1404 | (0, _inherits2.default)(Hide, _$e$modules$CommandBa); |
| 1405 | return (0, _createClass2.default)(Hide, [{ |
| 1406 | key: "apply", |
| 1407 | value: function apply() { |
| 1408 | $e.components.get('preview/styleguide').hideStyleguidePreview(); |
| 1409 | } |
| 1410 | }]); |
| 1411 | }($e.modules.CommandBase); |
| 1412 | var _default = exports["default"] = Hide; |
| 1413 | |
| 1414 | /***/ }), |
| 1415 | |
| 1416 | /***/ "../modules/styleguide/assets/js/commands/index.js": |
| 1417 | /*!*********************************************************!*\ |
| 1418 | !*** ../modules/styleguide/assets/js/commands/index.js ***! |
| 1419 | \*********************************************************/ |
| 1420 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1421 | |
| 1422 | "use strict"; |
| 1423 | |
| 1424 | |
| 1425 | Object.defineProperty(exports, "__esModule", ({ |
| 1426 | value: true |
| 1427 | })); |
| 1428 | Object.defineProperty(exports, "Enable", ({ |
| 1429 | enumerable: true, |
| 1430 | get: function get() { |
| 1431 | return _enable.Enable; |
| 1432 | } |
| 1433 | })); |
| 1434 | Object.defineProperty(exports, "GlobalColors", ({ |
| 1435 | enumerable: true, |
| 1436 | get: function get() { |
| 1437 | return _globalColors.GlobalColors; |
| 1438 | } |
| 1439 | })); |
| 1440 | Object.defineProperty(exports, "GlobalTypography", ({ |
| 1441 | enumerable: true, |
| 1442 | get: function get() { |
| 1443 | return _globalTypography.GlobalTypography; |
| 1444 | } |
| 1445 | })); |
| 1446 | Object.defineProperty(exports, "Hide", ({ |
| 1447 | enumerable: true, |
| 1448 | get: function get() { |
| 1449 | return _hide.Hide; |
| 1450 | } |
| 1451 | })); |
| 1452 | Object.defineProperty(exports, "SwitcherChange", ({ |
| 1453 | enumerable: true, |
| 1454 | get: function get() { |
| 1455 | return _switcherChange.SwitcherChange; |
| 1456 | } |
| 1457 | })); |
| 1458 | var _enable = __webpack_require__(/*! ./enable */ "../modules/styleguide/assets/js/commands/enable.js"); |
| 1459 | var _globalColors = __webpack_require__(/*! ./global-colors */ "../modules/styleguide/assets/js/commands/global-colors.js"); |
| 1460 | var _globalTypography = __webpack_require__(/*! ./global-typography */ "../modules/styleguide/assets/js/commands/global-typography.js"); |
| 1461 | var _hide = __webpack_require__(/*! ./hide */ "../modules/styleguide/assets/js/commands/hide.js"); |
| 1462 | var _switcherChange = __webpack_require__(/*! ./switcher-change */ "../modules/styleguide/assets/js/commands/switcher-change.js"); |
| 1463 | |
| 1464 | /***/ }), |
| 1465 | |
| 1466 | /***/ "../modules/styleguide/assets/js/commands/switcher-change.js": |
| 1467 | /*!*******************************************************************!*\ |
| 1468 | !*** ../modules/styleguide/assets/js/commands/switcher-change.js ***! |
| 1469 | \*******************************************************************/ |
| 1470 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1471 | |
| 1472 | "use strict"; |
| 1473 | |
| 1474 | |
| 1475 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1476 | Object.defineProperty(exports, "__esModule", ({ |
| 1477 | value: true |
| 1478 | })); |
| 1479 | exports["default"] = exports.SwitcherChange = void 0; |
| 1480 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1481 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1482 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1483 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1484 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1485 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1486 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1487 | var SwitcherChange = exports.SwitcherChange = /*#__PURE__*/function (_$e$modules$CommandBa) { |
| 1488 | function SwitcherChange() { |
| 1489 | (0, _classCallCheck2.default)(this, SwitcherChange); |
| 1490 | return _callSuper(this, SwitcherChange, arguments); |
| 1491 | } |
| 1492 | (0, _inherits2.default)(SwitcherChange, _$e$modules$CommandBa); |
| 1493 | return (0, _createClass2.default)(SwitcherChange, [{ |
| 1494 | key: "validateArgs", |
| 1495 | value: function validateArgs() { |
| 1496 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 1497 | this.requireArgumentType('name', 'string', args); |
| 1498 | this.requireArgumentType('value', 'string', args); |
| 1499 | } |
| 1500 | }, { |
| 1501 | key: "apply", |
| 1502 | value: function apply(args) { |
| 1503 | if (args.name.includes('enable_styleguide_preview')) { |
| 1504 | $e.components.get('preview/styleguide').enableStyleguidePreview({ |
| 1505 | value: args.value |
| 1506 | }); |
| 1507 | } |
| 1508 | } |
| 1509 | }]); |
| 1510 | }($e.modules.CommandBase); |
| 1511 | var _default = exports["default"] = SwitcherChange; |
| 1512 | |
| 1513 | /***/ }), |
| 1514 | |
| 1515 | /***/ "../modules/styleguide/assets/js/controls/switcher.js": |
| 1516 | /*!************************************************************!*\ |
| 1517 | !*** ../modules/styleguide/assets/js/controls/switcher.js ***! |
| 1518 | \************************************************************/ |
| 1519 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1520 | |
| 1521 | "use strict"; |
| 1522 | |
| 1523 | |
| 1524 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1525 | Object.defineProperty(exports, "__esModule", ({ |
| 1526 | value: true |
| 1527 | })); |
| 1528 | exports["default"] = void 0; |
| 1529 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1530 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1531 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1532 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1533 | var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); |
| 1534 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1535 | var _switcher = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/editor/controls/switcher */ "../assets/dev/js/editor/controls/switcher.js")); |
| 1536 | var _baseData = _interopRequireDefault(__webpack_require__(/*! elementor-controls/base-data */ "../assets/dev/js/editor/controls/base-data.js")); |
| 1537 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1538 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1539 | function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } |
| 1540 | var _default = exports["default"] = /*#__PURE__*/function (_Switcher) { |
| 1541 | function _default() { |
| 1542 | (0, _classCallCheck2.default)(this, _default); |
| 1543 | return _callSuper(this, _default, arguments); |
| 1544 | } |
| 1545 | (0, _inherits2.default)(_default, _Switcher); |
| 1546 | return (0, _createClass2.default)(_default, [{ |
| 1547 | key: "initialize", |
| 1548 | value: function initialize() { |
| 1549 | _baseData.default.prototype.initialize.apply(this, arguments); |
| 1550 | this.$el.addClass('elementor-control-type-switcher'); |
| 1551 | } |
| 1552 | }, { |
| 1553 | key: "onBeforeRender", |
| 1554 | value: function onBeforeRender() { |
| 1555 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 1556 | args[_key] = arguments[_key]; |
| 1557 | } |
| 1558 | _superPropGet(_default, "onBeforeRender", this, 3)(args); |
| 1559 | var actualValue = elementor.getPreferences('enable_styleguide_preview'); |
| 1560 | if (actualValue !== this.getCurrentValue()) { |
| 1561 | this.setValue(actualValue); |
| 1562 | } |
| 1563 | } |
| 1564 | }, { |
| 1565 | key: "onBaseInputChange", |
| 1566 | value: function onBaseInputChange(event) { |
| 1567 | _baseData.default.prototype.onBaseInputChange.apply(this, arguments); |
| 1568 | var input = event.currentTarget, |
| 1569 | value = this.getInputValue(input); |
| 1570 | if (this.model.get('on_change_command')) { |
| 1571 | this.runCommand(value); |
| 1572 | } |
| 1573 | this.model.set('return_value', null); |
| 1574 | } |
| 1575 | }, { |
| 1576 | key: "runCommand", |
| 1577 | value: function runCommand(value) { |
| 1578 | $e.run('preview/styleguide/switcher-change', { |
| 1579 | name: this.model.get('name'), |
| 1580 | value: value |
| 1581 | }); |
| 1582 | } |
| 1583 | }]); |
| 1584 | }(_switcher.default); |
| 1585 | |
| 1586 | /***/ }), |
| 1587 | |
| 1588 | /***/ "../modules/styleguide/assets/js/e-component.js": |
| 1589 | /*!******************************************************!*\ |
| 1590 | !*** ../modules/styleguide/assets/js/e-component.js ***! |
| 1591 | \******************************************************/ |
| 1592 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1593 | |
| 1594 | "use strict"; |
| 1595 | |
| 1596 | |
| 1597 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1598 | var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); |
| 1599 | Object.defineProperty(exports, "__esModule", ({ |
| 1600 | value: true |
| 1601 | })); |
| 1602 | exports["default"] = void 0; |
| 1603 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1604 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1605 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1606 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1607 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1608 | var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands */ "../modules/styleguide/assets/js/commands/index.js")); |
| 1609 | var _switcher = _interopRequireDefault(__webpack_require__(/*! ./controls/switcher */ "../modules/styleguide/assets/js/controls/switcher.js")); |
| 1610 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } |
| 1611 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1612 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1613 | var _default = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) { |
| 1614 | function _default(args) { |
| 1615 | var _this; |
| 1616 | (0, _classCallCheck2.default)(this, _default); |
| 1617 | _this = _callSuper(this, _default, [args]); |
| 1618 | elementor.addControlView('global-style-switcher', _switcher.default); |
| 1619 | _this.registerStyleguideDialogType(); |
| 1620 | elementor.once('preview:loaded', function () { |
| 1621 | _this.initModal(); |
| 1622 | }); |
| 1623 | return _this; |
| 1624 | } |
| 1625 | (0, _inherits2.default)(_default, _$e$modules$Component); |
| 1626 | return (0, _createClass2.default)(_default, [{ |
| 1627 | key: "getNamespace", |
| 1628 | value: function getNamespace() { |
| 1629 | return 'preview/styleguide'; |
| 1630 | } |
| 1631 | }, { |
| 1632 | key: "defaultCommands", |
| 1633 | value: function defaultCommands() { |
| 1634 | return this.importCommands(commands); |
| 1635 | } |
| 1636 | }, { |
| 1637 | key: "registerStyleguideDialogType", |
| 1638 | value: function registerStyleguideDialogType() { |
| 1639 | DialogsManager.addWidgetType('styleguide', DialogsManager.getWidgetType('lightbox').extend('alert', { |
| 1640 | buildWidget: function buildWidget() { |
| 1641 | DialogsManager.getWidgetType('lightbox').prototype.buildWidget.apply(this, arguments); |
| 1642 | var $widgetContent = this.addElement('widgetContent'), |
| 1643 | elements = this.getElements(); |
| 1644 | $widgetContent.append(elements.message); |
| 1645 | elements.widget.html($widgetContent); |
| 1646 | } |
| 1647 | })); |
| 1648 | } |
| 1649 | }, { |
| 1650 | key: "initModal", |
| 1651 | value: function initModal() { |
| 1652 | var modal; |
| 1653 | this.getModal = function () { |
| 1654 | if (modal) { |
| 1655 | return modal; |
| 1656 | } |
| 1657 | modal = elementorCommon.dialogsManager.createWidget('styleguide', { |
| 1658 | id: 'e-styleguide-preview-dialog', |
| 1659 | message: "<div class=\"e-styleguide-preview-root\"></div>", |
| 1660 | position: { |
| 1661 | my: 'center center', |
| 1662 | at: 'center center' |
| 1663 | }, |
| 1664 | hide: { |
| 1665 | onOutsideClick: false, |
| 1666 | onEscKeyPress: false, |
| 1667 | onClick: false, |
| 1668 | onBackgroundClick: false |
| 1669 | }, |
| 1670 | container: elementor.$previewContents.find('body') |
| 1671 | }); |
| 1672 | return modal; |
| 1673 | }; |
| 1674 | } |
| 1675 | |
| 1676 | /** |
| 1677 | * Show the Styleguide Preview. |
| 1678 | * If skipPreferences is true, it will not check the User Preferences before showing the dialog. |
| 1679 | * |
| 1680 | * @param {boolean} skipPreferencesCheck |
| 1681 | */ |
| 1682 | }, { |
| 1683 | key: "showStyleguidePreview", |
| 1684 | value: function showStyleguidePreview() { |
| 1685 | var skipPreferencesCheck = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
| 1686 | if (this.getModal().isVisible() || !skipPreferencesCheck && !elementor.getPreferences('enable_styleguide_preview')) { |
| 1687 | return; |
| 1688 | } |
| 1689 | this.getPreviewFrame().postMessage({ |
| 1690 | name: 'elementor/styleguide/preview/show' |
| 1691 | }, '*'); |
| 1692 | this.getModal().show(); |
| 1693 | } |
| 1694 | |
| 1695 | /** |
| 1696 | * Hide the Styleguide Preview. |
| 1697 | */ |
| 1698 | }, { |
| 1699 | key: "hideStyleguidePreview", |
| 1700 | value: function hideStyleguidePreview() { |
| 1701 | this.getPreviewFrame().postMessage({ |
| 1702 | name: 'elementor/styleguide/preview/hide' |
| 1703 | }, '*'); |
| 1704 | this.getModal().hide(); |
| 1705 | } |
| 1706 | |
| 1707 | /** |
| 1708 | * Update the User Preferences to show the global settings. |
| 1709 | * Triggered on switcher change at Global Colors / Global Typography panels. |
| 1710 | * |
| 1711 | * @param {Array} options |
| 1712 | */ |
| 1713 | }, { |
| 1714 | key: "enableStyleguidePreview", |
| 1715 | value: function enableStyleguidePreview(options) { |
| 1716 | if (options.value) { |
| 1717 | this.showStyleguidePreview(true); |
| 1718 | } else { |
| 1719 | this.hideStyleguidePreview(); |
| 1720 | } |
| 1721 | $e.run('document/elements/settings', { |
| 1722 | container: elementor.settings.editorPreferences.getEditedView().getContainer(), |
| 1723 | settings: { |
| 1724 | enable_styleguide_preview: options.value |
| 1725 | }, |
| 1726 | options: { |
| 1727 | external: true |
| 1728 | } |
| 1729 | }); |
| 1730 | } |
| 1731 | |
| 1732 | /** |
| 1733 | * Check if the current script context is the Editor. |
| 1734 | * |
| 1735 | * @return {boolean} |
| 1736 | */ |
| 1737 | }, { |
| 1738 | key: "isInEditor", |
| 1739 | value: function isInEditor() { |
| 1740 | return !!window.elementor; |
| 1741 | } |
| 1742 | |
| 1743 | /** |
| 1744 | * Get the Preview Frame. |
| 1745 | * |
| 1746 | * @return {Window} |
| 1747 | */ |
| 1748 | }, { |
| 1749 | key: "getPreviewFrame", |
| 1750 | value: function getPreviewFrame() { |
| 1751 | return this.isInEditor() ? elementor.$preview[0].contentWindow : window; |
| 1752 | } |
| 1753 | }]); |
| 1754 | }($e.modules.ComponentBase); |
| 1755 | |
| 1756 | /***/ }), |
| 1757 | |
| 1758 | /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": |
| 1759 | /*!******************************************************************!*\ |
| 1760 | !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! |
| 1761 | \******************************************************************/ |
| 1762 | /***/ ((module) => { |
| 1763 | |
| 1764 | function _arrayLikeToArray(r, a) { |
| 1765 | (null == a || a > r.length) && (a = r.length); |
| 1766 | for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 1767 | return n; |
| 1768 | } |
| 1769 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1770 | |
| 1771 | /***/ }), |
| 1772 | |
| 1773 | /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": |
| 1774 | /*!****************************************************************!*\ |
| 1775 | !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! |
| 1776 | \****************************************************************/ |
| 1777 | /***/ ((module) => { |
| 1778 | |
| 1779 | function _arrayWithHoles(r) { |
| 1780 | if (Array.isArray(r)) return r; |
| 1781 | } |
| 1782 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1783 | |
| 1784 | /***/ }), |
| 1785 | |
| 1786 | /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": |
| 1787 | /*!***********************************************************************!*\ |
| 1788 | !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! |
| 1789 | \***********************************************************************/ |
| 1790 | /***/ ((module) => { |
| 1791 | |
| 1792 | function _assertThisInitialized(e) { |
| 1793 | if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 1794 | return e; |
| 1795 | } |
| 1796 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1797 | |
| 1798 | /***/ }), |
| 1799 | |
| 1800 | /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": |
| 1801 | /*!****************************************************************!*\ |
| 1802 | !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! |
| 1803 | \****************************************************************/ |
| 1804 | /***/ ((module) => { |
| 1805 | |
| 1806 | function _classCallCheck(a, n) { |
| 1807 | if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); |
| 1808 | } |
| 1809 | module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1810 | |
| 1811 | /***/ }), |
| 1812 | |
| 1813 | /***/ "../node_modules/@babel/runtime/helpers/createClass.js": |
| 1814 | /*!*************************************************************!*\ |
| 1815 | !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! |
| 1816 | \*************************************************************/ |
| 1817 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1818 | |
| 1819 | var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); |
| 1820 | function _defineProperties(e, r) { |
| 1821 | for (var t = 0; t < r.length; t++) { |
| 1822 | var o = r[t]; |
| 1823 | o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); |
| 1824 | } |
| 1825 | } |
| 1826 | function _createClass(e, r, t) { |
| 1827 | return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { |
| 1828 | writable: !1 |
| 1829 | }), e; |
| 1830 | } |
| 1831 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1832 | |
| 1833 | /***/ }), |
| 1834 | |
| 1835 | /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": |
| 1836 | /*!****************************************************************!*\ |
| 1837 | !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! |
| 1838 | \****************************************************************/ |
| 1839 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1840 | |
| 1841 | var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); |
| 1842 | function _defineProperty(e, r, t) { |
| 1843 | return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 1844 | value: t, |
| 1845 | enumerable: !0, |
| 1846 | configurable: !0, |
| 1847 | writable: !0 |
| 1848 | }) : e[r] = t, e; |
| 1849 | } |
| 1850 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1851 | |
| 1852 | /***/ }), |
| 1853 | |
| 1854 | /***/ "../node_modules/@babel/runtime/helpers/get.js": |
| 1855 | /*!*****************************************************!*\ |
| 1856 | !*** ../node_modules/@babel/runtime/helpers/get.js ***! |
| 1857 | \*****************************************************/ |
| 1858 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1859 | |
| 1860 | var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); |
| 1861 | function _get() { |
| 1862 | return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { |
| 1863 | var p = superPropBase(e, t); |
| 1864 | if (p) { |
| 1865 | var n = Object.getOwnPropertyDescriptor(p, t); |
| 1866 | return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; |
| 1867 | } |
| 1868 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); |
| 1869 | } |
| 1870 | module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1871 | |
| 1872 | /***/ }), |
| 1873 | |
| 1874 | /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": |
| 1875 | /*!****************************************************************!*\ |
| 1876 | !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! |
| 1877 | \****************************************************************/ |
| 1878 | /***/ ((module) => { |
| 1879 | |
| 1880 | function _getPrototypeOf(t) { |
| 1881 | return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { |
| 1882 | return t.__proto__ || Object.getPrototypeOf(t); |
| 1883 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); |
| 1884 | } |
| 1885 | module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1886 | |
| 1887 | /***/ }), |
| 1888 | |
| 1889 | /***/ "../node_modules/@babel/runtime/helpers/inherits.js": |
| 1890 | /*!**********************************************************!*\ |
| 1891 | !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! |
| 1892 | \**********************************************************/ |
| 1893 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1894 | |
| 1895 | var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); |
| 1896 | function _inherits(t, e) { |
| 1897 | if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 1898 | t.prototype = Object.create(e && e.prototype, { |
| 1899 | constructor: { |
| 1900 | value: t, |
| 1901 | writable: !0, |
| 1902 | configurable: !0 |
| 1903 | } |
| 1904 | }), Object.defineProperty(t, "prototype", { |
| 1905 | writable: !1 |
| 1906 | }), e && setPrototypeOf(t, e); |
| 1907 | } |
| 1908 | module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1909 | |
| 1910 | /***/ }), |
| 1911 | |
| 1912 | /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": |
| 1913 | /*!***********************************************************************!*\ |
| 1914 | !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! |
| 1915 | \***********************************************************************/ |
| 1916 | /***/ ((module) => { |
| 1917 | |
| 1918 | function _interopRequireDefault(e) { |
| 1919 | return e && e.__esModule ? e : { |
| 1920 | "default": e |
| 1921 | }; |
| 1922 | } |
| 1923 | module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1924 | |
| 1925 | /***/ }), |
| 1926 | |
| 1927 | /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": |
| 1928 | /*!**********************************************************************!*\ |
| 1929 | !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! |
| 1930 | \**********************************************************************/ |
| 1931 | /***/ ((module) => { |
| 1932 | |
| 1933 | function _iterableToArrayLimit(r, l) { |
| 1934 | var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 1935 | if (null != t) { |
| 1936 | var e, |
| 1937 | n, |
| 1938 | i, |
| 1939 | u, |
| 1940 | a = [], |
| 1941 | f = !0, |
| 1942 | o = !1; |
| 1943 | try { |
| 1944 | if (i = (t = t.call(r)).next, 0 === l) { |
| 1945 | if (Object(t) !== t) return; |
| 1946 | f = !1; |
| 1947 | } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); |
| 1948 | } catch (r) { |
| 1949 | o = !0, n = r; |
| 1950 | } finally { |
| 1951 | try { |
| 1952 | if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; |
| 1953 | } finally { |
| 1954 | if (o) throw n; |
| 1955 | } |
| 1956 | } |
| 1957 | return a; |
| 1958 | } |
| 1959 | } |
| 1960 | module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1961 | |
| 1962 | /***/ }), |
| 1963 | |
| 1964 | /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": |
| 1965 | /*!*****************************************************************!*\ |
| 1966 | !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! |
| 1967 | \*****************************************************************/ |
| 1968 | /***/ ((module) => { |
| 1969 | |
| 1970 | function _nonIterableRest() { |
| 1971 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 1972 | } |
| 1973 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1974 | |
| 1975 | /***/ }), |
| 1976 | |
| 1977 | /***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": |
| 1978 | /*!***************************************************************************!*\ |
| 1979 | !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! |
| 1980 | \***************************************************************************/ |
| 1981 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 1982 | |
| 1983 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 1984 | var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); |
| 1985 | function _possibleConstructorReturn(t, e) { |
| 1986 | if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; |
| 1987 | if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 1988 | return assertThisInitialized(t); |
| 1989 | } |
| 1990 | module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1991 | |
| 1992 | /***/ }), |
| 1993 | |
| 1994 | /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": |
| 1995 | /*!****************************************************************!*\ |
| 1996 | !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! |
| 1997 | \****************************************************************/ |
| 1998 | /***/ ((module) => { |
| 1999 | |
| 2000 | function _setPrototypeOf(t, e) { |
| 2001 | return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { |
| 2002 | return t.__proto__ = e, t; |
| 2003 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); |
| 2004 | } |
| 2005 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2006 | |
| 2007 | /***/ }), |
| 2008 | |
| 2009 | /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": |
| 2010 | /*!***************************************************************!*\ |
| 2011 | !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! |
| 2012 | \***************************************************************/ |
| 2013 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2014 | |
| 2015 | var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); |
| 2016 | var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); |
| 2017 | var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); |
| 2018 | var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); |
| 2019 | function _slicedToArray(r, e) { |
| 2020 | return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); |
| 2021 | } |
| 2022 | module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2023 | |
| 2024 | /***/ }), |
| 2025 | |
| 2026 | /***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": |
| 2027 | /*!***************************************************************!*\ |
| 2028 | !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! |
| 2029 | \***************************************************************/ |
| 2030 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2031 | |
| 2032 | var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); |
| 2033 | function _superPropBase(t, o) { |
| 2034 | for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); |
| 2035 | return t; |
| 2036 | } |
| 2037 | module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2038 | |
| 2039 | /***/ }), |
| 2040 | |
| 2041 | /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": |
| 2042 | /*!*************************************************************!*\ |
| 2043 | !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! |
| 2044 | \*************************************************************/ |
| 2045 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2046 | |
| 2047 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 2048 | function toPrimitive(t, r) { |
| 2049 | if ("object" != _typeof(t) || !t) return t; |
| 2050 | var e = t[Symbol.toPrimitive]; |
| 2051 | if (void 0 !== e) { |
| 2052 | var i = e.call(t, r || "default"); |
| 2053 | if ("object" != _typeof(i)) return i; |
| 2054 | throw new TypeError("@@toPrimitive must return a primitive value."); |
| 2055 | } |
| 2056 | return ("string" === r ? String : Number)(t); |
| 2057 | } |
| 2058 | module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2059 | |
| 2060 | /***/ }), |
| 2061 | |
| 2062 | /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": |
| 2063 | /*!***************************************************************!*\ |
| 2064 | !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! |
| 2065 | \***************************************************************/ |
| 2066 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2067 | |
| 2068 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 2069 | var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); |
| 2070 | function toPropertyKey(t) { |
| 2071 | var i = toPrimitive(t, "string"); |
| 2072 | return "symbol" == _typeof(i) ? i : i + ""; |
| 2073 | } |
| 2074 | module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2075 | |
| 2076 | /***/ }), |
| 2077 | |
| 2078 | /***/ "../node_modules/@babel/runtime/helpers/typeof.js": |
| 2079 | /*!********************************************************!*\ |
| 2080 | !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! |
| 2081 | \********************************************************/ |
| 2082 | /***/ ((module) => { |
| 2083 | |
| 2084 | function _typeof(o) { |
| 2085 | "@babel/helpers - typeof"; |
| 2086 | |
| 2087 | return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { |
| 2088 | return typeof o; |
| 2089 | } : function (o) { |
| 2090 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 2091 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); |
| 2092 | } |
| 2093 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2094 | |
| 2095 | /***/ }), |
| 2096 | |
| 2097 | /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": |
| 2098 | /*!****************************************************************************!*\ |
| 2099 | !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! |
| 2100 | \****************************************************************************/ |
| 2101 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2102 | |
| 2103 | var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); |
| 2104 | function _unsupportedIterableToArray(r, a) { |
| 2105 | if (r) { |
| 2106 | if ("string" == typeof r) return arrayLikeToArray(r, a); |
| 2107 | var t = {}.toString.call(r).slice(8, -1); |
| 2108 | 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; |
| 2109 | } |
| 2110 | } |
| 2111 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2112 | |
| 2113 | /***/ }), |
| 2114 | |
| 2115 | /***/ "@wordpress/i18n": |
| 2116 | /*!**************************!*\ |
| 2117 | !*** external "wp.i18n" ***! |
| 2118 | \**************************/ |
| 2119 | /***/ ((module) => { |
| 2120 | |
| 2121 | "use strict"; |
| 2122 | module.exports = wp.i18n; |
| 2123 | |
| 2124 | /***/ }) |
| 2125 | |
| 2126 | /******/ }); |
| 2127 | /************************************************************************/ |
| 2128 | /******/ // The module cache |
| 2129 | /******/ var __webpack_module_cache__ = {}; |
| 2130 | /******/ |
| 2131 | /******/ // The require function |
| 2132 | /******/ function __webpack_require__(moduleId) { |
| 2133 | /******/ // Check if module is in cache |
| 2134 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 2135 | /******/ if (cachedModule !== undefined) { |
| 2136 | /******/ return cachedModule.exports; |
| 2137 | /******/ } |
| 2138 | /******/ // Create a new module (and put it into the cache) |
| 2139 | /******/ var module = __webpack_module_cache__[moduleId] = { |
| 2140 | /******/ // no module.id needed |
| 2141 | /******/ // no module.loaded needed |
| 2142 | /******/ exports: {} |
| 2143 | /******/ }; |
| 2144 | /******/ |
| 2145 | /******/ // Execute the module function |
| 2146 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 2147 | /******/ |
| 2148 | /******/ // Return the exports of the module |
| 2149 | /******/ return module.exports; |
| 2150 | /******/ } |
| 2151 | /******/ |
| 2152 | /************************************************************************/ |
| 2153 | var __webpack_exports__ = {}; |
| 2154 | // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |
| 2155 | (() => { |
| 2156 | "use strict"; |
| 2157 | /*!*****************************************************!*\ |
| 2158 | !*** ../modules/styleguide/assets/js/styleguide.js ***! |
| 2159 | \*****************************************************/ |
| 2160 | |
| 2161 | |
| 2162 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2163 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 2164 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 2165 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 2166 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 2167 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 2168 | var _eComponent = _interopRequireDefault(__webpack_require__(/*! ./e-component */ "../modules/styleguide/assets/js/e-component.js")); |
| 2169 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 2170 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 2171 | var Styleguide = /*#__PURE__*/function (_elementorModules$edi) { |
| 2172 | function Styleguide() { |
| 2173 | (0, _classCallCheck2.default)(this, Styleguide); |
| 2174 | return _callSuper(this, Styleguide, arguments); |
| 2175 | } |
| 2176 | (0, _inherits2.default)(Styleguide, _elementorModules$edi); |
| 2177 | return (0, _createClass2.default)(Styleguide, [{ |
| 2178 | key: "onInit", |
| 2179 | value: function onInit() { |
| 2180 | $e.components.register(new _eComponent.default()); |
| 2181 | this.addHooks(); |
| 2182 | } |
| 2183 | }, { |
| 2184 | key: "getGlobalRoutes", |
| 2185 | value: function getGlobalRoutes() { |
| 2186 | return { |
| 2187 | 'global-colors': 'panel/global/global-colors', |
| 2188 | 'global-typography': 'panel/global/global-typography' |
| 2189 | }; |
| 2190 | } |
| 2191 | }, { |
| 2192 | key: "addHooks", |
| 2193 | value: function addHooks() { |
| 2194 | elementor.hooks.addAction('panel/global/tab/before-show', this.show.bind(this)); |
| 2195 | elementor.hooks.addAction('panel/global/tab/before-destroy', this.hide.bind(this)); |
| 2196 | } |
| 2197 | |
| 2198 | /** |
| 2199 | * Function show() triggered before showing a new tab at the Globals panel. |
| 2200 | * |
| 2201 | * @param {Object} args |
| 2202 | */ |
| 2203 | }, { |
| 2204 | key: "show", |
| 2205 | value: function show(args) { |
| 2206 | if (!args.id || !(args.id in this.getGlobalRoutes())) { |
| 2207 | return; |
| 2208 | } |
| 2209 | $e.run("preview/styleguide/".concat(args.id)); |
| 2210 | } |
| 2211 | |
| 2212 | /** |
| 2213 | * Function hide() triggered before hiding a tab at the Globals panel. |
| 2214 | * |
| 2215 | * @param {Object} args |
| 2216 | */ |
| 2217 | }, { |
| 2218 | key: "hide", |
| 2219 | value: function hide(args) { |
| 2220 | if (!args.id || !(args.id in this.getGlobalRoutes())) { |
| 2221 | return; |
| 2222 | } |
| 2223 | var isGlobalsRoute = Object.values(this.getGlobalRoutes()).some(function (route) { |
| 2224 | return $e.routes.current.panel === route; |
| 2225 | }); |
| 2226 | if (isGlobalsRoute) { |
| 2227 | return; |
| 2228 | } |
| 2229 | $e.run('preview/styleguide/hide'); |
| 2230 | } |
| 2231 | }]); |
| 2232 | }(elementorModules.editor.utils.Module); |
| 2233 | new Styleguide(); |
| 2234 | })(); |
| 2235 | |
| 2236 | /******/ })() |
| 2237 | ; |
| 2238 | //# sourceMappingURL=styleguide.js.map |