@superdoc-dev/esign 2.0.0-next.1 → 2.0.1-next.1

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/README.md CHANGED
@@ -37,22 +37,22 @@ function App() {
37
37
 
38
38
  fields={{
39
39
  document: [
40
- { id: '1', value: 'John Doe' },
41
- { id: '2', value: new Date().toLocaleDateString() },
42
- { id: '3', value: 'SuperDoc' },
43
- { id: '4', value: 'Premium' },
44
- { id: '5', value: 'CA' },
45
- { id: '6', value: '123 Main St, Anytown, USA' }
40
+ { id: 'user_name', value: 'John Doe' },
41
+ { id: 'agreement_date', value: new Date().toLocaleDateString() },
42
+ { id: 'company_name', value: 'SuperDoc' },
43
+ { id: 'service_type', value: 'Premium' },
44
+ { id: 'agreement_jurisdiction', value: 'CA' },
45
+ { id: 'company_address', value: '123 Main St, Anytown, USA' }
46
46
  ],
47
47
  signer: [
48
48
  {
49
- id: '7',
49
+ id: 'signature',
50
50
  type: 'signature',
51
51
  validation: { required: true },
52
52
  label: 'Type your full name'
53
53
  },
54
54
  {
55
- id: '8',
55
+ id: 'accept_terms',
56
56
  type: 'checkbox',
57
57
  validation: { required: true },
58
58
  label: 'I accept the terms'
@@ -118,11 +118,11 @@ See [Python, Node.js, and more examples](https://docs.superdoc.dev/solutions/esi
118
118
  timestamp: "2024-01-15T10:30:00Z",
119
119
  duration: 45000,
120
120
  documentFields: [
121
- { id: "1", value: "John Doe" }
121
+ { id: "user_name", value: "John Doe" }
122
122
  ],
123
123
  signerFields: [
124
- { id: "7", value: "John Doe" },
125
- { id: "8", value: true }
124
+ { id: "signature", value: "John Doe" },
125
+ { id: "accept_terms", value: true }
126
126
  ],
127
127
  auditTrail: [
128
128
  { type: "ready", timestamp: "..." },
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AAEpB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAIzC,QAAA,MAAM,aAAa,gIAuflB,CAAC;AAIF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AAEpB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAIzC,QAAA,MAAM,aAAa,gIAqclB,CAAC;AAIF,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var ye=Object.create;var J=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var Ce=(i,c,r,n)=>{if(c&&typeof c=="object"||typeof c=="function")for(let o of xe(c))!we.call(i,o)&&o!==r&&J(i,o,{get:()=>c[o],enumerable:!(n=be(c,o))||n.enumerable});return i};var De=(i,c,r)=>(r=i!=null?ye(Se(i)):{},Ce(c||!i||!i.__esModule?J(r,"default",{value:i,enumerable:!0}):r,i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),a=require("react"),Q=i=>{const c=globalThis.document.createElement("canvas"),r=c.getContext("2d"),n=30;r.font=`italic ${n}px cursive`;const u=r.measureText(i).width,f=n*1.3,g=4,M=6;return c.width=Math.ceil(u+g*2)+20,c.height=Math.ceil(f+M*2),r.font=`italic ${n}px cursive`,r.fillStyle="black",r.textAlign="center",r.textBaseline="middle",r.fillText(i,c.width/2,c.height/2),c.toDataURL("image/png")},Z=({value:i,onChange:c,isDisabled:r,label:n})=>l.jsxs("div",{className:"superdoc-esign-signature-input",style:{display:"flex",flexDirection:"column",gap:"8px"},children:[n&&l.jsx("label",{children:n}),l.jsx("input",{type:"text",value:String(i||""),onChange:o=>c(o.target.value),disabled:r,placeholder:"Type your full name",style:{fontFamily:"cursive",fontSize:"18px"}})]}),ee=({value:i,onChange:c,isDisabled:r,label:n})=>l.jsxs("label",{className:"superdoc-esign-checkbox-input",style:{display:"flex",gap:"8px"},children:[l.jsx("input",{type:"checkbox",checked:!!i,onChange:o=>c(o.target.checked),disabled:r}),l.jsx("span",{children:n})]}),je=i=>({onClick:r,fileName:n,isDisabled:o,isDownloading:u})=>{const f=i?.label||"Download",g=o||u;return l.jsxs("button",{onClick:r,disabled:g,className:`superdoc-esign-btn superdoc-esign-btn--download${u?" superdoc-esign-btn--loading":""}`,style:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #d0d5dd",background:"#ffffff",color:"#333",cursor:g?"not-allowed":"pointer",opacity:g?.7:1,fontSize:"16px",fontWeight:"bold",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.2s ease"},children:[u&&l.jsx("span",{className:"superdoc-esign-spinner"}),u?"Downloading...":f,!u&&n&&` (${n})`]})},Me=i=>({onClick:r,isValid:n,isDisabled:o,isSubmitting:u})=>{const f=i?.label||"Submit",g=!n||o||u;return l.jsxs("button",{onClick:r,disabled:g,className:`superdoc-esign-btn superdoc-esign-btn--submit${u?" superdoc-esign-btn--loading":""}`,style:{padding:"12px 24px",borderRadius:"6px",border:"none",background:"#007bff",color:"#fff",cursor:g?"not-allowed":"pointer",opacity:g&&!u?.5:1,fontSize:"16px",fontWeight:"bold",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.2s ease"},children:[u&&l.jsx("span",{className:"superdoc-esign-spinner superdoc-esign-spinner--light"}),u?"Submitting...":f]})},te=a.forwardRef((i,c)=>{const{eventId:r,document:n,fields:o={},download:u,submit:f,onSubmit:g,onDownload:M,onStateChange:F,onFieldChange:A,onFieldsDiscovered:q,isDisabled:h=!1,className:ne,style:se,documentHeight:oe="600px"}=i,[b,_]=a.useState(!n.validation?.scroll?.required),[m,B]=a.useState(new Map),[x,V]=a.useState(!1),[v,U]=a.useState(!1),[N,z]=a.useState(!1),[O,$]=a.useState([]),[H,re]=a.useState(!1),R=a.useRef(null),T=a.useRef(null),ae=a.useRef(Date.now()),S=a.useRef(o),w=a.useRef([]),P=a.useRef(q);S.current=o,P.current=q,a.useEffect(()=>{w.current=O},[O]);const y=a.useCallback(e=>{if(!T.current?.activeEditor)return;const t=T.current.activeEditor,d=S.current.signer?.find(s=>s.id===e.id);if(e.type==="table"&&Array.isArray(e.value)){const D=t.helpers?.structuredContentCommands?.getStructuredContentTablesById?.(e.id,t.state)||[];if(D.length){const{node:k,pos:fe}=D[0],X=k.childCount;if(X>1){let j=t.state.tr;for(let E=X-1;E>=1;E--){let Y=1;for(let I=0;I<E;I++)Y+=k.child(I).nodeSize;const he=k.child(E),G=fe+Y,ve=G+he.nodeSize;j=j.delete(j.mapping.map(G),j.mapping.map(ve))}t.view?.dispatch(j)}t.commands?.appendRowsToStructuredContentTable?.({id:e.id,rows:e.value,copyRowStyle:!0})}return}let p;d?.type==="signature"&&e.value?p={json:{type:"image",attrs:{src:typeof e.value=="string"&&e.value.startsWith("data:image/")?e.value:Q(String(e.value)),alt:"Signature"}}}:p={text:String(e.value??"")},e.id&&t.commands?.updateStructuredContentById?.(e.id,p)},[]),W=a.useCallback(e=>{if(!e)return;const t=e.helpers.structuredContentCommands.getStructuredContentTags(e.state),d=new Map;S.current.document?.forEach(s=>{s.id&&d.set(s.id,s.value)}),S.current.signer?.forEach(s=>{s.value!==void 0&&d.set(s.id,s.value)});const p=t.map(({node:s})=>({id:s.attrs.id,label:s.attrs.label,value:d.get(s.attrs.id)??s.textContent??""})).filter(s=>s.id);p.length>0&&(P.current?.(p),(S.current.document||[]).filter(s=>s.value!==void 0).forEach(s=>y({id:s.id,value:s.value,type:s.type})),(S.current.signer||[]).filter(s=>s.value!==void 0).forEach(s=>y({id:s.id,value:s.value})))},[y]),C=e=>{const t={...e,timestamp:new Date().toISOString()},d=globalThis?.__SUPERDOC_AUDIT_MOCK__;d&&d(t);const p=[...w.current,t];return w.current=p,$(p),p};a.useEffect(()=>{if(!R.current)return;let e=!1,t=null;return(async()=>{const{SuperDoc:p}=await import("superdoc");e||(t=new p({selector:R.current,document:n.source,documentMode:"viewing",modules:{comments:!1},layoutMode:n.layoutMode,layoutMargins:n.layoutMargins,onReady:()=>{e||(t?.activeEditor&&W(t.activeEditor),C({type:"ready"}),re(!0))}}),T.current=t)})(),()=>{e=!0,t&&typeof t.destroy=="function"&&t.destroy(),T.current=null}},[n.source,n.mode,n.layoutMode,n.layoutMargins?.top,n.layoutMargins?.bottom,n.layoutMargins?.left,n.layoutMargins?.right,W]),a.useEffect(()=>{if(!n.validation?.scroll?.required||!H)return;const e=R.current;if(!e)return;const t=()=>{const{scrollTop:d,scrollHeight:p,clientHeight:s}=e,D=d/(p-s);(D>=.95||p<=s)&&(_(!0),C({type:"scroll",data:{percent:Math.round(D*100)}}))};return e.addEventListener("scroll",t),t(),()=>e.removeEventListener("scroll",t)},[n.validation?.scroll?.required,H]);const ie=a.useCallback((e,t)=>{B(d=>{const p=d.get(e),s=new Map(d);return s.set(e,t),y({id:e,value:t}),C({type:"field_change",data:{fieldId:e,value:t,previousValue:p}}),A?.({id:e,value:t,previousValue:p}),s})},[A,y]),L=a.useCallback(()=>n.validation?.scroll?.required&&!b?!1:(o.signer||[]).every(e=>{if(!e.validation?.required)return!0;const t=m.get(e.id);return t&&(typeof t!="string"||t.trim())}),[b,o.signer,m,n.validation?.scroll?.required]);a.useEffect(()=>{const e=L();V(e),F?.({scrolled:b,fields:m,isValid:e,isSubmitting:v})},[b,m,v,L,F]);const ce=a.useCallback(async()=>{if(h||N)return;z(!0);const e={eventId:r,documentSource:n.source,fields:{document:o.document||[],signer:(o.signer||[]).map(t=>({id:t.id,value:m.get(t.id)??null}))},fileName:u?.fileName||"document.pdf"};try{await M?.(e)}finally{z(!1)}},[h,N,r,n.source,o,m,u,M]),le=a.useCallback(async()=>{if(!x||h||v)return;U(!0),C({type:"submit"});const e=C({type:"submit"}),t={eventId:r,timestamp:new Date().toISOString(),duration:Math.floor((Date.now()-ae.current)/1e3),auditTrail:e,documentFields:o.document||[],signerFields:(o.signer||[]).map(d=>({id:d.id,value:m.get(d.id)??null})),isFullyCompleted:x};try{await g(t)}finally{U(!1)}},[x,h,v,r,o,m,g]),ue=e=>{const t=e.component||de(e.type);return l.jsx(t,{value:m.get(e.id)??null,onChange:d=>ie(e.id,d),isDisabled:h,label:e.label},e.id)},de=e=>{switch(e){case"signature":case"text":return Z;case"checkbox":return ee}},pe=()=>{const e=u?.component||je(u);return e?l.jsx(e,{onClick:ce,fileName:u?.fileName,isDisabled:h,isDownloading:N}):null},ge=()=>{if(n.mode==="download")return null;const e=f?.component||Me(f);return l.jsx("div",{className:"superdoc-esign-actions superdoc-esign-form-actions",children:l.jsx(e,{onClick:le,isValid:x,isDisabled:h,isSubmitting:v})})},K=pe(),me=ge();return a.useImperativeHandle(c,()=>({getState:()=>({scrolled:b,fields:m,isValid:x,isSubmitting:v}),getAuditTrail:()=>w.current,reset:()=>{_(!n.validation?.scroll?.required),B(new Map),V(!1),w.current=[],$([])},updateFieldInDocument:y}),[b,m,x,v,n.validation?.scroll?.required,y]),l.jsxs("div",{className:`superdoc-esign-container ${ne||""}`,style:se,children:[l.jsxs("div",{className:"superdoc-esign-document","data-testid":"superdoc-esign-document",children:[K&&l.jsx("div",{className:"superdoc-esign-document-toolbar",children:l.jsx("div",{className:"superdoc-esign-document-controls",children:K})}),l.jsx("div",{ref:R,className:"superdoc-esign-document-viewer","data-testid":"superdoc-scroll-container",style:{height:oe,overflow:"auto"}})]}),l.jsxs("div",{className:"superdoc-esign-controls","data-testid":"superdoc-esign-controls",children:[o.signer&&o.signer.length>0&&l.jsx("div",{className:"superdoc-esign-fields","data-testid":"superdoc-esign-fields",children:o.signer.map(ue)}),me]})]})});te.displayName="SuperDocESign";exports.CheckboxInput=ee;exports.SignatureInput=Z;exports.default=te;exports.textToImageDataUrl=Q;
1
+ "use strict";var ce=Object.create;var P=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ge=(i,c,o,t)=>{if(c&&typeof c=="object"||typeof c=="function")for(let s of ue(c))!pe.call(i,s)&&s!==o&&P(i,s,{get:()=>c[s],enumerable:!(t=le(c,s))||t.enumerable});return i};var me=(i,c,o)=>(o=i!=null?ce(de(i)):{},ge(c||!i||!i.__esModule?P(o,"default",{value:i,enumerable:!0}):o,i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),r=require("react"),W=i=>{const c=globalThis.document.createElement("canvas"),o=c.getContext("2d"),t=30;o.font=`italic ${t}px cursive`;const u=o.measureText(i).width,f=t*1.3,g=4,D=6;return c.width=Math.ceil(u+g*2)+20,c.height=Math.ceil(f+D*2),o.font=`italic ${t}px cursive`,o.fillStyle="black",o.textAlign="center",o.textBaseline="middle",o.fillText(i,c.width/2,c.height/2),c.toDataURL("image/png")},L=({value:i,onChange:c,isDisabled:o,label:t})=>l.jsxs("div",{className:"superdoc-esign-signature-input",style:{display:"flex",flexDirection:"column",gap:"8px"},children:[t&&l.jsx("label",{children:t}),l.jsx("input",{type:"text",value:String(i||""),onChange:s=>c(s.target.value),disabled:o,placeholder:"Type your full name",style:{fontFamily:"cursive",fontSize:"18px"}})]}),K=({value:i,onChange:c,isDisabled:o,label:t})=>l.jsxs("label",{className:"superdoc-esign-checkbox-input",style:{display:"flex",gap:"8px"},children:[l.jsx("input",{type:"checkbox",checked:!!i,onChange:s=>c(s.target.checked),disabled:o}),l.jsx("span",{children:t})]}),fe=i=>({onClick:o,fileName:t,isDisabled:s,isDownloading:u})=>{const f=i?.label||"Download",g=s||u;return l.jsxs("button",{onClick:o,disabled:g,className:`superdoc-esign-btn superdoc-esign-btn--download${u?" superdoc-esign-btn--loading":""}`,style:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #d0d5dd",background:"#ffffff",color:"#333",cursor:g?"not-allowed":"pointer",opacity:g?.7:1,fontSize:"16px",fontWeight:"bold",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.2s ease"},children:[u&&l.jsx("span",{className:"superdoc-esign-spinner"}),u?"Downloading...":f,!u&&t&&` (${t})`]})},he=i=>({onClick:o,isValid:t,isDisabled:s,isSubmitting:u})=>{const f=i?.label||"Submit",g=!t||s||u;return l.jsxs("button",{onClick:o,disabled:g,className:`superdoc-esign-btn superdoc-esign-btn--submit${u?" superdoc-esign-btn--loading":""}`,style:{padding:"12px 24px",borderRadius:"6px",border:"none",background:"#007bff",color:"#fff",cursor:g?"not-allowed":"pointer",opacity:g&&!u?.5:1,fontSize:"16px",fontWeight:"bold",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.2s ease"},children:[u&&l.jsx("span",{className:"superdoc-esign-spinner superdoc-esign-spinner--light"}),u?"Submitting...":f]})},X=r.forwardRef((i,c)=>{const{eventId:o,document:t,fields:s={},download:u,submit:f,onSubmit:g,onDownload:D,onStateChange:E,onFieldChange:N,onFieldsDiscovered:T,isDisabled:h=!1,className:Y,style:G,documentHeight:J="600px"}=i,[y,F]=r.useState(!t.validation?.scroll?.required),[m,I]=r.useState(new Map),[b,q]=r.useState(!1),[x,A]=r.useState(!1),[k,_]=r.useState(!1),[V,B]=r.useState([]),[U,Q]=r.useState(!1),j=r.useRef(null),M=r.useRef(null),Z=r.useRef(Date.now()),S=r.useRef(s),w=r.useRef([]),$=r.useRef(T);S.current=s,$.current=T,r.useEffect(()=>{w.current=V},[V]);const C=r.useCallback(e=>{if(!M.current?.activeEditor)return;const n=M.current.activeEditor,d=S.current.signer?.find(a=>a.id===e.id);let p;d?.type==="signature"&&e.value?p={json:{type:"image",attrs:{src:typeof e.value=="string"&&e.value.startsWith("data:image/")?e.value:W(String(e.value)),alt:"Signature"}}}:p={text:String(e.value??"")},e.id&&n.commands.updateStructuredContentById?.(e.id,p)},[]),H=r.useCallback(e=>{if(!e)return;const n=e.helpers.structuredContentCommands.getStructuredContentTags(e.state),d=new Map;S.current.document?.forEach(a=>{a.id&&d.set(a.id,a.value)}),S.current.signer?.forEach(a=>{a.value!==void 0&&d.set(a.id,a.value)});const p=n.map(({node:a})=>({id:a.attrs.id,label:a.attrs.label,value:d.get(a.attrs.id)??a.textContent??""})).filter(a=>a.id);p.length>0&&($.current?.(p),[...S.current.document||[],...S.current.signer||[]].filter(v=>v.value!==void 0).forEach(v=>C({id:v.id,value:v.value})))},[C]),R=e=>{const n={...e,timestamp:new Date().toISOString()},d=globalThis?.__SUPERDOC_AUDIT_MOCK__;d&&d(n);const p=[...w.current,n];return w.current=p,B(p),p};r.useEffect(()=>{if(!j.current)return;let e=!1,n=null;return(async()=>{const{SuperDoc:p}=await import("superdoc");e||(n=new p({selector:j.current,document:t.source,documentMode:"viewing",modules:{comments:!1},layoutMode:t.layoutMode,layoutMargins:t.layoutMargins,onReady:()=>{e||(n?.activeEditor&&H(n.activeEditor),R({type:"ready"}),Q(!0))}}),M.current=n)})(),()=>{e=!0,n&&typeof n.destroy=="function"&&n.destroy(),M.current=null}},[t.source,t.mode,t.layoutMode,t.layoutMargins?.top,t.layoutMargins?.bottom,t.layoutMargins?.left,t.layoutMargins?.right,H]),r.useEffect(()=>{if(!t.validation?.scroll?.required||!U)return;const e=j.current;if(!e)return;const n=()=>{const{scrollTop:d,scrollHeight:p,clientHeight:a}=e,v=d/(p-a);(v>=.95||p<=a)&&(F(!0),R({type:"scroll",data:{percent:Math.round(v*100)}}))};return e.addEventListener("scroll",n),n(),()=>e.removeEventListener("scroll",n)},[t.validation?.scroll?.required,U]);const ee=r.useCallback((e,n)=>{I(d=>{const p=d.get(e),a=new Map(d);return a.set(e,n),C({id:e,value:n}),R({type:"field_change",data:{fieldId:e,value:n,previousValue:p}}),N?.({id:e,value:n,previousValue:p}),a})},[N,C]),O=r.useCallback(()=>t.validation?.scroll?.required&&!y?!1:(s.signer||[]).every(e=>{if(!e.validation?.required)return!0;const n=m.get(e.id);return n&&(typeof n!="string"||n.trim())}),[y,s.signer,m,t.validation?.scroll?.required]);r.useEffect(()=>{const e=O();q(e),E?.({scrolled:y,fields:m,isValid:e,isSubmitting:x})},[y,m,x,O,E]);const te=r.useCallback(async()=>{if(h||k)return;_(!0);const e={eventId:o,documentSource:t.source,fields:{document:s.document||[],signer:(s.signer||[]).map(n=>({id:n.id,value:m.get(n.id)??null}))},fileName:u?.fileName||"document.pdf"};try{await D?.(e)}finally{_(!1)}},[h,k,o,t.source,s,m,u,D]),ne=r.useCallback(async()=>{if(!b||h||x)return;A(!0);const e=R({type:"submit"}),n={eventId:o,timestamp:new Date().toISOString(),duration:Math.floor((Date.now()-Z.current)/1e3),auditTrail:e,documentFields:s.document||[],signerFields:(s.signer||[]).map(d=>({id:d.id,value:m.get(d.id)??null})),isFullyCompleted:b};try{await g(n)}finally{A(!1)}},[b,h,x,o,s,m,g]),se=e=>{const n=e.component||oe(e.type);return l.jsx(n,{value:m.get(e.id)??null,onChange:d=>ee(e.id,d),isDisabled:h,label:e.label},e.id)},oe=e=>{switch(e){case"signature":case"text":return L;case"checkbox":return K}},re=()=>{const e=u?.component||fe(u);return e?l.jsx(e,{onClick:te,fileName:u?.fileName,isDisabled:h,isDownloading:k}):null},ae=()=>{if(t.mode==="download")return null;const e=f?.component||he(f);return l.jsx("div",{className:"superdoc-esign-actions superdoc-esign-form-actions",children:l.jsx(e,{onClick:ne,isValid:b,isDisabled:h,isSubmitting:x})})},z=re(),ie=ae();return r.useImperativeHandle(c,()=>({getState:()=>({scrolled:y,fields:m,isValid:b,isSubmitting:x}),getAuditTrail:()=>w.current,reset:()=>{F(!t.validation?.scroll?.required),I(new Map),q(!1),w.current=[],B([])},updateFieldInDocument:C}),[y,m,b,x,t.validation?.scroll?.required,C]),l.jsxs("div",{className:`superdoc-esign-container ${Y||""}`,style:G,children:[l.jsxs("div",{className:"superdoc-esign-document","data-testid":"superdoc-esign-document",children:[z&&l.jsx("div",{className:"superdoc-esign-document-toolbar",children:l.jsx("div",{className:"superdoc-esign-document-controls",children:z})}),l.jsx("div",{ref:j,className:"superdoc-esign-document-viewer","data-testid":"superdoc-scroll-container",style:{height:J,overflow:"auto"}})]}),l.jsxs("div",{className:"superdoc-esign-controls","data-testid":"superdoc-esign-controls",children:[s.signer&&s.signer.length>0&&l.jsx("div",{className:"superdoc-esign-fields","data-testid":"superdoc-esign-fields",children:s.signer.map(se)}),ie]})]})});X.displayName="SuperDocESign";exports.CheckboxInput=K;exports.SignatureInput=L;exports.default=X;exports.textToImageDataUrl=W;
package/dist/index.mjs CHANGED
@@ -1,29 +1,29 @@
1
1
  import { jsxs as b, jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as ye, useState as v, useRef as C, useEffect as A, useCallback as D, useImperativeHandle as ve } from "react";
3
- const be = (u) => {
4
- const l = globalThis.document.createElement("canvas"), s = l.getContext("2d"), o = 30;
5
- s.font = `italic ${o}px cursive`;
6
- const a = s.measureText(u).width, m = o * 1.3, p = 4, R = 6;
7
- return l.width = Math.ceil(a + p * 2) + 20, l.height = Math.ceil(m + R * 2), s.font = `italic ${o}px cursive`, s.fillStyle = "black", s.textAlign = "center", s.textBaseline = "middle", s.fillText(u, l.width / 2, l.height / 2), l.toDataURL("image/png");
8
- }, xe = ({
2
+ import { forwardRef as ae, useState as y, useRef as D, useEffect as k, useCallback as M, useImperativeHandle as ce } from "react";
3
+ const le = (u) => {
4
+ const l = globalThis.document.createElement("canvas"), r = l.getContext("2d"), n = 30;
5
+ r.font = `italic ${n}px cursive`;
6
+ const i = r.measureText(u).width, m = n * 1.3, p = 4, T = 6;
7
+ return l.width = Math.ceil(i + p * 2) + 20, l.height = Math.ceil(m + T * 2), r.font = `italic ${n}px cursive`, r.fillStyle = "black", r.textAlign = "center", r.textBaseline = "middle", r.fillText(u, l.width / 2, l.height / 2), l.toDataURL("image/png");
8
+ }, de = ({
9
9
  value: u,
10
10
  onChange: l,
11
- isDisabled: s,
12
- label: o
11
+ isDisabled: r,
12
+ label: n
13
13
  }) => /* @__PURE__ */ b(
14
14
  "div",
15
15
  {
16
16
  className: "superdoc-esign-signature-input",
17
17
  style: { display: "flex", flexDirection: "column", gap: "8px" },
18
18
  children: [
19
- o && /* @__PURE__ */ d("label", { children: o }),
19
+ n && /* @__PURE__ */ d("label", { children: n }),
20
20
  /* @__PURE__ */ d(
21
21
  "input",
22
22
  {
23
23
  type: "text",
24
24
  value: String(u || ""),
25
- onChange: (r) => l(r.target.value),
26
- disabled: s,
25
+ onChange: (s) => l(s.target.value),
26
+ disabled: r,
27
27
  placeholder: "Type your full name",
28
28
  style: {
29
29
  fontFamily: "cursive",
@@ -33,35 +33,35 @@ const be = (u) => {
33
33
  )
34
34
  ]
35
35
  }
36
- ), we = ({
36
+ ), ue = ({
37
37
  value: u,
38
38
  onChange: l,
39
- isDisabled: s,
40
- label: o
39
+ isDisabled: r,
40
+ label: n
41
41
  }) => /* @__PURE__ */ b("label", { className: "superdoc-esign-checkbox-input", style: { display: "flex", gap: "8px" }, children: [
42
42
  /* @__PURE__ */ d(
43
43
  "input",
44
44
  {
45
45
  type: "checkbox",
46
46
  checked: !!u,
47
- onChange: (r) => l(r.target.checked),
48
- disabled: s
47
+ onChange: (s) => l(s.target.checked),
48
+ disabled: r
49
49
  }
50
50
  ),
51
- /* @__PURE__ */ d("span", { children: o })
52
- ] }), Se = (u) => ({
53
- onClick: s,
54
- fileName: o,
55
- isDisabled: r,
56
- isDownloading: a
51
+ /* @__PURE__ */ d("span", { children: n })
52
+ ] }), pe = (u) => ({
53
+ onClick: r,
54
+ fileName: n,
55
+ isDisabled: s,
56
+ isDownloading: i
57
57
  }) => {
58
- const m = u?.label || "Download", p = r || a;
58
+ const m = u?.label || "Download", p = s || i;
59
59
  return /* @__PURE__ */ b(
60
60
  "button",
61
61
  {
62
- onClick: s,
62
+ onClick: r,
63
63
  disabled: p,
64
- className: `superdoc-esign-btn superdoc-esign-btn--download${a ? " superdoc-esign-btn--loading" : ""}`,
64
+ className: `superdoc-esign-btn superdoc-esign-btn--download${i ? " superdoc-esign-btn--loading" : ""}`,
65
65
  style: {
66
66
  padding: "8px 16px",
67
67
  borderRadius: "6px",
@@ -78,25 +78,25 @@ const be = (u) => {
78
78
  transition: "opacity 0.2s ease"
79
79
  },
80
80
  children: [
81
- a && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner" }),
82
- a ? "Downloading..." : m,
83
- !a && o && ` (${o})`
81
+ i && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner" }),
82
+ i ? "Downloading..." : m,
83
+ !i && n && ` (${n})`
84
84
  ]
85
85
  }
86
86
  );
87
- }, Ce = (u) => ({
88
- onClick: s,
89
- isValid: o,
90
- isDisabled: r,
91
- isSubmitting: a
87
+ }, ge = (u) => ({
88
+ onClick: r,
89
+ isValid: n,
90
+ isDisabled: s,
91
+ isSubmitting: i
92
92
  }) => {
93
- const m = u?.label || "Submit", p = !o || r || a;
93
+ const m = u?.label || "Submit", p = !n || s || i;
94
94
  return /* @__PURE__ */ b(
95
95
  "button",
96
96
  {
97
- onClick: s,
97
+ onClick: r,
98
98
  disabled: p,
99
- className: `superdoc-esign-btn superdoc-esign-btn--submit${a ? " superdoc-esign-btn--loading" : ""}`,
99
+ className: `superdoc-esign-btn superdoc-esign-btn--submit${i ? " superdoc-esign-btn--loading" : ""}`,
100
100
  style: {
101
101
  padding: "12px 24px",
102
102
  borderRadius: "6px",
@@ -104,7 +104,7 @@ const be = (u) => {
104
104
  background: "#007bff",
105
105
  color: "#fff",
106
106
  cursor: p ? "not-allowed" : "pointer",
107
- opacity: p && !a ? 0.5 : 1,
107
+ opacity: p && !i ? 0.5 : 1,
108
108
  fontSize: "16px",
109
109
  fontWeight: "bold",
110
110
  display: "inline-flex",
@@ -113,321 +113,295 @@ const be = (u) => {
113
113
  transition: "opacity 0.2s ease"
114
114
  },
115
115
  children: [
116
- a && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner superdoc-esign-spinner--light" }),
117
- a ? "Submitting..." : m
116
+ i && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner superdoc-esign-spinner--light" }),
117
+ i ? "Submitting..." : m
118
118
  ]
119
119
  }
120
120
  );
121
- }, De = ye(
121
+ }, me = ae(
122
122
  (u, l) => {
123
123
  const {
124
- eventId: s,
125
- document: o,
126
- fields: r = {},
127
- download: a,
124
+ eventId: r,
125
+ document: n,
126
+ fields: s = {},
127
+ download: i,
128
128
  submit: m,
129
129
  onSubmit: p,
130
- onDownload: R,
131
- onStateChange: _,
132
- onFieldChange: z,
133
- onFieldsDiscovered: U,
130
+ onDownload: T,
131
+ onStateChange: A,
132
+ onFieldChange: q,
133
+ onFieldsDiscovered: V,
134
134
  isDisabled: f = !1,
135
- className: te,
136
- style: ne,
137
- documentHeight: oe = "600px"
138
- } = u, [x, $] = v(!o.validation?.scroll?.required), [g, H] = v(/* @__PURE__ */ new Map()), [w, O] = v(!1), [h, j] = v(!1), [q, P] = v(!1), [W, L] = v([]), [K, re] = v(!1), k = C(null), F = C(null), se = C(Date.now()), S = C(r), M = C([]), X = C(U);
139
- S.current = r, X.current = U, A(() => {
140
- M.current = W;
141
- }, [W]);
142
- const y = D((e) => {
135
+ className: X,
136
+ style: Y,
137
+ documentHeight: G = "600px"
138
+ } = u, [x, B] = y(!n.validation?.scroll?.required), [g, _] = y(/* @__PURE__ */ new Map()), [S, U] = y(!1), [h, $] = y(!1), [I, H] = y(!1), [z, O] = y([]), [W, J] = y(!1), E = D(null), F = D(null), Q = D(Date.now()), w = D(s), N = D([]), j = D(V);
139
+ w.current = s, j.current = V, k(() => {
140
+ N.current = z;
141
+ }, [z]);
142
+ const C = M((e) => {
143
143
  if (!F.current?.activeEditor) return;
144
- const t = F.current.activeEditor, i = S.current.signer?.find((n) => n.id === e.id);
145
- if (e.type === "table" && Array.isArray(e.value)) {
146
- const T = t.helpers?.structuredContentCommands?.getStructuredContentTablesById?.(e.id, t.state) || [];
147
- if (T.length) {
148
- const { node: B, pos: me } = T[0], Q = B.childCount;
149
- if (Q > 1) {
150
- let E = t.state.tr;
151
- for (let I = Q - 1; I >= 1; I--) {
152
- let Z = 1;
153
- for (let V = 0; V < I; V++)
154
- Z += B.child(V).nodeSize;
155
- const fe = B.child(I), ee = me + Z, he = ee + fe.nodeSize;
156
- E = E.delete(E.mapping.map(ee), E.mapping.map(he));
157
- }
158
- t.view?.dispatch(E);
159
- }
160
- t.commands?.appendRowsToStructuredContentTable?.({
161
- id: e.id,
162
- rows: e.value,
163
- copyRowStyle: !0
164
- });
165
- }
166
- return;
167
- }
144
+ const t = F.current.activeEditor, a = w.current.signer?.find((o) => o.id === e.id);
168
145
  let c;
169
- i?.type === "signature" && e.value ? c = {
146
+ a?.type === "signature" && e.value ? c = {
170
147
  json: {
171
148
  type: "image",
172
- attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value : be(String(e.value)), alt: "Signature" }
149
+ attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value : le(String(e.value)), alt: "Signature" }
173
150
  }
174
- } : c = { text: String(e.value ?? "") }, e.id && t.commands?.updateStructuredContentById?.(e.id, c);
175
- }, []), Y = D(
151
+ } : c = { text: String(e.value ?? "") }, e.id && t.commands.updateStructuredContentById?.(e.id, c);
152
+ }, []), L = M(
176
153
  (e) => {
177
154
  if (!e) return;
178
155
  const t = e.helpers.structuredContentCommands.getStructuredContentTags(
179
156
  e.state
180
- ), i = /* @__PURE__ */ new Map();
181
- S.current.document?.forEach((n) => {
182
- n.id && i.set(n.id, n.value);
183
- }), S.current.signer?.forEach((n) => {
184
- n.value !== void 0 && i.set(n.id, n.value);
157
+ ), a = /* @__PURE__ */ new Map();
158
+ w.current.document?.forEach((o) => {
159
+ o.id && a.set(o.id, o.value);
160
+ }), w.current.signer?.forEach((o) => {
161
+ o.value !== void 0 && a.set(o.id, o.value);
185
162
  });
186
- const c = t.map(({ node: n }) => ({
187
- id: n.attrs.id,
188
- label: n.attrs.label,
189
- value: i.get(n.attrs.id) ?? n.textContent ?? ""
190
- })).filter((n) => n.id);
191
- c.length > 0 && (X.current?.(c), (S.current.document || []).filter((n) => n.value !== void 0).forEach(
192
- (n) => y({
193
- id: n.id,
194
- value: n.value,
195
- type: n.type
196
- })
197
- ), (S.current.signer || []).filter((n) => n.value !== void 0).forEach(
198
- (n) => y({
199
- id: n.id,
200
- value: n.value
163
+ const c = t.map(({ node: o }) => ({
164
+ id: o.attrs.id,
165
+ label: o.attrs.label,
166
+ value: a.get(o.attrs.id) ?? o.textContent ?? ""
167
+ })).filter((o) => o.id);
168
+ c.length > 0 && (j.current?.(c), [
169
+ ...w.current.document || [],
170
+ ...w.current.signer || []
171
+ ].filter((v) => v.value !== void 0).forEach(
172
+ (v) => C({
173
+ id: v.id,
174
+ value: v.value
201
175
  })
202
176
  ));
203
177
  },
204
- [y]
205
- ), N = (e) => {
178
+ [C]
179
+ ), R = (e) => {
206
180
  const t = {
207
181
  ...e,
208
182
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
209
- }, i = globalThis?.__SUPERDOC_AUDIT_MOCK__;
210
- i && i(t);
211
- const c = [...M.current, t];
212
- return M.current = c, L(c), c;
183
+ }, a = globalThis?.__SUPERDOC_AUDIT_MOCK__;
184
+ a && a(t);
185
+ const c = [...N.current, t];
186
+ return N.current = c, O(c), c;
213
187
  };
214
- A(() => {
215
- if (!k.current) return;
188
+ k(() => {
189
+ if (!E.current) return;
216
190
  let e = !1, t = null;
217
191
  return (async () => {
218
192
  const { SuperDoc: c } = await import("superdoc");
219
193
  e || (t = new c({
220
- selector: k.current,
221
- document: o.source,
194
+ selector: E.current,
195
+ document: n.source,
222
196
  documentMode: "viewing",
223
197
  modules: {
224
198
  comments: !1
225
199
  },
226
200
  // @ts-expect-error - layoutMode is not supported in SuperDoc v1.1.0 yet
227
- layoutMode: o.layoutMode,
228
- layoutMargins: o.layoutMargins,
201
+ layoutMode: n.layoutMode,
202
+ layoutMargins: n.layoutMargins,
229
203
  onReady: () => {
230
- e || (t?.activeEditor && Y(t.activeEditor), N({ type: "ready" }), re(!0));
204
+ e || (t?.activeEditor && L(t.activeEditor), R({ type: "ready" }), J(!0));
231
205
  }
232
206
  }), F.current = t);
233
207
  })(), () => {
234
208
  e = !0, t && typeof t.destroy == "function" && t.destroy(), F.current = null;
235
209
  };
236
210
  }, [
237
- o.source,
238
- o.mode,
239
- o.layoutMode,
240
- o.layoutMargins?.top,
241
- o.layoutMargins?.bottom,
242
- o.layoutMargins?.left,
243
- o.layoutMargins?.right,
244
- Y
245
- ]), A(() => {
246
- if (!o.validation?.scroll?.required || !K) return;
247
- const e = k.current;
211
+ n.source,
212
+ n.mode,
213
+ n.layoutMode,
214
+ n.layoutMargins?.top,
215
+ n.layoutMargins?.bottom,
216
+ n.layoutMargins?.left,
217
+ n.layoutMargins?.right,
218
+ L
219
+ ]), k(() => {
220
+ if (!n.validation?.scroll?.required || !W) return;
221
+ const e = E.current;
248
222
  if (!e) return;
249
223
  const t = () => {
250
- const { scrollTop: i, scrollHeight: c, clientHeight: n } = e, T = i / (c - n);
251
- (T >= 0.95 || c <= n) && ($(!0), N({
224
+ const { scrollTop: a, scrollHeight: c, clientHeight: o } = e, v = a / (c - o);
225
+ (v >= 0.95 || c <= o) && (B(!0), R({
252
226
  type: "scroll",
253
- data: { percent: Math.round(T * 100) }
227
+ data: { percent: Math.round(v * 100) }
254
228
  }));
255
229
  };
256
230
  return e.addEventListener("scroll", t), t(), () => e.removeEventListener("scroll", t);
257
- }, [o.validation?.scroll?.required, K]);
258
- const ae = D(
231
+ }, [n.validation?.scroll?.required, W]);
232
+ const Z = M(
259
233
  (e, t) => {
260
- H((i) => {
261
- const c = i.get(e), n = new Map(i);
262
- return n.set(e, t), y({
234
+ _((a) => {
235
+ const c = a.get(e), o = new Map(a);
236
+ return o.set(e, t), C({
263
237
  id: e,
264
238
  value: t
265
- }), N({
239
+ }), R({
266
240
  type: "field_change",
267
241
  data: { fieldId: e, value: t, previousValue: c }
268
- }), z?.({
242
+ }), q?.({
269
243
  id: e,
270
244
  value: t,
271
245
  previousValue: c
272
- }), n;
246
+ }), o;
273
247
  });
274
248
  },
275
- [z, y]
276
- ), G = D(() => o.validation?.scroll?.required && !x ? !1 : (r.signer || []).every((e) => {
249
+ [q, C]
250
+ ), P = M(() => n.validation?.scroll?.required && !x ? !1 : (s.signer || []).every((e) => {
277
251
  if (!e.validation?.required) return !0;
278
252
  const t = g.get(e.id);
279
253
  return t && (typeof t != "string" || t.trim());
280
- }), [x, r.signer, g, o.validation?.scroll?.required]);
281
- A(() => {
282
- const e = G();
283
- O(e), _?.({
254
+ }), [x, s.signer, g, n.validation?.scroll?.required]);
255
+ k(() => {
256
+ const e = P();
257
+ U(e), A?.({
284
258
  scrolled: x,
285
259
  fields: g,
286
260
  isValid: e,
287
261
  isSubmitting: h
288
262
  });
289
- }, [x, g, h, G, _]);
290
- const ie = D(async () => {
291
- if (f || q) return;
292
- P(!0);
263
+ }, [x, g, h, P, A]);
264
+ const ee = M(async () => {
265
+ if (f || I) return;
266
+ H(!0);
293
267
  const e = {
294
- eventId: s,
295
- documentSource: o.source,
268
+ eventId: r,
269
+ documentSource: n.source,
296
270
  fields: {
297
- document: r.document || [],
298
- signer: (r.signer || []).map((t) => ({
271
+ document: s.document || [],
272
+ signer: (s.signer || []).map((t) => ({
299
273
  id: t.id,
300
274
  value: g.get(t.id) ?? null
301
275
  }))
302
276
  },
303
- fileName: a?.fileName || "document.pdf"
277
+ fileName: i?.fileName || "document.pdf"
304
278
  };
305
279
  try {
306
- await R?.(e);
280
+ await T?.(e);
307
281
  } finally {
308
- P(!1);
282
+ H(!1);
309
283
  }
310
284
  }, [
311
285
  f,
312
- q,
313
- s,
314
- o.source,
286
+ I,
315
287
  r,
288
+ n.source,
289
+ s,
316
290
  g,
317
- a,
318
- R
319
- ]), ce = D(async () => {
320
- if (!w || f || h) return;
321
- j(!0), N({ type: "submit" });
322
- const e = N({ type: "submit" }), t = {
323
- eventId: s,
291
+ i,
292
+ T
293
+ ]), te = M(async () => {
294
+ if (!S || f || h) return;
295
+ $(!0);
296
+ const e = R({ type: "submit" }), t = {
297
+ eventId: r,
324
298
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
325
- duration: Math.floor((Date.now() - se.current) / 1e3),
299
+ duration: Math.floor((Date.now() - Q.current) / 1e3),
326
300
  auditTrail: e,
327
- documentFields: r.document || [],
328
- signerFields: (r.signer || []).map((i) => ({
329
- id: i.id,
330
- value: g.get(i.id) ?? null
301
+ documentFields: s.document || [],
302
+ signerFields: (s.signer || []).map((a) => ({
303
+ id: a.id,
304
+ value: g.get(a.id) ?? null
331
305
  })),
332
- isFullyCompleted: w
306
+ isFullyCompleted: S
333
307
  };
334
308
  try {
335
309
  await p(t);
336
310
  } finally {
337
- j(!1);
311
+ $(!1);
338
312
  }
339
- }, [w, f, h, s, r, g, p]), le = (e) => {
340
- const t = e.component || de(e.type);
313
+ }, [S, f, h, r, s, g, p]), ne = (e) => {
314
+ const t = e.component || oe(e.type);
341
315
  return /* @__PURE__ */ d(
342
316
  t,
343
317
  {
344
318
  value: g.get(e.id) ?? null,
345
- onChange: (i) => ae(e.id, i),
319
+ onChange: (a) => Z(e.id, a),
346
320
  isDisabled: f,
347
321
  label: e.label
348
322
  },
349
323
  e.id
350
324
  );
351
- }, de = (e) => {
325
+ }, oe = (e) => {
352
326
  switch (e) {
353
327
  case "signature":
354
328
  case "text":
355
- return xe;
329
+ return de;
356
330
  case "checkbox":
357
- return we;
331
+ return ue;
358
332
  }
359
- }, ue = () => {
360
- const e = a?.component || Se(a);
333
+ }, se = () => {
334
+ const e = i?.component || pe(i);
361
335
  return e ? /* @__PURE__ */ d(
362
336
  e,
363
337
  {
364
- onClick: ie,
365
- fileName: a?.fileName,
338
+ onClick: ee,
339
+ fileName: i?.fileName,
366
340
  isDisabled: f,
367
- isDownloading: q
341
+ isDownloading: I
368
342
  }
369
343
  ) : null;
370
- }, pe = () => {
371
- if (o.mode === "download")
344
+ }, re = () => {
345
+ if (n.mode === "download")
372
346
  return null;
373
- const e = m?.component || Ce(m);
347
+ const e = m?.component || ge(m);
374
348
  return /* @__PURE__ */ d("div", { className: "superdoc-esign-actions superdoc-esign-form-actions", children: /* @__PURE__ */ d(
375
349
  e,
376
350
  {
377
- onClick: ce,
378
- isValid: w,
351
+ onClick: te,
352
+ isValid: S,
379
353
  isDisabled: f,
380
354
  isSubmitting: h
381
355
  }
382
356
  ) });
383
- }, J = ue(), ge = pe();
384
- return ve(
357
+ }, K = se(), ie = re();
358
+ return ce(
385
359
  l,
386
360
  () => ({
387
361
  getState: () => ({
388
362
  scrolled: x,
389
363
  fields: g,
390
- isValid: w,
364
+ isValid: S,
391
365
  isSubmitting: h
392
366
  }),
393
- getAuditTrail: () => M.current,
367
+ getAuditTrail: () => N.current,
394
368
  reset: () => {
395
- $(!o.validation?.scroll?.required), H(/* @__PURE__ */ new Map()), O(!1), M.current = [], L([]);
369
+ B(!n.validation?.scroll?.required), _(/* @__PURE__ */ new Map()), U(!1), N.current = [], O([]);
396
370
  },
397
- updateFieldInDocument: y
371
+ updateFieldInDocument: C
398
372
  }),
399
373
  [
400
374
  x,
401
375
  g,
402
- w,
376
+ S,
403
377
  h,
404
- o.validation?.scroll?.required,
405
- y
378
+ n.validation?.scroll?.required,
379
+ C
406
380
  ]
407
- ), /* @__PURE__ */ b("div", { className: `superdoc-esign-container ${te || ""}`, style: ne, children: [
381
+ ), /* @__PURE__ */ b("div", { className: `superdoc-esign-container ${X || ""}`, style: Y, children: [
408
382
  /* @__PURE__ */ b("div", { className: "superdoc-esign-document", "data-testid": "superdoc-esign-document", children: [
409
- J && /* @__PURE__ */ d("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ d("div", { className: "superdoc-esign-document-controls", children: J }) }),
383
+ K && /* @__PURE__ */ d("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ d("div", { className: "superdoc-esign-document-controls", children: K }) }),
410
384
  /* @__PURE__ */ d(
411
385
  "div",
412
386
  {
413
- ref: k,
387
+ ref: E,
414
388
  className: "superdoc-esign-document-viewer",
415
389
  "data-testid": "superdoc-scroll-container",
416
- style: { height: oe, overflow: "auto" }
390
+ style: { height: G, overflow: "auto" }
417
391
  }
418
392
  )
419
393
  ] }),
420
394
  /* @__PURE__ */ b("div", { className: "superdoc-esign-controls", "data-testid": "superdoc-esign-controls", children: [
421
- r.signer && r.signer.length > 0 && /* @__PURE__ */ d("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: r.signer.map(le) }),
422
- ge
395
+ s.signer && s.signer.length > 0 && /* @__PURE__ */ d("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: s.signer.map(ne) }),
396
+ ie
423
397
  ] })
424
398
  ] });
425
399
  }
426
400
  );
427
- De.displayName = "SuperDocESign";
401
+ me.displayName = "SuperDocESign";
428
402
  export {
429
- we as CheckboxInput,
430
- xe as SignatureInput,
431
- De as default,
432
- be as textToImageDataUrl
403
+ ue as CheckboxInput,
404
+ de as SignatureInput,
405
+ me as default,
406
+ le as textToImageDataUrl
433
407
  };
package/dist/types.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  export type FieldValue = string | boolean | number | null | undefined;
2
- export type TableFieldValue = string[][];
3
2
  export interface FieldReference {
4
3
  id: string;
5
4
  }
6
5
  export interface DocumentField extends FieldReference {
7
- type?: 'text' | 'table';
8
- value: FieldValue | TableFieldValue;
6
+ value: FieldValue;
9
7
  }
10
8
  export interface SignerField extends FieldReference {
11
9
  type: 'signature' | 'checkbox' | 'text';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,MAAM,EAAE,EAAE,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,KAAK,EAAE,UAAU,GAAG,eAAe,CAAC;CACrC;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE;QACX,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAA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a,GAAG;IAAE,aAAa,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,UAAU,CAAC;CACnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/esign",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.1-next.1",
4
4
  "description": "React eSignature component for SuperDoc",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,19 +23,16 @@
23
23
  "dev": "vite build --watch",
24
24
  "build": "tsc && vite build",
25
25
  "type-check": "tsc --noEmit",
26
- "lint": "eslint src demo",
27
- "lint:fix": "eslint src demo --fix",
28
- "format": "prettier --write \"src/**/*.{ts,tsx}\" \"demo/**/*.{ts,tsx}\"",
29
- "format:check": "prettier --check \"src/**/*.{ts,tsx}\" \"demo/**/*.{ts,tsx}\"",
30
- "test": "vitest",
26
+ "lint": "eslint src",
27
+ "lint:fix": "eslint src --fix",
28
+ "test": "vitest run",
31
29
  "test:watch": "vitest --watch",
32
- "prepare": "husky",
33
- "release": "semantic-release",
34
- "check:all": "pnpm run format:check && pnpm run lint && pnpm run type-check && pnpm run build"
30
+ "prepublishOnly": "pnpm run build"
35
31
  },
36
32
  "repository": {
37
33
  "type": "git",
38
- "url": "https://github.com/superdoc-dev/esign.git"
34
+ "url": "git+https://github.com/superdoc-dev/superdoc.git",
35
+ "directory": "packages/esign"
39
36
  },
40
37
  "keywords": [
41
38
  "superdoc",
@@ -50,49 +47,31 @@
50
47
  "author": "SuperDoc Team",
51
48
  "license": "AGPL-3.0",
52
49
  "bugs": {
53
- "url": "https://github.com/superdoc-dev/esign/issues"
50
+ "url": "https://github.com/superdoc-dev/superdoc/issues"
54
51
  },
55
- "homepage": "https://github.com/superdoc-dev/esign#readme",
52
+ "homepage": "https://github.com/superdoc-dev/superdoc/tree/main/packages/esign#readme",
56
53
  "peerDependencies": {
57
54
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
58
55
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
59
56
  "superdoc": "^1.9.0"
60
57
  },
61
58
  "devDependencies": {
62
- "@commitlint/cli": "^20.1.0",
63
- "@commitlint/config-conventional": "^20.0.0",
64
- "@eslint/js": "^9.36.0",
65
- "@semantic-release/changelog": "^6.0.3",
66
- "@semantic-release/git": "^10.0.1",
67
- "@testing-library/jest-dom": "^6.9.1",
68
- "@testing-library/react": "^16.3.0",
69
- "@testing-library/user-event": "^14.6.1",
70
- "@types/node": "^24.5.2",
71
- "@types/react": "^19.2.2",
72
- "@types/react-dom": "^19.2.1",
73
- "@vitejs/plugin-react": "^5.0.4",
74
- "eslint": "^9.36.0",
75
- "eslint-plugin-react": "^7.37.5",
76
- "eslint-plugin-react-hooks": "^6.1.0",
77
- "husky": "^9.1.7",
78
- "jsdom": "^27.0.0",
79
- "lint-staged": "^16.2.7",
80
- "prettier": "^3.6.2",
81
- "react": "^19.2.0",
82
- "react-dom": "^19.2.0",
83
- "semantic-release": "^24.2.9",
84
- "superdoc": "1.9.0",
85
- "typescript": "^5.9.2",
86
- "typescript-eslint": "^8.44.1",
87
- "vite": "^7.1.7",
88
- "vite-plugin-dts": "^4.5.4",
89
- "vitest": "^3.2.4"
90
- },
91
- "lint-staged": {
92
- "*.{ts,tsx}": [
93
- "prettier --write",
94
- "eslint --fix"
95
- ]
59
+ "@testing-library/jest-dom": "catalog:",
60
+ "@testing-library/react": "catalog:",
61
+ "@testing-library/user-event": "catalog:",
62
+ "@types/react": "catalog:",
63
+ "@types/react-dom": "catalog:",
64
+ "@vitejs/plugin-react": "catalog:",
65
+ "eslint-plugin-react": "catalog:",
66
+ "eslint-plugin-react-hooks": "catalog:",
67
+ "react": "catalog:",
68
+ "react-dom": "catalog:",
69
+ "superdoc": "workspace:*",
70
+ "typescript": "catalog:",
71
+ "vite": "catalog:",
72
+ "vite-plugin-dts": "catalog:",
73
+ "vitest": "catalog:",
74
+ "jsdom": "catalog:"
96
75
  },
97
76
  "publishConfig": {
98
77
  "access": "public"