@copio/sdk 0.1.2 → 0.1.4

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 (105) hide show
  1. package/LICENSE +661 -0
  2. package/LICENSE-COMMERCIAL.md +43 -0
  3. package/README.md +155 -147
  4. package/THIRD_PARTY_NOTICES.md +416 -0
  5. package/dist/adapters/image/canvas2d-adapter.js +1 -1
  6. package/dist/adapters/image/index.js +1 -1
  7. package/dist/adapters/image/null-image-processor-adapter.js +1 -1
  8. package/dist/adapters/index.js +1 -1
  9. package/dist/adapters/indexeddb-adapter.js +1 -1
  10. package/dist/adapters/memory-adapter.js +1 -1
  11. package/dist/adapters/ocr/index.js +1 -1
  12. package/dist/adapters/ocr/null-ocr-adapter.js +1 -1
  13. package/dist/adapters/ocr/tesseract-wasm-adapter.js +1 -1
  14. package/dist/adapters/pdf/index.js +1 -1
  15. package/dist/adapters/pdf/null-pdf-adapter.js +1 -1
  16. package/dist/adapters/pdf/pdfkit-adapter.js +1 -1
  17. package/dist/adapters/storage/index.js +1 -1
  18. package/dist/adapters/storage/indexeddb-adapter.js +1 -1
  19. package/dist/adapters/storage/memory-adapter.js +1 -1
  20. package/dist/adapters/sync/index.js +1 -1
  21. package/dist/adapters/sync/null-sync-adapter.js +1 -1
  22. package/dist/adapters/sync/peerjs-adapter.js +1 -1
  23. package/dist/cdn.js +56 -1276
  24. package/dist/{chunk-A5G52Q2W.js → chunk-2AB5L3Y2.js} +2 -2
  25. package/dist/{chunk-DGGK5KEX.js → chunk-4ICUYKSR.js} +2 -2
  26. package/dist/{chunk-E7JYVRJA.js → chunk-5OTO5WFV.js} +2 -2
  27. package/dist/{chunk-N4R55VRR.js → chunk-6DSLE3AY.js} +1 -1
  28. package/dist/chunk-DIU5BGU5.js +2 -0
  29. package/dist/chunk-FAVTIE3M.js +8 -0
  30. package/dist/chunk-FFRDPFTS.js +1395 -0
  31. package/dist/chunk-FQRADJY6.js +2 -0
  32. package/dist/{chunk-N7Q34F2P.js → chunk-G5EUMLYT.js} +4 -4
  33. package/dist/{chunk-IUBYFIV6.js → chunk-GGERQ3CJ.js} +11 -11
  34. package/dist/chunk-IBF5HCYT.js +2 -0
  35. package/dist/{chunk-PVNRK4OH.js → chunk-J7HWZNIP.js} +2 -2
  36. package/dist/chunk-K4NR6OAC.js +2 -0
  37. package/dist/{chunk-SH4P4XSZ.js → chunk-KH5JE65X.js} +2 -2
  38. package/dist/chunk-L4OVZN23.js +2 -0
  39. package/dist/chunk-MEE2NNYB.js +2 -0
  40. package/dist/{chunk-KIMVF5UG.js → chunk-NEEWG3OP.js} +1 -1
  41. package/dist/chunk-NQW6FFN7.js +50 -0
  42. package/dist/{chunk-YHLOPPXM.js → chunk-O6FQFVKY.js} +1 -1
  43. package/dist/{chunk-B7HT2X67.js → chunk-U3V3VZGO.js} +2 -2
  44. package/dist/{chunk-HN3336JN.js → chunk-ULTSZWZO.js} +1 -1
  45. package/dist/{chunk-BKZEOOH4.js → chunk-WETG2JD7.js} +2 -2
  46. package/dist/{chunk-V2FP4EEH.js → chunk-YNY65JUJ.js} +1 -1
  47. package/dist/chunk-ZT72PD2C.js +2 -0
  48. package/dist/core.js +1 -1
  49. package/dist/custom-elements.json +464 -1812
  50. package/dist/export.js +1 -1
  51. package/dist/index.js +11 -19
  52. package/dist/ocr.js +1 -1
  53. package/dist/scanner.js +24 -1257
  54. package/dist/sync.js +1 -1
  55. package/dist/types/js/adapters/storage/blob-store.d.ts +48 -0
  56. package/dist/types/js/adapters/storage/index.d.ts +11 -4
  57. package/dist/types/js/adapters/storage/indexeddb-adapter.d.ts +46 -9
  58. package/dist/types/js/adapters/storage/memory-adapter.d.ts +7 -0
  59. package/dist/types/js/adapters/storage/opfs-adapter.d.ts +160 -0
  60. package/dist/types/js/adapters/storage/storage-port.d.ts +7 -0
  61. package/dist/types/js/routes/ocr/copio-doc-ocr-dialog.d.ts +0 -2
  62. package/dist/types/js/services/doc-repository.d.ts +1 -0
  63. package/dist/types/js/services/export-utils.d.ts +8 -12
  64. package/dist/types/js/services/ocr-service.d.ts +2 -1
  65. package/dist/types/js/utils/module-loader.d.ts +0 -6
  66. package/dist/types/js/utils/utils.d.ts +5 -3
  67. package/dist/types/sdk/core.d.ts +13 -2
  68. package/dist/types/sdk/elements.d.ts +0 -12
  69. package/dist/types/sdk/events.d.ts +4 -4
  70. package/dist/types/sdk/index.d.ts +3 -9
  71. package/dist/types/sdk/models.d.ts +66 -0
  72. package/dist/types/sdk/scanner.d.ts +2 -7
  73. package/dist/types/sdk/styles.d.ts +1 -1
  74. package/dist/types/sdk/version.d.ts +1 -1
  75. package/package.json +4 -3
  76. package/sdk/cdn.js +1 -0
  77. package/sdk/core.js +60 -0
  78. package/sdk/events.js +3 -2
  79. package/sdk/index.js +4 -9
  80. package/sdk/license.js +1 -0
  81. package/sdk/models.js +79 -3
  82. package/sdk/scanner.js +50 -19
  83. package/sdk/styles.js +12 -5
  84. package/sdk/sync.js +1 -0
  85. package/sdk/version.js +2 -1
  86. package/dist/chunk-36F637QU.js +0 -2
  87. package/dist/chunk-4JPEWIT4.js +0 -2
  88. package/dist/chunk-B2EK6INF.js +0 -2
  89. package/dist/chunk-B5BEYYR2.js +0 -8
  90. package/dist/chunk-G65H4ZTJ.js +0 -2
  91. package/dist/chunk-HS6GDZIS.js +0 -2
  92. package/dist/chunk-IZOWC74B.js +0 -2601
  93. package/dist/chunk-K6YP7EET.js +0 -8
  94. package/dist/chunk-LI54F6PA.js +0 -2
  95. package/dist/chunk-OI4WCW7E.js +0 -2
  96. package/dist/chunk-UCV3MQ6I.js +0 -33
  97. package/dist/chunk-XEN5VKAV.js +0 -19
  98. package/dist/types/js/components/copio-header.d.ts +0 -19
  99. package/dist/types/js/components/copio-loader.d.ts +0 -6
  100. package/dist/types/js/core/store.d.ts +0 -2
  101. package/dist/types/js/routes/add-edit/copio-add-edit-dialog.d.ts +0 -9
  102. package/dist/types/js/routes/doc/copio-carousel.d.ts +0 -43
  103. package/dist/types/js/routes/doc/copio-images.d.ts +0 -37
  104. package/dist/types/js/routes/home/copio-row.d.ts +0 -49
  105. package/dist/types/js/styles/cropper-styles.d.ts +0 -5
