@documenso/embed-solid 0.6.0 → 0.6.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.
@@ -7,6 +7,7 @@ export type EmbedCreateDocumentProps = {
7
7
  css?: string | undefined;
8
8
  cssVars?: (CssVars & Record<string, string>) | undefined;
9
9
  darkModeDisabled?: boolean | undefined;
10
+ language?: string | undefined;
10
11
  features?: {
11
12
  allowConfigureSignatureTypes?: boolean;
12
13
  allowConfigureLanguage?: boolean;
@@ -6,9 +6,11 @@ export type EmbedCreateEnvelopeProps = {
6
6
  presignToken: string;
7
7
  externalId?: string;
8
8
  type: "DOCUMENT" | "TEMPLATE";
9
+ folderId?: string;
9
10
  css?: string | undefined;
10
11
  cssVars?: (CssVars & Record<string, string>) | undefined;
11
12
  darkModeDisabled?: boolean | undefined;
13
+ language?: string | undefined;
12
14
  features?: DeepPartial<EnvelopeEditorSettings> & Record<string, any>;
13
15
  onEnvelopeCreated?: (data: {
14
16
  externalId: string | null;
@@ -7,6 +7,7 @@ export type EmbedCreateTemplateProps = {
7
7
  css?: string | undefined;
8
8
  cssVars?: (CssVars & Record<string, string>) | undefined;
9
9
  darkModeDisabled?: boolean | undefined;
10
+ language?: string | undefined;
10
11
  features?: {
11
12
  allowConfigureSignatureTypes?: boolean;
12
13
  allowConfigureLanguage?: boolean;
@@ -7,6 +7,7 @@ export type EmbedDirectTemplateProps = {
7
7
  css?: string | undefined;
8
8
  cssVars?: (CssVars & Record<string, string>) | undefined;
9
9
  darkModeDisabled?: boolean | undefined;
10
+ language?: string | undefined;
10
11
  email?: string | undefined;
11
12
  lockEmail?: boolean | undefined;
12
13
  name?: string | undefined;
@@ -34,6 +34,7 @@ export type EnvelopeEditorSettings = {
34
34
  allowConfigureOrder: boolean;
35
35
  allowUpload: boolean;
36
36
  allowDelete: boolean;
37
+ allowReplace: boolean;
37
38
  } | null;
38
39
  /** If null, recipients will not be configurable at all. */
39
40
  recipients: {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("solid-js/web"),r=require("solid-js");var h=n.template("<iframe>");function g(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${d}`});function m(t){if(o?.contentWindow===t.source)switch(t.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(t.data.data);break;case"document-error":e.onDocumentError?.(t.data.data);break;case"field-signed":e.onFieldSigned?.();break;case"field-unsigned":e.onFieldUnsigned?.();break}}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=h(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var E=n.template("<iframe>");function I(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps})));return`${new URL(`/embed/sign/${e.token}`,t)}#${d}`});function m(t){if(o?.contentWindow===t.source)switch(t.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(t.data.data);break;case"document-error":e.onDocumentError?.(t.data.data);break;case"document-rejected":e.onDocumentRejected?.(t.data.data);break}}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=E(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var w=n.template("<iframe>");function l(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL("/embed/v1/authoring/document/create",t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function m(t){o?.contentWindow===t.source&&t.data.type==="document-created"&&e.onDocumentCreated?.({documentId:t.data.documentId,externalId:t.data.externalId})}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=w(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var D=n.template("<iframe>");function u(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL("/embed/v1/authoring/template/create",t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function m(t){o?.contentWindow===t.source&&t.data.type==="template-created"&&e.onTemplateCreated?.({templateId:t.data.templateId,externalId:t.data.externalId})}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=D(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var M=n.template("<iframe>");function f(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({token:e.presignToken,externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,onlyEditFields:e.onlyEditFields,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/document/edit/${e.documentId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function m(t){o?.contentWindow===t.source&&t.data.type==="document-updated"&&e.onDocumentUpdated?.({documentId:t.data.documentId,externalId:t.data.externalId})}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=M(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var U=n.template("<iframe>");function b(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,onlyEditFields:e.onlyEditFields,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/template/edit/${e.templateId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function m(t){o?.contentWindow===t.source&&t.data.type==="template-updated"&&e.onTemplateUpdated?.({templateId:t.data.templateId,externalId:t.data.externalId})}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=U(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var y=n.template("<iframe>");function v(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,type:e.type,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled}))),a=new URL("/embed/v2/authoring/envelope/create",t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function m(t){o?.contentWindow===t.source&&t.data.type==="envelope-created"&&e.onEnvelopeCreated?.({envelopeId:t.data.envelopeId,externalId:t.data.externalId})}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=y(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var _=n.template("<iframe>");function k(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled}))),a=new URL(`/embed/v2/authoring/envelope/edit/${e.envelopeId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function m(t){o?.contentWindow===t.source&&t.data.type==="envelope-updated"&&e.onEnvelopeUpdated?.({envelopeId:t.data.envelopeId,externalId:t.data.externalId})}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=_(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var N=n.template("<iframe>");function $(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps}))),a=new URL("/embed/v1/multisign",t);for(const c of e.tokens)a.searchParams.append("token",c);return`${a}#${d}`});function m(t){if(o?.contentWindow===t.source)switch(t.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(t.data.data);break;case"document-error":e.onDocumentError?.(t.data.data);break;case"document-rejected":e.onDocumentRejected?.(t.data.data);break;case"all-documents-completed":e.onAllDocumentsCompleted?.(t.data.data);break}}let o;return r.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=N(),d=o;return typeof d=="function"?n.use(d,t):o=t,n.effect(a=>{var c=e.className,s=i();return c!==a.e&&n.className(t,a.e=c),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}exports.EmbedCreateDocumentV1=l;exports.EmbedCreateEnvelopeV2=v;exports.EmbedCreateTemplateV1=u;exports.EmbedDirectTemplate=g;exports.EmbedSignDocument=I;exports.EmbedUpdateDocumentV1=f;exports.EmbedUpdateEnvelopeV2=k;exports.EmbedUpdateTemplateV1=b;exports.unstable_EmbedCreateDocument=l;exports.unstable_EmbedCreateEnvelope=v;exports.unstable_EmbedCreateTemplate=u;exports.unstable_EmbedMultiSignDocument=$;exports.unstable_EmbedUpdateDocument=f;exports.unstable_EmbedUpdateEnvelope=k;exports.unstable_EmbedUpdateTemplate=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("solid-js/web"),r=require("solid-js");var k=n.template("<iframe>");function h(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language,...e.additionalProps}))),a=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${d}`});function l(t){if(c?.contentWindow===t.source)switch(t.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(t.data.data);break;case"document-error":e.onDocumentError?.(t.data.data);break;case"field-signed":e.onFieldSigned?.();break;case"field-unsigned":e.onFieldUnsigned?.();break}}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=k(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var I=n.template("<iframe>");function E(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps})));return`${new URL(`/embed/sign/${e.token}`,t)}#${d}`});function l(t){if(c?.contentWindow===t.source)switch(t.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(t.data.data);break;case"document-error":e.onDocumentError?.(t.data.data);break;case"document-rejected":e.onDocumentRejected?.(t.data.data);break}}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=I(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var w=n.template("<iframe>");function m(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language,...e.additionalProps}))),a=new URL("/embed/v1/authoring/document/create",t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function l(t){c?.contentWindow===t.source&&t.data.type==="document-created"&&e.onDocumentCreated?.({documentId:t.data.documentId,externalId:t.data.externalId})}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=w(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var D=n.template("<iframe>");function u(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language,...e.additionalProps}))),a=new URL("/embed/v1/authoring/template/create",t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function l(t){c?.contentWindow===t.source&&t.data.type==="template-created"&&e.onTemplateCreated?.({templateId:t.data.templateId,externalId:t.data.externalId})}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=D(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var M=n.template("<iframe>");function f(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({token:e.presignToken,externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language,onlyEditFields:e.onlyEditFields,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/document/edit/${e.documentId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function l(t){c?.contentWindow===t.source&&t.data.type==="document-updated"&&e.onDocumentUpdated?.({documentId:t.data.documentId,externalId:t.data.externalId})}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=M(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var U=n.template("<iframe>");function b(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language,onlyEditFields:e.onlyEditFields,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/template/edit/${e.templateId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function l(t){c?.contentWindow===t.source&&t.data.type==="template-updated"&&e.onTemplateUpdated?.({templateId:t.data.templateId,externalId:t.data.externalId})}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=U(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var y=n.template("<iframe>");function g(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,type:e.type,folderId:e.folderId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language}))),a=new URL("/embed/v2/authoring/envelope/create",t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function l(t){c?.contentWindow===t.source&&t.data.type==="envelope-created"&&e.onEnvelopeCreated?.({envelopeId:t.data.envelopeId,externalId:t.data.externalId})}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=y(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var _=n.template("<iframe>");function v(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,language:e.language}))),a=new URL(`/embed/v2/authoring/envelope/edit/${e.envelopeId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=d,a.toString()});function l(t){c?.contentWindow===t.source&&t.data.type==="envelope-updated"&&e.onEnvelopeUpdated?.({envelopeId:t.data.envelopeId,externalId:t.data.externalId})}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=_(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}var N=n.template("<iframe>");function $(e){const i=r.createMemo(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps}))),a=new URL("/embed/v1/multisign",t);for(const o of e.tokens)a.searchParams.append("token",o);return`${a}#${d}`});function l(t){if(c?.contentWindow===t.source)switch(t.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(t.data.data);break;case"document-error":e.onDocumentError?.(t.data.data);break;case"document-rejected":e.onDocumentRejected?.(t.data.data);break;case"all-documents-completed":e.onAllDocumentsCompleted?.(t.data.data);break}}let c;return r.onMount(()=>{window.addEventListener("message",l)}),(()=>{var t=N(),d=c;return typeof d=="function"?n.use(d,t):c=t,n.effect(a=>{var o=e.className,s=i();return o!==a.e&&n.className(t,a.e=o),s!==a.t&&n.setAttribute(t,"src",a.t=s),a},{e:void 0,t:void 0}),t})()}exports.EmbedCreateDocumentV1=m;exports.EmbedCreateEnvelopeV2=g;exports.EmbedCreateTemplateV1=u;exports.EmbedDirectTemplate=h;exports.EmbedSignDocument=E;exports.EmbedUpdateDocumentV1=f;exports.EmbedUpdateEnvelopeV2=v;exports.EmbedUpdateTemplateV1=b;exports.unstable_EmbedCreateDocument=m;exports.unstable_EmbedCreateEnvelope=g;exports.unstable_EmbedCreateTemplate=u;exports.unstable_EmbedMultiSignDocument=$;exports.unstable_EmbedUpdateDocument=f;exports.unstable_EmbedUpdateEnvelope=v;exports.unstable_EmbedUpdateTemplate=b;
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { effect as i, className as m, setAttribute as l, use as u, template as f } from "solid-js/web";
2
- import { createMemo as b, onMount as v } from "solid-js";
3
- var k = /* @__PURE__ */ f("<iframe>");
1
+ import { effect as i, className as l, setAttribute as m, use as u, template as f } from "solid-js/web";
2
+ import { createMemo as g, onMount as b } from "solid-js";
3
+ var v = /* @__PURE__ */ f("<iframe>");
4
4
  function x(e) {
5
- const c = b(() => {
6
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
5
+ const s = g(() => {
6
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
7
7
  name: e.name,
8
8
  lockName: e.lockName,
9
9
  email: e.email,
@@ -11,21 +11,22 @@ function x(e) {
11
11
  css: e.css,
12
12
  cssVars: e.cssVars,
13
13
  darkModeDisabled: e.darkModeDisabled,
14
+ language: e.language,
14
15
  ...e.additionalProps
15
- }))), a = new URL(`/embed/direct/${e.token}`, t);
16
- return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${n}`;
16
+ }))), t = new URL(`/embed/direct/${e.token}`, a);
17
+ return e.externalId && t.searchParams.set("externalId", e.externalId), `${t}#${n}`;
17
18
  });
18
- function r(t) {
19
- if (d?.contentWindow === t.source)
20
- switch (t.data.action) {
19
+ function r(a) {
20
+ if (d?.contentWindow === a.source)
21
+ switch (a.data.action) {
21
22
  case "document-ready":
22
23
  e.onDocumentReady?.();
23
24
  break;
24
25
  case "document-completed":
25
- e.onDocumentCompleted?.(t.data.data);
26
+ e.onDocumentCompleted?.(a.data.data);
26
27
  break;
27
28
  case "document-error":
28
- e.onDocumentError?.(t.data.data);
29
+ e.onDocumentError?.(a.data.data);
29
30
  break;
30
31
  case "field-signed":
31
32
  e.onFieldSigned?.();
@@ -36,23 +37,23 @@ function x(e) {
36
37
  }
37
38
  }
38
39
  let d;
39
- return v(() => {
40
+ return b(() => {
40
41
  window.addEventListener("message", r);
41
42
  }), (() => {
42
- var t = k(), n = d;
43
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
44
- var o = e.className, s = c();
45
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
43
+ var a = v(), n = d;
44
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
45
+ var c = e.className, o = s();
46
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
46
47
  }, {
47
48
  e: void 0,
48
49
  t: void 0
49
- }), t;
50
+ }), a;
50
51
  })();
51
52
  }
52
- var h = /* @__PURE__ */ f("<iframe>");
53
+ var k = /* @__PURE__ */ f("<iframe>");
53
54
  function $(e) {
54
- const c = b(() => {
55
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
55
+ const s = g(() => {
56
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
56
57
  name: e.name,
57
58
  lockName: e.lockName,
58
59
  email: e.email,
@@ -60,246 +61,254 @@ function $(e) {
60
61
  css: e.css,
61
62
  cssVars: e.cssVars,
62
63
  darkModeDisabled: e.darkModeDisabled,
64
+ language: e.language,
63
65
  allowDocumentRejection: e.allowDocumentRejection,
64
66
  ...e.additionalProps
65
67
  })));
66
- return `${new URL(`/embed/sign/${e.token}`, t)}#${n}`;
68
+ return `${new URL(`/embed/sign/${e.token}`, a)}#${n}`;
67
69
  });
68
- function r(t) {
69
- if (d?.contentWindow === t.source)
70
- switch (t.data.action) {
70
+ function r(a) {
71
+ if (d?.contentWindow === a.source)
72
+ switch (a.data.action) {
71
73
  case "document-ready":
72
74
  e.onDocumentReady?.();
73
75
  break;
74
76
  case "document-completed":
75
- e.onDocumentCompleted?.(t.data.data);
77
+ e.onDocumentCompleted?.(a.data.data);
76
78
  break;
77
79
  case "document-error":
78
- e.onDocumentError?.(t.data.data);
80
+ e.onDocumentError?.(a.data.data);
79
81
  break;
80
82
  case "document-rejected":
81
- e.onDocumentRejected?.(t.data.data);
83
+ e.onDocumentRejected?.(a.data.data);
82
84
  break;
83
85
  }
84
86
  }
85
87
  let d;
86
- return v(() => {
88
+ return b(() => {
87
89
  window.addEventListener("message", r);
88
90
  }), (() => {
89
- var t = h(), n = d;
90
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
91
- var o = e.className, s = c();
92
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
91
+ var a = k(), n = d;
92
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
93
+ var c = e.className, o = s();
94
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
93
95
  }, {
94
96
  e: void 0,
95
97
  t: void 0
96
- }), t;
98
+ }), a;
97
99
  })();
98
100
  }
99
- var g = /* @__PURE__ */ f("<iframe>");
101
+ var h = /* @__PURE__ */ f("<iframe>");
100
102
  function R(e) {
101
- const c = b(() => {
102
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
103
+ const s = g(() => {
104
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
103
105
  externalId: e.externalId,
104
106
  features: e.features,
105
107
  css: e.css,
106
108
  cssVars: e.cssVars,
107
109
  darkModeDisabled: e.darkModeDisabled,
110
+ language: e.language,
108
111
  ...e.additionalProps
109
- }))), a = new URL("/embed/v1/authoring/document/create", t);
110
- return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
112
+ }))), t = new URL("/embed/v1/authoring/document/create", a);
113
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
111
114
  });
112
- function r(t) {
113
- d?.contentWindow === t.source && t.data.type === "document-created" && e.onDocumentCreated?.({
114
- documentId: t.data.documentId,
115
- externalId: t.data.externalId
115
+ function r(a) {
116
+ d?.contentWindow === a.source && a.data.type === "document-created" && e.onDocumentCreated?.({
117
+ documentId: a.data.documentId,
118
+ externalId: a.data.externalId
116
119
  });
117
120
  }
118
121
  let d;
119
- return v(() => {
122
+ return b(() => {
120
123
  window.addEventListener("message", r);
121
124
  }), (() => {
122
- var t = g(), n = d;
123
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
124
- var o = e.className, s = c();
125
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
125
+ var a = h(), n = d;
126
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
127
+ var c = e.className, o = s();
128
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
126
129
  }, {
127
130
  e: void 0,
128
131
  t: void 0
129
- }), t;
132
+ }), a;
130
133
  })();
131
134
  }
132
135
  var I = /* @__PURE__ */ f("<iframe>");
133
136
  function C(e) {
134
- const c = b(() => {
135
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
137
+ const s = g(() => {
138
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
136
139
  externalId: e.externalId,
137
140
  features: e.features,
138
141
  css: e.css,
139
142
  cssVars: e.cssVars,
140
143
  darkModeDisabled: e.darkModeDisabled,
144
+ language: e.language,
141
145
  ...e.additionalProps
142
- }))), a = new URL("/embed/v1/authoring/template/create", t);
143
- return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
146
+ }))), t = new URL("/embed/v1/authoring/template/create", a);
147
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
144
148
  });
