@documenso/embed-solid 0.2.1-rc.1 → 0.2.1-rc.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.js +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("solid-js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("solid-js");function l(e,o,s){let c;const t=()=>{const n=document.createElement("template");return n.innerHTML=e,n.content.firstChild},a=()=>(c||(c=t())).cloneNode(!0);return a.cloneNode=a,a}function m(e,o,s){k(e)||(s==null?e.removeAttribute(o):e.setAttribute(o,s))}function u(e,o){k(e)||(o==null?e.removeAttribute("class"):e.className=o)}function f(e,o,s){return r.untrack(()=>e(o,s))}function k(e){return!!r.sharedConfig.context&&!r.sharedConfig.done&&(!e||e.isConnected)}var g=l("<iframe>");function v(e){const o=r.createMemo(()=>{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}))),n=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&n.searchParams.set("externalId",e.externalId),`${n}#${a}`});function s(t){var a,n,d,i,b;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(n=e.onDocumentCompleted)==null||n.call(e,t.data.data);break;case"document-error":(d=e.onDocumentError)==null||d.call(e,t.data.data);break;case"field-signed":(i=e.onFieldSigned)==null||i.call(e);break;case"field-unsigned":(b=e.onFieldUnsigned)==null||b.call(e);break}}let c;return r.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=g(),a=c;return typeof a=="function"?f(a,t):c=t,r.createRenderEffect(n=>{var d=e.className,i=o();return d!==n.e&&u(t,n.e=d),i!==n.t&&m(t,"src",n.t=i),n},{e:void 0,t:void 0}),t})()}var D=l("<iframe>");function h(e){const o=r.createMemo(()=>{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 s(t){var a,n,d,i;if((c==null?void 0:c.contentWindow)===t.source)switch(t.data.action){case"document-ready":(a=e.onDocumentReady)==null||a.call(e);break;case"document-completed":(n=e.onDocumentCompleted)==null||n.call(e,t.data.data);break;case"document-error":(d=e.onDocumentError)==null||d.call(e,t.data.data);break;case"document-rejected":(i=e.onDocumentRejected)==null||i.call(e,t.data.data);break}}let c;return r.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=D(),a=c;return typeof a=="function"?f(a,t):c=t,r.createRenderEffect(n=>{var d=e.className,i=o();return d!==n.e&&u(t,n.e=d),i!==n.t&&m(t,"src",n.t=i),n},{e:void 0,t:void 0}),t})()}var w=l("<iframe>");function E(e){const o=r.createMemo(()=>{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})));return`${new URL("/embed/v1/authoring/document/create",t)}#${a}`});function s(t){var a;if((c==null?void 0:c.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}}let c;return r.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=w(),a=c;return typeof a=="function"?f(a,t):c=t,r.createRenderEffect(n=>{var d=e.className,i=o();return d!==n.e&&u(t,n.e=d),i!==n.t&&m(t,"src",n.t=i),n},{e:void 0,t:void 0}),t})()}var M=l("<iframe>");function I(e){const o=r.createMemo(()=>{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})));return`${new URL("/embed/v1/authoring/template/create",t)}#${a}`});function s(t){var a;if((c==null?void 0:c.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}}let c;return r.onMount(()=>{window.addEventListener("message",s)}),(()=>{var t=M(),a=c;return typeof a=="function"?f(a,t):c=t,r.createRenderEffect(n=>{var d=e.className,i=o();return d!==n.e&&u(t,n.e=d),i!==n.t&&m(t,"src",n.t=i),n},{e:void 0,t:void 0}),t})()}exports.EmbedDirectTemplate=v;exports.EmbedSignDocument=h;exports.unstable_EmbedCreateDocument=E;exports.unstable_EmbedCreateTemplate=I;
|
package/dist/index.mjs
CHANGED
|
@@ -133,7 +133,7 @@ function y(e) {
|
|
|
133
133
|
var a;
|
|
134
134
|
if ((c == null ? void 0 : c.contentWindow) === t.source)
|
|
135
135
|
switch (t.data.type) {
|
|
136
|
-
case "document-
|
|
136
|
+
case "document-created":
|
|
137
137
|
(a = e.onDocumentCreated) == null || a.call(e, {
|
|
138
138
|
documentId: t.data.documentId,
|
|
139
139
|
externalId: t.data.externalId
|
|
@@ -173,7 +173,7 @@ function M(e) {
|
|
|
173
173
|
var a;
|
|
174
174
|
if ((c == null ? void 0 : c.contentWindow) === t.source)
|
|
175
175
|
switch (t.data.type) {
|
|
176
|
-
case "template-
|
|
176
|
+
case "template-created":
|
|
177
177
|
(a = e.onTemplateCreated) == null || a.call(e, {
|
|
178
178
|
templateId: t.data.templateId,
|
|
179
179
|
externalId: t.data.externalId
|