@documenso/embed-vue 0.2.2 → 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 +197 -124
- package/dist/multisign-document.vue.d.ts +46 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as unstable_EmbedCreateDocument } from './create-document.vue';
|
|
|
4
4
|
export { default as unstable_EmbedCreateTemplate } from './create-template.vue';
|
|
5
5
|
export { default as unstable_EmbedUpdateDocument } from './update-document.vue';
|
|
6
6
|
export { default as unstable_EmbedUpdateTemplate } from './update-template.vue';
|
|
7
|
+
export { default as unstable_EmbedMultiSignDocument } from './multisign-document.vue';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as unstable_EmbedCreateDocument } from './create-document.vue';
|
|
|
4
4
|
export { default as unstable_EmbedCreateTemplate } from './create-template.vue';
|
|
5
5
|
export { default as unstable_EmbedUpdateDocument } from './update-document.vue';
|
|
6
6
|
export { default as unstable_EmbedUpdateTemplate } from './update-template.vue';
|
|
7
|
+
export { default as unstable_EmbedMultiSignDocument } from './multisign-document.vue';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),p=["src"],f=n.defineComponent({__name:"direct-template",props:{className:{},host:{},token:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},email:{},lockEmail:{type:Boolean},name:{},lockName:{type:Boolean},additionalProps:{},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function},onFieldSigned:{type:Function},onFieldUnsigned:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),p=["src"],f=n.defineComponent({__name:"direct-template",props:{className:{},host:{},token:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},email:{},lockEmail:{type:Boolean},name:{},lockName:{type:Boolean},additionalProps:{},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function},onFieldSigned:{type:Function},onFieldUnsigned:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=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}))),o=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&o.searchParams.set("externalId",e.externalId),`${o}#${a}`});function c(t){var a,o,m,i,l,u;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.action){case"document-ready":(o=e.onDocumentReady)==null||o.call(e);break;case"document-completed":(m=e.onDocumentCompleted)==null||m.call(e,t.data.data);break;case"document-error":(i=e.onDocumentError)==null||i.call(e,t.data.data);break;case"field-signed":(l=e.onFieldSigned)==null||l.call(e);break;case"field-unsigned":(u=e.onFieldUnsigned)==null||u.call(e);break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,p))}}),k=["src"],_=n.defineComponent({__name:"sign-document",props:{className:{},host:{},token:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},name:{},lockName:{type:Boolean},allowDocumentRejection:{type:Boolean},additionalProps:{},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function},onDocumentRejected:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=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)}#${a}`});function c(t){var a,o,m,i,l;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.action){case"document-ready":(o=e.onDocumentReady)==null||o.call(e);break;case"document-completed":(m=e.onDocumentCompleted)==null||m.call(e,t.data.data);break;case"document-error":(i=e.onDocumentError)==null||i.call(e,t.data.data);break;case"document-rejected":(l=e.onDocumentRejected)==null||l.call(e,t.data.data);break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,k))}}),b=["src"],h=n.defineComponent({__name:"create-document",props:{className:{},host:{},presignToken:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},additionalProps:{},onDocumentCreated:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),o=new URL("/embed/v1/authoring/document/create",t);return o.searchParams.set("token",e.presignToken),o.hash=a,o.toString()});function c(t){var a,o;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.type){case"document-created":(o=e.onDocumentCreated)==null||o.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,b))}}),y=["src"],D=n.defineComponent({__name:"create-template",props:{className:{},host:{},presignToken:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},additionalProps:{},onTemplateCreated:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),o=new URL("/embed/v1/authoring/template/create",t);return o.searchParams.set("token",e.presignToken),o.hash=a,o.toString()});function c(t){var a,o;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.type){case"template-created":(o=e.onTemplateCreated)==null||o.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,y))}}),g=["src"],w=n.defineComponent({__name:"update-document",props:{className:{},host:{},presignToken:{},documentId:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},additionalProps:{},onDocumentUpdated:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=btoa(encodeURIComponent(JSON.stringify({token:e.presignToken,externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),o=new URL(`/embed/v1/authoring/document/edit/${e.documentId}`,t);return o.searchParams.set("token",e.presignToken),o.hash=a,o.toString()});function c(t){var a,o;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.type){case"document-updated":(o=e.onDocumentUpdated)==null||o.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,g))}}),I=["src"],E=n.defineComponent({__name:"update-template",props:{className:{},host:{},presignToken:{},templateId:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},additionalProps:{},onTemplateUpdated:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),o=new URL(`/embed/v1/authoring/template/edit/${e.templateId}`,t);return o.searchParams.set("token",e.presignToken),o.hash=a,o.toString()});function c(t){var a,o;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.type){case"template-updated":(o=e.onTemplateUpdated)==null||o.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,I))}}),M=["src"],U=n.defineComponent({__name:"multisign-document",props:{className:{},host:{},tokens:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},name:{},lockName:{type:Boolean},allowDocumentRejection:{type:Boolean},additionalProps:{},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function},onDocumentRejected:{type:Function},onAllDocumentsCompleted:{type:Function}},setup(d){const e=d,s=n.ref();n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",a=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps}))),o=new URL("/embed/v1/multisign",t);for(const m of e.tokens)o.searchParams.append("token",m);return`${o}#${a}`});function c(t){var a,o,m,i,l,u;if(((a=s.value)==null?void 0:a.contentWindow)===t.source)switch(t.data.action){case"document-ready":(o=e.onDocumentReady)==null||o.call(e);break;case"document-completed":(m=e.onDocumentCompleted)==null||m.call(e,t.data.data);break;case"document-error":(i=e.onDocumentError)==null||i.call(e,t.data.data);break;case"document-rejected":(l=e.onDocumentRejected)==null||l.call(e,t.data.data);break;case"all-documents-completed":(u=e.onAllDocumentsCompleted)==null||u.call(e,t.data.data);break}}return(t,a)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(t.className),src:r.value},null,10,M))}});exports.EmbedDirectTemplate=f;exports.EmbedSignDocument=_;exports.unstable_EmbedCreateDocument=h;exports.unstable_EmbedCreateTemplate=D;exports.unstable_EmbedMultiSignDocument=U;exports.unstable_EmbedUpdateDocument=w;exports.unstable_EmbedUpdateTemplate=E;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as l, ref as u, onMounted as p, onUnmounted as _, computed as f, openBlock as k, createElementBlock as h, normalizeClass as b } from "vue";
|
|
2
|
+
const y = ["src"], R = /* @__PURE__ */ l({
|
|
3
3
|
__name: "direct-template",
|
|
4
4
|
props: {
|
|
5
5
|
className: {},
|
|
@@ -21,14 +21,14 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
21
21
|
onFieldUnsigned: { type: Function }
|
|
22
22
|
},
|
|
23
23
|
setup(c) {
|
|
24
|
-
const e = c,
|
|
25
|
-
|
|
24
|
+
const e = c, s = u();
|
|
25
|
+
p(() => {
|
|
26
26
|
window.addEventListener("message", o);
|
|
27
|
-
}),
|
|
27
|
+
}), _(() => {
|
|
28
28
|
window.removeEventListener("message", o);
|
|
29
29
|
});
|
|
30
|
-
const d =
|
|
31
|
-
const
|
|
30
|
+
const d = f(() => {
|
|
31
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
32
32
|
encodeURIComponent(
|
|
33
33
|
JSON.stringify({
|
|
34
34
|
name: e.name,
|
|
@@ -41,38 +41,38 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
41
41
|
...e.additionalProps
|
|
42
42
|
})
|
|
43
43
|
)
|
|
44
|
-
),
|
|
45
|
-
return e.externalId &&
|
|
44
|
+
), a = new URL(`/embed/direct/${e.token}`, t);
|
|
45
|
+
return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${n}`;
|
|
46
46
|
});
|
|
47
|
-
function o(
|
|
48
|
-
var
|
|
49
|
-
if (((
|
|
50
|
-
switch (
|
|
47
|
+
function o(t) {
|
|
48
|
+
var n, a, r, i, m, D;
|
|
49
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
50
|
+
switch (t.data.action) {
|
|
51
51
|
case "document-ready":
|
|
52
|
-
(
|
|
52
|
+
(a = e.onDocumentReady) == null || a.call(e);
|
|
53
53
|
break;
|
|
54
54
|
case "document-completed":
|
|
55
|
-
(
|
|
55
|
+
(r = e.onDocumentCompleted) == null || r.call(e, t.data.data);
|
|
56
56
|
break;
|
|
57
57
|
case "document-error":
|
|
58
|
-
(
|
|
58
|
+
(i = e.onDocumentError) == null || i.call(e, t.data.data);
|
|
59
59
|
break;
|
|
60
60
|
case "field-signed":
|
|
61
|
-
(
|
|
61
|
+
(m = e.onFieldSigned) == null || m.call(e);
|
|
62
62
|
break;
|
|
63
63
|
case "field-unsigned":
|
|
64
|
-
(
|
|
64
|
+
(D = e.onFieldUnsigned) == null || D.call(e);
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
return (
|
|
68
|
+
return (t, n) => (k(), h("iframe", {
|
|
69
69
|
ref_key: "__iframe",
|
|
70
|
-
ref:
|
|
71
|
-
class:
|
|
70
|
+
ref: s,
|
|
71
|
+
class: b(t.className),
|
|
72
72
|
src: d.value
|
|
73
|
-
}, null, 10,
|
|
73
|
+
}, null, 10, y));
|
|
74
74
|
}
|
|
75
|
-
}),
|
|
75
|
+
}), g = ["src"], x = /* @__PURE__ */ l({
|
|
76
76
|
__name: "sign-document",
|
|
77
77
|
props: {
|
|
78
78
|
className: {},
|
|
@@ -91,14 +91,14 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
91
91
|
onDocumentRejected: { type: Function }
|
|
92
92
|
},
|
|
93
93
|
setup(c) {
|
|
94
|
-
const e = c,
|
|
95
|
-
|
|
94
|
+
const e = c, s = u();
|
|
95
|
+
p(() => {
|
|
96
96
|
window.addEventListener("message", o);
|
|
97
|
-
}),
|
|
97
|
+
}), _(() => {
|
|
98
98
|
window.removeEventListener("message", o);
|
|
99
99
|
});
|
|
100
|
-
const d =
|
|
101
|
-
const
|
|
100
|
+
const d = f(() => {
|
|
101
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
102
102
|
encodeURIComponent(
|
|
103
103
|
JSON.stringify({
|
|
104
104
|
name: e.name,
|
|
@@ -111,34 +111,34 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
111
111
|
})
|
|
112
112
|
)
|
|
113
113
|
);
|
|
114
|
-
return `${new URL(`/embed/sign/${e.token}`,
|
|
114
|
+
return `${new URL(`/embed/sign/${e.token}`, t)}#${n}`;
|
|
115
115
|
});
|
|
116
|
-
function o(
|
|
117
|
-
var
|
|
118
|
-
if (((
|
|
119
|
-
switch (
|
|
116
|
+
function o(t) {
|
|
117
|
+
var n, a, r, i, m;
|
|
118
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
119
|
+
switch (t.data.action) {
|
|
120
120
|
case "document-ready":
|
|
121
|
-
(
|
|
121
|
+
(a = e.onDocumentReady) == null || a.call(e);
|
|
122
122
|
break;
|
|
123
123
|
case "document-completed":
|
|
124
|
-
(
|
|
124
|
+
(r = e.onDocumentCompleted) == null || r.call(e, t.data.data);
|
|
125
125
|
break;
|
|
126
126
|
case "document-error":
|
|
127
|
-
(
|
|
127
|
+
(i = e.onDocumentError) == null || i.call(e, t.data.data);
|
|
128
128
|
break;
|
|
129
129
|
case "document-rejected":
|
|
130
|
-
(
|
|
130
|
+
(m = e.onDocumentRejected) == null || m.call(e, t.data.data);
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
return (
|
|
134
|
+
return (t, n) => (k(), h("iframe", {
|
|
135
135
|
ref_key: "__iframe",
|
|
136
|
-
ref:
|
|
137
|
-
class:
|
|
136
|
+
ref: s,
|
|
137
|
+
class: b(t.className),
|
|
138
138
|
src: d.value
|
|
139
|
-
}, null, 10,
|
|
139
|
+
}, null, 10, g));
|
|
140
140
|
}
|
|
141
|
-
}),
|
|
141
|
+
}), w = ["src"], C = /* @__PURE__ */ l({
|
|
142
142
|
__name: "create-document",
|
|
143
143
|
props: {
|
|
144
144
|
className: {},
|
|
@@ -153,14 +153,14 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
153
153
|
onDocumentCreated: { type: Function }
|
|
154
154
|
},
|
|
155
155
|
setup(c) {
|
|
156
|
-
const e = c,
|
|
157
|
-
|
|
156
|
+
const e = c, s = u();
|
|
157
|
+
p(() => {
|
|
158
158
|
window.addEventListener("message", o);
|
|
159
|
-
}),
|
|
159
|
+
}), _(() => {
|
|
160
160
|
window.removeEventListener("message", o);
|
|
161
161
|
});
|
|
162
|
-
const d =
|
|
163
|
-
const
|
|
162
|
+
const d = f(() => {
|
|
163
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
164
164
|
encodeURIComponent(
|
|
165
165
|
JSON.stringify({
|
|
166
166
|
externalId: e.externalId,
|
|
@@ -171,29 +171,29 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
171
171
|
...e.additionalProps
|
|
172
172
|
})
|
|
173
173
|
)
|
|
174
|
-
),
|
|
175
|
-
return
|
|
174
|
+
), a = new URL("/embed/v1/authoring/document/create", t);
|
|
175
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
176
176
|
});
|
|
177
|
-
function o(
|
|
178
|
-
var
|
|
179
|
-
if (((
|
|
180
|
-
switch (
|
|
177
|
+
function o(t) {
|
|
178
|
+
var n, a;
|
|
179
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
180
|
+
switch (t.data.type) {
|
|
181
181
|
case "document-created":
|
|
182
|
-
(
|
|
183
|
-
documentId:
|
|
184
|
-
externalId:
|
|
182
|
+
(a = e.onDocumentCreated) == null || a.call(e, {
|
|
183
|
+
documentId: t.data.documentId,
|
|
184
|
+
externalId: t.data.externalId
|
|
185
185
|
});
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
return (
|
|
189
|
+
return (t, n) => (k(), h("iframe", {
|
|
190
190
|
ref_key: "__iframe",
|
|
191
|
-
ref:
|
|
192
|
-
class:
|
|
191
|
+
ref: s,
|
|
192
|
+
class: b(t.className),
|
|
193
193
|
src: d.value
|
|
194
|
-
}, null, 10,
|
|
194
|
+
}, null, 10, w));
|
|
195
195
|
}
|
|
196
|
-
}), I = ["src"],
|
|
196
|
+
}), I = ["src"], F = /* @__PURE__ */ l({
|
|
197
197
|
__name: "create-template",
|
|
198
198
|
props: {
|
|
199
199
|
className: {},
|
|
@@ -208,14 +208,14 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
208
208
|
onTemplateCreated: { type: Function }
|
|
209
209
|
},
|
|
210
210
|
setup(c) {
|
|
211
|
-
const e = c,
|
|
212
|
-
|
|
211
|
+
const e = c, s = u();
|
|
212
|
+
p(() => {
|
|
213
213
|
window.addEventListener("message", o);
|
|
214
|
-
}),
|
|
214
|
+
}), _(() => {
|
|
215
215
|
window.removeEventListener("message", o);
|
|
216
216
|
});
|
|
217
|
-
const d =
|
|
218
|
-
const
|
|
217
|
+
const d = f(() => {
|
|
218
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
219
219
|
encodeURIComponent(
|
|
220
220
|
JSON.stringify({
|
|
221
221
|
externalId: e.externalId,
|
|
@@ -226,29 +226,29 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
226
226
|
...e.additionalProps
|
|
227
227
|
})
|
|
228
228
|
)
|
|
229
|
-
),
|
|
230
|
-
return
|
|
229
|
+
), a = new URL("/embed/v1/authoring/template/create", t);
|
|
230
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
231
231
|
});
|
|
232
|
-
function o(
|
|
233
|
-
var
|
|
234
|
-
if (((
|
|
235
|
-
switch (
|
|
232
|
+
function o(t) {
|
|
233
|
+
var n, a;
|
|
234
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
235
|
+
switch (t.data.type) {
|
|
236
236
|
case "template-created":
|
|
237
|
-
(
|
|
238
|
-
templateId:
|
|
239
|
-
externalId:
|
|
237
|
+
(a = e.onTemplateCreated) == null || a.call(e, {
|
|
238
|
+
templateId: t.data.templateId,
|
|
239
|
+
externalId: t.data.externalId
|
|
240
240
|
});
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
return (
|
|
244
|
+
return (t, n) => (k(), h("iframe", {
|
|
245
245
|
ref_key: "__iframe",
|
|
246
|
-
ref:
|
|
247
|
-
class:
|
|
246
|
+
ref: s,
|
|
247
|
+
class: b(t.className),
|
|
248
248
|
src: d.value
|
|
249
249
|
}, null, 10, I));
|
|
250
250
|
}
|
|
251
|
-
}),
|
|
251
|
+
}), E = ["src"], $ = /* @__PURE__ */ l({
|
|
252
252
|
__name: "update-document",
|
|
253
253
|
props: {
|
|
254
254
|
className: {},
|
|
@@ -264,14 +264,14 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
264
264
|
onDocumentUpdated: { type: Function }
|
|
265
265
|
},
|
|
266
266
|
setup(c) {
|
|
267
|
-
const e = c,
|
|
268
|
-
|
|
267
|
+
const e = c, s = u();
|
|
268
|
+
p(() => {
|
|
269
269
|
window.addEventListener("message", o);
|
|
270
|
-
}),
|
|
270
|
+
}), _(() => {
|
|
271
271
|
window.removeEventListener("message", o);
|
|
272
272
|
});
|
|
273
|
-
const d =
|
|
274
|
-
const
|
|
273
|
+
const d = f(() => {
|
|
274
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
275
275
|
encodeURIComponent(
|
|
276
276
|
JSON.stringify({
|
|
277
277
|
token: e.presignToken,
|
|
@@ -283,32 +283,32 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
283
283
|
...e.additionalProps
|
|
284
284
|
})
|
|
285
285
|
)
|
|
286
|
-
),
|
|
286
|
+
), a = new URL(
|
|
287
287
|
`/embed/v1/authoring/document/edit/${e.documentId}`,
|
|
288
|
-
|
|
288
|
+
t
|
|
289
289
|
);
|
|
290
|
-
return
|
|
290
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
291
291
|
});
|
|
292
|
-
function o(
|
|
293
|
-
var
|
|
294
|
-
if (((
|
|
295
|
-
switch (
|
|
292
|
+
function o(t) {
|
|
293
|
+
var n, a;
|
|
294
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
295
|
+
switch (t.data.type) {
|
|
296
296
|
case "document-updated":
|
|
297
|
-
(
|
|
298
|
-
documentId:
|
|
299
|
-
externalId:
|
|
297
|
+
(a = e.onDocumentUpdated) == null || a.call(e, {
|
|
298
|
+
documentId: t.data.documentId,
|
|
299
|
+
externalId: t.data.externalId
|
|
300
300
|
});
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
return (
|
|
304
|
+
return (t, n) => (k(), h("iframe", {
|
|
305
305
|
ref_key: "__iframe",
|
|
306
|
-
ref:
|
|
307
|
-
class:
|
|
306
|
+
ref: s,
|
|
307
|
+
class: b(t.className),
|
|
308
308
|
src: d.value
|
|
309
|
-
}, null, 10,
|
|
309
|
+
}, null, 10, E));
|
|
310
310
|
}
|
|
311
|
-
}),
|
|
311
|
+
}), U = ["src"], L = /* @__PURE__ */ l({
|
|
312
312
|
__name: "update-template",
|
|
313
313
|
props: {
|
|
314
314
|
className: {},
|
|
@@ -324,14 +324,14 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
324
324
|
onTemplateUpdated: { type: Function }
|
|
325
325
|
},
|
|
326
326
|
setup(c) {
|
|
327
|
-
const e = c,
|
|
328
|
-
|
|
327
|
+
const e = c, s = u();
|
|
328
|
+
p(() => {
|
|
329
329
|
window.addEventListener("message", o);
|
|
330
|
-
}),
|
|
330
|
+
}), _(() => {
|
|
331
331
|
window.removeEventListener("message", o);
|
|
332
332
|
});
|
|
333
|
-
const d =
|
|
334
|
-
const
|
|
333
|
+
const d = f(() => {
|
|
334
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
335
335
|
encodeURIComponent(
|
|
336
336
|
JSON.stringify({
|
|
337
337
|
externalId: e.externalId,
|
|
@@ -342,37 +342,110 @@ const w = ["src"], M = /* @__PURE__ */ r({
|
|
|
342
342
|
...e.additionalProps
|
|
343
343
|
})
|
|
344
344
|
)
|
|
345
|
-
),
|
|
345
|
+
), a = new URL(
|
|
346
346
|
`/embed/v1/authoring/template/edit/${e.templateId}`,
|
|
347
|
-
|
|
347
|
+
t
|
|
348
348
|
);
|
|
349
|
-
return
|
|
349
|
+
return a.searchParams.set("token", e.presignToken), a.hash = n, a.toString();
|
|
350
350
|
});
|
|
351
|
-
function o(
|
|
352
|
-
var
|
|
353
|
-
if (((
|
|
354
|
-
switch (
|
|
351
|
+
function o(t) {
|
|
352
|
+
var n, a;
|
|
353
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
354
|
+
switch (t.data.type) {
|
|
355
355
|
case "template-updated":
|
|
356
|
-
(
|
|
357
|
-
templateId:
|
|
358
|
-
externalId:
|
|
356
|
+
(a = e.onTemplateUpdated) == null || a.call(e, {
|
|
357
|
+
templateId: t.data.templateId,
|
|
358
|
+
externalId: t.data.externalId
|
|
359
359
|
});
|
|
360
360
|
break;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
return (
|
|
363
|
+
return (t, n) => (k(), h("iframe", {
|
|
364
364
|
ref_key: "__iframe",
|
|
365
|
-
ref:
|
|
366
|
-
class:
|
|
365
|
+
ref: s,
|
|
366
|
+
class: b(t.className),
|
|
367
367
|
src: d.value
|
|
368
|
-
}, null, 10,
|
|
368
|
+
}, null, 10, U));
|
|
369
|
+
}
|
|
370
|
+
}), M = ["src"], V = /* @__PURE__ */ l({
|
|
371
|
+
__name: "multisign-document",
|
|
372
|
+
props: {
|
|
373
|
+
className: {},
|
|
374
|
+
host: {},
|
|
375
|
+
tokens: {},
|
|
376
|
+
css: {},
|
|
377
|
+
cssVars: {},
|
|
378
|
+
darkModeDisabled: { type: Boolean },
|
|
379
|
+
name: {},
|
|
380
|
+
lockName: { type: Boolean },
|
|
381
|
+
allowDocumentRejection: { type: Boolean },
|
|
382
|
+
additionalProps: {},
|
|
383
|
+
onDocumentReady: { type: Function },
|
|
384
|
+
onDocumentCompleted: { type: Function },
|
|
385
|
+
onDocumentError: { type: Function },
|
|
386
|
+
onDocumentRejected: { type: Function },
|
|
387
|
+
onAllDocumentsCompleted: { type: Function }
|
|
388
|
+
},
|
|
389
|
+
setup(c) {
|
|
390
|
+
const e = c, s = u();
|
|
391
|
+
p(() => {
|
|
392
|
+
window.addEventListener("message", o);
|
|
393
|
+
}), _(() => {
|
|
394
|
+
window.removeEventListener("message", o);
|
|
395
|
+
});
|
|
396
|
+
const d = f(() => {
|
|
397
|
+
const t = e.host || "https://app.documenso.com", n = btoa(
|
|
398
|
+
encodeURIComponent(
|
|
399
|
+
JSON.stringify({
|
|
400
|
+
name: e.name,
|
|
401
|
+
lockName: e.lockName,
|
|
402
|
+
css: e.css,
|
|
403
|
+
cssVars: e.cssVars,
|
|
404
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
405
|
+
allowDocumentRejection: e.allowDocumentRejection,
|
|
406
|
+
...e.additionalProps
|
|
407
|
+
})
|
|
408
|
+
)
|
|
409
|
+
), a = new URL("/embed/v1/multisign", t);
|
|
410
|
+
for (const r of e.tokens)
|
|
411
|
+
a.searchParams.append("token", r);
|
|
412
|
+
return `${a}#${n}`;
|
|
413
|
+
});
|
|
414
|
+
function o(t) {
|
|
415
|
+
var n, a, r, i, m, D;
|
|
416
|
+
if (((n = s.value) == null ? void 0 : n.contentWindow) === t.source)
|
|
417
|
+
switch (t.data.action) {
|
|
418
|
+
case "document-ready":
|
|
419
|
+
(a = e.onDocumentReady) == null || a.call(e);
|
|
420
|
+
break;
|
|
421
|
+
case "document-completed":
|
|
422
|
+
(r = e.onDocumentCompleted) == null || r.call(e, t.data.data);
|
|
423
|
+
break;
|
|
424
|
+
case "document-error":
|
|
425
|
+
(i = e.onDocumentError) == null || i.call(e, t.data.data);
|
|
426
|
+
break;
|
|
427
|
+
case "document-rejected":
|
|
428
|
+
(m = e.onDocumentRejected) == null || m.call(e, t.data.data);
|
|
429
|
+
break;
|
|
430
|
+
case "all-documents-completed":
|
|
431
|
+
(D = e.onAllDocumentsCompleted) == null || D.call(e, t.data.data);
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return (t, n) => (k(), h("iframe", {
|
|
436
|
+
ref_key: "__iframe",
|
|
437
|
+
ref: s,
|
|
438
|
+
class: b(t.className),
|
|
439
|
+
src: d.value
|
|
440
|
+
}, null, 10, M));
|
|
369
441
|
}
|
|
370
442
|
});
|
|
371
443
|
export {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
444
|
+
R as EmbedDirectTemplate,
|
|
445
|
+
x as EmbedSignDocument,
|
|
446
|
+
C as unstable_EmbedCreateDocument,
|
|
447
|
+
F as unstable_EmbedCreateTemplate,
|
|
448
|
+
V as unstable_EmbedMultiSignDocument,
|
|
449
|
+
$ as unstable_EmbedUpdateDocument,
|
|
450
|
+
L as unstable_EmbedUpdateTemplate
|
|
378
451
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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 const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<EmbedMultiSignDocumentProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToOption<EmbedMultiSignDocumentProps>>>, {}, {}>;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
39
|
+
type __VLS_TypePropsToOption<T> = {
|
|
40
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
41
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
42
|
+
} : {
|
|
43
|
+
type: import('vue').PropType<T[K]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
};
|