145
- function r(t) {
146
- d?.contentWindow === t.source && t.data.type === "template-created" && e.onTemplateCreated?.({
147
- templateId: t.data.templateId,
148
- externalId: t.data.externalId
149
+ function r(a) {
150
+ d?.contentWindow === a.source && a.data.type === "template-created" && e.onTemplateCreated?.({
151
+ templateId: a.data.templateId,
152
+ externalId: a.data.externalId
149
153
  });
150
154
  }
151
155
  let d;
152
- return v(() => {
156
+ return b(() => {
153
157
  window.addEventListener("message", r);
154
158
  }), (() => {
155
- var t = I(), n = d;
156
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
157
- var o = e.className, s = c();
158
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
159
+ var a = I(), n = d;
160
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
161
+ var c = e.className, o = s();
162
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
159
163
  }, {
160
164
  e: void 0,
161
165
  t: void 0
162
- }), t;
166
+ }), a;
163
167
  })();
164
168
  }
165
169
  var E = /* @__PURE__ */ f("<iframe>");
166
170
  function N(e) {
167
- const c = b(() => {
168
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
171
+ const s = g(() => {
172
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
169
173
  token: e.presignToken,
170
174
  externalId: e.externalId,
171
175
  features: e.features,
172
176
  css: e.css,
173
177
  cssVars: e.cssVars,
174
178
  darkModeDisabled: e.darkModeDisabled,
179
+ language: e.language,
175
180
  onlyEditFields: e.onlyEditFields,
176
181
  ...e.additionalProps
177
- }))), a = new URL(`/embed/v1/authoring/document/edit/${e.documentId}`, t);
178
- return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
182
+ }))), t = new URL(`/embed/v1/authoring/document/edit/${e.documentId}`, a);
183
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
179
184
  });
