@backmatter/studio 0.0.1
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/chunks/UiKitPage-CgNMOqfE.js +172 -0
- package/dist/chunks/WorkspaceRoutes-DgRtdie8.js +87297 -0
- package/dist/chunks/abap-Y8Dl9g_6.js +6 -0
- package/dist/chunks/actionscript-3-DQVEcJUW.js +6 -0
- package/dist/chunks/ada-vP6ak0IW.js +6 -0
- package/dist/chunks/andromeeda-BbmzSJq1.js +4 -0
- package/dist/chunks/angular-html-DPB4Rf0C.js +32 -0
- package/dist/chunks/angular-ts-CTOR2ofC.js +21 -0
- package/dist/chunks/apache-BUjz-sD2.js +6 -0
- package/dist/chunks/apex-OyTfjCYK.js +6 -0
- package/dist/chunks/apl-CjNiDgad.js +16 -0
- package/dist/chunks/applescript-BPx7YFFu.js +6 -0
- package/dist/chunks/ara-Z2fSOxSw.js +6 -0
- package/dist/chunks/asciidoc-C1T9ziH6.js +6 -0
- package/dist/chunks/asm-BTWLY5ym.js +6 -0
- package/dist/chunks/astro-CFFExE8Q.js +18 -0
- package/dist/chunks/aurora-x-BwoVEUWZ.js +4 -0
- package/dist/chunks/awk-Fb0P9dkn.js +6 -0
- package/dist/chunks/ayu-dark-DJoqd4M9.js +4 -0
- package/dist/chunks/ayu-light-BzXEJRJ-.js +4 -0
- package/dist/chunks/ayu-mirage-BJ2oZGzi.js +4 -0
- package/dist/chunks/ballerina-oZK-YekG.js +6 -0
- package/dist/chunks/bat-0FvbqU9S.js +6 -0
- package/dist/chunks/beancount-DqJEb89h.js +6 -0
- package/dist/chunks/berry-DODBq_Ff.js +6 -0
- package/dist/chunks/bibtex-EULQRLY5.js +6 -0
- package/dist/chunks/bicep-BorU73w0.js +6 -0
- package/dist/chunks/bird2-CIjBSNj3.js +6 -0
- package/dist/chunks/blade-D0HyNvCw.js +20 -0
- package/dist/chunks/bsl-NkNNwerW.js +8 -0
- package/dist/chunks/c-eeMepfLm.js +6 -0
- package/dist/chunks/c3-BY5XW5ym.js +6 -0
- package/dist/chunks/cadence-02UX7mW8.js +6 -0
- package/dist/chunks/cairo-DM6WF2e3.js +8 -0
- package/dist/chunks/catppuccin-frappe-D3cH2rXe.js +4 -0
- package/dist/chunks/catppuccin-latte-C0LRGUW4.js +4 -0
- package/dist/chunks/catppuccin-macchiato-c5wQ11TT.js +4 -0
- package/dist/chunks/catppuccin-mocha-WMD6Qvya.js +4 -0
- package/dist/chunks/clarity-PKm5CwqM.js +6 -0
- package/dist/chunks/clojure-CXJfHrL3.js +6 -0
- package/dist/chunks/cmake-BJz8BOTU.js +6 -0
- package/dist/chunks/cobol-HihOMwht.js +10 -0
- package/dist/chunks/codeowners-Bt9yU6NX.js +6 -0
- package/dist/chunks/codeql-DHkodjjI.js +6 -0
- package/dist/chunks/coffee-DGBR_nr_.js +8 -0
- package/dist/chunks/common-lisp-EVqT9Zhp.js +6 -0
- package/dist/chunks/coq-B0L9upzn.js +6 -0
- package/dist/chunks/cpp-Cj177cuW.js +18 -0
- package/dist/chunks/crystal-CRJyc4G-.js +18 -0
- package/dist/chunks/csharp-CCgA4A09.js +6 -0
- package/dist/chunks/css-CECN5uSL.js +6 -0
- package/dist/chunks/csv-CmYOceLb.js +6 -0
- package/dist/chunks/cue-ZzumE7IT.js +6 -0
- package/dist/chunks/cypher-jpdmjtA6.js +6 -0
- package/dist/chunks/d-CBagWSwH.js +6 -0
- package/dist/chunks/dark-plus-pUHDTVV0.js +4 -0
- package/dist/chunks/dart-6ObCrKr9.js +6 -0
- package/dist/chunks/dashboard-XKKZuJGm.js +1736 -0
- package/dist/chunks/dax-CcDT-8dH.js +6 -0
- package/dist/chunks/define-studio-BYtYDGLX.js +33 -0
- package/dist/chunks/desktop-B93p9R9O.js +6 -0
- package/dist/chunks/diff-BxzP2J8R.js +6 -0
- package/dist/chunks/docker-CsHqm9tx.js +6 -0
- package/dist/chunks/dotenv-BMjVjUL1.js +6 -0
- package/dist/chunks/dracula-BtZx2Kac.js +4 -0
- package/dist/chunks/dracula-soft-BKa-aqBv.js +4 -0
- package/dist/chunks/dream-maker-PAx17jaB.js +6 -0
- package/dist/chunks/edge-BYQkOzbF.js +12 -0
- package/dist/chunks/elixir-Dh036GMp.js +8 -0
- package/dist/chunks/elm-BtNbw_Cd.js +8 -0
- package/dist/chunks/emacs-lisp-Cfxdx5D-.js +6 -0
- package/dist/chunks/erb-ScVOXVpH.js +10 -0
- package/dist/chunks/erlang-DNcDT8Hi.js +8 -0
- package/dist/chunks/everforest-dark-DMCBqXCK.js +4 -0
- package/dist/chunks/everforest-light-BbXl82Em.js +4 -0
- package/dist/chunks/fennel-N4WcXuKx.js +6 -0
- package/dist/chunks/fish-BTDEUgqH.js +6 -0
- package/dist/chunks/fluent-BMXUxfv1.js +6 -0
- package/dist/chunks/fortran-fixed-form-B67KFkXH.js +8 -0
- package/dist/chunks/fortran-free-form-CwqYvCLJ.js +6 -0
- package/dist/chunks/fsharp-CYOiIVNx.js +8 -0
- package/dist/chunks/gdresource-CvCIUjhi.js +10 -0
- package/dist/chunks/gdscript-DSAxJ_aS.js +6 -0
- package/dist/chunks/gdshader-Bk8fF6yr.js +6 -0
- package/dist/chunks/genie-DzUvd7U9.js +6 -0
- package/dist/chunks/gherkin-DHRaV0YP.js +6 -0
- package/dist/chunks/git-commit-Bd32YZ0K.js +8 -0
- package/dist/chunks/git-rebase-ZWUFO_T4.js +8 -0
- package/dist/chunks/github-dark-DenFmJkN.js +4 -0
- package/dist/chunks/github-dark-default-BJPUVz4H.js +4 -0
- package/dist/chunks/github-dark-dimmed-DUshB20C.js +4 -0
- package/dist/chunks/github-dark-high-contrast-D3aGCnF8.js +4 -0
- package/dist/chunks/github-light-JYsPkUQd.js +4 -0
- package/dist/chunks/github-light-default-D99KPAby.js +4 -0
- package/dist/chunks/github-light-high-contrast-BbmZE-Mp.js +4 -0
- package/dist/chunks/gleam-Bv284lvN.js +6 -0
- package/dist/chunks/glimmer-js-DkxNrfPT.js +14 -0
- package/dist/chunks/glimmer-ts-D6YZEmK_.js +14 -0
- package/dist/chunks/glsl-CkUcVZNK.js +8 -0
- package/dist/chunks/gn-XtJxiLa4.js +6 -0
- package/dist/chunks/gnuplot-yPG9-sE_.js +6 -0
- package/dist/chunks/go-CvFNMTvu.js +6 -0
- package/dist/chunks/graphql-CBu2ehBn.js +14 -0
- package/dist/chunks/groovy-CJQTphOW.js +6 -0
- package/dist/chunks/gruvbox-dark-hard-C5HOtKIh.js +4 -0
- package/dist/chunks/gruvbox-dark-medium-FVgwJHuz.js +4 -0
- package/dist/chunks/gruvbox-dark-soft-B46F314v.js +4 -0
- package/dist/chunks/gruvbox-light-hard-CJD38wDZ.js +4 -0
- package/dist/chunks/gruvbox-light-medium-BlIhMYTA.js +4 -0
- package/dist/chunks/gruvbox-light-soft-DoPHyLVZ.js +4 -0
- package/dist/chunks/hack-ItRNKiEb.js +10 -0
- package/dist/chunks/haml-NZLVzu_R.js +10 -0
- package/dist/chunks/handlebars-mxStpSE7.js +14 -0
- package/dist/chunks/haskell-WeIwNIP6.js +6 -0
- package/dist/chunks/haxe-TztHsm5T.js +6 -0
- package/dist/chunks/hcl-D438OF-I.js +6 -0
- package/dist/chunks/hjson-DYBUbqOl.js +6 -0
- package/dist/chunks/hlsl-Bk8TCZNL.js +6 -0
- package/dist/chunks/horizon-CJQ10nlf.js +4 -0
- package/dist/chunks/horizon-bright-CdkBZOMB.js +4 -0
- package/dist/chunks/houston-BDYrDoDW.js +4 -0
- package/dist/chunks/html-B50bmoVb.js +10 -0
- package/dist/chunks/html-derivative-C6bxFbFW.js +8 -0
- package/dist/chunks/http-DLvAkeD-.js +14 -0
- package/dist/chunks/hurl-CgkFN90t.js +12 -0
- package/dist/chunks/hxml-GbqSQCLa.js +8 -0
- package/dist/chunks/hy-Brt5EZ7-.js +6 -0
- package/dist/chunks/imba-CimUv-Uh.js +6 -0
- package/dist/chunks/index-CFAIR8GH.js +18924 -0
- package/dist/chunks/ini-BZIuRIvJ.js +6 -0
- package/dist/chunks/java-DY6VlHhP.js +6 -0
- package/dist/chunks/javascript-C25yR2R2.js +6 -0
- package/dist/chunks/jinja-CFW5uAwY.js +11 -0
- package/dist/chunks/jison-DdreslRX.js +8 -0
- package/dist/chunks/json-DxJze_jm.js +6 -0
- package/dist/chunks/json5-BT4Fjg39.js +6 -0
- package/dist/chunks/jsonc-CHjZD8gR.js +6 -0
- package/dist/chunks/jsonl-BGuvDmy9.js +6 -0
- package/dist/chunks/jsonnet-Bx2cfsXg.js +6 -0
- package/dist/chunks/jssm-BcADi6EI.js +6 -0
- package/dist/chunks/jsx-BtKADgXT.js +6 -0
- package/dist/chunks/julia-CZiKXNNP.js +16 -0
- package/dist/chunks/just-CEK2SJ_k.js +18 -0
- package/dist/chunks/kanagawa-dragon-CiKur4Hl.js +4 -0
- package/dist/chunks/kanagawa-lotus-BKu-smKu.js +4 -0
- package/dist/chunks/kanagawa-wave-CQwozSzG.js +4 -0
- package/dist/chunks/kdl-BNOv9TC3.js +6 -0
- package/dist/chunks/kotlin-ByBMgTeR.js +6 -0
- package/dist/chunks/kusto-DH_XitHS.js +6 -0
- package/dist/chunks/laserwave-6a00oqik.js +4 -0
- package/dist/chunks/latex-B8Egmqc5.js +8 -0
- package/dist/chunks/lean-BnVxaZxY.js +6 -0
- package/dist/chunks/less-B1GLI2Di.js +6 -0
- package/dist/chunks/light-plus-CZuVqSLX.js +4 -0
- package/dist/chunks/liquid-CHzkx3jT.js +14 -0
- package/dist/chunks/llvm-Bk2XctFf.js +6 -0
- package/dist/chunks/log-Al8wyEFV.js +6 -0
- package/dist/chunks/logo-DBa4JDzV.js +6 -0
- package/dist/chunks/lua-Bp3IRv7I.js +8 -0
- package/dist/chunks/luau-UQyhudEE.js +6 -0
- package/dist/chunks/make-CsMclxtr.js +6 -0
- package/dist/chunks/markdown-CrScaQ96.js +6 -0
- package/dist/chunks/marko-CJBA24Ri.js +14 -0
- package/dist/chunks/material-theme-D6KBX41T.js +4 -0
- package/dist/chunks/material-theme-darker-CkRroheE.js +4 -0
- package/dist/chunks/material-theme-lighter-BUBw43Yz.js +4 -0
- package/dist/chunks/material-theme-ocean-ClGX14Ja.js +4 -0
- package/dist/chunks/material-theme-palenight-C1RVm8K1.js +4 -0
- package/dist/chunks/matlab-BOAaUVP0.js +6 -0
- package/dist/chunks/mdc-C9YSUwVC.js +12 -0
- package/dist/chunks/mdx-BOhZZUJ8.js +6 -0
- package/dist/chunks/mermaid-C3rz4dYh.js +6 -0
- package/dist/chunks/min-dark-C7ak0t6c.js +4 -0
- package/dist/chunks/min-light-CKFxVcPp.js +4 -0
- package/dist/chunks/mipsasm-CTx18fBl.js +6 -0
- package/dist/chunks/mojo-EIZIZRTQ.js +6 -0
- package/dist/chunks/monokai-C1KBYcO0.js +4 -0
- package/dist/chunks/moonbit-B1TV0fG3.js +6 -0
- package/dist/chunks/move-Db4ltDq1.js +6 -0
- package/dist/chunks/narrat-DmhDCBs-.js +6 -0
- package/dist/chunks/nextflow-47kAzSl1.js +8 -0
- package/dist/chunks/nextflow-groovy-Drz_2V0j.js +6 -0
- package/dist/chunks/nginx-D7O4WoB1.js +8 -0
- package/dist/chunks/night-owl-Bm2rzalh.js +4 -0
- package/dist/chunks/night-owl-light-CBI5u5kw.js +4 -0
- package/dist/chunks/nim-QAjRdh9w.js +20 -0
- package/dist/chunks/nix-fTRXMGic.js +9 -0
- package/dist/chunks/nord-CC5OiUXg.js +4 -0
- package/dist/chunks/nushell-BGCPRlV5.js +6 -0
- package/dist/chunks/objective-c-Itk8tzmv.js +6 -0
- package/dist/chunks/objective-cpp-DGt5UKRO.js +6 -0
- package/dist/chunks/ocaml-eSVK32Eg.js +6 -0
- package/dist/chunks/odin-BItnF517.js +6 -0
- package/dist/chunks/one-dark-pro-DTA3VF0_.js +4 -0
- package/dist/chunks/one-light-LkMrt1Cf.js +4 -0
- package/dist/chunks/openscad-Sp5uZ6f2.js +6 -0
- package/dist/chunks/pascal-xy8pJNns.js +6 -0
- package/dist/chunks/perl-DkVrgJBg.js +16 -0
- package/dist/chunks/php-BIzsF_5x.js +18 -0
- package/dist/chunks/pkl-C-zSNmaA.js +6 -0
- package/dist/chunks/plastic-CSTz3KZp.js +4 -0
- package/dist/chunks/plsql-pVbGZfOv.js +6 -0
- package/dist/chunks/po-BNfHvqmm.js +6 -0
- package/dist/chunks/poimandres-C-VADXHD.js +4 -0
- package/dist/chunks/polar-CAZahv3u.js +6 -0
- package/dist/chunks/postcss-05aHdL-n.js +6 -0
- package/dist/chunks/powerquery-DI9HkTvs.js +6 -0
- package/dist/chunks/powershell-Clc4ydu-.js +6 -0
- package/dist/chunks/prisma-FZjmVtSl.js +6 -0
- package/dist/chunks/prolog-C5-yg4TO.js +6 -0
- package/dist/chunks/proto-C7QgialS.js +6 -0
- package/dist/chunks/pug-XOw9Q1Ho.js +12 -0
- package/dist/chunks/puppet-CUJHmnxV.js +6 -0
- package/dist/chunks/purescript-rUfGld-4.js +6 -0
- package/dist/chunks/python-BFNSHbwJ.js +6 -0
- package/dist/chunks/qml-rTNXsquU.js +8 -0
- package/dist/chunks/qmldir-BInDYbpo.js +6 -0
- package/dist/chunks/qss-AeJTysr_.js +6 -0
- package/dist/chunks/r-CSmzDPi7.js +6 -0
- package/dist/chunks/racket-B83wSAja.js +6 -0
- package/dist/chunks/raku-nEQ4ZJJ7.js +6 -0
- package/dist/chunks/razor-Ci8D0dQK.js +10 -0
- package/dist/chunks/red-7y8PH7HH.js +4 -0
- package/dist/chunks/reg-m_s_Kiip.js +6 -0
- package/dist/chunks/regexp-BazyLpPg.js +6 -0
- package/dist/chunks/rel-BcRfyd6Q.js +6 -0
- package/dist/chunks/riscv-Ce8MAQLP.js +6 -0
- package/dist/chunks/ron-DCEEQypA.js +6 -0
- package/dist/chunks/rose-pine-BKc3yVeu.js +4 -0
- package/dist/chunks/rose-pine-dawn-BulJcPZT.js +4 -0
- package/dist/chunks/rose-pine-moon-j6jiXKV8.js +4 -0
- package/dist/chunks/rosmsg-Cz0w1km8.js +6 -0
- package/dist/chunks/rst-DM32Wy3O.js +22 -0
- package/dist/chunks/ruby-BeqCs27h.js +30 -0
- package/dist/chunks/rust-CLzF9zIN.js +6 -0
- package/dist/chunks/sas-fpEvgATw.js +8 -0
- package/dist/chunks/sass-DxHp5rTx.js +6 -0
- package/dist/chunks/scala-D4grkFkl.js +6 -0
- package/dist/chunks/scheme-BCRWuEm4.js +6 -0
- package/dist/chunks/scss-B1FaCqwR.js +8 -0
- package/dist/chunks/sdbl-B7T8abf4.js +6 -0
- package/dist/chunks/shaderlab-Cr62-Wb4.js +8 -0
- package/dist/chunks/shellscript-InADTalH.js +6 -0
- package/dist/chunks/shellsession-DiDJNQdy.js +8 -0
- package/dist/chunks/slack-dark-i7wN4OET.js +4 -0
- package/dist/chunks/slack-ochin-ndHf0LoP.js +4 -0
- package/dist/chunks/smalltalk-BlI1_OkM.js +6 -0
- package/dist/chunks/snazzy-light-BlSJXAu4.js +4 -0
- package/dist/chunks/solarized-dark-UTmkh7lw.js +4 -0
- package/dist/chunks/solarized-light-BheCkDPT.js +4 -0
- package/dist/chunks/solidity-DUWnFhS6.js +6 -0
- package/dist/chunks/soy-C1-6njHa.js +8 -0
- package/dist/chunks/sparql-B0KWFEri.js +8 -0
- package/dist/chunks/splunk-CRXR8A9s.js +6 -0
- package/dist/chunks/sql-Cn_v3PB0.js +6 -0
- package/dist/chunks/ssh-config-DP-hNVbF.js +6 -0
- package/dist/chunks/stata-B8c5fTjX.js +8 -0
- package/dist/chunks/stylus-CyKEU1Ej.js +6 -0
- package/dist/chunks/surrealql-CQi7GQN7.js +8 -0
- package/dist/chunks/svelte-rYri41WT.js +14 -0
- package/dist/chunks/swift-DJpUqPLg.js +6 -0
- package/dist/chunks/synthwave-84-NU3C_KFZ.js +4 -0
- package/dist/chunks/system-verilog-BCm7smPJ.js +6 -0
- package/dist/chunks/systemd-C-4qm6XH.js +6 -0
- package/dist/chunks/talonscript-CFF3LF_O.js +6 -0
- package/dist/chunks/tasl-Cg_WBUAe.js +6 -0
- package/dist/chunks/tcl-DN7buRTF.js +6 -0
- package/dist/chunks/templ-Crs9Ui8q.js +12 -0
- package/dist/chunks/terraform-DGvcn9zM.js +6 -0
- package/dist/chunks/tex-AHxmLTL0.js +8 -0
- package/dist/chunks/tokyo-night-DP4TmcQl.js +4 -0
- package/dist/chunks/toml-DY62mUL_.js +6 -0
- package/dist/chunks/ts-tags-ioVe2PKw.js +41 -0
- package/dist/chunks/tsv-BtvSkaG0.js +6 -0
- package/dist/chunks/tsx-B8rCNbgL.js +6 -0
- package/dist/chunks/turtle-_H59FV7D.js +6 -0
- package/dist/chunks/twig-DwV2Fi4L.js +18 -0
- package/dist/chunks/typescript-RycA9KXf.js +6 -0
- package/dist/chunks/typespec-DWqp-kUU.js +6 -0
- package/dist/chunks/typst-D_1QKWns.js +6 -0
- package/dist/chunks/v-BPCNiyYe.js +6 -0
- package/dist/chunks/vala-uxaPR7d1.js +6 -0
- package/dist/chunks/vb-D8_c5-KN.js +6 -0
- package/dist/chunks/verilog-B-bybjPF.js +6 -0
- package/dist/chunks/vesper-BckBta1U.js +4 -0
- package/dist/chunks/vhdl-CUlNa8ac.js +6 -0
- package/dist/chunks/viml-DsfA-sWm.js +6 -0
- package/dist/chunks/vitesse-black-BoGvW84i.js +4 -0
- package/dist/chunks/vitesse-dark-Cym-eLtO.js +4 -0
- package/dist/chunks/vitesse-light-CcmG315c.js +4 -0
- package/dist/chunks/vue-DXEmyXn9.js +31 -0
- package/dist/chunks/vue-html-j9xNEdu3.js +8 -0
- package/dist/chunks/vue-vine-D41-N99t.js +18 -0
- package/dist/chunks/vyper-CPQuu50u.js +6 -0
- package/dist/chunks/wasm-BBXxrAl7.js +6 -0
- package/dist/chunks/wasm-DQxwEHae.js +7 -0
- package/dist/chunks/wenyan-pbVjoM9_.js +6 -0
- package/dist/chunks/wgsl-DY4iK1q1.js +6 -0
- package/dist/chunks/wikitext-Z-MoUasO.js +6 -0
- package/dist/chunks/wit-CQMQOlTg.js +6 -0
- package/dist/chunks/wolfram-Dz4KXISs.js +6 -0
- package/dist/chunks/xml-C2J0sS9M.js +8 -0
- package/dist/chunks/xsl-BmSZphgC.js +8 -0
- package/dist/chunks/yaml-DaO7k5B1.js +6 -0
- package/dist/chunks/zenscript-CxBjpf9c.js +6 -0
- package/dist/chunks/zig-Vm0PO9wB.js +6 -0
- package/dist/dashboard.js +8 -0
- package/dist/define.js +4 -0
- package/dist/index.js +317 -0
- package/dist/studio.css +2272 -0
- package/dist/styles.js +1 -0
- package/package.json +88 -0
- package/prose-node-shims/fs.ts +6 -0
- package/prose-node-shims/path.ts +16 -0
- package/prose-node-shims/sharp.ts +4 -0
- package/prose-ui-node-shim.ts +26 -0
- package/src/App.tsx +173 -0
- package/src/WorkspaceRoutes.tsx +38 -0
- package/src/api.ts +833 -0
- package/src/auth-client.ts +15 -0
- package/src/chat/ChangeCard.tsx +330 -0
- package/src/chat/ChatBar.tsx +238 -0
- package/src/chat/ChatMessage.tsx +478 -0
- package/src/chat/ChatPanel.tsx +406 -0
- package/src/chat/ChatProvider.tsx +661 -0
- package/src/chat/Composer.tsx +461 -0
- package/src/chat/DocListCard.tsx +322 -0
- package/src/chat/LiveStatus.tsx +83 -0
- package/src/chat/MentionPopover.tsx +164 -0
- package/src/chat/ModelPicker.tsx +113 -0
- package/src/chat/Shimmer.tsx +39 -0
- package/src/chat/ThreadHistory.tsx +268 -0
- package/src/chat/chat-context.ts +41 -0
- package/src/chat/chat-helpers.ts +402 -0
- package/src/chat/chat-state.ts +59 -0
- package/src/chat/icons.tsx +171 -0
- package/src/chat/useStickToBottom.ts +110 -0
- package/src/chrome/AppShell.tsx +100 -0
- package/src/chrome/AppSidebar.tsx +305 -0
- package/src/chrome/CommandPalette.tsx +559 -0
- package/src/chrome/ContentApiPopover.tsx +215 -0
- package/src/chrome/EditorActionsContext.tsx +63 -0
- package/src/chrome/EditorFocusContext.tsx +80 -0
- package/src/chrome/EditorStatusContext.tsx +84 -0
- package/src/chrome/NavItem.tsx +75 -0
- package/src/chrome/OpenSiteButton.tsx +148 -0
- package/src/chrome/StatusBar.tsx +73 -0
- package/src/chrome/UserMenu.tsx +130 -0
- package/src/chrome/WorkspaceNavContext.tsx +60 -0
- package/src/chrome/WorkspaceStatusBar.tsx +940 -0
- package/src/chrome/content-api-url.ts +111 -0
- package/src/chrome/content-type-groups.ts +32 -0
- package/src/chrome/hotkeys.ts +79 -0
- package/src/chrome/icons.tsx +191 -0
- package/src/chrome/open-site.ts +30 -0
- package/src/chrome/status-bar-action.ts +24 -0
- package/src/components/AppChromeContext.tsx +32 -0
- package/src/components/Shell.tsx +18 -0
- package/src/components/WorkspaceSwitcher.tsx +345 -0
- package/src/content-blocks/index.tsx +262 -0
- package/src/css.d.ts +2 -0
- package/src/dashboard.ts +5 -0
- package/src/define-studio.tsx +98 -0
- package/src/define.ts +12 -0
- package/src/index.css +123 -0
- package/src/index.ts +19 -0
- package/src/last-user.ts +40 -0
- package/src/last-workspace.ts +57 -0
- package/src/mcp/McpConnectorsPanel.tsx +872 -0
- package/src/mcp/parse-json.ts +52 -0
- package/src/pages/AcceptInvitePage.tsx +99 -0
- package/src/pages/BlockSettingsDialog.tsx +303 -0
- package/src/pages/BlocksList.tsx +402 -0
- package/src/pages/BodyProse.tsx +236 -0
- package/src/pages/DocEditorPage.tsx +1394 -0
- package/src/pages/EmbedChatPage.tsx +110 -0
- package/src/pages/EmbedPublishPage.tsx +259 -0
- package/src/pages/EnterPage.tsx +96 -0
- package/src/pages/GithubConnectPage.tsx +142 -0
- package/src/pages/LegacyWorkspaceRedirect.tsx +57 -0
- package/src/pages/LoginPage.tsx +335 -0
- package/src/pages/NewWorkspacePage.tsx +74 -0
- package/src/pages/RenderedBody.tsx +598 -0
- package/src/pages/ResumeHome.tsx +18 -0
- package/src/pages/SelectionBar.tsx +277 -0
- package/src/pages/SettingsGeneralPage.tsx +403 -0
- package/src/pages/SettingsGithubPage.tsx +277 -0
- package/src/pages/SettingsLayout.tsx +127 -0
- package/src/pages/SettingsMcpPage.tsx +30 -0
- package/src/pages/SettingsSchemaPage.tsx +93 -0
- package/src/pages/SettingsUsersPage.tsx +363 -0
- package/src/pages/TypeDocsPage.tsx +225 -0
- package/src/pages/UiKitPage.tsx +331 -0
- package/src/pages/UserSettingsPage.tsx +94 -0
- package/src/pages/WorkspaceHomeRedirect.tsx +17 -0
- package/src/pages/WorkspaceLayout.tsx +103 -0
- package/src/pages/WorkspacesPage.tsx +35 -0
- package/src/pages/blocks-list.ts +73 -0
- package/src/pages/body-blocks.ts +233 -0
- package/src/pages/body-mdx.tsx +82 -0
- package/src/pages/compile-body.ts +37 -0
- package/src/pages/host-env.ts +22 -0
- package/src/pages/html-to-markdown.ts +99 -0
- package/src/pages/preview-bridge.ts +46 -0
- package/src/pages/preview-split.ts +30 -0
- package/src/pages/preview-url.ts +92 -0
- package/src/pages/selection-format.ts +179 -0
- package/src/pages/type-docs.ts +9 -0
- package/src/replica/BootstrapSplash.tsx +80 -0
- package/src/replica/ReplicaProvider.tsx +267 -0
- package/src/replica/cache.ts +30 -0
- package/src/replica/idb.ts +89 -0
- package/src/replica/instance.ts +39 -0
- package/src/replica/pull.ts +23 -0
- package/src/replica/store.ts +497 -0
- package/src/replica/sync-cache.ts +51 -0
- package/src/replica/types.ts +119 -0
- package/src/replica/useReplica.ts +13 -0
- package/src/site.tsx +230 -0
- package/src/studio-config.ts +81 -0
- package/src/styles/themes.ts +49 -0
- package/src/styles/tokens.stylex.ts +58 -0
- package/src/styles.ts +11 -0
- package/src/theme/AccentOverride.tsx +29 -0
- package/src/theme/ThemeProvider.tsx +130 -0
- package/src/theme/apply-theme-class.ts +12 -0
- package/src/ui/BackLink.tsx +28 -0
- package/src/ui/Button.tsx +167 -0
- package/src/ui/ConfirmDialog.tsx +141 -0
- package/src/ui/Field.tsx +45 -0
- package/src/ui/Input.tsx +183 -0
- package/src/ui/ListRow.tsx +88 -0
- package/src/ui/Page.tsx +151 -0
- package/src/ui/Text.tsx +77 -0
- package/src/ui/Tooltip.tsx +85 -0
- package/src/ui/popup.ts +216 -0
- package/src/workspace/permissions.ts +17 -0
- package/src/workspace/types.ts +12 -0
- package/src/workspace-path.ts +98 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
// packages/studio/src/chrome/CommandPalette.tsx
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { useNavigate } from "react-router";
|
|
4
|
+
import { Combobox } from "@base-ui/react/combobox";
|
|
5
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
6
|
+
import * as stylex from "@stylexjs/stylex";
|
|
7
|
+
import {
|
|
8
|
+
commitWorkspace,
|
|
9
|
+
countConflicts,
|
|
10
|
+
notifyHeadChanged,
|
|
11
|
+
notifyTreeChanged,
|
|
12
|
+
publishCommittedFiles,
|
|
13
|
+
pullFromGithub,
|
|
14
|
+
} from "../api";
|
|
15
|
+
import { isStudioDev } from "../studio-config";
|
|
16
|
+
import { useReplicaState } from "../replica/useReplica";
|
|
17
|
+
import { useChatUIOptional } from "../chat/ChatProvider";
|
|
18
|
+
import { useAppChrome } from "../components/AppChromeContext";
|
|
19
|
+
import { colors, radius, space, type, z } from "../styles/tokens.stylex";
|
|
20
|
+
import { useTheme } from "../theme/ThemeProvider";
|
|
21
|
+
import { cx } from "../ui/popup";
|
|
22
|
+
import { useEditorActions } from "./EditorActionsContext";
|
|
23
|
+
import {
|
|
24
|
+
matchAppHotkey,
|
|
25
|
+
modifierSymbol,
|
|
26
|
+
previewSiteOrigin,
|
|
27
|
+
} from "./hotkeys";
|
|
28
|
+
import { parsePreviewMessage } from "@backmatter/core/preview";
|
|
29
|
+
import { useWorkspaceNav } from "./WorkspaceNavContext";
|
|
30
|
+
import {
|
|
31
|
+
contentDocPath,
|
|
32
|
+
contentTypePath,
|
|
33
|
+
settingsPath,
|
|
34
|
+
workspaceHomePath,
|
|
35
|
+
} from "../workspace-path";
|
|
36
|
+
|
|
37
|
+
type Item = {
|
|
38
|
+
id: string;
|
|
39
|
+
group: string;
|
|
40
|
+
label: string;
|
|
41
|
+
hint?: string;
|
|
42
|
+
shortcut?: string;
|
|
43
|
+
run: () => void;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type ItemGroup = { value: string; items: Item[] };
|
|
47
|
+
|
|
48
|
+
const THEME_LABEL = {
|
|
49
|
+
system: "System",
|
|
50
|
+
light: "Light",
|
|
51
|
+
dark: "Dark",
|
|
52
|
+
} as const;
|
|
53
|
+
|
|
54
|
+
function matches(query: string, text: string) {
|
|
55
|
+
const needle = query.trim().toLowerCase();
|
|
56
|
+
if (!needle) return true;
|
|
57
|
+
return text.toLowerCase().includes(needle);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function CommandPalette() {
|
|
61
|
+
const [open, setOpen] = useState(false);
|
|
62
|
+
const replica = useReplicaState();
|
|
63
|
+
const workspaces = replica.control?.workspaces ?? [];
|
|
64
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
65
|
+
const navigate = useNavigate();
|
|
66
|
+
const workspaceNav = useWorkspaceNav();
|
|
67
|
+
const editorActions = useEditorActions();
|
|
68
|
+
const { onLogout } = useAppChrome();
|
|
69
|
+
const { preference, cyclePreference } = useTheme();
|
|
70
|
+
const chat = useChatUIOptional();
|
|
71
|
+
const mod = modifierSymbol();
|
|
72
|
+
|
|
73
|
+
const saveDocAction = editorActions.save;
|
|
74
|
+
const revertDoc = editorActions.revert;
|
|
75
|
+
const toggleChat = chat?.aiAvailable ? chat.dispatch : null;
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
function runHotkey(action: ReturnType<typeof matchAppHotkey>) {
|
|
79
|
+
if (action === "palette") {
|
|
80
|
+
setOpen((v) => !v);
|
|
81
|
+
} else if (action === "save") {
|
|
82
|
+
void saveDocAction?.();
|
|
83
|
+
} else if (action === "chat") {
|
|
84
|
+
toggleChat?.({ type: "toggle" });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function onKey(e: KeyboardEvent) {
|
|
89
|
+
const action = matchAppHotkey(e);
|
|
90
|
+
if (!action) return;
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
runHotkey(action);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function onMessage(e: MessageEvent) {
|
|
96
|
+
const expected = previewSiteOrigin(workspaceNav?.siteUrls);
|
|
97
|
+
if (!expected || e.origin !== expected) return;
|
|
98
|
+
const message = parsePreviewMessage(e.data);
|
|
99
|
+
if (!message || message.type !== "backmatter:hotkey") return;
|
|
100
|
+
const action = matchAppHotkey(message);
|
|
101
|
+
if (!action) return;
|
|
102
|
+
runHotkey(action);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
document.addEventListener("keydown", onKey, true);
|
|
106
|
+
window.addEventListener("message", onMessage);
|
|
107
|
+
return () => {
|
|
108
|
+
document.removeEventListener("keydown", onKey, true);
|
|
109
|
+
window.removeEventListener("message", onMessage);
|
|
110
|
+
};
|
|
111
|
+
}, [saveDocAction, toggleChat, workspaceNav?.siteUrls]);
|
|
112
|
+
|
|
113
|
+
const docs = workspaceNav
|
|
114
|
+
? replica.docs(workspaceNav.workspaceId)
|
|
115
|
+
: [];
|
|
116
|
+
const git = workspaceNav ? replica.git(workspaceNav.workspaceId) : null;
|
|
117
|
+
|
|
118
|
+
const items = useMemo<Item[]>(() => {
|
|
119
|
+
const go = (path: string) => () => {
|
|
120
|
+
setOpen(false);
|
|
121
|
+
navigate(path);
|
|
122
|
+
};
|
|
123
|
+
const list: Item[] = [];
|
|
124
|
+
if (saveDocAction) {
|
|
125
|
+
list.push({
|
|
126
|
+
id: "action-save",
|
|
127
|
+
group: "Actions",
|
|
128
|
+
label: "Save",
|
|
129
|
+
shortcut: `${mod}S`,
|
|
130
|
+
run: () => {
|
|
131
|
+
setOpen(false);
|
|
132
|
+
void saveDocAction();
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (workspaceNav && git && git.changes.length > 0) {
|
|
137
|
+
const workspaceId = workspaceNav.workspaceId;
|
|
138
|
+
const count = git.changes.length;
|
|
139
|
+
const conflicts = countConflicts(git);
|
|
140
|
+
list.push({
|
|
141
|
+
id: "action-commit",
|
|
142
|
+
group: "Actions",
|
|
143
|
+
label:
|
|
144
|
+
conflicts > 0
|
|
145
|
+
? `Commit blocked: ${conflicts} ${conflicts === 1 ? "conflict" : "conflicts"}`
|
|
146
|
+
: `Commit ${count} ${count === 1 ? "file" : "files"} to ${git.currentBranch}`,
|
|
147
|
+
hint: conflicts > 0 ? "Resolve conflicts in the editor first" : "Uses the default message",
|
|
148
|
+
run: () => {
|
|
149
|
+
setOpen(false);
|
|
150
|
+
if (conflicts > 0) return;
|
|
151
|
+
void commitWorkspace(workspaceId)
|
|
152
|
+
.then((result) => {
|
|
153
|
+
publishCommittedFiles(workspaceId, result.files);
|
|
154
|
+
})
|
|
155
|
+
.catch(() => {
|
|
156
|
+
notifyTreeChanged();
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (workspaceNav) {
|
|
162
|
+
const workspaceId = workspaceNav.workspaceId;
|
|
163
|
+
list.push({
|
|
164
|
+
id: "action-pull",
|
|
165
|
+
group: "Actions",
|
|
166
|
+
label: "Pull from GitHub",
|
|
167
|
+
hint: "Re-import the branch if a push was missed",
|
|
168
|
+
run: () => {
|
|
169
|
+
setOpen(false);
|
|
170
|
+
void pullFromGithub(workspaceId).then(() => {
|
|
171
|
+
notifyHeadChanged();
|
|
172
|
+
notifyTreeChanged();
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
if (chat?.aiAvailable) {
|
|
178
|
+
list.push(
|
|
179
|
+
{
|
|
180
|
+
id: "action-chat",
|
|
181
|
+
group: "Actions",
|
|
182
|
+
label: "Open AI chat",
|
|
183
|
+
shortcut: `${mod}J`,
|
|
184
|
+
run: () => {
|
|
185
|
+
setOpen(false);
|
|
186
|
+
chat.dispatch({ type: "open" });
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: "action-chat-new",
|
|
191
|
+
group: "Actions",
|
|
192
|
+
label: "New AI chat",
|
|
193
|
+
run: () => {
|
|
194
|
+
setOpen(false);
|
|
195
|
+
chat.newThread();
|
|
196
|
+
chat.dispatch({ type: "open" });
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "action-chat-history",
|
|
201
|
+
group: "Actions",
|
|
202
|
+
label: "AI chat history",
|
|
203
|
+
run: () => {
|
|
204
|
+
setOpen(false);
|
|
205
|
+
chat.dispatch({ type: "showHistory" });
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
if (editorActions.canRevert && revertDoc) {
|
|
211
|
+
list.push({
|
|
212
|
+
id: "action-revert",
|
|
213
|
+
group: "Actions",
|
|
214
|
+
label: "Revert file",
|
|
215
|
+
hint: "Drop my uncommitted changes to this document",
|
|
216
|
+
run: () => {
|
|
217
|
+
setOpen(false);
|
|
218
|
+
void revertDoc();
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
list.push(
|
|
223
|
+
{
|
|
224
|
+
id: "action-workspaces",
|
|
225
|
+
group: "Actions",
|
|
226
|
+
label: "All workspaces",
|
|
227
|
+
run: go("/workspaces"),
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: "action-new-ws",
|
|
231
|
+
group: "Actions",
|
|
232
|
+
label: "Create workspace",
|
|
233
|
+
run: go("/workspaces/new"),
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "action-account",
|
|
237
|
+
group: "Actions",
|
|
238
|
+
label: "User settings",
|
|
239
|
+
run: go("/account"),
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: "action-theme",
|
|
243
|
+
group: "Appearance",
|
|
244
|
+
label: `Theme: ${THEME_LABEL[preference]}`,
|
|
245
|
+
hint: "Toggle",
|
|
246
|
+
run: () => {
|
|
247
|
+
cyclePreference();
|
|
248
|
+
setOpen(false);
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: "action-logout",
|
|
253
|
+
group: "Actions",
|
|
254
|
+
label: "Log out",
|
|
255
|
+
run: () => {
|
|
256
|
+
setOpen(false);
|
|
257
|
+
onLogout();
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
);
|
|
261
|
+
if (isStudioDev()) {
|
|
262
|
+
list.push({
|
|
263
|
+
id: "action-ui-kit",
|
|
264
|
+
group: "Actions",
|
|
265
|
+
label: "Open UI kit",
|
|
266
|
+
hint: "/__ui",
|
|
267
|
+
run: go("/__ui"),
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
for (const ws of workspaces) {
|
|
271
|
+
list.push({
|
|
272
|
+
id: `ws-${ws.id}`,
|
|
273
|
+
group: "Workspaces",
|
|
274
|
+
label: ws.name,
|
|
275
|
+
run: go(workspaceHomePath(ws.slug)),
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
if (workspaceNav) {
|
|
279
|
+
list.push(
|
|
280
|
+
{
|
|
281
|
+
id: "settings-general",
|
|
282
|
+
group: "Settings",
|
|
283
|
+
label: "General settings",
|
|
284
|
+
run: go(settingsPath(workspaceNav.workspaceSlug, "general")),
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: "settings-github",
|
|
288
|
+
group: "Settings",
|
|
289
|
+
label: "GitHub settings",
|
|
290
|
+
run: go(settingsPath(workspaceNav.workspaceSlug, "github")),
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: "settings-schema",
|
|
294
|
+
group: "Settings",
|
|
295
|
+
label: "Schema settings",
|
|
296
|
+
run: go(settingsPath(workspaceNav.workspaceSlug, "schema")),
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "settings-mcp",
|
|
300
|
+
group: "Settings",
|
|
301
|
+
label: "Connectors",
|
|
302
|
+
run: go(settingsPath(workspaceNav.workspaceSlug, "mcp")),
|
|
303
|
+
},
|
|
304
|
+
);
|
|
305
|
+
for (const contentType of workspaceNav.contentTypes) {
|
|
306
|
+
list.push({
|
|
307
|
+
id: `type-${contentType}`,
|
|
308
|
+
group: "Documents",
|
|
309
|
+
label: contentType,
|
|
310
|
+
hint: "Type",
|
|
311
|
+
run: go(contentTypePath(workspaceNav.workspaceSlug, contentType)),
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
for (const doc of docs) {
|
|
315
|
+
list.push({
|
|
316
|
+
id: `doc-${doc.locale}-${doc.type}-${doc.slug}`,
|
|
317
|
+
group: "Documents",
|
|
318
|
+
label: `${doc.type}/${doc.slug}`,
|
|
319
|
+
hint: doc.status === "clean" ? doc.locale : `${doc.locale} · ${doc.status === "added" ? "new" : doc.status}`,
|
|
320
|
+
run: go(
|
|
321
|
+
contentDocPath(
|
|
322
|
+
workspaceNav.workspaceSlug,
|
|
323
|
+
doc.type,
|
|
324
|
+
doc.slug,
|
|
325
|
+
doc.locale,
|
|
326
|
+
workspaceNav.defaultLocale,
|
|
327
|
+
),
|
|
328
|
+
),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return list;
|
|
333
|
+
}, [
|
|
334
|
+
chat,
|
|
335
|
+
cyclePreference,
|
|
336
|
+
revertDoc,
|
|
337
|
+
docs,
|
|
338
|
+
editorActions.canRevert,
|
|
339
|
+
git,
|
|
340
|
+
mod,
|
|
341
|
+
navigate,
|
|
342
|
+
onLogout,
|
|
343
|
+
preference,
|
|
344
|
+
saveDocAction,
|
|
345
|
+
workspaceNav,
|
|
346
|
+
workspaces,
|
|
347
|
+
]);
|
|
348
|
+
|
|
349
|
+
const groups = useMemo<ItemGroup[]>(() => {
|
|
350
|
+
const order: string[] = [];
|
|
351
|
+
const map = new Map<string, Item[]>();
|
|
352
|
+
for (const item of items) {
|
|
353
|
+
if (!map.has(item.group)) {
|
|
354
|
+
map.set(item.group, []);
|
|
355
|
+
order.push(item.group);
|
|
356
|
+
}
|
|
357
|
+
map.get(item.group)!.push(item);
|
|
358
|
+
}
|
|
359
|
+
return order.map((group) => ({ value: group, items: map.get(group)! }));
|
|
360
|
+
}, [items]);
|
|
361
|
+
|
|
362
|
+
return (
|
|
363
|
+
// Combobox owns filtering + keyboard navigation; Dialog owns the overlay.
|
|
364
|
+
// Binding both to the same `open` resets the query/highlight on close.
|
|
365
|
+
<Combobox.Root
|
|
366
|
+
inline
|
|
367
|
+
autoHighlight
|
|
368
|
+
open={open}
|
|
369
|
+
onOpenChange={setOpen}
|
|
370
|
+
items={groups}
|
|
371
|
+
value={null}
|
|
372
|
+
filter={filterItem}
|
|
373
|
+
itemToStringLabel={(item: Item) => item.label}
|
|
374
|
+
onValueChange={(item) => item?.run()}
|
|
375
|
+
>
|
|
376
|
+
<Dialog.Root open={open} onOpenChange={setOpen}>
|
|
377
|
+
<Dialog.Portal>
|
|
378
|
+
<Dialog.Backdrop {...stylex.props(styles.backdrop)} />
|
|
379
|
+
<Dialog.Popup {...stylex.props(styles.popup)} initialFocus={inputRef}>
|
|
380
|
+
<Dialog.Title {...stylex.props(styles.srOnly)}>Command palette</Dialog.Title>
|
|
381
|
+
<Dialog.Description {...stylex.props(styles.srOnly)}>
|
|
382
|
+
Jump to pages or run save, commit, and other actions.
|
|
383
|
+
</Dialog.Description>
|
|
384
|
+
<Combobox.Input
|
|
385
|
+
ref={inputRef}
|
|
386
|
+
placeholder="Go to or run…"
|
|
387
|
+
aria-label="Command palette search"
|
|
388
|
+
autoComplete="off"
|
|
389
|
+
spellCheck={false}
|
|
390
|
+
className={cx(styles.input)}
|
|
391
|
+
/>
|
|
392
|
+
<p {...stylex.props(styles.caption)}>↑↓ move · ↵ run · esc close</p>
|
|
393
|
+
<div {...stylex.props(styles.results)}>
|
|
394
|
+
<Combobox.Empty className={cx(styles.empty)}>No matches</Combobox.Empty>
|
|
395
|
+
<Combobox.List>
|
|
396
|
+
{(group: ItemGroup) => (
|
|
397
|
+
<Combobox.Group key={group.value} items={group.items}>
|
|
398
|
+
<Combobox.GroupLabel className={cx(styles.group)}>
|
|
399
|
+
{group.value}
|
|
400
|
+
</Combobox.GroupLabel>
|
|
401
|
+
<Combobox.Collection>
|
|
402
|
+
{(item: Item) => (
|
|
403
|
+
<Combobox.Item
|
|
404
|
+
key={item.id}
|
|
405
|
+
value={item}
|
|
406
|
+
className={(state) =>
|
|
407
|
+
cx(styles.item, state.highlighted && styles.itemActive)
|
|
408
|
+
}
|
|
409
|
+
>
|
|
410
|
+
<span>{item.label}</span>
|
|
411
|
+
<span {...stylex.props(styles.meta)}>
|
|
412
|
+
{item.hint ? (
|
|
413
|
+
<span {...stylex.props(styles.hint)}>{item.hint}</span>
|
|
414
|
+
) : null}
|
|
415
|
+
{item.shortcut ? (
|
|
416
|
+
<span {...stylex.props(styles.shortcut)}>{item.shortcut}</span>
|
|
417
|
+
) : null}
|
|
418
|
+
</span>
|
|
419
|
+
</Combobox.Item>
|
|
420
|
+
)}
|
|
421
|
+
</Combobox.Collection>
|
|
422
|
+
</Combobox.Group>
|
|
423
|
+
)}
|
|
424
|
+
</Combobox.List>
|
|
425
|
+
</div>
|
|
426
|
+
</Dialog.Popup>
|
|
427
|
+
</Dialog.Portal>
|
|
428
|
+
</Dialog.Root>
|
|
429
|
+
</Combobox.Root>
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function filterItem(item: Item, query: string) {
|
|
434
|
+
return (
|
|
435
|
+
matches(query, item.label) ||
|
|
436
|
+
matches(query, item.group) ||
|
|
437
|
+
(item.hint ? matches(query, item.hint) : false) ||
|
|
438
|
+
(item.shortcut ? matches(query, item.shortcut) : false)
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const styles = stylex.create({
|
|
443
|
+
backdrop: {
|
|
444
|
+
position: "fixed",
|
|
445
|
+
inset: 0,
|
|
446
|
+
zIndex: z.overlay,
|
|
447
|
+
backgroundColor: colors.overlay,
|
|
448
|
+
},
|
|
449
|
+
popup: {
|
|
450
|
+
position: "fixed",
|
|
451
|
+
left: "50%",
|
|
452
|
+
top: "18vh",
|
|
453
|
+
zIndex: z.palette,
|
|
454
|
+
width: "min(520px, calc(100vw - 32px))",
|
|
455
|
+
transform: "translateX(-50%)",
|
|
456
|
+
borderRadius: radius.md,
|
|
457
|
+
borderWidth: 1,
|
|
458
|
+
borderStyle: "solid",
|
|
459
|
+
borderColor: colors.border,
|
|
460
|
+
backgroundColor: colors.bgSurface,
|
|
461
|
+
overflow: "hidden",
|
|
462
|
+
outline: "none",
|
|
463
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
464
|
+
transitionDuration: "0ms",
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
input: {
|
|
468
|
+
display: "block",
|
|
469
|
+
width: "100%",
|
|
470
|
+
borderWidth: 0,
|
|
471
|
+
backgroundColor: "transparent",
|
|
472
|
+
color: colors.text,
|
|
473
|
+
paddingInline: space.xl,
|
|
474
|
+
paddingTop: space.lg,
|
|
475
|
+
paddingBottom: space.sm,
|
|
476
|
+
fontSize: type.lg,
|
|
477
|
+
outline: "none",
|
|
478
|
+
},
|
|
479
|
+
caption: {
|
|
480
|
+
margin: 0,
|
|
481
|
+
paddingInline: space.xl,
|
|
482
|
+
paddingBottom: space.md,
|
|
483
|
+
borderBottomWidth: 1,
|
|
484
|
+
borderBottomStyle: "solid",
|
|
485
|
+
borderBottomColor: colors.border,
|
|
486
|
+
color: colors.textMuted,
|
|
487
|
+
fontFamily: type.mono,
|
|
488
|
+
fontSize: type.xs,
|
|
489
|
+
lineHeight: 1.45,
|
|
490
|
+
},
|
|
491
|
+
results: {
|
|
492
|
+
maxHeight: "320px",
|
|
493
|
+
overflowY: "auto",
|
|
494
|
+
paddingBlock: space.sm,
|
|
495
|
+
},
|
|
496
|
+
group: {
|
|
497
|
+
margin: 0,
|
|
498
|
+
paddingInline: space.xl,
|
|
499
|
+
paddingBlock: space.sm,
|
|
500
|
+
fontSize: type.xs,
|
|
501
|
+
fontWeight: 600,
|
|
502
|
+
letterSpacing: "0.08em",
|
|
503
|
+
textTransform: "uppercase",
|
|
504
|
+
color: colors.textMuted,
|
|
505
|
+
},
|
|
506
|
+
item: {
|
|
507
|
+
display: "flex",
|
|
508
|
+
width: "100%",
|
|
509
|
+
cursor: "pointer",
|
|
510
|
+
alignItems: "center",
|
|
511
|
+
justifyContent: "space-between",
|
|
512
|
+
gap: space.lg,
|
|
513
|
+
borderWidth: 0,
|
|
514
|
+
backgroundColor: "transparent",
|
|
515
|
+
paddingInline: space.xl,
|
|
516
|
+
paddingBlock: space.md,
|
|
517
|
+
textAlign: "left",
|
|
518
|
+
fontSize: type.md,
|
|
519
|
+
fontWeight: 500,
|
|
520
|
+
color: colors.text,
|
|
521
|
+
},
|
|
522
|
+
itemActive: {
|
|
523
|
+
backgroundColor: colors.bgActive,
|
|
524
|
+
},
|
|
525
|
+
hint: {
|
|
526
|
+
color: colors.textMuted,
|
|
527
|
+
fontFamily: type.mono,
|
|
528
|
+
fontSize: type.xs,
|
|
529
|
+
},
|
|
530
|
+
meta: {
|
|
531
|
+
display: "flex",
|
|
532
|
+
alignItems: "center",
|
|
533
|
+
gap: space.md,
|
|
534
|
+
flexShrink: 0,
|
|
535
|
+
},
|
|
536
|
+
shortcut: {
|
|
537
|
+
color: colors.textMuted,
|
|
538
|
+
fontFamily: type.mono,
|
|
539
|
+
fontSize: type.xs,
|
|
540
|
+
},
|
|
541
|
+
empty: {
|
|
542
|
+
margin: 0,
|
|
543
|
+
// Combobox.Empty stays mounted while items exist; collapse it then.
|
|
544
|
+
padding: { default: space.xl, ":empty": 0 },
|
|
545
|
+
fontSize: type.sm,
|
|
546
|
+
color: colors.textMuted,
|
|
547
|
+
},
|
|
548
|
+
srOnly: {
|
|
549
|
+
position: "absolute",
|
|
550
|
+
width: "1px",
|
|
551
|
+
height: "1px",
|
|
552
|
+
padding: 0,
|
|
553
|
+
margin: "-1px",
|
|
554
|
+
overflow: "hidden",
|
|
555
|
+
clip: "rect(0, 0, 0, 0)",
|
|
556
|
+
whiteSpace: "nowrap",
|
|
557
|
+
borderWidth: 0,
|
|
558
|
+
},
|
|
559
|
+
});
|