@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.
- package/dist/create-document.d.ts +1 -0
- package/dist/create-envelope.d.ts +2 -0
- package/dist/create-template.d.ts +1 -0
- package/dist/direct-template.d.ts +1 -0
- package/dist/features-type.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +149 -140
- package/dist/sign-document.d.ts +1 -0
- package/dist/update-document.d.ts +1 -0
- package/dist/update-envelope.d.ts +1 -0
- package/dist/update-template.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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;
|
package/dist/features-type.d.ts
CHANGED
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
|
|
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
|
|
2
|
-
import { createMemo as
|
|
3
|
-
var
|
|
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
|
|
6
|
-
const
|
|
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
|
-
}))),
|
|
16
|
-
return e.externalId &&
|
|
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(
|
|
19
|
-
if (d?.contentWindow ===
|
|
20
|
-
switch (
|
|
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?.(
|
|
26
|
+
e.onDocumentCompleted?.(a.data.data);
|
|
26
27
|
break;
|
|
27
28
|
case "document-error":
|
|
28
|
-
e.onDocumentError?.(
|
|
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
|
|
40
|
+
return b(() => {
|
|
40
41
|
window.addEventListener("message", r);
|
|
41
42
|
}), (() => {
|
|
42
|
-
var
|
|
43
|
-
return typeof n == "function" ? u(n,
|
|
44
|
-
var
|
|
45
|
-
return
|
|
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
|
-
}),
|
|
50
|
+
}), a;
|
|
50
51
|
})();
|
|
51
52
|
}
|
|
52
|
-
var
|
|
53
|
+
var k = /* @__PURE__ */ f("<iframe>");
|
|
53
54
|
function $(e) {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
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}`,
|
|
68
|
+
return `${new URL(`/embed/sign/${e.token}`, a)}#${n}`;
|
|
67
69
|
});
|
|
68
|
-
function r(
|
|
69
|
-
if (d?.contentWindow ===
|
|
70
|
-
switch (
|
|
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?.(
|
|
77
|
+
e.onDocumentCompleted?.(a.data.data);
|
|
76
78
|
break;
|
|
77
79
|
case "document-error":
|
|
78
|
-
e.onDocumentError?.(
|
|
80
|
+
e.onDocumentError?.(a.data.data);
|
|
79
81
|
break;
|
|
80
82
|
case "document-rejected":
|
|
81
|
-
e.onDocumentRejected?.(
|
|
83
|
+
e.onDocumentRejected?.(a.data.data);
|
|
82
84
|
break;
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
let d;
|
|
86
|
-
return
|
|
88
|
+
return b(() => {
|
|
87
89
|
window.addEventListener("message", r);
|
|
88
90
|
}), (() => {
|
|
89
|
-
var
|
|
90
|
-
return typeof n == "function" ? u(n,
|
|
91
|
-
var
|
|
92
|
-
return
|
|
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
|
-
}),
|
|
98
|
+
}), a;
|
|
97
99
|
})();
|
|
98
100
|
}
|
|
99
|
-
var
|
|
101
|
+
var h = /* @__PURE__ */ f("<iframe>");
|
|
100
102
|
function R(e) {
|
|
101
|
-
const
|
|
102
|
-
const
|
|
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
|
-
}))),
|
|
110
|
-
return
|
|
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(
|
|
113
|
-
d?.contentWindow ===
|
|
114
|
-
documentId:
|
|
115
|
-
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
|
|
122
|
+
return b(() => {
|
|
120
123
|
window.addEventListener("message", r);
|
|
121
124
|
}), (() => {
|
|
122
|
-
var
|
|
123
|
-
return typeof n == "function" ? u(n,
|
|
124
|
-
var
|
|
125
|
-
return
|
|
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
|
-
}),
|
|
132
|
+
}), a;
|
|
130
133
|
})();
|
|
131
134
|
}
|
|
132
135
|
var I = /* @__PURE__ */ f("<iframe>");
|
|
133
136
|
function C(e) {
|
|
134
|
-
const
|
|
135
|
-
const
|
|
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
|
-
}))),
|
|
143
|
-
return
|
|
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(
|
|
146
|
-
d?.contentWindow ===
|
|
147
|
-
templateId:
|
|
148
|
-
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
|
|
156
|
+
return b(() => {
|
|
153
157
|
window.addEventListener("message", r);
|
|
154
158
|
}), (() => {
|
|
155
|
-
var
|
|
156
|
-
return typeof n == "function" ? u(n,
|
|
157
|
-
var
|
|
158
|
-
return
|
|
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
|
-
}),
|
|
166
|
+
}), a;
|
|
163
167
|
})();
|
|
164
168
|
}
|
|
165
169
|
var E = /* @__PURE__ */ f("<iframe>");
|
|
166
170
|
function N(e) {
|
|
167
|
-
const
|
|
168
|
-
const
|
|
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
|
-
}))),
|
|
178
|
-
return
|
|
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(
|
|
181
|
-
d?.contentWindow ===
|
|
182
|
-
documentId:
|
|
183
|
-
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
|
|
192
|
+
return b(() => {
|
|
188
193
|
window.addEventListener("message", r);
|
|
189
194
|
}), (() => {
|
|
190
|
-
var
|
|
191
|
-
return typeof n == "function" ? u(n,
|
|
192
|
-
var
|
|
193
|
-
return
|
|
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
|
-
}),
|
|
202
|
+
}), a;
|
|
198
203
|
})();
|
|
199
204
|
}
|
|
200
205
|
var w = /* @__PURE__ */ f("<iframe>");
|
|
201
206
|
function V(e) {
|
|
202
|
-
const
|
|
203
|
-
const
|
|
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
|
-
}))),
|
|
212
|
-
return
|
|
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(
|
|
215
|
-
d?.contentWindow ===
|
|
216
|
-
templateId:
|
|
217
|
-
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
|
|
227
|
+
return b(() => {
|
|
222
228
|
window.addEventListener("message", r);
|
|
223
229
|
}), (() => {
|
|
224
|
-
var
|
|
225
|
-
return typeof n == "function" ? u(n,
|
|
226
|
-
var
|
|
227
|
-
return
|
|
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
|
-
}),
|
|
237
|
+
}), a;
|
|
232
238
|
})();
|
|
233
239
|
}
|
|
234
240
|
var D = /* @__PURE__ */ f("<iframe>");
|
|
235
241
|
function S(e) {
|
|
236
|
-
const
|
|
237
|
-
const
|
|
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
|
-
|
|
245
|
-
|
|
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(
|
|
248
|
-
d?.contentWindow ===
|
|
249
|
-
envelopeId:
|
|
250
|
-
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
|
|
262
|
+
return b(() => {
|
|
255
263
|
window.addEventListener("message", r);
|
|
256
264
|
}), (() => {
|
|
257
|
-
var
|
|
258
|
-
return typeof n == "function" ? u(n,
|
|
259
|
-
var
|
|
260
|
-
return
|
|
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
|
-
}),
|
|
272
|
+
}), a;
|
|
265
273
|
})();
|
|
266
274
|
}
|
|
267
275
|
var U = /* @__PURE__ */ f("<iframe>");
|
|
268
276
|
function L(e) {
|
|
269
|
-
const
|
|
270
|
-
const
|
|
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
|
-
|
|
277
|
-
|
|
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(
|
|
280
|
-
d?.contentWindow ===
|
|
281
|
-
envelopeId:
|
|
282
|
-
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
|
|
295
|
+
return b(() => {
|
|
287
296
|
window.addEventListener("message", r);
|
|
288
297
|
}), (() => {
|
|
289
|
-
var
|
|
290
|
-
return typeof n == "function" ? u(n,
|
|
291
|
-
var
|
|
292
|
-
return
|
|
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
|
-
}),
|
|
305
|
+
}), a;
|
|
297
306
|
})();
|
|
298
307
|
}
|
|
299
308
|
var y = /* @__PURE__ */ f("<iframe>");
|
|
300
309
|
function O(e) {
|
|
301
|
-
const
|
|
302
|
-
const
|
|
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
|
-
}))),
|
|
311
|
-
for (const
|
|
312
|
-
|
|
313
|
-
return `${
|
|
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(
|
|
316
|
-
if (d?.contentWindow ===
|
|
317
|
-
switch (
|
|
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?.(
|
|
331
|
+
e.onDocumentCompleted?.(a.data.data);
|
|
323
332
|
break;
|
|
324
333
|
case "document-error":
|
|
325
|
-
e.onDocumentError?.(
|
|
334
|
+
e.onDocumentError?.(a.data.data);
|
|
326
335
|
break;
|
|
327
336
|
case "document-rejected":
|
|
328
|
-
e.onDocumentRejected?.(
|
|
337
|
+
e.onDocumentRejected?.(a.data.data);
|
|
329
338
|
break;
|
|
330
339
|
case "all-documents-completed":
|
|
331
|
-
e.onAllDocumentsCompleted?.(
|
|
340
|
+
e.onAllDocumentsCompleted?.(a.data.data);
|
|
332
341
|
break;
|
|
333
342
|
}
|
|
334
343
|
}
|
|
335
344
|
let d;
|
|
336
|
-
return
|
|
345
|
+
return b(() => {
|
|
337
346
|
window.addEventListener("message", r);
|
|
338
347
|
}), (() => {
|
|
339
|
-
var
|
|
340
|
-
return typeof n == "function" ? u(n,
|
|
341
|
-
var
|
|
342
|
-
return
|
|
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
|
-
}),
|
|
355
|
+
}), a;
|
|
347
356
|
})();
|
|
348
357
|
}
|
|
349
358
|
export {
|
package/dist/sign-document.d.ts
CHANGED
|
@@ -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;
|