180
- function r(t) {
181
- d?.contentWindow === t.source && t.data.type === "document-updated" && e.onDocumentUpdated?.({
182
- documentId: t.data.documentId,
183
- externalId: t.data.externalId
185
+ function r(a) {
186
+ d?.contentWindow === a.source && a.data.type === "document-updated" && e.onDocumentUpdated?.({
187
+ documentId: a.data.documentId,
188
+ externalId: a.data.externalId
184
189
  });
185
190
  }
186
191
  let d;
187
- return v(() => {
192
+ return b(() => {
188
193
  window.addEventListener("message", r);
189
194
  }), (() => {
190
- var t = E(), n = d;
191
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
192
- var o = e.className, s = c();
193
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
195
+ var a = E(), n = d;
196
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
197
+ var c = e.className, o = s();
198
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
194
199
  }, {
195
200
  e: void 0,
196
201
  t: void 0
197
- }), t;
202
+ }), a;
198
203
  })();
199
204
  }
200
205
  var w = /* @__PURE__ */ f("<iframe>");
201
206
  function V(e) {
202
- const c = b(() => {
203
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
207
+ const s = g(() => {
208
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
204
209
  externalId: e.externalId,
205
210
  features: e.features,
206
211
  css: e.css,
207
212
  cssVars: e.cssVars,
208
213
  darkModeDisabled: e.darkModeDisabled,
214
+ language: e.language,
209
215
  onlyEditFields: e.onlyEditFields,
210
216
  ...e.additionalProps
211
- }))), a = new URL(`/embed/v1/authoring/template/edit/${e.templateId}`, t);
212
- return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
217
+ }))), t = new URL(`/embed/v1/authoring/template/edit/${e.templateId}`, a);
218
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
213
219
  });
