@documenso/embed-solid 0.0.2-rc.0 → 0.1.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("solid-js");function l(e,i,m){let a;const t=()=>{const n=document.createElement("template");return n.innerHTML=e,n.content.firstChild},c=()=>(a||(a=t())).cloneNode(!0);return c.cloneNode=c,c}function s(e,i,m){g(e)||(m==null?e.removeAttribute(i):e.setAttribute(i,m))}function f(e,i){g(e)||(i==null?e.removeAttribute("class"):e.className=i)}function b(e,i,m){return o.untrack(()=>e(i,m))}function g(e){return!!o.sharedConfig.context&&!o.sharedConfig.done&&(!e||e.isConnected)}var k=l("<iframe>");function h(e){const i=o.createMemo(()=>{const t=e.host||"https://app.documenso.com",c=btoa(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css})),n=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&n.searchParams.set("externalId",e.externalId),`${n}#${c}`});function m(t){var c,n,d,u,r;if((a==null?void 0:a.contentWindow)===t.source)switch(t.data.action){case"document-ready":(c=e.onDocumentReady)==null||c.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":(u=e.onFieldSigned)==null||u.call(e);break;case"field-unsigned":(r=e.onFieldUnsigned)==null||r.call(e);break}}let a;return o.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=k(),c=a;return typeof c=="function"?b(c,t):a=t,o.createRenderEffect(n=>{var d=e.className,u=i();return d!==n.e&&f(t,n.e=d),u!==n.t&&s(t,"src",n.t=u),n},{e:void 0,t:void 0}),t})()}var E=l("<iframe>");function v(e){const i=o.createMemo(()=>{const t=e.host||"https://app.documenso.com",c=btoa(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css}));return`${new URL(`/embed/sign/${e.token}`,t)}#${c}`});function m(t){var c,n,d;if((a==null?void 0:a.contentWindow)===t.source)switch(t.data.action){case"document-ready":(c=e.onDocumentReady)==null||c.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}}let a;return o.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=E(),c=a;return typeof c=="function"?b(c,t):a=t,o.createRenderEffect(n=>{var d=e.className,u=i();return d!==n.e&&f(t,n.e=d),u!==n.t&&s(t,"src",n.t=u),n},{e:void 0,t:void 0}),t})()}exports.EmbedDirectTemplate=h;exports.EmbedSignDocument=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("solid-js");function l(e,i,m){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 s(e,i,m){g(e)||(m==null?e.removeAttribute(i):e.setAttribute(i,m))}function f(e,i){g(e)||(i==null?e.removeAttribute("class"):e.className=i)}function b(e,i,m){return o.untrack(()=>e(i,m))}function g(e){return!!o.sharedConfig.context&&!o.sharedConfig.done&&(!e||e.isConnected)}var k=l("<iframe>");function E(e){const i=o.createMemo(()=>{const t=e.host||"https://app.documenso.com",a=btoa(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css})),n=new URL(`/embed/direct/${e.token}`,t);return e.externalId&&n.searchParams.set("externalId",e.externalId),`${n}#${a}`});function m(t){var a,n,d,u,r;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":(u=e.onFieldSigned)==null||u.call(e);break;case"field-unsigned":(r=e.onFieldUnsigned)==null||r.call(e);break}}let c;return o.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=k(),a=c;return typeof a=="function"?b(a,t):c=t,o.createRenderEffect(n=>{var d=e.className,u=i();return d!==n.e&&f(t,n.e=d),u!==n.t&&s(t,"src",n.t=u),n},{e:void 0,t:void 0}),t})()}var v=l("<iframe>");function h(e){const i=o.createMemo(()=>{const t=e.host||"https://app.documenso.com",a=btoa(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css}));return`${new URL(`/embed/sign/${e.token}`,t)}#${a}`});function m(t){var a,n,d;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}}let c;return o.onMount(()=>{window.addEventListener("message",m)}),(()=>{var t=v(),a=c;return typeof a=="function"?b(a,t):c=t,o.createRenderEffect(n=>{var d=e.className,u=i();return d!==n.e&&f(t,n.e=d),u!==n.t&&s(t,"src",n.t=u),n},{e:void 0,t:void 0}),t})()}exports.EmbedDirectTemplate=E;exports.EmbedSignDocument=h;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { sharedConfig as l, untrack as N, createMemo as r, onMount as s, createRenderEffect as f } from "solid-js";
1
+ import { sharedConfig as l, untrack as h, createMemo as r, onMount as s, createRenderEffect as f } from "solid-js";
2
2
  function b(e, i, m) {
3
3
  let c;
4
4
  const t = () => {
@@ -8,15 +8,15 @@ function b(e, i, m) {
8
8
  return a.cloneNode = a, a;
9
9
  }
10
10
  function k(e, i, m) {
11
- v(e) || (m == null ? e.removeAttribute(i) : e.setAttribute(i, m));
11
+ N(e) || (m == null ? e.removeAttribute(i) : e.setAttribute(i, m));
12
12
  }
13
13
  function g(e, i) {
14
- v(e) || (i == null ? e.removeAttribute("class") : e.className = i);
14
+ N(e) || (i == null ? e.removeAttribute("class") : e.className = i);
15
15
  }
16
- function h(e, i, m) {
17
- return N(() => e(i, m));
16
+ function v(e, i, m) {
17
+ return h(() => e(i, m));
18
18
  }
19
- function v(e) {
19
+ function N(e) {
20
20
  return !!l.context && !l.done && (!e || e.isConnected);
21
21
  }
22
22
  var E = /* @__PURE__ */ b("<iframe>");
@@ -57,7 +57,7 @@ function $(e) {
57
57
  window.addEventListener("message", m);
58
58
  }), (() => {
59
59
  var t = E(), a = c;
60
- return typeof a == "function" ? h(a, t) : c = t, f((n) => {
60
+ return typeof a == "function" ? v(a, t) : c = t, f((n) => {
61
61
  var d = e.className, u = i();
62
62
  return d !== n.e && g(t, n.e = d), u !== n.t && k(t, "src", n.t = u), n;
63
63
  }, {
@@ -96,7 +96,7 @@ function D(e) {
96
96
  window.addEventListener("message", m);
97
97
  }), (() => {
98
98
  var t = w(), a = c;
99
- return typeof a == "function" ? h(a, t) : c = t, f((n) => {
99
+ return typeof a == "function" ? v(a, t) : c = t, f((n) => {
100
100
  var d = e.className, u = i();
101
101
  return d !== n.e && g(t, n.e = d), u !== n.t && k(t, "src", n.t = u), n;
102
102
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-solid",
3
- "version": "0.0.2-rc.0",
3
+ "version": "0.1.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "scripts": {
28
28
  "build": "vite build",
29
- "clean": "rimraf node_modules",
29
+ "clean": "rimraf node_modules && rimraf src",
30
30
  "check-exports": "attw --pack .",
31
31
  "publint": "publint"
32
32
  },