@documenso/embed-vue 0.4.0 → 0.5.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/create-document.vue.d.ts +3 -10
- package/dist/create-template.vue.d.ts +3 -10
- package/dist/direct-template.vue.d.ts +3 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +106 -126
- package/dist/multisign-document.vue.d.ts +3 -10
- package/dist/sign-document.vue.d.ts +3 -10
- package/dist/update-document.vue.d.ts +3 -10
- package/dist/update-template.vue.d.ts +3 -10
- package/package.json +6 -5
|
@@ -21,14 +21,7 @@ export type EmbedCreateDocumentProps = {
|
|
|
21
21
|
documentId: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
};
|
|
24
|
-
declare const _default: import('vue').DefineComponent<
|
|
24
|
+
declare const _default: import('vue').DefineComponent<EmbedCreateDocumentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedCreateDocumentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
|
+
__iframe: HTMLIFrameElement;
|
|
26
|
+
}, HTMLIFrameElement>;
|
|
25
27
|
export default _default;
|
|
26
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
-
type __VLS_TypePropsToOption<T> = {
|
|
28
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
-
} : {
|
|
31
|
-
type: import('vue').PropType<T[K]>;
|
|
32
|
-
required: true;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
@@ -21,14 +21,7 @@ export type EmbedCreateTemplateProps = {
|
|
|
21
21
|
templateId: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
};
|
|
24
|
-
declare const _default: import('vue').DefineComponent<
|
|
24
|
+
declare const _default: import('vue').DefineComponent<EmbedCreateTemplateProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedCreateTemplateProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
|
+
__iframe: HTMLIFrameElement;
|
|
26
|
+
}, HTMLIFrameElement>;
|
|
25
27
|
export default _default;
|
|
26
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
-
type __VLS_TypePropsToOption<T> = {
|
|
28
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
-
} : {
|
|
31
|
-
type: import('vue').PropType<T[K]>;
|
|
32
|
-
required: true;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
@@ -22,15 +22,7 @@ export type EmbedDirectTemplateProps = {
|
|
|
22
22
|
onFieldSigned?: () => void;
|
|
23
23
|
onFieldUnsigned?: () => void;
|
|
24
24
|
};
|
|
25
|
-
declare const _default: import('vue').DefineComponent<
|
|
25
|
+
declare const _default: import('vue').DefineComponent<EmbedDirectTemplateProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedDirectTemplateProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
26
|
+
__iframe: HTMLIFrameElement;
|
|
27
|
+
}, HTMLIFrameElement>;
|
|
26
28
|
export default _default;
|
|
27
|
-
|
|
28
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
29
|
-
type __VLS_TypePropsToOption<T> = {
|
|
30
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
31
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
32
|
-
} : {
|
|
33
|
-
type: import('vue').PropType<T[K]>;
|
|
34
|
-
required: true;
|
|
35
|
-
};
|
|
36
|
-
};
|
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 n=require("vue"),f=["src"],k=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(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=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}#${d}`});function c(t){if(s.value?.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(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,f))}}),_=["src"],b=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(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=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)}#${d}`});function c(t){if(s.value?.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(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,_))}}),y=["src"],l=n.defineComponent({__name:"create-document",props:{className:{},host:{},presignToken:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},additionalProps:{},onDocumentCreated:{type:Function}},setup(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=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=d,o.toString()});function c(t){s.value?.contentWindow===t.source&&t.data.type==="document-created"&&e.onDocumentCreated?.({documentId:t.data.documentId,externalId:t.data.externalId})}return(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,y))}}),h=["src"],m=n.defineComponent({__name:"create-template",props:{className:{},host:{},presignToken:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},additionalProps:{},onTemplateCreated:{type:Function}},setup(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=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=d,o.toString()});function c(t){s.value?.contentWindow===t.source&&t.data.type==="template-created"&&e.onTemplateCreated?.({templateId:t.data.templateId,externalId:t.data.externalId})}return(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,h))}}),D=["src"],i=n.defineComponent({__name:"update-document",props:{className:{},host:{},presignToken:{},documentId:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},onlyEditFields:{type:Boolean},additionalProps:{},onDocumentUpdated:{type:Function}},setup(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({token:e.presignToken,externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,onlyEditFields:e.onlyEditFields,...e.additionalProps}))),o=new URL(`/embed/v1/authoring/document/edit/${e.documentId}`,t);return o.searchParams.set("token",e.presignToken),o.hash=d,o.toString()});function c(t){s.value?.contentWindow===t.source&&t.data.type==="document-updated"&&e.onDocumentUpdated?.({documentId:t.data.documentId,externalId:t.data.externalId})}return(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,D))}}),g=["src"],u=n.defineComponent({__name:"update-template",props:{className:{},host:{},presignToken:{},templateId:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},features:{},onlyEditFields:{type:Boolean},additionalProps:{},onTemplateUpdated:{type:Function}},setup(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,onlyEditFields:e.onlyEditFields,...e.additionalProps}))),o=new URL(`/embed/v1/authoring/template/edit/${e.templateId}`,t);return o.searchParams.set("token",e.presignToken),o.hash=d,o.toString()});function c(t){s.value?.contentWindow===t.source&&t.data.type==="template-updated"&&e.onTemplateUpdated?.({templateId:t.data.templateId,externalId:t.data.externalId})}return(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,g))}}),w=["src"],E=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(a){const e=a,s=n.ref(null);n.onMounted(()=>{window.addEventListener("message",c)}),n.onUnmounted(()=>{window.removeEventListener("message",c)});const r=n.computed(()=>{const t=e.host||"https://app.documenso.com",d=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 p of e.tokens)o.searchParams.append("token",p);return`${o}#${d}`});function c(t){if(s.value?.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(t,d)=>(n.openBlock(),n.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:n.normalizeClass(a.className),src:r.value},null,10,w))}});exports.EmbedCreateDocumentV1=l;exports.EmbedCreateTemplateV1=m;exports.EmbedDirectTemplate=k;exports.EmbedSignDocument=b;exports.EmbedUpdateDocumentV1=i;exports.EmbedUpdateTemplateV1=u;exports.unstable_EmbedCreateDocument=l;exports.unstable_EmbedCreateTemplate=m;exports.unstable_EmbedMultiSignDocument=E;exports.unstable_EmbedUpdateDocument=i;exports.unstable_EmbedUpdateTemplate=u;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as r, ref as i, onMounted as
|
|
1
|
+
import { defineComponent as r, ref as i, onMounted as l, onUnmounted as m, computed as u, openBlock as p, createElementBlock as f, normalizeClass as k } from "vue";
|
|
2
2
|
const b = ["src"], U = /* @__PURE__ */ r({
|
|
3
3
|
__name: "direct-template",
|
|
4
4
|
props: {
|
|
@@ -20,15 +20,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
20
20
|
onFieldSigned: { type: Function },
|
|
21
21
|
onFieldUnsigned: { type: Function }
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const e =
|
|
25
|
-
|
|
23
|
+
setup(s) {
|
|
24
|
+
const e = s, n = i(null);
|
|
25
|
+
l(() => {
|
|
26
26
|
window.addEventListener("message", o);
|
|
27
|
-
}),
|
|
27
|
+
}), m(() => {
|
|
28
28
|
window.removeEventListener("message", o);
|
|
29
29
|
});
|
|
30
|
-
const d =
|
|
31
|
-
const t = e.host || "https://app.documenso.com",
|
|
30
|
+
const d = u(() => {
|
|
31
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
32
32
|
encodeURIComponent(
|
|
33
33
|
JSON.stringify({
|
|
34
34
|
name: e.name,
|
|
@@ -42,10 +42,10 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
42
42
|
})
|
|
43
43
|
)
|
|
44
44
|
), a = new URL(`/embed/direct/${e.token}`, t);
|
|
45
|
-
return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${
|
|
45
|
+
return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${c}`;
|
|
46
46
|
});
|
|
47
47
|
function o(t) {
|
|
48
|
-
if (
|
|
48
|
+
if (n.value?.contentWindow === t.source)
|
|
49
49
|
switch (t.data.action) {
|
|
50
50
|
case "document-ready":
|
|
51
51
|
e.onDocumentReady?.();
|
|
@@ -64,14 +64,14 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
return (t,
|
|
67
|
+
return (t, c) => (p(), f("iframe", {
|
|
68
68
|
ref_key: "__iframe",
|
|
69
|
-
ref:
|
|
70
|
-
class:
|
|
69
|
+
ref: n,
|
|
70
|
+
class: k(s.className),
|
|
71
71
|
src: d.value
|
|
72
72
|
}, null, 10, b));
|
|
73
73
|
}
|
|
74
|
-
}), h = ["src"],
|
|
74
|
+
}), h = ["src"], x = /* @__PURE__ */ r({
|
|
75
75
|
__name: "sign-document",
|
|
76
76
|
props: {
|
|
77
77
|
className: {},
|
|
@@ -89,15 +89,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
89
89
|
onDocumentError: { type: Function },
|
|
90
90
|
onDocumentRejected: { type: Function }
|
|
91
91
|
},
|
|
92
|
-
setup(
|
|
93
|
-
const e =
|
|
94
|
-
|
|
92
|
+
setup(s) {
|
|
93
|
+
const e = s, n = i(null);
|
|
94
|
+
l(() => {
|
|
95
95
|
window.addEventListener("message", o);
|
|
96
|
-
}),
|
|
96
|
+
}), m(() => {
|
|
97
97
|
window.removeEventListener("message", o);
|
|
98
98
|
});
|
|
99
|
-
const d =
|
|
100
|
-
const t = e.host || "https://app.documenso.com",
|
|
99
|
+
const d = u(() => {
|
|
100
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
101
101
|
encodeURIComponent(
|
|
102
102
|
JSON.stringify({
|
|
103
103
|
name: e.name,
|
|
@@ -110,10 +110,10 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
110
110
|
})
|
|
111
111
|
)
|
|
112
112
|
);
|
|
113
|
-
return `${new URL(`/embed/sign/${e.token}`, t)}#${
|
|
113
|
+
return `${new URL(`/embed/sign/${e.token}`, t)}#${c}`;
|
|
114
114
|
});
|
|
115
115
|
function o(t) {
|
|
116
|
-
if (
|
|
116
|
+
if (n.value?.contentWindow === t.source)
|
|
117
117
|
switch (t.data.action) {
|
|
118
118
|
case "document-ready":
|
|
119
119
|
e.onDocumentReady?.();
|
|
@@ -129,14 +129,14 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
return (t,
|
|
132
|
+
return (t, c) => (p(), f("iframe", {
|
|
133
133
|
ref_key: "__iframe",
|
|
134
|
-
ref:
|
|
135
|
-
class:
|
|
134
|
+
ref: n,
|
|
135
|
+
class: k(s.className),
|
|
136
136
|
src: d.value
|
|
137
137
|
}, null, 10, h));
|
|
138
138
|
}
|
|
139
|
-
}), y = ["src"],
|
|
139
|
+
}), y = ["src"], M = /* @__PURE__ */ r({
|
|
140
140
|
__name: "create-document",
|
|
141
141
|
props: {
|
|
142
142
|
className: {},
|
|
@@ -150,15 +150,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
150
150
|
additionalProps: {},
|
|
151
151
|
onDocumentCreated: { type: Function }
|
|
152
152
|
},
|
|
153
|
-
setup(
|
|
154
|
-
const e =
|
|
155
|
-
|
|
153
|
+
setup(s) {
|
|
154
|
+
const e = s, n = i(null);
|
|
155
|
+
l(() => {
|
|
156
156
|
window.addEventListener("message", o);
|
|
157
|
-
}),
|
|
157
|
+
}), m(() => {
|
|
158
158
|
window.removeEventListener("message", o);
|
|
159
159
|
});
|
|
160
|
-
const d =
|
|
161
|
-
const t = e.host || "https://app.documenso.com",
|
|
160
|
+
const d = u(() => {
|
|
161
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
162
162
|
encodeURIComponent(
|
|
163
163
|
JSON.stringify({
|
|
164
164
|
externalId: e.externalId,
|
|
@@ -170,27 +170,22 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
170
170
|
})
|
|
171
171
|
)
|
|
172
172
|
), a = new URL("/embed/v1/authoring/document/create", t);
|
|
173
|
-
return a.searchParams.set("token", e.presignToken), a.hash =
|
|
173
|
+
return a.searchParams.set("token", e.presignToken), a.hash = c, a.toString();
|
|
174
174
|
});
|
|
175
175
|
function o(t) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
documentId: t.data.documentId,
|
|
181
|
-
externalId: t.data.externalId
|
|
182
|
-
});
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
176
|
+
n.value?.contentWindow === t.source && t.data.type === "document-created" && e.onDocumentCreated?.({
|
|
177
|
+
documentId: t.data.documentId,
|
|
178
|
+
externalId: t.data.externalId
|
|
179
|
+
});
|
|
185
180
|
}
|
|
186
|
-
return (t,
|
|
181
|
+
return (t, c) => (p(), f("iframe", {
|
|
187
182
|
ref_key: "__iframe",
|
|
188
|
-
ref:
|
|
189
|
-
class:
|
|
183
|
+
ref: n,
|
|
184
|
+
class: k(s.className),
|
|
190
185
|
src: d.value
|
|
191
186
|
}, null, 10, y));
|
|
192
187
|
}
|
|
193
|
-
}), D = ["src"],
|
|
188
|
+
}), D = ["src"], N = /* @__PURE__ */ r({
|
|
194
189
|
__name: "create-template",
|
|
195
190
|
props: {
|
|
196
191
|
className: {},
|
|
@@ -204,15 +199,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
204
199
|
additionalProps: {},
|
|
205
200
|
onTemplateCreated: { type: Function }
|
|
206
201
|
},
|
|
207
|
-
setup(
|
|
208
|
-
const e =
|
|
209
|
-
|
|
202
|
+
setup(s) {
|
|
203
|
+
const e = s, n = i(null);
|
|
204
|
+
l(() => {
|
|
210
205
|
window.addEventListener("message", o);
|
|
211
|
-
}),
|
|
206
|
+
}), m(() => {
|
|
212
207
|
window.removeEventListener("message", o);
|
|
213
208
|
});
|
|
214
|
-
const d =
|
|
215
|
-
const t = e.host || "https://app.documenso.com",
|
|
209
|
+
const d = u(() => {
|
|
210
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
216
211
|
encodeURIComponent(
|
|
217
212
|
JSON.stringify({
|
|
218
213
|
externalId: e.externalId,
|
|
@@ -224,27 +219,22 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
224
219
|
})
|
|
225
220
|
)
|
|
226
221
|
), a = new URL("/embed/v1/authoring/template/create", t);
|
|
227
|
-
return a.searchParams.set("token", e.presignToken), a.hash =
|
|
222
|
+
return a.searchParams.set("token", e.presignToken), a.hash = c, a.toString();
|
|
228
223
|
});
|
|
229
224
|
function o(t) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
templateId: t.data.templateId,
|
|
235
|
-
externalId: t.data.externalId
|
|
236
|
-
});
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
225
|
+
n.value?.contentWindow === t.source && t.data.type === "template-created" && e.onTemplateCreated?.({
|
|
226
|
+
templateId: t.data.templateId,
|
|
227
|
+
externalId: t.data.externalId
|
|
228
|
+
});
|
|
239
229
|
}
|
|
240
|
-
return (t,
|
|
230
|
+
return (t, c) => (p(), f("iframe", {
|
|
241
231
|
ref_key: "__iframe",
|
|
242
|
-
ref:
|
|
243
|
-
class:
|
|
232
|
+
ref: n,
|
|
233
|
+
class: k(s.className),
|
|
244
234
|
src: d.value
|
|
245
235
|
}, null, 10, D));
|
|
246
236
|
}
|
|
247
|
-
}), g = ["src"],
|
|
237
|
+
}), g = ["src"], R = /* @__PURE__ */ r({
|
|
248
238
|
__name: "update-document",
|
|
249
239
|
props: {
|
|
250
240
|
className: {},
|
|
@@ -260,15 +250,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
260
250
|
additionalProps: {},
|
|
261
251
|
onDocumentUpdated: { type: Function }
|
|
262
252
|
},
|
|
263
|
-
setup(
|
|
264
|
-
const e =
|
|
265
|
-
|
|
253
|
+
setup(s) {
|
|
254
|
+
const e = s, n = i(null);
|
|
255
|
+
l(() => {
|
|
266
256
|
window.addEventListener("message", o);
|
|
267
|
-
}),
|
|
257
|
+
}), m(() => {
|
|
268
258
|
window.removeEventListener("message", o);
|
|
269
259
|
});
|
|
270
|
-
const d =
|
|
271
|
-
const t = e.host || "https://app.documenso.com",
|
|
260
|
+
const d = u(() => {
|
|
261
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
272
262
|
encodeURIComponent(
|
|
273
263
|
JSON.stringify({
|
|
274
264
|
token: e.presignToken,
|
|
@@ -285,27 +275,22 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
285
275
|
`/embed/v1/authoring/document/edit/${e.documentId}`,
|
|
286
276
|
t
|
|
287
277
|
);
|
|
288
|
-
return a.searchParams.set("token", e.presignToken), a.hash =
|
|
278
|
+
return a.searchParams.set("token", e.presignToken), a.hash = c, a.toString();
|
|
289
279
|
});
|
|
290
280
|
function o(t) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
documentId: t.data.documentId,
|
|
296
|
-
externalId: t.data.externalId
|
|
297
|
-
});
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
281
|
+
n.value?.contentWindow === t.source && t.data.type === "document-updated" && e.onDocumentUpdated?.({
|
|
282
|
+
documentId: t.data.documentId,
|
|
283
|
+
externalId: t.data.externalId
|
|
284
|
+
});
|
|
300
285
|
}
|
|
301
|
-
return (t,
|
|
286
|
+
return (t, c) => (p(), f("iframe", {
|
|
302
287
|
ref_key: "__iframe",
|
|
303
|
-
ref:
|
|
304
|
-
class:
|
|
288
|
+
ref: n,
|
|
289
|
+
class: k(s.className),
|
|
305
290
|
src: d.value
|
|
306
291
|
}, null, 10, g));
|
|
307
292
|
}
|
|
308
|
-
}), w = ["src"],
|
|
293
|
+
}), w = ["src"], F = /* @__PURE__ */ r({
|
|
309
294
|
__name: "update-template",
|
|
310
295
|
props: {
|
|
311
296
|
className: {},
|
|
@@ -321,15 +306,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
321
306
|
additionalProps: {},
|
|
322
307
|
onTemplateUpdated: { type: Function }
|
|
323
308
|
},
|
|
324
|
-
setup(
|
|
325
|
-
const e =
|
|
326
|
-
|
|
309
|
+
setup(s) {
|
|
310
|
+
const e = s, n = i(null);
|
|
311
|
+
l(() => {
|
|
327
312
|
window.addEventListener("message", o);
|
|
328
|
-
}),
|
|
313
|
+
}), m(() => {
|
|
329
314
|
window.removeEventListener("message", o);
|
|
330
315
|
});
|
|
331
|
-
const d =
|
|
332
|
-
const t = e.host || "https://app.documenso.com",
|
|
316
|
+
const d = u(() => {
|
|
317
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
333
318
|
encodeURIComponent(
|
|
334
319
|
JSON.stringify({
|
|
335
320
|
externalId: e.externalId,
|
|
@@ -345,23 +330,18 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
345
330
|
`/embed/v1/authoring/template/edit/${e.templateId}`,
|
|
346
331
|
t
|
|
347
332
|
);
|
|
348
|
-
return a.searchParams.set("token", e.presignToken), a.hash =
|
|
333
|
+
return a.searchParams.set("token", e.presignToken), a.hash = c, a.toString();
|
|
349
334
|
});
|
|
350
335
|
function o(t) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
templateId: t.data.templateId,
|
|
356
|
-
externalId: t.data.externalId
|
|
357
|
-
});
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
336
|
+
n.value?.contentWindow === t.source && t.data.type === "template-updated" && e.onTemplateUpdated?.({
|
|
337
|
+
templateId: t.data.templateId,
|
|
338
|
+
externalId: t.data.externalId
|
|
339
|
+
});
|
|
360
340
|
}
|
|
361
|
-
return (t,
|
|
341
|
+
return (t, c) => (p(), f("iframe", {
|
|
362
342
|
ref_key: "__iframe",
|
|
363
|
-
ref:
|
|
364
|
-
class:
|
|
343
|
+
ref: n,
|
|
344
|
+
class: k(s.className),
|
|
365
345
|
src: d.value
|
|
366
346
|
}, null, 10, w));
|
|
367
347
|
}
|
|
@@ -384,15 +364,15 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
384
364
|
onDocumentRejected: { type: Function },
|
|
385
365
|
onAllDocumentsCompleted: { type: Function }
|
|
386
366
|
},
|
|
387
|
-
setup(
|
|
388
|
-
const e =
|
|
389
|
-
|
|
367
|
+
setup(s) {
|
|
368
|
+
const e = s, n = i(null);
|
|
369
|
+
l(() => {
|
|
390
370
|
window.addEventListener("message", o);
|
|
391
|
-
}),
|
|
371
|
+
}), m(() => {
|
|
392
372
|
window.removeEventListener("message", o);
|
|
393
373
|
});
|
|
394
|
-
const d =
|
|
395
|
-
const t = e.host || "https://app.documenso.com",
|
|
374
|
+
const d = u(() => {
|
|
375
|
+
const t = e.host || "https://app.documenso.com", c = btoa(
|
|
396
376
|
encodeURIComponent(
|
|
397
377
|
JSON.stringify({
|
|
398
378
|
name: e.name,
|
|
@@ -405,12 +385,12 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
405
385
|
})
|
|
406
386
|
)
|
|
407
387
|
), a = new URL("/embed/v1/multisign", t);
|
|
408
|
-
for (const
|
|
409
|
-
a.searchParams.append("token",
|
|
410
|
-
return `${a}#${
|
|
388
|
+
for (const _ of e.tokens)
|
|
389
|
+
a.searchParams.append("token", _);
|
|
390
|
+
return `${a}#${c}`;
|
|
411
391
|
});
|
|
412
392
|
function o(t) {
|
|
413
|
-
if (
|
|
393
|
+
if (n.value?.contentWindow === t.source)
|
|
414
394
|
switch (t.data.action) {
|
|
415
395
|
case "document-ready":
|
|
416
396
|
e.onDocumentReady?.();
|
|
@@ -429,24 +409,24 @@ const b = ["src"], U = /* @__PURE__ */ r({
|
|
|
429
409
|
break;
|
|
430
410
|
}
|
|
431
411
|
}
|
|
432
|
-
return (t,
|
|
412
|
+
return (t, c) => (p(), f("iframe", {
|
|
433
413
|
ref_key: "__iframe",
|
|
434
|
-
ref:
|
|
435
|
-
class:
|
|
414
|
+
ref: n,
|
|
415
|
+
class: k(s.className),
|
|
436
416
|
src: d.value
|
|
437
417
|
}, null, 10, I));
|
|
438
418
|
}
|
|
439
419
|
});
|
|
440
420
|
export {
|
|
441
|
-
|
|
442
|
-
|
|
421
|
+
M as EmbedCreateDocumentV1,
|
|
422
|
+
N as EmbedCreateTemplateV1,
|
|
443
423
|
U as EmbedDirectTemplate,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
424
|
+
x as EmbedSignDocument,
|
|
425
|
+
R as EmbedUpdateDocumentV1,
|
|
426
|
+
F as EmbedUpdateTemplateV1,
|
|
427
|
+
M as unstable_EmbedCreateDocument,
|
|
428
|
+
N as unstable_EmbedCreateTemplate,
|
|
449
429
|
C as unstable_EmbedMultiSignDocument,
|
|
450
|
-
|
|
451
|
-
|
|
430
|
+
R as unstable_EmbedUpdateDocument,
|
|
431
|
+
F as unstable_EmbedUpdateTemplate
|
|
452
432
|
};
|
|
@@ -33,14 +33,7 @@ export type EmbedMultiSignDocumentProps = {
|
|
|
33
33
|
}>;
|
|
34
34
|
}) => void;
|
|
35
35
|
};
|
|
36
|
-
declare const _default: import('vue').DefineComponent<
|
|
36
|
+
declare const _default: import('vue').DefineComponent<EmbedMultiSignDocumentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedMultiSignDocumentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
37
|
+
__iframe: HTMLIFrameElement;
|
|
38
|
+
}, HTMLIFrameElement>;
|
|
37
39
|
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
|
-
};
|
|
@@ -24,14 +24,7 @@ export type EmbedSignDocumentProps = {
|
|
|
24
24
|
reason: string;
|
|
25
25
|
}) => void;
|
|
26
26
|
};
|
|
27
|
-
declare const _default: import('vue').DefineComponent<
|
|
27
|
+
declare const _default: import('vue').DefineComponent<EmbedSignDocumentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedSignDocumentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
28
|
+
__iframe: HTMLIFrameElement;
|
|
29
|
+
}, HTMLIFrameElement>;
|
|
28
30
|
export default _default;
|
|
29
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
-
type __VLS_TypePropsToOption<T> = {
|
|
31
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
-
} : {
|
|
34
|
-
type: import('vue').PropType<T[K]>;
|
|
35
|
-
required: true;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
@@ -23,14 +23,7 @@ export type EmbedUpdateDocumentProps = {
|
|
|
23
23
|
documentId: number;
|
|
24
24
|
}) => void;
|
|
25
25
|
};
|
|
26
|
-
declare const _default: import('vue').DefineComponent<
|
|
26
|
+
declare const _default: import('vue').DefineComponent<EmbedUpdateDocumentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedUpdateDocumentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
27
|
+
__iframe: HTMLIFrameElement;
|
|
28
|
+
}, HTMLIFrameElement>;
|
|
27
29
|
export default _default;
|
|
28
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
29
|
-
type __VLS_TypePropsToOption<T> = {
|
|
30
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
31
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
32
|
-
} : {
|
|
33
|
-
type: import('vue').PropType<T[K]>;
|
|
34
|
-
required: true;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
@@ -23,14 +23,7 @@ export type EmbedUpdateTemplateProps = {
|
|
|
23
23
|
templateId: number;
|
|
24
24
|
}) => void;
|
|
25
25
|
};
|
|
26
|
-
declare const _default: import('vue').DefineComponent<
|
|
26
|
+
declare const _default: import('vue').DefineComponent<EmbedUpdateTemplateProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmbedUpdateTemplateProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
27
|
+
__iframe: HTMLIFrameElement;
|
|
28
|
+
}, HTMLIFrameElement>;
|
|
27
29
|
export default _default;
|
|
28
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
29
|
-
type __VLS_TypePropsToOption<T> = {
|
|
30
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
31
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
32
|
-
} : {
|
|
33
|
-
type: import('vue').PropType<T[K]>;
|
|
34
|
-
required: true;
|
|
35
|
-
};
|
|
36
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@documenso/embed-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -36,9 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@documenso/embed": "*",
|
|
39
|
-
"@vitejs/plugin-vue": "^5.
|
|
40
|
-
"unplugin-auto-import": "^0.18.
|
|
41
|
-
"vite": "7.0.
|
|
42
|
-
"vite-plugin-dts": "^4.
|
|
39
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
40
|
+
"unplugin-auto-import": "^0.18.0",
|
|
41
|
+
"vite": "^7.0.0",
|
|
42
|
+
"vite-plugin-dts": "^4.0.0",
|
|
43
|
+
"vue": "^3.0.0"
|
|
43
44
|
}
|
|
44
45
|
}
|