214
- function r(t) {
215
- d?.contentWindow === t.source && t.data.type === "template-updated" && e.onTemplateUpdated?.({
216
- templateId: t.data.templateId,
217
- externalId: t.data.externalId
220
+ function r(a) {
221
+ d?.contentWindow === a.source && a.data.type === "template-updated" && e.onTemplateUpdated?.({
222
+ templateId: a.data.templateId,
223
+ externalId: a.data.externalId
218
224
  });
219
225
  }
220
226
  let d;
221
- return v(() => {
227
+ return b(() => {
222
228
  window.addEventListener("message", r);
223
229
  }), (() => {
224
- var t = w(), n = d;
225
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
226
- var o = e.className, s = c();
227
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
230
+ var a = w(), n = d;
231
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
232
+ var c = e.className, o = s();
233
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
228
234
  }, {
229
235
  e: void 0,
230
236
  t: void 0
231
- }), t;
237
+ }), a;
232
238
  })();
233
239
  }
234
240
  var D = /* @__PURE__ */ f("<iframe>");
235
241
  function S(e) {
236
- const c = b(() => {
237
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
242
+ const s = g(() => {
243
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
238
244
  externalId: e.externalId,
239
245
  type: e.type,
246
+ folderId: e.folderId,
240
247
  features: e.features,
241
248
  css: e.css,
242
249
  cssVars: e.cssVars,
243
- darkModeDisabled: e.darkModeDisabled
244
- }))), a = new URL("/embed/v2/authoring/envelope/create", t);
245
- return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
250
+ darkModeDisabled: e.darkModeDisabled,
251
+ language: e.language
252
+ }))), t = new URL("/embed/v2/authoring/envelope/create", a);
253
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
246
254
  });
