@embedpdf/snippet 2.1.1 → 2.2.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.
Files changed (53) hide show
  1. package/dist/{browser-awZxztMA-K_rXQQYD.js → browser-awZxztMA-DP8ttsSz.js} +1 -1
  2. package/dist/components/app.d.ts +13 -1
  3. package/dist/components/app.d.ts.map +1 -1
  4. package/dist/components/capture.d.ts +9 -1
  5. package/dist/components/capture.d.ts.map +1 -1
  6. package/dist/components/comment-sidebar/annotation-card.d.ts +2 -1
  7. package/dist/components/comment-sidebar/annotation-card.d.ts.map +1 -1
  8. package/dist/components/comment-sidebar/annotation-icon.d.ts +2 -1
  9. package/dist/components/comment-sidebar/annotation-icon.d.ts.map +1 -1
  10. package/dist/components/comment-sidebar/comment.d.ts +2 -1
  11. package/dist/components/comment-sidebar/comment.d.ts.map +1 -1
  12. package/dist/components/comment-sidebar/config.d.ts +1 -0
  13. package/dist/components/comment-sidebar/config.d.ts.map +1 -1
  14. package/dist/components/comment-sidebar.d.ts.map +1 -1
  15. package/dist/components/hint-layer.d.ts +4 -1
  16. package/dist/components/hint-layer.d.ts.map +1 -1
  17. package/dist/components/icons/eye-off.d.ts +4 -0
  18. package/dist/components/icons/eye-off.d.ts.map +1 -0
  19. package/dist/components/icons/eye.d.ts +4 -0
  20. package/dist/components/icons/eye.d.ts.map +1 -0
  21. package/dist/components/icons/index.d.ts.map +1 -1
  22. package/dist/components/icons/info.d.ts +4 -0
  23. package/dist/components/icons/info.d.ts.map +1 -0
  24. package/dist/components/icons/types.d.ts +2 -1
  25. package/dist/components/icons/types.d.ts.map +1 -1
  26. package/dist/components/icons/unlock.d.ts +4 -0
  27. package/dist/components/icons/unlock.d.ts.map +1 -0
  28. package/dist/components/permissions-display.d.ts +16 -0
  29. package/dist/components/permissions-display.d.ts.map +1 -0
  30. package/dist/components/print-modal.d.ts.map +1 -1
  31. package/dist/components/protect-modal.d.ts +10 -0
  32. package/dist/components/protect-modal.d.ts.map +1 -0
  33. package/dist/components/ui/dialog.d.ts +1 -3
  34. package/dist/components/ui/dialog.d.ts.map +1 -1
  35. package/dist/components/unlock-owner-overlay.d.ts +7 -0
  36. package/dist/components/unlock-owner-overlay.d.ts.map +1 -0
  37. package/dist/components/view-permissions-modal.d.ts +10 -0
  38. package/dist/components/view-permissions-modal.d.ts.map +1 -0
  39. package/dist/config/commands.d.ts.map +1 -1
  40. package/dist/config/translations.d.ts +1 -0
  41. package/dist/config/translations.d.ts.map +1 -1
  42. package/dist/config/ui-schema.d.ts.map +1 -1
  43. package/dist/direct-engine-m4-HnUa2.js +1 -0
  44. package/dist/embedpdf-T0lTFeLi.js +3 -0
  45. package/dist/embedpdf.js +1 -1
  46. package/dist/pdfium.wasm +0 -0
  47. package/dist/worker-engine-Ch3J8jLj.js +1 -0
  48. package/package.json +31 -32
  49. package/dist/components/annotation-menu.d.ts +0 -9
  50. package/dist/components/annotation-menu.d.ts.map +0 -1
  51. package/dist/direct-engine-Db2HQG7S.js +0 -1
  52. package/dist/embedpdf-Ob4AJbqq.js +0 -3
  53. package/dist/worker-engine-BwJuk6Jt.js +0 -1
