decocms
Version:
Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools
2 lines (1 loc) • 3.63 kB
JavaScript
import{c as N,j as i,r as _,m as R,b as T}from"./index-ztdGKvBm.js";import{a as v}from"./UserCheck01-k-4bTA2h.js";import{O as P,S as K,I as D,a as I}from"./held-block-view-QD0AvQ2Q.js";import{t as W}from"./ChevronDown-XsLJSrfl.js";import{C as y,a as Y,b as w}from"./collapsible-CadTVXY4.js";import{ai as B,W as L}from"./category-tree-DGOo1BAt.js";function $(l){const e=N.c(2);let t;return e[0]!==l?(t=i.jsx(P,{children:i.jsx(K,{...l})}),e[0]=l,e[1]=t):t=e[1],t}function A(l){const e=N.c(18),{icon:t,title:o,defaultOpen:c,children:d}=l,j=c===void 0?!1:c,[f,C]=_.useState(j);let m;e[0]!==t?(m=i.jsx(t,{size:15}),e[0]=t,e[1]=m):m=e[1];let s;e[2]!==o?(s=i.jsx("span",{className:"flex-1 text-left",children:o}),e[2]=o,e[3]=s):s=e[3];const b=f&&"rotate-180";let n;e[4]!==b?(n=R("transition-transform",b),e[4]=b,e[5]=n):n=e[5];let p;e[6]!==n?(p=i.jsx(W,{size:15,className:n}),e[6]=n,e[7]=p):p=e[7];let r;e[8]!==m||e[9]!==s||e[10]!==p?(r=i.jsx(y,{asChild:!0,children:i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer",children:[m,s,p]})}),e[8]=m,e[9]=s,e[10]=p,e[11]=r):r=e[11];let a;e[12]!==d?(a=i.jsx(Y,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=a):a=e[13];let u;return e[14]!==f||e[15]!==r||e[16]!==a?(u=i.jsxs(w,{open:f,onOpenChange:C,className:"mt-4",children:[r,a]}),e[14]=f,e[15]=r,e[16]=a,e[17]=u):u=e[17],u}function Z(l){const e=N.c(32),{schema:t,value:o,onChange:c,basePath:d,meta:j,decofile:f,sandbox:C,onSaveReferencedBlock:m}=l,s=T();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const[n,p]=_.useState(b);if(!t)return null;let r;e[1]!==s?(r=s("sandbox.blogCustomFields.title"),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==s?(a=s("sandbox.blogCustomFields.description"),e[3]=s,e[4]=a):a=e[4];let u;e[5]!==a?(u=i.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:a}),e[5]=a,e[6]=u):u=e[6];let x;e[7]!==s?(x=s("sandbox.blogCustomFields.breadcrumbLabel"),e[7]=s,e[8]=x):x=e[8];let h;e[9]!==s?(h=s("sandbox.blogCustomFields.backToFields"),e[9]=s,e[10]=h):h=e[10];let g;e[11]!==n||e[12]!==x||e[13]!==h?(g=i.jsx(D,{path:n,onNavigate:p,label:x,backTitle:h}),e[11]=n,e[12]=x,e[13]=h,e[14]=g):g=e[14];let S;e[15]!==c?(S=F=>c(F),e[15]=c,e[16]=S):S=e[16];let E;e[17]!==d||e[18]!==n||e[19]!==f||e[20]!==j||e[21]!==m||e[22]!==C||e[23]!==t||e[24]!==S||e[25]!==o?(E=i.jsx($,{schema:t,value:o,onChange:S,basePath:d,breadcrumbPath:n,onBreadcrumbChange:p,meta:j,decofile:f,sandbox:C,onSaveReferencedBlock:m}),e[17]=d,e[18]=n,e[19]=f,e[20]=j,e[21]=m,e[22]=C,e[23]=t,e[24]=S,e[25]=o,e[26]=E):E=e[26];let O;return e[27]!==r||e[28]!==u||e[29]!==g||e[30]!==E?(O=i.jsxs(A,{icon:v,title:r,children:[u,g,E]}),e[27]=r,e[28]=u,e[29]=g,e[30]=E,e[31]=O):O=e[31],O}function k(l,e){if(!e)return null;const o=I(B[l],e)?.properties?.[L[l]];if(!o)return null;const c=o.properties?o:o.plainSchema;return c?.properties?c:null}const z=new Set(["__resolveType","@type"]);function G(l,e){const t=l?.properties;if(!t)return null;const o=Object.fromEntries(Object.entries(t).filter(([c,d])=>!e.has(c)&&!z.has(c)&&d.hidden!==!0));return Object.keys(o).length===0?null:{type:"object",properties:o}}function ee(l,e,t){return G(k(l,e),t)}const V=["title","slug","excerpt","date","readTime","image","mobileImage","alt","authors","categories","sections","seo","extraProps","scheduledDatetime","status","dateModified","planning","content"],te=new Set(V),M=["name","slug","parentSlug","description","sections"],se=new Set(M);export{Z as C,te as K,$ as S,A as a,ee as b,se as c};