cortex-react-components 2.22.4 → 2.23.1
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.
- package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
- package/dist/{chunk-SCBDVNHG.mjs → chunk-AF3FLXBA.mjs} +1 -1
- package/dist/{chunk-CGR5NBBF.mjs → chunk-AHMDJQZI.mjs} +1 -1
- package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
- package/dist/{chunk-TL2RQFU5.mjs → chunk-B7AXSCTN.mjs} +1 -1
- package/dist/{chunk-RIZ2ODJL.mjs → chunk-GZ7FGBTR.mjs} +1 -1
- package/dist/{chunk-CSZCPO6D.mjs → chunk-IAFKJKBN.mjs} +1 -1
- package/dist/{chunk-GPFPTU7U.mjs → chunk-INBT5E6T.mjs} +1 -1
- package/dist/{chunk-2W4GQ3FI.mjs → chunk-JCWFPKF3.mjs} +1 -1
- package/dist/chunk-JTMIQ7MK.mjs +4 -0
- package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
- package/dist/{chunk-75WE6ZXB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
- package/dist/chunk-LEUI66J6.mjs +1 -0
- package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
- package/dist/{chunk-S7MFNEEY.mjs → chunk-OWC4BAX6.mjs} +1 -1
- package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
- package/dist/{chunk-D7VHHXGM.mjs → chunk-PZFYJ5FS.mjs} +1 -1
- package/dist/{chunk-F2MJXGRT.mjs → chunk-RS4VD3ML.mjs} +1 -1
- package/dist/chunk-TSFX33PR.mjs +4 -0
- package/dist/{chunk-UTJZH3X5.mjs → chunk-W4OD5UUE.mjs} +1 -1
- package/dist/chunk-WLI2YTOQ.mjs +1 -0
- package/dist/chunk-XJKRA2AE.mjs +4 -0
- package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
- package/dist/components/Foundary/Knowledge/manage-team-context.css +1 -0
- package/dist/components/Foundary/Knowledge/manage-team-context.d.ts +11 -0
- package/dist/components/Foundary/Knowledge/manage-team-context.js +4 -0
- package/dist/components/Foundary/Knowledge/manage-team-context.mjs +1 -0
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/index.js +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.js +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.d.ts +4 -2
- package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/document-edit.d.ts +1 -1
- package/dist/components/Foundary/document-edit.js +1 -1
- package/dist/components/Foundary/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.js +4 -4
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.js +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.js +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +20 -20
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +30 -30
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-HMZKODQJ.mjs +0 -4
- package/dist/chunk-NIGA3VKZ.mjs +0 -4
- package/dist/chunk-U2OXF7PJ.mjs +0 -1
- package/dist/chunk-UOA5RYVR.mjs +0 -1
- package/dist/chunk-YLEBXRJS.mjs +0 -4
package/dist/chunk-HMZKODQJ.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import{a as E}from"./chunk-D7VHHXGM.mjs";import{a as x}from"./chunk-DFIXTV2M.mjs";import{a as y,c as C,d as S,g as D,i as g}from"./chunk-YFAZQYK4.mjs";import{a as k}from"./chunk-B4H6T2GP.mjs";import{a as h}from"./chunk-L5JPAKPM.mjs";import{b as i}from"./chunk-ZUA4KNIR.mjs";import{motion as K}from"motion/react";import{Save as G,X as T,Plus as H,ChevronDown as J,ChevronRight as L,Info as M,File as F,FileText as Q,Type as W}from"lucide-react";import{useEffect as Y,useState as v}from"react";import{jsx as e,jsxs as d}from"react/jsx-runtime";function ce({document:u,onSave:A,mode:Z="edit",onCancel:B,availableDocuments:p=[],knowledgeContexts:I=[]}){let[n,r]=v({...u,updatedAt:new Date}),[m,_]=v(!1),[N,j]=v(n.richTextContent);Y(()=>{r(u)},[u]);let ee=t=>{switch(t){case"markdown":case"mdx":return e(Q,{className:"h-6 w-6 text-primary"});case"richText":return e(F,{className:"h-6 w-6 text-success"});case"text":return e(W,{className:"h-6 w-6 text-muted-foreground"});default:return e(F,{className:"h-6 w-6 text-muted-foreground"})}},V=t=>{switch(t){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"}},z=()=>{let t=new Set,a=new Set;return I.forEach(s=>{s.menuConfig.groupBy.forEach(l=>t.add(l))}),p.forEach(s=>{s.metadata&&Object.keys(s.metadata).forEach(l=>a.add(l))}),{contextKeys:Array.from(t).sort(),documentKeys:Array.from(a).sort(),allKeys:Array.from(new Set([...t,...a])).sort()}},O=t=>{let a=new Set;return p.forEach(s=>{s.metadata?.[t]&&a.add(String(s.metadata[t]))}),Array.from(a).sort()},R=z(),$=()=>{A({...n,richTextContent:N})},c=(t,a)=>{r(s=>({...s,metadata:{...s.metadata,[t]:a}}))},P=(t,a)=>{a==="__custom__"?c(t,""):c(t,a)},U=()=>{c("","")},X=t=>{r(a=>{let s={...a.metadata};return delete s[t],{...a,metadata:s}})};return d(K.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[d("div",{className:"border-b border-border bg-card p-8 pb-6",children:[d("div",{className:"flex items-start justify-between gap-4 mb-4",children:[e("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:d("div",{className:"flex-1 min-w-0",children:[d("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[e("div",{className:"flex-1 min-w-0",children:e(x,{fieldName:"title",value:n.title,label:"",onSave:(t,a)=>r(s=>({...s,title:a})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),e("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${V(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]}),e("div",{className:"mt-2",children:e(x,{fieldName:"description",value:n.description||"Click to add description...",label:"",multiline:!0,onSave:(t,a)=>r(s=>({...s,description:a})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),d("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d(i,{variant:"ghost",size:"sm",onClick:()=>_(!m),className:"gap-2",children:[e(M,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&e("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),m?e(J,{className:"h-4 w-4"}):e(L,{className:"h-4 w-4"})]}),d(i,{variant:"outline",size:"sm",onClick:B,className:"gap-2",children:[e(T,{className:"h-4 w-4"}),"Cancel"]}),d(i,{size:"sm",onClick:$,className:"gap-2",children:[e(G,{className:"h-4 w-4"}),"Save"]})]})]}),e(K.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:d("div",{className:"pt-4 border-t border-border mt-4 h-screen max-h-full flex",children:[d("div",{className:"flex items-center justify-between mb-3",children:[d("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[e(M,{className:"h-4 w-4"}),"Document Metadata"]}),d(i,{type:"button",variant:"outline",size:"sm",onClick:U,className:"gap-1 h-8",children:[e(H,{className:"h-3 w-3"}),"Add Field"]})]}),e("div",{className:"bg-muted rounded-lg p-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?e("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([t,a],s)=>{let l=O(t);return d("div",{className:"flex gap-2 items-center",children:[e(h,{value:t,onChange:o=>{let b=o.target.value||"",q=n.metadata?.[t];r(w=>{let f={...w.metadata};return delete f[t],b&&(f[b]=q||""),{...w,metadata:f}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${t}`}),e("datalist",{id:`metadata-keys-${t}`,children:R.allKeys.map(o=>e("option",{value:o},o))}),e("span",{className:"text-muted-foreground text-sm",children:"="}),l.length>0?d(y,{value:String(a||""),onValueChange:o=>P(t,o),children:[e(S,{className:"flex-1 h-8 text-sm",children:e(C,{placeholder:"Value"})}),d(D,{children:[l.map(o=>e(g,{value:o,children:o},o)),e(g,{value:"__custom__",children:e("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):e(h,{value:String(a||""),onChange:o=>c(t,o.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),e(i,{type:"button",variant:"ghost",size:"sm",onClick:()=>X(t),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:e(T,{className:"h-3 w-3"})})]},`metadata-key-${s}`)})}):d("div",{className:"text-center py-4",children:[e("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),e("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),e("div",{className:"flex-1 overflow-hidden",children:e("div",{className:"p-8 h-full max-h-full overflow-auto",children:n.format==="richText"?e(E,{setValue:j,value:N,name:"richTextContent"}):e(k,{value:n.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{ce as a};
|
package/dist/chunk-NIGA3VKZ.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import{a as D}from"./chunk-HMZKODQJ.mjs";import{a as k}from"./chunk-D7VHHXGM.mjs";import{a as N,c as w,e as y}from"./chunk-3UMMMQEH.mjs";import{b as f}from"./chunk-ZUA4KNIR.mjs";import{a as v}from"./chunk-MDJREBVI.mjs";import{motion as C}from"motion/react";import{File as R,FileText as T,Edit3 as A,Type as G,ChevronDown as L,ChevronRight as Z,Info as K,Loader2 as H}from"lucide-react";import{startTransition as P,useEffect as Q,useMemo as V,useRef as W,useState as l}from"react";import*as O from"@radix-ui/react-dialog";import Y from"react-markdown";import _ from"remark-gfm";import{Fragment as ae,jsx as e,jsxs as o}from"react/jsx-runtime";var E=n=>e(Y,{remarkPlugins:[_],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:i})=>e("a",{href:i,className:"text-blue-500",children:t}),img:({src:t,alt:i})=>e("img",{src:t,alt:i,className:"mb-4"}),blockquote:({children:t})=>e("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:n}),M=n=>e("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:n}),ee=n=>e("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:n&&e(k,{value:JSON.stringify(n),editable:!1,name:"richTextContent"},JSON.stringify(n))}),te=n=>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."]})}),E(n)]});function pe({document:n,onDocumentUpdate:t,editable:i=!0,mode:g="view",renderers:S,availableDocuments:j=[],knowledgeContexts:I=[]}){let[B,c]=l(!1),[d,$]=l(!1),[a,m]=l(n),[q,x]=l(!1),u=W(null),p=a.format==="richText"?a.richTextContent:a.content,z=V(()=>`${a.format}:${JSON.stringify(p)}`,[a.format,p]);Q(()=>{m(n)},[n]);let re=r=>{switch(r){case"markdown":case"mdx":return e(T,{className:"h-6 w-6 text-primary"});case"richText":return e(R,{className:"h-6 w-6 text-success"});case"text":return e(G,{className:"h-6 w-6 text-muted-foreground"});default:return e(R,{className:"h-6 w-6 text-muted-foreground"})}},F=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"}},J=(r,s)=>{let U={markdown:E,mdx:te,text:M},h=S?.[s]||U[s];if(s==="richText"&&typeof r=="object")return ee(r);if(h&&typeof r=="string")return h(r);if(typeof r=="string")return M(r)},X=async r=>{x(!0),u.current=a,P(()=>{m({...r,richTextContent:r.richTextContent?structuredClone(r.richTextContent):void 0})});try{let s=await t?.(r);if(x(!1),!s)throw new Error("save failed");c(!1)}catch{u.current&&P(()=>m(u.current))}},b=()=>{c(!1)};return o(ae,{children:[e(N,{open:B||g==="create",onOpenChange:r=>!r&&b(),children:o(w,{children:[e(y,{}),o(O.Content,{className:v("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:[q&&e("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:e(H,{className:"h-8 w-8 animate-spin text-primary"})}),e(D,{mode:g==="create"?"create":"edit",document:a,onSave:X,onCancel:b,availableDocuments:j,knowledgeContexts:I})]})]})}),o(C.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:[a.title,e("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${F(a.format)}`,children:a.format.toUpperCase()})]}),a.description&&e("p",{className:"text-muted-foreground text-lg leading-relaxed",children:a.description})]})}),o("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[a.metadata&&Object.keys(a.metadata).length>0&&o(f,{variant:"ghost",size:"sm",onClick:()=>$(!d),className:"gap-2",children:[e(K,{className:"h-4 w-4"}),"Metadata",d?e(L,{className:"h-4 w-4"}):e(Z,{className:"h-4 w-4"})]}),i&&o(f,{variant:"outline",size:"sm",onClick:()=>c(!0),className:"gap-2",children:[e(A,{className:"h-4 w-4"}),"Edit"]})]})]}),a.metadata&&Object.keys(a.metadata).length>0&&e(C.div,{initial:!1,animate:{height:d?"auto":0,opacity:d?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(K,{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(a.metadata).map(([r,s])=>o("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:r.replace(/([A-Z])/g," $1").trim()}),e("span",{className:"text-foreground font-medium",children:String(s)})]},r))})})]})})]}),e("div",{className:"flex-1 ",children:e("div",{className:"py-4 h-full",children:e("div",{className:"space-y-4",children:a.content||a.richTextContent?e("div",{className:"relative",children:e("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:J(a.format==="richText"?a.richTextContent:a.content,a.format)})},z):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(T,{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{pe as a};
|
package/dist/chunk-U2OXF7PJ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m,c as u,d as p,g,i as v}from"./chunk-YFAZQYK4.mjs";import{a as D}from"./chunk-INCYANPB.mjs";import{a as n}from"./chunk-TVZOULLL.mjs";import{a as C,f as b,g as h,i as B}from"./chunk-3UMMMQEH.mjs";import{a as s}from"./chunk-L5JPAKPM.mjs";import{b as i}from"./chunk-ZUA4KNIR.mjs";import{b as f}from"./chunk-CSBGSBEU.mjs";import{useState as S}from"react";import{Save as L,X as w}from"lucide-react";import{jsx as t,jsxs as o}from"react/jsx-runtime";var X=({isOpen:x,onClose:y,onAddTeamContext:N})=>{let[a,r]=S({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),[c,d]=S(""),O=e=>{e.preventDefault(),console.log("formData",a),a.label&&(N({id:a.label,label:a.label,description:a.description,menuConfig:{groupBy:a.groupBy,sortBy:a.sortBy||null,sortOrder:a.sortOrder,showDocumentCount:a.showDocumentCount}}),r({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}))},T=()=>{r({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),y()},k=[{value:"name",label:"Name"},{value:"createdAt",label:"Created Date"}],A=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}];return t(C,{open:x,onOpenChange:T,children:o(b,{className:"sm:max-w-md",children:[t(h,{children:t(B,{children:"Add New Knowledge source"})}),o("form",{onSubmit:O,className:"space-y-4",children:[o("div",{className:"space-y-4",children:[o("div",{children:[t(n,{htmlFor:"label",children:"Label *"}),t(s,{id:"label",value:a.label,onChange:e=>r(l=>({...l,label:e.target.value})),required:!0})]}),o("div",{children:[t(n,{htmlFor:"description",children:"Description"}),t(s,{id:"description",value:a.description,onChange:e=>r(l=>({...l,description:e.target.value}))})]}),o("div",{children:[t(n,{children:"Group By"}),o("div",{className:"space-y-2",children:[t("div",{className:"flex flex-wrap gap-2",children:a.groupBy.map(e=>o(f,{variant:"secondary",className:"px-2 py-1",children:[e,t("button",{type:"button",className:"ml-1 inline-flex",onClick:()=>{r(l=>({...l,groupBy:l.groupBy.filter(F=>F!==e)}))},"aria-label":`Remove ${e}`,children:t(w,{className:"h-3 w-3"})})]},e))}),o("div",{className:"flex gap-2",children:[t(s,{placeholder:"Type a tag and press Enter",value:c,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.key==="Enter"||e.key===",")&&(e.preventDefault(),r(l=>({...l,groupBy:[...l.groupBy,c]})),d(""))}}),t(i,{type:"button",onClick:()=>{r(e=>({...e,groupBy:[...e.groupBy,c]})),d("")},children:"Add"})]})]})]}),o("div",{children:[t(n,{htmlFor:"sortBy",children:"Sort By"}),o(m,{value:a.sortBy,onValueChange:e=>r(l=>({...l,sortBy:e})),children:[t(p,{children:t(u,{placeholder:"Select sort field"})}),t(g,{children:k.map(e=>t(v,{value:e.value,children:e.label},e.value))})]})]}),o("div",{children:[t(n,{htmlFor:"sortOrder",children:"Sort Order"}),o(m,{value:a.sortOrder,onValueChange:e=>r(l=>({...l,sortOrder:e})),children:[t(p,{children:t(u,{placeholder:"Select sort order"})}),t(g,{children:A.map(e=>t(v,{value:e.value,children:e.label},e.value))})]})]}),o("div",{className:"flex items-center space-x-2",children:[t(D,{id:"showDocumentCount",checked:a.showDocumentCount,onCheckedChange:e=>r(l=>({...l,showDocumentCount:e}))}),t(n,{htmlFor:"showDocumentCount",className:"text-sm",children:"Show Document Count"})]})]}),o("div",{className:"flex justify-end gap-3 pt-4",children:[o(i,{variant:"outline",size:"sm",onClick:y,className:"gap-2",children:[t(w,{className:"h-4 w-4"}),"Cancel"]}),o(i,{type:"submit",children:[t(L,{className:"h-4 w-4"}),"Create"]})]})]})]})})};export{X as a};
|
package/dist/chunk-UOA5RYVR.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $}from"./chunk-L2UJOICL.mjs";import{a as L}from"./chunk-T3F3RQIC.mjs";import{a as P}from"./chunk-UP67R64J.mjs";import{a as F}from"./chunk-6QERRKM4.mjs";import{a as H}from"./chunk-VSU7LYXZ.mjs";import{b as E,c as S}from"./chunk-RKS7CWAP.mjs";import{b as _}from"./chunk-BZEGLKRZ.mjs";import{a as U}from"./chunk-IPRG56MW.mjs";import{a as j,b as B,c as J,d as G,e as X}from"./chunk-HFEN3KJC.mjs";import{a as f,b as p,i as u,j as g}from"./chunk-OCPX4QPC.mjs";import{a as y,b as A,c as R,d as O}from"./chunk-KY7WQYN4.mjs";import{a as I}from"./chunk-MDJREBVI.mjs";import{useLexicalComposerContext as he}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext";import{$insertNodeToNearestRoot as Ce,mergeRegister as Y}from"@payloadcms/richtext-lexical/lexical/utils";import{$createParagraphNode as ve,$getPreviousSelection as ke,$getRoot as Ne,$getSelection as v,$isParagraphNode as q,$isRangeSelection as k,CAN_REDO_COMMAND as Te,CAN_UNDO_COMMAND as De,COMMAND_PRIORITY_EDITOR as Me,FORMAT_ELEMENT_COMMAND as m,FORMAT_TEXT_COMMAND as c,SELECTION_CHANGE_COMMAND as xe,UNDO_COMMAND as z}from"@payloadcms/richtext-lexical/lexical";import{$setBlocksType as K}from"@payloadcms/richtext-lexical/lexical/selection";import{INSERT_ORDERED_LIST_COMMAND as we,INSERT_UNORDERED_LIST_COMMAND as Ie}from"@payloadcms/richtext-lexical/lexical/list";import{AlignCenter as ye,AlignJustify as Ae,AlignLeft as Re,AlignRight as Oe,ChevronDown as N,ImageUp as _e,List as Ee,ListOrdered as Se,Plus as Ue,RotateCcw as $e,RotateCw as He}from"lucide-react";import{Fragment as Le,useCallback as Pe,useEffect as Fe,useRef as je,useState as s}from"react";import{$createHeadingNode as Be}from"@payloadcms/richtext-lexical/lexical/rich-text";import{jsx as o,jsxs as a}from"react/jsx-runtime";var T=1;function Je(){return o("span",{className:"border border-[#222222]"})}function Ge(){let[t]=he(),Q=je(null),[V,W]=s(!1),[Z,ee]=s(!1),[oe,te]=s(!1),[ie,ne]=s(!1),[ae,se]=s(!1),[re,ce]=s(!1),[le,de]=s(!1),[fe,pe]=s(!1),[D,M]=s(!1),[x,ue]=s("left"),[w,ge]=s("p"),l=e=>{t.update(()=>{let i=v();k(i)&&(e==="p"?K(i,()=>ve()):K(i,()=>Be(e)))})},b=Pe(()=>{let e=v();if(k(e)){te(e.hasFormat("bold")),ne(e.hasFormat("italic")),se(e.hasFormat("underline")),ce(e.hasFormat("strikethrough")),de(e.hasFormat("subscript")),pe(e.hasFormat("superscript"));let i=e.anchor.getNode(),n=i;for(;n&&!q(n)&&n!==Ne();){let r=n.getParent();r&&(n=r)}if(n){let r=n.getFormatType();ue(r||"left")}let d=i.getTopLevelElement()?.__tag;ge(d||"p")}},[]);Fe(()=>Y(t.registerUpdateListener(({editorState:e})=>{e.read(()=>{b()})}),t.registerCommand(xe,(e,i)=>(b(),!1),T),t.registerCommand(De,e=>(W(e),!1),T),t.registerCommand(Te,e=>(ee(e),!1),T),Y(t.registerCommand(E,e=>(t.update(()=>{let i=v()||ke();if(k(i)){let n=_({id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value}),{focus:d}=i,r=d.getNode();Ce(n),q(r)&&!r.__first&&r.remove()}}),!0),Me))),[t,b]);let me=[[{label:"Undo",icon:o($e,{width:15,height:15}),onClick:()=>{t.dispatchCommand(z,void 0)},disabled:!V},{label:"Redo",icon:o(He,{width:15,height:15}),onClick:()=>{t.dispatchCommand(z,void 0)},disabled:!Z}],[{label:"Bold",icon:o(U,{}),onClick:()=>{t.dispatchCommand(c,"bold")},value:"bold",active:oe},{label:"Italic",icon:o($,{}),onClick:()=>{t.dispatchCommand(c,"italic")},value:"italic",active:ie},{label:"Underline",icon:o(H,{}),onClick:()=>{t.dispatchCommand(c,"underline")},value:"underline",active:ae},{label:"Strikethrough",icon:o(L,{}),onClick:()=>{t.dispatchCommand(c,"strikethrough")},value:"strikethrough",active:re},{label:"Subscript",icon:o(P,{}),onClick:()=>{t.dispatchCommand(c,"subscript")},value:"subscript",active:le},{label:"Superscript",icon:o(F,{}),onClick:()=>{t.dispatchCommand(c,"superscript")},value:"superscript",active:fe}]],h=[{label:"Left Align",direction:"left",icon:o(Re,{width:15,height:15}),onClick:()=>{t.dispatchCommand(m,"left")}},{label:"Center Align",direction:"center",icon:o(ye,{width:15,height:15}),onClick:()=>{t.dispatchCommand(m,"center")}},{label:"Right Align",direction:"right",icon:o(Oe,{width:15,height:15}),onClick:()=>{t.dispatchCommand(m,"right")}},{label:"Justify Align",direction:"justify",icon:o(Ae,{width:15,height:15}),onClick:()=>{t.dispatchCommand(m,"justify")}}],C=[{label:"Normal Text",value:"p",icon:o(j,{}),onClick:()=>l("p")},{label:"Heading 1",value:"h1",icon:o(B,{}),onClick:()=>l("h1")},{label:"Heading 2",value:"h2",icon:o(J,{}),onClick:()=>l("h2")},{label:"Heading 3",value:"h3",icon:o(G,{}),onClick:()=>l("h3")},{label:"Heading 4",value:"h4",icon:o(X,{}),onClick:()=>l("h4")},...[{label:"Unordered List",value:"ul",icon:o(Ee,{width:15,height:15}),onClick:()=>{t.dispatchCommand(Ie,void 0)}},{label:"Ordered List",value:"ol",icon:o(Se,{width:15,height:15}),onClick:()=>{t.dispatchCommand(we,void 0)}}]],be=[{label:"Insert Image",icon:o(_e,{width:15,height:15}),onClick:()=>{M(!0)},disabled:!1}];return o("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:a("div",{className:"flex gap-2 ",ref:Q,children:[me.map((e,i)=>a(Le,{children:[o("div",{className:"flex items-center gap-2",children:e.map((n,d)=>o("div",{role:"button","aria-disabled":n.disabled||!1,onClick:n.onClick,className:I("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",n.active&&"bg-[#3c3c3c]"),"aria-label":n.label,children:o(y,{children:a(A,{children:[o(R,{className:"text-[#b5b5b5]",children:n.icon}),o(O,{children:o("p",{children:n.label})})]})})},d))}),o(Je,{})]},`toolbar-option-${e.length}-${i}`)),a(f,{children:[a(p,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[h.find(e=>e.direction===x)?.icon,h.find(e=>e.direction===x)?.label,o(N,{width:15,height:15})]}),o(u,{className:"bg-black hover:bg-black",children:h.map((e,i)=>a(g,{onClick:e.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[o("span",{children:e.icon}),o("span",{children:e.label})]},`${e.label}-${i}`))})]}),a(f,{children:[a(p,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[C.find(e=>e.value===w)?.icon,C.find(e=>e.value===w)?.label,o(N,{width:15,height:15})]}),o(u,{className:"bg-black hover:bg-black",children:C.map((e,i)=>a(g,{onClick:e.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[o("span",{children:e.icon}),o("span",{children:e.label})]},`heading-option-${e.label}-${i}`))})]}),a(f,{children:[a(p,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[o(Ue,{width:15,height:15}),o(N,{width:15,height:15})]}),o(u,{className:"bg-black hover:bg-black",children:be.map((e,i)=>a(g,{onClick:e.onClick,disabled:e.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[o("span",{children:e.icon}),o("span",{children:e.label})]},i))})]}),D&&o(S,{activeEditor:t,onClose:()=>{M(!1)},isOpen:D})]})})}export{Ge as a};
|
package/dist/chunk-YLEBXRJS.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import{a as u}from"./chunk-I6XKBCH4.mjs";import{a as f}from"./chunk-U2OXF7PJ.mjs";import{a as p}from"./chunk-RIZ2ODJL.mjs";import{b as c}from"./chunk-ZUA4KNIR.mjs";import{useEffect as A,useState as l}from"react";import{Loader2 as k}from"lucide-react";import{Fragment as T,jsx as e,jsxs as d}from"react/jsx-runtime";function O({documents:x=[],contexts:t=[],onDocumentClick:g=o=>console.log("Document clicked:",o),onDocumentShare:w=o=>console.log("Share document:",o),onLoadDocumentContent:I,selectedDocumentId:v,onAddKnowledge:m,onAddTeamContext:a,onDocumentUpdate:b}){let[o,s]=l(t[0]),[C,r]=l(!1),[K,i]=l(!1),[h,y]=l(!1);A(()=>{!o&&t&&t.length>0&&s(t[0])},[t]);let N=n=>{m&&(y(!0),m(n)),r(!1)},D=n=>{a&&a(n),i(!1)};return d("div",{className:"flex flex-col h-full",children:[d("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[h&&d("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[e(k,{className:"h-8 w-8 animate-spin text-primary"}),e("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&d("div",{className:"",children:[e("div",{className:"",children:d("nav",{className:"-mb-px flex justify-between items-center",children:[e("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(n=>d("button",{onClick:()=>s(n),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===n.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[n.icon,n.label]},n.id))}),d("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e("button",{onClick:()=>r(!0),className:"inline-flex border border-primary rounded-xl items-center py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Knowledge"}),e("button",{onClick:()=>i(!0),className:"inline-flex border border-primary rounded-xl items-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Context"})]})]})}),o?.description&&e("div",{className:"mt-3 px-1",children:e("p",{className:"text-sm text-primary",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-xl border overflow-hidden",children:e(p,{documents:x,menuConfig:o?.menuConfig,onDocumentClick:g,onDocumentShare:w,selectedDocumentId:v,onDocumentUpdate:b})})}):d("div",{children:[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"})}),e("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:e(c,{onClick:()=>i(!0),children:"Add Context"})})]}),d(T,{children:[e(f,{isOpen:K,onClose:()=>i(!1),onAddTeamContext:D}),e(u,{isOpen:C,onClose:()=>r(!1),onAddKnowledge:N,knowledgeContexts:t})]})]})}export{O as a};
|