| 1 |
/******/ (function() { // webpackBootstrap |
| 2 |
/******/ "use strict"; |
| 3 |
/******/ var __webpack_modules__ = ({ |
| 4 |
|
| 5 |
/***/ "react": |
| 6 |
/*!************************!*\ |
| 7 |
!*** external "React" ***! |
| 8 |
\************************/ |
| 9 |
/***/ (function(module) { |
| 10 |
|
| 11 |
module.exports = window["React"]; |
| 12 |
|
| 13 |
/***/ }), |
| 14 |
|
| 15 |
/***/ "react-dom": |
| 16 |
/*!***************************!*\ |
| 17 |
!*** external "ReactDOM" ***! |
| 18 |
\***************************/ |
| 19 |
/***/ (function(module) { |
| 20 |
|
| 21 |
module.exports = window["ReactDOM"]; |
| 22 |
|
| 23 |
/***/ }), |
| 24 |
|
| 25 |
/***/ "@elementor/editor-documents": |
| 26 |
/*!********************************************************************!*\ |
| 27 |
!*** external ["__UNSTABLE__elementorPackages","editorDocuments"] ***! |
| 28 |
\********************************************************************/ |
| 29 |
/***/ (function(module) { |
| 30 |
|
| 31 |
module.exports = window["__UNSTABLE__elementorPackages"]["editorDocuments"]; |
| 32 |
|
| 33 |
/***/ }), |
| 34 |
|
| 35 |
/***/ "@elementor/editor-v1-adapters": |
| 36 |
/*!*********************************************************************!*\ |
| 37 |
!*** external ["__UNSTABLE__elementorPackages","editorV1Adapters"] ***! |
| 38 |
\*********************************************************************/ |
| 39 |
/***/ (function(module) { |
| 40 |
|
| 41 |
module.exports = window["__UNSTABLE__elementorPackages"]["editorV1Adapters"]; |
| 42 |
|
| 43 |
/***/ }), |
| 44 |
|
| 45 |
/***/ "@elementor/locations": |
| 46 |
/*!**************************************************************!*\ |
| 47 |
!*** external ["__UNSTABLE__elementorPackages","locations"] ***! |
| 48 |
\**************************************************************/ |
| 49 |
/***/ (function(module) { |
| 50 |
|
| 51 |
module.exports = window["__UNSTABLE__elementorPackages"]["locations"]; |
| 52 |
|
| 53 |
/***/ }), |
| 54 |
|
| 55 |
/***/ "@elementor/store": |
| 56 |
/*!**********************************************************!*\ |
| 57 |
!*** external ["__UNSTABLE__elementorPackages","store"] ***! |
| 58 |
\**********************************************************/ |
| 59 |
/***/ (function(module) { |
| 60 |
|
| 61 |
module.exports = window["__UNSTABLE__elementorPackages"]["store"]; |
| 62 |
|
| 63 |
/***/ }), |
| 64 |
|
| 65 |
/***/ "@elementor/ui": |
| 66 |
/*!*******************************************************!*\ |
| 67 |
!*** external ["__UNSTABLE__elementorPackages","ui"] ***! |
| 68 |
\*******************************************************/ |
| 69 |
/***/ (function(module) { |
| 70 |
|
| 71 |
module.exports = window["__UNSTABLE__elementorPackages"]["ui"]; |
| 72 |
|
| 73 |
/***/ }), |
| 74 |
|
| 75 |
/***/ "@wordpress/i18n": |
| 76 |
/*!******************************!*\ |
| 77 |
!*** external ["wp","i18n"] ***! |
| 78 |
\******************************/ |
| 79 |
/***/ (function(module) { |
| 80 |
|
| 81 |
module.exports = window["wp"]["i18n"]; |
| 82 |
|
| 83 |
/***/ }) |
| 84 |
|
| 85 |
/******/ }); |
| 86 |
/************************************************************************/ |
| 87 |
/******/ // The module cache |
| 88 |
/******/ var __webpack_module_cache__ = {}; |
| 89 |
/******/ |
| 90 |
/******/ // The require function |
| 91 |
/******/ function __webpack_require__(moduleId) { |
| 92 |
/******/ // Check if module is in cache |
| 93 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 94 |
/******/ if (cachedModule !== undefined) { |
| 95 |
/******/ return cachedModule.exports; |
| 96 |
/******/ } |
| 97 |
/******/ // Create a new module (and put it into the cache) |
| 98 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 99 |
/******/ // no module.id needed |
| 100 |
/******/ // no module.loaded needed |
| 101 |
/******/ exports: {} |
| 102 |
/******/ }; |
| 103 |
/******/ |
| 104 |
/******/ // Execute the module function |
| 105 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 106 |
/******/ |
| 107 |
/******/ // Return the exports of the module |
| 108 |
/******/ return module.exports; |
| 109 |
/******/ } |
| 110 |
/******/ |
| 111 |
/************************************************************************/ |
| 112 |
/******/ /* webpack/runtime/define property getters */ |
| 113 |
/******/ !function() { |
| 114 |
/******/ // define getter functions for harmony exports |
| 115 |
/******/ __webpack_require__.d = function(exports, definition) { |
| 116 |
/******/ for(var key in definition) { |
| 117 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 118 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 119 |
/******/ } |
| 120 |
/******/ } |
| 121 |
/******/ }; |
| 122 |
/******/ }(); |
| 123 |
/******/ |
| 124 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 125 |
/******/ !function() { |
| 126 |
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } |
| 127 |
/******/ }(); |
| 128 |
/******/ |
| 129 |
/******/ /* webpack/runtime/make namespace object */ |
| 130 |
/******/ !function() { |
| 131 |
/******/ // define __esModule on exports |
| 132 |
/******/ __webpack_require__.r = function(exports) { |
| 133 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 134 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 135 |
/******/ } |
| 136 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 137 |
/******/ }; |
| 138 |
/******/ }(); |
| 139 |
/******/ |
| 140 |
/************************************************************************/ |
| 141 |
var __webpack_exports__ = {}; |
| 142 |
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. |
| 143 |
!function() { |
| 144 |
/*!*******************************************************!*\ |
| 145 |
!*** ./node_modules/@elementor/editor/dist/index.mjs ***! |
| 146 |
\*******************************************************/ |
| 147 |
__webpack_require__.r(__webpack_exports__); |
| 148 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 149 |
/* harmony export */ "init": function() { return /* binding */ init; }, |
| 150 |
/* harmony export */ "injectIntoTop": function() { return /* binding */ injectIntoTop; } |
| 151 |
/* harmony export */ }); |
| 152 |
/* harmony import */ var _elementor_locations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/locations */ "@elementor/locations"); |
| 153 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 154 |
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom"); |
| 155 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 156 |
/* harmony import */ var _elementor_editor_documents__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @elementor/editor-documents */ "@elementor/editor-documents"); |
| 157 |
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); |
| 158 |
/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @elementor/store */ "@elementor/store"); |
| 159 |
/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @elementor/editor-v1-adapters */ "@elementor/editor-v1-adapters"); |
| 160 |
// src/locations.ts |
| 161 |
|
| 162 |
var { |
| 163 |
Slot: TopSlot, |
| 164 |
inject: injectIntoTop |
| 165 |
} = (0,_elementor_locations__WEBPACK_IMPORTED_MODULE_0__.createLocation)(); |
| 166 |
|
| 167 |
// src/init.tsx |
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
// src/components/shell.tsx |
| 173 |
|
| 174 |
|
| 175 |
// src/hooks/use-sync-document-title.ts |
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
function useSyncDocumentTitle() { |
| 180 |
const activeDocument = (0,_elementor_editor_documents__WEBPACK_IMPORTED_MODULE_4__.useActiveDocument)(); |
| 181 |
const hostDocument = (0,_elementor_editor_documents__WEBPACK_IMPORTED_MODULE_4__.useHostDocument)(); |
| 182 |
const document = activeDocument && activeDocument.type.value !== "kit" ? activeDocument : hostDocument; |
| 183 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 184 |
if (document?.title === void 0) { |
| 185 |
return; |
| 186 |
} |
| 187 |
const title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Edit "%s" with Elementor', "elementor").replace("%s", document.title); |
| 188 |
window.document.title = title; |
| 189 |
}, [document?.title]); |
| 190 |
} |
| 191 |
|
| 192 |
// src/hooks/use-sync-document-query-params.ts |
| 193 |
|
| 194 |
|
| 195 |
function useSyncDocumentQueryParams() { |
| 196 |
const hostDocument = (0,_elementor_editor_documents__WEBPACK_IMPORTED_MODULE_4__.useHostDocument)(); |
| 197 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 198 |
if (!hostDocument?.id) { |
| 199 |
return; |
| 200 |
} |
| 201 |
const url = new URL(window.location.href); |
| 202 |
url.searchParams.set("post", hostDocument.id.toString()); |
| 203 |
url.searchParams.delete("active-document"); |
| 204 |
history.replaceState({}, "", url); |
| 205 |
}, [hostDocument?.id]); |
| 206 |
} |
| 207 |
|
| 208 |
// src/components/shell.tsx |
| 209 |
function Shell() { |
| 210 |
useSyncDocumentTitle(); |
| 211 |
useSyncDocumentQueryParams(); |
| 212 |
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(TopSlot, null); |
| 213 |
} |
| 214 |
|
| 215 |
// src/init.tsx |
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
// src/components/theme-provider.tsx |
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
// src/sync/use-color-scheme.ts |
| 225 |
|
| 226 |
|
| 227 |
function useColorScheme() { |
| 228 |
const [colorScheme, setColorScheme] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => getV1ColorScheme()); |
| 229 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 230 |
return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_7__.listenTo)( |
| 231 |
(0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_7__.v1ReadyEvent)(), |
| 232 |
() => setColorScheme(getV1ColorScheme()) |
| 233 |
); |
| 234 |
}, []); |
| 235 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 236 |
return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_7__.listenTo)( |
| 237 |
(0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_7__.commandEndEvent)("document/elements/settings"), |
| 238 |
(e) => { |
| 239 |
const event = e; |
| 240 |
const isColorScheme = event.args?.settings && "ui_theme" in event.args.settings; |
| 241 |
if (isColorScheme) { |
| 242 |
setColorScheme(getV1ColorScheme()); |
| 243 |
} |
| 244 |
} |
| 245 |
); |
| 246 |
}, []); |
| 247 |
return colorScheme; |
| 248 |
} |
| 249 |
function getV1ColorScheme() { |
| 250 |
return window.elementor?.getPreferences?.("ui_theme") || "auto"; |
| 251 |
} |
| 252 |
|
| 253 |
// src/components/theme-provider.tsx |
| 254 |
function ThemeProvider({ children }) { |
| 255 |
const colorScheme = useColorScheme(); |
| 256 |
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_5__.ThemeProvider, { colorScheme }, children); |
| 257 |
} |
| 258 |
|
| 259 |
// src/init.tsx |
| 260 |
function init(domElement) { |
| 261 |
const store = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_6__.createStore)(); |
| 262 |
(0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_7__.dispatchReadyEvent)(); |
| 263 |
react_dom__WEBPACK_IMPORTED_MODULE_2__.render(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(_elementor_store__WEBPACK_IMPORTED_MODULE_6__.StoreProvider, { store }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_5__.DirectionProvider, { rtl: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.isRTL)() }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(ThemeProvider, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Shell, null)))), domElement); |
| 264 |
} |
| 265 |
|
| 266 |
//# sourceMappingURL=index.mjs.map |
| 267 |
}(); |
| 268 |
(window.__UNSTABLE__elementorPackages = window.__UNSTABLE__elementorPackages || {}).editor = __webpack_exports__; |
| 269 |
/******/ })() |
| 270 |
; |