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
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{c as k,h as v,i as R,k as f,l as y,o as x,p as c,q as d,r as h,s as w,v as L,w as P,x as B}from"./chunk-
|
|
4
|
+
import{c as k,h as v,i as R,k as f,l as y,o as x,p as c,q as d,r as h,s as w,v as L,w as P,x as B}from"./chunk-ZFUP5NVF.mjs";import{a as n}from"./chunk-7GSXNSLD.mjs";import{a as S,b as C,c as M}from"./chunk-YNCJATT7.mjs";import{ChevronRight as G}from"lucide-react";import T from"clsx";import{Fragment as H,jsx as e,jsxs as r}from"react/jsx-runtime";function J({mainNav:u,secondaryNav:s,ongoingWork:l,title:t,subTitle:o,pathName:i,menuHeading:O,onNavClick:m,loading:b=!1,LinkComponent:N,...A}){let g=N?a=>e(N,{...a}):m?({href:a,children:p,...I})=>e("button",{onClick:()=>m&&m(a),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...I,children:p}):a=>e("a",{...a});return r(k,{...A,variant:"inset",children:[e(v,{children:e(c,{children:e(d,{children:b?r("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[e(n,{className:"bg-gray-200 my-2 w-full h-7"}),e(n,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):r("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[e("span",{className:"truncate font-semibold",children:t}),o&&e("span",{className:"truncate text-sm",children:o})]})})})}),b&&r(f,{children:[e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"})]}),r(f,{children:[e("div",{className:"px-4 text-sm",children:"Recent Work"}),l&&!b&&l.map((a,p)=>e(F,{subNav:a,pathName:i,Link:g},p)),e("div",{className:"border-t border-gray-200 my-4"}),u&&!b&&u.map((a,p)=>e(F,{subNav:a,pathName:i,Link:g},p)),e(y,{className:"mt-auto",children:e(x,{children:e(c,{children:s&&!b&&s.map(a=>e(d,{children:e(h,{asChild:!0,size:"sm",children:r(g,{href:a.url||"",children:[a.icon&&e(a.icon,{}),e("span",{children:a.label})]})})},a.label))})})})]}),e(R,{})]})}function F({subNav:u,pathName:s,Link:l}){let t=u,o=!1;return t.links&&t.links.map(i=>{i.url===s&&(o=!0)}),e(S,{defaultOpen:!0,className:"group/collapsible",children:e(y,{className:"py-0",children:e(c,{children:e(S,{asChild:!0,defaultOpen:t.isActive,children:r(d,{children:[e(h,{asChild:!0,tooltip:t.label,className:T(o&&"font-bold text-accent"),children:r(l,{href:t.url,children:[t.icon&&e(t.icon,{}),e("span",{children:t.label})]})}),t.links?.length?r(H,{children:[e(C,{asChild:!0,children:r(w,{className:"data-[state=open]:rotate-90",children:[e(G,{}),e("span",{className:"sr-only",children:"Toggle"})]})}),e(M,{children:e(L,{children:t.links?.map(i=>e(P,{children:e(B,{asChild:!0,className:T(i.url===s&&"font-bold text-accent"),children:e(l,{href:i.url,children:e("span",{children:i.label})})})},i.label))})})]}):null]})},t.label)})})})}export{J as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as S,b as z}from"./chunk-7TSR2LQB.mjs";import{a as R}from"./chunk-W4OD5UUE.mjs";import{a as F}from"./chunk-2LINLX4S.mjs";import{d as y}from"./chunk-Q2DPE66H.mjs";import{a as B}from"./chunk-FT3AE7L2.mjs";import{a as E}from"./chunk-L5JPAKPM.mjs";import{b as s}from"./chunk-ZUA4KNIR.mjs";import{a as b,c as x}from"./chunk-SOLZ4VQH.mjs";import{a as A}from"./chunk-MDJREBVI.mjs";import{useRef as N,useEffect as T,useState as O}from"react";import*as l from"motion/react-client";import{Send as ie,Bot as H,Menu as oe,Paperclip as se,X as ne,FileText as le,Image as re,File as ce}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function ke({messages:r,input:C,isTyping:d=!1,currentSessionTitle:L,capabilities:u,fileUploads:f,isDragOver:$,enableFileUpload:w,onInputChange:P,addToolResult:K,onSendMessage:U,onKeyPress:V,onFileUpload:k,onRemoveFile:J,onDragOver:p,className:Q,status:W="ready"}){let g=N(null),G=N(null),I=N(null),[n,c]=O(!1),[v,me]=O({path:[],selectedItems:[],filters:{}});T(()=>{g.current?.scrollIntoView({behavior:"smooth"})},[r]),T(()=>{n&&setTimeout(()=>{g.current?.scrollIntoView({behavior:"smooth"})},100)},[n]);let M=()=>y(v),D=()=>{let e=[];return u.forEach(a=>{a.actions&&a.actions.forEach(o=>{e.push({label:o.label,action:()=>h(o.id,{path:[a],selectedItems:[],filters:{}})})}),a.children&&a.children.forEach(o=>{o.type==="list"&&o.data&&e.push({label:`View ${o.name}`,action:()=>c(!0)})})}),e.slice(0,5)},h=(e,a)=>{console.log("Capability action:",e,a);let o=`Executing ${e} with context: ${JSON.stringify(a.path.map(m=>m.name))}`;c(!1)},X=y({path:[],selectedItems:[],filters:{}}),q=e=>{k(e.target.files),e.target.files&&(e.target.value="")},Y=e=>{e.preventDefault(),p(!0)},Z=e=>{e.preventDefault(),p(!1)},_=e=>{e.preventDefault(),p(!1),k(e.dataTransfer.files)},j=e=>{if(e===0)return"0 Bytes";let a=1024,o=["Bytes","KB","MB","GB"],m=Math.floor(Math.log(e)/Math.log(a));return parseFloat((e/Math.pow(a,m)).toFixed(2))+" "+o[m]},ee=e=>e.startsWith("image/")?t(re,{className:"h-4 w-4"}):e.startsWith("text/")?t(le,{className:"h-4 w-4"}):t(ce,{className:"h-4 w-4"}),te={messages:r,currentSessionTitle:L,capabilities:u,currentCapabilityContext:v,contextualActions:X,getQuickSuggestions:D().map(e=>e.label)},ae=()=>{navigator.clipboard.writeText(JSON.stringify(te,null,2)),alert("Debug info copied to clipboard")};return i("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${Q||""}`,children:[i(B,{ref:G,className:"flex-1 p-4 bg-background border-0",onDragOver:Y,onDragLeave:Z,onDrop:_,children:[i("div",{className:A("space-y-4",$&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[t(l.animate,{children:r.map(e=>t(l.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:t(S,{from:e.role,children:t(z,{variant:"flat",children:R({message:e,addToolResult:K??(()=>{}),status:W,messages:r})})},e.id)},e.id))}),n&&i(l.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[t(b,{className:"h-8 w-8",children:t(x,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:t(H,{className:"h-4 w-4"})})}),t("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:t(F,{capabilities:u,isOpen:n,onToggle:()=>c(!n),onActionSelect:h,className:"w-full"})})]}),d&&i(l.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[t(b,{className:"h-8 w-8",children:t(x,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:t(H,{className:"h-4 w-4"})})}),t("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:i("div",{className:"flex space-x-1",children:[t("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),t("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),t("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),t("div",{ref:g})]}),f.length>0&&t("div",{className:"p-4 border-t bg-muted/10",children:t("div",{className:"flex flex-wrap gap-2",children:f.map(e=>i("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[ee(e.file.type),t("span",{className:"text-sm font-medium",children:e.file.name}),t("span",{className:"text-xs text-muted-foreground",children:j(e.file.size)}),t(s,{variant:"ghost",size:"sm",onClick:()=>J(e.id),className:"h-6 w-6 p-0",children:t(ne,{className:"h-4 w-4"})})]},e.id))})}),i("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[i("div",{className:"flex gap-3",children:[t(E,{value:C,onChange:e=>P(e.target.value),onKeyPress:V,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:d}),w&&t(s,{variant:"outline",size:"icon",onClick:()=>I.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:t(se,{className:"h-4 w-4"})}),t(s,{onClick:U,disabled:!C.trim()&&f.length===0||d,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:t(ie,{className:"h-4 w-4"})})]}),i("div",{className:"flex items-center gap-3 mt-3",children:[i(s,{onClick:()=>c(!n),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[t(oe,{className:"h-3 w-3 mr-1"}),n?"Hide":"Show"," Capabilities"]}),i("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[M().map((e,a)=>t(s,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>h(e.id,v),children:e.label},`context-${e.id}`)),M().length===0&&D().map((e,a)=>t(s,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:e.action,children:e.label},`suggestion-${a}`)),t(s,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:ae,children:"Debug"})]})]}),w&&t("input",{ref:I,type:"file",multiple:!0,onChange:q,className:"hidden"})]})]})}export{ke as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as S,b as w}from"./chunk-MXCW6SOT.mjs";import{a as k}from"./chunk-5SHZBJ5R.mjs";import{a as C}from"./chunk-I2GNNRFH.mjs";import{a as g}from"./chunk-MZP7RIQZ.mjs";import{a as u}from"./chunk-255P6K5W.mjs";import{a as
|
|
4
|
+
import{a as S,b as w}from"./chunk-MXCW6SOT.mjs";import{a as k}from"./chunk-5SHZBJ5R.mjs";import{a as C}from"./chunk-I2GNNRFH.mjs";import{a as g}from"./chunk-MZP7RIQZ.mjs";import{a as u}from"./chunk-255P6K5W.mjs";import{a as v}from"./chunk-HKGW6JI2.mjs";import{a as f}from"./chunk-YKG4FNS4.mjs";import{c as m,f as p}from"./chunk-N3B3XNV3.mjs";import{a as d}from"./chunk-2BR55L74.mjs";import{a as s}from"./chunk-7WIO2CIC.mjs";import{a as x}from"./chunk-6C4WESLL.mjs";import{a as N}from"./chunk-LAQ3QAUW.mjs";import{a as h}from"./chunk-FMJBJ3HN.mjs";import{a as n}from"./chunk-MDJREBVI.mjs";import{a as b}from"./chunk-WU3JMLSC.mjs";import{a as y}from"./chunk-BZAYEKYC.mjs";import z from"next/image";import{jsx as e,jsxs as o}from"react/jsx-runtime";var H=t=>({root:{type:"root",format:"",indent:0,version:1,children:[{type:"paragraph",format:"",indent:0,version:1,children:[{mode:"normal",text:t,type:"text",style:"",detail:0,format:0,version:1}],direction:"ltr",textStyle:"",textFormat:0}],direction:"ltr"}}),T=({children:t})=>e("div",{children:o("div",{className:"sticky top-0 h-screen",children:[t,e(s,{className:"text-black z-10",position:"header"})]})}),R=()=>o(T,{children:[o("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[e("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),e("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:e(h,{children:o("div",{className:"flex flex-col items-start md:w-1/2 mb-10 z-0 md:mb-0",children:[e("h1",{className:"text-5xl md:text-7xl mb-6",children:"Lorum ipsum."}),e("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:"Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio."})]})})})]}),L={highImpact:u,lowImpact:v,mediumImpact:f,sectionHero:g,dummy:R};function P({...t}){let i=t.style;return o("div",{className:"relative overflow-y-none scroll-smooth snap-y snap-mandatory",children:[e(N,{isMenuOpen:!0,logoLight:y,logoDark:b,...t.header}),e(I,{...t.hero}),e(c,{theme:"light",style:i,children:e(k,{...t.service})}),e(c,{theme:"dark",style:i,image:t.service.services[0].image,children:e(j,{})}),e(c,{theme:"light",style:i,children:e(j,{})}),e(c,{theme:"dark",style:i,children:e(S,{...t.contact})}),e(c,{theme:"light",style:i,children:e(w,{...t.contact})}),e(c,{theme:"last",style:i,children:e(C,{...t.blog})}),e(m,{...t.cta}),e(x,{...t.footer})]})}var I=t=>{let{type:i}=t||{};if(!i||i==="none")return null;let l=L[i];return l?e(l,{...t}):null},j=()=>{let t={blurDataURL:"/assets/props/Cortex-Handshake-BG.jpg",height:1315,url:"/assets/props/Cortex-Handshake-BG.jpg",width:1920};return e("div",{className:"container",children:o("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[o("div",{className:n("w-full text-left"),children:[e("h2",{className:"text-3xl md:text-5xl text-primary",children:"Lorum ipsum..."}),e("p",{className:"mt-4 text-gray-700 text-lg",children:e(p,{enableGutter:!1,content:H("Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio. Nulla facilisi. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio. Nulla facilisi. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies."),enableProse:!1,className:n("prose prose-headings:text-foreground prose-p:text-foreground")})}),e("button",{className:"mt-6 px-6 py-3 border border-1 border-accent text-foreground rounded-full text-base hover:bg-accent hover:text-accent-foreground transition",children:"Click here"})]}),e("div",{className:"w-full h-full min-h-96 p-6 md:p-6 flex justify-center",children:e(z,{src:t.url,alt:"image",width:t.width,height:t.height,className:"max-w-full"})})]})})},c=({children:t,theme:i,style:l,neighbours:M,shape:D,image:B,id:r,continueTheme:F})=>{let G=a=>o("div",{className:"select-none",children:[a&&typeof a=="object"&&e(d,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:a}),a&&typeof a=="string"&&e("div",{children:e(z,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:a})})]});if(i==="dark"&&l==="slide")return e("section",{id:r||"next-section",className:"sticky md:top-0 h-screen",children:o("div",{className:"dark pt-0 min-h-[80vh]",children:[e(s,{className:"z-10",position:"dark-top"}),o("div",{className:"relative",children:[e("div",{className:"flex items-center bg-black justify-center pt-12",children:e("div",{className:"container",children:t})}),e(s,{className:"z-10",position:"dark-bottom"})]})]})});if(i==="light"&&l==="slide")return e("section",{id:r||"next-section",className:"sticky top-0 light pt-0 h-screen",children:o("div",{className:"sticky top-0 light pt-0 h-screen",children:[e(s,{className:"z-10",position:"light-top"}),o("div",{className:"relative bg-white",children:[e("div",{className:"flex items-center bg-white justify-center pt-12",children:e("div",{className:"container",children:t})}),e("div",{className:"h-[200px] bg-white"})]})]})});if(i==="first")return e("section",{id:r||"next-section",className:"",children:e("div",{className:"sticky top-0 light bg-background pt-6 min-h-[80vh]",children:o("div",{className:"relative",children:[e("div",{className:"flex items-center justify-center pt-12",children:e("div",{className:"container",children:t})}),e(s,{className:"text-black z-10",position:"bottom-right"})]})})});if(i==="light")return e("section",{id:r||"next-section",className:"",children:e("div",{className:n("sticky top-0 light bg-background min-h-[50vh]","pb-10"),children:e("div",{className:"flex items-center pt-8 justify-center",children:e("div",{className:"container",children:t})})})});if(i==="dark")return e("section",{id:r||"next-section",className:"",children:o("div",{className:"sticky -top-[1px] dark min-h-[80vh] bg-white",children:[e(s,{className:"text-black z-10",position:"bottom-right"}),e("div",{className:"flex items-center justify-center pt-12 bg-black",children:e("div",{className:"container",children:t})}),e(s,{className:"text-accent z-10",position:"top"})]})});if(i==="last")return e("section",{id:r||"next-section",className:"",children:o("div",{className:"sticky -top-[1px] dark min-h-[80vh] bg-white",children:[e(s,{className:"text-black z-10",position:"bottom-right"}),e("div",{className:"flex items-center justify-center pb-12 bg-black min-h-[80vh]",children:e("div",{className:"container",children:t})})]})})};export{P as a,c as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{c as k,h as v,i as R,k as f,l as y,o as x,p as c,q as d,r as h,s as w,v as L,w as P,x as B}from"./chunk-
|
|
4
|
+
import{c as k,h as v,i as R,k as f,l as y,o as x,p as c,q as d,r as h,s as w,v as L,w as P,x as B}from"./chunk-ZFUP5NVF.mjs";import{a as n}from"./chunk-7GSXNSLD.mjs";import{a as S,b as C,c as M}from"./chunk-YNCJATT7.mjs";import{ChevronRight as G}from"lucide-react";import T from"clsx";import{Fragment as H,jsx as e,jsxs as r}from"react/jsx-runtime";function J({mainNav:u,secondaryNav:s,ongoingWork:l,title:t,subTitle:o,pathName:i,menuHeading:O,onNavClick:m,loading:b=!1,LinkComponent:N,...A}){let g=N?a=>e(N,{...a}):m?({href:a,children:p,...I})=>e("button",{onClick:()=>m&&m(a),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...I,children:p}):a=>e("a",{...a});return r(k,{...A,variant:"inset",children:[e(v,{children:e(c,{children:e(d,{children:b?r("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[e(n,{className:"bg-gray-200 my-2 w-full h-7"}),e(n,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):r("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[e("span",{className:"truncate font-semibold",children:t}),o&&e("span",{className:"truncate text-sm",children:o})]})})})}),b&&r(f,{children:[e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"})]}),r(f,{children:[e("div",{className:"px-4 text-sm",children:"Recent Work"}),l&&!b&&l.map((a,p)=>e(F,{subNav:a,pathName:i,Link:g},p)),e("div",{className:"border-t border-gray-200 my-4"}),u&&!b&&u.map((a,p)=>e(F,{subNav:a,pathName:i,Link:g},p)),e(y,{className:"mt-auto",children:e(x,{children:e(c,{children:s&&!b&&s.map(a=>e(d,{children:e(h,{asChild:!0,size:"sm",children:r(g,{href:a.url||"",children:[a.icon&&e(a.icon,{}),e("span",{children:a.label})]})})},a.label))})})})]}),e(R,{})]})}function F({subNav:u,pathName:s,Link:l}){let t=u,o=!1;return t.links&&t.links.map(i=>{i.url===s&&(o=!0)}),e(S,{defaultOpen:!0,className:"group/collapsible",children:e(y,{className:"py-0",children:e(c,{children:e(S,{asChild:!0,defaultOpen:t.isActive,children:r(d,{children:[e(h,{asChild:!0,tooltip:t.label,className:T(o&&"font-bold text-accent"),children:r(l,{href:t.url,children:[t.icon&&e(t.icon,{}),e("span",{children:t.label})]})}),t.links?.length?r(H,{children:[e(C,{asChild:!0,children:r(w,{className:"data-[state=open]:rotate-90",children:[e(G,{}),e("span",{className:"sr-only",children:"Toggle"})]})}),e(M,{children:e(L,{children:t.links?.map(i=>e(P,{children:e(B,{asChild:!0,className:T(i.url===s&&"font-bold text-accent"),children:e(l,{href:i.url,children:e("span",{children:i.label})})})},i.label))})})]}):null]})},t.label)})})})}export{J as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-MZP7RIQZ.mjs";import{a as i}from"./chunk-255P6K5W.mjs";import{a as
|
|
1
|
+
import{a as n}from"./chunk-MZP7RIQZ.mjs";import{a as i}from"./chunk-255P6K5W.mjs";import{a as l}from"./chunk-HKGW6JI2.mjs";import{a as m}from"./chunk-YKG4FNS4.mjs";import{ChevronRightIcon as c,HomeIcon as f}from"@heroicons/react/20/solid";import{Fragment as h,jsx as e,jsxs as a}from"react/jsx-runtime";var d={highImpact:i,lowImpact:l,mediumImpact:m,sectionHero:n},H=t=>{let{type:o}=t||{};if(!o||o==="none")return null;let r=d[o];return r?e(r,{...t}):null};function N({breadcrumbItems:t}){if(t&&t.length>0){let o=t.filter(r=>r.label.toLowerCase()!=="home");return e("nav",{"aria-label":"Breadcrumb",className:"flex",children:a("ol",{role:"list",className:"flex items-center space-x-4",children:[e("li",{children:e("div",{children:a("a",{href:"/",className:"text-foreground hover:text-accent",children:[e(f,{"aria-hidden":"true",className:"size-5 shrink-0"}),e("span",{className:"sr-only",children:"Home"})]})})}),o.map((r,s)=>e("li",{children:a("div",{className:"flex items-center",children:[e(c,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),r.href?e("a",{href:r.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:r.label}):e("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:r.label})]})},s))]})})}return e(h,{})}export{H as a,N as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as $}from"./chunk-
|
|
4
|
+
import{a as $}from"./chunk-XJKRA2AE.mjs";import{a as O}from"./chunk-FT3AE7L2.mjs";import{a as H}from"./chunk-L5JPAKPM.mjs";import{motion as v}from"motion/react";import{ChevronRight as A,File as M,FileText as K,Search as Q}from"lucide-react";import{useState as N,useMemo as P,useEffect as T}from"react";import{Fragment as E,jsx as e,jsxs as r}from"react/jsx-runtime";function j({label:x,documents:a,children:l,level:p,onDocumentClick:w,selectedDocumentId:f,showDocumentCount:y=!0}){let[c,i]=N(p===0),D=l&&Object.keys(l).length>0,u=a.length+(l?Object.values(l).reduce((t,n)=>t+n.documents.length,0):0),b=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"})}},g=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:[(D||a.length>0)&&r(v.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:`${p*20}px`},onClick:()=>i(!c),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:`w-1 h-6 rounded-full ${g(p)}`}),e(v.div,{animate:{rotate:c?90:0},transition:{duration:.2},className:"flex-shrink-0",children:e(A,{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:x})}),y&&u>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:u})})]})]}),e(v.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:[a.map((t,n)=>r(v.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 ${f===t.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${p*20+20}px`},onClick:()=>w?.(t),whileHover:{scale:1.01},whileTap:{scale:.99},children:[e("div",{className:"flex-shrink-0",children:b(t.format)}),r("div",{className:"flex-1 min-w-0",children:[e("p",{className:`text-sm truncate transition-colors ${f===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)),l&&Object.entries(l).map(([t,n])=>e(j,{label:t,documents:n.documents,children:n.children,level:p+1,onDocumentClick:w,selectedDocumentId:f,showDocumentCount:y},t))]})})]})}function Z({documents:x,menuConfig:a,onDocumentClick:l,onDocumentShare:p,onDocumentUpdate:w,selectedDocumentId:f,className:y,editable:c=!0}){let[i,D]=N(""),[u,b]=N(null),[g,t]=N(x);T(()=>{t(x)},[x]),T(()=>{if(u?.id){let o=g.find(s=>s.id===u.id);o&&b(o)}},[g]);let n=P(()=>i?g.filter(o=>o.title.toLowerCase().includes(i.toLowerCase())||o.description?.toLowerCase().includes(i.toLowerCase())||o.tags?.some(s=>s.toLowerCase().includes(i.toLowerCase()))||Object.values(o.metadata||{}).some(s=>String(s).toLowerCase().includes(i.toLowerCase()))):g,[g,i]),S=P(()=>{let o=(s,L)=>{if(L.length===0)return{};let[F,...B]=L;return s.reduce((d,C)=>{let U=C.metadata?.[F]||"Uncategorized",m=String(U);if(d[m]||(d[m]={documents:[],children:{}}),B.length===0)d[m].documents.push(C);else{let k=o([C],B),h=Object.keys(k)[0];h&&(d[m].children||(d[m].children={}),d[m].children[h]?d[m].children[h].documents.push(...k[h].documents):d[m].children[h]=k[h])}return d},{})};return o(n,a.groupBy)},[n,a.groupBy]),I=o=>{b(o),l?.(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(Q,{className:"h-4 w-4 text-muted-foreground"})}),e(H,{placeholder:"Search knowledge base...",value:i,onChange:o=>D(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:a.groupBy.length===0?e(E,{children:e(j,{label:"Document",documents:n,level:0,onDocumentClick:I,selectedDocumentId:f,showDocumentCount:a.showDocumentCount},"Document")}):r(E,{children:[Object.entries(S).map(([o,s])=>e(j,{label:o,documents:s.documents,children:s.children,level:0,onDocumentClick:I,selectedDocumentId:f,showDocumentCount:a.showDocumentCount},o)),Object.keys(S).length===0&&r(v.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:u?e($,{document:u,onDocumentUpdate:w,editable:c}):e("div",{className:"h-full flex items-center justify-center text-center",children:r(v.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 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as
|
|
4
|
+
import{a as x}from"./chunk-TSFX33PR.mjs";import{a as N}from"./chunk-INBT5E6T.mjs";import{a as f,b as y}from"./chunk-I4GYQZGM.mjs";import{a as g}from"./chunk-CRAFZGCI.mjs";import{a as n}from"./chunk-R4SE63GR.mjs";import{a as b}from"./chunk-KPTGYVDM.mjs";import{a as u}from"./chunk-JXQRVEQB.mjs";import{a as r,b as h,d as v}from"./chunk-DXRAJQMA.mjs";import{a}from"./chunk-Z22NSJMF.mjs";import{useState as C}from"react";import{motion as G,AnimatePresence as Y}from"motion/react";import{Bot as z}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function K({title:k="Digital Colleagues",businessUnits:c,projects:m,fileCount:A,teamMemberCount:w,onCreateProject:P,onOpenProject:j,sidebarItems:W,initialColleagues:F,users:T,onColleagueAdd:S,onColleagueEdit:U,onColleagueDelete:I}){let[i,s]=C("home"),[l,O]=C(c[0]),d=t=>{console.log("Opening app:",t.name)},p=t=>{console.log("Favoriting app:",t.name)},B=t=>{console.log("Opening file:",t.name)},_=t=>{console.log("Sharing file:",t.name)},D=t=>{console.log("Opening project:",t.name),j(t)},R=t=>{console.log("Sharing project:",t.name)},L=t=>{O(t),console.log("Business unit changed to:",t.name)},E=()=>{console.log("Copilot clicked - navigating to chat"),s("chat")},H=t=>{console.log("Notification removed:",t)},M=()=>{console.log("All notifications removed")},V=()=>{switch(i){case"home":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[o("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",l.name," team"]}),e("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),o("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),e("p",{className:"text-3xl font-bold text-primary",children:m.length}),e("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),e("p",{className:"text-3xl font-bold text-primary",children:w}),e("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),e("p",{className:"text-3xl font-bold text-primary",children:A}),e("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),e(a,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>s("chat")}})]});case"colleagues":return e(N,{initialColleagues:F,availableUsers:T,onColleagueAdd:S,onColleagueEdit:U,onColleagueDelete:I});case"chat":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[e("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),o("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",l.name," team members and collaborate in real-time."]})]}),e(a,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return o("div",{className:"space-y-8",children:[e(a,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"New Releases"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:r.filter(t=>t.new).map(t=>e(n,{app:t,showProgress:!0,onOpen:d,onFavorite:p},t.name))})]}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"All Apps"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:r.map(t=>e(n,{app:t,onOpen:d,onFavorite:p},t.name))})]})]});case"knowledge":return e(x,{});case"files":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(a,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),o("section",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:e("h2",{className:"text-2xl font-semibold",children:"All Files"})}),e(u,{files:h,onFileClick:B})]})]});case"projects":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(a,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:P}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),e("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:m.map(t=>e(b,{project:t,onOpen:D,onShare:R},t.name))})]})]});case"learn":return o("div",{className:"space-y-8",children:[e(a,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),e("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:v.slice(0,3).map(t=>o("div",{className:"rounded-3xl border p-6",children:[e("h3",{className:"font-semibold mb-2",children:t.title}),e("p",{className:"text-sm text-muted-foreground mb-4",children:t.description}),o("div",{className:"flex items-center justify-between text-sm",children:[e("span",{children:t.duration}),e("span",{children:t.level})]})]},t.title))})]})]});default:return null}};return e(g,{sidebarItems:f,title:k,notifications:y,businessUnits:c,currentBusinessUnit:l,onBusinessUnitChange:L,activeTab:i,onTabChange:s,showTabs:!0,onActionClick:E,actionIcon:e(z,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:H,onRemoveAll:M,children:e(Y,{mode:"wait",children:e(G.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:V()},i)})})}export{K as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as K}from"./chunk-GAU24H4A.mjs";import{a as
|
|
4
|
+
import{a as K}from"./chunk-GAU24H4A.mjs";import{a as ee}from"./chunk-M2REXGQW.mjs";import{a as x}from"./chunk-HB57GPGK.mjs";import{a as O}from"./chunk-KKW3FINI.mjs";import{a as Z}from"./chunk-FSCDCSVK.mjs";import{a as _}from"./chunk-NDZ26EG6.mjs";import{a as X}from"./chunk-Z22NSJMF.mjs";import{a as le}from"./chunk-Y7H3EUBR.mjs";import{a as Y}from"./chunk-FGEFYI5E.mjs";import{a as U,c as $,d as k,g as F,i as p}from"./chunk-YFAZQYK4.mjs";import{a as R}from"./chunk-L5JPAKPM.mjs";import{b as H}from"./chunk-ZUA4KNIR.mjs";import{a as c,b as h,c as w,e as u}from"./chunk-YO3GQYRJ.mjs";import{useEffect as Ce,useState as o}from"react";import{Plus as fe,Search as ve,Users as te,Bot as ye,User as he,Filter as we}from"lucide-react";import{motion as xe,AnimatePresence as Ne}from"motion/react";import{jsx as l,jsxs as t}from"react/jsx-runtime";function Se({initialColleagues:N,onColleagueAdd:S,onColleagueEdit:I,onColleagueDelete:ae,compactView:n=!1,departments:ie=["Design","Engineering","Marketing","Product","Sales","Operations"],className:oe,availableUsers:L=[],existingDigitalColleagues:P=[],availableKnowledgeDocuments:j=[]}){let[s,r]=o(N||[]),[d,B]=o(""),[b,M]=o("all"),[D,G]=o("all"),[v,ne]=o("all"),[W,C]=o(null),[A,y]=o(null);Ce(()=>{r(N||[])},[N]);let se=Array.isArray(L)?L:[],re=Array.isArray(P)?P:[],[m,a]=o("main"),f=s.filter(e=>!e||!e.name?!1:e.name.toLowerCase().includes(d.toLowerCase())||e.type==="human"&&e.email?.toLowerCase().includes(d.toLowerCase())||e.type==="digital"&&e.jobDescription?.toLowerCase().includes(d.toLowerCase())),q=f.filter(e=>e.type==="human"),z=f.filter(e=>e.type==="digital"),J=()=>{a("typeSelection")},T=e=>{e.type==="digital"&&(C(e),a("form")),console.log("Editing colleague:",e),I?.(e)},E=e=>{e.type==="digital"&&(y(e),a("view"))},de=e=>{let i={id:`human-${Date.now()}`,type:"human",name:e.name,email:e.email,updatedAt:e.updatedAt,createdAt:e.createdAt,accounts:e.accounts};r(g=>[...g,i]),S?.(i),a("main")},me=e=>{if(!e||!e.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",e);return}r(i=>[...i,{...e,type:"digital"}]),S?.({...e,type:"digital"}),a("main")},ge=()=>{C(null),a("form")},Q=e=>{if(!e||!e.id){console.error("Invalid colleague provided to handleSaveColleague:",e);return}W?(r(i=>i.map(g=>g.id===e.id?{...e,type:"digital"}:g)),I?.({...e,type:"digital"})):(r(i=>[...i,{...e,type:"digital"}]),S?.({...e,type:"digital"})),a("main"),C(null)},ce=()=>{a("main"),C(null),y(null)},ue=()=>{a("main"),y(null)},be=()=>{A&&(C(A),y(null),a("form"))},V=e=>{console.log("deleting",e,s),ae?.(e,s.find(i=>i.id.toString()===e.toString())?.type),r(i=>i.filter(g=>g.id!==e))},pe=()=>{B(""),M("all"),G("all")};return m==="typeSelection"?l(Z,{onSelectHuman:()=>a("userSelection"),onSelectDigital:()=>a("digitalOptions"),onCancel:()=>a("main")}):m==="userSelection"?l(le,{users:se,onUserSelect:de,onCancel:()=>a("typeSelection")}):m==="digitalOptions"?l(ee,{onCloneExisting:()=>a("digitalClone"),onCreateNew:ge,onCancel:()=>a("typeSelection")}):m==="digitalClone"?l(_,{digitalColleagues:re,onColleagueClone:me,onCancel:()=>a("digitalOptions")}):m==="form"?l(O,{colleague:W||void 0,onSave:Q,onCancel:ce,availableKnowledgeDocuments:j}):m==="view"?l(O,{colleague:A||void 0,onSave:Q,onCancel:ue,readOnly:!0,availableKnowledgeDocuments:j}):l("div",{className:"px-2 md:px-4 py-4 space-y-8",children:l(Ne,{mode:"wait",children:l(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:t("div",{className:`space-y-6 ${oe||""}`,children:[l(X,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:J}}),t("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t(c,{children:[t(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l(w,{className:"text-sm font-medium",children:"Total Colleagues"}),l(te,{className:"h-4 w-4 text-muted-foreground"})]}),t(u,{children:[l("div",{className:"text-2xl font-bold",children:s.length}),l("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),t(c,{children:[t(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l(w,{className:"text-sm font-medium",children:"Human Members"}),l(he,{className:"h-4 w-4 text-muted-foreground"})]}),t(u,{children:[l("div",{className:"text-2xl font-bold",children:s.filter(e=>e.type==="human").length}),l("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),t(c,{children:[t(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l(w,{className:"text-sm font-medium",children:"Digital Colleagues"}),l(ye,{className:"h-4 w-4 text-muted-foreground"})]}),t(u,{children:[l("div",{className:"text-2xl font-bold",children:s.filter(e=>e.type==="digital").length}),l("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),l(c,{children:l(u,{className:"pt-6",children:t("div",{className:"flex flex-col md:flex-row gap-4",children:[l("div",{className:"flex-1",children:t("div",{className:"relative",children:[l(ve,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),l(R,{placeholder:"Search colleagues...",value:d,onChange:e=>B(e.target.value),className:"pl-9"})]})}),t(U,{value:b,onValueChange:M,children:[l(k,{className:"w-full md:w-[180px]",children:l($,{placeholder:"Department"})}),t(F,{children:[l(p,{value:"all",children:"All Departments"}),ie.map(e=>l(p,{value:e,children:e},e))]})]}),t(U,{value:D,onValueChange:G,children:[l(k,{className:"w-full md:w-[140px]",children:l($,{placeholder:"Status"})}),t(F,{children:[l(p,{value:"all",children:"All Status"}),l(p,{value:"active",children:"Active"}),l(p,{value:"inactive",children:"Inactive"})]})]}),(d||b!=="all"||D!=="all")&&t(H,{variant:"outline",onClick:pe,className:"gap-2",children:[l(we,{className:"h-4 w-4"}),"Clear"]})]})})}),t("div",{className:"space-y-4",children:[l(Y,{activeTab:v,onTabChange:ne,tabOptions:[{value:"all",label:`All (${f.length})`},{value:"human",label:`Human (${q.length})`},{value:"digital",label:`Digital (${z.length})`}],maxWidth:"400px",gridCols:3}),v==="all"&&l("div",{className:`grid gap-4 ${n?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:f.map(e=>l(x,{colleague:e,onEdit:T,onDelete:V,onViewDetails:E,compact:n,className:K([e.type==="digital"&&"border-teal-400"])},`${e}-${e.id}`))}),v==="human"&&l("div",{className:`grid gap-4 ${n?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:q.map(e=>l(x,{colleague:e,onEdit:T,onDelete:V,onViewDetails:E,compact:n},e.id))}),v==="digital"&&l("div",{className:`grid gap-4 ${n?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:z.map(e=>l(x,{colleague:e,onEdit:T,onDelete:V,onViewDetails:E,compact:n,className:K([e.type==="digital"&&"border-teal-400"])},e.id))})]}),f.length===0&&l(c,{children:l(u,{className:"pt-6",children:t("div",{className:"text-center py-8",children:[l(te,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),l("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),l("p",{className:"text-muted-foreground mb-4",children:d||b!=="all"||D!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),t(H,{onClick:J,className:"gap-2",children:[l(fe,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}export{Se as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as g}from"./chunk-
|
|
4
|
+
import{a as g}from"./chunk-AQQCH7Z2.mjs";import{a as d,b as o,c as a,d as m,e as t,f as l}from"./chunk-76M7JE4D.mjs";import{a as u}from"./chunk-OYZDAMCS.mjs";import{b as n,d as b,f as c}from"./chunk-ZFUP5NVF.mjs";import{a as s}from"./chunk-4UIARERB.mjs";import{a as p}from"./chunk-LAQ3QAUW.mjs";import{a as f}from"./chunk-WU3JMLSC.mjs";import{a as S}from"./chunk-BZAYEKYC.mjs";import{jsx as e,jsxs as r}from"react/jsx-runtime";function h({...i}){return r("div",{className:"bg-sidebar",children:[e(p,{isMenuOpen:!0,logoLight:S,logoDark:f,...i.header,className:"bg-sidebar",wide:!0}),r(n,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[e(g,{...i.sidebarLeft,className:"flex-none top-24"}),r(c,{className:"grow overflow-hidden",children:[e("header",{className:"flex h-16 shrink-0 items-center gap-2",children:r("div",{className:"flex items-center gap-2 px-4",children:[e(b,{className:"-ml-1"}),e(s,{orientation:"vertical",className:"mr-2 h-4"}),e(d,{children:r(o,{children:[e(a,{className:"hidden md:block",children:e(m,{href:"#",children:"Building Your Application"})}),e(l,{className:"hidden md:block"}),e(a,{children:e(t,{children:"Data Fetching"})})]})})]})}),r("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[r("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),e("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),e(u,{})]})}export{h as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as V}from"./chunk-PZFYJ5FS.mjs";import{a as A}from"./chunk-DFIXTV2M.mjs";import{a as I,c as _,d as L,g as O,i as M}from"./chunk-YFAZQYK4.mjs";import{a as z}from"./chunk-B4H6T2GP.mjs";import{a as k}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{motion as H}from"motion/react";import{Save as oe,X as J,Plus as ie,ChevronDown as le,ChevronRight as de,Info as $,File as P,FileText as ce,Type as me,Loader2 as ue}from"lucide-react";import{useEffect as w,useRef as p,useState as y}from"react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function De({document:C,onSave:S,mode:fe="edit",onCancel:U,availableDocuments:K=[],knowledgeContexts:W=[]}){let[s,l]=y({...C,updatedAt:new Date}),[x,X]=y(!1),[d,q]=y(s.richTextContent),[u,R]=y(!1),he=p(null),v=p(""),T=p(null),f=p(null),F=e=>{let a=new WeakSet,n=r=>r&&typeof r=="object"?a.has(r)?null:(a.add(r),Array.isArray(r)?r.map(n):Object.keys(r).sort().reduce((o,c)=>(o[c]=n(r[c]),o),{})):r;return JSON.stringify(n(e))},h=e=>e?e.replace(/\s+/g," ").trim():"",D=()=>s.format==="richText"?F(d):h(s.content),j=()=>{let e={title:h(s.title),description:h(s.description),format:s.format,content:D()},a=F(e),n=5381;for(let r=0;r<a.length;r++)n=n*33^a.charCodeAt(r);return(n>>>0).toString(16)},G=(e,a)=>{if(e===a)return!1;if(s.format!=="richText"){let n=Q(e),r=D();if(n==null)return!0;let o=n.length,c=r.length,g=Math.abs(c-o),b=o===0?1:g/o;return h(n)===h(r)&&g<3?!1:g>=10||b>=.02}return!0},B=p(new Map),Q=e=>{let a=B.current.get(e);return a==null?null:"x".repeat(a)};w(()=>(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{let e=j(),a=v.current;if(G(a,e)&&(R(!0),S({...s,richTextContent:d},"autosave"),v.current=e,s.format!=="richText")){let n=D();B.current.set(e,n.length)}},800),()=>{f.current&&clearTimeout(f.current)}),[s.title,s.description,s.format,s.content,s.metadata,d]),w(()=>{let e=()=>{let a=j();a!==v.current&&(S({...s,richTextContent:d},"autosave"),v.current=a)};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[s,d]),w(()=>(u&&(T.current=setTimeout(()=>{R(!1)},2e3)),()=>{T.current&&clearTimeout(T.current)}),[u]),w(()=>{l(C)},[C]);let ge=e=>{switch(e){case"markdown":case"mdx":return t(ce,{className:"h-6 w-6 text-primary"});case"richText":return t(P,{className:"h-6 w-6 text-success"});case"text":return t(me,{className:"h-6 w-6 text-muted-foreground"});default:return t(P,{className:"h-6 w-6 text-muted-foreground"})}},Y=e=>{switch(e){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 e=new Set,a=new Set;return W.forEach(n=>{n.menuConfig.groupBy.forEach(r=>e.add(r))}),K.forEach(n=>{n.metadata&&Object.keys(n.metadata).forEach(r=>a.add(r))}),{contextKeys:Array.from(e).sort(),documentKeys:Array.from(a).sort(),allKeys:Array.from(new Set([...e,...a])).sort()}},ee=e=>{let a=new Set;return K.forEach(n=>{n.metadata?.[e]&&a.add(String(n.metadata[e]))}),Array.from(a).sort()},te=Z(),ae=()=>{S({...s,richTextContent:d},"autosave")},N=(e,a)=>{l(n=>({...n,metadata:{...n.metadata,[e]:a}}))},ne=(e,a)=>{a==="__custom__"?N(e,""):N(e,a)},se=()=>{N("","")},re=e=>{l(a=>{let n={...a.metadata};return delete n[e],{...a,metadata:n}})};return i(H.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[i("div",{className:"border-b border-border bg-card p-8 pb-6",children:[i("div",{className:"flex items-start justify-between gap-4 mb-4",children:[t("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:i("div",{className:"flex-1 min-w-0",children:[i("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[t("div",{className:"flex-1 min-w-0",children:t(A,{fieldName:"title",value:s.title,label:"",onSave:(e,a)=>l(n=>({...n,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"})}),t("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${Y(s.format)} flex-shrink-0 mt-1`,children:s.format.toUpperCase()})]}),t("div",{className:"mt-2",children:t(A,{fieldName:"description",value:s.description||"Click to add description...",label:"",multiline:!0,onSave:(e,a)=>l(n=>({...n,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"})})]})}),i("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i(m,{variant:"ghost",size:"sm",onClick:()=>X(!x),className:"gap-2",children:[t($,{className:"h-4 w-4"}),"Metadata",s.metadata&&Object.keys(s.metadata).length>0&&t("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(s.metadata).length}),x?t(le,{className:"h-4 w-4"}):t(de,{className:"h-4 w-4"})]}),i(m,{variant:"outline",size:"sm",onClick:U,className:"gap-2",children:[t(J,{className:"h-4 w-4"}),"Close"]}),i(m,{size:"sm",onClick:ae,className:"gap-2",disabled:u,children:[u?t(ue,{className:"h-4 w-4 animate-spin"}):t(oe,{className:"h-4 w-4"}),u?"Auto-saving...":"Save"]})]})]}),t(H.div,{initial:!1,animate:{height:x?"auto":0,opacity:x?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:i("div",{className:"pt-4 border-t border-border mt-4 max-h-full flex gap-2",children:[t("div",{className:"flex items-center justify-between mb-3",children:i("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[t($,{className:"h-4 w-4"}),"Document Metadata"]})}),i("div",{className:"flex flex-col gap-2",children:[t("div",{className:"bg-muted rounded-lg p-4 border border-border",children:s.metadata&&Object.keys(s.metadata).length>0?t("div",{className:"space-y-2",children:Object.entries(s.metadata).map(([e,a],n)=>{let r=ee(e);return i("div",{className:"flex gap-2 items-center",children:[t(k,{value:e,onChange:o=>{let c=o.target.value||"",g=s.metadata?.[e];l(b=>{let E={...b.metadata};return delete E[e],c&&(E[c]=g||""),{...b,metadata:E}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${e}`}),t("datalist",{id:`metadata-keys-${e}`,children:te.allKeys.map(o=>t("option",{value:o},o))}),t("span",{className:"text-muted-foreground text-sm",children:"="}),r.length>0?i(I,{value:String(a||""),onValueChange:o=>ne(e,o),children:[t(L,{className:"flex-1 h-8 text-sm",children:t(_,{placeholder:"Value"})}),i(O,{children:[r.map(o=>t(M,{value:o,children:o},o)),t(M,{value:"__custom__",children:t("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):t(k,{value:String(a||""),onChange:o=>N(e,o.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),t(m,{type:"button",variant:"ghost",size:"sm",onClick:()=>re(e),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:t(J,{className:"h-3 w-3"})})]},`metadata-key-${n}`)})}):i("div",{className:"text-center py-4",children:[t("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),t("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})}),i(m,{type:"button",variant:"outline",size:"sm",onClick:se,className:"gap-1 h-8",children:[t(ie,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),t("div",{className:"flex-1 overflow-hidden",children:t("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:s.format==="richText"?t(V,{setValue:q,value:d,name:"richTextContent"}):t(z,{value:s.content||"",onChange:e=>l(a=>({...a,content:e.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}export{De as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as
|
|
4
|
+
import{a as c}from"./chunk-Q5XT55O3.mjs";import{a as i}from"./chunk-WISC5QJV.mjs";import{a as l}from"./chunk-MDJREBVI.mjs";import{useState as m,useEffect as d}from"react";import{useTheme as S}from"next-themes";import{Moon as N,Sun as y}from"lucide-react";import{PopoverGroup as D}from"@headlessui/react";import{Fragment as H,jsx as e,jsxs as p}from"react/jsx-runtime";function z({isMenuOpen:u,logoLight:h,logoDark:f,menuItems:o,themeControl:g=!1,wide:b=!1}){let[v,a]=m(!1),[k,n]=m(""),r=["light","dark"],{theme:s,setTheme:w}=S();d(()=>{n(s||"dark")},[s]);let x=()=>{let t=r[(r.indexOf(k)+1)%r.length];n(t),w(t)};return d(()=>{let t=()=>{window.scrollY>100?a(!0):a(!1)};return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[]),e(H,{children:e("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${v||u?"translate-y-0":"-translate-y-full bg-transparent"}`,children:e("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:p("div",{className:l("flex items-center justify-between px-9 py-0",!b&&"container"),children:[e(c,{logoDark:f,logoLight:h}),e(D,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(t=>e(i,{...t},t.name))}),g&&e("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:x,children:p("div",{className:"relative",children:[e(y,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),e(N,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}export{z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-PDY7JYY3.mjs";import{a as i}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-PDY7JYY3.mjs";import{a as i}from"./chunk-L3BLBPSR.mjs";import{a as r}from"./chunk-MDJREBVI.mjs";import{jsx as n,jsxs as d}from"react/jsx-runtime";function u({isMenuOpen:e,logoLight:o,logoDark:t,menuItems:a,className:p,wide:l,themeControl:s=!1}){return d("div",{className:r("fixed top-0 left-0 right-0 z-50",p),children:[n(i,{isMenuOpen:e,logoLight:o,logoDark:t,menuItems:a,themeControl:s,wide:l}),n(m,{isMenuOpen:e,logoLight:o,logoDark:t,menuItems:a})]})}export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as j,b as B,c as J,d as z,e as G}from"./chunk-HFEN3KJC.mjs";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 f,b as p,i as u,j as g}from"./chunk-OCPX4QPC.mjs";import{a as I,b as A,c as R,d as O}from"./chunk-KY7WQYN4.mjs";import{a as y}from"./chunk-MDJREBVI.mjs";import{useLexicalComposerContext as he}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext";import{$insertNodeToNearestRoot as Ce,mergeRegister as X}from"@payloadcms/richtext-lexical/lexical/utils";import{$createParagraphNode as ke,$getPreviousSelection as ve,$getRoot as Ne,$getSelection as k,$isParagraphNode as Y,$isRangeSelection as v,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 q}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 ye}from"@payloadcms/richtext-lexical/lexical/list";import{AlignCenter as Ie,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 ze(){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=k();v(i)&&(e==="p"?K(i,()=>ke()):K(i,()=>Be(e)))})},b=Pe(()=>{let e=k();if(v(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&&!Y(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(()=>X(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),X(t.registerCommand(E,e=>(t.update(()=>{let i=k()||ve();if(v(i)){let n=_({id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value}),{focus:d}=i,r=d.getNode();Ce(n),Y(r)&&!r.__first&&r.remove()}}),!0),Me))),[t,b]);let me=[[{label:"Undo",icon:o($e,{width:15,height:15}),onClick:()=>{t.dispatchCommand(q,void 0)},disabled:!V},{label:"Redo",icon:o(He,{width:15,height:15}),onClick:()=>{t.dispatchCommand(q,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(Ie,{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(z,{}),onClick:()=>l("h3")},{label:"Heading 4",value:"h4",icon:o(G,{}),onClick:()=>l("h4")},...[{label:"Unordered List",value:"ul",icon:o(Ee,{width:15,height:15}),onClick:()=>{t.dispatchCommand(ye,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 sticky top-0 bg-black z-50",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:y("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(I,{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{ze as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{c as k,h as R,i as v,k as S,l as f,o as x,p as u,q as c,r as y,s as w,v as P,w as B,x as L}from"./chunk-
|
|
4
|
+
import{c as k,h as R,i as v,k as S,l as f,o as x,p as u,q as c,r as y,s as w,v as P,w as B,x as L}from"./chunk-ZFUP5NVF.mjs";import{a as n}from"./chunk-7GSXNSLD.mjs";import{a as g,b as N,c as M}from"./chunk-YNCJATT7.mjs";import{ChevronRight as A}from"lucide-react";import T from"clsx";import{Fragment as H,jsx as e,jsxs as r}from"react/jsx-runtime";function J({mainNav:l,secondaryNav:s,title:o,subTitle:a,pathName:b,menuHeading:i,onNavClick:d,loading:p=!1,LinkComponent:h,...F}){let C=h?t=>e(h,{...t}):d?({href:t,children:m,...I})=>e("button",{onClick:()=>d&&d(t),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...I,children:m}):t=>e("a",{...t});return r(k,{...F,variant:"inset",children:[e(R,{children:e(u,{children:e(c,{children:p?r("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[e(n,{className:"bg-gray-200 my-2 w-full h-7"}),e(n,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):r("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[e("span",{className:"truncate font-semibold",children:o}),a&&e("span",{className:"truncate text-sm",children:a})]})})})}),p&&r(S,{children:[e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"}),e(n,{className:"bg-gray-200 w-3/4 h-5"})]}),r(S,{children:[l&&!p&&l.map((t,m)=>e(G,{subNav:t,pathName:b,Link:C},m)),e(f,{className:"mt-auto",children:e(x,{children:e(u,{children:s&&!p&&s.map(t=>e(c,{children:e(y,{asChild:!0,size:"sm",children:r(C,{href:t.url||"",children:[t.icon&&e(t.icon,{}),e("span",{children:t.label})]})})},t.label))})})})]}),e(v,{})]})}function G({subNav:l,pathName:s,Link:o}){let a=l,b=!1;return a.links&&a.links.map(i=>{i.url===s&&(b=!0)}),e(g,{defaultOpen:!0,className:"group/collapsible",children:e(f,{className:"py-0",children:e(u,{children:e(g,{asChild:!0,defaultOpen:a.isActive,children:r(c,{children:[e(y,{asChild:!0,tooltip:a.label,className:T(b&&"font-bold text-accent"),children:r(o,{href:a.url,children:[a.icon&&e(a.icon,{}),e("span",{children:a.label})]})}),a.links?.length?r(H,{children:[e(N,{asChild:!0,children:r(w,{className:"data-[state=open]:rotate-90",children:[e(A,{}),e("span",{className:"sr-only",children:"Toggle"})]})}),e(M,{children:e(P,{children:a.links?.map(i=>e(B,{children:e(L,{asChild:!0,className:T(i.url===s&&"font-bold text-accent"),children:e(o,{href:i.url,children:e("span",{children:i.label})})})},i.label))})})]}):null]})},a.label)})})})}export{J as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as b}from"./chunk-CTTBF7F4.mjs";import{a as I}from"./chunk-56X4PU43.mjs";import{a as S}from"./chunk-
|
|
4
|
+
import{a as b}from"./chunk-CTTBF7F4.mjs";import{a as I}from"./chunk-56X4PU43.mjs";import{a as S}from"./chunk-AF3FLXBA.mjs";import{useChat as me}from"@ai-sdk/react";import{useState as l}from"react";import{motion as fe,AnimatePresence as he}from"motion/react";import{Users as ye}from"lucide-react";import{jsx as n,jsxs as Ce}from"react/jsx-runtime";function Le({aiConfig:w,useCustomChat:F,enableAI:T=!0,messages:D=[],businessUnits:R=[],capabilities:B=[],sidebarItems:x=[],notifications:N=[],sessions:M=[],onNewChat:A,onSessionSelect:L,onSessionDelete:P,onSessionEdit:k=()=>{},onBusinessUnitChange:E=()=>{},onNotificationRemove:K=()=>{},onRemoveAll:O=()=>{},onActionClick:$=()=>{},onSearch:q=p=>console.log("Search query:",p),initialTeam:z="design",currentSession:m=null,showCapabilities:ve=!0,title:W="Digital Colleagues",enableFileUpload:f=!0,maxFileSize:h=10,allowedFileTypes:y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:H="/headerlogo.png",appName:X="Nuvia",tagline:G="AI-Powered Workspace",actionIcon:J=n(ye,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate",sidebarInitiallyClosed:V=!1}){let p={...w,onError:e=>{i?.setMessages(t=>[...t,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:e.message}]}]),console.error("Error in CopilotInterface:",e)}},Y=me(p||{}),i=T?F||Y:null,[Z,u]=l(""),[_,C]=l(!1),j=i?.messages||D,r=Z,ee=i?.status==="submitted"||_,se=i?.addToolResult?(e,t,s)=>{i.addToolResult({tool:t,toolCallId:e,output:s}),console.log("Tool result added:",{toolCallId:e,tool:t,output:s}),i.sendMessage()}:()=>{console.log("addToolResult not available")},o=R||[],te={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[ie,ne]=l(()=>o.length===0?te:o.find(e=>e.id===z)||o[0]),[a,c]=l([]),[oe,ae]=l(!1),le=e=>{if(!e||!f)return;let t=[];Array.from(e).forEach(s=>{if(s.size>h*1024*1024){alert(`File ${s.name} is too large. Maximum size is ${h}MB.`);return}if(y.length>0&&!y.some(d=>s.type.match(d))){alert(`File type ${s.type} is not allowed.`);return}let U={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:s,status:"pending",progress:0};if(s.type.startsWith("image/")){let d=new FileReader;d.onload=ue=>{c(ge=>ge.map(g=>g.id===U.id?{...g,preview:ue.target?.result}:g))},d.readAsDataURL(s)}t.push(U)}),c(s=>[...s,...t])},re=e=>{c(t=>t.filter(s=>s.id!==e))},v=()=>{if(!(!r.trim()&&a.length===0)){if(i){let e=a.length>0?ce(a.map(t=>t.file)):void 0;i.sendMessage({text:r,files:e},{body:{timestamp:Date.now()}}),u("")}else console.log("Message to send:",r),console.log("Files to upload:",a),u(""),C(!0),setTimeout(()=>{C(!1)},1500);c([])}},ce=e=>{let t=new DataTransfer;return e.forEach(s=>t.items.add(s)),t.files},de=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),v())},pe=e=>{u(e)};return n(b,{sidebarItems:x||[],title:W,notifications:N||[],businessUnits:o,currentBusinessUnit:ie,onBusinessUnitChange:e=>{e&&(ne(e),E?.(e))},onSearch:q,showTabs:!1,onActionClick:$,actionIcon:J,actionText:Q,onNotificationRemove:K,onRemoveAll:O,logo:H,appName:X,tagline:G,sidebarInitiallyClosed:V,children:n(he,{mode:"wait",children:n(fe.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:Ce("div",{className:"h-full flex",children:[n("div",{className:"w-80 flex-shrink-0 h-full p-2",children:n(I,{sessions:M||[],currentSession:m,teams:o,onNewChat:A,onSessionSelect:L,onSessionEdit:k,onSessionDelete:P})}),n("div",{className:"flex-1 h-full p-2",children:n(S,{messages:j||[],input:r,isTyping:ee,currentSessionTitle:m?.title,capabilities:B||[],onInputChange:pe,addToolResult:se,onSendMessage:v,onKeyPress:de,fileUploads:a,isDragOver:oe,enableFileUpload:f,onFileUpload:le,onRemoveFile:re,onDragOver:ae})})]})},"chat-interface")})})}export{Le as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{c as R,h as v,i as w,j as B,k as P,l,m as s,o as b,p as o,q as n,r as u,v as C,w as g,x as y}from"./chunk-
|
|
4
|
+
import{c as R,h as v,i as w,j as B,k as P,l,m as s,o as b,p as o,q as n,r as u,v as C,w as g,x as y}from"./chunk-ZFUP5NVF.mjs";import{a as f}from"./chunk-7GSXNSLD.mjs";import{a as p,b as d,c}from"./chunk-YNCJATT7.mjs";import{a as M}from"./chunk-FVM5SQT2.mjs";import{PencilLine as z,ChevronDown as h,FilePlus as E,Edit as H,Printer as _}from"lucide-react";import $ from"clsx";import{Fragment as T,jsx as e,jsxs as a}from"react/jsx-runtime";var q=()=>e(M,{iconName:"github",size:"10x"});function Z({relatedContent:i,tableOfContents:x,editorComponent:N,loading:m=!1,editMode:k=!1,onAddDocument:A,onEditDocument:L,onPrintDocument:O,onGithubClick:G,onNavClick:S,LinkComponent:I,...D}){let F=I?t=>e(I,{...t}):S?({item:t,children:r,...j})=>e("button",{onClick:()=>S&&S(t),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...j,children:r}):t=>e("a",{href:t.href,...t});return a(R,{side:"right",variant:"inset",...D,children:[a(v,{className:"border-b border-sidebar-border",children:[a(o,{className:"flex-row space-x-1",children:[e(n,{children:a(u,{onClick:A,children:[e(E,{})," ",e("span",{children:"Add Document"})]})}),G&&e(n,{children:e(u,{onClick:G,tooltip:"Open in GitHub",children:e(q,{})})})]}),a(o,{className:"flex-row space-x-1",children:[e(n,{className:"w-5/12",children:a(u,{onClick:()=>L(),variant:k?"outline":"default",className:$(k&&"text-accent"),children:[e(H,{})," ",e("span",{children:"Edit"})]})}),e(n,{className:"w-5/12",children:a(u,{onClick:O,children:[e(_,{})," ",e("span",{children:"Print"})]})})]})]}),N&&a(T,{children:[e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Editor Controls",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:N})})]})}),e(B,{className:"mx-0"})]}),a(P,{className:"overflow-auto",children:[m&&a(T,{children:[a(l,{children:[e(s,{children:"Related Content"}),e(b,{children:e(o,{children:Array.from({length:3}).map((t,r)=>e(n,{children:e(f,{className:"bg-gray-200 w-full h-10"})},r))})})]}),a(l,{children:[e(s,{children:"Table of Contents"}),e(b,{children:e(o,{children:Array.from({length:3}).map((t,r)=>e(n,{children:e(f,{className:"bg-gray-200 w-full h-10"})},r))})})]})]}),i&&!m&&Object.keys(i).length>0&&e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Related Content",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:e(o,{children:i&&Object.keys(i).map(t=>a(n,{children:[a("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",t.charAt(0).toUpperCase()+t.slice(1)]}),t&&i[t]&&e(C,{children:i[t].map(r=>e(g,{children:e(y,{asChild:!0,isActive:!1,size:"sm",children:a(F,{href:r.url,item:r,className:"flex justify-between items-center w-full text-xs",children:[e("span",{children:r.label}),r.type==="note"&&e(z,{className:"ml-2 text-gray-400 !important",size:16}),r.type==="draft"&&e(M,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},r.label))})]},t))})})})]})}),x&&!m&&e(p,{defaultOpen:!0,className:"group/collapsible",children:a(l,{children:[e(s,{asChild:!0,children:a(d,{children:["Table of Contents",e(h,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),e(b,{children:e(c,{children:e(o,{children:x.map(t=>a(n,{children:[e(u,{asChild:!0,children:e("a",{href:`#${t.url}`,className:"text-xs",children:t.title})}),t.items?.length?e(C,{children:t.items.map(r=>e(g,{children:e(y,{asChild:!0,isActive:r.isActive,size:"sm",children:e("a",{href:`#${r.url}`,className:"flex justify-between items-center w-full text-xs",children:e("span",{children:r.title})})})},r.title))}):null]},t.title))})})})]})})]}),e(w,{})]})}export{Z as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as c}from"./chunk-
|
|
4
|
+
import{a as c}from"./chunk-LEUI66J6.mjs";import{d as m}from"./chunk-RKS7CWAP.mjs";import{a as s}from"./chunk-BZEGLKRZ.mjs";import{AutoFocusPlugin as p}from"@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin";import{LexicalComposer as g}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposer";import{ContentEditable as x}from"@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as f}from"@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary";import{HistoryPlugin as C}from"@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin";import{RichTextPlugin as E}from"@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin";import{ListPlugin as b}from"@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin";import{ListItemNode as v,ListNode as P}from"@payloadcms/richtext-lexical/lexical/list";import{HeadingNode as L}from"@payloadcms/richtext-lexical/lexical/rich-text";import{OnChangePlugin as N}from"@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin";import{useEffect as u}from"react";import{useLexicalComposerContext as R}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext";import{Fragment as T,jsx as t,jsxs as a}from"react/jsx-runtime";var y=({setValue:n,value:i,name:l,editable:e=!0})=>{let[o]=R(),r=d=>{d.read(()=>{let h=d.toJSON();n?.(()=>h)})};return u(()=>{o.setEditable(e)},[e]),u(()=>{i&&o.update(()=>{o.setEditorState(o.parseEditorState(i))})},[]),t("div",{className:"w-full",children:a("div",{className:" ",children:[e&&t(c,{}),a("div",{className:"px-4 my-4 border-l border-[#222222]",children:[t(E,{contentEditable:t(x,{name:l,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:f}),e&&a(T,{children:[t(C,{}),t(p,{}),t(b,{}),t(N,{onChange:r}),t(m,{})]})]})]})})},S=({setValue:n,value:i,name:l,editable:e=!0})=>t(g,{initialConfig:{namespace:"Lexical editor",nodes:[P,v,L,s],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:t(y,{value:i,setValue:n,name:l,editable:e})}),Q=S;export{Q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import{a as S}from"./chunk-
|
|
4
|
+
import{a as S}from"./chunk-5NIEZE7A.mjs";import{a as d,b as o,c as a,d as m,e as t,f as l}from"./chunk-76M7JE4D.mjs";import{a as u}from"./chunk-OYZDAMCS.mjs";import{b as n,d as b,f as c}from"./chunk-ZFUP5NVF.mjs";import{a as s}from"./chunk-4UIARERB.mjs";import{a as p}from"./chunk-LAQ3QAUW.mjs";import{a as g}from"./chunk-WU3JMLSC.mjs";import{a as f}from"./chunk-BZAYEKYC.mjs";import{jsx as e,jsxs as r}from"react/jsx-runtime";function h({...i}){return r("div",{className:"bg-sidebar",children:[e(p,{isMenuOpen:!0,logoLight:f,logoDark:g,...i.header,className:"bg-sidebar",wide:!0}),r(n,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[e(S,{...i.sidebarLeft,className:"flex-none top-24"}),r(c,{className:"grow overflow-hidden",children:[e("header",{className:"flex h-16 shrink-0 items-center gap-2",children:r("div",{className:"flex items-center gap-2 px-4",children:[e(b,{className:"-ml-1"}),e(s,{orientation:"vertical",className:"mr-2 h-4"}),e(d,{children:r(o,{children:[e(a,{className:"hidden md:block",children:e(m,{href:"#",children:"Building Your Application"})}),e(l,{className:"hidden md:block"}),e(a,{children:e(t,{children:"Data Fetching"})})]})})]})}),r("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[r("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"}),e("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),e("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),e(u,{})]})}export{h as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as w}from"./chunk-I6XKBCH4.mjs";import{a as x}from"./chunk-WLI2YTOQ.mjs";import{a as f}from"./chunk-GZ7FGBTR.mjs";import{a as c,b as p,i as u,j as m}from"./chunk-OCPX4QPC.mjs";import{b as g}from"./chunk-ZUA4KNIR.mjs";import{useEffect as S,useState as l}from"react";import{ChevronDown as j,Loader2 as P}from"lucide-react";import{Fragment as B,jsx as e,jsxs as t}from"react/jsx-runtime";function U({documents:v=[],contexts:o=[],onDocumentClick:C=n=>console.log("Document clicked:",n),onDocumentShare:D=n=>console.log("Share document:",n),onLoadDocumentContent:L,selectedDocumentId:K,onAddKnowledge:s,onDocumentUpdate:b,onAddTeamContext:h,onUpdateTeamContext:N,onDeleteTeamContext:y}){let[n,i]=l(o[0]),[M,r]=l(!1),[A,a]=l(!1),[k,I]=l(!1);S(()=>{if(!n&&o&&o.length>0)i(o[0]);else{let d=o.find(O=>O.id===n?.id);i(d||o[0])}},[o]);let T=d=>{s&&(I(!0),s(d)),r(!1)};return t("div",{className:"flex flex-col h-full",children:[t("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[k&&t("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[e(P,{className:"h-8 w-8 animate-spin text-primary"}),e("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),o&&o.length>0&&t("div",{className:"",children:[e("div",{className:"",children:t("nav",{className:"-mb-px flex justify-between items-center",children:[e("div",{className:"flex space-x-8 overflow-x-auto",children:o.map(d=>t("button",{onClick:()=>i(d),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${n?.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))}),t(c,{children:[e(p,{children:t("div",{className:"inline-flex border border-primary rounded-xl items-center justify-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:["Actions ",e(j,{className:"h-4 w-4"})]})}),t(u,{children:[e(m,{onClick:()=>r(!0),children:"Add Knowledge"}),e(m,{onClick:()=>a(!0),children:"Manage Contexts"})]})]})]})}),n?.description&&e("div",{className:"mt-3 px-1",children:e("p",{className:"text-sm text-primary",children:n?.description})})]})]}),n?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(f,{documents:v,menuConfig:n?.menuConfig,onDocumentClick:C,onDocumentShare:D,selectedDocumentId:K,onDocumentUpdate:b})})}):t("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(g,{onClick:()=>a(!0),children:"Add Context"})})]}),t(B,{children:[e(x,{isOpen:A,onClose:()=>a(!1),knowledgeSources:o,onCreate:h,onUpdate:N,onDelete:y}),e(w,{isOpen:M,onClose:()=>r(!1),onAddKnowledge:T,knowledgeContexts:o})]})]})}export{U as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as T,b,c as w}from"./chunk-5Y6FKL5W.mjs";import{a as y}from"./chunk-EW6KWAHS.mjs";import{a as h,b as P,c as k,d as I,e as R}from"./chunk-7JDMW5R3.mjs";import{a as x}from"./chunk-YPZAYXNQ.mjs";import{a as C}from"./chunk-MTA6RFZ7.mjs";import{a as f}from"./chunk-SH5SK6V2.mjs";import{a as g}from"./chunk-RL6365DN.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{b as N}from"./chunk-CSBGSBEU.mjs";import{a as l,b as u,c,e as d}from"./chunk-YO3GQYRJ.mjs";import{FileText as A,Image as E,File as L,Download as S,ExternalLink as U}from"lucide-react";import{jsx as t,jsxs as r}from"react/jsx-runtime";var $=n=>n.startsWith("image/")?t(E,{className:"h-4 w-4"}):n.startsWith("text/")?t(A,{className:"h-4 w-4"}):t(L,{className:"h-4 w-4"}),Z=({message:n,addToolResult:p,status:B,messages:H})=>n.parts.map((a,s)=>{if(a.type==="text")return t(y,{children:a.text},`${s}`);if(a.type==="file"){let e=a;return t("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:r("div",{className:"flex items-center gap-2",children:[$(e.mediaType||"application/octet-stream"),t("div",{className:"flex-1 min-w-0",children:t("p",{className:"text-sm font-medium truncate",children:e.filename||e.url?.split("/").pop()||"File"})}),e.url&&t(m,{variant:"ghost",size:"sm",onClick:()=>window.open(e.url,"_blank"),className:"h-8 w-8 p-0",children:t(S,{className:"h-4 w-4"})})]})},s)}if(a.type.startsWith("tool-")){let e=a,i=a.type.replace("tool-","");if(i==="task")switch(e.state){case"input-available":return t("div",{className:"text-sm opacity-70",children:"Loading task..."},s);case"output-available":return t("div",{className:"mb-2",children:t(g,{data:{id:e.output?.id||e.input?.id,fetchLatest:!1,taskData:e.output||e.input}})},s);case"output-error":return r("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},s);default:return null}if(a.type==="tool-requestEndpointLogin")return t("div",{className:"mb-2",children:t(f,{toolPart:e,index:s,addToolResult:p??(()=>{})})},s);if(a.type==="tool-authenticate")return t("div",{className:"mb-2",children:t(f,{toolPart:e,index:s,addToolResult:p??(()=>{})})},s);if(a.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",e),t("div",{className:"mb-2",children:t(C,{toolPart:e,index:s,addToolResult:p??(()=>{})})},s);if(i==="artefact")switch(e.state){case"input-available":return t("div",{className:"text-sm opacity-70",children:"Loading artefact..."},s);case"output-available":return t("div",{className:"mb-2",children:t(x,{artefact:e.output?.description||"",taskId:e.output?.id||e.input?.id,taskData:e.output||e.input})},s);case"output-error":return r("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},s);default:return null}return t("div",{className:"mb-2",children:r(l,{className:"w-full max-w-md",children:[t(u,{children:t(c,{className:"text-lg",children:i})}),r(d,{children:[e.state==="input-available"&&r("p",{className:"text-sm",children:["Processing ",i,"..."]}),e.state==="output-available"&&t("pre",{className:"text-sm",children:JSON.stringify(e.output,null,2)}),e.state==="output-error"&&r("p",{className:"text-sm text-red-500",children:["Error: ",e.errorText]})]})]})},s)}if(a.type.startsWith("data-")){let e=a,i=a.type.replace("data-","");return i==="reference"?t("div",{className:"mb-2",children:t(l,{className:"w-full",children:t(d,{className:"p-4",children:t("div",{className:"space-y-2",children:e.data?.references?.map((o,v)=>r("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[t(N,{variant:"outline",children:o.type||"link"}),r("div",{className:"flex-1 min-w-0",children:[t("p",{className:"text-sm font-medium truncate",children:o.title}),o.description&&t("p",{className:"text-xs text-muted-foreground truncate",children:o.description})]}),o.url&&t(m,{variant:"ghost",size:"sm",onClick:()=>window.open(o.url,"_blank"),className:"h-8 w-8 p-0",children:t(U,{className:"h-4 w-4"})})]},v))})})})},s):i==="menu"?t("div",{className:"mb-2",children:r(l,{className:"w-full",children:[t(u,{children:t(c,{className:"text-lg",children:e.data?.title})}),t(d,{children:t("div",{className:"space-y-2",children:e.data?.items?.map((o,v)=>t(m,{variant:"outline",className:"w-full justify-start",onClick:o.action,children:r("div",{className:"text-left",children:[t("p",{className:"font-medium",children:o.label}),o.description&&t("p",{className:"text-xs text-muted-foreground",children:o.description})]})},v))})})]})},s):t("div",{className:"mb-2",children:r(l,{className:"w-full max-w-md",children:[t(u,{children:t(c,{className:"text-lg",children:i})}),t(d,{children:t("pre",{className:"text-sm",children:JSON.stringify(e.data,null,2)})})]})},s)}if(a.type==="reasoning")return r(T,{className:"w-full",isStreaming:B==="streaming"&&s===n.parts.length-1&&n.id===H.at(-1)?.id,children:[t(b,{}),t(w,{children:a.text})]},`${s}`);if(a.type==="dynamic-tool")return r(h,{defaultOpen:a.state!=="output-available",children:[t(P,{type:`tool-${a.toolName}`,state:a.state}),r(k,{children:[t(I,{input:a.input}),t(R,{output:a.output,errorText:a.errorText})]})]},`${n.id}-${s}`)});export{Z as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as B,c as L,d as K,g as A,i as d}from"./chunk-YFAZQYK4.mjs";import{a as q}from"./chunk-INCYANPB.mjs";import{a as G}from"./chunk-B4H6T2GP.mjs";import{a as l}from"./chunk-TVZOULLL.mjs";import{a as D}from"./chunk-FT3AE7L2.mjs";import{a as P,f as U,g as V,i as j}from"./chunk-3UMMMQEH.mjs";import{a as b}from"./chunk-L5JPAKPM.mjs";import{b as s}from"./chunk-ZUA4KNIR.mjs";import{a as E}from"./chunk-MDJREBVI.mjs";import{useState as o}from"react";import{X as te,Search as ae,FileText as oe,Trash2 as re}from"lucide-react";import{toast as i}from"sonner";import{Fragment as ne,jsx as t,jsxs as a}from"react/jsx-runtime";var xe=({isOpen:H,onClose:I,knowledgeSources:Q,onCreate:R,onUpdate:z,onDelete:X})=>{let[m,$]=o(""),[r,F]=o(null),[c,v]=o(""),[x,C]=o(""),[n,u]=o([]),[g,N]=o(""),[h,y]=o("name"),[w,S]=o("asc"),[k,T]=o(!0),M=Q.filter(e=>e.label.toLowerCase().includes(m.toLowerCase())||e.description?.toLowerCase().includes(m.toLowerCase())),J=e=>{F(e),v(e.label),C(e.description||""),u(e.menuConfig?.groupBy||[]),y(e.menuConfig?.sortBy||"name"),S(e.menuConfig?.sortOrder||"asc"),T(e.menuConfig?.showDocumentCount||!0)},O=()=>{g.trim()&&!n.includes(g.trim())&&(u([...n,g.trim()]),N(""))},W=e=>{u(n.filter(f=>f!==e))},Y=e=>{e.key==="Enter"&&(e.preventDefault(),O())},p=()=>{F(null),v(""),C(""),u([]),N(""),y("name"),S("asc"),T(!0)},Z=()=>{if(!c.trim()){i.error("Label is required");return}R?.({id:c.trim(),label:c.trim(),description:x.trim(),menuConfig:{groupBy:n,sortBy:h,sortOrder:w,showDocumentCount:k}}),i.success("Knowledge source created successfully"),p()},_=()=>{if(r){if(!c.trim()){i.error("Label is required");return}z?.({id:r.id,label:c.trim(),description:x.trim(),menuConfig:{groupBy:n,sortBy:h,sortOrder:w,showDocumentCount:k}}),i.success("Knowledge source updated successfully"),p()}},ee=()=>{r&&window.confirm(`Are you sure you want to delete "${r.label}"?`)&&(X?.(r.id),i.success("Knowledge source deleted successfully"),p())};return t(P,{open:H,onOpenChange:I,children:a(U,{className:"sm:max-w-[900px] max-h-[90vh] bg-card border-border p-0",children:[t(V,{className:"px-6 pt-6 pb-4 border-b border-border",children:t(j,{className:"text-foreground text-2xl",children:"Manage Knowledge Sources"})}),a("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 overflow-hidden",children:[a("div",{className:"flex flex-col gap-4",children:[a("div",{className:"relative",children:[t(ae,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t(b,{value:m,onChange:e=>$(e.target.value),placeholder:"Search contexts...",className:"pl-10 bg-background border-input"})]}),t(D,{className:"rounded-md border border-border bg-background flex-1",children:t("div",{className:"p-2 space-y-2",children:M.length===0?a("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t(oe,{className:"h-12 w-12 text-muted-foreground mb-2"}),t("p",{className:"text-sm text-muted-foreground",children:m?"No contexts found":"No contexts yet"})]}):M.map(e=>t("div",{onClick:()=>J(e),className:E("p-3 rounded-lg cursor-pointer transition-all hover:bg-accent/50",r?.id===e.id&&"bg-accent text-accent-foreground"),children:t("div",{className:"flex items-start justify-between gap-2",children:a("div",{className:"flex-1 min-w-0",children:[t("h4",{className:"font-medium truncate",children:e.label}),e.description&&t("p",{className:"text-sm opacity-80 truncate mt-1",children:e.description}),(e.menuConfig?.groupBy||[]).length>0&&a("div",{className:"flex flex-wrap gap-1 mt-2",children:[e.menuConfig?.groupBy?.slice(0,3).map(f=>t("span",{className:"text-xs px-2 py-0.5 rounded-full bg-secondary text-secondary-foreground",children:f},f)),(e.menuConfig?.groupBy||[]).length>3&&a("span",{className:"text-xs px-2 py-0.5",children:["+",(e.menuConfig?.groupBy||[]).length-3]})]})]})})},e.id))})}),t(s,{variant:"outline",onClick:p,className:"w-full",children:"Clear Selection / New Context"})]}),a("div",{className:"space-y-4",children:[t(D,{className:"h-[400px] pr-4",children:a("div",{className:"space-y-4",children:[a("div",{className:"space-y-2",children:[a(l,{htmlFor:"label",className:"text-foreground",children:["Label ",t("span",{className:"text-destructive",children:"*"})]}),t(b,{id:"label",value:c,onChange:e=>v(e.target.value),placeholder:"Enter label",className:"bg-background border-input"})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:"description",className:"text-foreground",children:"Description"}),t(G,{id:"description",value:x,onChange:e=>C(e.target.value),placeholder:"Enter description",className:"bg-background border-input resize-none",rows:3})]}),a("div",{className:"space-y-2",children:[t(l,{className:"text-foreground",children:"Group By"}),a("div",{className:"flex gap-2",children:[t(b,{value:g,onChange:e=>N(e.target.value),onKeyPress:Y,placeholder:"Type a tag and press Enter",className:"bg-background border-input flex-1"}),t(s,{onClick:O,className:"bg-accent hover:bg-accent/90",children:"Add"})]}),n.length>0&&t("div",{className:"flex flex-wrap gap-2 mt-2",children:n.map(e=>a("div",{className:"bg-secondary text-secondary-foreground px-3 py-1 rounded-md flex items-center gap-2 text-sm",children:[e,t(te,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>W(e)})]},e))})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:"sortBy",className:"text-foreground",children:"Sort By"}),a(B,{value:h,onValueChange:e=>y(e),children:[t(K,{className:"bg-background border-input",children:t(L,{})}),a(A,{className:"bg-popover border-border",children:[t(d,{value:"name",children:"Name"}),t(d,{value:"createdAt",children:"Created At"})]})]})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:"sortOrder",className:"text-foreground",children:"Sort Order"}),a(B,{value:w,onValueChange:e=>S(e),children:[t(K,{className:"bg-background border-input",children:t(L,{})}),a(A,{className:"bg-popover border-border",children:[t(d,{value:"asc",children:"Ascending"}),t(d,{value:"desc",children:"Descending"})]})]})]}),a("div",{className:"flex items-center space-x-2",children:[t(q,{id:"showDocumentCount",checked:k,onCheckedChange:e=>T(e)}),t(l,{htmlFor:"showDocumentCount",className:"text-sm font-normal cursor-pointer text-foreground",children:"Show Document Count"})]})]})}),t("div",{className:"flex gap-3 pt-4 border-t border-border",children:r?a(ne,{children:[a(s,{variant:"destructive",onClick:ee,className:"flex-1",children:[t(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),t(s,{onClick:_,className:"flex-1 bg-accent hover:bg-accent/90",children:"Update"})]}):t(s,{onClick:Z,className:"w-full bg-accent hover:bg-accent/90",children:"Create"})})]})]}),t("div",{className:"px-6 py-4 border-t border-border flex justify-end",children:t(s,{variant:"outline",onClick:I,children:"Close"})})]})})};export{xe as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
import{a as C}from"./chunk-JTMIQ7MK.mjs";import{a as D}from"./chunk-PZFYJ5FS.mjs";import{a as w,c as y,e as k}from"./chunk-3UMMMQEH.mjs";import{b as f}from"./chunk-ZUA4KNIR.mjs";import{a as N}from"./chunk-MDJREBVI.mjs";import{motion as R}from"motion/react";import{File as T,FileText as K,Edit3 as A,Type as G,ChevronDown as L,ChevronRight as Z,Info as P,Loader2 as H}from"lucide-react";import{startTransition as M,useEffect as Q,useMemo as V,useRef as W,useState as c}from"react";import*as E 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 S=s=>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:s}),O=s=>e("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:s}),ee=s=>e("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:s&&e(D,{value:JSON.stringify(s),editable:!1,name:"richTextContent"},JSON.stringify(s))}),te=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."]})}),S(s)]});function pe({document:s,onDocumentUpdate:t,editable:i=!0,mode:g="view",renderers:j,availableDocuments:I=[],knowledgeContexts:B=[]}){let[$,x]=c(!1),[d,q]=c(!1),[a,m]=c(s),[z,p]=c(!1),u=W(null),b=a.format==="richText"?a.richTextContent:a.content,F=V(()=>`${a.format}:${JSON.stringify(b)}`,[a.format,b]);Q(()=>{m(s)},[s]);let re=r=>{switch(r){case"markdown":case"mdx":return e(K,{className:"h-6 w-6 text-primary"});case"richText":return e(T,{className:"h-6 w-6 text-success"});case"text":return e(G,{className:"h-6 w-6 text-muted-foreground"});default:return e(T,{className:"h-6 w-6 text-muted-foreground"})}},J=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"}},X=(r,n)=>{let l={markdown:S,mdx:te,text:O},h=j?.[n]||l[n];if(n==="richText"&&typeof r=="object")return ee(r);if(h&&typeof r=="string")return h(r);if(typeof r=="string")return O(r)},U=async(r,n="save")=>{n==="save"&&p(!0),u.current=a,M(()=>{m({...r,richTextContent:r.richTextContent?structuredClone(r.richTextContent):void 0})});try{let l=await t?.(r);if(n==="save"&&p(!1),!l)throw new Error("save failed")}catch{u.current&&M(()=>m(u.current))}},v=()=>{x(!1)};return o(ae,{children:[e(w,{open:$||g==="create",onOpenChange:r=>!r&&v(),children:o(y,{children:[e(k,{}),o(E.Content,{className:N("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:[z&&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(C,{mode:g==="create"?"create":"edit",document:a,onSave:U,onCancel:v,availableDocuments:I,knowledgeContexts:B})]})]})}),o(R.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 ${J(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:()=>q(!d),className:"gap-2",children:[e(P,{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:()=>x(!0),className:"gap-2",children:[e(A,{className:"h-4 w-4"}),"Edit"]})]})]}),a.metadata&&Object.keys(a.metadata).length>0&&e(R.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(P,{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,n])=>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(n)})]},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:X(a.format==="richText"?a.richTextContent:a.content,a.format)})},F):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(K,{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};
|