@@ -1 +1 @@
1
- import{N as e,T as t,G as r,P as n,H as i}from"./embedpdf-Ob4AJbqq.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,G as r,P as n,H as i}from"./embedpdf-T0lTFeLi.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};
@@ -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;AAG1E,OAAO,EAGL,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAIL,cAAc,EAGf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,2BAA2B,EAI5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAyB,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAqB,gBAAgB,EAAmB,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAIL,gBAAgB,EAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAA+B,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAA0B,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAsB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAEL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAyB,oBAAoB,EAAE,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AAC;IAG5C,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC9C,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,qCAAqC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,uBAAuB;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1C,yBAAyB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAG9C,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvC,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnC,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAG7C,2BAA2B;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvC,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC9D;AAuDD,UAAU,cAAc;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CACtD;AAgID,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,cAAc,iBAqLpE"}
@@ -1,3 +1,11 @@
1
1
  import { h } from 'preact';
2
- export declare function Capture(): h.JSX.Element;
2
+ export interface CaptureData {
3
+ pageIndex: number;
4
+ rect: any;
5
+ blob: Blob;
6
+ }
7
+ export interface CaptureProps {
8
+ documentId: string;
9
+ }
10
+ export declare function Capture({ documentId }: CaptureProps): h.JSX.Element;
3
11
  //# sourceMappingURL=capture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/components/capture.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAYrC,wBAAgB,OAAO,kBAuGtB"}
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/components/capture.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAOrC,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,UAAU,EAAE,EAAE,YAAY,iBA6GnD"}
@@ -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;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,2EAQ5B,mBAAmB,yBAkIrB,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"}
@@ -1,9 +1,10 @@
1
1
  import { h } from 'preact';
2
2
  import { TrackedAnnotation } from '@embedpdf/plugin-annotation';
3
3
  import { AnnotationConfig } from './config';
