@chaibuilder/sdk 4.0.0-beta.46 → 4.0.0-beta.48
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/{2SSKDMRQ-B6pWs8Zk.js → 2SSKDMRQ-CLLNh3td.js} +2 -2
- package/dist/{2SSKDMRQ-B7Va8HeK.cjs → 2SSKDMRQ-DqwAKdGS.cjs} +1 -1
- package/dist/{AP7HFJJL-Xv13XYXE.cjs → AP7HFJJL-BA2SSB20.cjs} +1 -1
- package/dist/{AP7HFJJL-CNIRZpP-.js → AP7HFJJL-wgsmCJDJ.js} +1 -1
- package/dist/{IconPicker-CeAu6O-X.cjs → IconPicker-BQy4V5jA.cjs} +1 -1
- package/dist/{IconPicker-CGtjTiWr.js → IconPicker-DsT0ONLh.js} +1 -1
- package/dist/{WDYDFRGG-zZ8jN8rF.cjs → WDYDFRGG-DyEYv-Y5.cjs} +1 -1
- package/dist/{WDYDFRGG-5Lwxhw_-.js → WDYDFRGG-EEb06kwn.js} +2 -2
- package/dist/{actions-registery-BQ31lpix.cjs → actions-registery-2natwC9b.cjs} +1 -1
- package/dist/{actions-registery-B1VeX52Y.js → actions-registery-wRY05tEE.js} +1 -1
- package/dist/actions.cjs +1 -1
- package/dist/actions.js +2 -2
- package/dist/{active-in-another-tab-HtM97aRN.js → active-in-another-tab-DE2fn30l.js} +2 -2
- package/dist/{active-in-another-tab-C8FXtXk5.cjs → active-in-another-tab-p0hkvIFc.cjs} +1 -1
- package/dist/{add-new-language-page-x88_n8EW.js → add-new-language-page-CH7GtcqC.js} +3 -3
- package/dist/{add-new-language-page-gbvPI58M.cjs → add-new-language-page-f2wam593.cjs} +1 -1
- package/dist/{add-new-page-BMSePgKl.js → add-new-page-8d0Nn-zI.js} +2 -2
- package/dist/{add-new-page-CPB4yhqv.cjs → add-new-page-CV7A1XJQ.cjs} +1 -1
- package/dist/ai-panel-default-lang-BJLeTdw3.cjs +3 -0
- package/dist/ai-panel-default-lang-Dcm4e1o8.js +332 -0
- package/dist/ai-panel-other-lang-B48Y5C8z.js +147 -0
- package/dist/ai-panel-other-lang-Ch0RHXqZ.cjs +1 -0
- package/dist/ai-prompt-input-C1yoNntS.cjs +1 -0
- package/dist/{ai-prompt-input-bleYNRnH.js → ai-prompt-input-DhVfzVhy.js} +253 -258
- package/dist/{ai-translation-prompt-DvHdOZ6t.js → ai-translation-prompt-CUYVv2jG.js} +1 -1
- package/dist/{ai-translation-prompt-DGrNA2Od.cjs → ai-translation-prompt-mj26BpgQ.cjs} +1 -1
- package/dist/{change-password-modal-bce5bF3K.cjs → change-password-modal-DFupkIGx.cjs} +1 -1
- package/dist/{change-password-modal-C9afEHLW.js → change-password-modal-DiEQWZez.js} +10 -10
- package/dist/{code-editor-BVmpIZOt.cjs → code-editor-BiLiryYr.cjs} +1 -1
- package/dist/{code-editor-BfGHceIq.js → code-editor-CazbxsDv.js} +1 -1
- package/dist/{continue-editing-in-this-client-4bvChAL-.cjs → continue-editing-in-this-client-C3NoncEN.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-BFptv8tA.js → continue-editing-in-this-client-CpKDDW6u.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-import-modal-CEQccCmc.js → css-import-modal-BOQr_e6S.js} +1 -1
- package/dist/{css-import-modal-C9G5pbFd.cjs → css-import-modal-DFdZ471B.cjs} +1 -1
- package/dist/{delete-page-BOxoMgyl.cjs → delete-page-D8Vr-1aC.cjs} +1 -1
- package/dist/{delete-page-8h4dNP7d.js → delete-page-DIZhbU2t.js} +15 -15
- package/dist/{design-token-usage-CVPBTF21.js → design-token-usage-Co5Lj1HN.js} +1 -1
- package/dist/{design-token-usage-C5WfKLj-.cjs → design-token-usage-N5DLBdWf.cjs} +1 -1
- package/dist/{digital-asset-manager-83B0Y6L-.js → digital-asset-manager-CObQa_0R.js} +3 -3
- package/dist/{digital-asset-manager-JtBK07Ob.cjs → digital-asset-manager-uXP27Dou.cjs} +1 -1
- package/dist/{duplicate-page-DVqC24Rd.cjs → duplicate-page-DomSAvnp.cjs} +1 -1
- package/dist/{duplicate-page-DIa59iDe.js → duplicate-page-xpV-pRVU.js} +12 -12
- package/dist/{dynamic-page-selector-C9vYslOg.js → dynamic-page-selector-Bl5kYPWG.js} +2 -2
- package/dist/{dynamic-page-selector-YRCRqWlz.cjs → dynamic-page-selector-CYZv-SlK.cjs} +1 -1
- package/dist/{image-editor-CzxSXo-u.js → image-editor-CDFnNWAz.js} +1 -1
- package/dist/{image-editor-DQ8mQonU.cjs → image-editor-pOsT95KQ.cjs} +1 -1
- package/dist/{index-RwAuF_BE.js → index-BbkBlCE2.js} +297 -297
- package/dist/{index-DlTEPwjW.js → index-Cyz_Iww4.js} +828 -805
- package/dist/{index-DrzR7vXl.cjs → index-DonDtb8f.cjs} +8 -8
- package/dist/index-j-XsKW-V.cjs +5 -0
- package/dist/{json-diff-viewer-Bpsk0toO.cjs → json-diff-viewer-CoEViavL.cjs} +1 -1
- package/dist/{json-diff-viewer-is2P3TOV.js → json-diff-viewer-amjoEZ5K.js} +6 -6
- package/dist/{lang-panel-BI5OFsBY.cjs → lang-panel-BzWstLZ-.cjs} +1 -1
- package/dist/{lang-panel-DwiCJRs9.js → lang-panel-DPpIXFl4.js} +9 -9
- package/dist/{manage-design-tokens-D2Oz-jVp.js → manage-design-tokens-BVfEFOrN.js} +2 -2
- package/dist/{manage-design-tokens-sDi2Pdec.cjs → manage-design-tokens-CIiwBv2v.cjs} +1 -1
- package/dist/{manage-design-tokens-modal-ZR8PuhWC.js → manage-design-tokens-modal-CBOw_Dg6.js} +2 -2
- package/dist/{manage-design-tokens-modal-Gufu9nHL.cjs → manage-design-tokens-modal-m3D2luIa.cjs} +1 -1
- package/dist/{mark-as-template-muKJE1gk.cjs → mark-as-template-C2-S_aA2.cjs} +1 -1
- package/dist/{mark-as-template-C0Z2P_UF.js → mark-as-template-CQjchLk7.js} +2 -2
- package/dist/{models-D0RH2u4C.cjs → models-CQaC3EBW.cjs} +1 -1
- package/dist/{models-BCu-p_QK.js → models-DZ9C6CvE.js} +4 -5
- package/dist/{nested-path-selector-content-Ct80kFX-.js → nested-path-selector-content-BtsI3H0i.js} +1 -1
- package/dist/{nested-path-selector-content-DhNCvKp3.cjs → nested-path-selector-content-Dd3NzUE0.cjs} +1 -1
- package/dist/{no-language-page-content-BekrmPc5.js → no-language-page-content-BrDAjkdi.js} +2 -2
- package/dist/{no-language-page-content-zn3891M8.cjs → no-language-page-content-CggJC14_.cjs} +1 -1
- package/dist/{no-language-page-dialog-dHlAqLlU.js → no-language-page-dialog-DSbcLM8f.js} +2 -2
- package/dist/{no-language-page-dialog-wEXIlBuQ.cjs → no-language-page-dialog-Dkxdu99i.cjs} +1 -1
- package/dist/{page-creator-6L7ehzhL.js → page-creator-CR-FbJ7C.js} +33 -33
- package/dist/{page-creator-CN2phGn5.cjs → page-creator-DqKFL1sB.cjs} +1 -1
- package/dist/{page-lock-C--D8qD7.js → page-lock-CwzMBdD-.js} +2 -2
- package/dist/{page-lock-DllloCJE.cjs → page-lock-D4Anxwpy.cjs} +1 -1
- package/dist/{page-locked-dialog-BD8LHbdC.js → page-locked-dialog-Dv_unUwx.js} +11 -11
- package/dist/{page-locked-dialog-DzB8p0wl.cjs → page-locked-dialog-UrTgnXd6.cjs} +1 -1
- package/dist/{page-manager-new-uFcGaZZY.js → page-manager-new-DpCTazS0.js} +42 -42
- package/dist/{page-manager-new-DyjhsvPx.cjs → page-manager-new-DuqhyqMY.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-DK883UmG.js → page-manager-search-and-filter-B6F-ZvdQ.js} +87 -80
- package/dist/page-manager-search-and-filter-Yt0pjK_r.cjs +1 -0
- package/dist/{page-revisions-content-Bi2ehMnj.cjs → page-revisions-content-C2VMkAt4.cjs} +1 -1
- package/dist/{page-revisions-content-D3rIJj9X.js → page-revisions-content-CUPsMEVU.js} +16 -16
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +60 -1
- package/dist/pages.js +19 -19
- package/dist/{publish-pages-content-BQUHNRCX.cjs → publish-pages-content-BrjDksNY.cjs} +1 -1
- package/dist/{publish-pages-content-ByPf4lvE.js → publish-pages-content-CK0ahL2t.js} +32 -32
- package/dist/{rte-widget-modal-Tj_pS3ql.js → rte-widget-modal-DgEF73WC.js} +1 -1
- package/dist/{rte-widget-modal-BwE5wIZa.cjs → rte-widget-modal-Dktetdg4.cjs} +1 -1
- package/dist/{save-to-lib-CcUqS0s1.js → save-to-lib-Bs6-wr2u.js} +50 -50
- package/dist/{save-to-lib-Cyeqcelv.cjs → save-to-lib-CuVYPtm-.cjs} +1 -1
- package/dist/{selected-block-display-Benbb_OW.cjs → selected-block-display-BCcwnFzJ.cjs} +1 -1
- package/dist/{selected-block-display-C6LxDm0H.js → selected-block-display-D-lzXUfE.js} +2 -2
- package/dist/{seo-panel-1U9Q0Ato.js → seo-panel-By-TlhHK.js} +25 -25
- package/dist/{seo-panel-CCuvQpwV.cjs → seo-panel-DTqsu3I0.cjs} +1 -1
- package/dist/{shared-json-ld-DbzUITto.js → shared-json-ld-CMCwFEI0.js} +26 -26
- package/dist/{shared-json-ld-bj77fq_b.cjs → shared-json-ld-C_vaAxgT.cjs} +1 -1
- package/dist/{slug-input-BvIplRdd.cjs → slug-input-DCmvuN69.cjs} +1 -1
- package/dist/{slug-input-P-CLfUrw.js → slug-input-bhZSv9VS.js} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.js +1 -1
- package/dist/{take-over-request-R3HRgShm.cjs → take-over-request-BGvKpN5m.cjs} +1 -1
- package/dist/{take-over-request-Bwj_2nPR.js → take-over-request-f0dbfkLe.js} +5 -5
- package/dist/{translation-warning-modal-BdkToZwn.js → translation-warning-modal-D0-WNJnG.js} +1 -1
- package/dist/{translation-warning-modal-Bc2i-0YG.cjs → translation-warning-modal-_0YmCcU8.cjs} +1 -1
- package/dist/{unmark-as-template-BG882c_S.cjs → unmark-as-template-BE1BO8Z0.cjs} +1 -1
- package/dist/{unmark-as-template-DHDMooLZ.js → unmark-as-template-WE3WJ-RJ.js} +2 -2
- package/dist/{unpublish-page-C4e_gIX8.js → unpublish-page-B4A-GQEz.js} +8 -8
- package/dist/{unpublish-page-DudJ1znF.cjs → unpublish-page-DrZnWLVM.cjs} +1 -1
- package/dist/{unpublished-partials-modal-p_0N6V23.js → unpublished-partials-modal-CGK-4WJ3.js} +1 -1
- package/dist/{unpublished-partials-modal-i1oOnrgA.cjs → unpublished-partials-modal-KFXm1fG4.cjs} +1 -1
- package/dist/{web-preview-BA08d7DN.js → web-preview-BSmef-RL.js} +1 -1
- package/dist/{web-preview-MG0HZxgA.cjs → web-preview-ClV1a6hl.cjs} +1 -1
- package/package.json +1 -1
- package/dist/ai-panel-default-lang-DKGh1pbz.cjs +0 -3
- package/dist/ai-panel-default-lang-Dav6FRUY.js +0 -317
- package/dist/ai-panel-other-lang-CdFx2x23.js +0 -132
- package/dist/ai-panel-other-lang-DdDn2I8h.cjs +0 -1
- package/dist/ai-prompt-input-B8SFfk6N.cjs +0 -1
- package/dist/index-DXBHjFwY.cjs +0 -5
- package/dist/page-manager-search-and-filter-zfR5i_GU.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./register-chai-top-bar-DyW9GPzV.cjs"),x=require("./index-DrzR7vXl.cjs"),b=require("./index-DXBHjFwY.cjs"),C=require("@tanstack/react-query"),X=require("jotai"),j=require("sonner"),E=require("lucide-react"),i=require("react"),J=require("./image-compression-UaU7Bwqe.cjs"),R=require("lodash-es"),Z=s=>{const r=b.useApiUrl(),l=b.useFetch();return C.useMutation({mutationFn:async t=>l(r,{action:b.ACTIONS.UPSERT_LIBRARY_ITEM,data:t}),onSuccess:t=>{s?s(t):j.toast.success("Block saved successfully")},onError:t=>{console.error("Error saving block:",t),j.toast.error("Failed to save block",{description:t instanceof Error?t.message:"Unknown error"})}})},ee=s=>{const r=b.useApiUrl(),l=b.useFetch();return C.useQuery({staleTime:"static",queryKey:[b.ACTIONS.GET_LIBRARY_ITEM,s],enabled:!!s,queryFn:async()=>{if(!s)return null;try{return await l(r,{action:b.ACTIONS.GET_LIBRARY_ITEM,data:{id:s}})}catch(t){throw console.error(t),new Error("The block could not be found on the server. It may have been deleted.")}},retry:!1})},te=s=>{const r=b.useApiUrl(),l=b.useFetch(),t=X.useSetAtom(x.libraryBlocksAtom);return C.useMutation({mutationFn:async c=>l(r,{action:b.ACTIONS.DELETE_LIBRARY_ITEM,data:{id:c}}),onSuccess:()=>{t(c=>{const m={...c};return Object.keys(m).forEach(u=>{m[u]={loading:"idle",blocks:[],error:!1}}),m}),s?s():j.toast.success("Block deleted successfully")},onError:c=>{console.error("Error deleting block:",c),j.toast.error("Failed to delete block",{description:c instanceof Error?c.message:"Unknown error"})}})},se=({blockId:s,libBlockId:r,isOpen:l,onClose:t,blockName:c,trigger:m})=>{const[u,o]=i.useState(!1),d=x.useUpdateBlocksPropsRealtime(),y=te(()=>{d([s],{_libBlockId:void 0}),j.toast.success("Block deleted successfully"),o(!1),t()}),h=()=>{o(!0),y.mutate(r)},g=e.jsxs(p.Button,{type:"button",variant:"destructive",size:"sm",onClick:f=>f.preventDefault(),disabled:u,children:[e.jsx(E.Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]});return e.jsxs(x.Popover,{open:l,onOpenChange:f=>!f&&t(),children:[e.jsx(x.PopoverTrigger,{asChild:!0,children:m||g}),e.jsx(x.PopoverContent,{className:"z-[9999] w-72 p-4",sideOffset:5,align:"center",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-medium",children:"Delete Block"}),e.jsxs("p",{className:"text-sm",children:["Are you sure you want to delete the block",e.jsxs("span",{className:"font-medium",children:[' "',c,'"']}),"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This block will be permanently removed from the library. This action cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p.Button,{type:"button",variant:"outline",size:"sm",onClick:t,disabled:u,children:"Cancel"}),e.jsx(p.Button,{type:"button",variant:"destructive",size:"sm",onClick:h,disabled:u,children:u?"Deleting...":"Delete"})]})]})})]})},re=({blockId:s,libBlockId:r,blockName:l,size:t="sm",className:c="",close:m})=>{const[u,o]=i.useState(!1);return e.jsx(se,{blockId:s,libBlockId:r,isOpen:u,onClose:()=>{o(!1),m()},blockName:l,trigger:e.jsxs(p.Button,{type:"button",variant:"destructive",size:t,className:c,onClick:()=>o(!0),children:[e.jsx(E.Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]})})},ne=()=>{const s=b.useApiUrl(),r=b.useFetch(),l=C.useQueryClient(),{data:t=[],isLoading:c,error:m}=C.useQuery({queryKey:["library-groups"],staleTime:"static",placeholderData:[],queryFn:async()=>{try{return await r(s,{action:"GET_LIBRARY_GROUPS"})||[]}catch(d){return console.error("Error fetching library groups:",d),[]}}}),{mutateAsync:u,isPending:o}=C.useMutation({mutationFn:async d=>{if(!d.trim())throw new Error("Group name is required");return r(s,{action:"CREATE_BLOCK_GROUP",data:{name:d}})},onSuccess:()=>{l.invalidateQueries({queryKey:["library-groups"]}),j.toast.success("Group created successfully")},onError:d=>{console.error("Error creating group:",d),j.toast.error("Failed to create group",{description:d instanceof Error?d.message:"Unknown error"})}});return{groups:t,isLoading:c,error:m,createGroup:u,isCreating:o}},ae=({value:s,onChange:r})=>{const[l,t]=i.useState(!1),[c,m]=i.useState(""),u=i.useRef(null),{groups:o}=ne(),[d,y]=i.useState([{id:"hero",name:"Hero"},{id:"feature",name:"Feature"},{id:"footer",name:"Footer"},{id:"content",name:"Content"},{id:"testimonial",name:"Testimonial"},{id:"pricing",name:"Pricing"},{id:"login",name:"Login"},{id:"logos",name:"Logos"},{id:"about",name:"About"},{id:"banner",name:"Banner"},{id:"blog",name:"Blog"},{id:"careers",name:"Careers"},{id:"casestudy",name:"Casestudy"},{id:"changelog",name:"Changelog"},{id:"compare",name:"Compare"},{id:"contact",name:"Contact"},{id:"cta",name:"Cta"},{id:"faq",name:"Faq"},{id:"gallery",name:"Gallery"},{id:"integration",name:"Integration"},{id:"list",name:"List"},{id:"navbar",name:"Navbar"},{id:"product",name:"Product"},{id:"signup",name:"Signup"},{id:"stats",name:"Stats"},{id:"team",name:"Team"},{id:"timeline",name:"Timeline"}]),h=i.useMemo(()=>[...o,...d.filter(n=>!o.some(B=>B.id===n.id))],[o,d]),g=()=>{const n=c.trim();if(!n)return;const B={id:n,name:n};y(w=>[...w,B]),r(B.id),m(""),t(!1)};i.useEffect(()=>{l&&u.current&&u.current.focus()},[l]);const f=n=>{n.key==="Enter"&&(n.preventDefault(),g())};return i.useEffect(()=>{s&&!h.some(n=>n.id===s)&&r("")},[s,h,r]),l?e.jsxs("div",{className:"space-y-2",children:[e.jsx(p.Input,{ref:u,placeholder:"Enter new group name",value:c,onChange:n=>m(n.target.value),onKeyDown:f}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p.Button,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Cancel"}),e.jsx(p.Button,{size:"sm",onClick:g,children:"Create"})]})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",value:s,onChange:n=>r(n.target.value),children:[e.jsx("option",{value:"",children:"Select a group"}),o.length>0&&e.jsx("optgroup",{label:"Library Groups",children:o.map(n=>e.jsx("option",{value:n.id,children:n.name},`lib-${n.id}`))}),d.length>0&&e.jsx("optgroup",{label:"Predefined Groups",children:d.filter(n=>!o.some(B=>B.id===n.id)).map(n=>e.jsx("option",{value:n.id,children:n.name},`local-${n.id}`))})]}),e.jsx(p.Button,{type:"button",size:"icon",variant:"outline",onClick:()=>t(!0),children:e.jsx(E.Plus,{className:"h-4 w-4"})})]})},oe=({value:s,onChange:r})=>{const[l,t]=i.useState(!1),c=i.useRef(null),m=i.useCallback(async d=>{var h;const y=(h=d.target.files)==null?void 0:h[0];if(y)try{t(!0);let g=y;y.type.startsWith("image/")&&(g=await J.compressImageIfNeeded(y));const f=new FileReader;f.onloadend=()=>{r(f.result),t(!1)},f.readAsDataURL(g)}catch(g){console.error("Error reading file:",g),t(!1),j.toast.error("Failed to process image",{description:g instanceof Error?g.message:"Unknown error"})}},[r]),u=()=>{r(""),c.current&&(c.current.value="")},o=()=>{var d;(d=c.current)==null||d.click()};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p.Input,{type:"file",ref:c,onChange:m,accept:"image/*",className:"hidden"}),e.jsx(p.Button,{type:"button",variant:"outline",onClick:o,disabled:l,className:"w-full",children:l?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Uploading..."]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(E.ImageIcon,{className:"h-4 w-4"}),"Select image"]})}),s&&e.jsx(p.Button,{type:"button",variant:"outline",size:"icon",onClick:u,children:e.jsx(E.X,{className:"h-4 w-4"})})]}),s&&e.jsx("div",{className:"aspect-video h-[200px] max-h-[200px] overflow-hidden rounded-md border",children:e.jsx("img",{src:s,alt:"Preview",className:"h-full w-full object-contain"})})]})},ie=s=>{const{blocks:r,close:l,blockId:t}=s,{getPartialBlocks:c}=x.usePartialBlocksStore(),m=r.find(a=>a._id===t),u=m==null?void 0:m._libBlockId,o=!!u,d=i.useMemo(()=>r.some(a=>a._type==="PartialBlock"||a._type==="GlobalBlock"),[r]),y=i.useMemo(()=>{let a=[];for(const k of r)if(k._type==="PartialBlock"||k._type==="GlobalBlock"){let v=c(k.partialBlockId);k._parent&&(v==null?void 0:v.length)>0&&(v=v.map(T=>(R.isEmpty(T._parent)&&R.set(T,"_parent",k._parent),T))),a=[...a,...v]}else a.push(k);return a},[r,c]),[h,g]=i.useState(""),[f,n]=i.useState(""),[B,w]=i.useState(""),[S,_]=i.useState(""),[N,U]=i.useState({}),[q,M]=i.useState(!1),[O,F]=i.useState(o),[z,K]=i.useState(!1),{hasPermission:Y}=x.usePermissions(),Q=Y(b.PAGES_PERMISSIONS.DELETE_LIBRARY_BLOCK),D=x.useUpdateBlocksPropsRealtime(),V=()=>{D([t],{_libBlockId:void 0}),j.toast.success("Block delinked from library"),l()},{data:I,isLoading:P,isError:G}=ee(u);i.useEffect(()=>{G&&o&&(K(!0),F(!1))},[G,o]),i.useEffect(()=>{I&&!P&&(g(I.name||""),n(I.group||""),w(I.description||""),_(I.preview||""),F(!1))},[I,P]),i.useEffect(()=>{const a=h.trim().length>=2,k=f.trim()!=="";M(a&&k)},[h,f]);const W=()=>{const a={};return h.trim()?h.length<2&&(a.name="Name must be at least 2 characters"):a.name="Name is required",f||(a.group="Group is required"),U(a),Object.keys(a).length===0},{resetLibrary:$}=x.useLibraryBlocks({id:""}),A=Z(a=>{o||D([t],{_libBlockId:a.id}),j.toast.success(`Block ${o?"updated":"saved"} successfully`),$(a.library),l()}),H=async a=>{if(a.preventDefault(),!W())return;const k=y.map(v=>(R.has(v,"_libBlockId")&&delete v._libBlockId,v));A.mutate({name:h.trim(),group:f,blocks:k,description:B.trim(),...S&&S.startsWith("data:")?{previewImage:S}:{},...o?{id:u}:{}})},L=A.isPending;return O||P?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):z?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"font-medium text-destructive",children:"Block Not Found"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This block could not be found on the server. It may have been deleted."}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(p.Button,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),e.jsx(p.Button,{onClick:V,variant:"destructive",children:"Delink Block"})]})]}):e.jsxs("div",{children:[d&&e.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-destructive",children:[e.jsx(E.AlertCircle,{className:"mt-0.5 h-5 w-5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Partial Blocks Detected"}),e.jsx("p",{className:"mt-1 text-xs",children:"This block contains one or more Partial Blocks. Partial blocks will be merged into the library block"})]})]}),e.jsxs("form",{onSubmit:H,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"name",className:N.name?"text-destructive":"",children:"Name"}),e.jsx(p.Input,{id:"name",placeholder:"Enter block name",value:h,onChange:a=>g(a.target.value),className:N.name?"border-destructive":""}),N.name&&e.jsx("p",{className:"text-xs text-destructive",children:N.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"group",className:N.group?"text-destructive":"",children:"Group"}),e.jsx(ae,{value:f,onChange:n}),N.group&&e.jsx("p",{className:"text-xs text-destructive",children:N.group})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"description",children:"Description (optional)"}),e.jsx(p.Input,{id:"description",placeholder:"Enter a brief description",className:"resize-none",value:B,onChange:a=>w(a.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"previewImage",children:"Preview Image (optional)"}),e.jsx(oe,{value:S,onChange:_})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[o&&Q&&e.jsx(re,{blockId:t,libBlockId:u,blockName:h,className:"mr-auto",close:l}),e.jsx(p.Button,{type:"button",variant:"outline",onClick:l,disabled:L,children:"Cancel"}),e.jsx(p.Button,{type:"submit",disabled:L||!q,children:L?"Saving...":o?"Update Block":"Save Block"})]})]})]})};exports.default=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./register-chai-top-bar-DyW9GPzV.cjs"),x=require("./index-DonDtb8f.cjs"),b=require("./index-j-XsKW-V.cjs"),C=require("@tanstack/react-query"),X=require("jotai"),j=require("sonner"),E=require("lucide-react"),i=require("react"),J=require("./image-compression-UaU7Bwqe.cjs"),R=require("lodash-es"),Z=s=>{const r=b.useApiUrl(),l=b.useFetch();return C.useMutation({mutationFn:async t=>l(r,{action:b.ACTIONS.UPSERT_LIBRARY_ITEM,data:t}),onSuccess:t=>{s?s(t):j.toast.success("Block saved successfully")},onError:t=>{console.error("Error saving block:",t),j.toast.error("Failed to save block",{description:t instanceof Error?t.message:"Unknown error"})}})},ee=s=>{const r=b.useApiUrl(),l=b.useFetch();return C.useQuery({staleTime:"static",queryKey:[b.ACTIONS.GET_LIBRARY_ITEM,s],enabled:!!s,queryFn:async()=>{if(!s)return null;try{return await l(r,{action:b.ACTIONS.GET_LIBRARY_ITEM,data:{id:s}})}catch(t){throw console.error(t),new Error("The block could not be found on the server. It may have been deleted.")}},retry:!1})},te=s=>{const r=b.useApiUrl(),l=b.useFetch(),t=X.useSetAtom(x.libraryBlocksAtom);return C.useMutation({mutationFn:async c=>l(r,{action:b.ACTIONS.DELETE_LIBRARY_ITEM,data:{id:c}}),onSuccess:()=>{t(c=>{const m={...c};return Object.keys(m).forEach(u=>{m[u]={loading:"idle",blocks:[],error:!1}}),m}),s?s():j.toast.success("Block deleted successfully")},onError:c=>{console.error("Error deleting block:",c),j.toast.error("Failed to delete block",{description:c instanceof Error?c.message:"Unknown error"})}})},se=({blockId:s,libBlockId:r,isOpen:l,onClose:t,blockName:c,trigger:m})=>{const[u,o]=i.useState(!1),d=x.useUpdateBlocksPropsRealtime(),y=te(()=>{d([s],{_libBlockId:void 0}),j.toast.success("Block deleted successfully"),o(!1),t()}),h=()=>{o(!0),y.mutate(r)},g=e.jsxs(p.Button,{type:"button",variant:"destructive",size:"sm",onClick:f=>f.preventDefault(),disabled:u,children:[e.jsx(E.Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]});return e.jsxs(x.Popover,{open:l,onOpenChange:f=>!f&&t(),children:[e.jsx(x.PopoverTrigger,{asChild:!0,children:m||g}),e.jsx(x.PopoverContent,{className:"z-[9999] w-72 p-4",sideOffset:5,align:"center",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-medium",children:"Delete Block"}),e.jsxs("p",{className:"text-sm",children:["Are you sure you want to delete the block",e.jsxs("span",{className:"font-medium",children:[' "',c,'"']}),"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This block will be permanently removed from the library. This action cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p.Button,{type:"button",variant:"outline",size:"sm",onClick:t,disabled:u,children:"Cancel"}),e.jsx(p.Button,{type:"button",variant:"destructive",size:"sm",onClick:h,disabled:u,children:u?"Deleting...":"Delete"})]})]})})]})},re=({blockId:s,libBlockId:r,blockName:l,size:t="sm",className:c="",close:m})=>{const[u,o]=i.useState(!1);return e.jsx(se,{blockId:s,libBlockId:r,isOpen:u,onClose:()=>{o(!1),m()},blockName:l,trigger:e.jsxs(p.Button,{type:"button",variant:"destructive",size:t,className:c,onClick:()=>o(!0),children:[e.jsx(E.Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]})})},ne=()=>{const s=b.useApiUrl(),r=b.useFetch(),l=C.useQueryClient(),{data:t=[],isLoading:c,error:m}=C.useQuery({queryKey:["library-groups"],staleTime:"static",placeholderData:[],queryFn:async()=>{try{return await r(s,{action:"GET_LIBRARY_GROUPS"})||[]}catch(d){return console.error("Error fetching library groups:",d),[]}}}),{mutateAsync:u,isPending:o}=C.useMutation({mutationFn:async d=>{if(!d.trim())throw new Error("Group name is required");return r(s,{action:"CREATE_BLOCK_GROUP",data:{name:d}})},onSuccess:()=>{l.invalidateQueries({queryKey:["library-groups"]}),j.toast.success("Group created successfully")},onError:d=>{console.error("Error creating group:",d),j.toast.error("Failed to create group",{description:d instanceof Error?d.message:"Unknown error"})}});return{groups:t,isLoading:c,error:m,createGroup:u,isCreating:o}},ae=({value:s,onChange:r})=>{const[l,t]=i.useState(!1),[c,m]=i.useState(""),u=i.useRef(null),{groups:o}=ne(),[d,y]=i.useState([{id:"hero",name:"Hero"},{id:"feature",name:"Feature"},{id:"footer",name:"Footer"},{id:"content",name:"Content"},{id:"testimonial",name:"Testimonial"},{id:"pricing",name:"Pricing"},{id:"login",name:"Login"},{id:"logos",name:"Logos"},{id:"about",name:"About"},{id:"banner",name:"Banner"},{id:"blog",name:"Blog"},{id:"careers",name:"Careers"},{id:"casestudy",name:"Casestudy"},{id:"changelog",name:"Changelog"},{id:"compare",name:"Compare"},{id:"contact",name:"Contact"},{id:"cta",name:"Cta"},{id:"faq",name:"Faq"},{id:"gallery",name:"Gallery"},{id:"integration",name:"Integration"},{id:"list",name:"List"},{id:"navbar",name:"Navbar"},{id:"product",name:"Product"},{id:"signup",name:"Signup"},{id:"stats",name:"Stats"},{id:"team",name:"Team"},{id:"timeline",name:"Timeline"}]),h=i.useMemo(()=>[...o,...d.filter(n=>!o.some(B=>B.id===n.id))],[o,d]),g=()=>{const n=c.trim();if(!n)return;const B={id:n,name:n};y(w=>[...w,B]),r(B.id),m(""),t(!1)};i.useEffect(()=>{l&&u.current&&u.current.focus()},[l]);const f=n=>{n.key==="Enter"&&(n.preventDefault(),g())};return i.useEffect(()=>{s&&!h.some(n=>n.id===s)&&r("")},[s,h,r]),l?e.jsxs("div",{className:"space-y-2",children:[e.jsx(p.Input,{ref:u,placeholder:"Enter new group name",value:c,onChange:n=>m(n.target.value),onKeyDown:f}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p.Button,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Cancel"}),e.jsx(p.Button,{size:"sm",onClick:g,children:"Create"})]})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",value:s,onChange:n=>r(n.target.value),children:[e.jsx("option",{value:"",children:"Select a group"}),o.length>0&&e.jsx("optgroup",{label:"Library Groups",children:o.map(n=>e.jsx("option",{value:n.id,children:n.name},`lib-${n.id}`))}),d.length>0&&e.jsx("optgroup",{label:"Predefined Groups",children:d.filter(n=>!o.some(B=>B.id===n.id)).map(n=>e.jsx("option",{value:n.id,children:n.name},`local-${n.id}`))})]}),e.jsx(p.Button,{type:"button",size:"icon",variant:"outline",onClick:()=>t(!0),children:e.jsx(E.Plus,{className:"h-4 w-4"})})]})},oe=({value:s,onChange:r})=>{const[l,t]=i.useState(!1),c=i.useRef(null),m=i.useCallback(async d=>{var h;const y=(h=d.target.files)==null?void 0:h[0];if(y)try{t(!0);let g=y;y.type.startsWith("image/")&&(g=await J.compressImageIfNeeded(y));const f=new FileReader;f.onloadend=()=>{r(f.result),t(!1)},f.readAsDataURL(g)}catch(g){console.error("Error reading file:",g),t(!1),j.toast.error("Failed to process image",{description:g instanceof Error?g.message:"Unknown error"})}},[r]),u=()=>{r(""),c.current&&(c.current.value="")},o=()=>{var d;(d=c.current)==null||d.click()};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p.Input,{type:"file",ref:c,onChange:m,accept:"image/*",className:"hidden"}),e.jsx(p.Button,{type:"button",variant:"outline",onClick:o,disabled:l,className:"w-full",children:l?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Uploading..."]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(E.ImageIcon,{className:"h-4 w-4"}),"Select image"]})}),s&&e.jsx(p.Button,{type:"button",variant:"outline",size:"icon",onClick:u,children:e.jsx(E.X,{className:"h-4 w-4"})})]}),s&&e.jsx("div",{className:"aspect-video h-[200px] max-h-[200px] overflow-hidden rounded-md border",children:e.jsx("img",{src:s,alt:"Preview",className:"h-full w-full object-contain"})})]})},ie=s=>{const{blocks:r,close:l,blockId:t}=s,{getPartialBlocks:c}=x.usePartialBlocksStore(),m=r.find(a=>a._id===t),u=m==null?void 0:m._libBlockId,o=!!u,d=i.useMemo(()=>r.some(a=>a._type==="PartialBlock"||a._type==="GlobalBlock"),[r]),y=i.useMemo(()=>{let a=[];for(const k of r)if(k._type==="PartialBlock"||k._type==="GlobalBlock"){let v=c(k.partialBlockId);k._parent&&(v==null?void 0:v.length)>0&&(v=v.map(T=>(R.isEmpty(T._parent)&&R.set(T,"_parent",k._parent),T))),a=[...a,...v]}else a.push(k);return a},[r,c]),[h,g]=i.useState(""),[f,n]=i.useState(""),[B,w]=i.useState(""),[S,_]=i.useState(""),[N,U]=i.useState({}),[q,M]=i.useState(!1),[O,F]=i.useState(o),[z,K]=i.useState(!1),{hasPermission:Y}=x.usePermissions(),Q=Y(b.PAGES_PERMISSIONS.DELETE_LIBRARY_BLOCK),D=x.useUpdateBlocksPropsRealtime(),V=()=>{D([t],{_libBlockId:void 0}),j.toast.success("Block delinked from library"),l()},{data:I,isLoading:P,isError:G}=ee(u);i.useEffect(()=>{G&&o&&(K(!0),F(!1))},[G,o]),i.useEffect(()=>{I&&!P&&(g(I.name||""),n(I.group||""),w(I.description||""),_(I.preview||""),F(!1))},[I,P]),i.useEffect(()=>{const a=h.trim().length>=2,k=f.trim()!=="";M(a&&k)},[h,f]);const W=()=>{const a={};return h.trim()?h.length<2&&(a.name="Name must be at least 2 characters"):a.name="Name is required",f||(a.group="Group is required"),U(a),Object.keys(a).length===0},{resetLibrary:$}=x.useLibraryBlocks({id:""}),A=Z(a=>{o||D([t],{_libBlockId:a.id}),j.toast.success(`Block ${o?"updated":"saved"} successfully`),$(a.library),l()}),H=async a=>{if(a.preventDefault(),!W())return;const k=y.map(v=>(R.has(v,"_libBlockId")&&delete v._libBlockId,v));A.mutate({name:h.trim(),group:f,blocks:k,description:B.trim(),...S&&S.startsWith("data:")?{previewImage:S}:{},...o?{id:u}:{}})},L=A.isPending;return O||P?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):z?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"font-medium text-destructive",children:"Block Not Found"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This block could not be found on the server. It may have been deleted."}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(p.Button,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),e.jsx(p.Button,{onClick:V,variant:"destructive",children:"Delink Block"})]})]}):e.jsxs("div",{children:[d&&e.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-destructive",children:[e.jsx(E.AlertCircle,{className:"mt-0.5 h-5 w-5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Partial Blocks Detected"}),e.jsx("p",{className:"mt-1 text-xs",children:"This block contains one or more Partial Blocks. Partial blocks will be merged into the library block"})]})]}),e.jsxs("form",{onSubmit:H,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"name",className:N.name?"text-destructive":"",children:"Name"}),e.jsx(p.Input,{id:"name",placeholder:"Enter block name",value:h,onChange:a=>g(a.target.value),className:N.name?"border-destructive":""}),N.name&&e.jsx("p",{className:"text-xs text-destructive",children:N.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"group",className:N.group?"text-destructive":"",children:"Group"}),e.jsx(ae,{value:f,onChange:n}),N.group&&e.jsx("p",{className:"text-xs text-destructive",children:N.group})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"description",children:"Description (optional)"}),e.jsx(p.Input,{id:"description",placeholder:"Enter a brief description",className:"resize-none",value:B,onChange:a=>w(a.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x.Label,{htmlFor:"previewImage",children:"Preview Image (optional)"}),e.jsx(oe,{value:S,onChange:_})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[o&&Q&&e.jsx(re,{blockId:t,libBlockId:u,blockName:h,className:"mr-auto",close:l}),e.jsx(p.Button,{type:"button",variant:"outline",onClick:l,disabled:L,children:"Cancel"}),e.jsx(p.Button,{type:"submit",disabled:L||!q,children:L?"Saving...":o?"Update Block":"Save Block"})]})]})]})};exports.default=ie;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),r=require("./register-chai-top-bar-DyW9GPzV.cjs"),m=require("lucide-react"),i=require("react"),p=require("use-stick-to-bottom"),T=require("streamdown");require("@radix-ui/react-slot");const P=require("class-variance-authority"),_=require("./index-
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),r=require("./register-chai-top-bar-DyW9GPzV.cjs"),m=require("lucide-react"),i=require("react"),p=require("use-stick-to-bottom"),T=require("streamdown");require("@radix-ui/react-slot");const P=require("class-variance-authority"),_=require("./index-DonDtb8f.cjs");require("clsx");require("tailwind-merge");const z=require("@radix-ui/react-tooltip"),j=require("@radix-ui/react-use-controllable-state"),B=require("@radix-ui/react-collapsible"),D=require("framer-motion"),f=require("./index-j-XsKW-V.cjs"),I=require("react-i18next");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const L=h(i),S=h(z),b=h(B),G=({className:e,...t})=>o.jsx(p.StickToBottom,{className:r.cn("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),$=({className:e,...t})=>o.jsx(p.StickToBottom.Content,{className:r.cn("flex flex-col gap-8 p-4",e),...t}),F=({className:e,title:t="No messages yet",description:s="Start a conversation to see messages here",icon:n,children:a,...l})=>o.jsx("div",{className:r.cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...l,children:a??o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{className:"text-muted-foreground",children:n}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h3",{className:"text-sm font-medium",children:t}),s&&o.jsx("p",{className:"text-sm text-muted-foreground",children:s})]})]})}),Q=({className:e,...t})=>{const{isAtBottom:s,scrollToBottom:n}=p.useStickToBottomContext(),a=i.useCallback(()=>{n()},[n]);return!s&&o.jsx(r.Button,{className:r.cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:a,size:"icon",type:"button",variant:"outline",...t,children:o.jsx(m.ArrowDownIcon,{className:"size-4"})})};P.cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});const V=L.forwardRef(({className:e,sideOffset:t=4,...s},n)=>o.jsx(S.Content,{ref:n,sideOffset:t,className:r.cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...s}));V.displayName=S.Content.displayName;const K=({className:e,from:t,...s})=>o.jsx("div",{className:r.cn("group flex w-full max-w-[80%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...s}),Y=({children:e,className:t,...s})=>o.jsx("div",{className:r.cn("is-user:dark flex w-fit flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...s,children:e});i.createContext(null);const w=i.memo(({className:e,...t})=>o.jsx(T.Streamdown,{className:r.cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);w.displayName="MessageResponse";const J=b.Root,X=b.CollapsibleTrigger,H=b.CollapsibleContent,W=({children:e,as:t="p",className:s,duration:n=2,spread:a=2})=>{const l=D.motion.create(t),g=i.useMemo(()=>((e==null?void 0:e.length)??0)*a,[e,a]);return o.jsx(l,{animate:{backgroundPosition:"0% center"},className:r.cn("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",s),initial:{backgroundPosition:"100% center"},style:{"--spread":`${g}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{repeat:Number.POSITIVE_INFINITY,duration:n,ease:"linear"},children:e})},E=i.memo(W),R=i.createContext(null),Z=()=>{const e=i.useContext(R);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},ee=1e3,te=1e3,y=i.memo(({className:e,isStreaming:t=!1,open:s,defaultOpen:n=!0,onOpenChange:a,duration:l,children:g,...U})=>{const[c,d]=j.useControllableState({prop:s,defaultProp:n,onChange:a}),[M,v]=j.useControllableState({prop:l,defaultProp:void 0}),[N,q]=i.useState(!1),[u,C]=i.useState(null);i.useEffect(()=>{t?u===null&&C(Date.now()):u!==null&&(v(Math.ceil((Date.now()-u)/te)),C(null))},[t,u,v]),i.useEffect(()=>{if(n&&!t&&c&&!N){const x=setTimeout(()=>{d(!1),q(!0)},ee);return()=>clearTimeout(x)}},[t,c,n,d,N]);const O=x=>{d(x)};return o.jsx(R.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:d,duration:M},children:o.jsx(J,{className:r.cn("not-prose mb-4",e),onOpenChange:O,open:c,...U,children:g})})}),oe=(e,t)=>e||t===0?o.jsx(E,{duration:1,children:"Thinking..."}):t===void 0?o.jsx("p",{children:"Thought for a few seconds"}):o.jsxs("p",{children:["Thought for ",t," seconds"]}),A=i.memo(({className:e,children:t,...s})=>{const{isStreaming:n,isOpen:a,duration:l}=Z();return o.jsx(X,{className:r.cn("flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",e),...s,children:t??o.jsxs(o.Fragment,{children:[o.jsx(m.BrainIcon,{className:"size-4"}),oe(n,l),o.jsx(m.ChevronDownIcon,{className:r.cn("size-4 transition-transform",a?"rotate-180":"rotate-0")})]})})}),k=i.memo(({className:e,children:t,...s})=>o.jsx(H,{className:r.cn("mt-4 text-sm","text-muted-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2",e),...s,children:o.jsx(T.Streamdown,{...s,children:t})}));y.displayName="Reasoning";A.displayName="ReasoningTrigger";k.displayName="ReasoningContent";const se=({className:e,content:t,isLoading:s=!1,...n})=>o.jsx("div",{className:r.cn("is-assistant flex w-full max-w-[80%] flex-col gap-2",e),...n,children:o.jsx("div",{className:"flex w-fit flex-col gap-2 overflow-hidden text-sm",children:o.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-muted-foreground/20 bg-muted/50 p-3",children:o.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[s&&o.jsx(E,{duration:1.5,children:t}),!s&&o.jsx("div",{className:"text-xs text-muted-foreground",children:t})]})})})});function ne({userInput:e,language:t="en",currentHtml:s}){const n=f.LANGUAGES[t]||"English";return s&&s.trim().length>0?`
|
|
2
2
|
MODE: EDIT
|
|
3
3
|
CURRENT HTML:
|
|
4
4
|
${s}
|
|
@@ -7,14 +7,14 @@ import { StickToBottom as R, useStickToBottomContext as Q } from "use-stick-to-b
|
|
|
7
7
|
import { Streamdown as y } from "streamdown";
|
|
8
8
|
import "@radix-ui/react-slot";
|
|
9
9
|
import { cva as F } from "class-variance-authority";
|
|
10
|
-
import { r as K } from "./index-
|
|
10
|
+
import { r as K } from "./index-BbkBlCE2.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
13
13
|
import * as A from "@radix-ui/react-tooltip";
|
|
14
14
|
import { useControllableState as w } from "@radix-ui/react-use-controllable-state";
|
|
15
15
|
import * as x from "@radix-ui/react-collapsible";
|
|
16
16
|
import { motion as V } from "framer-motion";
|
|
17
|
-
import { L as h } from "./index-
|
|
17
|
+
import { L as h } from "./index-Cyz_Iww4.js";
|
|
18
18
|
import { useTranslation as Y } from "react-i18next";
|
|
19
19
|
const Te = ({ className: e, ...t }) => /* @__PURE__ */ o(
|
|
20
20
|
R,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { j as ve,
|
|
3
|
-
import { d as z, D as ke, e as Te, f as Ce, g as Fe, o as
|
|
4
|
-
import { find as
|
|
5
|
-
import { useMemo as _e, useRef as ae, useState as
|
|
6
|
-
import { B as R, D as Ve, F as Ge, z as
|
|
2
|
+
import { j as ve, ar as xe, aq as Ne, A as we, L as ee, av as Se, aL as De, aM as Oe, g as be, ax as je, aN as Le, aO as Ie, aP as T, aQ as Ee, aF as te } from "./index-Cyz_Iww4.js";
|
|
3
|
+
import { d as z, D as ke, e as Te, f as Ce, g as Fe, o as Ae, n as Je, ax as Pe, ay as Re, az as qe, aA as $, p as S, T as se } from "./index-BbkBlCE2.js";
|
|
4
|
+
import { find as Be, get as g, isEqual as ne, isEmpty as Ue } from "lodash-es";
|
|
5
|
+
import { useMemo as _e, useRef as ae, useState as A, useEffect as oe } from "react";
|
|
6
|
+
import { B as R, D as Ve, F as Ge, z as J } from "./register-chai-top-bar-D6GjnauV.js";
|
|
7
7
|
import { useTranslation as Me } from "react-i18next";
|
|
8
8
|
import { toast as b } from "sonner";
|
|
9
9
|
import { useMutation as He } from "@tanstack/react-query";
|
|
@@ -11,7 +11,7 @@ import { Loader as $e, Wand2Icon as We } from "lucide-react";
|
|
|
11
11
|
import { g as W } from "./get-seo-defaults-9zHebckY.js";
|
|
12
12
|
const ze = () => {
|
|
13
13
|
const { selectedLang: e } = z(), { data: l, isFetching: r } = ve();
|
|
14
|
-
return { data: _e(() =>
|
|
14
|
+
return { data: _e(() => Be(l, { lang: e || "" }) || {}, [l, e]), isFetching: r };
|
|
15
15
|
}, Ke = () => {
|
|
16
16
|
var y;
|
|
17
17
|
const l = (y = document.getElementById("canvas-iframe").contentDocument) == null ? void 0 : y.body.innerHTML;
|
|
@@ -193,7 +193,7 @@ const Qe = ({
|
|
|
193
193
|
return /* @__PURE__ */ t(ke, { open: e, onOpenChange: l, children: /* @__PURE__ */ o(Te, { className: "sm:max-w-[425px]", children: [
|
|
194
194
|
/* @__PURE__ */ o(Ce, { children: [
|
|
195
195
|
/* @__PURE__ */ t(Fe, { children: "Unsaved SEO Changes" }),
|
|
196
|
-
/* @__PURE__ */ o(
|
|
196
|
+
/* @__PURE__ */ o(Ae, { children: [
|
|
197
197
|
'You have unsaved changes in the SEO for "',
|
|
198
198
|
m,
|
|
199
199
|
'" version. Do you want to save these changes before switching to "',
|
|
@@ -221,7 +221,7 @@ const Qe = ({
|
|
|
221
221
|
newCursorPos: j
|
|
222
222
|
};
|
|
223
223
|
}, Ze = () => {
|
|
224
|
-
const { t: e } = Me(), [, l] =
|
|
224
|
+
const { t: e } = Me(), [, l] = Je(), { data: r } = Se(), { data: a } = De(), { data: n, isFetching: c } = ze(), y = n == null ? void 0 : n.seo, m = ae(null), [p, j] = A("seo"), q = r == null ? void 0 : r.id, le = r == null ? void 0 : r.pageType, I = Oe(le), { selectedLang: K, fallbackLang: re } = z(), f = K || re, [Q, U] = A(!1), [ce, Y] = A(!1), [ie, _] = A(!1), [D, V] = A(null), [i, O] = A({
|
|
225
225
|
keyword: "",
|
|
226
226
|
title: "",
|
|
227
227
|
description: "",
|
|
@@ -239,7 +239,7 @@ const Qe = ({
|
|
|
239
239
|
...y
|
|
240
240
|
}), C = ae({}), { mutate: de, isPending: G } = be(), x = G || Q || ce, { hasPermission: ue } = Pe(), d = ue(je.EDIT_SEO), [he] = Le(), me = g(he, "flags.resetSeoToDefault", !1), X = !K || i.jsonLD !== "{}";
|
|
241
241
|
oe(() => {
|
|
242
|
-
if (!c && y &&
|
|
242
|
+
if (!c && y && q) {
|
|
243
243
|
const s = {
|
|
244
244
|
keyword: "",
|
|
245
245
|
title: "",
|
|
@@ -259,15 +259,15 @@ const Qe = ({
|
|
|
259
259
|
};
|
|
260
260
|
O(s), C.current[f] = s;
|
|
261
261
|
}
|
|
262
|
-
}, [c, y, f,
|
|
262
|
+
}, [c, y, f, q]), oe(() => {
|
|
263
263
|
const s = (u) => {
|
|
264
|
-
const { fromLang: v, toLang:
|
|
265
|
-
(M ? !ne(M, i) : !1) ? (V({ fromLang: v, toLang:
|
|
264
|
+
const { fromLang: v, toLang: B, switchHandler: w } = u.detail, M = C.current[f];
|
|
265
|
+
(M ? !ne(M, i) : !1) ? (V({ fromLang: v, toLang: B, switchHandler: w }), _(!0)) : w();
|
|
266
266
|
};
|
|
267
267
|
return window.addEventListener("seo-language-switch-check", s), () => {
|
|
268
268
|
window.removeEventListener("seo-language-switch-check", s);
|
|
269
269
|
};
|
|
270
|
-
}, [
|
|
270
|
+
}, [q, i, f]);
|
|
271
271
|
const pe = async () => {
|
|
272
272
|
if (!(!I || !f))
|
|
273
273
|
try {
|
|
@@ -324,7 +324,7 @@ const Qe = ({
|
|
|
324
324
|
}
|
|
325
325
|
}, Z = async () => {
|
|
326
326
|
de(
|
|
327
|
-
{ id: n == null ? void 0 : n.id, seo: i, primaryPage:
|
|
327
|
+
{ id: n == null ? void 0 : n.id, seo: i, primaryPage: q },
|
|
328
328
|
{
|
|
329
329
|
onSuccess: () => {
|
|
330
330
|
console.log("SEO & JSON-LD updated successfully", i), C.current[f] = i, b.success("SEO & JSON-LD updated successfully");
|
|
@@ -334,13 +334,13 @@ const Qe = ({
|
|
|
334
334
|
}, L = (s, u) => {
|
|
335
335
|
const v = document.getElementById(u);
|
|
336
336
|
if (v) {
|
|
337
|
-
const { value:
|
|
337
|
+
const { value: B, newCursorPos: w } = Xe(v, s);
|
|
338
338
|
m.current = {
|
|
339
339
|
id: u,
|
|
340
340
|
position: w
|
|
341
|
-
}, v.tagName.toLowerCase() === "input" ? (v.value =
|
|
341
|
+
}, v.tagName.toLowerCase() === "input" ? (v.value = B, O((k) => ({
|
|
342
342
|
...k,
|
|
343
|
-
[v.name]:
|
|
343
|
+
[v.name]: B
|
|
344
344
|
})), v.focus(), v.setSelectionRange(w, w), [0, 10, 50, 100, 200].forEach((k) => {
|
|
345
345
|
setTimeout(() => {
|
|
346
346
|
const H = document.getElementById(u);
|
|
@@ -348,7 +348,7 @@ const Qe = ({
|
|
|
348
348
|
}, k);
|
|
349
349
|
})) : (O((E) => ({
|
|
350
350
|
...E,
|
|
351
|
-
[v.name]:
|
|
351
|
+
[v.name]: B
|
|
352
352
|
})), requestAnimationFrame(() => {
|
|
353
353
|
const E = document.getElementById(u);
|
|
354
354
|
E && (E.focus(), E.setSelectionRange(w, w), setTimeout(() => {
|
|
@@ -406,7 +406,7 @@ const Qe = ({
|
|
|
406
406
|
/* @__PURE__ */ t(Ie, { showAdd: !1 })
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ t("form", { className: "space-y-8", children: /* @__PURE__ */ o(Re, { value: p, onValueChange: j, className: "w-full", children: [
|
|
409
|
-
/* @__PURE__ */ o(
|
|
409
|
+
/* @__PURE__ */ o(qe, { className: "mb-4 grid w-full grid-cols-3", children: [
|
|
410
410
|
/* @__PURE__ */ t($, { value: "seo", children: e("SEO") }),
|
|
411
411
|
/* @__PURE__ */ t($, { value: "opengraph", children: e("Meta Tags") }),
|
|
412
412
|
/* @__PURE__ */ t($, { value: "jsonld", children: e("JSON-LD") })
|
|
@@ -425,7 +425,7 @@ const Qe = ({
|
|
|
425
425
|
)
|
|
426
426
|
] }),
|
|
427
427
|
/* @__PURE__ */ t(
|
|
428
|
-
|
|
428
|
+
J,
|
|
429
429
|
{
|
|
430
430
|
type: "text",
|
|
431
431
|
id: "keyword",
|
|
@@ -454,7 +454,7 @@ const Qe = ({
|
|
|
454
454
|
] })
|
|
455
455
|
] }),
|
|
456
456
|
/* @__PURE__ */ t(
|
|
457
|
-
|
|
457
|
+
J,
|
|
458
458
|
{
|
|
459
459
|
type: "text",
|
|
460
460
|
id: "title",
|
|
@@ -515,7 +515,7 @@ const Qe = ({
|
|
|
515
515
|
)
|
|
516
516
|
] }),
|
|
517
517
|
/* @__PURE__ */ t(
|
|
518
|
-
|
|
518
|
+
J,
|
|
519
519
|
{
|
|
520
520
|
type: "text",
|
|
521
521
|
id: "canonicalUrl",
|
|
@@ -531,7 +531,7 @@ const Qe = ({
|
|
|
531
531
|
/* @__PURE__ */ o("div", { className: "", children: [
|
|
532
532
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-x-2", children: [
|
|
533
533
|
/* @__PURE__ */ t(
|
|
534
|
-
|
|
534
|
+
J,
|
|
535
535
|
{
|
|
536
536
|
type: "checkbox",
|
|
537
537
|
id: "noIndex",
|
|
@@ -549,7 +549,7 @@ const Qe = ({
|
|
|
549
549
|
/* @__PURE__ */ o("div", { className: "", children: [
|
|
550
550
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-x-2", children: [
|
|
551
551
|
/* @__PURE__ */ t(
|
|
552
|
-
|
|
552
|
+
J,
|
|
553
553
|
{
|
|
554
554
|
type: "checkbox",
|
|
555
555
|
id: "noFollow",
|
|
@@ -591,7 +591,7 @@ const Qe = ({
|
|
|
591
591
|
] })
|
|
592
592
|
] }),
|
|
593
593
|
/* @__PURE__ */ t(
|
|
594
|
-
|
|
594
|
+
J,
|
|
595
595
|
{
|
|
596
596
|
type: "text",
|
|
597
597
|
id: "ogTitle",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./index-j-XsKW-V.cjs"),r=require("./index-DonDtb8f.cjs"),u=require("lodash-es"),w=require("react"),f=require("./register-chai-top-bar-DyW9GPzV.cjs"),ie=require("react-i18next"),O=require("sonner"),de=require("@tanstack/react-query"),K=require("lucide-react"),G=require("./get-seo-defaults-Cw7vFt-B.cjs"),ue=()=>{const{selectedLang:t}=r.useLanguages(),{data:p,isFetching:n}=i.useLanguagePages();return{data:w.useMemo(()=>u.find(p,{lang:t||""})||{},[p,t]),isFetching:n}},pe=()=>{var x;const p=(x=document.getElementById("canvas-iframe").contentDocument)==null?void 0:x.body.innerHTML;if(!p)return null;const d=new DOMParser().parseFromString(p,"text/html");d.querySelectorAll("style, script, link, svg, [data-block-type='PartialBlock']").forEach(h=>h.remove()),d.querySelectorAll("*").forEach(h=>{Array.from(h.attributes).forEach(g=>h.removeAttribute(g.name))});const l=d.querySelectorAll("h1, h2, h3, h4, h5, h6, p");return Array.from(l).map(h=>`<${h.tagName.toLowerCase()}>${h.innerHTML}</${h.tagName.toLowerCase()}>`).join(" ").replace(/<p>Partial block. Double click to edit.<\/p>/,"")},R=({keyword:t,onComplete:p,field:n})=>{const d=i.useFetch(),l=i.useApiUrl(),{selectedLang:N,fallbackLang:x}=r.useLanguages(),{mutate:h,isPending:g}=de.useMutation({mutationFn:async()=>{const I=pe();return await d(l,{action:i.ACTIONS.GENERATE_SEO_FIELD,data:{pageContext:"",dynamic:!1,field:n,lang:N||x,pageContent:I,keyword:t}})},onSuccess:I=>{p({fieldValue:I.field})},onError:I=>{p({fieldValue:null,error:I.message})}});return e.jsx(f.Button,{disabled:g,type:"button",className:"h-5 w-5",variant:"ghost",size:"sm",onClick:()=>h(),children:g?e.jsx(K.Loader,{className:"h-3 w-3 animate-spin text-yellow-500"}):e.jsx(K.Wand2Icon,{className:"text-yellow-500"})})},he=(t,p)=>{if(!t)return{success:!1,error:"Empty response from AI"};try{let n=t;if(typeof n=="string"&&(/^".*"$/.test(n)&&(n=n.replace(/^"(.*)"$/,"$1"),n=n.replace(/\\\\/g,"___DOUBLE_BACKSLASH___").replace(/\\n/g,`
|
|
2
2
|
`).replace(/\\"/g,'"').replace(/___DOUBLE_BACKSLASH___/g,"\\")),p==="jsonLD"||p==="metaOther")){n.includes("```")&&(n=n.replace(/^```json\s*/i,"").replace(/^```\s*/,"").replace(/\s*```$/m,"")),n=n.trim();try{JSON.parse(n)}catch{return{success:!1,error:"The AI response is not valid JSON. Please try again or edit manually."}}}return{success:!0,value:n}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error occurred"}}},ge=({isOpen:t,onClose:p,onSave:n,onDiscard:d,isSaving:l=!1,fromLanguage:N,toLanguage:x})=>{const h=i.LANGUAGES[N]||N,g=i.LANGUAGES[x]||x;return e.jsx(r.Dialog,{open:t,onOpenChange:p,children:e.jsxs(r.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(r.DialogHeader,{children:[e.jsx(r.DialogTitle,{children:"Unsaved SEO Changes"}),e.jsxs(r.DialogDescription,{children:['You have unsaved changes in the SEO for "',h,'" version. Do you want to save these changes before switching to "',g,'" version?']})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(f.Button,{variant:"outline",onClick:d,disabled:l,children:"Discard Changes"}),e.jsx(f.Button,{onClick:n,disabled:l,children:l?"Saving...":"Save & Switch"})]})]})})},me=t=>{if(!t)return!0;try{return JSON.parse(t),!0}catch{return!1}},xe=(t,p)=>{const n=t.selectionStart||0,d=t.selectionEnd||0,l=t.value,N=l.substring(0,n),x=l.substring(d),h=`{{${p}}}`,g=N+""+h+x,I=n+0+h.length;return{value:g,newCursorPos:I}},Q=()=>{const{t}=ie.useTranslation(),[,p]=r.useSidebarActivePanel(),{data:n}=i.usePrimaryPage(),{data:d}=i.useBuilderPageData(),{data:l,isFetching:N}=ue(),x=l==null?void 0:l.seo,h=w.useRef(null),[g,I]=w.useState("seo"),F=n==null?void 0:n.id,Y=n==null?void 0:n.pageType,E=i.usePageType(Y),{selectedLang:M,fallbackLang:X}=r.useLanguages(),m=M||X,[H,P]=w.useState(!1),[Z,$]=w.useState(!1),[ee,q]=w.useState(!1),[b,B]=w.useState(null),[o,D]=w.useState({keyword:"",title:"",description:"",cononicalUrl:"",noIndex:!1,noFollow:"",ogTitle:"",ogDescription:"",ogImage:"",ogImageId:"",searchTitle:"",searchDescription:"",jsonLD:"{}",metaOther:"{}",...x}),A=w.useRef({}),{mutate:se,isPending:U}=i.useUpdatePage(),y=U||H||Z,{hasPermission:te}=r.usePermissions(),a=te(i.PAGES_PERMISSIONS.EDIT_SEO),[ne]=i.usePagesProps(),oe=u.get(ne,"flags.resetSeoToDefault",!1),W=!M||o.jsonLD!=="{}";w.useEffect(()=>{if(!N&&x&&F){const s={keyword:"",title:"",description:"",cononicalUrl:"",noIndex:!1,noFollow:"",ogTitle:"",ogDescription:"",ogImage:"",ogImageId:"",searchTitle:"",searchDescription:"",jsonLD:"",metaOther:"",...x};D(s),A.current[m]=s}},[N,x,m,F]),w.useEffect(()=>{const s=c=>{const{fromLang:j,toLang:J,switchHandler:v}=c.detail,_=A.current[m];(_?!u.isEqual(_,o):!1)?(B({fromLang:j,toLang:J,switchHandler:v}),q(!0)):v()};return window.addEventListener("seo-language-switch-check",s),()=>{window.removeEventListener("seo-language-switch-check",s)}},[F,o,m]);const ae=async()=>{if(!(!E||!m))try{P(!0);const s=G.getSeoDefaults(E,m),c={...o,keyword:u.get(s,"seo.keyword",""),title:u.get(s,"seo.title",""),description:u.get(s,"seo.description",""),cononicalUrl:u.get(s,"seo.canonicalUrl",""),noIndex:u.get(s,"seo.noIndex",!1),noFollow:u.get(s,"seo.noFollow",!1),ogTitle:u.get(s,"seo.ogTitle",""),ogDescription:u.get(s,"seo.ogDescription","")};D(c),O.toast.success(t("SEO fields reset to defaults"))}catch(s){O.toast.error(t("Failed to reset SEO fields")),console.error("Reset SEO error:",s)}finally{P(!1)}},re=async()=>{if(!(!E||!m))try{$(!0);const s=G.getSeoDefaults(E,m),c={...o,jsonLD:u.get(s,"seo.jsonLD","")};D(c),O.toast.success(t("JSON-LD reset to default"))}catch(s){O.toast.error(t("Failed to reset JSON-LD")),console.error("Reset JSON-LD error:",s)}finally{$(!1)}},le=async()=>{if(!(!E||!m))try{P(!0);const s=G.getSeoDefaults(E,m),c={...o,ogTitle:u.get(s,"seo.ogTitle",""),ogDescription:u.get(s,"seo.ogDescription",""),ogImage:u.get(s,"seo.ogImage",""),ogImageId:u.get(s,"seo.ogImageId",""),metaOther:u.get(s,"seo.metaOther","{}")};D(c),O.toast.success(t("Meta Tag fields reset to defaults"))}catch(s){O.toast.error(t("Failed to reset Meta Tag fields")),console.error("Reset Meta Tag error:",s)}finally{P(!1)}},z=async()=>{se({id:l==null?void 0:l.id,seo:o,primaryPage:F},{onSuccess:()=>{console.log("SEO & JSON-LD updated successfully",o),A.current[m]=o,O.toast.success("SEO & JSON-LD updated successfully")}})},L=(s,c)=>{const j=document.getElementById(c);if(j){const{value:J,newCursorPos:v}=xe(j,s);h.current={id:c,position:v},j.tagName.toLowerCase()==="input"?(j.value=J,D(k=>({...k,[j.name]:J})),j.focus(),j.setSelectionRange(v,v),[0,10,50,100,200].forEach(k=>{setTimeout(()=>{const V=document.getElementById(c);V&&(V.focus(),V.setSelectionRange(v,v))},k)})):(D(T=>({...T,[j.name]:J})),requestAnimationFrame(()=>{const T=document.getElementById(c);T&&(T.focus(),T.setSelectionRange(v,v),setTimeout(()=>{const k=document.getElementById(c);k&&(k.focus(),k.setSelectionRange(v,v))},50))}))}},S=s=>{const c={...o,[s.target.name]:s.target.name==="noIndex"||s.target.name==="noFollow"?s.target.checked:s.target.value};D(c)},C=s=>c=>{if(!u.isEmpty(c.fieldValue)){const j=he(c.fieldValue,s);j.success?S({target:{name:s,value:j.value}}):O.toast.error(e.jsxs("div",{children:[e.jsx("h2",{children:"Failed to process AI response:"}),e.jsx("p",{children:j.error})]}))}c.error&&O.toast.error(e.jsxs("div",{children:[e.jsx("h2",{children:"Failed to generate:"}),e.jsx("p",{children:c.error})]}))},ce=()=>{const s=u.get(n,"seo.jsonLD","{}");if((s==null?void 0:s.trim())==="{}"){O.toast.error("Default page JSON-LD is empty");return}S({target:{name:"jsonLD",value:s}})};return e.jsxs("div",{className:"relative flex h-full flex-col","data-panel-id":"seo",children:[!a&&e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm",children:e.jsx(f.Alert,{variant:"default",className:"w-[80%] max-w-md text-xs",children:e.jsx(f.AlertDescription,{children:t("You don't have permission to edit SEO settings. Contact your administrator for access.")})})}),e.jsxs("div",{className:"no-scrollbar flex-grow overflow-y-auto px-2 pb-20",children:[e.jsxs("div",{className:"mb-4 flex w-full items-center justify-between rounded-md bg-gray-100 px-2 py-1 text-left text-sm",children:[e.jsxs("span",{children:[e.jsx("div",{className:"font-medium",children:l==null?void 0:l.name}),e.jsx("span",{className:"font-mono text-xs leading-tight text-gray-500",children:l==null?void 0:l.slug})]}),e.jsx(i.LanguageSwitcher,{showAdd:!1})]}),e.jsx("form",{className:"space-y-8",children:e.jsxs(r.Tabs,{value:g,onValueChange:I,className:"w-full",children:[e.jsxs(r.TabsList,{className:"mb-4 grid w-full grid-cols-3",children:[e.jsx(r.TabsTrigger,{value:"seo",children:t("SEO")}),e.jsx(r.TabsTrigger,{value:"opengraph",children:t("Meta Tags")}),e.jsx(r.TabsTrigger,{value:"jsonld",children:t("JSON-LD")})]}),e.jsx("div",{className:g==="seo"?"":"sr-only",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"keyword",children:t("Keyword")}),a&&e.jsx(i.NestedPathSelector,{dataType:"value",data:d??{},onSelect:s=>L(s,"keyword")})]}),e.jsx(f.Input,{type:"text",id:"keyword",name:"keyword",value:o.keyword,onChange:S,disabled:y||!a,placeholder:t("Enter keyword"),readOnly:!a})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"title",children:t("SEO Title")}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(R,{keyword:o.keyword,onComplete:C("title"),field:"title"}),a&&e.jsx(i.NestedPathSelector,{dataType:"value",data:d??{},onSelect:s=>L(s,"title")})]})]}),e.jsx(f.Input,{type:"text",id:"title",name:"title",value:o.title,onChange:S,disabled:y||!a,placeholder:t("Enter SEO title"),readOnly:!a})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"description",children:t("SEO Description")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{keyword:o.keyword,onComplete:C("description"),field:"description"}),a&&e.jsx(i.NestedPathSelector,{data:d??{},onSelect:s=>L(s,"description")})]})]}),e.jsx(r.Textarea,{id:"description",name:"description",rows:5,value:o.description,onChange:S,disabled:y||!a,placeholder:t("Enter SEO description"),readOnly:!a})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"title",children:t("Canonical URL")}),a&&e.jsx(i.NestedPathSelector,{dataType:"value",data:d??{},onSelect:s=>L(s,"canonicalUrl")})]}),e.jsx(f.Input,{type:"text",id:"canonicalUrl",name:"canonicalUrl",value:o.canonicalUrl,onChange:S,disabled:y||!a,placeholder:t("Enter Canonical URL"),readOnly:!a})]}),e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsx(f.Input,{type:"checkbox",id:"noIndex",name:"noIndex",checked:o.noIndex,onChange:S,disabled:y||!a,className:"h-4 w-4"}),e.jsx(r.Label,{className:"pb-1 text-xs",htmlFor:"noIndex",children:t("No Index")})]}),e.jsx("p",{className:"mt-0 text-[10px] font-light leading-4 text-gray-400",children:t("Check this if you don't want search engines to index this page.")})]}),e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsx(f.Input,{type:"checkbox",id:"noFollow",name:"noFollow",checked:o.noFollow,onChange:S,disabled:y||!a,className:"h-4 w-4"}),e.jsx(r.Label,{className:"pb-1 text-xs",htmlFor:"noIndex",children:t("No Follow")})]}),e.jsx("p",{className:"text-[10px] font-light leading-4 text-gray-400",children:t("Check this if you don't want search engines to follow links on this page.")})]})]})}),e.jsx("div",{className:g==="opengraph"?"":"sr-only",children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 font-semibold text-slate-700",children:t("Open Graph")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"ogTitle",children:t("OG Title")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{keyword:o.keyword,onComplete:C("ogTitle"),field:"ogTitle"}),a&&e.jsx(i.NestedPathSelector,{dataType:"value",data:d??{},onSelect:s=>L(s,"ogTitle")})]})]}),e.jsx(f.Input,{type:"text",id:"ogTitle",name:"ogTitle",value:o.ogTitle,onChange:S,disabled:y||!a,placeholder:t("Enter OG title"),readOnly:!a})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"ogDescription",children:t("OG Description")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{keyword:o.keyword,onComplete:C("ogDescription"),field:"ogDescription"}),a&&e.jsx(i.NestedPathSelector,{dataType:"value",data:d??{},onSelect:s=>L(s,"ogDescription")})]})]}),e.jsx(r.Textarea,{id:"ogDescription",name:"ogDescription",rows:5,value:o.ogDescription,onChange:S,disabled:y||!a,placeholder:t("Enter OG description"),readOnly:!a})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"ogImage",children:t("OG Image")}),a&&e.jsx(i.NestedPathSelector,{dataType:"value",data:d??{},onSelect:s=>{D({...o,ogImage:`{{${s}}}`,ogImageId:""})}})]}),e.jsx(i.ImagePicker,{assetId:o.ogImageId,assetUrl:o.ogImage,onChange:s=>{D({...o,ogImage:s.url,ogImageId:s.id})},disabled:y||!a,placeholder:t("Select OG image"),className:"mb-2"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"metaOther",children:t("Meta Tags")}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(R,{keyword:o.keyword,onComplete:C("metaOther"),field:"metaOther"})})]}),e.jsx(i.SmartJsonInput,{id:"metaOther",value:o.metaOther,onChange:s=>{S({target:{name:"metaOther",value:s}})},placeholder:t("Enter Meta Tags JSON"),disabled:y||!a,readOnly:!a,pageData:d||{},rows:8,handleFieldInsert:L})]})]})]})})}),e.jsx("div",{className:g==="jsonld"?"":"sr-only",children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(r.Label,{className:"text-xs",htmlFor:"jsonLD",children:t("JSON-LD")}),W&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(R,{keyword:o.keyword,onComplete:C("jsonLD"),field:"jsonLD"})})]}),e.jsx("div",{className:"hidden",children:JSON.stringify(d)}),e.jsx(i.SmartJsonInput,{id:"jsonLD",value:o.jsonLD,onChange:s=>{S({target:{name:"jsonLD",value:s}})},placeholder:t("Enter JSON-LD"),disabled:y||!a,readOnly:!a,pageData:d||{},rows:12,handleFieldInsert:L,hasJsonLdForSelectedLang:W,copyJsonLDFromDefaultPage:ce})]})})})]})})]}),a&&e.jsxs("div",{className:"fixed bottom-0 left-0 right-0 flex w-full flex-shrink-0 items-center justify-between border-t bg-background p-4",children:[oe?e.jsx(f.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>{g==="jsonld"?re():g==="opengraph"?le():ae()},disabled:y||!a||!E,children:t(H?"Resetting...":`Reset to ${g==="jsonld"?"Default JSON-LD":g==="opengraph"?"Default Open Graph":"Default SEO"}`)}):e.jsx("div",{}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(f.Button,{onClick:z,disabled:!me(o==null?void 0:o.jsonLD)||(A.current[m]?u.isEqual(A.current[m],o):!1)||y||!a,children:t(U?"Saving...":"Save")}),e.jsx(f.Button,{variant:"link",className:"text-gray-500 hover:text-gray-700",onClick:()=>p("outline"),children:t("Cancel")})]})]}),e.jsx(ge,{isOpen:ee,onClose:()=>{q(!1),B(null)},onSave:async()=>{b&&(await z(),b.switchHandler(),q(!1),B(null))},onDiscard:()=>{if(b){const s=A.current[m];s&&D(s),b.switchHandler(),q(!1),B(null)}},isSaving:U,fromLanguage:(b==null?void 0:b.fromLang)||m,toLanguage:(b==null?void 0:b.toLang)||""})]})};Q.displayName="SeoPanel";exports.default=Q;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { D as $, e as W, f as Y, g as X, p as y, a1 as U, a2 as _, at as R, a3 as M, a4 as q, au as H, a5 as K, a6 as Q, d as me, z as L, A as
|
|
2
|
+
import { D as $, e as W, f as Y, g as X, p as y, a1 as U, a2 as _, at as R, a3 as M, a4 as q, au as H, a5 as K, a6 as Q, d as me, z as L, A as J, E as F, a7 as he, J as ue, K as ge, M as fe, av as pe, O as xe, T as Ne } from "./index-BbkBlCE2.js";
|
|
3
3
|
import { D as be, F as ye, z as G, B as v } from "./register-chai-top-bar-D6GjnauV.js";
|
|
4
|
-
import {
|
|
4
|
+
import { aq as ve, ar as we, A as V, av as le, aD as Ae, aE as se, aF as re, aG as de, aH as Se, aI as Ce, aJ as Pe, j as Te, aK as De } from "./index-Cyz_Iww4.js";
|
|
5
5
|
import { useQuery as Ee, useQueryClient as Le } from "@tanstack/react-query";
|
|
6
|
-
import { filter as
|
|
6
|
+
import { filter as Je, find as Fe } from "lodash-es";
|
|
7
7
|
import { Info as Oe, Loader as O, Plus as ke, Eye as je, Edit as Ge, Trash as Be } from "lucide-react";
|
|
8
8
|
import { useState as g, useEffect as Z, useMemo as z } from "react";
|
|
9
9
|
import { toast as B } from "sonner";
|
|
@@ -27,14 +27,14 @@ const oe = () => {
|
|
|
27
27
|
content: "",
|
|
28
28
|
description: "",
|
|
29
29
|
enabledByDefaultForNewPages: !1
|
|
30
|
-
}), [x,
|
|
30
|
+
}), [x, C] = g(!1), { data: u } = le(), { mutateAsync: S, isPending: p } = Ae(), { mutateAsync: c } = se(), w = Le();
|
|
31
31
|
Z(() => {
|
|
32
32
|
f(a ? {
|
|
33
33
|
name: a.name,
|
|
34
34
|
description: a.description,
|
|
35
35
|
content: JSON.stringify(a.jsonld, null, 2),
|
|
36
36
|
enabledByDefaultForNewPages: !1
|
|
37
|
-
} : { name: "", description: "", content: "", enabledByDefaultForNewPages: !1 }),
|
|
37
|
+
} : { name: "", description: "", content: "", enabledByDefaultForNewPages: !1 }), C(!1);
|
|
38
38
|
}, [t, a]);
|
|
39
39
|
const o = async () => {
|
|
40
40
|
if (!d.name || !d.content) {
|
|
@@ -54,7 +54,7 @@ const oe = () => {
|
|
|
54
54
|
description: d.description
|
|
55
55
|
};
|
|
56
56
|
a != null && a.primaryPageId && (N.primaryPage = a.primaryPageId);
|
|
57
|
-
const A = await
|
|
57
|
+
const A = await S(N);
|
|
58
58
|
u != null && u.id && (A != null && A.id) && !(a != null && a.primaryPageId) && (await c({
|
|
59
59
|
schemaId: A.id,
|
|
60
60
|
pageId: u.id,
|
|
@@ -120,7 +120,7 @@ const oe = () => {
|
|
|
120
120
|
type: "checkbox",
|
|
121
121
|
id: "add-to-all-existing",
|
|
122
122
|
checked: x,
|
|
123
|
-
onChange: (l) =>
|
|
123
|
+
onChange: (l) => C(l.target.checked),
|
|
124
124
|
className: "h-5 w-5 cursor-pointer rounded focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1"
|
|
125
125
|
}
|
|
126
126
|
),
|
|
@@ -164,7 +164,7 @@ const oe = () => {
|
|
|
164
164
|
content: "",
|
|
165
165
|
description: "",
|
|
166
166
|
enabledByDefaultForNewPages: !1
|
|
167
|
-
}), [f, x] = g(!1), [
|
|
167
|
+
}), [f, x] = g(!1), [C, u] = g(!1), [S, p] = g(!1), { data: c } = oe(), { mutateAsync: w, isPending: o } = Se(), { mutateAsync: l } = Ce(), { mutateAsync: N } = Pe();
|
|
168
168
|
Z(() => {
|
|
169
169
|
var m, T;
|
|
170
170
|
if (t && c) {
|
|
@@ -211,7 +211,7 @@ const oe = () => {
|
|
|
211
211
|
return /* @__PURE__ */ n(W, { className: "flex max-w-xl flex-col overflow-y-auto", children: [
|
|
212
212
|
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Edit Shared JSON-LD Schema" }) }),
|
|
213
213
|
/* @__PURE__ */ n("div", { className: "flex max-h-[75vh] flex-col space-y-2 overflow-y-auto", children: [
|
|
214
|
-
!
|
|
214
|
+
!S && /* @__PURE__ */ n("div", { className: "flex items-center justify-between rounded-lg border border-blue-300 bg-blue-500/10 p-2", children: [
|
|
215
215
|
/* @__PURE__ */ n("div", { children: [
|
|
216
216
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-blue-900", children: "Manage Existing Pages" }),
|
|
217
217
|
/* @__PURE__ */ e("div", { className: "text-xs text-blue-700", children: "Add or remove this schema from all existing pages on your site" })
|
|
@@ -259,7 +259,7 @@ const oe = () => {
|
|
|
259
259
|
}
|
|
260
260
|
)
|
|
261
261
|
] }),
|
|
262
|
-
!
|
|
262
|
+
!S && /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
|
|
263
263
|
/* @__PURE__ */ e(
|
|
264
264
|
"input",
|
|
265
265
|
{
|
|
@@ -297,7 +297,7 @@ const oe = () => {
|
|
|
297
297
|
/* @__PURE__ */ e(Q, { onClick: I, children: "Add to All" })
|
|
298
298
|
] })
|
|
299
299
|
] }) }),
|
|
300
|
-
/* @__PURE__ */ e(U, { open:
|
|
300
|
+
/* @__PURE__ */ e(U, { open: C, onOpenChange: u, children: /* @__PURE__ */ n(_, { children: [
|
|
301
301
|
/* @__PURE__ */ n(R, { children: [
|
|
302
302
|
/* @__PURE__ */ e(M, { children: "Remove from All Pages?" }),
|
|
303
303
|
/* @__PURE__ */ n(q, { children: [
|
|
@@ -314,8 +314,8 @@ const oe = () => {
|
|
|
314
314
|
] });
|
|
315
315
|
};
|
|
316
316
|
function Xe() {
|
|
317
|
-
const [t, i] = g(!1), [a, d] = g(void 0), [f, x] = g(null), [
|
|
318
|
-
const h = o ?
|
|
317
|
+
const [t, i] = g(!1), [a, d] = g(void 0), [f, x] = g(null), [C, u] = g(null), [S, p] = g(null), { data: c, isLoading: w } = oe(), { selectedLang: o } = me(), { data: l } = le(), { data: N } = Te(), { mutateAsync: A } = De(), { mutateAsync: I } = se(), P = z(() => N == null ? void 0 : N.find((s) => !s.primaryPage && s.lang === ""), [N]), m = z(() => (P == null ? void 0 : P.globalJsonLds) || [], [P]), T = z(() => c ? Je(c, (r) => r.primaryPage === null && r.lang === "").map((r) => {
|
|
318
|
+
const h = o ? Fe(c, (D) => D.primaryPage === r.id && D.lang === o) : null;
|
|
319
319
|
return {
|
|
320
320
|
defaultSchema: r,
|
|
321
321
|
languageVersion: h,
|
|
@@ -359,7 +359,7 @@ function Xe() {
|
|
|
359
359
|
] }),
|
|
360
360
|
!o && /* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
361
361
|
/* @__PURE__ */ e(
|
|
362
|
-
|
|
362
|
+
J,
|
|
363
363
|
{
|
|
364
364
|
type: "button",
|
|
365
365
|
disabled: w,
|
|
@@ -370,7 +370,7 @@ function Xe() {
|
|
|
370
370
|
children: w ? /* @__PURE__ */ e(O, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-4 w-4" })
|
|
371
371
|
}
|
|
372
372
|
),
|
|
373
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e(F, { children: "Add new schema" })
|
|
374
374
|
] })
|
|
375
375
|
] }),
|
|
376
376
|
/* @__PURE__ */ n(he, { className: "max-h-96 overflow-y-auto", children: [
|
|
@@ -382,13 +382,13 @@ function Xe() {
|
|
|
382
382
|
return /* @__PURE__ */ n(
|
|
383
383
|
ue,
|
|
384
384
|
{
|
|
385
|
-
className: `relative border-gray-300 p-0 shadow-none transition-all ${
|
|
385
|
+
className: `relative border-gray-300 p-0 shadow-none transition-all ${S === r.id ? "pointer-events-none" : ""}`,
|
|
386
386
|
children: [
|
|
387
|
-
|
|
387
|
+
S === r.id && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 flex items-center justify-center rounded-xl bg-white/80", children: /* @__PURE__ */ e(O, { className: "h-5 w-5 animate-spin text-primary" }) }),
|
|
388
388
|
/* @__PURE__ */ e(ge, { className: "p-2", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
389
389
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
390
390
|
(h || !o) && /* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
391
|
-
/* @__PURE__ */ e(
|
|
391
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(
|
|
392
392
|
"input",
|
|
393
393
|
{
|
|
394
394
|
type: "checkbox",
|
|
@@ -398,7 +398,7 @@ function Xe() {
|
|
|
398
398
|
className: "h-5 w-5 cursor-pointer rounded focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1"
|
|
399
399
|
}
|
|
400
400
|
) }),
|
|
401
|
-
h && o && /* @__PURE__ */ e(
|
|
401
|
+
h && o && /* @__PURE__ */ e(F, { children: "Using the default language state" })
|
|
402
402
|
] }),
|
|
403
403
|
/* @__PURE__ */ n("div", { children: [
|
|
404
404
|
/* @__PURE__ */ n(fe, { className: "flex items-center gap-2 text-sm leading-none", children: [
|
|
@@ -416,7 +416,7 @@ function Xe() {
|
|
|
416
416
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
417
417
|
/* @__PURE__ */ e("div", { className: "mx-2 h-6 w-px bg-border" }),
|
|
418
418
|
/* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
419
|
-
/* @__PURE__ */ e(
|
|
419
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(
|
|
420
420
|
v,
|
|
421
421
|
{
|
|
422
422
|
type: "button",
|
|
@@ -427,11 +427,11 @@ function Xe() {
|
|
|
427
427
|
children: /* @__PURE__ */ e(je, { className: "h-4 w-4" })
|
|
428
428
|
}
|
|
429
429
|
) }),
|
|
430
|
-
/* @__PURE__ */ e(
|
|
430
|
+
/* @__PURE__ */ e(F, { children: "View schema" })
|
|
431
431
|
] }),
|
|
432
432
|
(h || !o) && /* @__PURE__ */ n(j, { children: [
|
|
433
433
|
/* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
434
|
-
/* @__PURE__ */ e(
|
|
434
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(
|
|
435
435
|
v,
|
|
436
436
|
{
|
|
437
437
|
type: "button",
|
|
@@ -442,12 +442,12 @@ function Xe() {
|
|
|
442
442
|
children: /* @__PURE__ */ e(Ge, { className: "h-4 w-4" })
|
|
443
443
|
}
|
|
444
444
|
) }),
|
|
445
|
-
/* @__PURE__ */ e(
|
|
445
|
+
/* @__PURE__ */ e(F, { children: "Edit schema" })
|
|
446
446
|
] }),
|
|
447
447
|
/* @__PURE__ */ n(U, { children: [
|
|
448
448
|
/* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
449
|
-
/* @__PURE__ */ e(
|
|
450
|
-
/* @__PURE__ */ e(
|
|
449
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(pe, { className: "flex h-5 w-5 items-center justify-center rounded-md text-red-500 hover:bg-red-100 hover:text-red-800", children: /* @__PURE__ */ e(Be, { className: "h-4 w-4" }) }) }),
|
|
450
|
+
/* @__PURE__ */ e(F, { children: "Delete schema" })
|
|
451
451
|
] }),
|
|
452
452
|
/* @__PURE__ */ n(_, { children: [
|
|
453
453
|
/* @__PURE__ */ n(R, { children: [
|
|
@@ -527,7 +527,7 @@ function Xe() {
|
|
|
527
527
|
/* @__PURE__ */ e(
|
|
528
528
|
Re,
|
|
529
529
|
{
|
|
530
|
-
schema: c == null ? void 0 : c.find((s) => s.id ===
|
|
530
|
+
schema: c == null ? void 0 : c.find((s) => s.id === C),
|
|
531
531
|
onClose: () => u(null)
|
|
532
532
|
}
|
|
533
533
|
)
|