@documenso/embed-solid 0.2.1 → 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.js +1 -1
- package/dist/index.mjs +33 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { sharedConfig as g, untrack as I, createMemo as r, onMount as m, createRenderEffect as l } from "solid-js";
|
|
2
|
-
function u(e,
|
|
2
|
+
function u(e, i, o) {
|
|
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, o) {
|
|
11
|
+
v(e) || (o == null ? e.removeAttribute(i) : e.setAttribute(i, o));
|
|
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 I(() => e(
|
|
16
|
+
function k(e, i, o) {
|
|
17
|
+
return I(() => e(i, o));
|
|
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
23
|
function N(e) {
|
|
24
|
-
const
|
|
24
|
+
const i = r(() => {
|
|
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,7 +34,7 @@ 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
|
|
37
|
+
function o(t) {
|
|
38
38
|
var n, a, c, s, h;
|
|
39
39
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
40
40
|
switch (t.data.action) {
|
|
@@ -57,11 +57,11 @@ function N(e) {
|
|
|
57
57
|
}
|
|
58
58
|
let d;
|
|
59
59
|
return m(() => {
|
|
60
|
-
window.addEventListener("message",
|
|
60
|
+
window.addEventListener("message", o);
|
|
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, s =
|
|
64
|
+
var c = e.className, s = i();
|
|
65
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,
|
|
@@ -71,7 +71,7 @@ function N(e) {
|
|
|
71
71
|
}
|
|
72
72
|
var D = /* @__PURE__ */ u("<iframe>");
|
|
73
73
|
function $(e) {
|
|
74
|
-
const
|
|
74
|
+
const i = r(() => {
|
|
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,7 +83,7 @@ function $(e) {
|
|
|
83
83
|
})));
|
|
84
84
|
return `${new URL(`/embed/sign/${e.token}`, t)}#${n}`;
|
|
85
85
|
});
|
|
86
|
-
function
|
|
86
|
+
function o(t) {
|
|
87
87
|
var n, a, c, s;
|
|
88
88
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
89
89
|
switch (t.data.action) {
|
|
@@ -103,11 +103,11 @@ function $(e) {
|
|
|
103
103
|
}
|
|
104
104
|
let d;
|
|
105
105
|
return m(() => {
|
|
106
|
-
window.addEventListener("message",
|
|
106
|
+
window.addEventListener("message", o);
|
|
107
107
|
}), (() => {
|
|
108
108
|
var t = D(), n = d;
|
|
109
109
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
110
|
-
var c = e.className, s =
|
|
110
|
+
var c = e.className, s = i();
|
|
111
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,
|
|
@@ -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 = r(() => {
|
|
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 o(t) {
|
|
132
132
|
var n;
|
|
133
133
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
134
134
|
switch (t.data.type) {
|
|
@@ -142,11 +142,11 @@ function C(e) {
|
|
|
142
142
|
}
|
|
143
143
|
let d;
|
|
144
144
|
return m(() => {
|
|
145
|
-
window.addEventListener("message",
|
|
145
|
+
window.addEventListener("message", o);
|
|
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, s =
|
|
149
|
+
var c = e.className, s = i();
|
|
150
150
|
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
151
151
|
}, {
|
|
152
152
|
e: void 0,
|
|
@@ -156,7 +156,7 @@ function C(e) {
|
|
|
156
156
|
}
|
|
157
157
|
var E = /* @__PURE__ */ u("<iframe>");
|
|
158
158
|
function R(e) {
|
|
159
|
-
const
|
|
159
|
+
const i = r(() => {
|
|
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 o(t) {
|
|
171
171
|
var n;
|
|
172
172
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
173
173
|
switch (t.data.type) {
|
|
@@ -181,11 +181,11 @@ function R(e) {
|
|
|
181
181
|
}
|
|
182
182
|
let d;
|
|
183
183
|
return m(() => {
|
|
184
|
-
window.addEventListener("message",
|
|
184
|
+
window.addEventListener("message", o);
|
|
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, s =
|
|
188
|
+
var c = e.className, s = i();
|
|
189
189
|
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
190
190
|
}, {
|
|
191
191
|
e: void 0,
|
|
@@ -195,7 +195,7 @@ function R(e) {
|
|
|
195
195
|
}
|
|
196
196
|
var x = /* @__PURE__ */ u("<iframe>");
|
|
197
197
|
function L(e) {
|
|
198
|
-
const
|
|
198
|
+
const i = r(() => {
|
|
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 o(t) {
|
|
211
211
|
var n;
|
|
212
212
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
213
213
|
switch (t.data.type) {
|
|
@@ -221,11 +221,11 @@ function L(e) {
|
|
|
221
221
|
}
|
|
222
222
|
let d;
|
|
223
223
|
return m(() => {
|
|
224
|
-
window.addEventListener("message",
|
|
224
|
+
window.addEventListener("message", o);
|
|
225
225
|
}), (() => {
|
|
226
226
|
var t = x(), n = d;
|
|
227
227
|
return typeof n == "function" ? k(n, t) : d = t, l((a) => {
|
|
228
|
-
var c = e.className, s =
|
|
228
|
+
var c = e.className, s = i();
|
|
229
229
|
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
230
230
|
}, {
|
|
231
231
|
e: void 0,
|
|
@@ -235,7 +235,7 @@ function L(e) {
|
|
|
235
235
|
}
|
|
236
236
|
var y = /* @__PURE__ */ u("<iframe>");
|
|
237
237
|
function S(e) {
|
|
238
|
-
const
|
|
238
|
+
const i = r(() => {
|
|
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 o(t) {
|
|
250
250
|
var n;
|
|
251
251
|
if ((d == null ? void 0 : d.contentWindow) === t.source)
|
|
252
252
|
switch (t.data.type) {
|
|
@@ -260,11 +260,11 @@ function S(e) {
|
|
|
260
260
|
}
|
|
261
261
|
let d;
|
|
262
262
|
return m(() => {
|
|
263
|
-
window.addEventListener("message",
|
|
263
|
+
window.addEventListener("message", o);
|
|
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, s =
|
|
267
|
+
var c = e.className, s = i();
|
|
268
268
|
return c !== a.e && b(t, a.e = c), s !== a.t && f(t, "src", a.t = s), a;
|
|
269
269
|
}, {
|
|
270
270
|
e: void 0,
|