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