@superdoc-dev/esign 1.4.0-next.3 → 1.4.0-next.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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signature.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/signature.test.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import { textToImageDataUrl } from './utils/signature';
1
2
  import { SignatureInput, CheckboxInput } from './defaults';
2
3
  import type * as Types from './types';
3
4
  export * from './types';
5
+ export { textToImageDataUrl };
4
6
  export { SignatureInput, CheckboxInput };
5
7
  declare const SuperDocESign: import('react').ForwardRefExoticComponent<Types.SuperDocESignProps & import('react').RefAttributes<Types.SuperDocESignHandle>>;
6
8
  export default SuperDocESign;
@@ -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,EACL,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AAEpB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAIzC,QAAA,MAAM,aAAa,gIAielB,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,gIAuclB,CAAC;AAIF,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var de=Object.create;var P=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty;var he=(l,p,u,n)=>{if(p&&typeof p=="object"||typeof p=="function")for(let s of ge(p))!fe.call(l,s)&&s!==u&&P(l,s,{get:()=>p[s],enumerable:!(n=pe(p,s))||n.enumerable});return l};var ve=(l,p,u)=>(u=l!=null?de(me(l)):{},he(p||!l||!l.__esModule?P(u,"default",{value:l,enumerable:!0}):u,l));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),a=require("react"),W=({value:l,onChange:p,isDisabled:u,label:n})=>c.jsxs("div",{className:"superdoc-esign-signature-input",style:{display:"flex",flexDirection:"column",gap:"8px"},children:[n&&c.jsx("label",{children:n}),c.jsx("input",{type:"text",value:String(l||""),onChange:s=>p(s.target.value),disabled:u,placeholder:"Type your full name",style:{fontFamily:"cursive",fontSize:"18px"}})]}),L=({value:l,onChange:p,isDisabled:u,label:n})=>c.jsxs("label",{className:"superdoc-esign-checkbox-input",style:{display:"flex",gap:"8px"},children:[c.jsx("input",{type:"checkbox",checked:!!l,onChange:s=>p(s.target.checked),disabled:u}),c.jsx("span",{children:n})]}),xe=l=>({onClick:u,fileName:n,isDisabled:s,isDownloading:d})=>{const x=l?.label||"Download",m=s||d;return c.jsxs("button",{onClick:u,disabled:m,className:`superdoc-esign-btn superdoc-esign-btn--download${d?" superdoc-esign-btn--loading":""}`,style:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #d0d5dd",background:"#ffffff",color:"#333",cursor:m?"not-allowed":"pointer",opacity:m?.7:1,fontSize:"16px",fontWeight:"bold",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.2s ease"},children:[d&&c.jsx("span",{className:"superdoc-esign-spinner"}),d?"Downloading...":x,!d&&n&&` (${n})`]})},ye=l=>({onClick:u,isValid:n,isDisabled:s,isSubmitting:d})=>{const x=l?.label||"Submit",m=!n||s||d;return c.jsxs("button",{onClick:u,disabled:m,className:`superdoc-esign-btn superdoc-esign-btn--submit${d?" superdoc-esign-btn--loading":""}`,style:{padding:"12px 24px",borderRadius:"6px",border:"none",background:"#007bff",color:"#fff",cursor:m?"not-allowed":"pointer",opacity:m&&!d?.5:1,fontSize:"16px",fontWeight:"bold",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.2s ease"},children:[d&&c.jsx("span",{className:"superdoc-esign-spinner superdoc-esign-spinner--light"}),d?"Submitting...":x]})},K=a.forwardRef((l,p)=>{const{eventId:u,document:n,fields:s={},download:d,submit:x,onSubmit:m,onDownload:k,onStateChange:E,onFieldChange:N,onFieldsDiscovered:T,isDisabled:h=!1,className:X,style:Y,documentHeight:G="600px"}=l,[y,F]=a.useState(!n.validation?.scroll?.required),[g,I]=a.useState(new Map),[b,q]=a.useState(!1),[v,A]=a.useState(!1),[R,_]=a.useState(!1),[V,B]=a.useState([]),[U,J]=a.useState(!1),j=a.useRef(null),M=a.useRef(null),Q=a.useRef(Date.now()),S=a.useRef(s),w=a.useRef([]),$=a.useRef(T);S.current=s,$.current=T,a.useEffect(()=>{w.current=V},[V]);const C=a.useCallback(e=>{if(!M.current?.activeEditor)return;const t=M.current.activeEditor,o=S.current.signer?.find(r=>r.id===e.id);let i;o?.type==="signature"&&e.value?i={json:{type:"image",attrs:{src:typeof e.value=="string"&&e.value.startsWith("data:image/")?e.value:Z(String(e.value)),alt:"Signature"}}}:i={text:String(e.value??"")},e.id&&t.commands.updateStructuredContentById(e.id,i)},[]);function Z(e){const t=globalThis.document.createElement("canvas"),o=t.getContext("2d"),i=30;o.font=`italic ${i}px cursive`;const f=o.measureText(e).width,ce=i*1.3,le=4,ue=6;return t.width=Math.ceil(f+le*2)+20,t.height=Math.ceil(ce+ue*2),o.font=`italic ${i}px cursive`,o.fillStyle="black",o.textAlign="center",o.textBaseline="middle",o.fillText(e,t.width/2,t.height/2),t.toDataURL("image/png")}const H=a.useCallback(e=>{if(!e)return;const t=e.helpers.structuredContentCommands.getStructuredContentTags(e.state),o=new Map;S.current.document?.forEach(r=>{r.id&&o.set(r.id,r.value)}),S.current.signer?.forEach(r=>{r.value!==void 0&&o.set(r.id,r.value)});const i=t.map(({node:r})=>({id:r.attrs.id,label:r.attrs.label,value:o.get(r.attrs.id)??r.textContent??""})).filter(r=>r.id);i.length>0&&($.current?.(i),[...S.current.document||[],...S.current.signer||[]].filter(f=>f.value!==void 0).forEach(f=>C({id:f.id,value:f.value})))},[C]),D=e=>{const t={...e,timestamp:new Date().toISOString()},o=globalThis?.__SUPERDOC_AUDIT_MOCK__;o&&o(t);const i=[...w.current,t];return w.current=i,B(i),i};a.useEffect(()=>{if(!j.current)return;let e=!1,t=null;return(async()=>{const{SuperDoc:i}=await import("superdoc");e||(t=new i({selector:j.current,document:n.source,documentMode:"viewing",modules:{comments:!1},layoutMode:n.layoutMode,layoutMargins:n.layoutMargins,onReady:()=>{e||(t?.activeEditor&&H(t.activeEditor),D({type:"ready"}),J(!0))}}),M.current=t)})(),()=>{e=!0,t&&typeof t.destroy=="function"&&t.destroy(),M.current=null}},[n.source,n.mode,n.layoutMode,n.layoutMargins?.top,n.layoutMargins?.bottom,n.layoutMargins?.left,n.layoutMargins?.right,H]),a.useEffect(()=>{if(!n.validation?.scroll?.required||!U)return;const e=j.current;if(!e)return;const t=()=>{const{scrollTop:o,scrollHeight:i,clientHeight:r}=e,f=o/(i-r);(f>=.95||i<=r)&&(F(!0),D({type:"scroll",data:{percent:Math.round(f*100)}}))};return e.addEventListener("scroll",t),t(),()=>e.removeEventListener("scroll",t)},[n.validation?.scroll?.required,U]);const ee=a.useCallback((e,t)=>{I(o=>{const i=o.get(e),r=new Map(o);return r.set(e,t),C({id:e,value:t}),D({type:"field_change",data:{fieldId:e,value:t,previousValue:i}}),N?.({id:e,value:t,previousValue:i}),r})},[N,C]),O=a.useCallback(()=>n.validation?.scroll?.required&&!y?!1:(s.signer||[]).every(e=>{if(!e.validation?.required)return!0;const t=g.get(e.id);return t&&(typeof t!="string"||t.trim())}),[y,s.signer,g,n.validation?.scroll?.required]);a.useEffect(()=>{const e=O();q(e),E?.({scrolled:y,fields:g,isValid:e,isSubmitting:v})},[y,g,v,O,E]);const te=a.useCallback(async()=>{if(h||R)return;_(!0);const e={eventId:u,documentSource:n.source,fields:{document:s.document||[],signer:(s.signer||[]).map(t=>({id:t.id,value:g.get(t.id)??null}))},fileName:d?.fileName||"document.pdf"};try{await k?.(e)}finally{_(!1)}},[h,R,u,n.source,s,g,d,k]),ne=a.useCallback(async()=>{if(!b||h||v)return;A(!0),D({type:"submit"});const e=D({type:"submit"}),t={eventId:u,timestamp:new Date().toISOString(),duration:Math.floor((Date.now()-Q.current)/1e3),auditTrail:e,documentFields:s.document||[],signerFields:(s.signer||[]).map(o=>({id:o.id,value:g.get(o.id)??null})),isFullyCompleted:b};try{await m(t)}finally{A(!1)}},[b,h,v,u,s,g,m]),se=e=>{const t=e.component||oe(e.type);return c.jsx(t,{value:g.get(e.id)??null,onChange:o=>ee(e.id,o),isDisabled:h,label:e.label},e.id)},oe=e=>{switch(e){case"signature":case"text":return W;case"checkbox":return L}},re=()=>{const e=d?.component||xe(d);return e?c.jsx(e,{onClick:te,fileName:d?.fileName,isDisabled:h,isDownloading:R}):null},ae=()=>{if(n.mode==="download")return null;const e=x?.component||ye(x);return c.jsx("div",{className:"superdoc-esign-actions superdoc-esign-form-actions",children:c.jsx(e,{onClick:ne,isValid:b,isDisabled:h,isSubmitting:v})})},z=re(),ie=ae();return a.useImperativeHandle(p,()=>({getState:()=>({scrolled:y,fields:g,isValid:b,isSubmitting:v}),getAuditTrail:()=>w.current,reset:()=>{F(!n.validation?.scroll?.required),I(new Map),q(!1),w.current=[],B([])},updateFieldInDocument:C}),[y,g,b,v,n.validation?.scroll?.required,C]),c.jsxs("div",{className:`superdoc-esign-container ${X||""}`,style:Y,children:[c.jsxs("div",{className:"superdoc-esign-document","data-testid":"superdoc-esign-document",children:[z&&c.jsx("div",{className:"superdoc-esign-document-toolbar",children:c.jsx("div",{className:"superdoc-esign-document-controls",children:z})}),c.jsx("div",{ref:j,className:"superdoc-esign-document-viewer","data-testid":"superdoc-scroll-container",style:{height:G,overflow:"auto"}})]}),c.jsxs("div",{className:"superdoc-esign-controls","data-testid":"superdoc-esign-controls",children:[s.signer&&s.signer.length>0&&c.jsx("div",{className:"superdoc-esign-fields","data-testid":"superdoc-esign-fields",children:s.signer.map(se)}),ie]})]})});K.displayName="SuperDocESign";exports.CheckboxInput=L;exports.SignatureInput=W;exports.default=K;
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,j=6;return c.width=Math.ceil(u+g*2)+20,c.height=Math.ceil(f+j*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:j,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),M=r.useRef(null),R=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(!R.current?.activeEditor)return;const n=R.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]),D=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(!M.current)return;let e=!1,n=null;return(async()=>{const{SuperDoc:p}=await import("superdoc");e||(n=new p({selector:M.current,document:t.source,documentMode:"viewing",modules:{comments:!1},layoutMode:t.layoutMode,layoutMargins:t.layoutMargins,onReady:()=>{e||(n?.activeEditor&&H(n.activeEditor),D({type:"ready"}),Q(!0))}}),R.current=n)})(),()=>{e=!0,n&&typeof n.destroy=="function"&&n.destroy(),R.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=M.current;if(!e)return;const n=()=>{const{scrollTop:d,scrollHeight:p,clientHeight:a}=e,v=d/(p-a);(v>=.95||p<=a)&&(F(!0),D({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}),D({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 j?.(e)}finally{_(!1)}},[h,k,o,t.source,s,m,u,j]),ne=r.useCallback(async()=>{if(!b||h||x)return;A(!0),D({type:"submit"});const e=D({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:M,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,24 +1,29 @@
1
- import { jsxs as y, jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as ue, useState as v, useRef as D, useEffect as R, useCallback as M, useImperativeHandle as pe } from "react";
3
- const ge = ({
4
- value: p,
5
- onChange: m,
6
- isDisabled: l,
1
+ import { jsxs as b, jsx as d } from "react/jsx-runtime";
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, E = 6;
7
+ return l.width = Math.ceil(i + p * 2) + 20, l.height = Math.ceil(m + E * 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
+ value: u,
10
+ onChange: l,
11
+ isDisabled: r,
7
12
  label: n
8
- }) => /* @__PURE__ */ y(
13
+ }) => /* @__PURE__ */ b(
9
14
  "div",
10
15
  {
11
16
  className: "superdoc-esign-signature-input",
12
17
  style: { display: "flex", flexDirection: "column", gap: "8px" },
13
18
  children: [
14
- n && /* @__PURE__ */ c("label", { children: n }),
15
- /* @__PURE__ */ c(
19
+ n && /* @__PURE__ */ d("label", { children: n }),
20
+ /* @__PURE__ */ d(
16
21
  "input",
17
22
  {
18
23
  type: "text",
19
- value: String(p || ""),
20
- onChange: (i) => m(i.target.value),
21
- disabled: l,
24
+ value: String(u || ""),
25
+ onChange: (o) => l(o.target.value),
26
+ disabled: r,
22
27
  placeholder: "Type your full name",
23
28
  style: {
24
29
  fontFamily: "cursive",
@@ -28,43 +33,43 @@ const ge = ({
28
33
  )
29
34
  ]
30
35
  }
31
- ), me = ({
32
- value: p,
33
- onChange: m,
34
- isDisabled: l,
36
+ ), ue = ({
37
+ value: u,
38
+ onChange: l,
39
+ isDisabled: r,
35
40
  label: n
36
- }) => /* @__PURE__ */ y("label", { className: "superdoc-esign-checkbox-input", style: { display: "flex", gap: "8px" }, children: [
37
- /* @__PURE__ */ c(
41
+ }) => /* @__PURE__ */ b("label", { className: "superdoc-esign-checkbox-input", style: { display: "flex", gap: "8px" }, children: [
42
+ /* @__PURE__ */ d(
38
43
  "input",
39
44
  {
40
45
  type: "checkbox",
41
- checked: !!p,
42
- onChange: (i) => m(i.target.checked),
43
- disabled: l
46
+ checked: !!u,
47
+ onChange: (o) => l(o.target.checked),
48
+ disabled: r
44
49
  }
45
50
  ),
46
- /* @__PURE__ */ c("span", { children: n })
47
- ] }), fe = (p) => ({
48
- onClick: l,
51
+ /* @__PURE__ */ d("span", { children: n })
52
+ ] }), pe = (u) => ({
53
+ onClick: r,
49
54
  fileName: n,
50
- isDisabled: i,
51
- isDownloading: a
55
+ isDisabled: o,
56
+ isDownloading: i
52
57
  }) => {
53
- const b = p?.label || "Download", u = i || a;
54
- return /* @__PURE__ */ y(
58
+ const m = u?.label || "Download", p = o || i;
59
+ return /* @__PURE__ */ b(
55
60
  "button",
56
61
  {
57
- onClick: l,
58
- disabled: u,
59
- className: `superdoc-esign-btn superdoc-esign-btn--download${a ? " superdoc-esign-btn--loading" : ""}`,
62
+ onClick: r,
63
+ disabled: p,
64
+ className: `superdoc-esign-btn superdoc-esign-btn--download${i ? " superdoc-esign-btn--loading" : ""}`,
60
65
  style: {
61
66
  padding: "8px 16px",
62
67
  borderRadius: "6px",
63
68
  border: "1px solid #d0d5dd",
64
69
  background: "#ffffff",
65
70
  color: "#333",
66
- cursor: u ? "not-allowed" : "pointer",
67
- opacity: u ? 0.7 : 1,
71
+ cursor: p ? "not-allowed" : "pointer",
72
+ opacity: p ? 0.7 : 1,
68
73
  fontSize: "16px",
69
74
  fontWeight: "bold",
70
75
  display: "inline-flex",
@@ -73,33 +78,33 @@ const ge = ({
73
78
  transition: "opacity 0.2s ease"
74
79
  },
75
80
  children: [
76
- a && /* @__PURE__ */ c("span", { className: "superdoc-esign-spinner" }),
77
- a ? "Downloading..." : b,
78
- !a && n && ` (${n})`
81
+ i && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner" }),
82
+ i ? "Downloading..." : m,
83
+ !i && n && ` (${n})`
79
84
  ]
80
85
  }
81
86
  );
82
- }, he = (p) => ({
83
- onClick: l,
87
+ }, ge = (u) => ({
88
+ onClick: r,
84
89
  isValid: n,
85
- isDisabled: i,
86
- isSubmitting: a
90
+ isDisabled: o,
91
+ isSubmitting: i
87
92
  }) => {
88
- const b = p?.label || "Submit", u = !n || i || a;
89
- return /* @__PURE__ */ y(
93
+ const m = u?.label || "Submit", p = !n || o || i;
94
+ return /* @__PURE__ */ b(
90
95
  "button",
91
96
  {
92
- onClick: l,
93
- disabled: u,
94
- className: `superdoc-esign-btn superdoc-esign-btn--submit${a ? " superdoc-esign-btn--loading" : ""}`,
97
+ onClick: r,
98
+ disabled: p,
99
+ className: `superdoc-esign-btn superdoc-esign-btn--submit${i ? " superdoc-esign-btn--loading" : ""}`,
95
100
  style: {
96
101
  padding: "12px 24px",
97
102
  borderRadius: "6px",
98
103
  border: "none",
99
104
  background: "#007bff",
100
105
  color: "#fff",
101
- cursor: u ? "not-allowed" : "pointer",
102
- opacity: u && !a ? 0.5 : 1,
106
+ cursor: p ? "not-allowed" : "pointer",
107
+ opacity: p && !i ? 0.5 : 1,
103
108
  fontSize: "16px",
104
109
  fontWeight: "bold",
105
110
  display: "inline-flex",
@@ -108,21 +113,21 @@ const ge = ({
108
113
  transition: "opacity 0.2s ease"
109
114
  },
110
115
  children: [
111
- a && /* @__PURE__ */ c("span", { className: "superdoc-esign-spinner superdoc-esign-spinner--light" }),
112
- a ? "Submitting..." : b
116
+ i && /* @__PURE__ */ d("span", { className: "superdoc-esign-spinner superdoc-esign-spinner--light" }),
117
+ i ? "Submitting..." : m
113
118
  ]
114
119
  }
115
120
  );
116
- }, ve = ue(
117
- (p, m) => {
121
+ }, me = ae(
122
+ (u, l) => {
118
123
  const {
119
- eventId: l,
124
+ eventId: r,
120
125
  document: n,
121
- fields: i = {},
122
- download: a,
123
- submit: b,
124
- onSubmit: u,
125
- onDownload: I,
126
+ fields: o = {},
127
+ download: i,
128
+ submit: m,
129
+ onSubmit: p,
130
+ onDownload: E,
126
131
  onStateChange: A,
127
132
  onFieldChange: q,
128
133
  onFieldsDiscovered: V,
@@ -130,50 +135,43 @@ const ge = ({
130
135
  className: X,
131
136
  style: Y,
132
137
  documentHeight: G = "600px"
133
- } = p, [x, B] = v(!n.validation?.scroll?.required), [d, _] = v(/* @__PURE__ */ new Map()), [S, U] = v(!1), [h, $] = v(!1), [k, H] = v(!1), [z, O] = v([]), [W, J] = v(!1), E = D(null), F = D(null), Q = D(Date.now()), w = D(i), N = D([]), j = D(V);
134
- w.current = i, j.current = V, R(() => {
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), F = D(null), R = D(null), Q = D(Date.now()), w = D(o), N = D([]), j = D(V);
139
+ w.current = o, j.current = V, k(() => {
135
140
  N.current = z;
136
141
  }, [z]);
137
142
  const C = M((e) => {
138
- if (!F.current?.activeEditor) return;
139
- const t = F.current.activeEditor, o = w.current.signer?.find((s) => s.id === e.id);
140
- let r;
141
- o?.type === "signature" && e.value ? r = {
143
+ if (!R.current?.activeEditor) return;
144
+ const t = R.current.activeEditor, a = w.current.signer?.find((s) => s.id === e.id);
145
+ let c;
146
+ a?.type === "signature" && e.value ? c = {
142
147
  json: {
143
148
  type: "image",
144
- attrs: { src: typeof e.value == "string" && e.value.startsWith("data:image/") ? e.value : Z(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" }
145
150
  }
146
- } : r = { text: String(e.value ?? "") }, e.id && t.commands.updateStructuredContentById(e.id, r);
147
- }, []);
148
- function Z(e) {
149
- const t = globalThis.document.createElement("canvas"), o = t.getContext("2d"), r = 30;
150
- o.font = `italic ${r}px cursive`;
151
- const g = o.measureText(e).width, ce = r * 1.3, le = 4, de = 6;
152
- return t.width = Math.ceil(g + le * 2) + 20, t.height = Math.ceil(ce + de * 2), o.font = `italic ${r}px cursive`, o.fillStyle = "black", o.textAlign = "center", o.textBaseline = "middle", o.fillText(e, t.width / 2, t.height / 2), t.toDataURL("image/png");
153
- }
154
- const L = M(
151
+ } : c = { text: String(e.value ?? "") }, e.id && t.commands.updateStructuredContentById(e.id, c);
152
+ }, []), L = M(
155
153
  (e) => {
156
154
  if (!e) return;
157
155
  const t = e.helpers.structuredContentCommands.getStructuredContentTags(
158
156
  e.state
159
- ), o = /* @__PURE__ */ new Map();
157
+ ), a = /* @__PURE__ */ new Map();
160
158
  w.current.document?.forEach((s) => {
161
- s.id && o.set(s.id, s.value);
159
+ s.id && a.set(s.id, s.value);
162
160
  }), w.current.signer?.forEach((s) => {
163
- s.value !== void 0 && o.set(s.id, s.value);
161
+ s.value !== void 0 && a.set(s.id, s.value);
164
162
  });
165
- const r = t.map(({ node: s }) => ({
163
+ const c = t.map(({ node: s }) => ({
166
164
  id: s.attrs.id,
167
165
  label: s.attrs.label,
168
- value: o.get(s.attrs.id) ?? s.textContent ?? ""
166
+ value: a.get(s.attrs.id) ?? s.textContent ?? ""
169
167
  })).filter((s) => s.id);
170
- r.length > 0 && (j.current?.(r), [
168
+ c.length > 0 && (j.current?.(c), [
171
169
  ...w.current.document || [],
172
170
  ...w.current.signer || []
173
- ].filter((g) => g.value !== void 0).forEach(
174
- (g) => C({
175
- id: g.id,
176
- value: g.value
171
+ ].filter((v) => v.value !== void 0).forEach(
172
+ (v) => C({
173
+ id: v.id,
174
+ value: v.value
177
175
  })
178
176
  ));
179
177
  },
@@ -182,31 +180,32 @@ const ge = ({
182
180
  const t = {
183
181
  ...e,
184
182
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
185
- }, o = globalThis?.__SUPERDOC_AUDIT_MOCK__;
186
- o && o(t);
187
- const r = [...N.current, t];
188
- return N.current = r, O(r), r;
183
+ }, a = globalThis?.__SUPERDOC_AUDIT_MOCK__;
184
+ a && a(t);
185
+ const c = [...N.current, t];
186
+ return N.current = c, O(c), c;
189
187
  };
190
- R(() => {
191
- if (!E.current) return;
188
+ k(() => {
189
+ if (!F.current) return;
192
190
  let e = !1, t = null;
193
191
  return (async () => {
194
- const { SuperDoc: r } = await import("superdoc");
195
- e || (t = new r({
196
- selector: E.current,
192
+ const { SuperDoc: c } = await import("superdoc");
193
+ e || (t = new c({
194
+ selector: F.current,
197
195
  document: n.source,
198
196
  documentMode: "viewing",
199
197
  modules: {
200
198
  comments: !1
201
199
  },
200
+ // @ts-expect-error - layoutMode is not supported in SuperDoc v1.1.0 yet
202
201
  layoutMode: n.layoutMode,
203
202
  layoutMargins: n.layoutMargins,
204
203
  onReady: () => {
205
204
  e || (t?.activeEditor && L(t.activeEditor), T({ type: "ready" }), J(!0));
206
205
  }
207
- }), F.current = t);
206
+ }), R.current = t);
208
207
  })(), () => {
209
- e = !0, t && typeof t.destroy == "function" && t.destroy(), F.current = null;
208
+ e = !0, t && typeof t.destroy == "function" && t.destroy(), R.current = null;
210
209
  };
211
210
  }, [
212
211
  n.source,
@@ -217,107 +216,107 @@ const ge = ({
217
216
  n.layoutMargins?.left,
218
217
  n.layoutMargins?.right,
219
218
  L
220
- ]), R(() => {
219
+ ]), k(() => {
221
220
  if (!n.validation?.scroll?.required || !W) return;
222
- const e = E.current;
221
+ const e = F.current;
223
222
  if (!e) return;
224
223
  const t = () => {
225
- const { scrollTop: o, scrollHeight: r, clientHeight: s } = e, g = o / (r - s);
226
- (g >= 0.95 || r <= s) && (B(!0), T({
224
+ const { scrollTop: a, scrollHeight: c, clientHeight: s } = e, v = a / (c - s);
225
+ (v >= 0.95 || c <= s) && (B(!0), T({
227
226
  type: "scroll",
228
- data: { percent: Math.round(g * 100) }
227
+ data: { percent: Math.round(v * 100) }
229
228
  }));
230
229
  };
231
230
  return e.addEventListener("scroll", t), t(), () => e.removeEventListener("scroll", t);
232
231
  }, [n.validation?.scroll?.required, W]);
233
- const ee = M(
232
+ const Z = M(
234
233
  (e, t) => {
235
- _((o) => {
236
- const r = o.get(e), s = new Map(o);
234
+ _((a) => {
235
+ const c = a.get(e), s = new Map(a);
237
236
  return s.set(e, t), C({
238
237
  id: e,
239
238
  value: t
240
239
  }), T({
241
240
  type: "field_change",
242
- data: { fieldId: e, value: t, previousValue: r }
241
+ data: { fieldId: e, value: t, previousValue: c }
243
242
  }), q?.({
244
243
  id: e,
245
244
  value: t,
246
- previousValue: r
245
+ previousValue: c
247
246
  }), s;
248
247
  });
249
248
  },
250
249
  [q, C]
251
- ), P = M(() => n.validation?.scroll?.required && !x ? !1 : (i.signer || []).every((e) => {
250
+ ), P = M(() => n.validation?.scroll?.required && !x ? !1 : (o.signer || []).every((e) => {
252
251
  if (!e.validation?.required) return !0;
253
- const t = d.get(e.id);
252
+ const t = g.get(e.id);
254
253
  return t && (typeof t != "string" || t.trim());
255
- }), [x, i.signer, d, n.validation?.scroll?.required]);
256
- R(() => {
254
+ }), [x, o.signer, g, n.validation?.scroll?.required]);
255
+ k(() => {
257
256
  const e = P();
258
257
  U(e), A?.({
259
258
  scrolled: x,
260
- fields: d,
259
+ fields: g,
261
260
  isValid: e,
262
261
  isSubmitting: h
263
262
  });
264
- }, [x, d, h, P, A]);
265
- const te = M(async () => {
266
- if (f || k) return;
263
+ }, [x, g, h, P, A]);
264
+ const ee = M(async () => {
265
+ if (f || I) return;
267
266
  H(!0);
268
267
  const e = {
269
- eventId: l,
268
+ eventId: r,
270
269
  documentSource: n.source,
271
270
  fields: {
272
- document: i.document || [],
273
- signer: (i.signer || []).map((t) => ({
271
+ document: o.document || [],
272
+ signer: (o.signer || []).map((t) => ({
274
273
  id: t.id,
275
- value: d.get(t.id) ?? null
274
+ value: g.get(t.id) ?? null
276
275
  }))
277
276
  },
278
- fileName: a?.fileName || "document.pdf"
277
+ fileName: i?.fileName || "document.pdf"
279
278
  };
280
279
  try {
281
- await I?.(e);
280
+ await E?.(e);
282
281
  } finally {
283
282
  H(!1);
284
283
  }
285
284
  }, [
286
285
  f,
287
- k,
288
- l,
286
+ I,
287
+ r,
289
288
  n.source,
289
+ o,
290
+ g,
290
291
  i,
291
- d,
292
- a,
293
- I
294
- ]), ne = M(async () => {
292
+ E
293
+ ]), te = M(async () => {
295
294
  if (!S || f || h) return;
296
295
  $(!0), T({ type: "submit" });
297
296
  const e = T({ type: "submit" }), t = {
298
- eventId: l,
297
+ eventId: r,
299
298
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
300
299
  duration: Math.floor((Date.now() - Q.current) / 1e3),
301
300
  auditTrail: e,
302
- documentFields: i.document || [],
303
- signerFields: (i.signer || []).map((o) => ({
304
- id: o.id,
305
- value: d.get(o.id) ?? null
301
+ documentFields: o.document || [],
302
+ signerFields: (o.signer || []).map((a) => ({
303
+ id: a.id,
304
+ value: g.get(a.id) ?? null
306
305
  })),
307
306
  isFullyCompleted: S
308
307
  };
309
308
  try {
310
- await u(t);
309
+ await p(t);
311
310
  } finally {
312
311
  $(!1);
313
312
  }
314
- }, [S, f, h, l, i, d, u]), oe = (e) => {
313
+ }, [S, f, h, r, o, g, p]), ne = (e) => {
315
314
  const t = e.component || se(e.type);
316
- return /* @__PURE__ */ c(
315
+ return /* @__PURE__ */ d(
317
316
  t,
318
317
  {
319
- value: d.get(e.id) ?? null,
320
- onChange: (o) => ee(e.id, o),
318
+ value: g.get(e.id) ?? null,
319
+ onChange: (a) => Z(e.id, a),
321
320
  isDisabled: f,
322
321
  label: e.label
323
322
  },
@@ -327,41 +326,41 @@ const ge = ({
327
326
  switch (e) {
328
327
  case "signature":
329
328
  case "text":
330
- return ge;
329
+ return de;
331
330
  case "checkbox":
332
- return me;
331
+ return ue;
333
332
  }
334
- }, re = () => {
335
- const e = a?.component || fe(a);
336
- return e ? /* @__PURE__ */ c(
333
+ }, oe = () => {
334
+ const e = i?.component || pe(i);
335
+ return e ? /* @__PURE__ */ d(
337
336
  e,
338
337
  {
339
- onClick: te,
340
- fileName: a?.fileName,
338
+ onClick: ee,
339
+ fileName: i?.fileName,
341
340
  isDisabled: f,
342
- isDownloading: k
341
+ isDownloading: I
343
342
  }
344
343
  ) : null;
345
- }, ie = () => {
344
+ }, re = () => {
346
345
  if (n.mode === "download")
347
346
  return null;
348
- const e = b?.component || he(b);
349
- return /* @__PURE__ */ c("div", { className: "superdoc-esign-actions superdoc-esign-form-actions", children: /* @__PURE__ */ c(
347
+ const e = m?.component || ge(m);
348
+ return /* @__PURE__ */ d("div", { className: "superdoc-esign-actions superdoc-esign-form-actions", children: /* @__PURE__ */ d(
350
349
  e,
351
350
  {
352
- onClick: ne,
351
+ onClick: te,
353
352
  isValid: S,
354
353
  isDisabled: f,
355
354
  isSubmitting: h
356
355
  }
357
356
  ) });
358
- }, K = re(), ae = ie();
359
- return pe(
360
- m,
357
+ }, K = oe(), ie = re();
358
+ return ce(
359
+ l,
361
360
  () => ({
362
361
  getState: () => ({
363
362
  scrolled: x,
364
- fields: d,
363
+ fields: g,
365
364
  isValid: S,
366
365
  isSubmitting: h
367
366
  }),
@@ -373,35 +372,36 @@ const ge = ({
373
372
  }),
374
373
  [
375
374
  x,
376
- d,
375
+ g,
377
376
  S,
378
377
  h,
379
378
  n.validation?.scroll?.required,
380
379
  C
381
380
  ]
382
- ), /* @__PURE__ */ y("div", { className: `superdoc-esign-container ${X || ""}`, style: Y, children: [
383
- /* @__PURE__ */ y("div", { className: "superdoc-esign-document", "data-testid": "superdoc-esign-document", children: [
384
- K && /* @__PURE__ */ c("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ c("div", { className: "superdoc-esign-document-controls", children: K }) }),
385
- /* @__PURE__ */ c(
381
+ ), /* @__PURE__ */ b("div", { className: `superdoc-esign-container ${X || ""}`, style: Y, children: [
382
+ /* @__PURE__ */ b("div", { className: "superdoc-esign-document", "data-testid": "superdoc-esign-document", children: [
383
+ K && /* @__PURE__ */ d("div", { className: "superdoc-esign-document-toolbar", children: /* @__PURE__ */ d("div", { className: "superdoc-esign-document-controls", children: K }) }),
384
+ /* @__PURE__ */ d(
386
385
  "div",
387
386
  {
388
- ref: E,
387
+ ref: F,
389
388
  className: "superdoc-esign-document-viewer",
390
389
  "data-testid": "superdoc-scroll-container",
391
390
  style: { height: G, overflow: "auto" }
392
391
  }
393
392
  )
394
393
  ] }),
395
- /* @__PURE__ */ y("div", { className: "superdoc-esign-controls", "data-testid": "superdoc-esign-controls", children: [
396
- i.signer && i.signer.length > 0 && /* @__PURE__ */ c("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: i.signer.map(oe) }),
397
- ae
394
+ /* @__PURE__ */ b("div", { className: "superdoc-esign-controls", "data-testid": "superdoc-esign-controls", children: [
395
+ o.signer && o.signer.length > 0 && /* @__PURE__ */ d("div", { className: "superdoc-esign-fields", "data-testid": "superdoc-esign-fields", children: o.signer.map(ne) }),
396
+ ie
398
397
  ] })
399
398
  ] });
400
399
  }
401
400
  );
402
- ve.displayName = "SuperDocESign";
401
+ me.displayName = "SuperDocESign";
403
402
  export {
404
- me as CheckboxInput,
405
- ge as SignatureInput,
406
- ve as default
403
+ ue as CheckboxInput,
404
+ de as SignatureInput,
405
+ me as default,
406
+ le as textToImageDataUrl
407
407
  };
@@ -0,0 +1,2 @@
1
+ export declare const textToImageDataUrl: (text: string) => string;
2
+ //# sourceMappingURL=signature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAyBjD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/esign",
3
- "version": "1.4.0-next.3",
3
+ "version": "1.4.0-next.4",
4
4
  "description": "React eSignature component for SuperDoc",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "peerDependencies": {
57
57
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
58
58
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
59
- "superdoc": "^0.29.0"
59
+ "superdoc": "^1.1.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@commitlint/cli": "^20.1.0",
@@ -81,7 +81,7 @@
81
81
  "react": "^19.2.0",
82
82
  "react-dom": "^19.2.0",
83
83
  "semantic-release": "^24.2.9",
84
- "superdoc": "^0.36.1",
84
+ "superdoc": "1.1.0",
85
85
  "typescript": "^5.9.2",
86
86
  "typescript-eslint": "^8.44.1",
87
87
  "vite": "^7.1.7",