cortex-react-components 2.20.1 → 2.22.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.
Files changed (173) hide show
  1. package/dist/{chunk-MGSTQLZC.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-6FHRZHAJ.mjs → chunk-2HWSTGAP.mjs} +1 -1
  3. package/dist/{chunk-R33MOMFK.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  4. package/dist/{chunk-UPRS7OYQ.mjs → chunk-2UNIT7NC.mjs} +1 -1
  5. package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
  6. package/dist/{chunk-CTC6WSB6.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  7. package/dist/{chunk-CCJJAUGB.mjs → chunk-5WVFEIMC.mjs} +1 -1
  8. package/dist/{chunk-QZIJTAPO.mjs → chunk-62A35O55.mjs} +1 -1
  9. package/dist/{chunk-HLTP3ZQN.mjs → chunk-67QPOSVV.mjs} +1 -1
  10. package/dist/{chunk-VDFRWGXR.mjs → chunk-6PS55VJZ.mjs} +1 -1
  11. package/dist/{chunk-3EGSOIRH.mjs → chunk-7GMAMIHM.mjs} +1 -1
  12. package/dist/chunk-ADA43MGG.mjs +4 -0
  13. package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  14. package/dist/chunk-BIZO7KML.mjs +4 -0
  15. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  16. package/dist/{chunk-MAZGVZJN.mjs → chunk-DMCFEJ2C.mjs} +1 -1
  17. package/dist/{chunk-ANCSWAD7.mjs → chunk-ERJXTG6X.mjs} +1 -1
  18. package/dist/{chunk-GO42W2BM.mjs → chunk-FKU4VQR6.mjs} +1 -1
  19. package/dist/{chunk-D3YJZROI.mjs → chunk-FSCQ7GK7.mjs} +1 -1
  20. package/dist/{chunk-YPSUDHCJ.mjs → chunk-H3CJOE6S.mjs} +1 -1
  21. package/dist/{chunk-6EKGV4I2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  22. package/dist/{chunk-DX3G3FKT.mjs → chunk-I2GNNRFH.mjs} +1 -1
  23. package/dist/{chunk-W2LPR7SX.mjs → chunk-I6XKBCH4.mjs} +1 -1
  24. package/dist/{chunk-JNJJAJPI.mjs → chunk-IF3425JX.mjs} +1 -1
  25. package/dist/{chunk-G27V7B6H.mjs → chunk-INBT5E6T.mjs} +1 -1
  26. package/dist/{chunk-M456UF2N.mjs → chunk-K7NZWTGP.mjs} +1 -1
  27. package/dist/{chunk-MSFBSDB3.mjs → chunk-KYUPRUH5.mjs} +1 -1
  28. package/dist/chunk-LG4P3APU.mjs +4 -0
  29. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  30. package/dist/{chunk-RMZLEIRP.mjs → chunk-LJQPLE4S.mjs} +1 -1
  31. package/dist/{chunk-QILFMWE5.mjs → chunk-M7NV6EFH.mjs} +1 -1
  32. package/dist/{chunk-33CHGT4N.mjs → chunk-MXCW6SOT.mjs} +1 -1
  33. package/dist/{chunk-MFUZNS7C.mjs → chunk-N3B3XNV3.mjs} +1 -1
  34. package/dist/{chunk-MEVSHOG4.mjs → chunk-NWISIJFD.mjs} +1 -1
  35. package/dist/{chunk-5PJLI46T.mjs → chunk-OLIYPWO3.mjs} +1 -1
  36. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  37. package/dist/{chunk-YWRU7OE3.mjs → chunk-PK3OBSCB.mjs} +1 -1
  38. package/dist/{chunk-LLP4EFT4.mjs → chunk-PO3XUUWY.mjs} +1 -1
  39. package/dist/{chunk-CQAMS7RZ.mjs → chunk-Q2QAFOWG.mjs} +1 -1
  40. package/dist/{chunk-D6K6RO5P.mjs → chunk-R5P4ZICA.mjs} +1 -1
  41. package/dist/{chunk-N6CZEXLZ.mjs → chunk-S4PW6SKD.mjs} +1 -1
  42. package/dist/{chunk-TZCRIKIJ.mjs → chunk-VLVR5VHG.mjs} +1 -1
  43. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  44. package/dist/chunk-X4MQSO2K.mjs +4 -0
  45. package/dist/{chunk-OXKN6X62.mjs → chunk-XKGBG5FX.mjs} +1 -1
  46. package/dist/{chunk-VQBOJHZF.mjs → chunk-YKG4FNS4.mjs} +1 -1
  47. package/dist/{chunk-XYJ4S67W.mjs → chunk-ZEPEWKBV.mjs} +1 -1
  48. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  49. package/dist/components/Blocks/Banner.mjs +1 -1
  50. package/dist/components/Blocks/CallToAction.mjs +1 -1
  51. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  52. package/dist/components/Blocks/Content.mjs +1 -1
  53. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  54. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  55. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  56. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  57. package/dist/components/Blocks/index.mjs +1 -1
  58. package/dist/components/Cards/ContentCard.mjs +1 -1
  59. package/dist/components/Cards/FeatureCard.mjs +1 -1
  60. package/dist/components/Cards/index.mjs +1 -1
  61. package/dist/components/Chat/ChatInterface.mjs +1 -1
  62. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  63. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  64. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  65. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  66. package/dist/components/Chat/demo-tests.mjs +1 -1
  67. package/dist/components/Chat/demo.mjs +1 -1
  68. package/dist/components/Chat/example-usage.mjs +1 -1
  69. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  70. package/dist/components/Chat/index.mjs +1 -1
  71. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  72. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  73. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  74. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  75. package/dist/components/DigitalColleagues/document-edit.d.ts +2 -2
  76. package/dist/components/DigitalColleagues/document-edit.js +0 -1
  77. package/dist/components/DigitalColleagues/index.mjs +1 -1
  78. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  79. package/dist/components/Foundary/Knowledge/add-knowledge-modal.js +1 -1
  80. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  81. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  82. package/dist/components/Foundary/Login.css +1 -0
  83. package/dist/components/Foundary/Login.d.ts +61 -0
  84. package/dist/components/Foundary/Login.js +4 -0
  85. package/dist/components/Foundary/Login.mjs +2 -0
  86. package/dist/components/Foundary/MainPage.mjs +1 -1
  87. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  88. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  89. package/dist/components/Foundary/RichText/index.mjs +1 -1
  90. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  91. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  92. package/dist/components/Foundary/Views/KnowledgeView.d.ts +1 -1
  93. package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
  94. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  95. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  96. package/dist/components/Foundary/Views/index.js +1 -1
  97. package/dist/components/Foundary/Views/index.mjs +1 -1
  98. package/dist/components/Foundary/document-edit.mjs +1 -1
  99. package/dist/components/Foundary/document-preview-examples.js +3 -3
  100. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  101. package/dist/components/Foundary/document-preview.d.ts +1 -1
  102. package/dist/components/Foundary/document-preview.js +1 -1
  103. package/dist/components/Foundary/document-preview.mjs +1 -1
  104. package/dist/components/Foundary/index.d.ts +1 -0
  105. package/dist/components/Foundary/index.js +1 -1
  106. package/dist/components/Foundary/index.mjs +1 -1
  107. package/dist/components/Foundary/knowledge-browser.d.ts +1 -1
  108. package/dist/components/Foundary/knowledge-browser.js +1 -1
  109. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  110. package/dist/components/HeaderFooter/Header.mjs +1 -1
  111. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  112. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  113. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  114. package/dist/components/HeaderFooter/index.mjs +1 -1
  115. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  116. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  117. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  118. package/dist/components/Heros/PostHero/index.mjs +1 -1
  119. package/dist/components/Heros/RenderHero.mjs +1 -1
  120. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  121. package/dist/components/Heros/index.mjs +1 -1
  122. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  123. package/dist/components/Holidays/index.mjs +1 -1
  124. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  125. package/dist/components/Layouts/Print.mjs +1 -1
  126. package/dist/components/Layouts/SlideShow.mjs +1 -1
  127. package/dist/components/Layouts/index.mjs +1 -1
  128. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  129. package/dist/components/Menus/SidebarRight.mjs +1 -1
  130. package/dist/components/Menus/index.mjs +1 -1
  131. package/dist/components/Other/index.mjs +1 -1
  132. package/dist/components/Payload/RichText/index.mjs +1 -1
  133. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  134. package/dist/components/Payload/index.mjs +1 -1
  135. package/dist/components/Projects/EpicsView.mjs +1 -1
  136. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  137. package/dist/components/Projects/ProjectPage.mjs +1 -1
  138. package/dist/components/Projects/ProjectView.mjs +1 -1
  139. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  140. package/dist/components/Projects/index.mjs +1 -1
  141. package/dist/components/dc-temp/index.mjs +1 -1
  142. package/dist/components/index.js +20 -20
  143. package/dist/components/index.mjs +1 -1
  144. package/dist/components/ui/index.mjs +1 -1
  145. package/dist/components/ui/sidebar.mjs +1 -1
  146. package/dist/globals.css +1 -1
  147. package/dist/index.js +25 -25
  148. package/dist/index.mjs +1 -1
  149. package/dist/metafile-cjs.json +1 -1
  150. package/dist/metafile-esm.json +1 -1
  151. package/dist/pages/Blog.mjs +1 -1
  152. package/dist/pages/Documentation.mjs +1 -1
  153. package/dist/pages/IndexPage.mjs +1 -1
  154. package/dist/pages/Intranet.mjs +1 -1
  155. package/dist/pages/LandingPage.mjs +1 -1
  156. package/dist/pages/Page.mjs +1 -1
  157. package/dist/pages/Publish.mjs +1 -1
  158. package/dist/pages/Website.mjs +1 -1
  159. package/dist/sections/AboutSection.mjs +1 -1
  160. package/dist/sections/BlogDetail.mjs +1 -1
  161. package/dist/sections/BlogList.mjs +1 -1
  162. package/dist/sections/BlogListSection.mjs +1 -1
  163. package/dist/sections/ContactSection.mjs +1 -1
  164. package/dist/sections/PageSections.mjs +1 -1
  165. package/dist/sections/PricingSection.mjs +1 -1
  166. package/dist/sections/ServiceDetail.mjs +1 -1
  167. package/dist/sections/ServiceDetailSection.mjs +1 -1
  168. package/dist/sections/ServiceSection.mjs +1 -1
  169. package/dist/sections/index.mjs +1 -1
  170. package/package.json +1 -1
  171. package/dist/chunk-4CHIFK3W.mjs +0 -4
  172. package/dist/chunk-PE5L5LZL.mjs +0 -4
  173. package/dist/chunk-V4W2JDQB.mjs +0 -4
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as $}from"./chunk-V4W2JDQB.mjs";import{a as O}from"./chunk-FT3AE7L2.mjs";import{a as H}from"./chunk-L5JPAKPM.mjs";import{motion as h}from"motion/react";import{ChevronRight as U,File as M,FileText as K,Search as A}from"lucide-react";import{useState as b,useMemo as P,useEffect as Q}from"react";import{Fragment as T,jsx as e,jsxs as r}from"react/jsx-runtime";function j({label:f,documents:s,children:d,level:u,onDocumentClick:w,selectedDocumentId:g,showDocumentCount:y=!0}){let[c,a]=b(u===0),N=d&&Object.keys(d).length>0,v=s.length+(d?Object.values(d).reduce((t,n)=>t+n.documents.length,0):0),D=t=>{switch(t){case"markdown":case"mdx":return e(K,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return e(M,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return e(M,{className:"h-3.5 w-3.5 text-muted-foreground"})}},x=t=>{let n=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return n[t%n.length]};return r("div",{className:"space-y-1",children:[(N||s.length>0)&&r(h.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${c?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${u*20}px`},onClick:()=>a(!c),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:`w-1 h-6 rounded-full ${x(u)}`}),e(h.div,{animate:{rotate:c?90:0},transition:{duration:.2},className:"flex-shrink-0",children:e(U,{className:"h-4 w-4 text-muted-foreground"})}),r("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:e("span",{className:"font-medium text-foreground truncate",children:f})}),y&&v>0&&e("div",{className:"flex-shrink-0 ml-2",children:e("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:v})})]})]}),e(h.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:r("div",{className:"pt-2 space-y-1",children:[s.map((t,n)=>r(h.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:n*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${g===t.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${u*20+20}px`},onClick:()=>w?.(t),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:"flex-shrink-0",children:D(t.format)}),r("div",{className:"flex-1 min-w-0",children:[e("p",{className:`text-sm truncate transition-colors ${g===t.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:t.title}),t.description&&e("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t.description})]}),t.tags&&t.tags.length>0&&e("div",{className:"flex-shrink-0",children:e("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:t.tags[0]})})]},t.id)),d&&Object.entries(d).map(([t,n])=>e(j,{label:t,documents:n.documents,children:n.children,level:u+1,onDocumentClick:w,selectedDocumentId:g,showDocumentCount:y},t))]})})]})}function Z({documents:f,menuConfig:s,onDocumentClick:d,onDocumentShare:u,onDocumentUpdate:w,selectedDocumentId:g,className:y,editable:c=!0}){let[a,N]=b(""),[v,D]=b(null),[x,t]=b(f);Q(()=>{t(f)},[f]);let n=P(()=>a?x.filter(o=>o.title.toLowerCase().includes(a.toLowerCase())||o.description?.toLowerCase().includes(a.toLowerCase())||o.tags?.some(l=>l.toLowerCase().includes(a.toLowerCase()))||Object.values(o.metadata||{}).some(l=>String(l).toLowerCase().includes(a.toLowerCase()))):x,[x,a]),S=P(()=>{let o=(l,L)=>{if(L.length===0)return{};let[E,...B]=L;return l.reduce((i,C)=>{let F=C.metadata?.[E]||"Uncategorized",m=String(F);if(i[m]||(i[m]={documents:[],children:{}}),B.length===0)i[m].documents.push(C);else{let k=o([C],B),p=Object.keys(k)[0];p&&(i[m].children||(i[m].children={}),i[m].children[p]?i[m].children[p].documents.push(...k[p].documents):i[m].children[p]=k[p])}return i},{})};return o(n,s.groupBy)},[n,s.groupBy]),I=o=>{D(o),d?.(o)};return r("div",{className:`flex h-full ${y||""}`,children:[r("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[e("div",{className:"p-6 border-b border-border",children:r("div",{className:"relative",children:[e("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e(A,{className:"h-4 w-4 text-muted-foreground"})}),e(H,{placeholder:"Search knowledge base...",value:a,onChange:o=>N(o.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),e(O,{className:"h-[calc(100%-100px)]",children:e("div",{className:"p-4 space-y-3",children:s.groupBy.length===0?e(T,{children:e(j,{label:"Document",documents:n,level:0,onDocumentClick:I,selectedDocumentId:g,showDocumentCount:s.showDocumentCount},"Document")}):r(T,{children:[Object.entries(S).map(([o,l])=>e(j,{label:o,documents:l.documents,children:l.children,level:0,onDocumentClick:I,selectedDocumentId:g,showDocumentCount:s.showDocumentCount},o)),Object.keys(S).length===0&&r(h.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[e("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:e(K,{className:"h-8 w-8 text-muted-foreground"})}),e("p",{className:"text-sm font-medium",children:"No documents found"}),e("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),e("div",{className:"flex-1 bg-background overflow-scroll",children:v?e($,{document:v,onDocumentUpdate:w,editable:c}):e("div",{className:"h-full flex items-center justify-center text-center",children:r(h.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[e("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:e(K,{className:"h-10 w-10 text-primary"})}),e("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),e("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}export{Z as a};
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as w}from"./chunk-TZCRIKIJ.mjs";import{a as N}from"./chunk-N6CZEXLZ.mjs";import{a as b,c as v,e as h}from"./chunk-3UMMMQEH.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{a as x}from"./chunk-MDJREBVI.mjs";import{motion as y}from"motion/react";import{File as k,FileText as D,Edit3 as z,Type as X,ChevronDown as F,ChevronRight as U,Info as R}from"lucide-react";import{useEffect as $,useState as c}from"react";import*as T from"@radix-ui/react-dialog";import A from"react-markdown";import G from"remark-gfm";import{Fragment as H,jsx as e,jsxs as o}from"react/jsx-runtime";var K=s=>e(A,{remarkPlugins:[G],components:{h1:({children:t})=>e("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>e("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>e("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>e("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>e("ol",{className:"list-decimal",children:t}),ul:({children:t})=>e("ul",{className:"list-disc",children:t}),li:({children:t})=>e("li",{className:"ml-4",children:t}),p:({children:t})=>e("p",{className:"mb-4",children:t}),a:({children:t,href:n})=>e("a",{href:n,className:"text-blue-500",children:t}),img:({src:t,alt:n})=>e("img",{src:t,alt:n,className:"mb-4"}),blockquote:({children:t})=>e("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:s}),C=s=>e("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:s}),J=s=>e("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:s&&e(N,{value:JSON.stringify(s),editable:!1,name:"richTextContent"})}),Z=s=>o("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[e("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:o("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[e("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),K(s)]});function de({document:s,onDocumentUpdate:t,editable:n=!0,mode:u="view",renderers:P,availableDocuments:M=[],knowledgeContexts:O=[]}){let[E,l]=c(!1),[i,j]=c(!1),[r,g]=c(s);$(()=>{g(s)},[s]);let L=a=>{switch(a){case"markdown":case"mdx":return e(D,{className:"h-6 w-6 text-primary"});case"richText":return e(k,{className:"h-6 w-6 text-success"});case"text":return e(X,{className:"h-6 w-6 text-muted-foreground"});default:return e(k,{className:"h-6 w-6 text-muted-foreground"})}},I=a=>{switch(a){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},S=(a,d)=>{let q={markdown:K,mdx:Z,text:C},p=P?.[d]||q[d];if(d==="richText"&&typeof a=="object")return J(a);if(p&&typeof a=="string")return p(a);if(typeof a=="string")return C(a)},B=a=>{l(!1),t?.(a),g(a)},f=()=>{l(!1)};return o(H,{children:[e(b,{open:E||u==="create",onOpenChange:a=>!a&&f(),children:o(v,{children:[e(h,{}),e(T.Content,{className:x("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:e(w,{mode:u==="create"?"create":"edit",document:r,onSave:B,onCancel:f,availableDocuments:M,knowledgeContexts:O})})]})}),o(y.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[o("div",{className:"border-b border-border bg-card p-8 pb-6",children:[o("div",{className:"flex items-start justify-between gap-4",children:[e("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:o("div",{className:"flex-1 min-w-0",children:[o("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[r.title,e("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${I(r.format)}`,children:r.format.toUpperCase()})]}),r.description&&e("p",{className:"text-muted-foreground text-lg leading-relaxed",children:r.description})]})}),o("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[r.metadata&&Object.keys(r.metadata).length>0&&o(m,{variant:"ghost",size:"sm",onClick:()=>j(!i),className:"gap-2",children:[e(R,{className:"h-4 w-4"}),"Metadata",i?e(F,{className:"h-4 w-4"}):e(U,{className:"h-4 w-4"})]}),n&&o(m,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[e(z,{className:"h-4 w-4"}),"Edit"]})]})]}),r.metadata&&Object.keys(r.metadata).length>0&&e(y.div,{initial:!1,animate:{height:i?"auto":0,opacity:i?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:o("div",{className:"pt-4 border-t border-border mt-4",children:[o("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[e(R,{className:"h-4 w-4"}),"Document Metadata"]}),e("div",{className:"bg-muted rounded-lg p-4 border border-border",children:e("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(r.metadata).map(([a,d])=>o("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:a.replace(/([A-Z])/g," $1").trim()}),e("span",{className:"text-foreground font-medium",children:String(d)})]},a))})})]})})]}),e("div",{className:"flex-1 ",children:e("div",{className:"py-4 h-full",children:e("div",{className:"space-y-4",children:r.content||r.richTextContent?e("div",{className:"relative",children:e("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:S(r.format==="richText"?r.richTextContent:r.content,r.format)})}):o("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[e("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:e(D,{className:"h-8 w-8 text-muted-foreground"})}),e("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),e("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}export{de as a};