texlite 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/DESIGN.md +64 -12
  2. package/dist/client/assets/AdminUsers-CfKlKMUu.js +1 -0
  3. package/dist/client/assets/{CitationLibraryDialog-tVD3i2gg.js → CitationLibraryDialog-BpnX28Le.js} +1 -1
  4. package/dist/client/assets/Dashboard-nbu54S0M.js +2 -0
  5. package/dist/client/assets/GitDialog-CrLMkNSh.js +3 -0
  6. package/dist/client/assets/GitHubAccountDialog-Bt0c8yBQ.js +1 -0
  7. package/dist/client/assets/HistoryDialog-CNEHivv5.js +7 -0
  8. package/dist/client/assets/LatexEditor-Dq9cqkpP.js +138 -0
  9. package/dist/client/assets/{PdfPreview-CMkO72I5.js → PdfPreview-xiB5Piyv.js} +1 -1
  10. package/dist/client/assets/ProjectIconPickerDialog-BSdiBwtv.js +1 -0
  11. package/dist/client/assets/{ProjectNavigationDialogs-isGMXCfG.js → ProjectNavigationDialogs-C7cD7PvT.js} +1 -1
  12. package/dist/client/assets/ProjectSettings-CRHG-jAZ.js +1 -0
  13. package/dist/client/assets/ProjectWorkspace-BdmKRaK2.js +32 -0
  14. package/dist/client/assets/{SelectionHistoryDialog-ZvAhIJMy.js → SelectionHistoryDialog-JL_2qLGf.js} +1 -1
  15. package/dist/client/assets/SystemMetricsDialog-BIWJwsxD.js +1 -0
  16. package/dist/client/assets/{TagManagementDialog-qhZfHgTr.js → TagManagementDialog-CJXWtqXN.js} +1 -1
  17. package/dist/client/assets/{WordCountDialog-tFhMCGyn.js → WordCountDialog-sr21g-ex.js} +1 -1
  18. package/dist/client/assets/check-CzfkSYah.js +1 -0
  19. package/dist/client/assets/{chktex-tM1XXPk2.js → chktex-BEVGf49u.js} +1 -1
  20. package/dist/client/assets/{editor-B9HNwtsd.js → editor-taw1iptB.js} +1 -1
  21. package/dist/client/assets/external-link-DuxFggPh.js +1 -0
  22. package/dist/client/assets/github-D805ABUR.js +1 -0
  23. package/dist/client/assets/{hard-drive-CkIPwUSV.js → hard-drive-De8wdQpw.js} +1 -1
  24. package/dist/client/assets/index-BYAZKPNO.js +10 -0
  25. package/dist/client/assets/{index-DTYEGzB7.js → index-CXWzCgcU.js} +1 -1
  26. package/dist/client/assets/index-Cc9-JFj7.css +1 -0
  27. package/dist/client/assets/{minimize-2-CLuDohEf.js → minimize-2-DP0ZJHGp.js} +1 -1
  28. package/dist/client/assets/{minus-BpuvzV2m.js → minus-BDK-NFbs.js} +1 -1
  29. package/dist/client/assets/{plus-BFr75l91.js → plus-GB_3iSP8.js} +1 -1
  30. package/dist/client/assets/{refresh-cw-DyA4NKh7.js → refresh-cw-DwUVAz9L.js} +1 -1
  31. package/dist/client/assets/{search-Nu4OcY_n.js → search-BJ0HR5pC.js} +1 -1
  32. package/dist/client/assets/{sigma-B-wjepsY.js → sigma-DOfd27T4.js} +1 -1
  33. package/dist/client/assets/{spellCheck-C-bNJsIU.js → spellCheck-CRN7y5Qf.js} +1 -1
  34. package/dist/client/assets/{tags-BSA08jK3.js → tags-BdjO5Lmr.js} +1 -1
  35. package/dist/client/assets/{type-BCdIbDmF.js → type-qV4gbXDh.js} +1 -1
  36. package/dist/client/assets/{user-plus-gFwY-NA3.js → user-plus-CPne6OnV.js} +1 -1
  37. package/dist/client/assets/x-DPtqmVM9.js +1 -0
  38. package/dist/client/index.html +3 -3
  39. package/dist/server/db.js +30 -1
  40. package/dist/server/git.js +64 -29
  41. package/dist/server/harper.js +14 -0
  42. package/dist/server/history.js +14 -5
  43. package/dist/server/i18n.js +2 -2
  44. package/dist/server/routes/projectGit.js +10 -11
  45. package/dist/server/routes/projectHistory.js +32 -5
  46. package/dist/server/routes/projectMembers.js +0 -5
  47. package/dist/server/routes/projects.js +10 -0
  48. package/dist/server/routes/users.js +0 -2
  49. package/dist/shared/historyFiles.js +6 -0
  50. package/package.json +3 -1
  51. package/dist/client/assets/AdminUsers-BExOMZsW.js +0 -1
  52. package/dist/client/assets/Dashboard-DRt4rjKP.js +0 -2
  53. package/dist/client/assets/GitDialog-CjDCi1uh.js +0 -3
  54. package/dist/client/assets/HistoryDialog-Pa9mK3Ky.js +0 -7
  55. package/dist/client/assets/LatexEditor-8r486VeG.js +0 -138
  56. package/dist/client/assets/ProjectIconPickerDialog-B52xbSyr.js +0 -1
  57. package/dist/client/assets/ProjectSettings-Br_kJ113.js +0 -1
  58. package/dist/client/assets/ProjectWorkspace-CcbrdCy8.js +0 -32
  59. package/dist/client/assets/SystemMetricsDialog-D4ouU4HI.js +0 -1
  60. package/dist/client/assets/check-DKIW1zpR.js +0 -1
  61. package/dist/client/assets/index-90X2GUd_.css +0 -1
  62. package/dist/client/assets/index-CqBmQAzW.js +0 -10
  63. package/dist/client/assets/key-round-BEnQo7IM.js +0 -1
  64. package/dist/client/assets/x-Cspw_pa4.js +0 -1
