n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 3.69 kB
JavaScript
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`427068ab-20bb-44bd-a6e4-3838bff0e7dd`,e._sentryDebugIdIdentifier=`sentry-dbid-427068ab-20bb-44bd-a6e4-3838bff0e7dd`)})()}catch{}import{$ as e,A as t,C as n,Ft as r,N as i,O as a,S as o,Sn as s,T as c,Wt as l,X as u,_n as d,gt as f,h as p,j as m,q as h,w as g,yt as _}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{at as v}from"./core-Bz5WjPxS.js";import{G as y,Xi as b,Zi as x,ct as S,lt as C}from"./src-XqE2yCpG.js";import{t as w}from"./_plugin-vue_export-helper-CIL7EULb.js";import{In as T,Rt as E,fr as D,qt as O,w as k}from"./users.store-xP93bV7X.js";import{t as A}from"./RecommendedTemplateCard-DNolG202.js";import{t as j}from"./WorkflowPreview-C5OyFGa3.js";import{n as M}from"./templateActions-CWJ2rAV4.js";import{t as N}from"./TemplatesView-DWHPzBDs.js";var P=w(i({__name:`TemplatesWorkflowView`,setup(i){let w=T(),P=O(),F=k(),I=S(),L=C(),R=D(),z=v(),B=E(),V=r(!0),H=r(!0),U=r(!1),W=r(!0),G=r(null),K=null,q=o(()=>Array.isArray(I.params.id)?I.params.id[0]:I.params.id),J=o(()=>P.getFullTemplateById(q.value)),Y=async(e,t)=>{await M({router:L,templateId:e,inNewBrowserTab:t.metaKey||t.ctrlKey,externalHooks:w,nodeTypesStore:F,telemetry:R,templatesStore:P,source:`template_preview`})},X=()=>{H.value=!1},Z=()=>{let e=document.getElementById(`content`);e&&e.scrollTo({top:0})};f(()=>J.value,e=>{e?B.set(`Template template: ${e.name}`):B.set(`Templates`)}),f(G,e=>{K&&=(K.disconnect(),null),e&&(K=new IntersectionObserver(e=>{for(let t of e)W.value=t.isIntersecting},{threshold:0}),K.observe(e))},{immediate:!0}),u(async()=>{if(Z(),J.value?.full){V.value=!1;return}try{await P.fetchTemplateById(q.value)}catch{U.value=!0}V.value=!1}),h(()=>{K&&=(K.disconnect(),null)});let Q=o(()=>{if(J.value?.workflow)return J.value.readyToDemo?J.value.workflow:{...J.value.workflow,pinData:{}}});return(r,i)=>(e(),g(N,{"full-width":!0},a({_:2},[U.value?{name:`header`,fn:_(()=>[n(`div`,{class:d(r.$style.notFound)},[m(l(b),{color:`text-base`},{default:_(()=>[t(s(l(z).baseText(`templates.workflowsNotFound`)),1)]),_:1})],2)]),key:`0`}:void 0,U.value?void 0:{name:`content`,fn:_(()=>[n(`div`,{class:d(r.$style.previewWrapper)},[n(`div`,{class:d(r.$style.image)},[H.value?(e(),g(j,{key:0,loading:V.value,workflow:Q.value,onClose:X},null,8,[`loading`,`workflow`])):c(``,!0)],2)],2),n(`div`,{class:d(r.$style.contentContainer)},[n(`div`,{class:d(r.$style.content)},[n(`div`,{class:d(r.$style.templateCard)},[J.value?(e(),g(A,{key:0,template:J.value,"show-details":!0},{belowContent:_(()=>[m(l(x),{"data-test-id":`use-template-button`,label:l(z).baseText(`template.buttons.tryTemplate`),size:`large`,onClick:i[0]||=p(e=>Y(q.value,e),[`stop`])},null,8,[`label`])]),_:1},8,[`template`])):c(``,!0)],2),n(`div`,{class:d(r.$style.markdown),"data-test-id":`template-description`},[m(l(y),{content:J.value?.description,images:J.value?.image,loading:V.value},null,8,[`content`,`images`,`loading`])],2)],2)],2)]),key:`1`}]),1024))}}),[[`__cssModules`,{$style:{notFound:`_notFound_1t3tp_125`,previewWrapper:`_previewWrapper_1t3tp_129`,image:`_image_1t3tp_133`,button:`_button_1t3tp_143`,contentContainer:`_contentContainer_1t3tp_151`,content:`_content_1t3tp_151`,templateCard:`_templateCard_1t3tp_167`,markdown:`_markdown_1t3tp_182`}}]]);export{P as default};
//# sourceMappingURL=TemplatesWorkflowView-DM-N2gQu.js.map