PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.4
Elementor Website Builder – more than just a page builder v4.1.4
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/design-system-sync.js +68 -60 4.3.0 → 4.1.4 View file →
@@ -1,65 +1,73 @@
1 -(function() {
1 +/******/ (() => { // webpackBootstrap
2 +/******/ "use strict";
3 +/*!*****************************************************************************!*\
4 + !*** ../modules/design-system-sync/assets/js/design-system-sync-handler.js ***!
5 + \*****************************************************************************/
2 6
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
9 7
10 -//#endregion
8 +(function () {
9 + 'use strict';
11 10
12 -//#region modules/design-system-sync/assets/js/design-system-sync-handler.js
13 - (function() {
14 - "use strict";
15 - var SYNC_ENDPOINT = wpApiSettings.root + "elementor/v1/design-system-sync/stylesheet";
16 - var SYNC_STYLESHEET_ID = "elementor-design-system-sync-css";
17 - var DEBOUNCE_MS = 500;
18 - var syncTimeout;
19 - function syncDesignSystem() {
20 - fetch(SYNC_ENDPOINT, {
21 - method: "POST",
22 - headers: { "X-WP-Nonce": wpApiSettings.nonce }
23 - }).then(function(response) {
24 - if (!response.ok) return;
25 - if (204 === response.status) return;
26 - return response.json();
27 - }).then(function(data) {
28 - if (!data) return;
29 - refreshGlobals();
30 - reloadCanvasDesignSyncStyles(data);
31 - });
32 - }
33 - function refreshGlobals() {
34 - var globals = $e.components.get("globals");
35 - globals === null || globals === void 0 || globals.refreshGlobalData();
36 - globals === null || globals === void 0 || globals.populateGlobalData();
37 - }
38 - function reloadCanvasDesignSyncStyles(_ref) {
39 - var url = _ref.url;
40 - var previewFrame = document.getElementById("elementor-preview-iframe");
41 - if (!(previewFrame !== null && previewFrame !== void 0 && previewFrame.contentDocument)) return;
42 - var link = previewFrame.contentDocument.getElementById(SYNC_STYLESHEET_ID);
43 - if (!link) {
44 - link = previewFrame.contentDocument.createElement("link");
45 - link.id = SYNC_STYLESHEET_ID;
46 - link.rel = "stylesheet";
47 - previewFrame.contentDocument.head.appendChild(link);
48 - }
49 - link.href = url;
50 - }
51 - function onClassesUpdated(event) {
52 - if (event.detail.context !== "frontend") return;
53 - clearTimeout(syncTimeout);
54 - syncTimeout = setTimeout(syncDesignSystem, DEBOUNCE_MS);
55 - }
56 - window.addEventListener("classes:updated", onClassesUpdated);
57 - window.addEventListener("variables:updated", function() {
58 - clearTimeout(syncTimeout);
59 - syncTimeout = setTimeout(syncDesignSystem, DEBOUNCE_MS);
60 - });
61 - })();
62 -
63 -//#endregion
11 + var SYNC_ENDPOINT = wpApiSettings.root + 'elementor/v1/design-system-sync/stylesheet';
12 + var SYNC_STYLESHEET_ID = 'elementor-design-system-sync-css';
13 + var DEBOUNCE_MS = 500;
14 + var syncTimeout;
15 + function syncDesignSystem() {
16 + fetch(SYNC_ENDPOINT, {
17 + method: 'POST',
18 + headers: {
19 + 'X-WP-Nonce': wpApiSettings.nonce
20 + }
21 + }).then(function (response) {
22 + if (!response.ok) {
23 + return;
24 + }
25 + if (204 === response.status) {
26 + return;
27 + }
28 + return response.json();
29 + }).then(function (data) {
30 + if (!data) {
31 + return;
32 + }
33 + refreshGlobals();
34 + reloadCanvasDesignSyncStyles(data);
35 + });
36 + }
37 + function refreshGlobals() {
38 + var globals = $e.components.get('globals');
39 + globals === null || globals === void 0 || globals.refreshGlobalData();
40 + globals === null || globals === void 0 || globals.populateGlobalData();
41 + }
42 + function reloadCanvasDesignSyncStyles(_ref) {
43 + var url = _ref.url;
44 + var previewFrame = document.getElementById('elementor-preview-iframe');
45 + if (!(previewFrame !== null && previewFrame !== void 0 && previewFrame.contentDocument)) {
46 + return;
47 + }
48 + var link = previewFrame.contentDocument.getElementById(SYNC_STYLESHEET_ID);
49 + if (!link) {
50 + link = previewFrame.contentDocument.createElement('link');
51 + link.id = SYNC_STYLESHEET_ID;
52 + link.rel = 'stylesheet';
53 + previewFrame.contentDocument.head.appendChild(link);
54 + }
55 + link.href = url;
56 + }
57 + function onClassesUpdated(event) {
58 + var context = event.detail.context;
59 + if (context !== 'frontend') {
60 + return;
61 + }
62 + clearTimeout(syncTimeout);
63 + syncTimeout = setTimeout(syncDesignSystem, DEBOUNCE_MS);
64 + }
65 + window.addEventListener('classes:updated', onClassesUpdated);
66 + window.addEventListener('variables:updated', function () {
67 + clearTimeout(syncTimeout);
68 + syncTimeout = setTimeout(syncDesignSystem, DEBOUNCE_MS);
69 + });
64 70 })();
71 +/******/ })()
72 +;
65 73 //# sourceMappingURL=design-system-sync.js.map