247
- function r(t) {
248
- d?.contentWindow === t.source && t.data.type === "envelope-created" && e.onEnvelopeCreated?.({
249
- envelopeId: t.data.envelopeId,
250
- externalId: t.data.externalId
255
+ function r(a) {
256
+ d?.contentWindow === a.source && a.data.type === "envelope-created" && e.onEnvelopeCreated?.({
257
+ envelopeId: a.data.envelopeId,
258
+ externalId: a.data.externalId
251
259
  });
252
260
  }
253
261
  let d;
254
- return v(() => {
262
+ return b(() => {
255
263
  window.addEventListener("message", r);
256
264
  }), (() => {
257
- var t = D(), n = d;
258
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
259
- var o = e.className, s = c();
260
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
265
+ var a = D(), n = d;
266
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
267
+ var c = e.className, o = s();
268
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
261
269
  }, {
262
270
  e: void 0,
263
271
  t: void 0
264
- }), t;
272
+ }), a;
265
273
  })();
266
274
  }
267
275
  var U = /* @__PURE__ */ f("<iframe>");
268
276
  function L(e) {
269
- const c = b(() => {
270
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
277
+ const s = g(() => {
278
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
271
279
  externalId: e.externalId,
272
280
  features: e.features,
273
281
  css: e.css,
274
282
  cssVars: e.cssVars,
275
- darkModeDisabled: e.darkModeDisabled
276
- }))), a = new URL(`/embed/v2/authoring/envelope/edit/${e.envelopeId}`, t);
277
- return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
283
+ darkModeDisabled: e.darkModeDisabled,
284
+ language: e.language
285
+ }))), t = new URL(`/embed/v2/authoring/envelope/edit/${e.envelopeId}`, a);
286
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
278
287
  });
