texlite 0.22.0 → 0.24.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.
- package/DESIGN.md +75 -15
- package/OPERATIONS.md +21 -1
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/addon.md +76 -0
- package/dist/client/assets/AdminUsers-C-8tXzvj.js +1 -0
- package/dist/client/assets/AdminUsers-C-8tXzvj.js.br +0 -0
- package/dist/client/assets/AdminUsers-C-8tXzvj.js.gz +0 -0
- package/dist/client/assets/{AgentIcon-DeoZDwgh.css → AgentIcon-_B7xXJpJ.css} +1 -1
- package/dist/client/assets/AgentIcon-_B7xXJpJ.css.br +0 -0
- package/dist/client/assets/AgentIcon-_B7xXJpJ.css.gz +0 -0
- package/dist/client/assets/{AgentManagement-DlV6tHez.js → AgentManagement-DXgfP7l_.js} +1 -1
- package/dist/client/assets/AgentManagement-DXgfP7l_.js.br +0 -0
- package/dist/client/assets/AgentManagement-DXgfP7l_.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-DD4sskCS.js +2 -0
- package/dist/client/assets/AgentTerminal-DD4sskCS.js.br +0 -0
- package/dist/client/assets/AgentTerminal-DD4sskCS.js.gz +0 -0
- package/dist/client/assets/AgentTerminalSurface-DliOcop5.js +16 -0
- package/dist/client/assets/AgentTerminalSurface-DliOcop5.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-DliOcop5.js.gz +0 -0
- package/dist/client/assets/{AvatarSettingsDialog-C8WQhZBK.js → AvatarSettingsDialog-iuEbMO4a.js} +1 -1
- package/dist/client/assets/AvatarSettingsDialog-iuEbMO4a.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-iuEbMO4a.js.gz +0 -0
- package/dist/client/assets/CitationBibtexEditor-CDiYDj3M.js +1 -0
- package/dist/client/assets/{CitationLibraryDialog-DgOIkLwK.js → CitationLibraryDialog-CJlL-Ytx.js} +3 -3
- package/dist/client/assets/CitationLibraryDialog-CJlL-Ytx.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-CJlL-Ytx.js.gz +0 -0
- package/dist/client/assets/Dashboard-DqwGd9wd.js +5 -0
- package/dist/client/assets/Dashboard-DqwGd9wd.js.br +0 -0
- package/dist/client/assets/Dashboard-DqwGd9wd.js.gz +0 -0
- package/dist/client/assets/{GitDialog-DGzZ3GRj.js → GitDialog-DUGAigLx.js} +1 -1
- package/dist/client/assets/GitDialog-DUGAigLx.js.br +0 -0
- package/dist/client/assets/GitDialog-DUGAigLx.js.gz +0 -0
- package/dist/client/assets/{GitHubAccountDialog-CGZl3mcY.js → GitHubAccountDialog-B4eD622i.js} +1 -1
- package/dist/client/assets/GitHubAccountDialog-B4eD622i.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-B4eD622i.js.gz +0 -0
- package/dist/client/assets/HistoryDialog-upkR8E0L.js +8 -0
- package/dist/client/assets/HistoryDialog-upkR8E0L.js.br +0 -0
- package/dist/client/assets/HistoryDialog-upkR8E0L.js.gz +0 -0
- package/dist/client/assets/{InfoPopover-Ba7GvcuW.js → InfoPopover-CQ3Q10tN.js} +1 -1
- package/dist/client/assets/LatexEditor-DvDYTc0r.js +25 -0
- package/dist/client/assets/LatexEditor-DvDYTc0r.js.br +0 -0
- package/dist/client/assets/LatexEditor-DvDYTc0r.js.gz +0 -0
- package/dist/client/assets/{MarkdownPreview-BH2iwvle.js → MarkdownPreview-_AXp5G7f.js} +1 -1
- package/dist/client/assets/MarkdownPreview-_AXp5G7f.js.br +0 -0
- package/dist/client/assets/MarkdownPreview-_AXp5G7f.js.gz +0 -0
- package/dist/client/assets/{ProjectIconPickerDialog-Bfkaxcnh.js → ProjectIconPickerDialog-BxjEYsau.js} +1 -1
- package/dist/client/assets/ProjectIconPickerDialog-BxjEYsau.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-BxjEYsau.js.gz +0 -0
- package/dist/client/assets/ProjectSearchDialog-BB8thfK9.js +1 -0
- package/dist/client/assets/ProjectSearchDialog-BB8thfK9.js.br +0 -0
- package/dist/client/assets/ProjectSearchDialog-BB8thfK9.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-Dx-b26uN.js +4 -0
- package/dist/client/assets/ProjectSettings-Dx-b26uN.js.br +0 -0
- package/dist/client/assets/ProjectSettings-Dx-b26uN.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-DiurYeU1.js +25 -0
- package/dist/client/assets/ProjectWorkspace-DiurYeU1.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-DiurYeU1.js.gz +0 -0
- package/dist/client/assets/{QuickOpenDialog-CHjPlBu2.js → QuickOpenDialog-HlkWqVR9.js} +1 -1
- package/dist/client/assets/QuickOpenDialog-HlkWqVR9.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-HlkWqVR9.js.gz +0 -0
- package/dist/client/assets/ReadOnlySource-BIdN1YP_.js +2 -0
- package/dist/client/assets/SelectionHistoryDialog-Cb8I-G6m.js +3 -0
- package/dist/client/assets/SelectionHistoryDialog-Cb8I-G6m.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-Cb8I-G6m.js.gz +0 -0
- package/dist/client/assets/SharedProjectPage-BBLOLjnD.js +2 -0
- package/dist/client/assets/SharedProjectPage-BBLOLjnD.js.br +0 -0
- package/dist/client/assets/SharedProjectPage-BBLOLjnD.js.gz +0 -0
- package/dist/client/assets/{SystemMetricsDialog-DkmBA4o4.js → SystemMetricsDialog-Dr4pYWG6.js} +1 -1
- package/dist/client/assets/SystemMetricsDialog-Dr4pYWG6.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-Dr4pYWG6.js.gz +0 -0
- package/dist/client/assets/{TagManagementDialog-BM1MRuwh.js → TagManagementDialog-D4fYVboy.js} +1 -1
- package/dist/client/assets/TagManagementDialog-D4fYVboy.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-D4fYVboy.js.gz +0 -0
- package/dist/client/assets/{ThemeSwitcher-dcvtWVCO.js → ThemeSwitcher-BgzkYTeA.js} +1 -1
- package/dist/client/assets/TikzGalleryDialog-Bqzl2256.css +1 -0
- package/dist/client/assets/TikzGalleryDialog-Bqzl2256.css.br +0 -0
- package/dist/client/assets/TikzGalleryDialog-Bqzl2256.css.gz +0 -0
- package/dist/client/assets/TikzGalleryDialog-cPUDQ5Wj.js +1 -0
- package/dist/client/assets/TikzGalleryDialog-cPUDQ5Wj.js.br +0 -0
- package/dist/client/assets/TikzGalleryDialog-cPUDQ5Wj.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-AiuR3rra.js +1 -0
- package/dist/client/assets/WordCountDialog-AiuR3rra.js.br +0 -0
- package/dist/client/assets/WordCountDialog-AiuR3rra.js.gz +0 -0
- package/dist/client/assets/{chktex-BrzPYHey.js → chktex--32C-Pkl.js} +1 -1
- package/dist/client/assets/{citationLibrary-DxGdbZEQ.js → citationLibrary-BJRzAgaV.js} +1 -1
- package/dist/client/assets/citationLibrary-BJRzAgaV.js.br +0 -0
- package/dist/client/assets/citationLibrary-BJRzAgaV.js.gz +0 -0
- package/dist/client/assets/editor-CSq7NymY.js +14 -0
- package/dist/client/assets/editor-CSq7NymY.js.br +0 -0
- package/dist/client/assets/editor-CSq7NymY.js.gz +0 -0
- package/dist/client/assets/editor-languages-CKP1xVf6.js +36 -0
- package/dist/client/assets/editor-languages-CKP1xVf6.js.br +0 -0
- package/dist/client/assets/editor-languages-CKP1xVf6.js.gz +0 -0
- package/dist/client/assets/editorThemeExtension-CjBD77yn.js +1 -0
- package/dist/client/assets/editorThemeExtension-CjBD77yn.js.br +0 -0
- package/dist/client/assets/editorThemeExtension-CjBD77yn.js.gz +0 -0
- package/dist/client/assets/file-cog-D_mhAnBe.js +1 -0
- package/dist/client/assets/{generatedParser-CZa2vsK6.js → generatedParser-2izSCuvk.js} +1 -1
- package/dist/client/assets/generatedParser-2izSCuvk.js.br +0 -0
- package/dist/client/assets/generatedParser-2izSCuvk.js.gz +0 -0
- package/dist/client/assets/i18n-Dpk6KCs6.js +13 -0
- package/dist/client/assets/i18n-Dpk6KCs6.js.br +0 -0
- package/dist/client/assets/i18n-Dpk6KCs6.js.gz +0 -0
- package/dist/client/assets/index-B1vejuOw.js +2 -0
- package/dist/client/assets/index-B1vejuOw.js.br +0 -0
- package/dist/client/assets/index-B1vejuOw.js.gz +0 -0
- package/dist/client/assets/index-Blr4J_Pq.css +1 -0
- package/dist/client/assets/index-Blr4J_Pq.css.br +0 -0
- package/dist/client/assets/index-Blr4J_Pq.css.gz +0 -0
- package/dist/client/assets/{relativeTime-mmWGtWRR.js → relativeTime-CcP1IEvr.js} +1 -1
- package/dist/client/assets/relativeTime-CcP1IEvr.js.br +0 -0
- package/dist/client/assets/relativeTime-CcP1IEvr.js.gz +0 -0
- package/dist/client/assets/sourceCursorStore-EycYBVxj.js +1 -0
- package/dist/client/assets/sourceCursorStore-EycYBVxj.js.br +0 -0
- package/dist/client/assets/sourceCursorStore-EycYBVxj.js.gz +0 -0
- package/dist/client/assets/{spellCheck-BTyLQAFH.js → spellCheck-DpWPgtM7.js} +1 -1
- package/dist/client/assets/spellCheck-DpWPgtM7.js.br +0 -0
- package/dist/client/assets/spellCheck-DpWPgtM7.js.gz +0 -0
- package/dist/client/assets/textLanguageSupport-tGXUsMU9.js +1 -0
- package/dist/client/assets/textLanguages-BpqiXyQi.js +78 -0
- package/dist/client/assets/textLanguages-BpqiXyQi.js.br +0 -0
- package/dist/client/assets/textLanguages-BpqiXyQi.js.gz +0 -0
- package/dist/client/assets/useDeletionTransitions-DvxVkRuo.js +1 -0
- package/dist/client/assets/useDeletionTransitions-DvxVkRuo.js.br +0 -0
- package/dist/client/assets/useDeletionTransitions-DvxVkRuo.js.gz +0 -0
- package/dist/client/assets/{vimSupport-C-WiMLjc.js → vimSupport-DMVGjr9R.js} +6 -6
- package/dist/client/assets/vimSupport-DMVGjr9R.js.br +0 -0
- package/dist/client/assets/vimSupport-DMVGjr9R.js.gz +0 -0
- package/dist/client/index.html +3 -3
- package/dist/server/agentChanges.js +95 -7
- package/dist/server/agents/outputBuffer.js +105 -0
- package/dist/server/agents/sessions.js +33 -16
- package/dist/server/agents/workspaces.js +14 -1
- package/dist/server/app.js +2 -0
- package/dist/server/cli.js +12 -1
- package/dist/server/collaboration.js +9 -0
- package/dist/server/config.js +10 -0
- package/dist/server/db.js +64 -0
- package/dist/server/editHistory.js +68 -20
- package/dist/server/git.js +9 -7
- package/dist/server/history.js +160 -69
- package/dist/server/i18n.js +8 -0
- package/dist/server/locales/zh-Hant.js +4 -0
- package/dist/server/projectMutations.js +4 -0
- package/dist/server/routes/comments.js +7 -2
- package/dist/server/routes/compile.js +56 -4
- package/dist/server/routes/projectFiles.js +54 -0
- package/dist/server/routes/projectGit.js +1 -1
- package/dist/server/routes/projectHistory.js +19 -5
- package/dist/server/routes/system.js +1 -0
- package/dist/server/routes/tikzGallery.js +38 -0
- package/dist/server/tikzEditorAddon.js +115 -0
- package/dist/server/tikzEditorRelease.js +9 -0
- package/dist/server/tikzGallery.js +63 -0
- package/dist/shared/agentMessages.js +3 -0
- package/dist/shared/tikzStandalone.js +15 -0
- package/package.json +2 -1
- package/templates/agents/AGENTS.md +12 -0
- package/texlite.config.example.json +4 -0
- package/dist/client/assets/AdminUsers-DepqkT6m.js +0 -1
- package/dist/client/assets/AdminUsers-DepqkT6m.js.br +0 -0
- package/dist/client/assets/AdminUsers-DepqkT6m.js.gz +0 -0
- package/dist/client/assets/AgentIcon-DeoZDwgh.css.br +0 -0
- package/dist/client/assets/AgentIcon-DeoZDwgh.css.gz +0 -0
- package/dist/client/assets/AgentManagement-DlV6tHez.js.br +0 -0
- package/dist/client/assets/AgentManagement-DlV6tHez.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-CvOz5X_j.js +0 -2
- package/dist/client/assets/AgentTerminal-CvOz5X_j.js.br +0 -0
- package/dist/client/assets/AgentTerminal-CvOz5X_j.js.gz +0 -0
- package/dist/client/assets/AgentTerminalSurface-COqg_GdK.js +0 -16
- package/dist/client/assets/AgentTerminalSurface-COqg_GdK.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-COqg_GdK.js.gz +0 -0
- package/dist/client/assets/AvatarSettingsDialog-C8WQhZBK.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-C8WQhZBK.js.gz +0 -0
- package/dist/client/assets/CitationBibtexEditor-SpudGDwi.js +0 -1
- package/dist/client/assets/CitationLibraryDialog-DgOIkLwK.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-DgOIkLwK.js.gz +0 -0
- package/dist/client/assets/Dashboard-CD1w42mA.js +0 -5
- package/dist/client/assets/Dashboard-CD1w42mA.js.br +0 -0
- package/dist/client/assets/Dashboard-CD1w42mA.js.gz +0 -0
- package/dist/client/assets/GitDialog-DGzZ3GRj.js.br +0 -0
- package/dist/client/assets/GitDialog-DGzZ3GRj.js.gz +0 -0
- package/dist/client/assets/GitHubAccountDialog-CGZl3mcY.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-CGZl3mcY.js.gz +0 -0
- package/dist/client/assets/HistoryDialog-DTZxCgyT.js +0 -8
- package/dist/client/assets/HistoryDialog-DTZxCgyT.js.br +0 -0
- package/dist/client/assets/HistoryDialog-DTZxCgyT.js.gz +0 -0
- package/dist/client/assets/LatexEditor-Boc-45KL.js +0 -25
- package/dist/client/assets/LatexEditor-Boc-45KL.js.br +0 -0
- package/dist/client/assets/LatexEditor-Boc-45KL.js.gz +0 -0
- package/dist/client/assets/MarkdownPreview-BH2iwvle.js.br +0 -0
- package/dist/client/assets/MarkdownPreview-BH2iwvle.js.gz +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-Bfkaxcnh.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-Bfkaxcnh.js.gz +0 -0
- package/dist/client/assets/ProjectSearchDialog-DPIzxVYj.js +0 -1
- package/dist/client/assets/ProjectSearchDialog-DPIzxVYj.js.br +0 -0
- package/dist/client/assets/ProjectSearchDialog-DPIzxVYj.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-ChXx_cmP.js +0 -4
- package/dist/client/assets/ProjectSettings-ChXx_cmP.js.br +0 -0
- package/dist/client/assets/ProjectSettings-ChXx_cmP.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-B-w2ix8N.js +0 -25
- package/dist/client/assets/ProjectWorkspace-B-w2ix8N.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-B-w2ix8N.js.gz +0 -0
- package/dist/client/assets/QuickOpenDialog-CHjPlBu2.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-CHjPlBu2.js.gz +0 -0
- package/dist/client/assets/ReadOnlySource-DKcmDg0e.js +0 -2
- package/dist/client/assets/SelectionHistoryDialog-Dnj22E8N.js +0 -3
- package/dist/client/assets/SelectionHistoryDialog-Dnj22E8N.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-Dnj22E8N.js.gz +0 -0
- package/dist/client/assets/SharedProjectPage-l8GSYTm-.js +0 -2
- package/dist/client/assets/SharedProjectPage-l8GSYTm-.js.br +0 -0
- package/dist/client/assets/SharedProjectPage-l8GSYTm-.js.gz +0 -0
- package/dist/client/assets/SystemMetricsDialog-DkmBA4o4.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-DkmBA4o4.js.gz +0 -0
- package/dist/client/assets/TagManagementDialog-BM1MRuwh.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-BM1MRuwh.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-DI0Jv-fg.js +0 -1
- package/dist/client/assets/WordCountDialog-DI0Jv-fg.js.br +0 -0
- package/dist/client/assets/WordCountDialog-DI0Jv-fg.js.gz +0 -0
- package/dist/client/assets/citationLibrary-DxGdbZEQ.js.br +0 -0
- package/dist/client/assets/citationLibrary-DxGdbZEQ.js.gz +0 -0
- package/dist/client/assets/editor-CkUEg2La.js +0 -14
- package/dist/client/assets/editor-CkUEg2La.js.br +0 -0
- package/dist/client/assets/editor-CkUEg2La.js.gz +0 -0
- package/dist/client/assets/editor-languages-kcWr1Z3Q.js +0 -36
- package/dist/client/assets/editor-languages-kcWr1Z3Q.js.br +0 -0
- package/dist/client/assets/editor-languages-kcWr1Z3Q.js.gz +0 -0
- package/dist/client/assets/editorThemeExtension-BWtZV1Af.js +0 -1
- package/dist/client/assets/editorThemeExtension-BWtZV1Af.js.br +0 -0
- package/dist/client/assets/editorThemeExtension-BWtZV1Af.js.gz +0 -0
- package/dist/client/assets/generatedParser-CZa2vsK6.js.br +0 -0
- package/dist/client/assets/generatedParser-CZa2vsK6.js.gz +0 -0
- package/dist/client/assets/i18n-Dtn6w-qA.js +0 -13
- package/dist/client/assets/i18n-Dtn6w-qA.js.br +0 -0
- package/dist/client/assets/i18n-Dtn6w-qA.js.gz +0 -0
- package/dist/client/assets/index-BbU2fbRw.css +0 -1
- package/dist/client/assets/index-BbU2fbRw.css.br +0 -0
- package/dist/client/assets/index-BbU2fbRw.css.gz +0 -0
- package/dist/client/assets/index-CPR6YZEf.js +0 -2
- package/dist/client/assets/index-CPR6YZEf.js.br +0 -0
- package/dist/client/assets/index-CPR6YZEf.js.gz +0 -0
- package/dist/client/assets/relativeTime-mmWGtWRR.js.br +0 -0
- package/dist/client/assets/relativeTime-mmWGtWRR.js.gz +0 -0
- package/dist/client/assets/sourceCursorStore-BVDvDKeP.js +0 -1
- package/dist/client/assets/sourceCursorStore-BVDvDKeP.js.br +0 -0
- package/dist/client/assets/sourceCursorStore-BVDvDKeP.js.gz +0 -0
- package/dist/client/assets/spellCheck-BTyLQAFH.js.br +0 -0
- package/dist/client/assets/spellCheck-BTyLQAFH.js.gz +0 -0
- package/dist/client/assets/textLanguageSupport-Ck8lMOWz.js +0 -1
- package/dist/client/assets/textLanguages-CwWstpJ5.js +0 -78
- package/dist/client/assets/textLanguages-CwWstpJ5.js.br +0 -0
- package/dist/client/assets/textLanguages-CwWstpJ5.js.gz +0 -0
- package/dist/client/assets/useDeletionTransitions-Ba_yhkrl.js +0 -1
- package/dist/client/assets/useDeletionTransitions-Ba_yhkrl.js.br +0 -0
- package/dist/client/assets/useDeletionTransitions-Ba_yhkrl.js.gz +0 -0
- package/dist/client/assets/vimSupport-C-WiMLjc.js.br +0 -0
- package/dist/client/assets/vimSupport-C-WiMLjc.js.gz +0 -0
- /package/dist/client/assets/{AgentIcon-CA-PfOka.js → AgentIcon-CjaO3WzI.js} +0 -0
- /package/dist/client/assets/{AgentIcon-CA-PfOka.js.br → AgentIcon-CjaO3WzI.js.br} +0 -0
- /package/dist/client/assets/{AgentIcon-CA-PfOka.js.gz → AgentIcon-CjaO3WzI.js.gz} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{i as r,r as i}from"./useDeletionTransitions-Ba_yhkrl.js";import{n as a}from"./index-CPR6YZEf.js";import{Kt as o,Pt as s,Qt as c,Rt as l,Wt as u,Y as d,d as f,en as p,f as m,gt as h,it as g,ot as _}from"./editor-CkUEg2La.js";import{c as v,i as y,n as b,o as x,t as S}from"./editorThemeExtension-BWtZV1Af.js";import{n as C,o as w,r as T,s as E,t as D}from"./textLanguages-CwWstpJ5.js";var O=e(t(),1),k=n();function A({path:e,content:t,jumpTo:n,onCursor:A}){let j=(0,O.useRef)(null),M=(0,O.useRef)(null),N=(0,O.useRef)(A);N.current=A;let P=a();return(0,O.useEffect)(()=>{if(!j.current)return;let n=new c,r=D(e),i=/\.(?:bib|bibtex)$/i.test(e),a=/\.bst$/i.test(e),O=new s({parent:j.current,state:p.create({doc:t,extensions:[p.readOnly.of(!0),s.editable.of(!1),S(P),s.contentAttributes.of({tabindex:`0`,"aria-label":e}),o(),g(),d(),l(),s.lineWrapping,f(),u.of([...m,..._]),n.of(r?E:i?T:a?w:[]),...r?[h(y),x]:[h(b)],...i?[h(v)]:[],s.theme({"&":{height:`100%`},".cm-scroller":{overflow:`auto`,fontFamily:`inherit`,lineHeight:`inherit`},".cm-content, .cm-gutters":{fontFamily:`inherit`,fontSize:`inherit`}}),s.updateListener.of(e=>{if(!e.selectionSet)return;let t=e.state.selection.main.head,n=e.state.doc.lineAt(t);N.current?.(n.number,t-n.from+1,t)})]})});M.current=O,N.current?.(1,1,0);let k=!1;return!r&&!i&&!a&&C(e,t.split(`
|
|
2
|
-
`,1)[0]).then(e=>{k||O.dispatch({effects:n.reconfigure(e)})}).catch(()=>{}),()=>{k=!0,M.current=null,O.destroy()}},[e,t,P]),(0,O.useEffect)(()=>{let e=M.current;if(!e||!n)return;let t=e.state.doc.line(Math.max(1,Math.min(e.state.doc.lines,n.line))).from;e.dispatch({selection:{anchor:t},effects:s.scrollIntoView(t,{y:`center`})}),e.focus()},[n,e,t,P]),(0,k.jsx)(`div`,{className:`editor-shell`,"data-editor-theme":P,style:{fontFamily:r(i.font),fontSize:i.fontSize,lineHeight:i.lineHeight},children:(0,k.jsx)(`div`,{className:`editor-host`,ref:j})})}export{A as ReadOnlySource};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{t as r}from"./useTranslation-DwkoADSz.js";import{T as i,c as a,d as o}from"./useDeletionTransitions-Ba_yhkrl.js";import{t as s}from"./bot-ClmnQ29j.js";import{t as c}from"./clock-3-DztJubz_.js";import{t as l}from"./hard-drive-CXlummIE.js";import{t as u}from"./loader-circle-DKGyi5EK.js";import{E as d,g as f,h as p,w as m,y as h}from"./index-CPR6YZEf.js";import{n as g,r as _,t as v}from"./dist-Dxkdrap6.js";import{f as y}from"./ProjectWorkspace-B-w2ix8N.js";var b=e(t(),1),x=/[\uD800-\uDFFF]/u;function S(e,t){let n=t===`semantic`?g(e):v(e,4);return n.some(([,e])=>x.test(e))?e:n}var C=96,w=48;function ee(e,t){let n=e.replace(/\r\n/g,`
|
|
2
|
-
`),r=t.replace(/\r\n/g,`
|
|
3
|
-
`);if(n===r)return{previous:[],current:[],additions:0,deletions:0,hasChanges:!1};let i=S(_(n,r,{checkLines:!1,timeout:1}),`semantic`),a=[],o=[],s=0,c=0;for(let e=0;e<i.length;e+=1){let[t,n]=i[e];if(n){if(t===0){let t=T(n,e,i.length);j(a,t),j(o,t)}else t<0?(c+=n.length,j(a,{kind:`deletion`,text:n})):(s+=n.length,j(o,{kind:`addition`,text:n}))}}return{previous:a,current:o,additions:s,deletions:c,hasChanges:s>0||c>0}}function T(e,t,n){let r=t===0,i=t===n-1;return(r||i)&&e.length<=C||!r&&!i&&e.length<=96?{kind:`equal`,text:e}:r?{kind:`omitted`,text:`…${D(e,C)}`}:i?{kind:`omitted`,text:`${E(e,C)}…`}:{kind:`omitted`,text:`${E(e,w)}…${D(e,w)}`}}function E(e,t){if(e.length<=t)return e;let n=O(e,t);return e.slice(0,n)}function D(e,t){if(e.length<=t)return e;let n=k(e,e.length-t);return e.slice(n)}function O(e,t){let n=Math.min(e.length,t+24);for(let r=t;r<n;r+=1)if(A(e[r]))return r+1;return t}function k(e,t){let n=Math.max(0,t-24);for(let r=t;r>n;--r)if(A(e[r-1]))return r;return t}function A(e){return/\s|[.,;:!?)}\]]/.test(e)}function j(e,t){let n=e.at(-1);n?.kind===t.kind?n.text+=t.text:e.push({...t})}var M=n();function N({open:e,project:t,filePath:n,selection:g,currentSource:_,onOpenChange:v}){let{t:x,i18n:S}=r(),[{filePath:C,selection:w,source:T}]=(0,b.useState)(()=>({filePath:n,selection:g,source:_})),[E,D]=(0,b.useState)([]),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(!1),[N,F]=(0,b.useState)(!0),[L,R]=(0,b.useState)(!1),[z,B]=(0,b.useState)(``),[V,H]=(0,b.useState)(null),[U,W]=(0,b.useState)(!1),[G,K]=(0,b.useState)(!1),[q,J]=(0,b.useState)(``),[Y,X]=(0,b.useState)(0);(0,b.useEffect)(()=>{if(H(null),!e||t.permission!==`owner`)return;let n=new AbortController;return m(`/api/projects/${t.id}/edit-history/stats`,{signal:n.signal}).then(e=>{n.signal.aborted||H(e)}).catch(e=>{!n.signal.aborted&&!d(e)&&B(h(e))}),()=>n.abort()},[e,t.id,t.permission,Y]);let Z=async()=>{if(!G){K(!0),J(``);try{await m(`/api/projects/${t.id}/edit-history`,{method:`DELETE`}),D([]),k(null),j(!1),F(!0),X(e=>e+1),W(!1)}catch(e){J(h(e))}finally{K(!1)}}},[ne,Q]=(0,b.useState)({}),$=Math.max(0,w.endOffset-w.startOffset);(0,b.useEffect)(()=>{if(!e||!C||$<=0)return;let n=new AbortController;if(R(!0),B(``),D([]),F(!0),Q({}),k(null),j(!1),T.slice(w.startOffset,w.endOffset)!==w.selectedText){B(x(`selectionHistory.sourceChanged`)),R(!1);return}let r=new URLSearchParams({path:C,start:String(w.startOffset),end:String(w.endOffset),sourceHash:y(T)});return m(`/api/projects/${t.id}/edit-history?${r}`,{signal:n.signal}).then(e=>{D(e.entries),F(e.chainComplete),k(e.baseline),j(e.hasMore)}).catch(e=>{d(e)||B(h(e))}).finally(()=>{n.signal.aborted||R(!1)}),()=>n.abort()},[e,t.id,C,w,$,T,x]);let re=(0,b.useMemo)(()=>x(`selectionHistory.description`,{path:C,count:$}),[x,C,$]);return(0,M.jsx)(f,{open:e,wide:!0,draggable:!0,className:`selection-history-modal`,title:x(`selectionHistory.title`),description:re,onOpenChange:v,footer:(0,M.jsxs)(M.Fragment,{children:[t.permission===`owner`&&V&&(0,M.jsxs)(`button`,{type:`button`,className:`selection-history-clear`,disabled:L||G||V.segmentCount===0,"aria-busy":G,onClick:()=>{J(``),W(!0)},children:[G?(0,M.jsx)(u,{className:`spin`,size:13}):(0,M.jsx)(i,{size:13}),(0,M.jsx)(`span`,{children:x(`selectionHistory.clearAll`)})]}),(0,M.jsx)(`button`,{type:`button`,className:`history-close`,onClick:()=>v(!1),children:x(`common.close`)})]}),children:(0,M.jsxs)(`div`,{className:`selection-history-dialog`,children:[t.permission===`owner`&&V&&(0,M.jsxs)(`div`,{className:`selection-history-storage`,children:[(0,M.jsx)(l,{size:15,"aria-hidden":!0}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`strong`,{children:x(`selectionHistory.storageUsage`,{used:(V.payloadBytes/1048576).toFixed(2),limit:(V.maxStorageBytes/1048576).toFixed(0),count:V.segmentCount})}),(0,M.jsx)(`small`,{children:x(`selectionHistory.storageDescription`)})]})]}),(0,M.jsx)(p,{open:U,title:x(`selectionHistory.clearAll`),description:x(`selectionHistory.clearDescription`),confirmLabel:x(`common.delete`),danger:!0,busy:G,error:q,onConfirm:()=>void Z(),onCancel:()=>{G||W(!1)}}),z&&(0,M.jsx)(`p`,{className:`error selection-history-message`,children:z}),L?(0,M.jsxs)(`div`,{className:`selection-history-loading`,children:[(0,M.jsx)(u,{className:`spin`,size:22}),x(`common.loading`)]}):(0,M.jsxs)(M.Fragment,{children:[!N&&(0,M.jsx)(`p`,{className:`selection-history-boundary`,children:x(`selectionHistory.boundary`)}),A&&(0,M.jsx)(`p`,{className:`selection-history-boundary`,children:x(`selectionHistory.limited`,{count:E.length})}),E.length===0&&!z?(0,M.jsxs)(`div`,{className:`selection-history-empty`,children:[(0,M.jsx)(c,{size:28}),(0,M.jsx)(`strong`,{children:x(`selectionHistory.emptyTitle`)}),(0,M.jsx)(`span`,{children:x(`selectionHistory.emptyDescription`)})]}):(0,M.jsx)(`ol`,{className:`selection-history-list`,children:E.map((e,t)=>{let n=ne[e.id]||`content`,r=E[t+1]||O,i=!(!r||e.content===null||r.content===null||e.contentTruncated||r.contentTruncated),c=n===`diff`&&i?ee(r.content,e.content):null,l=r?i?c&&!c.hasChanges?x(`selectionHistory.noDiff`):null:x(`selectionHistory.diffUnavailable`):x(`selectionHistory.noPrevious`);return(0,M.jsx)(`li`,{children:(0,M.jsxs)(`article`,{className:`selection-history-entry`,children:[(0,M.jsxs)(`header`,{children:[(0,M.jsx)(`time`,{title:a(e.updatedAt,S.resolvedLanguage),children:I(e.updatedAt,S.resolvedLanguage)}),(0,M.jsxs)(`span`,{className:`selection-history-authors`,children:[(0,M.jsx)(`span`,{children:x(`selectionHistory.changedBy`)}),(0,M.jsxs)(`span`,{className:`selection-history-author-list`,children:[e.authors.map((e,t)=>{let n=P(e,x(`editor.deletedUser`));return(0,M.jsxs)(`span`,{"data-tooltip":e.username?`@${e.username}`:void 0,"data-texlite-tooltip-always":!0,children:[(0,M.jsx)(o,{userId:e.id,name:n,username:e.username,avatarStyle:e.avatarStyle,className:`selection-history-avatar`}),(0,M.jsx)(`span`,{className:`selection-history-author-name`,children:n})]},e.id||`deleted-${t}`)}),e.hasAgent&&(0,M.jsxs)(`span`,{className:`selection-history-agent`,children:[(0,M.jsx)(`span`,{className:`selection-history-avatar`,"aria-hidden":!0,children:(0,M.jsx)(s,{size:12})}),(0,M.jsx)(`span`,{className:`selection-history-author-name`,children:x(`history.codingAgent`)})]})]})]})]}),(0,M.jsxs)(`div`,{className:`selection-history-tabs`,role:`tablist`,"aria-label":x(`selectionHistory.view`),children:[(0,M.jsx)(`button`,{type:`button`,className:n===`content`?`active`:``,role:`tab`,"aria-selected":n===`content`,"aria-controls":`selection-history-content-${e.id}`,onClick:()=>Q(t=>({...t,[e.id]:`content`})),children:x(`selectionHistory.contentTab`)}),(0,M.jsx)(`button`,{type:`button`,className:n===`diff`?`active`:``,role:`tab`,"aria-selected":n===`diff`,"aria-controls":`selection-history-diff-${e.id}`,onClick:()=>Q(t=>({...t,[e.id]:`diff`})),children:x(`selectionHistory.diffTab`)})]}),n===`content`?(0,M.jsxs)(`div`,{className:`selection-history-content`,id:`selection-history-content-${e.id}`,role:`tabpanel`,children:[e.content===null?(0,M.jsx)(`p`,{className:`selection-history-content-unavailable`,children:x(`selectionHistory.contentUnavailable`)}):(0,M.jsx)(`pre`,{children:e.content||`∅`}),e.contentTruncated&&(0,M.jsx)(`small`,{children:x(`selectionHistory.contentTruncated`)})]}):(0,M.jsx)(`div`,{className:`selection-history-content`,id:`selection-history-diff-${e.id}`,role:`tabpanel`,children:l?(0,M.jsx)(`p`,{className:`selection-history-content-unavailable`,children:l}):c&&(0,M.jsx)(te,{diff:c,previousLabel:x(`selectionHistory.previousVersion`),currentLabel:x(`selectionHistory.currentVersion`)})})]})},e.id)})})]})]})})}function P(e,t){return e.name||e.username||t}function te({diff:e,previousLabel:t,currentLabel:n}){return(0,M.jsxs)(`div`,{className:`selection-history-semantic-diff`,children:[(0,M.jsx)(F,{label:t,pieces:e.previous,variant:`previous`}),(0,M.jsx)(F,{label:n,pieces:e.current,variant:`current`})]})}function F({label:e,pieces:t,variant:n}){return(0,M.jsxs)(`section`,{className:`selection-history-diff-side ${n}`,children:[(0,M.jsx)(`header`,{children:e}),(0,M.jsx)(`pre`,{children:t.length?t.map((e,t)=>(0,M.jsx)(`span`,{className:e.kind,children:e.text},`${t}-${e.kind}`)):`∅`})]})}function I(e,t){return a(e,t,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}export{N as SelectionHistoryDialog};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PdfPreview-CIOM7sbu.js","./rolldown-runtime-XKyaHtl9.js","./react-DUEFWlB7.js","./useTranslation-DwkoADSz.js","./i18nInstance-CIMFwH0l.js","./basePath-B5-c90eh.js","./check-Dw16EqG-.js","./createLucideIcon-CDYIzuiB.js","./dist-B_WjsTVV.js","./es2015-D2UDOM09.js","./chevron-up-BHaMUEEA.js","./loader-circle-DKGyi5EK.js","./minus-DrpwqY8Y.js","./plus-Cei21TlT.js","./refresh-cw-IqExWG6S.js","./dist-C9O-A_C4.js","./pdf-DNPdInaJ.js","./vite-runtime-CRzLMJPS.js","./pdf-viewer-D6ryBmMb.js","./pdf-viewer-3Ft6T6NK.css","./ReadOnlySource-DKcmDg0e.js","./useDeletionTransitions-Ba_yhkrl.js","./index-CPR6YZEf.js","./i18n-Dtn6w-qA.js","./dist-DdUqlCPw.js","./index-BbU2fbRw.css","./editor-CkUEg2La.js","./editorThemeExtension-BWtZV1Af.js","./generatedParser-CZa2vsK6.js","./textLanguages-CwWstpJ5.js","./bibtexNames-CPGbBJxd.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{t as r}from"./useTranslation-DwkoADSz.js";import{r as i}from"./i18n-Dtn6w-qA.js";import{t as a}from"./basePath-B5-c90eh.js";import{t as o}from"./vite-runtime-CRzLMJPS.js";import{E as s,H as c,N as l,S as u,_ as d,b as f,c as p,j as m,k as h,m as g,r as _,u as v,v as y,x as b}from"./useDeletionTransitions-Ba_yhkrl.js";import{o as x}from"./dist-B_WjsTVV.js";import{C as S,E as C,O as w,S as T,_ as E,a as D,b as O,d as k,f as A,g as j,h as M,i as N,l as P,m as F,n as ee,o as I,p as L,s as R,t as z,w as te,x as B}from"./sourceCursorStore-BVDvDKeP.js";import{n as V,t as H}from"./ThemeSwitcher-dcvtWVCO.js";import{t as U}from"./loader-circle-DKGyi5EK.js";import{t as W}from"./lock-keyhole-aC_QjKDi.js";import{t as G}from"./palette-8_-Y5XON.js";import{t as K}from"./refresh-cw-IqExWG6S.js";import{C as q,w as J,y as Y}from"./index-CPR6YZEf.js";var X=e(t(),1),Z=n(),ne=(0,X.lazy)(()=>o(()=>import(`./PdfPreview-CIOM7sbu.js`).then(e=>({default:e.PdfPreview})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Q=()=>void 0;function $(){let{t:e,i18n:t}=r(),[n,a]=(0,X.useState)(!1),o=(0,X.useId)();return(0,Z.jsxs)(g,{open:n,onOpenChange:a,children:[(0,Z.jsx)(f,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:n?`active`:``,"aria-label":e(`common.settings`),title:e(`common.settings`),children:[(0,Z.jsx)(B,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label workspace-action-label-persistent`,children:e(`common.settings`)})]})}),(0,Z.jsx)(y,{children:(0,Z.jsx)(d,{className:`user-menu-content shared-reader-settings`,align:`end`,sideOffset:10,collisionPadding:12,"aria-label":e(`common.settings`),children:(0,Z.jsxs)(`div`,{className:`user-menu-settings`,children:[(0,Z.jsxs)(`div`,{className:`user-menu-language`,children:[(0,Z.jsxs)(`label`,{htmlFor:o,children:[(0,Z.jsx)(V,{size:16}),e(`common.language`)]}),(0,Z.jsxs)(`div`,{className:`user-menu-language-select`,children:[(0,Z.jsxs)(`select`,{id:o,value:i(t.resolvedLanguage),onChange:e=>void t.changeLanguage(e.target.value),children:[(0,Z.jsx)(`option`,{value:`en`,children:e(`common.languageEnglish`)}),(0,Z.jsx)(`option`,{value:`zh`,children:e(`common.languageChinese`)}),(0,Z.jsx)(`option`,{value:`zh-Hant`,children:e(`common.languageTraditionalChinese`)})]}),(0,Z.jsx)(x,{size:13,"aria-hidden":!0})]})]}),(0,Z.jsxs)(`div`,{className:`user-menu-theme`,children:[(0,Z.jsxs)(`span`,{className:`user-menu-setting-label`,children:[(0,Z.jsx)(G,{size:16}),e(`theme.title`)]}),(0,Z.jsx)(H,{})]})]})})})]})}function re({data:e,path:t=``,loading:n,onRefresh:i,children:a}){let{t:o,i18n:c}=r(),l=e?.expiresAt?o(`viewLinks.expires`,{time:p(e.expiresAt,c.resolvedLanguage)}):o(`viewLinks.readOnly`);return(0,Z.jsxs)(R,{siteName:e?.siteName??`TexLite`,projectName:e?.project.name??`TexLite`,subtitle:t||o(`viewLinks.readOnly`),titleAccessory:e&&(0,Z.jsxs)(`span`,{className:`shared-reader-access`,tabIndex:0,title:l,"data-texlite-tooltip-always":!0,children:[(0,Z.jsx)(W,{size:13,"aria-hidden":!0}),o(`viewLinks.readOnly`)]}),children:[a,e&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,className:`share-action`,disabled:!0,"aria-label":o(`projectSettings.share`),children:[(0,Z.jsx)(u,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:o(`projectSettings.share`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`snapshots-action`,disabled:!0,"aria-label":o(`history.projectSnapshots`),children:[(0,Z.jsx)(w,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:o(`history.projectSnapshotsButton`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`comments-action`,disabled:!0,"aria-label":o(`common.comments`),children:[(0,Z.jsx)(h,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:o(`common.comments`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`git-action`,disabled:!0,"aria-label":o(`git.title`),children:[(0,Z.jsx)(m,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:`Git`})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`reader-terminal-action`,disabled:!0,"aria-label":o(`agents.terminal`),children:[(0,Z.jsx)(s,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:o(`agents.terminal`)})]})]}),(0,Z.jsxs)(`button`,{type:`button`,disabled:n,"aria-label":o(`viewLinks.refresh`),title:o(`viewLinks.refresh`),onClick:i,children:[(0,Z.jsx)(K,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:o(`viewLinks.refresh`)})]}),(0,Z.jsx)($,{}),e&&(0,Z.jsxs)(`button`,{type:`button`,className:`compile`,disabled:!0,"aria-label":o(`editor.compile`,{engine:e.project.engine}),children:[(0,Z.jsx)(T,{size:15}),(0,Z.jsxs)(`span`,{className:`workspace-action-label workspace-action-label-persistent`,children:[o(`editor.compileShort`),(0,Z.jsxs)(`span`,{className:`compile-engine-label`,children:[` · `,e.project.engine]})]})]})]})}function ie({data:e,path:t,loading:n,error:i,onRefresh:a,onOpenFile:o,onJumpToSource:s,sourceCursorStore:u,children:d}){let{t:f,i18n:m}=r(),h=k(),[g,y]=(0,X.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 900px)`).matches?`editor-only`:`editor-pdf`),b=h&&g===`editor-pdf`?`editor-only`:g,w=e=>{y(h&&e===`editor-pdf`?`editor-only`:e),O(!1)},[T,O]=(0,X.useState)(!1),[I,R]=(0,X.useState)(()=>new Set),[z,B]=(0,X.useState)(null),[V,H]=(0,X.useState)(!1),[W,G]=(0,X.useState)(!1),K=M(),q=b!==`pdf-only`,J=b!==`editor-only`;(0,X.useEffect)(()=>{B(null),R(e=>{let n=new Set(e),r=t.split(`/`);for(let e=1;e<r.length;e++)n.add(r.slice(0,e).join(`/`));return n})},[t]);let Y=(0,X.useMemo)(()=>{let t=new Map;for(let n of e.files){let e=n.path.includes(`/`)?n.path.slice(0,n.path.lastIndexOf(`/`)):``,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[],r=e=>{let i=[...t.get(e)??[]].sort((e,t)=>e.type===t.type?e.path.localeCompare(t.path):e.type===`directory`?-1:1);for(let e of i)n.push(e),e.type===`directory`&&I.has(e.path)&&r(e.path)};return r(``),n},[e.files,I]),$=e.pdf?.compiledAt??null,ie=$?p($,m.resolvedLanguage,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}):``;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(re,{data:e,path:t,loading:n,onRefresh:a,children:[q&&(0,Z.jsxs)(`button`,{type:`button`,className:`files-action${(h?T:!V)?` active`:``}`,"aria-label":f(`common.files`),title:f(`common.files`),"aria-expanded":h?T:!V,onClick:()=>{h?O(e=>!e):K.current?.isCollapsed()?K.current.expand():K.current?.collapse()},children:[V?(0,Z.jsx)(S,{size:15}):(0,Z.jsx)(te,{size:15}),(0,Z.jsx)(`span`,{className:`workspace-action-label`,children:f(`common.files`)})]}),(0,Z.jsx)(P,{value:b,onChange:w,workspacePrimary:!0})]}),i&&(0,Z.jsx)(`div`,{className:`shared-reader-error error`,role:`alert`,children:i}),(0,Z.jsxs)(F,{orientation:`horizontal`,className:`work-grid shared-reader-workspace`,children:[q&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ae,{phone:h,open:T,onClose:()=>O(!1),filesPanel:K,onCollapsed:H,children:(0,Z.jsx)(D,{phone:h,files:(0,Z.jsxs)(`section`,{className:`files-panel`,children:[(0,Z.jsx)(`div`,{className:`panel-title`,children:(0,Z.jsx)(`button`,{type:`button`,className:`file-size-toggle`,"aria-pressed":W,title:f(W?`editor.hideFileSizes`:`editor.showFileSizes`),onClick:()=>G(e=>!e),children:f(`common.files`)})}),(0,Z.jsx)(`div`,{className:`file-list shared-reader-files${z===null?``:` folder-selected`}`,style:{fontSize:_.fontSize},children:Y.map(n=>{let r=n.type===`directory`,i=n.path.split(`/`).length-1,a=n.path.split(`/`).at(-1);return(0,Z.jsxs)(`div`,{className:`file-entry${r?` folder-entry${z===n.path?` selected`:``}`:z===null&&t===n.path?` active`:``}`,style:{paddingLeft:i*13+(r?5:18)},children:[(0,Z.jsxs)(`button`,{type:`button`,className:`file-entry-main`,"aria-expanded":r?I.has(n.path):void 0,onClick:()=>{r?(B(n.path),R(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t})):(B(null),o(n.path),h&&O(!1))},children:[r?(0,Z.jsxs)(Z.Fragment,{children:[I.has(n.path)?(0,Z.jsx)(x,{size:13}):(0,Z.jsx)(c,{size:13}),(0,Z.jsx)(l,{size:14})]}):(0,Z.jsx)(j,{path:n.path}),(0,Z.jsx)(`span`,{children:a}),!r&&n.path===e.project.mainFile&&(0,Z.jsx)(`small`,{children:f(`editor.currentMainShort`)})]}),W&&n.type===`file`&&n.size!=null&&(0,Z.jsx)(`span`,{className:`file-entry-size`,children:v(n.size)})]},n.path)})})]}),outline:(0,Z.jsx)(N,{outline:e.outline,activeFile:t,activeMainFile:e.project.mainFile,sourceCursorStore:u,jumpToSource:(...e)=>{s(...e),h&&O(!1)}})})}),!h&&(0,Z.jsx)(L,{className:`resize-handle`,"aria-label":f(`common.files`),children:(0,Z.jsx)(C,{size:12})}),(0,Z.jsx)(A,{id:`source`,minSize:`22%`,children:(0,Z.jsx)(`section`,{className:`source-panel`,children:(0,Z.jsx)(`div`,{className:`editor-content-container shared-reader-source`,children:d})})})]}),q&&J&&(0,Z.jsx)(L,{className:`resize-handle`,"aria-label":f(`viewLinks.pdf`),children:(0,Z.jsx)(C,{size:12})}),J&&(0,Z.jsx)(A,{id:`preview`,minSize:`22%`,children:(0,Z.jsxs)(`section`,{className:`preview-panel shared-reader-pdf`,children:[(0,Z.jsx)(ee,{mainFile:e.project.mainFile,targetLabel:e.project.mainFile.split(`/`).at(-1)??e.project.mainFile,compiledAt:$,compiledLabel:ie,sizeBytes:e.pdf?.size??null,downloadUrl:e.pdf?`${e.pdf.url}&download=1`:``,activeSurface:`pdf`,onSelect:Q,diagnosticCount:0,diagnosticsDisabled:!0}),(0,Z.jsx)(`div`,{className:`preview-content preview-pdf`,children:e.pdf?(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`pdf-loading-state`,role:`status`,children:[(0,Z.jsx)(U,{className:`spin`,size:24}),(0,Z.jsx)(`span`,{children:f(`editor.loadingPdf`)})]}),children:(0,Z.jsx)(ne,{url:e.pdf.url,loadingMode:e.pdf.loadingMode,target:null,onViewportLocation:Q},e.pdf.url)}):(0,Z.jsxs)(`div`,{className:`preview-empty preview-empty-uncompiled`,role:`status`,children:[(0,Z.jsx)(`span`,{className:`preview-empty-icon`,children:(0,Z.jsx)(E,{size:32})}),(0,Z.jsx)(`strong`,{children:f(`editor.previewEmptyTitle`)}),(0,Z.jsx)(`p`,{children:f(`viewLinks.noPdf`)})]})})]})})]})]})}function ae({phone:e,open:t,onClose:n,filesPanel:i,onCollapsed:a,children:o}){let{t:s}=r();return e?(0,Z.jsxs)(I,{files:!0,open:t,title:s(`common.files`),onClose:n,children:[(0,Z.jsx)(`button`,{className:`workspace-mobile-files-close`,type:`button`,"aria-label":s(`common.close`),onClick:n,children:(0,Z.jsx)(b,{size:18})}),o]}):(0,Z.jsx)(A,{id:`files`,panelRef:i,defaultSize:`16%`,minSize:`100px`,maxSize:`35%`,collapsible:!0,collapsedSize:`0%`,onResize:e=>a(e.asPercentage===0),children:o})}var oe=(0,X.lazy)(()=>o(()=>import(`./ReadOnlySource-DKcmDg0e.js`).then(e=>({default:e.ReadOnlySource})),__vite__mapDeps([20,1,2,21,5,7,8,9,22,3,4,23,17,11,24,25,26,27,28,29,30]),import.meta.url)),se=(0,X.lazy)(()=>o(()=>import(`./PdfPreview-CIOM7sbu.js`).then(e=>({default:e.PdfPreview})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),ce=()=>void 0;function le({linkId:e}){let{t}=r(),[n,i]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(!0),[v,y]=(0,X.useState)(!1),[b,x]=(0,X.useState)(0),[S,C]=(0,X.useState)(null),w=(0,X.useRef)(0),T=(0,X.useMemo)(()=>z(),[]);(0,X.useEffect)(()=>()=>T.dispose(),[T]);let E=(0,X.useRef)(0),D=(0,X.useRef)(window.location.hash),k=`/api/shared/${e}`,A=()=>{E.current++,d(!0),i(null),l(null)},j=e=>e instanceof q&&e.code===`VIEW_LINK_INVALID`;(0,X.useEffect)(()=>{let e=()=>{let e=window.location.hash;e&&e!==D.current&&(D.current=e,E.current++,i(null),l(null),s(``),d(!1),p(``),h(``),x(e=>e+1))};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,X.useEffect)(()=>{let e=new AbortController,t=++E.current,n=!1,r=async r=>{if(!(n||e.signal.aborted||E.current!==t)){n=!0;try{if(r){let t=window.location.hash.slice(1);if(t){if(await J(`${k}/access`,{method:`POST`,body:JSON.stringify({token:t}),signal:e.signal,suppressSessionExpired:!0}),e.signal.aborted)return;window.history.replaceState(window.history.state,``,window.location.pathname+window.location.search),D.current=``}}else{await J(`${k}/access`,{signal:e.signal,suppressSessionExpired:!0});return}let n=await J(k,{signal:e.signal,suppressSessionExpired:!0});if(e.signal.aborted||E.current!==t)return;d(!1),p(``),i(n),s(e=>n.files.some(t=>t.type===`file`&&t.path===e)?e:n.files.some(e=>e.type===`file`&&e.path===n.project.mainFile)?n.project.mainFile:n.files.find(e=>e.type===`file`)?.path??``)}catch(n){if(e.signal.aborted||E.current!==t)return;j(n)?A():p(Y(n))}finally{n=!1,!e.signal.aborted&&E.current===t&&_(!1)}}};_(!0),r(!0);let a=window.setInterval(()=>{document.visibilityState!==`hidden`&&r(!1)},3e4),o=()=>{document.visibilityState!==`hidden`&&r(!1)};return document.addEventListener(`visibilitychange`,o),()=>{e.abort(),window.clearInterval(a),document.removeEventListener(`visibilitychange`,o)}},[k,b]),(0,X.useEffect)(()=>{if(!n?.expiresAt)return;let e=Date.parse(n.expiresAt)-Date.now();if(e<=0){A();return}let t=window.setTimeout(()=>{Date.parse(n.expiresAt)<=Date.now()&&A()},Math.min(e,2147483647));return()=>window.clearTimeout(t)},[n?.expiresAt]),(0,X.useEffect)(()=>{if(!n||u||!o)return;let e=O(o);if(e!==`text`&&e!==`other`){l(null),h(``),y(!1);return}let t=new AbortController,r=E.current;return l(null),h(``),y(!0),J(`${k}/file?path=${encodeURIComponent(o)}`,{signal:t.signal,suppressSessionExpired:!0}).then(e=>{!t.signal.aborted&&E.current===r&&l(e)}).catch(e=>{!t.signal.aborted&&E.current===r&&(j(e)?A():h(Y(e)))}).finally(()=>{!t.signal.aborted&&E.current===r&&y(!1)}),()=>t.abort()},[k,o,u,!!n,b]),(0,X.useEffect)(()=>{let e=document.title;return document.title=n?`TexLite | ${n.project.name}`:`TexLite`,()=>{document.title=e}},[n?.project.name]);let M=a(`${k}/resource?path=${encodeURIComponent(o)}`),N=O(o),P=(0,Z.jsxs)(`div`,{className:`shared-reader-empty`,role:`status`,children:[(0,Z.jsx)(U,{size:24,className:`spin`}),t(`common.loading`)]}),F=()=>x(e=>e+1);return(0,Z.jsx)(`div`,{className:`workspace shared-reader`,"data-texlite-tooltips":`off`,children:u||!n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(re,{loading:g||u,onRefresh:F}),u?(0,Z.jsxs)(`div`,{className:`shared-reader-empty shared-reader-unavailable`,role:`alert`,children:[(0,Z.jsx)(W,{size:32}),(0,Z.jsx)(`h1`,{children:t(`viewLinks.unavailable`)}),(0,Z.jsx)(`p`,{children:t(`viewLinks.unavailableHint`)})]}):g?P:(0,Z.jsx)(`div`,{className:`shared-reader-empty`,role:`alert`,children:f})]}):(0,Z.jsx)(ie,{data:n,path:o,loading:g,error:f,onRefresh:F,sourceCursorStore:T,onOpenFile:e=>{T.reset(),C(null),s(e)},onJumpToSource:(e,t)=>{T.reset(),s(e),C({path:e,line:t,nonce:++w.current})},children:o?v?P:m?(0,Z.jsx)(`div`,{className:`shared-reader-empty`,role:`alert`,children:m}):N===`image`?(0,Z.jsx)(`div`,{className:`shared-reader-image`,children:(0,Z.jsx)(`img`,{src:M,alt:o})}):N===`pdf`?(0,Z.jsx)(X.Suspense,{fallback:P,children:(0,Z.jsx)(se,{url:M,loadingMode:`range`,target:null,onViewportLocation:ce},M)}):N===`binary`?(0,Z.jsx)(`div`,{className:`shared-reader-empty`,children:t(`viewLinks.unsupported`)}):c?.path===o&&(0,Z.jsx)(X.Suspense,{fallback:P,children:(0,Z.jsx)(oe,{path:o,content:c.content,onCursor:T.update,jumpTo:S?.path===o?S:null})}):(0,Z.jsx)(`div`,{className:`shared-reader-empty`,children:t(`viewLinks.noFile`)})})})}export{le as SharedProjectPage};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-DUEFWlB7.js";import{t}from"./useTranslation-DwkoADSz.js";import{w as n}from"./useDeletionTransitions-Ba_yhkrl.js";import{T as r}from"./sourceCursorStore-BVDvDKeP.js";import{t as i}from"./loader-circle-DKGyi5EK.js";import{t as a}from"./type-CKe1tHHo.js";import{g as o}from"./index-CPR6YZEf.js";var s=e();function c({open:e,mode:c,path:l,busy:u,error:d,result:f,onOpenChange:p}){let{t:m}=t(),h=m(c===`full`?`editor.wordCountFullHint`:`editor.wordCountSelectionHint`);return(0,s.jsxs)(o,{open:e,title:m(`editor.wordCountTitle`),description:h,onOpenChange:p,footer:(0,s.jsx)(`button`,{type:`button`,onClick:()=>p(!1),children:m(`common.close`)}),children:[l&&(0,s.jsxs)(`p`,{className:`word-count-source`,children:[m(c===`full`?`editor.wordCountFull`:`editor.wordCountSelection`),` · `,(0,s.jsx)(`code`,{children:l}),(0,s.jsx)(`a`,{href:`https://app.uio.no/ifi/texcount/`,target:`_blank`,rel:`noreferrer`,children:m(`editor.wordCountHelp`)})]}),(0,s.jsx)(`p`,{className:`word-count-template-note`,children:m(`editor.wordCountTemplateNote`)}),u&&(0,s.jsxs)(`div`,{className:`word-count-loading`,role:`status`,"aria-live":`polite`,children:[(0,s.jsx)(i,{className:`spin`,size:22}),(0,s.jsx)(`span`,{children:m(`editor.wordCountLoading`)})]}),d&&(0,s.jsx)(`p`,{className:`error dialog-error`,children:d}),f&&!u&&(0,s.jsxs)(`div`,{className:`word-count-result`,"aria-live":`polite`,children:[(0,s.jsxs)(`div`,{className:`word-count-totals`,children:[(0,s.jsxs)(`div`,{className:`word-count-total`,children:[(0,s.jsx)(r,{size:20}),(0,s.jsx)(`strong`,{children:f.totalWords.toLocaleString()}),(0,s.jsx)(`span`,{children:m(`editor.wordCountTotal`)})]}),(0,s.jsxs)(`div`,{className:`word-count-total word-count-characters`,children:[(0,s.jsx)(a,{size:20}),(0,s.jsx)(`strong`,{children:f.totalCharacters.toLocaleString()}),(0,s.jsxs)(`span`,{children:[m(`editor.wordCountCharacters`),(0,s.jsx)(`small`,{children:m(`editor.wordCountCharactersHint`)})]})]})]}),(0,s.jsxs)(`dl`,{className:`word-count-breakdown`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountText`)}),(0,s.jsxs)(`dd`,{children:[f.textWords.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountWordsUnit`,{count:f.textWords})})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountHeaders`)}),(0,s.jsxs)(`dd`,{children:[f.headerWords.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountWordsUnit`,{count:f.headerWords})})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountCaptions`)}),(0,s.jsxs)(`dd`,{children:[f.captionWords.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountWordsUnit`,{count:f.captionWords})})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountFloats`)}),(0,s.jsxs)(`dd`,{children:[f.floats.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountItemsUnit`,{count:f.floats})})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountInlineMath`)}),(0,s.jsxs)(`dd`,{children:[f.inlineMath.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountExpressionsUnit`,{count:f.inlineMath})})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountDisplayMath`)}),(0,s.jsxs)(`dd`,{children:[f.displayMath.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountExpressionsUnit`,{count:f.displayMath})})]})]}),f.files!==null&&(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:m(`editor.wordCountFiles`)}),(0,s.jsxs)(`dd`,{children:[f.files.toLocaleString(),(0,s.jsx)(`small`,{children:m(`editor.wordCountItemsUnit`,{count:f.files})})]})]})]}),f.parserErrors>0&&(0,s.jsxs)(`p`,{className:`warning word-count-warning`,children:[(0,s.jsx)(n,{size:14}),m(`editor.wordCountParserErrors`,{count:f.parserErrors})]})]})]})}export{c as WordCountDialog};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|