package/dist/export.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e}from"./chunk-K6YP7EET.js";import"./chunk-IUBYFIV6.js";import"./chunk-V2FP4EEH.js";import"./chunk-G65H4ZTJ.js";import"./chunk-4C666HHU.js";export{d as exportDocumentAsImages,e as exportDocumentAsMarkdown,c as exportDocumentAsPdf,b as renderMarkdownToPageDataUrls,a as renderMarkdownToPdf};
1
+ import{a,b}from"./chunk-MEE2NNYB.js";import"./chunk-YNY65JUJ.js";import"./chunk-ZT72PD2C.js";import"./chunk-4C666HHU.js";export{b as exportDocumentAsImages,a as exportDocumentAsPdf};
2
2
  //# sourceMappingURL=export.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j as ve}from"./chunk-IZOWC74B.js";import{a as E,b as R,c as G,d as J,e as X,f as Y,g as ee,h as te,i as se,j as oe,k as re,o as a,p as ie,q as ae}from"./chunk-HS6GDZIS.js";import{a as we}from"./chunk-UCV3MQ6I.js";import{b as r,c as b}from"./chunk-XEN5VKAV.js";import"./chunk-V6E2SSSW.js";import{a as Pe}from"./chunk-A5G52Q2W.js";import{a as ke}from"./chunk-PVNRK4OH.js";import{a as Oe}from"./chunk-KIMVF5UG.js";import"./chunk-PUJYN435.js";import{a as m}from"./chunk-DGGK5KEX.js";import"./chunk-CWCS22CQ.js";import{a as u}from"./chunk-B2EK6INF.js";import"./chunk-4GEMGDRU.js";import{a as $,b as A,c as O,e as k,f as P,g as I,l as c}from"./chunk-N7Q34F2P.js";import{a as q}from"./chunk-SH4P4XSZ.js";import{a as Z}from"./chunk-HN3336JN.js";import{a as T}from"./chunk-36F637QU.js";import{a as w}from"./chunk-4JPEWIT4.js";import{a as F}from"./chunk-B7HT2X67.js";import{a as V}from"./chunk-N4R55VRR.js";import{a as Q}from"./chunk-E7JYVRJA.js";import{a as H}from"./chunk-YHLOPPXM.js";import{b as g}from"./chunk-BKZEOOH4.js";import{a as p,b as Se,c as Ce,d,e as h}from"./chunk-B5BEYYR2.js";import{c as Te,d as $e,e as Ae,f as y}from"./chunk-K6YP7EET.js";import{a as ne}from"./chunk-IUBYFIV6.js";import{a as le,b as ce,c as pe,d as i}from"./chunk-V2FP4EEH.js";import{a as D,b as N,c as _,d as L,e as M,f as U,g as z,h as B,i as W,j,k as K}from"./chunk-G65H4ZTJ.js";import{a as C}from"./chunk-OI4WCW7E.js";import{a as S}from"./chunk-LI54F6PA.js";import"./chunk-4C666HHU.js";var l=class extends b{#e=null;static properties={isOpen:{type:Boolean,state:!0},docId:{type:String,state:!0},docName:{type:String,state:!0},pages:{type:Array,state:!0},lang:{type:String,state:!0},step:{type:String,state:!0},progress:{type:Number,state:!0},statusMessage:{type:String,state:!0},resultText:{type:String,state:!0},confidence:{type:Number,state:!0},copied:{type:Boolean,state:!0}};createRenderRoot(){return this}disconnectedCallback(){super.disconnectedCallback(),this.#e&&(this.#e.abort(),this.#e=null),h(),this.isOpen=!1}constructor(){super(),this.isOpen=!1,this.docId="",this.docName="",this.pages=[],this.lang="eng",this.step="processing",this.progress=0,this.statusMessage="Starting OCR engine...",this.resultText="",this.confidence=0,this.copied=!1,this._pageIndex=null,this.#e=null}open(e,s,t,o="eng"){this._pageIndex=null,this._openInternal(e,s,t,o)}openPage(e,s,t,o,n="eng"){this._pageIndex=o,this._openInternal(e,s,[t],n)}_openInternal(e,s,t,o){if(this.#e&&(this.#e.abort(),this.#e=null),this.docId=e,this.docName=s||"Document",this.pages=t||[],this.lang=o,this.progress=0,this.resultText="",this.confidence=0,this.copied=!1,(this.pages||[]).filter(x=>x.type!=="markdown"&&x.src).length===0){this.step="empty",this.statusMessage="This document does not contain any image pages for text recognition.",this.isOpen=!0;return}this.step="processing",this.statusMessage=typeof window<"u"&&!window.Tesseract?"Downloading OCR engine...":"Starting OCR engine...",this.isOpen=!0,this.startOcr(o)}cancel=()=>{this.#e&&(this.#e.abort(),this.#e=null),this.close()};close=()=>{this.#e&&(this.#e.abort(),this.#e=null),this.isOpen=!1};async startOcr(e="eng"){this.#e&&(this.#e.abort(),this.#e=null),this.#e=new AbortController;let{signal:s}=this.#e;try{let t=await d(this.pages,{lang:e,abortSignal:s,onPageProgress:({overallProgress:o,message:n})=>{this.isOpen&&!s.aborted&&(this.progress=Math.round((o||0)*100),this.statusMessage=n)}});this.isOpen&&!s.aborted&&(this.step="done",this.resultText=t.combinedText||"",this.confidence=t.averageConfidence||0,i.success("Text recognition complete"))}catch(t){if(t.name==="AbortError"||s.aborted)return;console.error("Document OCR Error:",t),this.isOpen&&(this.step="error",this.statusMessage=t.message||"Text recognition failed",i.error(t.message||"Text recognition failed"))}finally{this.#e?.signal===s&&(this.#e=null)}}handleLangChange=e=>{let s=e.target.value;this.lang=s,this.step="processing",this.progress=0,this.statusMessage="Starting OCR engine with new language...",this.startOcr(s)};handleTextInput=e=>{this.resultText=e.target.value};copyText=async()=>{if(this.resultText)try{await navigator.clipboard.writeText(this.resultText),this.copied=!0,i.success("Copied text to clipboard"),setTimeout(()=>{this.copied=!1},2e3)}catch(e){console.error("Failed to copy text:",e),i.error("Failed to copy text to clipboard")}};downloadMarkdown=()=>{if(!this.resultText)return;let e=(this.docName||"document").replace(/[/\\?%*:|"<>]/g,"_"),s=new Blob([this.resultText],{type:"text/markdown;charset=utf-8"}),t=URL.createObjectURL(s),o=document.createElement("a");o.href=t,o.download=`${e}-ocr.md`,o.click(),URL.revokeObjectURL(t),i.success(`Exported OCR markdown (${e}-ocr.md)`)};downloadText=()=>{if(!this.resultText)return;let e=(this.docName||"document").replace(/[/\\?%*:|"<>]/g,"_"),s=new Blob([this.resultText],{type:"text/plain;charset=utf-8"}),t=URL.createObjectURL(s),o=document.createElement("a");o.href=t,o.download=`${e}-ocr.txt`,o.click(),URL.revokeObjectURL(t),i.success(`Exported OCR text (${e}-ocr.txt)`)};saveAsNote=()=>{if(!this.resultText||!this.docId)return;let e={docId:this.docId,content:this.resultText,pageIndex:this._pageIndex};this.dispatchEvent(new CustomEvent("note:save",{bubbles:!0,composed:!1,detail:e})),i.success("Saved OCR text as note"),this.close()};get _isSinglePage(){return this._pageIndex!==null}get _dialogLabel(){return this._isSinglePage?`Extract Text \u2014 ${this.docName} (Page ${this._pageIndex+1})`:`Extract All Text \u2014 ${this.docName}`}render(){return this.isOpen?r`
