gitlatex 1.5.0__tar.gz → 1.5.2__tar.gz

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 (82) hide show
  1. {gitlatex-1.5.0 → gitlatex-1.5.2}/PKG-INFO +1 -1
  2. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/__init__.py +1 -1
  3. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/http.py +0 -1
  4. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/base.css +1 -0
  5. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/layout.css +6 -0
  6. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/versions.css +2 -2
  7. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/index.html +1 -0
  8. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/layout.js +37 -1
  9. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/files.py +18 -14
  10. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/PKG-INFO +1 -1
  11. {gitlatex-1.5.0 → gitlatex-1.5.2}/pyproject.toml +1 -1
  12. {gitlatex-1.5.0 → gitlatex-1.5.2}/README.md +0 -0
  13. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/__main__.py +0 -0
  14. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/app.py +0 -0
  15. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/app.js +0 -0
  16. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/bib-commands.json +0 -0
  17. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/console.css +0 -0
  18. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/docs.css +0 -0
  19. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/editor.css +0 -0
  20. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/home.css +0 -0
  21. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/loading.css +0 -0
  22. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/outline.css +0 -0
  23. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/problems.css +0 -0
  24. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/settings.css +0 -0
  25. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/sidebar.css +0 -0
  26. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/support.css +0 -0
  27. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/toolbar.css +0 -0
  28. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/updates.css +0 -0
  29. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/favicon.svg +0 -0
  30. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/build/compile.js +0 -0
  31. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/build/problems.js +0 -0
  32. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/api.js +0 -0
  33. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/filetypes.js +0 -0
  34. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/router.js +0 -0
  35. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/state.js +0 -0
  36. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/storage.js +0 -0
  37. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/completions.js +0 -0
  38. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/envcolors.js +0 -0
  39. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/filetree.js +0 -0
  40. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/languages.js +0 -0
  41. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/mainfile.js +0 -0
  42. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/monaco.js +0 -0
  43. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/outline.js +0 -0
  44. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/projectindex.js +0 -0
  45. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/session.js +0 -0
  46. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/spell.js +0 -0
  47. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/actions.js +0 -0
  48. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/diffview.js +0 -0
  49. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/menu.js +0 -0
  50. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/versions.js +0 -0
  51. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/home/repolist.js +0 -0
  52. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/consolepane.js +0 -0
  53. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/loading.js +0 -0
  54. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/modals.js +0 -0
  55. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/settings.js +0 -0
  56. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/theme.js +0 -0
  57. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/viewer.js +0 -0
  58. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/latex-commands.json +0 -0
  59. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/__init__.py +0 -0
  60. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/compile.py +0 -0
  61. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/git.py +0 -0
  62. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/pages.py +0 -0
  63. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/projectindex.py +0 -0
  64. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/repos.py +0 -0
  65. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/spell.py +0 -0
  66. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/system.py +0 -0
  67. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/server.py +0 -0
  68. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/__init__.py +0 -0
  69. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/git_backend.py +0 -0
  70. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/gitrepo.py +0 -0
  71. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/latex.py +0 -0
  72. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/paths.py +0 -0
  73. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/projectindex.py +0 -0
  74. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/spell.py +0 -0
  75. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/updates.py +0 -0
  76. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/state.py +0 -0
  77. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/SOURCES.txt +0 -0
  78. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/dependency_links.txt +0 -0
  79. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/entry_points.txt +0 -0
  80. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/requires.txt +0 -0
  81. {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/top_level.txt +0 -0
  82. {gitlatex-1.5.0 → gitlatex-1.5.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitlatex
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: A simple UI for LaTeX projects with Git support. Clone repos, edit, compile, and push.
5
5
  License-Expression: ISC
6
6
  Project-URL: Homepage, https://github.com/abdussamiakanda/gitlatex
@@ -1,2 +1,2 @@
1
1
  """GitLaTeX IDE - LaTeX projects with Git support."""
2
- __version__ = "1.5.0"
2
+ __version__ = "1.5.2"
@@ -16,7 +16,6 @@ MIME_TYPES = {
16
16
  ".js": "application/javascript; charset=utf-8",
17
17
  }
18
18
 
19
- REPO_FILE_MAX_SIZE = 5 * 1024 * 1024
20
19
  STATIC_EXTENSIONS = frozenset({".css", ".js", ".html", ".ico", ".png", ".jpg", ".svg", ".woff", ".woff2"})
21
20
  ASSET_EXTENSIONS = frozenset({".css", ".js", ".svg", ".ico", ".png", ".jpeg", ".jpg", ".json", ".woff", ".woff2"})
22
21
 
@@ -44,6 +44,7 @@
44
44
  --sidebar-width: 260px;
45
45
  --pdf-width: 42%;
46
46
  --console-height: 200px;
47
+ --versions-width: 320px;
47
48
  }
48
49
 
49
50
  /* Light theme */
@@ -29,6 +29,12 @@
29
29
  overflow: hidden;
30
30
  }
