texlite 0.15.0 → 0.16.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 (69) hide show
  1. package/DESIGN.md +11 -0
  2. package/README.md +6 -0
  3. package/README.zh-CN.md +6 -0
  4. package/dist/client/assets/AdminUsers-Dyapv-3c.js +1 -0
  5. package/dist/client/assets/CitationLibraryDialog-CU7Q7r0Z.js +1 -0
  6. package/dist/client/assets/Dashboard-DsdhFENx.js +2 -0
  7. package/dist/client/assets/GitDialog-CZpnKw-J.js +3 -0
  8. package/dist/client/assets/{GitHubAccountDialog-Cqcezf6G.js → GitHubAccountDialog-CZ8O_PjD.js} +1 -1
  9. package/dist/client/assets/{HistoryDialog-IurkSJuU.js → HistoryDialog-DWYErBwj.js} +3 -3
  10. package/dist/client/assets/LatexEditor-CssVgypt.js +141 -0
  11. package/dist/client/assets/{PdfPreview-BTmvQDCV.js → PdfPreview-BjghzUb1.js} +1 -1
  12. package/dist/client/assets/{ProjectIconPickerDialog-Cbm-0YQW.js → ProjectIconPickerDialog-CqRmgFBM.js} +1 -1
  13. package/dist/client/assets/{ProjectNavigationDialogs-CozcEa2v.js → ProjectNavigationDialogs-BZxI3PJO.js} +1 -1
  14. package/dist/client/assets/ProjectSettings-CZE_xDKn.js +1 -0
  15. package/dist/client/assets/ProjectWorkspace-CAX3qEYr.js +32 -0
  16. package/dist/client/assets/{SelectionHistoryDialog-DiRKiMEt.js → SelectionHistoryDialog-CR5c3I8k.js} +2 -2
  17. package/dist/client/assets/{SystemMetricsDialog-DJJZueSr.js → SystemMetricsDialog-DDpFwgXh.js} +1 -1
  18. package/dist/client/assets/{TagManagementDialog-3c-WAWQd.js → TagManagementDialog-CXLA9h_j.js} +1 -1
  19. package/dist/client/assets/WordCountDialog-DUyR24vv.js +1 -0
  20. package/dist/client/assets/check-CwBYzomT.js +1 -0
  21. package/dist/client/assets/chevron-up-D5lCNKlk.js +1 -0
  22. package/dist/client/assets/chktex-CRkLYKcV.js +3 -0
  23. package/dist/client/assets/{citationLibrary-ZeQPCv5O.js → citationLibrary-C9WnXB-1.js} +2 -2
  24. package/dist/client/assets/{external-link-DGfNJFKy.js → external-link-C9Td1CCj.js} +1 -1
  25. package/dist/client/assets/{github-DJezB5ef.js → github-D-JDXb-w.js} +1 -1
  26. package/dist/client/assets/{hard-drive-B9h-a7KY.js → hard-drive-Ctj3K_zx.js} +1 -1
  27. package/dist/client/assets/{index-DmBKxZf9.js → index-9hnQ8Q9x.js} +1 -1
  28. package/dist/client/assets/index-C0qg2Ylw.css +1 -0
  29. package/dist/client/assets/index-DkpU9Fgs.js +10 -0
  30. package/dist/client/assets/index-_eYe7K9T.js +1 -0
  31. package/dist/client/assets/{minimize-2-Crq_SyYM.js → minimize-2-BiVyoWZA.js} +1 -1
  32. package/dist/client/assets/{minus-Dn3USloe.js → minus-Bl8l4LXq.js} +1 -1
  33. package/dist/client/assets/{plus-BwKRQJHI.js → plus-CCxK-HNt.js} +1 -1
  34. package/dist/client/assets/{refresh-cw-C5yVKb1r.js → refresh-cw-BE8IbaHI.js} +1 -1
  35. package/dist/client/assets/{search-CDyQWr9H.js → search-CPbhRWQE.js} +1 -1
  36. package/dist/client/assets/{sigma-9fiQHdlo.js → sigma-LxGD9tK2.js} +1 -1
  37. package/dist/client/assets/spellCheck-hpm8qZTr.js +1 -0
  38. package/dist/client/assets/{tags-C_3BvsxV.js → tags-DuN89PsZ.js} +1 -1
  39. package/dist/client/assets/{type-CnT0mBxu.js → type-BiettCiY.js} +1 -1
  40. package/dist/client/assets/{x-DN0Ol4Ya.js → x-C_3swJOC.js} +1 -1
  41. package/dist/client/index.html +3 -3
  42. package/dist/client/texlite-icon.svg +8 -0
  43. package/dist/server/auth.js +0 -3
  44. package/dist/server/chktex.js +3 -4
  45. package/dist/server/i18n.js +4 -0
  46. package/dist/server/latexCompletion.js +11 -88
  47. package/dist/server/projectOutline.js +4 -39
  48. package/dist/server/projectSearch.js +0 -4
  49. package/dist/server/routes/citations.js +22 -0
  50. package/dist/server/routes/users.js +21 -3
  51. package/dist/shared/bibtexReferences.js +5 -1
  52. package/dist/shared/latexCompletion.js +1 -0
  53. package/dist/shared/latexReferences.js +13 -3
  54. package/dist/shared/latexSymbols.js +77 -0
  55. package/package.json +1 -1
  56. package/dist/client/assets/AdminUsers-Cau9nlv9.js +0 -1
  57. package/dist/client/assets/CitationLibraryDialog-Cf_bbSq3.js +0 -1
  58. package/dist/client/assets/Dashboard-JQ8pJe2d.js +0 -2
  59. package/dist/client/assets/GitDialog-BcqqWKr-.js +0 -3
  60. package/dist/client/assets/LatexEditor-msdbtTyG.js +0 -141
  61. package/dist/client/assets/ProjectSettings-BlthcpdA.js +0 -1
  62. package/dist/client/assets/ProjectWorkspace-DUPLJCQ3.js +0 -32
  63. package/dist/client/assets/WordCountDialog-BqlX2s36.js +0 -1
  64. package/dist/client/assets/check-EZ2H-iDj.js +0 -1
  65. package/dist/client/assets/chktex-CZIYuMLb.js +0 -3
  66. package/dist/client/assets/index-BgeOKYIx.js +0 -10
  67. package/dist/client/assets/index-CMBalIBd.css +0 -1
  68. package/dist/client/assets/spellCheck-BCpcq-VN.js +0 -1
  69. package/dist/client/assets/user-plus-pxz36w4w.js +0 -1