1
+ import{a as ge,b as he,c as me,d as fe}from"./chunk-FFRDPFTS.js";import{a as N,b as c,c as V,d as F,e as ee,f as te,j as se,k as re,l as oe,m as ie,n as ae,r as a,s as ne,t as le}from"./chunk-IBF5HCYT.js";import{a as o,b,c as ye}from"./chunk-NQW6FFN7.js";import"./chunk-V6E2SSSW.js";import{a as Te}from"./chunk-2AB5L3Y2.js";import{a as Ce}from"./chunk-J7HWZNIP.js";import{a as Ae}from"./chunk-NEEWG3OP.js";import"./chunk-PUJYN435.js";import{a as u}from"./chunk-4ICUYKSR.js";import"./chunk-CWCS22CQ.js";import{a as ve,b as x}from"./chunk-GGERQ3CJ.js";import"./chunk-4GEMGDRU.js";import{a as I,b as R,c as k,e as D,f as E,g as _,k as d}from"./chunk-G5EUMLYT.js";import{a as Y}from"./chunk-KH5JE65X.js";import{a as X}from"./chunk-ULTSZWZO.js";import{a as O,b as P,c as w}from"./chunk-K4NR6OAC.js";import{d as $}from"./chunk-L4OVZN23.js";import{a as Z}from"./chunk-U3V3VZGO.js";import{a as Q}from"./chunk-6DSLE3AY.js";import{a as H}from"./chunk-5OTO5WFV.js";import{a as q}from"./chunk-O6FQFVKY.js";import{b as f}from"./chunk-WETG2JD7.js";import{a as g,b as ue,c as xe,d as h,e as m}from"./chunk-FAVTIE3M.js";import{a as be,b as Se,c as S}from"./chunk-MEE2NNYB.js";import{a as ce,b as pe,c as de,d as n}from"./chunk-YNY65JUJ.js";import{a as M,b as L,c as z,d as U,e as W,f as B,g as K,h as G,i as j,j as J}from"./chunk-ZT72PD2C.js";import{a as T}from"./chunk-FQRADJY6.js";import{a as C}from"./chunk-DIU5BGU5.js";import"./chunk-4C666HHU.js";var p=class extends b{#e=null;static properties={isOpen:{type:Boolean,state:!0},docId:{type:String,state:!0},docName:{type:String,state:!0},pages:{type:Array,state:!0},lang:{type:String,state:!0},step:{type:String,state:!0},progress:{type:Number,state:!0},statusMessage:{type:String,state:!0},resultText:{type:String,state:!0},confidence:{type:Number,state:!0},copied:{type:Boolean,state:!0}};createRenderRoot(){return this}disconnectedCallback(){super.disconnectedCallback(),this.#e&&(this.#e.abort(),this.#e=null),m(),this.isOpen=!1}constructor(){super(),this.isOpen=!1,this.docId="",this.docName="",this.pages=[],this.lang="eng",this.step="processing",this.progress=0,this.statusMessage="Starting OCR engine...",this.resultText="",this.confidence=0,this.copied=!1,this._pageIndex=null,this.#e=null}open(e,r,s,t="eng"){this._pageIndex=null,this._openInternal(e,r,s,t)}openPage(e,r,s,t,i="eng"){this._pageIndex=t,this._openInternal(e,r,[s],i)}_openInternal(e,r,s,t){if(this.#e&&(this.#e.abort(),this.#e=null),this.docId=e,this.docName=r||"Document",this.pages=s||[],this.lang=t,this.progress=0,this.resultText="",this.confidence=0,this.copied=!1,(this.pages||[]).filter(l=>l.src).length===0){this.step="empty",this.statusMessage="This document does not contain any image pages for text recognition.",this.isOpen=!0;return}this.step="processing",this.statusMessage=typeof window<"u"&&!window.Tesseract?"Downloading OCR engine...":"Starting OCR engine...",this.isOpen=!0,this.startOcr(t)}cancel=()=>{this.#e&&(this.#e.abort(),this.#e=null),this.close()};close=()=>{this.#e&&(this.#e.abort(),this.#e=null),this.isOpen=!1};async startOcr(e="eng"){this.#e&&(this.#e.abort(),this.#e=null),this.#e=new AbortController;let{signal:r}=this.#e;try{let s=await h(this.pages,{lang:e,abortSignal:r,onPageProgress:({overallProgress:t,message:i})=>{this.isOpen&&!r.aborted&&(this.progress=Math.round((t||0)*100),this.statusMessage=i)}});if(this.isOpen&&!r.aborted&&(this.step="done",this.resultText=s.combinedText||"",this.confidence=s.averageConfidence||0,n.success("Text recognition complete"),this.docId&&Array.isArray(s.pagesResults)))try{let t=await c.getDoc(this.docId);if(t&&Array.isArray(t.pages)){for(let i of s.pagesResults){let l=t.pages.find(A=>A.id===i.pageId)||t.pages[i.pageIndex];l&&(l.ocrText=i.text,l.ocrConfidence=i.confidence,l.ocrWords=i.words)}await c.saveDoc(this.docId,t)}}catch(t){console.warn("Could not persist OCR results to document:",t)}}catch(s){if(s.name==="AbortError"||r.aborted)return;console.error("Document OCR Error:",s),this.isOpen&&(this.step="error",this.statusMessage=s.message||"Text recognition failed",n.error(s.message||"Text recognition failed"))}finally{this.#e?.signal===r&&(this.#e=null)}}handleLangChange=e=>{let r=e.target.value;this.lang=r,this.step="processing",this.progress=0,this.statusMessage="Starting OCR engine with new language...",this.startOcr(r)};handleTextInput=e=>{this.resultText=e.target.value};copyText=async()=>{if(this.resultText)try{await navigator.clipboard.writeText(this.resultText),this.copied=!0,n.success("Copied text to clipboard"),setTimeout(()=>{this.copied=!1},2e3)}catch(e){console.error("Failed to copy text:",e),n.error("Failed to copy text to clipboard")}};downloadText=()=>{if(!this.resultText)return;let e=(this.docName||"document").replace(/[/\\?%*:|"<>]/g,"_"),r=new Blob([this.resultText],{type:"text/plain;charset=utf-8"}),s=URL.createObjectURL(r),t=document.createElement("a");t.href=s,t.download=`${e}-ocr.txt`,t.click(),URL.revokeObjectURL(s),n.success(`Exported OCR text (${e}-ocr.txt)`)};get _isSinglePage(){return this._pageIndex!==null}get _dialogLabel(){return this._isSinglePage?`Extract Text \u2014 ${this.docName} (Page ${this._pageIndex+1})`:`Extract All Text \u2014 ${this.docName}`}render(){return this.isOpen?o`
2
2
  <sl-dialog
3
3
  label="${this._dialogLabel}"
4
4
  open
@@ -12,10 +12,10 @@ import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j
12
12
  @sl-change=${this.handleLangChange}
13
13
  style="min-width: 180px;"
14
14
  >
15
- ${p.map(e=>r`<sl-option value=${e.code}>${e.flag} ${e.label}</sl-option>`)}
15
+ ${g.map(e=>o`<sl-option value=${e.code}>${e.flag} ${e.label}</sl-option>`)}
16
16
  </sl-select>
17
17
 
18
- ${this.step==="done"?r`
18
+ ${this.step==="done"?o`
19
19
  <sl-badge
20
20
  variant=${this.confidence>=75?"success":this.confidence>=50?"warning":"danger"}
21
21
  >
@@ -24,7 +24,7 @@ import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j
24
24
  `:""}
25
25
  </div>
26
26
 
27
- ${this.step==="empty"?r`
27
+ ${this.step==="empty"?o`
28
28
  <div style="padding: 2.5rem 1rem; text-align: center; color: #64748b;">
29
29
  <sl-icon name="file-earmark-x" style="font-size: 2.5rem; margin-bottom: 0.5rem; color: #94a3b8;"></sl-icon>
30
30
  <p style="margin: 0; font-size: 1rem; color: #334155; font-weight: 500;">${this.statusMessage}</p>
@@ -32,7 +32,7 @@ import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j
32
32
  </div>
33
33
  `:""}
34
34
 
35
- ${this.step==="processing"?r`
35
+ ${this.step==="processing"?o`
36
36
  <div style="padding: 2.5rem 1rem; text-align: center;">
37
37
  <div style="font-size: 1.1rem; color: #0284c7; font-weight: 600; margin-bottom: 1rem;">
38
38
  ${this.statusMessage}
@@ -44,14 +44,14 @@ import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j
44
44
  </div>
45
45
  `:""}
46
46
 
47
- ${this.step==="error"?r`
47
+ ${this.step==="error"?o`
48
48
  <div style="padding: 2rem; text-align: center; color: #ef4444;">
49
49
  <sl-icon name="x-circle-fill" style="font-size: 2rem;"></sl-icon>
50
50
  <p style="margin-top: 0.5rem;">${this.statusMessage}</p>
51
51
  </div>
52
52
  `:""}
53
53
 
54
- ${this.step==="done"?r`
54
+ ${this.step==="done"?o`
55
55
  <div>
56
56
  <sl-textarea
57
57
  rows="14"
@@ -62,18 +62,18 @@ import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j
62
62
  </div>
63
63
  `:""}
64
64
 
65
- ${this.step==="processing"?r`
65
+ ${this.step==="processing"?o`
66
66
  <sl-button slot="footer" variant="default" @click=${this.cancel}>
67
67
  <sl-icon slot="prefix" name="x-lg"></sl-icon>
68
68
  Cancel
69
69
  </sl-button>
70
70
  `:""}
71
- ${this.step==="empty"||this.step==="error"?r`
71
+ ${this.step==="empty"||this.step==="error"?o`
72
72
  <sl-button slot="footer" variant="default" @click=${this.close}>
73
73
  Close
74
74
  </sl-button>
75
75
  `:""}
76
- ${this.step==="done"?r`
76
+ ${this.step==="done"?o`
77
77
  <sl-button slot="footer" variant="default" @click=${this.close}>
78
78
  Close
79
79
  </sl-button>
@@ -85,15 +85,7 @@ import{a as de,b as he,c as ge,d as me,e as ue,f as fe,g as xe,h as be,i as ye,j
85
85
  <sl-icon slot="prefix" name="download"></sl-icon>
86
86
  Download .txt
87
87
  </sl-button>
88
- <sl-button slot="footer" variant="default" @click=${this.downloadMarkdown}>
89
- <sl-icon slot="prefix" name="download"></sl-icon>
90
- Download .md
91
- </sl-button>
92
- <sl-button slot="footer" variant="primary" @click=${this.saveAsNote}>
93
- <sl-icon slot="prefix" name="file-earmark-plus"></sl-icon>
94
- Save as Note
95
- </sl-button>
96
88
  `:""}
97
89
  </sl-dialog>
98
- `:""}};customElements.define("copio-doc-ocr-dialog",l);var f=class{constructor(e=null){this.key=e}setKey(e){this.key=e}getKey(){return this.key}isValid(){return!!this.key}getTier(){return this.key?this.key.startsWith("pro_")?"pro":this.key.startsWith("ent_")?"enterprise":"commercial":"community"}};a("export",y);a("ocr",new m);a("sync",g);a("pdf",new u);a("imageProcessor",new c);export{G as BUILD_DATE,oe as COPIO_EVENTS,c as Canvas2DAdapter,ge as CopioAddEditDialog,he as CopioCarousel,l as CopioDocOcrDialog,ae as CopioEngine,ue as CopioHeader,de as CopioImages,fe as CopioLoader,me as CopioRow,ve as CopioScanner,we as CopioSyncDialog,E as DocRepository,te as Document,Z as ImageProcessorPort,w as IndexedDbStorageAdapter,f as LicenseManager,C as MemoryStorageAdapter,q as NullImageProcessorAdapter,F as NullOcrAdapter,Q as NullPdfAdapter,Pe as NullSyncAdapter,V as OcrPort,ee as Page,u as PdfKitAdapter,H as PdfPort,ke as PeerJsAdapter,p as SUPPORTED_LANGUAGES,se as ScanSession,S as StoragePort,g as SyncManager,Oe as SyncPort,m as TesseractWasmAdapter,J as VERSION,ye as adoptScannerStyles,pe as clearNotifications,T as createDefaultAdapter,re as dispatchCopioEvent,R as docRepository,$e as exportDocumentAsImages,Ae as exportDocumentAsMarkdown,Te as exportDocumentAsPdf,$ as extractExif,O as fileToBase64,D as getAssetBase,ce as getContainer,I as getCroppedSrc,Se as getOcrWorker,ie as getRegisteredService,be as getScannerStyleSheet,Y as hasActiveEdits,M as loadCropper,z as loadJsZip,B as loadMarked,U as loadPdfKit,W as loadPeerJs,j as loadQrCode,L as loadScript,K as loadTesseract,X as normalizeEditStack,i as notify,A as randomId,d as recognizeDocumentPages,Ce as recognizeImageText,a as registerService,ne as renderPdfPagesToDataUrls,_ as resolveAssetUrl,P as rotateSrc,xe as scannerCss,N as setAssetBase,le as setContainer,h as terminateOcrWorker,k as thresholdSrc};
90
+ `:""}};customElements.define("copio-doc-ocr-dialog",p);var y=class{constructor(e=null){this.key=e}setKey(e){this.key=e}getKey(){return this.key}isValid(){return!!this.key}getTier(){return this.key?this.key.startsWith("pro_")?"pro":this.key.startsWith("ent_")?"enterprise":"commercial":"community"}};a("export",S);a("ocr",new u);a("sync",f);a("pdf",new x);a("imageProcessor",new d);export{V as BUILD_DATE,ie as COPIO_EVENTS,d as Canvas2DAdapter,p as CopioDocOcrDialog,le as CopioEngine,fe as CopioScanner,ye as CopioSyncDialog,N as DocRepository,re as Document,X as ImageProcessorPort,$ as IndexedDbStorageAdapter,y as LicenseManager,T as MemoryStorageAdapter,Y as NullImageProcessorAdapter,Z as NullOcrAdapter,H as NullPdfAdapter,Te as NullSyncAdapter,Q as OcrPort,P as OpfsStorageAdapter,se as Page,x as PdfKitAdapter,q as PdfPort,Ce as PeerJsAdapter,g as SUPPORTED_LANGUAGES,oe as ScanSession,C as StoragePort,f as SyncManager,Ae as SyncPort,u as TesseractWasmAdapter,F as VERSION,me as adoptScannerStyles,de as clearNotifications,w as createDefaultAdapter,ae as dispatchCopioEvent,c as docRepository,Se as exportDocumentAsImages,be as exportDocumentAsPdf,I as extractExif,k as fileToBase64,M as getAssetBase,pe as getContainer,_ as getCroppedSrc,ue as getOcrWorker,ne as getRegisteredService,he as getScannerStyleSheet,te as hasActiveEdits,W as loadCropper,K as loadJsZip,B as loadPdfKit,G as loadPeerJs,j as loadQrCode,U as loadScript,J as loadTesseract,ee as normalizeEditStack,n as notify,O as probeOpfs,R as randomId,h as recognizeDocumentPages,xe as recognizeImageText,a as registerService,ve as renderPdfPagesToDataUrls,z as resolveAssetUrl,E as rotateSrc,ge as scannerCss,L as setAssetBase,ce as setContainer,m as terminateOcrWorker,D as thresholdSrc};
99
91
  //# sourceMappingURL=index.js.map
package/dist/ocr.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e}from"./chunk-B5BEYYR2.js";import"./chunk-V2FP4EEH.js";import"./chunk-G65H4ZTJ.js";import"./chunk-4C666HHU.js";export{a as SUPPORTED_LANGUAGES,b as getOcrWorker,d as recognizeDocumentPages,c as recognizeImageText,e as terminateOcrWorker};
1
+ import{a,b,c,d,e}from"./chunk-FAVTIE3M.js";import"./chunk-YNY65JUJ.js";import"./chunk-ZT72PD2C.js";import"./chunk-4C666HHU.js";export{a as SUPPORTED_LANGUAGES,b as getOcrWorker,d as recognizeDocumentPages,c as recognizeImageText,e as terminateOcrWorker};
2
2
  //# sourceMappingURL=ocr.js.map