cortex-react-components 2.18.7 → 2.19.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 (150) hide show
  1. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  2. package/dist/{chunk-FYQBRCQM.mjs → chunk-2BRDNDUB.mjs} +1 -1
  3. package/dist/{chunk-2OOJ4ZFB.mjs → chunk-3HNU2NYP.mjs} +1 -1
  4. package/dist/{chunk-HDKHF3EA.mjs → chunk-3NRXQBBS.mjs} +1 -1
  5. package/dist/{chunk-FEWOSBUJ.mjs → chunk-3Y7QG6VP.mjs} +1 -1
  6. package/dist/{chunk-MO4HRQEL.mjs → chunk-5MWZTJYP.mjs} +1 -1
  7. package/dist/{chunk-UECG3SCG.mjs → chunk-5PJLI46T.mjs} +1 -1
  8. package/dist/{chunk-DPZHVBGG.mjs → chunk-6MSM3CZ6.mjs} +1 -1
  9. package/dist/{chunk-BQQ4V4PX.mjs → chunk-75F3LJMX.mjs} +1 -1
  10. package/dist/{chunk-4SRUEQTP.mjs → chunk-7R47MHQE.mjs} +1 -1
  11. package/dist/{chunk-WHDV4REI.mjs → chunk-AEACICA7.mjs} +1 -1
  12. package/dist/{chunk-PTZT4QJW.mjs → chunk-AJQHGVZ5.mjs} +1 -1
  13. package/dist/{chunk-HKMNAXLM.mjs → chunk-C4RWEPVF.mjs} +1 -1
  14. package/dist/{chunk-V6GK2FJG.mjs → chunk-CQAMS7RZ.mjs} +1 -1
  15. package/dist/{chunk-7OMPPFGG.mjs → chunk-CXOVEABI.mjs} +1 -1
  16. package/dist/{chunk-R6AYIVIR.mjs → chunk-EM3T2XYC.mjs} +1 -1
  17. package/dist/{chunk-PNUBVBSR.mjs → chunk-FE7ZGUPU.mjs} +1 -1
  18. package/dist/{chunk-F64CA5CH.mjs → chunk-GHOL5L32.mjs} +1 -1
  19. package/dist/chunk-GLARGNXX.mjs +4 -0
  20. package/dist/{chunk-G2DUU25F.mjs → chunk-GTZDHELR.mjs} +1 -1
  21. package/dist/{chunk-P6OSMPUQ.mjs → chunk-GTZJWMZR.mjs} +1 -1
  22. package/dist/{chunk-4DR4ILAP.mjs → chunk-H7NKR2WR.mjs} +1 -1
  23. package/dist/chunk-HEKQ55BA.mjs +4 -0
  24. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  25. package/dist/{chunk-5EQXJS23.mjs → chunk-JCWFPKF3.mjs} +1 -1
  26. package/dist/{chunk-ITJH72Z2.mjs → chunk-LAQ3QAUW.mjs} +1 -1
  27. package/dist/{chunk-KZAYLEFB.mjs → chunk-LJXTXROJ.mjs} +1 -1
  28. package/dist/{chunk-L5NPH5RX.mjs → chunk-LLP4EFT4.mjs} +1 -1
  29. package/dist/{chunk-U3FYDDE2.mjs → chunk-NINFDOV5.mjs} +1 -1
  30. package/dist/{chunk-RIRZRO6U.mjs → chunk-P55W6AFU.mjs} +1 -1
  31. package/dist/chunk-PLOUY2B7.mjs +4 -0
  32. package/dist/{chunk-D6K6RO5P.mjs → chunk-R5P4ZICA.mjs} +1 -1
  33. package/dist/{chunk-GETYSIZV.mjs → chunk-RGOKBIQ5.mjs} +1 -1
  34. package/dist/{chunk-GAZHKHGB.mjs → chunk-RJGYVDOU.mjs} +1 -1
  35. package/dist/{chunk-6R6NYDWN.mjs → chunk-RS4VD3ML.mjs} +1 -1
  36. package/dist/{chunk-T5HJS6OF.mjs → chunk-RSDUFAIB.mjs} +1 -1
  37. package/dist/{chunk-OQCMTGML.mjs → chunk-TVTTUSWM.mjs} +1 -1
  38. package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
  39. package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
  40. package/dist/chunk-W2LPR7SX.mjs +1 -0
  41. package/dist/{chunk-2GM2LPLB.mjs → chunk-WIRQ5IRT.mjs} +1 -1
  42. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  43. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  44. package/dist/{chunk-3ANJOET7.mjs → chunk-ZEALRBXW.mjs} +1 -1
  45. package/dist/components/Blocks/Banner.mjs +1 -1
  46. package/dist/components/Blocks/CallToAction.mjs +1 -1
  47. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  48. package/dist/components/Blocks/Content.mjs +1 -1
  49. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  50. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  51. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  52. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  53. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  54. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  55. package/dist/components/Blocks/index.mjs +1 -1
  56. package/dist/components/Cards/ContentCard.mjs +1 -1
  57. package/dist/components/Cards/FeatureCard.mjs +1 -1
  58. package/dist/components/Cards/index.mjs +1 -1
  59. package/dist/components/Chat/ChatInterface.mjs +1 -1
  60. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  61. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  62. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  63. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  64. package/dist/components/Chat/demo-tests.mjs +1 -1
  65. package/dist/components/Chat/demo.mjs +1 -1
  66. package/dist/components/Chat/example-usage.mjs +1 -1
  67. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  68. package/dist/components/Chat/index.mjs +1 -1
  69. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  70. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  71. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  72. package/dist/components/DigitalColleagues/index.mjs +1 -1
  73. package/dist/components/Foundary/Knowledge/add-knowledge-modal.js +1 -1
  74. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  75. package/dist/components/Foundary/MainPage.mjs +1 -1
  76. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  77. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  78. package/dist/components/Foundary/Views/KnowledgeView.js +1 -2
  79. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  80. package/dist/components/Foundary/Views/index.js +1 -1
  81. package/dist/components/Foundary/Views/index.mjs +1 -1
  82. package/dist/components/Foundary/document-edit.js +1 -1
  83. package/dist/components/Foundary/document-edit.mjs +1 -1
  84. package/dist/components/Foundary/document-preview-examples.js +5 -5
  85. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  86. package/dist/components/Foundary/document-preview.js +1 -1
  87. package/dist/components/Foundary/document-preview.mjs +1 -1
  88. package/dist/components/Foundary/index.js +1 -1
  89. package/dist/components/Foundary/index.mjs +1 -1
  90. package/dist/components/Foundary/knowledge-browser.js +1 -1
  91. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  92. package/dist/components/HeaderFooter/Header.mjs +1 -1
  93. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  94. package/dist/components/HeaderFooter/index.mjs +1 -1
  95. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  96. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  97. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  98. package/dist/components/Heros/RenderHero.mjs +1 -1
  99. package/dist/components/Heros/index.mjs +1 -1
  100. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  101. package/dist/components/Holidays/index.mjs +1 -1
  102. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  103. package/dist/components/Layouts/Print.mjs +1 -1
  104. package/dist/components/Layouts/SlideShow.mjs +1 -1
  105. package/dist/components/Layouts/index.mjs +1 -1
  106. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  107. package/dist/components/Payload/Media/index.mjs +1 -1
  108. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  109. package/dist/components/Payload/RichText/index.mjs +1 -1
  110. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  111. package/dist/components/Payload/index.mjs +1 -1
  112. package/dist/components/Projects/EpicsView.mjs +1 -1
  113. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  114. package/dist/components/Projects/ProjectPage.mjs +1 -1
  115. package/dist/components/Projects/ProjectView.mjs +1 -1
  116. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  117. package/dist/components/Projects/index.mjs +1 -1
  118. package/dist/components/dc-temp/index.mjs +1 -1
  119. package/dist/components/index.js +20 -20
  120. package/dist/components/index.mjs +1 -1
  121. package/dist/globals.css +1 -1
  122. package/dist/index.js +25 -25
  123. package/dist/index.mjs +1 -1
  124. package/dist/metafile-cjs.json +1 -1
  125. package/dist/metafile-esm.json +1 -1
  126. package/dist/pages/Blog.mjs +1 -1
  127. package/dist/pages/Documentation.mjs +1 -1
  128. package/dist/pages/IndexPage.mjs +1 -1
  129. package/dist/pages/Intranet.mjs +1 -1
  130. package/dist/pages/LandingPage.mjs +1 -1
  131. package/dist/pages/Page.mjs +1 -1
  132. package/dist/pages/Publish.mjs +1 -1
  133. package/dist/pages/Website.mjs +1 -1
  134. package/dist/sections/AboutSection.mjs +1 -1
  135. package/dist/sections/BlogDetail.mjs +1 -1
  136. package/dist/sections/BlogList.mjs +1 -1
  137. package/dist/sections/BlogListSection.mjs +1 -1
  138. package/dist/sections/ContactSection.mjs +1 -1
  139. package/dist/sections/PageSections.mjs +1 -1
  140. package/dist/sections/PricingSection.mjs +1 -1
  141. package/dist/sections/ServiceDetail.mjs +1 -1
  142. package/dist/sections/ServiceDetailSection.mjs +1 -1
  143. package/dist/sections/ServiceSection.mjs +1 -1
  144. package/dist/sections/form/index.mjs +1 -1
  145. package/dist/sections/index.mjs +1 -1
  146. package/package.json +1 -1
  147. package/dist/chunk-3DZFESHK.mjs +0 -4
  148. package/dist/chunk-3F6AUCZF.mjs +0 -1
  149. package/dist/chunk-3ZQFJ5WD.mjs +0 -4
  150. package/dist/chunk-HHPTGV4F.mjs +0 -4
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as D}from"./chunk-QAJBJFRP.mjs";import{a as v,c as p,d as h,g as N,i as c}from"./chunk-YFAZQYK4.mjs";import{a as b}from"./chunk-B4H6T2GP.mjs";import{a as g}from"./chunk-L5JPAKPM.mjs";import{b as i}from"./chunk-ZUA4KNIR.mjs";import{motion as $}from"motion/react";import{Edit3 as O,Save as P,X as K,Plus as X}from"lucide-react";import{useEffect as q,useState as k}from"react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function Z({document:x,onSave:T,mode:E="edit",onCancel:M,availableDocuments:y=[],knowledgeContexts:A=[]}){let[l,r]=k({...x,updatedAt:new Date}),[C,V]=k(l.richTextContent);q(()=>{r(x)},[x]);let _=()=>{let t=new Set,a=new Set;return A.forEach(n=>{n.menuConfig.groupBy.forEach(d=>t.add(d))}),y.forEach(n=>{n.metadata&&Object.keys(n.metadata).forEach(d=>a.add(d))}),{contextKeys:Array.from(t).sort(),documentKeys:Array.from(a).sort(),allKeys:Array.from(new Set([...t,...a])).sort()}},B=t=>{let a=new Set;return y.forEach(n=>{n.metadata?.[t]&&a.add(String(n.metadata[t]))}),Array.from(a).sort()},m=_(),F=()=>{T({...l,richTextContent:C})},u=(t,a)=>{r(n=>({...n,metadata:{...n.metadata,[t]:a}}))},I=(t,a)=>{a==="__custom__"?u(t,""):u(t,a)},j=()=>{u("","")},z=t=>{r(a=>{let n={...a.metadata};return delete n[t],{...a,metadata:n}})};return o($.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",children:[o("div",{className:"flex items-start justify-between gap-4 mb-6",children:[o("div",{className:"flex items-center gap-3",children:[e("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:e(O,{className:"h-6 w-6 text-primary"})}),e("h1",{className:"text-2xl font-bold text-foreground",children:E==="edit"?"Edit Document":"Create Document"})]}),o("div",{className:"flex gap-2",children:[o(i,{variant:"outline",size:"sm",onClick:M,className:"gap-2",children:[e(K,{className:"h-4 w-4"}),"Cancel"]}),o(i,{size:"sm",onClick:F,className:"gap-2",children:[e(P,{className:"h-4 w-4"}),"Save Changes"]})]})]}),o("div",{className:"space-y-4",children:[o("div",{children:[e("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),e(g,{value:l.title,onChange:t=>r(a=>({...a,title:t.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),o("div",{children:[e("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),e(b,{value:l.description||"",onChange:t=>r(a=>({...a,description:t.target.value})),placeholder:"Document description...",rows:2})]}),o("div",{children:[o("div",{className:"flex items-center justify-between mb-3",children:[o("div",{children:[e("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),m.contextKeys.length>0&&o("p",{className:"text-xs text-muted-foreground",children:["Suggested: ",m.contextKeys.slice(0,4).join(", "),m.contextKeys.length>4&&` +${m.contextKeys.length-4}`]})]}),o(i,{type:"button",variant:"outline",size:"sm",onClick:j,className:"gap-1 h-8",children:[e(X,{className:"h-3 w-3"}),"Add"]})]}),l.metadata&&Object.keys(l.metadata).length>0?e("div",{className:"space-y-2",children:Object.entries(l.metadata).map(([t,a],n)=>{let d=B(t);return o("div",{className:"flex gap-2 items-center",children:[e(g,{value:t,onChange:s=>{let S=s.target.value||"",R=l.metadata?.[t];r(w=>{let f={...w.metadata};return delete f[t],S&&(f[S]=R||""),{...w,metadata:f}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${t}`}),e("datalist",{id:`metadata-keys-${t}`,children:m.allKeys.map(s=>e("option",{value:s},s))}),e("span",{className:"text-muted-foreground text-sm",children:"="}),d.length>0?o(v,{value:String(a||""),onValueChange:s=>I(t,s),children:[e(h,{className:"flex-1 h-8 text-sm",children:e(p,{placeholder:"Value"})}),o(N,{children:[d.map(s=>e(c,{value:s,children:s},s)),e(c,{value:"__custom__",children:e("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):e(g,{value:String(a||""),onChange:s=>u(t,s.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),e(i,{type:"button",variant:"ghost",size:"sm",onClick:()=>z(t),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:e(K,{className:"h-3 w-3"})})]},`metadata-key-${n}`)})}):e("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:e("p",{className:"text-xs text-muted-foreground",children:'No metadata \u2022 Click "Add" to create fields'})})]}),o("div",{className:"flex items-center gap-2",children:[e("span",{className:"text-sm font-medium text-foreground",children:"Format"}),o(v,{value:l.format,onValueChange:t=>r(a=>({...a,format:t})),children:[e(h,{className:"flex-1 h-8 text-sm",children:e(p,{placeholder:"Format"})}),o(N,{children:[e(c,{value:"markdown",children:"Markdown"}),e(c,{value:"richText",children:"Rich Text"})]})]})]})]})]}),e("div",{className:"flex-1 ",children:o("div",{className:"p-8",children:[e("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),l.format==="richText"?e(D,{setValue:V,value:C,name:"richTextContent"}):e(b,{value:l.content||"",onChange:t=>r(a=>({...a,content:t.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}export{Z as a};
@@ -1 +0,0 @@
1
- import{a as K,c as b,d as D,g as A,i as h}from"./chunk-YFAZQYK4.mjs";import{a as v}from"./chunk-TVZOULLL.mjs";import{a as w,f as S,g as N,i as C}from"./chunk-3UMMMQEH.mjs";import{a as m}from"./chunk-L5JPAKPM.mjs";import{b as c}from"./chunk-ZUA4KNIR.mjs";import{Plus as z,Save as E,X as k}from"lucide-react";import{useState as P}from"react";import{jsx as t,jsxs as s}from"react/jsx-runtime";var J=({isOpen:M,onClose:f,onAddKnowledge:F,knowledgeContexts:I})=>{let[d,r]=P({name:"",description:"",metadata:[]}),_=e=>{e.preventDefault(),d.name&&(F({name:d.name,description:d.description,metadata:d.metadata,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",metadata:[]}),f())},B=()=>{r({name:"",description:"",metadata:[]}),f()},i=(()=>{let e=new Set,a=new Set;return I.forEach(o=>{o.menuConfig.groupBy.forEach(l=>e.add(l))}),{contextKeys:Array.from(e).sort(),documentKeys:Array.from(a).sort(),allKeys:Array.from(new Set([...e,...a])).sort()}})(),V=e=>{let a=new Set;return Array.from(a).sort()},g=(e,a)=>{r(o=>{let l=o.metadata.find(n=>n.key===e);return l&&(l.value=a),{...o,metadata:[...o.metadata.filter(n=>n.key!==e),{key:e,value:a}]}})},O=(e,a)=>{a==="__custom__"?g(e,""):g(e,a)},L=()=>{g(" ","")},R=e=>{r(a=>{let o=[...a.metadata],l=o.findIndex(n=>n.key===e);return l!==-1&&o.splice(l,1),{...a,metadata:o}})};return t(w,{open:M,onOpenChange:B,children:s(S,{className:"sm:max-w-md",children:[t(N,{children:t(C,{children:"Add New Knowledge source"})}),s("form",{onSubmit:_,className:"space-y-4",children:[s("div",{className:"space-y-2",children:[s("div",{children:[t(v,{htmlFor:"name",children:"Name *"}),t(m,{id:"name",value:d.name,onChange:e=>r(a=>({...a,name:e.target.value})),required:!0})]}),s("div",{children:[t(v,{htmlFor:"name",children:"Description"}),t(m,{id:"name",value:d.description,onChange:e=>r(a=>({...a,description:e.target.value})),required:!0})]}),s("div",{className:"space-y-2",children:[s("div",{className:"flex items-center justify-between mb-3",children:[s("div",{children:[t(v,{htmlFor:"metadata",children:"Metadata"}),i.contextKeys.length>0&&s("p",{className:"text-xs text-muted-foreground",children:["Suggested: ",i.contextKeys.slice(0,4).join(", "),i.contextKeys.length>4&&` +${i.contextKeys.length-4}`]})]}),s(c,{type:"button",variant:"outline",size:"sm",onClick:L,className:"gap-1 h-8",children:[t(z,{className:"h-3 w-3"}),"Add"]})]}),d.metadata&&d.metadata.length>0?t("div",{className:"space-y-2",children:d.metadata.map(({key:e,value:a},o)=>{let l=V(e);return s("div",{className:"flex gap-2 items-center",children:[t(m,{value:e,onChange:n=>{let x=n.target.value||" ",T=d.metadata.find(u=>u.key===e)?.value;r(u=>{let p=[...u.metadata],y=p.findIndex($=>$.key===e);return y!==-1&&p.splice(y,1),x&&p.push({key:x,value:T||""}),{...u,metadata:p}}),n.target.focus()},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${e}`}),t("datalist",{id:`metadata-keys-${e}`,children:i.allKeys.map(n=>t("option",{value:n},n))}),t("span",{className:"text-muted-foreground text-sm",children:"="}),l.length>0?s(K,{value:String(a||""),onValueChange:n=>O(e,n),children:[t(D,{className:"flex-1 h-8 text-sm",children:t(b,{placeholder:"Value"})}),s(A,{children:[l.map(n=>t(h,{value:n,children:n},n)),t(h,{value:"__custom__",children:t("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):t(m,{value:String(a||""),onChange:n=>g(e,n.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),t(c,{type:"button",variant:"ghost",size:"sm",onClick:()=>R(e),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:t(k,{className:"h-3 w-3"})})]},`metadata-key-${o}`)})}):t("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:t("p",{className:"text-xs text-muted-foreground",children:'No metadata \u2022 Click "Add" to create fields'})})]})]}),s("div",{className:"flex justify-end gap-3 pt-4",children:[s(c,{variant:"outline",size:"sm",onClick:f,className:"gap-2",children:[t(k,{className:"h-4 w-4"}),"Cancel"]}),s(c,{type:"submit",children:[t(E,{className:"h-4 w-4"}),"Create"]})]})]})]})})};export{J as a};
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as g}from"./chunk-U2OXF7PJ.mjs";import{a as p}from"./chunk-3F6AUCZF.mjs";import{a as u}from"./chunk-4DR4ILAP.mjs";import{a as c}from"./chunk-Z22NSJMF.mjs";import{useEffect as A,useState as r}from"react";import{Fragment as y,jsx as e,jsxs as t}from"react/jsx-runtime";function N({documents:f=[],contexts:n=[],onDocumentClick:w=o=>console.log("Document clicked:",o),onDocumentShare:v=o=>console.log("Share document:",o),onLoadDocumentContent:k,selectedDocumentId:x,onAddKnowledge:l,onAddTeamContext:a,onDocumentUpdate:C}){let[o,s]=r(n[0]),[K,i]=r(!1),[b,m]=r(!1);A(()=>{!o&&n&&n.length>0&&s(n[0])},[n]);let h=d=>{l&&l(d),i(!1)},D=d=>{a&&a(d),m(!1)};return t("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[t("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[e(c,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:l?{label:"Create",onClick:()=>i(!0)}:void 0,secondaryAction:a?{label:"Add Context",onClick:()=>m(!0)}:void 0}),n&&n.length>0&&t("div",{className:"mt-6",children:[e("div",{className:"border-b border-border",children:e("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:n.map(d=>t("button",{onClick:()=>s(d),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${o?.id===d.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[d.icon,d.label]},d.id))})}),o?.description&&e("div",{className:"mt-3 px-1",children:e("p",{className:"text-sm text-muted-foreground",children:o?.description})})]})]}),o?e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:e("div",{className:"h-full rounded-3xl border overflow-hidden",children:e(u,{documents:f,menuConfig:o?.menuConfig,onDocumentClick:w,onDocumentShare:v,selectedDocumentId:x,onDocumentUpdate:C})})}):e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:e("p",{className:"text-muted-foreground",children:"No contexts available"})}),t(y,{children:[e(g,{isOpen:b,onClose:()=>m(!1),onAddTeamContext:D}),e(p,{isOpen:K,onClose:()=>i(!1),onAddKnowledge:h,knowledgeContexts:n})]})]})}export{N as a};
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as x}from"./chunk-3DZFESHK.mjs";import{a as f}from"./chunk-QAJBJFRP.mjs";import{b as u}from"./chunk-ZUA4KNIR.mjs";import{motion as E}from"motion/react";import{File as g,FileText as b,Edit3 as P,Type as j}from"lucide-react";import{useEffect as S,useState as p}from"react";import q from"react-markdown";import B from"remark-gfm";import{jsx as e,jsxs as o}from"react/jsx-runtime";var N=d=>e(q,{remarkPlugins:[B],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:s})=>e("a",{href:s,className:"text-blue-500",children:t}),img:({src:t,alt:s})=>e("img",{src:t,alt:s,className:"mb-4"}),blockquote:({children:t})=>e("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:d}),v=d=>e("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:d}),I=d=>e("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:d&&e(f,{value:JSON.stringify(d),editable:!1,name:"richTextContent"})}),O=d=>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."]})}),N(d)]});function Z({document:d,onDocumentUpdate:t,editable:s=!0,mode:l="view",renderers:h,availableDocuments:w=[],knowledgeContexts:y=[]}){let[k,i]=p(!1),[a,m]=p(d);S(()=>{m(d)},[d]);let R=r=>{switch(r){case"markdown":case"mdx":return e(b,{className:"h-6 w-6 text-primary"});case"richText":return e(g,{className:"h-6 w-6 text-success"});case"text":return e(j,{className:"h-6 w-6 text-muted-foreground"});default:return e(g,{className:"h-6 w-6 text-muted-foreground"})}},D=r=>{switch(r){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"}},T=(r,n)=>{let M={markdown:N,mdx:O,text:v},c=h?.[n]||M[n];if(n==="richText"&&typeof r=="object")return I(r);if(c&&typeof r=="string")return c(r);if(typeof r=="string")return v(r)},C=r=>{i(!1),t?.(r),m(r)},K=()=>{i(!1)};return k||l==="create"?e(x,{mode:l==="create"?"create":"edit",document:a,onSave:C,onCancel:K,availableDocuments:w,knowledgeContexts:y}):o(E.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",children:[o("div",{className:"flex items-start justify-between gap-4 mb-4",children:[o("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[e("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:R(a.format)}),o("div",{className:"flex-1 min-w-0",children:[e("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:a.title}),a.description&&e("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:a.description})]})]}),s&&e("div",{className:"flex-shrink-0",children:o(u,{variant:"outline",size:"sm",onClick:()=>i(!0),className:"gap-2",children:[e(P,{className:"h-4 w-4"}),"Edit"]})})]}),o("div",{className:"flex flex-wrap gap-2",children:[e("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${D(a.format)}`,children:a.format.toUpperCase()}),a.tags?.map(r=>o("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",r]},r))]})]}),e("div",{className:"flex-1 ",children:o("div",{className:"p-8",children:[a.metadata&&Object.keys(a.metadata).length>0&&o("div",{className:"mb-6",children:[e("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),e("div",{className:"bg-muted rounded-lg p-3 border border-border",children:e("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(a.metadata).map(([r,n])=>o("div",{className:"flex gap-1",children:[o("span",{className:"text-muted-foreground font-medium",children:[r.replace(/([A-Z])/g," $1").trim(),":"]}),e("span",{className:"text-foreground truncate",children:String(n)})]},r))})})]}),e("div",{className:"space-y-4",children:a.content||a.richTextContent?e("div",{className:"relative",children:e("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:T(a.format==="richText"?a.richTextContent:a.content,a.format)})}):o("div",{className:"text-center py-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(b,{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{Z as a};