@@ -1 +0,0 @@
1
- import{u as c,j as o}from"./react-CltQJflK.js";import{M as x,d as h}from"./index-BgeOKYIx.js";import{H as j}from"./ProjectWorkspace-DUPLJCQ3.js";import{T as u}from"./type-CnT0mBxu.js";import{k as m}from"./x-DN0Ol4Ya.js";import"./check-EZ2H-iDj.js";import"./search-CDyQWr9H.js";import"./user-plus-pxz36w4w.js";import"./refresh-cw-C5yVKb1r.js";function T({open:l,mode:t,path:s,busy:i,error:e,result:d,onOpenChange:n}){const{t:r}=c(),a=r(t==="full"?"editor.wordCountFullHint":"editor.wordCountSelectionHint");return o.jsxs(x,{open:l,title:r("editor.wordCountTitle"),description:a,onOpenChange:n,footer:o.jsx("button",{type:"button",onClick:()=>n(!1),children:r("common.close")}),children:[s&&o.jsxs("p",{className:"word-count-source",children:[r(t==="full"?"editor.wordCountFull":"editor.wordCountSelection")," · ",o.jsx("code",{children:s}),o.jsx("a",{href:"https://app.uio.no/ifi/texcount/",target:"_blank",rel:"noreferrer",children:r("editor.wordCountHelp")})]}),o.jsx("p",{className:"word-count-template-note",children:r("editor.wordCountTemplateNote")}),i&&o.jsxs("div",{className:"word-count-loading",role:"status","aria-live":"polite",children:[o.jsx(h,{className:"spin",size:22}),o.jsx("span",{children:r("editor.wordCountLoading")})]}),e&&o.jsx("p",{className:"error dialog-error",children:e}),d&&!i&&o.jsxs("div",{className:"word-count-result","aria-live":"polite",children:[o.jsxs("div",{className:"word-count-totals",children:[o.jsxs("div",{className:"word-count-total",children:[o.jsx(j,{size:20}),o.jsx("strong",{children:d.totalWords.toLocaleString()}),o.jsx("span",{children:r("editor.wordCountTotal")})]}),o.jsxs("div",{className:"word-count-total word-count-characters",children:[o.jsx(u,{size:20}),o.jsx("strong",{children:d.totalCharacters.toLocaleString()}),o.jsxs("span",{children:[r("editor.wordCountCharacters"),o.jsx("small",{children:r("editor.wordCountCharactersHint")})]})]})]}),o.jsxs("dl",{className:"word-count-breakdown",children:[o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountText")}),o.jsxs("dd",{children:[d.textWords.toLocaleString(),o.jsx("small",{children:r("editor.wordCountWordsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountHeaders")}),o.jsxs("dd",{children:[d.headerWords.toLocaleString(),o.jsx("small",{children:r("editor.wordCountWordsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountCaptions")}),o.jsxs("dd",{children:[d.captionWords.toLocaleString(),o.jsx("small",{children:r("editor.wordCountWordsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountFloats")}),o.jsxs("dd",{children:[d.floats.toLocaleString(),o.jsx("small",{children:r("editor.wordCountItemsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountInlineMath")}),o.jsxs("dd",{children:[d.inlineMath.toLocaleString(),o.jsx("small",{children:r("editor.wordCountExpressionsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountDisplayMath")}),o.jsxs("dd",{children:[d.displayMath.toLocaleString(),o.jsx("small",{children:r("editor.wordCountExpressionsUnit")})]})]}),d.files!==null&&o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountFiles")}),o.jsxs("dd",{children:[d.files.toLocaleString(),o.jsx("small",{children:r("editor.wordCountItemsUnit")})]})]})]}),d.parserErrors>0&&o.jsxs("p",{className:"warning word-count-warning",children:[o.jsx(m,{size:14}),r("editor.wordCountParserErrors",{count:d.parserErrors})]})]})]})}export{T as WordCountDialog};
@@ -1 +0,0 @@
1
- import{c}from"./index-BgeOKYIx.js";const o=c("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);export{o as C};
@@ -1,3 +0,0 @@
1
- import{g as y,A as b}from"./index-BgeOKYIx.js";import{a as L,c as $}from"./ProjectWorkspace-DUPLJCQ3.js";import"./react-CltQJflK.js";import"./check-EZ2H-iDj.js";import"./x-DN0Ol4Ya.js";import"./search-CDyQWr9H.js";import"./user-plus-pxz36w4w.js";import"./refresh-cw-C5yVKb1r.js";class k extends Error{constructor(){super("A newer ChkTeX check replaced this request."),this.name="ChktexLintSupersededError"}}function H(t){return t instanceof k}const O=$();let T=0;async function I(t,s,e,r){try{return(await y(`/api/projects/${t}/chktex`,{method:"POST",body:JSON.stringify({path:s,source:e,clientId:O,sequence:r})})).issues}catch(o){throw o instanceof b&&o.code==="CHK_TEX_SUPERSEDED"?new k:o}}function M(t){const s=[0],e=new TextEncoder;let r=0;for(const o of t){const a=e.encode(o).length;r+=o.length;for(let n=0;n<a;n+=1)s.push(r)}return s}function X(t){const s=[0];for(let e=0;e<t.length;e+=1)t[e]===`
2
- `&&s.push(e+1);return s}function q(t,s){const e=X(t),r=new Set,o=new Map,a=[];for(const n of s){const i=n.line-1;if(!Number.isSafeInteger(i)||i<0||i>=e.length)continue;let l=o.get(i);if(!l){const m=e[i]??0,g=t.indexOf(`
3
- `,m),w=g===-1?t.length:g,x=t.slice(m,w);l={start:m,line:x,offsets:M(x)},o.set(i,l)}const{start:d,line:C,offsets:h}=l,c=n.column-1;if(!Number.isSafeInteger(c)||c<0||c>=h.length-1)continue;const f=d+h[c],E=Math.min(h.length-1,c+Math.max(1,n.length)),u=d+(h[E]??C.length);if(f>=t.length||u<=f)continue;const S=t.slice(f,Math.min(u,t.length)),p=`${f}:${u}:${n.number??""}`;r.has(p)||(r.add(p),a.push({from:f,to:Math.min(u,t.length),word:S,kind:"latex",message:n.number===null?`ChkTeX: ${n.message}`:`ChkTeX ${n.number}: ${n.message}`,suggestions:[]}))}return a.sort((n,i)=>n.from-i.from||n.to-i.to)}async function J(t,s,e){if(!L(s))return[];const r=await I(t,s,e,++T);return q(e,r)}export{k as ChktexLintSupersededError,H as isChktexLintSupersededError,J as lintChktex,q as mapChktexLints};