texlite 0.9.2 → 0.9.4
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/DESIGN.md +29 -6
- package/OPERATIONS.md +9 -7
- package/README.md +6 -3
- package/README.zh-CN.md +6 -2
- package/dist/client/assets/AdminUsers-B12FJUMy.js +1 -0
- package/dist/client/assets/CitationLibraryDialog-BTmnCP4V.js +1 -0
- package/dist/client/assets/Dashboard-JA5_M3TK.js +2 -0
- package/dist/client/assets/{GitDialog-CTWAU8q6.js → GitDialog--MoUIW0n.js} +1 -1
- package/dist/client/assets/{HistoryDialog-Mo4p8HEg.js → HistoryDialog-LgKbjsTZ.js} +1 -1
- package/dist/client/assets/LatexEditor-Dj2zIaQm.js +138 -0
- package/dist/client/assets/{PdfPreview-BUpELZd-.js → PdfPreview-C_W7w360.js} +1 -1
- package/dist/client/assets/ProjectIconPickerDialog-GzRuM0oQ.js +1 -0
- package/dist/client/assets/{ProjectNavigationDialogs-CpjkXZTz.js → ProjectNavigationDialogs-BiArHmQ9.js} +1 -1
- package/dist/client/assets/ProjectSettings-DgJohWUv.js +1 -0
- package/dist/client/assets/ProjectWorkspace-C6sYiBF2.js +32 -0
- package/dist/client/assets/{SelectionHistoryDialog-9FWlc3Rb.js → SelectionHistoryDialog-Bpv6nvrC.js} +2 -2
- package/dist/client/assets/SystemMetricsDialog-hJQATmd4.js +1 -0
- package/dist/client/assets/{TagManagementDialog-BHIA0vEA.js → TagManagementDialog-BHC8qULq.js} +1 -1
- package/dist/client/assets/{WordCountDialog-DFIWvLrP.js → WordCountDialog-DZhhO94k.js} +1 -1
- package/dist/client/assets/check-C1db8iNn.js +1 -0
- package/dist/client/assets/{editor-3rgn4IYh.js → editor-B9HNwtsd.js} +1 -1
- package/dist/client/assets/hard-drive-BWZnOgnm.js +1 -0
- package/dist/client/assets/index-BiwJj0Np.css +1 -0
- package/dist/client/assets/{index-CNTGCh7t.js → index-kTamGfTl.js} +1 -1
- package/dist/client/assets/index-p1NHkGGG.js +12 -0
- package/dist/client/assets/{key-round-BjL9H8-H.js → key-round-CoDwyVJc.js} +1 -1
- package/dist/client/assets/{minimize-2-DDCq8c49.js → minimize-2-D100opW2.js} +1 -1
- package/dist/client/assets/{minus-DgKZCT9F.js → minus-DDTYB-Oz.js} +1 -1
- package/dist/client/assets/{plus-CezUzSIZ.js → plus-BVXOlQXP.js} +1 -1
- package/dist/client/assets/{refresh-cw-CDFNL-qu.js → refresh-cw-LtwnqlWh.js} +1 -1
- package/dist/client/assets/{search-CrDJjHoj.js → search-DXo_aAp0.js} +1 -1
- package/dist/client/assets/{sigma-DOcJr7VG.js → sigma-BgvHGPto.js} +1 -1
- package/dist/client/assets/{spellCheck-BgWyesvf.js → spellCheck-BtRppKcC.js} +1 -1
- package/dist/client/assets/{tags-BedQ75lh.js → tags-m9kppdi0.js} +1 -1
- package/dist/client/assets/{type-glZNdzZR.js → type-YO4aprqE.js} +1 -1
- package/dist/client/assets/{user-plus-gQ6q5Nom.js → user-plus-MRmKeDtX.js} +1 -1
- package/dist/client/assets/x-eisRQJv_.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/client/pdf-download.svg +2 -0
- package/dist/client/pdf-file.svg +19 -0
- package/dist/client/tex-file.svg +7 -0
- package/dist/server/cli.js +5 -2
- package/dist/server/collaboration.js +6 -19
- package/dist/server/db.js +91 -10
- package/dist/server/latexDocumentGraph.js +127 -16
- package/dist/server/projectOutline.js +103 -91
- package/dist/server/projectReferences.js +1 -1
- package/dist/server/routes/comments.js +10 -4
- package/dist/server/routes/projectFiles.js +6 -1
- package/dist/server/routes/projectShared.js +33 -12
- package/dist/shared/collaborationProtocol.js +31 -0
- package/dist/shared/latexDependencies.js +83 -23
- package/dist/shared/writingChecks.js +2 -2
- package/package.json +4 -3
- package/dist/client/assets/AdminUsers-Buf5ZclR.js +0 -1
- package/dist/client/assets/CitationLibraryDialog-DrKbIlD-.js +0 -1
- package/dist/client/assets/Dashboard-DLk2j3oq.js +0 -2
- package/dist/client/assets/LatexEditor-CwvakYva.js +0 -135
- package/dist/client/assets/ProjectIconPickerDialog-BiWSwDdt.js +0 -1
- package/dist/client/assets/ProjectSettings-DoxitHbX.js +0 -1
- package/dist/client/assets/ProjectWorkspace-iNqXZlsj.js +0 -29
- package/dist/client/assets/SystemMetricsDialog-24kifZO6.js +0 -1
- package/dist/client/assets/check-C3GZh6a1.js +0 -1
- package/dist/client/assets/chevron-left-l1oupvGO.js +0 -1
- package/dist/client/assets/hard-drive-B-NSDVVA.js +0 -1
- package/dist/client/assets/index-CrlfruX_.css +0 -1
- package/dist/client/assets/index-DIM_KiG2.js +0 -12
- package/dist/client/assets/x-CSzFikn2.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-DIM_KiG2.js";import{i as z,p as b,P as h,a as L,n as F}from"./Dashboard-DLk2j3oq.js";import{S as q}from"./search-CrDJjHoj.js";import"./hard-drive-B-NSDVVA.js";import"./x-CSzFikn2.js";import"./sigma-DOcJr7VG.js";import"./tags-BedQ75lh.js";import"./chevron-left-l1oupvGO.js";function y(o){return o.trim().toLocaleLowerCase()}function J({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{J as ProjectIconPickerDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as le,r,j as e}from"./react-BVUjbTTn.js";import{c as j,g as x,h as S,d as oe}from"./index-DIM_KiG2.js";import{w as y,x as pe,S as O,y as U,z as de,A as he,u as me,B as xe}from"./ProjectWorkspace-iNqXZlsj.js";import{X as V,C as je,c as ge}from"./x-CSzFikn2.js";import{T as K}from"./type-glZNdzZR.js";import{S as ue}from"./sigma-DOcJr7VG.js";import{C as be}from"./chevron-left-l1oupvGO.js";import{R as X}from"./refresh-cw-CDFNL-qu.js";import"./check-C3GZh6a1.js";import"./search-CrDJjHoj.js";import"./user-plus-gQ6q5Nom.js";const ve=j("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);const Se=j("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);const ye=j("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 fe=j("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 ke=j("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 Ne=j("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 Ce({name:f,state:n,label:c,reloadLabel:d,onReload:k,compact:N=!1}){const g=n.status==="loading"?e.jsx(oe,{className:"spin",size:14}):n.status==="working"?e.jsx(me,{size:14}):e.jsx(ye,{size:14}),u=e.jsxs(e.Fragment,{children:[g,e.jsx("strong",{children:f}),e.jsx("span",{children:c}),n.status==="error"&&e.jsxs("button",{type:"button",className:"browser-tool-reload",title:d,"aria-label":d,onClick:k,children:[e.jsx(X,{size:12}),d]})]});return N?e.jsxs("span",{className:`browser-tool-status compact ${n.status}`,role:"status","aria-live":"polite","aria-label":`${f}: ${c}`,title:n.error||void 0,children:[g,e.jsx("span",{children:c}),n.status==="error"&&e.jsx("button",{type:"button",className:"browser-tool-reload",title:d,"aria-label":d,onClick:k,children:e.jsx(X,{size:12})})]}):e.jsx("div",{className:`browser-tool-status ${n.status}`,title:n.error||void 0,children:u})}function He({onClose:f,project:n,projectId:c,site:d,files:k,dictionaryWords:N,onDictionaryChange:g,editorPreferences:u,onEditorPreferences:G,spellCheckCount:o,spellCheckUniqueCount:Q,spellCheckIndex:h,onSpellCheckNavigate:C,onProject:Y}){const{t:s}=le(),[M,Z]=r.useState(n.engine),[F,T]=r.useState(""),[$,I]=r.useState(n.name),[b,ee]=r.useState(n.mainFile),[v,D]=r.useState(null),[P,z]=r.useState(""),[E,A]=r.useState(""),[H,w]=r.useState(""),[p,L]=r.useState("appearance"),[i,l]=r.useState(u),R=r.useSyncExternalStore(y.subscribe,y.getSnapshot,y.getSnapshot),m=n.permission==="owner",W=n.permission!=="read",q=n.permission!=="read";r.useEffect(()=>l(u),[u]),r.useEffect(()=>{pe().catch(y.failed)},[c]);const te=()=>{xe().catch(y.failed)};r.useEffect(()=>{if(!n.latexmkrc)return T("");x(`/api/projects/${c}/file?path=${encodeURIComponent(n.latexmkrc)}`).then(({content:t})=>T(t)).catch(t=>z(S(t)))},[n.latexmkrc]),r.useEffect(()=>{if(p!=="compiler")return;const t=new AbortController;return D(null),x(`/api/projects/${c}/main-files`,{signal:t.signal}).then(a=>D(a.mainFiles)).catch(a=>{a instanceof Error&&a.name==="AbortError"||z(S(a))}),()=>t.abort()},[c,k,p]);const se=v??[n.mainFile],ie=v!==null&&!v.includes(b),_=async()=>{try{const t=F.trim()&&d.allowProjectLatexmkrc!==!1?".latexmkrc":null;t&&await x(`/api/projects/${c}/file`,{method:"PUT",body:JSON.stringify({path:t,content:F})});const a=await x(`/api/projects/${c}`,{method:"PATCH",body:JSON.stringify({name:$,mainFile:b,engine:M,latexmkrc:t})});Y(a.project)}catch(t){z(S(t))}},B=()=>G(i),ne=()=>{if(p==="appearance")return B();m&&_()},ae=s(p==="appearance"?"projectSettings.saveAppearance":"projectSettings.saveCompiler"),re=p==="appearance"||m,J=async()=>{const t=E.trim();if(t)try{const a=await x(`/api/projects/${c}/dictionary`,{method:"POST",body:JSON.stringify({word:t})});g(a.words),A(""),w("")}catch(a){w(S(a))}},ce=async t=>{try{const a=await x(`/api/projects/${c}/dictionary/${encodeURIComponent(t)}`,{method:"DELETE"});g(a.words),w("")}catch(a){w(S(a))}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"drawer-title settings-drawer-title",children:[e.jsx("strong",{children:s("editor.projectSettings")}),e.jsxs("div",{className:"drawer-title-actions",children:[re&&e.jsxs("button",{type:"button",className:"drawer-settings-save",onClick:ne,children:[e.jsx(O,{size:14}),e.jsx("span",{children:ae})]}),e.jsx("button",{type:"button","aria-label":s("common.close"),onClick:f,children:e.jsx(V,{size:17})})]})]}),e.jsxs("div",{className:"settings padded",children:[P&&e.jsx("p",{className:"error",children:P}),e.jsxs("div",{className:"settings-tabs",role:"tablist","aria-label":s("common.settings"),children:[e.jsxs("button",{id:"settings-tab-appearance",type:"button",role:"tab","aria-selected":p==="appearance","aria-controls":"settings-panel-appearance",className:`settings-tab${p==="appearance"?" active":""}`,onClick:()=>L("appearance"),children:[e.jsx(K,{size:15}),s("projectSettings.editorTab")]}),e.jsxs("button",{id:"settings-tab-compiler",type:"button",role:"tab","aria-selected":p==="compiler","aria-controls":"settings-panel-compiler",className:`settings-tab${p==="compiler"?" active":""}`,onClick:()=>L("compiler"),children:[e.jsx(U,{size:15}),s("projectSettings.compilerTab")]})]}),p==="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(K,{size:15}),e.jsx("strong",{children:s("projectSettings.editorAppearance")})]}),e.jsx("p",{className:"settings-description appearance-description",children:s("projectSettings.editorAppearanceDescription")}),e.jsxs("label",{children:[s("projectSettings.fontFamily"),e.jsx("select",{value:i.font,onChange:t=>l({...i,font:t.target.value}),children:de.map(t=>e.jsx("option",{value:t.id,children:s(t.labelKey)},t.id))})]}),e.jsxs("label",{children:[s("projectSettings.fontSize"),e.jsx("select",{value:i.fontSize,onChange:t=>l({...i,fontSize:Number(t.target.value)}),children:[12,13,14,15,16,18,20].map(t=>e.jsxs("option",{value:t,children:[t," px"]},t))})]}),e.jsxs("label",{children:[s("projectSettings.lineHeight"),e.jsxs("select",{value:i.lineHeight,onChange:t=>l({...i,lineHeight:Number(t.target.value)}),children:[e.jsx("option",{value:1.45,children:s("projectSettings.lineHeightCompact")}),e.jsx("option",{value:1.65,children:s("projectSettings.lineHeightNormal")}),e.jsx("option",{value:1.85,children:s("projectSettings.lineHeightRelaxed")})]})]}),e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.lineWrapping,onChange:t=>l({...i,lineWrapping:t.target.checked})}),e.jsx(Ne,{size:15}),e.jsx("span",{children:s("projectSettings.lineWrapping")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.mathPreviewOnHover,onChange:t=>l({...i,mathPreviewOnHover:t.target.checked})}),e.jsx(ue,{size:15}),e.jsx("span",{children:s("projectSettings.mathPreviewOnHover")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.mathPreviewOnHoverDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.spellCheck,onChange:t=>l({...i,spellCheck:t.target.checked})}),e.jsx("span",{children:s("projectSettings.spellCheck")})]}),e.jsxs("p",{className:"field-hint",children:[s("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:i.vimMode,onChange:t=>l({...i,vimMode:t.target.checked})}),e.jsx("span",{children:s("projectSettings.vimMode")})]}),e.jsxs("p",{className:"field-hint",children:[s("projectSettings.vimModeDescription")," ",e.jsx("a",{href:"https://replit-codemirror-vim.mintlify.app/",target:"_blank",rel:"noreferrer",children:s("projectSettings.vimHelp")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.openFilesInTabs,onChange:t=>l({...i,openFilesInTabs:t.target.checked})}),e.jsx(fe,{size:15}),e.jsx("span",{children:s("projectSettings.openFilesInTabs")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.openFilesInTabsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",disabled:!W,checked:i.formatOnCompile,onChange:t=>l({...i,formatOnCompile:t.target.checked})}),e.jsx(he,{size:15}),e.jsx("span",{children:s("projectSettings.formatOnCompile")})]}),e.jsxs("p",{className:"field-hint",children:[s(W?"projectSettings.formatOnCompileDescription":"projectSettings.formatRequiresWrite")," ",s("projectSettings.formatterDescription")," ",e.jsx("a",{href:"https://www.npmjs.com/package/tex-fmt",target:"_blank",rel:"noreferrer",children:s("projectSettings.formatterInstall")})," · ",e.jsx("a",{href:"https://github.com/FlamingTempura/bibtex-tidy",target:"_blank",rel:"noreferrer",children:s("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:s("projectSettings.texFmtOptions")}),e.jsx(Ce,{compact:!0,name:"tex-fmt",state:R,label:s(`projectSettings.toolStatus.${R.status}`),reloadLabel:s("projectSettings.reloadTool"),onReload:te})]}),e.jsx("textarea",{className:"tex-fmt-options-editor",rows:6,maxLength:16*1024,spellCheck:!1,value:i.texFmtConfig,placeholder:s("projectSettings.texFmtOptionsPlaceholder"),onChange:t=>l({...i,texFmtConfig:t.target.value})})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.texFmtOptionsDescription")})]}),o!==null&&e.jsxs("div",{className:`spell-check-result${o?" has-issues":""}`,role:"status","aria-live":"polite",children:[e.jsx(ke,{size:14}),e.jsx("span",{children:o?s("projectSettings.writingIssues",{count:o,uniqueCount:Q??0}):s("projectSettings.noWritingIssues")}),o>0&&e.jsxs("span",{className:"spell-check-controls",children:[e.jsx("button",{type:"button",title:s("projectSettings.spellCheckFirst"),"aria-label":s("projectSettings.spellCheckFirst"),disabled:h<=0,onClick:()=>C(0),children:e.jsx(ve,{size:14})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckPrevious"),"aria-label":s("projectSettings.spellCheckPrevious"),disabled:h<=0,onClick:()=>C(h-1),children:e.jsx(be,{size:14})}),e.jsx("span",{className:"spell-check-position",children:s("projectSettings.spellCheckPosition",{current:Math.min(h+1,o),total:o})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckNext"),"aria-label":s("projectSettings.spellCheckNext"),disabled:h>=o-1,onClick:()=>C(h+1),children:e.jsx(je,{size:14})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckLast"),"aria-label":s("projectSettings.spellCheckLast"),disabled:h>=o-1,onClick:()=>C(o-1),children:e.jsx(Se,{size:14})})]})]}),e.jsxs("div",{className:"settings-section-title",children:[e.jsx(ge,{size:15}),e.jsx("strong",{children:s("projectSettings.dictionary")})]}),e.jsx("p",{className:"settings-description",children:s("projectSettings.dictionaryDescription")}),H&&e.jsx("p",{className:"error dictionary-error",children:H}),q&&e.jsxs("div",{className:"dictionary-add",children:[e.jsx("input",{value:E,placeholder:s("projectSettings.dictionaryPlaceholder"),onChange:t=>A(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),J())}}),e.jsx("button",{type:"button",disabled:!E.trim(),onClick:()=>{J()},children:s("projectSettings.addWord")})]}),e.jsxs("div",{className:"dictionary-words",children:[N.map(t=>e.jsxs("span",{className:"dictionary-word",children:[e.jsx("code",{children:t}),q&&e.jsx("button",{type:"button",title:s("common.delete"),"aria-label":`${s("common.delete")} ${t}`,onClick:()=>{ce(t)},children:e.jsx(V,{size:13})})]},t)),N.length===0&&e.jsx("span",{className:"dictionary-empty",children:s("projectSettings.dictionaryEmpty")})]}),e.jsx("div",{className:"settings-actions",children:e.jsxs("button",{className:"settings-save",onClick:B,children:[e.jsx(O,{size:15}),s("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(U,{size:15}),e.jsx("strong",{children:s("projectSettings.compilerTab")})]}),e.jsx("p",{className:"settings-description compiler-description",children:s("projectSettings.compilerDescription")}),e.jsxs("label",{children:[s("projects.name"),e.jsx("input",{disabled:!m,value:$,onChange:t=>I(t.target.value)})]}),e.jsxs("label",{children:[s("projectSettings.mainFile"),e.jsxs("select",{disabled:!m||v===null||v.length===0,value:b,onChange:t=>ee(t.target.value),children:[ie&&e.jsx("option",{value:b,disabled:!0,children:s("projectSettings.invalidMainFileOption",{path:b})}),se.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("label",{children:[s("projectSettings.engine"),e.jsx("select",{disabled:!m,value:M,onChange:t=>Z(t.target.value),children:(d.allowedEngines??["pdflatex","xelatex","lualatex"]).map(t=>e.jsx("option",{children:t},t))})]}),e.jsxs("label",{children:[s("projectSettings.latexmkrc"),e.jsx("textarea",{className:"latexmkrc-editor",rows:10,spellCheck:!1,disabled:!m||d.allowProjectLatexmkrc===!1,value:F,placeholder:s("projectSettings.latexmkrcPlaceholder"),onChange:t=>T(t.target.value)})]}),e.jsx("div",{className:"settings-actions",children:m&&e.jsxs("button",{className:"settings-save",onClick:()=>{_()},children:[e.jsx(O,{size:15}),s("projectSettings.saveCompiler")]})})]})]})]})}export{He as ProjectSettings};
|