cortex-react-components 2.19.5 → 2.20.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-7R47MHQE.mjs → chunk-33CHGT4N.mjs} +1 -1
- package/dist/{chunk-CXOVEABI.mjs → chunk-3EGSOIRH.mjs} +1 -1
- package/dist/{chunk-TJXOYVV5.mjs → chunk-4CHIFK3W.mjs} +1 -1
- package/dist/{chunk-LHO4WFYP.mjs → chunk-5FWH5YVM.mjs} +1 -1
- package/dist/{chunk-UECG3SCG.mjs → chunk-5PJLI46T.mjs} +1 -1
- package/dist/{chunk-NINFDOV5.mjs → chunk-6EKGV4I2.mjs} +1 -1
- package/dist/{chunk-6R6NYDWN.mjs → chunk-6FHRZHAJ.mjs} +1 -1
- package/dist/{chunk-WIRQ5IRT.mjs → chunk-ANCSWAD7.mjs} +1 -1
- package/dist/chunk-BZEGLKRZ.mjs +4 -0
- package/dist/{chunk-EM3T2XYC.mjs → chunk-CCJJAUGB.mjs} +1 -1
- package/dist/{chunk-V6GK2FJG.mjs → chunk-CQAMS7RZ.mjs} +1 -1
- package/dist/{chunk-75F3LJMX.mjs → chunk-CTC6WSB6.mjs} +1 -1
- package/dist/{chunk-2OCXL6FJ.mjs → chunk-D3YJZROI.mjs} +1 -1
- package/dist/{chunk-LJXTXROJ.mjs → chunk-DX3G3FKT.mjs} +1 -1
- package/dist/{chunk-XED4ZCVN.mjs → chunk-G27V7B6H.mjs} +1 -1
- package/dist/{chunk-3NRXQBBS.mjs → chunk-GO42W2BM.mjs} +1 -1
- package/dist/{chunk-RJGYVDOU.mjs → chunk-HLTP3ZQN.mjs} +1 -1
- package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
- package/dist/{chunk-FE7ZGUPU.mjs → chunk-JNJJAJPI.mjs} +1 -1
- package/dist/chunk-K7N3FRGH.mjs +4 -0
- package/dist/{chunk-AQQCH7Z2.mjs → chunk-KBEXWUKI.mjs} +1 -1
- package/dist/chunk-KKW3FINI.mjs +4 -0
- package/dist/{chunk-ITJH72Z2.mjs → chunk-LAQ3QAUW.mjs} +1 -1
- package/dist/{chunk-L5NPH5RX.mjs → chunk-LLP4EFT4.mjs} +1 -1
- package/dist/chunk-M456UF2N.mjs +1 -0
- package/dist/{chunk-5EQXJS23.mjs → chunk-MAZGVZJN.mjs} +1 -1
- package/dist/{chunk-3Y7QG6VP.mjs → chunk-MEVSHOG4.mjs} +1 -1
- package/dist/{chunk-2BRDNDUB.mjs → chunk-MFUZNS7C.mjs} +1 -1
- package/dist/{chunk-RGOKBIQ5.mjs → chunk-MGSTQLZC.mjs} +1 -1
- package/dist/{chunk-GNYXEKEA.mjs → chunk-MSFBSDB3.mjs} +1 -1
- package/dist/{chunk-P7S6XFU4.mjs → chunk-MX3JKY3V.mjs} +1 -1
- package/dist/chunk-N6CZEXLZ.mjs +4 -0
- package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
- package/dist/{chunk-TVTTUSWM.mjs → chunk-OXKN6X62.mjs} +1 -1
- package/dist/{chunk-PJOYZVEY.mjs → chunk-PE5L5LZL.mjs} +1 -1
- package/dist/{chunk-3HNU2NYP.mjs → chunk-QILFMWE5.mjs} +1 -1
- package/dist/{chunk-ZEALRBXW.mjs → chunk-QZIJTAPO.mjs} +1 -1
- package/dist/{chunk-GTZJWMZR.mjs → chunk-R33MOMFK.mjs} +1 -1
- package/dist/chunk-RKS7CWAP.mjs +1 -0
- package/dist/{chunk-AJQHGVZ5.mjs → chunk-RMZLEIRP.mjs} +1 -1
- package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
- package/dist/{chunk-NH32U7JS.mjs → chunk-TZCRIKIJ.mjs} +1 -1
- package/dist/{chunk-2UNIT7NC.mjs → chunk-UPRS7OYQ.mjs} +1 -1
- package/dist/{chunk-OTFFDAVV.mjs → chunk-V4W2JDQB.mjs} +1 -1
- package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
- package/dist/{chunk-C4RWEPVF.mjs → chunk-VQBOJHZF.mjs} +1 -1
- package/dist/{chunk-5NIEZE7A.mjs → chunk-XX4GSGRP.mjs} +1 -1
- package/dist/{chunk-TTWEHUP5.mjs → chunk-XYJ4S67W.mjs} +1 -1
- package/dist/{chunk-GHOL5L32.mjs → chunk-YPSUDHCJ.mjs} +1 -1
- package/dist/{chunk-5MWZTJYP.mjs → chunk-YWRU7OE3.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/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.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/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/components/RawUploadComponent/index.css +1 -0
- package/dist/components/Foundary/RichText/components/RawUploadComponent/index.d.ts +8 -0
- package/dist/components/Foundary/RichText/components/RawUploadComponent/index.js +4 -0
- package/dist/components/Foundary/RichText/components/RawUploadComponent/index.mjs +2 -0
- package/dist/components/Foundary/RichText/index.js +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/nodes/image-node.css +1 -0
- package/dist/components/Foundary/RichText/nodes/image-node.d.ts +16 -0
- package/dist/components/Foundary/RichText/nodes/image-node.js +4 -0
- package/dist/components/Foundary/RichText/nodes/image-node.mjs +2 -0
- package/dist/components/Foundary/RichText/plugins/image-plugin.css +1 -0
- package/dist/components/Foundary/RichText/plugins/image-plugin.d.ts +24 -0
- package/dist/components/Foundary/RichText/plugins/image-plugin.js +4 -0
- package/dist/components/Foundary/RichText/plugins/image-plugin.mjs +1 -0
- 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.js +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/TeamsIndexView.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/colleague-form.js +1 -1
- package/dist/components/Foundary/colleague-form.mjs +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 +5 -5
- 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/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/Projects/EpicsView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/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 +25 -25
- 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/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-H3RVI2OI.mjs +0 -4
- package/dist/chunk-PTJVI53B.mjs +0 -1
- package/dist/chunk-QAJBJFRP.mjs +0 -4
package/dist/chunk-H3RVI2OI.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import{a as k}from"./chunk-5HT2KC5I.mjs";import{a as u}from"./chunk-B4H6T2GP.mjs";import{a as g}from"./chunk-TVZOULLL.mjs";import{a as v}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{b as N}from"./chunk-CSBGSBEU.mjs";import{a as f,b as D,c as h,e as K}from"./chunk-YO3GQYRJ.mjs";import{useState as b,useEffect as M}from"react";import{Bot as J,Plus as U,X as W,Edit as X}from"lucide-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function le({colleague:c,onSave:A,onCancel:S,isLoading:i=!1,title:I,submitLabel:x,cancelLabel:F="Cancel",readOnly:B=!1,availableKnowledgeDocuments:E=[]}){let[t,n]=b({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...c}),[_,G]=b(""),[T,j]=b(""),[l,P]=b(!B);M(()=>{c&&n(c)},[c]);let O=e=>{e.preventDefault();let r={id:t.id||parseInt(Date.now().toString()),name:t.name,type:"digital",description:t.description,jobDescription:t.jobDescription||"",workInstructions:t.workInstructions||"",capabilities:t.capabilities||[],capabilityLevel:t.capabilityLevel||0,coreKnowledge:t.coreKnowledge||null};A(r)},C=(e,r,s)=>{if(!r.trim())return;let p=t[e]||[];n({...t,[e]:[...p,r.trim()]}),s("")},R=(e,r)=>{let s=t[e]||[];n({...t,[e]:s.filter((p,w)=>w!==r)})},$=e=>{e.preventDefault(),P(!l)},q=(e,r,s,p,w)=>{let L=t[e]||[];return o("div",{className:"space-y-2",children:[a(g,{children:r}),l&&o("div",{className:"flex gap-2",children:[a(v,{value:s,onChange:d=>p(d.target.value),placeholder:w,onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),C(e,s,p))},disabled:i}),a(m,{type:"button",variant:"outline",size:"icon",onClick:()=>C(e,s,p),disabled:i,children:a(U,{className:"h-4 w-4"})})]}),a("div",{className:"flex flex-wrap gap-2",children:L.map((d,y)=>o(N,{className:"gap-1",children:[d,l&&a(m,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>R(e,y),disabled:i,children:a(W,{className:"h-3 w-3"})})]},`${e}-${y}-${d}`))})]})},z=I||(l?c?"Edit Colleague":"Add New Colleague":"View Colleague"),H=x||(c?"Update Colleague":"Add Colleague");return o(f,{className:"m-8 w-full max-w-4xl mx-auto",children:[a(D,{children:o(h,{className:"flex items-center gap-2",children:[a(J,{className:"h-5 w-5"}),z]})}),a(K,{children:o("form",{onSubmit:O,className:"space-y-6",children:[o("div",{className:"space-y-4",children:[o("div",{className:"space-y-2",children:[a(g,{htmlFor:"name",children:"Name *"}),a(v,{id:"name",value:t.name||"",onChange:e=>n({...t,name:e.target.value}),required:!0,disabled:i||!l})]}),o("div",{className:"space-y-2",children:[a(g,{htmlFor:"description",children:"Description"}),a(u,{id:"description",value:t.description||"",onChange:e=>n({...t,description:e.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:i||!l})]})]}),o("div",{className:"space-y-4",children:[a("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),o("div",{className:"space-y-2",children:[a(g,{htmlFor:"jobDescription",children:"Job Description *"}),a(u,{id:"jobDescription",value:t.jobDescription||"",onChange:e=>n({...t,jobDescription:e.target.value}),rows:4,required:t.type==="digital",disabled:i||!l})]}),o("div",{className:"space-y-2",children:[a(g,{htmlFor:"workInstructions",children:"Work Instructions"}),a(u,{id:"workInstructions",value:t.workInstructions||"",onChange:e=>n({...t,workInstructions:e.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:i||!l})]}),q("capabilities","Capabilities",T,j,"Add capability"),a(k,{selectedDocuments:t.coreKnowledge?[{id:t.coreKnowledge?.id?.toString(),title:t.coreKnowledge?.name,format:"markdown",content:t.coreKnowledge?.content||"",createdAt:new Date(t.coreKnowledge?.createdAt),description:t.coreKnowledge?.description||"",metadata:t.coreKnowledge?.metadata||{},updatedAt:new Date(t.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:e=>{let r={createdAt:e[0]?.createdAt.toISOString(),id:parseInt(e[0]?.id),name:e[0]?.title,source:"payload",updatedAt:(e[0]?.updatedAt||new Date).toISOString()};console.log(e),n({...t,coreKnowledge:e&&e.length>0?r:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:i||!l,availableDocuments:E.map(e=>({id:e.id.toString(),title:e.name,name:e.name,format:"markdown",content:e.content||"",createdAt:new Date(e.createdAt),source:e.source,description:e.description||"",metadata:e.metadata||{},updatedAt:new Date(e.updatedAt)}))})]}),o("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[a(m,{type:"button",variant:"outline",onClick:S,disabled:i,children:l?F:"Close"}),l?a(m,{type:"submit",disabled:i,children:i?"Saving...":H}):o(m,{type:"button",onClick:$,disabled:i,className:"gap-2",children:[a(X,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}export{le as a};
|
package/dist/chunk-PTJVI53B.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I}from"./chunk-T3F3RQIC.mjs";import{a as O}from"./chunk-UP67R64J.mjs";import{a as S}from"./chunk-6QERRKM4.mjs";import{a as R}from"./chunk-VSU7LYXZ.mjs";import{a as y}from"./chunk-IPRG56MW.mjs";import{a as _,b as E,c as $,d as H,e as L}from"./chunk-HFEN3KJC.mjs";import{a as A}from"./chunk-L2UJOICL.mjs";import{a as m,b as h,i as b,j as C}from"./chunk-OCPX4QPC.mjs";import{a as D,b as M,c as w,d as x}from"./chunk-KY7WQYN4.mjs";import{a as N}from"./chunk-MDJREBVI.mjs";import{useLexicalComposerContext as de}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext";import{mergeRegister as pe}from"@payloadcms/richtext-lexical/lexical/utils";import{$createParagraphNode as ge,$getRoot as fe,$getSelection as F,$isParagraphNode as ue,$isRangeSelection as U,CAN_REDO_COMMAND as me,CAN_UNDO_COMMAND as he,FORMAT_ELEMENT_COMMAND as d,FORMAT_TEXT_COMMAND as s,SELECTION_CHANGE_COMMAND as be,UNDO_COMMAND as P}from"@payloadcms/richtext-lexical/lexical";import{$setBlocksType as B}from"@payloadcms/richtext-lexical/lexical/selection";import{INSERT_ORDERED_LIST_COMMAND as Ce,INSERT_UNORDERED_LIST_COMMAND as ke}from"@payloadcms/richtext-lexical/lexical/list";import{AlignCenter as ve,AlignJustify as Te,AlignLeft as Ne,AlignRight as De,ChevronDown as j,ImageUp as Me,List as we,ListOrdered as xe,RotateCcw as ye,RotateCw as Ae}from"lucide-react";import{Fragment as Re,useCallback as Ie,useEffect as Oe,useRef as Se,useState as a}from"react";import{$createHeadingNode as _e}from"@payloadcms/richtext-lexical/lexical/rich-text";import{jsx as o,jsxs as l}from"react/jsx-runtime";var k=1;function Ee(){return o("span",{className:"border border-[#222222]"})}function $e(){let[t]=de(),J=Se(null),[G,X]=a(!1),[Y,q]=a(!1),[z,K]=a(!1),[Q,V]=a(!1),[W,Z]=a(!1),[ee,oe]=a(!1),[te,ie]=a(!1),[ne,ae]=a(!1),[He,le]=a(!1),[v,se]=a("left"),[T,ce]=a("p"),c=e=>{t.update(()=>{let n=F();U(n)&&(e==="p"?B(n,()=>ge()):B(n,()=>_e(e)))})},p=Ie(()=>{let e=F();if(U(e)){K(e.hasFormat("bold")),V(e.hasFormat("italic")),Z(e.hasFormat("underline")),oe(e.hasFormat("strikethrough")),ie(e.hasFormat("subscript")),ae(e.hasFormat("superscript"));let n=e.anchor.getNode(),i=n;for(;i&&!ue(i)&&i!==fe();){let r=i.getParent();r&&(i=r)}if(i){let r=i.getFormatType();se(r||"left")}let u=n.getTopLevelElement()?.__tag;ce(u||"p")}},[]);Oe(()=>pe(t.registerUpdateListener(({editorState:e})=>{e.read(()=>{p()})}),t.registerCommand(be,(e,n)=>(p(),!1),k),t.registerCommand(he,e=>(X(e),!1),k),t.registerCommand(me,e=>(q(e),!1),k)),[t,p]);let re=[[{label:"Undo",icon:o(ye,{width:15,height:15}),onClick:()=>{t.dispatchCommand(P,void 0)},disabled:!G},{label:"Redo",icon:o(Ae,{width:15,height:15}),onClick:()=>{t.dispatchCommand(P,void 0)},disabled:!Y}],[{label:"Bold",icon:o(y,{}),onClick:()=>{t.dispatchCommand(s,"bold")},value:"bold",active:z},{label:"Italic",icon:o(A,{}),onClick:()=>{t.dispatchCommand(s,"italic")},value:"italic",active:Q},{label:"Underline",icon:o(R,{}),onClick:()=>{t.dispatchCommand(s,"underline")},value:"underline",active:W},{label:"Strikethrough",icon:o(I,{}),onClick:()=>{t.dispatchCommand(s,"strikethrough")},value:"strikethrough",active:ee},{label:"Subscript",icon:o(O,{}),onClick:()=>{t.dispatchCommand(s,"subscript")},value:"subscript",active:te},{label:"Superscript",icon:o(S,{}),onClick:()=>{t.dispatchCommand(s,"superscript")},value:"superscript",active:ne}]],g=[{label:"Left Align",direction:"left",icon:o(Ne,{width:15,height:15}),onClick:()=>{t.dispatchCommand(d,"left")}},{label:"Center Align",direction:"center",icon:o(ve,{width:15,height:15}),onClick:()=>{t.dispatchCommand(d,"center")}},{label:"Right Align",direction:"right",icon:o(De,{width:15,height:15}),onClick:()=>{t.dispatchCommand(d,"right")}},{label:"Justify Align",direction:"justify",icon:o(Te,{width:15,height:15}),onClick:()=>{t.dispatchCommand(d,"justify")}}],f=[{label:"Normal Text",value:"p",icon:o(_,{}),onClick:()=>c("p")},{label:"Heading 1",value:"h1",icon:o(E,{}),onClick:()=>c("h1")},{label:"Heading 2",value:"h2",icon:o($,{}),onClick:()=>c("h2")},{label:"Heading 3",value:"h3",icon:o(H,{}),onClick:()=>c("h3")},{label:"Heading 4",value:"h4",icon:o(L,{}),onClick:()=>c("h4")},...[{label:"Unordered List",value:"ul",icon:o(we,{width:15,height:15}),onClick:()=>{t.dispatchCommand(ke,void 0)}},{label:"Ordered List",value:"ol",icon:o(xe,{width:15,height:15}),onClick:()=>{t.dispatchCommand(Ce,void 0)}}]],Fe=[{label:"Insert Image",icon:o(Me,{width:15,height:15}),onClick:()=>{le(!0)},disabled:!1}];return o("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:l("div",{className:"flex gap-2 ",ref:J,children:[re.map((e,n)=>l(Re,{children:[o("div",{className:"flex items-center gap-2",children:e.map((i,u)=>o("div",{role:"button","aria-disabled":i.disabled||!1,onClick:i.onClick,className:N("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]",i.active&&"bg-[#3c3c3c]"),"aria-label":i.label,children:o(D,{children:l(M,{children:[o(w,{className:"text-[#b5b5b5]",children:i.icon}),o(x,{children:o("p",{children:i.label})})]})})},u))}),o(Ee,{})]},`toolbar-option-${e.length}-${n}`)),l(m,{children:[l(h,{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:[g.find(e=>e.direction===v)?.icon,g.find(e=>e.direction===v)?.label,o(j,{width:15,height:15})]}),o(b,{className:"bg-black hover:bg-black",children:g.map((e,n)=>l(C,{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}-${n}`))})]}),l(m,{children:[l(h,{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:[f.find(e=>e.value===T)?.icon,f.find(e=>e.value===T)?.label,o(j,{width:15,height:15})]}),o(b,{className:"bg-black hover:bg-black",children:f.map((e,n)=>l(C,{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}-${n}`))})]})]})})}export{$e as a};
|
package/dist/chunk-QAJBJFRP.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import{a as s}from"./chunk-PTJVI53B.mjs";import{AutoFocusPlugin as u}from"@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin";import{LexicalComposer as h}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposer";import{ContentEditable as p}from"@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as x}from"@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary";import{HistoryPlugin as g}from"@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin";import{RichTextPlugin as f}from"@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin";import{ListPlugin as C}from"@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin";import{ListItemNode as E,ListNode as b}from"@payloadcms/richtext-lexical/lexical/list";import{HeadingNode as v}from"@payloadcms/richtext-lexical/lexical/rich-text";import{OnChangePlugin as L}from"@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin";import{useEffect as c}from"react";import{useLexicalComposerContext as P}from"@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext";import{Fragment as y,jsx as t,jsxs as a}from"react/jsx-runtime";var R=({setValue:n,value:i,name:l,editable:e=!0})=>{let[o]=P(),r=d=>{d.read(()=>{let m=d.toJSON();n?.(()=>m)})};return c(()=>{o.setEditable(e)},[e]),c(()=>{i&&o.update(()=>{o.setEditorState(o.parseEditorState(i))})},[]),t("div",{className:"w-full",children:a("div",{className:" ",children:[e&&t(s,{}),a("div",{className:"px-4 my-4 border-l border-[#222222]",children:[t(f,{contentEditable:t(p,{name:l,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:x}),e&&a(y,{children:[t(g,{}),t(u,{}),t(C,{}),t(L,{onChange:r})]})]})]})})},N=({setValue:n,value:i,name:l,editable:e=!0})=>t(h,{initialConfig:{namespace:"Lexical editor",nodes:[b,E,v],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl",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(R,{value:i,setValue:n,name:l,editable:e})}),G=N;export{G as a};
|