@documenso/embed-react 0.2.2 → 0.3.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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +149 -108
- package/dist/multisign-document.d.ts +38 -0
- package/package.json +6 -6
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 r=require("react/jsx-runtime"),n=require("react");function i(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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}#${o}`}function c(t){if(s.current?.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}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}function u(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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)}#${o}`}function c(t){if(s.current?.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}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}function l(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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=o,a.toString()}function c(t){if(s.current?.contentWindow===t.source)switch(t.data.type){case"document-created":e.onDocumentCreated?.({documentId:t.data.documentId,externalId:t.data.externalId});break}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}function f(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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=o,a.toString()}function c(t){if(s.current?.contentWindow===t.source)switch(t.data.type){case"template-created":e.onTemplateCreated?.({templateId:t.data.templateId,externalId:t.data.externalId});break}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}function b(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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=o,a.toString()}function c(t){if(s.current?.contentWindow===t.source)switch(t.data.type){case"document-updated":e.onDocumentUpdated?.({documentId:t.data.documentId,externalId:t.data.externalId});break}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}function k(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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=o,a.toString()}function c(t){if(s.current?.contentWindow===t.source)switch(t.data.type){case"template-updated":e.onTemplateUpdated?.({templateId:t.data.templateId,externalId:t.data.externalId});break}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}function g(e){const s=n.useRef(null);function d(){const t=e.host||"https://app.documenso.com",o=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 m of e.tokens)a.searchParams.append("token",m);return`${a}#${o}`}function c(t){if(s.current?.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}}return n.useEffect(()=>{window.addEventListener("message",c)},[]),n.useEffect(()=>()=>{window.removeEventListener("message",c)},[]),r.jsx("iframe",{ref:s,className:e.className,src:d()})}exports.EmbedDirectTemplate=i;exports.EmbedSignDocument=u;exports.unstable_EmbedCreateDocument=l;exports.unstable_EmbedCreateTemplate=f;exports.unstable_EmbedMultiSignDocument=g;exports.unstable_EmbedUpdateDocument=b;exports.unstable_EmbedUpdateTemplate=k;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as s } from "react";
|
|
3
|
+
function f(e) {
|
|
4
|
+
const n = m(null);
|
|
5
|
+
function c() {
|
|
6
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
7
7
|
encodeURIComponent(
|
|
8
8
|
JSON.stringify({
|
|
9
9
|
name: e.name,
|
|
@@ -16,40 +16,39 @@ function g(e) {
|
|
|
16
16
|
...e.additionalProps
|
|
17
17
|
})
|
|
18
18
|
)
|
|
19
|
-
),
|
|
20
|
-
return e.externalId &&
|
|
19
|
+
), t = new URL(`/embed/direct/${e.token}`, a);
|
|
20
|
+
return e.externalId && t.searchParams.set("externalId", e.externalId), `${t}#${o}`;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
switch (t.data.action) {
|
|
22
|
+
function d(a) {
|
|
23
|
+
if (n.current?.contentWindow === a.source)
|
|
24
|
+
switch (a.data.action) {
|
|
26
25
|
case "document-ready":
|
|
27
|
-
|
|
26
|
+
e.onDocumentReady?.();
|
|
28
27
|
break;
|
|
29
28
|
case "document-completed":
|
|
30
|
-
|
|
29
|
+
e.onDocumentCompleted?.(a.data.data);
|
|
31
30
|
break;
|
|
32
31
|
case "document-error":
|
|
33
|
-
|
|
32
|
+
e.onDocumentError?.(a.data.data);
|
|
34
33
|
break;
|
|
35
34
|
case "field-signed":
|
|
36
|
-
|
|
35
|
+
e.onFieldSigned?.();
|
|
37
36
|
break;
|
|
38
37
|
case "field-unsigned":
|
|
39
|
-
|
|
38
|
+
e.onFieldUnsigned?.();
|
|
40
39
|
break;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
return s(() => {
|
|
44
|
-
window.addEventListener("message",
|
|
43
|
+
window.addEventListener("message", d);
|
|
45
44
|
}, []), s(() => () => {
|
|
46
|
-
window.removeEventListener("message",
|
|
47
|
-
}, []), /* @__PURE__ */
|
|
45
|
+
window.removeEventListener("message", d);
|
|
46
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
48
47
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
function
|
|
52
|
-
const
|
|
48
|
+
function b(e) {
|
|
49
|
+
const n = m(null);
|
|
50
|
+
function c() {
|
|
51
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
53
52
|
encodeURIComponent(
|
|
54
53
|
JSON.stringify({
|
|
55
54
|
name: e.name,
|
|
@@ -62,36 +61,35 @@ function k(e) {
|
|
|
62
61
|
})
|
|
63
62
|
)
|
|
64
63
|
);
|
|
65
|
-
return `${new URL(`/embed/sign/${e.token}`,
|
|
64
|
+
return `${new URL(`/embed/sign/${e.token}`, a)}#${o}`;
|
|
66
65
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
switch (t.data.action) {
|
|
66
|
+
function d(a) {
|
|
67
|
+
if (n.current?.contentWindow === a.source)
|
|
68
|
+
switch (a.data.action) {
|
|
71
69
|
case "document-ready":
|
|
72
|
-
|
|
70
|
+
e.onDocumentReady?.();
|
|
73
71
|
break;
|
|
74
72
|
case "document-completed":
|
|
75
|
-
|
|
73
|
+
e.onDocumentCompleted?.(a.data.data);
|
|
76
74
|
break;
|
|
77
75
|
case "document-error":
|
|
78
|
-
|
|
76
|
+
e.onDocumentError?.(a.data.data);
|
|
79
77
|
break;
|
|
80
78
|
case "document-rejected":
|
|
81
|
-
|
|
79
|
+
e.onDocumentRejected?.(a.data.data);
|
|
82
80
|
break;
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
return s(() => {
|
|
86
|
-
window.addEventListener("message",
|
|
84
|
+
window.addEventListener("message", d);
|
|
87
85
|
}, []), s(() => () => {
|
|
88
|
-
window.removeEventListener("message",
|
|
89
|
-
}, []), /* @__PURE__ */
|
|
86
|
+
window.removeEventListener("message", d);
|
|
87
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
90
88
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
function
|
|
94
|
-
const
|
|
89
|
+
function k(e) {
|
|
90
|
+
const n = m(null);
|
|
91
|
+
function c() {
|
|
92
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
95
93
|
encodeURIComponent(
|
|
96
94
|
JSON.stringify({
|
|
97
95
|
externalId: e.externalId,
|
|
@@ -102,31 +100,30 @@ function h(e) {
|
|
|
102
100
|
...e.additionalProps
|
|
103
101
|
})
|
|
104
102
|
)
|
|
105
|
-
),
|
|
106
|
-
return
|
|
103
|
+
), t = new URL("/embed/v1/authoring/document/create", a);
|
|
104
|
+
return t.searchParams.set("token", e.presignToken), t.hash = o, t.toString();
|
|
107
105
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
switch (t.data.type) {
|
|
106
|
+
function d(a) {
|
|
107
|
+
if (n.current?.contentWindow === a.source)
|
|
108
|
+
switch (a.data.type) {
|
|
112
109
|
case "document-created":
|
|
113
|
-
|
|
114
|
-
documentId:
|
|
115
|
-
externalId:
|
|
110
|
+
e.onDocumentCreated?.({
|
|
111
|
+
documentId: a.data.documentId,
|
|
112
|
+
externalId: a.data.externalId
|
|
116
113
|
});
|
|
117
114
|
break;
|
|
118
115
|
}
|
|
119
116
|
}
|
|
120
117
|
return s(() => {
|
|
121
|
-
window.addEventListener("message",
|
|
118
|
+
window.addEventListener("message", d);
|
|
122
119
|
}, []), s(() => () => {
|
|
123
|
-
window.removeEventListener("message",
|
|
124
|
-
}, []), /* @__PURE__ */
|
|
120
|
+
window.removeEventListener("message", d);
|
|
121
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
125
122
|
}
|
|
126
|
-
function
|
|
127
|
-
const
|
|
128
|
-
function
|
|
129
|
-
const
|
|
123
|
+
function w(e) {
|
|
124
|
+
const n = m(null);
|
|
125
|
+
function c() {
|
|
126
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
130
127
|
encodeURIComponent(
|
|
131
128
|
JSON.stringify({
|
|
132
129
|
externalId: e.externalId,
|
|
@@ -137,31 +134,30 @@ function I(e) {
|
|
|
137
134
|
...e.additionalProps
|
|
138
135
|
})
|
|
139
136
|
)
|
|
140
|
-
),
|
|
141
|
-
return
|
|
137
|
+
), t = new URL("/embed/v1/authoring/template/create", a);
|
|
138
|
+
return t.searchParams.set("token", e.presignToken), t.hash = o, t.toString();
|
|
142
139
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
switch (t.data.type) {
|
|
140
|
+
function d(a) {
|
|
141
|
+
if (n.current?.contentWindow === a.source)
|
|
142
|
+
switch (a.data.type) {
|
|
147
143
|
case "template-created":
|
|
148
|
-
|
|
149
|
-
templateId:
|
|
150
|
-
externalId:
|
|
144
|
+
e.onTemplateCreated?.({
|
|
145
|
+
templateId: a.data.templateId,
|
|
146
|
+
externalId: a.data.externalId
|
|
151
147
|
});
|
|
152
148
|
break;
|
|
153
149
|
}
|
|
154
150
|
}
|
|
155
151
|
return s(() => {
|
|
156
|
-
window.addEventListener("message",
|
|
152
|
+
window.addEventListener("message", d);
|
|
157
153
|
}, []), s(() => () => {
|
|
158
|
-
window.removeEventListener("message",
|
|
159
|
-
}, []), /* @__PURE__ */
|
|
154
|
+
window.removeEventListener("message", d);
|
|
155
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
160
156
|
}
|
|
161
|
-
function
|
|
162
|
-
const
|
|
163
|
-
function
|
|
164
|
-
const
|
|
157
|
+
function g(e) {
|
|
158
|
+
const n = m(null);
|
|
159
|
+
function c() {
|
|
160
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
165
161
|
encodeURIComponent(
|
|
166
162
|
JSON.stringify({
|
|
167
163
|
token: e.presignToken,
|
|
@@ -173,34 +169,33 @@ function D(e) {
|
|
|
173
169
|
...e.additionalProps
|
|
174
170
|
})
|
|
175
171
|
)
|
|
176
|
-
),
|
|
172
|
+
), t = new URL(
|
|
177
173
|
`/embed/v1/authoring/document/edit/${e.documentId}`,
|
|
178
|
-
|
|
174
|
+
a
|
|
179
175
|
);
|
|
180
|
-
return
|
|
176
|
+
return t.searchParams.set("token", e.presignToken), t.hash = o, t.toString();
|
|
181
177
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
switch (t.data.type) {
|
|
178
|
+
function d(a) {
|
|
179
|
+
if (n.current?.contentWindow === a.source)
|
|
180
|
+
switch (a.data.type) {
|
|
186
181
|
case "document-updated":
|
|
187
|
-
|
|
188
|
-
documentId:
|
|
189
|
-
externalId:
|
|
182
|
+
e.onDocumentUpdated?.({
|
|
183
|
+
documentId: a.data.documentId,
|
|
184
|
+
externalId: a.data.externalId
|
|
190
185
|
});
|
|
191
186
|
break;
|
|
192
187
|
}
|
|
193
188
|
}
|
|
194
189
|
return s(() => {
|
|
195
|
-
window.addEventListener("message",
|
|
190
|
+
window.addEventListener("message", d);
|
|
196
191
|
}, []), s(() => () => {
|
|
197
|
-
window.removeEventListener("message",
|
|
198
|
-
}, []), /* @__PURE__ */
|
|
192
|
+
window.removeEventListener("message", d);
|
|
193
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
199
194
|
}
|
|
200
|
-
function
|
|
201
|
-
const
|
|
202
|
-
function
|
|
203
|
-
const
|
|
195
|
+
function h(e) {
|
|
196
|
+
const n = m(null);
|
|
197
|
+
function c() {
|
|
198
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
204
199
|
encodeURIComponent(
|
|
205
200
|
JSON.stringify({
|
|
206
201
|
externalId: e.externalId,
|
|
@@ -211,35 +206,81 @@ function E(e) {
|
|
|
211
206
|
...e.additionalProps
|
|
212
207
|
})
|
|
213
208
|
)
|
|
214
|
-
),
|
|
209
|
+
), t = new URL(
|
|
215
210
|
`/embed/v1/authoring/template/edit/${e.templateId}`,
|
|
216
|
-
|
|
211
|
+
a
|
|
217
212
|
);
|
|
218
|
-
return
|
|
213
|
+
return t.searchParams.set("token", e.presignToken), t.hash = o, t.toString();
|
|
219
214
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
switch (t.data.type) {
|
|
215
|
+
function d(a) {
|
|
216
|
+
if (n.current?.contentWindow === a.source)
|
|
217
|
+
switch (a.data.type) {
|
|
224
218
|
case "template-updated":
|
|
225
|
-
|
|
226
|
-
templateId:
|
|
227
|
-
externalId:
|
|
219
|
+
e.onTemplateUpdated?.({
|
|
220
|
+
templateId: a.data.templateId,
|
|
221
|
+
externalId: a.data.externalId
|
|
228
222
|
});
|
|
229
223
|
break;
|
|
230
224
|
}
|
|
231
225
|
}
|
|
232
226
|
return s(() => {
|
|
233
|
-
window.addEventListener("message",
|
|
227
|
+
window.addEventListener("message", d);
|
|
228
|
+
}, []), s(() => () => {
|
|
229
|
+
window.removeEventListener("message", d);
|
|
230
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
231
|
+
}
|
|
232
|
+
function D(e) {
|
|
233
|
+
const n = m(null);
|
|
234
|
+
function c() {
|
|
235
|
+
const a = e.host || "https://app.documenso.com", o = btoa(
|
|
236
|
+
encodeURIComponent(
|
|
237
|
+
JSON.stringify({
|
|
238
|
+
name: e.name,
|
|
239
|
+
lockName: e.lockName,
|
|
240
|
+
css: e.css,
|
|
241
|
+
cssVars: e.cssVars,
|
|
242
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
243
|
+
allowDocumentRejection: e.allowDocumentRejection,
|
|
244
|
+
...e.additionalProps
|
|
245
|
+
})
|
|
246
|
+
)
|
|
247
|
+
), t = new URL("/embed/v1/multisign", a);
|
|
248
|
+
for (const i of e.tokens)
|
|
249
|
+
t.searchParams.append("token", i);
|
|
250
|
+
return `${t}#${o}`;
|
|
251
|
+
}
|
|
252
|
+
function d(a) {
|
|
253
|
+
if (n.current?.contentWindow === a.source)
|
|
254
|
+
switch (a.data.action) {
|
|
255
|
+
case "document-ready":
|
|
256
|
+
e.onDocumentReady?.();
|
|
257
|
+
break;
|
|
258
|
+
case "document-completed":
|
|
259
|
+
e.onDocumentCompleted?.(a.data.data);
|
|
260
|
+
break;
|
|
261
|
+
case "document-error":
|
|
262
|
+
e.onDocumentError?.(a.data.data);
|
|
263
|
+
break;
|
|
264
|
+
case "document-rejected":
|
|
265
|
+
e.onDocumentRejected?.(a.data.data);
|
|
266
|
+
break;
|
|
267
|
+
case "all-documents-completed":
|
|
268
|
+
e.onAllDocumentsCompleted?.(a.data.data);
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return s(() => {
|
|
273
|
+
window.addEventListener("message", d);
|
|
234
274
|
}, []), s(() => () => {
|
|
235
|
-
window.removeEventListener("message",
|
|
236
|
-
}, []), /* @__PURE__ */
|
|
275
|
+
window.removeEventListener("message", d);
|
|
276
|
+
}, []), /* @__PURE__ */ r("iframe", { ref: n, className: e.className, src: c() });
|
|
237
277
|
}
|
|
238
278
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
D as
|
|
244
|
-
|
|
279
|
+
f as EmbedDirectTemplate,
|
|
280
|
+
b as EmbedSignDocument,
|
|
281
|
+
k as unstable_EmbedCreateDocument,
|
|
282
|
+
w as unstable_EmbedCreateTemplate,
|
|
283
|
+
D as unstable_EmbedMultiSignDocument,
|
|
284
|
+
g as unstable_EmbedUpdateDocument,
|
|
285
|
+
h as unstable_EmbedUpdateTemplate
|
|
245
286
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CssVars } from './css-vars';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type EmbedMultiSignDocumentProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
host?: string;
|
|
6
|
+
tokens: string[];
|
|
7
|
+
css?: string | undefined;
|
|
8
|
+
cssVars?: (CssVars & Record<string, string>) | undefined;
|
|
9
|
+
darkModeDisabled?: boolean | undefined;
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
lockName?: boolean | undefined;
|
|
12
|
+
allowDocumentRejection?: boolean | undefined;
|
|
13
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
14
|
+
onDocumentReady?: () => void;
|
|
15
|
+
onDocumentCompleted?: (data: {
|
|
16
|
+
token: string;
|
|
17
|
+
documentId: number;
|
|
18
|
+
recipientId: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
onDocumentError?: (error: string) => void;
|
|
21
|
+
onDocumentRejected?: (data: {
|
|
22
|
+
token: string;
|
|
23
|
+
documentId: number;
|
|
24
|
+
recipientId: number;
|
|
25
|
+
reason: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
onAllDocumentsCompleted?: (data: {
|
|
28
|
+
documents: Array<{
|
|
29
|
+
token: string;
|
|
30
|
+
documentId: number;
|
|
31
|
+
recipientId: number;
|
|
32
|
+
action: "document-completed" | "document-rejected";
|
|
33
|
+
reason?: string;
|
|
34
|
+
}>;
|
|
35
|
+
}) => void;
|
|
36
|
+
};
|
|
37
|
+
declare function EmbedMultiSignDocument(props: EmbedMultiSignDocumentProps): React.JSX.Element;
|
|
38
|
+
export default EmbedMultiSignDocument;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@documenso/embed-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "^18.0.0",
|
|
36
|
-
"react-dom": "^18.0.0"
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@documenso/embed": "*",
|
|
40
|
-
"@types/react": "^18.0.0",
|
|
41
|
-
"@vitejs/plugin-react": "^
|
|
42
|
-
"vite": "^
|
|
40
|
+
"@types/react": "^18.0.0 || ^19.0.0",
|
|
41
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
42
|
+
"vite": "^7.0.0",
|
|
43
43
|
"vite-plugin-dts": "^4.1.0"
|
|
44
44
|
}
|
|
45
45
|
}
|