zidane-gui 9.0.4 → 9.1.3
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/README.md +1 -1
- package/out/main/chunks/{dev-extension-D5os9z0A.js → dev-extension-CjcEOYly.js} +10 -9
- package/out/main/chunks/extension-watch-Bk_X4gTf.js +93 -0
- package/out/main/chunks/{history-pager-DUFgTrih.js → history-pager-B5iwhWqn.js} +44 -7
- package/out/main/chunks/idle-collect-ZgTY7fw2.js +33 -0
- package/out/main/chunks/{remote-hosts-DlvE2ELX.js → remote-hosts-DmiOiwKi.js} +41 -1
- package/out/main/chunks/{session-search-sql-BrNTuwjH.js → session-search-sql-BaBnjEgm.js} +4 -4
- package/out/main/chunks/{tool-results-sql-C0MqWcQc.js → tool-results-sql-CVleIS51.js} +1 -1
- package/out/main/chunks/transcript-sql-DfsO-a4Q.js +27 -0
- package/out/main/extension-worker.js +52 -0
- package/out/main/git-watch-worker.js +21 -0
- package/out/main/history-worker.js +6 -3
- package/out/main/index.js +7677 -4252
- package/out/main/session-search-worker.js +18 -13
- package/out/main/tool-results-worker.js +18 -13
- package/out/main/update-worker.js +6 -0
- package/out/main/usage-worker.js +4 -1
- package/out/preload/index.mjs +56 -6
- package/out/renderer/assets/2CHDFZHC-B7OS2WPy.js +76 -0
- package/out/renderer/assets/43YPWK3Q-BLwohgFu.js +297 -0
- package/out/renderer/assets/45MVAN6X-DCPmrh2y.js +227 -0
- package/out/renderer/assets/46GJKBLZ-n_NiMQEY.js +362 -0
- package/out/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
- package/out/renderer/assets/63WH7YNF-B0-gnOSz.js +1519 -0
- package/out/renderer/assets/6DDU7VKX-BKAF5gyQ.js +139 -0
- package/out/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
- package/out/renderer/assets/CLQLV5VT-BIZsXon4.js +1159 -0
- package/out/renderer/assets/CUSPXG5M-Donlp74Y.js +233 -0
- package/out/renderer/assets/{CodeEditor-in2F3Rz-.js → CodeEditor-80QT2Pyq.js} +404 -744
- package/out/renderer/assets/{ComposerEditor-DzKoxH6Z.js → ComposerEditor-CXpNHoo1.js} +6 -7
- package/out/renderer/assets/D3L7O4X2-BCbmkNpB.js +194 -0
- package/out/renderer/assets/D5TW5CPZ-Bp-wetYa.js +21 -0
- package/out/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
- package/out/renderer/assets/{DiffsTab-Ceh4E5wW.js → DiffsTab-Dy8a_hwG.js} +43 -26
- package/out/renderer/assets/EGADTWYV-CqSrkc7g.js +292 -0
- package/out/renderer/assets/EOJSJZXM-BTI84tys.js +1137 -0
- package/out/renderer/assets/{EditorWorkers-Bhv2OJRb.js → EditorWorkers-Durn1REy.js} +9 -11
- package/out/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
- package/out/renderer/assets/{FileIcon-CYgGSQ59.js → FileIcon-acads6Ac.js} +1 -1
- package/out/renderer/assets/{FilesTab-DESQMqGK.js → FilesTab-h32FFVsw.js} +70 -28
- package/out/renderer/assets/G2OEIG6X-CS8YUqSL.js +519 -0
- package/out/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
- package/out/renderer/assets/GXJ2T77W-BHaQFzB4.js +445 -0
- package/out/renderer/assets/HX3UMAK7-DOOY2pSg.js +177 -0
- package/out/renderer/assets/IU7WZTP6-D7pwhQLH.js +137 -0
- package/out/renderer/assets/J5J2NR2G-SPjkbJgo.js +673 -0
- package/out/renderer/assets/JRCWTJEL-DT7JLR7k.js +419 -0
- package/out/renderer/assets/KHUP5TOH-BX0A2YHC.js +359 -0
- package/out/renderer/assets/L74FQTH5-MbDLfIZo.js +994 -0
- package/out/renderer/assets/LAV4ZXOS-ClHlsIHg.js +968 -0
- package/out/renderer/assets/LBIZYCRR-DmofT7Vk.js +715 -0
- package/out/renderer/assets/LFFXNLRS-yLLLefJM.js +377 -0
- package/out/renderer/assets/LLLWOAQD-DNhT1-qV.js +409 -0
- package/out/renderer/assets/LTYQZ5U5-BxUtiilS.js +1223 -0
- package/out/renderer/assets/NDSCUZ25-DltJ5xGa.js +83 -0
- package/out/renderer/assets/NMN3IKWL-BXUYzi9o.js +1042 -0
- package/out/renderer/assets/NMUA3R2D-CAVxt8OJ.js +1080 -0
- package/out/renderer/assets/NY5A6PPW-B3P5KUoQ.js +523 -0
- package/out/renderer/assets/OHJ2EJXK-CKyEtj37.js +85 -0
- package/out/renderer/assets/OU2GIT2H-i9HfUuBk.js +32 -0
- package/out/renderer/assets/PDMLSE6I-BnbSSXbG.js +15 -0
- package/out/renderer/assets/PJ7X32S5-Do_rplzd.js +188 -0
- package/out/renderer/assets/RLLQ44NJ-SEvjKAya.js +248 -0
- package/out/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
- package/out/renderer/assets/S6DWMCK5-CK9P5x9H.js +817 -0
- package/out/renderer/assets/STIOTUT7-KYZS5tvF.js +509 -0
- package/out/renderer/assets/SXSLPWUD-ylCpsia5.js +120 -0
- package/out/renderer/assets/TR4WJQGX-DXlqK6NQ.js +25 -0
- package/out/renderer/assets/UWRPUF3N-7_KSfEv0.js +1276 -0
- package/out/renderer/assets/VSWIZJ7B-qmPn48eQ.js +205 -0
- package/out/renderer/assets/WM7NR6YK-D4oWq6L3.js +193 -0
- package/out/renderer/assets/WXKV2YEK-DsK-bqP8.js +499 -0
- package/out/renderer/assets/XLHPVVFU-4_9lhZe2.js +56 -0
- package/out/renderer/assets/YNX532HU-C1DPijVc.js +119 -0
- package/out/renderer/assets/YUPSMAUO-0pM5w-ie.js +39 -0
- package/out/renderer/assets/ZFRCZTLK-4EIJek0V.js +150 -0
- package/out/renderer/assets/ZZDR4CN3-B_T2R-Zh.js +122 -0
- package/out/renderer/assets/andromeeda-Bx1G2cLE.js +293 -0
- package/out/renderer/assets/andromeeda-vBqMIOkk.js +293 -0
- package/out/renderer/assets/aurora-x-Cm7-xw-C.js +243 -0
- package/out/renderer/assets/aurora-x-DPl7s7lw.js +243 -0
- package/out/renderer/assets/ayu-dark-CwZzE4zG.js +207 -0
- package/out/renderer/assets/ayu-dark-DkHc-GR-.js +207 -0
- package/out/renderer/assets/ayu-light-D8NJUeg2.js +207 -0
- package/out/renderer/assets/ayu-light-DNVhSCsl.js +207 -0
- package/out/renderer/assets/ayu-mirage-C-lSBwzI.js +207 -0
- package/out/renderer/assets/ayu-mirage-JE49iZ2H.js +207 -0
- package/out/renderer/assets/catppuccin-frappe-DU1nAiyx.js +414 -0
- package/out/renderer/assets/catppuccin-frappe-DX6Q-ciL.js +414 -0
- package/out/renderer/assets/catppuccin-latte-CO9onEOF.js +414 -0
- package/out/renderer/assets/catppuccin-latte-CkSyOFfG.js +414 -0
- package/out/renderer/assets/catppuccin-macchiato-OyZDjojj.js +414 -0
- package/out/renderer/assets/catppuccin-macchiato-WINjU_Dw.js +414 -0
- package/out/renderer/assets/catppuccin-mocha-0z8-eFg0.js +414 -0
- package/out/renderer/assets/catppuccin-mocha-DRTSTdRR.js +414 -0
- package/out/renderer/assets/{core-xOIU6ifr.js → core-2jWUG3m-.js} +4466 -2537
- package/out/renderer/assets/core-COuvbqNs.js +5186 -0
- package/out/renderer/assets/{highlight.worker-gURcNJD7.js → core-Drnj1qQL.js} +404 -4454
- package/out/renderer/assets/dark-plus-BaggkchT.js +241 -0
- package/out/renderer/assets/dark-plus-Conw9IRY.js +241 -0
- package/out/renderer/assets/default-CzLFidVE.js +1890 -0
- package/out/renderer/assets/dracula-BKSZoV-6.js +227 -0
- package/out/renderer/assets/dracula-BpiXsqbq.js +227 -0
- package/out/renderer/assets/dracula-soft-BF0b4PXf.js +169 -0
- package/out/renderer/assets/dracula-soft-DIWOT7Wr.js +169 -0
- package/out/renderer/assets/engine-javascript-CtTomO8o.js +3238 -0
- package/out/renderer/assets/engine-javascript-DUvVq6Hk.js +3223 -0
- package/out/renderer/assets/engine-oniguruma-DKBWYAaE.js +482 -0
- package/out/renderer/assets/engine-oniguruma-mZf4aRKS.js +482 -0
- package/out/renderer/assets/everforest-dark-B3n4qCUZ.js +181 -0
- package/out/renderer/assets/everforest-dark-BXgth4bF.js +181 -0
- package/out/renderer/assets/everforest-light-BhaIwhYu.js +181 -0
- package/out/renderer/assets/everforest-light-cbpcbx0E.js +181 -0
- package/out/renderer/assets/{file-tabs-Cozt9Sho.js → file-tabs-DwqRIh1X.js} +10 -12
- package/out/renderer/assets/{ghostty-web-BTHoKwMc.js → ghostty-web-DnI2p8KS.js} +3 -1
- package/out/renderer/assets/github-dark-BESFF5XO.js +234 -0
- package/out/renderer/assets/github-dark-DNCSzN6m.js +234 -0
- package/out/renderer/assets/github-dark-default-DgFmzzcd.js +168 -0
- package/out/renderer/assets/github-dark-default-ffmDUf0z.js +168 -0
- package/out/renderer/assets/github-dark-dimmed-CLKTYZCg.js +225 -0
- package/out/renderer/assets/github-dark-dimmed-s1SLsKJt.js +225 -0
- package/out/renderer/assets/github-dark-high-contrast-CXehgwDU.js +225 -0
- package/out/renderer/assets/github-dark-high-contrast-KLlCEr3k.js +225 -0
- package/out/renderer/assets/github-light-U3PkvbB_.js +234 -0
- package/out/renderer/assets/github-light-default-BPzGUBgG.js +225 -0
- package/out/renderer/assets/github-light-default-xMLgS_bN.js +225 -0
- package/out/renderer/assets/github-light-high-contrast-C8D72_o0.js +225 -0
- package/out/renderer/assets/github-light-high-contrast-DQhuIFi9.js +225 -0
- package/out/renderer/assets/github-light-jtm9FPHO.js +234 -0
- package/out/renderer/assets/gruvbox-dark-hard-BAboCHnq.js +214 -0
- package/out/renderer/assets/gruvbox-dark-hard-woZR1aVf.js +214 -0
- package/out/renderer/assets/gruvbox-dark-medium-BsoEOmFF.js +214 -0
- package/out/renderer/assets/gruvbox-dark-medium-CNo7daJC.js +214 -0
- package/out/renderer/assets/gruvbox-dark-soft-CaJ_lf0b.js +214 -0
- package/out/renderer/assets/gruvbox-dark-soft-Cg271WAX.js +214 -0
- package/out/renderer/assets/gruvbox-light-hard-CEjA0x_J.js +214 -0
- package/out/renderer/assets/gruvbox-light-hard-D8Ufxp8E.js +214 -0
- package/out/renderer/assets/gruvbox-light-medium-BCS-MX7u.js +214 -0
- package/out/renderer/assets/gruvbox-light-medium-DZkNZdeM.js +214 -0
- package/out/renderer/assets/gruvbox-light-soft-CRdK2Ssn.js +214 -0
- package/out/renderer/assets/gruvbox-light-soft-DEEl98i-.js +214 -0
- package/out/renderer/assets/hastToHtml-AUrFnNH_.js +123 -0
- package/out/renderer/assets/highlight.worker-BYB12Fvh.js +1624 -0
- package/out/renderer/assets/highlights-6LT5DvBO.js +292 -0
- package/out/renderer/assets/highlights-CpZm9DAR-DaBE50nC.js +2188 -0
- package/out/renderer/assets/highlights-DmxOEap0.js +313 -0
- package/out/renderer/assets/horizon-B492K9Ky.js +165 -0
- package/out/renderer/assets/horizon-DAZuC-xh.js +165 -0
- package/out/renderer/assets/horizon-bright-D2Sfzu7E.js +165 -0
- package/out/renderer/assets/horizon-bright-tGFWGsRc.js +165 -0
- package/out/renderer/assets/houston-BuwDhoUX.js +373 -0
- package/out/renderer/assets/houston-Cp9zzZds.js +373 -0
- package/out/renderer/assets/icons-D67TrEZV.js +23 -0
- package/out/renderer/assets/{index-DkE-xvCG.js → index-BnnCv70H.js} +1852 -394
- package/out/renderer/assets/{index-DrLLItLS.css → index-C-Dal-Bp.css} +508 -44
- package/out/renderer/assets/index-DhpOdP7M.js +882 -0
- package/out/renderer/assets/kanagawa-dragon-6NLBJhOz.js +229 -0
- package/out/renderer/assets/kanagawa-dragon-BF7rCHRT.js +229 -0
- package/out/renderer/assets/kanagawa-lotus-Cj8RDQcT.js +229 -0
- package/out/renderer/assets/kanagawa-lotus-uV7FMPcj.js +229 -0
- package/out/renderer/assets/kanagawa-wave-0rvDP1ei.js +229 -0
- package/out/renderer/assets/kanagawa-wave-B6IVm0GO.js +229 -0
- package/out/renderer/assets/{kit-BUt8oFlT.js → kit-CdRTRA2T.js} +46458 -39887
- package/out/renderer/assets/langs-BtXnoosO.js +1331 -0
- package/out/renderer/assets/langs-D9nZatrh.js +1333 -0
- package/out/renderer/assets/laserwave-DXWE1WnK.js +166 -0
- package/out/renderer/assets/laserwave-JLRBtymH.js +166 -0
- package/out/renderer/assets/lazy-C1DShJVi.js +1188 -0
- package/out/renderer/assets/light-plus-DU2oMqtU.js +244 -0
- package/out/renderer/assets/light-plus-D_GZIzn-.js +244 -0
- package/out/renderer/assets/loader-BlmA-DDi.js +83 -0
- package/out/renderer/assets/loader-q6EC19QI.js +80 -0
- package/out/renderer/assets/material-theme-C0rHRk_7.js +171 -0
- package/out/renderer/assets/material-theme-CKzpgSIj.js +171 -0
- package/out/renderer/assets/material-theme-darker-LxtgP-nI.js +171 -0
- package/out/renderer/assets/material-theme-darker-q1PJSGwC.js +171 -0
- package/out/renderer/assets/material-theme-lighter-Bo7q33GI.js +171 -0
- package/out/renderer/assets/material-theme-lighter-DIrXq_cm.js +171 -0
- package/out/renderer/assets/material-theme-ocean-DBoGA257.js +171 -0
- package/out/renderer/assets/material-theme-ocean-DKw0PiZ1.js +171 -0
- package/out/renderer/assets/material-theme-palenight-C6KqY_uf.js +171 -0
- package/out/renderer/assets/material-theme-palenight-DoLm5E7H.js +171 -0
- package/out/renderer/assets/min-dark-C29HEm34.js +166 -0
- package/out/renderer/assets/min-dark-C5zOB6s9.js +166 -0
- package/out/renderer/assets/min-light-BDAdB2zx.js +166 -0
- package/out/renderer/assets/min-light-CCfylF7u.js +166 -0
- package/out/renderer/assets/monokai-CgbJVDnk.js +246 -0
- package/out/renderer/assets/monokai-hi1UnAdE.js +246 -0
- package/out/renderer/assets/night-owl-Cy8ZrWil.js +238 -0
- package/out/renderer/assets/night-owl-Pfm14M0L.js +238 -0
- package/out/renderer/assets/night-owl-light-Cr6ug2dl.js +237 -0
- package/out/renderer/assets/night-owl-light-UewpB7JV.js +237 -0
- package/out/renderer/assets/nord-C68LX7oy.js +200 -0
- package/out/renderer/assets/nord-D68iK8nx.js +200 -0
- package/out/renderer/assets/one-dark-pro-DSih0ZZj.js +196 -0
- package/out/renderer/assets/one-dark-pro-DyTT0T_G.js +196 -0
- package/out/renderer/assets/one-light--fEa3idW.js +232 -0
- package/out/renderer/assets/one-light-BzGf0rQc.js +232 -0
- package/out/renderer/assets/{patch-parse.worker-BAW1QWyk.js → patch-parse.worker-siqPY9wG.js} +24 -4
- package/out/renderer/assets/pierre-dark-1Xh1-lMo.js +4 -0
- package/out/renderer/assets/pierre-dark-7z_hCG7W.js +364 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-DjiH32kw.js +364 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-GW6g2K_K.js +364 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-LDfpPKjm.js +4 -0
- package/out/renderer/assets/pierre-dark-soft-1iBHdNO0.js +364 -0
- package/out/renderer/assets/pierre-dark-soft-C_k_gt55.js +4 -0
- package/out/renderer/assets/pierre-dark-soft-D5-n1AeJ.js +364 -0
- package/out/renderer/assets/pierre-dark-tritanopia-CeWJyYfV.js +4 -0
- package/out/renderer/assets/pierre-dark-tritanopia-ClMvjOGO.js +364 -0
- package/out/renderer/assets/pierre-dark-tritanopia-D9kXXcwP.js +364 -0
- package/out/renderer/assets/pierre-dark-vibrant-6Oqz1PbM.js +4 -0
- package/out/renderer/assets/pierre-dark-vibrant-C8yH51pK.js +364 -0
- package/out/renderer/assets/pierre-dark-vibrant-D_7rJXbX.js +364 -0
- package/out/renderer/assets/pierre-dark-yHUcpElV.js +364 -0
- package/out/renderer/assets/pierre-light-BIebL0yQ.js +4 -0
- package/out/renderer/assets/pierre-light-C34x-mcs.js +364 -0
- package/out/renderer/assets/pierre-light-C9v4GAHb.js +364 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-BufD2-1n.js +4 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-DUrvpW2C.js +364 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-VwXWNPo2.js +364 -0
- package/out/renderer/assets/pierre-light-soft-BmDnpPlM.js +364 -0
- package/out/renderer/assets/pierre-light-soft-Cd6v49hf.js +4 -0
- package/out/renderer/assets/pierre-light-soft-DqFh0kZA.js +364 -0
- package/out/renderer/assets/pierre-light-tritanopia-BVCfgdSF.js +364 -0
- package/out/renderer/assets/pierre-light-tritanopia-RkA2q6k9.js +364 -0
- package/out/renderer/assets/pierre-light-tritanopia-VrCUn-Lh.js +4 -0
- package/out/renderer/assets/pierre-light-vibrant-C5BaqWq3.js +364 -0
- package/out/renderer/assets/pierre-light-vibrant-CCrCMYrB.js +364 -0
- package/out/renderer/assets/pierre-light-vibrant-ClZHsQXl.js +4 -0
- package/out/renderer/assets/{pierre-theme-Bj5EAt1L.js → pierre-theme-DpuLJ_93.js} +1022 -913
- package/out/renderer/assets/plastic-7t7HzasC.js +207 -0
- package/out/renderer/assets/plastic-EgWoj0TX.js +207 -0
- package/out/renderer/assets/poimandres-Clm3QHf_.js +186 -0
- package/out/renderer/assets/poimandres-_9ZL-zjP.js +186 -0
- package/out/renderer/assets/red-BGLMOAQA.js +240 -0
- package/out/renderer/assets/red-C7WxuK4s.js +240 -0
- package/out/renderer/assets/rose-pine-CSYOOLQH.js +200 -0
- package/out/renderer/assets/rose-pine-DQTixAK4.js +200 -0
- package/out/renderer/assets/rose-pine-dawn-BsExWFpO.js +200 -0
- package/out/renderer/assets/rose-pine-dawn-DtnCKB3V.js +200 -0
- package/out/renderer/assets/rose-pine-moon-CIVzFPCR.js +200 -0
- package/out/renderer/assets/rose-pine-moon-DUVYttUm.js +200 -0
- package/out/renderer/assets/shiki-Ci4cdHsM-C6d-uTVf.js +681 -0
- package/out/renderer/assets/shiki-RupN-xqP.js +651 -0
- package/out/renderer/assets/slack-dark-DqfBLzDN.js +156 -0
- package/out/renderer/assets/slack-dark-PDVLPqBV.js +156 -0
- package/out/renderer/assets/slack-ochin-BXb20b9s.js +167 -0
- package/out/renderer/assets/slack-ochin-Bkl8Akj-.js +167 -0
- package/out/renderer/assets/snazzy-light-B-XgRQqH.js +169 -0
- package/out/renderer/assets/snazzy-light-B_Pnr_t3.js +169 -0
- package/out/renderer/assets/solarized-dark-BExlwCgF.js +256 -0
- package/out/renderer/assets/solarized-dark-BWOkBqBk.js +256 -0
- package/out/renderer/assets/solarized-light-B0LC-9ef.js +256 -0
- package/out/renderer/assets/solarized-light-B7xKmc3j.js +256 -0
- package/out/renderer/assets/stream-tokenizer-DK9xp5M5-BkzgPytU.js +2641 -0
- package/out/renderer/assets/stream-tokenizer-DLDzyMrK.js +131 -0
- package/out/renderer/assets/synthwave-84-Bz5LYLQI.js +766 -0
- package/out/renderer/assets/synthwave-84-DnB997dV.js +766 -0
- package/out/renderer/assets/themes-B1aebwax.js +323 -0
- package/out/renderer/assets/themes-KOxcu5sY.js +322 -0
- package/out/renderer/assets/tokyo-night-BFQDXQF9.js +343 -0
- package/out/renderer/assets/tokyo-night-BKV2xFQO.js +343 -0
- package/out/renderer/assets/{useDetachCleanup-Bb7k1ePf.js → useDetachCleanup-BXvhEVk-.js} +95 -51
- package/out/renderer/assets/{useFolderChanges-B4X4n6NV.js → useFolderChanges-BHQktE6l.js} +406 -242
- package/out/renderer/assets/utils-BcG7Lqcy.js +90 -0
- package/out/renderer/assets/{vendor-BvslLX9q.js → vendor-BpwX-s_O.js} +16835 -16799
- package/out/renderer/assets/{vendor-editor-Bx3dRdBD.js → vendor-editor-Cx3SvGyZ.js} +2 -2
- package/out/renderer/assets/{vendor-motion-BLeNAEjH.js → vendor-motion-BgQeucLF.js} +3 -3
- package/out/renderer/assets/{vendor-react-DltKc0Ts.js → vendor-react-bPTwWURR.js} +28 -12
- package/out/renderer/assets/vesper-BVtJs6jF.js +173 -0
- package/out/renderer/assets/vesper-BXSaHQeX.js +173 -0
- package/out/renderer/assets/vitesse-black-Bk4nGSr_.js +388 -0
- package/out/renderer/assets/vitesse-black-DjBh7jMr.js +388 -0
- package/out/renderer/assets/vitesse-dark-BSeRY0TR.js +388 -0
- package/out/renderer/assets/vitesse-dark-Czy_Ejt3.js +388 -0
- package/out/renderer/assets/vitesse-light-BpMpGmeY.js +388 -0
- package/out/renderer/assets/vitesse-light-Cv09MZGR.js +388 -0
- package/out/renderer/assets/worker-CswOd5_T.js +2367 -0
- package/out/renderer/index.html +8 -9
- package/package.json +13 -6
- package/out/main/chunks/transcript-sql-DbZ-a5wb.js +0 -43
- package/out/renderer/assets/index-DogoEzwx.js +0 -10868
- package/out/renderer/assets/vendor-shiki-ba8IDo5s.js +0 -459
- package/out/renderer/assets/worker-DNIQ0wG8.js +0 -12761
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports, r as reactExports } from "./vendor-react-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as useFilesLabels, K as KeyHint, H as languageFor, R as RowActionsMenu, J as rangeLabel, L as serializeCodeSnippet, M as attachmentName, N as serializeReviewComment, g as useEditorEnvironment, O as excerptFor, Z as ZoomableImage, Q as MediaNav, T as useEditorPrefs, h as useFilesHost, y as matchRanges, U as Tooltip, V as IconButton, j as filesRootOf } from "./kit-
|
|
6
|
-
import { F as FileIcon, T as TreeChevron } from "./FileIcon-
|
|
1
|
+
import { j as jsxRuntimeExports, r as reactExports } from "./vendor-react-bPTwWURR.js";
|
|
2
|
+
import { a8 as SPLIT_WITH_NEWLINES, a9 as getHunkSideStartBoundary, aa as getHunkSideEndBoundary, ab as COMMIT_METADATA_SPLIT, ac as GIT_DIFF_FILE_BREAK_REGEX, ad as FILENAME_HEADER_REGEX, ae as INDEX_LINE_METADATA, af as cleanLastNewline, ag as Diff, G as createHastElement, ah as createTextNodeElement, ai as createIconElement, aj as hasTrailingContextMismatch, ak as getExpandedRegion, al as getTrailingExpandedRegion, D as DEFAULT_THEMES, am as areDiffTargetsEqual, an as areDiffRenderOptionsEqual, ao as isDiffPlainText, O as isHandledWorkerPoolError, ap as DEFAULT_EXPANDED_REGION, a7 as DEFAULT_TOKENIZE_MAX_LENGTH, I as getSharedHighlighter, v as getHighlighterIfLoaded, H as HighlighterDisposedError, y as DEFAULT_RENDER_RANGE, z as areThemesAttached, B as areLanguagesAttached, aq as renderDiffWithHighlighter, ar as iterateOverDiff, as as getTrailingContextRangeSize, E as createGutterGap, J as createGutterWrapper, F as createGutterItem, w as getFiletypeFromFileName, K as EMPTY_LINE_ANNOTATIONS, L as areThemesEqual, N as EMPTY_RENDER_RANGE, M as getThemes, at as isAdditionLineRenderable, au as getNearestRenderableAdditionLine, av as getHunkAdditionLineRange, Q as CUSTOM_HEADER_SLOT_ID, S as HEADER_PREFIX_SLOT_ID, T as HEADER_FILENAME_SUFFIX_SLOT_ID, U as HEADER_METADATA_SLOT_ID, aw as areFilesEqual, Z as getVirtualFileHeaderRegion, ax as getLeadingHunkSeparatorLayout, ay as getTrailingHunkSeparatorLayout, _ as getVirtualFilePaddingBottom, X as computeVirtualFileMetrics, Y as getVirtualFileHeaderHeight, $ as WorkerPoolContext, a0 as DIFFS_TAG_NAME, a6 as VIRTUALIZER_CONFIG, a4 as DIFFS_UNSAFE_CSS, P as PREFERRED_HIGHLIGHTER, a5 as DIFFS_HOST_STYLE } from "./pierre-theme-DpuLJ_93.js";
|
|
3
|
+
import { ab as cloneFileDiffMetadata, g as getLineAnnotationName, b as applyLineTextWithNewline, h as createAnnotationElement, l as getHighlighterOptions, r as resolvePreferredHighlighter, c as areRenderRangesEqual, i as isDefaultRenderRange, m as createPreElement, k as createContentColumn, e as shouldRenderFileAnnotations, f as getFileAnnotations, j as createFileHeaderElement, n as shouldUseTokenTransformer, R as ResizeManager, I as InteractionManager, p as pluckInteractionOptions, o as resolveEditSessionSlotName, w as writeEditSessionAnnotations, a2 as dequeueRender, t as prerenderHTMLIfNecessary, q as adoptEditSessionAnnotations, a1 as cloneHunks, a3 as queueRender, v as createAnnotationWrapperNode, x as createGutterUtilityContentNode, J as isStyleNode, S as SVGSpriteSheet, y as createUnsafeCSSStyleNode, z as wrapUnsafeCSS, A as getMeasuredScrollbarGutter, B as upsertHostThemeStyle, C as wrapThemeCSS, D as patchScrollbarGutterSize, E as isSafari, H as guardWebKitScrollDuringRebuild, G as getOrCreateCodeNode, K as arePrePropertiesEqual, L as setPreNodeProperties, M as areObjectsEqual, O as includesFileAnnotations, N as areOptionsEqual, P as FILE_ANNOTATION_DOM_KEY, ac as MergeConflictSlotStyles, Q as GutterUtilitySlotStyles, T as useVirtualizer, U as useCreateEditor, V as useStableCallback, W as useForceUpdate, X as useNextRenderData, Y as noopRender, a as areFileTargetsEqual, Z as templateRender, a9 as Virtualizer, a5 as useDetachCleanup, a6 as revealOnHighlight, a7 as scrollReachOnRender } from "./useDetachCleanup-BXvhEVk-.js";
|
|
4
|
+
import { h as hastToHtml } from "./hastToHtml-AUrFnNH_.js";
|
|
5
|
+
import { i as useFilesLabels, K as KeyHint, H as languageFor, R as RowActionsMenu, J as rangeLabel, L as serializeCodeSnippet, M as attachmentName, N as serializeReviewComment, g as useEditorEnvironment, O as excerptFor, Z as ZoomableImage, Q as MediaNav, T as useEditorPrefs, h as useFilesHost, y as matchRanges, U as Tooltip, V as IconButton, j as filesRootOf } from "./kit-CdRTRA2T.js";
|
|
6
|
+
import { F as FileIcon, T as TreeChevron } from "./FileIcon-acads6Ac.js";
|
|
7
7
|
const CACHE_KEY_VERSION = 1;
|
|
8
8
|
function composeCacheKey(scope, ...segments) {
|
|
9
9
|
return `ck${CACHE_KEY_VERSION}:${JSON.stringify([scope, ...segments])}`;
|
|
@@ -25,6 +25,8 @@ function hydratePartialDiff(type, fileDiff, files) {
|
|
|
25
25
|
targetFileDiff.isPartial = false;
|
|
26
26
|
targetFileDiff.deletionLines = lines;
|
|
27
27
|
targetFileDiff.additionLines = lines;
|
|
28
|
+
targetFileDiff.deletionCharacterCount = newFile.contents.length;
|
|
29
|
+
targetFileDiff.additionCharacterCount = newFile.contents.length;
|
|
28
30
|
setHydratedCacheKey(targetFileDiff, null, newFile);
|
|
29
31
|
return targetFileDiff;
|
|
30
32
|
}
|
|
@@ -41,6 +43,8 @@ function hydrateTwoSidedFileDiff(fileDiff, oldFile, newFile) {
|
|
|
41
43
|
fileDiff.isPartial = false;
|
|
42
44
|
fileDiff.deletionLines = deletionLines;
|
|
43
45
|
fileDiff.additionLines = additionLines;
|
|
46
|
+
fileDiff.deletionCharacterCount = oldFile.contents.length;
|
|
47
|
+
fileDiff.additionCharacterCount = newFile.contents.length;
|
|
44
48
|
setHydratedCacheKey(fileDiff, oldFile, newFile);
|
|
45
49
|
return fileDiff;
|
|
46
50
|
}
|
|
@@ -396,6 +400,8 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
396
400
|
isPartial,
|
|
397
401
|
additionLines: !isPartial && oldFile != null && newFile != null ? splitFileContents(newFile.contents) : [],
|
|
398
402
|
deletionLines: !isPartial && oldFile != null && newFile != null ? splitFileContents(oldFile.contents) : [],
|
|
403
|
+
additionCharacterCount: !isPartial && oldFile != null && newFile != null ? newFile.contents.length : 0,
|
|
404
|
+
deletionCharacterCount: !isPartial && oldFile != null && newFile != null ? oldFile.contents.length : 0,
|
|
399
405
|
cacheKey: maybeDetachOptionalString(cacheKey)
|
|
400
406
|
};
|
|
401
407
|
if (currentFile.additionLines.length === 1 && newFile?.contents === "") currentFile.additionLines.length = 0;
|
|
@@ -501,7 +507,10 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
501
507
|
}
|
|
502
508
|
additionLineIndex++;
|
|
503
509
|
parsedAdditionLines++;
|
|
504
|
-
if (isPartial)
|
|
510
|
+
if (isPartial) {
|
|
511
|
+
currentFile.additionLines.push(line);
|
|
512
|
+
currentFile.additionCharacterCount += line.length;
|
|
513
|
+
}
|
|
505
514
|
currentContent.additions++;
|
|
506
515
|
additionLines++;
|
|
507
516
|
lastLineType = "addition";
|
|
@@ -514,7 +523,10 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
514
523
|
}
|
|
515
524
|
deletionLineIndex++;
|
|
516
525
|
parsedDeletionLines++;
|
|
517
|
-
if (isPartial)
|
|
526
|
+
if (isPartial) {
|
|
527
|
+
currentFile.deletionLines.push(line);
|
|
528
|
+
currentFile.deletionCharacterCount += line.length;
|
|
529
|
+
}
|
|
518
530
|
currentContent.deletions++;
|
|
519
531
|
deletionLines++;
|
|
520
532
|
lastLineType = "deletion";
|
|
@@ -532,6 +544,8 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
532
544
|
if (isPartial) {
|
|
533
545
|
currentFile.deletionLines.push(line);
|
|
534
546
|
currentFile.additionLines.push(line);
|
|
547
|
+
currentFile.deletionCharacterCount += line.length;
|
|
548
|
+
currentFile.additionCharacterCount += line.length;
|
|
535
549
|
}
|
|
536
550
|
currentContent.lines++;
|
|
537
551
|
lastLineType = "context";
|
|
@@ -543,11 +557,21 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
543
557
|
else if (lastLineType === "addition") hunkData.noEOFCRAdditions = true;
|
|
544
558
|
if (isPartial && (lastLineType === "addition" || lastLineType === "context")) {
|
|
545
559
|
const lastIndex = currentFile.additionLines.length - 1;
|
|
546
|
-
if (lastIndex >= 0)
|
|
560
|
+
if (lastIndex >= 0) {
|
|
561
|
+
const line = currentFile.additionLines[lastIndex];
|
|
562
|
+
const cleanedLine = cleanLastNewline(line);
|
|
563
|
+
currentFile.additionLines[lastIndex] = cleanedLine;
|
|
564
|
+
currentFile.additionCharacterCount += cleanedLine.length - line.length;
|
|
565
|
+
}
|
|
547
566
|
}
|
|
548
567
|
if (isPartial && (lastLineType === "deletion" || lastLineType === "context")) {
|
|
549
568
|
const lastIndex = currentFile.deletionLines.length - 1;
|
|
550
|
-
if (lastIndex >= 0)
|
|
569
|
+
if (lastIndex >= 0) {
|
|
570
|
+
const line = currentFile.deletionLines[lastIndex];
|
|
571
|
+
const cleanedLine = cleanLastNewline(line);
|
|
572
|
+
currentFile.deletionLines[lastIndex] = cleanedLine;
|
|
573
|
+
currentFile.deletionCharacterCount += cleanedLine.length - line.length;
|
|
574
|
+
}
|
|
551
575
|
}
|
|
552
576
|
}
|
|
553
577
|
}
|
|
@@ -1360,6 +1384,8 @@ function recomputeDiffHunks(diff, parseDiffOptions) {
|
|
|
1360
1384
|
unifiedLineCount: recomputed.unifiedLineCount,
|
|
1361
1385
|
additionLines: recomputed.additionLines,
|
|
1362
1386
|
deletionLines: recomputed.deletionLines,
|
|
1387
|
+
additionCharacterCount: recomputed.additionCharacterCount,
|
|
1388
|
+
deletionCharacterCount: recomputed.deletionCharacterCount,
|
|
1363
1389
|
type: recomputed.type
|
|
1364
1390
|
};
|
|
1365
1391
|
}
|
|
@@ -1378,7 +1404,7 @@ function hasOnlyBlankAdditionContents(additionLines) {
|
|
|
1378
1404
|
function shouldTopAlignAdditionRecompute(diff, additionLines) {
|
|
1379
1405
|
return additionLines.length > 0 && additionLines.length < diff.deletionLines.length && hasOnlyBlankAdditionContents(additionLines);
|
|
1380
1406
|
}
|
|
1381
|
-
function recomputeTopAlignedAdditionDiff(diff, additionLines, parseDiffOptions) {
|
|
1407
|
+
function recomputeTopAlignedAdditionDiff(diff, additionLines, additionCharacterCount, parseDiffOptions) {
|
|
1382
1408
|
const deletionContents = diff.deletionLines.join("");
|
|
1383
1409
|
const additionSentinel = buildTopAlignedAdditionSentinel(additionLines.length, deletionContents);
|
|
1384
1410
|
const recomputed = parseDiffFromFile({
|
|
@@ -1395,15 +1421,17 @@ function recomputeTopAlignedAdditionDiff(diff, additionLines, parseDiffOptions)
|
|
|
1395
1421
|
unifiedLineCount: recomputed.unifiedLineCount,
|
|
1396
1422
|
additionLines,
|
|
1397
1423
|
deletionLines: recomputed.deletionLines,
|
|
1424
|
+
additionCharacterCount,
|
|
1425
|
+
deletionCharacterCount: recomputed.deletionCharacterCount,
|
|
1398
1426
|
type: recomputed.type
|
|
1399
1427
|
};
|
|
1400
1428
|
}
|
|
1401
1429
|
function recomputeEmptyDocumentDiff(diff, parseDiffOptions) {
|
|
1402
|
-
return recomputeTopAlignedAdditionDiff(diff, [""], parseDiffOptions);
|
|
1430
|
+
return recomputeTopAlignedAdditionDiff(diff, [""], 0, parseDiffOptions);
|
|
1403
1431
|
}
|
|
1404
1432
|
function recomputeDiffHunksForEdit(diff, parseDiffOptions) {
|
|
1405
1433
|
if (diff.additionLines.length === 0) return recomputeEmptyDocumentDiff(diff, parseDiffOptions);
|
|
1406
|
-
if (shouldTopAlignAdditionRecompute(diff, diff.additionLines)) return recomputeTopAlignedAdditionDiff(diff, diff.additionLines, parseDiffOptions);
|
|
1434
|
+
if (shouldTopAlignAdditionRecompute(diff, diff.additionLines)) return recomputeTopAlignedAdditionDiff(diff, diff.additionLines, diff.additionCharacterCount, parseDiffOptions);
|
|
1407
1435
|
const additionLines = diff.additionLines;
|
|
1408
1436
|
const recomputed = recomputeDiffHunks(diff, parseDiffOptions);
|
|
1409
1437
|
preserveTrailingEditorBlankLine(recomputed, additionLines);
|
|
@@ -1996,7 +2024,6 @@ var DiffHunksRenderer = class {
|
|
|
1996
2024
|
onRenderUpdate;
|
|
1997
2025
|
workerManager;
|
|
1998
2026
|
__id = `diff-hunks-renderer:${++instanceId$2}`;
|
|
1999
|
-
highlighter;
|
|
2000
2027
|
diff;
|
|
2001
2028
|
expandedHunks = /* @__PURE__ */ new Map();
|
|
2002
2029
|
deletionAnnotations = {};
|
|
@@ -2011,7 +2038,6 @@ var DiffHunksRenderer = class {
|
|
|
2011
2038
|
this.annotationSlotName = annotationSlotName;
|
|
2012
2039
|
this.onRenderUpdate = onRenderUpdate;
|
|
2013
2040
|
this.workerManager = workerManager;
|
|
2014
|
-
if (workerManager?.isWorkingPool() !== true) this.highlighter = areThemesAttached(options.theme ?? DEFAULT_THEMES) ? getHighlighterIfLoaded() : void 0;
|
|
2015
2041
|
}
|
|
2016
2042
|
cleanUp() {
|
|
2017
2043
|
this.endEditSession();
|
|
@@ -2021,7 +2047,6 @@ var DiffHunksRenderer = class {
|
|
|
2021
2047
|
this.onRenderUpdate = void 0;
|
|
2022
2048
|
}
|
|
2023
2049
|
recycle() {
|
|
2024
|
-
this.highlighter = void 0;
|
|
2025
2050
|
this.diff = void 0;
|
|
2026
2051
|
if (this.editSessionActive) {
|
|
2027
2052
|
if (this.renderCache != null) this.renderCache.renderRange = void 0;
|
|
@@ -2107,7 +2132,9 @@ var DiffHunksRenderer = class {
|
|
|
2107
2132
|
workerManager.evictDiffFromCache(diff.cacheKey);
|
|
2108
2133
|
return workerManager.primeDiffHighlightCache(diff).then(() => {
|
|
2109
2134
|
this.applyRefreshedResult(diff, workerManager.getDiffResultCache(diff));
|
|
2110
|
-
}).catch((error) =>
|
|
2135
|
+
}).catch((error) => {
|
|
2136
|
+
if (!isHandledWorkerPoolError(error)) this.onHighlightError(error);
|
|
2137
|
+
});
|
|
2111
2138
|
}
|
|
2112
2139
|
return this.asyncHighlight(diff).then((fresh) => this.applyRefreshedResult(diff, fresh)).catch((error) => this.onHighlightError(error));
|
|
2113
2140
|
}
|
|
@@ -2203,6 +2230,7 @@ var DiffHunksRenderer = class {
|
|
|
2203
2230
|
const previous = diff.additionLines[line] ?? "";
|
|
2204
2231
|
if (previous !== text) {
|
|
2205
2232
|
diff.additionLines[line] = text;
|
|
2233
|
+
diff.additionCharacterCount += text.length - previous.length;
|
|
2206
2234
|
changedAdditionLines.push(line);
|
|
2207
2235
|
previousAdditionLines.set(line, previous);
|
|
2208
2236
|
if (!dirtyLines.has(line)) hastLines[line] = createPlainAdditionLineElement(line, cleanLastNewline(text));
|
|
@@ -2216,7 +2244,9 @@ var DiffHunksRenderer = class {
|
|
|
2216
2244
|
const prevLine = canSyncDiffLine ? diff.additionLines[line] ?? "" : "";
|
|
2217
2245
|
const prevText = cleanLastNewline(prevLine);
|
|
2218
2246
|
if (pendingStructuralRows == null && canSyncDiffLine && changedDocumentLines?.has(line) !== true) {
|
|
2219
|
-
|
|
2247
|
+
const nextLine = applyLineTextWithNewline(prevLine, lineText);
|
|
2248
|
+
diff.additionLines[line] = nextLine;
|
|
2249
|
+
diff.additionCharacterCount += nextLine.length - prevLine.length;
|
|
2220
2250
|
if (prevText !== lineText) {
|
|
2221
2251
|
changedAdditionLines.push(line);
|
|
2222
2252
|
previousAdditionLines.set(line, prevLine);
|
|
@@ -2267,7 +2297,7 @@ var DiffHunksRenderer = class {
|
|
|
2267
2297
|
this.applyRecomputePreservingSessionType(diff, recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions));
|
|
2268
2298
|
regionsChanged = true;
|
|
2269
2299
|
} else if (shouldTopAlignAdditionRecompute(diff, diff.additionLines)) {
|
|
2270
|
-
this.applyRecomputePreservingSessionType(diff, recomputeTopAlignedAdditionDiff(diff, diff.additionLines, this.options.parseDiffOptions));
|
|
2300
|
+
this.applyRecomputePreservingSessionType(diff, recomputeTopAlignedAdditionDiff(diff, diff.additionLines, diff.additionCharacterCount, this.options.parseDiffOptions));
|
|
2271
2301
|
regionsChanged = true;
|
|
2272
2302
|
} else {
|
|
2273
2303
|
const change = applySessionChangedLines(diff, changedAdditionLines, this.options.parseDiffOptions, previousAdditionLines);
|
|
@@ -2291,7 +2321,9 @@ var DiffHunksRenderer = class {
|
|
|
2291
2321
|
const result = renderCache?.result;
|
|
2292
2322
|
if (diff.isPartial) throw new Error("Could not apply document change for partial diff");
|
|
2293
2323
|
const { additionLines: previousAdditionLines } = diff;
|
|
2294
|
-
|
|
2324
|
+
const { lines, characterCount } = getEditorDocumentLines(textDocument);
|
|
2325
|
+
diff.additionLines = lines;
|
|
2326
|
+
diff.additionCharacterCount = characterCount;
|
|
2295
2327
|
if (result != null) result.code.additionLines = realignAdditionHastLines(previousAdditionLines, diff.additionLines, result.code.additionLines, textDocument);
|
|
2296
2328
|
if (diff.additionLines.length <= 1 && diff.additionLines.join("") === "") {
|
|
2297
2329
|
this.applyRecomputePreservingSessionType(diff, recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions));
|
|
@@ -2307,7 +2339,7 @@ var DiffHunksRenderer = class {
|
|
|
2307
2339
|
const { parseDiffOptions } = this.options;
|
|
2308
2340
|
const rawLines = diff.additionLines;
|
|
2309
2341
|
if (shouldTopAlignAdditionRecompute(diff, rawLines)) {
|
|
2310
|
-
this.applyRecomputePreservingSessionType(diff, recomputeTopAlignedAdditionDiff(diff, rawLines, parseDiffOptions));
|
|
2342
|
+
this.applyRecomputePreservingSessionType(diff, recomputeTopAlignedAdditionDiff(diff, rawLines, diff.additionCharacterCount, parseDiffOptions));
|
|
2311
2343
|
return;
|
|
2312
2344
|
}
|
|
2313
2345
|
this.applyExpansionRemap(rebuildSessionHunks(diff, parseDiffOptions, (index) => previousAdditionLines[index]));
|
|
@@ -2364,12 +2396,11 @@ var DiffHunksRenderer = class {
|
|
|
2364
2396
|
useCSSClasses
|
|
2365
2397
|
};
|
|
2366
2398
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2399
|
+
initializeHighlighter() {
|
|
2400
|
+
return getSharedHighlighter(getHighlighterOptions(this.computedLangs, {
|
|
2369
2401
|
theme: this.getLocalHighlightTheme(),
|
|
2370
|
-
preferredHighlighter: this.workerManager
|
|
2402
|
+
preferredHighlighter: resolvePreferredHighlighter(this.workerManager, this.options)
|
|
2371
2403
|
}));
|
|
2372
|
-
return this.highlighter;
|
|
2373
2404
|
}
|
|
2374
2405
|
hydrate(diff) {
|
|
2375
2406
|
if (diff == null) return;
|
|
@@ -2386,13 +2417,24 @@ var DiffHunksRenderer = class {
|
|
|
2386
2417
|
result: massiveDiff ? void 0 : cache?.result,
|
|
2387
2418
|
renderRange: void 0
|
|
2388
2419
|
};
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2420
|
+
const workerManager = this.getHighlightWorkerManager(diff);
|
|
2421
|
+
if (workerManager != null) {
|
|
2422
|
+
if (this.renderCache.result == null && !massiveDiff) workerManager.highlightDiffAST(this, this.diff);
|
|
2423
|
+
} else if (getHighlighterIfLoaded({ theme: this.getLocalHighlightTheme() }) == null) {
|
|
2392
2424
|
this.computedLangs = getDiffLanguages(diff);
|
|
2393
|
-
this.initializeHighlighter()
|
|
2425
|
+
this.initializeHighlighter().catch((error) => {
|
|
2426
|
+
if (!(error instanceof HighlighterDisposedError)) this.onHighlightError(error);
|
|
2427
|
+
});
|
|
2394
2428
|
}
|
|
2395
2429
|
}
|
|
2430
|
+
getHighlightWorkerManager(diff) {
|
|
2431
|
+
const { editSessionActive, workerManager } = this;
|
|
2432
|
+
return !editSessionActive && workerManager?.isWorkingPool() === true && !workerManager.shouldHighlightOnMainThread(diff) ? workerManager : void 0;
|
|
2433
|
+
}
|
|
2434
|
+
cacheHighlightResult(diff, renderResult) {
|
|
2435
|
+
const { editSessionActive, workerManager } = this;
|
|
2436
|
+
if (!editSessionActive && workerManager?.isWorkingPool() === true) workerManager.setDiffResultCache(diff.cacheKey, renderResult);
|
|
2437
|
+
}
|
|
2396
2438
|
getLocalHighlightTheme() {
|
|
2397
2439
|
return this.workerManager?.getDiffRenderOptions().theme ?? this.options.theme ?? DEFAULT_THEMES;
|
|
2398
2440
|
}
|
|
@@ -2453,10 +2495,10 @@ var DiffHunksRenderer = class {
|
|
|
2453
2495
|
canRenderDiff(diff, options, forcePlainText) {
|
|
2454
2496
|
const { renderCache } = this;
|
|
2455
2497
|
if (renderCache == null || areDiffTargetsEqual(renderCache.diff, diff)) return true;
|
|
2456
|
-
if (forcePlainText) return renderCache.result == null && renderCache.hydrated !== true || this.workerManager?.isWorkingPool() === true
|
|
2498
|
+
if (forcePlainText) return renderCache.result == null && renderCache.hydrated !== true || this.workerManager?.isWorkingPool() === true && !this.workerManager.shouldHighlightOnMainThread(diff) || getHighlighterIfLoaded({ theme: options.theme }) != null;
|
|
2457
2499
|
if (renderCache.result == null && renderCache.hydrated !== true) return true;
|
|
2458
|
-
if (
|
|
2459
|
-
return
|
|
2500
|
+
if (this.getHighlightWorkerManager(diff) != null) return !renderCache.highlighted;
|
|
2501
|
+
return getHighlighterIfLoaded({ theme: options.theme }) != null;
|
|
2460
2502
|
}
|
|
2461
2503
|
renderDiff(diff = this.diff, renderRange = DEFAULT_RENDER_RANGE) {
|
|
2462
2504
|
this.diff = diff;
|
|
@@ -2488,24 +2530,26 @@ var DiffHunksRenderer = class {
|
|
|
2488
2530
|
const canRenderDiff = this.canRenderDiff(diff, options, forcePlainText);
|
|
2489
2531
|
const newContent = !areDiffTargetsEqual(diff, this.renderCache.diff);
|
|
2490
2532
|
const newRenderRange = !areRenderRangesEqual(this.renderCache.renderRange, renderRange);
|
|
2491
|
-
|
|
2533
|
+
const workerManager = this.getHighlightWorkerManager(diff);
|
|
2534
|
+
if (workerManager != null) {
|
|
2492
2535
|
const preserveHydratedContent = this.renderCache.result == null && this.renderCache.highlighted && !forcePlainText && !newContent && isDefaultRenderRange(renderRange);
|
|
2493
2536
|
if (canRenderDiff && !preserveHydratedContent && (forcePlainText || this.renderCache.result == null || !this.renderCache.highlighted && (newContent || newRenderRange))) {
|
|
2494
2537
|
this.renderCache.diff = diff;
|
|
2495
2538
|
this.renderCache.options = options;
|
|
2496
2539
|
this.renderCache.highlighted = false;
|
|
2497
|
-
if (this.renderCache.result == null || newContent || newRenderRange || forceHighlight) this.renderCache.result =
|
|
2540
|
+
if (this.renderCache.result == null || newContent || newRenderRange || forceHighlight) this.renderCache.result = workerManager.getPlainDiffAST(diff, renderRange.startingLine, renderRange.totalLines, isDefaultRenderRange(renderRange) ? true : expandUnchanged ? true : this.expandedHunks, collapsedContextThreshold);
|
|
2498
2541
|
this.renderCache.renderRange = renderRange;
|
|
2499
2542
|
}
|
|
2500
|
-
if (!forcePlainText && hasContent && (!this.renderCache.highlighted || forceHighlight))
|
|
2543
|
+
if (!forcePlainText && hasContent && (!this.renderCache.highlighted || forceHighlight)) workerManager.highlightDiffAST(this, diff);
|
|
2501
2544
|
} else {
|
|
2502
2545
|
this.computedLangs = getDiffLanguages(diff);
|
|
2503
|
-
|
|
2504
|
-
const hasThemes =
|
|
2505
|
-
const hasLangs =
|
|
2546
|
+
const highlighter = getHighlighterIfLoaded();
|
|
2547
|
+
const hasThemes = highlighter != null && areThemesAttached(options.theme, highlighter);
|
|
2548
|
+
const hasLangs = highlighter != null && areLanguagesAttached(this.computedLangs, highlighter);
|
|
2506
2549
|
const canHighlight = !forcePlainText && hasLangs;
|
|
2507
|
-
|
|
2508
|
-
|
|
2550
|
+
const lazyLineAST = Number.isFinite(renderRange.totalLines);
|
|
2551
|
+
if (canRenderDiff && highlighter != null && hasThemes && (forceHighlight || forcePlainText || !this.renderCache.highlighted && canHighlight || this.renderCache.result == null)) {
|
|
2552
|
+
const { result, options: options2 } = this.renderDiffWithHighlighter(diff, highlighter, forcePlainText || !hasLangs, lazyLineAST);
|
|
2509
2553
|
this.renderCache = {
|
|
2510
2554
|
diff,
|
|
2511
2555
|
options: options2,
|
|
@@ -2513,16 +2557,26 @@ var DiffHunksRenderer = class {
|
|
|
2513
2557
|
result,
|
|
2514
2558
|
renderRange: void 0
|
|
2515
2559
|
};
|
|
2560
|
+
if (canHighlight) this.cacheHighlightResult(diff, {
|
|
2561
|
+
result,
|
|
2562
|
+
options: options2
|
|
2563
|
+
});
|
|
2516
2564
|
}
|
|
2517
|
-
if (!hasThemes || !forcePlainText && !hasLangs) this.asyncHighlight(diff).then(({ result, options: options2 }) => {
|
|
2565
|
+
if (!hasThemes || !forcePlainText && !hasLangs) this.asyncHighlight(diff, lazyLineAST).then(({ result, options: options2 }) => {
|
|
2566
|
+
if (!forcePlainText) this.cacheHighlightResult(diff, {
|
|
2567
|
+
result,
|
|
2568
|
+
options: options2
|
|
2569
|
+
});
|
|
2518
2570
|
this.applyHighlightResult(diff, result, options2, !forcePlainText);
|
|
2571
|
+
}).catch((error) => {
|
|
2572
|
+
if (!(error instanceof HighlighterDisposedError)) this.onHighlightError(error);
|
|
2519
2573
|
});
|
|
2520
2574
|
}
|
|
2521
2575
|
return this.renderCache.result != null ? this.processDiffResult(this.renderCache.diff, renderRange, this.renderCache.result) : void 0;
|
|
2522
2576
|
}
|
|
2523
2577
|
async asyncRender(diff, renderRange = DEFAULT_RENDER_RANGE) {
|
|
2524
2578
|
this.diff = diff;
|
|
2525
|
-
const { result } = await this.asyncHighlight(diff);
|
|
2579
|
+
const { result } = await this.asyncHighlight(diff, Number.isFinite(renderRange.totalLines));
|
|
2526
2580
|
return this.processDiffResult(diff, renderRange, result);
|
|
2527
2581
|
}
|
|
2528
2582
|
createPreElement(split, totalLines, customProperties) {
|
|
@@ -2538,19 +2592,21 @@ var DiffHunksRenderer = class {
|
|
|
2538
2592
|
customProperties
|
|
2539
2593
|
});
|
|
2540
2594
|
}
|
|
2541
|
-
async asyncHighlight(diff) {
|
|
2595
|
+
async asyncHighlight(diff, lazyLineAST = false) {
|
|
2542
2596
|
const forcePlainText = isDiffMassive(diff, this.getTokenizeMaxLength());
|
|
2543
2597
|
this.computedLangs = forcePlainText ? ["text"] : getDiffLanguages(diff);
|
|
2544
|
-
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2547
|
-
|
|
2598
|
+
let highlighter = getHighlighterIfLoaded();
|
|
2599
|
+
const hasThemes = highlighter != null && areThemesAttached(this.getLocalHighlightTheme(), highlighter);
|
|
2600
|
+
const hasLangs = forcePlainText || highlighter != null && areLanguagesAttached(this.computedLangs, highlighter);
|
|
2601
|
+
if (highlighter == null || !hasThemes || !hasLangs) highlighter = await this.initializeHighlighter();
|
|
2602
|
+
return this.renderDiffWithHighlighter(diff, highlighter, forcePlainText, lazyLineAST);
|
|
2548
2603
|
}
|
|
2549
|
-
renderDiffWithHighlighter(diff, highlighter, forcePlainText = false) {
|
|
2604
|
+
renderDiffWithHighlighter(diff, highlighter, forcePlainText = false, lazyLineAST = false) {
|
|
2550
2605
|
const { options } = this.getRenderOptions(diff);
|
|
2551
2606
|
const { collapsedContextThreshold } = this.getOptionsWithDefaults();
|
|
2552
2607
|
const result = renderDiffWithHighlighter(diff, highlighter, options, {
|
|
2553
2608
|
forcePlainText,
|
|
2609
|
+
lazyLineAST,
|
|
2554
2610
|
expandedHunks: forcePlainText ? true : void 0,
|
|
2555
2611
|
collapsedContextThreshold
|
|
2556
2612
|
});
|
|
@@ -2844,7 +2900,7 @@ var DiffHunksRenderer = class {
|
|
|
2844
2900
|
}
|
|
2845
2901
|
}
|
|
2846
2902
|
}
|
|
2847
|
-
if (noEOFCRAddition) {
|
|
2903
|
+
if (noEOFCRAddition && !(unified && noEOFCRDeletion && type !== "change")) {
|
|
2848
2904
|
const noEOFType = type === "context" || type === "context-expanded" ? type : "change-addition";
|
|
2849
2905
|
if (diffStyle === "unified") {
|
|
2850
2906
|
context.unifiedContentAST.push(createNoNewlineElement(noEOFType));
|
|
@@ -2954,11 +3010,11 @@ var DiffHunksRenderer = class {
|
|
|
2954
3010
|
};
|
|
2955
3011
|
}
|
|
2956
3012
|
renderFullHTML(result, tempChildren = []) {
|
|
2957
|
-
return
|
|
3013
|
+
return hastToHtml(this.renderFullAST(result, tempChildren));
|
|
2958
3014
|
}
|
|
2959
3015
|
renderPartialHTML(children, columnType) {
|
|
2960
|
-
if (columnType == null) return
|
|
2961
|
-
return
|
|
3016
|
+
if (columnType == null) return hastToHtml(children);
|
|
3017
|
+
return hastToHtml(createHastElement({
|
|
2962
3018
|
tagName: "code",
|
|
2963
3019
|
children,
|
|
2964
3020
|
properties: {
|
|
@@ -3234,8 +3290,16 @@ function createPlainAdditionLineElement(lineIndex, lineText, unifiedLineIndex =
|
|
|
3234
3290
|
}
|
|
3235
3291
|
function getEditorDocumentLines(textDocument) {
|
|
3236
3292
|
const lines = [];
|
|
3237
|
-
|
|
3238
|
-
|
|
3293
|
+
let characterCount = 0;
|
|
3294
|
+
for (let line = 0; line < textDocument.lineCount; line++) {
|
|
3295
|
+
const text = textDocument.getLineText(line, true);
|
|
3296
|
+
lines.push(text);
|
|
3297
|
+
characterCount += text.length;
|
|
3298
|
+
}
|
|
3299
|
+
return {
|
|
3300
|
+
lines,
|
|
3301
|
+
characterCount
|
|
3302
|
+
};
|
|
3239
3303
|
}
|
|
3240
3304
|
function getDiffLanguages(diff) {
|
|
3241
3305
|
if (diff.lang != null) return [diff.lang];
|
|
@@ -3332,16 +3396,16 @@ function shouldResetUndoState(prevDiff, nextDiff) {
|
|
|
3332
3396
|
function areLinesEqual(first, second) {
|
|
3333
3397
|
return first.length === second.length && first.every((line, index) => line === second[index]);
|
|
3334
3398
|
}
|
|
3335
|
-
function canRestoreDiffSession(snapshot,
|
|
3399
|
+
function canRestoreDiffSession(snapshot, inputDiff) {
|
|
3336
3400
|
const { oldFile } = snapshot;
|
|
3337
|
-
if (oldFile == null) return
|
|
3338
|
-
return
|
|
3401
|
+
if (oldFile == null) return inputDiff.type === "new";
|
|
3402
|
+
return inputDiff.type !== "new" && oldFile.name === (inputDiff.prevName ?? inputDiff.name) && areLinesEqual(oldFile.lines, inputDiff.deletionLines);
|
|
3339
3403
|
}
|
|
3340
3404
|
let instanceId$1 = -1;
|
|
3341
3405
|
var FileDiff$1 = class FileDiff {
|
|
3342
3406
|
options;
|
|
3343
3407
|
workerManager;
|
|
3344
|
-
|
|
3408
|
+
requestOwnerRender;
|
|
3345
3409
|
static LoadedCustomComponent = true;
|
|
3346
3410
|
__id = `file-diff:${++instanceId$1}`;
|
|
3347
3411
|
type = "file-diff";
|
|
@@ -3372,13 +3436,17 @@ var FileDiff$1 = class FileDiff {
|
|
|
3372
3436
|
scrollSyncManager;
|
|
3373
3437
|
interactionManager;
|
|
3374
3438
|
annotationCache = /* @__PURE__ */ new Map();
|
|
3375
|
-
lineAnnotations
|
|
3439
|
+
get lineAnnotations() {
|
|
3440
|
+
return this.renderedData?.lineAnnotations ?? EMPTY_LINE_ANNOTATIONS;
|
|
3441
|
+
}
|
|
3376
3442
|
managersDirty = false;
|
|
3377
3443
|
deletionFile;
|
|
3378
3444
|
additionFile;
|
|
3379
3445
|
fileDiff;
|
|
3380
3446
|
editSession;
|
|
3381
|
-
|
|
3447
|
+
renderedData;
|
|
3448
|
+
pendingData;
|
|
3449
|
+
forceRenderOverride;
|
|
3382
3450
|
renderRange;
|
|
3383
3451
|
pendingFiles;
|
|
3384
3452
|
appliedPreAttributes;
|
|
@@ -3395,10 +3463,10 @@ var FileDiff$1 = class FileDiff {
|
|
|
3395
3463
|
lineStateRefreshPending = false;
|
|
3396
3464
|
deferredSelectedLines;
|
|
3397
3465
|
deferredEditorActiveLine;
|
|
3398
|
-
constructor(options = { theme: DEFAULT_THEMES }, workerManager,
|
|
3466
|
+
constructor(options = { theme: DEFAULT_THEMES }, workerManager, requestOwnerRender) {
|
|
3399
3467
|
this.options = options;
|
|
3400
3468
|
this.workerManager = workerManager;
|
|
3401
|
-
this.
|
|
3469
|
+
this.requestOwnerRender = requestOwnerRender;
|
|
3402
3470
|
this.hunksRenderer = this.createHunksRenderer(options);
|
|
3403
3471
|
this.resizeManager = new ResizeManager();
|
|
3404
3472
|
this.scrollSyncManager = new ScrollSyncManager();
|
|
@@ -3517,27 +3585,35 @@ var FileDiff$1 = class FileDiff {
|
|
|
3517
3585
|
return resolveEditSessionSlotName(this.editSession?.annotations, annotation, getLineAnnotationName);
|
|
3518
3586
|
};
|
|
3519
3587
|
getLatestAnnotations() {
|
|
3520
|
-
return this.editSession?.annotations?.current ?? this.lineAnnotations;
|
|
3588
|
+
return this.pendingData?.lineAnnotations ?? this.editSession?.annotations?.current ?? this.lineAnnotations;
|
|
3589
|
+
}
|
|
3590
|
+
getAnnotationsForDiff(fileDiff) {
|
|
3591
|
+
const { pendingData } = this;
|
|
3592
|
+
return pendingData != null && areDiffTargetsEqual(fileDiff, pendingData.fileDiff) ? pendingData.lineAnnotations : this.lineAnnotations;
|
|
3521
3593
|
}
|
|
3522
3594
|
isNewAnnotations(lineAnnotations) {
|
|
3523
3595
|
const session = this.editSession?.annotations;
|
|
3524
|
-
if (lineAnnotations === this.
|
|
3596
|
+
if (lineAnnotations === this.getLatestAnnotations()) return false;
|
|
3525
3597
|
return session == null || lineAnnotations !== session.provided && lineAnnotations !== session.current;
|
|
3526
3598
|
}
|
|
3527
3599
|
setLineAnnotations(lineAnnotations) {
|
|
3528
3600
|
const sessionAnnotations = this.editSession?.annotations;
|
|
3529
|
-
if (sessionAnnotations
|
|
3530
|
-
this.lineAnnotations
|
|
3531
|
-
|
|
3601
|
+
if (sessionAnnotations != null) {
|
|
3602
|
+
if (!this.isNewAnnotations(lineAnnotations)) return;
|
|
3603
|
+
writeEditSessionAnnotations(sessionAnnotations, lineAnnotations, getLineAnnotationName);
|
|
3532
3604
|
}
|
|
3533
|
-
|
|
3534
|
-
this.
|
|
3535
|
-
|
|
3605
|
+
const fileDiff = this.getWorkingDiff();
|
|
3606
|
+
if (fileDiff != null) this.pendingData = {
|
|
3607
|
+
fileDiff,
|
|
3608
|
+
lineAnnotations
|
|
3609
|
+
};
|
|
3536
3610
|
}
|
|
3537
3611
|
syncEditSessionAnnotationsFromEditor(lineAnnotations) {
|
|
3538
3612
|
const session = this.editSession?.annotations;
|
|
3539
3613
|
if (session == null || lineAnnotations === session.current) return false;
|
|
3540
3614
|
session.current = lineAnnotations;
|
|
3615
|
+
if (this.renderedData != null) this.renderedData.lineAnnotations = lineAnnotations;
|
|
3616
|
+
this.pendingData = void 0;
|
|
3541
3617
|
this.hunksRenderer.setLineAnnotations(lineAnnotations);
|
|
3542
3618
|
this.renderAnnotations();
|
|
3543
3619
|
return true;
|
|
@@ -3582,7 +3658,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
3582
3658
|
}
|
|
3583
3659
|
shouldApplyColumnVariables(overflow) {
|
|
3584
3660
|
if (typeof this.options.hunkSeparators === "function") return true;
|
|
3585
|
-
return overflow === "scroll" && (this.
|
|
3661
|
+
return overflow === "scroll" && (this.lineAnnotations.length > 0 || this.pre?.hasAttribute("data-has-merge-conflict") === true);
|
|
3586
3662
|
}
|
|
3587
3663
|
getCodeScrollLeft() {
|
|
3588
3664
|
return Math.max(this.codeUnified?.scrollLeft ?? 0, this.codeDeletions?.scrollLeft ?? 0, this.codeAdditions?.scrollLeft ?? 0);
|
|
@@ -3611,12 +3687,16 @@ var FileDiff$1 = class FileDiff {
|
|
|
3611
3687
|
this.workerManager?.unsubscribeToThemeChanges(this);
|
|
3612
3688
|
this.renderRange = void 0;
|
|
3613
3689
|
if (!recycle) this.pendingFiles = void 0;
|
|
3614
|
-
if (!this.
|
|
3690
|
+
if (!this.isComponentManaged) this.fileContainer?.remove();
|
|
3615
3691
|
this.fileContainer = void 0;
|
|
3616
3692
|
this.mounted = false;
|
|
3617
|
-
if (!recycle)
|
|
3693
|
+
if (!recycle) {
|
|
3694
|
+
this.renderedData = void 0;
|
|
3695
|
+
this.pendingData = void 0;
|
|
3696
|
+
}
|
|
3618
3697
|
this.clearAuxiliaryNodes();
|
|
3619
3698
|
this.annotationCache.clear();
|
|
3699
|
+
this.pre?.remove();
|
|
3620
3700
|
this.pre = void 0;
|
|
3621
3701
|
this.codeUnified = void 0;
|
|
3622
3702
|
this.codeDeletions = void 0;
|
|
@@ -3626,11 +3706,9 @@ var FileDiff$1 = class FileDiff {
|
|
|
3626
3706
|
this.bufferAfter?.remove();
|
|
3627
3707
|
this.bufferAfter = void 0;
|
|
3628
3708
|
this.appliedPreAttributes = void 0;
|
|
3709
|
+
this.headerElement?.remove();
|
|
3629
3710
|
this.headerElement = void 0;
|
|
3630
|
-
this.
|
|
3631
|
-
this.headerFilenameSuffix = void 0;
|
|
3632
|
-
this.headerMetadata = void 0;
|
|
3633
|
-
this.headerCustom = void 0;
|
|
3711
|
+
this.clearHeaderSlots();
|
|
3634
3712
|
this.placeHolder?.remove();
|
|
3635
3713
|
this.placeHolder = void 0;
|
|
3636
3714
|
this.headerCache.lastRenderedHTML = void 0;
|
|
@@ -3650,7 +3728,6 @@ var FileDiff$1 = class FileDiff {
|
|
|
3650
3728
|
this.workerManager = void 0;
|
|
3651
3729
|
this.fileDiff = void 0;
|
|
3652
3730
|
this.editSession = void 0;
|
|
3653
|
-
this.renderedDiff = void 0;
|
|
3654
3731
|
this.deletionFile = void 0;
|
|
3655
3732
|
this.additionFile = void 0;
|
|
3656
3733
|
}
|
|
@@ -3739,14 +3816,19 @@ var FileDiff$1 = class FileDiff {
|
|
|
3739
3816
|
this.hydrateMeasuredScrollbar();
|
|
3740
3817
|
}
|
|
3741
3818
|
hydrationSetup({ fileDiff, oldFile, newFile, lineAnnotations }) {
|
|
3742
|
-
|
|
3819
|
+
const hydratedAnnotations = lineAnnotations ?? this.getLatestAnnotations();
|
|
3820
|
+
this.pendingData = void 0;
|
|
3743
3821
|
this.additionFile = newFile;
|
|
3744
3822
|
this.deletionFile = oldFile;
|
|
3745
3823
|
this.fileDiff = fileDiff ?? (oldFile !== void 0 && newFile !== void 0 ? parseDiffFromFile(oldFile, newFile, this.options.parseDiffOptions) : void 0);
|
|
3824
|
+
this.renderedData = this.fileDiff != null ? {
|
|
3825
|
+
fileDiff: this.fileDiff,
|
|
3826
|
+
lineAnnotations: hydratedAnnotations
|
|
3827
|
+
} : void 0;
|
|
3828
|
+
if (this.fileDiff != null) this.adoptRenderData(this.fileDiff);
|
|
3746
3829
|
if (this.pre == null) return;
|
|
3747
3830
|
this.syncInteractionOptions();
|
|
3748
3831
|
this.hunksRenderer.hydrate(this.fileDiff);
|
|
3749
|
-
this.renderedDiff = this.fileDiff;
|
|
3750
3832
|
this.renderAnnotations();
|
|
3751
3833
|
this.renderGutterUtility();
|
|
3752
3834
|
this.injectUnsafeCSS();
|
|
@@ -3754,12 +3836,23 @@ var FileDiff$1 = class FileDiff {
|
|
|
3754
3836
|
this.flushManagers();
|
|
3755
3837
|
}
|
|
3756
3838
|
rerender() {
|
|
3757
|
-
if (!this.enabled || this.
|
|
3839
|
+
if (!this.enabled || this.getInputDiff() == null && this.additionFile == null && this.deletionFile == null) return;
|
|
3840
|
+
if (this.requestRender()) return;
|
|
3758
3841
|
this.render({
|
|
3759
3842
|
forceRender: true,
|
|
3760
3843
|
renderRange: this.renderRange
|
|
3761
3844
|
});
|
|
3762
3845
|
}
|
|
3846
|
+
requestRender() {
|
|
3847
|
+
const { requestOwnerRender } = this;
|
|
3848
|
+
if (this.editSession != null || requestOwnerRender == null) return false;
|
|
3849
|
+
this.forceRenderOverride = true;
|
|
3850
|
+
requestOwnerRender();
|
|
3851
|
+
return true;
|
|
3852
|
+
}
|
|
3853
|
+
get isComponentManaged() {
|
|
3854
|
+
return this.requestOwnerRender != null;
|
|
3855
|
+
}
|
|
3763
3856
|
onThemeChange() {
|
|
3764
3857
|
this.hunksRenderer.clearRenderCache();
|
|
3765
3858
|
this.rerender();
|
|
@@ -3773,7 +3866,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
3773
3866
|
this.rerender();
|
|
3774
3867
|
};
|
|
3775
3868
|
loadFilesIfNecessary() {
|
|
3776
|
-
const
|
|
3869
|
+
const fileDiff = this.getInputDiff();
|
|
3870
|
+
const { loadDiffFiles } = this.options;
|
|
3777
3871
|
if (fileDiff == null || !canHydrateDiff(fileDiff) || this.pendingFiles?.fileDiff === fileDiff) return;
|
|
3778
3872
|
if (loadDiffFiles == null) throw new Error("FileDiff: loadDiffFiles is required to load full files for a partial diff");
|
|
3779
3873
|
const promise = this.loadFilesForDiff(fileDiff, loadDiffFiles);
|
|
@@ -3793,7 +3887,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
3793
3887
|
* `loadDiffFiles` was passed in to `options`
|
|
3794
3888
|
*/
|
|
3795
3889
|
__canAttachEditor() {
|
|
3796
|
-
|
|
3890
|
+
const fileDiff = this.getInputDiff();
|
|
3891
|
+
return fileDiff != null && !fileDiff.isPartial;
|
|
3797
3892
|
}
|
|
3798
3893
|
/**
|
|
3799
3894
|
* Load a partial diff before starting a new edit session. Call this before
|
|
@@ -3804,7 +3899,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
3804
3899
|
if (this.__canAttachEditor()) return;
|
|
3805
3900
|
const pending = this.__prepareForEditing();
|
|
3806
3901
|
if (pending == null) {
|
|
3807
|
-
|
|
3902
|
+
const fileDiff = this.getInputDiff();
|
|
3903
|
+
if (fileDiff?.isPartial === true && !canHydrateDiff(fileDiff)) throw new Error("FileDiff.prepareForEditing: this partial diff cannot be hydrated; provide a complete diff");
|
|
3808
3904
|
throw new Error("FileDiff.prepareForEditing: a partial diff requires loadDiffFiles");
|
|
3809
3905
|
}
|
|
3810
3906
|
await pending;
|
|
@@ -3813,14 +3909,15 @@ var FileDiff$1 = class FileDiff {
|
|
|
3813
3909
|
/** Hydrate a diff if necessary */
|
|
3814
3910
|
__prepareForEditing() {
|
|
3815
3911
|
if (this.__canAttachEditor()) return;
|
|
3816
|
-
|
|
3912
|
+
const fileDiff = this.getInputDiff();
|
|
3913
|
+
if (fileDiff?.isPartial === true && !canHydrateDiff(fileDiff)) throw new Error("FileDiff: this partial diff cannot be hydrated; provide a complete diff to edit");
|
|
3817
3914
|
this.loadFilesIfNecessary();
|
|
3818
3915
|
return this.pendingFiles?.promise;
|
|
3819
3916
|
}
|
|
3820
3917
|
async loadFilesForDiff(fileDiff, loadDiffFiles) {
|
|
3821
3918
|
try {
|
|
3822
3919
|
const files = await loadDiffFiles(fileDiff);
|
|
3823
|
-
if (this.
|
|
3920
|
+
if (this.getInputDiff() !== fileDiff) return;
|
|
3824
3921
|
await this.handleFilesLoaded(fileDiff, files);
|
|
3825
3922
|
} catch (error) {
|
|
3826
3923
|
if (this.options.disableErrorHandling === true) throw error;
|
|
@@ -3828,7 +3925,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
3828
3925
|
}
|
|
3829
3926
|
}
|
|
3830
3927
|
async handleFilesLoaded(expectedDiff, files) {
|
|
3831
|
-
if (this.
|
|
3928
|
+
if (this.getInputDiff() !== expectedDiff || !expectedDiff.isPartial) return;
|
|
3832
3929
|
hydratePartialDiff("merge", expectedDiff, files);
|
|
3833
3930
|
this.setHydratedState(files);
|
|
3834
3931
|
if (this.installHydratedSessionDiff(expectedDiff)) {
|
|
@@ -3836,58 +3933,69 @@ var FileDiff$1 = class FileDiff {
|
|
|
3836
3933
|
return;
|
|
3837
3934
|
}
|
|
3838
3935
|
await awaitWithTimeout(() => this.primeHighlightCache(expectedDiff));
|
|
3839
|
-
if (!this.enabled || this.
|
|
3936
|
+
if (!this.enabled || this.getInputDiff() !== expectedDiff) return;
|
|
3840
3937
|
this.rerender();
|
|
3841
3938
|
}
|
|
3842
3939
|
installHydratedSessionDiff(expectedDiff) {
|
|
3843
3940
|
if (expectedDiff.isPartial) throw new Error("FileDiff.installHydratedSessionDiff: diffs cannot be partial for editing");
|
|
3844
|
-
if (this.
|
|
3941
|
+
if (this.getInputDiff() !== expectedDiff) return false;
|
|
3845
3942
|
if (this.editSession?.outgoingDiff != null) {
|
|
3846
3943
|
this.installEditSession(expectedDiff);
|
|
3847
3944
|
return true;
|
|
3848
3945
|
}
|
|
3849
3946
|
return false;
|
|
3850
3947
|
}
|
|
3851
|
-
|
|
3852
|
-
if (areDiffTargetsEqual(this.
|
|
3853
|
-
const
|
|
3854
|
-
this.fileDiff =
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3948
|
+
updateInputDiff(incomingDiff, lineAnnotations) {
|
|
3949
|
+
if (areDiffTargetsEqual(this.getInputDiff(), incomingDiff)) return false;
|
|
3950
|
+
const previousAnnotations = this.getLatestAnnotations();
|
|
3951
|
+
this.fileDiff = incomingDiff;
|
|
3952
|
+
const { editSession: previousSession } = this;
|
|
3953
|
+
const outgoingDiff = previousSession?.outgoingDiff ?? previousSession?.diff;
|
|
3954
|
+
if (previousSession != null) {
|
|
3955
|
+
if (incomingDiff.isPartial) previousSession.inputDiff = incomingDiff;
|
|
3956
|
+
else this.installEditSession(incomingDiff);
|
|
3858
3957
|
if (this.editSession != null) this.editSession.outgoingDiff = outgoingDiff;
|
|
3859
3958
|
}
|
|
3860
|
-
if (this.editSession?.annotations != null && lineAnnotations != null)
|
|
3861
|
-
|
|
3862
|
-
this.editSession
|
|
3863
|
-
|
|
3959
|
+
if (this.editSession?.annotations != null && lineAnnotations != null) this.editSession.annotations = adoptEditSessionAnnotations(lineAnnotations, getLineAnnotationName, this.editSession.annotations);
|
|
3960
|
+
this.pendingData = {
|
|
3961
|
+
fileDiff: this.editSession?.diff ?? incomingDiff,
|
|
3962
|
+
lineAnnotations: this.editSession?.annotations?.current ?? lineAnnotations ?? previousAnnotations
|
|
3963
|
+
};
|
|
3964
|
+
if (outgoingDiff != null && incomingDiff.isPartial) this.loadFilesIfNecessary();
|
|
3864
3965
|
return true;
|
|
3865
3966
|
}
|
|
3866
|
-
installEditSession(
|
|
3867
|
-
const
|
|
3967
|
+
installEditSession(inputDiff, retainedDocument, retainedSession) {
|
|
3968
|
+
const inputContents = inputDiff.additionLines.join("");
|
|
3868
3969
|
const retainedLines = retainedDocument != null ? splitFileContents$1(retainedDocument.contents) : void 0;
|
|
3869
|
-
const restoreRetainedSession = retainedSession != null && canRestoreDiffSession(retainedSession,
|
|
3970
|
+
const restoreRetainedSession = retainedSession != null && canRestoreDiffSession(retainedSession, inputDiff);
|
|
3870
3971
|
if (retainedSession != null && !restoreRetainedSession) throw new Error("FileDiff: retained session cannot resume against a different old file");
|
|
3871
|
-
if (retainedDocument != null && retainedDocument.contents !==
|
|
3872
|
-
const
|
|
3873
|
-
const sessionDiff = createEditSessionDiff(
|
|
3874
|
-
if (retainedDocument != null && retainedLines != null && !
|
|
3972
|
+
if (retainedDocument != null && retainedDocument.contents !== inputContents && !restoreRetainedSession) throw new Error("FileDiff: retained edits are missing their diff session state");
|
|
3973
|
+
const usesInputDocument = retainedDocument == null || retainedDocument.name === inputDiff.name && retainedDocument.lang === inputDiff.lang && retainedDocument.contents === inputContents;
|
|
3974
|
+
const sessionDiff = createEditSessionDiff(inputDiff);
|
|
3975
|
+
if (retainedDocument != null && retainedLines != null && !usesInputDocument) {
|
|
3875
3976
|
sessionDiff.name = retainedDocument.name;
|
|
3876
3977
|
sessionDiff.lang = retainedDocument.lang;
|
|
3877
3978
|
}
|
|
3878
|
-
if (restoreRetainedSession && retainedSession != null && retainedLines != null) {
|
|
3979
|
+
if (restoreRetainedSession && retainedSession != null && retainedDocument != null && retainedLines != null) {
|
|
3879
3980
|
sessionDiff.additionLines = retainedLines;
|
|
3981
|
+
sessionDiff.additionCharacterCount = retainedDocument.contents.length;
|
|
3880
3982
|
sessionDiff.type = retainedSession.type;
|
|
3881
3983
|
sessionDiff.hunks = retainedSession.hunks;
|
|
3882
3984
|
sessionDiff.editSessionDirty = true;
|
|
3883
3985
|
recomputeDiffRenderLineCounts(sessionDiff);
|
|
3884
3986
|
}
|
|
3987
|
+
const annotations = this.editSession?.annotations ?? adoptEditSessionAnnotations(this.getLatestAnnotations(), getLineAnnotationName);
|
|
3885
3988
|
this.editSession = {
|
|
3886
3989
|
diff: sessionDiff,
|
|
3887
|
-
|
|
3990
|
+
inputDiff,
|
|
3991
|
+
annotations,
|
|
3888
3992
|
outgoingDiff: this.editSession?.outgoingDiff
|
|
3889
3993
|
};
|
|
3890
|
-
this.
|
|
3994
|
+
this.pendingData = {
|
|
3995
|
+
fileDiff: sessionDiff,
|
|
3996
|
+
lineAnnotations: annotations.current
|
|
3997
|
+
};
|
|
3998
|
+
this.hunksRenderer.beginEditSession(sessionDiff, usesInputDocument && !restoreRetainedSession ? inputDiff : void 0);
|
|
3891
3999
|
}
|
|
3892
4000
|
setHydratedState(files) {
|
|
3893
4001
|
this.deletionFile = files.oldFile;
|
|
@@ -3897,6 +4005,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
3897
4005
|
}
|
|
3898
4006
|
render({ fileDiff, deferManagers = false, forceRender = false, preventEmit = false, lineAnnotations, fileContainer, containerWrapper, renderRange, ...fileInputProps }) {
|
|
3899
4007
|
if (!this.enabled) throw new Error("FileDiff.render: attempting to call render after cleaned up");
|
|
4008
|
+
forceRender = this.forceRenderOverride ?? forceRender;
|
|
4009
|
+
this.forceRenderOverride = void 0;
|
|
3900
4010
|
const fileInput = getDiffFileInput(fileInputProps, "FileDiff.render");
|
|
3901
4011
|
const oldFile = fileInput?.oldFile;
|
|
3902
4012
|
const newFile = fileInput?.newFile;
|
|
@@ -3906,7 +4016,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
3906
4016
|
const themeChanged = this.hasThemeChanged();
|
|
3907
4017
|
const hasFileInput = fileInput != null;
|
|
3908
4018
|
const filesDidChange = hasFileInput && (!areOptionalFilesEqual$1(oldFile, this.deletionFile) || !areOptionalFilesEqual$1(newFile, this.additionFile));
|
|
3909
|
-
let diffDidChange = fileDiff != null && !areDiffTargetsEqual(fileDiff, this.
|
|
4019
|
+
let diffDidChange = fileDiff != null && !areDiffTargetsEqual(fileDiff, this.getInputDiff());
|
|
3910
4020
|
const annotationsChanged = lineAnnotations != null && (lineAnnotations.length > 0 || this.getLatestAnnotations().length > 0) ? this.isNewAnnotations(lineAnnotations) : false;
|
|
3911
4021
|
if (!collapsed && areRenderRangesEqual(nextRenderRange, this.renderRange) && !forceRender && !annotationsChanged && !themeChanged && (fileDiff != null && !diffDidChange || fileDiff == null && !filesDidChange)) {
|
|
3912
4022
|
const rendered = this.applyCachedThemeState(themeType);
|
|
@@ -3914,7 +4024,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
3914
4024
|
return rendered;
|
|
3915
4025
|
}
|
|
3916
4026
|
let nextParsedFileDiff;
|
|
3917
|
-
if (fileDiff == null && hasFileInput && (filesDidChange || this.
|
|
4027
|
+
if (fileDiff == null && hasFileInput && (filesDidChange || this.getInputDiff() == null)) nextParsedFileDiff = parseDiffFromFile(fileInput.oldFile, fileInput.newFile, this.options.parseDiffOptions);
|
|
3918
4028
|
const { renderRange: previousRenderRange } = this;
|
|
3919
4029
|
this.renderRange = nextRenderRange;
|
|
3920
4030
|
if (hasFileInput) {
|
|
@@ -3924,23 +4034,23 @@ var FileDiff$1 = class FileDiff {
|
|
|
3924
4034
|
this.deletionFile = void 0;
|
|
3925
4035
|
this.additionFile = void 0;
|
|
3926
4036
|
}
|
|
3927
|
-
if (fileDiff != null && diffDidChange) this.
|
|
4037
|
+
if (fileDiff != null && diffDidChange) this.updateInputDiff(fileDiff, lineAnnotations);
|
|
3928
4038
|
else if (nextParsedFileDiff != null) {
|
|
3929
4039
|
diffDidChange = true;
|
|
3930
|
-
this.
|
|
4040
|
+
this.updateInputDiff(nextParsedFileDiff, lineAnnotations);
|
|
3931
4041
|
}
|
|
3932
4042
|
if (diffDidChange) this.clearReusableHeader();
|
|
3933
4043
|
if (lineAnnotations != null) this.setLineAnnotations(lineAnnotations);
|
|
3934
|
-
const
|
|
3935
|
-
if (
|
|
3936
|
-
if (
|
|
3937
|
-
finishEditSessionForDiff(
|
|
4044
|
+
const workingDiff = this.getWorkingDiff();
|
|
4045
|
+
if (workingDiff == null) return false;
|
|
4046
|
+
if (workingDiff.editSessionDirty === true && this.shouldSelfHealEditSession()) {
|
|
4047
|
+
finishEditSessionForDiff(workingDiff, this.options.parseDiffOptions);
|
|
3938
4048
|
this.hunksRenderer.refreshHighlightedResult();
|
|
3939
4049
|
}
|
|
3940
4050
|
if (expandUnchanged) this.loadFilesIfNecessary();
|
|
3941
4051
|
this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options));
|
|
3942
4052
|
this.syncInteractionOptions();
|
|
3943
|
-
this.
|
|
4053
|
+
this.prepareRenderData(this.hunksRenderer.getDiffForNextRender(workingDiff));
|
|
3944
4054
|
const { disableErrorHandling = false, disableFileHeader = false } = this.options;
|
|
3945
4055
|
if (disableFileHeader) {
|
|
3946
4056
|
if (this.headerElement != null) {
|
|
@@ -3956,11 +4066,11 @@ var FileDiff$1 = class FileDiff {
|
|
|
3956
4066
|
this.removeRenderedCode();
|
|
3957
4067
|
this.clearAuxiliaryNodes();
|
|
3958
4068
|
try {
|
|
3959
|
-
const hunksResult = this.hunksRenderer.renderDiff(
|
|
4069
|
+
const hunksResult = this.hunksRenderer.renderDiff(workingDiff, EMPTY_RENDER_RANGE);
|
|
3960
4070
|
if (hunksResult != null) this.applyThemeState(fileContainer, hunksResult.themeStyles, themeType, hunksResult.baseThemeType);
|
|
3961
4071
|
if (hunksResult?.headerElement != null) this.applyHeaderToDOM(hunksResult.headerElement, fileContainer, hunksResult.fileDiff);
|
|
3962
4072
|
this.renderSeparators([]);
|
|
3963
|
-
this.
|
|
4073
|
+
this.adoptRenderData(hunksResult?.fileDiff ?? workingDiff);
|
|
3964
4074
|
this.injectUnsafeCSS();
|
|
3965
4075
|
} catch (error) {
|
|
3966
4076
|
if (disableErrorHandling) throw error;
|
|
@@ -3973,12 +4083,12 @@ var FileDiff$1 = class FileDiff {
|
|
|
3973
4083
|
}
|
|
3974
4084
|
try {
|
|
3975
4085
|
const pre = this.getOrCreatePreNode(fileContainer);
|
|
3976
|
-
if (!(this.canPartiallyRender(forceRender, annotationsChanged, filesDidChange || diffDidChange || themeChanged || !areDiffTargetsEqual(this.
|
|
3977
|
-
fileDiff:
|
|
4086
|
+
if (!(this.canPartiallyRender(forceRender, annotationsChanged, filesDidChange || diffDidChange || themeChanged || !areDiffTargetsEqual(this.getRenderedDiff(), workingDiff)) && this.applyPartialRender({
|
|
4087
|
+
fileDiff: workingDiff,
|
|
3978
4088
|
previousRenderRange,
|
|
3979
4089
|
renderRange: nextRenderRange
|
|
3980
4090
|
}))) {
|
|
3981
|
-
const hunksResult = this.hunksRenderer.renderDiff(
|
|
4091
|
+
const hunksResult = this.hunksRenderer.renderDiff(workingDiff, nextRenderRange);
|
|
3982
4092
|
if (hunksResult == null) {
|
|
3983
4093
|
if (this.workerManager?.isInitialized() === false && this.workerManager.isWorkingPool()) this.workerManager.initialize().catch(() => {
|
|
3984
4094
|
}).then(() => this.rerender());
|
|
@@ -3992,7 +4102,10 @@ var FileDiff$1 = class FileDiff {
|
|
|
3992
4102
|
this.pre = void 0;
|
|
3993
4103
|
}
|
|
3994
4104
|
this.renderSeparators(hunksResult.hunkData);
|
|
3995
|
-
this.
|
|
4105
|
+
this.adoptRenderData(hunksResult.fileDiff);
|
|
4106
|
+
} else {
|
|
4107
|
+
const renderedDiff = this.getRenderedDiff();
|
|
4108
|
+
if (renderedDiff != null) this.adoptRenderData(renderedDiff);
|
|
3996
4109
|
}
|
|
3997
4110
|
this.applyBuffers(pre, nextRenderRange);
|
|
3998
4111
|
this.injectUnsafeCSS();
|
|
@@ -4026,24 +4139,56 @@ var FileDiff$1 = class FileDiff {
|
|
|
4026
4139
|
this.mounted = true;
|
|
4027
4140
|
onPostRender?.(fileContainer, this, phase);
|
|
4028
4141
|
}
|
|
4029
|
-
|
|
4030
|
-
return this.
|
|
4142
|
+
getInputDiff() {
|
|
4143
|
+
return this.fileDiff;
|
|
4144
|
+
}
|
|
4145
|
+
getWorkingDiff(fallbackDiff = this.fileDiff) {
|
|
4146
|
+
return this.editSession?.diff ?? fallbackDiff;
|
|
4031
4147
|
}
|
|
4032
4148
|
getRenderedDiff() {
|
|
4033
|
-
return this.
|
|
4149
|
+
return this.renderedData?.fileDiff;
|
|
4150
|
+
}
|
|
4151
|
+
/**
|
|
4152
|
+
* @internal Data the next render() with this input will display. While a
|
|
4153
|
+
* replacement diff is being highlighted, this is still the displayed data.
|
|
4154
|
+
*/
|
|
4155
|
+
__getNextRenderData({ fileDiff, lineAnnotations }) {
|
|
4156
|
+
const sessionAnnotations = this.editSession?.annotations;
|
|
4157
|
+
if (sessionAnnotations != null) return {
|
|
4158
|
+
fileDiff,
|
|
4159
|
+
lineAnnotations: lineAnnotations != null && this.isNewAnnotations(lineAnnotations) ? lineAnnotations : sessionAnnotations.provided
|
|
4160
|
+
};
|
|
4161
|
+
const workingDiff = this.getWorkingDiff(fileDiff) ?? fileDiff;
|
|
4162
|
+
const nextDiff = this.hunksRenderer.getDiffForNextRender(workingDiff);
|
|
4163
|
+
return {
|
|
4164
|
+
fileDiff: nextDiff,
|
|
4165
|
+
lineAnnotations: lineAnnotations != null && areDiffTargetsEqual(nextDiff, workingDiff) ? lineAnnotations : this.getAnnotationsForDiff(nextDiff)
|
|
4166
|
+
};
|
|
4167
|
+
}
|
|
4168
|
+
prepareRenderData(fileDiff) {
|
|
4169
|
+
this.hunksRenderer.setLineAnnotations(this.getAnnotationsForDiff(fileDiff));
|
|
4170
|
+
}
|
|
4171
|
+
adoptRenderData(fileDiff) {
|
|
4172
|
+
const { pendingData } = this;
|
|
4173
|
+
const matchesPending = pendingData != null && areDiffTargetsEqual(fileDiff, pendingData.fileDiff);
|
|
4174
|
+
this.renderedData = {
|
|
4175
|
+
fileDiff,
|
|
4176
|
+
lineAnnotations: matchesPending ? pendingData.lineAnnotations : this.lineAnnotations
|
|
4177
|
+
};
|
|
4178
|
+
if (matchesPending) this.pendingData = void 0;
|
|
4034
4179
|
}
|
|
4035
4180
|
syncRenderViewToEditor() {
|
|
4036
4181
|
const { editor, fileContainer } = this;
|
|
4037
4182
|
const lineAnnotations = this.getLatestAnnotations();
|
|
4038
4183
|
const renderRange = this.computeEditorRenderRange(this.renderRange);
|
|
4039
|
-
const fileDiff = this.
|
|
4184
|
+
const fileDiff = this.getWorkingDiff();
|
|
4040
4185
|
if (editor == null || fileContainer == null || fileDiff == null || fileDiff.isPartial) return;
|
|
4041
4186
|
const sync = (highlighter2) => {
|
|
4042
|
-
if (!this.enabled || this.editor !== editor || this.fileContainer !== fileContainer || this.
|
|
4187
|
+
if (!this.enabled || this.editor !== editor || this.fileContainer !== fileContainer || this.getWorkingDiff() !== fileDiff) return;
|
|
4043
4188
|
const replacement = this.editSession?.outgoingDiff;
|
|
4044
|
-
const
|
|
4045
|
-
const externalDocument = replacement != null &&
|
|
4046
|
-
const resetHistory = externalDocument && replacement != null &&
|
|
4189
|
+
const inputDiff = this.getInputDiff();
|
|
4190
|
+
const externalDocument = replacement != null && inputDiff != null && replacement !== fileDiff;
|
|
4191
|
+
const resetHistory = externalDocument && replacement != null && inputDiff != null ? shouldResetUndoState(replacement, inputDiff) : false;
|
|
4047
4192
|
editor.__syncRenderView({
|
|
4048
4193
|
highlighter: highlighter2,
|
|
4049
4194
|
fileContainer,
|
|
@@ -4064,11 +4209,13 @@ var FileDiff$1 = class FileDiff {
|
|
|
4064
4209
|
else getSharedHighlighter({
|
|
4065
4210
|
themes: getThemes(theme),
|
|
4066
4211
|
langs: ["text", lang],
|
|
4067
|
-
preferredHighlighter: this.workerManager
|
|
4068
|
-
}).then(sync)
|
|
4212
|
+
preferredHighlighter: resolvePreferredHighlighter(this.workerManager, this.options)
|
|
4213
|
+
}).then(sync).catch((error) => {
|
|
4214
|
+
if (!(error instanceof HighlighterDisposedError)) console.error(error);
|
|
4215
|
+
});
|
|
4069
4216
|
}
|
|
4070
4217
|
computeEditorRenderRange(renderRange) {
|
|
4071
|
-
const fileDiff = this.
|
|
4218
|
+
const fileDiff = this.getWorkingDiff();
|
|
4072
4219
|
if (renderRange == null || fileDiff == null || isDefaultRenderRange(renderRange)) return renderRange;
|
|
4073
4220
|
const { diffStyle = "split", expandUnchanged = false, collapsedContextThreshold = 1 } = this.options;
|
|
4074
4221
|
let firstLineNumber;
|
|
@@ -4118,7 +4265,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
4118
4265
|
* When `clone` is true, the returned lines and hunks are copied.
|
|
4119
4266
|
*/
|
|
4120
4267
|
__captureDocumentSessionState(clone = true) {
|
|
4121
|
-
|
|
4268
|
+
const fileDiff = this.getInputDiff();
|
|
4269
|
+
let { diff: sessionDiff, outgoingDiff } = this.editSession ?? {};
|
|
4122
4270
|
if (outgoingDiff != null && fileDiff != null) {
|
|
4123
4271
|
if (!fileDiff.isPartial && shouldResetUndoState(outgoingDiff, fileDiff)) return;
|
|
4124
4272
|
sessionDiff = outgoingDiff;
|
|
@@ -4159,17 +4307,17 @@ var FileDiff$1 = class FileDiff {
|
|
|
4159
4307
|
this.resumeEditorRendering(editor);
|
|
4160
4308
|
}
|
|
4161
4309
|
resumeEditorRendering(editor) {
|
|
4162
|
-
const
|
|
4310
|
+
const inputDiff = this.getInputDiff();
|
|
4163
4311
|
const pendingReplacement = this.editSession?.outgoingDiff;
|
|
4164
|
-
if (pendingReplacement != null &&
|
|
4165
|
-
const
|
|
4166
|
-
if (
|
|
4312
|
+
if (pendingReplacement != null && inputDiff != null && !inputDiff.isPartial && this.editSession?.diff === pendingReplacement) this.installEditSession(inputDiff);
|
|
4313
|
+
const initialInputDiff = this.editSession == null && inputDiff != null && !inputDiff.isPartial ? inputDiff : void 0;
|
|
4314
|
+
if (initialInputDiff != null) this.installEditSession(initialInputDiff, editor.__getDocumentContents(getAdditionFile(initialInputDiff)), editor.__getDocumentSessionState());
|
|
4167
4315
|
else if (this.editSession != null) this.hunksRenderer.beginEditSession(this.editSession.diff);
|
|
4168
4316
|
this.editor = editor;
|
|
4169
|
-
if (this.
|
|
4317
|
+
if (this.getInputDiff()?.isPartial === true) this.loadFilesIfNecessary();
|
|
4170
4318
|
const editSessionDiff = this.editSession?.diff;
|
|
4171
4319
|
if (this.hunksRenderer.editorRenderReady()) {
|
|
4172
|
-
if (editSessionDiff != null && this.hunksRenderer.diffCache === editSessionDiff) this.
|
|
4320
|
+
if (editSessionDiff != null && this.hunksRenderer.diffCache === editSessionDiff) this.adoptRenderData(editSessionDiff);
|
|
4173
4321
|
this.syncRenderViewToEditor();
|
|
4174
4322
|
} else this.rerender();
|
|
4175
4323
|
}
|
|
@@ -4184,7 +4332,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4184
4332
|
* Requires the editor to be detached first. Does nothing when no session
|
|
4185
4333
|
* exists, so callers can invoke it again safely after it has settled.
|
|
4186
4334
|
*
|
|
4187
|
-
* `onEditComplete` receives the completed diff, current
|
|
4335
|
+
* `onEditComplete` receives the completed diff, current input diff,
|
|
4188
4336
|
* complete file pair, and both annotation collections even when the final
|
|
4189
4337
|
* text is unchanged. In `install` mode, accepting installs the completed diff
|
|
4190
4338
|
* and its annotations; rejecting or having no handler restores the external
|
|
@@ -4195,9 +4343,10 @@ var FileDiff$1 = class FileDiff {
|
|
|
4195
4343
|
this.settleEditSession(mode === "install", editor);
|
|
4196
4344
|
}
|
|
4197
4345
|
settleEditSession(installResult, editor) {
|
|
4198
|
-
const { editSession
|
|
4199
|
-
if (editSession == null
|
|
4200
|
-
const { diff: editSessionDiff, annotations: editSessionAnnotations } = editSession;
|
|
4346
|
+
const { editSession } = this;
|
|
4347
|
+
if (editSession == null) return;
|
|
4348
|
+
const { diff: editSessionDiff, inputDiff, annotations: editSessionAnnotations } = editSession;
|
|
4349
|
+
const inputAnnotations = editSessionAnnotations?.provided ?? this.lineAnnotations;
|
|
4201
4350
|
if (this.editor != null) throw new Error("FileDiff.__completeEditSession: detach the editor before completing the session");
|
|
4202
4351
|
this.hunksRenderer.endEditSession();
|
|
4203
4352
|
this.finalizeEditSessionHunks();
|
|
@@ -4217,20 +4366,20 @@ var FileDiff$1 = class FileDiff {
|
|
|
4217
4366
|
const event = {
|
|
4218
4367
|
fileDiff: completedDiff,
|
|
4219
4368
|
editor,
|
|
4220
|
-
originalFileDiff:
|
|
4369
|
+
originalFileDiff: inputDiff,
|
|
4221
4370
|
oldFile: completedDiff.type === "new" ? null : {
|
|
4222
4371
|
name: completedDiff.prevName ?? completedDiff.name,
|
|
4223
4372
|
contents: completedDiff.deletionLines.join("")
|
|
4224
4373
|
},
|
|
4225
4374
|
newFile,
|
|
4226
4375
|
lineAnnotations: sessionAnnotationsCurrent,
|
|
4227
|
-
originalLineAnnotations:
|
|
4376
|
+
originalLineAnnotations: inputAnnotations
|
|
4228
4377
|
};
|
|
4229
4378
|
Object.freeze(event);
|
|
4230
4379
|
try {
|
|
4231
4380
|
editor.__emitEditComplete(event);
|
|
4232
4381
|
if (this.options.onEditComplete?.(event) === "accept") {
|
|
4233
|
-
if (completedDiff.cacheKey != null && completedDiff.cacheKey ===
|
|
4382
|
+
if (completedDiff.cacheKey != null && completedDiff.cacheKey === inputDiff.cacheKey) throw new Error("FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey");
|
|
4234
4383
|
acceptedDiff = completedDiff;
|
|
4235
4384
|
acceptedOldFile = event.oldFile;
|
|
4236
4385
|
acceptedNewFile = event.newFile;
|
|
@@ -4240,14 +4389,17 @@ var FileDiff$1 = class FileDiff {
|
|
|
4240
4389
|
failure = error;
|
|
4241
4390
|
}
|
|
4242
4391
|
if (installResult && acceptedDiff != null) {
|
|
4243
|
-
this.fileDiff = acceptedDiff;
|
|
4244
4392
|
if (this.additionFile != null) {
|
|
4245
4393
|
this.deletionFile = acceptedOldFile;
|
|
4246
4394
|
this.additionFile = acceptedNewFile;
|
|
4247
4395
|
}
|
|
4248
|
-
if (sessionAnnotationsCurrent != null) this.lineAnnotations = sessionAnnotationsCurrent;
|
|
4249
4396
|
}
|
|
4250
4397
|
this.editSession = void 0;
|
|
4398
|
+
this.fileDiff = installResult && acceptedDiff != null ? acceptedDiff : inputDiff;
|
|
4399
|
+
this.pendingData = {
|
|
4400
|
+
fileDiff: this.fileDiff,
|
|
4401
|
+
lineAnnotations: installResult && acceptedDiff != null ? sessionAnnotationsCurrent ?? inputAnnotations : inputAnnotations
|
|
4402
|
+
};
|
|
4251
4403
|
if (installResult && this.fileContainer != null) this.rerender();
|
|
4252
4404
|
if (failed) throw failure;
|
|
4253
4405
|
}
|
|
@@ -4264,7 +4416,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4264
4416
|
* ran.
|
|
4265
4417
|
*/
|
|
4266
4418
|
finalizeEditSessionHunks() {
|
|
4267
|
-
const fileDiff = this.
|
|
4419
|
+
const fileDiff = this.getWorkingDiff();
|
|
4268
4420
|
if (fileDiff == null || fileDiff.editSessionDirty !== true) return false;
|
|
4269
4421
|
const { collapsedContextThreshold = 1 } = this.options;
|
|
4270
4422
|
const anchors = captureExpansionAnchors(fileDiff, this.hunksRenderer.getExpandedHunksMap(), collapsedContextThreshold);
|
|
@@ -4316,9 +4468,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
4316
4468
|
}
|
|
4317
4469
|
}
|
|
4318
4470
|
detachAdditionLines() {
|
|
4319
|
-
const editSessionDiff = this.editSession
|
|
4320
|
-
|
|
4321
|
-
if (editSessionDiff != null && (editSessionDiff.additionLines === fileDiff?.additionLines || editSessionDiff.additionLines === editSessionDiff.deletionLines)) editSessionDiff.additionLines = [...editSessionDiff.additionLines];
|
|
4471
|
+
const { diff: editSessionDiff, inputDiff } = this.editSession ?? {};
|
|
4472
|
+
if (editSessionDiff != null && (editSessionDiff.additionLines === inputDiff?.additionLines || editSessionDiff.additionLines === editSessionDiff.deletionLines)) editSessionDiff.additionLines = [...editSessionDiff.additionLines];
|
|
4322
4473
|
}
|
|
4323
4474
|
isLineRenderable(lineNumber) {
|
|
4324
4475
|
const fileDiff = this.getRenderedDiff();
|
|
@@ -4436,7 +4587,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4436
4587
|
this.placeHolder.style.setProperty("height", `${height}px`);
|
|
4437
4588
|
return true;
|
|
4438
4589
|
}
|
|
4439
|
-
async primeHighlightCache(fileDiff = this.
|
|
4590
|
+
async primeHighlightCache(fileDiff = this.getInputDiff()) {
|
|
4440
4591
|
const { workerManager } = this;
|
|
4441
4592
|
if (fileDiff == null || workerManager == null || !workerManager.isWorkingPool() || fileDiff.cacheKey == null || isDiffPlainText(fileDiff)) return;
|
|
4442
4593
|
const tokenizeMaxLength = this.options.tokenizeMaxLength ?? 1e5;
|
|
@@ -4490,7 +4641,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4490
4641
|
}
|
|
4491
4642
|
renderSeparators(hunkData) {
|
|
4492
4643
|
const { hunkSeparators } = this.options;
|
|
4493
|
-
if (this.
|
|
4644
|
+
if (this.isComponentManaged || this.fileContainer == null || typeof hunkSeparators !== "function") {
|
|
4494
4645
|
for (const { element } of this.separatorCache.values()) element.remove();
|
|
4495
4646
|
this.separatorCache.clear();
|
|
4496
4647
|
return;
|
|
@@ -4521,31 +4672,34 @@ var FileDiff$1 = class FileDiff {
|
|
|
4521
4672
|
}
|
|
4522
4673
|
}
|
|
4523
4674
|
renderAnnotations() {
|
|
4524
|
-
if (this.
|
|
4675
|
+
if (this.isComponentManaged || this.fileContainer == null) {
|
|
4525
4676
|
for (const { element } of this.annotationCache.values()) element.remove();
|
|
4526
4677
|
this.annotationCache.clear();
|
|
4527
4678
|
return;
|
|
4528
4679
|
}
|
|
4529
4680
|
const staleAnnotations = new Map(this.annotationCache);
|
|
4530
|
-
const { renderAnnotation } = this
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
const
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
cache
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4681
|
+
const { renderedData, options: { renderAnnotation } } = this;
|
|
4682
|
+
if (renderAnnotation != null && renderedData != null) {
|
|
4683
|
+
const { fileDiff, lineAnnotations } = renderedData;
|
|
4684
|
+
for (const [index, annotation] of lineAnnotations.entries()) {
|
|
4685
|
+
const name = this.getAnnotationSlotName(annotation);
|
|
4686
|
+
const id = `${index}-${name}`;
|
|
4687
|
+
let cache = this.annotationCache.get(id);
|
|
4688
|
+
if (cache == null || cache.fileDiff !== fileDiff || !areDiffLineAnnotationsEqual(annotation, cache.annotation)) {
|
|
4689
|
+
cache?.element.remove();
|
|
4690
|
+
const content = renderAnnotation(annotation, fileDiff);
|
|
4691
|
+
if (content == null) continue;
|
|
4692
|
+
cache = {
|
|
4693
|
+
element: createAnnotationWrapperNode(name),
|
|
4694
|
+
annotation,
|
|
4695
|
+
fileDiff
|
|
4696
|
+
};
|
|
4697
|
+
cache.element.appendChild(content);
|
|
4698
|
+
this.fileContainer.appendChild(cache.element);
|
|
4699
|
+
this.annotationCache.set(id, cache);
|
|
4700
|
+
}
|
|
4701
|
+
staleAnnotations.delete(id);
|
|
4547
4702
|
}
|
|
4548
|
-
staleAnnotations.delete(id);
|
|
4549
4703
|
}
|
|
4550
4704
|
for (const [id, { element }] of staleAnnotations.entries()) {
|
|
4551
4705
|
this.annotationCache.delete(id);
|
|
@@ -4643,7 +4797,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4643
4797
|
this.placeHolder?.remove();
|
|
4644
4798
|
this.placeHolder = void 0;
|
|
4645
4799
|
const { headerCache: { fileDiff: cachedHeaderDiff, html: cachedHeaderHTML, lastRenderedHTML } } = this;
|
|
4646
|
-
const headerHTML = (fileDiff !== this.editSession?.diff && areDiffTargetsEqual(cachedHeaderDiff, fileDiff) ? cachedHeaderHTML : void 0) ??
|
|
4800
|
+
const headerHTML = (fileDiff !== this.editSession?.diff && areDiffTargetsEqual(cachedHeaderDiff, fileDiff) ? cachedHeaderHTML : void 0) ?? hastToHtml(headerAST);
|
|
4647
4801
|
this.headerCache.html = headerHTML;
|
|
4648
4802
|
this.headerCache.fileDiff = fileDiff;
|
|
4649
4803
|
if (headerHTML !== lastRenderedHTML) {
|
|
@@ -4656,7 +4810,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4656
4810
|
this.headerElement = newHeader;
|
|
4657
4811
|
this.headerCache.lastRenderedHTML = headerHTML;
|
|
4658
4812
|
}
|
|
4659
|
-
if (this.
|
|
4813
|
+
if (this.isComponentManaged) return;
|
|
4660
4814
|
const { renderCustomHeader, renderHeaderPrefix, renderHeaderFilenameSuffix, renderHeaderMetadata } = this.options;
|
|
4661
4815
|
if (renderCustomHeader != null) {
|
|
4662
4816
|
const content2 = renderCustomHeader(fileDiff) ?? void 0;
|
|
@@ -4714,6 +4868,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4714
4868
|
}
|
|
4715
4869
|
injectUnsafeCSS() {
|
|
4716
4870
|
const { unsafeCSS } = this.options;
|
|
4871
|
+
this.pre?.toggleAttribute("data-custom-styles", Boolean(unsafeCSS));
|
|
4717
4872
|
const shadowRoot = this.fileContainer?.shadowRoot;
|
|
4718
4873
|
if (shadowRoot == null) return;
|
|
4719
4874
|
if (unsafeCSS == null || unsafeCSS === "") {
|
|
@@ -4782,8 +4937,8 @@ var FileDiff$1 = class FileDiff {
|
|
|
4782
4937
|
const gutterChildren = getElementChildren(ast[0]);
|
|
4783
4938
|
const contentChildren = getElementChildren(ast[1]);
|
|
4784
4939
|
if (gutterChildren == null || contentChildren == null) return false;
|
|
4785
|
-
columns.gutter.innerHTML =
|
|
4786
|
-
columns.content.innerHTML =
|
|
4940
|
+
columns.gutter.innerHTML = hastToHtml(gutterChildren);
|
|
4941
|
+
columns.content.innerHTML = hastToHtml(contentChildren);
|
|
4787
4942
|
if (rowCount !== this.lastRowCount) {
|
|
4788
4943
|
columns.gutter.style.setProperty("grid-row", `span ${rowCount}`);
|
|
4789
4944
|
columns.content.style.setProperty("grid-row", `span ${rowCount}`);
|
|
@@ -4906,7 +5061,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4906
5061
|
else if (diffStyle === "split" && Array.isArray(codeElements)) this.insertPartialHTML(diffStyle, codeElements, result, insertPosition);
|
|
4907
5062
|
else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");
|
|
4908
5063
|
rowCount += result.rowCount;
|
|
4909
|
-
this.
|
|
5064
|
+
this.adoptRenderData(result.fileDiff);
|
|
4910
5065
|
};
|
|
4911
5066
|
this.cleanupErrorWrapper();
|
|
4912
5067
|
applyChunk(prependResult, "afterbegin");
|
|
@@ -4929,7 +5084,7 @@ var FileDiff$1 = class FileDiff {
|
|
|
4929
5084
|
} else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition");
|
|
4930
5085
|
}
|
|
4931
5086
|
refreshSplitDiffView() {
|
|
4932
|
-
const fileDiff = this.
|
|
5087
|
+
const fileDiff = this.getWorkingDiff();
|
|
4933
5088
|
if (this.options.diffStyle !== "split" || fileDiff == null) return;
|
|
4934
5089
|
const hunksResult = this.hunksRenderer.renderDiff(fileDiff, this.renderRange);
|
|
4935
5090
|
if (hunksResult == null) return;
|
|
@@ -4948,10 +5103,10 @@ var FileDiff$1 = class FileDiff {
|
|
|
4948
5103
|
};
|
|
4949
5104
|
applyLineType("deletions", columns[0]);
|
|
4950
5105
|
applyLineType("additions", columns[1]);
|
|
4951
|
-
this.
|
|
5106
|
+
this.adoptRenderData(hunksResult.fileDiff);
|
|
4952
5107
|
}
|
|
4953
5108
|
refreshUnifiedDiffView() {
|
|
4954
|
-
const fileDiff = this.
|
|
5109
|
+
const fileDiff = this.getWorkingDiff();
|
|
4955
5110
|
if (this.options.diffStyle !== "unified" || fileDiff == null) return;
|
|
4956
5111
|
const hunksResult = this.hunksRenderer.renderDiff(fileDiff, this.renderRange);
|
|
4957
5112
|
if (hunksResult == null) return;
|
|
@@ -4961,12 +5116,12 @@ var FileDiff$1 = class FileDiff {
|
|
|
4961
5116
|
const gutterChildren = getElementChildren(ast?.[0]);
|
|
4962
5117
|
const contentChildren = getElementChildren(ast?.[1]);
|
|
4963
5118
|
const applyColumns = () => {
|
|
4964
|
-
for (const [el, astChildren] of [[columns.gutter, gutterChildren], [columns.content, contentChildren]]) if (astChildren != null) el.innerHTML =
|
|
5119
|
+
for (const [el, astChildren] of [[columns.gutter, gutterChildren], [columns.content, contentChildren]]) if (astChildren != null) el.innerHTML = hastToHtml(astChildren);
|
|
4965
5120
|
if (hunksResult.rowCount !== this.lastRowCount) {
|
|
4966
5121
|
this.applyRowSpan("unified", columns, hunksResult.rowCount);
|
|
4967
5122
|
this.lastRowCount = hunksResult.rowCount;
|
|
4968
5123
|
}
|
|
4969
|
-
this.
|
|
5124
|
+
this.adoptRenderData(hunksResult.fileDiff);
|
|
4970
5125
|
};
|
|
4971
5126
|
if (this.shouldGuardRebuildScroll()) guardWebKitScrollDuringRebuild(this.pre, applyColumns);
|
|
4972
5127
|
else applyColumns();
|
|
@@ -5407,13 +5562,12 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5407
5562
|
isSetup = false;
|
|
5408
5563
|
virtualizer;
|
|
5409
5564
|
layoutDirty = true;
|
|
5410
|
-
forceRenderOverride;
|
|
5411
5565
|
currentCollapsed;
|
|
5412
5566
|
pendingHydratedDiff;
|
|
5413
5567
|
pendingExpansions;
|
|
5414
5568
|
pendingRender;
|
|
5415
|
-
constructor(options, virtualizer, metrics, workerManager,
|
|
5416
|
-
super(options, workerManager,
|
|
5569
|
+
constructor(options, virtualizer, metrics, workerManager, requestOwnerRender) {
|
|
5570
|
+
super(options, workerManager, requestOwnerRender);
|
|
5417
5571
|
this.virtualizer = virtualizer;
|
|
5418
5572
|
this.metrics = computeVirtualFileMetrics(metrics);
|
|
5419
5573
|
}
|
|
@@ -5446,7 +5600,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5446
5600
|
return true;
|
|
5447
5601
|
}
|
|
5448
5602
|
hasFileAnnotations(fileDiff) {
|
|
5449
|
-
const lineAnnotations = this.
|
|
5603
|
+
const lineAnnotations = this.getLayoutAnnotations();
|
|
5450
5604
|
if (!includesFileAnnotations(lineAnnotations)) return false;
|
|
5451
5605
|
return lineAnnotations.some((annotation) => {
|
|
5452
5606
|
if (annotation.lineNumber !== 0) return false;
|
|
@@ -5536,7 +5690,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5536
5690
|
this.top = this.getVirtualizedTop();
|
|
5537
5691
|
hasHeightChange = this.applyGhostTextRows(fileDiff, this.editor?.__getGhostTextRows() ?? NO_GHOST_TEXT_ROWS);
|
|
5538
5692
|
const { ghostTextRowsByIndex } = this.cache;
|
|
5539
|
-
const measureAllRows = overflow !== "scroll" || this.
|
|
5693
|
+
const measureAllRows = overflow !== "scroll" || this.lineAnnotations.length > 0 || this.isResizeDebuggingEnabled();
|
|
5540
5694
|
if (this.placeHolder != null || !measureAllRows && this.cache.heightDeltas.size === 0 && this.cache.fileAnnotationHeight === 0) {
|
|
5541
5695
|
if (hasHeightChange) {
|
|
5542
5696
|
this.computeApproximateSize(true);
|
|
@@ -5614,7 +5768,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5614
5768
|
resetEstimatedHeights = true;
|
|
5615
5769
|
}
|
|
5616
5770
|
}
|
|
5617
|
-
const diffChanged = this.
|
|
5771
|
+
const diffChanged = this.updateInputDiff(fileDiff, lineAnnotations);
|
|
5618
5772
|
const { pendingRenderDiff, layoutDiffChanged, renderedDiffChanged, annotationsChanged } = this.updatePendingRender(fileDiff, lineAnnotations);
|
|
5619
5773
|
if (!this.forceRenderOverride && (diffChanged || renderedDiffChanged || annotationsChanged)) this.forceRenderOverride = true;
|
|
5620
5774
|
if (reset?.resetDiffLayoutCache === true || layoutDiffChanged) resetLayoutCache = true;
|
|
@@ -5795,7 +5949,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5795
5949
|
cleanUp(recycle = false) {
|
|
5796
5950
|
const hadGhostTextRows = this.cache.ghostTextRows.size > 0;
|
|
5797
5951
|
if (hadGhostTextRows) this.layoutDirty = true;
|
|
5798
|
-
const shouldRecomputeLayout = recycle && this.isAdvancedMode() && this.fileContainer != null && (hadGhostTextRows || !areDiffTargetsEqual(this.getRenderedDiff(), this.
|
|
5952
|
+
const shouldRecomputeLayout = recycle && this.isAdvancedMode() && this.fileContainer != null && (hadGhostTextRows || !areDiffTargetsEqual(this.getRenderedDiff(), this.getWorkingDiff()));
|
|
5799
5953
|
if (this.fileContainer != null && this.isSimpleMode()) this.getSimpleVirtualizer()?.disconnect(this.fileContainer);
|
|
5800
5954
|
if (!recycle) {
|
|
5801
5955
|
this.resetLayoutCache({ includeEstimatedHeights: true });
|
|
@@ -5808,7 +5962,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5808
5962
|
if (shouldRecomputeLayout) this.virtualizer.instanceChanged(this, true);
|
|
5809
5963
|
}
|
|
5810
5964
|
expandHunk = (hunkIndex, direction, expansionLineCountOverride) => {
|
|
5811
|
-
if (this.
|
|
5965
|
+
if (this.getInputDiff() == null) return;
|
|
5812
5966
|
this.loadFilesIfNecessary();
|
|
5813
5967
|
if (this.isAdvancedMode()) {
|
|
5814
5968
|
this.pendingExpansions ??= [];
|
|
@@ -5826,11 +5980,11 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5826
5980
|
this.virtualizer.instanceChanged(this, true);
|
|
5827
5981
|
};
|
|
5828
5982
|
async handleFilesLoaded(expectedDiff, files) {
|
|
5829
|
-
if (this.
|
|
5983
|
+
if (this.getInputDiff() !== expectedDiff || !expectedDiff.isPartial) return;
|
|
5830
5984
|
if (this.isAdvancedMode()) {
|
|
5831
5985
|
const nextDiff = hydratePartialDiff("clone", expectedDiff, files);
|
|
5832
5986
|
await awaitWithTimeout(() => this.primeHighlightCache(nextDiff));
|
|
5833
|
-
if (this.
|
|
5987
|
+
if (this.getInputDiff() !== expectedDiff) return;
|
|
5834
5988
|
this.pendingHydratedDiff = {
|
|
5835
5989
|
expectedDiff,
|
|
5836
5990
|
nextDiff,
|
|
@@ -5841,7 +5995,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5841
5995
|
this.setHydratedState(files);
|
|
5842
5996
|
if (!this.installHydratedSessionDiff(expectedDiff)) {
|
|
5843
5997
|
await awaitWithTimeout(() => this.primeHighlightCache(expectedDiff));
|
|
5844
|
-
if (this.
|
|
5998
|
+
if (this.getInputDiff() !== expectedDiff) return;
|
|
5845
5999
|
}
|
|
5846
6000
|
this.resetLayoutCache({ includeEstimatedHeights: true });
|
|
5847
6001
|
this.computeApproximateSize();
|
|
@@ -5851,7 +6005,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5851
6005
|
}
|
|
5852
6006
|
loadFilesIfNecessary() {
|
|
5853
6007
|
if (this.pendingHydratedDiff != null) {
|
|
5854
|
-
if (this.pendingHydratedDiff.expectedDiff === this.
|
|
6008
|
+
if (this.pendingHydratedDiff.expectedDiff === this.getInputDiff()) return;
|
|
5855
6009
|
this.pendingHydratedDiff = void 0;
|
|
5856
6010
|
}
|
|
5857
6011
|
super.loadFilesIfNecessary();
|
|
@@ -5900,7 +6054,7 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5900
6054
|
}
|
|
5901
6055
|
escalateEditSessionRender() {
|
|
5902
6056
|
this.invalidateEditSessionLayout();
|
|
5903
|
-
if (!this.enabled || this.
|
|
6057
|
+
if (!this.enabled || this.getInputDiff() == null) return;
|
|
5904
6058
|
this.forceRenderOverride = true;
|
|
5905
6059
|
this.virtualizer.instanceChanged(this, true);
|
|
5906
6060
|
}
|
|
@@ -5919,13 +6073,17 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5919
6073
|
}
|
|
5920
6074
|
}
|
|
5921
6075
|
rerender() {
|
|
5922
|
-
if (!this.enabled || this.
|
|
5923
|
-
const
|
|
5924
|
-
const nextRenderDiff =
|
|
6076
|
+
if (!this.enabled || this.getInputDiff() == null && this.additionFile == null && this.deletionFile == null) return;
|
|
6077
|
+
const workingDiff = this.getWorkingDiff();
|
|
6078
|
+
const nextRenderDiff = workingDiff == null ? void 0 : this.hunksRenderer.getDiffForNextRender(workingDiff);
|
|
5925
6079
|
if (this.isSimpleMode()) this.pendingRender = void 0;
|
|
5926
6080
|
this.forceRenderOverride = true;
|
|
6081
|
+
if (this.isSimpleMode() && this.requestRender()) return;
|
|
5927
6082
|
this.virtualizer.instanceChanged(this, !areDiffTargetsEqual(this.getRenderedDiff(), nextRenderDiff));
|
|
5928
6083
|
}
|
|
6084
|
+
get isComponentManaged() {
|
|
6085
|
+
return this.getAdvancedVirtualizer()?.isComponentManaged ?? super.isComponentManaged;
|
|
6086
|
+
}
|
|
5929
6087
|
syncGhostTextRows() {
|
|
5930
6088
|
const codeView = this.getAdvancedVirtualizer();
|
|
5931
6089
|
if (codeView != null) {
|
|
@@ -5979,6 +6137,10 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
5979
6137
|
getLayoutDiff() {
|
|
5980
6138
|
return this.pendingRender?.diff ?? this.getRenderedDiff();
|
|
5981
6139
|
}
|
|
6140
|
+
getLayoutAnnotations() {
|
|
6141
|
+
const { pendingRender } = this;
|
|
6142
|
+
return pendingRender != null ? this.getAnnotationsForDiff(pendingRender.diff) : this.lineAnnotations;
|
|
6143
|
+
}
|
|
5982
6144
|
getActiveEstimatedHeight(fileDiff = this.getLayoutDiff()) {
|
|
5983
6145
|
this.ensureEstimatedDiffHeights(fileDiff);
|
|
5984
6146
|
const estimatedHeight = this.getDiffStyle() === "split" ? this.cache.estimatedSplitHeight : this.cache.estimatedUnifiedHeight;
|
|
@@ -6022,20 +6184,20 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
6022
6184
|
const oldFile = fileInput?.oldFile;
|
|
6023
6185
|
const newFile = fileInput?.newFile;
|
|
6024
6186
|
const filesDidChange = hasFileInput && (!areOptionalFilesEqual(oldFile, this.deletionFile) || !areOptionalFilesEqual(newFile, this.additionFile));
|
|
6025
|
-
let nextFileDiff = fileDiff ?? this.
|
|
6026
|
-
if (fileDiff == null && hasFileInput && (filesDidChange || this.
|
|
6187
|
+
let nextFileDiff = fileDiff ?? this.getInputDiff();
|
|
6188
|
+
if (fileDiff == null && hasFileInput && (filesDidChange || this.getInputDiff() == null)) nextFileDiff = parseDiffFromFile(fileInput.oldFile, fileInput.newFile, this.options.parseDiffOptions);
|
|
6027
6189
|
const { forceRenderOverride, isSetup } = this;
|
|
6028
6190
|
this.forceRenderOverride = void 0;
|
|
6029
|
-
const targetChanged = nextFileDiff != null && !areDiffTargetsEqual(this.
|
|
6191
|
+
const targetChanged = nextFileDiff != null && !areDiffTargetsEqual(this.getInputDiff(), nextFileDiff);
|
|
6030
6192
|
const dataChanged = targetChanged || filesDidChange;
|
|
6031
6193
|
fileContainer = this.getOrCreateFileContainer(fileContainer);
|
|
6032
6194
|
if (nextFileDiff == null) {
|
|
6033
6195
|
console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data");
|
|
6034
6196
|
return false;
|
|
6035
6197
|
}
|
|
6036
|
-
if (targetChanged) this.
|
|
6198
|
+
if (targetChanged) this.updateInputDiff(nextFileDiff, lineAnnotations);
|
|
6037
6199
|
const { pendingRenderDiff, layoutDiffChanged, renderedDiffChanged, annotationsChanged } = (() => {
|
|
6038
|
-
if (this.pendingRender != null && this.pendingRender.
|
|
6200
|
+
if (this.pendingRender != null && this.pendingRender.workingDiff === (this.getWorkingDiff(nextFileDiff) ?? nextFileDiff)) return {
|
|
6039
6201
|
pendingRenderDiff: this.pendingRender.diff,
|
|
6040
6202
|
layoutDiffChanged: false,
|
|
6041
6203
|
renderedDiffChanged: false,
|
|
@@ -6089,13 +6251,13 @@ var VirtualizedFileDiff = class extends FileDiff$1 {
|
|
|
6089
6251
|
if (this.isSimpleMode()) this.getSimpleVirtualizer()?.requestHeightReconcile(this);
|
|
6090
6252
|
}
|
|
6091
6253
|
updatePendingRender(nextFileDiff, lineAnnotations) {
|
|
6092
|
-
const
|
|
6254
|
+
const workingDiff = this.getWorkingDiff(nextFileDiff) ?? nextFileDiff;
|
|
6093
6255
|
const previousRenderedDiff = this.getRenderedDiff();
|
|
6094
6256
|
const { pendingRender } = this;
|
|
6095
6257
|
const previousLayoutDiff = pendingRender?.diff ?? previousRenderedDiff;
|
|
6096
|
-
const pendingRenderDiff = this.hunksRenderer.getDiffForNextRender(
|
|
6258
|
+
const pendingRenderDiff = this.hunksRenderer.getDiffForNextRender(workingDiff);
|
|
6097
6259
|
this.pendingRender = {
|
|
6098
|
-
|
|
6260
|
+
workingDiff,
|
|
6099
6261
|
diff: pendingRenderDiff
|
|
6100
6262
|
};
|
|
6101
6263
|
return {
|
|
@@ -6566,7 +6728,7 @@ function renderDiffChildren({ fileDiff, actions, renderCustomHeader, renderHeade
|
|
|
6566
6728
|
] }),
|
|
6567
6729
|
renderAnnotation != null && lineAnnotations?.map((annotation, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
6568
6730
|
slot: getAnnotationSlotName(annotation),
|
|
6569
|
-
children: renderAnnotation(annotation)
|
|
6731
|
+
children: renderAnnotation(annotation, fileDiff)
|
|
6570
6732
|
}, index)),
|
|
6571
6733
|
actions != null && renderMergeConflictUtility != null && getInstance != null && actions.map((action) => {
|
|
6572
6734
|
if (action == null) return;
|
|
@@ -6636,6 +6798,12 @@ function useFileDiffInstance({ fileDiff, oldFile, newFile, options, editorOption
|
|
|
6636
6798
|
parseDiffOptions: options?.parseDiffOptions
|
|
6637
6799
|
});
|
|
6638
6800
|
const instanceRef = reactExports.useRef(null);
|
|
6801
|
+
const forceUpdate = useForceUpdate();
|
|
6802
|
+
const accepted = useAcceptedValues(acceptedCache, effectiveFileDiff, lineAnnotations);
|
|
6803
|
+
const renderData = useNextRenderData(instanceRef, accepted) ?? {
|
|
6804
|
+
fileDiff: effectiveFileDiff,
|
|
6805
|
+
lineAnnotations: lineAnnotations ?? EMPTY_LINE_ANNOTATIONS
|
|
6806
|
+
};
|
|
6639
6807
|
const disposeEditorRef = reactExports.useRef(null);
|
|
6640
6808
|
const pendingAttachRef = reactExports.useRef(null);
|
|
6641
6809
|
const getEditor = useStableCallback(() => {
|
|
@@ -6652,7 +6820,7 @@ function useFileDiffInstance({ fileDiff, oldFile, newFile, options, editorOption
|
|
|
6652
6820
|
onEditChange,
|
|
6653
6821
|
onEditComplete,
|
|
6654
6822
|
options
|
|
6655
|
-
}), simpleVirtualizer, metrics, !disableWorkerPool ? poolManager : void 0,
|
|
6823
|
+
}), simpleVirtualizer, metrics, !disableWorkerPool ? poolManager : void 0, forceUpdate);
|
|
6656
6824
|
else instanceRef.current = new FileDiff$1(mergeFileDiffOptions({
|
|
6657
6825
|
controlledSelection,
|
|
6658
6826
|
hasCustomHeader,
|
|
@@ -6660,7 +6828,7 @@ function useFileDiffInstance({ fileDiff, oldFile, newFile, options, editorOption
|
|
|
6660
6828
|
onEditChange,
|
|
6661
6829
|
onEditComplete,
|
|
6662
6830
|
options
|
|
6663
|
-
}), !disableWorkerPool ? poolManager : void 0,
|
|
6831
|
+
}), !disableWorkerPool ? poolManager : void 0, forceUpdate);
|
|
6664
6832
|
instanceRef.current.hydrate({
|
|
6665
6833
|
fileDiff: effectiveFileDiff,
|
|
6666
6834
|
fileContainer,
|
|
@@ -6686,7 +6854,7 @@ function useFileDiffInstance({ fileDiff, oldFile, newFile, options, editorOption
|
|
|
6686
6854
|
onEditComplete,
|
|
6687
6855
|
options
|
|
6688
6856
|
});
|
|
6689
|
-
const forceRender =
|
|
6857
|
+
const forceRender = !areOptionsEqual(instance.options, newOptions);
|
|
6690
6858
|
instance.setOptions(newOptions);
|
|
6691
6859
|
if (!edit) {
|
|
6692
6860
|
pendingAttachRef.current = null;
|
|
@@ -6708,6 +6876,7 @@ function useFileDiffInstance({ fileDiff, oldFile, newFile, options, editorOption
|
|
|
6708
6876
|
const attach = () => {
|
|
6709
6877
|
if (instanceRef.current !== instance || disposeEditorRef.current != null || !instance.__canAttachEditor()) return;
|
|
6710
6878
|
disposeEditorRef.current = applyEdit(instance, getEditor);
|
|
6879
|
+
forceUpdate();
|
|
6711
6880
|
};
|
|
6712
6881
|
if (instance.__canAttachEditor()) {
|
|
6713
6882
|
pendingAttachRef.current = null;
|
|
@@ -6739,7 +6908,7 @@ function useFileDiffInstance({ fileDiff, oldFile, newFile, options, editorOption
|
|
|
6739
6908
|
const getAnnotationSlotName = reactExports.useCallback((annotation) => instanceRef.current?.getAnnotationSlotName(annotation) ?? getLineAnnotationName(annotation), []);
|
|
6740
6909
|
if (asyncAttachError != null) throw asyncAttachError;
|
|
6741
6910
|
return {
|
|
6742
|
-
|
|
6911
|
+
...renderData,
|
|
6743
6912
|
ref,
|
|
6744
6913
|
getHoveredLine,
|
|
6745
6914
|
getAnnotationSlotName
|
|
@@ -6766,31 +6935,26 @@ function useEffectiveFileDiff({ acceptedCache, fileDiff, newFile, oldFile, parse
|
|
|
6766
6935
|
function isSameFilePair(oldFile, newFile, filePair) {
|
|
6767
6936
|
return areFileTargetsEqual(oldFile ?? void 0, filePair.oldFile ?? void 0) && areFileTargetsEqual(newFile ?? void 0, filePair.newFile ?? void 0);
|
|
6768
6937
|
}
|
|
6938
|
+
function useAcceptedValues(acceptedCache, fileDiff, lineAnnotations) {
|
|
6939
|
+
"use no memo";
|
|
6940
|
+
return getAcceptedValues(fileDiff, lineAnnotations, acceptedCache.current);
|
|
6941
|
+
}
|
|
6942
|
+
function getAcceptedValues(fileDiff, lineAnnotations, accepted) {
|
|
6943
|
+
return {
|
|
6944
|
+
fileDiff: accepted?.fileDiff != null && areDiffTargetsEqual(fileDiff, accepted.fileDiff.stale) ? accepted.fileDiff.installed : fileDiff,
|
|
6945
|
+
lineAnnotations: accepted?.annotations != null && lineAnnotations === accepted.annotations.stale ? accepted.annotations.installed : lineAnnotations
|
|
6946
|
+
};
|
|
6947
|
+
}
|
|
6769
6948
|
function resolveAcceptedValues(fileDiff, lineAnnotations, acceptedCache) {
|
|
6770
6949
|
const { current: accepted } = acceptedCache;
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
const { fileDiff: acceptedDiff, annotations: acceptedAnnotations } = accepted;
|
|
6776
|
-
let resolvedFileDiff = fileDiff;
|
|
6777
|
-
if (acceptedDiff != null) {
|
|
6778
|
-
if (areDiffTargetsEqual(fileDiff, acceptedDiff.stale)) resolvedFileDiff = acceptedDiff.installed;
|
|
6779
|
-
else accepted.fileDiff = null;
|
|
6780
|
-
}
|
|
6781
|
-
let resolvedAnnotations = lineAnnotations;
|
|
6782
|
-
if (acceptedAnnotations != null) {
|
|
6783
|
-
if (lineAnnotations === acceptedAnnotations.stale) resolvedAnnotations = acceptedAnnotations.installed;
|
|
6784
|
-
else accepted.annotations = null;
|
|
6785
|
-
}
|
|
6950
|
+
const resolved = getAcceptedValues(fileDiff, lineAnnotations, accepted);
|
|
6951
|
+
if (accepted == null) return resolved;
|
|
6952
|
+
if (accepted.fileDiff != null && !areDiffTargetsEqual(fileDiff, accepted.fileDiff.stale)) accepted.fileDiff = null;
|
|
6953
|
+
if (lineAnnotations !== accepted.annotations?.stale) accepted.annotations = null;
|
|
6786
6954
|
if (accepted.fileDiff == null && accepted.annotations == null && accepted.filePair == null) acceptedCache.current = null;
|
|
6787
|
-
return
|
|
6788
|
-
fileDiff: resolvedFileDiff,
|
|
6789
|
-
lineAnnotations: resolvedAnnotations
|
|
6790
|
-
};
|
|
6955
|
+
return resolved;
|
|
6791
6956
|
}
|
|
6792
6957
|
function mergeFileDiffOptions({ options, controlledSelection, hasCustomHeader, hasGutterRenderUtility, onEditChange, onEditComplete }) {
|
|
6793
|
-
if (!(controlledSelection || hasGutterRenderUtility || hasCustomHeader || onEditChange != null || onEditComplete != null)) return options;
|
|
6794
6958
|
return {
|
|
6795
6959
|
...options,
|
|
6796
6960
|
controlledSelection,
|
|
@@ -6810,7 +6974,7 @@ function applyEdit(instance, getEditor) {
|
|
|
6810
6974
|
}
|
|
6811
6975
|
}
|
|
6812
6976
|
function FileDiff2({ fileDiff, options, editorOptions, editStateKey, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderCustomHeader, renderHeaderPrefix, renderHeaderFilenameSuffix, renderHeaderMetadata, renderGutterUtility, disableWorkerPool = false, edit = false, onEditChange, onEditComplete }) {
|
|
6813
|
-
const { ref, getHoveredLine, getAnnotationSlotName } = useFileDiffInstance({
|
|
6977
|
+
const { ref, getHoveredLine, getAnnotationSlotName, fileDiff: renderedDiff, lineAnnotations: renderedAnnotations } = useFileDiffInstance({
|
|
6814
6978
|
fileDiff,
|
|
6815
6979
|
options,
|
|
6816
6980
|
editorOptions,
|
|
@@ -6827,14 +6991,14 @@ function FileDiff2({ fileDiff, options, editorOptions, editStateKey, metrics, li
|
|
|
6827
6991
|
onEditComplete
|
|
6828
6992
|
});
|
|
6829
6993
|
const children = renderDiffChildren({
|
|
6830
|
-
fileDiff,
|
|
6994
|
+
fileDiff: renderedDiff,
|
|
6831
6995
|
renderCustomHeader,
|
|
6832
6996
|
renderHeaderPrefix,
|
|
6833
6997
|
renderHeaderFilenameSuffix,
|
|
6834
6998
|
renderHeaderMetadata,
|
|
6835
6999
|
renderAnnotation,
|
|
6836
7000
|
renderGutterUtility,
|
|
6837
|
-
lineAnnotations,
|
|
7001
|
+
lineAnnotations: renderedAnnotations,
|
|
6838
7002
|
getHoveredLine,
|
|
6839
7003
|
getAnnotationSlotName
|
|
6840
7004
|
});
|
|
@@ -6847,7 +7011,7 @@ function FileDiff2({ fileDiff, options, editorOptions, editStateKey, metrics, li
|
|
|
6847
7011
|
}
|
|
6848
7012
|
function PatchDiff({ patch, options, editorOptions, editStateKey, metrics, lineAnnotations, selectedLines, className, style, prerenderedHTML, renderAnnotation, renderCustomHeader, renderHeaderPrefix, renderHeaderFilenameSuffix, renderHeaderMetadata, renderGutterUtility, disableWorkerPool = false, edit = false, onEditChange, onEditComplete }) {
|
|
6849
7013
|
const fileDiff = usePatch(patch);
|
|
6850
|
-
const { ref, getHoveredLine, getAnnotationSlotName } = useFileDiffInstance({
|
|
7014
|
+
const { ref, getHoveredLine, getAnnotationSlotName, fileDiff: renderedDiff, lineAnnotations: renderedAnnotations } = useFileDiffInstance({
|
|
6851
7015
|
fileDiff,
|
|
6852
7016
|
options,
|
|
6853
7017
|
editorOptions,
|
|
@@ -6864,13 +7028,13 @@ function PatchDiff({ patch, options, editorOptions, editStateKey, metrics, lineA
|
|
|
6864
7028
|
onEditComplete
|
|
6865
7029
|
});
|
|
6866
7030
|
const children = renderDiffChildren({
|
|
6867
|
-
fileDiff,
|
|
7031
|
+
fileDiff: renderedDiff,
|
|
6868
7032
|
renderCustomHeader,
|
|
6869
7033
|
renderHeaderPrefix,
|
|
6870
7034
|
renderHeaderFilenameSuffix,
|
|
6871
7035
|
renderHeaderMetadata,
|
|
6872
7036
|
renderAnnotation,
|
|
6873
|
-
lineAnnotations,
|
|
7037
|
+
lineAnnotations: renderedAnnotations,
|
|
6874
7038
|
renderGutterUtility,
|
|
6875
7039
|
getHoveredLine,
|
|
6876
7040
|
getAnnotationSlotName
|