@documenso/embed-vue 0.2.0-rc.0 → 0.2.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.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),k=["src"],f=o.defineComponent({__name:"direct-template",props:{className:{},host:{},token:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},email:{},lockEmail:{type:Boolean},name:{},lockName:{type:Boolean},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function},onFieldSigned:{type:Function},onFieldUnsigned:{type:Function}},setup(m){const e=m,c=o.ref();o.onMounted(()=>{window.addEventListener("message",s)}),o.onUnmounted(()=>{window.removeEventListener("message",s)});const i=o.computed(()=>{const n=e.host||"https://app.documenso.com",t=btoa(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled})),a=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${t}`});function s(n){var t,a,d,r,l,u;if(((t=c.value)==null?void 0:t.contentWindow)===n.source)switch(n.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(d=e.onDocumentCompleted)==null||d.call(e,n.data.data);break;case"document-error":(r=e.onDocumentError)==null||r.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,t)=>(o.openBlock(),o.createElementBlock("iframe",{ref_key:"__iframe",ref:c,class:o.normalizeClass(n.className),src:i.value},null,10,k))}}),y=["src"],_=o.defineComponent({__name:"sign-document",props:{className:{},host:{},token:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},name:{},lockName:{type:Boolean},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function}},setup(m){const e=m,c=o.ref();o.onMounted(()=>{window.addEventListener("message",s)}),o.onUnmounted(()=>{window.removeEventListener("message",s)});const i=o.computed(()=>{const n=e.host||"https://app.documenso.com",t=btoa(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled}));return`${new URL(`/embed/sign/${e.token}`,n)}#${t}`});function s(n){var t,a,d,r;if(((t=c.value)==null?void 0:t.contentWindow)===n.source)switch(n.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(d=e.onDocumentCompleted)==null||d.call(e,n.data.data);break;case"document-error":(r=e.onDocumentError)==null||r.call(e,n.data.data);break}}return(n,t)=>(o.openBlock(),o.createElementBlock("iframe",{ref_key:"__iframe",ref:c,class:o.normalizeClass(n.className),src:i.value},null,10,y))}});exports.EmbedDirectTemplate=f;exports.EmbedSignDocument=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),k=["src"],f=o.defineComponent({__name:"direct-template",props:{className:{},host:{},token:{},externalId:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},email:{},lockEmail:{type:Boolean},name:{},lockName:{type:Boolean},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function},onFieldSigned:{type:Function},onFieldUnsigned:{type:Function}},setup(m){const e=m,c=o.ref();o.onMounted(()=>{window.addEventListener("message",s)}),o.onUnmounted(()=>{window.removeEventListener("message",s)});const i=o.computed(()=>{const n=e.host||"https://app.documenso.com",t=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}))),a=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${t}`});function s(n){var t,a,d,r,l,u;if(((t=c.value)==null?void 0:t.contentWindow)===n.source)switch(n.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(d=e.onDocumentCompleted)==null||d.call(e,n.data.data);break;case"document-error":(r=e.onDocumentError)==null||r.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,t)=>(o.openBlock(),o.createElementBlock("iframe",{ref_key:"__iframe",ref:c,class:o.normalizeClass(n.className),src:i.value},null,10,k))}}),y=["src"],_=o.defineComponent({__name:"sign-document",props:{className:{},host:{},token:{},css:{},cssVars:{},darkModeDisabled:{type:Boolean},name:{},lockName:{type:Boolean},onDocumentReady:{type:Function},onDocumentCompleted:{type:Function},onDocumentError:{type:Function}},setup(m){const e=m,c=o.ref();o.onMounted(()=>{window.addEventListener("message",s)}),o.onUnmounted(()=>{window.removeEventListener("message",s)});const i=o.computed(()=>{const n=e.host||"https://app.documenso.com",t=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled})));return`${new URL(`/embed/sign/${e.token}`,n)}#${t}`});function s(n){var t,a,d,r;if(((t=c.value)==null?void 0:t.contentWindow)===n.source)switch(n.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(d=e.onDocumentCompleted)==null||d.call(e,n.data.data);break;case"document-error":(r=e.onDocumentError)==null||r.call(e,n.data.data);break}}return(n,t)=>(o.openBlock(),o.createElementBlock("iframe",{ref_key:"__iframe",ref:c,class:o.normalizeClass(n.className),src:i.value},null,10,y))}});exports.EmbedDirectTemplate=f;exports.EmbedSignDocument=_;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as u, ref as k, onMounted as f, onUnmounted as _, computed as y, openBlock as b, createElementBlock as D, normalizeClass as g } from "vue";
2
- const p = ["src"], E = /* @__PURE__ */ u({
1
+ import { defineComponent as u, ref as k, onMounted as f, onUnmounted as _, computed as y, openBlock as b, createElementBlock as D, normalizeClass as p } from "vue";
2
+ const g = ["src"], E = /* @__PURE__ */ u({
3
3
  __name: "direct-template",
4
4
  props: {
5
5
  className: {},
@@ -22,33 +22,35 @@ const p = ["src"], E = /* @__PURE__ */ u({
22
22
  setup(r) {
23
23
  const e = r, t = k();
24
24
  f(() => {
25
- window.addEventListener("message", s);
25
+ window.addEventListener("message", c);
26
26
  }), _(() => {
27
- window.removeEventListener("message", s);
27
+ window.removeEventListener("message", c);
28
28
  });
29
29
  const m = y(() => {
30
- const n = e.host || "https://app.documenso.com", a = btoa(
31
- JSON.stringify({
32
- name: e.name,
33
- lockName: e.lockName,
34
- email: e.email,
35
- lockEmail: e.lockEmail,
36
- css: e.css,
37
- cssVars: e.cssVars,
38
- darkModeDisabled: e.darkModeDisabled
39
- })
40
- ), o = new URL(`/embed/direct/${e.token}`, n);
41
- return e.externalId && o.searchParams.set("externalId", e.externalId), `${o}#${a}`;
30
+ const n = e.host || "https://app.documenso.com", o = btoa(
31
+ encodeURIComponent(
32
+ JSON.stringify({
33
+ name: e.name,
34
+ lockName: e.lockName,
35
+ email: e.email,
36
+ lockEmail: e.lockEmail,
37
+ css: e.css,
38
+ cssVars: e.cssVars,
39
+ darkModeDisabled: e.darkModeDisabled
40
+ })
41
+ )
42
+ ), a = new URL(`/embed/direct/${e.token}`, n);
43
+ return e.externalId && a.searchParams.set("externalId", e.externalId), `${a}#${o}`;
42
44
  });
43
- function s(n) {
44
- var a, o, c, d, i, l;
45
- if (((a = t.value) == null ? void 0 : a.contentWindow) === n.source)
45
+ function c(n) {
46
+ var o, a, s, d, i, l;
47
+ if (((o = t.value) == null ? void 0 : o.contentWindow) === n.source)
46
48
  switch (n.data.action) {
47
49
  case "document-ready":
48
- (o = e.onDocumentReady) == null || o.call(e);
50
+ (a = e.onDocumentReady) == null || a.call(e);
49
51
  break;
50
52
  case "document-completed":
51
- (c = e.onDocumentCompleted) == null || c.call(e, n.data.data);
53
+ (s = e.onDocumentCompleted) == null || s.call(e, n.data.data);
52
54
  break;
53
55
  case "document-error":
54
56
  (d = e.onDocumentError) == null || d.call(e, n.data.data);
@@ -61,12 +63,12 @@ const p = ["src"], E = /* @__PURE__ */ u({
61
63
  break;
62
64
  }
63
65
  }
64
- return (n, a) => (b(), D("iframe", {
66
+ return (n, o) => (b(), D("iframe", {
65
67
  ref_key: "__iframe",
66
68
  ref: t,
67
- class: g(n.className),
69
+ class: p(n.className),
68
70
  src: m.value
69
- }, null, 10, p));
71
+ }, null, 10, g));
70
72
  }
71
73
  }), h = ["src"], F = /* @__PURE__ */ u({
72
74
  __name: "sign-document",
@@ -86,41 +88,43 @@ const p = ["src"], E = /* @__PURE__ */ u({
86
88
  setup(r) {
87
89
  const e = r, t = k();
88
90
  f(() => {
89
- window.addEventListener("message", s);
91
+ window.addEventListener("message", c);
90
92
  }), _(() => {
91
- window.removeEventListener("message", s);
93
+ window.removeEventListener("message", c);
92
94
  });
93
95
  const m = y(() => {
94
- const n = e.host || "https://app.documenso.com", a = btoa(
95
- JSON.stringify({
96
- name: e.name,
97
- lockName: e.lockName,
98
- css: e.css,
99
- cssVars: e.cssVars,
100
- darkModeDisabled: e.darkModeDisabled
101
- })
96
+ const n = e.host || "https://app.documenso.com", o = btoa(
97
+ encodeURIComponent(
98
+ JSON.stringify({
99
+ name: e.name,
100
+ lockName: e.lockName,
101
+ css: e.css,
102
+ cssVars: e.cssVars,
103
+ darkModeDisabled: e.darkModeDisabled
104
+ })
105
+ )
102
106
  );
103
- return `${new URL(`/embed/sign/${e.token}`, n)}#${a}`;
107
+ return `${new URL(`/embed/sign/${e.token}`, n)}#${o}`;
104
108
  });
105
- function s(n) {
106
- var a, o, c, d;
107
- if (((a = t.value) == null ? void 0 : a.contentWindow) === n.source)
109
+ function c(n) {
110
+ var o, a, s, d;
111
+ if (((o = t.value) == null ? void 0 : o.contentWindow) === n.source)
108
112
  switch (n.data.action) {
109
113
  case "document-ready":
110
- (o = e.onDocumentReady) == null || o.call(e);
114
+ (a = e.onDocumentReady) == null || a.call(e);
111
115
  break;
112
116
  case "document-completed":
113
- (c = e.onDocumentCompleted) == null || c.call(e, n.data.data);
117
+ (s = e.onDocumentCompleted) == null || s.call(e, n.data.data);
114
118
  break;
115
119
  case "document-error":
116
120
  (d = e.onDocumentError) == null || d.call(e, n.data.data);
117
121
  break;
118
122
  }
119
123
  }
120
- return (n, a) => (b(), D("iframe", {
124
+ return (n, o) => (b(), D("iframe", {
121
125
  ref_key: "__iframe",
122
126
  ref: t,
123
- class: g(n.className),
127
+ class: p(n.className),
124
128
  src: m.value
125
129
  }, null, 10, h));
126
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-vue",
3
- "version": "0.2.0-rc.0",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"