@documenso/embed-preact 0.2.1-rc.2 → 0.2.2

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 CHANGED
@@ -2,3 +2,5 @@ export { default as EmbedDirectTemplate } from './direct-template';
2
2
  export { default as EmbedSignDocument } from './sign-document';
3
3
  export { default as unstable_EmbedCreateDocument } from './create-document';
4
4
  export { default as unstable_EmbedCreateTemplate } from './create-template';
5
+ export { default as unstable_EmbedUpdateDocument } from './update-document';
6
+ export { default as unstable_EmbedUpdateTemplate } from './update-template';
package/dist/index.d.ts CHANGED
@@ -2,3 +2,5 @@ export { default as EmbedDirectTemplate } from './direct-template';
2
2
  export { default as EmbedSignDocument } from './sign-document';
3
3
  export { default as unstable_EmbedCreateDocument } from './create-document';
4
4
  export { default as unstable_EmbedCreateTemplate } from './create-template';
5
+ export { default as unstable_EmbedUpdateDocument } from './update-document';
6
+ export { default as unstable_EmbedUpdateTemplate } from './update-template';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("preact"),s=require("preact/hooks");var b=0;function l(e,c,m,d,t,n){c||(c={});var a,i,o=c;if("ref"in o)for(i in o={},c)i=="ref"?a=c[i]:o[i]=c[i];var u={type:e,props:o,key:m,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--b,__i:-1,__u:0,__source:t,__self:n};return f.options.vnode&&f.options.vnode(u),u}function k(e){const c=s.useRef(null);function m(){const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${n}`}function d(t){var n,a,i,o,u,r;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(i=e.onDocumentCompleted)==null||i.call(e,t.data.data);break;case"document-error":(o=e.onDocumentError)==null||o.call(e,t.data.data);break;case"field-signed":(u=e.onFieldSigned)==null||u.call(e);break;case"field-unsigned":(r=e.onFieldUnsigned)==null||r.call(e);break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),l("iframe",{ref:c,className:e.className,src:m()})}function _(e){const c=s.useRef(null);function m(){const t=e.host||"https://app.documenso.com",n=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)}#${n}`}function d(t){var n,a,i,o,u;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(i=e.onDocumentCompleted)==null||i.call(e,t.data.data);break;case"document-error":(o=e.onDocumentError)==null||o.call(e,t.data.data);break;case"document-rejected":(u=e.onDocumentRejected)==null||u.call(e,t.data.data);break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),l("iframe",{ref:c,className:e.className,src:m()})}function w(e){const c=s.useRef(null);function m(){const t=e.host||"https://app.documenso.com",n=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",t)}#${n}`}function d(t){var n,a;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.type){case"document-created":(a=e.onDocumentCreated)==null||a.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),l("iframe",{ref:c,className:e.className,src:m()})}function g(e){const c=s.useRef(null);function m(){const t=e.host||"https://app.documenso.com",n=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",t)}#${n}`}function d(t){var n,a;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.type){case"template-created":(a=e.onTemplateCreated)==null||a.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),l("iframe",{ref:c,className:e.className,src:m()})}exports.EmbedDirectTemplate=k;exports.EmbedSignDocument=_;exports.unstable_EmbedCreateDocument=w;exports.unstable_EmbedCreateTemplate=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("preact"),s=require("preact/hooks");var b=0;function r(e,c,i,d,t,n){c||(c={});var a,o,m=c;if("ref"in m)for(o in m={},c)o=="ref"?a=c[o]:m[o]=c[o];var u={type:e,props:m,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--b,__i:-1,__u:0,__source:t,__self:n};return f.options.vnode&&f.options.vnode(u),u}function g(e){const c=s.useRef(null);function i(){const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&a.searchParams.set("externalId",e.externalId),`${a}#${n}`}function d(t){var n,a,o,m,u,l;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(o=e.onDocumentCompleted)==null||o.call(e,t.data.data);break;case"document-error":(m=e.onDocumentError)==null||m.call(e,t.data.data);break;case"field-signed":(u=e.onFieldSigned)==null||u.call(e);break;case"field-unsigned":(l=e.onFieldUnsigned)==null||l.call(e);break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),r("iframe",{ref:c,className:e.className,src:i()})}function k(e){const c=s.useRef(null);function i(){const t=e.host||"https://app.documenso.com",n=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)}#${n}`}function d(t){var n,a,o,m,u;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(o=e.onDocumentCompleted)==null||o.call(e,t.data.data);break;case"document-error":(m=e.onDocumentError)==null||m.call(e,t.data.data);break;case"document-rejected":(u=e.onDocumentRejected)==null||u.call(e,t.data.data);break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),r("iframe",{ref:c,className:e.className,src:i()})}function w(e){const c=s.useRef(null);function i(){const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL("/embed/v1/authoring/document/create",t);return a.searchParams.set("token",e.presignToken),a.hash=n,a.toString()}function d(t){var n,a;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.type){case"document-created":(a=e.onDocumentCreated)==null||a.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),r("iframe",{ref:c,className:e.className,src:i()})}function h(e){const c=s.useRef(null);function i(){const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL("/embed/v1/authoring/template/create",t);return a.searchParams.set("token",e.presignToken),a.hash=n,a.toString()}function d(t){var n,a;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.type){case"template-created":(a=e.onTemplateCreated)==null||a.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),r("iframe",{ref:c,className:e.className,src:i()})}function E(e){const c=s.useRef(null);function i(){const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({token:e.presignToken,externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/document/edit/${e.documentId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=n,a.toString()}function d(t){var n,a;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.type){case"document-updated":(a=e.onDocumentUpdated)==null||a.call(e,{documentId:t.data.documentId,externalId:t.data.externalId});break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),r("iframe",{ref:c,className:e.className,src:i()})}function _(e){const c=s.useRef(null);function i(){const t=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({externalId:e.externalId,features:e.features,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),a=new URL(`/embed/v1/authoring/template/edit/${e.templateId}`,t);return a.searchParams.set("token",e.presignToken),a.hash=n,a.toString()}function d(t){var n,a;if(((n=c.current)==null?void 0:n.contentWindow)===t.source)switch(t.data.type){case"template-updated":(a=e.onTemplateUpdated)==null||a.call(e,{templateId:t.data.templateId,externalId:t.data.externalId});break}}return s.useEffect(()=>{window.addEventListener("message",d)},[]),s.useEffect(()=>()=>{window.removeEventListener("message",d)},[]),r("iframe",{ref:c,className:e.className,src:i()})}exports.EmbedDirectTemplate=g;exports.EmbedSignDocument=k;exports.unstable_EmbedCreateDocument=w;exports.unstable_EmbedCreateTemplate=h;exports.unstable_EmbedUpdateDocument=E;exports.unstable_EmbedUpdateTemplate=_;
package/dist/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
1
  import { options as b } from "preact";
2
- import { useRef as r, useEffect as l } from "preact/hooks";
2
+ import { useRef as l, useEffect as i } from "preact/hooks";
3
3
  var k = 0;
4
- function u(e, c, m, d, a, n) {
5
- c || (c = {});
6
- var t, i, s = c;
7
- if ("ref" in s) for (i in s = {}, c) i == "ref" ? t = c[i] : s[i] = c[i];
8
- var o = { type: e, props: s, key: m, ref: t, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --k, __i: -1, __u: 0, __source: a, __self: n };
9
- return b.vnode && b.vnode(o), o;
4
+ function u(e, d, s, c, a, n) {
5
+ d || (d = {});
6
+ var t, o, m = d;
7
+ if ("ref" in m) for (o in m = {}, d) o == "ref" ? t = d[o] : m[o] = d[o];
8
+ var r = { type: e, props: m, key: s, ref: t, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --k, __i: -1, __u: 0, __source: a, __self: n };
9
+ return b.vnode && b.vnode(r), r;
10
10
  }
11
- function g(e) {
12
- const c = r(null);
13
- function m() {
11
+ function h(e) {
12
+ const d = l(null);
13
+ function s() {
14
14
  const a = e.host || "https://app.documenso.com", n = btoa(
15
15
  encodeURIComponent(
16
16
  JSON.stringify({
@@ -27,36 +27,36 @@ function g(e) {
27
27
  ), t = new URL(`/embed/direct/${e.token}`, a);
28
28
  return e.externalId && t.searchParams.set("externalId", e.externalId), `${t}#${n}`;
29
29
  }
30
- function d(a) {
31
- var n, t, i, s, o, f;
32
- if (((n = c.current) == null ? void 0 : n.contentWindow) === a.source)
30
+ function c(a) {
31
+ var n, t, o, m, r, f;
32
+ if (((n = d.current) == null ? void 0 : n.contentWindow) === a.source)
33
33
  switch (a.data.action) {
34
34
  case "document-ready":
35
35
  (t = e.onDocumentReady) == null || t.call(e);
36
36
  break;
37
37
  case "document-completed":
38
- (i = e.onDocumentCompleted) == null || i.call(e, a.data.data);
38
+ (o = e.onDocumentCompleted) == null || o.call(e, a.data.data);
39
39
  break;
40
40
  case "document-error":
41
- (s = e.onDocumentError) == null || s.call(e, a.data.data);
41
+ (m = e.onDocumentError) == null || m.call(e, a.data.data);
42
42
  break;
43
43
  case "field-signed":
44
- (o = e.onFieldSigned) == null || o.call(e);
44
+ (r = e.onFieldSigned) == null || r.call(e);
45
45
  break;
46
46
  case "field-unsigned":
47
47
  (f = e.onFieldUnsigned) == null || f.call(e);
48
48
  break;
49
49
  }
50
50
  }
51
- return l(() => {
52
- window.addEventListener("message", d);
53
- }, []), l(() => () => {
54
- window.removeEventListener("message", d);
55
- }, []), /* @__PURE__ */ u("iframe", { ref: c, className: e.className, src: m() });
51
+ return i(() => {
52
+ window.addEventListener("message", c);
53
+ }, []), i(() => () => {
54
+ window.removeEventListener("message", c);
55
+ }, []), /* @__PURE__ */ u("iframe", { ref: d, className: e.className, src: s() });
56
56
  }
57
- function D(e) {
58
- const c = r(null);
59
- function m() {
57
+ function _(e) {
58
+ const d = l(null);
59
+ function s() {
60
60
  const a = e.host || "https://app.documenso.com", n = btoa(
61
61
  encodeURIComponent(
62
62
  JSON.stringify({
@@ -72,37 +72,36 @@ function D(e) {
72
72
  );
73
73
  return `${new URL(`/embed/sign/${e.token}`, a)}#${n}`;
74
74
  }
75
- function d(a) {
76
- var n, t, i, s, o;
77
- if (((n = c.current) == null ? void 0 : n.contentWindow) === a.source)
75
+ function c(a) {
76
+ var n, t, o, m, r;
77
+ if (((n = d.current) == null ? void 0 : n.contentWindow) === a.source)
78
78
  switch (a.data.action) {
79
79
  case "document-ready":
80
80
  (t = e.onDocumentReady) == null || t.call(e);
81
81
  break;
82
82
  case "document-completed":
83
- (i = e.onDocumentCompleted) == null || i.call(e, a.data.data);
83
+ (o = e.onDocumentCompleted) == null || o.call(e, a.data.data);
84
84
  break;
85
85
  case "document-error":
86
- (s = e.onDocumentError) == null || s.call(e, a.data.data);
86
+ (m = e.onDocumentError) == null || m.call(e, a.data.data);
87
87
  break;
88
88
  case "document-rejected":
89
- (o = e.onDocumentRejected) == null || o.call(e, a.data.data);
89
+ (r = e.onDocumentRejected) == null || r.call(e, a.data.data);
90
90
  break;
91
91
  }
92
92
  }
93
- return l(() => {
94
- window.addEventListener("message", d);
95
- }, []), l(() => () => {
96
- window.removeEventListener("message", d);
97
- }, []), /* @__PURE__ */ u("iframe", { ref: c, className: e.className, src: m() });
93
+ return i(() => {
94
+ window.addEventListener("message", c);
95
+ }, []), i(() => () => {
96
+ window.removeEventListener("message", c);
97
+ }, []), /* @__PURE__ */ u("iframe", { ref: d, className: e.className, src: s() });
98
98
  }
99
- function h(e) {
100
- const c = r(null);
101
- function m() {
99
+ function I(e) {
100
+ const d = l(null);
101
+ function s() {
102
102
  const a = e.host || "https://app.documenso.com", n = btoa(
103
103
  encodeURIComponent(
104
104
  JSON.stringify({
105
- token: e.presignToken,
106
105
  externalId: e.externalId,
107
106
  features: e.features,
108
107
  css: e.css,
@@ -111,12 +110,12 @@ function h(e) {
111
110
  ...e.additionalProps
112
111
  })
113
112
  )
114
- );
115
- return `${new URL("/embed/v1/authoring/document/create", a)}#${n}`;
113
+ ), t = new URL("/embed/v1/authoring/document/create", a);
114
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
116
115
  }
117
- function d(a) {
116
+ function c(a) {
118
117
  var n, t;
119
- if (((n = c.current) == null ? void 0 : n.contentWindow) === a.source)
118
+ if (((n = d.current) == null ? void 0 : n.contentWindow) === a.source)
120
119
  switch (a.data.type) {
121
120
  case "document-created":
122
121
  (t = e.onDocumentCreated) == null || t.call(e, {
@@ -126,15 +125,50 @@ function h(e) {
126
125
  break;
127
126
  }
128
127
  }
129
- return l(() => {
130
- window.addEventListener("message", d);
131
- }, []), l(() => () => {
132
- window.removeEventListener("message", d);
133
- }, []), /* @__PURE__ */ u("iframe", { ref: c, className: e.className, src: m() });
128
+ return i(() => {
129
+ window.addEventListener("message", c);
130
+ }, []), i(() => () => {
131
+ window.removeEventListener("message", c);
132
+ }, []), /* @__PURE__ */ u("iframe", { ref: d, className: e.className, src: s() });
133
+ }
134
+ function D(e) {
135
+ const d = l(null);
136
+ function s() {
137
+ const a = e.host || "https://app.documenso.com", n = btoa(
138
+ encodeURIComponent(
139
+ JSON.stringify({
140
+ externalId: e.externalId,
141
+ features: e.features,
142
+ css: e.css,
143
+ cssVars: e.cssVars,
144
+ darkModeDisabled: e.darkModeDisabled,
145
+ ...e.additionalProps
146
+ })
147
+ )
148
+ ), t = new URL("/embed/v1/authoring/template/create", a);
149
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
150
+ }
151
+ function c(a) {
152
+ var n, t;
153
+ if (((n = d.current) == null ? void 0 : n.contentWindow) === a.source)
154
+ switch (a.data.type) {
155
+ case "template-created":
156
+ (t = e.onTemplateCreated) == null || t.call(e, {
157
+ templateId: a.data.templateId,
158
+ externalId: a.data.externalId
159
+ });
160
+ break;
161
+ }
162
+ }
163
+ return i(() => {
164
+ window.addEventListener("message", c);
165
+ }, []), i(() => () => {
166
+ window.removeEventListener("message", c);
167
+ }, []), /* @__PURE__ */ u("iframe", { ref: d, className: e.className, src: s() });
134
168
  }
135
169
  function E(e) {
136
- const c = r(null);
137
- function m() {
170
+ const d = l(null);
171
+ function s() {
138
172
  const a = e.host || "https://app.documenso.com", n = btoa(
139
173
  encodeURIComponent(
140
174
  JSON.stringify({
@@ -147,30 +181,73 @@ function E(e) {
147
181
  ...e.additionalProps
148
182
  })
149
183
  )
184
+ ), t = new URL(
185
+ `/embed/v1/authoring/document/edit/${e.documentId}`,
186
+ a
150
187
  );
151
- return `${new URL("/embed/v1/authoring/template/create", a)}#${n}`;
188
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
152
189
  }
153
- function d(a) {
190
+ function c(a) {
154
191
  var n, t;
155
- if (((n = c.current) == null ? void 0 : n.contentWindow) === a.source)
192
+ if (((n = d.current) == null ? void 0 : n.contentWindow) === a.source)
156
193
  switch (a.data.type) {
157
- case "template-created":
158
- (t = e.onTemplateCreated) == null || t.call(e, {
194
+ case "document-updated":
195
+ (t = e.onDocumentUpdated) == null || t.call(e, {
196
+ documentId: a.data.documentId,
197
+ externalId: a.data.externalId
198
+ });
199
+ break;
200
+ }
201
+ }
202
+ return i(() => {
203
+ window.addEventListener("message", c);
204
+ }, []), i(() => () => {
205
+ window.removeEventListener("message", c);
206
+ }, []), /* @__PURE__ */ u("iframe", { ref: d, className: e.className, src: s() });
207
+ }
208
+ function U(e) {
209
+ const d = l(null);
210
+ function s() {
211
+ const a = e.host || "https://app.documenso.com", n = btoa(
212
+ encodeURIComponent(
213
+ JSON.stringify({
214
+ externalId: e.externalId,
215
+ features: e.features,
216
+ css: e.css,
217
+ cssVars: e.cssVars,
218
+ darkModeDisabled: e.darkModeDisabled,
219
+ ...e.additionalProps
220
+ })
221
+ )
222
+ ), t = new URL(
223
+ `/embed/v1/authoring/template/edit/${e.templateId}`,
224
+ a
225
+ );
226
+ return t.searchParams.set("token", e.presignToken), t.hash = n, t.toString();
227
+ }
228
+ function c(a) {
229
+ var n, t;
230
+ if (((n = d.current) == null ? void 0 : n.contentWindow) === a.source)
231
+ switch (a.data.type) {
232
+ case "template-updated":
233
+ (t = e.onTemplateUpdated) == null || t.call(e, {
159
234
  templateId: a.data.templateId,
160
235
  externalId: a.data.externalId
161
236
  });
162
237
  break;
163
238
  }
164
239
  }
165
- return l(() => {
166
- window.addEventListener("message", d);
167
- }, []), l(() => () => {
168
- window.removeEventListener("message", d);
169
- }, []), /* @__PURE__ */ u("iframe", { ref: c, className: e.className, src: m() });
240
+ return i(() => {
241
+ window.addEventListener("message", c);
242
+ }, []), i(() => () => {
243
+ window.removeEventListener("message", c);
244
+ }, []), /* @__PURE__ */ u("iframe", { ref: d, className: e.className, src: s() });
170
245
  }
171
246
  export {
172
- g as EmbedDirectTemplate,
173
- D as EmbedSignDocument,
174
- h as unstable_EmbedCreateDocument,
175
- E as unstable_EmbedCreateTemplate
247
+ h as EmbedDirectTemplate,
248
+ _ as EmbedSignDocument,
249
+ I as unstable_EmbedCreateDocument,
250
+ D as unstable_EmbedCreateTemplate,
251
+ E as unstable_EmbedUpdateDocument,
252
+ U as unstable_EmbedUpdateTemplate
176
253
  };
@@ -0,0 +1,27 @@
1
+ import { h } from 'preact';
2
+ import { CssVars } from './css-vars';
3
+ export type EmbedUpdateDocumentProps = {
4
+ className?: string;
5
+ host?: string;
6
+ presignToken: string;
7
+ documentId: number;
8
+ externalId?: string;
9
+ css?: string | undefined;
10
+ cssVars?: (CssVars & Record<string, string>) | undefined;
11
+ darkModeDisabled?: boolean | undefined;
12
+ features?: {
13
+ allowConfigureSignatureTypes?: boolean;
14
+ allowConfigureLanguage?: boolean;
15
+ allowConfigureDateFormat?: boolean;
16
+ allowConfigureTimezone?: boolean;
17
+ allowConfigureRedirectUrl?: boolean;
18
+ allowConfigureCommunication?: boolean;
19
+ };
20
+ additionalProps?: Record<string, string | number | boolean> | undefined;
21
+ onDocumentUpdated?: (data: {
22
+ externalId: string;
23
+ documentId: number;
24
+ }) => void;
25
+ };
26
+ declare function EmbedUpdateDocument(props: EmbedUpdateDocumentProps): h.JSX.Element;
27
+ export default EmbedUpdateDocument;
@@ -0,0 +1,27 @@
1
+ import { h } from 'preact';
2
+ import { CssVars } from './css-vars';
3
+ export type EmbedUpdateTemplateProps = {
4
+ className?: string;
5
+ host?: string;
6
+ presignToken: string;
7
+ templateId: number;
8
+ externalId?: string;
9
+ css?: string | undefined;
10
+ cssVars?: (CssVars & Record<string, string>) | undefined;
11
+ darkModeDisabled?: boolean | undefined;
12
+ features?: {
13
+ allowConfigureSignatureTypes?: boolean;
14
+ allowConfigureLanguage?: boolean;
15
+ allowConfigureDateFormat?: boolean;
16
+ allowConfigureTimezone?: boolean;
17
+ allowConfigureRedirectUrl?: boolean;
18
+ allowConfigureCommunication?: boolean;
19
+ };
20
+ additionalProps?: Record<string, string | number | boolean> | undefined;
21
+ onTemplateUpdated?: (data: {
22
+ externalId: string;
23
+ templateId: number;
24
+ }) => void;
25
+ };
26
+ declare function EmbedUpdateTemplate(props: EmbedUpdateTemplateProps): h.JSX.Element;
27
+ export default EmbedUpdateTemplate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-preact",
3
- "version": "0.2.1-rc.2",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"