@documenso/embed-vue 0.2.0 → 0.2.1-rc.1
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 +34 -0
- package/dist/create-template.vue.d.ts +34 -0
- package/dist/direct-template.vue.d.ts +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +173 -49
- package/dist/sign-document.vue.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CssVars } from './css-vars';
|
|
2
|
+
export type EmbedCreateDocumentProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
host?: string;
|
|
5
|
+
presignToken: string;
|
|
6
|
+
externalId?: string;
|
|
7
|
+
css?: string | undefined;
|
|
8
|
+
cssVars?: (CssVars & Record<string, string>) | undefined;
|
|
9
|
+
darkModeDisabled?: boolean | undefined;
|
|
10
|
+
features?: {
|
|
11
|
+
allowConfigureSignatureTypes?: boolean;
|
|
12
|
+
allowConfigureLanguage?: boolean;
|
|
13
|
+
allowConfigureDateFormat?: boolean;
|
|
14
|
+
allowConfigureTimezone?: boolean;
|
|
15
|
+
allowConfigureRedirectUrl?: boolean;
|
|
16
|
+
allowConfigureCommunication?: boolean;
|
|
17
|
+
};
|
|
18
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
19
|
+
onDocumentCreated?: (data: {
|
|
20
|
+
externalId: string;
|
|
21
|
+
documentId: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
};
|
|
24
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<EmbedCreateDocumentProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToOption<EmbedCreateDocumentProps>>>, {}, {}>;
|
|
25
|
+
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
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CssVars } from './css-vars';
|
|
2
|
+
export type EmbedCreateTemplateProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
host?: string;
|
|
5
|
+
presignToken: string;
|
|
6
|
+
externalId?: string;
|
|
7
|
+
css?: string | undefined;
|
|
8
|
+
cssVars?: (CssVars & Record<string, string>) | undefined;
|
|
9
|
+
darkModeDisabled?: boolean | undefined;
|
|
10
|
+
features?: {
|
|
11
|
+
allowConfigureSignatureTypes?: boolean;
|
|
12
|
+
allowConfigureLanguage?: boolean;
|
|
13
|
+
allowConfigureDateFormat?: boolean;
|
|
14
|
+
allowConfigureTimezone?: boolean;
|
|
15
|
+
allowConfigureRedirectUrl?: boolean;
|
|
16
|
+
allowConfigureCommunication?: boolean;
|
|
17
|
+
};
|
|
18
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
19
|
+
onTemplateCreated?: (data: {
|
|
20
|
+
externalId: string;
|
|
21
|
+
templateId: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
};
|
|
24
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<EmbedCreateTemplateProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToOption<EmbedCreateTemplateProps>>>, {}, {}>;
|
|
25
|
+
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
|
+
};
|
|
@@ -11,6 +11,7 @@ export type EmbedDirectTemplateProps = {
|
|
|
11
11
|
lockEmail?: boolean | undefined;
|
|
12
12
|
name?: string | undefined;
|
|
13
13
|
lockName?: boolean | undefined;
|
|
14
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
14
15
|
onDocumentReady?: () => void;
|
|
15
16
|
onDocumentCompleted?: (data: {
|
|
16
17
|
token: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default as EmbedDirectTemplate } from './direct-template.vue';
|
|
2
2
|
export { default as EmbedSignDocument } from './sign-document.vue';
|
|
3
|
+
export { default as unstable_EmbedCreateDocument } from './create-document.vue';
|
|
4
|
+
export { default as unstable_EmbedCreateTemplate } from './create-template.vue';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default as EmbedDirectTemplate } from './direct-template.vue';
|
|
2
2
|
export { default as EmbedSignDocument } from './sign-document.vue';
|
|
3
|
+
export { default as unstable_EmbedCreateDocument } from './create-document.vue';
|
|
4
|
+
export { default as unstable_EmbedCreateTemplate } from './create-template.vue';
|
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 t=require("vue"),p=["src"],f=t.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=t.ref();t.onMounted(()=>{window.addEventListener("message",c)}),t.onUnmounted(()=>{window.removeEventListener("message",c)});const r=t.computed(()=>{const n=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}`,n);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${o}`});function c(n){var o,a,m,i,l,u;if(((o=s.value)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(m=e.onDocumentCompleted)==null||m.call(e,n.data.data);break;case"document-error":(i=e.onDocumentError)==null||i.call(e,n.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(n,o)=>(t.openBlock(),t.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:t.normalizeClass(n.className),src:r.value},null,10,p))}}),k=["src"],_=t.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=t.ref();t.onMounted(()=>{window.addEventListener("message",c)}),t.onUnmounted(()=>{window.removeEventListener("message",c)});const r=t.computed(()=>{const n=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}`,n)}#${o}`});function c(n){var o,a,m,i,l;if(((o=s.value)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(m=e.onDocumentCompleted)==null||m.call(e,n.data.data);break;case"document-error":(i=e.onDocumentError)==null||i.call(e,n.data.data);break;case"document-rejected":(l=e.onDocumentRejected)==null||l.call(e,n.data.data);break}}return(n,o)=>(t.openBlock(),t.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:t.normalizeClass(n.className),src:r.value},null,10,k))}}),b=["src"],y=t.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=t.ref();t.onMounted(()=>{window.addEventListener("message",c)}),t.onUnmounted(()=>{window.removeEventListener("message",c)});const r=t.computed(()=>{const n=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})));return`${new URL("/embed/v1/authoring/document/create",n)}#${o}`});function c(n){var o,a;if(((o=s.value)==null?void 0:o.contentWindow)===n.source)switch(n.data.type){case"document-completed":(a=e.onDocumentCreated)==null||a.call(e,{documentId:n.data.documentId,externalId:n.data.externalId});break}}return(n,o)=>(t.openBlock(),t.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:t.normalizeClass(n.className),src:r.value},null,10,b))}}),D=["src"],g=t.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=t.ref();t.onMounted(()=>{window.addEventListener("message",c)}),t.onUnmounted(()=>{window.removeEventListener("message",c)});const r=t.computed(()=>{const n=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})));return`${new URL("/embed/v1/authoring/template/create",n)}#${o}`});function c(n){var o,a;if(((o=s.value)==null?void 0:o.contentWindow)===n.source)switch(n.data.type){case"template-completed":(a=e.onTemplateCreated)==null||a.call(e,{templateId:n.data.templateId,externalId:n.data.externalId});break}}return(n,o)=>(t.openBlock(),t.createElementBlock("iframe",{ref_key:"__iframe",ref:s,class:t.normalizeClass(n.className),src:r.value},null,10,D))}});exports.EmbedDirectTemplate=f;exports.EmbedSignDocument=_;exports.unstable_EmbedCreateDocument=y;exports.unstable_EmbedCreateTemplate=g;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const g = ["src"],
|
|
1
|
+
import { defineComponent as l, ref as u, onMounted as p, onUnmounted as _, computed as f, openBlock as k, createElementBlock as b, normalizeClass as y } from "vue";
|
|
2
|
+
const g = ["src"], N = /* @__PURE__ */ l({
|
|
3
3
|
__name: "direct-template",
|
|
4
4
|
props: {
|
|
5
5
|
className: {},
|
|
@@ -13,21 +13,22 @@ const g = ["src"], E = /* @__PURE__ */ u({
|
|
|
13
13
|
lockEmail: { type: Boolean },
|
|
14
14
|
name: {},
|
|
15
15
|
lockName: { type: Boolean },
|
|
16
|
+
additionalProps: {},
|
|
16
17
|
onDocumentReady: { type: Function },
|
|
17
18
|
onDocumentCompleted: { type: Function },
|
|
18
19
|
onDocumentError: { type: Function },
|
|
19
20
|
onFieldSigned: { type: Function },
|
|
20
21
|
onFieldUnsigned: { type: Function }
|
|
21
22
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const e =
|
|
24
|
-
|
|
25
|
-
window.addEventListener("message",
|
|
23
|
+
setup(c) {
|
|
24
|
+
const e = c, o = u();
|
|
25
|
+
p(() => {
|
|
26
|
+
window.addEventListener("message", s);
|
|
26
27
|
}), _(() => {
|
|
27
|
-
window.removeEventListener("message",
|
|
28
|
+
window.removeEventListener("message", s);
|
|
28
29
|
});
|
|
29
|
-
const
|
|
30
|
-
const
|
|
30
|
+
const d = f(() => {
|
|
31
|
+
const a = e.host || "https://app.documenso.com", n = btoa(
|
|
31
32
|
encodeURIComponent(
|
|
32
33
|
JSON.stringify({
|
|
33
34
|
name: e.name,
|
|
@@ -36,41 +37,42 @@ const g = ["src"], E = /* @__PURE__ */ u({
|
|
|
36
37
|
lockEmail: e.lockEmail,
|
|
37
38
|
css: e.css,
|
|
38
39
|
cssVars: e.cssVars,
|
|
39
|
-
darkModeDisabled: e.darkModeDisabled
|
|
40
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
41
|
+
...e.additionalProps
|
|
40
42
|
})
|
|
41
43
|
)
|
|
42
|
-
),
|
|
43
|
-
return e.externalId &&
|
|
44
|
+
), t = new URL(`/embed/direct/${e.token}`, a);
|
|
45
|
+
return e.externalId && t.searchParams.set("externalId", e.externalId), `${t}#${n}`;
|
|
44
46
|
});
|
|
45
|
-
function
|
|
46
|
-
var
|
|
47
|
-
if (((
|
|
48
|
-
switch (
|
|
47
|
+
function s(a) {
|
|
48
|
+
var n, t, r, i, m, D;
|
|
49
|
+
if (((n = o.value) == null ? void 0 : n.contentWindow) === a.source)
|
|
50
|
+
switch (a.data.action) {
|
|
49
51
|
case "document-ready":
|
|
50
|
-
(
|
|
52
|
+
(t = e.onDocumentReady) == null || t.call(e);
|
|
51
53
|
break;
|
|
52
54
|
case "document-completed":
|
|
53
|
-
(
|
|
55
|
+
(r = e.onDocumentCompleted) == null || r.call(e, a.data.data);
|
|
54
56
|
break;
|
|
55
57
|
case "document-error":
|
|
56
|
-
(
|
|
58
|
+
(i = e.onDocumentError) == null || i.call(e, a.data.data);
|
|
57
59
|
break;
|
|
58
60
|
case "field-signed":
|
|
59
|
-
(
|
|
61
|
+
(m = e.onFieldSigned) == null || m.call(e);
|
|
60
62
|
break;
|
|
61
63
|
case "field-unsigned":
|
|
62
|
-
(
|
|
64
|
+
(D = e.onFieldUnsigned) == null || D.call(e);
|
|
63
65
|
break;
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
|
-
return (
|
|
68
|
+
return (a, n) => (k(), b("iframe", {
|
|
67
69
|
ref_key: "__iframe",
|
|
68
|
-
ref:
|
|
69
|
-
class:
|
|
70
|
-
src:
|
|
70
|
+
ref: o,
|
|
71
|
+
class: y(a.className),
|
|
72
|
+
src: d.value
|
|
71
73
|
}, null, 10, g));
|
|
72
74
|
}
|
|
73
|
-
}), h = ["src"],
|
|
75
|
+
}), h = ["src"], U = /* @__PURE__ */ l({
|
|
74
76
|
__name: "sign-document",
|
|
75
77
|
props: {
|
|
76
78
|
className: {},
|
|
@@ -81,55 +83,177 @@ const g = ["src"], E = /* @__PURE__ */ u({
|
|
|
81
83
|
darkModeDisabled: { type: Boolean },
|
|
82
84
|
name: {},
|
|
83
85
|
lockName: { type: Boolean },
|
|
86
|
+
allowDocumentRejection: { type: Boolean },
|
|
87
|
+
additionalProps: {},
|
|
84
88
|
onDocumentReady: { type: Function },
|
|
85
89
|
onDocumentCompleted: { type: Function },
|
|
86
|
-
onDocumentError: { type: Function }
|
|
90
|
+
onDocumentError: { type: Function },
|
|
91
|
+
onDocumentRejected: { type: Function }
|
|
87
92
|
},
|
|
88
|
-
setup(
|
|
89
|
-
const e =
|
|
90
|
-
|
|
91
|
-
window.addEventListener("message",
|
|
93
|
+
setup(c) {
|
|
94
|
+
const e = c, o = u();
|
|
95
|
+
p(() => {
|
|
96
|
+
window.addEventListener("message", s);
|
|
92
97
|
}), _(() => {
|
|
93
|
-
window.removeEventListener("message",
|
|
98
|
+
window.removeEventListener("message", s);
|
|
94
99
|
});
|
|
95
|
-
const
|
|
96
|
-
const
|
|
100
|
+
const d = f(() => {
|
|
101
|
+
const a = e.host || "https://app.documenso.com", n = btoa(
|
|
97
102
|
encodeURIComponent(
|
|
98
103
|
JSON.stringify({
|
|
99
104
|
name: e.name,
|
|
100
105
|
lockName: e.lockName,
|
|
101
106
|
css: e.css,
|
|
102
107
|
cssVars: e.cssVars,
|
|
103
|
-
darkModeDisabled: e.darkModeDisabled
|
|
108
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
109
|
+
allowDocumentRejection: e.allowDocumentRejection,
|
|
110
|
+
...e.additionalProps
|
|
104
111
|
})
|
|
105
112
|
)
|
|
106
113
|
);
|
|
107
|
-
return `${new URL(`/embed/sign/${e.token}`,
|
|
114
|
+
return `${new URL(`/embed/sign/${e.token}`, a)}#${n}`;
|
|
108
115
|
});
|
|
109
|
-
function
|
|
110
|
-
var
|
|
111
|
-
if (((
|
|
112
|
-
switch (
|
|
116
|
+
function s(a) {
|
|
117
|
+
var n, t, r, i, m;
|
|
118
|
+
if (((n = o.value) == null ? void 0 : n.contentWindow) === a.source)
|
|
119
|
+
switch (a.data.action) {
|
|
113
120
|
case "document-ready":
|
|
114
|
-
(
|
|
121
|
+
(t = e.onDocumentReady) == null || t.call(e);
|
|
115
122
|
break;
|
|
116
123
|
case "document-completed":
|
|
117
|
-
(
|
|
124
|
+
(r = e.onDocumentCompleted) == null || r.call(e, a.data.data);
|
|
118
125
|
break;
|
|
119
126
|
case "document-error":
|
|
120
|
-
(
|
|
127
|
+
(i = e.onDocumentError) == null || i.call(e, a.data.data);
|
|
128
|
+
break;
|
|
129
|
+
case "document-rejected":
|
|
130
|
+
(m = e.onDocumentRejected) == null || m.call(e, a.data.data);
|
|
121
131
|
break;
|
|
122
132
|
}
|
|
123
133
|
}
|
|
124
|
-
return (
|
|
134
|
+
return (a, n) => (k(), b("iframe", {
|
|
125
135
|
ref_key: "__iframe",
|
|
126
|
-
ref:
|
|
127
|
-
class:
|
|
128
|
-
src:
|
|
136
|
+
ref: o,
|
|
137
|
+
class: y(a.className),
|
|
138
|
+
src: d.value
|
|
129
139
|
}, null, 10, h));
|
|
130
140
|
}
|
|
141
|
+
}), w = ["src"], M = /* @__PURE__ */ l({
|
|
142
|
+
__name: "create-document",
|
|
143
|
+
props: {
|
|
144
|
+
className: {},
|
|
145
|
+
host: {},
|
|
146
|
+
presignToken: {},
|
|
147
|
+
externalId: {},
|
|
148
|
+
css: {},
|
|
149
|
+
cssVars: {},
|
|
150
|
+
darkModeDisabled: { type: Boolean },
|
|
151
|
+
features: {},
|
|
152
|
+
additionalProps: {},
|
|
153
|
+
onDocumentCreated: { type: Function }
|
|
154
|
+
},
|
|
155
|
+
setup(c) {
|
|
156
|
+
const e = c, o = u();
|
|
157
|
+
p(() => {
|
|
158
|
+
window.addEventListener("message", s);
|
|
159
|
+
}), _(() => {
|
|
160
|
+
window.removeEventListener("message", s);
|
|
161
|
+
});
|
|
162
|
+
const d = f(() => {
|
|
163
|
+
const a = e.host || "https://app.documenso.com", n = btoa(
|
|
164
|
+
encodeURIComponent(
|
|
165
|
+
JSON.stringify({
|
|
166
|
+
token: e.presignToken,
|
|
167
|
+
externalId: e.externalId,
|
|
168
|
+
features: e.features,
|
|
169
|
+
css: e.css,
|
|
170
|
+
cssVars: e.cssVars,
|
|
171
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
172
|
+
...e.additionalProps
|
|
173
|
+
})
|
|
174
|
+
)
|
|
175
|
+
);
|
|
176
|
+
return `${new URL("/embed/v1/authoring/document/create", a)}#${n}`;
|
|
177
|
+
});
|
|
178
|
+
function s(a) {
|
|
179
|
+
var n, t;
|
|
180
|
+
if (((n = o.value) == null ? void 0 : n.contentWindow) === a.source)
|
|
181
|
+
switch (a.data.type) {
|
|
182
|
+
case "document-completed":
|
|
183
|
+
(t = e.onDocumentCreated) == null || t.call(e, {
|
|
184
|
+
documentId: a.data.documentId,
|
|
185
|
+
externalId: a.data.externalId
|
|
186
|
+
});
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return (a, n) => (k(), b("iframe", {
|
|
191
|
+
ref_key: "__iframe",
|
|
192
|
+
ref: o,
|
|
193
|
+
class: y(a.className),
|
|
194
|
+
src: d.value
|
|
195
|
+
}, null, 10, w));
|
|
196
|
+
}
|
|
197
|
+
}), I = ["src"], R = /* @__PURE__ */ l({
|
|
198
|
+
__name: "create-template",
|
|
199
|
+
props: {
|
|
200
|
+
className: {},
|
|
201
|
+
host: {},
|
|
202
|
+
presignToken: {},
|
|
203
|
+
externalId: {},
|
|
204
|
+
css: {},
|
|
205
|
+
cssVars: {},
|
|
206
|
+
darkModeDisabled: { type: Boolean },
|
|
207
|
+
features: {},
|
|
208
|
+
additionalProps: {},
|
|
209
|
+
onTemplateCreated: { type: Function }
|
|
210
|
+
},
|
|
211
|
+
setup(c) {
|
|
212
|
+
const e = c, o = u();
|
|
213
|
+
p(() => {
|
|
214
|
+
window.addEventListener("message", s);
|
|
215
|
+
}), _(() => {
|
|
216
|
+
window.removeEventListener("message", s);
|
|
217
|
+
});
|
|
218
|
+
const d = f(() => {
|
|
219
|
+
const a = e.host || "https://app.documenso.com", n = btoa(
|
|
220
|
+
encodeURIComponent(
|
|
221
|
+
JSON.stringify({
|
|
222
|
+
token: e.presignToken,
|
|
223
|
+
externalId: e.externalId,
|
|
224
|
+
features: e.features,
|
|
225
|
+
css: e.css,
|
|
226
|
+
cssVars: e.cssVars,
|
|
227
|
+
darkModeDisabled: e.darkModeDisabled,
|
|
228
|
+
...e.additionalProps
|
|
229
|
+
})
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
return `${new URL("/embed/v1/authoring/template/create", a)}#${n}`;
|
|
233
|
+
});
|
|
234
|
+
function s(a) {
|
|
235
|
+
var n, t;
|
|
236
|
+
if (((n = o.value) == null ? void 0 : n.contentWindow) === a.source)
|
|
237
|
+
switch (a.data.type) {
|
|
238
|
+
case "template-completed":
|
|
239
|
+
(t = e.onTemplateCreated) == null || t.call(e, {
|
|
240
|
+
templateId: a.data.templateId,
|
|
241
|
+
externalId: a.data.externalId
|
|
242
|
+
});
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return (a, n) => (k(), b("iframe", {
|
|
247
|
+
ref_key: "__iframe",
|
|
248
|
+
ref: o,
|
|
249
|
+
class: y(a.className),
|
|
250
|
+
src: d.value
|
|
251
|
+
}, null, 10, I));
|
|
252
|
+
}
|
|
131
253
|
});
|
|
132
254
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
255
|
+
N as EmbedDirectTemplate,
|
|
256
|
+
U as EmbedSignDocument,
|
|
257
|
+
M as unstable_EmbedCreateDocument,
|
|
258
|
+
R as unstable_EmbedCreateTemplate
|
|
135
259
|
};
|
|
@@ -8,6 +8,8 @@ export type EmbedSignDocumentProps = {
|
|
|
8
8
|
darkModeDisabled?: boolean | undefined;
|
|
9
9
|
name?: string | undefined;
|
|
10
10
|
lockName?: boolean | undefined;
|
|
11
|
+
allowDocumentRejection?: boolean | undefined;
|
|
12
|
+
additionalProps?: Record<string, string | number | boolean> | undefined;
|
|
11
13
|
onDocumentReady?: () => void;
|
|
12
14
|
onDocumentCompleted?: (data: {
|
|
13
15
|
token: string;
|
|
@@ -15,6 +17,12 @@ export type EmbedSignDocumentProps = {
|
|
|
15
17
|
recipientId: number;
|
|
16
18
|
}) => void;
|
|
17
19
|
onDocumentError?: (error: string) => void;
|
|
20
|
+
onDocumentRejected?: (data: {
|
|
21
|
+
token: string;
|
|
22
|
+
documentId: number;
|
|
23
|
+
recipientId: number;
|
|
24
|
+
reason: string;
|
|
25
|
+
}) => void;
|
|
18
26
|
};
|
|
19
27
|
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<EmbedSignDocumentProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToOption<EmbedSignDocumentProps>>>, {}, {}>;
|
|
20
28
|
export default _default;
|