← All changes
|
assets/js/packages/editor-ui/editor-ui.js
+2032
-3671
4.2.0-dev2
→
4.3.1
View file →
| @@ -1,1202 +1,66 @@ | ||
| 1 | -/******/ (function() { // webpackBootstrap | |
| 2 | -/******/ "use strict"; | |
| 3 | -/******/ var __webpack_modules__ = ({ | |
| 1 | +(function(_elementor_icons, _elementor_ui, react, _wordpress_i18n, _elementor_editor_v1_adapters, react_dom) { | |
| 4 | 2 | |
| 5 | -/***/ "./packages/node_modules/@tanstack/react-virtual/dist/esm/index.js": | |
| 6 | -/*!*************************************************************************!*\ | |
| 7 | - !*** ./packages/node_modules/@tanstack/react-virtual/dist/esm/index.js ***! | |
| 8 | - \*************************************************************************/ | |
| 9 | -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { | |
| 3 | +//#region \0rolldown/runtime.js | |
| 4 | + var __create = Object.create; | |
| 5 | + var __defProp = Object.defineProperty; | |
| 6 | + var __name = (target, value) => __defProp(target, "name", { | |
| 7 | + value, | |
| 8 | + configurable: true | |
| 9 | + }); | |
| 10 | + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | + var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | + var __getProtoOf = Object.getPrototypeOf; | |
| 13 | + var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | + var __exportAll = (all, no_symbols) => { | |
| 15 | + let target = {}; | |
| 16 | + for (var name in all) { | |
| 17 | + __defProp(target, name, { | |
| 18 | + get: all[name], | |
| 19 | + enumerable: true | |
| 20 | + }); | |
| 21 | + } | |
| 22 | + if (!no_symbols) { | |
| 23 | + __defProp(target, Symbol.toStringTag, { value: "Module" }); | |
| 24 | + } | |
| 25 | + return target; | |
| 26 | + }; | |
| 27 | + var __copyProps = (to, from, except, desc) => { | |
| 28 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 29 | + for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 30 | + key = keys[i]; | |
| 31 | + if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 32 | + __defProp(to, key, { | |
| 33 | + get: ((k) => from[k]).bind(null, key), | |
| 34 | + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 35 | + }); | |
| 36 | + } | |
| 37 | + } | |
| 38 | + } | |
| 39 | + return to; | |
| 40 | + }; | |
| 41 | + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 42 | + value: mod, | |
| 43 | + enumerable: true | |
| 44 | + }) : target, mod)); | |
| 10 | 45 | |
| 11 | -__webpack_require__.r(__webpack_exports__); | |
| 12 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 13 | -/* harmony export */ Virtualizer: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.Virtualizer; }, | |
| 14 | -/* harmony export */ approxEqual: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.approxEqual; }, | |
| 15 | -/* harmony export */ debounce: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.debounce; }, | |
| 16 | -/* harmony export */ defaultKeyExtractor: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.defaultKeyExtractor; }, | |
| 17 | -/* harmony export */ defaultRangeExtractor: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.defaultRangeExtractor; }, | |
| 18 | -/* harmony export */ elementScroll: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.elementScroll; }, | |
| 19 | -/* harmony export */ measureElement: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.measureElement; }, | |
| 20 | -/* harmony export */ memo: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.memo; }, | |
| 21 | -/* harmony export */ notUndefined: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.notUndefined; }, | |
| 22 | -/* harmony export */ observeElementOffset: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeElementOffset; }, | |
| 23 | -/* harmony export */ observeElementRect: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeElementRect; }, | |
| 24 | -/* harmony export */ observeWindowOffset: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeWindowOffset; }, | |
| 25 | -/* harmony export */ observeWindowRect: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeWindowRect; }, | |
| 26 | -/* harmony export */ useVirtualizer: function() { return /* binding */ useVirtualizer; }, | |
| 27 | -/* harmony export */ useWindowVirtualizer: function() { return /* binding */ useWindowVirtualizer; }, | |
| 28 | -/* harmony export */ windowScroll: function() { return /* reexport safe */ _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.windowScroll; } | |
| 29 | -/* harmony export */ }); | |
| 30 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 31 | -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom"); | |
| 32 | -/* harmony import */ var _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tanstack/virtual-core */ "./packages/node_modules/@tanstack/virtual-core/dist/esm/index.js"); | |
| 46 | +//#endregion | |
| 47 | +let react$1 = __toESM(react, 1); | |
| 48 | +react = __toESM(react); | |
| 33 | 49 | |
| 50 | +//#region packages/packages/libs/editor-ui/src/components/collapse-icon.tsx | |
| 51 | + var CollapseIcon = (0, _elementor_ui.styled)(_elementor_icons.ChevronDownIcon, { shouldForwardProp: (prop) => prop !== "open" && prop !== "disabled" })(({ theme, open, disabled = false }) => ({ | |
| 52 | + transform: open ? "rotate(180deg)" : "rotate(0deg)", | |
| 53 | + transition: theme.transitions.create("transform", { duration: theme.transitions.duration.standard }), | |
| 54 | + opacity: disabled ? .4 : 1 | |
| 55 | + })); | |
| 34 | 56 | |
| 35 | - | |
| 36 | - | |
| 37 | -const useIsomorphicLayoutEffect = typeof document !== "undefined" ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; | |
| 38 | -function useVirtualizerBase({ | |
| 39 | - useFlushSync = true, | |
| 40 | - ...options | |
| 41 | -}) { | |
| 42 | - const rerender = react__WEBPACK_IMPORTED_MODULE_0__.useReducer(() => ({}), {})[1]; | |
| 43 | - const resolvedOptions = { | |
| 44 | - ...options, | |
| 45 | - onChange: (instance2, sync) => { | |
| 46 | - var _a; | |
| 47 | - if (useFlushSync && sync) { | |
| 48 | - (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.flushSync)(rerender); | |
| 49 | - } else { | |
| 50 | - rerender(); | |
| 51 | - } | |
| 52 | - (_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync); | |
| 53 | - } | |
| 54 | - }; | |
| 55 | - const [instance] = react__WEBPACK_IMPORTED_MODULE_0__.useState( | |
| 56 | - () => new _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.Virtualizer(resolvedOptions) | |
| 57 | - ); | |
| 58 | - instance.setOptions(resolvedOptions); | |
| 59 | - useIsomorphicLayoutEffect(() => { | |
| 60 | - return instance._didMount(); | |
| 61 | - }, []); | |
| 62 | - useIsomorphicLayoutEffect(() => { | |
| 63 | - return instance._willUpdate(); | |
| 64 | - }); | |
| 65 | - return instance; | |
| 66 | -} | |
| 67 | -function useVirtualizer(options) { | |
| 68 | - return useVirtualizerBase({ | |
| 69 | - observeElementRect: _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeElementRect, | |
| 70 | - observeElementOffset: _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeElementOffset, | |
| 71 | - scrollToFn: _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.elementScroll, | |
| 72 | - ...options | |
| 73 | - }); | |
| 74 | -} | |
| 75 | -function useWindowVirtualizer(options) { | |
| 76 | - return useVirtualizerBase({ | |
| 77 | - getScrollElement: () => typeof document !== "undefined" ? window : null, | |
| 78 | - observeElementRect: _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeWindowRect, | |
| 79 | - observeElementOffset: _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.observeWindowOffset, | |
| 80 | - scrollToFn: _tanstack_virtual_core__WEBPACK_IMPORTED_MODULE_2__.windowScroll, | |
| 81 | - initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0, | |
| 82 | - ...options | |
| 83 | - }); | |
| 84 | -} | |
| 85 | - | |
| 86 | -//# sourceMappingURL=index.js.map | |
| 87 | - | |
| 88 | - | |
| 89 | -/***/ }), | |
| 90 | - | |
| 91 | -/***/ "./packages/node_modules/@tanstack/virtual-core/dist/esm/index.js": | |
| 92 | -/*!************************************************************************!*\ | |
| 93 | - !*** ./packages/node_modules/@tanstack/virtual-core/dist/esm/index.js ***! | |
| 94 | - \************************************************************************/ | |
| 95 | -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { | |
| 96 | - | |
| 97 | -__webpack_require__.r(__webpack_exports__); | |
| 98 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 99 | -/* harmony export */ Virtualizer: function() { return /* binding */ Virtualizer; }, | |
| 100 | -/* harmony export */ approxEqual: function() { return /* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_0__.approxEqual; }, | |
| 101 | -/* harmony export */ debounce: function() { return /* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_0__.debounce; }, | |
| 102 | -/* harmony export */ defaultKeyExtractor: function() { return /* binding */ defaultKeyExtractor; }, | |
| 103 | -/* harmony export */ defaultRangeExtractor: function() { return /* binding */ defaultRangeExtractor; }, | |
| 104 | -/* harmony export */ elementScroll: function() { return /* binding */ elementScroll; }, | |
| 105 | -/* harmony export */ measureElement: function() { return /* binding */ measureElement; }, | |
| 106 | -/* harmony export */ memo: function() { return /* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_0__.memo; }, | |
| 107 | -/* harmony export */ notUndefined: function() { return /* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_0__.notUndefined; }, | |
| 108 | -/* harmony export */ observeElementOffset: function() { return /* binding */ observeElementOffset; }, | |
| 109 | -/* harmony export */ observeElementRect: function() { return /* binding */ observeElementRect; }, | |
| 110 | -/* harmony export */ observeWindowOffset: function() { return /* binding */ observeWindowOffset; }, | |
| 111 | -/* harmony export */ observeWindowRect: function() { return /* binding */ observeWindowRect; }, | |
| 112 | -/* harmony export */ windowScroll: function() { return /* binding */ windowScroll; } | |
| 113 | -/* harmony export */ }); | |
| 114 | -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./packages/node_modules/@tanstack/virtual-core/dist/esm/utils.js"); | |
| 115 | - | |
| 116 | -const getRect = (element) => { | |
| 117 | - const { offsetWidth, offsetHeight } = element; | |
| 118 | - return { width: offsetWidth, height: offsetHeight }; | |
| 119 | -}; | |
| 120 | -const defaultKeyExtractor = (index) => index; | |
| 121 | -const defaultRangeExtractor = (range) => { | |
| 122 | - const start = Math.max(range.startIndex - range.overscan, 0); | |
| 123 | - const end = Math.min(range.endIndex + range.overscan, range.count - 1); | |
| 124 | - const arr = []; | |
| 125 | - for (let i = start; i <= end; i++) { | |
| 126 | - arr.push(i); | |
| 127 | - } | |
| 128 | - return arr; | |
| 129 | -}; | |
| 130 | -const observeElementRect = (instance, cb) => { | |
| 131 | - const element = instance.scrollElement; | |
| 132 | - if (!element) { | |
| 133 | - return; | |
| 134 | - } | |
| 135 | - const targetWindow = instance.targetWindow; | |
| 136 | - if (!targetWindow) { | |
| 137 | - return; | |
| 138 | - } | |
| 139 | - const handler = (rect) => { | |
| 140 | - const { width, height } = rect; | |
| 141 | - cb({ width: Math.round(width), height: Math.round(height) }); | |
| 142 | - }; | |
| 143 | - handler(getRect(element)); | |
| 144 | - if (!targetWindow.ResizeObserver) { | |
| 145 | - return () => { | |
| 146 | - }; | |
| 147 | - } | |
| 148 | - const observer = new targetWindow.ResizeObserver((entries) => { | |
| 149 | - const run = () => { | |
| 150 | - const entry = entries[0]; | |
| 151 | - if (entry == null ? void 0 : entry.borderBoxSize) { | |
| 152 | - const box = entry.borderBoxSize[0]; | |
| 153 | - if (box) { | |
| 154 | - handler({ width: box.inlineSize, height: box.blockSize }); | |
| 155 | - return; | |
| 156 | - } | |
| 157 | - } | |
| 158 | - handler(getRect(element)); | |
| 159 | - }; | |
| 160 | - instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run(); | |
| 161 | - }); | |
| 162 | - observer.observe(element, { box: "border-box" }); | |
| 163 | - return () => { | |
| 164 | - observer.unobserve(element); | |
| 165 | - }; | |
| 166 | -}; | |
| 167 | -const addEventListenerOptions = { | |
| 168 | - passive: true | |
| 169 | -}; | |
| 170 | -const observeWindowRect = (instance, cb) => { | |
| 171 | - const element = instance.scrollElement; | |
| 172 | - if (!element) { | |
| 173 | - return; | |
| 174 | - } | |
| 175 | - const handler = () => { | |
| 176 | - cb({ width: element.innerWidth, height: element.innerHeight }); | |
| 177 | - }; | |
| 178 | - handler(); | |
| 179 | - element.addEventListener("resize", handler, addEventListenerOptions); | |
| 180 | - return () => { | |
| 181 | - element.removeEventListener("resize", handler); | |
| 182 | - }; | |
| 183 | -}; | |
| 184 | -const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window; | |
| 185 | -const observeElementOffset = (instance, cb) => { | |
| 186 | - const element = instance.scrollElement; | |
| 187 | - if (!element) { | |
| 188 | - return; | |
| 189 | - } | |
| 190 | - const targetWindow = instance.targetWindow; | |
| 191 | - if (!targetWindow) { | |
| 192 | - return; | |
| 193 | - } | |
| 194 | - let offset = 0; | |
| 195 | - const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.debounce)( | |
| 196 | - targetWindow, | |
| 197 | - () => { | |
| 198 | - cb(offset, false); | |
| 199 | - }, | |
| 200 | - instance.options.isScrollingResetDelay | |
| 201 | - ); | |
| 202 | - const createHandler = (isScrolling) => () => { | |
| 203 | - const { horizontal, isRtl } = instance.options; | |
| 204 | - offset = horizontal ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"]; | |
| 205 | - fallback(); | |
| 206 | - cb(offset, isScrolling); | |
| 207 | - }; | |
| 208 | - const handler = createHandler(true); | |
| 209 | - const endHandler = createHandler(false); | |
| 210 | - element.addEventListener("scroll", handler, addEventListenerOptions); | |
| 211 | - const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend; | |
| 212 | - if (registerScrollendEvent) { | |
| 213 | - element.addEventListener("scrollend", endHandler, addEventListenerOptions); | |
| 214 | - } | |
| 215 | - return () => { | |
| 216 | - element.removeEventListener("scroll", handler); | |
| 217 | - if (registerScrollendEvent) { | |
| 218 | - element.removeEventListener("scrollend", endHandler); | |
| 219 | - } | |
| 220 | - }; | |
| 221 | -}; | |
| 222 | -const observeWindowOffset = (instance, cb) => { | |
| 223 | - const element = instance.scrollElement; | |
| 224 | - if (!element) { | |
| 225 | - return; | |
| 226 | - } | |
| 227 | - const targetWindow = instance.targetWindow; | |
| 228 | - if (!targetWindow) { | |
| 229 | - return; | |
| 230 | - } | |
| 231 | - let offset = 0; | |
| 232 | - const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.debounce)( | |
| 233 | - targetWindow, | |
| 234 | - () => { | |
| 235 | - cb(offset, false); | |
| 236 | - }, | |
| 237 | - instance.options.isScrollingResetDelay | |
| 238 | - ); | |
| 239 | - const createHandler = (isScrolling) => () => { | |
| 240 | - offset = element[instance.options.horizontal ? "scrollX" : "scrollY"]; | |
| 241 | - fallback(); | |
| 242 | - cb(offset, isScrolling); | |
| 243 | - }; | |
| 244 | - const handler = createHandler(true); | |
| 245 | - const endHandler = createHandler(false); | |
| 246 | - element.addEventListener("scroll", handler, addEventListenerOptions); | |
| 247 | - const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend; | |
| 248 | - if (registerScrollendEvent) { | |
| 249 | - element.addEventListener("scrollend", endHandler, addEventListenerOptions); | |
| 250 | - } | |
| 251 | - return () => { | |
| 252 | - element.removeEventListener("scroll", handler); | |
| 253 | - if (registerScrollendEvent) { | |
| 254 | - element.removeEventListener("scrollend", endHandler); | |
| 255 | - } | |
| 256 | - }; | |
| 257 | -}; | |
| 258 | -const measureElement = (element, entry, instance) => { | |
| 259 | - if (entry == null ? void 0 : entry.borderBoxSize) { | |
| 260 | - const box = entry.borderBoxSize[0]; | |
| 261 | - if (box) { | |
| 262 | - const size = Math.round( | |
| 263 | - box[instance.options.horizontal ? "inlineSize" : "blockSize"] | |
| 264 | - ); | |
| 265 | - return size; | |
| 266 | - } | |
| 267 | - } | |
| 268 | - return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"]; | |
| 269 | -}; | |
| 270 | -const windowScroll = (offset, { | |
| 271 | - adjustments = 0, | |
| 272 | - behavior | |
| 273 | -}, instance) => { | |
| 274 | - var _a, _b; | |
| 275 | - const toOffset = offset + adjustments; | |
| 276 | - (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, { | |
| 277 | - [instance.options.horizontal ? "left" : "top"]: toOffset, | |
| 278 | - behavior | |
| 279 | - }); | |
| 280 | -}; | |
| 281 | -const elementScroll = (offset, { | |
| 282 | - adjustments = 0, | |
| 283 | - behavior | |
| 284 | -}, instance) => { | |
| 285 | - var _a, _b; | |
| 286 | - const toOffset = offset + adjustments; | |
| 287 | - (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, { | |
| 288 | - [instance.options.horizontal ? "left" : "top"]: toOffset, | |
| 289 | - behavior | |
| 290 | - }); | |
| 291 | -}; | |
| 292 | -class Virtualizer { | |
| 293 | - constructor(opts) { | |
| 294 | - this.unsubs = []; | |
| 295 | - this.scrollElement = null; | |
| 296 | - this.targetWindow = null; | |
| 297 | - this.isScrolling = false; | |
| 298 | - this.scrollState = null; | |
| 299 | - this.measurementsCache = []; | |
| 300 | - this.itemSizeCache = /* @__PURE__ */ new Map(); | |
| 301 | - this.laneAssignments = /* @__PURE__ */ new Map(); | |
| 302 | - this.pendingMeasuredCacheIndexes = []; | |
| 303 | - this.prevLanes = void 0; | |
| 304 | - this.lanesChangedFlag = false; | |
| 305 | - this.lanesSettling = false; | |
| 306 | - this.scrollRect = null; | |
| 307 | - this.scrollOffset = null; | |
| 308 | - this.scrollDirection = null; | |
| 309 | - this.scrollAdjustments = 0; | |
| 310 | - this.elementsCache = /* @__PURE__ */ new Map(); | |
| 311 | - this.now = () => { | |
| 312 | - var _a, _b, _c; | |
| 313 | - return ((_c = (_b = (_a = this.targetWindow) == null ? void 0 : _a.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) ?? Date.now(); | |
| 314 | - }; | |
| 315 | - this.observer = /* @__PURE__ */ (() => { | |
| 316 | - let _ro = null; | |
| 317 | - const get = () => { | |
| 318 | - if (_ro) { | |
| 319 | - return _ro; | |
| 320 | - } | |
| 321 | - if (!this.targetWindow || !this.targetWindow.ResizeObserver) { | |
| 322 | - return null; | |
| 323 | - } | |
| 324 | - return _ro = new this.targetWindow.ResizeObserver((entries) => { | |
| 325 | - entries.forEach((entry) => { | |
| 326 | - const run = () => { | |
| 327 | - const node = entry.target; | |
| 328 | - const index = this.indexFromElement(node); | |
| 329 | - if (!node.isConnected) { | |
| 330 | - this.observer.unobserve(node); | |
| 331 | - return; | |
| 332 | - } | |
| 333 | - if (this.shouldMeasureDuringScroll(index)) { | |
| 334 | - this.resizeItem( | |
| 335 | - index, | |
| 336 | - this.options.measureElement(node, entry, this) | |
| 337 | - ); | |
| 338 | - } | |
| 339 | - }; | |
| 340 | - this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run(); | |
| 341 | - }); | |
| 342 | - }); | |
| 343 | - }; | |
| 344 | - return { | |
| 345 | - disconnect: () => { | |
| 346 | - var _a; | |
| 347 | - (_a = get()) == null ? void 0 : _a.disconnect(); | |
| 348 | - _ro = null; | |
| 349 | - }, | |
| 350 | - observe: (target) => { | |
| 351 | - var _a; | |
| 352 | - return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" }); | |
| 353 | - }, | |
| 354 | - unobserve: (target) => { | |
| 355 | - var _a; | |
| 356 | - return (_a = get()) == null ? void 0 : _a.unobserve(target); | |
| 357 | - } | |
| 358 | - }; | |
| 359 | - })(); | |
| 360 | - this.range = null; | |
| 361 | - this.setOptions = (opts2) => { | |
| 362 | - Object.entries(opts2).forEach(([key, value]) => { | |
| 363 | - if (typeof value === "undefined") delete opts2[key]; | |
| 364 | - }); | |
| 365 | - this.options = { | |
| 366 | - debug: false, | |
| 367 | - initialOffset: 0, | |
| 368 | - overscan: 1, | |
| 369 | - paddingStart: 0, | |
| 370 | - paddingEnd: 0, | |
| 371 | - scrollPaddingStart: 0, | |
| 372 | - scrollPaddingEnd: 0, | |
| 373 | - horizontal: false, | |
| 374 | - getItemKey: defaultKeyExtractor, | |
| 375 | - rangeExtractor: defaultRangeExtractor, | |
| 376 | - onChange: () => { | |
| 377 | - }, | |
| 378 | - measureElement, | |
| 379 | - initialRect: { width: 0, height: 0 }, | |
| 380 | - scrollMargin: 0, | |
| 381 | - gap: 0, | |
| 382 | - indexAttribute: "data-index", | |
| 383 | - initialMeasurementsCache: [], | |
| 384 | - lanes: 1, | |
| 385 | - isScrollingResetDelay: 150, | |
| 386 | - enabled: true, | |
| 387 | - isRtl: false, | |
| 388 | - useScrollendEvent: false, | |
| 389 | - useAnimationFrameWithResizeObserver: false, | |
| 390 | - laneAssignmentMode: "estimate", | |
| 391 | - ...opts2 | |
| 392 | - }; | |
| 393 | - }; | |
| 394 | - this.notify = (sync) => { | |
| 395 | - var _a, _b; | |
| 396 | - (_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync); | |
| 397 | - }; | |
| 398 | - this.maybeNotify = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)( | |
| 399 | - () => { | |
| 400 | - this.calculateRange(); | |
| 401 | - return [ | |
| 402 | - this.isScrolling, | |
| 403 | - this.range ? this.range.startIndex : null, | |
| 404 | - this.range ? this.range.endIndex : null | |
| 405 | - ]; | |
| 406 | - }, | |
| 407 | - (isScrolling) => { | |
| 408 | - this.notify(isScrolling); | |
| 409 | - }, | |
| 410 | - { | |
| 411 | - key: true && "maybeNotify", | |
| 412 | - debug: () => this.options.debug, | |
| 413 | - initialDeps: [ | |
| 414 | - this.isScrolling, | |
| 415 | - this.range ? this.range.startIndex : null, | |
| 416 | - this.range ? this.range.endIndex : null | |
| 417 | - ] | |
| 418 | - } | |
| 419 | - ); | |
| 420 | - this.cleanup = () => { | |
| 421 | - this.unsubs.filter(Boolean).forEach((d) => d()); | |
| 422 | - this.unsubs = []; | |
| 423 | - this.observer.disconnect(); | |
| 424 | - if (this.rafId != null && this.targetWindow) { | |
| 425 | - this.targetWindow.cancelAnimationFrame(this.rafId); | |
| 426 | - this.rafId = null; | |
| 427 | - } | |
| 428 | - this.scrollState = null; | |
| 429 | - this.scrollElement = null; | |
| 430 | - this.targetWindow = null; | |
| 431 | - }; | |
| 432 | - this._didMount = () => { | |
| 433 | - return () => { | |
| 434 | - this.cleanup(); | |
| 435 | - }; | |
| 436 | - }; | |
| 437 | - this._willUpdate = () => { | |
| 438 | - var _a; | |
| 439 | - const scrollElement = this.options.enabled ? this.options.getScrollElement() : null; | |
| 440 | - if (this.scrollElement !== scrollElement) { | |
| 441 | - this.cleanup(); | |
| 442 | - if (!scrollElement) { | |
| 443 | - this.maybeNotify(); | |
| 444 | - return; | |
| 445 | - } | |
| 446 | - this.scrollElement = scrollElement; | |
| 447 | - if (this.scrollElement && "ownerDocument" in this.scrollElement) { | |
| 448 | - this.targetWindow = this.scrollElement.ownerDocument.defaultView; | |
| 449 | - } else { | |
| 450 | - this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null; | |
| 451 | - } | |
| 452 | - this.elementsCache.forEach((cached) => { | |
| 453 | - this.observer.observe(cached); | |
| 454 | - }); | |
| 455 | - this.unsubs.push( | |
| 456 | - this.options.observeElementRect(this, (rect) => { | |
| 457 | - this.scrollRect = rect; | |
| 458 | - this.maybeNotify(); | |
| 459 | - }) | |
| 460 | - ); | |
| 461 | - this.unsubs.push( | |
| 462 | - this.options.observeElementOffset(this, (offset, isScrolling) => { | |
| 463 | - this.scrollAdjustments = 0; | |
| 464 | - this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null; | |
| 465 | - this.scrollOffset = offset; | |
| 466 | - this.isScrolling = isScrolling; | |
| 467 | - if (this.scrollState) { | |
| 468 | - this.scheduleScrollReconcile(); | |
| 469 | - } | |
| 470 | - this.maybeNotify(); | |
| 471 | - }) | |
| 472 | - ); | |
| 473 | - this._scrollToOffset(this.getScrollOffset(), { | |
| 474 | - adjustments: void 0, | |
| 475 | - behavior: void 0 | |
| 476 | - }); | |
| 477 | - } | |
| 478 | - }; | |
| 479 | - this.rafId = null; | |
| 480 | - this.getSize = () => { | |
| 481 | - if (!this.options.enabled) { | |
| 482 | - this.scrollRect = null; | |
| 483 | - return 0; | |
| 484 | - } | |
| 485 | - this.scrollRect = this.scrollRect ?? this.options.initialRect; | |
| 486 | - return this.scrollRect[this.options.horizontal ? "width" : "height"]; | |
| 487 | - }; | |
| 488 | - this.getScrollOffset = () => { | |
| 489 | - if (!this.options.enabled) { | |
| 490 | - this.scrollOffset = null; | |
| 491 | - return 0; | |
| 492 | - } | |
| 493 | - this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset); | |
| 494 | - return this.scrollOffset; | |
| 495 | - }; | |
| 496 | - this.getFurthestMeasurement = (measurements, index) => { | |
| 497 | - const furthestMeasurementsFound = /* @__PURE__ */ new Map(); | |
| 498 | - const furthestMeasurements = /* @__PURE__ */ new Map(); | |
| 499 | - for (let m = index - 1; m >= 0; m--) { | |
| 500 | - const measurement = measurements[m]; | |
| 501 | - if (furthestMeasurementsFound.has(measurement.lane)) { | |
| 502 | - continue; | |
| 503 | - } | |
| 504 | - const previousFurthestMeasurement = furthestMeasurements.get( | |
| 505 | - measurement.lane | |
| 506 | - ); | |
| 507 | - if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) { | |
| 508 | - furthestMeasurements.set(measurement.lane, measurement); | |
| 509 | - } else if (measurement.end < previousFurthestMeasurement.end) { | |
| 510 | - furthestMeasurementsFound.set(measurement.lane, true); | |
| 511 | - } | |
| 512 | - if (furthestMeasurementsFound.size === this.options.lanes) { | |
| 513 | - break; | |
| 514 | - } | |
| 515 | - } | |
| 516 | - return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => { | |
| 517 | - if (a.end === b.end) { | |
| 518 | - return a.index - b.index; | |
| 519 | - } | |
| 520 | - return a.end - b.end; | |
| 521 | - })[0] : void 0; | |
| 522 | - }; | |
| 523 | - this.getMeasurementOptions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)( | |
| 524 | - () => [ | |
| 525 | - this.options.count, | |
| 526 | - this.options.paddingStart, | |
| 527 | - this.options.scrollMargin, | |
| 528 | - this.options.getItemKey, | |
| 529 | - this.options.enabled, | |
| 530 | - this.options.lanes, | |
| 531 | - this.options.laneAssignmentMode | |
| 532 | - ], | |
| 533 | - (count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => { | |
| 534 | - const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes; | |
| 535 | - if (lanesChanged) { | |
| 536 | - this.lanesChangedFlag = true; | |
| 537 | - } | |
| 538 | - this.prevLanes = lanes; | |
| 539 | - this.pendingMeasuredCacheIndexes = []; | |
| 540 | - return { | |
| 541 | - count, | |
| 542 | - paddingStart, | |
| 543 | - scrollMargin, | |
| 544 | - getItemKey, | |
| 545 | - enabled, | |
| 546 | - lanes, | |
| 547 | - laneAssignmentMode | |
| 548 | - }; | |
| 549 | - }, | |
| 550 | - { | |
| 551 | - key: false | |
| 552 | - } | |
| 553 | - ); | |
| 554 | - this.getMeasurements = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)( | |
| 555 | - () => [this.getMeasurementOptions(), this.itemSizeCache], | |
| 556 | - ({ | |
| 557 | - count, | |
| 558 | - paddingStart, | |
| 559 | - scrollMargin, | |
| 560 | - getItemKey, | |
| 561 | - enabled, | |
| 562 | - lanes, | |
| 563 | - laneAssignmentMode | |
| 564 | - }, itemSizeCache) => { | |
| 565 | - if (!enabled) { | |
| 566 | - this.measurementsCache = []; | |
| 567 | - this.itemSizeCache.clear(); | |
| 568 | - this.laneAssignments.clear(); | |
| 569 | - return []; | |
| 570 | - } | |
| 571 | - if (this.laneAssignments.size > count) { | |
| 572 | - for (const index of this.laneAssignments.keys()) { | |
| 573 | - if (index >= count) { | |
| 574 | - this.laneAssignments.delete(index); | |
| 575 | - } | |
| 576 | - } | |
| 577 | - } | |
| 578 | - if (this.lanesChangedFlag) { | |
| 579 | - this.lanesChangedFlag = false; | |
| 580 | - this.lanesSettling = true; | |
| 581 | - this.measurementsCache = []; | |
| 582 | - this.itemSizeCache.clear(); | |
| 583 | - this.laneAssignments.clear(); | |
| 584 | - this.pendingMeasuredCacheIndexes = []; | |
| 585 | - } | |
| 586 | - if (this.measurementsCache.length === 0 && !this.lanesSettling) { | |
| 587 | - this.measurementsCache = this.options.initialMeasurementsCache; | |
| 588 | - this.measurementsCache.forEach((item) => { | |
| 589 | - this.itemSizeCache.set(item.key, item.size); | |
| 590 | - }); | |
| 591 | - } | |
| 592 | - const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0; | |
| 593 | - this.pendingMeasuredCacheIndexes = []; | |
| 594 | - if (this.lanesSettling && this.measurementsCache.length === count) { | |
| 595 | - this.lanesSettling = false; | |
| 596 | - } | |
| 597 | - const measurements = this.measurementsCache.slice(0, min); | |
| 598 | - const laneLastIndex = new Array(lanes).fill( | |
| 599 | - void 0 | |
| 600 | - ); | |
| 601 | - for (let m = 0; m < min; m++) { | |
| 602 | - const item = measurements[m]; | |
| 603 | - if (item) { | |
| 604 | - laneLastIndex[item.lane] = m; | |
| 605 | - } | |
| 606 | - } | |
| 607 | - for (let i = min; i < count; i++) { | |
| 608 | - const key = getItemKey(i); | |
| 609 | - const cachedLane = this.laneAssignments.get(i); | |
| 610 | - let lane; | |
| 611 | - let start; | |
| 612 | - const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key); | |
| 613 | - if (cachedLane !== void 0 && this.options.lanes > 1) { | |
| 614 | - lane = cachedLane; | |
| 615 | - const prevIndex = laneLastIndex[lane]; | |
| 616 | - const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0; | |
| 617 | - start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin; | |
| 618 | - } else { | |
| 619 | - const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i); | |
| 620 | - start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin; | |
| 621 | - lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes; | |
| 622 | - if (this.options.lanes > 1 && shouldCacheLane) { | |
| 623 | - this.laneAssignments.set(i, lane); | |
| 624 | - } | |
| 625 | - } | |
| 626 | - const measuredSize = itemSizeCache.get(key); | |
| 627 | - const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i); | |
| 628 | - const end = start + size; | |
| 629 | - measurements[i] = { | |
| 630 | - index: i, | |
| 631 | - start, | |
| 632 | - size, | |
| 633 | - end, | |
| 634 | - key, | |
| 635 | - lane | |
| 636 | - }; | |
| 637 | - laneLastIndex[lane] = i; | |
| 638 | - } | |
| 639 | - this.measurementsCache = measurements; | |
| 640 | - return measurements; | |
| 641 | - }, | |
| 642 | - { | |
| 643 | - key: true && "getMeasurements", | |
| 644 | - debug: () => this.options.debug | |
| 645 | - } | |
| 646 | - ); | |
| 647 | - this.calculateRange = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)( | |
| 648 | - () => [ | |
| 649 | - this.getMeasurements(), | |
| 650 | - this.getSize(), | |
| 651 | - this.getScrollOffset(), | |
| 652 | - this.options.lanes | |
| 653 | - ], | |
| 654 | - (measurements, outerSize, scrollOffset, lanes) => { | |
| 655 | - return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({ | |
| 656 | - measurements, | |
| 657 | - outerSize, | |
| 658 | - scrollOffset, | |
| 659 | - lanes | |
| 660 | - }) : null; | |
| 661 | - }, | |
| 662 | - { | |
| 663 | - key: true && "calculateRange", | |
| 664 | - debug: () => this.options.debug | |
| 665 | - } | |
| 666 | - ); | |
| 667 | - this.getVirtualIndexes = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)( | |
| 668 | - () => { | |
| 669 | - let startIndex = null; | |
| 670 | - let endIndex = null; | |
| 671 | - const range = this.calculateRange(); | |
| 672 | - if (range) { | |
| 673 | - startIndex = range.startIndex; | |
| 674 | - endIndex = range.endIndex; | |
| 675 | - } | |
| 676 | - this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]); | |
| 677 | - return [ | |
| 678 | - this.options.rangeExtractor, | |
| 679 | - this.options.overscan, | |
| 680 | - this.options.count, | |
| 681 | - startIndex, | |
| 682 | - endIndex | |
| 683 | - ]; | |
| 684 | - }, | |
| 685 | - (rangeExtractor, overscan, count, startIndex, endIndex) => { | |
| 686 | - return startIndex === null || endIndex === null ? [] : rangeExtractor({ | |
| 687 | - startIndex, | |
| 688 | - endIndex, | |
| 689 | - overscan, | |
| 690 | - count | |
| 691 | - }); | |
| 692 | - }, | |
| 693 | - { | |
| 694 | - key: true && "getVirtualIndexes", | |
| 695 | - debug: () => this.options.debug | |
| 696 | - } | |
| 697 | - ); | |
| 698 | - this.indexFromElement = (node) => { | |
| 699 | - const attributeName = this.options.indexAttribute; | |
| 700 | - const indexStr = node.getAttribute(attributeName); | |
| 701 | - if (!indexStr) { | |
| 702 | - console.warn( | |
| 703 | - `Missing attribute name '${attributeName}={index}' on measured element.` | |
| 704 | - ); | |
| 705 | - return -1; | |
| 706 | - } | |
| 707 | - return parseInt(indexStr, 10); | |
| 708 | - }; | |
| 709 | - this.shouldMeasureDuringScroll = (index) => { | |
| 710 | - var _a; | |
| 711 | - if (!this.scrollState || this.scrollState.behavior !== "smooth") { | |
| 712 | - return true; | |
| 713 | - } | |
| 714 | - const scrollIndex = this.scrollState.index ?? ((_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index); | |
| 715 | - if (scrollIndex !== void 0 && this.range) { | |
| 716 | - const bufferSize = Math.max( | |
| 717 | - this.options.overscan, | |
| 718 | - Math.ceil((this.range.endIndex - this.range.startIndex) / 2) | |
| 719 | - ); | |
| 720 | - const minIndex = Math.max(0, scrollIndex - bufferSize); | |
| 721 | - const maxIndex = Math.min( | |
| 722 | - this.options.count - 1, | |
| 723 | - scrollIndex + bufferSize | |
| 724 | - ); | |
| 725 | - return index >= minIndex && index <= maxIndex; | |
| 726 | - } | |
| 727 | - return true; | |
| 728 | - }; | |
| 729 | - this.measureElement = (node) => { | |
| 730 | - if (!node) { | |
| 731 | - this.elementsCache.forEach((cached, key2) => { | |
| 732 | - if (!cached.isConnected) { | |
| 733 | - this.observer.unobserve(cached); | |
| 734 | - this.elementsCache.delete(key2); | |
| 735 | - } | |
| 736 | - }); | |
| 737 | - return; | |
| 738 | - } | |
| 739 | - const index = this.indexFromElement(node); | |
| 740 | - const key = this.options.getItemKey(index); | |
| 741 | - const prevNode = this.elementsCache.get(key); | |
| 742 | - if (prevNode !== node) { | |
| 743 | - if (prevNode) { | |
| 744 | - this.observer.unobserve(prevNode); | |
| 745 | - } | |
| 746 | - this.observer.observe(node); | |
| 747 | - this.elementsCache.set(key, node); | |
| 748 | - } | |
| 749 | - if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) { | |
| 750 | - this.resizeItem(index, this.options.measureElement(node, void 0, this)); | |
| 751 | - } | |
| 752 | - }; | |
| 753 | - this.resizeItem = (index, size) => { | |
| 754 | - var _a; | |
| 755 | - const item = this.measurementsCache[index]; | |
| 756 | - if (!item) return; | |
| 757 | - const itemSize = this.itemSizeCache.get(item.key) ?? item.size; | |
| 758 | - const delta = size - itemSize; | |
| 759 | - if (delta !== 0) { | |
| 760 | - if (((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments)) { | |
| 761 | - if ( true && this.options.debug) { | |
| 762 | - console.info("correction", delta); | |
| 763 | - } | |
| 764 | - this._scrollToOffset(this.getScrollOffset(), { | |
| 765 | - adjustments: this.scrollAdjustments += delta, | |
| 766 | - behavior: void 0 | |
| 767 | - }); | |
| 768 | - } | |
| 769 | - this.pendingMeasuredCacheIndexes.push(item.index); | |
| 770 | - this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size)); | |
| 771 | - this.notify(false); | |
| 772 | - } | |
| 773 | - }; | |
| 774 | - this.getVirtualItems = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)( | |
| 775 | - () => [this.getVirtualIndexes(), this.getMeasurements()], | |
| 776 | - (indexes, measurements) => { | |
| 777 | - const virtualItems = []; | |
| 778 | - for (let k = 0, len = indexes.length; k < len; k++) { | |
| 779 | - const i = indexes[k]; | |
| 780 | - const measurement = measurements[i]; | |
| 781 | - virtualItems.push(measurement); | |
| 782 | - } | |
| 783 | - return virtualItems; | |
| 784 | - }, | |
| 785 | - { | |
| 786 | - key: true && "getVirtualItems", | |
| 787 | - debug: () => this.options.debug | |
| 788 | - } | |
| 789 | - ); | |
| 790 | - this.getVirtualItemForOffset = (offset) => { | |
| 791 | - const measurements = this.getMeasurements(); | |
| 792 | - if (measurements.length === 0) { | |
| 793 | - return void 0; | |
| 794 | - } | |
| 795 | - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.notUndefined)( | |
| 796 | - measurements[findNearestBinarySearch( | |
| 797 | - 0, | |
| 798 | - measurements.length - 1, | |
| 799 | - (index) => (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.notUndefined)(measurements[index]).start, | |
| 800 | - offset | |
| 801 | - )] | |
| 802 | - ); | |
| 803 | - }; | |
| 804 | - this.getMaxScrollOffset = () => { | |
| 805 | - if (!this.scrollElement) return 0; | |
| 806 | - if ("scrollHeight" in this.scrollElement) { | |
| 807 | - return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight; | |
| 808 | - } else { | |
| 809 | - const doc = this.scrollElement.document.documentElement; | |
| 810 | - return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight; | |
| 811 | - } | |
| 812 | - }; | |
| 813 | - this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => { | |
| 814 | - if (!this.scrollElement) return 0; | |
| 815 | - const size = this.getSize(); | |
| 816 | - const scrollOffset = this.getScrollOffset(); | |
| 817 | - if (align === "auto") { | |
| 818 | - align = toOffset >= scrollOffset + size ? "end" : "start"; | |
| 819 | - } | |
| 820 | - if (align === "center") { | |
| 821 | - toOffset += (itemSize - size) / 2; | |
| 822 | - } else if (align === "end") { | |
| 823 | - toOffset -= size; | |
| 824 | - } | |
| 825 | - const maxOffset = this.getMaxScrollOffset(); | |
| 826 | - return Math.max(Math.min(maxOffset, toOffset), 0); | |
| 827 | - }; | |
| 828 | - this.getOffsetForIndex = (index, align = "auto") => { | |
| 829 | - index = Math.max(0, Math.min(index, this.options.count - 1)); | |
| 830 | - const size = this.getSize(); | |
| 831 | - const scrollOffset = this.getScrollOffset(); | |
| 832 | - const item = this.measurementsCache[index]; | |
| 833 | - if (!item) return; | |
| 834 | - if (align === "auto") { | |
| 835 | - if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) { | |
| 836 | - align = "end"; | |
| 837 | - } else if (item.start <= scrollOffset + this.options.scrollPaddingStart) { | |
| 838 | - align = "start"; | |
| 839 | - } else { | |
| 840 | - return [scrollOffset, align]; | |
| 841 | - } | |
| 842 | - } | |
| 843 | - if (align === "end" && index === this.options.count - 1) { | |
| 844 | - return [this.getMaxScrollOffset(), align]; | |
| 845 | - } | |
| 846 | - const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart; | |
| 847 | - return [ | |
| 848 | - this.getOffsetForAlignment(toOffset, align, item.size), | |
| 849 | - align | |
| 850 | - ]; | |
| 851 | - }; | |
| 852 | - this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => { | |
| 853 | - const offset = this.getOffsetForAlignment(toOffset, align); | |
| 854 | - const now = this.now(); | |
| 855 | - this.scrollState = { | |
| 856 | - index: null, | |
| 857 | - align, | |
| 858 | - behavior, | |
| 859 | - startedAt: now, | |
| 860 | - lastTargetOffset: offset, | |
| 861 | - stableFrames: 0 | |
| 862 | - }; | |
| 863 | - this._scrollToOffset(offset, { adjustments: void 0, behavior }); | |
| 864 | - this.scheduleScrollReconcile(); | |
| 865 | - }; | |
| 866 | - this.scrollToIndex = (index, { | |
| 867 | - align: initialAlign = "auto", | |
| 868 | - behavior = "auto" | |
| 869 | - } = {}) => { | |
| 870 | - index = Math.max(0, Math.min(index, this.options.count - 1)); | |
| 871 | - const offsetInfo = this.getOffsetForIndex(index, initialAlign); | |
| 872 | - if (!offsetInfo) { | |
| 873 | - return; | |
| 874 | - } | |
| 875 | - const [offset, align] = offsetInfo; | |
| 876 | - const now = this.now(); | |
| 877 | - this.scrollState = { | |
| 878 | - index, | |
| 879 | - align, | |
| 880 | - behavior, | |
| 881 | - startedAt: now, | |
| 882 | - lastTargetOffset: offset, | |
| 883 | - stableFrames: 0 | |
| 884 | - }; | |
| 885 | - this._scrollToOffset(offset, { adjustments: void 0, behavior }); | |
| 886 | - this.scheduleScrollReconcile(); | |
| 887 | - }; | |
| 888 | - this.scrollBy = (delta, { behavior = "auto" } = {}) => { | |
| 889 | - const offset = this.getScrollOffset() + delta; | |
| 890 | - const now = this.now(); | |
| 891 | - this.scrollState = { | |
| 892 | - index: null, | |
| 893 | - align: "start", | |
| 894 | - behavior, | |
| 895 | - startedAt: now, | |
| 896 | - lastTargetOffset: offset, | |
| 897 | - stableFrames: 0 | |
| 898 | - }; | |
| 899 | - this._scrollToOffset(offset, { adjustments: void 0, behavior }); | |
| 900 | - this.scheduleScrollReconcile(); | |
| 901 | - }; | |
| 902 | - this.getTotalSize = () => { | |
| 903 | - var _a; | |
| 904 | - const measurements = this.getMeasurements(); | |
| 905 | - let end; | |
| 906 | - if (measurements.length === 0) { | |
| 907 | - end = this.options.paddingStart; | |
| 908 | - } else if (this.options.lanes === 1) { | |
| 909 | - end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0; | |
| 910 | - } else { | |
| 911 | - const endByLane = Array(this.options.lanes).fill(null); | |
| 912 | - let endIndex = measurements.length - 1; | |
| 913 | - while (endIndex >= 0 && endByLane.some((val) => val === null)) { | |
| 914 | - const item = measurements[endIndex]; | |
| 915 | - if (endByLane[item.lane] === null) { | |
| 916 | - endByLane[item.lane] = item.end; | |
| 917 | - } | |
| 918 | - endIndex--; | |
| 919 | - } | |
| 920 | - end = Math.max(...endByLane.filter((val) => val !== null)); | |
| 921 | - } | |
| 922 | - return Math.max( | |
| 923 | - end - this.options.scrollMargin + this.options.paddingEnd, | |
| 924 | - 0 | |
| 925 | - ); | |
| 926 | - }; | |
| 927 | - this._scrollToOffset = (offset, { | |
| 928 | - adjustments, | |
| 929 | - behavior | |
| 930 | - }) => { | |
| 931 | - this.options.scrollToFn(offset, { behavior, adjustments }, this); | |
| 932 | - }; | |
| 933 | - this.measure = () => { | |
| 934 | - this.itemSizeCache = /* @__PURE__ */ new Map(); | |
| 935 | - this.laneAssignments = /* @__PURE__ */ new Map(); | |
| 936 | - this.notify(false); | |
| 937 | - }; | |
| 938 | - this.setOptions(opts); | |
| 939 | - } | |
| 940 | - scheduleScrollReconcile() { | |
| 941 | - if (!this.targetWindow) { | |
| 942 | - this.scrollState = null; | |
| 943 | - return; | |
| 944 | - } | |
| 945 | - if (this.rafId != null) return; | |
| 946 | - this.rafId = this.targetWindow.requestAnimationFrame(() => { | |
| 947 | - this.rafId = null; | |
| 948 | - this.reconcileScroll(); | |
| 949 | - }); | |
| 950 | - } | |
| 951 | - reconcileScroll() { | |
| 952 | - if (!this.scrollState) return; | |
| 953 | - const el = this.scrollElement; | |
| 954 | - if (!el) return; | |
| 955 | - const MAX_RECONCILE_MS = 5e3; | |
| 956 | - if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) { | |
| 957 | - this.scrollState = null; | |
| 958 | - return; | |
| 959 | - } | |
| 960 | - const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0; | |
| 961 | - const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset; | |
| 962 | - const STABLE_FRAMES = 1; | |
| 963 | - const targetChanged = targetOffset !== this.scrollState.lastTargetOffset; | |
| 964 | - if (!targetChanged && (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.approxEqual)(targetOffset, this.getScrollOffset())) { | |
| 965 | - this.scrollState.stableFrames++; | |
| 966 | - if (this.scrollState.stableFrames >= STABLE_FRAMES) { | |
| 967 | - this.scrollState = null; | |
| 968 | - return; | |
| 969 | - } | |
| 970 | - } else { | |
| 971 | - this.scrollState.stableFrames = 0; | |
| 972 | - if (targetChanged) { | |
| 973 | - this.scrollState.lastTargetOffset = targetOffset; | |
| 974 | - this.scrollState.behavior = "auto"; | |
| 975 | - this._scrollToOffset(targetOffset, { | |
| 976 | - adjustments: void 0, | |
| 977 | - behavior: "auto" | |
| 978 | - }); | |
| 979 | - } | |
| 980 | - } | |
| 981 | - this.scheduleScrollReconcile(); | |
| 982 | - } | |
| 983 | -} | |
| 984 | -const findNearestBinarySearch = (low, high, getCurrentValue, value) => { | |
| 985 | - while (low <= high) { | |
| 986 | - const middle = (low + high) / 2 | 0; | |
| 987 | - const currentValue = getCurrentValue(middle); | |
| 988 | - if (currentValue < value) { | |
| 989 | - low = middle + 1; | |
| 990 | - } else if (currentValue > value) { | |
| 991 | - high = middle - 1; | |
| 992 | - } else { | |
| 993 | - return middle; | |
| 994 | - } | |
| 995 | - } | |
| 996 | - if (low > 0) { | |
| 997 | - return low - 1; | |
| 998 | - } else { | |
| 999 | - return 0; | |
| 1000 | - } | |
| 1001 | -}; | |
| 1002 | -function calculateRange({ | |
| 1003 | - measurements, | |
| 1004 | - outerSize, | |
| 1005 | - scrollOffset, | |
| 1006 | - lanes | |
| 1007 | -}) { | |
| 1008 | - const lastIndex = measurements.length - 1; | |
| 1009 | - const getOffset = (index) => measurements[index].start; | |
| 1010 | - if (measurements.length <= lanes) { | |
| 1011 | - return { | |
| 1012 | - startIndex: 0, | |
| 1013 | - endIndex: lastIndex | |
| 1014 | - }; | |
| 1015 | - } | |
| 1016 | - let startIndex = findNearestBinarySearch( | |
| 1017 | - 0, | |
| 1018 | - lastIndex, | |
| 1019 | - getOffset, | |
| 1020 | - scrollOffset | |
| 1021 | - ); | |
| 1022 | - let endIndex = startIndex; | |
| 1023 | - if (lanes === 1) { | |
| 1024 | - while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) { | |
| 1025 | - endIndex++; | |
| 1026 | - } | |
| 1027 | - } else if (lanes > 1) { | |
| 1028 | - const endPerLane = Array(lanes).fill(0); | |
| 1029 | - while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) { | |
| 1030 | - const item = measurements[endIndex]; | |
| 1031 | - endPerLane[item.lane] = item.end; | |
| 1032 | - endIndex++; | |
| 1033 | - } | |
| 1034 | - const startPerLane = Array(lanes).fill(scrollOffset + outerSize); | |
| 1035 | - while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) { | |
| 1036 | - const item = measurements[startIndex]; | |
| 1037 | - startPerLane[item.lane] = item.start; | |
| 1038 | - startIndex--; | |
| 1039 | - } | |
| 1040 | - startIndex = Math.max(0, startIndex - startIndex % lanes); | |
| 1041 | - endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes)); | |
| 1042 | - } | |
| 1043 | - return { startIndex, endIndex }; | |
| 1044 | -} | |
| 1045 | - | |
| 1046 | -//# sourceMappingURL=index.js.map | |
| 1047 | - | |
| 1048 | - | |
| 1049 | -/***/ }), | |
| 1050 | - | |
| 1051 | -/***/ "./packages/node_modules/@tanstack/virtual-core/dist/esm/utils.js": | |
| 1052 | -/*!************************************************************************!*\ | |
| 1053 | - !*** ./packages/node_modules/@tanstack/virtual-core/dist/esm/utils.js ***! | |
| 1054 | - \************************************************************************/ | |
| 1055 | -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { | |
| 1056 | - | |
| 1057 | -__webpack_require__.r(__webpack_exports__); | |
| 1058 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1059 | -/* harmony export */ approxEqual: function() { return /* binding */ approxEqual; }, | |
| 1060 | -/* harmony export */ debounce: function() { return /* binding */ debounce; }, | |
| 1061 | -/* harmony export */ memo: function() { return /* binding */ memo; }, | |
| 1062 | -/* harmony export */ notUndefined: function() { return /* binding */ notUndefined; } | |
| 1063 | -/* harmony export */ }); | |
| 1064 | -function memo(getDeps, fn, opts) { | |
| 1065 | - let deps = opts.initialDeps ?? []; | |
| 1066 | - let result; | |
| 1067 | - let isInitial = true; | |
| 1068 | - function memoizedFunction() { | |
| 1069 | - var _a, _b, _c; | |
| 1070 | - let depTime; | |
| 1071 | - if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now(); | |
| 1072 | - const newDeps = getDeps(); | |
| 1073 | - const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep); | |
| 1074 | - if (!depsChanged) { | |
| 1075 | - return result; | |
| 1076 | - } | |
| 1077 | - deps = newDeps; | |
| 1078 | - let resultTime; | |
| 1079 | - if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now(); | |
| 1080 | - result = fn(...newDeps); | |
| 1081 | - if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) { | |
| 1082 | - const depEndTime = Math.round((Date.now() - depTime) * 100) / 100; | |
| 1083 | - const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100; | |
| 1084 | - const resultFpsPercentage = resultEndTime / 16; | |
| 1085 | - const pad = (str, num) => { | |
| 1086 | - str = String(str); | |
| 1087 | - while (str.length < num) { | |
| 1088 | - str = " " + str; | |
| 1089 | - } | |
| 1090 | - return str; | |
| 1091 | - }; | |
| 1092 | - console.info( | |
| 1093 | - `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, | |
| 1094 | - ` | |
| 1095 | - font-size: .6rem; | |
| 1096 | - font-weight: bold; | |
| 1097 | - color: hsl(${Math.max( | |
| 1098 | - 0, | |
| 1099 | - Math.min(120 - 120 * resultFpsPercentage, 120) | |
| 1100 | - )}deg 100% 31%);`, | |
| 1101 | - opts == null ? void 0 : opts.key | |
| 1102 | - ); | |
| 1103 | - } | |
| 1104 | - if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) { | |
| 1105 | - opts.onChange(result); | |
| 1106 | - } | |
| 1107 | - isInitial = false; | |
| 1108 | - return result; | |
| 1109 | - } | |
| 1110 | - memoizedFunction.updateDeps = (newDeps) => { | |
| 1111 | - deps = newDeps; | |
| 1112 | - }; | |
| 1113 | - return memoizedFunction; | |
| 1114 | -} | |
| 1115 | -function notUndefined(value, msg) { | |
| 1116 | - if (value === void 0) { | |
| 1117 | - throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`); | |
| 1118 | - } else { | |
| 1119 | - return value; | |
| 1120 | - } | |
| 1121 | -} | |
| 1122 | -const approxEqual = (a, b) => Math.abs(a - b) < 1.01; | |
| 1123 | -const debounce = (targetWindow, fn, ms) => { | |
| 1124 | - let timeoutId; | |
| 1125 | - return function(...args) { | |
| 1126 | - targetWindow.clearTimeout(timeoutId); | |
| 1127 | - timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms); | |
| 1128 | - }; | |
| 1129 | -}; | |
| 1130 | - | |
| 1131 | -//# sourceMappingURL=utils.js.map | |
| 1132 | - | |
| 1133 | - | |
| 1134 | -/***/ }), | |
| 1135 | - | |
| 1136 | -/***/ "./packages/packages/libs/editor-ui/src/components/collapse-icon.tsx": | |
| 1137 | -/*!***************************************************************************!*\ | |
| 1138 | - !*** ./packages/packages/libs/editor-ui/src/components/collapse-icon.tsx ***! | |
| 1139 | - \***************************************************************************/ | |
| 1140 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1141 | - | |
| 1142 | -__webpack_require__.r(__webpack_exports__); | |
| 1143 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1144 | -/* harmony export */ CollapseIcon: function() { return /* binding */ CollapseIcon; } | |
| 1145 | -/* harmony export */ }); | |
| 1146 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1147 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_0__); | |
| 1148 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1149 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1150 | - | |
| 1151 | - | |
| 1152 | - | |
| 1153 | -// TODO: Replace this with future Rotate component that will be implemented in elementor-ui | |
| 1154 | -const CollapseIcon = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.styled)(_elementor_icons__WEBPACK_IMPORTED_MODULE_0__.ChevronDownIcon, { | |
| 1155 | - shouldForwardProp: prop => prop !== 'open' && prop !== 'disabled' | |
| 1156 | -})(({ | |
| 1157 | - theme, | |
| 1158 | - open, | |
| 1159 | - disabled = false | |
| 1160 | -}) => ({ | |
| 1161 | - transform: open ? 'rotate(180deg)' : 'rotate(0deg)', | |
| 1162 | - transition: theme.transitions.create('transform', { | |
| 1163 | - duration: theme.transitions.duration.standard | |
| 1164 | - }), | |
| 1165 | - opacity: disabled ? 0.4 : 1 | |
| 1166 | -})); | |
| 1167 | - | |
| 1168 | -/***/ }), | |
| 1169 | - | |
| 1170 | -/***/ "./packages/packages/libs/editor-ui/src/components/collapsible-content.tsx": | |
| 1171 | -/*!*********************************************************************************!*\ | |
| 1172 | - !*** ./packages/packages/libs/editor-ui/src/components/collapsible-content.tsx ***! | |
| 1173 | - \*********************************************************************************/ | |
| 1174 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1175 | - | |
| 1176 | -__webpack_require__.r(__webpack_exports__); | |
| 1177 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1178 | -/* harmony export */ CollapsibleContent: function() { return /* binding */ CollapsibleContent; }, | |
| 1179 | -/* harmony export */ getCollapsibleValue: function() { return /* binding */ getCollapsibleValue; } | |
| 1180 | -/* harmony export */ }); | |
| 1181 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1182 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1183 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1184 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1185 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1186 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); | |
| 1187 | -/* harmony import */ var _collapse_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collapse-icon */ "./packages/packages/libs/editor-ui/src/components/collapse-icon.tsx"); | |
| 1188 | - | |
| 1189 | - | |
| 1190 | - | |
| 1191 | - | |
| 1192 | - | |
| 1193 | -const IndicatorsWrapper = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.styled)('div')` | |
| 57 | +//#endregion | |
| 58 | +//#region packages/packages/libs/editor-ui/src/components/collapsible-content.tsx | |
| 59 | + var IndicatorsWrapper = (0, _elementor_ui.styled)("div")` | |
| 1194 | 60 | position: absolute; |
| 1195 | 61 | top: 0; |
| 1196 | - right: ${({ | |
| 1197 | - theme | |
| 1198 | -}) => theme.spacing(3)}; | |
| 62 | + right: ${({ theme }) => theme.spacing(3)}; | |
| 1199 | 63 | height: 100%; |
| 1200 | 64 | display: flex; |
| 1201 | 65 | flex-direction: column; |
| 1202 | 66 | align-items: center; |
| @@ -1201,235 +65,93 @@ | ||
| 1201 | 65 | flex-direction: column; |
| 1202 | 66 | align-items: center; |
| 1203 | 67 | justify-content: center; |
| 1204 | 68 | `; |
| 1205 | -const CollapsibleContent = ({ | |
| 1206 | - children, | |
| 1207 | - defaultOpen = false, | |
| 1208 | - titleEnd = null | |
| 1209 | -}) => { | |
| 1210 | - const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultOpen); | |
| 1211 | - const handleToggle = () => { | |
| 1212 | - setOpen(prevOpen => !prevOpen); | |
| 1213 | - }; | |
| 1214 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Stack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Stack, { | |
| 1215 | - sx: { | |
| 1216 | - position: 'relative' | |
| 1217 | - } | |
| 1218 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { | |
| 1219 | - fullWidth: true, | |
| 1220 | - size: "small", | |
| 1221 | - color: "secondary", | |
| 1222 | - variant: "outlined", | |
| 1223 | - onClick: handleToggle, | |
| 1224 | - endIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_collapse_icon__WEBPACK_IMPORTED_MODULE_3__.CollapseIcon, { | |
| 1225 | - open: open | |
| 1226 | - }), | |
| 1227 | - sx: { | |
| 1228 | - my: 0.5 | |
| 1229 | - }, | |
| 1230 | - "aria-label": open ? 'Show less' : 'Show more' | |
| 1231 | - }, open ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show less', 'elementor') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show more', 'elementor')), titleEnd && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(IndicatorsWrapper, null, getCollapsibleValue(titleEnd, open))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Collapse, { | |
| 1232 | - in: open, | |
| 1233 | - timeout: "auto", | |
| 1234 | - unmountOnExit: true | |
| 1235 | - }, children)); | |
| 1236 | -}; | |
| 1237 | -function getCollapsibleValue(value, isOpen) { | |
| 1238 | - if (typeof value === 'function') { | |
| 1239 | - return value(isOpen); | |
| 1240 | - } | |
| 1241 | - return value; | |
| 1242 | -} | |
| 69 | + var CollapsibleContent = ({ children, defaultOpen = false, titleEnd = null }) => { | |
| 70 | + const [open, setOpen] = (0, react.useState)(defaultOpen); | |
| 71 | + const handleToggle = () => { | |
| 72 | + setOpen((prevOpen) => !prevOpen); | |
| 73 | + }; | |
| 74 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, null, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { sx: { position: "relative" } }, /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 75 | + fullWidth: true, | |
| 76 | + size: "small", | |
| 77 | + color: "secondary", | |
| 78 | + variant: "outlined", | |
| 79 | + onClick: handleToggle, | |
| 80 | + endIcon: /* @__PURE__ */ react.createElement(CollapseIcon, { open }), | |
| 81 | + sx: { my: .5 }, | |
| 82 | + "aria-label": open ? "Show less" : "Show more" | |
| 83 | + }, open ? (0, _wordpress_i18n.__)("Show less", "elementor") : (0, _wordpress_i18n.__)("Show more", "elementor")), titleEnd && /* @__PURE__ */ react.createElement(IndicatorsWrapper, null, getCollapsibleValue(titleEnd, open))), /* @__PURE__ */ react.createElement(_elementor_ui.Collapse, { | |
| 84 | + in: open, | |
| 85 | + timeout: "auto", | |
| 86 | + unmountOnExit: true | |
| 87 | + }, children)); | |
| 88 | + }; | |
| 89 | + function getCollapsibleValue(value, isOpen) { | |
| 90 | + if (typeof value === "function") return value(isOpen); | |
| 91 | + return value; | |
| 92 | + } | |
| 1243 | 93 | |
| 1244 | -/***/ }), | |
| 94 | +//#endregion | |
| 95 | +//#region packages/packages/libs/editor-ui/src/components/ellipsis-with-tooltip.tsx | |
| 96 | + var EllipsisWithTooltip = ({ maxWidth, title, as, ...props }) => { | |
| 97 | + const [setRef, isOverflowing] = useIsOverflowing(); | |
| 98 | + if (isOverflowing) return /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, { | |
| 99 | + title, | |
| 100 | + placement: "top" | |
| 101 | + }, /* @__PURE__ */ react.createElement(Content, { | |
| 102 | + maxWidth, | |
| 103 | + ref: setRef, | |
| 104 | + as, | |
| 105 | + ...props | |
| 106 | + }, title)); | |
| 107 | + return /* @__PURE__ */ react.createElement(Content, { | |
| 108 | + maxWidth, | |
| 109 | + ref: setRef, | |
| 110 | + as, | |
| 111 | + ...props | |
| 112 | + }, title); | |
| 113 | + }; | |
| 114 | + var Content = react.forwardRef(({ maxWidth, as: Component = _elementor_ui.Box, ...props }, ref) => /* @__PURE__ */ react.createElement(Component, { | |
| 115 | + ref, | |
| 116 | + position: "relative", | |
| 117 | + ...props, | |
| 118 | + style: { | |
| 119 | + overflow: "hidden", | |
| 120 | + textOverflow: "ellipsis", | |
| 121 | + whiteSpace: "nowrap", | |
| 122 | + maxWidth | |
| 123 | + } | |
| 124 | + })); | |
| 125 | + var useIsOverflowing = () => { | |
| 126 | + const [el, setEl] = (0, react.useState)(null); | |
| 127 | + const [isOverflowing, setIsOverflown] = (0, react.useState)(false); | |
| 128 | + (0, react.useEffect)(() => { | |
| 129 | + const observer = new ResizeObserver(([{ target }]) => { | |
| 130 | + setIsOverflown(target.scrollWidth > target.clientWidth); | |
| 131 | + }); | |
| 132 | + if (el) observer.observe(el); | |
| 133 | + return () => { | |
| 134 | + observer.disconnect(); | |
| 135 | + }; | |
| 136 | + }, [el]); | |
| 137 | + return [setEl, isOverflowing]; | |
| 138 | + }; | |
| 1245 | 139 | |
| 1246 | -/***/ "./packages/packages/libs/editor-ui/src/components/confirmation-dialog.tsx": | |
| 1247 | -/*!*********************************************************************************!*\ | |
| 1248 | - !*** ./packages/packages/libs/editor-ui/src/components/confirmation-dialog.tsx ***! | |
| 1249 | - \*********************************************************************************/ | |
| 1250 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1251 | - | |
| 1252 | -__webpack_require__.r(__webpack_exports__); | |
| 1253 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1254 | -/* harmony export */ ConfirmationDialog: function() { return /* binding */ ConfirmationDialog; } | |
| 1255 | -/* harmony export */ }); | |
| 1256 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1257 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1258 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1259 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 1260 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1261 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 1262 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1263 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); | |
| 1264 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 1265 | - | |
| 1266 | - | |
| 1267 | - | |
| 1268 | - | |
| 1269 | - | |
| 1270 | -const TITLE_ID = 'confirmation-dialog'; | |
| 1271 | -const ConfirmationDialog = ({ | |
| 1272 | - open, | |
| 1273 | - onClose, | |
| 1274 | - children | |
| 1275 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Dialog, { | |
| 1276 | - open: open, | |
| 1277 | - onClose: onClose, | |
| 1278 | - "aria-labelledby": TITLE_ID, | |
| 1279 | - maxWidth: "sm" | |
| 1280 | -}, children); | |
| 1281 | -const ConfirmationDialogTitle = ({ | |
| 1282 | - children, | |
| 1283 | - icon: Icon = _elementor_icons__WEBPACK_IMPORTED_MODULE_1__.AlertOctagonFilledIcon, | |
| 1284 | - iconColor = 'error' | |
| 1285 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogTitle, { | |
| 1286 | - id: TITLE_ID, | |
| 1287 | - display: "flex", | |
| 1288 | - alignItems: "center", | |
| 1289 | - gap: 1, | |
| 1290 | - sx: { | |
| 1291 | - lineHeight: 1 | |
| 1292 | - } | |
| 1293 | -}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Icon, { | |
| 1294 | - color: iconColor | |
| 1295 | -}), children); | |
| 1296 | -const ConfirmationDialogContent = ({ | |
| 1297 | - children | |
| 1298 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogContent, { | |
| 1299 | - sx: { | |
| 1300 | - mt: 2 | |
| 1301 | - } | |
| 1302 | -}, children); | |
| 1303 | -const ConfirmationDialogContentText = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogContentText, _extends({ | |
| 1304 | - variant: "body2", | |
| 1305 | - color: "secondary" | |
| 1306 | -}, props)); | |
| 1307 | -const ConfirmationDialogActions = ({ | |
| 1308 | - onClose, | |
| 1309 | - onConfirm, | |
| 1310 | - cancelLabel, | |
| 1311 | - confirmLabel, | |
| 1312 | - color = 'error', | |
| 1313 | - onSuppressMessage, | |
| 1314 | - suppressLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Don't show this again", 'elementor') | |
| 1315 | -}) => { | |
| 1316 | - const [dontShowAgain, setDontShowAgain] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); | |
| 1317 | - const handleConfirm = () => { | |
| 1318 | - if (dontShowAgain && onSuppressMessage) { | |
| 1319 | - onSuppressMessage(); | |
| 1320 | - } | |
| 1321 | - onConfirm(); | |
| 1322 | - }; | |
| 1323 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogActions, { | |
| 1324 | - sx: onSuppressMessage ? { | |
| 1325 | - justifyContent: 'space-between', | |
| 1326 | - alignItems: 'center' | |
| 1327 | - } : undefined | |
| 1328 | - }, onSuppressMessage && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.FormControlLabel, { | |
| 1329 | - control: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Checkbox, { | |
| 1330 | - checked: dontShowAgain, | |
| 1331 | - onChange: event => setDontShowAgain(event.target.checked), | |
| 1332 | - size: "medium", | |
| 1333 | - color: "secondary" | |
| 1334 | - }), | |
| 1335 | - label: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 1336 | - variant: "body2", | |
| 1337 | - color: "text.secondary" | |
| 1338 | - }, suppressLabel) | |
| 1339 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, { | |
| 1340 | - color: "secondary", | |
| 1341 | - onClick: onClose | |
| 1342 | - }, cancelLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Not now', 'elementor')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, { | |
| 1343 | - autoFocus: true, | |
| 1344 | - variant: "contained", | |
| 1345 | - color: color, | |
| 1346 | - onClick: handleConfirm, | |
| 1347 | - sx: { | |
| 1348 | - ml: 1 | |
| 1349 | - } | |
| 1350 | - }, confirmLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Delete', 'elementor')))); | |
| 1351 | -}; | |
| 1352 | -ConfirmationDialog.Title = ConfirmationDialogTitle; | |
| 1353 | -ConfirmationDialog.Content = ConfirmationDialogContent; | |
| 1354 | -ConfirmationDialog.ContentText = ConfirmationDialogContentText; | |
| 1355 | -ConfirmationDialog.Actions = ConfirmationDialogActions; | |
| 1356 | - | |
| 1357 | -/***/ }), | |
| 1358 | - | |
| 1359 | -/***/ "./packages/packages/libs/editor-ui/src/components/cta-button.tsx": | |
| 1360 | -/*!************************************************************************!*\ | |
| 1361 | - !*** ./packages/packages/libs/editor-ui/src/components/cta-button.tsx ***! | |
| 1362 | - \************************************************************************/ | |
| 1363 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1364 | - | |
| 1365 | -__webpack_require__.r(__webpack_exports__); | |
| 1366 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1367 | -/* harmony export */ CtaButton: function() { return /* binding */ CtaButton; } | |
| 1368 | -/* harmony export */ }); | |
| 1369 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1370 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1371 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1372 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 1373 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1374 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 1375 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1376 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); | |
| 1377 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 1378 | - | |
| 1379 | - | |
| 1380 | - | |
| 1381 | - | |
| 1382 | -const CtaButton = ({ | |
| 1383 | - href, | |
| 1384 | - children, | |
| 1385 | - showIcon = true, | |
| 1386 | - ...props | |
| 1387 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, _extends({ | |
| 1388 | - variant: "contained", | |
| 1389 | - color: "promotion", | |
| 1390 | - href: href, | |
| 1391 | - target: "_blank", | |
| 1392 | - startIcon: showIcon ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.CrownFilledIcon, null) : undefined | |
| 1393 | -}, props), children ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Upgrade Now', 'elementor')); | |
| 1394 | - | |
| 1395 | -/***/ }), | |
| 1396 | - | |
| 1397 | -/***/ "./packages/packages/libs/editor-ui/src/components/editable-field.tsx": | |
| 1398 | -/*!****************************************************************************!*\ | |
| 1399 | - !*** ./packages/packages/libs/editor-ui/src/components/editable-field.tsx ***! | |
| 1400 | - \****************************************************************************/ | |
| 1401 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1402 | - | |
| 1403 | -__webpack_require__.r(__webpack_exports__); | |
| 1404 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1405 | -/* harmony export */ EditableField: function() { return /* binding */ EditableField; } | |
| 1406 | -/* harmony export */ }); | |
| 1407 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1408 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1409 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1410 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1411 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 1412 | - | |
| 1413 | - | |
| 1414 | - | |
| 1415 | -const EditableField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ | |
| 1416 | - value, | |
| 1417 | - error, | |
| 1418 | - as = 'span', | |
| 1419 | - sx, | |
| 1420 | - ...props | |
| 1421 | -}, ref) => { | |
| 1422 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Tooltip, { | |
| 1423 | - title: error, | |
| 1424 | - open: !!error, | |
| 1425 | - placement: "top" | |
| 1426 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(StyledField, _extends({ | |
| 1427 | - ref: ref, | |
| 1428 | - component: as | |
| 1429 | - }, props), value)); | |
| 1430 | -}); | |
| 1431 | -const StyledField = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.styled)((0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Box))` | |
| 140 | +//#endregion | |
| 141 | +//#region packages/packages/libs/editor-ui/src/components/editable-field.tsx | |
| 142 | + var EditableField = (0, react.forwardRef)(({ value, error, as = "span", sx, ...props }, ref) => { | |
| 143 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, { | |
| 144 | + title: error, | |
| 145 | + open: !!error, | |
| 146 | + placement: "top" | |
| 147 | + }, /* @__PURE__ */ react.createElement(StyledField, { | |
| 148 | + ref, | |
| 149 | + component: as, | |
| 150 | + ...props | |
| 151 | + }, value)); | |
| 152 | + }); | |
| 153 | + var StyledField = (0, _elementor_ui.styled)(_elementor_ui.Box)` | |
| 1432 | 154 | width: 100%; |
| 1433 | 155 | &:focus { |
| 1434 | 156 | outline: none; |
| 1435 | 157 | } |
| @@ -1434,300 +156,480 @@ | ||
| 1434 | 156 | outline: none; |
| 1435 | 157 | } |
| 1436 | 158 | `; |
| 1437 | 159 | |
| 1438 | -/***/ }), | |
| 160 | +//#endregion | |
| 161 | +//#region packages/packages/libs/editor-ui/src/components/introduction-modal.tsx | |
| 162 | + var IntroductionModal = ({ open, handleClose, title, children }) => { | |
| 163 | + const [shouldShowAgain, setShouldShowAgain] = (0, react.useState)(true); | |
| 164 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Dialog, { | |
| 165 | + open, | |
| 166 | + onClose: handleClose, | |
| 167 | + maxWidth: "sm", | |
| 168 | + TransitionComponent: Transition | |
| 169 | + }, title && /* @__PURE__ */ react.createElement(_elementor_ui.DialogHeader, { logo: false }, /* @__PURE__ */ react.createElement(_elementor_ui.DialogTitle, null, title)), children, /* @__PURE__ */ react.createElement(_elementor_ui.DialogActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.FormControlLabel, { | |
| 170 | + sx: { marginRight: "auto" }, | |
| 171 | + control: /* @__PURE__ */ react.createElement(_elementor_ui.Checkbox, { | |
| 172 | + checked: !shouldShowAgain, | |
| 173 | + onChange: () => setShouldShowAgain(!shouldShowAgain) | |
| 174 | + }), | |
| 175 | + label: /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("Don't show this again", "elementor")) | |
| 176 | + }), /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 177 | + size: "medium", | |
| 178 | + variant: "contained", | |
| 179 | + sx: { minWidth: "135px" }, | |
| 180 | + "aria-label": (0, _wordpress_i18n.__)("Got it introduction", "elementor"), | |
| 181 | + onClick: () => handleClose(shouldShowAgain) | |
| 182 | + }, (0, _wordpress_i18n.__)("Got it", "elementor")))); | |
| 183 | + }; | |
| 184 | + var Transition = react.forwardRef((props, ref) => /* @__PURE__ */ react.createElement(_elementor_ui.Fade, { | |
| 185 | + ref, | |
| 186 | + ...props, | |
| 187 | + timeout: { | |
| 188 | + enter: 1e3, | |
| 189 | + exit: 200 | |
| 190 | + } | |
| 191 | + })); | |
| 1439 | 192 | |
| 1440 | -/***/ "./packages/packages/libs/editor-ui/src/components/ellipsis-with-tooltip.tsx": | |
| 1441 | -/*!***********************************************************************************!*\ | |
| 1442 | - !*** ./packages/packages/libs/editor-ui/src/components/ellipsis-with-tooltip.tsx ***! | |
| 1443 | - \***********************************************************************************/ | |
| 1444 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 193 | +//#endregion | |
| 194 | +//#region packages/packages/libs/editor-ui/src/hooks/use-color-scheme.ts | |
| 195 | + function useColorScheme() { | |
| 196 | + const [colorScheme, setColorScheme] = (0, react.useState)(() => getV1ColorScheme()); | |
| 197 | + (0, react.useEffect)(() => { | |
| 198 | + return (0, _elementor_editor_v1_adapters.__privateListenTo)((0, _elementor_editor_v1_adapters.v1ReadyEvent)(), () => setColorScheme(getV1ColorScheme())); | |
| 199 | + }, []); | |
| 200 | + (0, react.useEffect)(() => { | |
| 201 | + return (0, _elementor_editor_v1_adapters.__privateListenTo)((0, _elementor_editor_v1_adapters.commandEndEvent)("document/elements/settings"), (e) => { | |
| 202 | + const event = e; | |
| 203 | + if (event.args?.settings && "ui_theme" in event.args.settings) setColorScheme(getV1ColorScheme()); | |
| 204 | + }); | |
| 205 | + }, []); | |
| 206 | + return colorScheme; | |
| 207 | + } | |
| 208 | + function getV1ColorScheme() { | |
| 209 | + return window.elementor?.getPreferences?.("ui_theme") || "auto"; | |
| 210 | + } | |
| 1445 | 211 | |
| 1446 | -__webpack_require__.r(__webpack_exports__); | |
| 1447 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1448 | -/* harmony export */ EllipsisWithTooltip: function() { return /* binding */ EllipsisWithTooltip; } | |
| 1449 | -/* harmony export */ }); | |
| 1450 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1451 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1452 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1453 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1454 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 212 | +//#endregion | |
| 213 | +//#region packages/packages/libs/editor-ui/src/components/theme-provider.tsx | |
| 214 | + var EDITOR_PALETTE = "unstable"; | |
| 215 | + function ThemeProvider({ children }) { | |
| 216 | + const colorScheme = useColorScheme(); | |
| 217 | + return /* @__PURE__ */ react.createElement(_elementor_ui.ThemeProvider, { | |
| 218 | + colorScheme, | |
| 219 | + palette: EDITOR_PALETTE | |
| 220 | + }, children); | |
| 221 | + } | |
| 1455 | 222 | |
| 223 | +//#endregion | |
| 224 | +//#region packages/packages/libs/editor-ui/src/components/info-alert.tsx | |
| 225 | + var InfoAlert = (props) => /* @__PURE__ */ react.createElement(_elementor_ui.Alert, { | |
| 226 | + icon: /* @__PURE__ */ react.createElement(_elementor_icons.InfoCircleFilledIcon, { | |
| 227 | + fontSize: "small", | |
| 228 | + color: "secondary" | |
| 229 | + }), | |
| 230 | + variant: "standard", | |
| 231 | + color: "secondary", | |
| 232 | + elevation: 0, | |
| 233 | + size: "small", | |
| 234 | + ...props | |
| 235 | + }); | |
| 1456 | 236 | |
| 237 | +//#endregion | |
| 238 | +//#region packages/packages/libs/editor-ui/src/components/menu-item.tsx | |
| 239 | + var MenuListItem = ({ children, menuItemTextProps, primaryTypographyProps = { variant: "caption" }, ...props }) => { | |
| 240 | + return /* @__PURE__ */ react.createElement(_elementor_ui.MenuItem, { | |
| 241 | + dense: true, | |
| 242 | + ...props, | |
| 243 | + sx: { ...props.sx ?? {} } | |
| 244 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.MenuItemText, { | |
| 245 | + primary: children, | |
| 246 | + primaryTypographyProps, | |
| 247 | + ...menuItemTextProps | |
| 248 | + })); | |
| 249 | + }; | |
| 250 | + var MenuItemInfotip = (0, react.forwardRef)(({ showInfoTip = false, children, content }, ref) => { | |
| 251 | + if (!showInfoTip) return /* @__PURE__ */ react.createElement(react.Fragment, null, children); | |
| 252 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, { | |
| 253 | + ref, | |
| 254 | + placement: "right", | |
| 255 | + arrow: false, | |
| 256 | + content: /* @__PURE__ */ react.createElement(InfoAlert, { sx: { maxWidth: 325 } }, content) | |
| 257 | + }, /* @__PURE__ */ react.createElement("div", { | |
| 258 | + style: { | |
| 259 | + pointerEvents: "initial", | |
| 260 | + width: "100%" | |
| 261 | + }, | |
| 262 | + onClick: (e) => e.stopPropagation() | |
| 263 | + }, children)); | |
| 264 | + }); | |
| 1457 | 265 | |
| 1458 | -const EllipsisWithTooltip = ({ | |
| 1459 | - maxWidth, | |
| 1460 | - title, | |
| 1461 | - as, | |
| 1462 | - ...props | |
| 1463 | -}) => { | |
| 1464 | - const [setRef, isOverflowing] = useIsOverflowing(); | |
| 1465 | - if (isOverflowing) { | |
| 1466 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Tooltip, { | |
| 1467 | - title: title, | |
| 1468 | - placement: "top" | |
| 1469 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Content, _extends({ | |
| 1470 | - maxWidth: maxWidth, | |
| 1471 | - ref: setRef, | |
| 1472 | - as: as | |
| 1473 | - }, props), title)); | |
| 1474 | - } | |
| 1475 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Content, _extends({ | |
| 1476 | - maxWidth: maxWidth, | |
| 1477 | - ref: setRef, | |
| 1478 | - as: as | |
| 1479 | - }, props), title); | |
| 1480 | -}; | |
| 1481 | -const Content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(({ | |
| 1482 | - maxWidth, | |
| 1483 | - as: Component = _elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Box, | |
| 1484 | - ...props | |
| 1485 | -}, ref) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, _extends({ | |
| 1486 | - ref: ref, | |
| 1487 | - position: "relative" | |
| 1488 | -}, props, { | |
| 1489 | - style: { | |
| 1490 | - overflow: 'hidden', | |
| 1491 | - textOverflow: 'ellipsis', | |
| 1492 | - whiteSpace: 'nowrap', | |
| 1493 | - maxWidth | |
| 1494 | - } | |
| 1495 | -}))); | |
| 1496 | -const useIsOverflowing = () => { | |
| 1497 | - const [el, setEl] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); | |
| 1498 | - const [isOverflowing, setIsOverflown] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); | |
| 1499 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 1500 | - const observer = new ResizeObserver(([{ | |
| 1501 | - target | |
| 1502 | - }]) => { | |
| 1503 | - setIsOverflown(target.scrollWidth > target.clientWidth); | |
| 1504 | - }); | |
| 1505 | - if (el) { | |
| 1506 | - observer.observe(el); | |
| 1507 | - } | |
| 1508 | - return () => { | |
| 1509 | - observer.disconnect(); | |
| 1510 | - }; | |
| 1511 | - }, [el]); | |
| 1512 | - return [setEl, isOverflowing]; | |
| 1513 | -}; | |
| 266 | +//#endregion | |
| 267 | +//#region packages/packages/libs/editor-ui/src/components/infotip-card.tsx | |
| 268 | + var InfoTipCard = ({ content, svgIcon, learnMoreButton, ctaButton }) => { | |
| 269 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Card, { | |
| 270 | + elevation: 0, | |
| 271 | + sx: { width: 320 } | |
| 272 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.CardContent, { sx: { pb: 0 } }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { | |
| 273 | + display: "flex", | |
| 274 | + alignItems: "start" | |
| 275 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.SvgIcon, { | |
| 276 | + fontSize: "tiny", | |
| 277 | + sx: { mr: .5 } | |
| 278 | + }, svgIcon), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { variant: "body2" }, content, learnMoreButton && /* @__PURE__ */ react.createElement(react.Fragment, null, "\xA0", /* @__PURE__ */ react.createElement(_elementor_ui.Link, { | |
| 279 | + color: "info.main", | |
| 280 | + href: learnMoreButton.href, | |
| 281 | + target: "_blank" | |
| 282 | + }, learnMoreButton.label))))), ctaButton && /* @__PURE__ */ react.createElement(_elementor_ui.CardActions, { sx: { justifyContent: "flex-start" } }, /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 283 | + size: "small", | |
| 284 | + color: "secondary", | |
| 285 | + variant: "contained", | |
| 286 | + onClick: ctaButton.onClick, | |
| 287 | + sx: { marginInlineStart: "1rem" } | |
| 288 | + }, ctaButton.label))); | |
| 289 | + }; | |
| 1514 | 290 | |
| 1515 | -/***/ }), | |
| 291 | +//#endregion | |
| 292 | +//#region packages/packages/libs/editor-ui/src/components/warning-infotip.tsx | |
| 293 | + var WarningInfotip = (0, react.forwardRef)(({ children, open, title, text, placement, width, offset, hasError = true }, ref) => { | |
| 294 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, { | |
| 295 | + ref, | |
| 296 | + open, | |
| 297 | + placement, | |
| 298 | + PopperProps: { | |
| 299 | + sx: { | |
| 300 | + width: width ? width : "initial", | |
| 301 | + ".MuiTooltip-tooltip": { | |
| 302 | + marginLeft: 0, | |
| 303 | + marginRight: 0 | |
| 304 | + } | |
| 305 | + }, | |
| 306 | + modifiers: offset ? [{ | |
| 307 | + name: "offset", | |
| 308 | + options: { offset } | |
| 309 | + }] : [] | |
| 310 | + }, | |
| 311 | + arrow: false, | |
| 312 | + content: /* @__PURE__ */ react.createElement(_elementor_ui.Alert, { | |
| 313 | + color: hasError ? "error" : "secondary", | |
| 314 | + severity: "warning", | |
| 315 | + variant: "standard", | |
| 316 | + size: "small" | |
| 317 | + }, title ? /* @__PURE__ */ react.createElement(_elementor_ui.AlertTitle, null, title) : null, text) | |
| 318 | + }, children); | |
| 319 | + }); | |
| 1516 | 320 | |
| 1517 | -/***/ "./packages/packages/libs/editor-ui/src/components/file-upload/file-upload-dropzone.tsx": | |
| 1518 | -/*!**********************************************************************************************!*\ | |
| 1519 | - !*** ./packages/packages/libs/editor-ui/src/components/file-upload/file-upload-dropzone.tsx ***! | |
| 1520 | - \**********************************************************************************************/ | |
| 1521 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 321 | +//#endregion | |
| 322 | +//#region packages/packages/libs/editor-ui/src/components/global-dialog/subscribers.ts | |
| 323 | + var currentDialogState = null; | |
| 324 | + var stateSubscribers = /* @__PURE__ */ new Set(); | |
| 325 | + var subscribeToDialogState = (callback) => { | |
| 326 | + stateSubscribers.add(callback); | |
| 327 | + callback(currentDialogState); | |
| 328 | + return () => stateSubscribers.delete(callback); | |
| 329 | + }; | |
| 330 | + var notifySubscribers = () => { | |
| 331 | + stateSubscribers.forEach((callback) => callback(currentDialogState)); | |
| 332 | + }; | |
| 333 | + var openDialog = ({ component }) => { | |
| 334 | + currentDialogState = { component }; | |
| 335 | + notifySubscribers(); | |
| 336 | + }; | |
| 337 | + var closeDialog = () => { | |
| 338 | + currentDialogState = null; | |
| 339 | + notifySubscribers(); | |
| 340 | + }; | |
| 1522 | 341 | |
| 1523 | -__webpack_require__.r(__webpack_exports__); | |
| 1524 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1525 | -/* harmony export */ FileUploadDropzone: function() { return /* binding */ FileUploadDropzone; } | |
| 1526 | -/* harmony export */ }); | |
| 1527 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1528 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1529 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1530 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 1531 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1532 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 1533 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1534 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); | |
| 342 | +//#endregion | |
| 343 | +//#region packages/packages/libs/editor-ui/src/components/global-dialog/components/global-dialog.tsx | |
| 344 | + var GlobalDialog = () => { | |
| 345 | + const [content, setContent] = (0, react.useState)(null); | |
| 346 | + (0, react.useEffect)(() => { | |
| 347 | + const unsubscribe = subscribeToDialogState(setContent); | |
| 348 | + return () => { | |
| 349 | + unsubscribe(); | |
| 350 | + }; | |
| 351 | + }, []); | |
| 352 | + if (!content) return null; | |
| 353 | + return /* @__PURE__ */ react.createElement(ThemeProvider, null, /* @__PURE__ */ react.createElement(_elementor_ui.Dialog, { | |
| 354 | + role: "dialog", | |
| 355 | + open: true, | |
| 356 | + onClose: closeDialog, | |
| 357 | + maxWidth: "sm", | |
| 358 | + fullWidth: true | |
| 359 | + }, content.component)); | |
| 360 | + }; | |
| 1535 | 361 | |
| 362 | +//#endregion | |
| 363 | +//#region packages/packages/libs/editor-ui/src/components/search-field.tsx | |
| 364 | + var SIZE$2 = "tiny"; | |
| 365 | + var SearchField = ({ value, onSearch, placeholder, id, sx }) => { | |
| 366 | + const inputRef = (0, react.useRef)(null); | |
| 367 | + const handleClear = () => { | |
| 368 | + onSearch(""); | |
| 369 | + inputRef.current?.focus(); | |
| 370 | + }; | |
| 371 | + const handleInputChange = (event) => { | |
| 372 | + onSearch(event.target.value); | |
| 373 | + }; | |
| 374 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { | |
| 375 | + px: 2, | |
| 376 | + pb: 1.5, | |
| 377 | + ...sx | |
| 378 | + } }, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, { | |
| 379 | + autoFocus: true, | |
| 380 | + fullWidth: true, | |
| 381 | + id, | |
| 382 | + size: SIZE$2, | |
| 383 | + value, | |
| 384 | + inputRef, | |
| 385 | + onChange: handleInputChange, | |
| 386 | + placeholder, | |
| 387 | + InputProps: { | |
| 388 | + startAdornment: /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "start" }, /* @__PURE__ */ react.createElement(_elementor_icons.SearchIcon, { fontSize: SIZE$2 })), | |
| 389 | + endAdornment: value && /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, { | |
| 390 | + size: SIZE$2, | |
| 391 | + onClick: handleClear, | |
| 392 | + "aria-label": (0, _wordpress_i18n.__)("Clear", "elementor") | |
| 393 | + }, /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, { | |
| 394 | + color: "action", | |
| 395 | + fontSize: SIZE$2 | |
| 396 | + })) | |
| 397 | + } | |
| 398 | + })); | |
| 399 | + }; | |
| 1536 | 400 | |
| 401 | +//#endregion | |
| 402 | +//#region packages/packages/libs/editor-ui/src/components/form.tsx | |
| 403 | + var Form = ({ children, onSubmit, "data-testid": dataTestId }) => { | |
| 404 | + const formRef = (0, react.useRef)(null); | |
| 405 | + const handleSubmit = (e) => { | |
| 406 | + e.preventDefault(); | |
| 407 | + onSubmit?.(); | |
| 408 | + }; | |
| 409 | + const handleKeyDown = (e) => { | |
| 410 | + const { target } = e; | |
| 411 | + if (e.key === "Enter" && target instanceof HTMLInputElement && target.type !== "submit") { | |
| 412 | + e.preventDefault(); | |
| 413 | + formRef.current?.requestSubmit(); | |
| 414 | + } | |
| 415 | + }; | |
| 416 | + return /* @__PURE__ */ react.createElement("form", { | |
| 417 | + onSubmit: handleSubmit, | |
| 418 | + ref: formRef, | |
| 419 | + onKeyDown: handleKeyDown, | |
| 420 | + ...dataTestId ? { "data-testid": dataTestId } : {} | |
| 421 | + }, children); | |
| 422 | + }; | |
| 1537 | 423 | |
| 424 | +//#endregion | |
| 425 | +//#region packages/packages/libs/editor-ui/src/components/cta-button.tsx | |
| 426 | + var CtaButton = ({ href, children, showIcon = true, ...props }) => /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 427 | + variant: "contained", | |
| 428 | + color: "promotion", | |
| 429 | + href, | |
| 430 | + target: "_blank", | |
| 431 | + startIcon: showIcon ? /* @__PURE__ */ react.createElement(_elementor_icons.CrownFilledIcon, null) : void 0, | |
| 432 | + ...props | |
| 433 | + }, children ?? (0, _wordpress_i18n.__)("Upgrade Now", "elementor")); | |
| 1538 | 434 | |
| 435 | +//#endregion | |
| 436 | +//#region packages/packages/libs/editor-ui/src/hooks/use-scroll-to-selected.ts | |
| 437 | + var useScrollToSelected = ({ selectedValue, items, virtualizer }) => { | |
| 438 | + (0, react.useEffect)(() => { | |
| 439 | + if (!selectedValue || items.length === 0) return; | |
| 440 | + const selectedIndex = items.findIndex((item) => item.value === selectedValue); | |
| 441 | + if (selectedIndex !== -1) virtualizer.scrollToIndex(selectedIndex, { align: "center" }); | |
| 442 | + }, [ | |
| 443 | + selectedValue, | |
| 444 | + items, | |
| 445 | + virtualizer | |
| 446 | + ]); | |
| 447 | + }; | |
| 1539 | 448 | |
| 1540 | -const cardSx = { | |
| 1541 | - minHeight: 152, | |
| 1542 | - border: '2px dashed', | |
| 1543 | - borderColor: 'divider', | |
| 1544 | - borderRadius: 1 | |
| 1545 | -}; | |
| 1546 | -const FileUploadDropzone = ({ | |
| 1547 | - onFileSelected, | |
| 1548 | - allowedFileTypes, | |
| 1549 | - accept, | |
| 1550 | - regionLabel, | |
| 1551 | - primaryLabel, | |
| 1552 | - secondaryLabel, | |
| 1553 | - helperText | |
| 1554 | -}) => { | |
| 1555 | - const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); | |
| 1556 | - const { | |
| 1557 | - getDropZoneProps | |
| 1558 | - } = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.useUnstableDropZone)({ | |
| 1559 | - allowedFileTypes, | |
| 1560 | - onChange: ({ | |
| 1561 | - valid | |
| 1562 | - }) => { | |
| 1563 | - if (valid[0]) { | |
| 1564 | - onFileSelected(valid[0]); | |
| 1565 | - } | |
| 1566 | - } | |
| 1567 | - }); | |
| 1568 | - const dropZoneProps = getDropZoneProps(); | |
| 1569 | - const handleBrowseClick = () => fileInputRef.current?.click(); | |
| 1570 | - const handleFileInputChange = event => { | |
| 1571 | - const file = event.target.files?.[0]; | |
| 1572 | - if (file) { | |
| 1573 | - onFileSelected(file); | |
| 1574 | - } | |
| 1575 | - event.target.value = ''; | |
| 1576 | - }; | |
| 1577 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Card, { | |
| 1578 | - variant: "outlined", | |
| 1579 | - role: "region", | |
| 1580 | - "aria-label": regionLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('File dropzone', 'elementor'), | |
| 1581 | - onDrop: dropZoneProps.onDrop, | |
| 1582 | - onDragEnter: dropZoneProps.onDragEnter, | |
| 1583 | - onDragLeave: dropZoneProps.onDragLeave, | |
| 1584 | - onDragOver: dropZoneProps.onDragOver, | |
| 1585 | - sx: cardSx | |
| 1586 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Stack, { | |
| 1587 | - alignItems: "center", | |
| 1588 | - spacing: 1, | |
| 1589 | - padding: 3 | |
| 1590 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.UploadIcon, { | |
| 1591 | - fontSize: "medium" | |
| 1592 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Stack, { | |
| 1593 | - direction: "row", | |
| 1594 | - spacing: 0.5, | |
| 1595 | - alignItems: "center" | |
| 1596 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Link, { | |
| 1597 | - component: "button", | |
| 1598 | - type: "button", | |
| 1599 | - underline: "always", | |
| 1600 | - onClick: handleBrowseClick | |
| 1601 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 1602 | - variant: "body1", | |
| 1603 | - component: "span" | |
| 1604 | - }, primaryLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Upload file', 'elementor'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 1605 | - variant: "body1" | |
| 1606 | - }, secondaryLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('or drag and drop', 'elementor'))), helperText ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 1607 | - variant: "caption", | |
| 1608 | - color: "text.secondary" | |
| 1609 | - }, helperText) : null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { | |
| 1610 | - ref: fileInputRef, | |
| 1611 | - type: "file", | |
| 1612 | - accept: accept, | |
| 1613 | - hidden: true, | |
| 1614 | - onChange: handleFileInputChange | |
| 1615 | - })); | |
| 1616 | -}; | |
| 449 | +//#endregion | |
| 450 | +//#region packages/packages/libs/editor-ui/src/hooks/use-scroll-top.ts | |
| 451 | + var useScrollTop = ({ containerRef }) => { | |
| 452 | + const [scrollTop, setScrollTop] = (0, react.useState)(0); | |
| 453 | + (0, react.useEffect)(() => { | |
| 454 | + const container = containerRef.current; | |
| 455 | + if (!container) return; | |
| 456 | + const handleScroll = () => { | |
| 457 | + setScrollTop(container.scrollTop); | |
| 458 | + }; | |
| 459 | + container.addEventListener("scroll", handleScroll); | |
| 460 | + return () => container.removeEventListener("scroll", handleScroll); | |
| 461 | + }, [containerRef]); | |
| 462 | + return scrollTop; | |
| 463 | + }; | |
| 1617 | 464 | |
| 1618 | -/***/ }), | |
| 465 | +//#endregion | |
| 466 | +//#region packages/packages/libs/editor-ui/src/hooks/use-text-field-auto-select.ts | |
| 467 | + var useTextFieldAutoSelect = () => { | |
| 468 | + const inputRef = (0, react.useRef)(null); | |
| 469 | + (0, react.useEffect)(() => { | |
| 470 | + if (inputRef.current) { | |
| 471 | + inputRef.current.focus(); | |
| 472 | + inputRef.current.select(); | |
| 473 | + } | |
| 474 | + }, []); | |
| 475 | + return inputRef; | |
| 476 | + }; | |
| 1619 | 477 | |
| 1620 | -/***/ "./packages/packages/libs/editor-ui/src/components/file-upload/file-upload-row.tsx": | |
| 1621 | -/*!*****************************************************************************************!*\ | |
| 1622 | - !*** ./packages/packages/libs/editor-ui/src/components/file-upload/file-upload-row.tsx ***! | |
| 1623 | - \*****************************************************************************************/ | |
| 1624 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 478 | +//#endregion | |
| 479 | +//#region packages/packages/libs/editor-ui/src/hooks/use-canvas-click-handler.tsx | |
| 480 | + var useCanvasClickHandler = (isActive, onClickAway) => { | |
| 481 | + (0, react.useEffect)(() => { | |
| 482 | + const canvasDocument = isActive ? (0, _elementor_editor_v1_adapters.getCanvasIframeDocument)() : null; | |
| 483 | + if (!canvasDocument) return; | |
| 484 | + canvasDocument.addEventListener("mousedown", onClickAway); | |
| 485 | + return () => canvasDocument.removeEventListener("mousedown", onClickAway); | |
| 486 | + }, [isActive, onClickAway]); | |
| 487 | + }; | |
| 1625 | 488 | |
| 1626 | -__webpack_require__.r(__webpack_exports__); | |
| 1627 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1628 | -/* harmony export */ FileUploadRow: function() { return /* binding */ FileUploadRow; } | |
| 1629 | -/* harmony export */ }); | |
| 1630 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1631 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1632 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1633 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 1634 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1635 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 1636 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1637 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); | |
| 489 | +//#endregion | |
| 490 | +//#region packages/packages/libs/editor-ui/src/components/promotions/promotion-infotip.tsx | |
| 491 | + var PromotionInfotip = ({ children, open, onClose, onCtaClick, ...cardProps }) => { | |
| 492 | + useCanvasClickHandler(!!open, onClose); | |
| 493 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, { | |
| 494 | + placement: "right", | |
| 495 | + content: /* @__PURE__ */ react.createElement(InfotipCard, { | |
| 496 | + onClose, | |
| 497 | + onCtaClick, | |
| 498 | + ...cardProps | |
| 499 | + }), | |
| 500 | + open | |
| 501 | + }, children); | |
| 502 | + }; | |
| 503 | + function InfotipCard({ title, content, assetUrl, ctaUrl, onClose, onCtaClick }) { | |
| 504 | + return /* @__PURE__ */ react.createElement(_elementor_ui.ClickAwayListener, { | |
| 505 | + disableReactTree: true, | |
| 506 | + mouseEvent: "onMouseDown", | |
| 507 | + touchEvent: "onTouchStart", | |
| 508 | + onClickAway: onClose | |
| 509 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Card, { | |
| 510 | + elevation: 0, | |
| 511 | + sx: { maxWidth: 296 } | |
| 512 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.CardHeader, { | |
| 513 | + title, | |
| 514 | + action: /* @__PURE__ */ react.createElement(_elementor_ui.CloseButton, { | |
| 515 | + slotProps: { icon: { fontSize: "tiny" } }, | |
| 516 | + onClick: onClose | |
| 517 | + }) | |
| 518 | + }), /* @__PURE__ */ react.createElement(_elementor_ui.CardMedia, { | |
| 519 | + component: "img", | |
| 520 | + image: assetUrl, | |
| 521 | + alt: "", | |
| 522 | + sx: { | |
| 523 | + width: "100%", | |
| 524 | + aspectRatio: "16 / 9" | |
| 525 | + } | |
| 526 | + }), /* @__PURE__ */ react.createElement(_elementor_ui.CardContent, null, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 527 | + variant: "body2", | |
| 528 | + color: "text.secondary" | |
| 529 | + }, content)), /* @__PURE__ */ react.createElement(_elementor_ui.CardActions, { sx: { justifyContent: "flex-start" } }, /* @__PURE__ */ react.createElement(CtaButton, { | |
| 530 | + href: ctaUrl, | |
| 531 | + onClick: onCtaClick | |
| 532 | + })))); | |
| 533 | + } | |
| 1638 | 534 | |
| 535 | +//#endregion | |
| 536 | +//#region packages/packages/libs/editor-ui/src/components/promotions/promotion-popover.tsx | |
| 537 | + var PromotionPopover = ({ children, open, placement = "right", slotProps, anchorRef, ...cardProps }) => { | |
| 538 | + const anchorEl = anchorRef?.current; | |
| 539 | + const defaultSlotProps = { popper: { | |
| 540 | + ...anchorEl && { anchorEl }, | |
| 541 | + modifiers: [{ | |
| 542 | + name: "offset", | |
| 543 | + options: { offset: anchorRef ? [0, 4] : [0, 10] } | |
| 544 | + }] | |
| 545 | + } }; | |
| 546 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, { | |
| 547 | + placement, | |
| 548 | + arrow: false, | |
| 549 | + content: /* @__PURE__ */ react.createElement(PopoverAlert, { ...cardProps }), | |
| 550 | + open, | |
| 551 | + slotProps: slotProps || defaultSlotProps | |
| 552 | + }, children); | |
| 553 | + }; | |
| 554 | + function PopoverAlert({ title, content, ctaUrl, ctaText, onClose, onCtaClick }) { | |
| 555 | + return /* @__PURE__ */ react.createElement(_elementor_ui.ClickAwayListener, { | |
| 556 | + disableReactTree: true, | |
| 557 | + mouseEvent: "onMouseDown", | |
| 558 | + touchEvent: "onTouchStart", | |
| 559 | + onClickAway: onClose | |
| 560 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Alert, { | |
| 561 | + variant: "standard", | |
| 562 | + color: "promotion", | |
| 563 | + icon: /* @__PURE__ */ react.createElement(_elementor_icons.CrownFilledIcon, { fontSize: "tiny" }), | |
| 564 | + onClose, | |
| 565 | + onMouseDown: (e) => e.stopPropagation(), | |
| 566 | + role: "dialog", | |
| 567 | + "aria-label": "promotion-popover-title", | |
| 568 | + action: /* @__PURE__ */ react.createElement(_elementor_ui.AlertAction, { | |
| 569 | + variant: "contained", | |
| 570 | + color: "promotion", | |
| 571 | + href: ctaUrl, | |
| 572 | + target: "_blank", | |
| 573 | + rel: "noopener noreferrer", | |
| 574 | + onClick: onCtaClick | |
| 575 | + }, ctaText), | |
| 576 | + sx: { maxWidth: 296 } | |
| 577 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { | |
| 578 | + gap: .5, | |
| 579 | + display: "flex", | |
| 580 | + flexDirection: "column" | |
| 581 | + } }, /* @__PURE__ */ react.createElement(_elementor_ui.AlertTitle, null, title), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { variant: "body2" }, content)))); | |
| 582 | + } | |
| 1639 | 583 | |
| 584 | +//#endregion | |
| 585 | +//#region packages/packages/libs/editor-ui/src/components/promotions/promotion-chip.tsx | |
| 586 | + var PromotionChip = react.forwardRef(({ ...props }, ref) => { | |
| 587 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Chip, { | |
| 588 | + "aria-label": "Promotion chip", | |
| 589 | + ref, | |
| 590 | + size: "tiny", | |
| 591 | + color: "promotion", | |
| 592 | + variant: "standard", | |
| 593 | + icon: /* @__PURE__ */ react.createElement(_elementor_icons.CrownFilledIcon, null), | |
| 594 | + sx: { | |
| 595 | + ml: 1, | |
| 596 | + width: "20px", | |
| 597 | + "& .MuiChip-label": { display: "none" } | |
| 598 | + }, | |
| 599 | + ...props | |
| 600 | + }); | |
| 601 | + }); | |
| 1640 | 602 | |
| 603 | +//#endregion | |
| 604 | +//#region packages/packages/libs/editor-ui/src/components/promotions/promotion-alert.tsx | |
| 605 | + var PromotionAlert = ({ message, upgradeUrl, onCtaClick }) => /* @__PURE__ */ react.createElement(_elementor_ui.Alert, { | |
| 606 | + variant: "standard", | |
| 607 | + color: "promotion", | |
| 608 | + icon: false, | |
| 609 | + role: "dialog", | |
| 610 | + "aria-label": "promotion-alert", | |
| 611 | + size: "small", | |
| 612 | + sx: { | |
| 613 | + m: 2, | |
| 614 | + mt: 1, | |
| 615 | + pt: .5, | |
| 616 | + pb: .5 | |
| 617 | + } | |
| 618 | + }, message, /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 619 | + size: "tiny", | |
| 620 | + variant: "text", | |
| 621 | + color: "promotion", | |
| 622 | + target: "_blank", | |
| 623 | + href: upgradeUrl, | |
| 624 | + rel: "noopener noreferrer", | |
| 625 | + startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.CrownFilledIcon, { fontSize: "tiny" }), | |
| 626 | + onClick: onCtaClick | |
| 627 | + }, (0, _wordpress_i18n.__)("Upgrade now", "elementor"))); | |
| 1641 | 628 | |
| 1642 | -const BYTES_PER_KILOBYTE = 1024; | |
| 1643 | -const cardSx = { | |
| 1644 | - minHeight: 152, | |
| 1645 | - border: '2px dashed', | |
| 1646 | - borderColor: 'divider', | |
| 1647 | - borderRadius: 1 | |
| 1648 | -}; | |
| 1649 | -const formatFileSize = sizeInBytes => { | |
| 1650 | - const kilobytes = Math.max(1, Math.round(sizeInBytes / BYTES_PER_KILOBYTE)); | |
| 1651 | - return `${kilobytes}kb`; | |
| 1652 | -}; | |
| 1653 | -const FileUploadRow = ({ | |
| 1654 | - file, | |
| 1655 | - onRemove, | |
| 1656 | - statusLabel | |
| 1657 | -}) => { | |
| 1658 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Card, { | |
| 1659 | - variant: "outlined", | |
| 1660 | - sx: cardSx | |
| 1661 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Stack, { | |
| 1662 | - direction: "row", | |
| 1663 | - alignItems: "center", | |
| 1664 | - justifyContent: "space-between", | |
| 1665 | - padding: 2, | |
| 1666 | - spacing: 2, | |
| 1667 | - minHeight: 152 | |
| 1668 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Stack, { | |
| 1669 | - direction: "column", | |
| 1670 | - spacing: 0.5, | |
| 1671 | - minWidth: 0, | |
| 1672 | - flex: 1 | |
| 1673 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 1674 | - variant: "subtitle2", | |
| 1675 | - noWrap: true | |
| 1676 | - }, file.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 1677 | - variant: "caption", | |
| 1678 | - color: "text.secondary", | |
| 1679 | - noWrap: true | |
| 1680 | - }, formatFileSize(file.size), " \xB7 ", statusLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Complete', 'elementor'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.IconButton, { | |
| 1681 | - size: "small", | |
| 1682 | - onClick: onRemove, | |
| 1683 | - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Remove file', 'elementor') | |
| 1684 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.XIcon, { | |
| 1685 | - fontSize: "inherit" | |
| 1686 | - })))); | |
| 1687 | -}; | |
| 1688 | - | |
| 1689 | -/***/ }), | |
| 1690 | - | |
| 1691 | -/***/ "./packages/packages/libs/editor-ui/src/components/file-upload/index.ts": | |
| 1692 | -/*!******************************************************************************!*\ | |
| 1693 | - !*** ./packages/packages/libs/editor-ui/src/components/file-upload/index.ts ***! | |
| 1694 | - \******************************************************************************/ | |
| 1695 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1696 | - | |
| 1697 | -__webpack_require__.r(__webpack_exports__); | |
| 1698 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1699 | -/* harmony export */ FileUploadDropzone: function() { return /* reexport safe */ _file_upload_dropzone__WEBPACK_IMPORTED_MODULE_0__.FileUploadDropzone; }, | |
| 1700 | -/* harmony export */ FileUploadRow: function() { return /* reexport safe */ _file_upload_row__WEBPACK_IMPORTED_MODULE_1__.FileUploadRow; } | |
| 1701 | -/* harmony export */ }); | |
| 1702 | -/* harmony import */ var _file_upload_dropzone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./file-upload-dropzone */ "./packages/packages/libs/editor-ui/src/components/file-upload/file-upload-dropzone.tsx"); | |
| 1703 | -/* harmony import */ var _file_upload_row__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./file-upload-row */ "./packages/packages/libs/editor-ui/src/components/file-upload/file-upload-row.tsx"); | |
| 1704 | - | |
| 1705 | - | |
| 1706 | - | |
| 1707 | -/***/ }), | |
| 1708 | - | |
| 1709 | -/***/ "./packages/packages/libs/editor-ui/src/components/floating-bar.tsx": | |
| 1710 | -/*!**************************************************************************!*\ | |
| 1711 | - !*** ./packages/packages/libs/editor-ui/src/components/floating-bar.tsx ***! | |
| 1712 | - \**************************************************************************/ | |
| 1713 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1714 | - | |
| 1715 | -__webpack_require__.r(__webpack_exports__); | |
| 1716 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1717 | -/* harmony export */ FloatingActionsBar: function() { return /* binding */ FloatingActionsBar; }, | |
| 1718 | -/* harmony export */ useFloatingActionsBar: function() { return /* binding */ useFloatingActionsBar; } | |
| 1719 | -/* harmony export */ }); | |
| 1720 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1721 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1722 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1723 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1724 | - | |
| 1725 | - | |
| 1726 | - | |
| 1727 | - | |
| 1728 | -// CSS hack to hide empty floating bars. | |
| 1729 | -const FloatingBarContainer = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.styled)('span')` | |
| 629 | +//#endregion | |
| 630 | +//#region packages/packages/libs/editor-ui/src/components/floating-bar.tsx | |
| 631 | + var FloatingBarContainer = (0, _elementor_ui.styled)("span")` | |
| 1730 | 632 | display: contents; |
| 1731 | 633 | |
| 1732 | 634 | .MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) { |
| 1733 | 635 | display: none; |
| @@ -1736,2005 +638,1464 @@ | ||
| 1736 | 638 | .MuiFloatingActionBar-popper { |
| 1737 | 639 | z-index: 1000; |
| 1738 | 640 | } |
| 1739 | 641 | `; |
| 1740 | -const FloatingActionsContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); | |
| 1741 | -function FloatingActionsBar({ | |
| 1742 | - actions, | |
| 1743 | - children | |
| 1744 | -}) { | |
| 1745 | - const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); | |
| 1746 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(FloatingActionsContext.Provider, { | |
| 1747 | - value: { | |
| 1748 | - open, | |
| 1749 | - setOpen | |
| 1750 | - } | |
| 1751 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(FloatingBarContainer, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.UnstableFloatingActionBar, { | |
| 1752 | - actions: actions, | |
| 1753 | - open: open || undefined | |
| 1754 | - }, children))); | |
| 1755 | -} | |
| 1756 | -function useFloatingActionsBar() { | |
| 1757 | - const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(FloatingActionsContext); | |
| 1758 | - if (!context) { | |
| 1759 | - throw new Error('useFloatingActions must be used within a FloatingActionsBar'); | |
| 1760 | - } | |
| 1761 | - return context; | |
| 1762 | -} | |
| 642 | + var FloatingActionsContext = (0, react.createContext)(null); | |
| 643 | + function FloatingActionsBar({ actions, children }) { | |
| 644 | + const [open, setOpen] = (0, react.useState)(false); | |
| 645 | + return /* @__PURE__ */ react.createElement(FloatingActionsContext.Provider, { value: { | |
| 646 | + open, | |
| 647 | + setOpen | |
| 648 | + } }, /* @__PURE__ */ react.createElement(FloatingBarContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.UnstableFloatingActionBar, { | |
| 649 | + actions, | |
| 650 | + open: open || void 0 | |
| 651 | + }, children))); | |
| 652 | + } | |
| 653 | + function useFloatingActionsBar() { | |
| 654 | + const context = (0, react.useContext)(FloatingActionsContext); | |
| 655 | + if (!context) throw new Error("useFloatingActions must be used within a FloatingActionsBar"); | |
| 656 | + return context; | |
| 657 | + } | |
| 1763 | 658 | |
| 1764 | -/***/ }), | |
| 659 | +//#endregion | |
| 660 | +//#region packages/packages/libs/editor-ui/src/components/file-upload/file-upload-dropzone.tsx | |
| 661 | + var cardSx$1 = { | |
| 662 | + minHeight: 152, | |
| 663 | + border: "2px dashed", | |
| 664 | + borderColor: "divider", | |
| 665 | + borderRadius: 1 | |
| 666 | + }; | |
| 667 | + var FileUploadDropzone = ({ onFileSelected, allowedFileTypes, accept, regionLabel, primaryLabel, secondaryLabel, helperText }) => { | |
| 668 | + const fileInputRef = (0, react.useRef)(null); | |
| 669 | + const { getDropZoneProps } = (0, _elementor_ui.useUnstableDropZone)({ | |
| 670 | + allowedFileTypes, | |
| 671 | + onChange: ({ valid }) => { | |
| 672 | + if (valid[0]) onFileSelected(valid[0]); | |
| 673 | + } | |
| 674 | + }); | |
| 675 | + const dropZoneProps = getDropZoneProps(); | |
| 676 | + const handleBrowseClick = () => fileInputRef.current?.click(); | |
| 677 | + const handleFileInputChange = (event) => { | |
| 678 | + const file = event.target.files?.[0]; | |
| 679 | + if (file) onFileSelected(file); | |
| 680 | + event.target.value = ""; | |
| 681 | + }; | |
| 682 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Card, { | |
| 683 | + variant: "outlined", | |
| 684 | + role: "region", | |
| 685 | + "aria-label": regionLabel ?? (0, _wordpress_i18n.__)("File dropzone", "elementor"), | |
| 686 | + onDrop: dropZoneProps.onDrop, | |
| 687 | + onDragEnter: dropZoneProps.onDragEnter, | |
| 688 | + onDragLeave: dropZoneProps.onDragLeave, | |
| 689 | + onDragOver: dropZoneProps.onDragOver, | |
| 690 | + sx: cardSx$1 | |
| 691 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 692 | + alignItems: "center", | |
| 693 | + spacing: 1, | |
| 694 | + padding: 3 | |
| 695 | + }, /* @__PURE__ */ react.createElement(_elementor_icons.UploadIcon, { fontSize: "medium" }), /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 696 | + direction: "row", | |
| 697 | + spacing: .5, | |
| 698 | + alignItems: "center" | |
| 699 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Link, { | |
| 700 | + component: "button", | |
| 701 | + type: "button", | |
| 702 | + underline: "always", | |
| 703 | + onClick: handleBrowseClick | |
| 704 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 705 | + variant: "body1", | |
| 706 | + component: "span" | |
| 707 | + }, primaryLabel ?? (0, _wordpress_i18n.__)("Upload file", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { variant: "body1" }, secondaryLabel ?? (0, _wordpress_i18n.__)("or drag and drop", "elementor"))), helperText ? /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 708 | + variant: "caption", | |
| 709 | + color: "text.secondary" | |
| 710 | + }, helperText) : null), /* @__PURE__ */ react.createElement("input", { | |
| 711 | + ref: fileInputRef, | |
| 712 | + type: "file", | |
| 713 | + accept, | |
| 714 | + hidden: true, | |
| 715 | + onChange: handleFileInputChange | |
| 716 | + })); | |
| 717 | + }; | |
| 1765 | 718 | |
| 1766 | -/***/ "./packages/packages/libs/editor-ui/src/components/form.tsx": | |
| 1767 | -/*!******************************************************************!*\ | |
| 1768 | - !*** ./packages/packages/libs/editor-ui/src/components/form.tsx ***! | |
| 1769 | - \******************************************************************/ | |
| 1770 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 719 | +//#endregion | |
| 720 | +//#region packages/packages/libs/editor-ui/src/components/file-upload/file-upload-row.tsx | |
| 721 | + var BYTES_PER_KILOBYTE = 1024; | |
| 722 | + var cardSx = { | |
| 723 | + minHeight: 152, | |
| 724 | + border: "2px dashed", | |
| 725 | + borderColor: "divider", | |
| 726 | + borderRadius: 1 | |
| 727 | + }; | |
| 728 | + var formatFileSize = (sizeInBytes) => { | |
| 729 | + return `${Math.max(1, Math.round(sizeInBytes / BYTES_PER_KILOBYTE))}kb`; | |
| 730 | + }; | |
| 731 | + var FileUploadRow = ({ file, onRemove, statusLabel }) => { | |
| 732 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Card, { | |
| 733 | + variant: "outlined", | |
| 734 | + sx: cardSx | |
| 735 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 736 | + direction: "row", | |
| 737 | + alignItems: "center", | |
| 738 | + justifyContent: "space-between", | |
| 739 | + padding: 2, | |
| 740 | + spacing: 2, | |
| 741 | + minHeight: 152 | |
| 742 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 743 | + direction: "column", | |
| 744 | + spacing: .5, | |
| 745 | + minWidth: 0, | |
| 746 | + flex: 1 | |
| 747 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 748 | + variant: "subtitle2", | |
| 749 | + noWrap: true | |
| 750 | + }, file.name), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 751 | + variant: "caption", | |
| 752 | + color: "text.secondary", | |
| 753 | + noWrap: true | |
| 754 | + }, formatFileSize(file.size), " · ", statusLabel ?? (0, _wordpress_i18n.__)("Complete", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, { | |
| 755 | + size: "small", | |
| 756 | + onClick: onRemove, | |
| 757 | + "aria-label": (0, _wordpress_i18n.__)("Remove file", "elementor") | |
| 758 | + }, /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, { fontSize: "inherit" })))); | |
| 759 | + }; | |
| 1771 | 760 | |
| 1772 | -__webpack_require__.r(__webpack_exports__); | |
| 1773 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1774 | -/* harmony export */ Form: function() { return /* binding */ Form; } | |
| 1775 | -/* harmony export */ }); | |
| 1776 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1777 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1778 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 761 | +//#endregion | |
| 762 | +//#region packages/packages/libs/editor-ui/src/components/popover/body.tsx | |
| 763 | + var SECTION_PADDING_INLINE = 32; | |
| 764 | + var DEFAULT_POPOVER_HEIGHT = 348; | |
| 765 | + var FALLBACK_POPOVER_WIDTH = 220; | |
| 766 | + var PopoverBody = ({ children, height = DEFAULT_POPOVER_HEIGHT, width, id }) => { | |
| 767 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { | |
| 768 | + display: "flex", | |
| 769 | + flexDirection: "column", | |
| 770 | + sx: { | |
| 771 | + height, | |
| 772 | + overflow: "hidden", | |
| 773 | + width: `${width ? width - SECTION_PADDING_INLINE : FALLBACK_POPOVER_WIDTH}px`, | |
| 774 | + maxWidth: 496 | |
| 775 | + }, | |
| 776 | + id | |
| 777 | + }, children); | |
| 778 | + }; | |
| 1779 | 779 | |
| 780 | +//#endregion | |
| 781 | +//#region packages/packages/libs/editor-ui/src/contexts/section-context.tsx | |
| 782 | + var FALLBACK_SECTION_WIDTH = 320; | |
| 783 | + var SectionRefContext = (0, react.createContext)(null); | |
| 784 | + var useSectionRef = () => (0, react.useContext)(SectionRefContext); | |
| 785 | + var useSectionWidth = () => { | |
| 786 | + return useSectionRef()?.current?.offsetWidth ?? FALLBACK_SECTION_WIDTH; | |
| 787 | + }; | |
| 1780 | 788 | |
| 1781 | -const Form = ({ | |
| 1782 | - children, | |
| 1783 | - onSubmit, | |
| 1784 | - 'data-testid': dataTestId | |
| 1785 | -}) => { | |
| 1786 | - const formRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); | |
| 1787 | - const handleSubmit = e => { | |
| 1788 | - e.preventDefault(); | |
| 1789 | - onSubmit?.(); | |
| 1790 | - }; | |
| 1791 | - const handleKeyDown = e => { | |
| 1792 | - const { | |
| 1793 | - target | |
| 1794 | - } = e; | |
| 1795 | - if (e.key === 'Enter' && target instanceof HTMLInputElement && target.type !== 'submit') { | |
| 1796 | - e.preventDefault(); | |
| 1797 | - formRef.current?.requestSubmit(); | |
| 1798 | - } | |
| 1799 | - }; | |
| 1800 | - return ( | |
| 1801 | - /*#__PURE__*/ | |
| 1802 | - // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions | |
| 1803 | - react__WEBPACK_IMPORTED_MODULE_0__.createElement("form", _extends({ | |
| 1804 | - onSubmit: handleSubmit, | |
| 1805 | - ref: formRef, | |
| 1806 | - onKeyDown: handleKeyDown | |
| 1807 | - }, dataTestId ? { | |
| 1808 | - 'data-testid': dataTestId | |
| 1809 | - } : {}), children) | |
| 1810 | - ); | |
| 1811 | -}; | |
| 789 | +//#endregion | |
| 790 | +//#region packages/packages/libs/editor-ui/src/components/popover/section-popover-body.tsx | |
| 791 | + var SectionPopoverBody = (props) => { | |
| 792 | + const sectionWidth = useSectionWidth(); | |
| 793 | + return /* @__PURE__ */ react.createElement(PopoverBody, { | |
| 794 | + ...props, | |
| 795 | + width: sectionWidth | |
| 796 | + }); | |
| 797 | + }; | |
| 1812 | 798 | |
| 1813 | -/***/ }), | |
| 799 | +//#endregion | |
| 800 | +//#region packages/packages/libs/editor-ui/src/components/popover/header.tsx | |
| 801 | + var SIZE$1 = "tiny"; | |
| 802 | + var PopoverHeader = ({ title, onClose, icon, actions }) => { | |
| 803 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 804 | + direction: "row", | |
| 805 | + alignItems: "center", | |
| 806 | + pl: 2, | |
| 807 | + pr: 1, | |
| 808 | + py: 1.5, | |
| 809 | + maxHeight: 36, | |
| 810 | + sx: { columnGap: .5 } | |
| 811 | + }, icon, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 812 | + variant: "subtitle2", | |
| 813 | + sx: { | |
| 814 | + fontSize: "12px", | |
| 815 | + mt: .25 | |
| 816 | + } | |
| 817 | + }, title), /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 818 | + direction: "row", | |
| 819 | + sx: { ml: "auto" } | |
| 820 | + }, actions, /* @__PURE__ */ react.createElement(_elementor_ui.CloseButton, { | |
| 821 | + slotProps: { icon: { fontSize: SIZE$1 } }, | |
| 822 | + sx: { ml: "auto" }, | |
| 823 | + onClick: onClose | |
| 824 | + }))); | |
| 825 | + }; | |
| 1814 | 826 | |
| 1815 | -/***/ "./packages/packages/libs/editor-ui/src/components/global-dialog/components/global-dialog.tsx": | |
| 1816 | -/*!****************************************************************************************************!*\ | |
| 1817 | - !*** ./packages/packages/libs/editor-ui/src/components/global-dialog/components/global-dialog.tsx ***! | |
| 1818 | - \****************************************************************************************************/ | |
| 1819 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 827 | +//#endregion | |
| 828 | +//#region packages/node_modules/@tanstack/virtual-core/dist/esm/utils.js | |
| 829 | + function memo(getDeps, fn, opts) { | |
| 830 | + let deps = opts.initialDeps ?? []; | |
| 831 | + let result; | |
| 832 | + let isInitial = true; | |
| 833 | + function memoizedFunction() { | |
| 834 | + var _a; | |
| 835 | + var _b; | |
| 836 | + var _c; | |
| 837 | + let depTime; | |
| 838 | + if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now(); | |
| 839 | + const newDeps = getDeps(); | |
| 840 | + if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep))) return result; | |
| 841 | + deps = newDeps; | |
| 842 | + let resultTime; | |
| 843 | + if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now(); | |
| 844 | + result = fn(...newDeps); | |
| 845 | + if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) { | |
| 846 | + const depEndTime = Math.round((Date.now() - depTime) * 100) / 100; | |
| 847 | + const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100; | |
| 848 | + const resultFpsPercentage = resultEndTime / 16; | |
| 849 | + const pad = (str, num) => { | |
| 850 | + str = String(str); | |
| 851 | + while (str.length < num) str = " " + str; | |
| 852 | + return str; | |
| 853 | + }; | |
| 854 | + console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, ` | |
| 855 | + font-size: .6rem; | |
| 856 | + font-weight: bold; | |
| 857 | + color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key); | |
| 858 | + } | |
| 859 | + if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) opts.onChange(result); | |
| 860 | + isInitial = false; | |
| 861 | + return result; | |
| 862 | + } | |
| 863 | + memoizedFunction.updateDeps = (newDeps) => { | |
| 864 | + deps = newDeps; | |
| 865 | + }; | |
| 866 | + return memoizedFunction; | |
| 867 | + } | |
| 868 | + function notUndefined(value, msg) { | |
| 869 | + if (value === void 0) throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`); | |
| 870 | + else return value; | |
| 871 | + } | |
| 872 | + var approxEqual = (a, b) => Math.abs(a - b) < 1.01; | |
| 873 | + var debounce = (targetWindow, fn, ms) => { | |
| 874 | + let timeoutId; | |
| 875 | + return function(...args) { | |
| 876 | + targetWindow.clearTimeout(timeoutId); | |
| 877 | + timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms); | |
| 878 | + }; | |
| 879 | + }; | |
| 1820 | 880 | |
| 1821 | -__webpack_require__.r(__webpack_exports__); | |
| 1822 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1823 | -/* harmony export */ GlobalDialog: function() { return /* binding */ GlobalDialog; } | |
| 1824 | -/* harmony export */ }); | |
| 1825 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1826 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1827 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1828 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1829 | -/* harmony import */ var _theme_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme-provider */ "./packages/packages/libs/editor-ui/src/components/theme-provider.tsx"); | |
| 1830 | -/* harmony import */ var _subscribers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../subscribers */ "./packages/packages/libs/editor-ui/src/components/global-dialog/subscribers.ts"); | |
| 881 | +//#endregion | |
| 882 | +//#region packages/node_modules/@tanstack/virtual-core/dist/esm/index.js | |
| 883 | + var getRect = (element) => { | |
| 884 | + const { offsetWidth, offsetHeight } = element; | |
| 885 | + return { | |
| 886 | + width: offsetWidth, | |
| 887 | + height: offsetHeight | |
| 888 | + }; | |
| 889 | + }; | |
| 890 | + var defaultKeyExtractor = (index) => index; | |
| 891 | + var defaultRangeExtractor = (range) => { | |
| 892 | + const start = Math.max(range.startIndex - range.overscan, 0); | |
| 893 | + const end = Math.min(range.endIndex + range.overscan, range.count - 1); | |
| 894 | + const arr = []; | |
| 895 | + for (let i = start; i <= end; i++) arr.push(i); | |
| 896 | + return arr; | |
| 897 | + }; | |
| 898 | + var observeElementRect = (instance, cb) => { | |
| 899 | + const element = instance.scrollElement; | |
| 900 | + if (!element) return; | |
| 901 | + const targetWindow = instance.targetWindow; | |
| 902 | + if (!targetWindow) return; | |
| 903 | + const handler = (rect) => { | |
| 904 | + const { width, height } = rect; | |
| 905 | + cb({ | |
| 906 | + width: Math.round(width), | |
| 907 | + height: Math.round(height) | |
| 908 | + }); | |
| 909 | + }; | |
| 910 | + handler(getRect(element)); | |
| 911 | + if (!targetWindow.ResizeObserver) return () => {}; | |
| 912 | + const observer = new targetWindow.ResizeObserver((entries) => { | |
| 913 | + const run = () => { | |
| 914 | + const entry = entries[0]; | |
| 915 | + if (entry == null ? void 0 : entry.borderBoxSize) { | |
| 916 | + const box = entry.borderBoxSize[0]; | |
| 917 | + if (box) { | |
| 918 | + handler({ | |
| 919 | + width: box.inlineSize, | |
| 920 | + height: box.blockSize | |
| 921 | + }); | |
| 922 | + return; | |
| 923 | + } | |
| 924 | + } | |
| 925 | + handler(getRect(element)); | |
| 926 | + }; | |
| 927 | + instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run(); | |
| 928 | + }); | |
| 929 | + observer.observe(element, { box: "border-box" }); | |
| 930 | + return () => { | |
| 931 | + observer.unobserve(element); | |
| 932 | + }; | |
| 933 | + }; | |
| 934 | + var addEventListenerOptions = { passive: true }; | |
| 935 | + var supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window; | |
| 936 | + var observeElementOffset = (instance, cb) => { | |
| 937 | + const element = instance.scrollElement; | |
| 938 | + if (!element) return; | |
| 939 | + const targetWindow = instance.targetWindow; | |
| 940 | + if (!targetWindow) return; | |
| 941 | + let offset = 0; | |
| 942 | + const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(targetWindow, () => { | |
| 943 | + cb(offset, false); | |
| 944 | + }, instance.options.isScrollingResetDelay); | |
| 945 | + const createHandler = (isScrolling) => () => { | |
| 946 | + const { horizontal, isRtl } = instance.options; | |
| 947 | + offset = horizontal ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"]; | |
| 948 | + fallback(); | |
| 949 | + cb(offset, isScrolling); | |
| 950 | + }; | |
| 951 | + const handler = createHandler(true); | |
| 952 | + const endHandler = createHandler(false); | |
| 953 | + element.addEventListener("scroll", handler, addEventListenerOptions); | |
| 954 | + const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend; | |
| 955 | + if (registerScrollendEvent) element.addEventListener("scrollend", endHandler, addEventListenerOptions); | |
| 956 | + return () => { | |
| 957 | + element.removeEventListener("scroll", handler); | |
| 958 | + if (registerScrollendEvent) element.removeEventListener("scrollend", endHandler); | |
| 959 | + }; | |
| 960 | + }; | |
| 961 | + var measureElement = (element, entry, instance) => { | |
| 962 | + if (entry == null ? void 0 : entry.borderBoxSize) { | |
| 963 | + const box = entry.borderBoxSize[0]; | |
| 964 | + if (box) return Math.round(box[instance.options.horizontal ? "inlineSize" : "blockSize"]); | |
| 965 | + } | |
| 966 | + return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"]; | |
| 967 | + }; | |
| 968 | + var elementScroll = (offset, { adjustments = 0, behavior }, instance) => { | |
| 969 | + var _a; | |
| 970 | + var _b; | |
| 971 | + const toOffset = offset + adjustments; | |
| 972 | + (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null || _b.call(_a, { | |
| 973 | + [instance.options.horizontal ? "left" : "top"]: toOffset, | |
| 974 | + behavior | |
| 975 | + }); | |
| 976 | + }; | |
| 977 | + var Virtualizer = class { | |
| 978 | + constructor(opts) { | |
| 979 | + this.unsubs = []; | |
| 980 | + this.scrollElement = null; | |
| 981 | + this.targetWindow = null; | |
| 982 | + this.isScrolling = false; | |
| 983 | + this.scrollState = null; | |
| 984 | + this.measurementsCache = []; | |
| 985 | + this.itemSizeCache = /* @__PURE__ */ new Map(); | |
| 986 | + this.laneAssignments = /* @__PURE__ */ new Map(); | |
| 987 | + this.pendingMeasuredCacheIndexes = []; | |
| 988 | + this.prevLanes = void 0; | |
| 989 | + this.lanesChangedFlag = false; | |
| 990 | + this.lanesSettling = false; | |
| 991 | + this.scrollRect = null; | |
| 992 | + this.scrollOffset = null; | |
| 993 | + this.scrollDirection = null; | |
| 994 | + this.scrollAdjustments = 0; | |
| 995 | + this.elementsCache = /* @__PURE__ */ new Map(); | |
| 996 | + this.now = () => { | |
| 997 | + var _a; | |
| 998 | + var _b; | |
| 999 | + var _c; | |
| 1000 | + return ((_c = (_b = (_a = this.targetWindow) == null ? void 0 : _a.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) ?? Date.now(); | |
| 1001 | + }; | |
| 1002 | + this.observer = /* @__PURE__ */ (() => { | |
| 1003 | + let _ro = null; | |
| 1004 | + const get = () => { | |
| 1005 | + if (_ro) return _ro; | |
| 1006 | + if (!this.targetWindow || !this.targetWindow.ResizeObserver) return null; | |
| 1007 | + return _ro = new this.targetWindow.ResizeObserver((entries) => { | |
| 1008 | + entries.forEach((entry) => { | |
| 1009 | + const run = () => { | |
| 1010 | + const node = entry.target; | |
| 1011 | + const index = this.indexFromElement(node); | |
| 1012 | + if (!node.isConnected) { | |
| 1013 | + this.observer.unobserve(node); | |
| 1014 | + return; | |
| 1015 | + } | |
| 1016 | + if (this.shouldMeasureDuringScroll(index)) this.resizeItem(index, this.options.measureElement(node, entry, this)); | |
| 1017 | + }; | |
| 1018 | + this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run(); | |
| 1019 | + }); | |
| 1020 | + }); | |
| 1021 | + }; | |
| 1022 | + return { | |
| 1023 | + disconnect: () => { | |
| 1024 | + var _a; | |
| 1025 | + (_a = get()) == null || _a.disconnect(); | |
| 1026 | + _ro = null; | |
| 1027 | + }, | |
| 1028 | + observe: (target) => { | |
| 1029 | + var _a; | |
| 1030 | + return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" }); | |
| 1031 | + }, | |
| 1032 | + unobserve: (target) => { | |
| 1033 | + var _a; | |
| 1034 | + return (_a = get()) == null ? void 0 : _a.unobserve(target); | |
| 1035 | + } | |
| 1036 | + }; | |
| 1037 | + })(); | |
| 1038 | + this.range = null; | |
| 1039 | + this.setOptions = (opts2) => { | |
| 1040 | + Object.entries(opts2).forEach(([key, value]) => { | |
| 1041 | + if (typeof value === "undefined") delete opts2[key]; | |
| 1042 | + }); | |
| 1043 | + this.options = { | |
| 1044 | + debug: false, | |
| 1045 | + initialOffset: 0, | |
| 1046 | + overscan: 1, | |
| 1047 | + paddingStart: 0, | |
| 1048 | + paddingEnd: 0, | |
| 1049 | + scrollPaddingStart: 0, | |
| 1050 | + scrollPaddingEnd: 0, | |
| 1051 | + horizontal: false, | |
| 1052 | + getItemKey: defaultKeyExtractor, | |
| 1053 | + rangeExtractor: defaultRangeExtractor, | |
| 1054 | + onChange: () => {}, | |
| 1055 | + measureElement, | |
| 1056 | + initialRect: { | |
| 1057 | + width: 0, | |
| 1058 | + height: 0 | |
| 1059 | + }, | |
| 1060 | + scrollMargin: 0, | |
| 1061 | + gap: 0, | |
| 1062 | + indexAttribute: "data-index", | |
| 1063 | + initialMeasurementsCache: [], | |
| 1064 | + lanes: 1, | |
| 1065 | + isScrollingResetDelay: 150, | |
| 1066 | + enabled: true, | |
| 1067 | + isRtl: false, | |
| 1068 | + useScrollendEvent: false, | |
| 1069 | + useAnimationFrameWithResizeObserver: false, | |
| 1070 | + laneAssignmentMode: "estimate", | |
| 1071 | + ...opts2 | |
| 1072 | + }; | |
| 1073 | + }; | |
| 1074 | + this.notify = (sync) => { | |
| 1075 | + var _a; | |
| 1076 | + var _b; | |
| 1077 | + (_b = (_a = this.options).onChange) == null || _b.call(_a, this, sync); | |
| 1078 | + }; | |
| 1079 | + this.maybeNotify = memo(() => { | |
| 1080 | + this.calculateRange(); | |
| 1081 | + return [ | |
| 1082 | + this.isScrolling, | |
| 1083 | + this.range ? this.range.startIndex : null, | |
| 1084 | + this.range ? this.range.endIndex : null | |
| 1085 | + ]; | |
| 1086 | + }, (isScrolling) => { | |
| 1087 | + this.notify(isScrolling); | |
| 1088 | + }, { | |
| 1089 | + key: "maybeNotify", | |
| 1090 | + debug: () => this.options.debug, | |
| 1091 | + initialDeps: [ | |
| 1092 | + this.isScrolling, | |
| 1093 | + this.range ? this.range.startIndex : null, | |
| 1094 | + this.range ? this.range.endIndex : null | |
| 1095 | + ] | |
| 1096 | + }); | |
| 1097 | + this.cleanup = () => { | |
| 1098 | + this.unsubs.filter(Boolean).forEach((d) => d()); | |
| 1099 | + this.unsubs = []; | |
| 1100 | + this.observer.disconnect(); | |
| 1101 | + if (this.rafId != null && this.targetWindow) { | |
| 1102 | + this.targetWindow.cancelAnimationFrame(this.rafId); | |
| 1103 | + this.rafId = null; | |
| 1104 | + } | |
| 1105 | + this.scrollState = null; | |
| 1106 | + this.scrollElement = null; | |
| 1107 | + this.targetWindow = null; | |
| 1108 | + }; | |
| 1109 | + this._didMount = () => { | |
| 1110 | + return () => { | |
| 1111 | + this.cleanup(); | |
| 1112 | + }; | |
| 1113 | + }; | |
| 1114 | + this._willUpdate = () => { | |
| 1115 | + var _a; | |
| 1116 | + const scrollElement = this.options.enabled ? this.options.getScrollElement() : null; | |
| 1117 | + if (this.scrollElement !== scrollElement) { | |
| 1118 | + this.cleanup(); | |
| 1119 | + if (!scrollElement) { | |
| 1120 | + this.maybeNotify(); | |
| 1121 | + return; | |
| 1122 | + } | |
| 1123 | + this.scrollElement = scrollElement; | |
| 1124 | + if (this.scrollElement && "ownerDocument" in this.scrollElement) this.targetWindow = this.scrollElement.ownerDocument.defaultView; | |
| 1125 | + else this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null; | |
| 1126 | + this.elementsCache.forEach((cached) => { | |
| 1127 | + this.observer.observe(cached); | |
| 1128 | + }); | |
| 1129 | + this.unsubs.push(this.options.observeElementRect(this, (rect) => { | |
| 1130 | + this.scrollRect = rect; | |
| 1131 | + this.maybeNotify(); | |
| 1132 | + })); | |
| 1133 | + this.unsubs.push(this.options.observeElementOffset(this, (offset, isScrolling) => { | |
| 1134 | + this.scrollAdjustments = 0; | |
| 1135 | + this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null; | |
| 1136 | + this.scrollOffset = offset; | |
| 1137 | + this.isScrolling = isScrolling; | |
| 1138 | + if (this.scrollState) this.scheduleScrollReconcile(); | |
| 1139 | + this.maybeNotify(); | |
| 1140 | + })); | |
| 1141 | + this._scrollToOffset(this.getScrollOffset(), { | |
| 1142 | + adjustments: void 0, | |
| 1143 | + behavior: void 0 | |
| 1144 | + }); | |
| 1145 | + } | |
| 1146 | + }; | |
| 1147 | + this.rafId = null; | |
| 1148 | + this.getSize = () => { | |
| 1149 | + if (!this.options.enabled) { | |
| 1150 | + this.scrollRect = null; | |
| 1151 | + return 0; | |
| 1152 | + } | |
| 1153 | + this.scrollRect = this.scrollRect ?? this.options.initialRect; | |
| 1154 | + return this.scrollRect[this.options.horizontal ? "width" : "height"]; | |
| 1155 | + }; | |
| 1156 | + this.getScrollOffset = () => { | |
| 1157 | + if (!this.options.enabled) { | |
| 1158 | + this.scrollOffset = null; | |
| 1159 | + return 0; | |
| 1160 | + } | |
| 1161 | + this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset); | |
| 1162 | + return this.scrollOffset; | |
| 1163 | + }; | |
| 1164 | + this.getFurthestMeasurement = (measurements, index) => { | |
| 1165 | + const furthestMeasurementsFound = /* @__PURE__ */ new Map(); | |
| 1166 | + const furthestMeasurements = /* @__PURE__ */ new Map(); | |
| 1167 | + for (let m = index - 1; m >= 0; m--) { | |
| 1168 | + const measurement = measurements[m]; | |
| 1169 | + if (furthestMeasurementsFound.has(measurement.lane)) continue; | |
| 1170 | + const previousFurthestMeasurement = furthestMeasurements.get(measurement.lane); | |
| 1171 | + if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) furthestMeasurements.set(measurement.lane, measurement); | |
| 1172 | + else if (measurement.end < previousFurthestMeasurement.end) furthestMeasurementsFound.set(measurement.lane, true); | |
| 1173 | + if (furthestMeasurementsFound.size === this.options.lanes) break; | |
| 1174 | + } | |
| 1175 | + return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => { | |
| 1176 | + if (a.end === b.end) return a.index - b.index; | |
| 1177 | + return a.end - b.end; | |
| 1178 | + })[0] : void 0; | |
| 1179 | + }; | |
| 1180 | + this.getMeasurementOptions = memo(() => [ | |
| 1181 | + this.options.count, | |
| 1182 | + this.options.paddingStart, | |
| 1183 | + this.options.scrollMargin, | |
| 1184 | + this.options.getItemKey, | |
| 1185 | + this.options.enabled, | |
| 1186 | + this.options.lanes, | |
| 1187 | + this.options.laneAssignmentMode | |
| 1188 | + ], (count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => { | |
| 1189 | + if (this.prevLanes !== void 0 && this.prevLanes !== lanes) this.lanesChangedFlag = true; | |
| 1190 | + this.prevLanes = lanes; | |
| 1191 | + this.pendingMeasuredCacheIndexes = []; | |
| 1192 | + return { | |
| 1193 | + count, | |
| 1194 | + paddingStart, | |
| 1195 | + scrollMargin, | |
| 1196 | + getItemKey, | |
| 1197 | + enabled, | |
| 1198 | + lanes, | |
| 1199 | + laneAssignmentMode | |
| 1200 | + }; | |
| 1201 | + }, { key: false }); | |
| 1202 | + this.getMeasurements = memo(() => [this.getMeasurementOptions(), this.itemSizeCache], ({ count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode }, itemSizeCache) => { | |
| 1203 | + if (!enabled) { | |
| 1204 | + this.measurementsCache = []; | |
| 1205 | + this.itemSizeCache.clear(); | |
| 1206 | + this.laneAssignments.clear(); | |
| 1207 | + return []; | |
| 1208 | + } | |
| 1209 | + if (this.laneAssignments.size > count) { | |
| 1210 | + for (const index of this.laneAssignments.keys()) if (index >= count) this.laneAssignments.delete(index); | |
| 1211 | + } | |
| 1212 | + if (this.lanesChangedFlag) { | |
| 1213 | + this.lanesChangedFlag = false; | |
| 1214 | + this.lanesSettling = true; | |
| 1215 | + this.measurementsCache = []; | |
| 1216 | + this.itemSizeCache.clear(); | |
| 1217 | + this.laneAssignments.clear(); | |
| 1218 | + this.pendingMeasuredCacheIndexes = []; | |
| 1219 | + } | |
| 1220 | + if (this.measurementsCache.length === 0 && !this.lanesSettling) { | |
| 1221 | + this.measurementsCache = this.options.initialMeasurementsCache; | |
| 1222 | + this.measurementsCache.forEach((item) => { | |
| 1223 | + this.itemSizeCache.set(item.key, item.size); | |
| 1224 | + }); | |
| 1225 | + } | |
| 1226 | + const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0; | |
| 1227 | + this.pendingMeasuredCacheIndexes = []; | |
| 1228 | + if (this.lanesSettling && this.measurementsCache.length === count) this.lanesSettling = false; | |
| 1229 | + const measurements = this.measurementsCache.slice(0, min); | |
| 1230 | + const laneLastIndex = new Array(lanes).fill(void 0); | |
| 1231 | + for (let m = 0; m < min; m++) { | |
| 1232 | + const item = measurements[m]; | |
| 1233 | + if (item) laneLastIndex[item.lane] = m; | |
| 1234 | + } | |
| 1235 | + for (let i = min; i < count; i++) { | |
| 1236 | + const key = getItemKey(i); | |
| 1237 | + const cachedLane = this.laneAssignments.get(i); | |
| 1238 | + let lane; | |
| 1239 | + let start; | |
| 1240 | + const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key); | |
| 1241 | + if (cachedLane !== void 0 && this.options.lanes > 1) { | |
| 1242 | + lane = cachedLane; | |
| 1243 | + const prevIndex = laneLastIndex[lane]; | |
| 1244 | + const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0; | |
| 1245 | + start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin; | |
| 1246 | + } else { | |
| 1247 | + const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i); | |
| 1248 | + start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin; | |
| 1249 | + lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes; | |
| 1250 | + if (this.options.lanes > 1 && shouldCacheLane) this.laneAssignments.set(i, lane); | |
| 1251 | + } | |
| 1252 | + const measuredSize = itemSizeCache.get(key); | |
| 1253 | + const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i); | |
| 1254 | + const end = start + size; | |
| 1255 | + measurements[i] = { | |
| 1256 | + index: i, | |
| 1257 | + start, | |
| 1258 | + size, | |
| 1259 | + end, | |
| 1260 | + key, | |
| 1261 | + lane | |
| 1262 | + }; | |
| 1263 | + laneLastIndex[lane] = i; | |
| 1264 | + } | |
| 1265 | + this.measurementsCache = measurements; | |
| 1266 | + return measurements; | |
| 1267 | + }, { | |
| 1268 | + key: "getMeasurements", | |
| 1269 | + debug: () => this.options.debug | |
| 1270 | + }); | |
| 1271 | + this.calculateRange = memo(() => [ | |
| 1272 | + this.getMeasurements(), | |
| 1273 | + this.getSize(), | |
| 1274 | + this.getScrollOffset(), | |
| 1275 | + this.options.lanes | |
| 1276 | + ], (measurements, outerSize, scrollOffset, lanes) => { | |
| 1277 | + return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({ | |
| 1278 | + measurements, | |
| 1279 | + outerSize, | |
| 1280 | + scrollOffset, | |
| 1281 | + lanes | |
| 1282 | + }) : null; | |
| 1283 | + }, { | |
| 1284 | + key: "calculateRange", | |
| 1285 | + debug: () => this.options.debug | |
| 1286 | + }); | |
| 1287 | + this.getVirtualIndexes = memo(() => { | |
| 1288 | + let startIndex = null; | |
| 1289 | + let endIndex = null; | |
| 1290 | + const range = this.calculateRange(); | |
| 1291 | + if (range) { | |
| 1292 | + startIndex = range.startIndex; | |
| 1293 | + endIndex = range.endIndex; | |
| 1294 | + } | |
| 1295 | + this.maybeNotify.updateDeps([ | |
| 1296 | + this.isScrolling, | |
| 1297 | + startIndex, | |
| 1298 | + endIndex | |
| 1299 | + ]); | |
| 1300 | + return [ | |
| 1301 | + this.options.rangeExtractor, | |
| 1302 | + this.options.overscan, | |
| 1303 | + this.options.count, | |
| 1304 | + startIndex, | |
| 1305 | + endIndex | |
| 1306 | + ]; | |
| 1307 | + }, (rangeExtractor, overscan, count, startIndex, endIndex) => { | |
| 1308 | + return startIndex === null || endIndex === null ? [] : rangeExtractor({ | |
| 1309 | + startIndex, | |
| 1310 | + endIndex, | |
| 1311 | + overscan, | |
| 1312 | + count | |
| 1313 | + }); | |
| 1314 | + }, { | |
| 1315 | + key: "getVirtualIndexes", | |
| 1316 | + debug: () => this.options.debug | |
| 1317 | + }); | |
| 1318 | + this.indexFromElement = (node) => { | |
| 1319 | + const attributeName = this.options.indexAttribute; | |
| 1320 | + const indexStr = node.getAttribute(attributeName); | |
| 1321 | + if (!indexStr) { | |
| 1322 | + console.warn(`Missing attribute name '${attributeName}={index}' on measured element.`); | |
| 1323 | + return -1; | |
| 1324 | + } | |
| 1325 | + return parseInt(indexStr, 10); | |
| 1326 | + }; | |
| 1327 | + this.shouldMeasureDuringScroll = (index) => { | |
| 1328 | + var _a; | |
| 1329 | + if (!this.scrollState || this.scrollState.behavior !== "smooth") return true; | |
| 1330 | + const scrollIndex = this.scrollState.index ?? ((_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index); | |
| 1331 | + if (scrollIndex !== void 0 && this.range) { | |
| 1332 | + const bufferSize = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)); | |
| 1333 | + const minIndex = Math.max(0, scrollIndex - bufferSize); | |
| 1334 | + const maxIndex = Math.min(this.options.count - 1, scrollIndex + bufferSize); | |
| 1335 | + return index >= minIndex && index <= maxIndex; | |
| 1336 | + } | |
| 1337 | + return true; | |
| 1338 | + }; | |
| 1339 | + this.measureElement = (node) => { | |
| 1340 | + if (!node) { | |
| 1341 | + this.elementsCache.forEach((cached, key2) => { | |
| 1342 | + if (!cached.isConnected) { | |
| 1343 | + this.observer.unobserve(cached); | |
| 1344 | + this.elementsCache.delete(key2); | |
| 1345 | + } | |
| 1346 | + }); | |
| 1347 | + return; | |
| 1348 | + } | |
| 1349 | + const index = this.indexFromElement(node); | |
| 1350 | + const key = this.options.getItemKey(index); | |
| 1351 | + const prevNode = this.elementsCache.get(key); | |
| 1352 | + if (prevNode !== node) { | |
| 1353 | + if (prevNode) this.observer.unobserve(prevNode); | |
| 1354 | + this.observer.observe(node); | |
| 1355 | + this.elementsCache.set(key, node); | |
| 1356 | + } | |
| 1357 | + if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) this.resizeItem(index, this.options.measureElement(node, void 0, this)); | |
| 1358 | + }; | |
| 1359 | + this.resizeItem = (index, size) => { | |
| 1360 | + var _a; | |
| 1361 | + const item = this.measurementsCache[index]; | |
| 1362 | + if (!item) return; | |
| 1363 | + const delta = size - (this.itemSizeCache.get(item.key) ?? item.size); | |
| 1364 | + if (delta !== 0) { | |
| 1365 | + if (((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments)) { | |
| 1366 | + if (this.options.debug) console.info("correction", delta); | |
| 1367 | + this._scrollToOffset(this.getScrollOffset(), { | |
| 1368 | + adjustments: this.scrollAdjustments += delta, | |
| 1369 | + behavior: void 0 | |
| 1370 | + }); | |
| 1371 | + } | |
| 1372 | + this.pendingMeasuredCacheIndexes.push(item.index); | |
| 1373 | + this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size)); | |
| 1374 | + this.notify(false); | |
| 1375 | + } | |
| 1376 | + }; | |
| 1377 | + this.getVirtualItems = memo(() => [this.getVirtualIndexes(), this.getMeasurements()], (indexes, measurements) => { | |
| 1378 | + const virtualItems = []; | |
| 1379 | + for (let k = 0, len = indexes.length; k < len; k++) { | |
| 1380 | + const measurement = measurements[indexes[k]]; | |
| 1381 | + virtualItems.push(measurement); | |
| 1382 | + } | |
| 1383 | + return virtualItems; | |
| 1384 | + }, { | |
| 1385 | + key: "getVirtualItems", | |
| 1386 | + debug: () => this.options.debug | |
| 1387 | + }); | |
| 1388 | + this.getVirtualItemForOffset = (offset) => { | |
| 1389 | + const measurements = this.getMeasurements(); | |
| 1390 | + if (measurements.length === 0) return; | |
| 1391 | + return notUndefined(measurements[findNearestBinarySearch(0, measurements.length - 1, (index) => notUndefined(measurements[index]).start, offset)]); | |
| 1392 | + }; | |
| 1393 | + this.getMaxScrollOffset = () => { | |
| 1394 | + if (!this.scrollElement) return 0; | |
| 1395 | + if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight; | |
| 1396 | + else { | |
| 1397 | + const doc = this.scrollElement.document.documentElement; | |
| 1398 | + return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight; | |
| 1399 | + } | |
| 1400 | + }; | |
| 1401 | + this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => { | |
| 1402 | + if (!this.scrollElement) return 0; | |
| 1403 | + const size = this.getSize(); | |
| 1404 | + const scrollOffset = this.getScrollOffset(); | |
| 1405 | + if (align === "auto") align = toOffset >= scrollOffset + size ? "end" : "start"; | |
| 1406 | + if (align === "center") toOffset += (itemSize - size) / 2; | |
| 1407 | + else if (align === "end") toOffset -= size; | |
| 1408 | + const maxOffset = this.getMaxScrollOffset(); | |
| 1409 | + return Math.max(Math.min(maxOffset, toOffset), 0); | |
| 1410 | + }; | |
| 1411 | + this.getOffsetForIndex = (index, align = "auto") => { | |
| 1412 | + index = Math.max(0, Math.min(index, this.options.count - 1)); | |
| 1413 | + const size = this.getSize(); | |
| 1414 | + const scrollOffset = this.getScrollOffset(); | |
| 1415 | + const item = this.measurementsCache[index]; | |
| 1416 | + if (!item) return; | |
| 1417 | + if (align === "auto") if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) align = "end"; | |
| 1418 | + else if (item.start <= scrollOffset + this.options.scrollPaddingStart) align = "start"; | |
| 1419 | + else return [scrollOffset, align]; | |
| 1420 | + if (align === "end" && index === this.options.count - 1) return [this.getMaxScrollOffset(), align]; | |
| 1421 | + const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart; | |
| 1422 | + return [this.getOffsetForAlignment(toOffset, align, item.size), align]; | |
| 1423 | + }; | |
| 1424 | + this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => { | |
| 1425 | + const offset = this.getOffsetForAlignment(toOffset, align); | |
| 1426 | + const now = this.now(); | |
| 1427 | + this.scrollState = { | |
| 1428 | + index: null, | |
| 1429 | + align, | |
| 1430 | + behavior, | |
| 1431 | + startedAt: now, | |
| 1432 | + lastTargetOffset: offset, | |
| 1433 | + stableFrames: 0 | |
| 1434 | + }; | |
| 1435 | + this._scrollToOffset(offset, { | |
| 1436 | + adjustments: void 0, | |
| 1437 | + behavior | |
| 1438 | + }); | |
| 1439 | + this.scheduleScrollReconcile(); | |
| 1440 | + }; | |
| 1441 | + this.scrollToIndex = (index, { align: initialAlign = "auto", behavior = "auto" } = {}) => { | |
| 1442 | + index = Math.max(0, Math.min(index, this.options.count - 1)); | |
| 1443 | + const offsetInfo = this.getOffsetForIndex(index, initialAlign); | |
| 1444 | + if (!offsetInfo) return; | |
| 1445 | + const [offset, align] = offsetInfo; | |
| 1446 | + const now = this.now(); | |
| 1447 | + this.scrollState = { | |
| 1448 | + index, | |
| 1449 | + align, | |
| 1450 | + behavior, | |
| 1451 | + startedAt: now, | |
| 1452 | + lastTargetOffset: offset, | |
| 1453 | + stableFrames: 0 | |
| 1454 | + }; | |
| 1455 | + this._scrollToOffset(offset, { | |
| 1456 | + adjustments: void 0, | |
| 1457 | + behavior | |
| 1458 | + }); | |
| 1459 | + this.scheduleScrollReconcile(); | |
| 1460 | + }; | |
| 1461 | + this.scrollBy = (delta, { behavior = "auto" } = {}) => { | |
| 1462 | + const offset = this.getScrollOffset() + delta; | |
| 1463 | + const now = this.now(); | |
| 1464 | + this.scrollState = { | |
| 1465 | + index: null, | |
| 1466 | + align: "start", | |
| 1467 | + behavior, | |
| 1468 | + startedAt: now, | |
| 1469 | + lastTargetOffset: offset, | |
| 1470 | + stableFrames: 0 | |
| 1471 | + }; | |
| 1472 | + this._scrollToOffset(offset, { | |
| 1473 | + adjustments: void 0, | |
| 1474 | + behavior | |
| 1475 | + }); | |
| 1476 | + this.scheduleScrollReconcile(); | |
| 1477 | + }; | |
| 1478 | + this.getTotalSize = () => { | |
| 1479 | + var _a; | |
| 1480 | + const measurements = this.getMeasurements(); | |
| 1481 | + let end; | |
| 1482 | + if (measurements.length === 0) end = this.options.paddingStart; | |
| 1483 | + else if (this.options.lanes === 1) end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0; | |
| 1484 | + else { | |
| 1485 | + const endByLane = Array(this.options.lanes).fill(null); | |
| 1486 | + let endIndex = measurements.length - 1; | |
| 1487 | + while (endIndex >= 0 && endByLane.some((val) => val === null)) { | |
| 1488 | + const item = measurements[endIndex]; | |
| 1489 | + if (endByLane[item.lane] === null) endByLane[item.lane] = item.end; | |
| 1490 | + endIndex--; | |
| 1491 | + } | |
| 1492 | + end = Math.max(...endByLane.filter((val) => val !== null)); | |
| 1493 | + } | |
| 1494 | + return Math.max(end - this.options.scrollMargin + this.options.paddingEnd, 0); | |
| 1495 | + }; | |
| 1496 | + this._scrollToOffset = (offset, { adjustments, behavior }) => { | |
| 1497 | + this.options.scrollToFn(offset, { | |
| 1498 | + behavior, | |
| 1499 | + adjustments | |
| 1500 | + }, this); | |
| 1501 | + }; | |
| 1502 | + this.measure = () => { | |
| 1503 | + this.itemSizeCache = /* @__PURE__ */ new Map(); | |
| 1504 | + this.laneAssignments = /* @__PURE__ */ new Map(); | |
| 1505 | + this.notify(false); | |
| 1506 | + }; | |
| 1507 | + this.setOptions(opts); | |
| 1508 | + } | |
| 1509 | + scheduleScrollReconcile() { | |
| 1510 | + if (!this.targetWindow) { | |
| 1511 | + this.scrollState = null; | |
| 1512 | + return; | |
| 1513 | + } | |
| 1514 | + if (this.rafId != null) return; | |
| 1515 | + this.rafId = this.targetWindow.requestAnimationFrame(() => { | |
| 1516 | + this.rafId = null; | |
| 1517 | + this.reconcileScroll(); | |
| 1518 | + }); | |
| 1519 | + } | |
| 1520 | + reconcileScroll() { | |
| 1521 | + if (!this.scrollState) return; | |
| 1522 | + if (!this.scrollElement) return; | |
| 1523 | + if (this.now() - this.scrollState.startedAt > 5e3) { | |
| 1524 | + this.scrollState = null; | |
| 1525 | + return; | |
| 1526 | + } | |
| 1527 | + const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0; | |
| 1528 | + const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset; | |
| 1529 | + const STABLE_FRAMES = 1; | |
| 1530 | + const targetChanged = targetOffset !== this.scrollState.lastTargetOffset; | |
| 1531 | + if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) { | |
| 1532 | + this.scrollState.stableFrames++; | |
| 1533 | + if (this.scrollState.stableFrames >= STABLE_FRAMES) { | |
| 1534 | + this.scrollState = null; | |
| 1535 | + return; | |
| 1536 | + } | |
| 1537 | + } else { | |
| 1538 | + this.scrollState.stableFrames = 0; | |
| 1539 | + if (targetChanged) { | |
| 1540 | + this.scrollState.lastTargetOffset = targetOffset; | |
| 1541 | + this.scrollState.behavior = "auto"; | |
| 1542 | + this._scrollToOffset(targetOffset, { | |
| 1543 | + adjustments: void 0, | |
| 1544 | + behavior: "auto" | |
| 1545 | + }); | |
| 1546 | + } | |
| 1547 | + } | |
| 1548 | + this.scheduleScrollReconcile(); | |
| 1549 | + } | |
| 1550 | + }; | |
| 1551 | + var findNearestBinarySearch = (low, high, getCurrentValue, value) => { | |
| 1552 | + while (low <= high) { | |
| 1553 | + const middle = (low + high) / 2 | 0; | |
| 1554 | + const currentValue = getCurrentValue(middle); | |
| 1555 | + if (currentValue < value) low = middle + 1; | |
| 1556 | + else if (currentValue > value) high = middle - 1; | |
| 1557 | + else return middle; | |
| 1558 | + } | |
| 1559 | + if (low > 0) return low - 1; | |
| 1560 | + else return 0; | |
| 1561 | + }; | |
| 1562 | + function calculateRange({ measurements, outerSize, scrollOffset, lanes }) { | |
| 1563 | + const lastIndex = measurements.length - 1; | |
| 1564 | + const getOffset = (index) => measurements[index].start; | |
| 1565 | + if (measurements.length <= lanes) return { | |
| 1566 | + startIndex: 0, | |
| 1567 | + endIndex: lastIndex | |
| 1568 | + }; | |
| 1569 | + let startIndex = findNearestBinarySearch(0, lastIndex, getOffset, scrollOffset); | |
| 1570 | + let endIndex = startIndex; | |
| 1571 | + if (lanes === 1) while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) endIndex++; | |
| 1572 | + else if (lanes > 1) { | |
| 1573 | + const endPerLane = Array(lanes).fill(0); | |
| 1574 | + while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) { | |
| 1575 | + const item = measurements[endIndex]; | |
| 1576 | + endPerLane[item.lane] = item.end; | |
| 1577 | + endIndex++; | |
| 1578 | + } | |
| 1579 | + const startPerLane = Array(lanes).fill(scrollOffset + outerSize); | |
| 1580 | + while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) { | |
| 1581 | + const item = measurements[startIndex]; | |
| 1582 | + startPerLane[item.lane] = item.start; | |
| 1583 | + startIndex--; | |
| 1584 | + } | |
| 1585 | + startIndex = Math.max(0, startIndex - startIndex % lanes); | |
| 1586 | + endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes)); | |
| 1587 | + } | |
| 1588 | + return { | |
| 1589 | + startIndex, | |
| 1590 | + endIndex | |
| 1591 | + }; | |
| 1592 | + } | |
| 1831 | 1593 | |
| 1594 | +//#endregion | |
| 1595 | +//#region packages/node_modules/@tanstack/react-virtual/dist/esm/index.js | |
| 1596 | + var useIsomorphicLayoutEffect = typeof document !== "undefined" ? react$1.useLayoutEffect : react$1.useEffect; | |
| 1597 | + function useVirtualizerBase({ useFlushSync = true, ...options }) { | |
| 1598 | + const rerender = react$1.useReducer(() => ({}), {})[1]; | |
| 1599 | + const resolvedOptions = { | |
| 1600 | + ...options, | |
| 1601 | + onChange: (instance2, sync) => { | |
| 1602 | + var _a; | |
| 1603 | + if (useFlushSync && sync) (0, react_dom.flushSync)(rerender); | |
| 1604 | + else rerender(); | |
| 1605 | + (_a = options.onChange) == null || _a.call(options, instance2, sync); | |
| 1606 | + } | |
| 1607 | + }; | |
| 1608 | + const [instance] = react$1.useState(() => new Virtualizer(resolvedOptions)); | |
| 1609 | + instance.setOptions(resolvedOptions); | |
| 1610 | + useIsomorphicLayoutEffect(() => { | |
| 1611 | + return instance._didMount(); | |
| 1612 | + }, []); | |
| 1613 | + useIsomorphicLayoutEffect(() => { | |
| 1614 | + return instance._willUpdate(); | |
| 1615 | + }); | |
| 1616 | + return instance; | |
| 1617 | + } | |
| 1618 | + function useVirtualizer(options) { | |
| 1619 | + return useVirtualizerBase({ | |
| 1620 | + observeElementRect, | |
| 1621 | + observeElementOffset, | |
| 1622 | + scrollToFn: elementScroll, | |
| 1623 | + ...options | |
| 1624 | + }); | |
| 1625 | + } | |
| 1832 | 1626 | |
| 1627 | +//#endregion | |
| 1628 | +//#region packages/packages/libs/editor-ui/src/components/popover/menu-list.tsx | |
| 1629 | + var ITEM_HEIGHT = 32; | |
| 1630 | + var LIST_ITEMS_BUFFER = 6; | |
| 1631 | + var MENU_LIST_PADDING_TOP = 8; | |
| 1632 | + var menuSubHeaderAbsoluteStyling = (start) => ({ | |
| 1633 | + position: "absolute", | |
| 1634 | + transform: `translateY(${start + MENU_LIST_PADDING_TOP}px)` | |
| 1635 | + }); | |
| 1636 | + var getAdjacentStickyIndices = (stickyIndices, range) => { | |
| 1637 | + const previousTwoStickyIndices = stickyIndices.filter((stickyIndex) => stickyIndex < range.startIndex).slice(-2); | |
| 1638 | + const nextTwoStickyIndices = stickyIndices.filter((stickyIndex) => stickyIndex > range.endIndex).slice(0, 2); | |
| 1639 | + return [...previousTwoStickyIndices, ...nextTwoStickyIndices]; | |
| 1640 | + }; | |
| 1641 | + var PopoverMenuList = ({ items, onSelect, onClose, selectedValue, itemStyle, onChange, "data-testid": dataTestId, menuItemContentTemplate, categoryItemContentTemplate, noResultsComponent, menuListTemplate: CustomMenuList }) => { | |
| 1642 | + const containerRef = (0, react.useRef)(null); | |
| 1643 | + const scrollTop = useScrollTop({ containerRef }); | |
| 1644 | + const theme = (0, _elementor_ui.useTheme)(); | |
| 1645 | + const MenuListComponent = CustomMenuList || StyledMenuList; | |
| 1646 | + const stickyIndices = (0, react.useMemo)(() => items.reduce((categoryIndices, item, index) => { | |
| 1647 | + if (item.type === "category") categoryIndices.push(index); | |
| 1648 | + return categoryIndices; | |
| 1649 | + }, []), [items]); | |
| 1650 | + const getActiveItemIndices = (range) => { | |
| 1651 | + const visibleAndStickyIndexes = []; | |
| 1652 | + for (let i = range.startIndex; i <= range.endIndex; i++) visibleAndStickyIndexes.push(i); | |
| 1653 | + getAdjacentStickyIndices(stickyIndices, range).forEach((stickyIndex) => { | |
| 1654 | + if (!visibleAndStickyIndexes.includes(stickyIndex)) visibleAndStickyIndexes.push(stickyIndex); | |
| 1655 | + }); | |
| 1656 | + return visibleAndStickyIndexes.sort((a, b) => a - b); | |
| 1657 | + }; | |
| 1658 | + const onChangeCallback = ({ getVirtualIndexes }) => { | |
| 1659 | + const visibleItems = getVirtualIndexes().map((index) => items[index]); | |
| 1660 | + onChange?.(visibleItems); | |
| 1661 | + }; | |
| 1662 | + const virtualizer = useVirtualizer({ | |
| 1663 | + count: items.length, | |
| 1664 | + getScrollElement: () => containerRef.current, | |
| 1665 | + estimateSize: () => 32, | |
| 1666 | + overscan: LIST_ITEMS_BUFFER, | |
| 1667 | + rangeExtractor: getActiveItemIndices, | |
| 1668 | + onChange: onChangeCallback | |
| 1669 | + }); | |
| 1670 | + (0, react.useEffect)(() => { | |
| 1671 | + onChangeCallback(virtualizer); | |
| 1672 | + }, [items]); | |
| 1673 | + useScrollToSelected({ | |
| 1674 | + selectedValue, | |
| 1675 | + items, | |
| 1676 | + virtualizer | |
| 1677 | + }); | |
| 1678 | + const virtualItems = virtualizer.getVirtualItems(); | |
| 1679 | + return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { | |
| 1680 | + ref: containerRef, | |
| 1681 | + sx: { | |
| 1682 | + height: "100%", | |
| 1683 | + overflowY: "auto" | |
| 1684 | + } | |
| 1685 | + }, items.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */ react.createElement(MenuListComponent, { | |
| 1686 | + role: "listbox", | |
| 1687 | + style: { height: `${virtualizer.getTotalSize()}px` }, | |
| 1688 | + "data-testid": dataTestId | |
| 1689 | + }, virtualItems.map((virtualRow) => { | |
| 1690 | + const item = items[virtualRow.index]; | |
| 1691 | + const isLast = virtualRow.index === items.length - 1; | |
| 1692 | + const isFirst = items[0]?.type === "category" ? virtualRow.index === 1 : virtualRow.index === 0; | |
| 1693 | + const isSelected = selectedValue === item.value; | |
| 1694 | + const tabIndexFallback = !selectedValue ? 0 : -1; | |
| 1695 | + if (!item) return null; | |
| 1696 | + if (item.type === "category") { | |
| 1697 | + const shouldStick = virtualRow.start + MENU_LIST_PADDING_TOP <= scrollTop; | |
| 1698 | + return /* @__PURE__ */ react.createElement(_elementor_ui.MenuSubheader, { | |
| 1699 | + key: virtualRow.key, | |
| 1700 | + style: shouldStick ? {} : menuSubHeaderAbsoluteStyling(virtualRow.start), | |
| 1701 | + sx: { | |
| 1702 | + fontWeight: "400", | |
| 1703 | + color: "text.tertiary" | |
| 1704 | + } | |
| 1705 | + }, categoryItemContentTemplate ? categoryItemContentTemplate(item) : item.label || item.value); | |
| 1706 | + } | |
| 1707 | + const isDisabled = item.disabled; | |
| 1708 | + return /* @__PURE__ */ react.createElement(_elementor_ui.ListItem, { | |
| 1709 | + key: virtualRow.key, | |
| 1710 | + role: "option", | |
| 1711 | + "aria-selected": isSelected, | |
| 1712 | + "aria-disabled": isDisabled, | |
| 1713 | + onClick: isDisabled ? void 0 : (e) => { | |
| 1714 | + if (e.target.closest("button")) return; | |
| 1715 | + onSelect(item.value); | |
| 1716 | + onClose(); | |
| 1717 | + }, | |
| 1718 | + onKeyDown: (event) => { | |
| 1719 | + if (event.key === "Enter" && !isDisabled) { | |
| 1720 | + onSelect(item.value); | |
| 1721 | + onClose(); | |
| 1722 | + } | |
| 1723 | + if (event.key === "ArrowDown" && isLast) { | |
| 1724 | + event.preventDefault(); | |
| 1725 | + event.stopPropagation(); | |
| 1726 | + } | |
| 1727 | + if (event.key === "ArrowUp" && isFirst) { | |
| 1728 | + event.preventDefault(); | |
| 1729 | + event.stopPropagation(); | |
| 1730 | + } | |
| 1731 | + }, | |
| 1732 | + tabIndex: isSelected ? 0 : tabIndexFallback, | |
| 1733 | + sx: { | |
| 1734 | + transform: `translateY(${virtualRow.start + MENU_LIST_PADDING_TOP}px)`, | |
| 1735 | + ...theme.typography.caption, | |
| 1736 | + ...itemStyle ? itemStyle(item) : {} | |
| 1737 | + } | |
| 1738 | + }, menuItemContentTemplate ? menuItemContentTemplate(item) : item.label || item.value); | |
| 1739 | + }))); | |
| 1740 | + }; | |
| 1741 | + var StyledMenuList = (0, _elementor_ui.styled)(_elementor_ui.MenuList)(({ theme }) => ({ | |
| 1742 | + "& > li": { | |
| 1743 | + height: 32, | |
| 1744 | + width: "100%", | |
| 1745 | + display: "flex", | |
| 1746 | + alignItems: "center" | |
| 1747 | + }, | |
| 1748 | + "& > [role=\"option\"]": { | |
| 1749 | + lineHeight: "inherit", | |
| 1750 | + padding: theme.spacing(.75, 2, .75, 4), | |
| 1751 | + "&:hover, &:focus": { backgroundColor: theme.palette.action.hover }, | |
| 1752 | + "&[aria-selected=\"true\"]": { backgroundColor: theme.palette.action.selected }, | |
| 1753 | + "&[aria-disabled=\"true\"]": { color: theme.palette.text.disabled }, | |
| 1754 | + cursor: "pointer", | |
| 1755 | + textOverflow: "ellipsis", | |
| 1756 | + position: "absolute", | |
| 1757 | + top: 0, | |
| 1758 | + left: 0 | |
| 1759 | + }, | |
| 1760 | + width: "100%", | |
| 1761 | + position: "relative" | |
| 1762 | + })); | |
| 1833 | 1763 | |
| 1764 | +//#endregion | |
| 1765 | +//#region packages/packages/libs/editor-ui/src/components/popover/popover-action.tsx | |
| 1766 | + var SIZE = "tiny"; | |
| 1767 | + function PopoverAction({ title, visible = true, icon: Icon, content: PopoverContent }) { | |
| 1768 | + const { popupState, triggerProps, popoverProps } = useFloatingActionsPopover(); | |
| 1769 | + if (!visible) return null; | |
| 1770 | + return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, { | |
| 1771 | + placement: "top", | |
| 1772 | + title | |
| 1773 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, { | |
| 1774 | + "aria-label": title, | |
| 1775 | + size: SIZE, | |
| 1776 | + ...triggerProps | |
| 1777 | + }, /* @__PURE__ */ react.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ react.createElement(_elementor_ui.Popover, { | |
| 1778 | + disableScrollLock: true, | |
| 1779 | + anchorOrigin: { | |
| 1780 | + vertical: "bottom", | |
| 1781 | + horizontal: "right" | |
| 1782 | + }, | |
| 1783 | + transformOrigin: { | |
| 1784 | + vertical: "top", | |
| 1785 | + horizontal: "right" | |
| 1786 | + }, | |
| 1787 | + PaperProps: { sx: { my: 2.5 } }, | |
| 1788 | + ...popoverProps | |
| 1789 | + }, /* @__PURE__ */ react.createElement(PopoverContent, { close: popupState.close }))); | |
| 1790 | + } | |
| 1791 | + function useFloatingActionsPopover() { | |
| 1792 | + const { setOpen } = useFloatingActionsBar(); | |
| 1793 | + const popupState = (0, _elementor_ui.usePopupState)({ variant: "popover" }); | |
| 1794 | + const triggerProps = (0, _elementor_ui.bindTrigger)(popupState); | |
| 1795 | + const popoverProps = (0, _elementor_ui.bindPopover)(popupState); | |
| 1796 | + const onClick = (e) => { | |
| 1797 | + triggerProps.onClick(e); | |
| 1798 | + setOpen(true); | |
| 1799 | + }; | |
| 1800 | + const onClose = () => { | |
| 1801 | + popoverProps.onClose(); | |
| 1802 | + setOpen(false); | |
| 1803 | + }; | |
| 1804 | + const close = () => { | |
| 1805 | + popupState.close(); | |
| 1806 | + setOpen(false); | |
| 1807 | + }; | |
| 1808 | + return { | |
| 1809 | + popupState: { | |
| 1810 | + ...popupState, | |
| 1811 | + close | |
| 1812 | + }, | |
| 1813 | + triggerProps: { | |
| 1814 | + ...triggerProps, | |
| 1815 | + onClick | |
| 1816 | + }, | |
| 1817 | + popoverProps: { | |
| 1818 | + ...popoverProps, | |
| 1819 | + onClose | |
| 1820 | + } | |
| 1821 | + }; | |
| 1822 | + } | |
| 1834 | 1823 | |
| 1824 | +//#endregion | |
| 1825 | +//#region packages/packages/libs/editor-ui/src/components/save-changes-dialog.tsx | |
| 1826 | + var TITLE_ID$1 = "save-changes-dialog"; | |
| 1827 | + var SaveChangesDialog = ({ children, onClose }) => /* @__PURE__ */ react.createElement(_elementor_ui.Dialog, { | |
| 1828 | + open: true, | |
| 1829 | + onClose, | |
| 1830 | + "aria-labelledby": TITLE_ID$1, | |
| 1831 | + maxWidth: "xs" | |
| 1832 | + }, children); | |
| 1833 | + var SaveChangesDialogTitle = ({ children, onClose }) => /* @__PURE__ */ react.createElement(_elementor_ui.DialogTitle, { | |
| 1834 | + id: TITLE_ID$1, | |
| 1835 | + display: "flex", | |
| 1836 | + alignItems: "center", | |
| 1837 | + gap: 1, | |
| 1838 | + sx: { | |
| 1839 | + lineHeight: 1, | |
| 1840 | + justifyContent: "space-between" | |
| 1841 | + } | |
| 1842 | + }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { | |
| 1843 | + direction: "row", | |
| 1844 | + alignItems: "center", | |
| 1845 | + gap: 1 | |
| 1846 | + }, /* @__PURE__ */ react.createElement(_elementor_icons.AlertTriangleFilledIcon, { color: "secondary" }), children), onClose && /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, { | |
| 1847 | + onClick: onClose, | |
| 1848 | + size: "small" | |
| 1849 | + }, /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, null))); | |
| 1850 | + var SaveChangesDialogContent = ({ children }) => /* @__PURE__ */ react.createElement(_elementor_ui.DialogContent, null, children); | |
| 1851 | + var SaveChangesDialogContentText = (props) => /* @__PURE__ */ react.createElement(_elementor_ui.DialogContentText, { | |
| 1852 | + variant: "body2", | |
| 1853 | + color: "textPrimary", | |
| 1854 | + display: "flex", | |
| 1855 | + flexDirection: "column", | |
| 1856 | + ...props | |
| 1857 | + }); | |
| 1858 | + var SaveChangesDialogActions = ({ actions }) => { | |
| 1859 | + const [isConfirming, setIsConfirming] = (0, react.useState)(false); | |
| 1860 | + const { cancel, confirm, discard } = actions; | |
| 1861 | + const onConfirm = async () => { | |
| 1862 | + setIsConfirming(true); | |
| 1863 | + await confirm.action(); | |
| 1864 | + setIsConfirming(false); | |
| 1865 | + }; | |
| 1866 | + return /* @__PURE__ */ react.createElement(_elementor_ui.DialogActions, null, cancel && /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 1867 | + variant: "text", | |
| 1868 | + color: "secondary", | |
| 1869 | + onClick: cancel.action | |
| 1870 | + }, cancel.label), discard && /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 1871 | + variant: "text", | |
| 1872 | + color: "secondary", | |
| 1873 | + onClick: discard.action | |
| 1874 | + }, discard.label), /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 1875 | + variant: "contained", | |
| 1876 | + color: "secondary", | |
| 1877 | + onClick: onConfirm, | |
| 1878 | + loading: isConfirming | |
| 1879 | + }, confirm.label)); | |
| 1880 | + }; | |
| 1881 | + SaveChangesDialog.Title = SaveChangesDialogTitle; | |
| 1882 | + SaveChangesDialog.Content = SaveChangesDialogContent; | |
| 1883 | + SaveChangesDialog.ContentText = SaveChangesDialogContentText; | |
| 1884 | + SaveChangesDialog.Actions = SaveChangesDialogActions; | |
| 1885 | + var useDialog = () => { | |
| 1886 | + const [isOpen, setIsOpen] = (0, react.useState)(false); | |
| 1887 | + const open = () => setIsOpen(true); | |
| 1888 | + const close = () => setIsOpen(false); | |
| 1889 | + return { | |
| 1890 | + isOpen, | |
| 1891 | + open, | |
| 1892 | + close | |
| 1893 | + }; | |
| 1894 | + }; | |
| 1835 | 1895 | |
| 1836 | -const GlobalDialog = () => { | |
| 1837 | - const [content, setContent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); | |
| 1838 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 1839 | - const unsubscribe = (0,_subscribers__WEBPACK_IMPORTED_MODULE_3__.subscribeToDialogState)(setContent); | |
| 1840 | - return () => { | |
| 1841 | - unsubscribe(); | |
| 1842 | - }; | |
| 1843 | - }, []); | |
| 1844 | - if (!content) { | |
| 1845 | - return null; | |
| 1846 | - } | |
| 1847 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_theme_provider__WEBPACK_IMPORTED_MODULE_2__["default"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Dialog, { | |
| 1848 | - role: "dialog", | |
| 1849 | - open: true, | |
| 1850 | - onClose: _subscribers__WEBPACK_IMPORTED_MODULE_3__.closeDialog, | |
| 1851 | - maxWidth: "sm", | |
| 1852 | - fullWidth: true | |
| 1853 | - }, content.component)); | |
| 1854 | -}; | |
| 1896 | +//#endregion | |
| 1897 | +//#region packages/packages/libs/editor-ui/src/components/confirmation-dialog.tsx | |
| 1898 | + var TITLE_ID = "confirmation-dialog"; | |
| 1899 | + var ConfirmationDialog = ({ open, onClose, children }) => /* @__PURE__ */ react.createElement(_elementor_ui.Dialog, { | |
| 1900 | + open, | |
| 1901 | + onClose, | |
| 1902 | + "aria-labelledby": TITLE_ID, | |
| 1903 | + maxWidth: "sm" | |
| 1904 | + }, children); | |
| 1905 | + var ConfirmationDialogTitle = ({ children, icon: Icon = _elementor_icons.AlertOctagonFilledIcon, iconColor = "error" }) => /* @__PURE__ */ react.createElement(_elementor_ui.DialogTitle, { | |
| 1906 | + id: TITLE_ID, | |
| 1907 | + display: "flex", | |
| 1908 | + alignItems: "center", | |
| 1909 | + gap: 1, | |
| 1910 | + sx: { lineHeight: 1 } | |
| 1911 | + }, /* @__PURE__ */ react.createElement(Icon, { color: iconColor }), children); | |
| 1912 | + var ConfirmationDialogContent = ({ children }) => /* @__PURE__ */ react.createElement(_elementor_ui.DialogContent, { sx: { mt: 2 } }, children); | |
| 1913 | + var ConfirmationDialogContentText = (props) => /* @__PURE__ */ react.createElement(_elementor_ui.DialogContentText, { | |
| 1914 | + variant: "body2", | |
| 1915 | + color: "secondary", | |
| 1916 | + ...props | |
| 1917 | + }); | |
| 1918 | + var ConfirmationDialogActions = ({ onClose, onConfirm, cancelLabel, confirmLabel, color = "error", onSuppressMessage, suppressLabel = (0, _wordpress_i18n.__)("Don't show this again", "elementor") }) => { | |
| 1919 | + const [dontShowAgain, setDontShowAgain] = (0, react.useState)(false); | |
| 1920 | + const handleConfirm = () => { | |
| 1921 | + if (dontShowAgain && onSuppressMessage) onSuppressMessage(); | |
| 1922 | + onConfirm(); | |
| 1923 | + }; | |
| 1924 | + return /* @__PURE__ */ react.createElement(_elementor_ui.DialogActions, { sx: onSuppressMessage ? { | |
| 1925 | + justifyContent: "space-between", | |
| 1926 | + alignItems: "center" | |
| 1927 | + } : void 0 }, onSuppressMessage && /* @__PURE__ */ react.createElement(_elementor_ui.FormControlLabel, { | |
| 1928 | + control: /* @__PURE__ */ react.createElement(_elementor_ui.Checkbox, { | |
| 1929 | + checked: dontShowAgain, | |
| 1930 | + onChange: (event) => setDontShowAgain(event.target.checked), | |
| 1931 | + size: "medium", | |
| 1932 | + color: "secondary" | |
| 1933 | + }), | |
| 1934 | + label: /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { | |
| 1935 | + variant: "body2", | |
| 1936 | + color: "text.secondary" | |
| 1937 | + }, suppressLabel) | |
| 1938 | + }), /* @__PURE__ */ react.createElement("div", null, /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 1939 | + color: "secondary", | |
| 1940 | + onClick: onClose | |
| 1941 | + }, cancelLabel ?? (0, _wordpress_i18n.__)("Not now", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Button, { | |
| 1942 | + autoFocus: true, | |
| 1943 | + variant: "contained", | |
| 1944 | + color, | |
| 1945 | + onClick: handleConfirm, | |
| 1946 | + sx: { ml: 1 } | |
| 1947 | + }, confirmLabel ?? (0, _wordpress_i18n.__)("Delete", "elementor")))); | |
| 1948 | + }; | |
| 1949 | + ConfirmationDialog.Title = ConfirmationDialogTitle; | |
| 1950 | + ConfirmationDialog.Content = ConfirmationDialogContent; | |
| 1951 | + ConfirmationDialog.ContentText = ConfirmationDialogContentText; | |
| 1952 | + ConfirmationDialog.Actions = ConfirmationDialogActions; | |
| 1855 | 1953 | |
| 1856 | -/***/ }), | |
| 1954 | +//#endregion | |
| 1955 | +//#region packages/packages/libs/editor-ui/src/hooks/use-editable.ts | |
| 1956 | + var useEditable = ({ value, onSubmit, validation, onClick, onError }) => { | |
| 1957 | + const [isEditing, setIsEditing] = (0, react.useState)(false); | |
| 1958 | + const [error, setError] = (0, react.useState)(null); | |
| 1959 | + const ref = useSelection(isEditing); | |
| 1960 | + const isDirty = (newValue) => newValue !== value; | |
| 1961 | + const openEditMode = () => { | |
| 1962 | + setIsEditing(true); | |
| 1963 | + }; | |
| 1964 | + const closeEditMode = () => { | |
| 1965 | + setError(null); | |
| 1966 | + onError?.(null); | |
| 1967 | + setIsEditing(false); | |
| 1968 | + }; | |
| 1969 | + const submit = (newValue) => { | |
| 1970 | + if (!isDirty(newValue)) { | |
| 1971 | + closeEditMode(); | |
| 1972 | + return; | |
| 1973 | + } | |
| 1974 | + if (!error) try { | |
| 1975 | + onSubmit(newValue); | |
| 1976 | + } finally { | |
| 1977 | + closeEditMode(); | |
| 1978 | + } | |
| 1979 | + }; | |
| 1980 | + const onChange = (event) => { | |
| 1981 | + const { innerText: newValue } = event.target; | |
| 1982 | + if (validation) { | |
| 1983 | + const updatedError = isDirty(newValue) ? validation(newValue) : null; | |
| 1984 | + setError(updatedError); | |
| 1985 | + onError?.(updatedError); | |
| 1986 | + } | |
| 1987 | + }; | |
| 1988 | + const handleKeyDown = (event) => { | |
| 1989 | + event.stopPropagation(); | |
| 1990 | + if (["Escape"].includes(event.key)) return closeEditMode(); | |
| 1991 | + if (["Enter"].includes(event.key)) { | |
| 1992 | + event.preventDefault(); | |
| 1993 | + if (!error) ref.current?.blur(); | |
| 1994 | + } | |
| 1995 | + }; | |
| 1996 | + const handleClick = (event) => { | |
| 1997 | + if (isEditing) event.stopPropagation(); | |
| 1998 | + onClick?.(event); | |
| 1999 | + }; | |
| 2000 | + const handleBlur = () => { | |
| 2001 | + if (error) { | |
| 2002 | + closeEditMode(); | |
| 2003 | + return; | |
| 2004 | + } | |
| 2005 | + submit(ref.current.innerText); | |
| 2006 | + }; | |
| 2007 | + const listeners = { | |
| 2008 | + onClick: handleClick, | |
| 2009 | + onKeyDown: handleKeyDown, | |
| 2010 | + onInput: onChange, | |
| 2011 | + onBlur: handleBlur | |
| 2012 | + }; | |
| 2013 | + const attributes = { | |
| 2014 | + value, | |
| 2015 | + role: "textbox", | |
| 2016 | + contentEditable: isEditing, | |
| 2017 | + ...isEditing && { suppressContentEditableWarning: true } | |
| 2018 | + }; | |
| 2019 | + return { | |
| 2020 | + ref, | |
| 2021 | + isEditing, | |
| 2022 | + openEditMode, | |
| 2023 | + closeEditMode, | |
| 2024 | + value, | |
| 2025 | + error, | |
| 2026 | + getProps: () => ({ | |
| 2027 | + ...listeners, | |
| 2028 | + ...attributes | |
| 2029 | + }) | |
| 2030 | + }; | |
| 2031 | + }; | |
| 2032 | + var useSelection = (isEditing) => { | |
| 2033 | + const ref = (0, react.useRef)(null); | |
| 2034 | + (0, react.useEffect)(() => { | |
| 2035 | + if (isEditing) selectAll(ref.current); | |
| 2036 | + }, [isEditing]); | |
| 2037 | + return ref; | |
| 2038 | + }; | |
| 2039 | + var selectAll = (el) => { | |
| 2040 | + const selection = getSelection(); | |
| 2041 | + if (!selection || !el) return; | |
| 2042 | + const range = document.createRange(); | |
| 2043 | + range.selectNodeContents(el); | |
| 2044 | + selection.removeAllRanges(); | |
| 2045 | + selection.addRange(range); | |
| 2046 | + }; | |
| 1857 | 2047 | |
| 1858 | -/***/ "./packages/packages/libs/editor-ui/src/components/global-dialog/index.ts": | |
| 1859 | -/*!********************************************************************************!*\ | |
| 1860 | - !*** ./packages/packages/libs/editor-ui/src/components/global-dialog/index.ts ***! | |
| 1861 | - \********************************************************************************/ | |
| 1862 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2048 | +//#endregion | |
| 2049 | +//#region packages/packages/libs/editor-ui/src/index.ts | |
| 2050 | + var src_exports = /* @__PURE__ */ __exportAll({ | |
| 2051 | + CollapseIcon: () => CollapseIcon, | |
| 2052 | + CollapsibleContent: () => CollapsibleContent, | |
| 2053 | + ConfirmationDialog: () => ConfirmationDialog, | |
| 2054 | + CtaButton: () => CtaButton, | |
| 2055 | + EditableField: () => EditableField, | |
| 2056 | + EllipsisWithTooltip: () => EllipsisWithTooltip, | |
| 2057 | + FileUploadDropzone: () => FileUploadDropzone, | |
| 2058 | + FileUploadRow: () => FileUploadRow, | |
| 2059 | + FloatingActionsBar: () => FloatingActionsBar, | |
| 2060 | + Form: () => Form, | |
| 2061 | + GlobalDialog: () => GlobalDialog, | |
| 2062 | + ITEM_HEIGHT: () => 32, | |
| 2063 | + InfoAlert: () => InfoAlert, | |
| 2064 | + InfoTipCard: () => InfoTipCard, | |
| 2065 | + IntroductionModal: () => IntroductionModal, | |
| 2066 | + MenuItemInfotip: () => MenuItemInfotip, | |
| 2067 | + MenuListItem: () => MenuListItem, | |
| 2068 | + PopoverAction: () => PopoverAction, | |
| 2069 | + PopoverBody: () => PopoverBody, | |
| 2070 | + PopoverHeader: () => PopoverHeader, | |
| 2071 | + PopoverMenuList: () => PopoverMenuList, | |
| 2072 | + PromotionAlert: () => PromotionAlert, | |
| 2073 | + PromotionChip: () => PromotionChip, | |
| 2074 | + PromotionInfotip: () => PromotionInfotip, | |
| 2075 | + PromotionPopover: () => PromotionPopover, | |
| 2076 | + SaveChangesDialog: () => SaveChangesDialog, | |
| 2077 | + SearchField: () => SearchField, | |
| 2078 | + SectionPopoverBody: () => SectionPopoverBody, | |
| 2079 | + SectionRefContext: () => SectionRefContext, | |
| 2080 | + StyledMenuList: () => StyledMenuList, | |
| 2081 | + ThemeProvider: () => ThemeProvider, | |
| 2082 | + WarningInfotip: () => WarningInfotip, | |
| 2083 | + closeDialog: () => closeDialog, | |
| 2084 | + getCollapsibleValue: () => getCollapsibleValue, | |
| 2085 | + openDialog: () => openDialog, | |
| 2086 | + useCanvasClickHandler: () => useCanvasClickHandler, | |
| 2087 | + useDialog: () => useDialog, | |
| 2088 | + useEditable: () => useEditable, | |
| 2089 | + useFloatingActionsBar: () => useFloatingActionsBar, | |
| 2090 | + useSectionWidth: () => useSectionWidth, | |
| 2091 | + useTextFieldAutoSelect: () => useTextFieldAutoSelect | |
| 2092 | + }); | |
| 1863 | 2093 | |
| 1864 | -__webpack_require__.r(__webpack_exports__); | |
| 1865 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1866 | -/* harmony export */ GlobalDialog: function() { return /* reexport safe */ _components_global_dialog__WEBPACK_IMPORTED_MODULE_0__.GlobalDialog; }, | |
| 1867 | -/* harmony export */ closeDialog: function() { return /* reexport safe */ _subscribers__WEBPACK_IMPORTED_MODULE_1__.closeDialog; }, | |
| 1868 | -/* harmony export */ openDialog: function() { return /* reexport safe */ _subscribers__WEBPACK_IMPORTED_MODULE_1__.openDialog; } | |
| 1869 | -/* harmony export */ }); | |
| 1870 | -/* harmony import */ var _components_global_dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/global-dialog */ "./packages/packages/libs/editor-ui/src/components/global-dialog/components/global-dialog.tsx"); | |
| 1871 | -/* harmony import */ var _subscribers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribers */ "./packages/packages/libs/editor-ui/src/components/global-dialog/subscribers.ts"); | |
| 2094 | +//#endregion | |
| 2095 | +//#region \0elementor-package-library-entry | |
| 2096 | + (window.elementorV2 = window.elementorV2 || {}).editorUi = src_exports; | |
| 1872 | 2097 | |
| 1873 | - | |
| 1874 | - | |
| 1875 | -/***/ }), | |
| 1876 | - | |
| 1877 | -/***/ "./packages/packages/libs/editor-ui/src/components/global-dialog/subscribers.ts": | |
| 1878 | -/*!**************************************************************************************!*\ | |
| 1879 | - !*** ./packages/packages/libs/editor-ui/src/components/global-dialog/subscribers.ts ***! | |
| 1880 | - \**************************************************************************************/ | |
| 1881 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1882 | - | |
| 1883 | -__webpack_require__.r(__webpack_exports__); | |
| 1884 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1885 | -/* harmony export */ closeDialog: function() { return /* binding */ closeDialog; }, | |
| 1886 | -/* harmony export */ openDialog: function() { return /* binding */ openDialog; }, | |
| 1887 | -/* harmony export */ subscribeToDialogState: function() { return /* binding */ subscribeToDialogState; } | |
| 1888 | -/* harmony export */ }); | |
| 1889 | -let currentDialogState = null; | |
| 1890 | -const stateSubscribers = new Set(); | |
| 1891 | -const subscribeToDialogState = callback => { | |
| 1892 | - stateSubscribers.add(callback); | |
| 1893 | - callback(currentDialogState); | |
| 1894 | - return () => stateSubscribers.delete(callback); | |
| 1895 | -}; | |
| 1896 | -const notifySubscribers = () => { | |
| 1897 | - stateSubscribers.forEach(callback => callback(currentDialogState)); | |
| 1898 | -}; | |
| 1899 | -const openDialog = ({ | |
| 1900 | - component | |
| 1901 | -}) => { | |
| 1902 | - currentDialogState = { | |
| 1903 | - component | |
| 1904 | - }; | |
| 1905 | - notifySubscribers(); | |
| 1906 | -}; | |
| 1907 | -const closeDialog = () => { | |
| 1908 | - currentDialogState = null; | |
| 1909 | - notifySubscribers(); | |
| 1910 | -}; | |
| 1911 | - | |
| 1912 | -/***/ }), | |
| 1913 | - | |
| 1914 | -/***/ "./packages/packages/libs/editor-ui/src/components/info-alert.tsx": | |
| 1915 | -/*!************************************************************************!*\ | |
| 1916 | - !*** ./packages/packages/libs/editor-ui/src/components/info-alert.tsx ***! | |
| 1917 | - \************************************************************************/ | |
| 1918 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1919 | - | |
| 1920 | -__webpack_require__.r(__webpack_exports__); | |
| 1921 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1922 | -/* harmony export */ InfoAlert: function() { return /* binding */ InfoAlert; } | |
| 1923 | -/* harmony export */ }); | |
| 1924 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1925 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1926 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1927 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 1928 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1929 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 1930 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 1931 | - | |
| 1932 | - | |
| 1933 | - | |
| 1934 | -const InfoAlert = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Alert, _extends({ | |
| 1935 | - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.InfoCircleFilledIcon, { | |
| 1936 | - fontSize: "small", | |
| 1937 | - color: "secondary" | |
| 1938 | - }), | |
| 1939 | - variant: 'standard', | |
| 1940 | - color: "secondary", | |
| 1941 | - elevation: 0, | |
| 1942 | - size: "small" | |
| 1943 | -}, props)); | |
| 1944 | - | |
| 1945 | -/***/ }), | |
| 1946 | - | |
| 1947 | -/***/ "./packages/packages/libs/editor-ui/src/components/infotip-card.tsx": | |
| 1948 | -/*!**************************************************************************!*\ | |
| 1949 | - !*** ./packages/packages/libs/editor-ui/src/components/infotip-card.tsx ***! | |
| 1950 | - \**************************************************************************/ | |
| 1951 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 1952 | - | |
| 1953 | -__webpack_require__.r(__webpack_exports__); | |
| 1954 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 1955 | -/* harmony export */ InfoTipCard: function() { return /* binding */ InfoTipCard; } | |
| 1956 | -/* harmony export */ }); | |
| 1957 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 1958 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 1959 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1960 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 1961 | - | |
| 1962 | - | |
| 1963 | -const InfoTipCard = ({ | |
| 1964 | - content, | |
| 1965 | - svgIcon, | |
| 1966 | - learnMoreButton, | |
| 1967 | - ctaButton | |
| 1968 | -}) => { | |
| 1969 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Card, { | |
| 1970 | - elevation: 0, | |
| 1971 | - sx: { | |
| 1972 | - width: 320 | |
| 1973 | - } | |
| 1974 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CardContent, { | |
| 1975 | - sx: { | |
| 1976 | - pb: 0 | |
| 1977 | - } | |
| 1978 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Box, { | |
| 1979 | - display: "flex", | |
| 1980 | - alignItems: "start" | |
| 1981 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.SvgIcon, { | |
| 1982 | - fontSize: "tiny", | |
| 1983 | - sx: { | |
| 1984 | - mr: 0.5 | |
| 1985 | - } | |
| 1986 | - }, svgIcon), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Typography, { | |
| 1987 | - variant: "body2" | |
| 1988 | - }, content, learnMoreButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, "\xA0", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Link, { | |
| 1989 | - color: "info.main", | |
| 1990 | - href: learnMoreButton.href, | |
| 1991 | - target: "_blank" | |
| 1992 | - }, learnMoreButton.label))))), ctaButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CardActions, { | |
| 1993 | - sx: { | |
| 1994 | - justifyContent: 'flex-start' | |
| 1995 | - } | |
| 1996 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { | |
| 1997 | - size: "small", | |
| 1998 | - color: "secondary", | |
| 1999 | - variant: "contained", | |
| 2000 | - onClick: ctaButton.onClick, | |
| 2001 | - sx: { | |
| 2002 | - marginInlineStart: '1rem' | |
| 2003 | - } | |
| 2004 | - }, ctaButton.label))); | |
| 2005 | -}; | |
| 2006 | - | |
| 2007 | -/***/ }), | |
| 2008 | - | |
| 2009 | -/***/ "./packages/packages/libs/editor-ui/src/components/introduction-modal.tsx": | |
| 2010 | -/*!********************************************************************************!*\ | |
| 2011 | - !*** ./packages/packages/libs/editor-ui/src/components/introduction-modal.tsx ***! | |
| 2012 | - \********************************************************************************/ | |
| 2013 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2014 | - | |
| 2015 | -__webpack_require__.r(__webpack_exports__); | |
| 2016 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2017 | -/* harmony export */ IntroductionModal: function() { return /* binding */ IntroductionModal; } | |
| 2018 | -/* harmony export */ }); | |
| 2019 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2020 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2021 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2022 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2023 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 2024 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); | |
| 2025 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2026 | - | |
| 2027 | - | |
| 2028 | - | |
| 2029 | - | |
| 2030 | -const IntroductionModal = ({ | |
| 2031 | - open, | |
| 2032 | - handleClose, | |
| 2033 | - title, | |
| 2034 | - children | |
| 2035 | -}) => { | |
| 2036 | - const [shouldShowAgain, setShouldShowAgain] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true); | |
| 2037 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Dialog, { | |
| 2038 | - open: open, | |
| 2039 | - onClose: handleClose, | |
| 2040 | - maxWidth: 'sm', | |
| 2041 | - TransitionComponent: Transition | |
| 2042 | - }, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.DialogHeader, { | |
| 2043 | - logo: false | |
| 2044 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.DialogTitle, null, title)), children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.DialogActions, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.FormControlLabel, { | |
| 2045 | - sx: { | |
| 2046 | - marginRight: 'auto' | |
| 2047 | - }, | |
| 2048 | - control: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Checkbox, { | |
| 2049 | - checked: !shouldShowAgain, | |
| 2050 | - onChange: () => setShouldShowAgain(!shouldShowAgain) | |
| 2051 | - }), | |
| 2052 | - label: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Typography, { | |
| 2053 | - variant: 'body2' | |
| 2054 | - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Don't show this again", 'elementor')) | |
| 2055 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { | |
| 2056 | - size: 'medium', | |
| 2057 | - variant: "contained", | |
| 2058 | - sx: { | |
| 2059 | - minWidth: '135px' | |
| 2060 | - }, | |
| 2061 | - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it introduction', 'elementor'), | |
| 2062 | - onClick: () => handleClose(shouldShowAgain) | |
| 2063 | - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'elementor')))); | |
| 2064 | -}; | |
| 2065 | -const Transition = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, ref) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Fade, _extends({ | |
| 2066 | - ref: ref | |
| 2067 | -}, props, { | |
| 2068 | - timeout: { | |
| 2069 | - enter: 1000, | |
| 2070 | - exit: 200 | |
| 2071 | - } | |
| 2072 | -}))); | |
| 2073 | - | |
| 2074 | -/***/ }), | |
| 2075 | - | |
| 2076 | -/***/ "./packages/packages/libs/editor-ui/src/components/menu-item.tsx": | |
| 2077 | -/*!***********************************************************************!*\ | |
| 2078 | - !*** ./packages/packages/libs/editor-ui/src/components/menu-item.tsx ***! | |
| 2079 | - \***********************************************************************/ | |
| 2080 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2081 | - | |
| 2082 | -__webpack_require__.r(__webpack_exports__); | |
| 2083 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2084 | -/* harmony export */ MenuItemInfotip: function() { return /* binding */ MenuItemInfotip; }, | |
| 2085 | -/* harmony export */ MenuListItem: function() { return /* binding */ MenuListItem; } | |
| 2086 | -/* harmony export */ }); | |
| 2087 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2088 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2089 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2090 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2091 | -/* harmony import */ var _info_alert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./info-alert */ "./packages/packages/libs/editor-ui/src/components/info-alert.tsx"); | |
| 2092 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2093 | - | |
| 2094 | - | |
| 2095 | - | |
| 2096 | - | |
| 2097 | -const MenuListItem = ({ | |
| 2098 | - children, | |
| 2099 | - menuItemTextProps, | |
| 2100 | - primaryTypographyProps = { | |
| 2101 | - variant: 'caption' | |
| 2102 | - }, | |
| 2103 | - ...props | |
| 2104 | -}) => { | |
| 2105 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.MenuItem, _extends({ | |
| 2106 | - dense: true | |
| 2107 | - }, props, { | |
| 2108 | - sx: { | |
| 2109 | - ...(props.sx ?? {}) | |
| 2110 | - } | |
| 2111 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.MenuItemText, _extends({ | |
| 2112 | - primary: children, | |
| 2113 | - primaryTypographyProps: primaryTypographyProps | |
| 2114 | - }, menuItemTextProps))); | |
| 2115 | -}; | |
| 2116 | -const MenuItemInfotip = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ | |
| 2117 | - showInfoTip = false, | |
| 2118 | - children, | |
| 2119 | - content | |
| 2120 | -}, ref) => { | |
| 2121 | - if (!showInfoTip) { | |
| 2122 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, children); | |
| 2123 | - } | |
| 2124 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Infotip, { | |
| 2125 | - ref: ref, | |
| 2126 | - placement: 'right', | |
| 2127 | - arrow: false, | |
| 2128 | - content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_info_alert__WEBPACK_IMPORTED_MODULE_2__.InfoAlert, { | |
| 2129 | - sx: { | |
| 2130 | - maxWidth: 325 | |
| 2131 | - } | |
| 2132 | - }, content) | |
| 2133 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { | |
| 2134 | - style: { | |
| 2135 | - pointerEvents: 'initial', | |
| 2136 | - width: '100%' | |
| 2137 | - }, | |
| 2138 | - onClick: e => e.stopPropagation() | |
| 2139 | - }, children)); | |
| 2140 | -}); | |
| 2141 | - | |
| 2142 | -/***/ }), | |
| 2143 | - | |
| 2144 | -/***/ "./packages/packages/libs/editor-ui/src/components/popover/body.tsx": | |
| 2145 | -/*!**************************************************************************!*\ | |
| 2146 | - !*** ./packages/packages/libs/editor-ui/src/components/popover/body.tsx ***! | |
| 2147 | - \**************************************************************************/ | |
| 2148 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2149 | - | |
| 2150 | -__webpack_require__.r(__webpack_exports__); | |
| 2151 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2152 | -/* harmony export */ PopoverBody: function() { return /* binding */ PopoverBody; } | |
| 2153 | -/* harmony export */ }); | |
| 2154 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2155 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2156 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2157 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2158 | - | |
| 2159 | - | |
| 2160 | -const SECTION_PADDING_INLINE = 32; | |
| 2161 | -const DEFAULT_POPOVER_HEIGHT = 348; | |
| 2162 | -const FALLBACK_POPOVER_WIDTH = 220; | |
| 2163 | -const PopoverBody = ({ | |
| 2164 | - children, | |
| 2165 | - height = DEFAULT_POPOVER_HEIGHT, | |
| 2166 | - width, | |
| 2167 | - id | |
| 2168 | -}) => { | |
| 2169 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Box, { | |
| 2170 | - display: "flex", | |
| 2171 | - flexDirection: "column", | |
| 2172 | - sx: { | |
| 2173 | - height, | |
| 2174 | - overflow: 'hidden', | |
| 2175 | - width: `${width ? width - SECTION_PADDING_INLINE : FALLBACK_POPOVER_WIDTH}px`, | |
| 2176 | - maxWidth: 496 | |
| 2177 | - }, | |
| 2178 | - id: id | |
| 2179 | - }, children); | |
| 2180 | -}; | |
| 2181 | - | |
| 2182 | -/***/ }), | |
| 2183 | - | |
| 2184 | -/***/ "./packages/packages/libs/editor-ui/src/components/popover/header.tsx": | |
| 2185 | -/*!****************************************************************************!*\ | |
| 2186 | - !*** ./packages/packages/libs/editor-ui/src/components/popover/header.tsx ***! | |
| 2187 | - \****************************************************************************/ | |
| 2188 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2189 | - | |
| 2190 | -__webpack_require__.r(__webpack_exports__); | |
| 2191 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2192 | -/* harmony export */ PopoverHeader: function() { return /* binding */ PopoverHeader; } | |
| 2193 | -/* harmony export */ }); | |
| 2194 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2195 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2196 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2197 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2198 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2199 | - | |
| 2200 | - | |
| 2201 | -const SIZE = 'tiny'; | |
| 2202 | -const PopoverHeader = ({ | |
| 2203 | - title, | |
| 2204 | - onClose, | |
| 2205 | - icon, | |
| 2206 | - actions | |
| 2207 | -}) => { | |
| 2208 | - const paddingAndSizing = { | |
| 2209 | - pl: 2, | |
| 2210 | - pr: 1, | |
| 2211 | - py: 1.5, | |
| 2212 | - maxHeight: 36 | |
| 2213 | - }; | |
| 2214 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Stack, _extends({ | |
| 2215 | - direction: "row", | |
| 2216 | - alignItems: "center" | |
| 2217 | - }, paddingAndSizing, { | |
| 2218 | - sx: { | |
| 2219 | - columnGap: 0.5 | |
| 2220 | - } | |
| 2221 | - }), icon, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Typography, { | |
| 2222 | - variant: "subtitle2", | |
| 2223 | - sx: { | |
| 2224 | - fontSize: '12px', | |
| 2225 | - mt: 0.25 | |
| 2226 | - } | |
| 2227 | - }, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Stack, { | |
| 2228 | - direction: "row", | |
| 2229 | - sx: { | |
| 2230 | - ml: 'auto' | |
| 2231 | - } | |
| 2232 | - }, actions, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CloseButton, { | |
| 2233 | - slotProps: { | |
| 2234 | - icon: { | |
| 2235 | - fontSize: SIZE | |
| 2236 | - } | |
| 2237 | - }, | |
| 2238 | - sx: { | |
| 2239 | - ml: 'auto' | |
| 2240 | - }, | |
| 2241 | - onClick: onClose | |
| 2242 | - }))); | |
| 2243 | -}; | |
| 2244 | - | |
| 2245 | -/***/ }), | |
| 2246 | - | |
| 2247 | -/***/ "./packages/packages/libs/editor-ui/src/components/popover/index.ts": | |
| 2248 | -/*!**************************************************************************!*\ | |
| 2249 | - !*** ./packages/packages/libs/editor-ui/src/components/popover/index.ts ***! | |
| 2250 | - \**************************************************************************/ | |
| 2251 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2252 | - | |
| 2253 | -__webpack_require__.r(__webpack_exports__); | |
| 2254 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2255 | -/* harmony export */ ITEM_HEIGHT: function() { return /* reexport safe */ _menu_list__WEBPACK_IMPORTED_MODULE_3__.ITEM_HEIGHT; }, | |
| 2256 | -/* harmony export */ PopoverAction: function() { return /* reexport safe */ _popover_action__WEBPACK_IMPORTED_MODULE_4__.PopoverAction; }, | |
| 2257 | -/* harmony export */ PopoverBody: function() { return /* reexport safe */ _body__WEBPACK_IMPORTED_MODULE_0__.PopoverBody; }, | |
| 2258 | -/* harmony export */ PopoverHeader: function() { return /* reexport safe */ _header__WEBPACK_IMPORTED_MODULE_2__.PopoverHeader; }, | |
| 2259 | -/* harmony export */ PopoverMenuList: function() { return /* reexport safe */ _menu_list__WEBPACK_IMPORTED_MODULE_3__.PopoverMenuList; }, | |
| 2260 | -/* harmony export */ SectionPopoverBody: function() { return /* reexport safe */ _section_popover_body__WEBPACK_IMPORTED_MODULE_1__.SectionPopoverBody; }, | |
| 2261 | -/* harmony export */ StyledMenuList: function() { return /* reexport safe */ _menu_list__WEBPACK_IMPORTED_MODULE_3__.StyledMenuList; } | |
| 2262 | -/* harmony export */ }); | |
| 2263 | -/* harmony import */ var _body__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./body */ "./packages/packages/libs/editor-ui/src/components/popover/body.tsx"); | |
| 2264 | -/* harmony import */ var _section_popover_body__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./section-popover-body */ "./packages/packages/libs/editor-ui/src/components/popover/section-popover-body.tsx"); | |
| 2265 | -/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./header */ "./packages/packages/libs/editor-ui/src/components/popover/header.tsx"); | |
| 2266 | -/* harmony import */ var _menu_list__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./menu-list */ "./packages/packages/libs/editor-ui/src/components/popover/menu-list.tsx"); | |
| 2267 | -/* harmony import */ var _popover_action__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./popover-action */ "./packages/packages/libs/editor-ui/src/components/popover/popover-action.tsx"); | |
| 2268 | - | |
| 2269 | - | |
| 2270 | - | |
| 2271 | - | |
| 2272 | - | |
| 2273 | - | |
| 2274 | -/***/ }), | |
| 2275 | - | |
| 2276 | -/***/ "./packages/packages/libs/editor-ui/src/components/popover/menu-list.tsx": | |
| 2277 | -/*!*******************************************************************************!*\ | |
| 2278 | - !*** ./packages/packages/libs/editor-ui/src/components/popover/menu-list.tsx ***! | |
| 2279 | - \*******************************************************************************/ | |
| 2280 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2281 | - | |
| 2282 | -__webpack_require__.r(__webpack_exports__); | |
| 2283 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2284 | -/* harmony export */ ITEM_HEIGHT: function() { return /* binding */ ITEM_HEIGHT; }, | |
| 2285 | -/* harmony export */ PopoverMenuList: function() { return /* binding */ PopoverMenuList; }, | |
| 2286 | -/* harmony export */ StyledMenuList: function() { return /* binding */ StyledMenuList; } | |
| 2287 | -/* harmony export */ }); | |
| 2288 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2289 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2290 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2291 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2292 | -/* harmony import */ var _tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tanstack/react-virtual */ "./packages/node_modules/@tanstack/react-virtual/dist/esm/index.js"); | |
| 2293 | -/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks */ "./packages/packages/libs/editor-ui/src/hooks/index.ts"); | |
| 2294 | - | |
| 2295 | - | |
| 2296 | - | |
| 2297 | - | |
| 2298 | - | |
| 2299 | -const ITEM_HEIGHT = 32; | |
| 2300 | -const LIST_ITEMS_BUFFER = 6; | |
| 2301 | -const MENU_LIST_PADDING_TOP = 8; | |
| 2302 | -const menuSubHeaderAbsoluteStyling = start => ({ | |
| 2303 | - position: 'absolute', | |
| 2304 | - transform: `translateY(${start + MENU_LIST_PADDING_TOP}px)` | |
| 2305 | -}); | |
| 2306 | -const getAdjacentStickyIndices = (stickyIndices, range) => { | |
| 2307 | - const previousTwoStickyIndices = stickyIndices.filter(stickyIndex => stickyIndex < range.startIndex).slice(-2); | |
| 2308 | - const nextTwoStickyIndices = stickyIndices.filter(stickyIndex => stickyIndex > range.endIndex).slice(0, 2); | |
| 2309 | - return [...previousTwoStickyIndices, ...nextTwoStickyIndices]; | |
| 2310 | -}; | |
| 2311 | -const PopoverMenuList = ({ | |
| 2312 | - items, | |
| 2313 | - onSelect, | |
| 2314 | - onClose, | |
| 2315 | - selectedValue, | |
| 2316 | - itemStyle, | |
| 2317 | - onChange, | |
| 2318 | - 'data-testid': dataTestId, | |
| 2319 | - menuItemContentTemplate, | |
| 2320 | - categoryItemContentTemplate, | |
| 2321 | - noResultsComponent, | |
| 2322 | - menuListTemplate: CustomMenuList | |
| 2323 | -}) => { | |
| 2324 | - const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); | |
| 2325 | - const scrollTop = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.useScrollTop)({ | |
| 2326 | - containerRef | |
| 2327 | - }); | |
| 2328 | - const theme = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.useTheme)(); | |
| 2329 | - const MenuListComponent = CustomMenuList || StyledMenuList; | |
| 2330 | - const stickyIndices = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => items.reduce((categoryIndices, item, index) => { | |
| 2331 | - if (item.type === 'category') { | |
| 2332 | - categoryIndices.push(index); | |
| 2333 | - } | |
| 2334 | - return categoryIndices; | |
| 2335 | - }, []), [items]); | |
| 2336 | - const getActiveItemIndices = range => { | |
| 2337 | - const visibleAndStickyIndexes = []; | |
| 2338 | - for (let i = range.startIndex; i <= range.endIndex; i++) { | |
| 2339 | - visibleAndStickyIndexes.push(i); | |
| 2340 | - } | |
| 2341 | - const stickyIndicesToShow = getAdjacentStickyIndices(stickyIndices, range); | |
| 2342 | - stickyIndicesToShow.forEach(stickyIndex => { | |
| 2343 | - if (!visibleAndStickyIndexes.includes(stickyIndex)) { | |
| 2344 | - visibleAndStickyIndexes.push(stickyIndex); | |
| 2345 | - } | |
| 2346 | - }); | |
| 2347 | - return visibleAndStickyIndexes.sort((a, b) => a - b); | |
| 2348 | - }; | |
| 2349 | - const onChangeCallback = ({ | |
| 2350 | - getVirtualIndexes | |
| 2351 | - }) => { | |
| 2352 | - const visibleItems = getVirtualIndexes().map(index => items[index]); | |
| 2353 | - onChange?.(visibleItems); | |
| 2354 | - }; | |
| 2355 | - const virtualizer = (0,_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_2__.useVirtualizer)({ | |
| 2356 | - count: items.length, | |
| 2357 | - getScrollElement: () => containerRef.current, | |
| 2358 | - estimateSize: () => ITEM_HEIGHT, | |
| 2359 | - overscan: LIST_ITEMS_BUFFER, | |
| 2360 | - rangeExtractor: getActiveItemIndices, | |
| 2361 | - onChange: onChangeCallback | |
| 2362 | - }); | |
| 2363 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 2364 | - onChangeCallback(virtualizer); | |
| 2365 | - // eslint-disable-next-line react-hooks/exhaustive-deps | |
| 2366 | - }, [items]); | |
| 2367 | - (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.useScrollToSelected)({ | |
| 2368 | - selectedValue, | |
| 2369 | - items, | |
| 2370 | - virtualizer | |
| 2371 | - }); | |
| 2372 | - const virtualItems = virtualizer.getVirtualItems(); | |
| 2373 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Box, { | |
| 2374 | - ref: containerRef, | |
| 2375 | - sx: { | |
| 2376 | - height: '100%', | |
| 2377 | - overflowY: 'auto' | |
| 2378 | - } | |
| 2379 | - }, items.length === 0 && noResultsComponent ? noResultsComponent : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(MenuListComponent, { | |
| 2380 | - role: "listbox", | |
| 2381 | - style: { | |
| 2382 | - height: `${virtualizer.getTotalSize()}px` | |
| 2383 | - }, | |
| 2384 | - "data-testid": dataTestId | |
| 2385 | - }, virtualItems.map(virtualRow => { | |
| 2386 | - const item = items[virtualRow.index]; | |
| 2387 | - const isLast = virtualRow.index === items.length - 1; | |
| 2388 | - const isFirst = items[0]?.type === 'category' ? virtualRow.index === 1 : virtualRow.index === 0; | |
| 2389 | - const isSelected = selectedValue === item.value; | |
| 2390 | - const tabIndexFallback = !selectedValue ? 0 : -1; | |
| 2391 | - if (!item) { | |
| 2392 | - return null; | |
| 2393 | - } | |
| 2394 | - if (item.type === 'category') { | |
| 2395 | - const shouldStick = virtualRow.start + MENU_LIST_PADDING_TOP <= scrollTop; | |
| 2396 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.MenuSubheader, { | |
| 2397 | - key: virtualRow.key, | |
| 2398 | - style: shouldStick ? {} : menuSubHeaderAbsoluteStyling(virtualRow.start), | |
| 2399 | - sx: { | |
| 2400 | - fontWeight: '400', | |
| 2401 | - color: 'text.tertiary' | |
| 2402 | - } | |
| 2403 | - }, categoryItemContentTemplate ? categoryItemContentTemplate(item) : item.label || item.value); | |
| 2404 | - } | |
| 2405 | - const isDisabled = item.disabled; | |
| 2406 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.ListItem, { | |
| 2407 | - key: virtualRow.key, | |
| 2408 | - role: "option", | |
| 2409 | - "aria-selected": isSelected, | |
| 2410 | - "aria-disabled": isDisabled, | |
| 2411 | - onClick: isDisabled ? undefined : e => { | |
| 2412 | - if (e.target.closest('button')) { | |
| 2413 | - return; | |
| 2414 | - } | |
| 2415 | - onSelect(item.value); | |
| 2416 | - onClose(); | |
| 2417 | - }, | |
| 2418 | - onKeyDown: event => { | |
| 2419 | - if (event.key === 'Enter' && !isDisabled) { | |
| 2420 | - onSelect(item.value); | |
| 2421 | - onClose(); | |
| 2422 | - } | |
| 2423 | - if (event.key === 'ArrowDown' && isLast) { | |
| 2424 | - event.preventDefault(); | |
| 2425 | - event.stopPropagation(); | |
| 2426 | - } | |
| 2427 | - if (event.key === 'ArrowUp' && isFirst) { | |
| 2428 | - event.preventDefault(); | |
| 2429 | - event.stopPropagation(); | |
| 2430 | - } | |
| 2431 | - }, | |
| 2432 | - tabIndex: isSelected ? 0 : tabIndexFallback, | |
| 2433 | - sx: { | |
| 2434 | - transform: `translateY(${virtualRow.start + MENU_LIST_PADDING_TOP}px)`, | |
| 2435 | - ...theme.typography.caption, | |
| 2436 | - ...(itemStyle ? itemStyle(item) : {}) | |
| 2437 | - } | |
| 2438 | - }, menuItemContentTemplate ? menuItemContentTemplate(item) : item.label || item.value); | |
| 2439 | - }))); | |
| 2440 | -}; | |
| 2441 | -const StyledMenuList = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.styled)(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.MenuList)(({ | |
| 2442 | - theme | |
| 2443 | -}) => ({ | |
| 2444 | - '& > li': { | |
| 2445 | - height: ITEM_HEIGHT, | |
| 2446 | - width: '100%', | |
| 2447 | - display: 'flex', | |
| 2448 | - alignItems: 'center' | |
| 2449 | - }, | |
| 2450 | - '& > [role="option"]': { | |
| 2451 | - lineHeight: 'inherit', | |
| 2452 | - padding: theme.spacing(0.75, 2, 0.75, 4), | |
| 2453 | - '&:hover, &:focus': { | |
| 2454 | - backgroundColor: theme.palette.action.hover | |
| 2455 | - }, | |
| 2456 | - '&[aria-selected="true"]': { | |
| 2457 | - backgroundColor: theme.palette.action.selected | |
| 2458 | - }, | |
| 2459 | - '&[aria-disabled="true"]': { | |
| 2460 | - color: theme.palette.text.disabled | |
| 2461 | - }, | |
| 2462 | - cursor: 'pointer', | |
| 2463 | - textOverflow: 'ellipsis', | |
| 2464 | - position: 'absolute', | |
| 2465 | - top: 0, | |
| 2466 | - left: 0 | |
| 2467 | - }, | |
| 2468 | - width: '100%', | |
| 2469 | - position: 'relative' | |
| 2470 | -})); | |
| 2471 | - | |
| 2472 | -/***/ }), | |
| 2473 | - | |
| 2474 | -/***/ "./packages/packages/libs/editor-ui/src/components/popover/popover-action.tsx": | |
| 2475 | -/*!************************************************************************************!*\ | |
| 2476 | - !*** ./packages/packages/libs/editor-ui/src/components/popover/popover-action.tsx ***! | |
| 2477 | - \************************************************************************************/ | |
| 2478 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2479 | - | |
| 2480 | -__webpack_require__.r(__webpack_exports__); | |
| 2481 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2482 | -/* harmony export */ PopoverAction: function() { return /* binding */ PopoverAction; }, | |
| 2483 | -/* harmony export */ useFloatingActionsPopover: function() { return /* binding */ useFloatingActionsPopover; } | |
| 2484 | -/* harmony export */ }); | |
| 2485 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2486 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2487 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2488 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2489 | -/* harmony import */ var _floating_bar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../floating-bar */ "./packages/packages/libs/editor-ui/src/components/floating-bar.tsx"); | |
| 2490 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2491 | - | |
| 2492 | - | |
| 2493 | - | |
| 2494 | -const SIZE = 'tiny'; | |
| 2495 | -function PopoverAction({ | |
| 2496 | - title, | |
| 2497 | - visible = true, | |
| 2498 | - icon: Icon, | |
| 2499 | - content: PopoverContent | |
| 2500 | -}) { | |
| 2501 | - const { | |
| 2502 | - popupState, | |
| 2503 | - triggerProps, | |
| 2504 | - popoverProps | |
| 2505 | - } = useFloatingActionsPopover(); | |
| 2506 | - if (!visible) { | |
| 2507 | - return null; | |
| 2508 | - } | |
| 2509 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Tooltip, { | |
| 2510 | - placement: "top", | |
| 2511 | - title: title | |
| 2512 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.IconButton, _extends({ | |
| 2513 | - "aria-label": title, | |
| 2514 | - size: SIZE | |
| 2515 | - }, triggerProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Icon, { | |
| 2516 | - fontSize: SIZE | |
| 2517 | - }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Popover, _extends({ | |
| 2518 | - disableScrollLock: true, | |
| 2519 | - anchorOrigin: { | |
| 2520 | - vertical: 'bottom', | |
| 2521 | - horizontal: 'right' | |
| 2522 | - }, | |
| 2523 | - transformOrigin: { | |
| 2524 | - vertical: 'top', | |
| 2525 | - horizontal: 'right' | |
| 2526 | - }, | |
| 2527 | - PaperProps: { | |
| 2528 | - sx: { | |
| 2529 | - my: 2.5 | |
| 2530 | - } | |
| 2531 | - } | |
| 2532 | - }, popoverProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(PopoverContent, { | |
| 2533 | - close: popupState.close | |
| 2534 | - }))); | |
| 2535 | -} | |
| 2536 | -function useFloatingActionsPopover() { | |
| 2537 | - const { | |
| 2538 | - setOpen | |
| 2539 | - } = (0,_floating_bar__WEBPACK_IMPORTED_MODULE_2__.useFloatingActionsBar)(); | |
| 2540 | - const popupState = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.usePopupState)({ | |
| 2541 | - variant: 'popover' | |
| 2542 | - }); | |
| 2543 | - const triggerProps = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.bindTrigger)(popupState); | |
| 2544 | - const popoverProps = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.bindPopover)(popupState); | |
| 2545 | - const onClick = e => { | |
| 2546 | - triggerProps.onClick(e); | |
| 2547 | - setOpen(true); | |
| 2548 | - }; | |
| 2549 | - const onClose = () => { | |
| 2550 | - popoverProps.onClose(); | |
| 2551 | - setOpen(false); | |
| 2552 | - }; | |
| 2553 | - const close = () => { | |
| 2554 | - popupState.close(); | |
| 2555 | - setOpen(false); | |
| 2556 | - }; | |
| 2557 | - return { | |
| 2558 | - popupState: { | |
| 2559 | - ...popupState, | |
| 2560 | - close | |
| 2561 | - }, | |
| 2562 | - triggerProps: { | |
| 2563 | - ...triggerProps, | |
| 2564 | - onClick | |
| 2565 | - }, | |
| 2566 | - popoverProps: { | |
| 2567 | - ...popoverProps, | |
| 2568 | - onClose | |
| 2569 | - } | |
| 2570 | - }; | |
| 2571 | -} | |
| 2572 | - | |
| 2573 | -/***/ }), | |
| 2574 | - | |
| 2575 | -/***/ "./packages/packages/libs/editor-ui/src/components/popover/section-popover-body.tsx": | |
| 2576 | -/*!******************************************************************************************!*\ | |
| 2577 | - !*** ./packages/packages/libs/editor-ui/src/components/popover/section-popover-body.tsx ***! | |
| 2578 | - \******************************************************************************************/ | |
| 2579 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2580 | - | |
| 2581 | -__webpack_require__.r(__webpack_exports__); | |
| 2582 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2583 | -/* harmony export */ SectionPopoverBody: function() { return /* binding */ SectionPopoverBody; } | |
| 2584 | -/* harmony export */ }); | |
| 2585 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2586 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2587 | -/* harmony import */ var _contexts_section_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../contexts/section-context */ "./packages/packages/libs/editor-ui/src/contexts/section-context.tsx"); | |
| 2588 | -/* harmony import */ var _body__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./body */ "./packages/packages/libs/editor-ui/src/components/popover/body.tsx"); | |
| 2589 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2590 | - | |
| 2591 | - | |
| 2592 | - | |
| 2593 | -const SectionPopoverBody = props => { | |
| 2594 | - const sectionWidth = (0,_contexts_section_context__WEBPACK_IMPORTED_MODULE_1__.useSectionWidth)(); | |
| 2595 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_body__WEBPACK_IMPORTED_MODULE_2__.PopoverBody, _extends({}, props, { | |
| 2596 | - width: sectionWidth | |
| 2597 | - })); | |
| 2598 | -}; | |
| 2599 | - | |
| 2600 | -/***/ }), | |
| 2601 | - | |
| 2602 | -/***/ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-alert.tsx": | |
| 2603 | -/*!****************************************************************************************!*\ | |
| 2604 | - !*** ./packages/packages/libs/editor-ui/src/components/promotions/promotion-alert.tsx ***! | |
| 2605 | - \****************************************************************************************/ | |
| 2606 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2607 | - | |
| 2608 | -__webpack_require__.r(__webpack_exports__); | |
| 2609 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2610 | -/* harmony export */ PromotionAlert: function() { return /* binding */ PromotionAlert; } | |
| 2611 | -/* harmony export */ }); | |
| 2612 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2613 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2614 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 2615 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 2616 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2617 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 2618 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 2619 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); | |
| 2620 | - | |
| 2621 | - | |
| 2622 | - | |
| 2623 | - | |
| 2624 | -const PromotionAlert = ({ | |
| 2625 | - message, | |
| 2626 | - upgradeUrl, | |
| 2627 | - onCtaClick | |
| 2628 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Alert, { | |
| 2629 | - variant: "standard", | |
| 2630 | - color: "promotion", | |
| 2631 | - icon: false, | |
| 2632 | - role: "dialog", | |
| 2633 | - "aria-label": "promotion-alert", | |
| 2634 | - size: "small", | |
| 2635 | - sx: { | |
| 2636 | - m: 2, | |
| 2637 | - mt: 1, | |
| 2638 | - pt: 0.5, | |
| 2639 | - pb: 0.5 | |
| 2640 | - } | |
| 2641 | -}, message, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, { | |
| 2642 | - size: 'tiny', | |
| 2643 | - variant: 'text', | |
| 2644 | - color: 'promotion', | |
| 2645 | - target: "_blank", | |
| 2646 | - href: upgradeUrl, | |
| 2647 | - rel: "noopener noreferrer", | |
| 2648 | - startIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.CrownFilledIcon, { | |
| 2649 | - fontSize: "tiny" | |
| 2650 | - }), | |
| 2651 | - onClick: onCtaClick | |
| 2652 | -}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Upgrade now', 'elementor'))); | |
| 2653 | - | |
| 2654 | -/***/ }), | |
| 2655 | - | |
| 2656 | -/***/ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-chip.tsx": | |
| 2657 | -/*!***************************************************************************************!*\ | |
| 2658 | - !*** ./packages/packages/libs/editor-ui/src/components/promotions/promotion-chip.tsx ***! | |
| 2659 | - \***************************************************************************************/ | |
| 2660 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2661 | - | |
| 2662 | -__webpack_require__.r(__webpack_exports__); | |
| 2663 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2664 | -/* harmony export */ PromotionChip: function() { return /* binding */ PromotionChip; } | |
| 2665 | -/* harmony export */ }); | |
| 2666 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2667 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2668 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 2669 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 2670 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2671 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 2672 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2673 | - | |
| 2674 | - | |
| 2675 | - | |
| 2676 | -const PromotionChip = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(({ | |
| 2677 | - ...props | |
| 2678 | -}, ref) => { | |
| 2679 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Chip, _extends({ | |
| 2680 | - "aria-label": "Promotion chip", | |
| 2681 | - ref: ref, | |
| 2682 | - size: "tiny", | |
| 2683 | - color: "promotion", | |
| 2684 | - variant: "standard", | |
| 2685 | - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.CrownFilledIcon, null), | |
| 2686 | - sx: { | |
| 2687 | - ml: 1, | |
| 2688 | - width: '20px', | |
| 2689 | - '& .MuiChip-label': { | |
| 2690 | - display: 'none' | |
| 2691 | - } | |
| 2692 | - } | |
| 2693 | - }, props)); | |
| 2694 | -}); | |
| 2695 | - | |
| 2696 | -/***/ }), | |
| 2697 | - | |
| 2698 | -/***/ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-infotip.tsx": | |
| 2699 | -/*!******************************************************************************************!*\ | |
| 2700 | - !*** ./packages/packages/libs/editor-ui/src/components/promotions/promotion-infotip.tsx ***! | |
| 2701 | - \******************************************************************************************/ | |
| 2702 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2703 | - | |
| 2704 | -__webpack_require__.r(__webpack_exports__); | |
| 2705 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2706 | -/* harmony export */ PromotionInfotip: function() { return /* binding */ PromotionInfotip; } | |
| 2707 | -/* harmony export */ }); | |
| 2708 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2709 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2710 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2711 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 2712 | -/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hooks */ "./packages/packages/libs/editor-ui/src/hooks/index.ts"); | |
| 2713 | -/* harmony import */ var _cta_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cta-button */ "./packages/packages/libs/editor-ui/src/components/cta-button.tsx"); | |
| 2714 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2715 | - | |
| 2716 | - | |
| 2717 | - | |
| 2718 | - | |
| 2719 | -const PromotionInfotip = ({ | |
| 2720 | - children, | |
| 2721 | - open, | |
| 2722 | - onClose, | |
| 2723 | - onCtaClick, | |
| 2724 | - ...cardProps | |
| 2725 | -}) => { | |
| 2726 | - (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useCanvasClickHandler)(!!open, onClose); | |
| 2727 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Infotip, { | |
| 2728 | - placement: "right", | |
| 2729 | - content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(InfotipCard, _extends({ | |
| 2730 | - onClose: onClose, | |
| 2731 | - onCtaClick: onCtaClick | |
| 2732 | - }, cardProps)), | |
| 2733 | - open: open | |
| 2734 | - }, children); | |
| 2735 | -}; | |
| 2736 | -function InfotipCard({ | |
| 2737 | - title, | |
| 2738 | - content, | |
| 2739 | - assetUrl, | |
| 2740 | - ctaUrl, | |
| 2741 | - onClose, | |
| 2742 | - onCtaClick | |
| 2743 | -}) { | |
| 2744 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.ClickAwayListener, { | |
| 2745 | - disableReactTree: true, | |
| 2746 | - mouseEvent: "onMouseDown", | |
| 2747 | - touchEvent: "onTouchStart", | |
| 2748 | - onClickAway: onClose | |
| 2749 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Card, { | |
| 2750 | - elevation: 0, | |
| 2751 | - sx: { | |
| 2752 | - maxWidth: 296 | |
| 2753 | - } | |
| 2754 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CardHeader, { | |
| 2755 | - title: title, | |
| 2756 | - action: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CloseButton, { | |
| 2757 | - slotProps: { | |
| 2758 | - icon: { | |
| 2759 | - fontSize: 'tiny' | |
| 2760 | - } | |
| 2761 | - }, | |
| 2762 | - onClick: onClose | |
| 2763 | - }) | |
| 2764 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CardMedia, { | |
| 2765 | - component: "img", | |
| 2766 | - image: assetUrl, | |
| 2767 | - alt: "", | |
| 2768 | - sx: { | |
| 2769 | - width: '100%', | |
| 2770 | - aspectRatio: '16 / 9' | |
| 2771 | - } | |
| 2772 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CardContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Typography, { | |
| 2773 | - variant: "body2", | |
| 2774 | - color: "text.secondary" | |
| 2775 | - }, content)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.CardActions, { | |
| 2776 | - sx: { | |
| 2777 | - justifyContent: 'flex-start' | |
| 2778 | - } | |
| 2779 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_cta_button__WEBPACK_IMPORTED_MODULE_3__.CtaButton, { | |
| 2780 | - href: ctaUrl, | |
| 2781 | - onClick: onCtaClick | |
| 2782 | - })))); | |
| 2783 | -} | |
| 2784 | - | |
| 2785 | -/***/ }), | |
| 2786 | - | |
| 2787 | -/***/ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-popover.tsx": | |
| 2788 | -/*!******************************************************************************************!*\ | |
| 2789 | - !*** ./packages/packages/libs/editor-ui/src/components/promotions/promotion-popover.tsx ***! | |
| 2790 | - \******************************************************************************************/ | |
| 2791 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2792 | - | |
| 2793 | -__webpack_require__.r(__webpack_exports__); | |
| 2794 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2795 | -/* harmony export */ PromotionPopover: function() { return /* binding */ PromotionPopover; } | |
| 2796 | -/* harmony export */ }); | |
| 2797 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2798 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2799 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 2800 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 2801 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2802 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 2803 | - | |
| 2804 | - | |
| 2805 | - | |
| 2806 | -const PromotionPopover = ({ | |
| 2807 | - children, | |
| 2808 | - open, | |
| 2809 | - placement = 'right', | |
| 2810 | - slotProps, | |
| 2811 | - anchorRef, | |
| 2812 | - ...cardProps | |
| 2813 | -}) => { | |
| 2814 | - const anchorEl = anchorRef?.current; | |
| 2815 | - const defaultSlotProps = { | |
| 2816 | - popper: { | |
| 2817 | - ...(anchorEl && { | |
| 2818 | - anchorEl | |
| 2819 | - }), | |
| 2820 | - modifiers: [{ | |
| 2821 | - name: 'offset', | |
| 2822 | - options: { | |
| 2823 | - offset: anchorRef ? [0, 4] : [0, 10] | |
| 2824 | - } | |
| 2825 | - }] | |
| 2826 | - } | |
| 2827 | - }; | |
| 2828 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Infotip, { | |
| 2829 | - placement: placement, | |
| 2830 | - arrow: false, | |
| 2831 | - content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(PopoverAlert, cardProps), | |
| 2832 | - open: open, | |
| 2833 | - slotProps: slotProps || defaultSlotProps | |
| 2834 | - }, children); | |
| 2835 | -}; | |
| 2836 | -function PopoverAlert({ | |
| 2837 | - title, | |
| 2838 | - content, | |
| 2839 | - ctaUrl, | |
| 2840 | - ctaText, | |
| 2841 | - onClose, | |
| 2842 | - onCtaClick | |
| 2843 | -}) { | |
| 2844 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.ClickAwayListener, { | |
| 2845 | - disableReactTree: true, | |
| 2846 | - mouseEvent: "onMouseDown", | |
| 2847 | - touchEvent: "onTouchStart", | |
| 2848 | - onClickAway: onClose | |
| 2849 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Alert, { | |
| 2850 | - variant: "standard", | |
| 2851 | - color: "promotion", | |
| 2852 | - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.CrownFilledIcon, { | |
| 2853 | - fontSize: "tiny" | |
| 2854 | - }), | |
| 2855 | - onClose: onClose, | |
| 2856 | - onMouseDown: e => e.stopPropagation(), | |
| 2857 | - role: "dialog", | |
| 2858 | - "aria-label": "promotion-popover-title", | |
| 2859 | - action: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.AlertAction, { | |
| 2860 | - variant: "contained", | |
| 2861 | - color: "promotion", | |
| 2862 | - href: ctaUrl, | |
| 2863 | - target: "_blank", | |
| 2864 | - rel: "noopener noreferrer", | |
| 2865 | - onClick: onCtaClick | |
| 2866 | - }, ctaText), | |
| 2867 | - sx: { | |
| 2868 | - maxWidth: 296 | |
| 2869 | - } | |
| 2870 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Box, { | |
| 2871 | - sx: { | |
| 2872 | - gap: 0.5, | |
| 2873 | - display: 'flex', | |
| 2874 | - flexDirection: 'column' | |
| 2875 | - } | |
| 2876 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.AlertTitle, null, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Typography, { | |
| 2877 | - variant: "body2" | |
| 2878 | - }, content)))); | |
| 2879 | -} | |
| 2880 | - | |
| 2881 | -/***/ }), | |
| 2882 | - | |
| 2883 | -/***/ "./packages/packages/libs/editor-ui/src/components/save-changes-dialog.tsx": | |
| 2884 | -/*!*********************************************************************************!*\ | |
| 2885 | - !*** ./packages/packages/libs/editor-ui/src/components/save-changes-dialog.tsx ***! | |
| 2886 | - \*********************************************************************************/ | |
| 2887 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2888 | - | |
| 2889 | -__webpack_require__.r(__webpack_exports__); | |
| 2890 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2891 | -/* harmony export */ SaveChangesDialog: function() { return /* binding */ SaveChangesDialog; }, | |
| 2892 | -/* harmony export */ useDialog: function() { return /* binding */ useDialog; } | |
| 2893 | -/* harmony export */ }); | |
| 2894 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 2895 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 2896 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 2897 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 2898 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2899 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 2900 | -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | |
| 2901 | - | |
| 2902 | - | |
| 2903 | - | |
| 2904 | - | |
| 2905 | -const TITLE_ID = 'save-changes-dialog'; | |
| 2906 | -const SaveChangesDialog = ({ | |
| 2907 | - children, | |
| 2908 | - onClose | |
| 2909 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Dialog, { | |
| 2910 | - open: true, | |
| 2911 | - onClose: onClose, | |
| 2912 | - "aria-labelledby": TITLE_ID, | |
| 2913 | - maxWidth: "xs" | |
| 2914 | -}, children); | |
| 2915 | -const SaveChangesDialogTitle = ({ | |
| 2916 | - children, | |
| 2917 | - onClose | |
| 2918 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogTitle, { | |
| 2919 | - id: TITLE_ID, | |
| 2920 | - display: "flex", | |
| 2921 | - alignItems: "center", | |
| 2922 | - gap: 1, | |
| 2923 | - sx: { | |
| 2924 | - lineHeight: 1, | |
| 2925 | - justifyContent: 'space-between' | |
| 2926 | - } | |
| 2927 | -}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Stack, { | |
| 2928 | - direction: "row", | |
| 2929 | - alignItems: "center", | |
| 2930 | - gap: 1 | |
| 2931 | -}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.AlertTriangleFilledIcon, { | |
| 2932 | - color: "secondary" | |
| 2933 | -}), children), onClose && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.IconButton, { | |
| 2934 | - onClick: onClose, | |
| 2935 | - size: "small" | |
| 2936 | -}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.XIcon, null))); | |
| 2937 | -const SaveChangesDialogContent = ({ | |
| 2938 | - children | |
| 2939 | -}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogContent, null, children); | |
| 2940 | -const SaveChangesDialogContentText = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogContentText, _extends({ | |
| 2941 | - variant: "body2", | |
| 2942 | - color: "textPrimary", | |
| 2943 | - display: "flex", | |
| 2944 | - flexDirection: "column" | |
| 2945 | -}, props)); | |
| 2946 | -const SaveChangesDialogActions = ({ | |
| 2947 | - actions | |
| 2948 | -}) => { | |
| 2949 | - const [isConfirming, setIsConfirming] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); | |
| 2950 | - const { | |
| 2951 | - cancel, | |
| 2952 | - confirm, | |
| 2953 | - discard | |
| 2954 | - } = actions; | |
| 2955 | - const onConfirm = async () => { | |
| 2956 | - setIsConfirming(true); | |
| 2957 | - await confirm.action(); | |
| 2958 | - setIsConfirming(false); | |
| 2959 | - }; | |
| 2960 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.DialogActions, null, cancel && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, { | |
| 2961 | - variant: "text", | |
| 2962 | - color: "secondary", | |
| 2963 | - onClick: cancel.action | |
| 2964 | - }, cancel.label), discard && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, { | |
| 2965 | - variant: "text", | |
| 2966 | - color: "secondary", | |
| 2967 | - onClick: discard.action | |
| 2968 | - }, discard.label), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Button, { | |
| 2969 | - variant: "contained", | |
| 2970 | - color: "secondary", | |
| 2971 | - onClick: onConfirm, | |
| 2972 | - loading: isConfirming | |
| 2973 | - }, confirm.label)); | |
| 2974 | -}; | |
| 2975 | -SaveChangesDialog.Title = SaveChangesDialogTitle; | |
| 2976 | -SaveChangesDialog.Content = SaveChangesDialogContent; | |
| 2977 | -SaveChangesDialog.ContentText = SaveChangesDialogContentText; | |
| 2978 | -SaveChangesDialog.Actions = SaveChangesDialogActions; | |
| 2979 | -const useDialog = () => { | |
| 2980 | - const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); | |
| 2981 | - const open = () => setIsOpen(true); | |
| 2982 | - const close = () => setIsOpen(false); | |
| 2983 | - return { | |
| 2984 | - isOpen, | |
| 2985 | - open, | |
| 2986 | - close | |
| 2987 | - }; | |
| 2988 | -}; | |
| 2989 | - | |
| 2990 | -/***/ }), | |
| 2991 | - | |
| 2992 | -/***/ "./packages/packages/libs/editor-ui/src/components/search-field.tsx": | |
| 2993 | -/*!**************************************************************************!*\ | |
| 2994 | - !*** ./packages/packages/libs/editor-ui/src/components/search-field.tsx ***! | |
| 2995 | - \**************************************************************************/ | |
| 2996 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 2997 | - | |
| 2998 | -__webpack_require__.r(__webpack_exports__); | |
| 2999 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3000 | -/* harmony export */ SearchField: function() { return /* binding */ SearchField; } | |
| 3001 | -/* harmony export */ }); | |
| 3002 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3003 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3004 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 3005 | -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__); | |
| 3006 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 3007 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__); | |
| 3008 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 3009 | -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); | |
| 3010 | - | |
| 3011 | - | |
| 3012 | - | |
| 3013 | - | |
| 3014 | - | |
| 3015 | -const SIZE = 'tiny'; | |
| 3016 | -const SearchField = ({ | |
| 3017 | - value, | |
| 3018 | - onSearch, | |
| 3019 | - placeholder, | |
| 3020 | - id, | |
| 3021 | - sx | |
| 3022 | -}) => { | |
| 3023 | - const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); | |
| 3024 | - const handleClear = () => { | |
| 3025 | - onSearch(''); | |
| 3026 | - inputRef.current?.focus(); | |
| 3027 | - }; | |
| 3028 | - const handleInputChange = event => { | |
| 3029 | - onSearch(event.target.value); | |
| 3030 | - }; | |
| 3031 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.Box, { | |
| 3032 | - sx: { | |
| 3033 | - px: 2, | |
| 3034 | - pb: 1.5, | |
| 3035 | - ...sx | |
| 3036 | - } | |
| 3037 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.TextField | |
| 3038 | - // eslint-disable-next-line jsx-a11y/no-autofocus | |
| 3039 | - , { | |
| 3040 | - autoFocus: true, | |
| 3041 | - fullWidth: true, | |
| 3042 | - id: id, | |
| 3043 | - size: SIZE, | |
| 3044 | - value: value, | |
| 3045 | - inputRef: inputRef, | |
| 3046 | - onChange: handleInputChange, | |
| 3047 | - placeholder: placeholder, | |
| 3048 | - InputProps: { | |
| 3049 | - startAdornment: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.InputAdornment, { | |
| 3050 | - position: "start" | |
| 3051 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.SearchIcon, { | |
| 3052 | - fontSize: SIZE | |
| 3053 | - })), | |
| 3054 | - endAdornment: value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_2__.IconButton, { | |
| 3055 | - size: SIZE, | |
| 3056 | - onClick: handleClear, | |
| 3057 | - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Clear', 'elementor') | |
| 3058 | - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_1__.XIcon, { | |
| 3059 | - color: "action", | |
| 3060 | - fontSize: SIZE | |
| 3061 | - })) | |
| 3062 | - } | |
| 3063 | - })); | |
| 3064 | -}; | |
| 3065 | - | |
| 3066 | -/***/ }), | |
| 3067 | - | |
| 3068 | -/***/ "./packages/packages/libs/editor-ui/src/components/theme-provider.tsx": | |
| 3069 | -/*!****************************************************************************!*\ | |
| 3070 | - !*** ./packages/packages/libs/editor-ui/src/components/theme-provider.tsx ***! | |
| 3071 | - \****************************************************************************/ | |
| 3072 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3073 | - | |
| 3074 | -__webpack_require__.r(__webpack_exports__); | |
| 3075 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3076 | -/* harmony export */ "default": function() { return /* binding */ ThemeProvider; } | |
| 3077 | -/* harmony export */ }); | |
| 3078 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3079 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3080 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 3081 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 3082 | -/* harmony import */ var _hooks_use_color_scheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hooks/use-color-scheme */ "./packages/packages/libs/editor-ui/src/hooks/use-color-scheme.ts"); | |
| 3083 | - | |
| 3084 | - | |
| 3085 | - | |
| 3086 | -const EDITOR_PALETTE = 'unstable'; | |
| 3087 | -function ThemeProvider({ | |
| 3088 | - children | |
| 3089 | -}) { | |
| 3090 | - const colorScheme = (0,_hooks_use_color_scheme__WEBPACK_IMPORTED_MODULE_2__.useColorScheme)(); | |
| 3091 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider, { | |
| 3092 | - colorScheme: colorScheme, | |
| 3093 | - palette: EDITOR_PALETTE | |
| 3094 | - }, children); | |
| 3095 | -} | |
| 3096 | - | |
| 3097 | -/***/ }), | |
| 3098 | - | |
| 3099 | -/***/ "./packages/packages/libs/editor-ui/src/components/warning-infotip.tsx": | |
| 3100 | -/*!*****************************************************************************!*\ | |
| 3101 | - !*** ./packages/packages/libs/editor-ui/src/components/warning-infotip.tsx ***! | |
| 3102 | - \*****************************************************************************/ | |
| 3103 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3104 | - | |
| 3105 | -__webpack_require__.r(__webpack_exports__); | |
| 3106 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3107 | -/* harmony export */ WarningInfotip: function() { return /* binding */ WarningInfotip; } | |
| 3108 | -/* harmony export */ }); | |
| 3109 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3110 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3111 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 3112 | -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__); | |
| 3113 | - | |
| 3114 | - | |
| 3115 | - | |
| 3116 | -const WarningInfotip = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ | |
| 3117 | - children, | |
| 3118 | - open, | |
| 3119 | - title, | |
| 3120 | - text, | |
| 3121 | - placement, | |
| 3122 | - width, | |
| 3123 | - offset, | |
| 3124 | - hasError = true | |
| 3125 | -}, ref) => { | |
| 3126 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Infotip, { | |
| 3127 | - ref: ref, | |
| 3128 | - open: open, | |
| 3129 | - placement: placement, | |
| 3130 | - PopperProps: { | |
| 3131 | - sx: { | |
| 3132 | - width: width ? width : 'initial', | |
| 3133 | - '.MuiTooltip-tooltip': { | |
| 3134 | - marginLeft: 0, | |
| 3135 | - marginRight: 0 | |
| 3136 | - } | |
| 3137 | - }, | |
| 3138 | - modifiers: offset ? [{ | |
| 3139 | - name: 'offset', | |
| 3140 | - options: { | |
| 3141 | - offset | |
| 3142 | - } | |
| 3143 | - }] : [] | |
| 3144 | - }, | |
| 3145 | - arrow: false, | |
| 3146 | - content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.Alert, { | |
| 3147 | - color: hasError ? 'error' : 'secondary', | |
| 3148 | - severity: "warning", | |
| 3149 | - variant: "standard", | |
| 3150 | - size: "small" | |
| 3151 | - }, title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_1__.AlertTitle, null, title) : null, text) | |
| 3152 | - }, children); | |
| 3153 | -}); | |
| 3154 | - | |
| 3155 | -/***/ }), | |
| 3156 | - | |
| 3157 | -/***/ "./packages/packages/libs/editor-ui/src/contexts/section-context.tsx": | |
| 3158 | -/*!***************************************************************************!*\ | |
| 3159 | - !*** ./packages/packages/libs/editor-ui/src/contexts/section-context.tsx ***! | |
| 3160 | - \***************************************************************************/ | |
| 3161 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3162 | - | |
| 3163 | -__webpack_require__.r(__webpack_exports__); | |
| 3164 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3165 | -/* harmony export */ SectionRefContext: function() { return /* binding */ SectionRefContext; }, | |
| 3166 | -/* harmony export */ useSectionWidth: function() { return /* binding */ useSectionWidth; } | |
| 3167 | -/* harmony export */ }); | |
| 3168 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3169 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3170 | - | |
| 3171 | -const FALLBACK_SECTION_WIDTH = 320; | |
| 3172 | -const SectionRefContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); | |
| 3173 | -const useSectionRef = () => (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(SectionRefContext); | |
| 3174 | -const useSectionWidth = () => { | |
| 3175 | - const sectionRef = useSectionRef(); | |
| 3176 | - return sectionRef?.current?.offsetWidth ?? FALLBACK_SECTION_WIDTH; | |
| 3177 | -}; | |
| 3178 | - | |
| 3179 | -/***/ }), | |
| 3180 | - | |
| 3181 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/index.ts": | |
| 3182 | -/*!*************************************************************!*\ | |
| 3183 | - !*** ./packages/packages/libs/editor-ui/src/hooks/index.ts ***! | |
| 3184 | - \*************************************************************/ | |
| 3185 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3186 | - | |
| 3187 | -__webpack_require__.r(__webpack_exports__); | |
| 3188 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3189 | -/* harmony export */ useCanvasClickHandler: function() { return /* reexport safe */ _use_canvas_click_handler__WEBPACK_IMPORTED_MODULE_3__.useCanvasClickHandler; }, | |
| 3190 | -/* harmony export */ useScrollToSelected: function() { return /* reexport safe */ _use_scroll_to_selected__WEBPACK_IMPORTED_MODULE_0__.useScrollToSelected; }, | |
| 3191 | -/* harmony export */ useScrollTop: function() { return /* reexport safe */ _use_scroll_top__WEBPACK_IMPORTED_MODULE_1__.useScrollTop; }, | |
| 3192 | -/* harmony export */ useTextFieldAutoSelect: function() { return /* reexport safe */ _use_text_field_auto_select__WEBPACK_IMPORTED_MODULE_2__.useTextFieldAutoSelect; } | |
| 3193 | -/* harmony export */ }); | |
| 3194 | -/* harmony import */ var _use_scroll_to_selected__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-scroll-to-selected */ "./packages/packages/libs/editor-ui/src/hooks/use-scroll-to-selected.ts"); | |
| 3195 | -/* harmony import */ var _use_scroll_top__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-scroll-top */ "./packages/packages/libs/editor-ui/src/hooks/use-scroll-top.ts"); | |
| 3196 | -/* harmony import */ var _use_text_field_auto_select__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./use-text-field-auto-select */ "./packages/packages/libs/editor-ui/src/hooks/use-text-field-auto-select.ts"); | |
| 3197 | -/* harmony import */ var _use_canvas_click_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use-canvas-click-handler */ "./packages/packages/libs/editor-ui/src/hooks/use-canvas-click-handler.tsx"); | |
| 3198 | - | |
| 3199 | - | |
| 3200 | - | |
| 3201 | - | |
| 3202 | - | |
| 3203 | -/***/ }), | |
| 3204 | - | |
| 3205 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/use-canvas-click-handler.tsx": | |
| 3206 | -/*!*********************************************************************************!*\ | |
| 3207 | - !*** ./packages/packages/libs/editor-ui/src/hooks/use-canvas-click-handler.tsx ***! | |
| 3208 | - \*********************************************************************************/ | |
| 3209 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3210 | - | |
| 3211 | -__webpack_require__.r(__webpack_exports__); | |
| 3212 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3213 | -/* harmony export */ useCanvasClickHandler: function() { return /* binding */ useCanvasClickHandler; } | |
| 3214 | -/* harmony export */ }); | |
| 3215 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3216 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3217 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-v1-adapters */ "@elementor/editor-v1-adapters"); | |
| 3218 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__); | |
| 3219 | - | |
| 3220 | - | |
| 3221 | -const useCanvasClickHandler = (isActive, onClickAway) => { | |
| 3222 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3223 | - const canvasDocument = isActive ? (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__.getCanvasIframeDocument)() : null; | |
| 3224 | - if (!canvasDocument) { | |
| 3225 | - return; | |
| 3226 | - } | |
| 3227 | - canvasDocument.addEventListener('mousedown', onClickAway); | |
| 3228 | - return () => canvasDocument.removeEventListener('mousedown', onClickAway); | |
| 3229 | - }, [isActive, onClickAway]); | |
| 3230 | -}; | |
| 3231 | - | |
| 3232 | -/***/ }), | |
| 3233 | - | |
| 3234 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/use-color-scheme.ts": | |
| 3235 | -/*!************************************************************************!*\ | |
| 3236 | - !*** ./packages/packages/libs/editor-ui/src/hooks/use-color-scheme.ts ***! | |
| 3237 | - \************************************************************************/ | |
| 3238 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3239 | - | |
| 3240 | -__webpack_require__.r(__webpack_exports__); | |
| 3241 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3242 | -/* harmony export */ useColorScheme: function() { return /* binding */ useColorScheme; } | |
| 3243 | -/* harmony export */ }); | |
| 3244 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3245 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3246 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-v1-adapters */ "@elementor/editor-v1-adapters"); | |
| 3247 | -/* harmony import */ var _elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__); | |
| 3248 | - | |
| 3249 | - | |
| 3250 | -function useColorScheme() { | |
| 3251 | - const [colorScheme, setColorScheme] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => getV1ColorScheme()); | |
| 3252 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3253 | - return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__.__privateListenTo)((0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__.v1ReadyEvent)(), () => setColorScheme(getV1ColorScheme())); | |
| 3254 | - }, []); | |
| 3255 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3256 | - return (0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__.__privateListenTo)((0,_elementor_editor_v1_adapters__WEBPACK_IMPORTED_MODULE_1__.commandEndEvent)('document/elements/settings'), e => { | |
| 3257 | - const event = e; | |
| 3258 | - | |
| 3259 | - // The User-Preferences settings object has a key named `ui_theme` that controls the color scheme. | |
| 3260 | - const isColorScheme = event.args?.settings && 'ui_theme' in event.args.settings; | |
| 3261 | - if (isColorScheme) { | |
| 3262 | - setColorScheme(getV1ColorScheme()); | |
| 3263 | - } | |
| 3264 | - }); | |
| 3265 | - }, []); | |
| 3266 | - return colorScheme; | |
| 3267 | -} | |
| 3268 | -function getV1ColorScheme() { | |
| 3269 | - return window.elementor?.getPreferences?.('ui_theme') || 'auto'; | |
| 3270 | -} | |
| 3271 | - | |
| 3272 | -/***/ }), | |
| 3273 | - | |
| 3274 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/use-editable.ts": | |
| 3275 | -/*!********************************************************************!*\ | |
| 3276 | - !*** ./packages/packages/libs/editor-ui/src/hooks/use-editable.ts ***! | |
| 3277 | - \********************************************************************/ | |
| 3278 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3279 | - | |
| 3280 | -__webpack_require__.r(__webpack_exports__); | |
| 3281 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3282 | -/* harmony export */ useEditable: function() { return /* binding */ useEditable; } | |
| 3283 | -/* harmony export */ }); | |
| 3284 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3285 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3286 | - | |
| 3287 | -const useEditable = ({ | |
| 3288 | - value, | |
| 3289 | - onSubmit, | |
| 3290 | - validation, | |
| 3291 | - onClick, | |
| 3292 | - onError | |
| 3293 | -}) => { | |
| 3294 | - const [isEditing, setIsEditing] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); | |
| 3295 | - const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); | |
| 3296 | - const ref = useSelection(isEditing); | |
| 3297 | - const isDirty = newValue => newValue !== value; | |
| 3298 | - const openEditMode = () => { | |
| 3299 | - setIsEditing(true); | |
| 3300 | - }; | |
| 3301 | - const closeEditMode = () => { | |
| 3302 | - setError(null); | |
| 3303 | - onError?.(null); | |
| 3304 | - setIsEditing(false); | |
| 3305 | - }; | |
| 3306 | - const submit = newValue => { | |
| 3307 | - if (!isDirty(newValue)) { | |
| 3308 | - closeEditMode(); | |
| 3309 | - return; | |
| 3310 | - } | |
| 3311 | - if (!error) { | |
| 3312 | - try { | |
| 3313 | - onSubmit(newValue); | |
| 3314 | - } finally { | |
| 3315 | - closeEditMode(); | |
| 3316 | - } | |
| 3317 | - } | |
| 3318 | - }; | |
| 3319 | - const onChange = event => { | |
| 3320 | - const { | |
| 3321 | - innerText: newValue | |
| 3322 | - } = event.target; | |
| 3323 | - if (validation) { | |
| 3324 | - const updatedError = isDirty(newValue) ? validation(newValue) : null; | |
| 3325 | - setError(updatedError); | |
| 3326 | - onError?.(updatedError); | |
| 3327 | - } | |
| 3328 | - }; | |
| 3329 | - const handleKeyDown = event => { | |
| 3330 | - event.stopPropagation(); | |
| 3331 | - if (['Escape'].includes(event.key)) { | |
| 3332 | - return closeEditMode(); | |
| 3333 | - } | |
| 3334 | - if (['Enter'].includes(event.key)) { | |
| 3335 | - event.preventDefault(); | |
| 3336 | - // submission is invoked only on blur, to avoid issues with double-submission in certain cases | |
| 3337 | - if (!error) { | |
| 3338 | - ref.current?.blur(); | |
| 3339 | - } | |
| 3340 | - } | |
| 3341 | - }; | |
| 3342 | - const handleClick = event => { | |
| 3343 | - if (isEditing) { | |
| 3344 | - event.stopPropagation(); | |
| 3345 | - } | |
| 3346 | - onClick?.(event); | |
| 3347 | - }; | |
| 3348 | - const handleBlur = () => { | |
| 3349 | - if (error) { | |
| 3350 | - closeEditMode(); | |
| 3351 | - return; | |
| 3352 | - } | |
| 3353 | - submit(ref.current.innerText); | |
| 3354 | - }; | |
| 3355 | - const listeners = { | |
| 3356 | - onClick: handleClick, | |
| 3357 | - onKeyDown: handleKeyDown, | |
| 3358 | - onInput: onChange, | |
| 3359 | - onBlur: handleBlur | |
| 3360 | - }; | |
| 3361 | - const attributes = { | |
| 3362 | - value, | |
| 3363 | - role: 'textbox', | |
| 3364 | - contentEditable: isEditing, | |
| 3365 | - ...(isEditing && { | |
| 3366 | - suppressContentEditableWarning: true | |
| 3367 | - }) | |
| 3368 | - }; | |
| 3369 | - return { | |
| 3370 | - ref, | |
| 3371 | - isEditing, | |
| 3372 | - openEditMode, | |
| 3373 | - closeEditMode, | |
| 3374 | - value, | |
| 3375 | - error, | |
| 3376 | - getProps: () => ({ | |
| 3377 | - ...listeners, | |
| 3378 | - ...attributes | |
| 3379 | - }) | |
| 3380 | - }; | |
| 3381 | -}; | |
| 3382 | -const useSelection = isEditing => { | |
| 3383 | - const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); | |
| 3384 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3385 | - if (isEditing) { | |
| 3386 | - selectAll(ref.current); | |
| 3387 | - } | |
| 3388 | - }, [isEditing]); | |
| 3389 | - return ref; | |
| 3390 | -}; | |
| 3391 | -const selectAll = el => { | |
| 3392 | - const selection = getSelection(); | |
| 3393 | - if (!selection || !el) { | |
| 3394 | - return; | |
| 3395 | - } | |
| 3396 | - const range = document.createRange(); | |
| 3397 | - range.selectNodeContents(el); | |
| 3398 | - selection.removeAllRanges(); | |
| 3399 | - selection.addRange(range); | |
| 3400 | -}; | |
| 3401 | - | |
| 3402 | -/***/ }), | |
| 3403 | - | |
| 3404 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/use-scroll-to-selected.ts": | |
| 3405 | -/*!******************************************************************************!*\ | |
| 3406 | - !*** ./packages/packages/libs/editor-ui/src/hooks/use-scroll-to-selected.ts ***! | |
| 3407 | - \******************************************************************************/ | |
| 3408 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3409 | - | |
| 3410 | -__webpack_require__.r(__webpack_exports__); | |
| 3411 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3412 | -/* harmony export */ useScrollToSelected: function() { return /* binding */ useScrollToSelected; } | |
| 3413 | -/* harmony export */ }); | |
| 3414 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3415 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3416 | - | |
| 3417 | -const useScrollToSelected = ({ | |
| 3418 | - selectedValue, | |
| 3419 | - items, | |
| 3420 | - virtualizer | |
| 3421 | -}) => { | |
| 3422 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3423 | - if (!selectedValue || items.length === 0) { | |
| 3424 | - return; | |
| 3425 | - } | |
| 3426 | - const selectedIndex = items.findIndex(item => item.value === selectedValue); | |
| 3427 | - if (selectedIndex !== -1) { | |
| 3428 | - virtualizer.scrollToIndex(selectedIndex, { | |
| 3429 | - align: 'center' | |
| 3430 | - }); | |
| 3431 | - } | |
| 3432 | - }, [selectedValue, items, virtualizer]); | |
| 3433 | -}; | |
| 3434 | - | |
| 3435 | -/***/ }), | |
| 3436 | - | |
| 3437 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/use-scroll-top.ts": | |
| 3438 | -/*!**********************************************************************!*\ | |
| 3439 | - !*** ./packages/packages/libs/editor-ui/src/hooks/use-scroll-top.ts ***! | |
| 3440 | - \**********************************************************************/ | |
| 3441 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3442 | - | |
| 3443 | -__webpack_require__.r(__webpack_exports__); | |
| 3444 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3445 | -/* harmony export */ useScrollTop: function() { return /* binding */ useScrollTop; } | |
| 3446 | -/* harmony export */ }); | |
| 3447 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3448 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3449 | - | |
| 3450 | -const useScrollTop = ({ | |
| 3451 | - containerRef | |
| 3452 | -}) => { | |
| 3453 | - const [scrollTop, setScrollTop] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0); | |
| 3454 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3455 | - const container = containerRef.current; | |
| 3456 | - if (!container) { | |
| 3457 | - return; | |
| 3458 | - } | |
| 3459 | - const handleScroll = () => { | |
| 3460 | - setScrollTop(container.scrollTop); | |
| 3461 | - }; | |
| 3462 | - container.addEventListener('scroll', handleScroll); | |
| 3463 | - return () => container.removeEventListener('scroll', handleScroll); | |
| 3464 | - }, [containerRef]); | |
| 3465 | - return scrollTop; | |
| 3466 | -}; | |
| 3467 | - | |
| 3468 | -/***/ }), | |
| 3469 | - | |
| 3470 | -/***/ "./packages/packages/libs/editor-ui/src/hooks/use-text-field-auto-select.ts": | |
| 3471 | -/*!**********************************************************************************!*\ | |
| 3472 | - !*** ./packages/packages/libs/editor-ui/src/hooks/use-text-field-auto-select.ts ***! | |
| 3473 | - \**********************************************************************************/ | |
| 3474 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 3475 | - | |
| 3476 | -__webpack_require__.r(__webpack_exports__); | |
| 3477 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3478 | -/* harmony export */ useTextFieldAutoSelect: function() { return /* binding */ useTextFieldAutoSelect; } | |
| 3479 | -/* harmony export */ }); | |
| 3480 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 3481 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 3482 | - | |
| 3483 | - | |
| 3484 | -// Automatically selects the default text in the text field when component mounts | |
| 3485 | -const useTextFieldAutoSelect = () => { | |
| 3486 | - const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); | |
| 3487 | - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { | |
| 3488 | - if (inputRef.current) { | |
| 3489 | - inputRef.current.focus(); | |
| 3490 | - inputRef.current.select(); | |
| 3491 | - } | |
| 3492 | - }, []); | |
| 3493 | - return inputRef; | |
| 3494 | -}; | |
| 3495 | - | |
| 3496 | -/***/ }), | |
| 3497 | - | |
| 3498 | -/***/ "@elementor/editor-v1-adapters": | |
| 3499 | -/*!***************************************************!*\ | |
| 3500 | - !*** external ["elementorV2","editorV1Adapters"] ***! | |
| 3501 | - \***************************************************/ | |
| 3502 | -/***/ (function(module) { | |
| 3503 | - | |
| 3504 | -module.exports = window["elementorV2"]["editorV1Adapters"]; | |
| 3505 | - | |
| 3506 | -/***/ }), | |
| 3507 | - | |
| 3508 | -/***/ "@elementor/icons": | |
| 3509 | -/*!****************************************!*\ | |
| 3510 | - !*** external ["elementorV2","icons"] ***! | |
| 3511 | - \****************************************/ | |
| 3512 | -/***/ (function(module) { | |
| 3513 | - | |
| 3514 | -module.exports = window["elementorV2"]["icons"]; | |
| 3515 | - | |
| 3516 | -/***/ }), | |
| 3517 | - | |
| 3518 | -/***/ "@elementor/ui": | |
| 3519 | -/*!*************************************!*\ | |
| 3520 | - !*** external ["elementorV2","ui"] ***! | |
| 3521 | - \*************************************/ | |
| 3522 | -/***/ (function(module) { | |
| 3523 | - | |
| 3524 | -module.exports = window["elementorV2"]["ui"]; | |
| 3525 | - | |
| 3526 | -/***/ }), | |
| 3527 | - | |
| 3528 | -/***/ "@wordpress/i18n": | |
| 3529 | -/*!******************************!*\ | |
| 3530 | - !*** external ["wp","i18n"] ***! | |
| 3531 | - \******************************/ | |
| 3532 | -/***/ (function(module) { | |
| 3533 | - | |
| 3534 | -module.exports = window["wp"]["i18n"]; | |
| 3535 | - | |
| 3536 | -/***/ }), | |
| 3537 | - | |
| 3538 | -/***/ "react": | |
| 3539 | -/*!**************************!*\ | |
| 3540 | - !*** external ["React"] ***! | |
| 3541 | - \**************************/ | |
| 3542 | -/***/ (function(module) { | |
| 3543 | - | |
| 3544 | -module.exports = window["React"]; | |
| 3545 | - | |
| 3546 | -/***/ }), | |
| 3547 | - | |
| 3548 | -/***/ "react-dom": | |
| 3549 | -/*!*****************************!*\ | |
| 3550 | - !*** external ["ReactDOM"] ***! | |
| 3551 | - \*****************************/ | |
| 3552 | -/***/ (function(module) { | |
| 3553 | - | |
| 3554 | -module.exports = window["ReactDOM"]; | |
| 3555 | - | |
| 3556 | -/***/ }) | |
| 3557 | - | |
| 3558 | -/******/ }); | |
| 3559 | -/************************************************************************/ | |
| 3560 | -/******/ // The module cache | |
| 3561 | -/******/ var __webpack_module_cache__ = {}; | |
| 3562 | -/******/ | |
| 3563 | -/******/ // The require function | |
| 3564 | -/******/ function __webpack_require__(moduleId) { | |
| 3565 | -/******/ // Check if module is in cache | |
| 3566 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 3567 | -/******/ if (cachedModule !== undefined) { | |
| 3568 | -/******/ return cachedModule.exports; | |
| 3569 | -/******/ } | |
| 3570 | -/******/ // Create a new module (and put it into the cache) | |
| 3571 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 3572 | -/******/ // no module.id needed | |
| 3573 | -/******/ // no module.loaded needed | |
| 3574 | -/******/ exports: {} | |
| 3575 | -/******/ }; | |
| 3576 | -/******/ | |
| 3577 | -/******/ // Execute the module function | |
| 3578 | -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 3579 | -/******/ | |
| 3580 | -/******/ // Return the exports of the module | |
| 3581 | -/******/ return module.exports; | |
| 3582 | -/******/ } | |
| 3583 | -/******/ | |
| 3584 | -/************************************************************************/ | |
| 3585 | -/******/ /* webpack/runtime/compat get default export */ | |
| 3586 | -/******/ !function() { | |
| 3587 | -/******/ // getDefaultExport function for compatibility with non-harmony modules | |
| 3588 | -/******/ __webpack_require__.n = function(module) { | |
| 3589 | -/******/ var getter = module && module.__esModule ? | |
| 3590 | -/******/ function() { return module['default']; } : | |
| 3591 | -/******/ function() { return module; }; | |
| 3592 | -/******/ __webpack_require__.d(getter, { a: getter }); | |
| 3593 | -/******/ return getter; | |
| 3594 | -/******/ }; | |
| 3595 | -/******/ }(); | |
| 3596 | -/******/ | |
| 3597 | -/******/ /* webpack/runtime/define property getters */ | |
| 3598 | -/******/ !function() { | |
| 3599 | -/******/ // define getter functions for harmony exports | |
| 3600 | -/******/ __webpack_require__.d = function(exports, definition) { | |
| 3601 | -/******/ for(var key in definition) { | |
| 3602 | -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 3603 | -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 3604 | -/******/ } | |
| 3605 | -/******/ } | |
| 3606 | -/******/ }; | |
| 3607 | -/******/ }(); | |
| 3608 | -/******/ | |
| 3609 | -/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 3610 | -/******/ !function() { | |
| 3611 | -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } | |
| 3612 | -/******/ }(); | |
| 3613 | -/******/ | |
| 3614 | -/******/ /* webpack/runtime/make namespace object */ | |
| 3615 | -/******/ !function() { | |
| 3616 | -/******/ // define __esModule on exports | |
| 3617 | -/******/ __webpack_require__.r = function(exports) { | |
| 3618 | -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 3619 | -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 3620 | -/******/ } | |
| 3621 | -/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 3622 | -/******/ }; | |
| 3623 | -/******/ }(); | |
| 3624 | -/******/ | |
| 3625 | -/************************************************************************/ | |
| 3626 | -var __webpack_exports__ = {}; | |
| 3627 | -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. | |
| 3628 | -!function() { | |
| 3629 | -/*!*******************************************************!*\ | |
| 3630 | - !*** ./packages/packages/libs/editor-ui/src/index.ts ***! | |
| 3631 | - \*******************************************************/ | |
| 3632 | -__webpack_require__.r(__webpack_exports__); | |
| 3633 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3634 | -/* harmony export */ CollapseIcon: function() { return /* reexport safe */ _components_collapse_icon__WEBPACK_IMPORTED_MODULE_0__.CollapseIcon; }, | |
| 3635 | -/* harmony export */ CollapsibleContent: function() { return /* reexport safe */ _components_collapsible_content__WEBPACK_IMPORTED_MODULE_1__.CollapsibleContent; }, | |
| 3636 | -/* harmony export */ ConfirmationDialog: function() { return /* reexport safe */ _components_confirmation_dialog__WEBPACK_IMPORTED_MODULE_22__.ConfirmationDialog; }, | |
| 3637 | -/* harmony export */ CtaButton: function() { return /* reexport safe */ _components_cta_button__WEBPACK_IMPORTED_MODULE_13__.CtaButton; }, | |
| 3638 | -/* harmony export */ EditableField: function() { return /* reexport safe */ _components_editable_field__WEBPACK_IMPORTED_MODULE_3__.EditableField; }, | |
| 3639 | -/* harmony export */ EllipsisWithTooltip: function() { return /* reexport safe */ _components_ellipsis_with_tooltip__WEBPACK_IMPORTED_MODULE_2__.EllipsisWithTooltip; }, | |
| 3640 | -/* harmony export */ FileUploadDropzone: function() { return /* reexport safe */ _components_file_upload__WEBPACK_IMPORTED_MODULE_19__.FileUploadDropzone; }, | |
| 3641 | -/* harmony export */ FileUploadRow: function() { return /* reexport safe */ _components_file_upload__WEBPACK_IMPORTED_MODULE_19__.FileUploadRow; }, | |
| 3642 | -/* harmony export */ FloatingActionsBar: function() { return /* reexport safe */ _components_floating_bar__WEBPACK_IMPORTED_MODULE_18__.FloatingActionsBar; }, | |
| 3643 | -/* harmony export */ Form: function() { return /* reexport safe */ _components_form__WEBPACK_IMPORTED_MODULE_12__.Form; }, | |
| 3644 | -/* harmony export */ GlobalDialog: function() { return /* reexport safe */ _components_global_dialog__WEBPACK_IMPORTED_MODULE_10__.GlobalDialog; }, | |
| 3645 | -/* harmony export */ ITEM_HEIGHT: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.ITEM_HEIGHT; }, | |
| 3646 | -/* harmony export */ InfoAlert: function() { return /* reexport safe */ _components_info_alert__WEBPACK_IMPORTED_MODULE_8__.InfoAlert; }, | |
| 3647 | -/* harmony export */ InfoTipCard: function() { return /* reexport safe */ _components_infotip_card__WEBPACK_IMPORTED_MODULE_7__.InfoTipCard; }, | |
| 3648 | -/* harmony export */ IntroductionModal: function() { return /* reexport safe */ _components_introduction_modal__WEBPACK_IMPORTED_MODULE_4__.IntroductionModal; }, | |
| 3649 | -/* harmony export */ MenuItemInfotip: function() { return /* reexport safe */ _components_menu_item__WEBPACK_IMPORTED_MODULE_6__.MenuItemInfotip; }, | |
| 3650 | -/* harmony export */ MenuListItem: function() { return /* reexport safe */ _components_menu_item__WEBPACK_IMPORTED_MODULE_6__.MenuListItem; }, | |
| 3651 | -/* harmony export */ PopoverAction: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.PopoverAction; }, | |
| 3652 | -/* harmony export */ PopoverBody: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.PopoverBody; }, | |
| 3653 | -/* harmony export */ PopoverHeader: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.PopoverHeader; }, | |
| 3654 | -/* harmony export */ PopoverMenuList: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.PopoverMenuList; }, | |
| 3655 | -/* harmony export */ PromotionAlert: function() { return /* reexport safe */ _components_promotions_promotion_alert__WEBPACK_IMPORTED_MODULE_17__.PromotionAlert; }, | |
| 3656 | -/* harmony export */ PromotionChip: function() { return /* reexport safe */ _components_promotions_promotion_chip__WEBPACK_IMPORTED_MODULE_16__.PromotionChip; }, | |
| 3657 | -/* harmony export */ PromotionInfotip: function() { return /* reexport safe */ _components_promotions_promotion_infotip__WEBPACK_IMPORTED_MODULE_14__.PromotionInfotip; }, | |
| 3658 | -/* harmony export */ PromotionPopover: function() { return /* reexport safe */ _components_promotions_promotion_popover__WEBPACK_IMPORTED_MODULE_15__.PromotionPopover; }, | |
| 3659 | -/* harmony export */ SaveChangesDialog: function() { return /* reexport safe */ _components_save_changes_dialog__WEBPACK_IMPORTED_MODULE_21__.SaveChangesDialog; }, | |
| 3660 | -/* harmony export */ SearchField: function() { return /* reexport safe */ _components_search_field__WEBPACK_IMPORTED_MODULE_11__.SearchField; }, | |
| 3661 | -/* harmony export */ SectionPopoverBody: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.SectionPopoverBody; }, | |
| 3662 | -/* harmony export */ SectionRefContext: function() { return /* reexport safe */ _contexts_section_context__WEBPACK_IMPORTED_MODULE_23__.SectionRefContext; }, | |
| 3663 | -/* harmony export */ StyledMenuList: function() { return /* reexport safe */ _components_popover__WEBPACK_IMPORTED_MODULE_20__.StyledMenuList; }, | |
| 3664 | -/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _components_theme_provider__WEBPACK_IMPORTED_MODULE_5__["default"]; }, | |
| 3665 | -/* harmony export */ WarningInfotip: function() { return /* reexport safe */ _components_warning_infotip__WEBPACK_IMPORTED_MODULE_9__.WarningInfotip; }, | |
| 3666 | -/* harmony export */ closeDialog: function() { return /* reexport safe */ _components_global_dialog__WEBPACK_IMPORTED_MODULE_10__.closeDialog; }, | |
| 3667 | -/* harmony export */ getCollapsibleValue: function() { return /* reexport safe */ _components_collapsible_content__WEBPACK_IMPORTED_MODULE_1__.getCollapsibleValue; }, | |
| 3668 | -/* harmony export */ openDialog: function() { return /* reexport safe */ _components_global_dialog__WEBPACK_IMPORTED_MODULE_10__.openDialog; }, | |
| 3669 | -/* harmony export */ useCanvasClickHandler: function() { return /* reexport safe */ _hooks_use_canvas_click_handler__WEBPACK_IMPORTED_MODULE_26__.useCanvasClickHandler; }, | |
| 3670 | -/* harmony export */ useDialog: function() { return /* reexport safe */ _components_save_changes_dialog__WEBPACK_IMPORTED_MODULE_21__.useDialog; }, | |
| 3671 | -/* harmony export */ useEditable: function() { return /* reexport safe */ _hooks_use_editable__WEBPACK_IMPORTED_MODULE_24__.useEditable; }, | |
| 3672 | -/* harmony export */ useFloatingActionsBar: function() { return /* reexport safe */ _components_floating_bar__WEBPACK_IMPORTED_MODULE_18__.useFloatingActionsBar; }, | |
| 3673 | -/* harmony export */ useSectionWidth: function() { return /* reexport safe */ _contexts_section_context__WEBPACK_IMPORTED_MODULE_23__.useSectionWidth; }, | |
| 3674 | -/* harmony export */ useTextFieldAutoSelect: function() { return /* reexport safe */ _hooks_use_text_field_auto_select__WEBPACK_IMPORTED_MODULE_25__.useTextFieldAutoSelect; } | |
| 3675 | -/* harmony export */ }); | |
| 3676 | -/* harmony import */ var _components_collapse_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/collapse-icon */ "./packages/packages/libs/editor-ui/src/components/collapse-icon.tsx"); | |
| 3677 | -/* harmony import */ var _components_collapsible_content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/collapsible-content */ "./packages/packages/libs/editor-ui/src/components/collapsible-content.tsx"); | |
| 3678 | -/* harmony import */ var _components_ellipsis_with_tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/ellipsis-with-tooltip */ "./packages/packages/libs/editor-ui/src/components/ellipsis-with-tooltip.tsx"); | |
| 3679 | -/* harmony import */ var _components_editable_field__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/editable-field */ "./packages/packages/libs/editor-ui/src/components/editable-field.tsx"); | |
| 3680 | -/* harmony import */ var _components_introduction_modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/introduction-modal */ "./packages/packages/libs/editor-ui/src/components/introduction-modal.tsx"); | |
| 3681 | -/* harmony import */ var _components_theme_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/theme-provider */ "./packages/packages/libs/editor-ui/src/components/theme-provider.tsx"); | |
| 3682 | -/* harmony import */ var _components_menu_item__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/menu-item */ "./packages/packages/libs/editor-ui/src/components/menu-item.tsx"); | |
| 3683 | -/* harmony import */ var _components_infotip_card__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/infotip-card */ "./packages/packages/libs/editor-ui/src/components/infotip-card.tsx"); | |
| 3684 | -/* harmony import */ var _components_info_alert__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/info-alert */ "./packages/packages/libs/editor-ui/src/components/info-alert.tsx"); | |
| 3685 | -/* harmony import */ var _components_warning_infotip__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/warning-infotip */ "./packages/packages/libs/editor-ui/src/components/warning-infotip.tsx"); | |
| 3686 | -/* harmony import */ var _components_global_dialog__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/global-dialog */ "./packages/packages/libs/editor-ui/src/components/global-dialog/index.ts"); | |
| 3687 | -/* harmony import */ var _components_search_field__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./components/search-field */ "./packages/packages/libs/editor-ui/src/components/search-field.tsx"); | |
| 3688 | -/* harmony import */ var _components_form__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./components/form */ "./packages/packages/libs/editor-ui/src/components/form.tsx"); | |
| 3689 | -/* harmony import */ var _components_cta_button__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./components/cta-button */ "./packages/packages/libs/editor-ui/src/components/cta-button.tsx"); | |
| 3690 | -/* harmony import */ var _components_promotions_promotion_infotip__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./components/promotions/promotion-infotip */ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-infotip.tsx"); | |
| 3691 | -/* harmony import */ var _components_promotions_promotion_popover__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./components/promotions/promotion-popover */ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-popover.tsx"); | |
| 3692 | -/* harmony import */ var _components_promotions_promotion_chip__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./components/promotions/promotion-chip */ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-chip.tsx"); | |
| 3693 | -/* harmony import */ var _components_promotions_promotion_alert__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./components/promotions/promotion-alert */ "./packages/packages/libs/editor-ui/src/components/promotions/promotion-alert.tsx"); | |
| 3694 | -/* harmony import */ var _components_floating_bar__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./components/floating-bar */ "./packages/packages/libs/editor-ui/src/components/floating-bar.tsx"); | |
| 3695 | -/* harmony import */ var _components_file_upload__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./components/file-upload */ "./packages/packages/libs/editor-ui/src/components/file-upload/index.ts"); | |
| 3696 | -/* harmony import */ var _components_popover__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./components/popover */ "./packages/packages/libs/editor-ui/src/components/popover/index.ts"); | |
| 3697 | -/* harmony import */ var _components_save_changes_dialog__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./components/save-changes-dialog */ "./packages/packages/libs/editor-ui/src/components/save-changes-dialog.tsx"); | |
| 3698 | -/* harmony import */ var _components_confirmation_dialog__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./components/confirmation-dialog */ "./packages/packages/libs/editor-ui/src/components/confirmation-dialog.tsx"); | |
| 3699 | -/* harmony import */ var _contexts_section_context__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./contexts/section-context */ "./packages/packages/libs/editor-ui/src/contexts/section-context.tsx"); | |
| 3700 | -/* harmony import */ var _hooks_use_editable__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./hooks/use-editable */ "./packages/packages/libs/editor-ui/src/hooks/use-editable.ts"); | |
| 3701 | -/* harmony import */ var _hooks_use_text_field_auto_select__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./hooks/use-text-field-auto-select */ "./packages/packages/libs/editor-ui/src/hooks/use-text-field-auto-select.ts"); | |
| 3702 | -/* harmony import */ var _hooks_use_canvas_click_handler__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./hooks/use-canvas-click-handler */ "./packages/packages/libs/editor-ui/src/hooks/use-canvas-click-handler.tsx"); | |
| 3703 | -// components | |
| 3704 | - | |
| 3705 | - | |
| 3706 | - | |
| 3707 | - | |
| 3708 | - | |
| 3709 | - | |
| 3710 | - | |
| 3711 | - | |
| 3712 | - | |
| 3713 | - | |
| 3714 | - | |
| 3715 | - | |
| 3716 | - | |
| 3717 | - | |
| 3718 | - | |
| 3719 | - | |
| 3720 | - | |
| 3721 | - | |
| 3722 | - | |
| 3723 | - | |
| 3724 | - | |
| 3725 | - | |
| 3726 | - | |
| 3727 | - | |
| 3728 | -// contexts | |
| 3729 | - | |
| 3730 | - | |
| 3731 | -// hooks | |
| 3732 | - | |
| 3733 | - | |
| 3734 | - | |
| 3735 | -}(); | |
| 3736 | -(window.elementorV2 = window.elementorV2 || {}).editorUi = __webpack_exports__; | |
| 3737 | -/******/ })() | |
| 3738 | -; | |
| 2098 | +//#endregion | |
| 2099 | +})(elementorV2.icons, elementorV2.ui, React, wp.i18n, elementorV2.editorV1Adapters, ReactDOM); | |
| 3739 | 2100 | window.elementorV2.editorUi?.init?.(); |
| 3740 | 2101 | //# sourceMappingURL=editor-ui.js.map |