279
- function r(t) {
280
- d?.contentWindow === t.source && t.data.type === "envelope-updated" && e.onEnvelopeUpdated?.({
281
- envelopeId: t.data.envelopeId,
282
- externalId: t.data.externalId
288
+ function r(a) {
289
+ d?.contentWindow === a.source && a.data.type === "envelope-updated" && e.onEnvelopeUpdated?.({
290
+ envelopeId: a.data.envelopeId,
291
+ externalId: a.data.externalId
283
292
  });
284
293
  }
285
294
  let d;
286
- return v(() => {
295
+ return b(() => {
287
296
  window.addEventListener("message", r);
288
297
  }), (() => {
289
- var t = U(), n = d;
290
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
291
- var o = e.className, s = c();
292
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
298
+ var a = U(), n = d;
299
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
300
+ var c = e.className, o = s();
301
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
293
302
  }, {
294
303
  e: void 0,
295
304
  t: void 0
296
- }), t;
305
+ }), a;
297
306
  })();
298
307
  }
299
308
  var y = /* @__PURE__ */ f("<iframe>");
300
309
  function O(e) {
301
- const c = b(() => {
302
- const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
310
+ const s = g(() => {
311
+ const a = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
303
312
  name: e.name,
304
313
  lockName: e.lockName,
305
314
  css: e.css,
@@ -307,43 +316,43 @@ function O(e) {
307
316
  darkModeDisabled: e.darkModeDisabled,
308
317
  allowDocumentRejection: e.allowDocumentRejection,
309
318
  ...e.additionalProps
310
- }))), a = new URL("/embed/v1/multisign", t);
311
- for (const o of e.tokens)
312
- a.searchParams.append("token", o);
313
- return `${a}#${n}`;
319
+ }))), t = new URL("/embed/v1/multisign", a);
320
+ for (const c of e.tokens)
321
+ t.searchParams.append("token", c);
322
+ return `${t}#${n}`;
314
323
  });
