Changeset 3311892
- Timestamp:
- 06/15/2025 12:58:10 PM (10 months ago)
- Location:
- flatten-pdf
- Files:
-
- 2 deleted
- 22 edited
- 1 copied
-
tags/1.0.1/trunk (copied) (copied from flatten-pdf/trunk)
-
tags/1.0.1/trunk/build/block.json (modified) (1 diff)
-
tags/1.0.1/trunk/build/index-rtl.css (modified) (1 diff)
-
tags/1.0.1/trunk/build/index.asset.php (modified) (1 diff)
-
tags/1.0.1/trunk/build/index.js (modified) (1 diff)
-
tags/1.0.1/trunk/build/style-index-rtl.css (modified) (1 diff)
-
tags/1.0.1/trunk/build/view.asset.php (modified) (1 diff)
-
tags/1.0.1/trunk/build/view.js (modified) (1 diff)
-
tags/1.0.1/trunk/build/view.js.map (deleted)
-
tags/1.0.1/trunk/flatten-pdf.php (modified) (1 diff)
-
tags/1.0.1/trunk/languages/flatten-pdf.pot (modified) (1 diff)
-
tags/1.0.1/trunk/readme.txt (modified) (1 diff)
-
tags/1.0.1/trunk/src/block.json (modified) (1 diff)
-
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.js (modified) (1 diff)
-
trunk/build/style-index-rtl.css (modified) (1 diff)
-
trunk/build/view.asset.php (modified) (1 diff)
-
trunk/build/view.js (modified) (1 diff)
-
trunk/build/view.js.map (deleted)
-
trunk/flatten-pdf.php (modified) (1 diff)
-
trunk/languages/flatten-pdf.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/block.json (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flatten-pdf/tags/1.0.1/trunk/build/block.json
r3294618 r3311892 3 3 "apiVersion": 3, 4 4 "name": "create-block/flatten-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Flatten Pdf", 7 7 "category": "widgets", -
flatten-pdf/tags/1.0.1/trunk/build/index-rtl.css
r3294618 r3311892 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__flatten-pdf { 5 margin: 1rem; 6 } 1 .solution__flatten-pdf{margin:1rem} -
flatten-pdf/tags/1.0.1/trunk/build/index.asset.php
r3294618 r3311892 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => '0 31c0edb2f7d39befe01');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => '0afc5ccba0e5e1ccc682'); -
flatten-pdf/tags/1.0.1/trunk/build/index.js
r3294618 r3311892 1 (()=>{"use strict";var e,t={354:()=>{const e=window.wp.blocks,t=window.wp.element,i=window.wp.i18n,n=window.ReactJSXRuntime,l=(0,t.createElement)("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("rect",{width:"32.0014",height:"32.0014",rx:"16.0007",fill:"#E5DBFF"}),(0,t.createElement)("path",{d:"M10.6418 20.331V18.6012H21.3595V20.331H10.6418ZM9.07568 22.9257V21.1959H22.9257V22.9257H9.07568ZM12.5353 17.7363V16.0065H19.4661V17.7363H12.5353ZM16.0065 15.1416L12.5469 11.6821L13.7625 10.4665L15.1533 11.8574V9.07568H16.8831V11.8457L18.2739 10.4548L19.4895 11.6704L16.0299 15.1299L16.0065 15.1416Z",fill:"#5A3BB2"})),s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/flatten-pdf","version":"1.0. 0","title":"Flatten Pdf","category":"widgets","description":"Effortlessly merge layers and annotations into a single, streamlined PDF with Flatten PDF. Make sharing, storing, and viewing your documents simple and hassle-free while preserving layout integrity and compatibility.","example":{},"supports":{"html":false},"textdomain":"flatten-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)(s,{icon:l,edit:function(){return(0,t.createElement)("div",null,(0,n.jsx)("div",{className:"solution__flatten-pdf",children:(0,n.jsx)("div",{className:"solution__container__wrapper",children:(0,n.jsxs)("div",{className:"solution__container",children:[(0,n.jsx)("div",{className:"solution__header",children:(0,i.__)("Flatten PDF","flatten-pdf")}),(0,n.jsxs)("div",{className:"solution__form",children:[(0,n.jsxs)("label",{htmlFor:"file",className:"solution__label",children:[(0,n.jsx)("span",{children:(0,i.__)("File:","flatten-pdf")}),(0,n.jsx)("input",{type:"file",id:"file",name:"file",required:!0,className:"solution__file-input",disabled:!0})]}),(0,n.jsx)("button",{disabled:!0,className:"solution__btn",children:(0,i.__)("Submit","flatten-pdf")})]})]})})}))}})}},i={};function n(e){var l=i[e];if(void 0!==l)return l.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,i,l,s)=>{if(!i){var r=1/0;for(c=0;c<e.length;c++){i=e[c][0],l=e[c][1],s=e[c][2];for(var a=!0,o=0;o<i.length;o++)(!1&s||r>=s)&&Object.keys(n.O).every((e=>n.O[e](i[o])))?i.splice(o--,1):(a=!1,s<r&&(r=s));if(a){e.splice(c--,1);var d=l();void 0!==d&&(t=d)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,l,s]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var l,s,r=i[0],a=i[1],o=i[2],d=0;if(r.some((t=>0!==e[t]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(o)var c=o(n)}for(t&&t(i);d<r.length;d++)s=r[d],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(c)},i=self.webpackChunk=self.webpackChunk||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var l=n.O(void 0,[350],(()=>n(354)));l=n.O(l)})();1 (()=>{"use strict";var e,t={354:()=>{const e=window.wp.blocks,t=window.wp.element,i=window.wp.i18n,n=window.ReactJSXRuntime,l=(0,t.createElement)("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("rect",{width:"32.0014",height:"32.0014",rx:"16.0007",fill:"#E5DBFF"}),(0,t.createElement)("path",{d:"M10.6418 20.331V18.6012H21.3595V20.331H10.6418ZM9.07568 22.9257V21.1959H22.9257V22.9257H9.07568ZM12.5353 17.7363V16.0065H19.4661V17.7363H12.5353ZM16.0065 15.1416L12.5469 11.6821L13.7625 10.4665L15.1533 11.8574V9.07568H16.8831V11.8457L18.2739 10.4548L19.4895 11.6704L16.0299 15.1299L16.0065 15.1416Z",fill:"#5A3BB2"})),s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/flatten-pdf","version":"1.0.1","title":"Flatten Pdf","category":"widgets","description":"Effortlessly merge layers and annotations into a single, streamlined PDF with Flatten PDF. Make sharing, storing, and viewing your documents simple and hassle-free while preserving layout integrity and compatibility.","example":{},"supports":{"html":false},"textdomain":"flatten-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)(s,{icon:l,edit:function(){return(0,t.createElement)("div",null,(0,n.jsx)("div",{className:"solution__flatten-pdf",children:(0,n.jsx)("div",{className:"solution__container__wrapper",children:(0,n.jsxs)("div",{className:"solution__container",children:[(0,n.jsx)("div",{className:"solution__header",children:(0,i.__)("Flatten PDF","flatten-pdf")}),(0,n.jsxs)("div",{className:"solution__form",children:[(0,n.jsxs)("label",{htmlFor:"file",className:"solution__label",children:[(0,n.jsx)("span",{children:(0,i.__)("File:","flatten-pdf")}),(0,n.jsx)("input",{type:"file",id:"file",name:"file",required:!0,className:"solution__file-input",disabled:!0})]}),(0,n.jsx)("button",{disabled:!0,className:"solution__btn",children:(0,i.__)("Submit","flatten-pdf")})]})]})})}))}})}},i={};function n(e){var l=i[e];if(void 0!==l)return l.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,i,l,s)=>{if(!i){var r=1/0;for(c=0;c<e.length;c++){i=e[c][0],l=e[c][1],s=e[c][2];for(var a=!0,o=0;o<i.length;o++)(!1&s||r>=s)&&Object.keys(n.O).every((e=>n.O[e](i[o])))?i.splice(o--,1):(a=!1,s<r&&(r=s));if(a){e.splice(c--,1);var d=l();void 0!==d&&(t=d)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,l,s]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var l,s,r=i[0],a=i[1],o=i[2],d=0;if(r.some((t=>0!==e[t]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(o)var c=o(n)}for(t&&t(i);d<r.length;d++)s=r[d],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(c)},i=self.webpackChunk=self.webpackChunk||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var l=n.O(void 0,[350],(()=>n(354)));l=n.O(l)})(); -
flatten-pdf/tags/1.0.1/trunk/build/style-index-rtl.css
r3294618 r3311892 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-flatten-pdf-primary-color: #4f46e5; 6 --solution-flatten-pdf-secondary-color: #eef2ff; 7 --solution-flatten-pdf-tertiary-color: #000; 8 --solution-flatten-pdf-background-color: #fff; 9 --solution-flatten-pdf-border-color: #e5e7eb; 10 --solution-flatten-pdf-input-border-color: #d1d5db; 11 --solution-flatten-pdf-shadow-color: rgba(149, 157, 165, 0.2); 12 --solution-flatten-pdf-btn-shadow-color: rgba(0, 0, 0, 0.05); 13 --solution-flatten-pdf-dropdown-bg-color: #fff; 14 --solution-flatten-pdf-dropdown-shadow-color-1: rgba(0, 0, 0, 0.1); 15 --solution-flatten-pdf-dropdown-shadow-color-2: rgba(0, 0, 0, 0.1); 16 } 17 18 .solution__flatten-pdf .solution__container-wrapper { 19 padding: 1rem; 20 display: flex; 21 flex-direction: column; 22 gap: 1rem; 23 color: var(--solution-flatten-pdf-tertiary-color); 24 } 25 .solution__flatten-pdf .solution__container { 26 box-shadow: var(--solution-flatten-pdf-shadow-color) 0 8px 24px; 27 border: 1px solid var(--solution-flatten-pdf-border-color); 28 background-color: var(--solution-flatten-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: 180px; 35 gap: 1rem; 36 } 37 .solution__flatten-pdf .solution__header { 38 font-size: 1.25rem; 39 letter-spacing: 0.05em; 40 font-weight: 500; 41 } 42 .solution__flatten-pdf .solution__content { 43 flex-grow: 1; 44 display: grid; 45 } 46 .solution__flatten-pdf .solution__form { 47 display: flex; 48 flex-direction: column; 49 gap: 1rem; 50 } 51 .solution__flatten-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__flatten-pdf .solution__hint { 61 font-size: 0.75rem; 62 font-weight: 500; 63 color: var(--solution-flatten-pdf-primary-color); 64 white-space: wrap; 65 } 66 .solution__flatten-pdf .solution__input { 67 border: 1px solid var(--solution-flatten-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__flatten-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-flatten-pdf-secondary-color); 81 color: var(--solution-flatten-pdf-primary-color); 82 font-weight: 500; 83 cursor: pointer; 84 } 85 .solution__flatten-pdf .solution__file-input:hover::-webkit-file-upload-button { 86 background-color: var(--solution-flatten-pdf-secondary-color); 87 } 88 .solution__flatten-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-flatten-pdf-btn-shadow-color); 94 background: var(--solution-flatten-pdf-secondary-color); 95 color: var(--solution-flatten-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__flatten-pdf .solution__btn:hover { 103 filter: brightness(0.98); 104 } 105 .solution__flatten-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__flatten-pdf .solution__dropdown-wrapper { 110 position: relative; 111 } 112 .solution__flatten-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__flatten-pdf .solution__dropdown--hidden { 123 display: none; 124 } 125 .solution__flatten-pdf .solution__loading-section { 126 display: none; 127 position: absolute; 128 top: 50%; 129 right: 50%; 130 transform: translate(50%, -50%); 131 } 132 .solution__flatten-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__flatten-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__flatten-pdf .solution__download-section:last-child { 148 margin-top: auto; 149 } 150 .solution__flatten-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__flatten-pdf .solution__download-file-container { 159 display: flex; 160 flex-wrap: wrap; 161 justify-content: flex-start; 162 gap: 1rem; 163 } 164 .solution__flatten-pdf .solution__download-file-name { 165 white-space: nowrap; 166 overflow: hidden; 167 text-overflow: ellipsis; 168 max-width: 12rem; 169 } 170 .solution__flatten-pdf .solution__title-text { 171 font-weight: 600; 172 } 173 .solution__flatten-pdf .solution__text { 174 font-weight: 500; 175 } 176 .solution__flatten-pdf .solution__provided-text { 177 display: flex; 178 justify-content: center; 179 font-size: 0.7rem; 180 margin-top: 0.5rem; 181 } 182 .solution__flatten-pdf .solution__error-section { 183 display: flex; 184 flex-direction: column; 185 justify-self: center; 186 align-self: center; 187 } 188 .solution__flatten-pdf .solution__dot { 189 background: var(--solution-flatten-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__flatten-pdf .solution__link { 196 color: var(--solution-flatten-pdf-tertiary-color); 197 } 198 .solution__flatten-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__flatten-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-flatten-pdf-input-border-color); 211 color: var(--solution-flatten-pdf-tertiary-color); 212 box-shadow: 0 1px 2px 0 var(--solution-flatten-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__flatten-pdf .solution__select .solution__select-input:focus { 224 outline: 1px solid var(--solution-flatten-pdf-primary-color); 225 box-shadow: 0 0 0 3px var(--solution-flatten-pdf-secondary-color); 226 } 227 .solution__flatten-pdf .solution__select .solution__select-input option { 228 padding: 1rem; 229 } 230 .solution__flatten-pdf .solution__select .solution__select-input option[disabled] { 231 color: var(--solution-flatten-pdf-input-border-color); 232 } 233 .solution__flatten-pdf .solution__select .solution__select-input:required:invalid { 234 color: var(--solution-flatten-pdf-input-border-color); 235 } 236 .solution__flatten-pdf .solution__select .solution__select-input option:not([disabled]) { 237 color: var(--solution-flatten-pdf-tertiary-color); 238 } 239 .solution__flatten-pdf .solution_dropdown button { 240 width: 100%; 241 } 242 .solution__flatten-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__flatten-pdf .solution__dropdown-content label { 260 display: block; 261 margin-top: 10px; 262 padding: 0 1rem; 263 } 264 .solution__flatten-pdf .solution__dropdown-button { 265 min-width: 100%; 266 } 267 .solution__flatten-pdf .solution__dropdown-content:hover, 268 .solution__flatten-pdf .solution__dropdown-button:focus + .solution__dropdown-content { 269 display: flex; 270 } 271 .solution__flatten-pdf .solution__group { 272 display: flex; 273 flex-wrap: wrap; 274 gap: 10px; 275 } 276 .solution__flatten-pdf .solution__group > div, 277 .solution__flatten-pdf .solution__group > label { 278 flex: 1; 279 } 280 281 @keyframes move { 282 0% { 283 transform: translateX(-50%); 284 } 285 50% { 286 transform: translateX(50%); 287 } 288 100% { 289 transform: translateX(-50%); 290 } 291 } 1 :root{--solution-flatten-pdf-primary-color:#4f46e5;--solution-flatten-pdf-secondary-color:#eef2ff;--solution-flatten-pdf-tertiary-color:#000;--solution-flatten-pdf-background-color:#fff;--solution-flatten-pdf-border-color:#e5e7eb;--solution-flatten-pdf-input-border-color:#d1d5db;--solution-flatten-pdf-shadow-color:hsla(210,8%,62%,.2);--solution-flatten-pdf-btn-shadow-color:rgba(0,0,0,.05);--solution-flatten-pdf-dropdown-bg-color:#fff;--solution-flatten-pdf-dropdown-shadow-color-1:rgba(0,0,0,.1);--solution-flatten-pdf-dropdown-shadow-color-2:rgba(0,0,0,.1)}.solution__flatten-pdf .solution__container-wrapper{color:var(--solution-flatten-pdf-tertiary-color);display:flex;flex-direction:column;gap:1rem;padding:1rem}.solution__flatten-pdf .solution__container{background-color:var(--solution-flatten-pdf-background-color);border:1px solid var(--solution-flatten-pdf-border-color);border-radius:.75rem;box-shadow:var(--solution-flatten-pdf-shadow-color) 0 8px 24px;display:flex;flex-direction:column;gap:1rem;min-height:180px;padding:1.5rem 1.5rem .5rem;position:relative}.solution__flatten-pdf .solution__header{font-size:1.25rem;font-weight:500;letter-spacing:.05em}.solution__flatten-pdf .solution__content{display:grid;flex-grow:1}.solution__flatten-pdf .solution__form{display:flex;flex-direction:column;gap:1rem}.solution__flatten-pdf .solution__label{display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.3rem;white-space:nowrap;width:100%}.solution__flatten-pdf .solution__hint{color:var(--solution-flatten-pdf-primary-color);font-size:.75rem;font-weight:500;white-space:wrap}.solution__flatten-pdf .solution__input{border:1px solid var(--solution-flatten-pdf-input-border-color);border-radius:.375rem;font-size:1rem;line-height:32px;outline:1px solid transparent;outline-offset:-1px;padding:.25rem .5rem}.solution__flatten-pdf .solution__file-input::-webkit-file-upload-button{background-color:var(--solution-flatten-pdf-secondary-color);border:none;border-radius:.75rem;color:var(--solution-flatten-pdf-primary-color);cursor:pointer;font-weight:500;margin-left:1rem;padding:.5rem 1rem}.solution__flatten-pdf .solution__file-input:hover::-webkit-file-upload-button{background-color:var(--solution-flatten-pdf-secondary-color)}.solution__flatten-pdf .solution__btn{align-items:center;background:var(--solution-flatten-pdf-secondary-color);border:none;border-radius:1rem;box-shadow:0 1px 2px 0 var(--solution-flatten-pdf-btn-shadow-color);color:var(--solution-flatten-pdf-primary-color);cursor:pointer;display:inline-flex;font-weight:600;gap:.5rem;justify-content:center;padding:.5rem 1rem}.solution__flatten-pdf .solution__btn:hover{filter:brightness(.98)}.solution__flatten-pdf .solution__btn .dashicons{font-size:1.2rem;vertical-align:middle}.solution__flatten-pdf .solution__dropdown-wrapper{position:relative}.solution__flatten-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__flatten-pdf .solution__dropdown--hidden{display:none}.solution__flatten-pdf .solution__loading-section{display:none;right:50%;position:absolute;top:50%;transform:translate(50%,-50%)}.solution__flatten-pdf .solution__loading-container{align-items:center;display:flex;gap:1rem;justify-content:center;transition:2s ease}.solution__flatten-pdf .solution__download-section{align-items:center;display:flex;flex-direction:column;gap:2rem;height:100%;justify-content:center}.solution__flatten-pdf .solution__download-section:last-child{margin-top:auto}.solution__flatten-pdf .solution__download-container{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:1rem;justify-content:center}.solution__flatten-pdf .solution__download-file-container{display:flex;flex-wrap:wrap;gap:1rem;justify-content:flex-start}.solution__flatten-pdf .solution__download-file-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.solution__flatten-pdf .solution__title-text{font-weight:600}.solution__flatten-pdf .solution__text{font-weight:500}.solution__flatten-pdf .solution__provided-text{display:flex;font-size:.7rem;justify-content:center;margin-top:.5rem}.solution__flatten-pdf .solution__error-section{align-self:center;display:flex;flex-direction:column;justify-self:center}.solution__flatten-pdf .solution__dot{animation:move .6s ease infinite;background:var(--solution-flatten-pdf-tertiary-color);border-radius:50%;height:.65em;width:.65em}.solution__flatten-pdf .solution__link{color:var(--solution-flatten-pdf-tertiary-color)}.solution__flatten-pdf .solution__select{display:flex;flex-direction:column;gap:.3rem;position:relative}.solution__flatten-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-flatten-pdf-input-border-color);border-radius:.375rem;box-shadow:0 1px 2px 0 var(--solution-flatten-pdf-shadow-color);color:var(--solution-flatten-pdf-tertiary-color);cursor:pointer;height:42px;padding:0 .5rem}.solution__flatten-pdf .solution__select .solution__select-input:focus{box-shadow:0 0 0 3px var(--solution-flatten-pdf-secondary-color);outline:1px solid var(--solution-flatten-pdf-primary-color)}.solution__flatten-pdf .solution__select .solution__select-input option{padding:1rem}.solution__flatten-pdf .solution__select .solution__select-input option[disabled]{color:var(--solution-flatten-pdf-input-border-color)}.solution__flatten-pdf .solution__select .solution__select-input:required:invalid{color:var(--solution-flatten-pdf-input-border-color)}.solution__flatten-pdf .solution__select .solution__select-input option:not([disabled]){color:var(--solution-flatten-pdf-tertiary-color)}.solution__flatten-pdf .solution_dropdown button{width:100%}.solution__flatten-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__flatten-pdf .solution__dropdown-content label{display:block;margin-top:10px;padding:0 1rem}.solution__flatten-pdf .solution__dropdown-button{min-width:100%}.solution__flatten-pdf .solution__dropdown-button:focus+.solution__dropdown-content,.solution__flatten-pdf .solution__dropdown-content:hover{display:flex}.solution__flatten-pdf .solution__group{display:flex;flex-wrap:wrap;gap:10px}.solution__flatten-pdf .solution__group>div,.solution__flatten-pdf .solution__group>label{flex:1}@keyframes move{0%{transform:translateX(-50%)}50%{transform:translateX(50%)}to{transform:translateX(-50%)}} -
flatten-pdf/tags/1.0.1/trunk/build/view.asset.php
r3294618 r3311892 1 <?php return array('dependencies' => array(), 'version' => ' ed698194fe1e30d2a6aa');1 <?php return array('dependencies' => array(), 'version' => '992919017377e75e2cae'); -
flatten-pdf/tags/1.0.1/trunk/build/view.js
r3294618 r3311892 1 /******/ (() => { // webpackBootstrap 2 /*!*********************!*\ 3 !*** ./src/view.js ***! 4 \*********************/ 5 document.querySelectorAll('.solution__flatten-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 loadingSection = document.getElementById(`loadingSection_${formId}`); 11 const errorSection = document.getElementById(`errorSection_${formId}`); 12 const resultMessage = document.getElementById(`resultMessage_${formId}`); 13 const downloadSection = document.getElementById(`downloadSection_${formId}`); 14 15 // Hide the form, show the loading indicator, hide error and download sections 16 form.style.display = 'none'; 17 loadingSection.style.display = 'flex'; 18 errorSection.style.display = 'none'; // Hide error section 19 downloadSection.style.display = 'none'; 20 const formData = new FormData(); 21 Array.from(fileInput.files).forEach((file, index) => { 22 formData.append(`file[${index}]`, file); 23 }); 24 formData.append('flattenPDFFormNonce', wpApiSettingsFlattenPDF.flattenPDFNonce); 25 fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/send-data`, { 26 method: 'POST', 27 body: formData 28 }).then(response => response.json()).then(data => { 29 if (data.id) { 30 pollStatus(data.id, formId); 31 } else { 32 loadingSection.style.display = 'none'; 33 errorSection.style.display = 'flex'; 34 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 35 } 36 }).catch(() => { 37 loadingSection.style.display = 'none'; 38 errorSection.style.display = 'flex'; 39 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 40 }); 41 }); 42 43 // Add event listener for restart buttons 44 const restartDownloadBtn = document.getElementById(`restartDownloadBtn_${form.id}`); 45 const restartErrorBtn = document.getElementById(`restartErrorBtn_${form.id}`); 46 47 // Function to restart the process and reset the form 48 function resetForm() { 49 form.reset(); 50 form.style.display = 'flex'; 51 document.getElementById(`loadingSection_${form.id}`).style.display = 'none'; // Hide loading 52 document.getElementById(`downloadSection_${form.id}`).style.display = 'none'; // Hide download 53 document.getElementById(`errorSection_${form.id}`).style.display = 'none'; // Hide error section 54 } 55 if (restartDownloadBtn) { 56 restartDownloadBtn.addEventListener('click', resetForm); 57 } 58 if (restartErrorBtn) { 59 restartErrorBtn.addEventListener('click', resetForm); 60 } 61 }); 62 function pollStatus(id, formId) { 63 const loadingSection = document.getElementById(`loadingSection_${formId}`); 64 const errorSection = document.getElementById(`errorSection_${formId}`); 65 const resultMessage = document.getElementById(`resultMessage_${formId}`); 66 const downloadSection = document.getElementById(`downloadSection_${formId}`); 67 const downloadFilesContainer = document.getElementById(`downloadFilesContainer_${formId}`); 68 function checkStatus() { 69 fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/status/${id}`, { 70 method: 'GET', 71 headers: { 72 'X-WP-Nonce': wpApiSettingsFlattenPDF.flattenPDFNonce, 73 'Content-Type': 'application/json' 74 } 75 }).then(response => response.json()).then(data => { 76 if (data.status === 'done') { 77 loadingSection.style.display = 'none'; 78 downloadFilesContainer.innerHTML = ''; // Clear previous downloads 79 80 if (data.output && data.output.files && data.output.files.length > 0) { 81 data.output.files.forEach(file => { 82 // Create download button 83 const downloadButton = document.createElement('button'); 84 downloadButton.type = 'button'; 85 downloadButton.className = 'solution__btn'; 86 downloadButton.innerHTML = ` 87 <div class="dashicons dashicons-download"></div> 88 <span class="solution__download-file-name">${file.name}</span> 89 `; 90 91 // Set download functionality 92 downloadButton.addEventListener('click', event => { 93 event.preventDefault(); 94 const anchor = document.createElement('a'); 95 anchor.href = file.path; 96 anchor.target = '_blank'; 97 document.body.appendChild(anchor); 98 anchor.click(); 99 document.body.removeChild(anchor); 100 }); 101 102 // Append elements to the container 103 const fileContainer = document.createElement('div'); 104 fileContainer.className = 'solution__download-file-container'; 105 fileContainer.appendChild(downloadButton); 106 downloadFilesContainer.appendChild(fileContainer); 107 }); 108 downloadSection.style.display = 'flex'; // Show download section 109 } else { 110 errorSection.style.display = 'flex'; 111 resultMessage.innerText = 'No files available for download.'; 112 } 113 } else if (data.status === 'error') { 114 throw new Error('Processing failed: ' + data.message); 115 } else { 116 setTimeout(checkStatus, 500); 117 } 118 }).catch(() => { 119 loadingSection.style.display = 'none'; 120 errorSection.style.display = 'flex'; 121 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 122 }); 123 } 124 checkStatus(); 125 } 126 /******/ })() 127 ; 128 //# sourceMappingURL=view.js.map 1 document.querySelectorAll(".solution__flatten-pdf .solution__form").forEach((e=>{e.addEventListener("submit",(function(t){t.preventDefault();const n=e.getAttribute("id"),o=e.querySelector('[name="file"]'),l=document.getElementById(`loadingSection_${n}`),d=document.getElementById(`errorSection_${n}`),a=document.getElementById(`resultMessage_${n}`),s=document.getElementById(`downloadSection_${n}`);e.style.display="none",l.style.display="flex",d.style.display="none",s.style.display="none";const i=new FormData;Array.from(o.files).forEach(((e,t)=>{i.append(`file[${t}]`,e)})),i.append("flattenPDFFormNonce",wpApiSettingsFlattenPDF.flattenPDFNonce),fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/send-data`,{method:"POST",body:i}).then((e=>e.json())).then((e=>{e.id?function(e,t){const n=document.getElementById(`loadingSection_${t}`),o=document.getElementById(`errorSection_${t}`),l=document.getElementById(`resultMessage_${t}`),d=document.getElementById(`downloadSection_${t}`),a=document.getElementById(`downloadFilesContainer_${t}`);!function t(){fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/status/${e}`,{method:"GET",headers:{"X-WP-Nonce":wpApiSettingsFlattenPDF.flattenPDFNonce,"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{if("done"===e.status)n.style.display="none",a.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),a.appendChild(n)})),d.style.display="flex"):(o.style.display="flex",l.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",l.innerText="An unexpected error occurred. Please try again."}))}()}(e.id,n):(l.style.display="none",d.style.display="flex",a.innerText="An unexpected error occurred. Please try again.")})).catch((()=>{l.style.display="none",d.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)})); -
flatten-pdf/tags/1.0.1/trunk/flatten-pdf.php
r3294618 r3311892 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 -
flatten-pdf/tags/1.0.1/trunk/languages/flatten-pdf.pot
r3294618 r3311892 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Flatten PDF 1.0. 0\n"5 "Project-Id-Version: Flatten PDF 1.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flatten-pdf\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
flatten-pdf/tags/1.0.1/trunk/readme.txt
r3311878 r3311892 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 Requires PHP: 7.2 9 9 License: GPLv2 or later -
flatten-pdf/tags/1.0.1/trunk/src/block.json
r3294618 r3311892 3 3 "apiVersion": 3, 4 4 "name": "create-block/flatten-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Flatten Pdf", 7 7 "category": "widgets", -
flatten-pdf/trunk/build/block.json
r3294618 r3311892 3 3 "apiVersion": 3, 4 4 "name": "create-block/flatten-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Flatten Pdf", 7 7 "category": "widgets", -
flatten-pdf/trunk/build/index-rtl.css
r3294618 r3311892 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__flatten-pdf { 5 margin: 1rem; 6 } 1 .solution__flatten-pdf{margin:1rem} -
flatten-pdf/trunk/build/index.asset.php
r3294618 r3311892 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => '0 31c0edb2f7d39befe01');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => '0afc5ccba0e5e1ccc682'); -
flatten-pdf/trunk/build/index.js
r3294618 r3311892 1 (()=>{"use strict";var e,t={354:()=>{const e=window.wp.blocks,t=window.wp.element,i=window.wp.i18n,n=window.ReactJSXRuntime,l=(0,t.createElement)("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("rect",{width:"32.0014",height:"32.0014",rx:"16.0007",fill:"#E5DBFF"}),(0,t.createElement)("path",{d:"M10.6418 20.331V18.6012H21.3595V20.331H10.6418ZM9.07568 22.9257V21.1959H22.9257V22.9257H9.07568ZM12.5353 17.7363V16.0065H19.4661V17.7363H12.5353ZM16.0065 15.1416L12.5469 11.6821L13.7625 10.4665L15.1533 11.8574V9.07568H16.8831V11.8457L18.2739 10.4548L19.4895 11.6704L16.0299 15.1299L16.0065 15.1416Z",fill:"#5A3BB2"})),s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/flatten-pdf","version":"1.0. 0","title":"Flatten Pdf","category":"widgets","description":"Effortlessly merge layers and annotations into a single, streamlined PDF with Flatten PDF. Make sharing, storing, and viewing your documents simple and hassle-free while preserving layout integrity and compatibility.","example":{},"supports":{"html":false},"textdomain":"flatten-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)(s,{icon:l,edit:function(){return(0,t.createElement)("div",null,(0,n.jsx)("div",{className:"solution__flatten-pdf",children:(0,n.jsx)("div",{className:"solution__container__wrapper",children:(0,n.jsxs)("div",{className:"solution__container",children:[(0,n.jsx)("div",{className:"solution__header",children:(0,i.__)("Flatten PDF","flatten-pdf")}),(0,n.jsxs)("div",{className:"solution__form",children:[(0,n.jsxs)("label",{htmlFor:"file",className:"solution__label",children:[(0,n.jsx)("span",{children:(0,i.__)("File:","flatten-pdf")}),(0,n.jsx)("input",{type:"file",id:"file",name:"file",required:!0,className:"solution__file-input",disabled:!0})]}),(0,n.jsx)("button",{disabled:!0,className:"solution__btn",children:(0,i.__)("Submit","flatten-pdf")})]})]})})}))}})}},i={};function n(e){var l=i[e];if(void 0!==l)return l.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,i,l,s)=>{if(!i){var r=1/0;for(c=0;c<e.length;c++){i=e[c][0],l=e[c][1],s=e[c][2];for(var a=!0,o=0;o<i.length;o++)(!1&s||r>=s)&&Object.keys(n.O).every((e=>n.O[e](i[o])))?i.splice(o--,1):(a=!1,s<r&&(r=s));if(a){e.splice(c--,1);var d=l();void 0!==d&&(t=d)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,l,s]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var l,s,r=i[0],a=i[1],o=i[2],d=0;if(r.some((t=>0!==e[t]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(o)var c=o(n)}for(t&&t(i);d<r.length;d++)s=r[d],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(c)},i=self.webpackChunk=self.webpackChunk||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var l=n.O(void 0,[350],(()=>n(354)));l=n.O(l)})();1 (()=>{"use strict";var e,t={354:()=>{const e=window.wp.blocks,t=window.wp.element,i=window.wp.i18n,n=window.ReactJSXRuntime,l=(0,t.createElement)("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("rect",{width:"32.0014",height:"32.0014",rx:"16.0007",fill:"#E5DBFF"}),(0,t.createElement)("path",{d:"M10.6418 20.331V18.6012H21.3595V20.331H10.6418ZM9.07568 22.9257V21.1959H22.9257V22.9257H9.07568ZM12.5353 17.7363V16.0065H19.4661V17.7363H12.5353ZM16.0065 15.1416L12.5469 11.6821L13.7625 10.4665L15.1533 11.8574V9.07568H16.8831V11.8457L18.2739 10.4548L19.4895 11.6704L16.0299 15.1299L16.0065 15.1416Z",fill:"#5A3BB2"})),s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/flatten-pdf","version":"1.0.1","title":"Flatten Pdf","category":"widgets","description":"Effortlessly merge layers and annotations into a single, streamlined PDF with Flatten PDF. Make sharing, storing, and viewing your documents simple and hassle-free while preserving layout integrity and compatibility.","example":{},"supports":{"html":false},"textdomain":"flatten-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)(s,{icon:l,edit:function(){return(0,t.createElement)("div",null,(0,n.jsx)("div",{className:"solution__flatten-pdf",children:(0,n.jsx)("div",{className:"solution__container__wrapper",children:(0,n.jsxs)("div",{className:"solution__container",children:[(0,n.jsx)("div",{className:"solution__header",children:(0,i.__)("Flatten PDF","flatten-pdf")}),(0,n.jsxs)("div",{className:"solution__form",children:[(0,n.jsxs)("label",{htmlFor:"file",className:"solution__label",children:[(0,n.jsx)("span",{children:(0,i.__)("File:","flatten-pdf")}),(0,n.jsx)("input",{type:"file",id:"file",name:"file",required:!0,className:"solution__file-input",disabled:!0})]}),(0,n.jsx)("button",{disabled:!0,className:"solution__btn",children:(0,i.__)("Submit","flatten-pdf")})]})]})})}))}})}},i={};function n(e){var l=i[e];if(void 0!==l)return l.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,i,l,s)=>{if(!i){var r=1/0;for(c=0;c<e.length;c++){i=e[c][0],l=e[c][1],s=e[c][2];for(var a=!0,o=0;o<i.length;o++)(!1&s||r>=s)&&Object.keys(n.O).every((e=>n.O[e](i[o])))?i.splice(o--,1):(a=!1,s<r&&(r=s));if(a){e.splice(c--,1);var d=l();void 0!==d&&(t=d)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,l,s]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var l,s,r=i[0],a=i[1],o=i[2],d=0;if(r.some((t=>0!==e[t]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(o)var c=o(n)}for(t&&t(i);d<r.length;d++)s=r[d],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(c)},i=self.webpackChunk=self.webpackChunk||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var l=n.O(void 0,[350],(()=>n(354)));l=n.O(l)})(); -
flatten-pdf/trunk/build/style-index-rtl.css
r3294618 r3311892 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-flatten-pdf-primary-color: #4f46e5; 6 --solution-flatten-pdf-secondary-color: #eef2ff; 7 --solution-flatten-pdf-tertiary-color: #000; 8 --solution-flatten-pdf-background-color: #fff; 9 --solution-flatten-pdf-border-color: #e5e7eb; 10 --solution-flatten-pdf-input-border-color: #d1d5db; 11 --solution-flatten-pdf-shadow-color: rgba(149, 157, 165, 0.2); 12 --solution-flatten-pdf-btn-shadow-color: rgba(0, 0, 0, 0.05); 13 --solution-flatten-pdf-dropdown-bg-color: #fff; 14 --solution-flatten-pdf-dropdown-shadow-color-1: rgba(0, 0, 0, 0.1); 15 --solution-flatten-pdf-dropdown-shadow-color-2: rgba(0, 0, 0, 0.1); 16 } 17 18 .solution__flatten-pdf .solution__container-wrapper { 19 padding: 1rem; 20 display: flex; 21 flex-direction: column; 22 gap: 1rem; 23 color: var(--solution-flatten-pdf-tertiary-color); 24 } 25 .solution__flatten-pdf .solution__container { 26 box-shadow: var(--solution-flatten-pdf-shadow-color) 0 8px 24px; 27 border: 1px solid var(--solution-flatten-pdf-border-color); 28 background-color: var(--solution-flatten-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: 180px; 35 gap: 1rem; 36 } 37 .solution__flatten-pdf .solution__header { 38 font-size: 1.25rem; 39 letter-spacing: 0.05em; 40 font-weight: 500; 41 } 42 .solution__flatten-pdf .solution__content { 43 flex-grow: 1; 44 display: grid; 45 } 46 .solution__flatten-pdf .solution__form { 47 display: flex; 48 flex-direction: column; 49 gap: 1rem; 50 } 51 .solution__flatten-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__flatten-pdf .solution__hint { 61 font-size: 0.75rem; 62 font-weight: 500; 63 color: var(--solution-flatten-pdf-primary-color); 64 white-space: wrap; 65 } 66 .solution__flatten-pdf .solution__input { 67 border: 1px solid var(--solution-flatten-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__flatten-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-flatten-pdf-secondary-color); 81 color: var(--solution-flatten-pdf-primary-color); 82 font-weight: 500; 83 cursor: pointer; 84 } 85 .solution__flatten-pdf .solution__file-input:hover::-webkit-file-upload-button { 86 background-color: var(--solution-flatten-pdf-secondary-color); 87 } 88 .solution__flatten-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-flatten-pdf-btn-shadow-color); 94 background: var(--solution-flatten-pdf-secondary-color); 95 color: var(--solution-flatten-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__flatten-pdf .solution__btn:hover { 103 filter: brightness(0.98); 104 } 105 .solution__flatten-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__flatten-pdf .solution__dropdown-wrapper { 110 position: relative; 111 } 112 .solution__flatten-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__flatten-pdf .solution__dropdown--hidden { 123 display: none; 124 } 125 .solution__flatten-pdf .solution__loading-section { 126 display: none; 127 position: absolute; 128 top: 50%; 129 right: 50%; 130 transform: translate(50%, -50%); 131 } 132 .solution__flatten-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__flatten-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__flatten-pdf .solution__download-section:last-child { 148 margin-top: auto; 149 } 150 .solution__flatten-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__flatten-pdf .solution__download-file-container { 159 display: flex; 160 flex-wrap: wrap; 161 justify-content: flex-start; 162 gap: 1rem; 163 } 164 .solution__flatten-pdf .solution__download-file-name { 165 white-space: nowrap; 166 overflow: hidden; 167 text-overflow: ellipsis; 168 max-width: 12rem; 169 } 170 .solution__flatten-pdf .solution__title-text { 171 font-weight: 600; 172 } 173 .solution__flatten-pdf .solution__text { 174 font-weight: 500; 175 } 176 .solution__flatten-pdf .solution__provided-text { 177 display: flex; 178 justify-content: center; 179 font-size: 0.7rem; 180 margin-top: 0.5rem; 181 } 182 .solution__flatten-pdf .solution__error-section { 183 display: flex; 184 flex-direction: column; 185 justify-self: center; 186 align-self: center; 187 } 188 .solution__flatten-pdf .solution__dot { 189 background: var(--solution-flatten-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__flatten-pdf .solution__link { 196 color: var(--solution-flatten-pdf-tertiary-color); 197 } 198 .solution__flatten-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__flatten-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-flatten-pdf-input-border-color); 211 color: var(--solution-flatten-pdf-tertiary-color); 212 box-shadow: 0 1px 2px 0 var(--solution-flatten-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__flatten-pdf .solution__select .solution__select-input:focus { 224 outline: 1px solid var(--solution-flatten-pdf-primary-color); 225 box-shadow: 0 0 0 3px var(--solution-flatten-pdf-secondary-color); 226 } 227 .solution__flatten-pdf .solution__select .solution__select-input option { 228 padding: 1rem; 229 } 230 .solution__flatten-pdf .solution__select .solution__select-input option[disabled] { 231 color: var(--solution-flatten-pdf-input-border-color); 232 } 233 .solution__flatten-pdf .solution__select .solution__select-input:required:invalid { 234 color: var(--solution-flatten-pdf-input-border-color); 235 } 236 .solution__flatten-pdf .solution__select .solution__select-input option:not([disabled]) { 237 color: var(--solution-flatten-pdf-tertiary-color); 238 } 239 .solution__flatten-pdf .solution_dropdown button { 240 width: 100%; 241 } 242 .solution__flatten-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__flatten-pdf .solution__dropdown-content label { 260 display: block; 261 margin-top: 10px; 262 padding: 0 1rem; 263 } 264 .solution__flatten-pdf .solution__dropdown-button { 265 min-width: 100%; 266 } 267 .solution__flatten-pdf .solution__dropdown-content:hover, 268 .solution__flatten-pdf .solution__dropdown-button:focus + .solution__dropdown-content { 269 display: flex; 270 } 271 .solution__flatten-pdf .solution__group { 272 display: flex; 273 flex-wrap: wrap; 274 gap: 10px; 275 } 276 .solution__flatten-pdf .solution__group > div, 277 .solution__flatten-pdf .solution__group > label { 278 flex: 1; 279 } 280 281 @keyframes move { 282 0% { 283 transform: translateX(-50%); 284 } 285 50% { 286 transform: translateX(50%); 287 } 288 100% { 289 transform: translateX(-50%); 290 } 291 } 1 :root{--solution-flatten-pdf-primary-color:#4f46e5;--solution-flatten-pdf-secondary-color:#eef2ff;--solution-flatten-pdf-tertiary-color:#000;--solution-flatten-pdf-background-color:#fff;--solution-flatten-pdf-border-color:#e5e7eb;--solution-flatten-pdf-input-border-color:#d1d5db;--solution-flatten-pdf-shadow-color:hsla(210,8%,62%,.2);--solution-flatten-pdf-btn-shadow-color:rgba(0,0,0,.05);--solution-flatten-pdf-dropdown-bg-color:#fff;--solution-flatten-pdf-dropdown-shadow-color-1:rgba(0,0,0,.1);--solution-flatten-pdf-dropdown-shadow-color-2:rgba(0,0,0,.1)}.solution__flatten-pdf .solution__container-wrapper{color:var(--solution-flatten-pdf-tertiary-color);display:flex;flex-direction:column;gap:1rem;padding:1rem}.solution__flatten-pdf .solution__container{background-color:var(--solution-flatten-pdf-background-color);border:1px solid var(--solution-flatten-pdf-border-color);border-radius:.75rem;box-shadow:var(--solution-flatten-pdf-shadow-color) 0 8px 24px;display:flex;flex-direction:column;gap:1rem;min-height:180px;padding:1.5rem 1.5rem .5rem;position:relative}.solution__flatten-pdf .solution__header{font-size:1.25rem;font-weight:500;letter-spacing:.05em}.solution__flatten-pdf .solution__content{display:grid;flex-grow:1}.solution__flatten-pdf .solution__form{display:flex;flex-direction:column;gap:1rem}.solution__flatten-pdf .solution__label{display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.3rem;white-space:nowrap;width:100%}.solution__flatten-pdf .solution__hint{color:var(--solution-flatten-pdf-primary-color);font-size:.75rem;font-weight:500;white-space:wrap}.solution__flatten-pdf .solution__input{border:1px solid var(--solution-flatten-pdf-input-border-color);border-radius:.375rem;font-size:1rem;line-height:32px;outline:1px solid transparent;outline-offset:-1px;padding:.25rem .5rem}.solution__flatten-pdf .solution__file-input::-webkit-file-upload-button{background-color:var(--solution-flatten-pdf-secondary-color);border:none;border-radius:.75rem;color:var(--solution-flatten-pdf-primary-color);cursor:pointer;font-weight:500;margin-left:1rem;padding:.5rem 1rem}.solution__flatten-pdf .solution__file-input:hover::-webkit-file-upload-button{background-color:var(--solution-flatten-pdf-secondary-color)}.solution__flatten-pdf .solution__btn{align-items:center;background:var(--solution-flatten-pdf-secondary-color);border:none;border-radius:1rem;box-shadow:0 1px 2px 0 var(--solution-flatten-pdf-btn-shadow-color);color:var(--solution-flatten-pdf-primary-color);cursor:pointer;display:inline-flex;font-weight:600;gap:.5rem;justify-content:center;padding:.5rem 1rem}.solution__flatten-pdf .solution__btn:hover{filter:brightness(.98)}.solution__flatten-pdf .solution__btn .dashicons{font-size:1.2rem;vertical-align:middle}.solution__flatten-pdf .solution__dropdown-wrapper{position:relative}.solution__flatten-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__flatten-pdf .solution__dropdown--hidden{display:none}.solution__flatten-pdf .solution__loading-section{display:none;right:50%;position:absolute;top:50%;transform:translate(50%,-50%)}.solution__flatten-pdf .solution__loading-container{align-items:center;display:flex;gap:1rem;justify-content:center;transition:2s ease}.solution__flatten-pdf .solution__download-section{align-items:center;display:flex;flex-direction:column;gap:2rem;height:100%;justify-content:center}.solution__flatten-pdf .solution__download-section:last-child{margin-top:auto}.solution__flatten-pdf .solution__download-container{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:1rem;justify-content:center}.solution__flatten-pdf .solution__download-file-container{display:flex;flex-wrap:wrap;gap:1rem;justify-content:flex-start}.solution__flatten-pdf .solution__download-file-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.solution__flatten-pdf .solution__title-text{font-weight:600}.solution__flatten-pdf .solution__text{font-weight:500}.solution__flatten-pdf .solution__provided-text{display:flex;font-size:.7rem;justify-content:center;margin-top:.5rem}.solution__flatten-pdf .solution__error-section{align-self:center;display:flex;flex-direction:column;justify-self:center}.solution__flatten-pdf .solution__dot{animation:move .6s ease infinite;background:var(--solution-flatten-pdf-tertiary-color);border-radius:50%;height:.65em;width:.65em}.solution__flatten-pdf .solution__link{color:var(--solution-flatten-pdf-tertiary-color)}.solution__flatten-pdf .solution__select{display:flex;flex-direction:column;gap:.3rem;position:relative}.solution__flatten-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-flatten-pdf-input-border-color);border-radius:.375rem;box-shadow:0 1px 2px 0 var(--solution-flatten-pdf-shadow-color);color:var(--solution-flatten-pdf-tertiary-color);cursor:pointer;height:42px;padding:0 .5rem}.solution__flatten-pdf .solution__select .solution__select-input:focus{box-shadow:0 0 0 3px var(--solution-flatten-pdf-secondary-color);outline:1px solid var(--solution-flatten-pdf-primary-color)}.solution__flatten-pdf .solution__select .solution__select-input option{padding:1rem}.solution__flatten-pdf .solution__select .solution__select-input option[disabled]{color:var(--solution-flatten-pdf-input-border-color)}.solution__flatten-pdf .solution__select .solution__select-input:required:invalid{color:var(--solution-flatten-pdf-input-border-color)}.solution__flatten-pdf .solution__select .solution__select-input option:not([disabled]){color:var(--solution-flatten-pdf-tertiary-color)}.solution__flatten-pdf .solution_dropdown button{width:100%}.solution__flatten-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__flatten-pdf .solution__dropdown-content label{display:block;margin-top:10px;padding:0 1rem}.solution__flatten-pdf .solution__dropdown-button{min-width:100%}.solution__flatten-pdf .solution__dropdown-button:focus+.solution__dropdown-content,.solution__flatten-pdf .solution__dropdown-content:hover{display:flex}.solution__flatten-pdf .solution__group{display:flex;flex-wrap:wrap;gap:10px}.solution__flatten-pdf .solution__group>div,.solution__flatten-pdf .solution__group>label{flex:1}@keyframes move{0%{transform:translateX(-50%)}50%{transform:translateX(50%)}to{transform:translateX(-50%)}} -
flatten-pdf/trunk/build/view.asset.php
r3294618 r3311892 1 <?php return array('dependencies' => array(), 'version' => ' ed698194fe1e30d2a6aa');1 <?php return array('dependencies' => array(), 'version' => '992919017377e75e2cae'); -
flatten-pdf/trunk/build/view.js
r3294618 r3311892 1 /******/ (() => { // webpackBootstrap 2 /*!*********************!*\ 3 !*** ./src/view.js ***! 4 \*********************/ 5 document.querySelectorAll('.solution__flatten-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 loadingSection = document.getElementById(`loadingSection_${formId}`); 11 const errorSection = document.getElementById(`errorSection_${formId}`); 12 const resultMessage = document.getElementById(`resultMessage_${formId}`); 13 const downloadSection = document.getElementById(`downloadSection_${formId}`); 14 15 // Hide the form, show the loading indicator, hide error and download sections 16 form.style.display = 'none'; 17 loadingSection.style.display = 'flex'; 18 errorSection.style.display = 'none'; // Hide error section 19 downloadSection.style.display = 'none'; 20 const formData = new FormData(); 21 Array.from(fileInput.files).forEach((file, index) => { 22 formData.append(`file[${index}]`, file); 23 }); 24 formData.append('flattenPDFFormNonce', wpApiSettingsFlattenPDF.flattenPDFNonce); 25 fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/send-data`, { 26 method: 'POST', 27 body: formData 28 }).then(response => response.json()).then(data => { 29 if (data.id) { 30 pollStatus(data.id, formId); 31 } else { 32 loadingSection.style.display = 'none'; 33 errorSection.style.display = 'flex'; 34 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 35 } 36 }).catch(() => { 37 loadingSection.style.display = 'none'; 38 errorSection.style.display = 'flex'; 39 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 40 }); 41 }); 42 43 // Add event listener for restart buttons 44 const restartDownloadBtn = document.getElementById(`restartDownloadBtn_${form.id}`); 45 const restartErrorBtn = document.getElementById(`restartErrorBtn_${form.id}`); 46 47 // Function to restart the process and reset the form 48 function resetForm() { 49 form.reset(); 50 form.style.display = 'flex'; 51 document.getElementById(`loadingSection_${form.id}`).style.display = 'none'; // Hide loading 52 document.getElementById(`downloadSection_${form.id}`).style.display = 'none'; // Hide download 53 document.getElementById(`errorSection_${form.id}`).style.display = 'none'; // Hide error section 54 } 55 if (restartDownloadBtn) { 56 restartDownloadBtn.addEventListener('click', resetForm); 57 } 58 if (restartErrorBtn) { 59 restartErrorBtn.addEventListener('click', resetForm); 60 } 61 }); 62 function pollStatus(id, formId) { 63 const loadingSection = document.getElementById(`loadingSection_${formId}`); 64 const errorSection = document.getElementById(`errorSection_${formId}`); 65 const resultMessage = document.getElementById(`resultMessage_${formId}`); 66 const downloadSection = document.getElementById(`downloadSection_${formId}`); 67 const downloadFilesContainer = document.getElementById(`downloadFilesContainer_${formId}`); 68 function checkStatus() { 69 fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/status/${id}`, { 70 method: 'GET', 71 headers: { 72 'X-WP-Nonce': wpApiSettingsFlattenPDF.flattenPDFNonce, 73 'Content-Type': 'application/json' 74 } 75 }).then(response => response.json()).then(data => { 76 if (data.status === 'done') { 77 loadingSection.style.display = 'none'; 78 downloadFilesContainer.innerHTML = ''; // Clear previous downloads 79 80 if (data.output && data.output.files && data.output.files.length > 0) { 81 data.output.files.forEach(file => { 82 // Create download button 83 const downloadButton = document.createElement('button'); 84 downloadButton.type = 'button'; 85 downloadButton.className = 'solution__btn'; 86 downloadButton.innerHTML = ` 87 <div class="dashicons dashicons-download"></div> 88 <span class="solution__download-file-name">${file.name}</span> 89 `; 90 91 // Set download functionality 92 downloadButton.addEventListener('click', event => { 93 event.preventDefault(); 94 const anchor = document.createElement('a'); 95 anchor.href = file.path; 96 anchor.target = '_blank'; 97 document.body.appendChild(anchor); 98 anchor.click(); 99 document.body.removeChild(anchor); 100 }); 101 102 // Append elements to the container 103 const fileContainer = document.createElement('div'); 104 fileContainer.className = 'solution__download-file-container'; 105 fileContainer.appendChild(downloadButton); 106 downloadFilesContainer.appendChild(fileContainer); 107 }); 108 downloadSection.style.display = 'flex'; // Show download section 109 } else { 110 errorSection.style.display = 'flex'; 111 resultMessage.innerText = 'No files available for download.'; 112 } 113 } else if (data.status === 'error') { 114 throw new Error('Processing failed: ' + data.message); 115 } else { 116 setTimeout(checkStatus, 500); 117 } 118 }).catch(() => { 119 loadingSection.style.display = 'none'; 120 errorSection.style.display = 'flex'; 121 resultMessage.innerText = 'An unexpected error occurred. Please try again.'; 122 }); 123 } 124 checkStatus(); 125 } 126 /******/ })() 127 ; 128 //# sourceMappingURL=view.js.map 1 document.querySelectorAll(".solution__flatten-pdf .solution__form").forEach((e=>{e.addEventListener("submit",(function(t){t.preventDefault();const n=e.getAttribute("id"),o=e.querySelector('[name="file"]'),l=document.getElementById(`loadingSection_${n}`),d=document.getElementById(`errorSection_${n}`),a=document.getElementById(`resultMessage_${n}`),s=document.getElementById(`downloadSection_${n}`);e.style.display="none",l.style.display="flex",d.style.display="none",s.style.display="none";const i=new FormData;Array.from(o.files).forEach(((e,t)=>{i.append(`file[${t}]`,e)})),i.append("flattenPDFFormNonce",wpApiSettingsFlattenPDF.flattenPDFNonce),fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/send-data`,{method:"POST",body:i}).then((e=>e.json())).then((e=>{e.id?function(e,t){const n=document.getElementById(`loadingSection_${t}`),o=document.getElementById(`errorSection_${t}`),l=document.getElementById(`resultMessage_${t}`),d=document.getElementById(`downloadSection_${t}`),a=document.getElementById(`downloadFilesContainer_${t}`);!function t(){fetch(`${wpApiSettingsFlattenPDF.root}flatten-pdf/v1/status/${e}`,{method:"GET",headers:{"X-WP-Nonce":wpApiSettingsFlattenPDF.flattenPDFNonce,"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{if("done"===e.status)n.style.display="none",a.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),a.appendChild(n)})),d.style.display="flex"):(o.style.display="flex",l.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",l.innerText="An unexpected error occurred. Please try again."}))}()}(e.id,n):(l.style.display="none",d.style.display="flex",a.innerText="An unexpected error occurred. Please try again.")})).catch((()=>{l.style.display="none",d.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)})); -
flatten-pdf/trunk/flatten-pdf.php
r3294618 r3311892 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 -
flatten-pdf/trunk/languages/flatten-pdf.pot
r3294618 r3311892 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Flatten PDF 1.0. 0\n"5 "Project-Id-Version: Flatten PDF 1.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flatten-pdf\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
flatten-pdf/trunk/readme.txt
r3311878 r3311892 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 Requires PHP: 7.2 9 9 License: GPLv2 or later -
flatten-pdf/trunk/src/block.json
r3294618 r3311892 3 3 "apiVersion": 3, 4 4 "name": "create-block/flatten-pdf", 5 "version": "1.0. 0",5 "version": "1.0.1", 6 6 "title": "Flatten Pdf", 7 7 "category": "widgets",
Note: See TracChangeset
for help on using the changeset viewer.