@embedpdf/snippet 2.1.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{browser-awZxztMA-MZYHZ0lP.js → browser-awZxztMA-RDxqV2Sx.js} +1 -1
- package/dist/components/annotation-sidebar/dynamic-sidebar.d.ts +14 -0
- package/dist/components/annotation-sidebar/dynamic-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/property-schema.d.ts +41 -0
- package/dist/components/annotation-sidebar/property-schema.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/property-sections.d.ts +12 -0
- package/dist/components/annotation-sidebar/property-sections.d.ts.map +1 -0
- package/dist/components/annotation-sidebar.d.ts.map +1 -1
- package/dist/components/app.d.ts +13 -1
- package/dist/components/app.d.ts.map +1 -1
- package/dist/components/comment-sidebar/annotation-card.d.ts +2 -1
- package/dist/components/comment-sidebar/annotation-card.d.ts.map +1 -1
- package/dist/components/comment-sidebar/comment.d.ts +2 -1
- package/dist/components/comment-sidebar/comment.d.ts.map +1 -1
- package/dist/components/comment-sidebar.d.ts.map +1 -1
- package/dist/components/icons/external-link.d.ts +3 -0
- package/dist/components/icons/external-link.d.ts.map +1 -0
- package/dist/components/icons/eye-off.d.ts +4 -0
- package/dist/components/icons/eye-off.d.ts.map +1 -0
- package/dist/components/icons/eye.d.ts +4 -0
- package/dist/components/icons/eye.d.ts.map +1 -0
- package/dist/components/icons/group.d.ts +4 -0
- package/dist/components/icons/group.d.ts.map +1 -0
- package/dist/components/icons/index.d.ts.map +1 -1
- package/dist/components/icons/info.d.ts +4 -0
- package/dist/components/icons/info.d.ts.map +1 -0
- package/dist/components/icons/link-off.d.ts +4 -0
- package/dist/components/icons/link-off.d.ts.map +1 -0
- package/dist/components/icons/link.d.ts +4 -0
- package/dist/components/icons/link.d.ts.map +1 -0
- package/dist/components/icons/marquee-select.d.ts +4 -0
- package/dist/components/icons/marquee-select.d.ts.map +1 -0
- package/dist/components/icons/types.d.ts +2 -1
- package/dist/components/icons/types.d.ts.map +1 -1
- package/dist/components/icons/ungroup.d.ts +4 -0
- package/dist/components/icons/ungroup.d.ts.map +1 -0
- package/dist/components/icons/unlock.d.ts +4 -0
- package/dist/components/icons/unlock.d.ts.map +1 -0
- package/dist/components/link-modal.d.ts +10 -0
- package/dist/components/link-modal.d.ts.map +1 -0
- package/dist/components/permissions-display.d.ts +16 -0
- package/dist/components/permissions-display.d.ts.map +1 -0
- package/dist/components/protect-modal.d.ts +10 -0
- package/dist/components/protect-modal.d.ts.map +1 -0
- package/dist/components/unlock-owner-overlay.d.ts +7 -0
- package/dist/components/unlock-owner-overlay.d.ts.map +1 -0
- package/dist/components/view-permissions-modal.d.ts +10 -0
- package/dist/components/view-permissions-modal.d.ts.map +1 -0
- package/dist/config/commands.d.ts.map +1 -1
- package/dist/config/translations.d.ts.map +1 -1
- package/dist/config/ui-schema.d.ts.map +1 -1
- package/dist/direct-engine-BDuzMUFV.js +1 -0
- package/dist/embedpdf-CE93i_Sd.js +3 -0
- package/dist/embedpdf.js +1 -1
- package/dist/pdfium.wasm +0 -0
- package/dist/ui/schema-selection-menu.d.ts.map +1 -1
- package/dist/worker-engine-D8W4P9zI.js +1 -0
- package/package.json +30 -30
- package/dist/components/annotation-menu.d.ts +0 -9
- package/dist/components/annotation-menu.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/free-text-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/free-text-sidebar.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/ink-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/ink-sidebar.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/line-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/line-sidebar.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/polygon-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/polygon-sidebar.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/registry.d.ts +0 -20
- package/dist/components/annotation-sidebar/registry.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/shape-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/shape-sidebar.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/stamp-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/stamp-sidebar.d.ts.map +0 -1
- package/dist/components/annotation-sidebar/text-markup-sidebar.d.ts +0 -5
- package/dist/components/annotation-sidebar/text-markup-sidebar.d.ts.map +0 -1
- package/dist/direct-engine-CluHueed.js +0 -1
- package/dist/embedpdf-BFHbxCoj.js +0 -3
- package/dist/worker-engine-rPr4Ul0q.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e,T as t,G as r,P as n,H as i}from"./embedpdf-BFHbxCoj.js";const o="TaskQueue",s="Queue";var u=(e=>(e[e.CRITICAL=3]="CRITICAL",e[e.HIGH=2]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=0]="LOW",e))(u||{});class a{constructor(t={}){this.queue=[],this.running=0,this.resultTasks=new Map,this.idleListeners=new Set;const{concurrency:r=1,comparator:n,ranker:i,onIdle:o,maxQueueSize:s,autoStart:u=!0,logger:a}=t;this.logger=a??new e,this.opts={concurrency:Math.max(1,r),comparator:n,ranker:i,onIdle:o??(()=>{}),maxQueueSize:s??Number.POSITIVE_INFINITY,autoStart:u}}setComparator(e){this.opts.comparator=e}setRanker(e){this.opts.ranker=e}size(){return this.queue.length}inFlight(){return this.running}isIdle(){return 0===this.queue.length&&0===this.running}async drain(){this.isIdle()||await new Promise(e=>{const t=()=>{this.isIdle()&&(this.offIdle(t),e())};this.onIdle(t)})}notifyIdle(){this.isIdle()&&([...this.idleListeners].forEach(e=>e()),this.idleListeners.clear(),this.opts.onIdle())}onIdle(e){this.idleListeners.add(e)}offIdle(e){this.idleListeners.delete(e)}enqueue(e,r={}){const n=this.generateId(),i=r.priority??1,u=new t;if(this.queue.length>=this.opts.maxQueueSize){const e=new Error("Queue is full (maxQueueSize reached).");return u.reject(e),u}this.resultTasks.set(n,u);const a={id:n,priority:i,meta:r.meta??e.meta,executeFactory:e.execute};this.queue.push(a),this.logger.debug(o,s,`Task enqueued: ${n} | Priority: ${i} | Running: ${this.running} | Queued: ${this.queue.length}`);const c=u.abort.bind(u);return u.abort=e=>{this.logger.debug(o,s,`Task aborted: ${n}`),this.cancel(n),c(e)},this.opts.autoStart&&this.process(!0===r.fifo),u}cancel(e){const t=this.queue.length;this.queue=this.queue.filter(t=>t.id!==e||(t.cancelled=!0,!1)),this.resultTasks.delete(e),t!==this.queue.length&&(this.logger.debug(o,s,`Task cancelled and removed: ${e}`),this.kick())}kick(){queueMicrotask(()=>this.process())}async process(e=!1){for(this.logger.debug(o,s,`process() called | Running: ${this.running} | Concurrency: ${this.opts.concurrency} | Queued: ${this.queue.length}`);this.running<this.opts.concurrency&&this.queue.length>0;){this.logger.debug(o,s,`Starting new task | Running: ${this.running} | Queued: ${this.queue.length}`),e||this.sortQueue();const t=this.queue.shift();if(t.cancelled){this.logger.debug(o,s,`Skipping cancelled task: ${t.id}`);continue}const r=this.resultTasks.get(t.id);r&&(this.running++,(async()=>{let e=null;try{if(e=t.executeFactory(),!e)throw new Error("Task factory returned null/undefined");e.wait(e=>{0===r.state.stage&&r.resolve(e)},e=>{0===r.state.stage&&("abort"===e.type?r.abort(e.reason):r.reject(e.reason))}),e.onProgress(e=>{r.progress(e)}),await e.toPromise()}catch(e){0===r.state.stage&&r.reject(e)}finally{this.resultTasks.delete(t.id),this.running--,this.logger.debug(o,s,`Task completed: ${t.id} | Running: ${this.running} | Queued: ${this.queue.length}`),this.isIdle()?this.notifyIdle():this.queue.length>0&&this.kick()}})().catch(e=>{this.logger.error(o,s,"Unhandled error in task execution wrapper:",e),this.running=Math.max(0,this.running-1),this.isIdle()?this.notifyIdle():this.queue.length>0&&this.kick()}))}}sortQueue(){const{comparator:e,ranker:t}=this.opts;if(e)return void this.queue.sort(e);const r=new Map,n=e=>t?(r.has(e.id)||r.set(e.id,t(e)),r.get(e.id)):this.defaultRank(e);this.queue.sort((e,t)=>{if(e.priority!==t.priority)return t.priority-e.priority;const r=n(e),i=n(t);return r!==i?i-r:this.extractTime(e.id)-this.extractTime(t.id)})}defaultRank(e){return 0}generateId(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}extractTime(e){const t=Number(e.split("-")[0]);return Number.isFinite(t)?t:0}}const c="PdfEngine",d="Orchestrator";class h{constructor(t,r){this.executor=t,this.logger=r.logger??new e,this.options={imageConverter:r.imageConverter,fetcher:r.fetcher??("undefined"!=typeof fetch?(e,t)=>fetch(e,t):void 0),logger:this.logger},this.workerQueue=new a({concurrency:1,autoStart:!0,logger:this.logger}),this.logger.debug(c,d,"PdfEngine orchestrator created")}chunkArray(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}isSupport(e){const n=new t;return n.resolve([r.Create,r.Read,r.Update,r.Delete]),n}destroy(){const e=new t;try{this.executor.destroy(),e.resolve(!0)}catch(t){e.reject({code:n.Unknown,message:String(t)})}return e}openDocumentUrl(e,r){const i=new t;return(async()=>{try{if(!this.options.fetcher)throw new Error("Fetcher is not set");const t=await this.options.fetcher(e.url,null==r?void 0:r.requestOptions),n=await t.arrayBuffer(),o={id:e.id,content:n};this.openDocumentBuffer(o,{password:null==r?void 0:r.password}).wait(e=>i.resolve(e),e=>i.fail(e))}catch(e){i.reject({code:n.Unknown,message:String(e)})}})(),i}openDocumentBuffer(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.openDocumentBuffer(e,t),meta:{docId:e.id,operation:"openDocumentBuffer"}},{priority:u.CRITICAL})}getMetadata(e){return this.workerQueue.enqueue({execute:()=>this.executor.getMetadata(e),meta:{docId:e.id,operation:"getMetadata"}},{priority:u.MEDIUM})}setMetadata(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.setMetadata(e,t),meta:{docId:e.id,operation:"setMetadata"}},{priority:u.MEDIUM})}getDocPermissions(e){return this.workerQueue.enqueue({execute:()=>this.executor.getDocPermissions(e),meta:{docId:e.id,operation:"getDocPermissions"}},{priority:u.MEDIUM})}getDocUserPermissions(e){return this.workerQueue.enqueue({execute:()=>this.executor.getDocUserPermissions(e),meta:{docId:e.id,operation:"getDocUserPermissions"}},{priority:u.MEDIUM})}getSignatures(e){return this.workerQueue.enqueue({execute:()=>this.executor.getSignatures(e),meta:{docId:e.id,operation:"getSignatures"}},{priority:u.MEDIUM})}getBookmarks(e){return this.workerQueue.enqueue({execute:()=>this.executor.getBookmarks(e),meta:{docId:e.id,operation:"getBookmarks"}},{priority:u.MEDIUM})}setBookmarks(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.setBookmarks(e,t),meta:{docId:e.id,operation:"setBookmarks"}},{priority:u.MEDIUM})}deleteBookmarks(e){return this.workerQueue.enqueue({execute:()=>this.executor.deleteBookmarks(e),meta:{docId:e.id,operation:"deleteBookmarks"}},{priority:u.MEDIUM})}renderPage(e,t,r){return this.renderWithEncoding(()=>this.executor.renderPageRaw(e,t,r),r,e.id,t.index,u.CRITICAL)}renderPageRect(e,t,r,n){return this.renderWithEncoding(()=>this.executor.renderPageRect(e,t,r,n),n,e.id,t.index,u.HIGH)}renderThumbnail(e,t,r){return this.renderWithEncoding(()=>this.executor.renderThumbnailRaw(e,t,r),r,e.id,t.index,u.MEDIUM)}renderPageAnnotation(e,t,r,n){return this.renderWithEncoding(()=>this.executor.renderPageAnnotationRaw(e,t,r,n),n,e.id,t.index,u.MEDIUM)}renderWithEncoding(e,r,n,i,o=u.CRITICAL){const s=new t,a=this.workerQueue.enqueue({execute:()=>e(),meta:{docId:n,pageIndex:i,operation:"render"}},{priority:o}),c=s.abort.bind(s);return s.abort=e=>{a.abort(e),c(e)},a.wait(e=>{0===s.state.stage&&this.encodeImage(e,r,s)},e=>{0===s.state.stage&&s.fail(e)}),s}encodeImage(e,t,r){const i=(null==t?void 0:t.imageType)??"image/webp",o=null==t?void 0:t.quality,s={data:new Uint8ClampedArray(e.data),width:e.width,height:e.height};this.options.imageConverter(()=>s,i,o).then(e=>r.resolve(e)).catch(e=>r.reject({code:n.Unknown,message:String(e)}))}getPageAnnotations(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageAnnotations(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageAnnotations"}},{priority:u.MEDIUM})}createPageAnnotation(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.createPageAnnotation(e,t,r,n),meta:{docId:e.id,pageIndex:t.index,operation:"createPageAnnotation"}},{priority:u.MEDIUM})}updatePageAnnotation(e,t,r){return this.workerQueue.enqueue({execute:()=>this.executor.updatePageAnnotation(e,t,r),meta:{docId:e.id,pageIndex:t.index,operation:"updatePageAnnotation"}},{priority:u.MEDIUM})}removePageAnnotation(e,t,r){return this.workerQueue.enqueue({execute:()=>this.executor.removePageAnnotation(e,t,r),meta:{docId:e.id,pageIndex:t.index,operation:"removePageAnnotation"}},{priority:u.MEDIUM})}getAllAnnotations(e){const t=this.chunkArray(e.pages,500);this.logger.debug(c,d,`getAllAnnotations: ${e.pages.length} pages in ${t.length} chunks`);const r=new i({aggregate:e=>Object.assign({},...e)});return t.forEach((t,n)=>{const i=this.workerQueue.enqueue({execute:()=>this.executor.getAnnotationsBatch(e,t),meta:{docId:e.id,operation:"getAnnotationsBatch",chunkSize:t.length}},{priority:u.LOW});i.onProgress(e=>{r.progress({page:e.pageIndex,result:e.result})}),r.addChild(i,n)}),r.finalize(),r}getPageTextRects(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageTextRects(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageTextRects"}},{priority:u.MEDIUM})}searchAllPages(e,t,r){const n=Array.isArray(null==r?void 0:r.flags)?r.flags.reduce((e,t)=>e|t,0):(null==r?void 0:r.flags)??0,o=this.chunkArray(e.pages,25);this.logger.debug(c,d,`searchAllPages: ${e.pages.length} pages in ${o.length} chunks`);const s=new i({aggregate:e=>{const t=e.flatMap(e=>Object.values(e).flat());return{results:t,total:t.length}}});return o.forEach((r,i)=>{const o=this.workerQueue.enqueue({execute:()=>this.executor.searchBatch(e,r,t,n),meta:{docId:e.id,operation:"searchBatch",chunkSize:r.length}},{priority:u.LOW});o.onProgress(e=>{s.progress({page:e.pageIndex,results:e.result})}),s.addChild(o,i)}),s.finalize(),s}getAttachments(e){return this.workerQueue.enqueue({execute:()=>this.executor.getAttachments(e),meta:{docId:e.id,operation:"getAttachments"}},{priority:u.MEDIUM})}addAttachment(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.addAttachment(e,t),meta:{docId:e.id,operation:"addAttachment"}},{priority:u.MEDIUM})}removeAttachment(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.removeAttachment(e,t),meta:{docId:e.id,operation:"removeAttachment"}},{priority:u.MEDIUM})}readAttachmentContent(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.readAttachmentContent(e,t),meta:{docId:e.id,operation:"readAttachmentContent"}},{priority:u.MEDIUM})}setFormFieldValue(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.setFormFieldValue(e,t,r,n),meta:{docId:e.id,pageIndex:t.index,operation:"setFormFieldValue"}},{priority:u.MEDIUM})}flattenPage(e,t,r){return this.workerQueue.enqueue({execute:()=>this.executor.flattenPage(e,t,r),meta:{docId:e.id,pageIndex:t.index,operation:"flattenPage"}},{priority:u.MEDIUM})}extractPages(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.extractPages(e,t),meta:{docId:e.id,pageIndexes:t,operation:"extractPages"}},{priority:u.MEDIUM})}extractText(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.extractText(e,t),meta:{docId:e.id,pageIndexes:t,operation:"extractText"}},{priority:u.MEDIUM})}redactTextInRects(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.redactTextInRects(e,t,r,n),meta:{docId:e.id,pageIndex:t.index,operation:"redactTextInRects"}},{priority:u.MEDIUM})}getTextSlices(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getTextSlices(e,t),meta:{docId:e.id,slices:t,operation:"getTextSlices"}},{priority:u.MEDIUM})}getPageGlyphs(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageGlyphs(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageGlyphs"}},{priority:u.MEDIUM})}getPageGeometry(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageGeometry(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageGeometry"}},{priority:u.MEDIUM})}merge(e){return this.workerQueue.enqueue({execute:()=>this.executor.merge(e),meta:{docId:e.map(e=>e.id).join(","),operation:"merge"}},{priority:u.MEDIUM})}mergePages(e){return this.workerQueue.enqueue({execute:()=>this.executor.mergePages(e),meta:{docId:e.map(e=>e.docId).join(","),operation:"mergePages"}},{priority:u.MEDIUM})}preparePrintDocument(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.preparePrintDocument(e,t),meta:{docId:e.id,operation:"preparePrintDocument"}},{priority:u.MEDIUM})}saveAsCopy(e){return this.workerQueue.enqueue({execute:()=>this.executor.saveAsCopy(e),meta:{docId:e.id,operation:"saveAsCopy"}},{priority:u.MEDIUM})}closeDocument(e){return this.workerQueue.enqueue({execute:()=>this.executor.closeDocument(e),meta:{docId:e.id,operation:"closeDocument"}},{priority:u.MEDIUM})}closeAllDocuments(){return this.workerQueue.enqueue({execute:()=>this.executor.closeAllDocuments(),meta:{operation:"closeAllDocuments"}},{priority:u.MEDIUM})}}class g extends Error{constructor(e){super(e),this.name="ImageConverterError"}}const l=(e,t="image/webp",r)=>{if("undefined"==typeof document)return Promise.reject(new g("document is not available. This converter requires a browser environment."));const n=e(),i=new ImageData(n.data,n.width,n.height);return new Promise((e,n)=>{const o=document.createElement("canvas");o.width=i.width,o.height=i.height,o.getContext("2d").putImageData(i,0,0),o.toBlob(t=>{t?e(t):n(new g("Canvas toBlob returned null"))},t,r)})};function p(e){return async(t,r="image/webp",n)=>{try{const i=t(),o=new Uint8ClampedArray(i.data);return await e.encode({data:o,width:i.width,height:i.height},r,n)}catch(e){return console.warn("Worker encoding failed, falling back to main-thread Canvas:",e),l(t,r,n)}}}export{h as P,l as b,p as c};
|
|
1
|
+
import{N as e,T as t,H as r,P as n,I as i}from"./embedpdf-CE93i_Sd.js";const o="TaskQueue",s="Queue";var u=(e=>(e[e.CRITICAL=3]="CRITICAL",e[e.HIGH=2]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=0]="LOW",e))(u||{});class a{constructor(t={}){this.queue=[],this.running=0,this.resultTasks=new Map,this.idleListeners=new Set;const{concurrency:r=1,comparator:n,ranker:i,onIdle:o,maxQueueSize:s,autoStart:u=!0,logger:a}=t;this.logger=a??new e,this.opts={concurrency:Math.max(1,r),comparator:n,ranker:i,onIdle:o??(()=>{}),maxQueueSize:s??Number.POSITIVE_INFINITY,autoStart:u}}setComparator(e){this.opts.comparator=e}setRanker(e){this.opts.ranker=e}size(){return this.queue.length}inFlight(){return this.running}isIdle(){return 0===this.queue.length&&0===this.running}async drain(){this.isIdle()||await new Promise(e=>{const t=()=>{this.isIdle()&&(this.offIdle(t),e())};this.onIdle(t)})}notifyIdle(){this.isIdle()&&([...this.idleListeners].forEach(e=>e()),this.idleListeners.clear(),this.opts.onIdle())}onIdle(e){this.idleListeners.add(e)}offIdle(e){this.idleListeners.delete(e)}enqueue(e,r={}){const n=this.generateId(),i=r.priority??1,u=new t;if(this.queue.length>=this.opts.maxQueueSize){const e=new Error("Queue is full (maxQueueSize reached).");return u.reject(e),u}this.resultTasks.set(n,u);const a={id:n,priority:i,meta:r.meta??e.meta,executeFactory:e.execute};this.queue.push(a),this.logger.debug(o,s,`Task enqueued: ${n} | Priority: ${i} | Running: ${this.running} | Queued: ${this.queue.length}`);const c=u.abort.bind(u);return u.abort=e=>{this.logger.debug(o,s,`Task aborted: ${n}`),this.cancel(n),c(e)},this.opts.autoStart&&this.process(!0===r.fifo),u}cancel(e){const t=this.queue.length;this.queue=this.queue.filter(t=>t.id!==e||(t.cancelled=!0,!1)),this.resultTasks.delete(e),t!==this.queue.length&&(this.logger.debug(o,s,`Task cancelled and removed: ${e}`),this.kick())}kick(){queueMicrotask(()=>this.process())}async process(e=!1){for(this.logger.debug(o,s,`process() called | Running: ${this.running} | Concurrency: ${this.opts.concurrency} | Queued: ${this.queue.length}`);this.running<this.opts.concurrency&&this.queue.length>0;){this.logger.debug(o,s,`Starting new task | Running: ${this.running} | Queued: ${this.queue.length}`),e||this.sortQueue();const t=this.queue.shift();if(t.cancelled){this.logger.debug(o,s,`Skipping cancelled task: ${t.id}`);continue}const r=this.resultTasks.get(t.id);r&&(this.running++,(async()=>{let e=null;try{if(e=t.executeFactory(),!e)throw new Error("Task factory returned null/undefined");e.wait(e=>{0===r.state.stage&&r.resolve(e)},e=>{0===r.state.stage&&("abort"===e.type?r.abort(e.reason):r.reject(e.reason))}),e.onProgress(e=>{r.progress(e)}),await e.toPromise()}catch(e){0===r.state.stage&&r.reject(e)}finally{this.resultTasks.delete(t.id),this.running--,this.logger.debug(o,s,`Task completed: ${t.id} | Running: ${this.running} | Queued: ${this.queue.length}`),this.isIdle()?this.notifyIdle():this.queue.length>0&&this.kick()}})().catch(e=>{this.logger.error(o,s,"Unhandled error in task execution wrapper:",e),this.running=Math.max(0,this.running-1),this.isIdle()?this.notifyIdle():this.queue.length>0&&this.kick()}))}}sortQueue(){const{comparator:e,ranker:t}=this.opts;if(e)return void this.queue.sort(e);const r=new Map,n=e=>t?(r.has(e.id)||r.set(e.id,t(e)),r.get(e.id)):this.defaultRank(e);this.queue.sort((e,t)=>{if(e.priority!==t.priority)return t.priority-e.priority;const r=n(e),i=n(t);return r!==i?i-r:this.extractTime(e.id)-this.extractTime(t.id)})}defaultRank(e){return 0}generateId(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}extractTime(e){const t=Number(e.split("-")[0]);return Number.isFinite(t)?t:0}}const c="PdfEngine",d="Orchestrator";class h{constructor(t,r){this.executor=t,this.logger=r.logger??new e,this.options={imageConverter:r.imageConverter,fetcher:r.fetcher??("undefined"!=typeof fetch?(e,t)=>fetch(e,t):void 0),logger:this.logger},this.workerQueue=new a({concurrency:1,autoStart:!0,logger:this.logger}),this.logger.debug(c,d,"PdfEngine orchestrator created")}chunkArray(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}isSupport(e){const n=new t;return n.resolve([r.Create,r.Read,r.Update,r.Delete]),n}destroy(){const e=new t;try{this.executor.destroy(),e.resolve(!0)}catch(t){e.reject({code:n.Unknown,message:String(t)})}return e}openDocumentUrl(e,r){const i=new t;return(async()=>{try{if(!this.options.fetcher)throw new Error("Fetcher is not set");const t=await this.options.fetcher(e.url,null==r?void 0:r.requestOptions),n=await t.arrayBuffer(),o={id:e.id,content:n};this.openDocumentBuffer(o,{password:null==r?void 0:r.password}).wait(e=>i.resolve(e),e=>i.fail(e))}catch(e){i.reject({code:n.Unknown,message:String(e)})}})(),i}openDocumentBuffer(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.openDocumentBuffer(e,t),meta:{docId:e.id,operation:"openDocumentBuffer"}},{priority:u.CRITICAL})}getMetadata(e){return this.workerQueue.enqueue({execute:()=>this.executor.getMetadata(e),meta:{docId:e.id,operation:"getMetadata"}},{priority:u.MEDIUM})}setMetadata(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.setMetadata(e,t),meta:{docId:e.id,operation:"setMetadata"}},{priority:u.MEDIUM})}getDocPermissions(e){return this.workerQueue.enqueue({execute:()=>this.executor.getDocPermissions(e),meta:{docId:e.id,operation:"getDocPermissions"}},{priority:u.MEDIUM})}getDocUserPermissions(e){return this.workerQueue.enqueue({execute:()=>this.executor.getDocUserPermissions(e),meta:{docId:e.id,operation:"getDocUserPermissions"}},{priority:u.MEDIUM})}getSignatures(e){return this.workerQueue.enqueue({execute:()=>this.executor.getSignatures(e),meta:{docId:e.id,operation:"getSignatures"}},{priority:u.MEDIUM})}getBookmarks(e){return this.workerQueue.enqueue({execute:()=>this.executor.getBookmarks(e),meta:{docId:e.id,operation:"getBookmarks"}},{priority:u.MEDIUM})}setBookmarks(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.setBookmarks(e,t),meta:{docId:e.id,operation:"setBookmarks"}},{priority:u.MEDIUM})}deleteBookmarks(e){return this.workerQueue.enqueue({execute:()=>this.executor.deleteBookmarks(e),meta:{docId:e.id,operation:"deleteBookmarks"}},{priority:u.MEDIUM})}renderPage(e,t,r){return this.renderWithEncoding(()=>this.executor.renderPageRaw(e,t,r),r,e.id,t.index,u.CRITICAL)}renderPageRect(e,t,r,n){return this.renderWithEncoding(()=>this.executor.renderPageRect(e,t,r,n),n,e.id,t.index,u.HIGH)}renderThumbnail(e,t,r){return this.renderWithEncoding(()=>this.executor.renderThumbnailRaw(e,t,r),r,e.id,t.index,u.MEDIUM)}renderPageAnnotation(e,t,r,n){return this.renderWithEncoding(()=>this.executor.renderPageAnnotationRaw(e,t,r,n),n,e.id,t.index,u.MEDIUM)}renderWithEncoding(e,r,n,i,o=u.CRITICAL){const s=new t,a=this.workerQueue.enqueue({execute:()=>e(),meta:{docId:n,pageIndex:i,operation:"render"}},{priority:o}),c=s.abort.bind(s);return s.abort=e=>{a.abort(e),c(e)},a.wait(e=>{0===s.state.stage&&this.encodeImage(e,r,s)},e=>{0===s.state.stage&&s.fail(e)}),s}encodeImage(e,t,r){const i=(null==t?void 0:t.imageType)??"image/webp",o=null==t?void 0:t.quality,s={data:new Uint8ClampedArray(e.data),width:e.width,height:e.height};this.options.imageConverter(()=>s,i,o).then(e=>r.resolve(e)).catch(e=>r.reject({code:n.Unknown,message:String(e)}))}getPageAnnotations(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageAnnotations(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageAnnotations"}},{priority:u.MEDIUM})}createPageAnnotation(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.createPageAnnotation(e,t,r,n),meta:{docId:e.id,pageIndex:t.index,operation:"createPageAnnotation"}},{priority:u.MEDIUM})}updatePageAnnotation(e,t,r){return this.workerQueue.enqueue({execute:()=>this.executor.updatePageAnnotation(e,t,r),meta:{docId:e.id,pageIndex:t.index,operation:"updatePageAnnotation"}},{priority:u.MEDIUM})}removePageAnnotation(e,t,r){return this.workerQueue.enqueue({execute:()=>this.executor.removePageAnnotation(e,t,r),meta:{docId:e.id,pageIndex:t.index,operation:"removePageAnnotation"}},{priority:u.MEDIUM})}getAllAnnotations(e){const t=this.chunkArray(e.pages,500);this.logger.debug(c,d,`getAllAnnotations: ${e.pages.length} pages in ${t.length} chunks`);const r=new i({aggregate:e=>Object.assign({},...e)});return t.forEach((t,n)=>{const i=this.workerQueue.enqueue({execute:()=>this.executor.getAnnotationsBatch(e,t),meta:{docId:e.id,operation:"getAnnotationsBatch",chunkSize:t.length}},{priority:u.LOW});i.onProgress(e=>{r.progress({page:e.pageIndex,result:e.result})}),r.addChild(i,n)}),r.finalize(),r}getPageTextRects(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageTextRects(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageTextRects"}},{priority:u.MEDIUM})}searchAllPages(e,t,r){const n=Array.isArray(null==r?void 0:r.flags)?r.flags.reduce((e,t)=>e|t,0):(null==r?void 0:r.flags)??0,o=this.chunkArray(e.pages,25);this.logger.debug(c,d,`searchAllPages: ${e.pages.length} pages in ${o.length} chunks`);const s=new i({aggregate:e=>{const t=e.flatMap(e=>Object.values(e).flat());return{results:t,total:t.length}}});return o.forEach((r,i)=>{const o=this.workerQueue.enqueue({execute:()=>this.executor.searchBatch(e,r,t,n),meta:{docId:e.id,operation:"searchBatch",chunkSize:r.length}},{priority:u.LOW});o.onProgress(e=>{s.progress({page:e.pageIndex,results:e.result})}),s.addChild(o,i)}),s.finalize(),s}getAttachments(e){return this.workerQueue.enqueue({execute:()=>this.executor.getAttachments(e),meta:{docId:e.id,operation:"getAttachments"}},{priority:u.MEDIUM})}addAttachment(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.addAttachment(e,t),meta:{docId:e.id,operation:"addAttachment"}},{priority:u.MEDIUM})}removeAttachment(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.removeAttachment(e,t),meta:{docId:e.id,operation:"removeAttachment"}},{priority:u.MEDIUM})}readAttachmentContent(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.readAttachmentContent(e,t),meta:{docId:e.id,operation:"readAttachmentContent"}},{priority:u.MEDIUM})}setFormFieldValue(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.setFormFieldValue(e,t,r,n),meta:{docId:e.id,pageIndex:t.index,operation:"setFormFieldValue"}},{priority:u.MEDIUM})}flattenPage(e,t,r){return this.workerQueue.enqueue({execute:()=>this.executor.flattenPage(e,t,r),meta:{docId:e.id,pageIndex:t.index,operation:"flattenPage"}},{priority:u.MEDIUM})}extractPages(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.extractPages(e,t),meta:{docId:e.id,pageIndexes:t,operation:"extractPages"}},{priority:u.MEDIUM})}extractText(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.extractText(e,t),meta:{docId:e.id,pageIndexes:t,operation:"extractText"}},{priority:u.MEDIUM})}redactTextInRects(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.redactTextInRects(e,t,r,n),meta:{docId:e.id,pageIndex:t.index,operation:"redactTextInRects"}},{priority:u.MEDIUM})}getTextSlices(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getTextSlices(e,t),meta:{docId:e.id,slices:t,operation:"getTextSlices"}},{priority:u.MEDIUM})}getPageGlyphs(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageGlyphs(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageGlyphs"}},{priority:u.MEDIUM})}getPageGeometry(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.getPageGeometry(e,t),meta:{docId:e.id,pageIndex:t.index,operation:"getPageGeometry"}},{priority:u.MEDIUM})}merge(e){return this.workerQueue.enqueue({execute:()=>this.executor.merge(e),meta:{docId:e.map(e=>e.id).join(","),operation:"merge"}},{priority:u.MEDIUM})}mergePages(e){return this.workerQueue.enqueue({execute:()=>this.executor.mergePages(e),meta:{docId:e.map(e=>e.docId).join(","),operation:"mergePages"}},{priority:u.MEDIUM})}preparePrintDocument(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.preparePrintDocument(e,t),meta:{docId:e.id,operation:"preparePrintDocument"}},{priority:u.MEDIUM})}saveAsCopy(e){return this.workerQueue.enqueue({execute:()=>this.executor.saveAsCopy(e),meta:{docId:e.id,operation:"saveAsCopy"}},{priority:u.MEDIUM})}closeDocument(e){return this.workerQueue.enqueue({execute:()=>this.executor.closeDocument(e),meta:{docId:e.id,operation:"closeDocument"}},{priority:u.MEDIUM})}closeAllDocuments(){return this.workerQueue.enqueue({execute:()=>this.executor.closeAllDocuments(),meta:{operation:"closeAllDocuments"}},{priority:u.MEDIUM})}setDocumentEncryption(e,t,r,n){return this.workerQueue.enqueue({execute:()=>this.executor.setDocumentEncryption(e,t,r,n),meta:{docId:e.id,operation:"setDocumentEncryption"}},{priority:u.MEDIUM})}removeEncryption(e){return this.workerQueue.enqueue({execute:()=>this.executor.removeEncryption(e),meta:{docId:e.id,operation:"removeEncryption"}},{priority:u.MEDIUM})}unlockOwnerPermissions(e,t){return this.workerQueue.enqueue({execute:()=>this.executor.unlockOwnerPermissions(e,t),meta:{docId:e.id,operation:"unlockOwnerPermissions"}},{priority:u.MEDIUM})}isEncrypted(e){return this.workerQueue.enqueue({execute:()=>this.executor.isEncrypted(e),meta:{docId:e.id,operation:"isEncrypted"}},{priority:u.MEDIUM})}isOwnerUnlocked(e){return this.workerQueue.enqueue({execute:()=>this.executor.isOwnerUnlocked(e),meta:{docId:e.id,operation:"isOwnerUnlocked"}},{priority:u.MEDIUM})}}class g extends Error{constructor(e){super(e),this.name="ImageConverterError"}}const l=(e,t="image/webp",r)=>{if("undefined"==typeof document)return Promise.reject(new g("document is not available. This converter requires a browser environment."));const n=e(),i=new ImageData(n.data,n.width,n.height);return new Promise((e,n)=>{const o=document.createElement("canvas");o.width=i.width,o.height=i.height,o.getContext("2d").putImageData(i,0,0),o.toBlob(t=>{t?e(t):n(new g("Canvas toBlob returned null"))},t,r)})};function p(e){return async(t,r="image/webp",n)=>{try{const i=t(),o=new Uint8ClampedArray(i.data);return await e.encode({data:o,width:i.width,height:i.height},r,n)}catch(e){return console.warn("Worker encoding failed, falling back to main-thread Canvas:",e),l(t,r,n)}}}export{h as P,l as b,p as c};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { AnnotationTool, TrackedAnnotation } from '@embedpdf/plugin-annotation';
|
|
3
|
+
interface DynamicSidebarProps {
|
|
4
|
+
documentId: string;
|
|
5
|
+
/** Selected annotations - length 0 = tool defaults, 1 = single, 2+ = multi */
|
|
6
|
+
annotations: TrackedAnnotation[];
|
|
7
|
+
/** The currently active tool (used when no annotations selected) */
|
|
8
|
+
activeTool: AnnotationTool | null;
|
|
9
|
+
/** Color presets for color pickers */
|
|
10
|
+
colorPresets: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function DynamicSidebar({ documentId, annotations, activeTool, colorPresets, }: DynamicSidebarProps): h.JSX.Element | null;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=dynamic-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/dynamic-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAWhF,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,oEAAoE;IACpE,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;IAClC,sCAAsC;IACtC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAaD,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,GACb,EAAE,mBAAmB,wBA8HrB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PdfAnnotationSubtype } from '@embedpdf/models';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a single editable property in the sidebar.
|
|
4
|
+
*/
|
|
5
|
+
export interface PropertyConfig {
|
|
6
|
+
/** The property key on the annotation object */
|
|
7
|
+
key: string;
|
|
8
|
+
/** The type of UI control to render */
|
|
9
|
+
type: 'color' | 'colorWithTransparent' | 'opacity' | 'slider' | 'strokeStyle' | 'lineEndings' | 'fontFamily' | 'fontSize' | 'fontColor' | 'textAlign' | 'verticalAlign' | 'blendMode';
|
|
10
|
+
/** Translation key for the label */
|
|
11
|
+
labelKey: string;
|
|
12
|
+
/** Minimum value for sliders */
|
|
13
|
+
min?: number;
|
|
14
|
+
/** Maximum value for sliders */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** Step value for sliders */
|
|
17
|
+
step?: number;
|
|
18
|
+
/** Unit to display (e.g., 'px', '%') */
|
|
19
|
+
unit?: string;
|
|
20
|
+
/** Whether to debounce changes (for sliders) */
|
|
21
|
+
debounce?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* All available property configurations.
|
|
25
|
+
* Each property has a unique identifier and its UI configuration.
|
|
26
|
+
*/
|
|
27
|
+
export declare const PROPERTY_CONFIGS: Record<string, PropertyConfig>;
|
|
28
|
+
/**
|
|
29
|
+
* Maps annotation types to their ordered list of editable properties.
|
|
30
|
+
* The order determines the display order in the sidebar.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ANNOTATION_PROPERTIES: Partial<Record<PdfAnnotationSubtype, string[]>>;
|
|
33
|
+
/**
|
|
34
|
+
* Computes the intersection of editable properties for the given annotation types.
|
|
35
|
+
* Returns properties in the order they appear in the first type's property list.
|
|
36
|
+
*
|
|
37
|
+
* @param types - Array of annotation subtypes to compute intersection for
|
|
38
|
+
* @returns Array of property keys that are shared by ALL given types
|
|
39
|
+
*/
|
|
40
|
+
export declare function getSharedProperties(types: PdfAnnotationSubtype[]): string[];
|
|
41
|
+
//# sourceMappingURL=property-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-schema.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/property-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,IAAI,EACA,OAAO,GACP,sBAAsB,GACtB,SAAS,GACT,QAAQ,GACR,aAAa,GACb,aAAa,GACb,YAAY,GACZ,UAAU,GACV,WAAW,GACX,WAAW,GACX,eAAe,GACf,WAAW,CAAC;IAChB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA2E3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC,CAyCjF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAe3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @jsxImportSource preact */
|
|
2
|
+
import { h } from 'preact';
|
|
3
|
+
import { PropertyConfig } from './property-schema';
|
|
4
|
+
export interface PropertySectionProps {
|
|
5
|
+
config: PropertyConfig;
|
|
6
|
+
value: any;
|
|
7
|
+
onChange: (value: any) => void;
|
|
8
|
+
colorPresets: string[];
|
|
9
|
+
translate: (key: string) => string;
|
|
10
|
+
}
|
|
11
|
+
export declare function PropertySection(props: PropertySectionProps): h.JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=property-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-sections.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/property-sections.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAoBrC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAmBnD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAOD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,wBA+B1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/annotation-sidebar.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"annotation-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/annotation-sidebar.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAgC3B,wBAAgB,iBAAiB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,wBAoEvE"}
|
package/dist/components/app.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
import { PluginRegistry } from '@embedpdf/core';
|
|
2
|
+
import { PluginRegistry, PermissionConfig } from '@embedpdf/core';
|
|
3
3
|
import { ViewportPluginConfig } from '@embedpdf/plugin-viewport/preact';
|
|
4
4
|
import { ScrollPluginConfig } from '@embedpdf/plugin-scroll/preact';
|
|
5
5
|
import { SpreadPluginConfig } from '@embedpdf/plugin-spread/preact';
|
|
@@ -37,6 +37,18 @@ export interface PDFViewerConfig {
|
|
|
37
37
|
wasmUrl?: string;
|
|
38
38
|
/** Enable debug logging. Default: false */
|
|
39
39
|
log?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Global permission configuration applied to all documents.
|
|
42
|
+
* Per-document permissions (in documentManager.initialDocuments) can override these.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Disable printing globally
|
|
46
|
+
* permissions: { overrides: { print: false } }
|
|
47
|
+
*
|
|
48
|
+
* // Ignore PDF permissions entirely (allow all by default)
|
|
49
|
+
* permissions: { enforceDocumentPermissions: false }
|
|
50
|
+
*/
|
|
51
|
+
permissions?: PermissionConfig;
|
|
40
52
|
/** Theme configuration */
|
|
41
53
|
theme?: ThemeConfig;
|
|
42
54
|
/** Custom icons */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/components/app.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAA4B,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/components/app.tsx"],"names":[],"mappings":"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"}
|
|
@@ -8,7 +8,8 @@ interface AnnotationCardProps {
|
|
|
8
8
|
onDelete: (annotation: TrackedAnnotation) => void;
|
|
9
9
|
onReply: (inReplyToId: string, contents: string) => void;
|
|
10
10
|
documentId: string;
|
|
11
|
+
isReadOnly?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare const AnnotationCard: ({ entry, isSelected, onSelect, onUpdate, onDelete, onReply, documentId, }: AnnotationCardProps) => h.JSX.Element | null;
|
|
13
|
+
export declare const AnnotationCard: ({ entry, isSelected, onSelect, onUpdate, onDelete, onReply, documentId, isReadOnly, }: AnnotationCardProps) => h.JSX.Element | null;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=annotation-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-card.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAUxF,UAAU,mBAAmB;IAC3B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"annotation-card.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAUxF,UAAU,mBAAmB;IAC3B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,GAAI,uFAS5B,mBAAmB,yBA0IrB,CAAC"}
|
|
@@ -6,7 +6,8 @@ interface CommentProps {
|
|
|
6
6
|
onDelete: () => void;
|
|
7
7
|
isReply?: boolean;
|
|
8
8
|
documentId: string;
|
|
9
|
+
isReadOnly?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const Comment: ({ annotation, onSave, onDelete, isReply, documentId, }: CommentProps) => h.JSX.Element;
|
|
11
|
+
export declare const Comment: ({ annotation, onSave, onDelete, isReply, documentId, isReadOnly, }: CommentProps) => h.JSX.Element;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=comment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/comment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,UAAU,YAAY;IACpB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/comment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,UAAU,YAAY;IACpB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,GAAI,oEAOrB,YAAY,kBAuEd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/comment-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"comment-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/comment-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAgB3B,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,gBAAgB,mBAAmB,kBAoKjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-link.d.ts","sourceRoot":"","sources":["../../../src/components/icons/external-link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,gBAAgB,EAAE,aAe9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eye-off.d.ts","sourceRoot":"","sources":["../../../src/components/icons/eye-off.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,UAAU,GAAI,4BAAsC,SAAS,kBAiBzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eye.d.ts","sourceRoot":"","sources":["../../../src/components/icons/eye.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,OAAO,GAAI,4BAAsC,SAAS,kBAiBtE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../src/components/icons/group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,SAAS,GAAI,wDAMvB,SAAS,kBAyBX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/icons/index.tsx"],"names":[],"mappings":"AAgEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/icons/index.tsx"],"names":[],"mappings":"AAgEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAkBxC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAiFnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/components/icons/info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,QAAQ,GAAI,4BAAsC,SAAS,kBAkBvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-off.d.ts","sourceRoot":"","sources":["../../../src/components/icons/link-off.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,WAAW,GAAI,wDAMzB,SAAS,kBAoBX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/components/icons/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,QAAQ,GAAI,wDAMtB,SAAS,kBAmBX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marquee-select.d.ts","sourceRoot":"","sources":["../../../src/components/icons/marquee-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,iBAAiB,GAAI,wDAM/B,SAAS,kBAyBX,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
1
|
+
import { FunctionComponent, CSSProperties } from 'preact';
|
|
2
2
|
export type IconProps = {
|
|
3
3
|
size?: number;
|
|
4
4
|
strokeWidth?: number;
|
|
@@ -6,6 +6,7 @@ export type IconProps = {
|
|
|
6
6
|
secondaryColor?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
title?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
9
10
|
};
|
|
10
11
|
export type IconComponent = FunctionComponent<IconProps>;
|
|
11
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/icons/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/icons/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ungroup.d.ts","sourceRoot":"","sources":["../../../src/components/icons/ungroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,WAAW,GAAI,wDAMzB,SAAS,kBAkBX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlock.d.ts","sourceRoot":"","sources":["../../../src/components/icons/unlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,UAAU,GAAI,4BAAsC,SAAS,kBAiBzE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
interface LinkModalProps {
|
|
3
|
+
documentId: string;
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
onExited?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function LinkModal({ documentId, isOpen, onClose, onExited }: LinkModalProps): h.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=link-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-modal.d.ts","sourceRoot":"","sources":["../../src/components/link-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAuB3B,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,cAAc,iBAqNlF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfPermissionFlag } from '@embedpdf/models';
|
|
3
|
+
interface PermissionsDisplayProps {
|
|
4
|
+
permissions: number;
|
|
5
|
+
translate: (key: string) => string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
interface PermissionOption {
|
|
9
|
+
flag: PdfPermissionFlag;
|
|
10
|
+
labelKey: string;
|
|
11
|
+
}
|
|
12
|
+
declare const PERMISSION_OPTIONS: PermissionOption[];
|
|
13
|
+
export declare function PermissionsDisplay({ permissions, translate, label }: PermissionsDisplayProps): h.JSX.Element;
|
|
14
|
+
export { PERMISSION_OPTIONS };
|
|
15
|
+
export type { PermissionOption };
|
|
16
|
+
//# sourceMappingURL=permissions-display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions-display.d.ts","sourceRoot":"","sources":["../../src/components/permissions-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,UAAU,uBAAuB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,kBAAkB,EAAE,gBAAgB,EAYzC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,uBAAuB,iBAiC5F;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
interface ProtectModalProps {
|
|
3
|
+
documentId: string;
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
onExited?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ProtectModal({ documentId, isOpen, onClose, onExited }: ProtectModalProps): h.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=protect-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protect-modal.d.ts","sourceRoot":"","sources":["../../src/components/protect-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAY3B,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,iBAAiB,iBAskBxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlock-owner-overlay.d.ts","sourceRoot":"","sources":["../../src/components/unlock-owner-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAQ3B,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,uBAAuB,wBAkEzE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
interface ViewPermissionsModalProps {
|
|
3
|
+
documentId: string;
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
onExited?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ViewPermissionsModal({ documentId, isOpen, onClose, onExited, }: ViewPermissionsModalProps): h.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=view-permissions-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-permissions-modal.d.ts","sourceRoot":"","sources":["../../src/components/view-permissions-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAW3B,UAAU,yBAAyB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,UAAU,EACV,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,yBAAyB,iBA8H3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/config/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/config/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAwB3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAiChC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAg3DnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/config/translations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/config/translations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,eAAO,MAAM,mBAAmB,EAAE,MAiUjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAkUhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAkU/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAkUhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAkUjC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,MA4T3C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,KAAK,CAShD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-schema.d.ts","sourceRoot":"","sources":["../../src/config/ui-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"ui-schema.d.ts","sourceRoot":"","sources":["../../src/config/ui-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,QA+5C5B,CAAC"}
|