31
31
 
32
+ /* The versions handle only exists while the panel does, otherwise it would
33
+ sit against the right edge with nothing to resize. */
34
+ #resizer-versions:has(+ #versions-panel.hidden) {
35
+ display: none;
36
+ }
37
+
32
38
  /* --- Main content area --- */
33
39
  #container {
34
40
  display: flex;
@@ -4,8 +4,8 @@
4
4
 
5
5
  /* --- Versions panel (commit history) --- */
6
6
  #versions-panel {
7
- width: 320px;
8
- min-width: 260px;
7
+ width: var(--versions-width);
8
+ min-width: 220px;
9
9
  flex: 0 0 auto;
10
10
  display: flex;
11
11
  flex-direction: column;
@@ -621,6 +621,7 @@ app.listen(8080, () => console.log("Compiler API on http://localhost:8080/compil
621
621
  </div>
622
622
  <div class="resizer resizer-v" id="resizer-pdf" title="Resize editor / PDF"></div>
623
623
  <iframe id="pdf"></iframe>
624
+ <div class="resizer resizer-v" id="resizer-versions" title="Resize versions panel"></div>
624
625
  <aside id="versions-panel" class="hidden" aria-hidden="true" aria-label="Version history">
625
626
  <div class="versions-header">
626
627
  <span class="material-icons" aria-hidden="true">history</span>
@@ -18,7 +18,7 @@ export function toggleSidebar() {
18
18
  // FA's fa-file-* set draws an actual document of that type, rather than a
19
19
 
20
20
  // ----- Resizable panels -----
21
- export const STORAGE_KEYS = { sidebar: "gitlatex-sidebar-width", pdf: "gitlatex-pdf-width", console: "gitlatex-console-height", consoleVisible: "gitlatex-console-visible" };
21
+ export const STORAGE_KEYS = { sidebar: "gitlatex-sidebar-width", pdf: "gitlatex-pdf-width", console: "gitlatex-console-height", consoleVisible: "gitlatex-console-visible", versions: "gitlatex-versions-width" };
22
22
 
23
23
  export function px(n) {
24
24
  return n + "px";
@@ -40,15 +40,18 @@ export function setupResizers() {
40
40
  const sidebar = document.getElementById("sidebar");
41
41
  const pdf = document.getElementById("pdf");
42
42
  const consoleEl = document.getElementById("console");
43
+ const versions = document.getElementById("versions-panel");
43
44
  if (!view || !sidebar || !pdf || !consoleEl) return;
44
45
 
45
46
  function loadStored() {
46
47
  const sw = localStorage.getItem(STORAGE_KEYS.sidebar);
47
48
  const pw = localStorage.getItem(STORAGE_KEYS.pdf);
48
49
  const ch = localStorage.getItem(STORAGE_KEYS.console);
50
+ const vw = localStorage.getItem(STORAGE_KEYS.versions);
49
51
  if (sw) view.style.setProperty("--sidebar-width", sw);
50
52
  if (pw) view.style.setProperty("--pdf-width", pw);
51
53
  if (ch) view.style.setProperty("--console-height", ch);
54
+ if (vw) view.style.setProperty("--versions-width", vw);
52
55
  }
53
56
  loadStored();
54
57
 
@@ -108,6 +111,36 @@ export function setupResizers() {
108
111
  document.addEventListener("mouseup", up);
109
112
  }
110
113
 
114
+ // Drags from the panel's left edge, so moving left widens it - same
115
+ // direction as the PDF pane.
116
+ function onResizeVersions(e) {
117
+ e.preventDefault();
118
+ const startX = e.clientX;
119
+ const startW = versions.offsetWidth;
120
+ view.classList.add("resizing");
121
+ document.getElementById("resizer-versions").classList.add("active");
122
+ const overlay = createResizeOverlay();
123
+ overlay.style.cursor = "col-resize";
124
+ document.body.appendChild(overlay);
125
+
126
+ function move(e2) {
127
+ const delta = startX - e2.clientX;
128
+ let w = Math.round(startW + delta);
129
+ w = Math.max(220, Math.min(window.innerWidth - 400, w));
130
+ view.style.setProperty("--versions-width", px(w));
131
+ }
132
+ function up() {
133
+ view.classList.remove("resizing");
134
+ document.getElementById("resizer-versions").classList.remove("active");
135
+ overlay.remove();
136
+ localStorage.setItem(STORAGE_KEYS.versions, px(versions.offsetWidth));
137
+ document.removeEventListener("mousemove", move);
138
+ document.removeEventListener("mouseup", up);
139
+ }
140
+ document.addEventListener("mousemove", move);
141
+ document.addEventListener("mouseup", up);
142
+ }
143
+
111
144
  function onResizeConsole(e) {
112
145
  e.preventDefault();
113
146
  const startY = e.clientY;
@@ -139,6 +172,9 @@ export function setupResizers() {
139
172
  document.getElementById("resizer-sidebar").addEventListener("mousedown", onResizeSidebar);
140
173
  document.getElementById("resizer-pdf").addEventListener("mousedown", onResizePdf);
141
174
  document.getElementById("resizer-console").addEventListener("mousedown", onResizeConsole);
175
+ if (versions) {
176
+ document.getElementById("resizer-versions")?.addEventListener("mousedown", onResizeVersions);
177
+ }
142
178
 
143
179
  const consoleToggle = document.getElementById("console-toggle");
144
180
  if (consoleToggle) {
@@ -2,13 +2,12 @@
2
2
 
3
3
  import base64
4
4
  import os
5
- import re
6
5
  import shutil
7
6
 
8
7
  from flask import Blueprint, jsonify, request, send_file
9
8
 
10
9
  from gitlatex import state
11
- from gitlatex.http import MIME_TYPES, REPO_FILE_MAX_SIZE, _json
10
+ from gitlatex.http import MIME_TYPES, _json
12
11
  from gitlatex.services.paths import flatten_file_tree, read_dir_recursive, resolve_repo_path
13
12
 
14
13
  bp = Blueprint("files", __name__)
@@ -44,21 +43,26 @@ def repo_files_content():
44
43
  for rel in paths:
45
44
  full_path = os.path.join(state.current_repo_path, rel)
46
45
  try:
47
- stat = os.stat(full_path)
48
- if not os.path.isfile(full_path) or stat.st_size > REPO_FILE_MAX_SIZE:
46
+ if not os.path.isfile(full_path):
49
47
  continue
50
- ext = os.path.splitext(full_path)[1].lower()
51
- is_binary = ext in MIME_TYPES or re.search(r"\.(pdf|zip|exe|dll)$", rel, re.I)
52
48
  rel_slash = rel.replace("\\", "/")
53
- if is_binary:
54
- with open(full_path, "rb") as f:
55
- content = base64.b64encode(f.read()).decode("ascii")
56
- files.append({"path": rel_slash, "base64": content})
49
+ with open(full_path, "rb") as f:
50
+ raw = f.read()
51
+ # Sniff the bytes rather than trusting the extension: anything that
52
+ # is not valid UTF-8 (binary .eps, fonts, archives) must travel as
53
+ # base64, or lossy decoding silently corrupts it in transit.
54
+ if b"\0" in raw:
55
+ text = None
57
56
  else:
58
- with open(full_path, "r", encoding="utf-8", errors="replace") as f:
59
- content = f.read()
60
- files.append({"path": rel_slash, "content": content})
61
- except (OSError, UnicodeDecodeError):
57
+ try:
58
+ text = raw.decode("utf-8")
59
+ except UnicodeDecodeError:
60
+ text = None
61
+ if text is None:
62
+ files.append({"path": rel_slash, "base64": base64.b64encode(raw).decode("ascii")})
63
+ else:
64
+ files.append({"path": rel_slash, "content": text})
65
+ except OSError:
62
66
  pass
63
67
  return jsonify(files=files)
64
68
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitlatex
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: A simple UI for LaTeX projects with Git support. Clone repos, edit, compile, and push.
5
5
  License-Expression: ISC
6
6
  Project-URL: Homepage, https://github.com/abdussamiakanda/gitlatex
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gitlatex"
7
- version = "1.5.0"
7
+ version = "1.5.2"
8
8
  description = "A simple UI for LaTeX projects with Git support. Clone repos, edit, compile, and push."
9
9
  readme = "README.md"
10
10
  license = "ISC"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes