@documenso/embed-solid 0.2.1 → 0.2.3
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +114 -62
- package/dist/multisign-document.d.ts +37 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as unstable_EmbedCreateDocument } from './create-document';
|
|
|
4
4
|
export { default as unstable_EmbedCreateTemplate } from './create-template';
|
|
5
5
|
export { default as unstable_EmbedUpdateDocument } from './update-document';
|
|
6
6
|
export { default as unstable_EmbedUpdateTemplate } from './update-template';
|
|
7
|
+
export { default as unstable_EmbedMultiSignDocument } from './multisign-document';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as unstable_EmbedCreateDocument } from './create-document';
|
|
|
4
4
|
export { default as unstable_EmbedCreateTemplate } from './create-template';
|
|
5
5
|
export { default as unstable_EmbedUpdateDocument } from './update-document';
|
|
6
6
|
export { default as unstable_EmbedUpdateTemplate } from './update-template';
|
|
7
|
+
export { default as unstable_EmbedMultiSignDocument } from './multisign-document';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("solid-js");function m(e,r,s){let c;const t=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},n=()=>(c||(c=t())).cloneNode(!0);return n.cloneNode=n,n}function u(e,r,s){k(e)||(s==null?e.removeAttribute(r):e.setAttribute(r,s))}function l(e,r){k(e)||(r==null?e.removeAttribute("class"):e.className=r)}function f(e,r,s){return i.untrack(()=>e(r,s))}function k(e){return!!i.sharedConfig.context&&!i.sharedConfig.done&&(!e||e.isConnected)}var g=m("<iframe>");function h(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=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}#${n}`});function s(t){var n,a,d,o,b;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.action){case"document-ready":(n=e.onDocumentReady)==null||n.call(e);break;case"document-completed":(a=e.onDocumentCompleted)==null||a.call(e,t.data.data);break;case"document-error":(d=e.onDocumentError)==null||d.call(e,t.data.data);break;case"field-signed":(o=e.onFieldSigned)==null||o.call(e);break;case"field-unsigned":(b=e.onFieldUnsigned)==null||b.call(e);break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=g(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var v=m("<iframe>");function D(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps})));return`${new URL(`/embed/sign/${e.token}`,t)}#${n}`});function s(t){var n,a,d,o;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.action){case"document-ready":(n=e.onDocumentReady)==null||n.call(e);break;case"document-completed":(a=e.onDocumentCompleted)==null||a.call(e,t.data.data);break;case"document-error":(d=e.onDocumentError)==null||d.call(e,t.data.data);break;case"document-rejected":(o=e.onDocumentRejected)==null||o.call(e,t.data.data);break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=v(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var w=m("<iframe>");function M(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=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=n,a.toString()});function s(t){var n;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.type){case"document-created":(n=e.onDocumentCreated)==null||n.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=w(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var I=m("<iframe>");function E(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=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=n,a.toString()});function s(t){var n;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.type){case"template-created":(n=e.onTemplateCreated)==null||n.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=I(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var R=m("<iframe>");function U(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({token:e.presignToken,externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/document/edit/${e.documentId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=n,a.toString()});function s(t){var n;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.type){case"document-updated":(n=e.onDocumentUpdated)==null||n.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=R(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var y=m("<iframe>");function N(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=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/edit/${e.templateId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=n,a.toString()});function s(t){var n;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.type){case"template-updated":(n=e.onTemplateUpdated)==null||n.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=y(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var $=m("<iframe>");function C(e){const r=i.createMemo(()=>{const t=e.host||"https://app.documenso.com",n=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 d of e.tokens)a.searchParams.append("token",d);return`${a}#${n}`});function s(t){var n,a,d,o,b;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.action){case"document-ready":(n=e.onDocumentReady)==null||n.call(e);break;case"document-completed":(a=e.onDocumentCompleted)==null||a.call(e,t.data.data);break;case"document-error":(d=e.onDocumentError)==null||d.call(e,t.data.data);break;case"document-rejected":(o=e.onDocumentRejected)==null||o.call(e,t.data.data);break;case"all-documents-completed":(b=e.onAllDocumentsCompleted)==null||b.call(e,t.data.data);break}}let c;return i.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=$(),n=c;return typeof n=="function"?f(n,t):c=t,i.createRenderEffect(a=>{var d=e.className,o=r();return d!==a.e&&l(t,a.e=d),o!==a.t&&u(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}exports.EmbedDirectTemplate=h;exports.EmbedSignDocument=D;exports.unstable_EmbedCreateDocument=M;exports.unstable_EmbedCreateTemplate=E;exports.unstable_EmbedMultiSignDocument=C;exports.unstable_EmbedUpdateDocument=U;exports.unstable_EmbedUpdateTemplate=N;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sharedConfig as g, untrack as
|
|
2
|
-
function u(e,
|
|
1
|
+
import { sharedConfig as g, untrack as D, createMemo as m, onMount as r, createRenderEffect as l } from "solid-js";
|
|
2
|
+
function u(e, i, s) {
|
|
3
3
|
let d;
|
|
4
4
|
const t = () => {
|
|
5
5
|
const a = document.createElement("template");
|
|
@@ -7,21 +7,21 @@ function u(e, o, i) {
|
|
|
7
7
|
}, n = () => (d || (d = t())).cloneNode(!0);
|
|
8
8
|
return n.cloneNode = n, n;
|
|
9
9
|
}
|
|
10
|
-
function f(e,
|
|
11
|
-
v(e) || (
|
|
10
|
+
function f(e, i, s) {
|
|
11
|
+
v(e) || (s == null ? e.removeAttribute(i) : e.setAttribute(i, s));
|
|
12
12
|
}
|
|
13
|
-
function b(e,
|
|
14
|
-
v(e) || (
|
|
13
|
+
function b(e, i) {
|
|
14
|
+
v(e) || (i == null ? e.removeAttribute("class") : e.className = i);
|
|
15
15
|
}
|
|
16
|
-
function k(e,
|
|
17
|
-
return
|
|
16
|
+
function k(e, i, s) {
|
|
17
|
+
return D(() => e(i, s));
|
|
18
18
|
}
|
|
19
19
|
function v(e) {
|
|
20
20
|
return !!g.context && !g.done && (!e || e.isConnected);
|
|
21
21
|
}
|
|
22
22
|
var w = /* @__PURE__ */ u("<iframe>");
|
|
23
|
-
function
|
|
24
|
-
const
|
|
23
|
+
function $(e) {
|
|
24
|
+
const i = m(() => {
|
|
25
25
|
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
26
26
|
name: e.name,
|
|
27
27
|
lockName: e.lockName,
|
|
@@ -34,8 +34,8 @@ function N(e) {
|
|
|
34
34
|
}))), a = new URL(`/embed/direct/${e.token}`, t);
|
|
35
35
|
return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${n}`;
|
|
36
36
|
});
|
|
37
|
-
function
|
|
38
|
-
var n, a, c,
|
|
37
|
+
function s(t) {
|
|
38
|
+
var n, a, c, o, h;
|
|
39
39
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
40
40
|
switch (t.data.action) {
|
|
41
41
|
case "document-ready":
|
|
@@ -48,7 +48,7 @@ function N(e) {
|
|
|
48
48
|
(c = e.onDocumentError) == null || c.call(e, t.data.data);
|
|
49
49
|
break;
|
|
50
50
|
case "field-signed":
|
|
51
|
-
(
|
|
51
|
+
(o = e.onFieldSigned) == null || o.call(e);
|
|
52
52
|
break;
|
|
53
53
|
case "field-unsigned":
|
|
54
54
|
(h = e.onFieldUnsigned) == null || h.call(e);
|
|
@@ -56,22 +56,22 @@ function N(e) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
let d;
|
|
59
|
-
return
|
|
60
|
-
window.addEventListener("message",
|
|
59
|
+
return r(() => {
|
|
60
|
+
window.addEventListener("message", s);
|
|
61
61
|
}), (() => {
|
|
62
62
|
var t = w(), n = d;
|
|
63
63
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
64
|
-
var c = e.className,
|
|
65
|
-
return c !== a.e && b(t, a.e = c),
|
|
64
|
+
var c = e.className, o = i();
|
|
65
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
66
66
|
}, {
|
|
67
67
|
e: void 0,
|
|
68
68
|
t: void 0
|
|
69
69
|
}), t;
|
|
70
70
|
})();
|
|
71
71
|
}
|
|
72
|
-
var
|
|
73
|
-
function
|
|
74
|
-
const
|
|
72
|
+
var I = /* @__PURE__ */ u("<iframe>");
|
|
73
|
+
function x(e) {
|
|
74
|
+
const i = m(() => {
|
|
75
75
|
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
76
76
|
name: e.name,
|
|
77
77
|
lockName: e.lockName,
|
|
@@ -83,8 +83,8 @@ function $(e) {
|
|
|
83
83
|
})));
|
|
84
84
|
return `${new URL(`/embed/sign/${e.token}`, t)}#${n}`;
|
|
85
85
|
});
|
|
86
|
-
function
|
|
87
|
-
var n, a, c,
|
|
86
|
+
function s(t) {
|
|
87
|
+
var n, a, c, o;
|
|
88
88
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
89
89
|
switch (t.data.action) {
|
|
90
90
|
case "document-ready":
|
|
@@ -97,18 +97,18 @@ function $(e) {
|
|
|
97
97
|
(c = e.onDocumentError) == null || c.call(e, t.data.data);
|
|
98
98
|
break;
|
|
99
99
|
case "document-rejected":
|
|
100
|
-
(
|
|
100
|
+
(o = e.onDocumentRejected) == null || o.call(e, t.data.data);
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
let d;
|
|
105
|
-
return
|
|
106
|
-
window.addEventListener("message",
|
|
105
|
+
return r(() => {
|
|
106
|
+
window.addEventListener("message", s);
|
|
107
107
|
}), (() => {
|
|
108
|
-
var t =
|
|
108
|
+
var t = I(), n = d;
|
|
109
109
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
110
|
-
var c = e.className,
|
|
111
|
-
return c !== a.e && b(t, a.e = c),
|
|
110
|
+
var c = e.className, o = i();
|
|
111
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
112
112
|
}, {
|
|
113
113
|
e: void 0,
|
|
114
114
|
t: void 0
|
|
@@ -117,7 +117,7 @@ function $(e) {
|
|
|
117
117
|
}
|
|
118
118
|
var U = /* @__PURE__ */ u("<iframe>");
|
|
119
119
|
function C(e) {
|
|
120
|
-
const
|
|
120
|
+
const i = m(() => {
|
|
121
121
|
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
122
122
|
externalId: e.externalId,
|
|
123
123
|
features: e.features,
|
|
@@ -128,7 +128,7 @@ function C(e) {
|
|
|
128
128
|
}))), a = new URL("/embed/v1/authoring/document/create", t);
|
|
129
129
|
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
130
130
|
});
|
|
131
|
-
function
|
|
131
|
+
function s(t) {
|
|
132
132
|
var n;
|
|
133
133
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
134
134
|
switch (t.data.type) {
|
|
@@ -141,13 +141,13 @@ function C(e) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
let d;
|
|
144
|
-
return
|
|
145
|
-
window.addEventListener("message",
|
|
144
|
+
return r(() => {
|
|
145
|
+
window.addEventListener("message", s);
|
|
146
146
|
}), (() => {
|
|
147
147
|
var t = U(), n = d;
|
|
148
148
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
149
|
-
var c = e.className,
|
|
150
|
-
return c !== a.e && b(t, a.e = c),
|
|
149
|
+
var c = e.className, o = i();
|
|
150
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
151
151
|
}, {
|
|
152
152
|
e: void 0,
|
|
153
153
|
t: void 0
|
|
@@ -155,8 +155,8 @@ function C(e) {
|
|
|
155
155
|
})();
|
|
156
156
|
}
|
|
157
157
|
var E = /* @__PURE__ */ u("<iframe>");
|
|
158
|
-
function
|
|
159
|
-
const
|
|
158
|
+
function S(e) {
|
|
159
|
+
const i = m(() => {
|
|
160
160
|
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
161
161
|
externalId: e.externalId,
|
|
162
162
|
features: e.features,
|
|
@@ -167,7 +167,7 @@ function R(e) {
|
|
|
167
167
|
}))), a = new URL("/embed/v1/authoring/template/create", t);
|
|
168
168
|
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
169
169
|
});
|
|
170
|
-
function
|
|
170
|
+
function s(t) {
|
|
171
171
|
var n;
|
|
172
172
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
173
173
|
switch (t.data.type) {
|
|
@@ -180,22 +180,22 @@ function R(e) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
let d;
|
|
183
|
-
return
|
|
184
|
-
window.addEventListener("message",
|
|
183
|
+
return r(() => {
|
|
184
|
+
window.addEventListener("message", s);
|
|
185
185
|
}), (() => {
|
|
186
186
|
var t = E(), n = d;
|
|
187
187
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
188
|
-
var c = e.className,
|
|
189
|
-
return c !== a.e && b(t, a.e = c),
|
|
188
|
+
var c = e.className, o = i();
|
|
189
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
190
190
|
}, {
|
|
191
191
|
e: void 0,
|
|
192
192
|
t: void 0
|
|
193
193
|
}), t;
|
|
194
194
|
})();
|
|
195
195
|
}
|
|
196
|
-
var
|
|
196
|
+
var M = /* @__PURE__ */ u("<iframe>");
|
|
197
197
|
function L(e) {
|
|
198
|
-
const
|
|
198
|
+
const i = m(() => {
|
|
199
199
|
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
200
200
|
token: e.presignToken,
|
|
201
201
|
externalId: e.externalId,
|
|
@@ -204,10 +204,10 @@ function L(e) {
|
|
|
204
204
|
cssVars: e.cssVars,
|
|
205
205
|
darkModeDisabled: e.darkModeDisabled,
|
|
206
206
|
...e.additionalProps
|
|
207
|
-
}))), a = new URL(`/embed/v1/authoring/document/
|
|
207
|
+
}))), a = new URL(`/embed/v1/authoring/document/edit/${e.documentId}`, t);
|
|
208
208
|
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
209
209
|
});
|
|
210
|
-
function
|
|
210
|
+
function s(t) {
|
|
211
211
|
var n;
|
|
212
212
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
213
213
|
switch (t.data.type) {
|
|
@@ -220,13 +220,13 @@ function L(e) {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
let d;
|
|
223
|
-
return
|
|
224
|
-
window.addEventListener("message",
|
|
223
|
+
return r(() => {
|
|
224
|
+
window.addEventListener("message", s);
|
|
225
225
|
}), (() => {
|
|
226
|
-
var t =
|
|
226
|
+
var t = M(), n = d;
|
|
227
227
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
228
|
-
var c = e.className,
|
|
229
|
-
return c !== a.e && b(t, a.e = c),
|
|
228
|
+
var c = e.className, o = i();
|
|
229
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
230
230
|
}, {
|
|
231
231
|
e: void 0,
|
|
232
232
|
t: void 0
|
|
@@ -234,8 +234,8 @@ function L(e) {
|
|
|
234
234
|
})();
|
|
235
235
|
}
|
|
236
236
|
var y = /* @__PURE__ */ u("<iframe>");
|
|
237
|
-
function
|
|
238
|
-
const
|
|
237
|
+
function V(e) {
|
|
238
|
+
const i = m(() => {
|
|
239
239
|
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
240
240
|
externalId: e.externalId,
|
|
241
241
|
features: e.features,
|
|
@@ -243,10 +243,10 @@ function S(e) {
|
|
|
243
243
|
cssVars: e.cssVars,
|
|
244
244
|
darkModeDisabled: e.darkModeDisabled,
|
|
245
245
|
...e.additionalProps
|
|
246
|
-
}))), a = new URL(`/embed/v1/authoring/template/
|
|
246
|
+
}))), a = new URL(`/embed/v1/authoring/template/edit/${e.templateId}`, t);
|
|
247
247
|
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
248
248
|
});
|
|
249
|
-
function
|
|
249
|
+
function s(t) {
|
|
250
250
|
var n;
|
|
251
251
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
252
252
|
switch (t.data.type) {
|
|
@@ -259,13 +259,64 @@ function S(e) {
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
let d;
|
|
262
|
-
return
|
|
263
|
-
window.addEventListener("message",
|
|
262
|
+
return r(() => {
|
|
263
|
+
window.addEventListener("message", s);
|
|
264
264
|
}), (() => {
|
|
265
265
|
var t = y(), n = d;
|
|
266
266
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
267
|
-
var c = e.className,
|
|
268
|
-
return c !== a.e && b(t, a.e = c),
|
|
267
|
+
var c = e.className, o = i();
|
|
268
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
269
|
+
}, {
|
|
270
|
+
e: void 0,
|
|
271
|
+
t: void 0
|
|
272
|
+
}), t;
|
|
273
|
+
})();
|
|
274
|
+
}
|
|
275
|
+
var N = /* @__PURE__ */ u("<iframe>");
|
|
276
|
+
function O(e) {
|
|
277
|
+
const i = m(() => {
|
|
278
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
279
|
+
name: e.name,
|
|
280
|
+
lockName: e.lockName,
|
|
281
|
+
css: e.css,
|
|
282
|
+
cssVars: e.cssVars,
|
|
283
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
284
|
+
allowDocumentRejection: e.allowDocumentRejection,
|
|
285
|
+
...e.additionalProps
|
|
286
|
+
}))), a = new URL("/embed/v1/multisign", t);
|
|
287
|
+
for (const c of e.tokens)
|
|
288
|
+
a.searchParams.append("token", c);
|
|
289
|
+
return `${a}#${n}`;
|
|
290
|
+
});
|
|
291
|
+
function s(t) {
|
|
292
|
+
var n, a, c, o, h;
|
|
293
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
294
|
+
switch (t.data.action) {
|
|
295
|
+
case "document-ready":
|
|
296
|
+
(n = e.onDocumentReady) == null || n.call(e);
|
|
297
|
+
break;
|
|
298
|
+
case "document-completed":
|
|
299
|
+
(a = e.onDocumentCompleted) == null || a.call(e, t.data.data);
|
|
300
|
+
break;
|
|
301
|
+
case "document-error":
|
|
302
|
+
(c = e.onDocumentError) == null || c.call(e, t.data.data);
|
|
303
|
+
break;
|
|
304
|
+
case "document-rejected":
|
|
305
|
+
(o = e.onDocumentRejected) == null || o.call(e, t.data.data);
|
|
306
|
+
break;
|
|
307
|
+
case "all-documents-completed":
|
|
308
|
+
(h = e.onAllDocumentsCompleted) == null || h.call(e, t.data.data);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
let d;
|
|
313
|
+
return r(() => {
|
|
314
|
+
window.addEventListener("message", s);
|
|
315
|
+
}), (() => {
|
|
316
|
+
var t = N(), n = d;
|
|
317
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
318
|
+
var c = e.className, o = i();
|
|
319
|
+
return c !== a.e && b(t, a.e = c), o !== a.t && f(t, "src", a.t = o), a;
|
|
269
320
|
}, {
|
|
270
321
|
e: void 0,
|
|
271
322
|
t: void 0
|
|
@@ -273,10 +324,11 @@ function S(e) {
|
|
|
273
324
|
})();
|
|
274
325
|
}
|
|
275
326
|
export {
|
|
276
|
-
|
|
277
|
-
|
|
327
|
+
$ as EmbedDirectTemplate,
|
|
328
|
+
x as EmbedSignDocument,
|
|
278
329
|
C as unstable_EmbedCreateDocument,
|
|
279
|
-
|
|
330
|
+
S as unstable_EmbedCreateTemplate,
|
|
331
|
+
O as unstable_EmbedMultiSignDocument,
|
|
280
332
|
L as unstable_EmbedUpdateDocument,
|
|
281
|
-
|
|
333
|
+
V as unstable_EmbedUpdateTemplate
|
|
282
334
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CssVars } from './css-vars';
|
|
2
|
+
export type EmbedMultiSignDocumentProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
host?: string;
|
|
5
|
+
tokens: string[];
|
|
6
|
+
css?: string | undefined;
|
|
7
|
+
cssVars?: (CssVars & Record<string, string>) | undefined;
|
|
8
|
+
darkModeDisabled?: boolean | undefined;
|
|
9
|
+
name?: string | undefined;
|
|
10
|
+
lockName?: boolean | undefined;
|
|
11
|
+
allowDocumentRejection?: boolean | undefined;
|
|
12
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
13
|
+
onDocumentReady?: () => void;
|
|
14
|
+
onDocumentCompleted?: (data: {
|
|
15
|
+
token: string;
|
|
16
|
+
documentId: number;
|
|
17
|
+
recipientId: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
onDocumentError?: (error: string) => void;
|
|
20
|
+
onDocumentRejected?: (data: {
|
|
21
|
+
token: string;
|
|
22
|
+
documentId: number;
|
|
23
|
+
recipientId: number;
|
|
24
|
+
reason: string;
|
|
25
|
+
}) => void;
|
|
26
|
+
onAllDocumentsCompleted?: (data: {
|
|
27
|
+
documents: Array<{
|
|
28
|
+
token: string;
|
|
29
|
+
documentId: number;
|
|
30
|
+
recipientId: number;
|
|
31
|
+
action: "document-completed" | "document-rejected";
|
|
32
|
+
reason?: string;
|
|
33
|
+
}>;
|
|
34
|
+
}) => void;
|
|
35
|
+
};
|
|
36
|
+
declare function EmbedMultiSignDocument(props: EmbedMultiSignDocumentProps): import("solid-js").JSX.Element;
|
|
37
|
+
export default EmbedMultiSignDocument;
|