@@ -1 +0,0 @@
1
- import{u as E,r as t,j as e}from"./react-BVUjbTTn.js";import{M as $,h as M}from"./index-CqBmQAzW.js";import{i as z,p as b,P as h,a as L,n as F}from"./Dashboard-DRt4rjKP.js";import{S as q}from"./search-Nu4OcY_n.js";import"./hard-drive-CkIPwUSV.js";import"./x-Cspw_pa4.js";import"./sigma-B-wjepsY.js";import"./tags-BSA08jK3.js";function y(o){return o.trim().toLocaleLowerCase()}function H({project:o,open:l,onOpenChange:d,onSave:g}){const{t:s,i18n:k}=E(),[i,x]=t.useState(""),[n,p]=t.useState(null),[I,u]=t.useState(""),[r,j]=t.useState(!1),[f,m]=t.useState("");t.useEffect(()=>{l&&(x(""),p(o?.icon??null),u(o?.icon&&!z(o.icon)?o.icon:""),j(!1),m(""))},[l,o?.id,o?.icon]);const v=t.useMemo(()=>{const c=y(i);return c?b.filter(({name:a})=>[a,s(`projectIcons.icons.${a}.name`),s(`projectIcons.icons.${a}.keywords`)].some(P=>y(P).includes(c))):b},[k.resolvedLanguage,i,s]),C=async()=>{if(!(!o||r)){j(!0),m("");try{await g(o.id,n),d(!1)}catch(c){m(M(c))}finally{j(!1)}}},S=n!==(o?.icon??null),N=c=>{p(c),u("")},w=c=>{u(c);const a=c.trim();p(a?F(a)??a:null)};return e.jsx($,{open:l,wide:!0,className:"project-icon-picker-modal",title:s("projectIcons.title"),description:o?s("projectIcons.description",{project:o.name}):void 0,onOpenChange:c=>{r||d(c)},footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:r,onClick:()=>d(!1),children:s("common.cancel")}),e.jsx("button",{type:"button",className:"primary",disabled:r||!S,"aria-busy":r,onClick:()=>{C()},children:s("projectIcons.save")})]}),children:e.jsxs("div",{className:"project-icon-picker",children:[f&&e.jsx("p",{className:"error dialog-error",role:"alert",children:f}),e.jsxs("label",{className:"project-icon-search",children:[e.jsx(q,{"aria-hidden":"true",size:16}),e.jsx("span",{className:"sr-only",children:s("projectIcons.search")}),e.jsx("input",{autoFocus:!0,value:i,placeholder:s("projectIcons.search"),onChange:c=>x(c.target.value)})]}),e.jsxs("div",{className:"project-icon-options","aria-label":s("projectIcons.title"),children:[e.jsxs("button",{type:"button","aria-pressed":n===null,className:`project-icon-option project-icon-reset${n===null?" selected":""}`,title:s("projectIcons.useInitial"),onClick:()=>N(null),children:[e.jsx("span",{className:"project-icon-option-glyph",children:e.jsx(h,{fallback:L(o?.name??"")})}),e.jsx("span",{children:s("projectIcons.useInitial")})]}),v.map(({name:c})=>e.jsxs("button",{type:"button","aria-pressed":n===c,className:`project-icon-option${n===c?" selected":""}`,title:s(`projectIcons.icons.${c}.name`),onClick:()=>N(c),children:[e.jsx("span",{className:"project-icon-option-glyph",children:e.jsx(h,{icon:c,fallback:"?"})}),e.jsx("span",{children:s(`projectIcons.icons.${c}.name`)})]},c))]}),v.length===0&&e.jsx("p",{className:"project-icon-picker-empty",children:s("projectIcons.noMatches",{query:i})}),e.jsxs("div",{className:"project-icon-advanced",children:[e.jsx("label",{htmlFor:"project-icon-advanced-name",children:s("projectIcons.advancedName")}),e.jsxs("div",{className:"project-icon-advanced-input",children:[e.jsx("input",{id:"project-icon-advanced-name",value:I,placeholder:s("projectIcons.advancedNamePlaceholder"),onChange:c=>w(c.target.value),spellCheck:!1,autoCapitalize:"off",autoCorrect:"off"}),I.trim()&&e.jsx("span",{className:"project-icon-advanced-preview","aria-label":s("projectIcons.advancedPreview"),children:e.jsx(h,{icon:n,fallback:"?"})})]}),e.jsxs("p",{children:[s("projectIcons.advancedNameDescription")," ",e.jsx("a",{href:"https://icon-sets.iconify.design/lucide/",target:"_blank",rel:"noreferrer",children:s("projectIcons.browse")})]})]})]})})}export{H as ProjectIconPickerDialog};
@@ -1 +0,0 @@
1
- import{u as Se,r,j as e}from"./react-BVUjbTTn.js";import{c as u,g as M,h as O,d as B}from"./index-CqBmQAzW.js";import{E as F,G as Ne,S as q,I as oe,J as Ce,K as we,B as Fe,L as Ee}from"./ProjectWorkspace-CcbrdCy8.js";import{X as pe,i as Te,C as ze,d as Me,k as Oe}from"./x-Cspw_pa4.js";import{T as de}from"./type-BCdIbDmF.js";import{S as Le}from"./sigma-B-wjepsY.js";import{R as he}from"./refresh-cw-DyA4NKh7.js";import"./check-DKIW1zpR.js";import"./search-Nu4OcY_n.js";import"./user-plus-gFwY-NA3.js";const De=u("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);const Re=u("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);const Ae=u("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Pe=u("FileCheck2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3 15 2 2 4-4",key:"1lhrkk"}]]);const $e=u("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const He=u("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);const We=u("SpellCheck2",[["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1",key:"8mdmtu"}]]);const qe=u("WrapText",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]]);function Be(b,i){const p=b.filter(a=>a.type==="file"&&["latexmkrc",".latexmkrc"].includes(a.path.split("/").at(-1)??"")).map(a=>a.path);i&&b.some(a=>a.type==="file"&&a.path===i)&&!p.includes(i)&&p.push(i);const o=a=>a==="latexmkrc"?0:a===".latexmkrc"?1:a.includes("/")?3:2;return p.sort((a,k)=>o(a)-o(k)||a.localeCompare(k))}function _e({name:b,state:i,label:p,reloadLabel:o,onReload:a,compact:k=!1}){const y=i.status==="loading"?e.jsx(B,{className:"spin",size:14}):i.status==="working"?e.jsx(Fe,{size:14}):e.jsx(Ae,{size:14}),S=e.jsxs(e.Fragment,{children:[y,e.jsx("strong",{children:b}),e.jsx("span",{children:p}),i.status==="error"&&e.jsxs("button",{type:"button",className:"browser-tool-reload",title:o,"aria-label":o,onClick:a,children:[e.jsx(he,{size:12}),o]})]});return k?e.jsxs("span",{className:`browser-tool-status compact ${i.status}`,role:"status","aria-live":"polite","aria-label":`${b}: ${p}`,title:i.error||void 0,children:[y,e.jsx("span",{children:p}),i.status==="error"&&e.jsx("button",{type:"button",className:"browser-tool-reload",title:o,"aria-label":o,onClick:a,children:e.jsx(he,{size:12})})]}):e.jsx("div",{className:`browser-tool-status ${i.status}`,title:i.error||void 0,children:S})}function et({onClose:b,project:i,projectId:p,site:o,files:a,dictionaryWords:k,onDictionaryChange:y,editorPreferences:S,onEditorPreferences:xe,spellCheckCount:m,spellCheckUniqueCount:me,spellCheckIndex:f,onSpellCheckNavigate:E,onProject:_}){const{t}=Se(),[L,V]=r.useState(i.engine),[D,R]=r.useState(!!i.latexmkrc),[A,J]=r.useState(i.name),[v,K]=r.useState(i.mainFile),[P,Q]=r.useState(i.chktexEnabled),[x,U]=r.useState(!1),T=r.useRef(null),N=r.useRef(!0),X=r.useRef({name:i.name,mainFile:i.mainFile,engine:i.engine,latexmkrc:i.latexmkrc,chktexEnabled:i.chktexEnabled}),[C,G]=r.useState(null),[Z,$]=r.useState(""),[H,I]=r.useState(""),[Y,z]=r.useState(""),[d,ee]=r.useState("appearance"),[n,h]=r.useState(S),te=r.useSyncExternalStore(F.subscribe,F.getSnapshot,F.getSnapshot),j=i.permission==="owner",se=i.permission!=="read",ie=i.permission!=="read";r.useEffect(()=>h(S),[S]),r.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]),r.useEffect(()=>{Ne().catch(F.failed)},[p]);const je=()=>{Ee().catch(F.failed)},w=Be(a,i.latexmkrc),ne=i.latexmkrc&&w.includes(i.latexmkrc)?i.latexmkrc:w[0]??"",ae=a.length>0&&i.latexmkrc!==null&&!w.includes(i.latexmkrc);r.useEffect(()=>{ae&&R(!1)},[ae]),r.useEffect(()=>{if(d!=="compiler")return;const s=new AbortController;return G(null),M(`/api/projects/${p}/main-files`,{signal:s.signal}).then(c=>G(c.mainFiles)).catch(c=>{c instanceof Error&&c.name==="AbortError"||$(O(c))}),()=>s.abort()},[p,a,d]);const ge=C??[i.mainFile],ue=C!==null&&!C.includes(v),re=async()=>{if(T.current)return;const s=a.length===0&&i.latexmkrc&&o.allowProjectLatexmkrc!==!1?i.latexmkrc:D&&o.allowProjectLatexmkrc!==!1&&ne||null,c=X.current,g={};if(A!==c.name&&(g.name=A),v!==c.mainFile&&(g.mainFile=v),L!==c.engine&&(g.engine=L),s!==c.latexmkrc&&(g.latexmkrc=s),P!==c.chktexEnabled&&(g.chktexEnabled=P),Object.keys(g).length===0)return;const ye=Object.fromEntries(Object.keys(g).map(l=>[l,c[l]])),W=new AbortController;T.current=W,U(!0);try{$("");const l=await M(`/api/projects/${p}`,{method:"PATCH",signal:W.signal,body:JSON.stringify({...g,expectedSettings:ye})});if(!N.current){_(l.project);return}X.current={name:l.project.name,mainFile:l.project.mainFile,engine:l.project.engine,latexmkrc:l.project.latexmkrc,chktexEnabled:l.project.chktexEnabled},J(l.project.name),K(l.project.mainFile),V(l.project.engine),Q(l.project.chktexEnabled),R(!!l.project.latexmkrc),_(l.project)}catch(l){N.current&&$(O(l))}finally{T.current===W&&(T.current=null,N.current&&U(!1))}},ce=()=>xe(n),be=()=>{if(d==="appearance")return ce();j&&re()},ke=t(d==="appearance"?"projectSettings.saveAppearance":"projectSettings.saveCompiler"),fe=d==="appearance"||j,le=async()=>{const s=H.trim();if(s)try{const c=await M(`/api/projects/${p}/dictionary`,{method:"POST",body:JSON.stringify({word:s})});y(c.words),I(""),z("")}catch(c){z(O(c))}},ve=async s=>{try{const c=await M(`/api/projects/${p}/dictionary/${encodeURIComponent(s)}`,{method:"DELETE"});y(c.words),z("")}catch(c){z(O(c))}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"drawer-title settings-drawer-title",children:[e.jsx("strong",{children:t("editor.projectSettings")}),e.jsxs("div",{className:"drawer-title-actions",children:[fe&&e.jsxs("button",{type:"button",className:"drawer-settings-save",disabled:d==="compiler"&&x,"aria-busy":d==="compiler"&&x,onClick:be,children:[d==="compiler"&&x?e.jsx(B,{className:"spin",size:14}):e.jsx(q,{size:14}),e.jsx("span",{children:ke})]}),e.jsx("button",{type:"button","aria-label":t("common.close"),onClick:b,children:e.jsx(pe,{size:17})})]})]}),e.jsxs("div",{className:"settings padded",children:[Z&&e.jsx("p",{className:"error",children:Z}),e.jsxs("div",{className:"settings-tabs",role:"tablist","aria-label":t("common.settings"),children:[e.jsxs("button",{id:"settings-tab-appearance",type:"button",role:"tab","aria-selected":d==="appearance","aria-controls":"settings-panel-appearance",className:`settings-tab${d==="appearance"?" active":""}`,onClick:()=>ee("appearance"),children:[e.jsx(de,{size:15}),t("projectSettings.editorTab")]}),e.jsxs("button",{id:"settings-tab-compiler",type:"button",role:"tab","aria-selected":d==="compiler","aria-controls":"settings-panel-compiler",className:`settings-tab${d==="compiler"?" active":""}`,onClick:()=>ee("compiler"),children:[e.jsx(oe,{size:15}),t("projectSettings.compilerTab")]})]}),d==="appearance"?e.jsxs("section",{id:"settings-panel-appearance",role:"tabpanel","aria-labelledby":"settings-tab-appearance",children:[e.jsxs("div",{className:"settings-section-title",children:[e.jsx(de,{size:15}),e.jsx("strong",{children:t("projectSettings.editorAppearance")})]}),e.jsx("p",{className:"settings-description appearance-description",children:t("projectSettings.editorAppearanceDescription")}),e.jsxs("label",{children:[t("projectSettings.fontFamily"),e.jsx("select",{value:n.font,onChange:s=>h({...n,font:s.target.value}),children:Ce.map(s=>e.jsx("option",{value:s.id,children:t(s.labelKey)},s.id))})]}),e.jsxs("label",{children:[t("projectSettings.fontSize"),e.jsx("select",{value:n.fontSize,onChange:s=>h({...n,fontSize:Number(s.target.value)}),children:[12,13,14,15,16,18,20].map(s=>e.jsxs("option",{value:s,children:[s," px"]},s))})]}),e.jsxs("label",{children:[t("projectSettings.lineHeight"),e.jsxs("select",{value:n.lineHeight,onChange:s=>h({...n,lineHeight:Number(s.target.value)}),children:[e.jsx("option",{value:1.45,children:t("projectSettings.lineHeightCompact")}),e.jsx("option",{value:1.65,children:t("projectSettings.lineHeightNormal")}),e.jsx("option",{value:1.85,children:t("projectSettings.lineHeightRelaxed")})]})]}),e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:n.lineWrapping,onChange:s=>h({...n,lineWrapping:s.target.checked})}),e.jsx(qe,{size:15}),e.jsx("span",{children:t("projectSettings.lineWrapping")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:n.showTooltips,onChange:s=>h({...n,showTooltips:s.target.checked})}),e.jsx($e,{size:15}),e.jsx("span",{children:t("projectSettings.showTooltips")})]}),e.jsx("p",{className:"field-hint",children:t("projectSettings.showTooltipsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:n.mathPreviewOnHover,onChange:s=>h({...n,mathPreviewOnHover:s.target.checked})}),e.jsx(Le,{size:15}),e.jsx("span",{children:t("projectSettings.mathPreviewOnHover")})]}),e.jsx("p",{className:"field-hint",children:t("projectSettings.mathPreviewOnHoverDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:n.spellCheck,onChange:s=>h({...n,spellCheck:s.target.checked})}),e.jsx("span",{children:t("projectSettings.spellCheck")})]}),e.jsxs("p",{className:"field-hint",children:[t("projectSettings.writingCheckDescription")," ",e.jsx("a",{href:"https://writewithharper.com/docs/integrations/language-server",target:"_blank",rel:"noreferrer",children:"Harper"})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:n.vimMode,onChange:s=>h({...n,vimMode:s.target.checked})}),e.jsx("span",{children:t("projectSettings.vimMode")})]}),e.jsxs("p",{className:"field-hint",children:[t("projectSettings.vimModeDescription")," ",e.jsx("a",{href:"https://replit-codemirror-vim.mintlify.app/",target:"_blank",rel:"noreferrer",children:t("projectSettings.vimHelp")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:n.openFilesInTabs,onChange:s=>h({...n,openFilesInTabs:s.target.checked})}),e.jsx(He,{size:15}),e.jsx("span",{children:t("projectSettings.openFilesInTabs")})]}),e.jsx("p",{className:"field-hint",children:t("projectSettings.openFilesInTabsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",disabled:!se,checked:n.formatOnCompile,onChange:s=>h({...n,formatOnCompile:s.target.checked})}),e.jsx(we,{size:15}),e.jsx("span",{children:t("projectSettings.formatOnCompile")})]}),e.jsxs("p",{className:"field-hint",children:[t(se?"projectSettings.formatOnCompileDescription":"projectSettings.formatRequiresWrite")," ",t("projectSettings.formatterDescription")," ",e.jsx("a",{href:"https://www.npmjs.com/package/tex-fmt",target:"_blank",rel:"noreferrer",children:t("projectSettings.formatterInstall")})," · ",e.jsx("a",{href:"https://github.com/FlamingTempura/bibtex-tidy",target:"_blank",rel:"noreferrer",children:t("projectSettings.bibtexTidyInstall")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"tex-fmt-options-field",children:[e.jsxs("span",{className:"tex-fmt-options-heading",children:[e.jsx("span",{children:t("projectSettings.texFmtOptions")}),e.jsx(_e,{compact:!0,name:"tex-fmt",state:te,label:t(`projectSettings.toolStatus.${te.status}`),reloadLabel:t("projectSettings.reloadTool"),onReload:je})]}),e.jsx("textarea",{className:"tex-fmt-options-editor",rows:6,maxLength:16*1024,spellCheck:!1,value:n.texFmtConfig,placeholder:t("projectSettings.texFmtOptionsPlaceholder"),onChange:s=>h({...n,texFmtConfig:s.target.value})})]}),e.jsx("p",{className:"field-hint",children:t("projectSettings.texFmtOptionsDescription")})]}),m!==null&&e.jsxs("div",{className:`spell-check-result${m?" has-issues":""}`,role:"status","aria-live":"polite",children:[e.jsx(We,{size:14}),e.jsx("span",{children:m?t("projectSettings.writingIssues",{count:m,uniqueCount:me??0}):t("chktex.noIssues")}),m>0&&e.jsxs("span",{className:"spell-check-controls",children:[e.jsx("button",{type:"button",title:t("projectSettings.spellCheckFirst"),"aria-label":t("projectSettings.spellCheckFirst"),disabled:f<=0,onClick:()=>E(0),children:e.jsx(De,{size:14})}),e.jsx("button",{type:"button",title:t("projectSettings.spellCheckPrevious"),"aria-label":t("projectSettings.spellCheckPrevious"),disabled:f<=0,onClick:()=>E(f-1),children:e.jsx(Te,{size:14})}),e.jsx("span",{className:"spell-check-position",children:t("projectSettings.spellCheckPosition",{current:Math.min(f+1,m),total:m})}),e.jsx("button",{type:"button",title:t("projectSettings.spellCheckNext"),"aria-label":t("projectSettings.spellCheckNext"),disabled:f>=m-1,onClick:()=>E(f+1),children:e.jsx(ze,{size:14})}),e.jsx("button",{type:"button",title:t("projectSettings.spellCheckLast"),"aria-label":t("projectSettings.spellCheckLast"),disabled:f>=m-1,onClick:()=>E(m-1),children:e.jsx(Re,{size:14})})]})]}),e.jsxs("div",{className:"settings-section-title",children:[e.jsx(Me,{size:15}),e.jsx("strong",{children:t("projectSettings.dictionary")})]}),e.jsx("p",{className:"settings-description",children:t("projectSettings.dictionaryDescription")}),Y&&e.jsx("p",{className:"error dictionary-error",children:Y}),ie&&e.jsxs("div",{className:"dictionary-add",children:[e.jsx("input",{value:H,placeholder:t("projectSettings.dictionaryPlaceholder"),onChange:s=>I(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),le())}}),e.jsx("button",{type:"button",disabled:!H.trim(),onClick:()=>{le()},children:t("projectSettings.addWord")})]}),e.jsxs("div",{className:"dictionary-words",children:[k.map(s=>e.jsxs("span",{className:"dictionary-word",children:[e.jsx("code",{children:s}),ie&&e.jsx("button",{type:"button",title:t("common.delete"),"aria-label":`${t("common.delete")} ${s}`,onClick:()=>{ve(s)},children:e.jsx(pe,{size:13})})]},s)),k.length===0&&e.jsx("span",{className:"dictionary-empty",children:t("projectSettings.dictionaryEmpty")})]}),e.jsx("div",{className:"settings-actions",children:e.jsxs("button",{className:"settings-save",onClick:ce,children:[e.jsx(q,{size:15}),t("projectSettings.saveAppearance")]})})]}):e.jsxs("section",{id:"settings-panel-compiler",role:"tabpanel","aria-labelledby":"settings-tab-compiler",children:[e.jsxs("div",{className:"settings-section-title",children:[e.jsx(oe,{size:15}),e.jsx("strong",{children:t("projectSettings.compilerTab")})]}),e.jsx("p",{className:"settings-description compiler-description",children:t("projectSettings.compilerDescription")}),e.jsxs("label",{children:[t("projects.name"),e.jsx("input",{disabled:!j||x,value:A,onChange:s=>J(s.target.value)})]}),e.jsxs("label",{children:[t("projectSettings.mainFile"),e.jsxs("select",{disabled:!j||x||C===null||C.length===0,value:v,onChange:s=>K(s.target.value),children:[ue&&e.jsx("option",{value:v,disabled:!0,children:t("projectSettings.invalidMainFileOption",{path:v})}),ge.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsxs("label",{children:[t(D&&w.length>0&&o.allowProjectLatexmkrc!==!1?"projectSettings.defaultEngine":"projectSettings.engine"),e.jsx("select",{disabled:!j||x,value:L,onChange:s=>V(s.target.value),children:(o.allowedEngines??["pdflatex","xelatex","lualatex"]).map(s=>e.jsx("option",{children:s},s))})]}),e.jsxs("div",{className:"editor-preference compiler-check-option",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",disabled:!j||x,checked:P,onChange:s=>Q(s.target.checked)}),e.jsx(Pe,{size:15}),e.jsx("span",{children:t("chktex.enabled")})]}),e.jsxs("p",{className:"field-hint",children:[t("chktex.description")," ",e.jsx("a",{href:"https://www.nongnu.org/chktex/",target:"_blank",rel:"noreferrer",children:"ChkTeX"})]})]}),w.length>0&&e.jsxs("div",{className:"editor-preference latexmkrc-setting",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",disabled:!j||x||o.allowProjectLatexmkrc===!1,checked:D&&o.allowProjectLatexmkrc!==!1,onChange:s=>R(s.target.checked)}),e.jsx("span",{children:t("projectSettings.enableLatexmkrc")})]}),e.jsx("p",{className:"field-hint",children:t("projectSettings.latexmkrcSource",{path:ne})}),o.allowProjectLatexmkrc===!1?e.jsx("p",{className:"field-hint",children:t("projectSettings.latexmkrcUnavailable")}):e.jsxs("p",{className:"field-hint latexmkrc-warning",children:[e.jsx(Oe,{size:14,"aria-hidden":"true"}),e.jsx("span",{children:t("projectSettings.latexmkrcWarning")})]})]}),e.jsx("div",{className:"settings-actions",children:j&&e.jsxs("button",{className:"settings-save",disabled:x,"aria-busy":x,onClick:()=>{re()},children:[x?e.jsx(B,{className:"spin",size:15}):e.jsx(q,{size:15}),t("projectSettings.saveCompiler")]})})]})]})]})}export{et as ProjectSettings};