@documenso/embed-solid 0.2.1-rc.2 → 0.2.2
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 +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +171 -92
- package/dist/update-document.d.ts +26 -0
- package/dist/update-template.d.ts +26 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,3 +2,5 @@ export { default as EmbedDirectTemplate } from './direct-template';
|
|
|
2
2
|
export { default as EmbedSignDocument } from './sign-document';
|
|
3
3
|
export { default as unstable_EmbedCreateDocument } from './create-document';
|
|
4
4
|
export { default as unstable_EmbedCreateTemplate } from './create-template';
|
|
5
|
+
export { default as unstable_EmbedUpdateDocument } from './update-document';
|
|
6
|
+
export { default as unstable_EmbedUpdateTemplate } from './update-template';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,5 @@ export { default as EmbedDirectTemplate } from './direct-template';
|
|
|
2
2
|
export { default as EmbedSignDocument } from './sign-document';
|
|
3
3
|
export { default as unstable_EmbedCreateDocument } from './create-document';
|
|
4
4
|
export { default as unstable_EmbedCreateTemplate } from './create-template';
|
|
5
|
+
export { default as unstable_EmbedUpdateDocument } from './update-document';
|
|
6
|
+
export { default as unstable_EmbedUpdateTemplate } from './update-template';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("solid-js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("solid-js");function m(e,s,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,s,i){h(e)||(i==null?e.removeAttribute(s):e.setAttribute(s,i))}function u(e,s){h(e)||(s==null?e.removeAttribute("class"):e.className=s)}function f(e,s,i){return r.untrack(()=>e(s,i))}function h(e){return!!r.sharedConfig.context&&!r.sharedConfig.done&&(!e||e.isConnected)}var k=m("<iframe>");function g(e){const s=r.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){var n,a,c,o,b;if((d==null?void 0:d.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":(c=e.onDocumentError)==null||c.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 d;return r.onMount(()=>{window.addEventListener("message",i)}),(()=>{var t=k(),n=d;return typeof n=="function"?f(n,t):d=t,r.createRenderEffect(a=>{var c=e.className,o=s();return c!==a.e&&u(t,a.e=c),o!==a.t&&l(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var v=m("<iframe>");function I(e){const s=r.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){var n,a,c,o;if((d==null?void 0:d.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":(c=e.onDocumentError)==null||c.call(e,t.data.data);break;case"document-rejected":(o=e.onDocumentRejected)==null||o.call(e,t.data.data);break}}let d;return r.onMount(()=>{window.addEventListener("message",i)}),(()=>{var t=v(),n=d;return typeof n=="function"?f(n,t):d=t,r.createRenderEffect(a=>{var c=e.className,o=s();return c!==a.e&&u(t,a.e=c),o!==a.t&&l(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var w=m("<iframe>");function M(e){const s=r.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){var n;if((d==null?void 0:d.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 d;return r.onMount(()=>{window.addEventListener("message",i)}),(()=>{var t=w(),n=d;return typeof n=="function"?f(n,t):d=t,r.createRenderEffect(a=>{var c=e.className,o=s();return c!==a.e&&u(t,a.e=c),o!==a.t&&l(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var D=m("<iframe>");function E(e){const s=r.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){var n;if((d==null?void 0:d.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 d;return r.onMount(()=>{window.addEventListener("message",i)}),(()=>{var t=D(),n=d;return typeof n=="function"?f(n,t):d=t,r.createRenderEffect(a=>{var c=e.className,o=s();return c!==a.e&&u(t,a.e=c),o!==a.t&&l(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var U=m("<iframe>");function y(e){const s=r.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 i(t){var n;if((d==null?void 0:d.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 d;return r.onMount(()=>{window.addEventListener("message",i)}),(()=>{var t=U(),n=d;return typeof n=="function"?f(n,t):d=t,r.createRenderEffect(a=>{var c=e.className,o=s();return c!==a.e&&u(t,a.e=c),o!==a.t&&l(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}var R=m("<iframe>");function x(e){const s=r.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 i(t){var n;if((d==null?void 0:d.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 d;return r.onMount(()=>{window.addEventListener("message",i)}),(()=>{var t=R(),n=d;return typeof n=="function"?f(n,t):d=t,r.createRenderEffect(a=>{var c=e.className,o=s();return c!==a.e&&u(t,a.e=c),o!==a.t&&l(t,"src",a.t=o),a},{e:void 0,t:void 0}),t})()}exports.EmbedDirectTemplate=g;exports.EmbedSignDocument=I;exports.unstable_EmbedCreateDocument=M;exports.unstable_EmbedCreateTemplate=E;exports.unstable_EmbedUpdateDocument=y;exports.unstable_EmbedUpdateTemplate=x;
|
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { sharedConfig as g, untrack as
|
|
2
|
-
function u(e,
|
|
3
|
-
let
|
|
1
|
+
import { sharedConfig as g, untrack as I, createMemo as r, onMount as m, createRenderEffect as l } from "solid-js";
|
|
2
|
+
function u(e, i, o) {
|
|
3
|
+
let d;
|
|
4
4
|
const t = () => {
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
return
|
|
5
|
+
const a = document.createElement("template");
|
|
6
|
+
return a.innerHTML = e, a.content.firstChild;
|
|
7
|
+
}, n = () => (d || (d = t())).cloneNode(!0);
|
|
8
|
+
return n.cloneNode = n, n;
|
|
9
9
|
}
|
|
10
|
-
function f(e,
|
|
11
|
-
|
|
10
|
+
function f(e, i, o) {
|
|
11
|
+
v(e) || (o == null ? e.removeAttribute(i) : e.setAttribute(i, o));
|
|
12
12
|
}
|
|
13
|
-
function b(e,
|
|
14
|
-
|
|
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, o) {
|
|
17
|
+
return I(() => e(i, o));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function v(e) {
|
|
20
20
|
return !!g.context && !g.done && (!e || e.isConnected);
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var w = /* @__PURE__ */ u("<iframe>");
|
|
23
23
|
function N(e) {
|
|
24
|
-
const
|
|
25
|
-
const t = e.host || "https://app.documenso.com",
|
|
24
|
+
const i = r(() => {
|
|
25
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
26
26
|
name: e.name,
|
|
27
27
|
lockName: e.lockName,
|
|
28
28
|
email: e.email,
|
|
@@ -31,48 +31,48 @@ function N(e) {
|
|
|
31
31
|
cssVars: e.cssVars,
|
|
32
32
|
darkModeDisabled: e.darkModeDisabled,
|
|
33
33
|
...e.additionalProps
|
|
34
|
-
}))),
|
|
35
|
-
return e.externalId &&
|
|
34
|
+
}))), a = new URL(`/embed/direct/${e.token}`, t);
|
|
35
|
+
return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${n}`;
|
|
36
36
|
});
|
|
37
|
-
function
|
|
38
|
-
var
|
|
39
|
-
if ((
|
|
37
|
+
function o(t) {
|
|
38
|
+
var n, a, c, s, h;
|
|
39
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
40
40
|
switch (t.data.action) {
|
|
41
41
|
case "document-ready":
|
|
42
|
-
(
|
|
42
|
+
(n = e.onDocumentReady) == null || n.call(e);
|
|
43
43
|
break;
|
|
44
44
|
case "document-completed":
|
|
45
|
-
(
|
|
45
|
+
(a = e.onDocumentCompleted) == null || a.call(e, t.data.data);
|
|
46
46
|
break;
|
|
47
47
|
case "document-error":
|
|
48
|
-
(
|
|
48
|
+
(c = e.onDocumentError) == null || c.call(e, t.data.data);
|
|
49
49
|
break;
|
|
50
50
|
case "field-signed":
|
|
51
|
-
(
|
|
51
|
+
(s = e.onFieldSigned) == null || s.call(e);
|
|
52
52
|
break;
|
|
53
53
|
case "field-unsigned":
|
|
54
|
-
(
|
|
54
|
+
(h = e.onFieldUnsigned) == null || h.call(e);
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
let
|
|
59
|
-
return
|
|
60
|
-
window.addEventListener("message",
|
|
58
|
+
let d;
|
|
59
|
+
return m(() => {
|
|
60
|
+
window.addEventListener("message", o);
|
|
61
61
|
}), (() => {
|
|
62
|
-
var t =
|
|
63
|
-
return typeof
|
|
64
|
-
var
|
|
65
|
-
return
|
|
62
|
+
var t = w(), n = d;
|
|
63
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
64
|
+
var c = e.className, s = i();
|
|
65
|
+
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), 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
|
|
75
|
-
const t = e.host || "https://app.documenso.com",
|
|
72
|
+
var D = /* @__PURE__ */ u("<iframe>");
|
|
73
|
+
function $(e) {
|
|
74
|
+
const i = r(() => {
|
|
75
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
76
76
|
name: e.name,
|
|
77
77
|
lockName: e.lockName,
|
|
78
78
|
css: e.css,
|
|
@@ -81,114 +81,191 @@ function U(e) {
|
|
|
81
81
|
allowDocumentRejection: e.allowDocumentRejection,
|
|
82
82
|
...e.additionalProps
|
|
83
83
|
})));
|
|
84
|
-
return `${new URL(`/embed/sign/${e.token}`, t)}#${
|
|
84
|
+
return `${new URL(`/embed/sign/${e.token}`, t)}#${n}`;
|
|
85
85
|
});
|
|
86
|
-
function
|
|
87
|
-
var
|
|
88
|
-
if ((
|
|
86
|
+
function o(t) {
|
|
87
|
+
var n, a, c, s;
|
|
88
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
89
89
|
switch (t.data.action) {
|
|
90
90
|
case "document-ready":
|
|
91
|
-
(
|
|
91
|
+
(n = e.onDocumentReady) == null || n.call(e);
|
|
92
92
|
break;
|
|
93
93
|
case "document-completed":
|
|
94
|
-
(
|
|
94
|
+
(a = e.onDocumentCompleted) == null || a.call(e, t.data.data);
|
|
95
95
|
break;
|
|
96
96
|
case "document-error":
|
|
97
|
-
(
|
|
97
|
+
(c = e.onDocumentError) == null || c.call(e, t.data.data);
|
|
98
98
|
break;
|
|
99
99
|
case "document-rejected":
|
|
100
|
-
(
|
|
100
|
+
(s = e.onDocumentRejected) == null || s.call(e, t.data.data);
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
let
|
|
105
|
-
return
|
|
106
|
-
window.addEventListener("message",
|
|
104
|
+
let d;
|
|
105
|
+
return m(() => {
|
|
106
|
+
window.addEventListener("message", o);
|
|
107
107
|
}), (() => {
|
|
108
|
-
var t =
|
|
109
|
-
return typeof
|
|
110
|
-
var
|
|
111
|
-
return
|
|
108
|
+
var t = D(), n = d;
|
|
109
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
110
|
+
var c = e.className, s = i();
|
|
111
|
+
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
112
112
|
}, {
|
|
113
113
|
e: void 0,
|
|
114
114
|
t: void 0
|
|
115
115
|
}), t;
|
|
116
116
|
})();
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
const t = e.host || "https://app.documenso.com",
|
|
122
|
-
token: e.presignToken,
|
|
118
|
+
var U = /* @__PURE__ */ u("<iframe>");
|
|
119
|
+
function C(e) {
|
|
120
|
+
const i = r(() => {
|
|
121
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
123
122
|
externalId: e.externalId,
|
|
124
123
|
features: e.features,
|
|
125
124
|
css: e.css,
|
|
126
125
|
cssVars: e.cssVars,
|
|
127
126
|
darkModeDisabled: e.darkModeDisabled,
|
|
128
127
|
...e.additionalProps
|
|
129
|
-
})));
|
|
130
|
-
return
|
|
128
|
+
}))), a = new URL("/embed/v1/authoring/document/create", t);
|
|
129
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
131
130
|
});
|
|
132
|
-
function
|
|
133
|
-
var
|
|
134
|
-
if ((
|
|
131
|
+
function o(t) {
|
|
132
|
+
var n;
|
|
133
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
135
134
|
switch (t.data.type) {
|
|
136
135
|
case "document-created":
|
|
137
|
-
(
|
|
136
|
+
(n = e.onDocumentCreated) == null || n.call(e, {
|
|
138
137
|
documentId: t.data.documentId,
|
|
139
138
|
externalId: t.data.externalId
|
|
140
139
|
});
|
|
141
140
|
break;
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
let
|
|
145
|
-
return
|
|
146
|
-
window.addEventListener("message",
|
|
143
|
+
let d;
|
|
144
|
+
return m(() => {
|
|
145
|
+
window.addEventListener("message", o);
|
|
147
146
|
}), (() => {
|
|
148
|
-
var t =
|
|
149
|
-
return typeof
|
|
150
|
-
var
|
|
151
|
-
return
|
|
147
|
+
var t = U(), n = d;
|
|
148
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
149
|
+
var c = e.className, s = i();
|
|
150
|
+
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
152
151
|
}, {
|
|
153
152
|
e: void 0,
|
|
154
153
|
t: void 0
|
|
155
154
|
}), t;
|
|
156
155
|
})();
|
|
157
156
|
}
|
|
158
|
-
var
|
|
159
|
-
function
|
|
160
|
-
const
|
|
161
|
-
const t = e.host || "https://app.documenso.com",
|
|
162
|
-
token: e.presignToken,
|
|
157
|
+
var E = /* @__PURE__ */ u("<iframe>");
|
|
158
|
+
function R(e) {
|
|
159
|
+
const i = r(() => {
|
|
160
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
163
161
|
externalId: e.externalId,
|
|
164
162
|
features: e.features,
|
|
165
163
|
css: e.css,
|
|
166
164
|
cssVars: e.cssVars,
|
|
167
165
|
darkModeDisabled: e.darkModeDisabled,
|
|
168
166
|
...e.additionalProps
|
|
169
|
-
})));
|
|
170
|
-
return
|
|
167
|
+
}))), a = new URL("/embed/v1/authoring/template/create", t);
|
|
168
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
171
169
|
});
|
|
172
|
-
function
|
|
173
|
-
var
|
|
174
|
-
if ((
|
|
170
|
+
function o(t) {
|
|
171
|
+
var n;
|
|
172
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
175
173
|
switch (t.data.type) {
|
|
176
174
|
case "template-created":
|
|
177
|
-
(
|
|
175
|
+
(n = e.onTemplateCreated) == null || n.call(e, {
|
|
176
|
+
templateId: t.data.templateId,
|
|
177
|
+
externalId: t.data.externalId
|
|
178
|
+
});
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
let d;
|
|
183
|
+
return m(() => {
|
|
184
|
+
window.addEventListener("message", o);
|
|
185
|
+
}), (() => {
|
|
186
|
+
var t = E(), n = d;
|
|
187
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
188
|
+
var c = e.className, s = i();
|
|
189
|
+
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
190
|
+
}, {
|
|
191
|
+
e: void 0,
|
|
192
|
+
t: void 0
|
|
193
|
+
}), t;
|
|
194
|
+
})();
|
|
195
|
+
}
|
|
196
|
+
var x = /* @__PURE__ */ u("<iframe>");
|
|
197
|
+
function L(e) {
|
|
198
|
+
const i = r(() => {
|
|
199
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
200
|
+
token: e.presignToken,
|
|
201
|
+
externalId: e.externalId,
|
|
202
|
+
features: e.features,
|
|
203
|
+
css: e.css,
|
|
204
|
+
cssVars: e.cssVars,
|
|
205
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
206
|
+
...e.additionalProps
|
|
207
|
+
}))), a = new URL(`/embed/v1/authoring/document/edit/${e.documentId}`, t);
|
|
208
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
209
|
+
});
|
|
210
|
+
function o(t) {
|
|
211
|
+
var n;
|
|
212
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
213
|
+
switch (t.data.type) {
|
|
214
|
+
case "document-updated":
|
|
215
|
+
(n = e.onDocumentUpdated) == null || n.call(e, {
|
|
216
|
+
documentId: t.data.documentId,
|
|
217
|
+
externalId: t.data.externalId
|
|
218
|
+
});
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
let d;
|
|
223
|
+
return m(() => {
|
|
224
|
+
window.addEventListener("message", o);
|
|
225
|
+
}), (() => {
|
|
226
|
+
var t = x(), n = d;
|
|
227
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
228
|
+
var c = e.className, s = i();
|
|
229
|
+
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
230
|
+
}, {
|
|
231
|
+
e: void 0,
|
|
232
|
+
t: void 0
|
|
233
|
+
}), t;
|
|
234
|
+
})();
|
|
235
|
+
}
|
|
236
|
+
var y = /* @__PURE__ */ u("<iframe>");
|
|
237
|
+
function S(e) {
|
|
238
|
+
const i = r(() => {
|
|
239
|
+
const t = e.host || "https://app.documenso.com", n = btoa(encodeURIComponent(JSON.stringify({
|
|
240
|
+
externalId: e.externalId,
|
|
241
|
+
features: e.features,
|
|
242
|
+
css: e.css,
|
|
243
|
+
cssVars: e.cssVars,
|
|
244
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
245
|
+
...e.additionalProps
|
|
246
|
+
}))), a = new URL(`/embed/v1/authoring/template/edit/${e.templateId}`, t);
|
|
247
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
248
|
+
});
|
|
249
|
+
function o(t) {
|
|
250
|
+
var n;
|
|
251
|
+
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
252
|
+
switch (t.data.type) {
|
|
253
|
+
case "template-updated":
|
|
254
|
+
(n = e.onTemplateUpdated) == null || n.call(e, {
|
|
178
255
|
templateId: t.data.templateId,
|
|
179
256
|
externalId: t.data.externalId
|
|
180
257
|
});
|
|
181
258
|
break;
|
|
182
259
|
}
|
|
183
260
|
}
|
|
184
|
-
let
|
|
185
|
-
return
|
|
186
|
-
window.addEventListener("message",
|
|
261
|
+
let d;
|
|
262
|
+
return m(() => {
|
|
263
|
+
window.addEventListener("message", o);
|
|
187
264
|
}), (() => {
|
|
188
|
-
var t =
|
|
189
|
-
return typeof
|
|
190
|
-
var
|
|
191
|
-
return
|
|
265
|
+
var t = y(), n = d;
|
|
266
|
+
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
267
|
+
var c = e.className, s = i();
|
|
268
|
+
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
192
269
|
}, {
|
|
193
270
|
e: void 0,
|
|
194
271
|
t: void 0
|
|
@@ -197,7 +274,9 @@ function M(e) {
|
|
|
197
274
|
}
|
|
198
275
|
export {
|
|
199
276
|
N as EmbedDirectTemplate,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
277
|
+
$ as EmbedSignDocument,
|
|
278
|
+
C as unstable_EmbedCreateDocument,
|
|
279
|
+
R as unstable_EmbedCreateTemplate,
|
|
280
|
+
L as unstable_EmbedUpdateDocument,
|
|
281
|
+
S as unstable_EmbedUpdateTemplate
|
|
203
282
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CssVars } from './css-vars';
|
|
2
|
+
export type EmbedUpdateDocumentProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
host?: string;
|
|
5
|
+
presignToken: string;
|
|
6
|
+
documentId: number;
|
|
7
|
+
externalId?: string;
|
|
8
|
+
css?: string | undefined;
|
|
9
|
+
cssVars?: (CssVars & Record<string, string>) | undefined;
|
|
10
|
+
darkModeDisabled?: boolean | undefined;
|
|
11
|
+
features?: {
|
|
12
|
+
allowConfigureSignatureTypes?: boolean;
|
|
13
|
+
allowConfigureLanguage?: boolean;
|
|
14
|
+
allowConfigureDateFormat?: boolean;
|
|
15
|
+
allowConfigureTimezone?: boolean;
|
|
16
|
+
allowConfigureRedirectUrl?: boolean;
|
|
17
|
+
allowConfigureCommunication?: boolean;
|
|
18
|
+
};
|
|
19
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
20
|
+
onDocumentUpdated?: (data: {
|
|
21
|
+
externalId: string;
|
|
22
|
+
documentId: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
declare function EmbedUpdateDocument(props: EmbedUpdateDocumentProps): import("solid-js").JSX.Element;
|
|
26
|
+
export default EmbedUpdateDocument;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CssVars } from './css-vars';
|
|
2
|
+
export type EmbedUpdateTemplateProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
host?: string;
|
|
5
|
+
presignToken: string;
|
|
6
|
+
templateId: number;
|
|
7
|
+
externalId?: string;
|
|
8
|
+
css?: string | undefined;
|
|
9
|
+
cssVars?: (CssVars & Record<string, string>) | undefined;
|
|
10
|
+
darkModeDisabled?: boolean | undefined;
|
|
11
|
+
features?: {
|
|
12
|
+
allowConfigureSignatureTypes?: boolean;
|
|
13
|
+
allowConfigureLanguage?: boolean;
|
|
14
|
+
allowConfigureDateFormat?: boolean;
|
|
15
|
+
allowConfigureTimezone?: boolean;
|
|
16
|
+
allowConfigureRedirectUrl?: boolean;
|
|
17
|
+
allowConfigureCommunication?: boolean;
|
|
18
|
+
};
|
|
19
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
20
|
+
onTemplateUpdated?: (data: {
|
|
21
|
+
externalId: string;
|
|
22
|
+
templateId: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
declare function EmbedUpdateTemplate(props: EmbedUpdateTemplateProps): import("solid-js").JSX.Element;
|
|
26
|
+
export default EmbedUpdateTemplate;
|