315
- function r(t) {
316
- if (d?.contentWindow === t.source)
317
- switch (t.data.action) {
324
+ function r(a) {
325
+ if (d?.contentWindow === a.source)
326
+ switch (a.data.action) {
318
327
  case "document-ready":
319
328
  e.onDocumentReady?.();
320
329
  break;
321
330
  case "document-completed":
322
- e.onDocumentCompleted?.(t.data.data);
331
+ e.onDocumentCompleted?.(a.data.data);
323
332
  break;
324
333
  case "document-error":
325
- e.onDocumentError?.(t.data.data);
334
+ e.onDocumentError?.(a.data.data);
326
335
  break;
327
336
  case "document-rejected":
328
- e.onDocumentRejected?.(t.data.data);
337
+ e.onDocumentRejected?.(a.data.data);
329
338
  break;
330
339
  case "all-documents-completed":
331
- e.onAllDocumentsCompleted?.(t.data.data);
340
+ e.onAllDocumentsCompleted?.(a.data.data);
332
341
  break;
333
342
  }
334
343
  }
335
344
  let d;
336
- return v(() => {
345
+ return b(() => {
337
346
  window.addEventListener("message", r);
338
347
  }), (() => {
339
- var t = y(), n = d;
340
- return typeof n == "function" ? u(n, t) : d = t, i((a) => {
341
- var o = e.className, s = c();
342
- return o !== a.e && m(t, a.e = o), s !== a.t && l(t, "src", a.t = s), a;
348
+ var a = y(), n = d;
349
+ return typeof n == "function" ? u(n, a) : d = a, i((t) => {
350
+ var c = e.className, o = s();
351
+ return c !== t.e && l(a, t.e = c), o !== t.t && m(a, "src", t.t = o), t;
343
352
  }, {
344
353
  e: void 0,
345
354
  t: void 0
346
- }), t;
355
+ }), a;
347
356
  })();
348
357
  }
349
358
  export {
@@ -6,6 +6,7 @@ export type EmbedSignDocumentProps = {
6
6
  css?: string | undefined;
7
7
  cssVars?: (CssVars & Record<string, string>) | undefined;
8
8
  darkModeDisabled?: boolean | undefined;
9
+ language?: string | undefined;
9
10
  name?: string | undefined;
10
11
  lockName?: boolean | undefined;
11
12
  email?: string | undefined;
@@ -8,6 +8,7 @@ export type EmbedUpdateDocumentProps = {
8
8
  css?: string | undefined;
9
9
  cssVars?: (CssVars & Record<string, string>) | undefined;
10
10
  darkModeDisabled?: boolean | undefined;
11
+ language?: string | undefined;
11
12
  features?: {
12
13
  allowConfigureSignatureTypes?: boolean;
13
14
  allowConfigureLanguage?: boolean;
@@ -9,6 +9,7 @@ export type EmbedUpdateEnvelopeProps = {
9
9
  css?: string | undefined;
10
10
  cssVars?: (CssVars & Record<string, string>) | undefined;
11
11
  darkModeDisabled?: boolean | undefined;
12
+ language?: string | undefined;
12
13
  features?: DeepPartial<EnvelopeEditorSettings> & Record<string, any>;
13
14
  onEnvelopeUpdated?: (data: {
14
15
  externalId: string | null;
@@ -8,6 +8,7 @@ export type EmbedUpdateTemplateProps = {
8
8
  css?: string | undefined;
9
9
  cssVars?: (CssVars & Record<string, string>) | undefined;
10
10
  darkModeDisabled?: boolean | undefined;
11
+ language?: string | undefined;
11
12
  features?: {
12
13
  allowConfigureSignatureTypes?: boolean;
13
14
  allowConfigureLanguage?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-solid",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",