@bud.sh/app 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hosted/hosted.js +121 -35
- package/dist/node-host/assets/abap-LtYK6g-v.js +3 -0
- package/dist/node-host/assets/actionscript-3-CfsDl31I.js +3 -0
- package/dist/node-host/assets/ada-CvTdxb4T.js +3 -0
- package/dist/node-host/assets/ahk-HN_I_y_3.js +3 -0
- package/dist/node-host/assets/ahk2-bJ5Wm9-K.js +3 -0
- package/dist/node-host/assets/andromeeda-BASpqCeJ.js +4 -0
- package/dist/node-host/assets/angular-html-C4SmZqv0.js +33 -0
- package/dist/node-host/assets/angular-ts-X1i_WOxI.js +27 -0
- package/dist/node-host/assets/apache-BIl2qPOf.js +3 -0
- package/dist/node-host/assets/apex-CybrBQ0z.js +3 -0
- package/dist/node-host/assets/api_vite-DSBC5Nzy.js +5 -0
- package/dist/node-host/assets/apl-CDTyNgE2.js +17 -0
- package/dist/node-host/assets/applescript-CJ80B5XJ.js +3 -0
- package/dist/node-host/assets/ara-IxnQjO6j.js +3 -0
- package/dist/node-host/assets/asciidoc-xKuVlNk6.js +3 -0
- package/dist/node-host/assets/asm-wBDSgBbA.js +3 -0
- package/dist/node-host/assets/astro-BiZFCPSt.js +19 -0
- package/dist/node-host/assets/aurora-x-DugsLcii.js +4 -0
- package/dist/node-host/assets/awk-D6dA05Ye.js +3 -0
- package/dist/node-host/assets/ayu-dark-BT3qdi3o.js +4 -0
- package/dist/node-host/assets/ayu-light-BVZyHoh9.js +4 -0
- package/dist/node-host/assets/ayu-mirage-XFwUVZQZ.js +4 -0
- package/dist/node-host/assets/ballerina-DIdXD2KH.js +3 -0
- package/dist/node-host/assets/bat-Dx8nnxXE.js +3 -0
- package/dist/node-host/assets/beancount-BG2UQN2D.js +3 -0
- package/dist/node-host/assets/berry-CgA2ea0_.js +3 -0
- package/dist/node-host/assets/bibtex-BzgdqG3s.js +3 -0
- package/dist/node-host/assets/bicep-CZ338dSk.js +3 -0
- package/dist/node-host/assets/bird2-BMprQDNV.js +3 -0
- package/dist/node-host/assets/blade-cZjv4Qad.js +21 -0
- package/dist/node-host/assets/bsl-Bh8bzcoy.js +6 -0
- package/dist/node-host/assets/build-Dn-L17Oj.js +5372 -0
- package/dist/node-host/assets/c-BXsbGxlp.js +6 -0
- package/dist/node-host/assets/c3-u0qNrniV.js +3 -0
- package/dist/node-host/assets/cadence-B1ELWULD.js +3 -0
- package/dist/node-host/assets/cairo-BsQhEq3R.js +6 -0
- package/dist/node-host/assets/canvas-BZhzizzt.js +1066 -0
- package/dist/node-host/assets/catppuccin-frappe-D20KODDN.js +4 -0
- package/dist/node-host/assets/catppuccin-latte-eGLVHIUJ.js +4 -0
- package/dist/node-host/assets/catppuccin-macchiato-bQGch4PY.js +4 -0
- package/dist/node-host/assets/catppuccin-mocha-Bes8-0Mr.js +4 -0
- package/dist/node-host/assets/chapel-cEZNBFmv.js +6 -0
- package/dist/node-host/assets/clarity-BkOxTQMf.js +3 -0
- package/dist/node-host/assets/clojure-DDsQ0FaV.js +3 -0
- package/dist/node-host/assets/cloneFileDiffMetadata-C1BcNpxN.js +3075 -0
- package/dist/node-host/assets/cmake-DPsCB_V6.js +3 -0
- package/dist/node-host/assets/cobol-BpMD18Rr.js +11 -0
- package/dist/node-host/assets/codeowners-CxEKPWu0.js +3 -0
- package/dist/node-host/assets/codeql-BwdvwJnv.js +3 -0
- package/dist/node-host/assets/coffee-BX_u-2R1.js +6 -0
- package/dist/node-host/assets/comment-data-nUlI0szN.js +92501 -0
- package/dist/node-host/assets/common-lisp-DJtwvW4V.js +3 -0
- package/dist/node-host/assets/coq-Byd42hNw.js +3 -0
- package/dist/node-host/assets/cpp-DjJRL98I.js +22 -0
- package/dist/node-host/assets/crystal-Cz-dKioR.js +19 -0
- package/dist/node-host/assets/csharp-Cx443ZdC.js +3 -0
- package/dist/node-host/assets/css-CWNyyZRg.js +6 -0
- package/dist/node-host/assets/csv-DqIVFkK7.js +3 -0
- package/dist/node-host/assets/cue-B5KneM5p.js +3 -0
- package/dist/node-host/assets/cypher-D8Bb8Cq2.js +3 -0
- package/dist/node-host/assets/d-BQY8TDgQ.js +3 -0
- package/dist/node-host/assets/dark-plus-BGuiqa1B.js +4 -0
- package/dist/node-host/assets/dart-BZ3YsgDB.js +3 -0
- package/dist/node-host/assets/dax-S-Noo-ku.js +3 -0
- package/dist/node-host/assets/desktop-BgOb7Aj4.js +3 -0
- package/dist/node-host/assets/diff-Blb4MjsC.js +3 -0
- package/dist/node-host/assets/dist-CVXhIZqO.js +6659 -0
- package/dist/node-host/assets/docker-PC1tuYpa.js +3 -0
- package/dist/node-host/assets/dotenv-BNWDqzYB.js +3 -0
- package/dist/node-host/assets/dracula-0CVA2XY5.js +4 -0
- package/dist/node-host/assets/dracula-soft-Dk9bpbVU.js +4 -0
- package/dist/node-host/assets/dream-maker-CngiPd8U.js +3 -0
- package/dist/node-host/assets/edge-D1_nghia.js +13 -0
- package/dist/node-host/assets/edit-DjpTbnEc.js +9788 -0
- package/dist/node-host/assets/elixir-x6BMZ6zW.js +6 -0
- package/dist/node-host/assets/elm-CiAjb3qf.js +6 -0
- package/dist/node-host/assets/emacs-lisp-DPCJASlD.js +3 -0
- package/dist/node-host/assets/erb-DzXTnEFa.js +11 -0
- package/dist/node-host/assets/erlang-DALBVNgL.js +6 -0
- package/dist/node-host/assets/everforest-dark-CRjTbhh5.js +4 -0
- package/dist/node-host/assets/everforest-light-CEeYFLn8.js +4 -0
- package/dist/node-host/assets/fennel-B3wtZRne.js +3 -0
- package/dist/node-host/assets/files-CTzcWGjb.js +3771 -0
- package/dist/node-host/assets/fish-D7qAeWQz.js +3 -0
- package/dist/node-host/assets/fluent-BjfpB34g.js +3 -0
- package/dist/node-host/assets/fortran-fixed-form-BbzsUHx4.js +6 -0
- package/dist/node-host/assets/fortran-free-form-yxJ7igsv.js +3 -0
- package/dist/node-host/assets/fsharp-D2o1Vyx0.js +6 -0
- package/dist/node-host/assets/gdresource-aTcOcjSd.js +11 -0
- package/dist/node-host/assets/gdscript-CSSSWtkL.js +3 -0
- package/dist/node-host/assets/gdshader-D7JfdFV3.js +3 -0
- package/dist/node-host/assets/genie-DnK2KWIP.js +3 -0
- package/dist/node-host/assets/gherkin-D6Lr12YQ.js +3 -0
- package/dist/node-host/assets/git-commit-BU1ZeqU-.js +6 -0
- package/dist/node-host/assets/git-rebase-BBwLmuqc.js +6 -0
- package/dist/node-host/assets/github-dark-BXgKmOw_.js +4 -0
- package/dist/node-host/assets/github-dark-default-DzJQXksd.js +4 -0
- package/dist/node-host/assets/github-dark-dimmed-B1pEmGtS.js +4 -0
- package/dist/node-host/assets/github-dark-high-contrast-BkHIa6jc.js +4 -0
- package/dist/node-host/assets/github-light-BKRlUbaB.js +4 -0
- package/dist/node-host/assets/github-light-default-BU3eYkzs.js +4 -0
- package/dist/node-host/assets/github-light-high-contrast-B3MumDcI.js +4 -0
- package/dist/node-host/assets/gleam-CTllUdfC.js +3 -0
- package/dist/node-host/assets/glimmer-js-Cr4KUylv.js +15 -0
- package/dist/node-host/assets/glimmer-ts-W_3bhuUU.js +15 -0
- package/dist/node-host/assets/glsl-CV8OarLe.js +8 -0
- package/dist/node-host/assets/gn-CpIn4Dcw.js +3 -0
- package/dist/node-host/assets/gnuplot-DgWvVXI8.js +3 -0
- package/dist/node-host/assets/go-aXtTCanQ.js +3 -0
- package/dist/node-host/assets/graphql-BzQEBhBd.js +17 -0
- package/dist/node-host/assets/groovy-Bw2Ku4bU.js +3 -0
- package/dist/node-host/assets/gruvbox-dark-hard-B0ecF443.js +4 -0
- package/dist/node-host/assets/gruvbox-dark-medium-BQnpC39k.js +4 -0
- package/dist/node-host/assets/gruvbox-dark-soft-DFZUgESr.js +4 -0
- package/dist/node-host/assets/gruvbox-light-hard-CuB_LOJr.js +4 -0
- package/dist/node-host/assets/gruvbox-light-medium-idDHgxjs.js +4 -0
- package/dist/node-host/assets/gruvbox-light-soft-CfWH49MY.js +4 -0
- package/dist/node-host/assets/hack-DhYZEMlu.js +11 -0
- package/dist/node-host/assets/haml-CRid5kR3.js +13 -0
- package/dist/node-host/assets/handlebars-Sm6kCGmL.js +15 -0
- package/dist/node-host/assets/haskell-CfGsE1Cf.js +3 -0
- package/dist/node-host/assets/haxe-QaqXWmIB.js +3 -0
- package/dist/node-host/assets/hcl-DHg_Osgo.js +3 -0
- package/dist/node-host/assets/hjson-Cuaphql8.js +3 -0
- package/dist/node-host/assets/hlsl-BJLUNfne.js +3 -0
- package/dist/node-host/assets/horizon-bright-Ba6M8QSV.js +4 -0
- package/dist/node-host/assets/horizon-h92C5OlZ.js +4 -0
- package/dist/node-host/assets/houston-EQnPegWq.js +4 -0
- package/dist/node-host/assets/html-derivative-Cm8plTfc.js +6 -0
- package/dist/node-host/assets/html-j1vihRKA.js +13 -0
- package/dist/node-host/assets/http-BZNc4yhO.js +15 -0
- package/dist/node-host/assets/hurl-O8ckTHPH.js +13 -0
- package/dist/node-host/assets/hxml-9hvSHCPQ.js +6 -0
- package/dist/node-host/assets/hy-CJKxDzbh.js +3 -0
- package/dist/node-host/assets/imba-96qKoJCa.js +3 -0
- package/dist/node-host/assets/ini-C24lZfdM.js +3 -0
- package/dist/node-host/assets/java-CFxSaKyu.js +6 -0
- package/dist/node-host/assets/javascript-D44WgUBn.js +6 -0
- package/dist/node-host/assets/jinja-BkVH86If.js +10 -0
- package/dist/node-host/assets/jison-DOInKsmT.js +6 -0
- package/dist/node-host/assets/jiti-CjBwKumX.js +5461 -0
- package/dist/node-host/assets/json-CnGl9idC.js +6 -0
- package/dist/node-host/assets/json5-xULSgPQI.js +3 -0
- package/dist/node-host/assets/jsonc-Cu6rqcrJ.js +3 -0
- package/dist/node-host/assets/jsonl-Bp0qqr10.js +3 -0
- package/dist/node-host/assets/jsonnet-BafgE6cE.js +3 -0
- package/dist/node-host/assets/jssm-Dx5A5sBR.js +3 -0
- package/dist/node-host/assets/jsx-Dv6553c2.js +6 -0
- package/dist/node-host/assets/julia-CnoY-eZu.js +17 -0
- package/dist/node-host/assets/just-rCgUmVkD.js +19 -0
- package/dist/node-host/assets/kanagawa-dragon-DgDvwi3B.js +4 -0
- package/dist/node-host/assets/kanagawa-lotus-BgoQro20.js +4 -0
- package/dist/node-host/assets/kanagawa-wave-DgXEowHs.js +4 -0
- package/dist/node-host/assets/kdl-DkTyxPcj.js +3 -0
- package/dist/node-host/assets/kotlin-BHE8CoV9.js +3 -0
- package/dist/node-host/assets/kusto-6FdaWTzR.js +3 -0
- package/dist/node-host/assets/laserwave-IxBH_3yW.js +4 -0
- package/dist/node-host/assets/latex-DTvJHHg_.js +6 -0
- package/dist/node-host/assets/lean-BwOKScIt.js +3 -0
- package/dist/node-host/assets/less-BzbdhFUi.js +3 -0
- package/dist/node-host/assets/lib-BzDu3tbz.js +17484 -0
- package/dist/node-host/assets/light-plus-S8JBx6is.js +4 -0
- package/dist/node-host/assets/liquid-praBF2DO.js +15 -0
- package/dist/node-host/assets/llvm-ZNG_yAr9.js +3 -0
- package/dist/node-host/assets/log-Dad54gsi.js +3 -0
- package/dist/node-host/assets/logo-DTXV8SKw.js +3 -0
- package/dist/node-host/assets/lru-C0_oUet4.js +134 -0
- package/dist/node-host/assets/lua-CiYoSQn2.js +8 -0
- package/dist/node-host/assets/luau-DlImmvOM.js +3 -0
- package/dist/node-host/assets/main-D0ab5M4V.js +2353 -0
- package/dist/node-host/assets/make-B2ukzWs3.js +3 -0
- package/dist/node-host/assets/markdown-CkmxmzqY.js +3 -0
- package/dist/node-host/assets/marko-Din1W3ot.js +15 -0
- package/dist/node-host/assets/material-theme-D1f3HBq-.js +4 -0
- package/dist/node-host/assets/material-theme-darker-ExzYhT0j.js +4 -0
- package/dist/node-host/assets/material-theme-lighter-D6gH9nnA.js +4 -0
- package/dist/node-host/assets/material-theme-ocean-D1w5BPAa.js +4 -0
- package/dist/node-host/assets/material-theme-palenight-CkqWmVpF.js +4 -0
- package/dist/node-host/assets/matlab-CfRK6IMC.js +3 -0
- package/dist/node-host/assets/mdc-DrUS0kOP.js +13 -0
- package/dist/node-host/assets/mdx-BK9ZufRc.js +3 -0
- package/dist/node-host/assets/mermaid-ItFqCK9s.js +3 -0
- package/dist/node-host/assets/min-dark-npsJH98j.js +4 -0
- package/dist/node-host/assets/min-light-DUk1XsVt.js +4 -0
- package/dist/node-host/assets/mipsasm-EL46Y4Xg.js +3 -0
- package/dist/node-host/assets/mojo-CsUSYzsu.js +3 -0
- package/dist/node-host/assets/monokai-CfFRWUNl.js +4 -0
- package/dist/node-host/assets/moonbit-BuY4M1CG.js +3 -0
- package/dist/node-host/assets/move-B-o8dn0N.js +3 -0
- package/dist/node-host/assets/narrat-D9rrR0H5.js +3 -0
- package/dist/node-host/assets/nextflow-ByPelpfh.js +6 -0
- package/dist/node-host/assets/nextflow-groovy-kiH-pxwE.js +3 -0
- package/dist/node-host/assets/nginx-CqxQjy7t.js +6 -0
- package/dist/node-host/assets/night-owl-BS7V-av_.js +4 -0
- package/dist/node-host/assets/night-owl-light-CZtRawYE.js +4 -0
- package/dist/node-host/assets/nim-BJfyW_Eo.js +21 -0
- package/dist/node-host/assets/nix-NHxlegoK.js +7 -0
- package/dist/node-host/assets/node-CaLaDAar.js +783 -0
- package/dist/node-host/assets/nord-BFh54Nqz.js +4 -0
- package/dist/node-host/assets/nsis-C3tUpeAt.js +3 -0
- package/dist/node-host/assets/nushell-Dx3871HW.js +3 -0
- package/dist/node-host/assets/objective-c-6dJF64Dt.js +3 -0
- package/dist/node-host/assets/objective-cpp-_ooRQ-PY.js +3 -0
- package/dist/node-host/assets/ocaml-vm1Y8An6.js +3 -0
- package/dist/node-host/assets/odin-vjOJSyfV.js +3 -0
- package/dist/node-host/assets/one-dark-pro-zDovGosB.js +4 -0
- package/dist/node-host/assets/one-light-gmHK3iK6.js +4 -0
- package/dist/node-host/assets/openscad-jn-f1Ocl.js +3 -0
- package/dist/node-host/assets/org-kbyZnkNe.js +101 -0
- package/dist/node-host/assets/pages-0aWH7z1j.js +578 -0
- package/dist/node-host/assets/pascal-D8-gNZ2I.js +3 -0
- package/dist/node-host/assets/perl-Ck21ZEIA.js +17 -0
- package/dist/node-host/assets/php-BI2xxNig.js +19 -0
- package/dist/node-host/assets/pierre-dark-DDWDl8g6.js +4 -0
- package/dist/node-host/assets/pierre-dark-protanopia-deuteranopia-C35UMuvO.js +4 -0
- package/dist/node-host/assets/pierre-dark-soft-Bb-4-biO.js +4 -0
- package/dist/node-host/assets/pierre-dark-tritanopia-CIJISGWF.js +4 -0
- package/dist/node-host/assets/pierre-dark-vibrant-8oZzB3gw.js +4 -0
- package/dist/node-host/assets/pierre-light-CWhW4NrH.js +4 -0
- package/dist/node-host/assets/pierre-light-protanopia-deuteranopia-u0U7N4Hn.js +4 -0
- package/dist/node-host/assets/pierre-light-soft-BCU6fuhO.js +4 -0
- package/dist/node-host/assets/pierre-light-tritanopia-3c8Yx3co.js +4 -0
- package/dist/node-host/assets/pierre-light-vibrant-Cwh332o_.js +4 -0
- package/dist/node-host/assets/pkl-C7lWzykI.js +3 -0
- package/dist/node-host/assets/plastic-DtdaCjub.js +4 -0
- package/dist/node-host/assets/plsql-DCNXypXO.js +3 -0
- package/dist/node-host/assets/po-IjpR1yHO.js +3 -0
- package/dist/node-host/assets/poimandres-Hdda6aHK.js +4 -0
- package/dist/node-host/assets/polar-4pN1JrJ8.js +3 -0
- package/dist/node-host/assets/postcss-0FnF2XR3.js +5833 -0
- package/dist/node-host/assets/postcss-D1gKt4z_.js +3 -0
- package/dist/node-host/assets/postcss-import-D5DErX4i.js +445 -0
- package/dist/node-host/assets/powerquery-SrvS_NBM.js +3 -0
- package/dist/node-host/assets/powershell-DvPkO2jl.js +3 -0
- package/dist/node-host/assets/prisma-4G_BaF_i.js +3 -0
- package/dist/node-host/assets/project-branches-1zs_0J_y.js +600 -0
- package/dist/node-host/assets/project-thread-links-LpUAGcDr.js +241 -0
- package/dist/node-host/assets/prolog-Bacii3Ue.js +3 -0
- package/dist/node-host/assets/prompt-CH6TK0bC-ZEO69UbU.js +885 -0
- package/dist/node-host/assets/proto-ClkOcAW0.js +3 -0
- package/dist/node-host/assets/pug-Du-dOfS3.js +13 -0
- package/dist/node-host/assets/puppet-CQlPp728.js +3 -0
- package/dist/node-host/assets/purescript-CLpaGMbw.js +3 -0
- package/dist/node-host/assets/python-BjnOIxPe.js +3 -0
- package/dist/node-host/assets/qml-BcFatdsQ.js +6 -0
- package/dist/node-host/assets/qmldir-Dz8ttxjf.js +3 -0
- package/dist/node-host/assets/qss-Iltvkn1C.js +3 -0
- package/dist/node-host/assets/r-DvDYa_8Q.js +6 -0
- package/dist/node-host/assets/racket-DRv7j6nv.js +3 -0
- package/dist/node-host/assets/raku-DI9yGpeW.js +3 -0
- package/dist/node-host/assets/razor-vGjCiVYw.js +11 -0
- package/dist/node-host/assets/rbs-D_4FkXDS.js +3 -0
- package/dist/node-host/assets/red-VqZFRByZ.js +4 -0
- package/dist/node-host/assets/reg-DpJf71oO.js +3 -0
- package/dist/node-host/assets/regexp-CE_3vZDh.js +6 -0
- package/dist/node-host/assets/rel-BT0iIKKw.js +3 -0
- package/dist/node-host/assets/riscv-CvzikGLb.js +3 -0
- package/dist/node-host/assets/rolldown-runtime-DktXgydw.js +35 -0
- package/dist/node-host/assets/ron-DzAo6FTJ.js +3 -0
- package/dist/node-host/assets/rose-pine-DiTkEueR.js +4 -0
- package/dist/node-host/assets/rose-pine-dawn-tfo5y2X0.js +4 -0
- package/dist/node-host/assets/rose-pine-moon-C0gON9XN.js +4 -0
- package/dist/node-host/assets/rosmsg-CyYq6XdT.js +3 -0
- package/dist/node-host/assets/rst-BqrTc4by.js +23 -0
- package/dist/node-host/assets/ruby-DLXfYriJ.js +31 -0
- package/dist/node-host/assets/rust-CaJo2YYS.js +3 -0
- package/dist/node-host/assets/sas-DJAJgMrq.js +6 -0
- package/dist/node-host/assets/sass-DI2zJwx7.js +3 -0
- package/dist/node-host/assets/scala-pMGZAs9j.js +3 -0
- package/dist/node-host/assets/scheme-D3A2QBtM.js +3 -0
- package/dist/node-host/assets/screen-DQoTOWYR.js +494 -0
- package/dist/node-host/assets/scss-n4nz8dJI.js +8 -0
- package/dist/node-host/assets/sdbl-CdQg5gu1.js +3 -0
- package/dist/node-host/assets/shaderlab-5KHT7nQ3.js +6 -0
- package/dist/node-host/assets/shellscript-BfuVOb-a.js +6 -0
- package/dist/node-host/assets/shellsession-hT9eQUDu.js +6 -0
- package/dist/node-host/assets/slack-dark-v8P_eXr6.js +4 -0
- package/dist/node-host/assets/slack-ochin-D8SyEdKz.js +4 -0
- package/dist/node-host/assets/smalltalk-D4IpSogw.js +3 -0
- package/dist/node-host/assets/smithy-BRyN83Yn.js +3 -0
- package/dist/node-host/assets/snazzy-light-BtkQkvXb.js +4 -0
- package/dist/node-host/assets/solarized-dark-B8nAdMfM.js +4 -0
- package/dist/node-host/assets/solarized-light-B-3F1INj.js +4 -0
- package/dist/node-host/assets/solidity-DPVu0wkJ.js +3 -0
- package/dist/node-host/assets/soy-Cbnz3v4z.js +6 -0
- package/dist/node-host/assets/sparql-cTZV4yOr.js +6 -0
- package/dist/node-host/assets/splunk-xP_ZjUH2.js +3 -0
- package/dist/node-host/assets/sql-DEvbt_rU.js +6 -0
- package/dist/node-host/assets/ssh-config-DXFPABYp.js +3 -0
- package/dist/node-host/assets/stata-0wnAnxv2.js +6 -0
- package/dist/node-host/assets/stylus-ZZDn1yUO.js +3 -0
- package/dist/node-host/assets/surrealql-70--UPGf.js +6 -0
- package/dist/node-host/assets/svelte-COI8WXVC.js +15 -0
- package/dist/node-host/assets/swift-DWmMn3lF.js +3 -0
- package/dist/node-host/assets/synthwave-84-DcsXCF_c.js +4 -0
- package/dist/node-host/assets/system-verilog-DW0KSMVO.js +3 -0
- package/dist/node-host/assets/systemd-DFbUltlW.js +3 -0
- package/dist/node-host/assets/talonscript-CLxaFu-b.js +3 -0
- package/dist/node-host/assets/tasks-C0WqnM7Q.js +644 -0
- package/dist/node-host/assets/tasks-request-Bwky5ORf.js +114 -0
- package/dist/node-host/assets/tasl-_AAbKiWM.js +3 -0
- package/dist/node-host/assets/tcl-DLe0Tsfm.js +3 -0
- package/dist/node-host/assets/templ-Bd0jzThC.js +13 -0
- package/dist/node-host/assets/terraform-v0KN9QQh.js +3 -0
- package/dist/node-host/assets/tex-C1Wtngrr.js +8 -0
- package/dist/node-host/assets/tokyo-night-Bvpqduda.js +4 -0
- package/dist/node-host/assets/toml-B7BHZIqX.js +3 -0
- package/dist/node-host/assets/ts-tags-BSGaPI18.js +59 -0
- package/dist/node-host/assets/tsv-BorGVq2Z.js +3 -0
- package/dist/node-host/assets/tsx-BxnCmyTp.js +6 -0
- package/dist/node-host/assets/turtle-BEG5g_eT.js +3 -0
- package/dist/node-host/assets/twig-BJG2k0MA.js +19 -0
- package/dist/node-host/assets/typescript-Cr5OHcug.js +6 -0
- package/dist/node-host/assets/typespec--jp0a8Qj.js +3 -0
- package/dist/node-host/assets/typst-BAvHLpwp.js +121 -0
- package/dist/node-host/assets/v-DBTjbKF9.js +3 -0
- package/dist/node-host/assets/vala-BnnASFsX.js +3 -0
- package/dist/node-host/assets/vb-eGVhCUXq.js +3 -0
- package/dist/node-host/assets/verilog-Ma7yBE30.js +3 -0
- package/dist/node-host/assets/vesper-CfxmMOy3.js +4 -0
- package/dist/node-host/assets/vhdl-Co2XFKY7.js +3 -0
- package/dist/node-host/assets/viml-BReTXeDA.js +3 -0
- package/dist/node-host/assets/vitesse-black-D9-_1mjV.js +4 -0
- package/dist/node-host/assets/vitesse-dark-DlSMLlr9.js +4 -0
- package/dist/node-host/assets/vitesse-light-KRWWWztf.js +4 -0
- package/dist/node-host/assets/vue-C3fWU2fi.js +31 -0
- package/dist/node-host/assets/vue-html-DxOM9wex.js +6 -0
- package/dist/node-host/assets/vue-vine-OKzSGBlX.js +19 -0
- package/dist/node-host/assets/vyper-C6KGx0YU.js +3 -0
- package/dist/node-host/assets/wasm-CvHAs-FG.js +7 -0
- package/dist/node-host/assets/wasm-gNIKwGlD.js +3 -0
- package/dist/node-host/assets/wenyan-BeysbCrW.js +3 -0
- package/dist/node-host/assets/wgsl-1s5rV5xS.js +3 -0
- package/dist/node-host/assets/wikitext-wjhjmmzD.js +3 -0
- package/dist/node-host/assets/wit-CeQiCbz_.js +3 -0
- package/dist/node-host/assets/wolfram-CcZPfnLd.js +3 -0
- package/dist/node-host/assets/worker-factory-C80HGMWf.js +14 -0
- package/dist/node-host/assets/xml-BsBjJrlv.js +8 -0
- package/dist/node-host/assets/xsl-BYwWzvT_.js +6 -0
- package/dist/node-host/assets/yaml-BRgACZP0.js +6 -0
- package/dist/node-host/assets/zenscript-BoijL7rl.js +3 -0
- package/dist/node-host/assets/zig-lTQvxhLD.js +3 -0
- package/dist/node-host/node-host.js +41395 -0
- package/dist/types/assets/contract-jA5pqK6h.d.ts +111 -0
- package/dist/types/hosted.d.ts +2 -98
- package/dist/types/node-host.d.ts +40 -0
- package/package.json +6 -2
|
@@ -0,0 +1,1066 @@
|
|
|
1
|
+
import { $t as Button, H as CanvasWorkspace, U as captureCanvasPoint, Zt as Loader, bt as conversationHref, dn as Text, en as ToolbarSeparator, et as BranchSidebar, fn as Icon, in as IconButton, l as projectStore, ln as readPreference, on as Tooltip, rn as Select, t as commentsUnavailable, tn as WorkspaceLayout, un as writePreference } from "./comment-data-nUlI0szN.js";
|
|
2
|
+
import { n as createProjectComments, r as loadComments, t as defineScreen } from "./screen-DQoTOWYR.js";
|
|
3
|
+
import { i as pictureKey, n as createProjectPreviews, t as createProjectBranches } from "./project-branches-1zs_0J_y.js";
|
|
4
|
+
import { t as ProjectThreadLinks } from "./project-thread-links-LpUAGcDr.js";
|
|
5
|
+
import { on, ref } from "remix/component";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
7
|
+
//#region app/client/preview-image.tsx
|
|
8
|
+
var failedHeight = 760;
|
|
9
|
+
var stopPan = on("pointerdown", (event) => event.stopPropagation());
|
|
10
|
+
function detailFor(picture, density, previous) {
|
|
11
|
+
let shown = picture.capture.width * density;
|
|
12
|
+
let widths = picture.capture.thumbnails.map((thumbnail) => thumbnail.width);
|
|
13
|
+
let pick = (scale) => {
|
|
14
|
+
let index = widths.findIndex((width) => shown <= width * scale);
|
|
15
|
+
return index < 0 ? "slices" : index;
|
|
16
|
+
};
|
|
17
|
+
let rank = (detail) => detail === "slices" ? widths.length : detail;
|
|
18
|
+
let target = pick(1);
|
|
19
|
+
if (previous === void 0 || rank(target) >= rank(previous)) return target;
|
|
20
|
+
return rank(pick(.85)) < rank(previous) ? target : previous;
|
|
21
|
+
}
|
|
22
|
+
function viewOf(viewport, id) {
|
|
23
|
+
return viewport?.get(id) ?? {
|
|
24
|
+
visible: true,
|
|
25
|
+
top: 0,
|
|
26
|
+
bottom: Infinity,
|
|
27
|
+
density: 1
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function placed(picture, bottom) {
|
|
31
|
+
let top = 0;
|
|
32
|
+
return picture.capture.tiles.map((tile, index) => {
|
|
33
|
+
let slice = {
|
|
34
|
+
tile,
|
|
35
|
+
index,
|
|
36
|
+
top,
|
|
37
|
+
src: picture.srcs[index]
|
|
38
|
+
};
|
|
39
|
+
top += tile.height;
|
|
40
|
+
return {
|
|
41
|
+
...slice,
|
|
42
|
+
shownTo: Math.min(top, bottom)
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One route's latest server-side screenshot in the canvas's theme, drawn only while the canvas
|
|
48
|
+
* shows it: a thumbnail when the page is small on screen, else only the slices in view. A new
|
|
49
|
+
* capture replaces the picture once what it shows is decoded, so the artboard never shows an
|
|
50
|
+
* empty frame between captures.
|
|
51
|
+
* @param handle - The route, its theme, its preview store and the canvas artboard state.
|
|
52
|
+
* @returns The artboard render function.
|
|
53
|
+
*/
|
|
54
|
+
function PreviewImage(handle) {
|
|
55
|
+
let { route, previews } = handle.props;
|
|
56
|
+
let page = route.pageId ?? route.id;
|
|
57
|
+
let shownKey = () => pictureKey(handle.props.theme, handle.props.size);
|
|
58
|
+
let layout = "";
|
|
59
|
+
let detail;
|
|
60
|
+
let shown;
|
|
61
|
+
let decoding = "";
|
|
62
|
+
function shownHeight(picture) {
|
|
63
|
+
return handle.props.topOnly ? picture.capture.tiles[0]?.height ?? picture.capture.height : picture.capture.height;
|
|
64
|
+
}
|
|
65
|
+
function report() {
|
|
66
|
+
let { preview, images } = previews.get(page);
|
|
67
|
+
let picture = images[shownKey()] ?? shown;
|
|
68
|
+
let height = picture ? shownHeight(picture) : preview?.captures[0]?.height ?? (preview?.state === "failed" ? failedHeight : 0);
|
|
69
|
+
if (!preview || !height) return;
|
|
70
|
+
let key = `${height}:${preview.path}:${picture?.capture.hash ?? ""}`;
|
|
71
|
+
if (layout === key) return;
|
|
72
|
+
layout = key;
|
|
73
|
+
handle.props.onLayout({
|
|
74
|
+
height,
|
|
75
|
+
path: preview.path,
|
|
76
|
+
pins: picture?.capture.pins
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function drawn(picture) {
|
|
80
|
+
let view = viewOf(handle.props.viewport, route.id);
|
|
81
|
+
if (!view.visible || detail === void 0) return {
|
|
82
|
+
thumbnail: void 0,
|
|
83
|
+
slices: []
|
|
84
|
+
};
|
|
85
|
+
if (detail === "slices" && picture.srcs.length) {
|
|
86
|
+
let bottom = Math.min(view.bottom, shownHeight(picture));
|
|
87
|
+
return {
|
|
88
|
+
thumbnail: picture.thumbnails.at(-1),
|
|
89
|
+
slices: placed(picture, bottom).filter(({ src, top, shownTo }) => src && top < shownTo && shownTo > view.top)
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
let index = detail === "slices" ? picture.thumbnails.length - 1 : detail;
|
|
93
|
+
return {
|
|
94
|
+
thumbnail: picture.thumbnails[index] ?? picture.thumbnails.at(-1),
|
|
95
|
+
slices: []
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function swap() {
|
|
99
|
+
let next = previews.get(page).images[shownKey()];
|
|
100
|
+
if (!next || next === shown) return;
|
|
101
|
+
if (!shown || shown.capture.hash === next.capture.hash) {
|
|
102
|
+
shown = next;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (detail === "slices" && !next.srcs.length) {
|
|
106
|
+
previews.slices(page, handle.props.theme, handle.props.size);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let key = `${next.capture.hash}:${detail}`;
|
|
110
|
+
if (decoding === key) return;
|
|
111
|
+
decoding = key;
|
|
112
|
+
let wanted = next;
|
|
113
|
+
let { thumbnail, slices } = drawn(wanted);
|
|
114
|
+
Promise.all([thumbnail, ...slices.map(({ src }) => src)].flatMap((src) => {
|
|
115
|
+
if (!src) return [];
|
|
116
|
+
let image = new Image();
|
|
117
|
+
image.src = src;
|
|
118
|
+
return [image.decode().catch(() => {})];
|
|
119
|
+
})).then(() => {
|
|
120
|
+
if (decoding !== key || handle.signal.aborted) return;
|
|
121
|
+
decoding = "";
|
|
122
|
+
shown = previews.get(page).images[shownKey()] ?? wanted;
|
|
123
|
+
report();
|
|
124
|
+
handle.update();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
let stopPreviews = previews.watch(page, () => {
|
|
128
|
+
swap();
|
|
129
|
+
report();
|
|
130
|
+
handle.update();
|
|
131
|
+
});
|
|
132
|
+
let stopViewport = handle.props.viewport?.watch(route.id, () => void handle.update());
|
|
133
|
+
handle.signal.addEventListener("abort", () => {
|
|
134
|
+
stopPreviews();
|
|
135
|
+
stopViewport?.();
|
|
136
|
+
}, { once: true });
|
|
137
|
+
return () => {
|
|
138
|
+
let { mode, origin, theme, viewport, size } = handle.props;
|
|
139
|
+
let { preview, images, refreshing, error } = previews.get(page);
|
|
140
|
+
handle.queueTask(() => {
|
|
141
|
+
previews.show(page, theme, size);
|
|
142
|
+
report();
|
|
143
|
+
});
|
|
144
|
+
let current = images[pictureKey(theme, size)] ?? images[pictureKey(theme === "dark" ? "light" : "dark", size)];
|
|
145
|
+
if (current && (!shown || shown.capture.theme !== current.capture.theme)) shown = current;
|
|
146
|
+
else swap();
|
|
147
|
+
let picture = shown;
|
|
148
|
+
let failure = error || (preview?.captures.length ? null : preview?.error);
|
|
149
|
+
let pageUrl = new URL(route.path, origin).href;
|
|
150
|
+
if (picture) {
|
|
151
|
+
let view = viewOf(viewport, route.id);
|
|
152
|
+
detail = detailFor(picture, view.density, detail);
|
|
153
|
+
if (view.visible && detail === "slices" && !picture.srcs.length) {
|
|
154
|
+
let { theme: wanted } = picture.capture;
|
|
155
|
+
handle.queueTask(() => previews.slices(page, wanted, size));
|
|
156
|
+
}
|
|
157
|
+
let height = shownHeight(picture);
|
|
158
|
+
let { width } = picture.capture;
|
|
159
|
+
let { thumbnail, slices } = drawn(picture);
|
|
160
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
161
|
+
role: "img",
|
|
162
|
+
"aria-label": `${route.title} preview`,
|
|
163
|
+
"data-detail": !view.visible ? "hidden" : slices.length ? "slices" : thumbnail ? "thumbnail" : "pending",
|
|
164
|
+
class: `relative select-none overflow-hidden ${mode === "comment" ? "cursor-crosshair" : ""}`,
|
|
165
|
+
style: { height },
|
|
166
|
+
mix: [on("pointerdown", (event) => {
|
|
167
|
+
if (mode !== "pan") event.stopPropagation();
|
|
168
|
+
}), on("click", (event) => {
|
|
169
|
+
if (mode !== "comment" || preview?.path !== route.path) return;
|
|
170
|
+
event.stopPropagation();
|
|
171
|
+
let rect = event.currentTarget.getBoundingClientRect();
|
|
172
|
+
let point = {
|
|
173
|
+
x: (event.clientX - rect.left) * width / rect.width,
|
|
174
|
+
y: (event.clientY - rect.top) * height / rect.height
|
|
175
|
+
};
|
|
176
|
+
handle.props.onPick({
|
|
177
|
+
element: null,
|
|
178
|
+
path: route.path,
|
|
179
|
+
...captureCanvasPoint(point, width),
|
|
180
|
+
found: previews.describe(page, picture.capture, point.x, point.y)
|
|
181
|
+
});
|
|
182
|
+
})],
|
|
183
|
+
children: [thumbnail ? /* @__PURE__ */ jsx("img", {
|
|
184
|
+
src: thumbnail,
|
|
185
|
+
alt: "",
|
|
186
|
+
decoding: "async",
|
|
187
|
+
draggable: false,
|
|
188
|
+
class: "absolute inset-x-0 top-0 block w-full max-w-none",
|
|
189
|
+
style: { height: picture.capture.height }
|
|
190
|
+
}) : null, slices.map(({ tile, index, top, src }) => /* @__PURE__ */ jsx("img", {
|
|
191
|
+
src,
|
|
192
|
+
alt: "",
|
|
193
|
+
decoding: "async",
|
|
194
|
+
draggable: false,
|
|
195
|
+
class: "absolute inset-x-0 block w-full max-w-none",
|
|
196
|
+
style: {
|
|
197
|
+
top,
|
|
198
|
+
height: tile.height + (index < picture.capture.tiles.length - 1 ? 1 : 0)
|
|
199
|
+
}
|
|
200
|
+
}, tile.hash))]
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (preview?.state === "failed" || failure && !refreshing) return /* @__PURE__ */ jsxs("div", {
|
|
204
|
+
class: "absolute inset-0 flex flex-col items-center justify-center gap-3 p-12 text-center",
|
|
205
|
+
role: "status",
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
208
|
+
name: "circle-alert",
|
|
209
|
+
size: 24,
|
|
210
|
+
class: "text-muted"
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
213
|
+
variant: "title",
|
|
214
|
+
weight: "semibold",
|
|
215
|
+
class: "text-ink",
|
|
216
|
+
children: [route.title, " couldn't be captured"]
|
|
217
|
+
}),
|
|
218
|
+
failure ? /* @__PURE__ */ jsx(Text, {
|
|
219
|
+
variant: "ui",
|
|
220
|
+
class: "max-w-md text-muted",
|
|
221
|
+
children: failure
|
|
222
|
+
}) : null,
|
|
223
|
+
/* @__PURE__ */ jsxs("div", {
|
|
224
|
+
class: "mt-2 flex gap-2",
|
|
225
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
226
|
+
variant: "secondary",
|
|
227
|
+
disabled: refreshing,
|
|
228
|
+
mix: [stopPan, on("click", () => void previews.refresh(page))],
|
|
229
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
230
|
+
variant: "ui",
|
|
231
|
+
children: "Try again"
|
|
232
|
+
})
|
|
233
|
+
}), /* @__PURE__ */ jsx("a", {
|
|
234
|
+
href: pageUrl,
|
|
235
|
+
target: "_blank",
|
|
236
|
+
rel: "noreferrer",
|
|
237
|
+
class: "bud-interaction bud-control flex h-control items-center rounded-lg px-3 text-ink",
|
|
238
|
+
mix: stopPan,
|
|
239
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
240
|
+
variant: "ui",
|
|
241
|
+
children: "Open page"
|
|
242
|
+
})
|
|
243
|
+
})]
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
});
|
|
247
|
+
return /* @__PURE__ */ jsx("div", {
|
|
248
|
+
class: "absolute inset-0 flex items-center justify-center",
|
|
249
|
+
children: /* @__PURE__ */ jsx(Loader, { label: `Capturing ${route.title}…` })
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Recaptures one route on demand, beside its artboard label.
|
|
255
|
+
* @param handle - The route and its preview store.
|
|
256
|
+
* @returns The button render function.
|
|
257
|
+
*/
|
|
258
|
+
function PreviewRefresh(handle) {
|
|
259
|
+
let { route, previews } = handle.props;
|
|
260
|
+
let page = route.pageId ?? route.id;
|
|
261
|
+
let stop = previews.watch(page, () => void handle.update());
|
|
262
|
+
handle.signal.addEventListener("abort", stop, { once: true });
|
|
263
|
+
return () => {
|
|
264
|
+
let { preview, refreshing } = previews.get(page);
|
|
265
|
+
let busy = refreshing || Boolean(preview?.updating);
|
|
266
|
+
let warning = preview?.state === "ready" ? preview.error : null;
|
|
267
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [warning ? /* @__PURE__ */ jsx(Tooltip, {
|
|
268
|
+
label: warning,
|
|
269
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
270
|
+
tabIndex: 0,
|
|
271
|
+
role: "img",
|
|
272
|
+
"aria-label": warning,
|
|
273
|
+
class: "pointer-events-auto ms-1 inline-flex text-amber-500",
|
|
274
|
+
mix: stopPan,
|
|
275
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
276
|
+
name: "circle-alert",
|
|
277
|
+
size: 13
|
|
278
|
+
})
|
|
279
|
+
})
|
|
280
|
+
}) : null, /* @__PURE__ */ jsx(IconButton, {
|
|
281
|
+
icon: "sync",
|
|
282
|
+
label: `Refresh ${route.title}`,
|
|
283
|
+
tooltip: true,
|
|
284
|
+
size: "small",
|
|
285
|
+
iconSize: 13,
|
|
286
|
+
disabled: refreshing,
|
|
287
|
+
"aria-busy": busy ? "true" : void 0,
|
|
288
|
+
class: `pointer-events-auto ms-0.5 text-muted hover:text-ink ${busy ? "[&_svg]:animate-spin" : ""}`,
|
|
289
|
+
mix: [stopPan, on("click", () => void previews.refresh(page))]
|
|
290
|
+
})] });
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region app/client/project-differences.ts
|
|
295
|
+
var results = /* @__PURE__ */ new Map();
|
|
296
|
+
function worker() {
|
|
297
|
+
return new Worker(new URL("./difference-worker.ts", import.meta.url), { type: "module" });
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Compares two picture sets route by route in a worker, in the routes' order, so the canvas can
|
|
301
|
+
* show only what changed between them: the working tree, main or an activated branch against
|
|
302
|
+
* another. Nothing leaves the browser; slices come from the previews store.
|
|
303
|
+
* @param options - The routes, each with its page and viewport, both sets, the theme, the
|
|
304
|
+
* comparison's lifetime and a callback for each route compared.
|
|
305
|
+
* @returns The comparison as it progresses.
|
|
306
|
+
*/
|
|
307
|
+
function compareProjectPictures(options) {
|
|
308
|
+
let { routes, before, after, theme, signal } = options;
|
|
309
|
+
let states = /* @__PURE__ */ new Map();
|
|
310
|
+
let state = {
|
|
311
|
+
get: (id) => states.get(id) ?? {
|
|
312
|
+
state: "pending",
|
|
313
|
+
regions: []
|
|
314
|
+
},
|
|
315
|
+
progress: {
|
|
316
|
+
compared: 0,
|
|
317
|
+
total: routes.length
|
|
318
|
+
},
|
|
319
|
+
done: routes.length === 0
|
|
320
|
+
};
|
|
321
|
+
let thread;
|
|
322
|
+
let next = 0;
|
|
323
|
+
let pending = /* @__PURE__ */ new Map();
|
|
324
|
+
function run(request) {
|
|
325
|
+
thread ??= worker();
|
|
326
|
+
thread.onmessage = (event) => {
|
|
327
|
+
pending.get(event.data.id)?.(event.data);
|
|
328
|
+
pending.delete(event.data.id);
|
|
329
|
+
};
|
|
330
|
+
let id = next++;
|
|
331
|
+
return new Promise((resolve) => {
|
|
332
|
+
pending.set(id, resolve);
|
|
333
|
+
thread.postMessage({
|
|
334
|
+
...request,
|
|
335
|
+
id
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
signal.addEventListener("abort", () => thread?.terminate(), { once: true });
|
|
340
|
+
async function compare(page, size) {
|
|
341
|
+
let [first, second] = await Promise.all([before.picture(page, theme, size), after.picture(page, theme, size)]);
|
|
342
|
+
if (!first || !second) return {
|
|
343
|
+
state: "missing",
|
|
344
|
+
regions: [],
|
|
345
|
+
before: first?.capture,
|
|
346
|
+
after: second?.capture
|
|
347
|
+
};
|
|
348
|
+
let pair = {
|
|
349
|
+
before: first.capture,
|
|
350
|
+
after: second.capture
|
|
351
|
+
};
|
|
352
|
+
if (first.capture.hash === second.capture.hash) return {
|
|
353
|
+
state: "same",
|
|
354
|
+
regions: [],
|
|
355
|
+
...pair
|
|
356
|
+
};
|
|
357
|
+
let key = `${first.capture.hash}\0${second.capture.hash}`;
|
|
358
|
+
let regions = results.get(key);
|
|
359
|
+
if (!regions) {
|
|
360
|
+
let picture = (side) => ({
|
|
361
|
+
images: side.images,
|
|
362
|
+
heights: side.capture.tiles.map((tile) => tile.height),
|
|
363
|
+
scale: side.capture.scale
|
|
364
|
+
});
|
|
365
|
+
let response = await run({
|
|
366
|
+
width: first.capture.width,
|
|
367
|
+
before: picture(first),
|
|
368
|
+
after: picture(second)
|
|
369
|
+
});
|
|
370
|
+
if ("error" in response) return {
|
|
371
|
+
state: "failed",
|
|
372
|
+
regions: [],
|
|
373
|
+
error: response.error,
|
|
374
|
+
...pair
|
|
375
|
+
};
|
|
376
|
+
regions = response.regions;
|
|
377
|
+
results.set(key, regions);
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
state: regions.length ? "different" : "same",
|
|
381
|
+
regions,
|
|
382
|
+
...pair
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
(async () => {
|
|
386
|
+
for (let route of routes) {
|
|
387
|
+
if (signal.aborted) return;
|
|
388
|
+
let result = await compare(route.page, route.size).catch((cause) => ({
|
|
389
|
+
state: "failed",
|
|
390
|
+
regions: [],
|
|
391
|
+
error: cause instanceof Error ? cause.message : "The pictures could not be compared."
|
|
392
|
+
}));
|
|
393
|
+
if (signal.aborted) return;
|
|
394
|
+
states.set(route.id, result);
|
|
395
|
+
state.progress = {
|
|
396
|
+
compared: state.progress.compared + 1,
|
|
397
|
+
total: routes.length
|
|
398
|
+
};
|
|
399
|
+
options.onChange(route.id);
|
|
400
|
+
}
|
|
401
|
+
state.done = true;
|
|
402
|
+
thread?.terminate();
|
|
403
|
+
thread = void 0;
|
|
404
|
+
options.onChange(null);
|
|
405
|
+
})();
|
|
406
|
+
return state;
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region app/client/difference-view.tsx
|
|
410
|
+
var caption = 40;
|
|
411
|
+
var gap = 48;
|
|
412
|
+
/**
|
|
413
|
+
* Where each change's slot starts in a difference artboard, and the artboard's height.
|
|
414
|
+
* @param regions - The route's changes.
|
|
415
|
+
* @returns The slots, top to bottom, and the total height in page pixels.
|
|
416
|
+
*/
|
|
417
|
+
function differenceSlots(regions) {
|
|
418
|
+
let top = 0;
|
|
419
|
+
return {
|
|
420
|
+
slots: regions.map((region) => {
|
|
421
|
+
let slot = {
|
|
422
|
+
top,
|
|
423
|
+
height: caption + Math.max(region.before.height, region.after.height, 1)
|
|
424
|
+
};
|
|
425
|
+
top += slot.height + gap;
|
|
426
|
+
return slot;
|
|
427
|
+
}),
|
|
428
|
+
height: Math.max(1, top - gap)
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
var kinds = {
|
|
432
|
+
changed: "Changed",
|
|
433
|
+
added: "Added",
|
|
434
|
+
removed: "Removed"
|
|
435
|
+
};
|
|
436
|
+
function crops(signal) {
|
|
437
|
+
let urls = /* @__PURE__ */ new Map();
|
|
438
|
+
signal.addEventListener("abort", () => {
|
|
439
|
+
for (let url of urls.values()) URL.revokeObjectURL(url);
|
|
440
|
+
}, { once: true });
|
|
441
|
+
return (blob) => {
|
|
442
|
+
let url = urls.get(blob);
|
|
443
|
+
if (!url) urls.set(blob, url = URL.createObjectURL(blob));
|
|
444
|
+
return url;
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* One side of a route's differences on the canvas: only the regions that changed, cropped from
|
|
449
|
+
* that side's picture, with the changed columns outlined. Its twin on the other side shows the
|
|
450
|
+
* same slots, so each change lines up across both.
|
|
451
|
+
* @param handle - The route, the side, its regions and the artboard's canvas state.
|
|
452
|
+
* @returns The artboard's render function.
|
|
453
|
+
*/
|
|
454
|
+
function DifferenceArtboard(handle) {
|
|
455
|
+
let url = crops(handle.signal);
|
|
456
|
+
let reported = 0;
|
|
457
|
+
return () => {
|
|
458
|
+
let { route, side, label, regions, viewport } = handle.props;
|
|
459
|
+
let { slots, height } = differenceSlots(regions);
|
|
460
|
+
if (reported !== height) {
|
|
461
|
+
reported = height;
|
|
462
|
+
handle.queueTask(() => handle.props.onLayout({
|
|
463
|
+
height,
|
|
464
|
+
path: route.path
|
|
465
|
+
}));
|
|
466
|
+
}
|
|
467
|
+
let visible = viewport?.get(route.id)?.visible ?? true;
|
|
468
|
+
return /* @__PURE__ */ jsx("div", {
|
|
469
|
+
role: "img",
|
|
470
|
+
"aria-label": `${route.title}, ${label}`,
|
|
471
|
+
"data-difference": side,
|
|
472
|
+
"data-changes": regions.length,
|
|
473
|
+
class: "relative select-none bg-[var(--bud-main)]",
|
|
474
|
+
style: { height: `${height}px` },
|
|
475
|
+
children: regions.map((region, index) => {
|
|
476
|
+
let span = region[side];
|
|
477
|
+
let crop = region.crops[side];
|
|
478
|
+
let slot = slots[index];
|
|
479
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
480
|
+
"data-kind": region.kind,
|
|
481
|
+
"data-span": `${span.y} ${span.height}`,
|
|
482
|
+
class: "absolute inset-x-0",
|
|
483
|
+
style: {
|
|
484
|
+
top: `${slot.top}px`,
|
|
485
|
+
height: `${slot.height}px`
|
|
486
|
+
},
|
|
487
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
488
|
+
class: "flex items-center gap-2 px-1",
|
|
489
|
+
style: { height: `${caption}px` },
|
|
490
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
491
|
+
variant: "ui",
|
|
492
|
+
weight: "medium",
|
|
493
|
+
children: `Change ${index + 1}`
|
|
494
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
495
|
+
variant: "ui",
|
|
496
|
+
tone: "muted",
|
|
497
|
+
children: kinds[region.kind]
|
|
498
|
+
})]
|
|
499
|
+
}), crop && span.height > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
500
|
+
class: "relative overflow-hidden",
|
|
501
|
+
style: { height: `${span.height}px` },
|
|
502
|
+
children: [visible ? /* @__PURE__ */ jsx("img", {
|
|
503
|
+
alt: "",
|
|
504
|
+
src: url(crop),
|
|
505
|
+
draggable: false,
|
|
506
|
+
class: "block h-full w-full"
|
|
507
|
+
}) : null, region.kind === "changed" ? /* @__PURE__ */ jsx("div", {
|
|
508
|
+
"aria-hidden": "true",
|
|
509
|
+
class: "pointer-events-none absolute inset-y-0 rounded-sm outline-2 outline-red-500/70",
|
|
510
|
+
style: {
|
|
511
|
+
left: `${region.x}px`,
|
|
512
|
+
width: `${Math.max(2, region.width)}px`
|
|
513
|
+
}
|
|
514
|
+
}) : null]
|
|
515
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
516
|
+
class: "grid h-24 place-items-center rounded-lg border border-dashed border-line",
|
|
517
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
518
|
+
variant: "ui",
|
|
519
|
+
tone: "muted",
|
|
520
|
+
children: `Not in ${label}`
|
|
521
|
+
})
|
|
522
|
+
})]
|
|
523
|
+
}, index);
|
|
524
|
+
})
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Every change, one at a time, both sides next to each other at the panel's width. Arrow keys
|
|
530
|
+
* step through them; Escape closes.
|
|
531
|
+
* @param handle - The changes, the shown one, the sides' names and callbacks.
|
|
532
|
+
* @returns The slideshow's render function.
|
|
533
|
+
*/
|
|
534
|
+
function DifferenceSlideshow(handle) {
|
|
535
|
+
let url = crops(handle.signal);
|
|
536
|
+
let step = (by) => {
|
|
537
|
+
let { slides, index } = handle.props;
|
|
538
|
+
if (slides.length) handle.props.onIndex((index + by + slides.length) % slides.length);
|
|
539
|
+
};
|
|
540
|
+
return () => {
|
|
541
|
+
let { slides, index, beforeLabel, afterLabel } = handle.props;
|
|
542
|
+
let slide = slides[Math.min(index, slides.length - 1)];
|
|
543
|
+
let side = (which, label) => {
|
|
544
|
+
let crop = slide?.region.crops[which];
|
|
545
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
546
|
+
class: "m-0 flex min-w-0 flex-col gap-2",
|
|
547
|
+
children: [/* @__PURE__ */ jsx("figcaption", { children: /* @__PURE__ */ jsx(Text, {
|
|
548
|
+
variant: "ui",
|
|
549
|
+
tone: "muted",
|
|
550
|
+
children: label
|
|
551
|
+
}) }), crop && slide.region[which].height > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
552
|
+
class: "relative",
|
|
553
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
554
|
+
alt: `${slide.route.title}, ${label}`,
|
|
555
|
+
src: url(crop),
|
|
556
|
+
class: "block w-full rounded-lg ring-1 ring-line"
|
|
557
|
+
}), slide.region.kind === "changed" ? /* @__PURE__ */ jsx("div", {
|
|
558
|
+
"aria-hidden": "true",
|
|
559
|
+
class: "pointer-events-none absolute inset-y-0 rounded-sm outline-2 outline-red-500/70",
|
|
560
|
+
style: {
|
|
561
|
+
left: `${slide.region.x / slide.width * 100}%`,
|
|
562
|
+
width: `max(2px, ${slide.region.width / slide.width * 100}%)`
|
|
563
|
+
}
|
|
564
|
+
}) : null]
|
|
565
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
566
|
+
class: "grid h-32 place-items-center rounded-lg border border-dashed border-line",
|
|
567
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
568
|
+
variant: "ui",
|
|
569
|
+
tone: "muted",
|
|
570
|
+
children: `Not in ${label}`
|
|
571
|
+
})
|
|
572
|
+
})]
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
576
|
+
role: "dialog",
|
|
577
|
+
"aria-label": "Differences slideshow",
|
|
578
|
+
class: "bud-surface absolute inset-0 z-40 flex flex-col bg-[var(--bud-main)]",
|
|
579
|
+
mix: ref((node, signal) => {
|
|
580
|
+
node.focus();
|
|
581
|
+
node.ownerDocument.addEventListener("keydown", (event) => {
|
|
582
|
+
if (event.key === "ArrowRight") step(1);
|
|
583
|
+
else if (event.key === "ArrowLeft") step(-1);
|
|
584
|
+
else if (event.key === "Escape") handle.props.onClose();
|
|
585
|
+
else return;
|
|
586
|
+
event.preventDefault();
|
|
587
|
+
}, { signal });
|
|
588
|
+
}),
|
|
589
|
+
tabindex: -1,
|
|
590
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
591
|
+
class: "flex h-12 shrink-0 items-center gap-2 border-b border-line ps-4 pe-2",
|
|
592
|
+
children: [
|
|
593
|
+
/* @__PURE__ */ jsxs("div", {
|
|
594
|
+
class: "flex min-w-0 flex-1 items-baseline gap-2",
|
|
595
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
596
|
+
variant: "ui",
|
|
597
|
+
weight: "medium",
|
|
598
|
+
class: "truncate",
|
|
599
|
+
children: slide?.route.title ?? "No differences"
|
|
600
|
+
}), slide ? /* @__PURE__ */ jsx(Text, {
|
|
601
|
+
variant: "ui",
|
|
602
|
+
tone: "muted",
|
|
603
|
+
class: "shrink-0 tabular-nums",
|
|
604
|
+
role: "status",
|
|
605
|
+
children: `${kinds[slide.region.kind]} · change ${slide.index + 1} of ${slide.count} · ${index + 1} / ${slides.length}`
|
|
606
|
+
}) : null]
|
|
607
|
+
}),
|
|
608
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
609
|
+
tooltip: true,
|
|
610
|
+
icon: "chevron-left",
|
|
611
|
+
label: "Previous change",
|
|
612
|
+
disabled: slides.length < 2,
|
|
613
|
+
mix: on("click", () => step(-1))
|
|
614
|
+
}),
|
|
615
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
616
|
+
tooltip: true,
|
|
617
|
+
icon: "chevron-right",
|
|
618
|
+
label: "Next change",
|
|
619
|
+
disabled: slides.length < 2,
|
|
620
|
+
mix: on("click", () => step(1))
|
|
621
|
+
}),
|
|
622
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
623
|
+
tooltip: true,
|
|
624
|
+
icon: "close",
|
|
625
|
+
label: "Close slideshow",
|
|
626
|
+
shortcut: "escape",
|
|
627
|
+
mix: on("click", () => handle.props.onClose())
|
|
628
|
+
})
|
|
629
|
+
]
|
|
630
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
631
|
+
class: "min-h-0 flex-1 overflow-auto p-4",
|
|
632
|
+
children: slide ? /* @__PURE__ */ jsxs("div", {
|
|
633
|
+
class: "grid gap-4 md:grid-cols-2",
|
|
634
|
+
children: [side("before", beforeLabel), side("after", afterLabel)]
|
|
635
|
+
}) : null
|
|
636
|
+
})]
|
|
637
|
+
});
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region app/client/project-canvas.tsx
|
|
642
|
+
function isCanvasThread(thread) {
|
|
643
|
+
return Boolean(thread.anchor && !("type" in thread.anchor));
|
|
644
|
+
}
|
|
645
|
+
function initialTheme(project, key) {
|
|
646
|
+
let { themes } = project.previews;
|
|
647
|
+
let stored = readPreference(key);
|
|
648
|
+
let interfaceTheme = document.documentElement.dataset.theme;
|
|
649
|
+
return themes.find((theme) => theme === stored) ?? themes.find((theme) => theme === interfaceTheme) ?? themes[0];
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Screenshots of the configured routes and their comments.
|
|
653
|
+
* @param handle - The project and its first comments.
|
|
654
|
+
* @returns The canvas render function.
|
|
655
|
+
*/
|
|
656
|
+
function ProjectCanvas(handle) {
|
|
657
|
+
let project = handle.props.project, requestedThread;
|
|
658
|
+
let comments = createProjectComments({
|
|
659
|
+
store: projectStore(project),
|
|
660
|
+
token: project.token,
|
|
661
|
+
signal: handle.signal,
|
|
662
|
+
initial: handle.props.comments,
|
|
663
|
+
onChange: () => {
|
|
664
|
+
handle.update();
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
if (handle.props.comments.stored) comments.load();
|
|
668
|
+
let home = project.workingTree ? null : project.main ?? "main";
|
|
669
|
+
let branchKey = `bud:canvas-branch:${project.id}`;
|
|
670
|
+
let stored = readPreference(branchKey);
|
|
671
|
+
let selected = typeof stored === "string" ? stored : home;
|
|
672
|
+
let wide = true;
|
|
673
|
+
let drawer = false;
|
|
674
|
+
let branches = createProjectBranches({
|
|
675
|
+
project,
|
|
676
|
+
signal: handle.signal,
|
|
677
|
+
onChange: () => {
|
|
678
|
+
if (selected && selected !== home && branches.loaded && !branches.list.branches.some((branch) => branch.name === selected && branch.active)) choose(home);
|
|
679
|
+
else handle.update();
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
let showing = new AbortController();
|
|
683
|
+
handle.signal.addEventListener("abort", () => showing.abort(), { once: true });
|
|
684
|
+
let previews = createProjectPreviews({
|
|
685
|
+
project,
|
|
686
|
+
signal: showing.signal,
|
|
687
|
+
branch: selected
|
|
688
|
+
});
|
|
689
|
+
function choose(branch) {
|
|
690
|
+
drawer = false;
|
|
691
|
+
if (branch === selected) return void handle.update();
|
|
692
|
+
selected = branch;
|
|
693
|
+
writePreference(branchKey, branch);
|
|
694
|
+
showing.abort();
|
|
695
|
+
showing = new AbortController();
|
|
696
|
+
previews = createProjectPreviews({
|
|
697
|
+
project,
|
|
698
|
+
signal: showing.signal,
|
|
699
|
+
branch
|
|
700
|
+
});
|
|
701
|
+
handle.update();
|
|
702
|
+
}
|
|
703
|
+
let themeKey = `bud:preview-theme:${project.id}`;
|
|
704
|
+
let theme = initialTheme(project, themeKey);
|
|
705
|
+
let topOnlyKey = `bud:preview-top-only:${project.id}`;
|
|
706
|
+
let topOnly = readPreference(topOnlyKey) === true;
|
|
707
|
+
let sizes = project.previews.viewports;
|
|
708
|
+
let several = sizes.length > 1;
|
|
709
|
+
let viewportKey = `bud:canvas-viewport:${project.id}`;
|
|
710
|
+
let storedViewport = readPreference(viewportKey);
|
|
711
|
+
let viewport = several && typeof storedViewport === "string" && (storedViewport === "all" || sizes.some((size) => size.id === storedViewport)) ? storedViewport : several ? "all" : sizes[0].id;
|
|
712
|
+
function show(next) {
|
|
713
|
+
if (next === viewport) return;
|
|
714
|
+
viewport = next;
|
|
715
|
+
writePreference(viewportKey, next);
|
|
716
|
+
handle.update();
|
|
717
|
+
}
|
|
718
|
+
function pageArtboards() {
|
|
719
|
+
let shownSizes = viewport === "all" ? sizes : sizes.filter((size) => size.id === viewport);
|
|
720
|
+
return project.routes.flatMap((route) => shownSizes.map((size) => ({
|
|
721
|
+
route,
|
|
722
|
+
size,
|
|
723
|
+
artboard: several ? {
|
|
724
|
+
...route,
|
|
725
|
+
id: `${route.id}@${size.id}`,
|
|
726
|
+
pageId: route.id,
|
|
727
|
+
width: size.width,
|
|
728
|
+
caption: String(size.width)
|
|
729
|
+
} : route
|
|
730
|
+
})));
|
|
731
|
+
}
|
|
732
|
+
let compareKey = `bud:canvas-compare:${project.id}`;
|
|
733
|
+
let comparing = null;
|
|
734
|
+
let comparison;
|
|
735
|
+
let slide;
|
|
736
|
+
function others() {
|
|
737
|
+
let sets = project.workingTree ? [{
|
|
738
|
+
value: "",
|
|
739
|
+
label: "Working tree"
|
|
740
|
+
}] : [];
|
|
741
|
+
for (let branch of branches.list.branches) if (branch.active && branch.captured) sets.push({
|
|
742
|
+
value: branch.name,
|
|
743
|
+
label: branch.name
|
|
744
|
+
});
|
|
745
|
+
return sets.filter((set) => set.value !== (selected ?? ""));
|
|
746
|
+
}
|
|
747
|
+
function label(set) {
|
|
748
|
+
return set ? set : "Working tree";
|
|
749
|
+
}
|
|
750
|
+
function startComparing() {
|
|
751
|
+
let sets = others();
|
|
752
|
+
let stored = readPreference(compareKey);
|
|
753
|
+
comparing = sets.find((set) => set.value === stored)?.value ?? sets.find((set) => set.value === (branches.list.main ?? "main"))?.value ?? sets[0]?.value ?? null;
|
|
754
|
+
slide = void 0;
|
|
755
|
+
handle.update();
|
|
756
|
+
}
|
|
757
|
+
function stopComparing() {
|
|
758
|
+
comparing = null;
|
|
759
|
+
slide = void 0;
|
|
760
|
+
comparison?.controller.abort();
|
|
761
|
+
comparison = void 0;
|
|
762
|
+
handle.update();
|
|
763
|
+
}
|
|
764
|
+
function compared(after) {
|
|
765
|
+
if (comparing === null) return void 0;
|
|
766
|
+
if (!others().some((set) => set.value === comparing)) comparing = others()[0]?.value ?? null;
|
|
767
|
+
if (comparing === null) return void 0;
|
|
768
|
+
let key = `${comparing}\0${selected ?? ""}\0${theme}\0${viewport}`;
|
|
769
|
+
if (comparison?.key === key) return comparison.result;
|
|
770
|
+
comparison?.controller.abort();
|
|
771
|
+
let controller = new AbortController();
|
|
772
|
+
handle.signal.addEventListener("abort", () => controller.abort(), { once: true });
|
|
773
|
+
let before = createProjectPreviews({
|
|
774
|
+
project,
|
|
775
|
+
signal: controller.signal,
|
|
776
|
+
branch: comparing || null
|
|
777
|
+
});
|
|
778
|
+
let result = compareProjectPictures({
|
|
779
|
+
routes: pageArtboards().map(({ route, size, artboard }) => ({
|
|
780
|
+
id: artboard.id,
|
|
781
|
+
page: route.id,
|
|
782
|
+
size
|
|
783
|
+
})),
|
|
784
|
+
before,
|
|
785
|
+
after,
|
|
786
|
+
theme,
|
|
787
|
+
signal: controller.signal,
|
|
788
|
+
onChange: () => {
|
|
789
|
+
handle.update();
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
comparison = {
|
|
793
|
+
key,
|
|
794
|
+
controller,
|
|
795
|
+
result
|
|
796
|
+
};
|
|
797
|
+
return result;
|
|
798
|
+
}
|
|
799
|
+
function onShownViewport(thread) {
|
|
800
|
+
if (!several || viewport === "all") return true;
|
|
801
|
+
return (sizes.find((size) => size.width === thread.anchor.viewport) ?? sizes[0]).id === viewport;
|
|
802
|
+
}
|
|
803
|
+
function shown(threads) {
|
|
804
|
+
return threads.filter(isCanvasThread).filter((thread) => (thread.anchor.branch ?? home) === selected).filter(onShownViewport);
|
|
805
|
+
}
|
|
806
|
+
return () => {
|
|
807
|
+
if (requestedThread !== handle.props.threadId) {
|
|
808
|
+
requestedThread = handle.props.threadId;
|
|
809
|
+
let id = requestedThread;
|
|
810
|
+
if (id) handle.queueTask(() => {
|
|
811
|
+
comments.loadThread(id);
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
if (!branches.loaded && !branches.error) return /* @__PURE__ */ jsx(Loader, { label: "Loading branches…" });
|
|
815
|
+
let projectKey = `${project.id}:${project.targetOrigin}:${project.routes.map((route) => route.path).join("|")}`;
|
|
816
|
+
let snapshot = {
|
|
817
|
+
...comments.snapshot,
|
|
818
|
+
threads: shown(comments.snapshot.threads)
|
|
819
|
+
};
|
|
820
|
+
let artboards = pageArtboards();
|
|
821
|
+
let sizeOf = new Map(artboards.map(({ artboard, size }) => [artboard.id, size]));
|
|
822
|
+
let differences = compared(previews);
|
|
823
|
+
let beforeLabel = label(comparing);
|
|
824
|
+
let afterLabel = label(selected);
|
|
825
|
+
let changed = differences ? artboards.map(({ artboard }) => artboard).filter((artboard) => differences.get(artboard.id).state === "different") : [];
|
|
826
|
+
let sides = /* @__PURE__ */ new Map();
|
|
827
|
+
let differenceArtboards = changed.flatMap((route) => ["before", "after"].map((side) => {
|
|
828
|
+
let id = `${route.id}#${side}`;
|
|
829
|
+
sides.set(id, {
|
|
830
|
+
route,
|
|
831
|
+
side
|
|
832
|
+
});
|
|
833
|
+
return {
|
|
834
|
+
id,
|
|
835
|
+
path: route.path,
|
|
836
|
+
title: route.title,
|
|
837
|
+
width: route.width,
|
|
838
|
+
caption: route.caption,
|
|
839
|
+
compare: {
|
|
840
|
+
groupId: route.id,
|
|
841
|
+
groupTitle: route.title,
|
|
842
|
+
versionLabel: side === "before" ? beforeLabel : afterLabel
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
}));
|
|
846
|
+
let slides = changed.flatMap((route) => {
|
|
847
|
+
let { regions, after: capture } = differences.get(route.id);
|
|
848
|
+
let width = capture?.width ?? route.width ?? sizes[0].width;
|
|
849
|
+
return regions.map((region, index) => ({
|
|
850
|
+
route,
|
|
851
|
+
region,
|
|
852
|
+
index,
|
|
853
|
+
count: regions.length,
|
|
854
|
+
width
|
|
855
|
+
}));
|
|
856
|
+
});
|
|
857
|
+
let status = "";
|
|
858
|
+
if (differences) {
|
|
859
|
+
let { compared: done, total } = differences.progress;
|
|
860
|
+
let missing = artboards.filter(({ artboard }) => differences.get(artboard.id).state === "missing").length;
|
|
861
|
+
status = !differences.done ? `Comparing with ${beforeLabel}… ${done} of ${total} pages` : changed.length ? `${changed.length} of ${total} pages differ from ${beforeLabel}` : `No differences from ${beforeLabel}`;
|
|
862
|
+
if (differences.done && missing) status += ` · ${missing} without pictures on both sides`;
|
|
863
|
+
}
|
|
864
|
+
let sets = others();
|
|
865
|
+
let icon = (size) => size.mobile || size.width < 600 ? "mobile" : size.width < 1100 ? "tablet" : "desktop";
|
|
866
|
+
let tools = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
867
|
+
several ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
868
|
+
sizes.map((size) => /* @__PURE__ */ jsx(IconButton, {
|
|
869
|
+
tooltip: true,
|
|
870
|
+
icon: icon(size),
|
|
871
|
+
label: `Show ${size.name} (${size.width})`,
|
|
872
|
+
active: viewport === size.id,
|
|
873
|
+
mix: on("click", () => show(size.id))
|
|
874
|
+
})),
|
|
875
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
876
|
+
tooltip: true,
|
|
877
|
+
icon: "columns",
|
|
878
|
+
label: "Show every viewport side by side",
|
|
879
|
+
active: viewport === "all",
|
|
880
|
+
mix: on("click", () => show("all"))
|
|
881
|
+
}),
|
|
882
|
+
/* @__PURE__ */ jsx(ToolbarSeparator, {})
|
|
883
|
+
] }) : null,
|
|
884
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
885
|
+
tooltip: true,
|
|
886
|
+
icon: "compare",
|
|
887
|
+
label: differences ? "Stop comparing" : "Show differences with another branch",
|
|
888
|
+
active: Boolean(differences),
|
|
889
|
+
disabled: !differences && !sets.length,
|
|
890
|
+
mix: on("click", () => differences ? stopComparing() : startComparing())
|
|
891
|
+
}),
|
|
892
|
+
differences ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Select, {
|
|
893
|
+
label: "Compare with",
|
|
894
|
+
value: comparing ?? "",
|
|
895
|
+
options: sets,
|
|
896
|
+
class: "max-w-48",
|
|
897
|
+
onChange: (value) => {
|
|
898
|
+
comparing = value;
|
|
899
|
+
slide = void 0;
|
|
900
|
+
writePreference(compareKey, value);
|
|
901
|
+
handle.update();
|
|
902
|
+
}
|
|
903
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
904
|
+
tooltip: true,
|
|
905
|
+
icon: "play",
|
|
906
|
+
label: "Step through the differences",
|
|
907
|
+
disabled: !slides.length,
|
|
908
|
+
mix: on("click", () => {
|
|
909
|
+
slide = 0;
|
|
910
|
+
handle.update();
|
|
911
|
+
})
|
|
912
|
+
})] }) : null
|
|
913
|
+
] });
|
|
914
|
+
return /* @__PURE__ */ jsx(WorkspaceLayout, {
|
|
915
|
+
class: "h-full min-h-0",
|
|
916
|
+
sidebarLabel: "Branches",
|
|
917
|
+
mainLabel: "Canvas",
|
|
918
|
+
drawerOpen: drawer,
|
|
919
|
+
onDrawerOpenChange: (open) => {
|
|
920
|
+
drawer = open;
|
|
921
|
+
handle.update();
|
|
922
|
+
},
|
|
923
|
+
onWideChange: (value) => {
|
|
924
|
+
if (wide === value) return;
|
|
925
|
+
wide = value;
|
|
926
|
+
handle.update();
|
|
927
|
+
},
|
|
928
|
+
sidebar: /* @__PURE__ */ jsx(BranchSidebar, {
|
|
929
|
+
working: branches.list.working,
|
|
930
|
+
workingTree: project.workingTree,
|
|
931
|
+
branches: branches.list.branches,
|
|
932
|
+
selected,
|
|
933
|
+
busy: branches.busy || !branches.loaded,
|
|
934
|
+
loaded: branches.loaded,
|
|
935
|
+
error: branches.error,
|
|
936
|
+
mobile: !wide,
|
|
937
|
+
onSelect: choose,
|
|
938
|
+
onActivate: (name, active) => {
|
|
939
|
+
branches.activate(name, active);
|
|
940
|
+
},
|
|
941
|
+
onCapture: (name) => {
|
|
942
|
+
branches.capture(name);
|
|
943
|
+
},
|
|
944
|
+
onClose: () => {
|
|
945
|
+
drawer = false;
|
|
946
|
+
handle.update();
|
|
947
|
+
}
|
|
948
|
+
}),
|
|
949
|
+
children: /* @__PURE__ */ jsx(CanvasWorkspace, {
|
|
950
|
+
artboards: differences ? differenceArtboards : artboards.map(({ artboard }) => artboard),
|
|
951
|
+
width: sizes[0].width,
|
|
952
|
+
storageKey: differences ? `bud:camera:${projectKey}:differences:${viewport}` : `bud:camera:${projectKey}:${several ? viewport : sizes[0].width}`,
|
|
953
|
+
tools,
|
|
954
|
+
overlay: differences && slide !== void 0 ? /* @__PURE__ */ jsx(DifferenceSlideshow, {
|
|
955
|
+
slides,
|
|
956
|
+
index: slide,
|
|
957
|
+
beforeLabel,
|
|
958
|
+
afterLabel,
|
|
959
|
+
onIndex: (index) => {
|
|
960
|
+
slide = index;
|
|
961
|
+
handle.update();
|
|
962
|
+
},
|
|
963
|
+
onClose: () => {
|
|
964
|
+
slide = void 0;
|
|
965
|
+
handle.update();
|
|
966
|
+
}
|
|
967
|
+
}) : null,
|
|
968
|
+
snapshot,
|
|
969
|
+
capabilities: comments.snapshot.capabilities,
|
|
970
|
+
commentsUnavailable: differences ? status : (comments.loaded ? !comments.ready : project.storage.threads?.state !== "ready") ? commentsUnavailable : void 0,
|
|
971
|
+
onLoadThread: comments.loadThread,
|
|
972
|
+
renderThreadLinks: (thread) => /* @__PURE__ */ jsx(ProjectThreadLinks, {
|
|
973
|
+
part: "links",
|
|
974
|
+
project,
|
|
975
|
+
thread,
|
|
976
|
+
canLink: comments.snapshot.capabilities.link,
|
|
977
|
+
busy: comments.busy,
|
|
978
|
+
onChange: async () => {
|
|
979
|
+
await comments.load();
|
|
980
|
+
await comments.loadThread(thread.id, true);
|
|
981
|
+
}
|
|
982
|
+
}),
|
|
983
|
+
renderThreadActions: (thread) => /* @__PURE__ */ jsx(ProjectThreadLinks, {
|
|
984
|
+
part: "action",
|
|
985
|
+
project,
|
|
986
|
+
thread,
|
|
987
|
+
canLink: comments.snapshot.capabilities.link,
|
|
988
|
+
busy: comments.busy,
|
|
989
|
+
onChange: async () => {
|
|
990
|
+
await comments.load();
|
|
991
|
+
await comments.loadThread(thread.id, true);
|
|
992
|
+
}
|
|
993
|
+
}),
|
|
994
|
+
initialThreadId: requestedThread,
|
|
995
|
+
loaded: comments.loaded,
|
|
996
|
+
busy: comments.busy,
|
|
997
|
+
error: comments.error,
|
|
998
|
+
now: comments.now,
|
|
999
|
+
onWrite: async (change) => {
|
|
1000
|
+
let next = await comments.write(change);
|
|
1001
|
+
return {
|
|
1002
|
+
...next,
|
|
1003
|
+
threads: shown(next.threads)
|
|
1004
|
+
};
|
|
1005
|
+
},
|
|
1006
|
+
onSync: () => comments.sync().catch(() => {}),
|
|
1007
|
+
onReload: comments.load,
|
|
1008
|
+
onCopyThreadLink: (thread) => navigator.clipboard.writeText(new URL(conversationHref(thread.id), window.location.origin).href),
|
|
1009
|
+
interactive: false,
|
|
1010
|
+
branch: selected,
|
|
1011
|
+
theme,
|
|
1012
|
+
onThemeChange: project.previews.themes.length > 1 ? (next) => {
|
|
1013
|
+
theme = next;
|
|
1014
|
+
writePreference(themeKey, next);
|
|
1015
|
+
handle.update();
|
|
1016
|
+
} : void 0,
|
|
1017
|
+
topOnly,
|
|
1018
|
+
onTopOnlyChange: differences ? void 0 : (next) => {
|
|
1019
|
+
topOnly = next;
|
|
1020
|
+
writePreference(topOnlyKey, next);
|
|
1021
|
+
handle.update();
|
|
1022
|
+
},
|
|
1023
|
+
onShowSidebar: wide ? void 0 : () => {
|
|
1024
|
+
drawer = true;
|
|
1025
|
+
handle.update();
|
|
1026
|
+
},
|
|
1027
|
+
sidebarLabel: "Branches",
|
|
1028
|
+
renderArtboard: (route, state) => {
|
|
1029
|
+
let side = sides.get(route.id);
|
|
1030
|
+
if (side) return /* @__PURE__ */ jsx(DifferenceArtboard, {
|
|
1031
|
+
route,
|
|
1032
|
+
side: side.side,
|
|
1033
|
+
label: side.side === "before" ? beforeLabel : afterLabel,
|
|
1034
|
+
regions: differences.get(side.route.id).regions,
|
|
1035
|
+
...state
|
|
1036
|
+
}, `${comparison?.key ?? ""}\0${route.id}`);
|
|
1037
|
+
return /* @__PURE__ */ jsx(PreviewImage, {
|
|
1038
|
+
route,
|
|
1039
|
+
origin: project.targetOrigin,
|
|
1040
|
+
theme,
|
|
1041
|
+
size: sizeOf.get(route.id) ?? sizes[0],
|
|
1042
|
+
topOnly,
|
|
1043
|
+
previews,
|
|
1044
|
+
...state
|
|
1045
|
+
}, `${selected ?? ""}\0${route.id}`);
|
|
1046
|
+
},
|
|
1047
|
+
renderArtboardActions: (route) => selected || differences ? null : /* @__PURE__ */ jsx(PreviewRefresh, {
|
|
1048
|
+
route,
|
|
1049
|
+
previews
|
|
1050
|
+
})
|
|
1051
|
+
}, `${differences ? `${projectKey}:differences` : projectKey}:${viewport}`)
|
|
1052
|
+
});
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
//#endregion
|
|
1056
|
+
//#region app/screens/canvas.tsx
|
|
1057
|
+
var canvas_default = defineScreen({
|
|
1058
|
+
load: ({ project, signal }) => loadComments(project, signal),
|
|
1059
|
+
render: (comments, { project, conversation }) => /* @__PURE__ */ jsx(ProjectCanvas, {
|
|
1060
|
+
project,
|
|
1061
|
+
comments,
|
|
1062
|
+
threadId: conversation?.id
|
|
1063
|
+
})
|
|
1064
|
+
});
|
|
1065
|
+
//#endregion
|
|
1066
|
+
export { canvas_default as default };
|