4
- export declare const AnnotationIcon: ({ annotation, config, className, }: {
4
+ export declare const AnnotationIcon: ({ annotation, config, className, title, }: {
5
5
  annotation: TrackedAnnotation;
6
6
  config: AnnotationConfig;
7
7
  className?: string;
8
+ title: string;
8
9
  }) => h.JSX.Element;
9
10
  //# sourceMappingURL=annotation-icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotation-icon.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,cAAc,GAAI,oCAI5B;IACD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kBAWA,CAAC"}
1
+ {"version":3,"file":"annotation-icon.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,cAAc,GAAI,2CAK5B;IACD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,kBAWA,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;CACpB;AAED,eAAO,MAAM,OAAO,GAAI,wDAMrB,YAAY,kBAqEd,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"}
@@ -2,6 +2,7 @@ import { PdfAnnotationObject } from '@embedpdf/models';
2
2
  import { SidebarSubtype, TrackedAnnotation } from '@embedpdf/plugin-annotation';
3
3
  export interface AnnotationConfig {
4
4
  label: string;
5
+ labelKey: string;
5
6
  icon: string;
6
7
  iconProps: (annotation: PdfAnnotationObject) => {
7
8
  primaryColor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA8C,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAEL,cAAc,EACd,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK;QAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAwFtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,YAAY,iBAAiB,KAAG,gBAAgB,GAAG,IAKtF,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA8C,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAEL,cAAc,EACd,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK;QAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAoGtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,YAAY,iBAAiB,KAAG,gBAAgB,GAAG,IAKtF,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;AAe3B,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,gBAAgB,mBAAmB,kBA+JjE,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"}
@@ -1,3 +1,6 @@
1
1
  import { h } from 'preact';
2
- export declare const HintLayer: () => h.JSX.Element | null;
2
+ export interface HintLayerProps {
3
+ documentId: string;
4
+ }
5
+ export declare const HintLayer: ({ documentId }: HintLayerProps) => h.JSX.Element | null;
3
6
  //# sourceMappingURL=hint-layer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hint-layer.d.ts","sourceRoot":"","sources":["../../src/components/hint-layer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAU3B,eAAO,MAAM,SAAS,4BAqPrB,CAAC"}
1
+ {"version":3,"file":"hint-layer.d.ts","sourceRoot":"","sources":["../../src/components/hint-layer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAW3B,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GAAI,gBAAgB,cAAc,yBAsPvD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { h } from 'preact';
2
+ import { IconProps } from './types';
3
+ export declare const EyeOffIcon: ({ size, className, style }: IconProps) => h.JSX.Element;
4
+ //# sourceMappingURL=eye-off.d.ts.map
@@ -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,4 @@
1
+ import { h } from 'preact';
2
+ import { IconProps } from './types';
3
+ export declare const EyeIcon: ({ size, className, style }: IconProps) => h.JSX.Element;
4
+ //# sourceMappingURL=eye.d.ts.map
@@ -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"}
@@ -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;AAQxC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAuEnB,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;AAYxC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KA2EnB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { h } from 'preact';
2
+ import { IconProps } from './types';
3
+ export declare const InfoIcon: ({ size, className, style }: IconProps) => h.JSX.Element;
4
+ //# sourceMappingURL=info.d.ts.map
@@ -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"}
@@ -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;AAE3C,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;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC,SAAS,CAAC,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,4 @@
1
+ import { h } from 'preact';
2
+ import { IconProps } from './types';
3
+ export declare const UnlockIcon: ({ size, className, style }: IconProps) => h.JSX.Element;
4
+ //# sourceMappingURL=unlock.d.ts.map
@@ -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,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"print-modal.d.ts","sourceRoot":"","sources":["../../src/components/print-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAW3B,UAAU,eAAe;IACvB,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,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,iBA4LpF"}
1
+ {"version":3,"file":"print-modal.d.ts","sourceRoot":"","sources":["../../src/components/print-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAY3B,UAAU,eAAe;IACvB,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,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,iBAqMpF"}
@@ -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"}
@@ -15,8 +15,6 @@ export interface DialogProps {
15
15
  className?: string;
16
16
  /** Whether to show close button */
17
17
  showCloseButton?: boolean;
18
- /** Maximum width of the dialog */
19
- maxWidth?: string;
20
18
  }
21
- export declare function Dialog({ open, title, children, onClose, onExited, className, showCloseButton, maxWidth, }: DialogProps): h.JSX.Element | null;
19
+ export declare function Dialog({ open, title, children, onClose, onExited, className, showCloseButton, }: DialogProps): h.JSX.Element | null;
22
20
  //# sourceMappingURL=dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAK9C,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAsB,EACtB,QAAkB,GACnB,EAAE,WAAW,wBA6Fb"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAM9C,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAsB,GACvB,EAAE,WAAW,wBA+Fb"}
@@ -0,0 +1,7 @@
1
+ import { h } from 'preact';
2
+ interface UnlockOwnerOverlayProps {
3
+ documentId: string;
4
+ }
5
+ export declare function UnlockOwnerOverlay({ documentId }: UnlockOwnerOverlayProps): h.JSX.Element | null;
6
+ export {};
7
+ //# sourceMappingURL=unlock-owner-overlay.d.ts.map
@@ -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;AAuB3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAQhC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAo/CnD,CAAC"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/config/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAuB3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AA+BhC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CA0lDnD,CAAC"}
@@ -5,5 +5,6 @@ export declare const germanTranslations: Locale;
5
5
  export declare const dutchTranslations: Locale;
6
6
  export declare const frenchTranslations: Locale;
7
7
  export declare const spanishTranslations: Locale;
8
+ export declare const simplifiedChineseTranslations: Locale;
8
9
  export declare const paramResolvers: ParamResolvers<State>;
9
10
  //# sourceMappingURL=translations.d.ts.map
@@ -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,MAiMjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAiMhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAkM/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAiMhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAkMjC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,KAAK,CAShD,CAAC"}
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,MA8SjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MA+ShC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MA+S/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MA+ShC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MA+SjC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,MAyS3C,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,QAqxC5B,CAAC"}
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,QAo2C5B,CAAC"}