n8n-demo-component
Advanced tools
Comparing version 1.0.29 to 1.0.31
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
var v;u.finalized=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==l||l({ReactiveElement:u}),(null!==(n=globalThis.reactiveElementVersions)&&void 0!==n?n:globalThis.reactiveElementVersions=[]).push("1.2.1");const f=globalThis.trustedTypes,p=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,m="?"+w,g=`<${m}>`,b=document,y=(t="")=>b.createComment(t),_=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k=/-->/g,C=/>/g,x=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,A=/'/g,M=/"/g,E=/^(?:script|style|textarea)$/i,N=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),O=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),j=new WeakMap,U=b.createTreeWalker(b,129,null,!1),z=(t,i)=>{const s=t.length-1,e=[];let o,n=2===i?"<svg>":"",r=$;for(let i=0;i<s;i++){const s=t[i];let h,l,d=-1,a=0;for(;a<s.length&&(r.lastIndex=a,l=r.exec(s),null!==l);)a=r.lastIndex,r===$?"!--"===l[1]?r=k:void 0!==l[1]?r=C:void 0!==l[2]?(E.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=x):void 0!==l[3]&&(r=x):r===x?">"===l[0]?(r=null!=o?o:$,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,h=l[1],r=void 0===l[3]?x:'"'===l[3]?M:A):r===M||r===A?r=x:r===k||r===C?r=$:(r=x,o=void 0);const c=r===x&&t[i+1].startsWith("/>")?" ":"";n+=r===$?s+g:d>=0?(e.push(h),s.slice(0,d)+"$lit$"+s.slice(d)+w+c):s+w+(-2===d?(e.push(void 0),i):c)}const h=n+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==p?p.createHTML(h):h,e]};class R{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const r=t.length-1,h=this.parts,[l,d]=z(t,i);if(this.el=R.createElement(l,s),U.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=U.nextNode())&&h.length<r;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(w)){const s=d[n++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+"$lit$").split(w),i=/([.?@])?(.*)/.exec(s);h.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?P:"?"===i[1]?B:"@"===i[1]?H:L})}else h.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(E.test(e.tagName)){const t=e.textContent.split(w),i=t.length-1;if(i>0){e.textContent=f?f.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],y()),U.nextNode(),h.push({type:2,index:++o});e.append(t[i],y())}}}else if(8===e.nodeType)if(e.data===m)h.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(w,t+1));)h.push({type:7,index:o}),t+=w.length-1}o++}}static createElement(t,i){const s=b.createElement("template");return s.innerHTML=t,s}}function J(t,i,s=t,e){var o,n,r,h;if(i===O)return i;let l=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const d=_(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==d&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===d?l=void 0:(l=new d(t),l._$AT(t,s,e)),void 0!==e?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[e]=l:s._$Cu=l),void 0!==l&&(i=J(t,l._$AS(t,i.values),l,e)),i}class I{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:b).importNode(s,!0);U.currentNode=o;let n=U.nextNode(),r=0,h=0,l=e[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new D(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new W(n,this,t)),this.v.push(i),l=e[++h]}r!==(null==l?void 0:l.index)&&(n=U.nextNode(),r++)}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class D{constructor(t,i,s,e){var o;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=J(this,t,i),_(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==O&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return S(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==T&&_(this._$AH)?this._$AA.nextSibling.data=t:this.S(b.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=R.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else{const t=new I(o,this),i=t.p(this.options);t.m(s),this.S(i),this._$AH=t}}_$AC(t){let i=j.get(t.strings);return void 0===i&&j.set(t.strings,i=new R(t)),i}A(t){S(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new D(this.M(y()),this.M(y()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class L{constructor(t,i,s,e,o){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=J(this,t,i,0),n=!_(t)||t!==this._$AH&&t!==O,n&&(this._$AH=t);else{const e=t;let r,h;for(t=o[0],r=0;r<o.length-1;r++)h=J(this,e[s+r],i,r),h===O&&(h=this._$AH[r]),n||(n=!_(h)||h!==this._$AH[r]),h===T?t=T:t!==T&&(t+=(null!=h?h:"")+o[r+1]),this._$AH[r]=h}n&&!e&&this.k(t)}k(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class P extends L{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===T?void 0:t}}const V=f?f.emptyScript:"";class B extends L{constructor(){super(...arguments),this.type=4}k(t){t&&t!==T?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class H extends L{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=J(this,t,i,0))&&void 0!==s?s:T)===O)return;const e=this._$AH,o=t===T&&e!==T||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==T&&(e===T||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const K=window.litHtmlPolyfillSupport; | ||
var v;u.finalized=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==l||l({ReactiveElement:u}),(null!==(n=globalThis.reactiveElementVersions)&&void 0!==n?n:globalThis.reactiveElementVersions=[]).push("1.2.1");const f=globalThis.trustedTypes,p=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,m="?"+w,g=`<${m}>`,b=document,y=(t="")=>b.createComment(t),_=t=>null===t||"object"!=typeof t&&"function"!=typeof t,$=Array.isArray,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k=/-->/g,C=/>/g,x=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,A=/'/g,M=/"/g,E=/^(?:script|style|textarea)$/i,j=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),N=Symbol.for("lit-noChange"),O=Symbol.for("lit-nothing"),T=new WeakMap,U=b.createTreeWalker(b,129,null,!1),z=(t,i)=>{const s=t.length-1,e=[];let o,n=2===i?"<svg>":"",r=S;for(let i=0;i<s;i++){const s=t[i];let h,l,d=-1,a=0;for(;a<s.length&&(r.lastIndex=a,l=r.exec(s),null!==l);)a=r.lastIndex,r===S?"!--"===l[1]?r=k:void 0!==l[1]?r=C:void 0!==l[2]?(E.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=x):void 0!==l[3]&&(r=x):r===x?">"===l[0]?(r=null!=o?o:S,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,h=l[1],r=void 0===l[3]?x:'"'===l[3]?M:A):r===M||r===A?r=x:r===k||r===C?r=S:(r=x,o=void 0);const c=r===x&&t[i+1].startsWith("/>")?" ":"";n+=r===S?s+g:d>=0?(e.push(h),s.slice(0,d)+"$lit$"+s.slice(d)+w+c):s+w+(-2===d?(e.push(void 0),i):c)}const h=n+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==p?p.createHTML(h):h,e]};class R{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const r=t.length-1,h=this.parts,[l,d]=z(t,i);if(this.el=R.createElement(l,s),U.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=U.nextNode())&&h.length<r;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(w)){const s=d[n++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+"$lit$").split(w),i=/([.?@])?(.*)/.exec(s);h.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?P:"?"===i[1]?B:"@"===i[1]?H:L})}else h.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(E.test(e.tagName)){const t=e.textContent.split(w),i=t.length-1;if(i>0){e.textContent=f?f.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],y()),U.nextNode(),h.push({type:2,index:++o});e.append(t[i],y())}}}else if(8===e.nodeType)if(e.data===m)h.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(w,t+1));)h.push({type:7,index:o}),t+=w.length-1}o++}}static createElement(t,i){const s=b.createElement("template");return s.innerHTML=t,s}}function J(t,i,s=t,e){var o,n,r,h;if(i===N)return i;let l=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const d=_(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==d&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===d?l=void 0:(l=new d(t),l._$AT(t,s,e)),void 0!==e?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[e]=l:s._$Cu=l),void 0!==l&&(i=J(t,l._$AS(t,i.values),l,e)),i}class I{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:b).importNode(s,!0);U.currentNode=o;let n=U.nextNode(),r=0,h=0,l=e[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new D(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new W(n,this,t)),this.v.push(i),l=e[++h]}r!==(null==l?void 0:l.index)&&(n=U.nextNode(),r++)}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class D{constructor(t,i,s,e){var o;this.type=2,this._$AH=O,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=J(this,t,i),_(t)?t===O||null==t||""===t?(this._$AH!==O&&this._$AR(),this._$AH=O):t!==this._$AH&&t!==N&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return $(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==O&&_(this._$AH)?this._$AA.nextSibling.data=t:this.S(b.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=R.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else{const t=new I(o,this),i=t.p(this.options);t.m(s),this.S(i),this._$AH=t}}_$AC(t){let i=T.get(t.strings);return void 0===i&&T.set(t.strings,i=new R(t)),i}A(t){$(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new D(this.M(y()),this.M(y()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class L{constructor(t,i,s,e,o){this.type=1,this._$AH=O,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=O}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=J(this,t,i,0),n=!_(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const e=t;let r,h;for(t=o[0],r=0;r<o.length-1;r++)h=J(this,e[s+r],i,r),h===N&&(h=this._$AH[r]),n||(n=!_(h)||h!==this._$AH[r]),h===O?t=O:t!==O&&(t+=(null!=h?h:"")+o[r+1]),this._$AH[r]=h}n&&!e&&this.k(t)}k(t){t===O?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class P extends L{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===O?void 0:t}}const V=f?f.emptyScript:"";class B extends L{constructor(){super(...arguments),this.type=4}k(t){t&&t!==O?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class H extends L{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=J(this,t,i,0))&&void 0!==s?s:O)===N)return;const e=this._$AH,o=t===O&&e!==O||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==O&&(e===O||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const K=window.litHtmlPolyfillSupport; | ||
/** | ||
@@ -24,3 +24,3 @@ * @license | ||
*/ | ||
var Z,q;null==K||K(R,D),(null!==(v=globalThis.litHtmlVersions)&&void 0!==v?v:globalThis.litHtmlVersions=[]).push("2.1.2");class F extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const s=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=s.firstChild),s}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let r=n._$litPart$;if(void 0===r){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=r=new D(i.insertBefore(y(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return O}}F.finalized=!0,F._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:F});const G=globalThis.litElementPolyfillSupport;null==G||G({LitElement:F}),(null!==(q=globalThis.litElementVersions)&&void 0!==q?q:globalThis.litElementVersions=[]).push("3.1.2"); | ||
var Z,q;null==K||K(R,D),(null!==(v=globalThis.litHtmlVersions)&&void 0!==v?v:globalThis.litHtmlVersions=[]).push("2.1.2");class Y extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const s=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=s.firstChild),s}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let r=n._$litPart$;if(void 0===r){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=r=new D(i.insertBefore(y(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return N}}Y.finalized=!0,Y._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:Y});const F=globalThis.litElementPolyfillSupport;null==F||F({LitElement:Y}),(null!==(q=globalThis.litElementVersions)&&void 0!==q?q:globalThis.litElementVersions=[]).push("3.1.2"); | ||
/** | ||
@@ -31,3 +31,3 @@ * @license | ||
*/ | ||
const Q=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(s){s.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(s){s.createProperty(i.key,t)}}; | ||
const G=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(s){s.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(s){s.createProperty(i.key,t)}}; | ||
/** | ||
@@ -37,3 +37,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/function X(t){return(i,s)=>void 0!==s?((t,i,s)=>{i.constructor.createProperty(s,t)})(t,i,s):Q(t,i) | ||
*/function Q(t){return(i,s)=>void 0!==s?((t,i,s)=>{i.constructor.createProperty(s,t)})(t,i,s):G(t,i) | ||
/** | ||
@@ -43,3 +43,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/}function Y(t){return X({...t,state:!0})} | ||
*/}function X(t){return Q({...t,state:!0})} | ||
/** | ||
@@ -61,3 +61,3 @@ * @license | ||
*/ | ||
const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==it||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var s,e;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(i)}const o=t.element.classList;this.st.forEach((t=>{t in i||(o.remove(t),this.st.delete(t))}));for(const t in i){const s=!!i[t];s===this.st.has(t)||(null===(e=this.et)||void 0===e?void 0:e.has(t))||(s?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return O}});var et=function(t,i,s,e){for(var o,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,h=t.length-1;h>=0;h--)(o=t[h])&&(r=(n<3?o(r):n>3?o(i,s,r):o(i,s))||r);return n>3&&r&&Object.defineProperty(i,s,r),r};function ot(t){try{JSON.parse(t)}catch(t){return!1}return!0}let nt=class extends F{constructor(){super(...arguments),this.workflow="{}",this.frame=!1,this.src="https://n8n-preview-service.internal.n8n.cloud/workflows/demo",this.showCode=!1,this.showPreview=!0,this.fullscreen=!1,this.insideIframe=!1,this.copyText="Copy",this.scrollX=0,this.scrollY=0,this.receiveMessage=({data:t,source:i})=>{const s=this.shadowRoot.getElementById("int_iframe");if(ot(t)&&s.contentWindow===i){const i=JSON.parse(t);"n8nReady"===i.command?(this.showPreview=!0,this.loadWorkflow()):"openNDV"===i.command?this.fullscreen=!0:"closeNDV"===i.command?this.fullscreen=!1:"error"===i.command&&(this.showPreview=!1)}},this.onDocumentScroll=()=>{this.insideIframe&&window.scrollTo(this.scrollX,this.scrollY)}}loadWorkflow(){console.log(this.workflow);try{const t=JSON.parse(this.workflow);if(!t)throw new Error("Missing workflow");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("Must have an array of nodes");const i=this.shadowRoot.getElementById("int_iframe");i.contentWindow&&i.contentWindow.postMessage(JSON.stringify({command:"openWorkflow",workflow:t}),"*")}catch{this.showPreview=!1}}toggleCode(){this.showCode=!this.showCode}onMouseEnter(){this.insideIframe=!0,this.scrollX=window.scrollX,this.scrollY=window.scrollY}onMouseLeave(){this.insideIframe=!1}copyClipboard(){navigator.clipboard.writeText(this.workflow),this.copyText="Copied",setTimeout((()=>{this.copyText="Copy"}),1500)}connectedCallback(){super.connectedCallback(),console.log(this.workflow),this.workflow=decodeURIComponent(this.workflow),window.addEventListener("message",this.receiveMessage),document.addEventListener("scroll",this.onDocumentScroll)}disconnectedCallback(){window.removeEventListener("message",this.receiveMessage),document.removeEventListener("scroll",this.onDocumentScroll),super.disconnectedCallback()}render(){return N` | ||
const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==it||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var s,e;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(i)}const o=t.element.classList;this.st.forEach((t=>{t in i||(o.remove(t),this.st.delete(t))}));for(const t in i){const s=!!i[t];s===this.st.has(t)||(null===(e=this.et)||void 0===e?void 0:e.has(t))||(s?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return N}});var et=function(t,i,s,e){for(var o,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,h=t.length-1;h>=0;h--)(o=t[h])&&(r=(n<3?o(r):n>3?o(i,s,r):o(i,s))||r);return n>3&&r&&Object.defineProperty(i,s,r),r};function ot(t){try{JSON.parse(t)}catch(t){return!1}return!0}let nt=class extends Y{constructor(){super(...arguments),this.workflow="{}",this.frame=!1,this.src="https://n8n-preview-service.internal.n8n.cloud/workflows/demo",this.showCode=!1,this.showPreview=!0,this.fullscreen=!1,this.insideIframe=!1,this.copyText="Copy",this.scrollX=0,this.scrollY=0,this.receiveMessage=({data:t,source:i})=>{const s=this.shadowRoot.getElementById("int_iframe");if(ot(t)&&s.contentWindow===i){const i=JSON.parse(t);"n8nReady"===i.command?(this.showPreview=!0,this.loadWorkflow()):"openNDV"===i.command?this.fullscreen=!0:"closeNDV"===i.command?this.fullscreen=!1:"error"===i.command&&(this.showPreview=!1)}},this.onDocumentScroll=()=>{this.insideIframe&&window.scrollTo(this.scrollX,this.scrollY)}}loadWorkflow(){try{const t=JSON.parse(this.workflow);if(!t)throw new Error("Missing workflow");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("Must have an array of nodes");const i=this.shadowRoot.getElementById("int_iframe");i.contentWindow&&i.contentWindow.postMessage(JSON.stringify({command:"openWorkflow",workflow:t}),"*")}catch{this.showPreview=!1}}toggleCode(){this.showCode=!this.showCode}onMouseEnter(){this.insideIframe=!0,this.scrollX=window.scrollX,this.scrollY=window.scrollY}onMouseLeave(){this.insideIframe=!1}copyClipboard(){navigator.clipboard.writeText(this.workflow),this.copyText="Copied",setTimeout((()=>{this.copyText="Copy"}),1500)}connectedCallback(){super.connectedCallback(),this.workflow=decodeURIComponent(this.workflow),window.addEventListener("message",this.receiveMessage),document.addEventListener("scroll",this.onDocumentScroll)}disconnectedCallback(){window.removeEventListener("message",this.receiveMessage),document.removeEventListener("scroll",this.onDocumentScroll),super.disconnectedCallback()}render(){return j` | ||
<div | ||
@@ -75,6 +75,6 @@ class="embedded_workflow" | ||
<div class="embedded_tip_error" ?hidden=${this.showPreview}> | ||
Something went wrong, unable to preview workflow at the moment. | ||
Could not load workflow preview. You can still <a href='javascript:void(0)' @click=${this.toggleCode}>view the code</a> and paste it into n8n | ||
</div> | ||
<div class="embedded_tip" ?hidden=${!this.frame}> | ||
💡 Double-click a node to see its settings, or paste <a class='code_toggle' href='#showcode' @click=${this.toggleCode}>this workflow's code</a> into n8n to import it | ||
<div class=${st({embedded_tip:!0,embedded_tip_with_code:this.showCode})} ?hidden=${!this.frame}> | ||
💡 Double-click a node to see its settings, or paste <a class='code_toggle' href='javascript:void(0)' @click=${this.toggleCode}>this workflow's code</a> into n8n to import it | ||
</div> | ||
@@ -108,9 +108,11 @@ <div class="workflow_json" ?hidden=${!this.showCode}> | ||
.embedded_workflow .embedded_tip { | ||
margin-top: 3px; | ||
margin-bottom: 3px; | ||
margin-top: 7px; | ||
color: hsl(0, 0%, 40%); | ||
text-align: center; | ||
vertical-align: middle; | ||
font-size: 0.9em; | ||
} | ||
.embedded_workflow .embedded_tip_with_code { | ||
margin-top: 2.5px; | ||
margin-bottom: 5px; | ||
} | ||
.embedded_workflow_iframe { | ||
@@ -138,11 +140,11 @@ width: 100%; | ||
display: block; | ||
position: absolute; | ||
float: right; | ||
right: 0px; | ||
margin-top: 2.5px; | ||
margin-right: 21.5px; | ||
margin-top: 5px; | ||
margin-right: 5px; | ||
padding: 5px; | ||
font-size: 0.8em; | ||
font-size: 1em; | ||
background: var(--n8n-copy-button-background-color, rgb(239, 239, 239)); | ||
cursor: pointer; | ||
} | ||
`,et([X({type:String})],nt.prototype,"workflow",void 0),et([X({type:Boolean})],nt.prototype,"frame",void 0),et([X({type:String})],nt.prototype,"src",void 0),et([Y()],nt.prototype,"showCode",void 0),et([Y()],nt.prototype,"showPreview",void 0),et([Y()],nt.prototype,"fullscreen",void 0),et([Y()],nt.prototype,"insideIframe",void 0),et([Y()],nt.prototype,"copyText",void 0),nt=et([(t=>i=>"function"==typeof i?((t,i)=>(window.customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:s,elements:e}=i;return{kind:s,elements:e,finisher(i){window.customElements.define(t,i)}}})(t,i))("n8n-demo")],nt);export{nt as N8NDemo}; | ||
`,et([Q({type:String})],nt.prototype,"workflow",void 0),et([Q({type:Boolean})],nt.prototype,"frame",void 0),et([Q({type:String})],nt.prototype,"src",void 0),et([X()],nt.prototype,"showCode",void 0),et([X()],nt.prototype,"showPreview",void 0),et([X()],nt.prototype,"fullscreen",void 0),et([X()],nt.prototype,"insideIframe",void 0),et([X()],nt.prototype,"copyText",void 0),nt=et([(t=>i=>"function"==typeof i?((t,i)=>(window.customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:s,elements:e}=i;return{kind:s,elements:e,finisher(i){window.customElements.define(t,i)}}})(t,i))("n8n-demo")],nt);export{nt as N8NDemo}; |
@@ -60,3 +60,2 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
loadWorkflow() { | ||
console.log(this.workflow); | ||
try { | ||
@@ -102,3 +101,2 @@ const workflow = JSON.parse(this.workflow); | ||
super.connectedCallback(); | ||
console.log(this.workflow); | ||
this.workflow = decodeURIComponent(this.workflow); | ||
@@ -130,6 +128,9 @@ window.addEventListener('message', this.receiveMessage); | ||
<div class="embedded_tip_error" ?hidden=${this.showPreview}> | ||
Something went wrong, unable to preview workflow at the moment. | ||
Could not load workflow preview. You can still <a href='javascript:void(0)' @click=${this.toggleCode}>view the code</a> and paste it into n8n | ||
</div> | ||
<div class="embedded_tip" ?hidden=${!this.frame}> | ||
💡 Double-click a node to see its settings, or paste <a class='code_toggle' href='#showcode' @click=${this.toggleCode}>this workflow's code</a> into n8n to import it | ||
<div class=${classMap({ | ||
embedded_tip: true, | ||
embedded_tip_with_code: this.showCode, | ||
})} ?hidden=${!this.frame}> | ||
💡 Double-click a node to see its settings, or paste <a class='code_toggle' href='javascript:void(0)' @click=${this.toggleCode}>this workflow's code</a> into n8n to import it | ||
</div> | ||
@@ -166,9 +167,11 @@ <div class="workflow_json" ?hidden=${!this.showCode}> | ||
.embedded_workflow .embedded_tip { | ||
margin-top: 3px; | ||
margin-bottom: 3px; | ||
margin-top: 7px; | ||
color: hsl(0, 0%, 40%); | ||
text-align: center; | ||
vertical-align: middle; | ||
font-size: 0.9em; | ||
} | ||
.embedded_workflow .embedded_tip_with_code { | ||
margin-top: 2.5px; | ||
margin-bottom: 5px; | ||
} | ||
.embedded_workflow_iframe { | ||
@@ -196,8 +199,8 @@ width: 100%; | ||
display: block; | ||
position: absolute; | ||
float: right; | ||
right: 0px; | ||
margin-top: 2.5px; | ||
margin-right: 21.5px; | ||
margin-top: 5px; | ||
margin-right: 5px; | ||
padding: 5px; | ||
font-size: 0.8em; | ||
font-size: 1em; | ||
background: var(--n8n-copy-button-background-color, rgb(239, 239, 239)); | ||
@@ -204,0 +207,0 @@ cursor: pointer; |
{ | ||
"name": "n8n-demo-component", | ||
"version": "1.0.29", | ||
"version": "1.0.31", | ||
"description": "web component for workflow previews", | ||
@@ -5,0 +5,0 @@ "main": "n8n-demo.js", |
@@ -71,3 +71,2 @@ import { LitElement, html, css } from 'lit'; | ||
loadWorkflow() { | ||
console.log(this.workflow); | ||
try { | ||
@@ -143,9 +142,11 @@ const workflow = JSON.parse(this.workflow); | ||
.embedded_workflow .embedded_tip { | ||
margin-top: 3px; | ||
margin-bottom: 3px; | ||
margin-top: 7px; | ||
color: hsl(0, 0%, 40%); | ||
text-align: center; | ||
vertical-align: middle; | ||
font-size: 0.9em; | ||
} | ||
.embedded_workflow .embedded_tip_with_code { | ||
margin-top: 2.5px; | ||
margin-bottom: 5px; | ||
} | ||
.embedded_workflow_iframe { | ||
@@ -173,8 +174,8 @@ width: 100%; | ||
display: block; | ||
position: absolute; | ||
float: right; | ||
right: 0px; | ||
margin-top: 2.5px; | ||
margin-right: 21.5px; | ||
margin-top: 5px; | ||
margin-right: 5px; | ||
padding: 5px; | ||
font-size: 0.8em; | ||
font-size: 1em; | ||
background: var(--n8n-copy-button-background-color, rgb(239, 239, 239)); | ||
@@ -187,3 +188,2 @@ cursor: pointer; | ||
super.connectedCallback(); | ||
console.log(this.workflow); | ||
this.workflow = decodeURIComponent(this.workflow); | ||
@@ -217,6 +217,9 @@ window.addEventListener('message', this.receiveMessage); | ||
<div class="embedded_tip_error" ?hidden=${this.showPreview}> | ||
Something went wrong, unable to preview workflow at the moment. | ||
Could not load workflow preview. You can still <a href='javascript:void(0)' @click=${this.toggleCode}>view the code</a> and paste it into n8n | ||
</div> | ||
<div class="embedded_tip" ?hidden=${!this.frame}> | ||
💡 Double-click a node to see its settings, or paste <a class='code_toggle' href='#showcode' @click=${this.toggleCode}>this workflow's code</a> into n8n to import it | ||
<div class=${classMap({ | ||
embedded_tip: true, | ||
embedded_tip_with_code: this.showCode, | ||
})} ?hidden=${!this.frame}> | ||
💡 Double-click a node to see its settings, or paste <a class='code_toggle' href='javascript:void(0)' @click=${this.toggleCode}>this workflow's code</a> into n8n to import it | ||
</div> | ||
@@ -223,0 +226,0 @@ <div class="workflow_json" ?hidden=${!this.showCode}> |
3507189
5519