Changeset 3260510
- Timestamp:
- 03/24/2025 04:17:16 AM (13 months ago)
- Location:
- compress-pdf
- Files:
-
- 8 deleted
- 30 edited
- 1 copied
-
tags/1.0.1 (copied) (copied from compress-pdf/trunk)
-
tags/1.0.1/build/block.json (modified) (1 diff)
-
tags/1.0.1/build/index-rtl.css (modified) (1 diff)
-
tags/1.0.1/build/index.asset.php (modified) (1 diff)
-
tags/1.0.1/build/index.css (modified) (1 diff)
-
tags/1.0.1/build/index.css.map (deleted)
-
tags/1.0.1/build/index.js (modified) (1 diff)
-
tags/1.0.1/build/index.js.map (deleted)
-
tags/1.0.1/build/style-index-rtl.css (modified) (1 diff)
-
tags/1.0.1/build/style-index.css (modified) (1 diff)
-
tags/1.0.1/build/style-index.css.map (deleted)
-
tags/1.0.1/build/view.asset.php (modified) (1 diff)
-
tags/1.0.1/build/view.js (modified) (1 diff)
-
tags/1.0.1/build/view.js.map (deleted)
-
tags/1.0.1/compress-pdf.php (modified) (2 diffs)
-
tags/1.0.1/includes/process-machine.php (modified) (1 diff)
-
tags/1.0.1/languages/compress-pdf.pot (modified) (1 diff)
-
tags/1.0.1/readme.txt (modified) (2 diffs)
-
tags/1.0.1/src/block.json (modified) (1 diff)
-
tags/1.0.1/src/view.js (modified) (2 diffs)
-
trunk/build/block.json (modified) (1 diff)
-
trunk/build/index-rtl.css (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.css (modified) (1 diff)
-
trunk/build/index.css.map (deleted)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/build/index.js.map (deleted)
-
trunk/build/style-index-rtl.css (modified) (1 diff)
-
trunk/build/style-index.css (modified) (1 diff)
-
trunk/build/style-index.css.map (deleted)
-
trunk/build/view.asset.php (modified) (1 diff)
-
trunk/build/view.js (modified) (1 diff)
-
trunk/build/view.js.map (deleted)
-
trunk/compress-pdf.php (modified) (2 diffs)
-
trunk/includes/process-machine.php (modified) (1 diff)
-
trunk/languages/compress-pdf.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/block.json (modified) (1 diff)
-
trunk/src/view.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
compress-pdf/tags/1.0.1/build/block.json
r3222633 r3260510 3 3 "apiVersion": 3, 4 4 "name": "create-block/compress-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Compress Pdf", 7 7 "category": "widgets", -
compress-pdf/tags/1.0.1/build/index-rtl.css
r3222633 r3260510 1 /*!****************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! 3 \****************************************************************************************************************************************************************************************************************************************************/ 4 .solution__compress-pdf { 5 margin: 1rem; 6 } 1 .solution__compress-pdf{margin:1rem} -
compress-pdf/tags/1.0.1/build/index.asset.php
r3222633 r3260510 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => ' e403623a48b9b082a5cd');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'dcc95b81d99127b77099'); -
compress-pdf/tags/1.0.1/build/index.css
r3222633 r3260510 1 /*!****************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! 3 \****************************************************************************************************************************************************************************************************************************************************/ 4 .solution__compress-pdf { 5 margin: 1rem; 6 } 7 8 /*# sourceMappingURL=index.css.map*/ 1 .solution__compress-pdf{margin:1rem} -
compress-pdf/tags/1.0.1/build/index.js
r3222633 r3260510 1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/edit.js": 6 /*!*********************!*\ 7 !*** ./src/edit.js ***! 8 \*********************/ 9 /***/ ((__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 */ compressPDFIcon: () => (/* binding */ compressPDFIcon), 14 /* harmony export */ "default": () => (/* binding */ Edit) 15 /* harmony export */ }); 16 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); 17 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 18 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 19 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 21 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 22 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 23 /** 24 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 25 * Those files can contain any CSS code that gets applied to the editor. 26 * 27 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 28 */ 29 30 31 32 33 function Edit() { 34 const dpiRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); 35 const imageQualityRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); 36 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 37 const refs = [dpiRef, imageQualityRef]; 38 refs.forEach(ref => { 39 const input = ref.current; 40 if (input && !input.isInitialized) { 41 input.isInitialized = true; // Prevent multiple initializations 42 const min = input.getAttribute('min'); 43 const max = input.getAttribute('max'); 44 const value = input.value; 45 46 // Initialize ionRangeSlider on the input element 47 ionRangeSlider(input, { 48 min: min, 49 max: max, 50 from: value, 51 step: 1, 52 grid: true, 53 grid_num: 5, 54 disable: true 55 }); 56 } 57 }); 58 }, []); 59 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('div', null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 60 className: "solution__compress-pdf", 61 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 62 className: "solution__container__wrapper", 63 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 64 className: "solution__container", 65 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 66 className: "solution__header", 67 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Compress PDF', 'compress-pdf') 68 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 69 className: "solution__form", 70 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", { 71 htmlFor: "file", 72 className: "solution__label", 73 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 74 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('File:', 'compress-pdf') 75 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 76 type: "file", 77 id: "file", 78 name: "file", 79 className: "solution__file-input", 80 required: true, 81 disabled: true 82 })] 83 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", { 84 htmlFor: "dpi", 85 className: "solution__label", 86 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 87 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('DPI:', 'compress-pdf') 88 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 89 ref: dpiRef, 90 type: "number", 91 id: "dpi", 92 name: "dpi", 93 className: "solution__input solution__range-linked", 94 max: 300, 95 min: 72, 96 value: 144, 97 required: true, 98 disabled: true 99 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 100 className: "solution__hint", 101 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Dots per inch from 72 to 300. Smaller value reduces size of PDF File but also quality.', 'compress-pdf') 102 })] 103 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", { 104 htmlFor: "image-quality", 105 className: "solution__label", 106 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 107 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Image Quality:', 'compress-pdf') 108 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 109 ref: imageQualityRef, 110 type: "number", 111 id: "image-quality", 112 name: "image-quality", 113 className: "solution__input .solution__range-linked", 114 max: 100, 115 min: 0, 116 value: 75, 117 required: true, 118 disabled: true 119 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 120 className: "solution__hint", 121 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Values in % from 0 to 100. Smaller value reduces size of PDF File but also the quality.', 'compress-pdf') 122 })] 123 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", { 124 disabled: true, 125 className: "solution__btn", 126 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Submit', 'compress-pdf') 127 })] 128 })] 129 }) 130 }) 131 })); 132 } 133 const compressPDFIcon = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('svg', { 134 width: 32, 135 height: 33, 136 viewBox: "0 0 32 33", 137 fill: "none", 138 xmlns: "http://www.w3.org/2000/svg" 139 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('rect', { 140 y: "0.5", 141 width: "32.0014", 142 height: "32.0014", 143 rx: "16.0007", 144 fill: "#E5DBFF" 145 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('path', { 146 d: "M15.2597 24.2785V21.9081L14.0745 23.0933L13.0374 22.0563L16.0005 19.0932L18.9637 22.0563L17.9266 23.0933L16.7413 21.9451V24.2785H15.2597ZM10.0742 18.3525V16.871H21.9269V18.3525H10.0742ZM10.0742 16.1302V14.6487H21.9269V16.1302H10.0742ZM16.0005 13.9079L13.0374 10.9449L14.0745 9.90787L15.2597 11.0931V8.72266H16.7413V11.0931L17.9266 9.90787L18.9637 10.9449L16.0005 13.9079Z", 147 fill: "#5A3BB2" 148 })); 149 150 /***/ }), 151 152 /***/ "./src/index.js": 153 /*!**********************!*\ 154 !*** ./src/index.js ***! 155 \**********************/ 156 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 157 158 __webpack_require__.r(__webpack_exports__); 159 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); 160 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 161 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); 162 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); 163 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); 164 165 166 167 168 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__, { 169 icon: _edit__WEBPACK_IMPORTED_MODULE_2__.compressPDFIcon, 170 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"] 171 }); 172 173 /***/ }), 174 175 /***/ "./src/editor.scss": 176 /*!*************************!*\ 177 !*** ./src/editor.scss ***! 178 \*************************/ 179 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 180 181 __webpack_require__.r(__webpack_exports__); 182 // extracted by mini-css-extract-plugin 183 184 185 /***/ }), 186 187 /***/ "./src/style.scss": 188 /*!************************!*\ 189 !*** ./src/style.scss ***! 190 \************************/ 191 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 192 193 __webpack_require__.r(__webpack_exports__); 194 // extracted by mini-css-extract-plugin 195 196 197 /***/ }), 198 199 /***/ "react/jsx-runtime": 200 /*!**********************************!*\ 201 !*** external "ReactJSXRuntime" ***! 202 \**********************************/ 203 /***/ ((module) => { 204 205 module.exports = window["ReactJSXRuntime"]; 206 207 /***/ }), 208 209 /***/ "@wordpress/blocks": 210 /*!********************************!*\ 211 !*** external ["wp","blocks"] ***! 212 \********************************/ 213 /***/ ((module) => { 214 215 module.exports = window["wp"]["blocks"]; 216 217 /***/ }), 218 219 /***/ "@wordpress/element": 220 /*!*********************************!*\ 221 !*** external ["wp","element"] ***! 222 \*********************************/ 223 /***/ ((module) => { 224 225 module.exports = window["wp"]["element"]; 226 227 /***/ }), 228 229 /***/ "@wordpress/i18n": 230 /*!******************************!*\ 231 !*** external ["wp","i18n"] ***! 232 \******************************/ 233 /***/ ((module) => { 234 235 module.exports = window["wp"]["i18n"]; 236 237 /***/ }), 238 239 /***/ "./src/block.json": 240 /*!************************!*\ 241 !*** ./src/block.json ***! 242 \************************/ 243 /***/ ((module) => { 244 245 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/compress-pdf","version":"1.0.0","title":"Compress Pdf","category":"widgets","description":"Effortlessly reduce the size of your PDF files while maintaining quality, making them easier to store, share, and upload without sacrificing readability.","example":{},"supports":{"html":false},"textdomain":"compress-pdf","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}'); 246 247 /***/ }) 248 249 /******/ }); 250 /************************************************************************/ 251 /******/ // The module cache 252 /******/ var __webpack_module_cache__ = {}; 253 /******/ 254 /******/ // The require function 255 /******/ function __webpack_require__(moduleId) { 256 /******/ // Check if module is in cache 257 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 258 /******/ if (cachedModule !== undefined) { 259 /******/ return cachedModule.exports; 260 /******/ } 261 /******/ // Create a new module (and put it into the cache) 262 /******/ var module = __webpack_module_cache__[moduleId] = { 263 /******/ // no module.id needed 264 /******/ // no module.loaded needed 265 /******/ exports: {} 266 /******/ }; 267 /******/ 268 /******/ // Execute the module function 269 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 270 /******/ 271 /******/ // Return the exports of the module 272 /******/ return module.exports; 273 /******/ } 274 /******/ 275 /******/ // expose the modules object (__webpack_modules__) 276 /******/ __webpack_require__.m = __webpack_modules__; 277 /******/ 278 /************************************************************************/ 279 /******/ /* webpack/runtime/chunk loaded */ 280 /******/ (() => { 281 /******/ var deferred = []; 282 /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 283 /******/ if(chunkIds) { 284 /******/ priority = priority || 0; 285 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 286 /******/ deferred[i] = [chunkIds, fn, priority]; 287 /******/ return; 288 /******/ } 289 /******/ var notFulfilled = Infinity; 290 /******/ for (var i = 0; i < deferred.length; i++) { 291 /******/ var chunkIds = deferred[i][0]; 292 /******/ var fn = deferred[i][1]; 293 /******/ var priority = deferred[i][2]; 294 /******/ var fulfilled = true; 295 /******/ for (var j = 0; j < chunkIds.length; j++) { 296 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 297 /******/ chunkIds.splice(j--, 1); 298 /******/ } else { 299 /******/ fulfilled = false; 300 /******/ if(priority < notFulfilled) notFulfilled = priority; 301 /******/ } 302 /******/ } 303 /******/ if(fulfilled) { 304 /******/ deferred.splice(i--, 1) 305 /******/ var r = fn(); 306 /******/ if (r !== undefined) result = r; 307 /******/ } 308 /******/ } 309 /******/ return result; 310 /******/ }; 311 /******/ })(); 312 /******/ 313 /******/ /* webpack/runtime/compat get default export */ 314 /******/ (() => { 315 /******/ // getDefaultExport function for compatibility with non-harmony modules 316 /******/ __webpack_require__.n = (module) => { 317 /******/ var getter = module && module.__esModule ? 318 /******/ () => (module['default']) : 319 /******/ () => (module); 320 /******/ __webpack_require__.d(getter, { a: getter }); 321 /******/ return getter; 322 /******/ }; 323 /******/ })(); 324 /******/ 325 /******/ /* webpack/runtime/define property getters */ 326 /******/ (() => { 327 /******/ // define getter functions for harmony exports 328 /******/ __webpack_require__.d = (exports, definition) => { 329 /******/ for(var key in definition) { 330 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 331 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 332 /******/ } 333 /******/ } 334 /******/ }; 335 /******/ })(); 336 /******/ 337 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 338 /******/ (() => { 339 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 340 /******/ })(); 341 /******/ 342 /******/ /* webpack/runtime/make namespace object */ 343 /******/ (() => { 344 /******/ // define __esModule on exports 345 /******/ __webpack_require__.r = (exports) => { 346 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 347 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 348 /******/ } 349 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 350 /******/ }; 351 /******/ })(); 352 /******/ 353 /******/ /* webpack/runtime/jsonp chunk loading */ 354 /******/ (() => { 355 /******/ // no baseURI 356 /******/ 357 /******/ // object to store loaded and loading chunks 358 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 359 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 360 /******/ var installedChunks = { 361 /******/ "index": 0, 362 /******/ "./style-index": 0 363 /******/ }; 364 /******/ 365 /******/ // no chunk on demand loading 366 /******/ 367 /******/ // no prefetching 368 /******/ 369 /******/ // no preloaded 370 /******/ 371 /******/ // no HMR 372 /******/ 373 /******/ // no HMR manifest 374 /******/ 375 /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 376 /******/ 377 /******/ // install a JSONP callback for chunk loading 378 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 379 /******/ var chunkIds = data[0]; 380 /******/ var moreModules = data[1]; 381 /******/ var runtime = data[2]; 382 /******/ // add "moreModules" to the modules object, 383 /******/ // then flag all "chunkIds" as loaded and fire callback 384 /******/ var moduleId, chunkId, i = 0; 385 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 386 /******/ for(moduleId in moreModules) { 387 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 388 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 389 /******/ } 390 /******/ } 391 /******/ if(runtime) var result = runtime(__webpack_require__); 392 /******/ } 393 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 394 /******/ for(;i < chunkIds.length; i++) { 395 /******/ chunkId = chunkIds[i]; 396 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 397 /******/ installedChunks[chunkId][0](); 398 /******/ } 399 /******/ installedChunks[chunkId] = 0; 400 /******/ } 401 /******/ return __webpack_require__.O(result); 402 /******/ } 403 /******/ 404 /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; 405 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 406 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 407 /******/ })(); 408 /******/ 409 /************************************************************************/ 410 /******/ 411 /******/ // startup 412 /******/ // Load entry module and return exports 413 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 414 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js"))) 415 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 416 /******/ 417 /******/ })() 418 ; 419 //# sourceMappingURL=index.js.map 1 (()=>{"use strict";var e,i={354:()=>{const e=window.wp.blocks,i=window.wp.element,s=window.wp.i18n,l=window.ReactJSXRuntime,t=(0,i.createElement)("svg",{width:32,height:33,viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.createElement)("rect",{y:"0.5",width:"32.0014",height:"32.0014",rx:"16.0007",fill:"#E5DBFF"}),(0,i.createElement)("path",{d:"M15.2597 24.2785V21.9081L14.0745 23.0933L13.0374 22.0563L16.0005 19.0932L18.9637 22.0563L17.9266 23.0933L16.7413 21.9451V24.2785H15.2597ZM10.0742 18.3525V16.871H21.9269V18.3525H10.0742ZM10.0742 16.1302V14.6487H21.9269V16.1302H10.0742ZM16.0005 13.9079L13.0374 10.9449L14.0745 9.90787L15.2597 11.0931V8.72266H16.7413V11.0931L17.9266 9.90787L18.9637 10.9449L16.0005 13.9079Z",fill:"#5A3BB2"})),r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/compress-pdf","version":"1.0.1","title":"Compress Pdf","category":"widgets","description":"Effortlessly reduce the size of your PDF files while maintaining quality, making them easier to store, share, and upload without sacrificing readability.","example":{},"supports":{"html":false},"textdomain":"compress-pdf","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}');(0,e.registerBlockType)(r,{icon:t,edit:function(){const e=(0,i.useRef)(null),t=(0,i.useRef)(null);return(0,i.useEffect)((()=>{[e,t].forEach((e=>{const i=e.current;if(i&&!i.isInitialized){i.isInitialized=!0;const e=i.getAttribute("min"),s=i.getAttribute("max"),l=i.value;ionRangeSlider(i,{min:e,max:s,from:l,step:1,grid:!0,grid_num:5,disable:!0})}}))}),[]),(0,i.createElement)("div",null,(0,l.jsx)("div",{className:"solution__compress-pdf",children:(0,l.jsx)("div",{className:"solution__container__wrapper",children:(0,l.jsxs)("div",{className:"solution__container",children:[(0,l.jsx)("div",{className:"solution__header",children:(0,s.__)("Compress PDF","compress-pdf")}),(0,l.jsxs)("div",{className:"solution__form",children:[(0,l.jsxs)("label",{htmlFor:"file",className:"solution__label",children:[(0,l.jsx)("span",{children:(0,s.__)("File:","compress-pdf")}),(0,l.jsx)("input",{type:"file",id:"file",name:"file",className:"solution__file-input",required:!0,disabled:!0})]}),(0,l.jsxs)("label",{htmlFor:"dpi",className:"solution__label",children:[(0,l.jsx)("span",{children:(0,s.__)("DPI:","compress-pdf")}),(0,l.jsx)("input",{ref:e,type:"number",id:"dpi",name:"dpi",className:"solution__input solution__range-linked",max:300,min:72,value:144,required:!0,disabled:!0}),(0,l.jsx)("span",{className:"solution__hint",children:(0,s.__)("Dots per inch from 72 to 300. Smaller value reduces size of PDF File but also quality.","compress-pdf")})]}),(0,l.jsxs)("label",{htmlFor:"image-quality",className:"solution__label",children:[(0,l.jsx)("span",{children:(0,s.__)("Image Quality:","compress-pdf")}),(0,l.jsx)("input",{ref:t,type:"number",id:"image-quality",name:"image-quality",className:"solution__input .solution__range-linked",max:100,min:0,value:75,required:!0,disabled:!0}),(0,l.jsx)("span",{className:"solution__hint",children:(0,s.__)("Values in % from 0 to 100. Smaller value reduces size of PDF File but also the quality.","compress-pdf")})]}),(0,l.jsx)("button",{disabled:!0,className:"solution__btn",children:(0,s.__)("Submit","compress-pdf")})]})]})})}))}})}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return i[e](r,r.exports,l),r.exports}l.m=i,e=[],l.O=(i,s,t,r)=>{if(!s){var n=1/0;for(c=0;c<e.length;c++){s=e[c][0],t=e[c][1],r=e[c][2];for(var a=!0,o=0;o<s.length;o++)(!1&r||n>=r)&&Object.keys(l.O).every((e=>l.O[e](s[o])))?s.splice(o--,1):(a=!1,r<n&&(n=r));if(a){e.splice(c--,1);var d=t();void 0!==d&&(i=d)}}return i}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[s,t,r]},l.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={57:0,350:0};l.O.j=i=>0===e[i];var i=(i,s)=>{var t,r,n=s[0],a=s[1],o=s[2],d=0;if(n.some((i=>0!==e[i]))){for(t in a)l.o(a,t)&&(l.m[t]=a[t]);if(o)var c=o(l)}for(i&&i(s);d<n.length;d++)r=n[d],l.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return l.O(c)},s=self.webpackChunk=self.webpackChunk||[];s.forEach(i.bind(null,0)),s.push=i.bind(null,s.push.bind(s))})();var t=l.O(void 0,[350],(()=>l(354)));t=l.O(t)})(); -
compress-pdf/tags/1.0.1/build/style-index-rtl.css
r3222633 r3260510 1 /*!***************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************/ 4 :root { 5 --solution-compress-pdf-primary-color: #4f46e5; 6 --solution-compress-pdf-secondary-color: #eef2ff; 7 --solution-compress-pdf-tertiary-color: #000; 8 --solution-compress-pdf-background-color: #fff; 9 --solution-compress-pdf-border-color: #e5e7eb; 10 --solution-compress-pdf-input-border-color: #d1d5db; 11 --solution-compress-pdf-shadow-color: rgba(149, 157, 165, 0.2); 12 --solution-compress-pdf-btn-shadow-color: rgba(0, 0, 0, 0.05); 13 --solution-compress-pdf-dropdown-bg-color: #fff; 14 --solution-compress-pdf-dropdown-shadow-color-1: rgba(0, 0, 0, 0.1); 15 --solution-compress-pdf-dropdown-shadow-color-2: rgba(0, 0, 0, 0.1); 16 } 17 18 .solution__compress-pdf .solution__container-wrapper { 19 padding: 1rem; 20 display: flex; 21 flex-direction: column; 22 gap: 1rem; 23 color: var(--solution-compress-pdf-tertiary-color); 24 } 25 .solution__compress-pdf .solution__container { 26 box-shadow: var(--solution-compress-pdf-shadow-color) 0 8px 24px; 27 border: 1px solid var(--solution-compress-pdf-border-color); 28 background-color: var(--solution-compress-pdf-background-color); 29 border-radius: 0.75rem; 30 padding: 1.5rem 1.5rem 0.5rem; 31 position: relative; 32 display: flex; 33 flex-direction: column; 34 min-height: 380px; 35 gap: 1rem; 36 } 37 .solution__compress-pdf .solution__header { 38 font-size: 1.25rem; 39 letter-spacing: 0.05em; 40 font-weight: 500; 41 } 42 .solution__compress-pdf .solution__content { 43 flex-grow: 1; 44 display: grid; 45 } 46 .solution__compress-pdf .solution__form { 47 display: flex; 48 flex-direction: column; 49 gap: 1rem; 50 } 51 .solution__compress-pdf .solution__label { 52 white-space: nowrap; 53 width: 100%; 54 font-size: 0.75rem; 55 font-weight: 500; 56 display: flex; 57 flex-direction: column; 58 gap: 0.3rem; 59 } 60 .solution__compress-pdf .solution__hint { 61 font-size: 0.75rem; 62 font-weight: 500; 63 color: var(--solution-compress-pdf-primary-color); 64 white-space: wrap; 65 } 66 .solution__compress-pdf .solution__input { 67 border: 1px solid var(--solution-compress-pdf-input-border-color); 68 border-radius: 0.375rem; 69 padding: 0.25rem 0.5rem; 70 font-size: 1rem; 71 line-height: 32px; 72 outline: 1px solid transparent; 73 outline-offset: -1px; 74 } 75 .solution__compress-pdf .solution__file-input::-webkit-file-upload-button { 76 margin-left: 1rem; 77 padding: 0.5rem 1rem; 78 border-radius: 0.75rem; 79 border: none; 80 background-color: var(--solution-compress-pdf-secondary-color); 81 color: var(--solution-compress-pdf-primary-color); 82 font-weight: 500; 83 cursor: pointer; 84 } 85 .solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button { 86 background-color: var(--solution-compress-pdf-secondary-color); 87 } 88 .solution__compress-pdf .solution__btn { 89 display: inline-flex; 90 align-items: center; /* Ensures the icon and text are aligned */ 91 justify-content: center; 92 gap: 0.5rem; /* Adds space between the icon and the text */ 93 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color); 94 background: var(--solution-compress-pdf-secondary-color); 95 color: var(--solution-compress-pdf-primary-color); 96 padding: 0.5rem 1rem; 97 border-radius: 1rem; 98 font-weight: 600; 99 cursor: pointer; 100 border: none; 101 } 102 .solution__compress-pdf .solution__btn:hover { 103 filter: brightness(0.98); 104 } 105 .solution__compress-pdf .solution__btn .dashicons { 106 font-size: 1.2rem; /* Adjust the size of the icon */ 107 vertical-align: middle; /* Aligns the icon vertically with the text */ 108 } 109 .solution__compress-pdf .solution__dropdown-wrapper { 110 position: relative; 111 } 112 .solution__compress-pdf .solution__dropdown { 113 position: relative; 114 overflow: visible; 115 background-color: transparent; 116 box-shadow: none; 117 width: 100%; 118 border-radius: 0.75rem; 119 max-height: 15rem; 120 z-index: 10; 121 } 122 .solution__compress-pdf .solution__dropdown--hidden { 123 display: none; 124 } 125 .solution__compress-pdf .solution__loading-section { 126 display: none; 127 position: absolute; 128 top: 50%; 129 right: 50%; 130 transform: translate(50%, -50%); 131 } 132 .solution__compress-pdf .solution__loading-container { 133 display: flex; 134 justify-content: center; 135 align-items: center; 136 gap: 1rem; 137 transition: 2s ease; 138 } 139 .solution__compress-pdf .solution__download-section { 140 display: flex; 141 justify-content: center; 142 align-items: center; 143 flex-direction: column; 144 gap: 2rem; 145 height: 100%; 146 } 147 .solution__compress-pdf .solution__download-section:last-child { 148 margin-top: auto; 149 } 150 .solution__compress-pdf .solution__download-container { 151 display: flex; 152 flex-direction: column; 153 flex-grow: 1; 154 justify-content: center; 155 align-items: center; 156 gap: 1rem; 157 } 158 .solution__compress-pdf .solution__download-file-container { 159 display: flex; 160 flex-wrap: wrap; 161 justify-content: flex-start; 162 gap: 1rem; 163 } 164 .solution__compress-pdf .solution__download-file-name { 165 white-space: nowrap; 166 overflow: hidden; 167 text-overflow: ellipsis; 168 max-width: 12rem; 169 } 170 .solution__compress-pdf .solution__title-text { 171 font-weight: 600; 172 } 173 .solution__compress-pdf .solution__text { 174 font-weight: 500; 175 } 176 .solution__compress-pdf .solution__provided-text { 177 display: flex; 178 justify-content: center; 179 font-size: 0.7rem; 180 margin-top: 0.5rem; 181 } 182 .solution__compress-pdf .solution__error-section { 183 display: flex; 184 flex-direction: column; 185 justify-self: center; 186 align-self: center; 187 } 188 .solution__compress-pdf .solution__dot { 189 background: var(--solution-compress-pdf-tertiary-color); 190 height: 0.65em; 191 width: 0.65em; 192 border-radius: 50%; 193 animation: move 0.6s ease infinite; 194 } 195 .solution__compress-pdf .solution__link { 196 color: var(--solution-compress-pdf-tertiary-color); 197 } 198 .solution__compress-pdf .solution__select { 199 display: flex; 200 flex-direction: column; 201 position: relative; 202 gap: 0.3rem; 203 /* Placeholder color */ 204 /* Style for selected option */ 205 } 206 .solution__compress-pdf .solution__select .solution__select-input { 207 height: 42px; 208 padding: 0 0.5rem; 209 border-radius: 0.375rem; 210 border: 1px solid var(--solution-compress-pdf-input-border-color); 211 color: var(--solution-compress-pdf-tertiary-color); 212 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-shadow-color); 213 -webkit-appearance: none; 214 -moz-appearance: none; 215 appearance: none; 216 cursor: pointer; 217 /* Arrow styling */ 218 background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E"); 219 background-repeat: no-repeat; 220 background-position: left 1rem center; 221 background-size: 1rem; 222 } 223 .solution__compress-pdf .solution__select .solution__select-input:focus { 224 outline: 1px solid var(--solution-compress-pdf-primary-color); 225 box-shadow: 0 0 0 3px var(--solution-compress-pdf-secondary-color); 226 } 227 .solution__compress-pdf .solution__select .solution__select-input option { 228 padding: 1rem; 229 } 230 .solution__compress-pdf .solution__select .solution__select-input option[disabled] { 231 color: var(--solution-compress-pdf-input-border-color); 232 } 233 .solution__compress-pdf .solution__select .solution__select-input:required:invalid { 234 color: var(--solution-compress-pdf-input-border-color); 235 } 236 .solution__compress-pdf .solution__select .solution__select-input option:not([disabled]) { 237 color: var(--solution-compress-pdf-tertiary-color); 238 } 239 .solution__compress-pdf .solution_dropdown button { 240 width: 100%; 241 } 242 .solution__compress-pdf .solution__dropdown-content { 243 display: none; 244 position: absolute; 245 flex-direction: column; 246 min-width: 100%; 247 max-height: 150px; 248 padding: 0.5rem 0; 249 overflow: auto; 250 background-color: #fff; 251 box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); 252 z-index: 10; 253 margin-top: 3px; 254 border-radius: 10px; 255 top: 100%; 256 right: 50%; 257 transform: translate(50%, 0); 258 } 259 .solution__compress-pdf .solution__dropdown-content label { 260 display: block; 261 margin-top: 10px; 262 padding: 0 1rem; 263 } 264 .solution__compress-pdf .solution__dropdown-button { 265 min-width: 100%; 266 } 267 .solution__compress-pdf .solution__dropdown-content:hover, 268 .solution__compress-pdf .solution__dropdown-button:focus + .solution__dropdown-content { 269 display: flex; 270 } 271 .solution__compress-pdf .solution__group { 272 display: flex; 273 flex-wrap: wrap; 274 gap: 10px; 275 } 276 .solution__compress-pdf .solution__group > div, 277 .solution__compress-pdf .solution__group > label { 278 flex: 1; 279 } 280 .solution__compress-pdf .irs--flat .irs-handle > i:first-child { 281 background-color: var(--solution-compress-pdf-primary-color) !important; 282 } 283 .solution__compress-pdf .irs--flat .irs-bar { 284 background-color: var(--solution-compress-pdf-primary-color) !important; 285 } 286 .solution__compress-pdf .irs--flat .irs-from, .solution__compress-pdf .irs--flat .irs-to, .solution__compress-pdf .irs--flat .irs-single { 287 background-color: var(--solution-compress-pdf-primary-color) !important; 288 } 289 .solution__compress-pdf .irs--flat .irs-from:before, .solution__compress-pdf .irs--flat .irs-to:before, .solution__compress-pdf .irs--flat .irs-single:before { 290 border-top-color: var(--solution-compress-pdf-primary-color) !important; 291 } 292 293 @keyframes move { 294 0% { 295 transform: translateX(-50%); 296 } 297 50% { 298 transform: translateX(50%); 299 } 300 100% { 301 transform: translateX(-50%); 302 } 303 } 1 :root{--solution-compress-pdf-primary-color:#4f46e5;--solution-compress-pdf-secondary-color:#eef2ff;--solution-compress-pdf-tertiary-color:#000;--solution-compress-pdf-background-color:#fff;--solution-compress-pdf-border-color:#e5e7eb;--solution-compress-pdf-input-border-color:#d1d5db;--solution-compress-pdf-shadow-color:hsla(210,8%,62%,.2);--solution-compress-pdf-btn-shadow-color:rgba(0,0,0,.05);--solution-compress-pdf-dropdown-bg-color:#fff;--solution-compress-pdf-dropdown-shadow-color-1:rgba(0,0,0,.1);--solution-compress-pdf-dropdown-shadow-color-2:rgba(0,0,0,.1)}.solution__compress-pdf .solution__container-wrapper{color:var(--solution-compress-pdf-tertiary-color);display:flex;flex-direction:column;gap:1rem;padding:1rem}.solution__compress-pdf .solution__container{background-color:var(--solution-compress-pdf-background-color);border:1px solid var(--solution-compress-pdf-border-color);border-radius:.75rem;box-shadow:var(--solution-compress-pdf-shadow-color) 0 8px 24px;display:flex;flex-direction:column;gap:1rem;min-height:380px;padding:1.5rem 1.5rem .5rem;position:relative}.solution__compress-pdf .solution__header{font-size:1.25rem;font-weight:500;letter-spacing:.05em}.solution__compress-pdf .solution__content{display:grid;flex-grow:1}.solution__compress-pdf .solution__form{display:flex;flex-direction:column;gap:1rem}.solution__compress-pdf .solution__label{display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.3rem;white-space:nowrap;width:100%}.solution__compress-pdf .solution__hint{color:var(--solution-compress-pdf-primary-color);font-size:.75rem;font-weight:500;white-space:wrap}.solution__compress-pdf .solution__input{border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;font-size:1rem;line-height:32px;outline:1px solid transparent;outline-offset:-1px;padding:.25rem .5rem}.solution__compress-pdf .solution__file-input::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color);border:none;border-radius:.75rem;color:var(--solution-compress-pdf-primary-color);cursor:pointer;font-weight:500;margin-left:1rem;padding:.5rem 1rem}.solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color)}.solution__compress-pdf .solution__btn{align-items:center;background:var(--solution-compress-pdf-secondary-color);border:none;border-radius:1rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color);color:var(--solution-compress-pdf-primary-color);cursor:pointer;display:inline-flex;font-weight:600;gap:.5rem;justify-content:center;padding:.5rem 1rem}.solution__compress-pdf .solution__btn:hover{filter:brightness(.98)}.solution__compress-pdf .solution__btn .dashicons{font-size:1.2rem;vertical-align:middle}.solution__compress-pdf .solution__dropdown-wrapper{position:relative}.solution__compress-pdf .solution__dropdown{background-color:transparent;border-radius:.75rem;box-shadow:none;max-height:15rem;overflow:visible;position:relative;width:100%;z-index:10}.solution__compress-pdf .solution__dropdown--hidden{display:none}.solution__compress-pdf .solution__loading-section{display:none;right:50%;position:absolute;top:50%;transform:translate(50%,-50%)}.solution__compress-pdf .solution__loading-container{align-items:center;display:flex;gap:1rem;justify-content:center;transition:2s ease}.solution__compress-pdf .solution__download-section{align-items:center;display:flex;flex-direction:column;gap:2rem;height:100%;justify-content:center}.solution__compress-pdf .solution__download-section:last-child{margin-top:auto}.solution__compress-pdf .solution__download-container{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:1rem;justify-content:center}.solution__compress-pdf .solution__download-file-container{display:flex;flex-wrap:wrap;gap:1rem;justify-content:flex-start}.solution__compress-pdf .solution__download-file-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.solution__compress-pdf .solution__title-text{font-weight:600}.solution__compress-pdf .solution__text{font-weight:500}.solution__compress-pdf .solution__provided-text{display:flex;font-size:.7rem;justify-content:center;margin-top:.5rem}.solution__compress-pdf .solution__error-section{align-self:center;display:flex;flex-direction:column;justify-self:center}.solution__compress-pdf .solution__dot{animation:move .6s ease infinite;background:var(--solution-compress-pdf-tertiary-color);border-radius:50%;height:.65em;width:.65em}.solution__compress-pdf .solution__link{color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution__select{display:flex;flex-direction:column;gap:.3rem;position:relative}.solution__compress-pdf .solution__select .solution__select-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E");background-position:left 1rem center;background-repeat:no-repeat;background-size:1rem;border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-shadow-color);color:var(--solution-compress-pdf-tertiary-color);cursor:pointer;height:42px;padding:0 .5rem}.solution__compress-pdf .solution__select .solution__select-input:focus{box-shadow:0 0 0 3px var(--solution-compress-pdf-secondary-color);outline:1px solid var(--solution-compress-pdf-primary-color)}.solution__compress-pdf .solution__select .solution__select-input option{padding:1rem}.solution__compress-pdf .solution__select .solution__select-input option[disabled]{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input:required:invalid{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input option:not([disabled]){color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution_dropdown button{width:100%}.solution__compress-pdf .solution__dropdown-content{background-color:#fff;border-radius:10px;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;flex-direction:column;right:50%;margin-top:3px;max-height:150px;min-width:100%;overflow:auto;padding:.5rem 0;position:absolute;top:100%;transform:translate(50%);z-index:10}.solution__compress-pdf .solution__dropdown-content label{display:block;margin-top:10px;padding:0 1rem}.solution__compress-pdf .solution__dropdown-button{min-width:100%}.solution__compress-pdf .solution__dropdown-button:focus+.solution__dropdown-content,.solution__compress-pdf .solution__dropdown-content:hover{display:flex}.solution__compress-pdf .solution__group{display:flex;flex-wrap:wrap;gap:10px}.solution__compress-pdf .solution__group>div,.solution__compress-pdf .solution__group>label{flex:1}.solution__compress-pdf .irs--flat .irs-bar,.solution__compress-pdf .irs--flat .irs-from,.solution__compress-pdf .irs--flat .irs-handle>i:first-child,.solution__compress-pdf .irs--flat .irs-single,.solution__compress-pdf .irs--flat .irs-to{background-color:var(--solution-compress-pdf-primary-color)!important}.solution__compress-pdf .irs--flat .irs-from:before,.solution__compress-pdf .irs--flat .irs-single:before,.solution__compress-pdf .irs--flat .irs-to:before{border-top-color:var(--solution-compress-pdf-primary-color)!important}@keyframes move{0%{transform:translateX(-50%)}50%{transform:translateX(50%)}to{transform:translateX(-50%)}} -
compress-pdf/tags/1.0.1/build/style-index.css
r3222633 r3260510 1 /*!***************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************/ 4 :root { 5 --solution-compress-pdf-primary-color: #4f46e5; 6 --solution-compress-pdf-secondary-color: #eef2ff; 7 --solution-compress-pdf-tertiary-color: #000; 8 --solution-compress-pdf-background-color: #fff; 9 --solution-compress-pdf-border-color: #e5e7eb; 10 --solution-compress-pdf-input-border-color: #d1d5db; 11 --solution-compress-pdf-shadow-color: rgba(149, 157, 165, 0.2); 12 --solution-compress-pdf-btn-shadow-color: rgba(0, 0, 0, 0.05); 13 --solution-compress-pdf-dropdown-bg-color: #fff; 14 --solution-compress-pdf-dropdown-shadow-color-1: rgba(0, 0, 0, 0.1); 15 --solution-compress-pdf-dropdown-shadow-color-2: rgba(0, 0, 0, 0.1); 16 } 17 18 .solution__compress-pdf .solution__container-wrapper { 19 padding: 1rem; 20 display: flex; 21 flex-direction: column; 22 gap: 1rem; 23 color: var(--solution-compress-pdf-tertiary-color); 24 } 25 .solution__compress-pdf .solution__container { 26 box-shadow: var(--solution-compress-pdf-shadow-color) 0 8px 24px; 27 border: 1px solid var(--solution-compress-pdf-border-color); 28 background-color: var(--solution-compress-pdf-background-color); 29 border-radius: 0.75rem; 30 padding: 1.5rem 1.5rem 0.5rem; 31 position: relative; 32 display: flex; 33 flex-direction: column; 34 min-height: 380px; 35 gap: 1rem; 36 } 37 .solution__compress-pdf .solution__header { 38 font-size: 1.25rem; 39 letter-spacing: 0.05em; 40 font-weight: 500; 41 } 42 .solution__compress-pdf .solution__content { 43 flex-grow: 1; 44 display: grid; 45 } 46 .solution__compress-pdf .solution__form { 47 display: flex; 48 flex-direction: column; 49 gap: 1rem; 50 } 51 .solution__compress-pdf .solution__label { 52 white-space: nowrap; 53 width: 100%; 54 font-size: 0.75rem; 55 font-weight: 500; 56 display: flex; 57 flex-direction: column; 58 gap: 0.3rem; 59 } 60 .solution__compress-pdf .solution__hint { 61 font-size: 0.75rem; 62 font-weight: 500; 63 color: var(--solution-compress-pdf-primary-color); 64 white-space: wrap; 65 } 66 .solution__compress-pdf .solution__input { 67 border: 1px solid var(--solution-compress-pdf-input-border-color); 68 border-radius: 0.375rem; 69 padding: 0.25rem 0.5rem; 70 font-size: 1rem; 71 line-height: 32px; 72 outline: 1px solid transparent; 73 outline-offset: -1px; 74 } 75 .solution__compress-pdf .solution__file-input::-webkit-file-upload-button { 76 margin-right: 1rem; 77 padding: 0.5rem 1rem; 78 border-radius: 0.75rem; 79 border: none; 80 background-color: var(--solution-compress-pdf-secondary-color); 81 color: var(--solution-compress-pdf-primary-color); 82 font-weight: 500; 83 cursor: pointer; 84 } 85 .solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button { 86 background-color: var(--solution-compress-pdf-secondary-color); 87 } 88 .solution__compress-pdf .solution__btn { 89 display: inline-flex; 90 align-items: center; /* Ensures the icon and text are aligned */ 91 justify-content: center; 92 gap: 0.5rem; /* Adds space between the icon and the text */ 93 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color); 94 background: var(--solution-compress-pdf-secondary-color); 95 color: var(--solution-compress-pdf-primary-color); 96 padding: 0.5rem 1rem; 97 border-radius: 1rem; 98 font-weight: 600; 99 cursor: pointer; 100 border: none; 101 } 102 .solution__compress-pdf .solution__btn:hover { 103 filter: brightness(0.98); 104 } 105 .solution__compress-pdf .solution__btn .dashicons { 106 font-size: 1.2rem; /* Adjust the size of the icon */ 107 vertical-align: middle; /* Aligns the icon vertically with the text */ 108 } 109 .solution__compress-pdf .solution__dropdown-wrapper { 110 position: relative; 111 } 112 .solution__compress-pdf .solution__dropdown { 113 position: relative; 114 overflow: visible; 115 background-color: transparent; 116 box-shadow: none; 117 width: 100%; 118 border-radius: 0.75rem; 119 max-height: 15rem; 120 z-index: 10; 121 } 122 .solution__compress-pdf .solution__dropdown--hidden { 123 display: none; 124 } 125 .solution__compress-pdf .solution__loading-section { 126 display: none; 127 position: absolute; 128 top: 50%; 129 left: 50%; 130 transform: translate(-50%, -50%); 131 } 132 .solution__compress-pdf .solution__loading-container { 133 display: flex; 134 justify-content: center; 135 align-items: center; 136 gap: 1rem; 137 transition: 2s ease; 138 } 139 .solution__compress-pdf .solution__download-section { 140 display: flex; 141 justify-content: center; 142 align-items: center; 143 flex-direction: column; 144 gap: 2rem; 145 height: 100%; 146 } 147 .solution__compress-pdf .solution__download-section:last-child { 148 margin-top: auto; 149 } 150 .solution__compress-pdf .solution__download-container { 151 display: flex; 152 flex-direction: column; 153 flex-grow: 1; 154 justify-content: center; 155 align-items: center; 156 gap: 1rem; 157 } 158 .solution__compress-pdf .solution__download-file-container { 159 display: flex; 160 flex-wrap: wrap; 161 justify-content: flex-start; 162 gap: 1rem; 163 } 164 .solution__compress-pdf .solution__download-file-name { 165 white-space: nowrap; 166 overflow: hidden; 167 text-overflow: ellipsis; 168 max-width: 12rem; 169 } 170 .solution__compress-pdf .solution__title-text { 171 font-weight: 600; 172 } 173 .solution__compress-pdf .solution__text { 174 font-weight: 500; 175 } 176 .solution__compress-pdf .solution__provided-text { 177 display: flex; 178 justify-content: center; 179 font-size: 0.7rem; 180 margin-top: 0.5rem; 181 } 182 .solution__compress-pdf .solution__error-section { 183 display: flex; 184 flex-direction: column; 185 justify-self: center; 186 align-self: center; 187 } 188 .solution__compress-pdf .solution__dot { 189 background: var(--solution-compress-pdf-tertiary-color); 190 height: 0.65em; 191 width: 0.65em; 192 border-radius: 50%; 193 animation: move 0.6s ease infinite; 194 } 195 .solution__compress-pdf .solution__link { 196 color: var(--solution-compress-pdf-tertiary-color); 197 } 198 .solution__compress-pdf .solution__select { 199 display: flex; 200 flex-direction: column; 201 position: relative; 202 gap: 0.3rem; 203 /* Placeholder color */ 204 /* Style for selected option */ 205 } 206 .solution__compress-pdf .solution__select .solution__select-input { 207 height: 42px; 208 padding: 0 0.5rem; 209 border-radius: 0.375rem; 210 border: 1px solid var(--solution-compress-pdf-input-border-color); 211 color: var(--solution-compress-pdf-tertiary-color); 212 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-shadow-color); 213 -webkit-appearance: none; 214 -moz-appearance: none; 215 appearance: none; 216 cursor: pointer; 217 /* Arrow styling */ 218 background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E"); 219 background-repeat: no-repeat; 220 background-position: right 1rem center; 221 background-size: 1rem; 222 } 223 .solution__compress-pdf .solution__select .solution__select-input:focus { 224 outline: 1px solid var(--solution-compress-pdf-primary-color); 225 box-shadow: 0 0 0 3px var(--solution-compress-pdf-secondary-color); 226 } 227 .solution__compress-pdf .solution__select .solution__select-input option { 228 padding: 1rem; 229 } 230 .solution__compress-pdf .solution__select .solution__select-input option[disabled] { 231 color: var(--solution-compress-pdf-input-border-color); 232 } 233 .solution__compress-pdf .solution__select .solution__select-input:required:invalid { 234 color: var(--solution-compress-pdf-input-border-color); 235 } 236 .solution__compress-pdf .solution__select .solution__select-input option:not([disabled]) { 237 color: var(--solution-compress-pdf-tertiary-color); 238 } 239 .solution__compress-pdf .solution_dropdown button { 240 width: 100%; 241 } 242 .solution__compress-pdf .solution__dropdown-content { 243 display: none; 244 position: absolute; 245 flex-direction: column; 246 min-width: 100%; 247 max-height: 150px; 248 padding: 0.5rem 0; 249 overflow: auto; 250 background-color: #fff; 251 box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); 252 z-index: 10; 253 margin-top: 3px; 254 border-radius: 10px; 255 top: 100%; 256 left: 50%; 257 transform: translate(-50%, 0); 258 } 259 .solution__compress-pdf .solution__dropdown-content label { 260 display: block; 261 margin-top: 10px; 262 padding: 0 1rem; 263 } 264 .solution__compress-pdf .solution__dropdown-button { 265 min-width: 100%; 266 } 267 .solution__compress-pdf .solution__dropdown-content:hover, 268 .solution__compress-pdf .solution__dropdown-button:focus + .solution__dropdown-content { 269 display: flex; 270 } 271 .solution__compress-pdf .solution__group { 272 display: flex; 273 flex-wrap: wrap; 274 gap: 10px; 275 } 276 .solution__compress-pdf .solution__group > div, 277 .solution__compress-pdf .solution__group > label { 278 flex: 1; 279 } 280 .solution__compress-pdf .irs--flat .irs-handle > i:first-child { 281 background-color: var(--solution-compress-pdf-primary-color) !important; 282 } 283 .solution__compress-pdf .irs--flat .irs-bar { 284 background-color: var(--solution-compress-pdf-primary-color) !important; 285 } 286 .solution__compress-pdf .irs--flat .irs-from, .solution__compress-pdf .irs--flat .irs-to, .solution__compress-pdf .irs--flat .irs-single { 287 background-color: var(--solution-compress-pdf-primary-color) !important; 288 } 289 .solution__compress-pdf .irs--flat .irs-from:before, .solution__compress-pdf .irs--flat .irs-to:before, .solution__compress-pdf .irs--flat .irs-single:before { 290 border-top-color: var(--solution-compress-pdf-primary-color) !important; 291 } 292 293 @keyframes move { 294 0% { 295 transform: translateX(50%); 296 } 297 50% { 298 transform: translateX(-50%); 299 } 300 100% { 301 transform: translateX(50%); 302 } 303 } 304 305 /*# sourceMappingURL=style-index.css.map*/ 1 :root{--solution-compress-pdf-primary-color:#4f46e5;--solution-compress-pdf-secondary-color:#eef2ff;--solution-compress-pdf-tertiary-color:#000;--solution-compress-pdf-background-color:#fff;--solution-compress-pdf-border-color:#e5e7eb;--solution-compress-pdf-input-border-color:#d1d5db;--solution-compress-pdf-shadow-color:hsla(210,8%,62%,.2);--solution-compress-pdf-btn-shadow-color:rgba(0,0,0,.05);--solution-compress-pdf-dropdown-bg-color:#fff;--solution-compress-pdf-dropdown-shadow-color-1:rgba(0,0,0,.1);--solution-compress-pdf-dropdown-shadow-color-2:rgba(0,0,0,.1)}.solution__compress-pdf .solution__container-wrapper{color:var(--solution-compress-pdf-tertiary-color);display:flex;flex-direction:column;gap:1rem;padding:1rem}.solution__compress-pdf .solution__container{background-color:var(--solution-compress-pdf-background-color);border:1px solid var(--solution-compress-pdf-border-color);border-radius:.75rem;box-shadow:var(--solution-compress-pdf-shadow-color) 0 8px 24px;display:flex;flex-direction:column;gap:1rem;min-height:380px;padding:1.5rem 1.5rem .5rem;position:relative}.solution__compress-pdf .solution__header{font-size:1.25rem;font-weight:500;letter-spacing:.05em}.solution__compress-pdf .solution__content{display:grid;flex-grow:1}.solution__compress-pdf .solution__form{display:flex;flex-direction:column;gap:1rem}.solution__compress-pdf .solution__label{display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.3rem;white-space:nowrap;width:100%}.solution__compress-pdf .solution__hint{color:var(--solution-compress-pdf-primary-color);font-size:.75rem;font-weight:500;white-space:wrap}.solution__compress-pdf .solution__input{border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;font-size:1rem;line-height:32px;outline:1px solid transparent;outline-offset:-1px;padding:.25rem .5rem}.solution__compress-pdf .solution__file-input::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color);border:none;border-radius:.75rem;color:var(--solution-compress-pdf-primary-color);cursor:pointer;font-weight:500;margin-right:1rem;padding:.5rem 1rem}.solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color)}.solution__compress-pdf .solution__btn{align-items:center;background:var(--solution-compress-pdf-secondary-color);border:none;border-radius:1rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color);color:var(--solution-compress-pdf-primary-color);cursor:pointer;display:inline-flex;font-weight:600;gap:.5rem;justify-content:center;padding:.5rem 1rem}.solution__compress-pdf .solution__btn:hover{filter:brightness(.98)}.solution__compress-pdf .solution__btn .dashicons{font-size:1.2rem;vertical-align:middle}.solution__compress-pdf .solution__dropdown-wrapper{position:relative}.solution__compress-pdf .solution__dropdown{background-color:transparent;border-radius:.75rem;box-shadow:none;max-height:15rem;overflow:visible;position:relative;width:100%;z-index:10}.solution__compress-pdf .solution__dropdown--hidden{display:none}.solution__compress-pdf .solution__loading-section{display:none;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.solution__compress-pdf .solution__loading-container{align-items:center;display:flex;gap:1rem;justify-content:center;transition:2s ease}.solution__compress-pdf .solution__download-section{align-items:center;display:flex;flex-direction:column;gap:2rem;height:100%;justify-content:center}.solution__compress-pdf .solution__download-section:last-child{margin-top:auto}.solution__compress-pdf .solution__download-container{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:1rem;justify-content:center}.solution__compress-pdf .solution__download-file-container{display:flex;flex-wrap:wrap;gap:1rem;justify-content:flex-start}.solution__compress-pdf .solution__download-file-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.solution__compress-pdf .solution__title-text{font-weight:600}.solution__compress-pdf .solution__text{font-weight:500}.solution__compress-pdf .solution__provided-text{display:flex;font-size:.7rem;justify-content:center;margin-top:.5rem}.solution__compress-pdf .solution__error-section{align-self:center;display:flex;flex-direction:column;justify-self:center}.solution__compress-pdf .solution__dot{animation:move .6s ease infinite;background:var(--solution-compress-pdf-tertiary-color);border-radius:50%;height:.65em;width:.65em}.solution__compress-pdf .solution__link{color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution__select{display:flex;flex-direction:column;gap:.3rem;position:relative}.solution__compress-pdf .solution__select .solution__select-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E");background-position:right 1rem center;background-repeat:no-repeat;background-size:1rem;border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-shadow-color);color:var(--solution-compress-pdf-tertiary-color);cursor:pointer;height:42px;padding:0 .5rem}.solution__compress-pdf .solution__select .solution__select-input:focus{box-shadow:0 0 0 3px var(--solution-compress-pdf-secondary-color);outline:1px solid var(--solution-compress-pdf-primary-color)}.solution__compress-pdf .solution__select .solution__select-input option{padding:1rem}.solution__compress-pdf .solution__select .solution__select-input option[disabled]{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input:required:invalid{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input option:not([disabled]){color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution_dropdown button{width:100%}.solution__compress-pdf .solution__dropdown-content{background-color:#fff;border-radius:10px;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;flex-direction:column;left:50%;margin-top:3px;max-height:150px;min-width:100%;overflow:auto;padding:.5rem 0;position:absolute;top:100%;transform:translate(-50%);z-index:10}.solution__compress-pdf .solution__dropdown-content label{display:block;margin-top:10px;padding:0 1rem}.solution__compress-pdf .solution__dropdown-button{min-width:100%}.solution__compress-pdf .solution__dropdown-button:focus+.solution__dropdown-content,.solution__compress-pdf .solution__dropdown-content:hover{display:flex}.solution__compress-pdf .solution__group{display:flex;flex-wrap:wrap;gap:10px}.solution__compress-pdf .solution__group>div,.solution__compress-pdf .solution__group>label{flex:1}.solution__compress-pdf .irs--flat .irs-bar,.solution__compress-pdf .irs--flat .irs-from,.solution__compress-pdf .irs--flat .irs-handle>i:first-child,.solution__compress-pdf .irs--flat .irs-single,.solution__compress-pdf .irs--flat .irs-to{background-color:var(--solution-compress-pdf-primary-color)!important}.solution__compress-pdf .irs--flat .irs-from:before,.solution__compress-pdf .irs--flat .irs-single:before,.solution__compress-pdf .irs--flat .irs-to:before{border-top-color:var(--solution-compress-pdf-primary-color)!important}@keyframes move{0%{transform:translateX(50%)}50%{transform:translateX(-50%)}to{transform:translateX(50%)}} -
compress-pdf/tags/1.0.1/build/view.asset.php
r3222633 r3260510 1 <?php return array('dependencies' => array(), 'version' => '5 7c8bb3aa93ff728e717');1 <?php return array('dependencies' => array(), 'version' => '51de7ef2e55ac9559d9a'); -
compress-pdf/tags/1.0.1/build/view.js
r3222633 r3260510 1 /******/ (() => { // webpackBootstrap 2 /*!*********************!*\ 3 !*** ./src/view.js ***! 4 \*********************/ 5 document.querySelectorAll('.solution__compress-pdf .solution__form').forEach(form => { 6 form.addEventListener('submit', function (event) { 7 event.preventDefault(); 8 const formId = form.getAttribute('id'); 9 const fileInput = form.querySelector('[name="file"]'); 10 const dpiInput = form.querySelector('[name="dpi"]'); 11 const imageQualityInput = form.querySelector('[name="image-quality"]'); 12 const loadingSection = document.getElementById(`loadingSection_${formId}`); 13 const errorSection = document.getElementById(`errorSection_${formId}`); 14 const resultMessage = document.getElementById(`resultMessage_${formId}`); 15 const downloadSection = document.getElementById(`downloadSection_${formId}`); 16 17 // Hide the form, show the loading indicator, hide error and download sections 18 form.style.display = 'none'; 19 loadingSection.style.display = 'flex'; 20 errorSection.style.display = 'none'; // Hide error section 21 downloadSection.style.display = 'none'; 22 const formData = new FormData(); 23 Array.from(fileInput.files).forEach((file, index) => { 24 formData.append(`file[${index}]`, file); 25 }); 26 formData.append('dpi', dpiInput.value); 27 formData.append('imageQuality', imageQualityInput.value); 28 formData.append('compressPDFFormNonce', wpApiSettings.compressPDFNonce); 29 fetch(`${wpApiSettings.root}compress-pdf/v1/send-data`, { 30 method: 'POST', 31 body: formData 32 }).then(response => response.json()).then(data => { 33 if (data.id) { 34 pollStatus(data.id, formId); 35 } else { 36 loadingSection.style.display = 'none'; 37 errorSection.style.display = 'flex'; 38 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 39 } 40 }).catch(() => { 41 loadingSection.style.display = 'none'; 42 errorSection.style.display = 'flex'; 43 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 44 }); 45 }); 46 47 // Add event listener for restart buttons 48 const restartDownloadBtn = document.getElementById(`restartDownloadBtn_${form.id}`); 49 const restartErrorBtn = document.getElementById(`restartErrorBtn_${form.id}`); 50 51 // Function to restart the process and reset the form 52 function resetForm() { 53 form.reset(); 54 form.style.display = 'flex'; 55 document.getElementById(`loadingSection_${form.id}`).style.display = 'none'; // Hide loading 56 document.getElementById(`downloadSection_${form.id}`).style.display = 'none'; // Hide download 57 document.getElementById(`errorSection_${form.id}`).style.display = 'none'; // Hide error section 58 } 59 if (restartDownloadBtn) { 60 restartDownloadBtn.addEventListener('click', resetForm); 61 } 62 if (restartErrorBtn) { 63 restartErrorBtn.addEventListener('click', resetForm); 64 } 65 }); 66 document.querySelectorAll('.solution__compress-pdf .solution__range-linked').forEach(input => { 67 const min = input.getAttribute('min'); 68 const max = input.getAttribute('max'); 69 const value = input.value; 70 ionRangeSlider(input, { 71 min: min, 72 max: max, 73 from: value, 74 step: 1, 75 grid: true, 76 grid_num: 5 77 }); 78 }); 79 function pollStatus(id, formId) { 80 const loadingSection = document.getElementById(`loadingSection_${formId}`); 81 const errorSection = document.getElementById(`errorSection_${formId}`); 82 const resultMessage = document.getElementById(`resultMessage_${formId}`); 83 const downloadSection = document.getElementById(`downloadSection_${formId}`); 84 const downloadFilesContainer = document.getElementById(`downloadFilesContainer_${formId}`); 85 function checkStatus() { 86 fetch(`${wpApiSettings.root}compress-pdf/v1/status/${id}`).then(response => response.json()).then(data => { 87 if (data.status === 'done') { 88 loadingSection.style.display = 'none'; 89 downloadFilesContainer.innerHTML = ''; // Clear previous downloads 90 91 if (data.output && data.output.files && data.output.files.length > 0) { 92 data.output.files.forEach(file => { 93 // Create download button 94 const downloadButton = document.createElement('button'); 95 downloadButton.type = 'button'; 96 downloadButton.className = 'solution__btn'; 97 downloadButton.innerHTML = ` 98 <div class="dashicons dashicons-download"></div> 99 <span class="solution__download-file-name">${file.name}</span> 100 `; 101 102 // Set download functionality 103 downloadButton.addEventListener('click', event => { 104 event.preventDefault(); 105 const anchor = document.createElement('a'); 106 anchor.href = file.path; 107 anchor.target = '_blank'; 108 document.body.appendChild(anchor); 109 anchor.click(); 110 document.body.removeChild(anchor); 111 }); 112 113 // Append elements to the container 114 const fileContainer = document.createElement('div'); 115 fileContainer.className = 'solution__download-file-container'; 116 fileContainer.appendChild(downloadButton); 117 downloadFilesContainer.appendChild(fileContainer); 118 }); 119 downloadSection.style.display = 'flex'; // Show download section 120 } else { 121 errorSection.style.display = 'flex'; 122 resultMessage.innerText = 'No files available for download.'; 123 } 124 } else if (data.status === 'error') { 125 throw new Error('Processing failed: ' + data.message); 126 } else { 127 setTimeout(checkStatus, 500); 128 } 129 }).catch(() => { 130 loadingSection.style.display = 'none'; 131 errorSection.style.display = 'flex'; 132 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 133 }); 134 } 135 checkStatus(); 136 } 137 /******/ })() 138 ; 139 //# sourceMappingURL=view.js.map 1 document.querySelectorAll(".solution__compress-pdf .solution__form").forEach((e=>{e.addEventListener("submit",(function(t){t.preventDefault();const n=e.getAttribute("id"),o=e.querySelector('[name="file"]'),d=e.querySelector('[name="dpi"]'),s=e.querySelector('[name="image-quality"]'),l=document.getElementById(`loadingSection_${n}`),i=document.getElementById(`errorSection_${n}`),a=document.getElementById(`resultMessage_${n}`),r=document.getElementById(`downloadSection_${n}`);e.style.display="none",l.style.display="flex",i.style.display="none",r.style.display="none";const c=new FormData;Array.from(o.files).forEach(((e,t)=>{c.append(`file[${t}]`,e)})),c.append("dpi",d.value),c.append("imageQuality",s.value),c.append("compressPDFFormNonce",wpApiSettingsCompressPDF.compressPDFNonce),fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/send-data`,{method:"POST",body:c}).then((e=>e.json())).then((e=>{e.id?function(e,t){const n=document.getElementById(`loadingSection_${t}`),o=document.getElementById(`errorSection_${t}`),d=document.getElementById(`resultMessage_${t}`),s=document.getElementById(`downloadSection_${t}`),l=document.getElementById(`downloadFilesContainer_${t}`);!function t(){fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/status/${e}`,{method:"GET",headers:{"X-WP-Nonce":wpApiSettingsCompressPDF.compressPDFNonce,"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{if("done"===e.status)n.style.display="none",l.innerHTML="",e.output&&e.output.files&&e.output.files.length>0?(e.output.files.forEach((e=>{const t=document.createElement("button");t.type="button",t.className="solution__btn",t.innerHTML=`\n <div class="dashicons dashicons-download"></div>\n <span class="solution__download-file-name">${e.name}</span>\n `,t.addEventListener("click",(t=>{t.preventDefault();const n=document.createElement("a");n.href=e.path,n.target="_blank",document.body.appendChild(n),n.click(),document.body.removeChild(n)}));const n=document.createElement("div");n.className="solution__download-file-container",n.appendChild(t),l.appendChild(n)})),s.style.display="flex"):(o.style.display="flex",d.innerText="No files available for download.");else{if("error"===e.status)throw new Error("Processing failed: "+e.message);setTimeout(t,500)}})).catch((()=>{n.style.display="none",o.style.display="flex",d.innerText="An unexpected error occurred. Please try again."}))}()}(e.id,n):(l.style.display="none",i.style.display="flex",a.innerText="An unexpected error occurred. Please try again.")})).catch((()=>{l.style.display="none",i.style.display="flex",a.innerText="An unexpected error occurred. Please try again."}))}));const t=document.getElementById(`restartDownloadBtn_${e.id}`),n=document.getElementById(`restartErrorBtn_${e.id}`);function o(){e.reset(),e.style.display="flex",document.getElementById(`loadingSection_${e.id}`).style.display="none",document.getElementById(`downloadSection_${e.id}`).style.display="none",document.getElementById(`errorSection_${e.id}`).style.display="none"}t&&t.addEventListener("click",o),n&&n.addEventListener("click",o)})),document.querySelectorAll(".solution__compress-pdf .solution__range-linked").forEach((e=>{const t=e.getAttribute("min"),n=e.getAttribute("max"),o=e.value;ionRangeSlider(e,{min:t,max:n,from:o,step:1,grid:!0,grid_num:5})})); -
compress-pdf/tags/1.0.1/compress-pdf.php
r3232406 r3260510 5 5 * Requires at least: 6.6 6 6 * Requires PHP: 7.2 7 * Version: 1.0. 07 * Version: 1.0.1 8 8 * Author: Cross Service Solutions 9 9 * License: GPL-2.0-or-later … … 104 104 function cross_service_solutions_compress_pdf_localize_script() { 105 105 // Localize the script registered by the viewScript in block.json 106 wp_localize_script('create-block-compress-pdf-view-script', 'wpApiSettings ', array(106 wp_localize_script('create-block-compress-pdf-view-script', 'wpApiSettingsCompressPDF', array( 107 107 'root' => esc_url_raw(rest_url()), 108 108 'compressPDFNonce' => wp_create_nonce('compress_pdf_form_nonce_action'), -
compress-pdf/tags/1.0.1/includes/process-machine.php
r3222633 r3260510 126 126 // Check status of processing task 127 127 function cross_service_solutions_compress_pdf_check_status($request) { 128 $nonce = $request->get_header('X-WP-Nonce'); 129 if (!$nonce || !wp_verify_nonce($nonce, 'compress_pdf_form_nonce_action')) { 130 return new WP_Error('nonce_invalid', 'Nonce verification failed', array( 131 'status' => 403, 132 'message' => 'The provided nonce is invalid or expired. Please refresh and try again.' 133 )); 134 } 135 128 136 $api_key = esc_attr(get_option('cross_service_solutions_api_key')); 129 137 $id = sanitize_text_field($request['id']); -
compress-pdf/tags/1.0.1/languages/compress-pdf.pot
r3250027 r3260510 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Compress PDF 1.0. 0\n"5 "Project-Id-Version: Compress PDF 1.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/compress-pdf\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
compress-pdf/tags/1.0.1/readme.txt
r3250027 r3260510 5 5 Requires at least: 5.0 6 6 Tested up to: 6.7 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 Requires PHP: 7.2 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 1.0.1 = 96 * Implemented nonce validation for polling status GET request. 97 * Ensuring the global object in JavaScript is unique. 98 95 99 = 1.0.0 = 96 100 * Initial release of the Compress PDF plugin. -
compress-pdf/tags/1.0.1/src/block.json
r3222633 r3260510 3 3 "apiVersion": 3, 4 4 "name": "create-block/compress-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Compress Pdf", 7 7 "category": "widgets", -
compress-pdf/tags/1.0.1/src/view.js
r3222633 r3260510 33 33 formData.append('dpi', dpiInput.value); 34 34 formData.append('imageQuality', imageQualityInput.value); 35 formData.append('compressPDFFormNonce', wpApiSettings .compressPDFNonce);35 formData.append('compressPDFFormNonce', wpApiSettingsCompressPDF.compressPDFNonce); 36 36 37 fetch(`${wpApiSettings .root}compress-pdf/v1/send-data`, {37 fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/send-data`, { 38 38 method: 'POST', 39 39 body: formData, … … 111 111 112 112 function checkStatus() { 113 fetch(`${wpApiSettings.root}compress-pdf/v1/status/${id}`) 113 fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/status/${id}`, { 114 method: 'GET', 115 headers: { 116 'X-WP-Nonce': wpApiSettingsCompressPDF.compressPDFNonce, 117 'Content-Type': 'application/json' 118 } 119 }) 114 120 .then((response) => response.json()) 115 121 .then((data) => { -
compress-pdf/trunk/build/block.json
r3222633 r3260510 3 3 "apiVersion": 3, 4 4 "name": "create-block/compress-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Compress Pdf", 7 7 "category": "widgets", -
compress-pdf/trunk/build/index-rtl.css
r3222633 r3260510 1 /*!****************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! 3 \****************************************************************************************************************************************************************************************************************************************************/ 4 .solution__compress-pdf { 5 margin: 1rem; 6 } 1 .solution__compress-pdf{margin:1rem} -
compress-pdf/trunk/build/index.asset.php
r3222633 r3260510 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => ' e403623a48b9b082a5cd');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'dcc95b81d99127b77099'); -
compress-pdf/trunk/build/index.css
r3222633 r3260510 1 /*!****************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! 3 \****************************************************************************************************************************************************************************************************************************************************/ 4 .solution__compress-pdf { 5 margin: 1rem; 6 } 7 8 /*# sourceMappingURL=index.css.map*/ 1 .solution__compress-pdf{margin:1rem} -
compress-pdf/trunk/build/index.js
r3222633 r3260510 1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/edit.js": 6 /*!*********************!*\ 7 !*** ./src/edit.js ***! 8 \*********************/ 9 /***/ ((__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 */ compressPDFIcon: () => (/* binding */ compressPDFIcon), 14 /* harmony export */ "default": () => (/* binding */ Edit) 15 /* harmony export */ }); 16 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); 17 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 18 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 19 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 20 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 21 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 22 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 23 /** 24 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 25 * Those files can contain any CSS code that gets applied to the editor. 26 * 27 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 28 */ 29 30 31 32 33 function Edit() { 34 const dpiRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); 35 const imageQualityRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); 36 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { 37 const refs = [dpiRef, imageQualityRef]; 38 refs.forEach(ref => { 39 const input = ref.current; 40 if (input && !input.isInitialized) { 41 input.isInitialized = true; // Prevent multiple initializations 42 const min = input.getAttribute('min'); 43 const max = input.getAttribute('max'); 44 const value = input.value; 45 46 // Initialize ionRangeSlider on the input element 47 ionRangeSlider(input, { 48 min: min, 49 max: max, 50 from: value, 51 step: 1, 52 grid: true, 53 grid_num: 5, 54 disable: true 55 }); 56 } 57 }); 58 }, []); 59 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('div', null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 60 className: "solution__compress-pdf", 61 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 62 className: "solution__container__wrapper", 63 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 64 className: "solution__container", 65 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { 66 className: "solution__header", 67 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Compress PDF', 'compress-pdf') 68 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { 69 className: "solution__form", 70 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", { 71 htmlFor: "file", 72 className: "solution__label", 73 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 74 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('File:', 'compress-pdf') 75 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 76 type: "file", 77 id: "file", 78 name: "file", 79 className: "solution__file-input", 80 required: true, 81 disabled: true 82 })] 83 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", { 84 htmlFor: "dpi", 85 className: "solution__label", 86 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 87 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('DPI:', 'compress-pdf') 88 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 89 ref: dpiRef, 90 type: "number", 91 id: "dpi", 92 name: "dpi", 93 className: "solution__input solution__range-linked", 94 max: 300, 95 min: 72, 96 value: 144, 97 required: true, 98 disabled: true 99 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 100 className: "solution__hint", 101 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Dots per inch from 72 to 300. Smaller value reduces size of PDF File but also quality.', 'compress-pdf') 102 })] 103 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", { 104 htmlFor: "image-quality", 105 className: "solution__label", 106 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 107 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Image Quality:', 'compress-pdf') 108 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", { 109 ref: imageQualityRef, 110 type: "number", 111 id: "image-quality", 112 name: "image-quality", 113 className: "solution__input .solution__range-linked", 114 max: 100, 115 min: 0, 116 value: 75, 117 required: true, 118 disabled: true 119 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", { 120 className: "solution__hint", 121 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Values in % from 0 to 100. Smaller value reduces size of PDF File but also the quality.', 'compress-pdf') 122 })] 123 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", { 124 disabled: true, 125 className: "solution__btn", 126 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Submit', 'compress-pdf') 127 })] 128 })] 129 }) 130 }) 131 })); 132 } 133 const compressPDFIcon = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('svg', { 134 width: 32, 135 height: 33, 136 viewBox: "0 0 32 33", 137 fill: "none", 138 xmlns: "http://www.w3.org/2000/svg" 139 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('rect', { 140 y: "0.5", 141 width: "32.0014", 142 height: "32.0014", 143 rx: "16.0007", 144 fill: "#E5DBFF" 145 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)('path', { 146 d: "M15.2597 24.2785V21.9081L14.0745 23.0933L13.0374 22.0563L16.0005 19.0932L18.9637 22.0563L17.9266 23.0933L16.7413 21.9451V24.2785H15.2597ZM10.0742 18.3525V16.871H21.9269V18.3525H10.0742ZM10.0742 16.1302V14.6487H21.9269V16.1302H10.0742ZM16.0005 13.9079L13.0374 10.9449L14.0745 9.90787L15.2597 11.0931V8.72266H16.7413V11.0931L17.9266 9.90787L18.9637 10.9449L16.0005 13.9079Z", 147 fill: "#5A3BB2" 148 })); 149 150 /***/ }), 151 152 /***/ "./src/index.js": 153 /*!**********************!*\ 154 !*** ./src/index.js ***! 155 \**********************/ 156 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 157 158 __webpack_require__.r(__webpack_exports__); 159 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); 160 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 161 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); 162 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); 163 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); 164 165 166 167 168 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__, { 169 icon: _edit__WEBPACK_IMPORTED_MODULE_2__.compressPDFIcon, 170 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"] 171 }); 172 173 /***/ }), 174 175 /***/ "./src/editor.scss": 176 /*!*************************!*\ 177 !*** ./src/editor.scss ***! 178 \*************************/ 179 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 180 181 __webpack_require__.r(__webpack_exports__); 182 // extracted by mini-css-extract-plugin 183 184 185 /***/ }), 186 187 /***/ "./src/style.scss": 188 /*!************************!*\ 189 !*** ./src/style.scss ***! 190 \************************/ 191 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 192 193 __webpack_require__.r(__webpack_exports__); 194 // extracted by mini-css-extract-plugin 195 196 197 /***/ }), 198 199 /***/ "react/jsx-runtime": 200 /*!**********************************!*\ 201 !*** external "ReactJSXRuntime" ***! 202 \**********************************/ 203 /***/ ((module) => { 204 205 module.exports = window["ReactJSXRuntime"]; 206 207 /***/ }), 208 209 /***/ "@wordpress/blocks": 210 /*!********************************!*\ 211 !*** external ["wp","blocks"] ***! 212 \********************************/ 213 /***/ ((module) => { 214 215 module.exports = window["wp"]["blocks"]; 216 217 /***/ }), 218 219 /***/ "@wordpress/element": 220 /*!*********************************!*\ 221 !*** external ["wp","element"] ***! 222 \*********************************/ 223 /***/ ((module) => { 224 225 module.exports = window["wp"]["element"]; 226 227 /***/ }), 228 229 /***/ "@wordpress/i18n": 230 /*!******************************!*\ 231 !*** external ["wp","i18n"] ***! 232 \******************************/ 233 /***/ ((module) => { 234 235 module.exports = window["wp"]["i18n"]; 236 237 /***/ }), 238 239 /***/ "./src/block.json": 240 /*!************************!*\ 241 !*** ./src/block.json ***! 242 \************************/ 243 /***/ ((module) => { 244 245 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/compress-pdf","version":"1.0.0","title":"Compress Pdf","category":"widgets","description":"Effortlessly reduce the size of your PDF files while maintaining quality, making them easier to store, share, and upload without sacrificing readability.","example":{},"supports":{"html":false},"textdomain":"compress-pdf","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}'); 246 247 /***/ }) 248 249 /******/ }); 250 /************************************************************************/ 251 /******/ // The module cache 252 /******/ var __webpack_module_cache__ = {}; 253 /******/ 254 /******/ // The require function 255 /******/ function __webpack_require__(moduleId) { 256 /******/ // Check if module is in cache 257 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 258 /******/ if (cachedModule !== undefined) { 259 /******/ return cachedModule.exports; 260 /******/ } 261 /******/ // Create a new module (and put it into the cache) 262 /******/ var module = __webpack_module_cache__[moduleId] = { 263 /******/ // no module.id needed 264 /******/ // no module.loaded needed 265 /******/ exports: {} 266 /******/ }; 267 /******/ 268 /******/ // Execute the module function 269 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 270 /******/ 271 /******/ // Return the exports of the module 272 /******/ return module.exports; 273 /******/ } 274 /******/ 275 /******/ // expose the modules object (__webpack_modules__) 276 /******/ __webpack_require__.m = __webpack_modules__; 277 /******/ 278 /************************************************************************/ 279 /******/ /* webpack/runtime/chunk loaded */ 280 /******/ (() => { 281 /******/ var deferred = []; 282 /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 283 /******/ if(chunkIds) { 284 /******/ priority = priority || 0; 285 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 286 /******/ deferred[i] = [chunkIds, fn, priority]; 287 /******/ return; 288 /******/ } 289 /******/ var notFulfilled = Infinity; 290 /******/ for (var i = 0; i < deferred.length; i++) { 291 /******/ var chunkIds = deferred[i][0]; 292 /******/ var fn = deferred[i][1]; 293 /******/ var priority = deferred[i][2]; 294 /******/ var fulfilled = true; 295 /******/ for (var j = 0; j < chunkIds.length; j++) { 296 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 297 /******/ chunkIds.splice(j--, 1); 298 /******/ } else { 299 /******/ fulfilled = false; 300 /******/ if(priority < notFulfilled) notFulfilled = priority; 301 /******/ } 302 /******/ } 303 /******/ if(fulfilled) { 304 /******/ deferred.splice(i--, 1) 305 /******/ var r = fn(); 306 /******/ if (r !== undefined) result = r; 307 /******/ } 308 /******/ } 309 /******/ return result; 310 /******/ }; 311 /******/ })(); 312 /******/ 313 /******/ /* webpack/runtime/compat get default export */ 314 /******/ (() => { 315 /******/ // getDefaultExport function for compatibility with non-harmony modules 316 /******/ __webpack_require__.n = (module) => { 317 /******/ var getter = module && module.__esModule ? 318 /******/ () => (module['default']) : 319 /******/ () => (module); 320 /******/ __webpack_require__.d(getter, { a: getter }); 321 /******/ return getter; 322 /******/ }; 323 /******/ })(); 324 /******/ 325 /******/ /* webpack/runtime/define property getters */ 326 /******/ (() => { 327 /******/ // define getter functions for harmony exports 328 /******/ __webpack_require__.d = (exports, definition) => { 329 /******/ for(var key in definition) { 330 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 331 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 332 /******/ } 333 /******/ } 334 /******/ }; 335 /******/ })(); 336 /******/ 337 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 338 /******/ (() => { 339 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 340 /******/ })(); 341 /******/ 342 /******/ /* webpack/runtime/make namespace object */ 343 /******/ (() => { 344 /******/ // define __esModule on exports 345 /******/ __webpack_require__.r = (exports) => { 346 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 347 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 348 /******/ } 349 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 350 /******/ }; 351 /******/ })(); 352 /******/ 353 /******/ /* webpack/runtime/jsonp chunk loading */ 354 /******/ (() => { 355 /******/ // no baseURI 356 /******/ 357 /******/ // object to store loaded and loading chunks 358 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 359 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 360 /******/ var installedChunks = { 361 /******/ "index": 0, 362 /******/ "./style-index": 0 363 /******/ }; 364 /******/ 365 /******/ // no chunk on demand loading 366 /******/ 367 /******/ // no prefetching 368 /******/ 369 /******/ // no preloaded 370 /******/ 371 /******/ // no HMR 372 /******/ 373 /******/ // no HMR manifest 374 /******/ 375 /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 376 /******/ 377 /******/ // install a JSONP callback for chunk loading 378 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 379 /******/ var chunkIds = data[0]; 380 /******/ var moreModules = data[1]; 381 /******/ var runtime = data[2]; 382 /******/ // add "moreModules" to the modules object, 383 /******/ // then flag all "chunkIds" as loaded and fire callback 384 /******/ var moduleId, chunkId, i = 0; 385 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 386 /******/ for(moduleId in moreModules) { 387 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 388 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 389 /******/ } 390 /******/ } 391 /******/ if(runtime) var result = runtime(__webpack_require__); 392 /******/ } 393 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 394 /******/ for(;i < chunkIds.length; i++) { 395 /******/ chunkId = chunkIds[i]; 396 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 397 /******/ installedChunks[chunkId][0](); 398 /******/ } 399 /******/ installedChunks[chunkId] = 0; 400 /******/ } 401 /******/ return __webpack_require__.O(result); 402 /******/ } 403 /******/ 404 /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; 405 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 406 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 407 /******/ })(); 408 /******/ 409 /************************************************************************/ 410 /******/ 411 /******/ // startup 412 /******/ // Load entry module and return exports 413 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 414 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js"))) 415 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 416 /******/ 417 /******/ })() 418 ; 419 //# sourceMappingURL=index.js.map 1 (()=>{"use strict";var e,i={354:()=>{const e=window.wp.blocks,i=window.wp.element,s=window.wp.i18n,l=window.ReactJSXRuntime,t=(0,i.createElement)("svg",{width:32,height:33,viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.createElement)("rect",{y:"0.5",width:"32.0014",height:"32.0014",rx:"16.0007",fill:"#E5DBFF"}),(0,i.createElement)("path",{d:"M15.2597 24.2785V21.9081L14.0745 23.0933L13.0374 22.0563L16.0005 19.0932L18.9637 22.0563L17.9266 23.0933L16.7413 21.9451V24.2785H15.2597ZM10.0742 18.3525V16.871H21.9269V18.3525H10.0742ZM10.0742 16.1302V14.6487H21.9269V16.1302H10.0742ZM16.0005 13.9079L13.0374 10.9449L14.0745 9.90787L15.2597 11.0931V8.72266H16.7413V11.0931L17.9266 9.90787L18.9637 10.9449L16.0005 13.9079Z",fill:"#5A3BB2"})),r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/compress-pdf","version":"1.0.1","title":"Compress Pdf","category":"widgets","description":"Effortlessly reduce the size of your PDF files while maintaining quality, making them easier to store, share, and upload without sacrificing readability.","example":{},"supports":{"html":false},"textdomain":"compress-pdf","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}');(0,e.registerBlockType)(r,{icon:t,edit:function(){const e=(0,i.useRef)(null),t=(0,i.useRef)(null);return(0,i.useEffect)((()=>{[e,t].forEach((e=>{const i=e.current;if(i&&!i.isInitialized){i.isInitialized=!0;const e=i.getAttribute("min"),s=i.getAttribute("max"),l=i.value;ionRangeSlider(i,{min:e,max:s,from:l,step:1,grid:!0,grid_num:5,disable:!0})}}))}),[]),(0,i.createElement)("div",null,(0,l.jsx)("div",{className:"solution__compress-pdf",children:(0,l.jsx)("div",{className:"solution__container__wrapper",children:(0,l.jsxs)("div",{className:"solution__container",children:[(0,l.jsx)("div",{className:"solution__header",children:(0,s.__)("Compress PDF","compress-pdf")}),(0,l.jsxs)("div",{className:"solution__form",children:[(0,l.jsxs)("label",{htmlFor:"file",className:"solution__label",children:[(0,l.jsx)("span",{children:(0,s.__)("File:","compress-pdf")}),(0,l.jsx)("input",{type:"file",id:"file",name:"file",className:"solution__file-input",required:!0,disabled:!0})]}),(0,l.jsxs)("label",{htmlFor:"dpi",className:"solution__label",children:[(0,l.jsx)("span",{children:(0,s.__)("DPI:","compress-pdf")}),(0,l.jsx)("input",{ref:e,type:"number",id:"dpi",name:"dpi",className:"solution__input solution__range-linked",max:300,min:72,value:144,required:!0,disabled:!0}),(0,l.jsx)("span",{className:"solution__hint",children:(0,s.__)("Dots per inch from 72 to 300. Smaller value reduces size of PDF File but also quality.","compress-pdf")})]}),(0,l.jsxs)("label",{htmlFor:"image-quality",className:"solution__label",children:[(0,l.jsx)("span",{children:(0,s.__)("Image Quality:","compress-pdf")}),(0,l.jsx)("input",{ref:t,type:"number",id:"image-quality",name:"image-quality",className:"solution__input .solution__range-linked",max:100,min:0,value:75,required:!0,disabled:!0}),(0,l.jsx)("span",{className:"solution__hint",children:(0,s.__)("Values in % from 0 to 100. Smaller value reduces size of PDF File but also the quality.","compress-pdf")})]}),(0,l.jsx)("button",{disabled:!0,className:"solution__btn",children:(0,s.__)("Submit","compress-pdf")})]})]})})}))}})}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return i[e](r,r.exports,l),r.exports}l.m=i,e=[],l.O=(i,s,t,r)=>{if(!s){var n=1/0;for(c=0;c<e.length;c++){s=e[c][0],t=e[c][1],r=e[c][2];for(var a=!0,o=0;o<s.length;o++)(!1&r||n>=r)&&Object.keys(l.O).every((e=>l.O[e](s[o])))?s.splice(o--,1):(a=!1,r<n&&(n=r));if(a){e.splice(c--,1);var d=t();void 0!==d&&(i=d)}}return i}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[s,t,r]},l.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={57:0,350:0};l.O.j=i=>0===e[i];var i=(i,s)=>{var t,r,n=s[0],a=s[1],o=s[2],d=0;if(n.some((i=>0!==e[i]))){for(t in a)l.o(a,t)&&(l.m[t]=a[t]);if(o)var c=o(l)}for(i&&i(s);d<n.length;d++)r=n[d],l.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return l.O(c)},s=self.webpackChunk=self.webpackChunk||[];s.forEach(i.bind(null,0)),s.push=i.bind(null,s.push.bind(s))})();var t=l.O(void 0,[350],(()=>l(354)));t=l.O(t)})(); -
compress-pdf/trunk/build/style-index-rtl.css
r3222633 r3260510 1 /*!***************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************/ 4 :root { 5 --solution-compress-pdf-primary-color: #4f46e5; 6 --solution-compress-pdf-secondary-color: #eef2ff; 7 --solution-compress-pdf-tertiary-color: #000; 8 --solution-compress-pdf-background-color: #fff; 9 --solution-compress-pdf-border-color: #e5e7eb; 10 --solution-compress-pdf-input-border-color: #d1d5db; 11 --solution-compress-pdf-shadow-color: rgba(149, 157, 165, 0.2); 12 --solution-compress-pdf-btn-shadow-color: rgba(0, 0, 0, 0.05); 13 --solution-compress-pdf-dropdown-bg-color: #fff; 14 --solution-compress-pdf-dropdown-shadow-color-1: rgba(0, 0, 0, 0.1); 15 --solution-compress-pdf-dropdown-shadow-color-2: rgba(0, 0, 0, 0.1); 16 } 17 18 .solution__compress-pdf .solution__container-wrapper { 19 padding: 1rem; 20 display: flex; 21 flex-direction: column; 22 gap: 1rem; 23 color: var(--solution-compress-pdf-tertiary-color); 24 } 25 .solution__compress-pdf .solution__container { 26 box-shadow: var(--solution-compress-pdf-shadow-color) 0 8px 24px; 27 border: 1px solid var(--solution-compress-pdf-border-color); 28 background-color: var(--solution-compress-pdf-background-color); 29 border-radius: 0.75rem; 30 padding: 1.5rem 1.5rem 0.5rem; 31 position: relative; 32 display: flex; 33 flex-direction: column; 34 min-height: 380px; 35 gap: 1rem; 36 } 37 .solution__compress-pdf .solution__header { 38 font-size: 1.25rem; 39 letter-spacing: 0.05em; 40 font-weight: 500; 41 } 42 .solution__compress-pdf .solution__content { 43 flex-grow: 1; 44 display: grid; 45 } 46 .solution__compress-pdf .solution__form { 47 display: flex; 48 flex-direction: column; 49 gap: 1rem; 50 } 51 .solution__compress-pdf .solution__label { 52 white-space: nowrap; 53 width: 100%; 54 font-size: 0.75rem; 55 font-weight: 500; 56 display: flex; 57 flex-direction: column; 58 gap: 0.3rem; 59 } 60 .solution__compress-pdf .solution__hint { 61 font-size: 0.75rem; 62 font-weight: 500; 63 color: var(--solution-compress-pdf-primary-color); 64 white-space: wrap; 65 } 66 .solution__compress-pdf .solution__input { 67 border: 1px solid var(--solution-compress-pdf-input-border-color); 68 border-radius: 0.375rem; 69 padding: 0.25rem 0.5rem; 70 font-size: 1rem; 71 line-height: 32px; 72 outline: 1px solid transparent; 73 outline-offset: -1px; 74 } 75 .solution__compress-pdf .solution__file-input::-webkit-file-upload-button { 76 margin-left: 1rem; 77 padding: 0.5rem 1rem; 78 border-radius: 0.75rem; 79 border: none; 80 background-color: var(--solution-compress-pdf-secondary-color); 81 color: var(--solution-compress-pdf-primary-color); 82 font-weight: 500; 83 cursor: pointer; 84 } 85 .solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button { 86 background-color: var(--solution-compress-pdf-secondary-color); 87 } 88 .solution__compress-pdf .solution__btn { 89 display: inline-flex; 90 align-items: center; /* Ensures the icon and text are aligned */ 91 justify-content: center; 92 gap: 0.5rem; /* Adds space between the icon and the text */ 93 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color); 94 background: var(--solution-compress-pdf-secondary-color); 95 color: var(--solution-compress-pdf-primary-color); 96 padding: 0.5rem 1rem; 97 border-radius: 1rem; 98 font-weight: 600; 99 cursor: pointer; 100 border: none; 101 } 102 .solution__compress-pdf .solution__btn:hover { 103 filter: brightness(0.98); 104 } 105 .solution__compress-pdf .solution__btn .dashicons { 106 font-size: 1.2rem; /* Adjust the size of the icon */ 107 vertical-align: middle; /* Aligns the icon vertically with the text */ 108 } 109 .solution__compress-pdf .solution__dropdown-wrapper { 110 position: relative; 111 } 112 .solution__compress-pdf .solution__dropdown { 113 position: relative; 114 overflow: visible; 115 background-color: transparent; 116 box-shadow: none; 117 width: 100%; 118 border-radius: 0.75rem; 119 max-height: 15rem; 120 z-index: 10; 121 } 122 .solution__compress-pdf .solution__dropdown--hidden { 123 display: none; 124 } 125 .solution__compress-pdf .solution__loading-section { 126 display: none; 127 position: absolute; 128 top: 50%; 129 right: 50%; 130 transform: translate(50%, -50%); 131 } 132 .solution__compress-pdf .solution__loading-container { 133 display: flex; 134 justify-content: center; 135 align-items: center; 136 gap: 1rem; 137 transition: 2s ease; 138 } 139 .solution__compress-pdf .solution__download-section { 140 display: flex; 141 justify-content: center; 142 align-items: center; 143 flex-direction: column; 144 gap: 2rem; 145 height: 100%; 146 } 147 .solution__compress-pdf .solution__download-section:last-child { 148 margin-top: auto; 149 } 150 .solution__compress-pdf .solution__download-container { 151 display: flex; 152 flex-direction: column; 153 flex-grow: 1; 154 justify-content: center; 155 align-items: center; 156 gap: 1rem; 157 } 158 .solution__compress-pdf .solution__download-file-container { 159 display: flex; 160 flex-wrap: wrap; 161 justify-content: flex-start; 162 gap: 1rem; 163 } 164 .solution__compress-pdf .solution__download-file-name { 165 white-space: nowrap; 166 overflow: hidden; 167 text-overflow: ellipsis; 168 max-width: 12rem; 169 } 170 .solution__compress-pdf .solution__title-text { 171 font-weight: 600; 172 } 173 .solution__compress-pdf .solution__text { 174 font-weight: 500; 175 } 176 .solution__compress-pdf .solution__provided-text { 177 display: flex; 178 justify-content: center; 179 font-size: 0.7rem; 180 margin-top: 0.5rem; 181 } 182 .solution__compress-pdf .solution__error-section { 183 display: flex; 184 flex-direction: column; 185 justify-self: center; 186 align-self: center; 187 } 188 .solution__compress-pdf .solution__dot { 189 background: var(--solution-compress-pdf-tertiary-color); 190 height: 0.65em; 191 width: 0.65em; 192 border-radius: 50%; 193 animation: move 0.6s ease infinite; 194 } 195 .solution__compress-pdf .solution__link { 196 color: var(--solution-compress-pdf-tertiary-color); 197 } 198 .solution__compress-pdf .solution__select { 199 display: flex; 200 flex-direction: column; 201 position: relative; 202 gap: 0.3rem; 203 /* Placeholder color */ 204 /* Style for selected option */ 205 } 206 .solution__compress-pdf .solution__select .solution__select-input { 207 height: 42px; 208 padding: 0 0.5rem; 209 border-radius: 0.375rem; 210 border: 1px solid var(--solution-compress-pdf-input-border-color); 211 color: var(--solution-compress-pdf-tertiary-color); 212 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-shadow-color); 213 -webkit-appearance: none; 214 -moz-appearance: none; 215 appearance: none; 216 cursor: pointer; 217 /* Arrow styling */ 218 background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E"); 219 background-repeat: no-repeat; 220 background-position: left 1rem center; 221 background-size: 1rem; 222 } 223 .solution__compress-pdf .solution__select .solution__select-input:focus { 224 outline: 1px solid var(--solution-compress-pdf-primary-color); 225 box-shadow: 0 0 0 3px var(--solution-compress-pdf-secondary-color); 226 } 227 .solution__compress-pdf .solution__select .solution__select-input option { 228 padding: 1rem; 229 } 230 .solution__compress-pdf .solution__select .solution__select-input option[disabled] { 231 color: var(--solution-compress-pdf-input-border-color); 232 } 233 .solution__compress-pdf .solution__select .solution__select-input:required:invalid { 234 color: var(--solution-compress-pdf-input-border-color); 235 } 236 .solution__compress-pdf .solution__select .solution__select-input option:not([disabled]) { 237 color: var(--solution-compress-pdf-tertiary-color); 238 } 239 .solution__compress-pdf .solution_dropdown button { 240 width: 100%; 241 } 242 .solution__compress-pdf .solution__dropdown-content { 243 display: none; 244 position: absolute; 245 flex-direction: column; 246 min-width: 100%; 247 max-height: 150px; 248 padding: 0.5rem 0; 249 overflow: auto; 250 background-color: #fff; 251 box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); 252 z-index: 10; 253 margin-top: 3px; 254 border-radius: 10px; 255 top: 100%; 256 right: 50%; 257 transform: translate(50%, 0); 258 } 259 .solution__compress-pdf .solution__dropdown-content label { 260 display: block; 261 margin-top: 10px; 262 padding: 0 1rem; 263 } 264 .solution__compress-pdf .solution__dropdown-button { 265 min-width: 100%; 266 } 267 .solution__compress-pdf .solution__dropdown-content:hover, 268 .solution__compress-pdf .solution__dropdown-button:focus + .solution__dropdown-content { 269 display: flex; 270 } 271 .solution__compress-pdf .solution__group { 272 display: flex; 273 flex-wrap: wrap; 274 gap: 10px; 275 } 276 .solution__compress-pdf .solution__group > div, 277 .solution__compress-pdf .solution__group > label { 278 flex: 1; 279 } 280 .solution__compress-pdf .irs--flat .irs-handle > i:first-child { 281 background-color: var(--solution-compress-pdf-primary-color) !important; 282 } 283 .solution__compress-pdf .irs--flat .irs-bar { 284 background-color: var(--solution-compress-pdf-primary-color) !important; 285 } 286 .solution__compress-pdf .irs--flat .irs-from, .solution__compress-pdf .irs--flat .irs-to, .solution__compress-pdf .irs--flat .irs-single { 287 background-color: var(--solution-compress-pdf-primary-color) !important; 288 } 289 .solution__compress-pdf .irs--flat .irs-from:before, .solution__compress-pdf .irs--flat .irs-to:before, .solution__compress-pdf .irs--flat .irs-single:before { 290 border-top-color: var(--solution-compress-pdf-primary-color) !important; 291 } 292 293 @keyframes move { 294 0% { 295 transform: translateX(-50%); 296 } 297 50% { 298 transform: translateX(50%); 299 } 300 100% { 301 transform: translateX(-50%); 302 } 303 } 1 :root{--solution-compress-pdf-primary-color:#4f46e5;--solution-compress-pdf-secondary-color:#eef2ff;--solution-compress-pdf-tertiary-color:#000;--solution-compress-pdf-background-color:#fff;--solution-compress-pdf-border-color:#e5e7eb;--solution-compress-pdf-input-border-color:#d1d5db;--solution-compress-pdf-shadow-color:hsla(210,8%,62%,.2);--solution-compress-pdf-btn-shadow-color:rgba(0,0,0,.05);--solution-compress-pdf-dropdown-bg-color:#fff;--solution-compress-pdf-dropdown-shadow-color-1:rgba(0,0,0,.1);--solution-compress-pdf-dropdown-shadow-color-2:rgba(0,0,0,.1)}.solution__compress-pdf .solution__container-wrapper{color:var(--solution-compress-pdf-tertiary-color);display:flex;flex-direction:column;gap:1rem;padding:1rem}.solution__compress-pdf .solution__container{background-color:var(--solution-compress-pdf-background-color);border:1px solid var(--solution-compress-pdf-border-color);border-radius:.75rem;box-shadow:var(--solution-compress-pdf-shadow-color) 0 8px 24px;display:flex;flex-direction:column;gap:1rem;min-height:380px;padding:1.5rem 1.5rem .5rem;position:relative}.solution__compress-pdf .solution__header{font-size:1.25rem;font-weight:500;letter-spacing:.05em}.solution__compress-pdf .solution__content{display:grid;flex-grow:1}.solution__compress-pdf .solution__form{display:flex;flex-direction:column;gap:1rem}.solution__compress-pdf .solution__label{display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.3rem;white-space:nowrap;width:100%}.solution__compress-pdf .solution__hint{color:var(--solution-compress-pdf-primary-color);font-size:.75rem;font-weight:500;white-space:wrap}.solution__compress-pdf .solution__input{border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;font-size:1rem;line-height:32px;outline:1px solid transparent;outline-offset:-1px;padding:.25rem .5rem}.solution__compress-pdf .solution__file-input::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color);border:none;border-radius:.75rem;color:var(--solution-compress-pdf-primary-color);cursor:pointer;font-weight:500;margin-left:1rem;padding:.5rem 1rem}.solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color)}.solution__compress-pdf .solution__btn{align-items:center;background:var(--solution-compress-pdf-secondary-color);border:none;border-radius:1rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color);color:var(--solution-compress-pdf-primary-color);cursor:pointer;display:inline-flex;font-weight:600;gap:.5rem;justify-content:center;padding:.5rem 1rem}.solution__compress-pdf .solution__btn:hover{filter:brightness(.98)}.solution__compress-pdf .solution__btn .dashicons{font-size:1.2rem;vertical-align:middle}.solution__compress-pdf .solution__dropdown-wrapper{position:relative}.solution__compress-pdf .solution__dropdown{background-color:transparent;border-radius:.75rem;box-shadow:none;max-height:15rem;overflow:visible;position:relative;width:100%;z-index:10}.solution__compress-pdf .solution__dropdown--hidden{display:none}.solution__compress-pdf .solution__loading-section{display:none;right:50%;position:absolute;top:50%;transform:translate(50%,-50%)}.solution__compress-pdf .solution__loading-container{align-items:center;display:flex;gap:1rem;justify-content:center;transition:2s ease}.solution__compress-pdf .solution__download-section{align-items:center;display:flex;flex-direction:column;gap:2rem;height:100%;justify-content:center}.solution__compress-pdf .solution__download-section:last-child{margin-top:auto}.solution__compress-pdf .solution__download-container{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:1rem;justify-content:center}.solution__compress-pdf .solution__download-file-container{display:flex;flex-wrap:wrap;gap:1rem;justify-content:flex-start}.solution__compress-pdf .solution__download-file-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.solution__compress-pdf .solution__title-text{font-weight:600}.solution__compress-pdf .solution__text{font-weight:500}.solution__compress-pdf .solution__provided-text{display:flex;font-size:.7rem;justify-content:center;margin-top:.5rem}.solution__compress-pdf .solution__error-section{align-self:center;display:flex;flex-direction:column;justify-self:center}.solution__compress-pdf .solution__dot{animation:move .6s ease infinite;background:var(--solution-compress-pdf-tertiary-color);border-radius:50%;height:.65em;width:.65em}.solution__compress-pdf .solution__link{color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution__select{display:flex;flex-direction:column;gap:.3rem;position:relative}.solution__compress-pdf .solution__select .solution__select-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E");background-position:left 1rem center;background-repeat:no-repeat;background-size:1rem;border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-shadow-color);color:var(--solution-compress-pdf-tertiary-color);cursor:pointer;height:42px;padding:0 .5rem}.solution__compress-pdf .solution__select .solution__select-input:focus{box-shadow:0 0 0 3px var(--solution-compress-pdf-secondary-color);outline:1px solid var(--solution-compress-pdf-primary-color)}.solution__compress-pdf .solution__select .solution__select-input option{padding:1rem}.solution__compress-pdf .solution__select .solution__select-input option[disabled]{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input:required:invalid{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input option:not([disabled]){color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution_dropdown button{width:100%}.solution__compress-pdf .solution__dropdown-content{background-color:#fff;border-radius:10px;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;flex-direction:column;right:50%;margin-top:3px;max-height:150px;min-width:100%;overflow:auto;padding:.5rem 0;position:absolute;top:100%;transform:translate(50%);z-index:10}.solution__compress-pdf .solution__dropdown-content label{display:block;margin-top:10px;padding:0 1rem}.solution__compress-pdf .solution__dropdown-button{min-width:100%}.solution__compress-pdf .solution__dropdown-button:focus+.solution__dropdown-content,.solution__compress-pdf .solution__dropdown-content:hover{display:flex}.solution__compress-pdf .solution__group{display:flex;flex-wrap:wrap;gap:10px}.solution__compress-pdf .solution__group>div,.solution__compress-pdf .solution__group>label{flex:1}.solution__compress-pdf .irs--flat .irs-bar,.solution__compress-pdf .irs--flat .irs-from,.solution__compress-pdf .irs--flat .irs-handle>i:first-child,.solution__compress-pdf .irs--flat .irs-single,.solution__compress-pdf .irs--flat .irs-to{background-color:var(--solution-compress-pdf-primary-color)!important}.solution__compress-pdf .irs--flat .irs-from:before,.solution__compress-pdf .irs--flat .irs-single:before,.solution__compress-pdf .irs--flat .irs-to:before{border-top-color:var(--solution-compress-pdf-primary-color)!important}@keyframes move{0%{transform:translateX(-50%)}50%{transform:translateX(50%)}to{transform:translateX(-50%)}} -
compress-pdf/trunk/build/style-index.css
r3222633 r3260510 1 /*!***************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************/ 4 :root { 5 --solution-compress-pdf-primary-color: #4f46e5; 6 --solution-compress-pdf-secondary-color: #eef2ff; 7 --solution-compress-pdf-tertiary-color: #000; 8 --solution-compress-pdf-background-color: #fff; 9 --solution-compress-pdf-border-color: #e5e7eb; 10 --solution-compress-pdf-input-border-color: #d1d5db; 11 --solution-compress-pdf-shadow-color: rgba(149, 157, 165, 0.2); 12 --solution-compress-pdf-btn-shadow-color: rgba(0, 0, 0, 0.05); 13 --solution-compress-pdf-dropdown-bg-color: #fff; 14 --solution-compress-pdf-dropdown-shadow-color-1: rgba(0, 0, 0, 0.1); 15 --solution-compress-pdf-dropdown-shadow-color-2: rgba(0, 0, 0, 0.1); 16 } 17 18 .solution__compress-pdf .solution__container-wrapper { 19 padding: 1rem; 20 display: flex; 21 flex-direction: column; 22 gap: 1rem; 23 color: var(--solution-compress-pdf-tertiary-color); 24 } 25 .solution__compress-pdf .solution__container { 26 box-shadow: var(--solution-compress-pdf-shadow-color) 0 8px 24px; 27 border: 1px solid var(--solution-compress-pdf-border-color); 28 background-color: var(--solution-compress-pdf-background-color); 29 border-radius: 0.75rem; 30 padding: 1.5rem 1.5rem 0.5rem; 31 position: relative; 32 display: flex; 33 flex-direction: column; 34 min-height: 380px; 35 gap: 1rem; 36 } 37 .solution__compress-pdf .solution__header { 38 font-size: 1.25rem; 39 letter-spacing: 0.05em; 40 font-weight: 500; 41 } 42 .solution__compress-pdf .solution__content { 43 flex-grow: 1; 44 display: grid; 45 } 46 .solution__compress-pdf .solution__form { 47 display: flex; 48 flex-direction: column; 49 gap: 1rem; 50 } 51 .solution__compress-pdf .solution__label { 52 white-space: nowrap; 53 width: 100%; 54 font-size: 0.75rem; 55 font-weight: 500; 56 display: flex; 57 flex-direction: column; 58 gap: 0.3rem; 59 } 60 .solution__compress-pdf .solution__hint { 61 font-size: 0.75rem; 62 font-weight: 500; 63 color: var(--solution-compress-pdf-primary-color); 64 white-space: wrap; 65 } 66 .solution__compress-pdf .solution__input { 67 border: 1px solid var(--solution-compress-pdf-input-border-color); 68 border-radius: 0.375rem; 69 padding: 0.25rem 0.5rem; 70 font-size: 1rem; 71 line-height: 32px; 72 outline: 1px solid transparent; 73 outline-offset: -1px; 74 } 75 .solution__compress-pdf .solution__file-input::-webkit-file-upload-button { 76 margin-right: 1rem; 77 padding: 0.5rem 1rem; 78 border-radius: 0.75rem; 79 border: none; 80 background-color: var(--solution-compress-pdf-secondary-color); 81 color: var(--solution-compress-pdf-primary-color); 82 font-weight: 500; 83 cursor: pointer; 84 } 85 .solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button { 86 background-color: var(--solution-compress-pdf-secondary-color); 87 } 88 .solution__compress-pdf .solution__btn { 89 display: inline-flex; 90 align-items: center; /* Ensures the icon and text are aligned */ 91 justify-content: center; 92 gap: 0.5rem; /* Adds space between the icon and the text */ 93 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color); 94 background: var(--solution-compress-pdf-secondary-color); 95 color: var(--solution-compress-pdf-primary-color); 96 padding: 0.5rem 1rem; 97 border-radius: 1rem; 98 font-weight: 600; 99 cursor: pointer; 100 border: none; 101 } 102 .solution__compress-pdf .solution__btn:hover { 103 filter: brightness(0.98); 104 } 105 .solution__compress-pdf .solution__btn .dashicons { 106 font-size: 1.2rem; /* Adjust the size of the icon */ 107 vertical-align: middle; /* Aligns the icon vertically with the text */ 108 } 109 .solution__compress-pdf .solution__dropdown-wrapper { 110 position: relative; 111 } 112 .solution__compress-pdf .solution__dropdown { 113 position: relative; 114 overflow: visible; 115 background-color: transparent; 116 box-shadow: none; 117 width: 100%; 118 border-radius: 0.75rem; 119 max-height: 15rem; 120 z-index: 10; 121 } 122 .solution__compress-pdf .solution__dropdown--hidden { 123 display: none; 124 } 125 .solution__compress-pdf .solution__loading-section { 126 display: none; 127 position: absolute; 128 top: 50%; 129 left: 50%; 130 transform: translate(-50%, -50%); 131 } 132 .solution__compress-pdf .solution__loading-container { 133 display: flex; 134 justify-content: center; 135 align-items: center; 136 gap: 1rem; 137 transition: 2s ease; 138 } 139 .solution__compress-pdf .solution__download-section { 140 display: flex; 141 justify-content: center; 142 align-items: center; 143 flex-direction: column; 144 gap: 2rem; 145 height: 100%; 146 } 147 .solution__compress-pdf .solution__download-section:last-child { 148 margin-top: auto; 149 } 150 .solution__compress-pdf .solution__download-container { 151 display: flex; 152 flex-direction: column; 153 flex-grow: 1; 154 justify-content: center; 155 align-items: center; 156 gap: 1rem; 157 } 158 .solution__compress-pdf .solution__download-file-container { 159 display: flex; 160 flex-wrap: wrap; 161 justify-content: flex-start; 162 gap: 1rem; 163 } 164 .solution__compress-pdf .solution__download-file-name { 165 white-space: nowrap; 166 overflow: hidden; 167 text-overflow: ellipsis; 168 max-width: 12rem; 169 } 170 .solution__compress-pdf .solution__title-text { 171 font-weight: 600; 172 } 173 .solution__compress-pdf .solution__text { 174 font-weight: 500; 175 } 176 .solution__compress-pdf .solution__provided-text { 177 display: flex; 178 justify-content: center; 179 font-size: 0.7rem; 180 margin-top: 0.5rem; 181 } 182 .solution__compress-pdf .solution__error-section { 183 display: flex; 184 flex-direction: column; 185 justify-self: center; 186 align-self: center; 187 } 188 .solution__compress-pdf .solution__dot { 189 background: var(--solution-compress-pdf-tertiary-color); 190 height: 0.65em; 191 width: 0.65em; 192 border-radius: 50%; 193 animation: move 0.6s ease infinite; 194 } 195 .solution__compress-pdf .solution__link { 196 color: var(--solution-compress-pdf-tertiary-color); 197 } 198 .solution__compress-pdf .solution__select { 199 display: flex; 200 flex-direction: column; 201 position: relative; 202 gap: 0.3rem; 203 /* Placeholder color */ 204 /* Style for selected option */ 205 } 206 .solution__compress-pdf .solution__select .solution__select-input { 207 height: 42px; 208 padding: 0 0.5rem; 209 border-radius: 0.375rem; 210 border: 1px solid var(--solution-compress-pdf-input-border-color); 211 color: var(--solution-compress-pdf-tertiary-color); 212 box-shadow: 0 1px 2px 0 var(--solution-compress-pdf-shadow-color); 213 -webkit-appearance: none; 214 -moz-appearance: none; 215 appearance: none; 216 cursor: pointer; 217 /* Arrow styling */ 218 background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E"); 219 background-repeat: no-repeat; 220 background-position: right 1rem center; 221 background-size: 1rem; 222 } 223 .solution__compress-pdf .solution__select .solution__select-input:focus { 224 outline: 1px solid var(--solution-compress-pdf-primary-color); 225 box-shadow: 0 0 0 3px var(--solution-compress-pdf-secondary-color); 226 } 227 .solution__compress-pdf .solution__select .solution__select-input option { 228 padding: 1rem; 229 } 230 .solution__compress-pdf .solution__select .solution__select-input option[disabled] { 231 color: var(--solution-compress-pdf-input-border-color); 232 } 233 .solution__compress-pdf .solution__select .solution__select-input:required:invalid { 234 color: var(--solution-compress-pdf-input-border-color); 235 } 236 .solution__compress-pdf .solution__select .solution__select-input option:not([disabled]) { 237 color: var(--solution-compress-pdf-tertiary-color); 238 } 239 .solution__compress-pdf .solution_dropdown button { 240 width: 100%; 241 } 242 .solution__compress-pdf .solution__dropdown-content { 243 display: none; 244 position: absolute; 245 flex-direction: column; 246 min-width: 100%; 247 max-height: 150px; 248 padding: 0.5rem 0; 249 overflow: auto; 250 background-color: #fff; 251 box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); 252 z-index: 10; 253 margin-top: 3px; 254 border-radius: 10px; 255 top: 100%; 256 left: 50%; 257 transform: translate(-50%, 0); 258 } 259 .solution__compress-pdf .solution__dropdown-content label { 260 display: block; 261 margin-top: 10px; 262 padding: 0 1rem; 263 } 264 .solution__compress-pdf .solution__dropdown-button { 265 min-width: 100%; 266 } 267 .solution__compress-pdf .solution__dropdown-content:hover, 268 .solution__compress-pdf .solution__dropdown-button:focus + .solution__dropdown-content { 269 display: flex; 270 } 271 .solution__compress-pdf .solution__group { 272 display: flex; 273 flex-wrap: wrap; 274 gap: 10px; 275 } 276 .solution__compress-pdf .solution__group > div, 277 .solution__compress-pdf .solution__group > label { 278 flex: 1; 279 } 280 .solution__compress-pdf .irs--flat .irs-handle > i:first-child { 281 background-color: var(--solution-compress-pdf-primary-color) !important; 282 } 283 .solution__compress-pdf .irs--flat .irs-bar { 284 background-color: var(--solution-compress-pdf-primary-color) !important; 285 } 286 .solution__compress-pdf .irs--flat .irs-from, .solution__compress-pdf .irs--flat .irs-to, .solution__compress-pdf .irs--flat .irs-single { 287 background-color: var(--solution-compress-pdf-primary-color) !important; 288 } 289 .solution__compress-pdf .irs--flat .irs-from:before, .solution__compress-pdf .irs--flat .irs-to:before, .solution__compress-pdf .irs--flat .irs-single:before { 290 border-top-color: var(--solution-compress-pdf-primary-color) !important; 291 } 292 293 @keyframes move { 294 0% { 295 transform: translateX(50%); 296 } 297 50% { 298 transform: translateX(-50%); 299 } 300 100% { 301 transform: translateX(50%); 302 } 303 } 304 305 /*# sourceMappingURL=style-index.css.map*/ 1 :root{--solution-compress-pdf-primary-color:#4f46e5;--solution-compress-pdf-secondary-color:#eef2ff;--solution-compress-pdf-tertiary-color:#000;--solution-compress-pdf-background-color:#fff;--solution-compress-pdf-border-color:#e5e7eb;--solution-compress-pdf-input-border-color:#d1d5db;--solution-compress-pdf-shadow-color:hsla(210,8%,62%,.2);--solution-compress-pdf-btn-shadow-color:rgba(0,0,0,.05);--solution-compress-pdf-dropdown-bg-color:#fff;--solution-compress-pdf-dropdown-shadow-color-1:rgba(0,0,0,.1);--solution-compress-pdf-dropdown-shadow-color-2:rgba(0,0,0,.1)}.solution__compress-pdf .solution__container-wrapper{color:var(--solution-compress-pdf-tertiary-color);display:flex;flex-direction:column;gap:1rem;padding:1rem}.solution__compress-pdf .solution__container{background-color:var(--solution-compress-pdf-background-color);border:1px solid var(--solution-compress-pdf-border-color);border-radius:.75rem;box-shadow:var(--solution-compress-pdf-shadow-color) 0 8px 24px;display:flex;flex-direction:column;gap:1rem;min-height:380px;padding:1.5rem 1.5rem .5rem;position:relative}.solution__compress-pdf .solution__header{font-size:1.25rem;font-weight:500;letter-spacing:.05em}.solution__compress-pdf .solution__content{display:grid;flex-grow:1}.solution__compress-pdf .solution__form{display:flex;flex-direction:column;gap:1rem}.solution__compress-pdf .solution__label{display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.3rem;white-space:nowrap;width:100%}.solution__compress-pdf .solution__hint{color:var(--solution-compress-pdf-primary-color);font-size:.75rem;font-weight:500;white-space:wrap}.solution__compress-pdf .solution__input{border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;font-size:1rem;line-height:32px;outline:1px solid transparent;outline-offset:-1px;padding:.25rem .5rem}.solution__compress-pdf .solution__file-input::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color);border:none;border-radius:.75rem;color:var(--solution-compress-pdf-primary-color);cursor:pointer;font-weight:500;margin-right:1rem;padding:.5rem 1rem}.solution__compress-pdf .solution__file-input:hover::-webkit-file-upload-button{background-color:var(--solution-compress-pdf-secondary-color)}.solution__compress-pdf .solution__btn{align-items:center;background:var(--solution-compress-pdf-secondary-color);border:none;border-radius:1rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-btn-shadow-color);color:var(--solution-compress-pdf-primary-color);cursor:pointer;display:inline-flex;font-weight:600;gap:.5rem;justify-content:center;padding:.5rem 1rem}.solution__compress-pdf .solution__btn:hover{filter:brightness(.98)}.solution__compress-pdf .solution__btn .dashicons{font-size:1.2rem;vertical-align:middle}.solution__compress-pdf .solution__dropdown-wrapper{position:relative}.solution__compress-pdf .solution__dropdown{background-color:transparent;border-radius:.75rem;box-shadow:none;max-height:15rem;overflow:visible;position:relative;width:100%;z-index:10}.solution__compress-pdf .solution__dropdown--hidden{display:none}.solution__compress-pdf .solution__loading-section{display:none;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.solution__compress-pdf .solution__loading-container{align-items:center;display:flex;gap:1rem;justify-content:center;transition:2s ease}.solution__compress-pdf .solution__download-section{align-items:center;display:flex;flex-direction:column;gap:2rem;height:100%;justify-content:center}.solution__compress-pdf .solution__download-section:last-child{margin-top:auto}.solution__compress-pdf .solution__download-container{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:1rem;justify-content:center}.solution__compress-pdf .solution__download-file-container{display:flex;flex-wrap:wrap;gap:1rem;justify-content:flex-start}.solution__compress-pdf .solution__download-file-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.solution__compress-pdf .solution__title-text{font-weight:600}.solution__compress-pdf .solution__text{font-weight:500}.solution__compress-pdf .solution__provided-text{display:flex;font-size:.7rem;justify-content:center;margin-top:.5rem}.solution__compress-pdf .solution__error-section{align-self:center;display:flex;flex-direction:column;justify-self:center}.solution__compress-pdf .solution__dot{animation:move .6s ease infinite;background:var(--solution-compress-pdf-tertiary-color);border-radius:50%;height:.65em;width:.65em}.solution__compress-pdf .solution__link{color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution__select{display:flex;flex-direction:column;gap:.3rem;position:relative}.solution__compress-pdf .solution__select .solution__select-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%234f46e5%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z%27/%3E%3C/svg%3E");background-position:right 1rem center;background-repeat:no-repeat;background-size:1rem;border:1px solid var(--solution-compress-pdf-input-border-color);border-radius:.375rem;box-shadow:0 1px 2px 0 var(--solution-compress-pdf-shadow-color);color:var(--solution-compress-pdf-tertiary-color);cursor:pointer;height:42px;padding:0 .5rem}.solution__compress-pdf .solution__select .solution__select-input:focus{box-shadow:0 0 0 3px var(--solution-compress-pdf-secondary-color);outline:1px solid var(--solution-compress-pdf-primary-color)}.solution__compress-pdf .solution__select .solution__select-input option{padding:1rem}.solution__compress-pdf .solution__select .solution__select-input option[disabled]{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input:required:invalid{color:var(--solution-compress-pdf-input-border-color)}.solution__compress-pdf .solution__select .solution__select-input option:not([disabled]){color:var(--solution-compress-pdf-tertiary-color)}.solution__compress-pdf .solution_dropdown button{width:100%}.solution__compress-pdf .solution__dropdown-content{background-color:#fff;border-radius:10px;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;flex-direction:column;left:50%;margin-top:3px;max-height:150px;min-width:100%;overflow:auto;padding:.5rem 0;position:absolute;top:100%;transform:translate(-50%);z-index:10}.solution__compress-pdf .solution__dropdown-content label{display:block;margin-top:10px;padding:0 1rem}.solution__compress-pdf .solution__dropdown-button{min-width:100%}.solution__compress-pdf .solution__dropdown-button:focus+.solution__dropdown-content,.solution__compress-pdf .solution__dropdown-content:hover{display:flex}.solution__compress-pdf .solution__group{display:flex;flex-wrap:wrap;gap:10px}.solution__compress-pdf .solution__group>div,.solution__compress-pdf .solution__group>label{flex:1}.solution__compress-pdf .irs--flat .irs-bar,.solution__compress-pdf .irs--flat .irs-from,.solution__compress-pdf .irs--flat .irs-handle>i:first-child,.solution__compress-pdf .irs--flat .irs-single,.solution__compress-pdf .irs--flat .irs-to{background-color:var(--solution-compress-pdf-primary-color)!important}.solution__compress-pdf .irs--flat .irs-from:before,.solution__compress-pdf .irs--flat .irs-single:before,.solution__compress-pdf .irs--flat .irs-to:before{border-top-color:var(--solution-compress-pdf-primary-color)!important}@keyframes move{0%{transform:translateX(50%)}50%{transform:translateX(-50%)}to{transform:translateX(50%)}} -
compress-pdf/trunk/build/view.asset.php
r3222633 r3260510 1 <?php return array('dependencies' => array(), 'version' => '5 7c8bb3aa93ff728e717');1 <?php return array('dependencies' => array(), 'version' => '51de7ef2e55ac9559d9a'); -
compress-pdf/trunk/build/view.js
r3222633 r3260510 1 /******/ (() => { // webpackBootstrap 2 /*!*********************!*\ 3 !*** ./src/view.js ***! 4 \*********************/ 5 document.querySelectorAll('.solution__compress-pdf .solution__form').forEach(form => { 6 form.addEventListener('submit', function (event) { 7 event.preventDefault(); 8 const formId = form.getAttribute('id'); 9 const fileInput = form.querySelector('[name="file"]'); 10 const dpiInput = form.querySelector('[name="dpi"]'); 11 const imageQualityInput = form.querySelector('[name="image-quality"]'); 12 const loadingSection = document.getElementById(`loadingSection_${formId}`); 13 const errorSection = document.getElementById(`errorSection_${formId}`); 14 const resultMessage = document.getElementById(`resultMessage_${formId}`); 15 const downloadSection = document.getElementById(`downloadSection_${formId}`); 16 17 // Hide the form, show the loading indicator, hide error and download sections 18 form.style.display = 'none'; 19 loadingSection.style.display = 'flex'; 20 errorSection.style.display = 'none'; // Hide error section 21 downloadSection.style.display = 'none'; 22 const formData = new FormData(); 23 Array.from(fileInput.files).forEach((file, index) => { 24 formData.append(`file[${index}]`, file); 25 }); 26 formData.append('dpi', dpiInput.value); 27 formData.append('imageQuality', imageQualityInput.value); 28 formData.append('compressPDFFormNonce', wpApiSettings.compressPDFNonce); 29 fetch(`${wpApiSettings.root}compress-pdf/v1/send-data`, { 30 method: 'POST', 31 body: formData 32 }).then(response => response.json()).then(data => { 33 if (data.id) { 34 pollStatus(data.id, formId); 35 } else { 36 loadingSection.style.display = 'none'; 37 errorSection.style.display = 'flex'; 38 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 39 } 40 }).catch(() => { 41 loadingSection.style.display = 'none'; 42 errorSection.style.display = 'flex'; 43 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 44 }); 45 }); 46 47 // Add event listener for restart buttons 48 const restartDownloadBtn = document.getElementById(`restartDownloadBtn_${form.id}`); 49 const restartErrorBtn = document.getElementById(`restartErrorBtn_${form.id}`); 50 51 // Function to restart the process and reset the form 52 function resetForm() { 53 form.reset(); 54 form.style.display = 'flex'; 55 document.getElementById(`loadingSection_${form.id}`).style.display = 'none'; // Hide loading 56 document.getElementById(`downloadSection_${form.id}`).style.display = 'none'; // Hide download 57 document.getElementById(`errorSection_${form.id}`).style.display = 'none'; // Hide error section 58 } 59 if (restartDownloadBtn) { 60 restartDownloadBtn.addEventListener('click', resetForm); 61 } 62 if (restartErrorBtn) { 63 restartErrorBtn.addEventListener('click', resetForm); 64 } 65 }); 66 document.querySelectorAll('.solution__compress-pdf .solution__range-linked').forEach(input => { 67 const min = input.getAttribute('min'); 68 const max = input.getAttribute('max'); 69 const value = input.value; 70 ionRangeSlider(input, { 71 min: min, 72 max: max, 73 from: value, 74 step: 1, 75 grid: true, 76 grid_num: 5 77 }); 78 }); 79 function pollStatus(id, formId) { 80 const loadingSection = document.getElementById(`loadingSection_${formId}`); 81 const errorSection = document.getElementById(`errorSection_${formId}`); 82 const resultMessage = document.getElementById(`resultMessage_${formId}`); 83 const downloadSection = document.getElementById(`downloadSection_${formId}`); 84 const downloadFilesContainer = document.getElementById(`downloadFilesContainer_${formId}`); 85 function checkStatus() { 86 fetch(`${wpApiSettings.root}compress-pdf/v1/status/${id}`).then(response => response.json()).then(data => { 87 if (data.status === 'done') { 88 loadingSection.style.display = 'none'; 89 downloadFilesContainer.innerHTML = ''; // Clear previous downloads 90 91 if (data.output && data.output.files && data.output.files.length > 0) { 92 data.output.files.forEach(file => { 93 // Create download button 94 const downloadButton = document.createElement('button'); 95 downloadButton.type = 'button'; 96 downloadButton.className = 'solution__btn'; 97 downloadButton.innerHTML = ` 98 <div class="dashicons dashicons-download"></div> 99 <span class="solution__download-file-name">${file.name}</span> 100 `; 101 102 // Set download functionality 103 downloadButton.addEventListener('click', event => { 104 event.preventDefault(); 105 const anchor = document.createElement('a'); 106 anchor.href = file.path; 107 anchor.target = '_blank'; 108 document.body.appendChild(anchor); 109 anchor.click(); 110 document.body.removeChild(anchor); 111 }); 112 113 // Append elements to the container 114 const fileContainer = document.createElement('div'); 115 fileContainer.className = 'solution__download-file-container'; 116 fileContainer.appendChild(downloadButton); 117 downloadFilesContainer.appendChild(fileContainer); 118 }); 119 downloadSection.style.display = 'flex'; // Show download section 120 } else { 121 errorSection.style.display = 'flex'; 122 resultMessage.innerText = 'No files available for download.'; 123 } 124 } else if (data.status === 'error') { 125 throw new Error('Processing failed: ' + data.message); 126 } else { 127 setTimeout(checkStatus, 500); 128 } 129 }).catch(() => { 130 loadingSection.style.display = 'none'; 131 errorSection.style.display = 'flex'; 132 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 133 }); 134 } 135 checkStatus(); 136 } 137 /******/ })() 138 ; 139 //# sourceMappingURL=view.js.map 1 document.querySelectorAll(".solution__compress-pdf .solution__form").forEach((e=>{e.addEventListener("submit",(function(t){t.preventDefault();const n=e.getAttribute("id"),o=e.querySelector('[name="file"]'),d=e.querySelector('[name="dpi"]'),s=e.querySelector('[name="image-quality"]'),l=document.getElementById(`loadingSection_${n}`),i=document.getElementById(`errorSection_${n}`),a=document.getElementById(`resultMessage_${n}`),r=document.getElementById(`downloadSection_${n}`);e.style.display="none",l.style.display="flex",i.style.display="none",r.style.display="none";const c=new FormData;Array.from(o.files).forEach(((e,t)=>{c.append(`file[${t}]`,e)})),c.append("dpi",d.value),c.append("imageQuality",s.value),c.append("compressPDFFormNonce",wpApiSettingsCompressPDF.compressPDFNonce),fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/send-data`,{method:"POST",body:c}).then((e=>e.json())).then((e=>{e.id?function(e,t){const n=document.getElementById(`loadingSection_${t}`),o=document.getElementById(`errorSection_${t}`),d=document.getElementById(`resultMessage_${t}`),s=document.getElementById(`downloadSection_${t}`),l=document.getElementById(`downloadFilesContainer_${t}`);!function t(){fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/status/${e}`,{method:"GET",headers:{"X-WP-Nonce":wpApiSettingsCompressPDF.compressPDFNonce,"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{if("done"===e.status)n.style.display="none",l.innerHTML="",e.output&&e.output.files&&e.output.files.length>0?(e.output.files.forEach((e=>{const t=document.createElement("button");t.type="button",t.className="solution__btn",t.innerHTML=`\n <div class="dashicons dashicons-download"></div>\n <span class="solution__download-file-name">${e.name}</span>\n `,t.addEventListener("click",(t=>{t.preventDefault();const n=document.createElement("a");n.href=e.path,n.target="_blank",document.body.appendChild(n),n.click(),document.body.removeChild(n)}));const n=document.createElement("div");n.className="solution__download-file-container",n.appendChild(t),l.appendChild(n)})),s.style.display="flex"):(o.style.display="flex",d.innerText="No files available for download.");else{if("error"===e.status)throw new Error("Processing failed: "+e.message);setTimeout(t,500)}})).catch((()=>{n.style.display="none",o.style.display="flex",d.innerText="An unexpected error occurred. Please try again."}))}()}(e.id,n):(l.style.display="none",i.style.display="flex",a.innerText="An unexpected error occurred. Please try again.")})).catch((()=>{l.style.display="none",i.style.display="flex",a.innerText="An unexpected error occurred. Please try again."}))}));const t=document.getElementById(`restartDownloadBtn_${e.id}`),n=document.getElementById(`restartErrorBtn_${e.id}`);function o(){e.reset(),e.style.display="flex",document.getElementById(`loadingSection_${e.id}`).style.display="none",document.getElementById(`downloadSection_${e.id}`).style.display="none",document.getElementById(`errorSection_${e.id}`).style.display="none"}t&&t.addEventListener("click",o),n&&n.addEventListener("click",o)})),document.querySelectorAll(".solution__compress-pdf .solution__range-linked").forEach((e=>{const t=e.getAttribute("min"),n=e.getAttribute("max"),o=e.value;ionRangeSlider(e,{min:t,max:n,from:o,step:1,grid:!0,grid_num:5})})); -
compress-pdf/trunk/compress-pdf.php
r3232406 r3260510 5 5 * Requires at least: 6.6 6 6 * Requires PHP: 7.2 7 * Version: 1.0. 07 * Version: 1.0.1 8 8 * Author: Cross Service Solutions 9 9 * License: GPL-2.0-or-later … … 104 104 function cross_service_solutions_compress_pdf_localize_script() { 105 105 // Localize the script registered by the viewScript in block.json 106 wp_localize_script('create-block-compress-pdf-view-script', 'wpApiSettings ', array(106 wp_localize_script('create-block-compress-pdf-view-script', 'wpApiSettingsCompressPDF', array( 107 107 'root' => esc_url_raw(rest_url()), 108 108 'compressPDFNonce' => wp_create_nonce('compress_pdf_form_nonce_action'), -
compress-pdf/trunk/includes/process-machine.php
r3222633 r3260510 126 126 // Check status of processing task 127 127 function cross_service_solutions_compress_pdf_check_status($request) { 128 $nonce = $request->get_header('X-WP-Nonce'); 129 if (!$nonce || !wp_verify_nonce($nonce, 'compress_pdf_form_nonce_action')) { 130 return new WP_Error('nonce_invalid', 'Nonce verification failed', array( 131 'status' => 403, 132 'message' => 'The provided nonce is invalid or expired. Please refresh and try again.' 133 )); 134 } 135 128 136 $api_key = esc_attr(get_option('cross_service_solutions_api_key')); 129 137 $id = sanitize_text_field($request['id']); -
compress-pdf/trunk/languages/compress-pdf.pot
r3250027 r3260510 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Compress PDF 1.0. 0\n"5 "Project-Id-Version: Compress PDF 1.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/compress-pdf\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
compress-pdf/trunk/readme.txt
r3250027 r3260510 5 5 Requires at least: 5.0 6 6 Tested up to: 6.7 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 Requires PHP: 7.2 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 1.0.1 = 96 * Implemented nonce validation for polling status GET request. 97 * Ensuring the global object in JavaScript is unique. 98 95 99 = 1.0.0 = 96 100 * Initial release of the Compress PDF plugin. -
compress-pdf/trunk/src/block.json
r3222633 r3260510 3 3 "apiVersion": 3, 4 4 "name": "create-block/compress-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Compress Pdf", 7 7 "category": "widgets", -
compress-pdf/trunk/src/view.js
r3222633 r3260510 33 33 formData.append('dpi', dpiInput.value); 34 34 formData.append('imageQuality', imageQualityInput.value); 35 formData.append('compressPDFFormNonce', wpApiSettings .compressPDFNonce);35 formData.append('compressPDFFormNonce', wpApiSettingsCompressPDF.compressPDFNonce); 36 36 37 fetch(`${wpApiSettings .root}compress-pdf/v1/send-data`, {37 fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/send-data`, { 38 38 method: 'POST', 39 39 body: formData, … … 111 111 112 112 function checkStatus() { 113 fetch(`${wpApiSettings.root}compress-pdf/v1/status/${id}`) 113 fetch(`${wpApiSettingsCompressPDF.root}compress-pdf/v1/status/${id}`, { 114 method: 'GET', 115 headers: { 116 'X-WP-Nonce': wpApiSettingsCompressPDF.compressPDFNonce, 117 'Content-Type': 'application/json' 118 } 119 }) 114 120 .then((response) => response.json()) 115 121 .then((data) => {
Note: See TracChangeset
for help on using the changeset viewer.