| @@ -1,449 +1 @@ | ||
| 1 | -/******/ (function() { // webpackBootstrap | |
| 2 | -/******/ "use strict"; | |
| 3 | -/******/ var __webpack_modules__ = ({ | |
| 4 | - | |
| 5 | -/***/ "./src/light-logo.svg": | |
| 6 | -/*!****************************!*\ | |
| 7 | - !*** ./src/light-logo.svg ***! | |
| 8 | - \****************************/ | |
| 9 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 10 | - | |
| 11 | -__webpack_require__.r(__webpack_exports__); | |
| 12 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 13 | -/* harmony export */ "ReactComponent": function() { return /* binding */ SvgLightLogo; } | |
| 14 | -/* harmony export */ }); | |
| 15 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | |
| 16 | -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | |
| 17 | -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | |
| 18 | - | |
| 19 | - | |
| 20 | - | |
| 21 | -var SvgLightLogo = function SvgLightLogo(props) { | |
| 22 | - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ | |
| 23 | - xmlns: "http://www.w3.org/2000/svg", | |
| 24 | - viewBox: "0 0 350 350", | |
| 25 | - xmlSpace: "preserve" | |
| 26 | - }, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { | |
| 27 | - d: "m239.5 547.7 114.2-114.2 144.8 144.8-145.4 145.2-113.6-113.6c-17.2-17.2-17.2-45 0-62.2z", | |
| 28 | - style: { | |
| 29 | - fill: "#265fff" | |
| 30 | - }, | |
| 31 | - transform: "translate(-165 -386.994)" | |
| 32 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { | |
| 33 | - d: "m207.2 477 43.5-43.5 144.8 144.8-145.4 145.2-42.9-42.9c-56.3-56.2-56.3-147.4 0-203.6z", | |
| 34 | - style: { | |
| 35 | - fill: "#ffd300" | |
| 36 | - }, | |
| 37 | - transform: "translate(-165 -386.994)" | |
| 38 | - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { | |
| 39 | - d: "M267.8 638.2c-32.8-32.8-32.8-86 0-118.8l34.4-34.4 93.3 93.3-93.9 93.7-33.8-33.8z", | |
| 40 | - style: { | |
| 41 | - fill: "#ffe980" | |
| 42 | - }, | |
| 43 | - transform: "translate(-165 -386.994)" | |
| 44 | - })); | |
| 45 | -}; | |
| 46 | - | |
| 47 | - | |
| 48 | -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNS40LjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAzNTAgMzUwIiBzdHlsZT0iIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MXtmaWxsOiMyNjVGRkY7fQ0KCS5zdDJ7ZmlsbDojRkZEMzAwO30NCgkuc3Qze2ZpbGw6I0ZGRTk4MDt9DQo8L3N0eWxlPg0KPGcgaWQ9ImRlcGljdGVyX2xvZ290eXBlIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTY1IC0zODYuOTk0KSI+DQoJPHBhdGggaWQ9IlJlY3RhbmdsZV83NzkiIGNsYXNzPSJzdDEiIGQ9Ik0yMzkuNSw1NDcuN2wxMTQuMi0xMTQuMmwwLDBsMTQ0LjgsMTQ0LjhsMCwwTDM1My4xLDcyMy41bDAsMEwyMzkuNSw2MDkuOQ0KCQlDMjIyLjMsNTkyLjcsMjIyLjMsNTY0LjksMjM5LjUsNTQ3Ljd6Ii8+DQoJPHBhdGggaWQ9IlJlY3RhbmdsZV83ODAiIGNsYXNzPSJzdDIiIGQ9Ik0yMDcuMiw0NzdsNDMuNS00My41bDAsMGwxNDQuOCwxNDQuOGwwLDBMMjUwLjEsNzIzLjVsMCwwbC00Mi45LTQyLjkNCgkJQzE1MC45LDYyNC40LDE1MC45LDUzMy4yLDIwNy4yLDQ3N3oiLz4NCgk8cGF0aCBpZD0iSW50ZXJzZWN0aW9uXzIyIiBjbGFzcz0ic3QzIiBkPSJNMjY3LjgsNjM4LjJjLTMyLjgtMzIuOC0zMi44LTg2LDAtMTE4LjhjMCwwLDAsMCwwLDBsMzQuNC0zNC40bDkzLjMsOTMuM0wzMDEuNiw2NzINCgkJTDI2Ny44LDYzOC4yeiIvPg0KPC9nPg0KPC9zdmc+DQo="); | |
| 49 | - | |
| 50 | -/***/ }), | |
| 51 | - | |
| 52 | -/***/ "./src/edit.js": | |
| 53 | -/*!*********************!*\ | |
| 54 | - !*** ./src/edit.js ***! | |
| 55 | - \*********************/ | |
| 56 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 57 | - | |
| 58 | -__webpack_require__.r(__webpack_exports__); | |
| 59 | -/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 60 | -/* harmony export */ "default": function() { return /* binding */ Edit; } | |
| 61 | -/* harmony export */ }); | |
| 62 | -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); | |
| 63 | -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); | |
| 64 | -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); | |
| 65 | -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); | |
| 66 | -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); | |
| 67 | -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); | |
| 68 | -/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); | |
| 69 | -/* harmony import */ var _light_logo_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./light-logo.svg */ "./src/light-logo.svg"); | |
| 70 | - | |
| 71 | - | |
| 72 | -/** | |
| 73 | - * React hook that is used to mark the block wrapper element. | |
| 74 | - * It provides all the necessary props like the class name. | |
| 75 | - * | |
| 76 | - * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps | |
| 77 | - */ | |
| 78 | - // import ServerSideRender from '@wordpress/server-side-render'; | |
| 79 | - | |
| 80 | - | |
| 81 | -/** | |
| 82 | - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. | |
| 83 | - * Those files can contain any CSS code that gets applied to the editor. | |
| 84 | - * | |
| 85 | - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css | |
| 86 | - */ | |
| 87 | - | |
| 88 | - | |
| 89 | - | |
| 90 | -function Edit(_ref) { | |
| 91 | - let { | |
| 92 | - attributes, | |
| 93 | - setAttributes | |
| 94 | - } = _ref; | |
| 95 | - const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); | |
| 96 | - | |
| 97 | - function updateID(newID) { | |
| 98 | - setAttributes({ | |
| 99 | - id: Number(newID) | |
| 100 | - }); | |
| 101 | - } // function fetchSlider( sliderID ) { | |
| 102 | - // fetch( ajaxurl + '?action=depicter/document/preview&status=publish&ID=' + sliderID, { | |
| 103 | - // method: 'GET', // or 'PUT' | |
| 104 | - // headers: { | |
| 105 | - // 'Content-Type': 'text/html', | |
| 106 | - // }, | |
| 107 | - // } ) | |
| 108 | - // .then( function( response ) { | |
| 109 | - // return response.text(); | |
| 110 | - // } ) | |
| 111 | - // .then( function( html ) { | |
| 112 | - // const depicterContentWrapper = document.querySelector( '.depicter-content' ); | |
| 113 | - // depicterContentWrapper.innerHTML = html; | |
| 114 | - // } ) | |
| 115 | - // .catch( function() { | |
| 116 | - // console.log( 'error encountered' ); | |
| 117 | - // } ); | |
| 118 | - // } | |
| 119 | - | |
| 120 | - | |
| 121 | - function getSliderTitle(sliderID) { | |
| 122 | - let sliderTitle = null; | |
| 123 | - | |
| 124 | - if (sliderID) { | |
| 125 | - sliderTitle = depicterSliders.list.map(function (item) { | |
| 126 | - if (item.value == sliderID) { | |
| 127 | - return item.label; | |
| 128 | - } | |
| 129 | - | |
| 130 | - return null; | |
| 131 | - }); | |
| 132 | - } | |
| 133 | - | |
| 134 | - return sliderTitle ? sliderTitle : 'Select slider from list'; | |
| 135 | - } | |
| 136 | - | |
| 137 | - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { | |
| 138 | - key: "setting" | |
| 139 | - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Panel, { | |
| 140 | - header: "Depicter" | |
| 141 | - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { | |
| 142 | - title: "Depicter Settings", | |
| 143 | - initialOpen: true | |
| 144 | - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { | |
| 145 | - label: "Slider", | |
| 146 | - value: attributes.id, | |
| 147 | - options: depicterSliders.list, | |
| 148 | - onChange: updateID | |
| 149 | - }))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", blockProps, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { | |
| 150 | - className: "dep-widget-wrapper" | |
| 151 | - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { | |
| 152 | - src: _light_logo_svg__WEBPACK_IMPORTED_MODULE_4__["default"], | |
| 153 | - alt: "logo" | |
| 154 | - }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, " ", getSliderTitle(attributes.id), " ")))); | |
| 155 | -} | |
| 156 | - | |
| 157 | -/***/ }), | |
| 158 | - | |
| 159 | -/***/ "./src/index.js": | |
| 160 | -/*!**********************!*\ | |
| 161 | - !*** ./src/index.js ***! | |
| 162 | - \**********************/ | |
| 163 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 164 | - | |
| 165 | -__webpack_require__.r(__webpack_exports__); | |
| 166 | -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); | |
| 167 | -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); | |
| 168 | -/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); | |
| 169 | -/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); | |
| 170 | -/** | |
| 171 | - * Registers a new block provided a unique name and an object defining its behavior. | |
| 172 | - * | |
| 173 | - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ | |
| 174 | - */ | |
| 175 | - | |
| 176 | -/** | |
| 177 | - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. | |
| 178 | - * All files containing `style` keyword are bundled together. The code used | |
| 179 | - * gets applied both to the front of your site and to the editor. | |
| 180 | - * | |
| 181 | - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css | |
| 182 | - */ | |
| 183 | - | |
| 184 | - | |
| 185 | -/** | |
| 186 | - * Internal dependencies | |
| 187 | - */ | |
| 188 | - | |
| 189 | - | |
| 190 | -/** | |
| 191 | - * Every block starts by registering a new block type definition. | |
| 192 | - * | |
| 193 | - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ | |
| 194 | - */ | |
| 195 | - | |
| 196 | -(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('depicter/slider', { | |
| 197 | - /** | |
| 198 | - * @see ./edit.js | |
| 199 | - */ | |
| 200 | - edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"] | |
| 201 | -}); | |
| 202 | - | |
| 203 | -/***/ }), | |
| 204 | - | |
| 205 | -/***/ "./src/editor.scss": | |
| 206 | -/*!*************************!*\ | |
| 207 | - !*** ./src/editor.scss ***! | |
| 208 | - \*************************/ | |
| 209 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 210 | - | |
| 211 | -__webpack_require__.r(__webpack_exports__); | |
| 212 | -// extracted by mini-css-extract-plugin | |
| 213 | - | |
| 214 | - | |
| 215 | -/***/ }), | |
| 216 | - | |
| 217 | -/***/ "./src/style.scss": | |
| 218 | -/*!************************!*\ | |
| 219 | - !*** ./src/style.scss ***! | |
| 220 | - \************************/ | |
| 221 | -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | |
| 222 | - | |
| 223 | -__webpack_require__.r(__webpack_exports__); | |
| 224 | -// extracted by mini-css-extract-plugin | |
| 225 | - | |
| 226 | - | |
| 227 | -/***/ }), | |
| 228 | - | |
| 229 | -/***/ "react": | |
| 230 | -/*!************************!*\ | |
| 231 | - !*** external "React" ***! | |
| 232 | - \************************/ | |
| 233 | -/***/ (function(module) { | |
| 234 | - | |
| 235 | -module.exports = window["React"]; | |
| 236 | - | |
| 237 | -/***/ }), | |
| 238 | - | |
| 239 | -/***/ "@wordpress/block-editor": | |
| 240 | -/*!*************************************!*\ | |
| 241 | - !*** external ["wp","blockEditor"] ***! | |
| 242 | - \*************************************/ | |
| 243 | -/***/ (function(module) { | |
| 244 | - | |
| 245 | -module.exports = window["wp"]["blockEditor"]; | |
| 246 | - | |
| 247 | -/***/ }), | |
| 248 | - | |
| 249 | -/***/ "@wordpress/blocks": | |
| 250 | -/*!********************************!*\ | |
| 251 | - !*** external ["wp","blocks"] ***! | |
| 252 | - \********************************/ | |
| 253 | -/***/ (function(module) { | |
| 254 | - | |
| 255 | -module.exports = window["wp"]["blocks"]; | |
| 256 | - | |
| 257 | -/***/ }), | |
| 258 | - | |
| 259 | -/***/ "@wordpress/components": | |
| 260 | -/*!************************************!*\ | |
| 261 | - !*** external ["wp","components"] ***! | |
| 262 | - \************************************/ | |
| 263 | -/***/ (function(module) { | |
| 264 | - | |
| 265 | -module.exports = window["wp"]["components"]; | |
| 266 | - | |
| 267 | -/***/ }), | |
| 268 | - | |
| 269 | -/***/ "@wordpress/element": | |
| 270 | -/*!*********************************!*\ | |
| 271 | - !*** external ["wp","element"] ***! | |
| 272 | - \*********************************/ | |
| 273 | -/***/ (function(module) { | |
| 274 | - | |
| 275 | -module.exports = window["wp"]["element"]; | |
| 276 | - | |
| 277 | -/***/ }) | |
| 278 | - | |
| 279 | -/******/ }); | |
| 280 | -/************************************************************************/ | |
| 281 | -/******/ // The module cache | |
| 282 | -/******/ var __webpack_module_cache__ = {}; | |
| 283 | -/******/ | |
| 284 | -/******/ // The require function | |
| 285 | -/******/ function __webpack_require__(moduleId) { | |
| 286 | -/******/ // Check if module is in cache | |
| 287 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 288 | -/******/ if (cachedModule !== undefined) { | |
| 289 | -/******/ return cachedModule.exports; | |
| 290 | -/******/ } | |
| 291 | -/******/ // Create a new module (and put it into the cache) | |
| 292 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 293 | -/******/ // no module.id needed | |
| 294 | -/******/ // no module.loaded needed | |
| 295 | -/******/ exports: {} | |
| 296 | -/******/ }; | |
| 297 | -/******/ | |
| 298 | -/******/ // Execute the module function | |
| 299 | -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 300 | -/******/ | |
| 301 | -/******/ // Return the exports of the module | |
| 302 | -/******/ return module.exports; | |
| 303 | -/******/ } | |
| 304 | -/******/ | |
| 305 | -/******/ // expose the modules object (__webpack_modules__) | |
| 306 | -/******/ __webpack_require__.m = __webpack_modules__; | |
| 307 | -/******/ | |
| 308 | -/************************************************************************/ | |
| 309 | -/******/ /* webpack/runtime/chunk loaded */ | |
| 310 | -/******/ !function() { | |
| 311 | -/******/ var deferred = []; | |
| 312 | -/******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { | |
| 313 | -/******/ if(chunkIds) { | |
| 314 | -/******/ priority = priority || 0; | |
| 315 | -/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; | |
| 316 | -/******/ deferred[i] = [chunkIds, fn, priority]; | |
| 317 | -/******/ return; | |
| 318 | -/******/ } | |
| 319 | -/******/ var notFulfilled = Infinity; | |
| 320 | -/******/ for (var i = 0; i < deferred.length; i++) { | |
| 321 | -/******/ var chunkIds = deferred[i][0]; | |
| 322 | -/******/ var fn = deferred[i][1]; | |
| 323 | -/******/ var priority = deferred[i][2]; | |
| 324 | -/******/ var fulfilled = true; | |
| 325 | -/******/ for (var j = 0; j < chunkIds.length; j++) { | |
| 326 | -/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { | |
| 327 | -/******/ chunkIds.splice(j--, 1); | |
| 328 | -/******/ } else { | |
| 329 | -/******/ fulfilled = false; | |
| 330 | -/******/ if(priority < notFulfilled) notFulfilled = priority; | |
| 331 | -/******/ } | |
| 332 | -/******/ } | |
| 333 | -/******/ if(fulfilled) { | |
| 334 | -/******/ deferred.splice(i--, 1) | |
| 335 | -/******/ var r = fn(); | |
| 336 | -/******/ if (r !== undefined) result = r; | |
| 337 | -/******/ } | |
| 338 | -/******/ } | |
| 339 | -/******/ return result; | |
| 340 | -/******/ }; | |
| 341 | -/******/ }(); | |
| 342 | -/******/ | |
| 343 | -/******/ /* webpack/runtime/compat get default export */ | |
| 344 | -/******/ !function() { | |
| 345 | -/******/ // getDefaultExport function for compatibility with non-harmony modules | |
| 346 | -/******/ __webpack_require__.n = function(module) { | |
| 347 | -/******/ var getter = module && module.__esModule ? | |
| 348 | -/******/ function() { return module['default']; } : | |
| 349 | -/******/ function() { return module; }; | |
| 350 | -/******/ __webpack_require__.d(getter, { a: getter }); | |
| 351 | -/******/ return getter; | |
| 352 | -/******/ }; | |
| 353 | -/******/ }(); | |
| 354 | -/******/ | |
| 355 | -/******/ /* webpack/runtime/define property getters */ | |
| 356 | -/******/ !function() { | |
| 357 | -/******/ // define getter functions for harmony exports | |
| 358 | -/******/ __webpack_require__.d = function(exports, definition) { | |
| 359 | -/******/ for(var key in definition) { | |
| 360 | -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 361 | -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 362 | -/******/ } | |
| 363 | -/******/ } | |
| 364 | -/******/ }; | |
| 365 | -/******/ }(); | |
| 366 | -/******/ | |
| 367 | -/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 368 | -/******/ !function() { | |
| 369 | -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } | |
| 370 | -/******/ }(); | |
| 371 | -/******/ | |
| 372 | -/******/ /* webpack/runtime/make namespace object */ | |
| 373 | -/******/ !function() { | |
| 374 | -/******/ // define __esModule on exports | |
| 375 | -/******/ __webpack_require__.r = function(exports) { | |
| 376 | -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 377 | -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 378 | -/******/ } | |
| 379 | -/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 380 | -/******/ }; | |
| 381 | -/******/ }(); | |
| 382 | -/******/ | |
| 383 | -/******/ /* webpack/runtime/jsonp chunk loading */ | |
| 384 | -/******/ !function() { | |
| 385 | -/******/ // no baseURI | |
| 386 | -/******/ | |
| 387 | -/******/ // object to store loaded and loading chunks | |
| 388 | -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched | |
| 389 | -/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded | |
| 390 | -/******/ var installedChunks = { | |
| 391 | -/******/ "index": 0, | |
| 392 | -/******/ "./style-index": 0 | |
| 393 | -/******/ }; | |
| 394 | -/******/ | |
| 395 | -/******/ // no chunk on demand loading | |
| 396 | -/******/ | |
| 397 | -/******/ // no prefetching | |
| 398 | -/******/ | |
| 399 | -/******/ // no preloaded | |
| 400 | -/******/ | |
| 401 | -/******/ // no HMR | |
| 402 | -/******/ | |
| 403 | -/******/ // no HMR manifest | |
| 404 | -/******/ | |
| 405 | -/******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; | |
| 406 | -/******/ | |
| 407 | -/******/ // install a JSONP callback for chunk loading | |
| 408 | -/******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { | |
| 409 | -/******/ var chunkIds = data[0]; | |
| 410 | -/******/ var moreModules = data[1]; | |
| 411 | -/******/ var runtime = data[2]; | |
| 412 | -/******/ // add "moreModules" to the modules object, | |
| 413 | -/******/ // then flag all "chunkIds" as loaded and fire callback | |
| 414 | -/******/ var moduleId, chunkId, i = 0; | |
| 415 | -/******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { | |
| 416 | -/******/ for(moduleId in moreModules) { | |
| 417 | -/******/ if(__webpack_require__.o(moreModules, moduleId)) { | |
| 418 | -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; | |
| 419 | -/******/ } | |
| 420 | -/******/ } | |
| 421 | -/******/ if(runtime) var result = runtime(__webpack_require__); | |
| 422 | -/******/ } | |
| 423 | -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); | |
| 424 | -/******/ for(;i < chunkIds.length; i++) { | |
| 425 | -/******/ chunkId = chunkIds[i]; | |
| 426 | -/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { | |
| 427 | -/******/ installedChunks[chunkId][0](); | |
| 428 | -/******/ } | |
| 429 | -/******/ installedChunks[chunkId] = 0; | |
| 430 | -/******/ } | |
| 431 | -/******/ return __webpack_require__.O(result); | |
| 432 | -/******/ } | |
| 433 | -/******/ | |
| 434 | -/******/ var chunkLoadingGlobal = self["webpackChunkdepicter"] = self["webpackChunkdepicter"] || []; | |
| 435 | -/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); | |
| 436 | -/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); | |
| 437 | -/******/ }(); | |
| 438 | -/******/ | |
| 439 | -/************************************************************************/ | |
| 440 | -/******/ | |
| 441 | -/******/ // startup | |
| 442 | -/******/ // Load entry module and return exports | |
| 443 | -/******/ // This entry module depends on other loaded chunks and execution need to be delayed | |
| 444 | -/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], function() { return __webpack_require__("./src/index.js"); }) | |
| 445 | -/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); | |
| 446 | -/******/ | |
| 447 | -/******/ })() | |
| 448 | -; | |
| 449 | -//# sourceMappingURL=index.js.map | |
| 1 | +!function(){var e,n={266:function(e,n,t){"use strict";var i=window.wp.blocks,o=window.wp.element,r=window.wp.blockEditor,a=window.wp.components,s=t(697),c=t.n(s),d=window.React,u=t.n(d);function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},l.apply(this,arguments)}function f(e,n){if(null==e)return{};var t,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)t=r[i],n.indexOf(t)>=0||(o[t]=e[t]);return o}var m,p,g=(m=function(e){!function(n){if("undefined"!=typeof window){var t,i=0,o=!1,r=!1,a="message".length,s="[iFrameSizer]",c=s.length,d=null,u=window.requestAnimationFrame,l={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},f={},m=null,p={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},g={};window.jQuery&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){H(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),e.exports=A(),window.iFrameResize=window.iFrameResize||A()}function h(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function b(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return f[e]?f[e].log:o}function v(e,n){O("log",e,n,y(e))}function k(e,n){O("info",e,n,y(e))}function x(e,n){O("warn",e,n,!0)}function O(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function E(e){function n(){t("Height"),t("Width"),P((function(){S(B),F(L),p("onResized",B)}),B,"init")}function t(e){var n=Number(f[L]["max"+e]),t=Number(f[L]["min"+e]),i=e.toLowerCase(),o=Number(B[i]);v(L,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(L,"Set "+i+" to min value")),o>n&&(o=n,v(L,"Set "+i+" to max value")),B[i]=""+o}function i(e){return N.substr(N.indexOf(":")+a+e)}function o(e,n){var t,i;t=function(){var t,i;W("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=B.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},g[i=n]||(g[i]=setTimeout((function(){g[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return z(L),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function u(e){var n=e?r(B.iframe):{x:0,y:0},t={x:Number(B.width)+n.x,y:Number(B.height)+n.y};v(L,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(L,"Unable to scroll to requested position, window.parentIFrame not found"):(d=t,l(),v(L,"--"))}function l(){!1!==p("onScroll",d)?F(L):T()}function m(e){p(e,{iframe:B.iframe,screenX:B.width,screenY:B.height,type:B.type})}function p(e,n){return I(L,e,n)}var h,y,O,E,M,H,N=e.data,B={},L=null;"[iFrameResizerChild]Ready"===N?function(){for(var e in f)W("iFrame requested init",j(e),f[e].iframe,e)}():s===(""+N).substr(0,c)&&N.substr(c).split(":")[0]in f?(E=(O=N.substr(c).split(":"))[1]?parseInt(O[1],10):0,M=f[O[0]]&&f[O[0]].iframe,H=getComputedStyle(M),B={iframe:M,id:O[0],height:E+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(H)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(H),width:O[2],type:O[3]},L=B.id,f[L]&&(f[L].loaded=!0),(y=B.type in{true:1,false:1,undefined:1})&&v(L,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return f[e]||(n=!1,x(B.type+" No settings for "+e+". Message was: "+N)),n}(L)&&(v(L,"Received: "+N),h=!0,null===B.iframe&&(x(L,"IFrame ("+B.id+") not found"),h=!1),h&&function(){var n,t=e.origin,i=f[L]&&f[L].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(L,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(n=f[L]&&f[L].remoteHost,v(L,"Checking connection is from: "+n),t===n)))throw new Error("Unexpected message received from: "+t+" for "+B.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(f[L]&&f[L].firstRun&&f[L]&&(f[L].firstRun=!1),B.type){case"close":R(B.iframe);break;case"message":c=i(6),v(L,"onMessage passed: {iframe: "+B.iframe.id+", message: "+c+"}"),p("onMessage",{iframe:B.iframe,message:JSON.parse(c)}),v(L,"--");break;case"mouseenter":m("onMouseEnter");break;case"mouseleave":m("onMouseLeave");break;case"autoResize":f[L].autoResize=JSON.parse(i(9));break;case"scrollTo":u(!1);break;case"scrollToOffset":u(!0);break;case"pageInfo":o(f[L]&&f[L].iframe,L),function(){function e(e,i){function r(){f[t]?o(f[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",b)}var t=L;e("Add ",w),f[t]&&(f[t].stopPageInfo=n)}();break;case"pageInfoStop":f[L]&&f[L].stopPageInfo&&(f[L].stopPageInfo(),delete f[L].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",a=decodeURIComponent(t),(s=document.getElementById(a)||document.getElementsByName(a)[0])?(e=r(s),v(L,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(L,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(L,"In page link #"+t+" not found and window.parentIFrame not found"):v(L,"In page link #"+t+" not found");break;case"reset":C(B);break;case"init":n(),p("onInit",B.iframe);break;default:n()}var e,t,a,s,c}())):k(L,"Ignored: "+N)}function I(e,n,t){var i=null,o=null;if(f[e]){if("function"!=typeof(i=f[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function M(e){var n=e.id;delete f[n]}function R(e){var n=e.id;if(!1!==I(n,"onClose",n)){v(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}I(n,"onClosed",n),v(n,"--"),M(e)}else v(n,"Close iframe cancelled by onClose event")}function z(e){null===d&&v(e,"Get page position: "+(d={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop}).x+","+d.y)}function F(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),T())}function T(){d=null}function C(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),z(e.id),P((function(){S(e),W("reset","reset",e.iframe,e.id)}),e,"reset")}function S(e){function n(n){r||"0"!==e[n]||(r=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(f).forEach((function(e){!function(e){function n(n){return"0px"===(f[e]&&f[e].iframe.style[n])}f[e]&&null!==f[e].iframe.offsetParent&&(n("height")||n("width"))&&W("Visibility change","resize",f[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),N(e,16)}var t,i=h();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;f[i]&&(f[i].sizeHeight&&t("height"),f[i].sizeWidth&&t("width"))}function P(e,n,t){t!==n.type&&u&&!window.jasmine?(v(n.id,"Requesting animation frame"),u(e)):e()}function W(e,n,t,i,o){var r,a=!1;i=i||t.id,f[i]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(r=f[i]&&f[i].targetOrigin,v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+r),t.contentWindow.postMessage(s+n,r)):x(i,"["+e+"] IFrame("+i+") not found"),o&&f[i]&&f[i].warningTimeout&&(f[i].msgTimeout=setTimeout((function(){!f[i]||f[i].loaded||a||(a=!0,x(i,"IFrame has not responded within "+f[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),f[i].warningTimeout)))}function j(e){return e+":"+f[e].bodyMarginV1+":"+f[e].sizeWidth+":"+f[e].log+":"+f[e].interval+":"+f[e].enablePublicMethods+":"+f[e].autoResize+":"+f[e].bodyMargin+":"+f[e].heightCalculationMethod+":"+f[e].bodyBackground+":"+f[e].bodyPadding+":"+f[e].tolerance+":"+f[e].inPageLinks+":"+f[e].resizeFrom+":"+f[e].widthCalculationMethod}function H(e,t){function r(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],x(c,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,s,c=function(n){var r;return""===n&&(e.id=(r=t&&t.id||p.id+i++,null!==document.getElementById(r)&&(r+=i++),n=r),o=(t||{}).log,v(n,"Added missing iframe ID: "+n+" ("+e.src+")")),n}(e.id);c in f&&"iFrameResizer"in e?x(c,"Ignored iFrame, already setup."):(function(n){var t;n=n||{},f[c]={firstRun:!0,iframe:e,remoteHost:e.src&&e.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(n),Object.keys(n).forEach(r,n),function(e){for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&(f[c][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:p[n])}(n),f[c]&&(f[c].targetOrigin=!0===f[c].checkOrigin?""===(t=f[c].remoteHost)||null!==t.match(/^(about:blank|javascript:|file:\/\/)/)?"*":t:"*")}(t),function(){switch(v(c,"IFrame scrolling "+(f[c]&&f[c].scrolling?"enabled":"disabled")+" for "+c),e.style.overflow=!1===(f[c]&&f[c].scrolling)?"hidden":"auto",f[c]&&f[c].scrolling){case"omit":break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=f[c]?f[c].scrolling:"no"}}(),function(){function n(n){1/0!==f[c][n]&&0!==f[c][n]&&(e.style[n]=f[c][n]+"px",v(c,"Set "+n+" = "+f[c][n]+"px"))}function t(e){if(f[c]["min"+e]>f[c]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}t("Height"),t("Width"),n("maxHeight"),n("minHeight"),n("maxWidth"),n("minWidth")}(),"number"!=typeof(f[c]&&f[c].bodyMargin)&&"0"!==(f[c]&&f[c].bodyMargin)||(f[c].bodyMarginV1=f[c].bodyMargin,f[c].bodyMargin=f[c].bodyMargin+"px"),a=j(c),(s=h())&&function(n){e.parentNode&&new n((function(n){n.forEach((function(n){Array.prototype.slice.call(n.removedNodes).forEach((function(n){n===e&&R(e)}))}))})).observe(e.parentNode,{childList:!0})}(s),w(e,"load",(function(){var t,i;W("iFrame.onload",a,e,n,!0),t=f[c]&&f[c].firstRun,i=f[c]&&f[c].heightCalculationMethod in l,!t&&i&&C({iframe:e,height:0,width:0,type:"init"})})),W("init",a,e,n,!0),f[c]&&(f[c].iframe.iFrameResizer={close:R.bind(null,f[c].iframe),removeListeners:M.bind(null,f[c].iframe),resize:W.bind(null,"Window resize","resize",f[c].iframe),moveToAnchor:function(e){W("Move to anchor","moveToAnchor:"+e,f[c].iframe,c)},sendMessage:function(e){W("Send Message","message:"+(e=JSON.stringify(e)),f[c].iframe,c)}}))}function N(e,n){null===m&&(m=setTimeout((function(){m=null,e()}),n))}function B(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visiblity change"),N((function(){L("Tab Visable","resize")}),16))}function L(e,n){Object.keys(f).forEach((function(t){(function(e){return f[e]&&"parent"===f[e].resizeFrom&&f[e].autoResize&&!f[e].firstRun})(t)&&W(e,n,f[t].iframe,t)}))}function A(){function e(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),H(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!u;e+=1)u=window[n[e]+"RequestAnimationFrame"];u?u=u.bind(window):v("setup","RequestAnimationFrame not supported")}(),w(window,"message",E),w(window,"resize",(function(){v("window","Trigger event: resize"),N((function(){L("Window resize","resize")}),16)})),w(document,"visibilitychange",B),w(document,"-webkit-visibilitychange",B),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),e.bind(n,i));break;case"object":e(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()},m(p={exports:{}}),p.exports),h=function(){},w=function(e){var n=e.title,t=e.forwardRef,i=f(e,["title","forwardRef"]),o=function(e){return e.autoResize,e.bodyBackground,e.bodyMargin,e.bodyPadding,e.checkOrigin,e.inPageLinks,e.heightCalculationMethod,e.interval,e.log,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.resizeFrom,e.scrolling,e.sizeHeight,e.sizeWidth,e.warningTimeout,e.tolerance,e.widthCalculationMethod,e.onClosed,e.onInit,e.onMessage,e.onMouseEnter,e.onMouseLeave,e.onResized,f(e,["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onMouseEnter","onMouseLeave","onResized"])}(i),r=(0,d.useRef)(null),a=function(){return h(!r.current,"[iframeSizerReact]["+(r&&r.current&&r.current.id)+"] Close event ignored, to remove the iframe update your React component"),!r.current};return(0,d.useEffect)((function(){var e=r.current;return g(l({},i,{onClose:a}),e),function(){return e.iFrameResizer&&e.iFrameResizer.removeListeners()}}),[]),(0,d.useImperativeHandle)(t,(function(){return{resize:function(){return r.current.iFrameResizer.resize()},moveToAnchor:function(e){return r.current.iFrameResizer.moveToAnchor(e)},sendMessage:function(e,n){r.current.iFrameResizer.sendMessage(e,n)}}})),u().createElement("iframe",l({title:n},o,{ref:r}))};w.defaultProps={title:"iframe"},w.propTypes={title:c().string};var b=w;(0,i.registerBlockType)("depicter/slider",{edit:function(e){let{attributes:n,setAttributes:t}=e;const i=(0,r.useBlockProps)();function s(e){window.fetch(window.depicterSliders.ajax_url+"?action=depicter/document/status&ID="+e,{method:"GET",headers:{"Content-Type":"text/html","X-DEPICTER-CSRF":window.depicterSliders.token}}).then((e=>e.json())).then((function(e){let n=document.getElementById("dep-publish-slider-btn");void 0===e.status||"publish"!=e.status?n.removeAttribute("disabled"):n.setAttribute("disabled",!0)})).catch((function(){}))}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(r.InspectorControls,{key:"setting"},(0,o.createElement)(a.Panel,{header:"Depicter"},(0,o.createElement)(a.PanelBody,{title:"Depicter Settings",initialOpen:!0},(0,o.createElement)(a.PanelRow,null,(0,o.createElement)(a.SelectControl,{id:"dep-slider-list",label:"Slider",value:n.id,options:depicterSliders.list,onChange:function(e){t({id:Number(e)}),s(e)}})),(0,o.createElement)(a.PanelRow,{className:"sliderBtns"},(0,o.createElement)(a.Button,{variant:"primary",id:"dep-publish-slider-btn",onClick:function(){let e=document.getElementById("dep-slider-list").value,n=document.getElementById("dep-publish-slider-btn");n.setAttribute("disabled",!0),n.classList.add("is-busy");var t=new FormData;t.append("ID",e),t.append("status","published"),window.fetch(window.depicterSliders.ajax_url+"?action=depicter/document/store",{method:"post",body:t,headers:{"X-DEPICTER-CSRF":window.depicterSliders.token}}).then((e=>e.json())).then((t=>{if(t.hits){s(e);var i=document.querySelector(".depicter-notice-wrapper");i&&i.remove(),n.classList.remove("is-busy")}})).catch((e=>{console.error(e)}))}},depicterSliders.publish_text),(0,o.createElement)(a.Button,{variant:"secondary",onClick:function(){let e=document.getElementById("dep-slider-list").value,n=window.depicterSliders.editor_url.replace("document=1","document="+e);window.open(n)}},depicterSliders.edit_text))))),(0,o.createElement)("div",i,(0,o.createElement)(b,{src:`${window.depicterSliders.ajax_url}?action=depicter/document/preview&depicter-csrf=${window.depicterSliders.token}&ID=${n.id}&status=draft|publish&gutenberg=true`,style:{width:"1px",minWidth:"100%"}})))}})},703:function(e,n,t){"use strict";var i=t(414);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,n,t,o,r,a){if(a!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function n(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,elementType:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:o};return t.PropTypes=t,t}},697:function(e,n,t){e.exports=t(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(e){var o=t[e];if(void 0!==o)return o.exports;var r=t[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,e=[],i.O=function(n,t,o,r){if(!t){var a=1/0;for(u=0;u<e.length;u++){t=e[u][0],o=e[u][1],r=e[u][2];for(var s=!0,c=0;c<t.length;c++)(!1&r||a>=r)&&Object.keys(i.O).every((function(e){return i.O[e](t[c])}))?t.splice(c--,1):(s=!1,r<a&&(a=r));if(s){e.splice(u--,1);var d=o();void 0!==d&&(n=d)}}return n}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[t,o,r]},i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,{a:n}),n},i.d=function(e,n){for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={826:0,431:0};i.O.j=function(n){return 0===e[n]};var n=function(n,t){var o,r,a=t[0],s=t[1],c=t[2],d=0;if(a.some((function(n){return 0!==e[n]}))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(c)var u=c(i)}for(n&&n(t);d<a.length;d++)r=a[d],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(u)},t=self.webpackChunkdepicter=self.webpackChunkdepicter||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var o=i.O(void 0,[431],(function(){return i(266)}));o=i.O(o)}(); | |