@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
package/src/ui/Page.tsx
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// packages/studio/src/ui/Page.tsx
|
|
2
|
+
import * as stylex from "@stylexjs/stylex";
|
|
3
|
+
import { colors, radius, space, type } from "../styles/tokens.stylex";
|
|
4
|
+
|
|
5
|
+
export function PageFrame({
|
|
6
|
+
children,
|
|
7
|
+
flush,
|
|
8
|
+
centered,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
flush?: boolean;
|
|
12
|
+
centered?: boolean;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
{...stylex.props(
|
|
17
|
+
styles.scroll,
|
|
18
|
+
flush && styles.flush,
|
|
19
|
+
centered && styles.scrollCentered,
|
|
20
|
+
)}
|
|
21
|
+
>
|
|
22
|
+
{flush ? (
|
|
23
|
+
children
|
|
24
|
+
) : (
|
|
25
|
+
<div {...stylex.props(styles.inner, centered && styles.innerCentered)}>
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function PageHeader({
|
|
34
|
+
kicker,
|
|
35
|
+
title,
|
|
36
|
+
description,
|
|
37
|
+
action,
|
|
38
|
+
compact,
|
|
39
|
+
}: {
|
|
40
|
+
kicker?: React.ReactNode;
|
|
41
|
+
title: string;
|
|
42
|
+
description?: React.ReactNode;
|
|
43
|
+
action?: React.ReactNode;
|
|
44
|
+
compact?: boolean;
|
|
45
|
+
}) {
|
|
46
|
+
return (
|
|
47
|
+
<header {...stylex.props(styles.header, compact && styles.headerCompact)}>
|
|
48
|
+
<div {...stylex.props(styles.heading)}>
|
|
49
|
+
{kicker}
|
|
50
|
+
<h1 {...stylex.props(styles.title)}>{title}</h1>
|
|
51
|
+
{description ? (
|
|
52
|
+
<div {...stylex.props(styles.description)}>{description}</div>
|
|
53
|
+
) : null}
|
|
54
|
+
</div>
|
|
55
|
+
{action}
|
|
56
|
+
</header>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function Panel({ children }: { children: React.ReactNode }) {
|
|
61
|
+
return <div {...stylex.props(styles.panel)}>{children}</div>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function Stack({
|
|
65
|
+
children,
|
|
66
|
+
gap = "md",
|
|
67
|
+
}: {
|
|
68
|
+
children: React.ReactNode;
|
|
69
|
+
gap?: "sm" | "md" | "lg";
|
|
70
|
+
}) {
|
|
71
|
+
return (
|
|
72
|
+
<div
|
|
73
|
+
{...stylex.props(
|
|
74
|
+
styles.stack,
|
|
75
|
+
gap === "sm" && styles.gapSm,
|
|
76
|
+
gap === "md" && styles.gapMd,
|
|
77
|
+
gap === "lg" && styles.gapLg,
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
{children}
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const styles = stylex.create({
|
|
86
|
+
scroll: {
|
|
87
|
+
minHeight: 0,
|
|
88
|
+
flex: 1,
|
|
89
|
+
overflowY: "auto",
|
|
90
|
+
},
|
|
91
|
+
flush: {
|
|
92
|
+
display: "flex",
|
|
93
|
+
flexDirection: "column",
|
|
94
|
+
overflow: "hidden",
|
|
95
|
+
},
|
|
96
|
+
scrollCentered: {
|
|
97
|
+
display: "flex",
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
},
|
|
101
|
+
inner: {
|
|
102
|
+
width: "100%",
|
|
103
|
+
maxWidth: "720px",
|
|
104
|
+
marginInline: "auto",
|
|
105
|
+
paddingInline: space.xxl,
|
|
106
|
+
paddingBlock: space.xxl,
|
|
107
|
+
},
|
|
108
|
+
innerCentered: {
|
|
109
|
+
maxWidth: "440px",
|
|
110
|
+
},
|
|
111
|
+
header: {
|
|
112
|
+
display: "flex",
|
|
113
|
+
alignItems: "flex-start",
|
|
114
|
+
justifyContent: "space-between",
|
|
115
|
+
gap: space.lg,
|
|
116
|
+
marginBottom: space.xxl,
|
|
117
|
+
},
|
|
118
|
+
headerCompact: {
|
|
119
|
+
marginBottom: 0,
|
|
120
|
+
},
|
|
121
|
+
heading: {
|
|
122
|
+
minWidth: 0,
|
|
123
|
+
},
|
|
124
|
+
title: {
|
|
125
|
+
margin: 0,
|
|
126
|
+
fontSize: type.xl,
|
|
127
|
+
fontWeight: 600,
|
|
128
|
+
letterSpacing: "-0.02em",
|
|
129
|
+
textWrap: "balance",
|
|
130
|
+
},
|
|
131
|
+
description: {
|
|
132
|
+
marginTop: space.xs,
|
|
133
|
+
color: colors.textMuted,
|
|
134
|
+
fontSize: type.sm,
|
|
135
|
+
},
|
|
136
|
+
panel: {
|
|
137
|
+
borderWidth: 1,
|
|
138
|
+
borderStyle: "solid",
|
|
139
|
+
borderColor: colors.border,
|
|
140
|
+
borderRadius: radius.md,
|
|
141
|
+
backgroundColor: colors.bgSurface,
|
|
142
|
+
padding: space.xl,
|
|
143
|
+
},
|
|
144
|
+
stack: {
|
|
145
|
+
display: "flex",
|
|
146
|
+
flexDirection: "column",
|
|
147
|
+
},
|
|
148
|
+
gapSm: { gap: space.md },
|
|
149
|
+
gapMd: { gap: space.lg },
|
|
150
|
+
gapLg: { gap: space.xxl },
|
|
151
|
+
});
|
package/src/ui/Text.tsx
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// packages/studio/src/ui/Text.tsx
|
|
2
|
+
import type { ElementType, ReactNode } from "react";
|
|
3
|
+
import * as stylex from "@stylexjs/stylex";
|
|
4
|
+
import { colors, type } from "../styles/tokens.stylex";
|
|
5
|
+
|
|
6
|
+
type Tone = "default" | "muted" | "danger" | "success";
|
|
7
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl" | "display";
|
|
8
|
+
|
|
9
|
+
export function Text({
|
|
10
|
+
as: Tag = "p",
|
|
11
|
+
tone = "default",
|
|
12
|
+
size = "md",
|
|
13
|
+
weight = "regular",
|
|
14
|
+
mono,
|
|
15
|
+
truncate,
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
as?: ElementType;
|
|
19
|
+
tone?: Tone;
|
|
20
|
+
size?: Size;
|
|
21
|
+
weight?: "regular" | "medium" | "semibold";
|
|
22
|
+
mono?: boolean;
|
|
23
|
+
truncate?: boolean;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}) {
|
|
26
|
+
return (
|
|
27
|
+
<Tag
|
|
28
|
+
{...stylex.props(
|
|
29
|
+
styles.base,
|
|
30
|
+
size === "xs" && styles.xs,
|
|
31
|
+
size === "sm" && styles.sm,
|
|
32
|
+
size === "md" && styles.md,
|
|
33
|
+
size === "lg" && styles.lg,
|
|
34
|
+
size === "xl" && styles.xl,
|
|
35
|
+
size === "display" && styles.display,
|
|
36
|
+
tone === "muted" && styles.muted,
|
|
37
|
+
tone === "danger" && styles.danger,
|
|
38
|
+
tone === "success" && styles.success,
|
|
39
|
+
weight === "medium" && styles.medium,
|
|
40
|
+
weight === "semibold" && styles.semibold,
|
|
41
|
+
mono && styles.mono,
|
|
42
|
+
truncate && styles.truncate,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</Tag>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const styles = stylex.create({
|
|
51
|
+
base: {
|
|
52
|
+
margin: 0,
|
|
53
|
+
color: colors.text,
|
|
54
|
+
textWrap: "pretty",
|
|
55
|
+
},
|
|
56
|
+
xs: { fontSize: type.xs, letterSpacing: "0.04em" },
|
|
57
|
+
sm: { fontSize: type.sm },
|
|
58
|
+
md: { fontSize: type.md },
|
|
59
|
+
lg: { fontSize: type.lg },
|
|
60
|
+
xl: { fontSize: type.xl, letterSpacing: "-0.02em", textWrap: "balance" },
|
|
61
|
+
display: {
|
|
62
|
+
fontSize: type.display,
|
|
63
|
+
letterSpacing: "-0.03em",
|
|
64
|
+
textWrap: "balance",
|
|
65
|
+
},
|
|
66
|
+
muted: { color: colors.textMuted },
|
|
67
|
+
danger: { color: colors.danger },
|
|
68
|
+
success: { color: colors.success },
|
|
69
|
+
medium: { fontWeight: 500 },
|
|
70
|
+
semibold: { fontWeight: 600 },
|
|
71
|
+
mono: { fontFamily: type.mono },
|
|
72
|
+
truncate: {
|
|
73
|
+
overflow: "hidden",
|
|
74
|
+
textOverflow: "ellipsis",
|
|
75
|
+
whiteSpace: "nowrap",
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// packages/studio/src/ui/Tooltip.tsx
|
|
2
|
+
//
|
|
3
|
+
// Base UI tooltip with app styling. Wrap any focusable trigger:
|
|
4
|
+
//
|
|
5
|
+
// <Tooltip label="Close (Esc)"><button aria-label="Close">…</button></Tooltip>
|
|
6
|
+
//
|
|
7
|
+
// Mount one <TooltipProvider> near the app root so hovering between adjacent
|
|
8
|
+
// icon buttons doesn't re-trigger the open delay.
|
|
9
|
+
import type { ReactElement, ReactNode } from "react";
|
|
10
|
+
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip";
|
|
11
|
+
import * as stylex from "@stylexjs/stylex";
|
|
12
|
+
import { colors, radius, space, type, z } from "../styles/tokens.stylex";
|
|
13
|
+
import { cx } from "./popup";
|
|
14
|
+
|
|
15
|
+
type Side = "top" | "bottom" | "left" | "right";
|
|
16
|
+
|
|
17
|
+
export function TooltipProvider({ children }: { children: ReactNode }) {
|
|
18
|
+
return (
|
|
19
|
+
<BaseTooltip.Provider delay={500} closeDelay={0} timeout={300}>
|
|
20
|
+
{children}
|
|
21
|
+
</BaseTooltip.Provider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function Tooltip({
|
|
26
|
+
label,
|
|
27
|
+
side = "top",
|
|
28
|
+
children,
|
|
29
|
+
}: {
|
|
30
|
+
label: ReactNode;
|
|
31
|
+
side?: Side;
|
|
32
|
+
/** A single element that accepts a ref and event handlers. */
|
|
33
|
+
children: ReactElement;
|
|
34
|
+
}) {
|
|
35
|
+
if (!label) return children;
|
|
36
|
+
return (
|
|
37
|
+
<BaseTooltip.Root>
|
|
38
|
+
<BaseTooltip.Trigger render={children} />
|
|
39
|
+
<BaseTooltip.Portal>
|
|
40
|
+
<BaseTooltip.Positioner side={side} sideOffset={6} className={cx(styles.positioner)}>
|
|
41
|
+
<BaseTooltip.Popup
|
|
42
|
+
className={(state) =>
|
|
43
|
+
cx(
|
|
44
|
+
styles.popup,
|
|
45
|
+
state.transitionStatus === "starting" && styles.hidden,
|
|
46
|
+
state.transitionStatus === "ending" && styles.hidden,
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
{label}
|
|
51
|
+
</BaseTooltip.Popup>
|
|
52
|
+
</BaseTooltip.Positioner>
|
|
53
|
+
</BaseTooltip.Portal>
|
|
54
|
+
</BaseTooltip.Root>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const styles = stylex.create({
|
|
59
|
+
positioner: {
|
|
60
|
+
zIndex: z.tooltip,
|
|
61
|
+
},
|
|
62
|
+
popup: {
|
|
63
|
+
boxSizing: "border-box",
|
|
64
|
+
maxWidth: 260,
|
|
65
|
+
paddingInline: space.md,
|
|
66
|
+
paddingBlock: space.xs,
|
|
67
|
+
borderRadius: radius.sm,
|
|
68
|
+
backgroundColor: colors.text,
|
|
69
|
+
color: colors.textInverse,
|
|
70
|
+
fontFamily: type.sans,
|
|
71
|
+
fontSize: type.xs,
|
|
72
|
+
lineHeight: 1.4,
|
|
73
|
+
boxShadow: "0 4px 12px rgba(24, 24, 27, 0.16)",
|
|
74
|
+
transformOrigin: "var(--transform-origin)",
|
|
75
|
+
transitionProperty: "opacity, transform",
|
|
76
|
+
transitionDuration: "100ms",
|
|
77
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
78
|
+
transitionDuration: "0ms",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
hidden: {
|
|
82
|
+
opacity: 0,
|
|
83
|
+
transform: "scale(0.96)",
|
|
84
|
+
},
|
|
85
|
+
});
|
package/src/ui/popup.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// packages/studio/src/ui/popup.ts
|
|
2
|
+
//
|
|
3
|
+
// Shared look for Base UI floating surfaces (Select, Menu, Combobox, Popover)
|
|
4
|
+
// so every dropdown in the app renders the same. Components pass these to
|
|
5
|
+
// `stylex.props` and combine them with their own local styles.
|
|
6
|
+
import * as stylex from "@stylexjs/stylex";
|
|
7
|
+
import { colors, radius, space, type, z } from "../styles/tokens.stylex";
|
|
8
|
+
|
|
9
|
+
const hover = "@media (hover: hover)";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Base UI passes component state to `className` functions. Use this to map
|
|
13
|
+
* state flags (highlighted, selected…) onto StyleX styles.
|
|
14
|
+
*/
|
|
15
|
+
/** Same argument type `stylex.props` accepts (styles, falsy, nested arrays). */
|
|
16
|
+
export type StyleArg = stylex.StyleXArray<
|
|
17
|
+
| (null | undefined | stylex.CompiledStyles)
|
|
18
|
+
| boolean
|
|
19
|
+
| Readonly<[stylex.CompiledStyles, stylex.InlineStyles]>
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export function cx(...styles: StyleArg[]) {
|
|
23
|
+
return stylex.props(...styles).className ?? "";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const popup = stylex.create({
|
|
27
|
+
positioner: {
|
|
28
|
+
zIndex: z.popover,
|
|
29
|
+
outline: "none",
|
|
30
|
+
},
|
|
31
|
+
surface: {
|
|
32
|
+
boxSizing: "border-box",
|
|
33
|
+
maxHeight: "var(--available-height)",
|
|
34
|
+
overflowY: "auto",
|
|
35
|
+
paddingBlock: space.xs,
|
|
36
|
+
borderWidth: 1,
|
|
37
|
+
borderStyle: "solid",
|
|
38
|
+
borderColor: colors.border,
|
|
39
|
+
borderRadius: 10,
|
|
40
|
+
backgroundColor: colors.bgSurface,
|
|
41
|
+
color: colors.text,
|
|
42
|
+
fontSize: type.xs,
|
|
43
|
+
boxShadow: "0 16px 40px rgba(24, 24, 27, 0.14), 0 2px 8px rgba(24, 24, 27, 0.06)",
|
|
44
|
+
outline: "none",
|
|
45
|
+
transformOrigin: "var(--transform-origin)",
|
|
46
|
+
transitionProperty: "opacity, transform",
|
|
47
|
+
transitionDuration: "150ms",
|
|
48
|
+
transitionTimingFunction: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
49
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
50
|
+
transitionDuration: "0ms",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
surfaceStarting: {
|
|
54
|
+
opacity: 0,
|
|
55
|
+
transform: "scale(0.96)",
|
|
56
|
+
},
|
|
57
|
+
surfaceEnding: {
|
|
58
|
+
opacity: 0,
|
|
59
|
+
transform: "scale(0.98)",
|
|
60
|
+
},
|
|
61
|
+
item: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
minHeight: 30,
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
gap: space.sm,
|
|
66
|
+
paddingInline: space.md,
|
|
67
|
+
paddingBlock: space.sm,
|
|
68
|
+
borderWidth: 0,
|
|
69
|
+
borderRadius: radius.md,
|
|
70
|
+
marginInline: space.xs,
|
|
71
|
+
backgroundColor: "transparent",
|
|
72
|
+
color: colors.text,
|
|
73
|
+
fontSize: type.xs,
|
|
74
|
+
textAlign: "left",
|
|
75
|
+
cursor: "default",
|
|
76
|
+
userSelect: "none",
|
|
77
|
+
outline: "none",
|
|
78
|
+
},
|
|
79
|
+
itemHighlighted: {
|
|
80
|
+
backgroundColor: colors.bgHover,
|
|
81
|
+
},
|
|
82
|
+
itemSelected: {
|
|
83
|
+
color: colors.text,
|
|
84
|
+
},
|
|
85
|
+
/** Footer / action rows that should look like items but are real buttons. */
|
|
86
|
+
action: {
|
|
87
|
+
boxSizing: "border-box",
|
|
88
|
+
alignSelf: "stretch",
|
|
89
|
+
cursor: "pointer",
|
|
90
|
+
fontFamily: "inherit",
|
|
91
|
+
fontSize: type.xs,
|
|
92
|
+
fontWeight: 400,
|
|
93
|
+
color: colors.text,
|
|
94
|
+
[hover]: {
|
|
95
|
+
":hover": {
|
|
96
|
+
backgroundColor: colors.bgHover,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
":focus-visible": {
|
|
100
|
+
outlineWidth: 2,
|
|
101
|
+
outlineStyle: "solid",
|
|
102
|
+
outlineColor: colors.focus,
|
|
103
|
+
outlineOffset: -2,
|
|
104
|
+
},
|
|
105
|
+
":disabled": {
|
|
106
|
+
opacity: 0.55,
|
|
107
|
+
cursor: "not-allowed",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
itemDisabled: {
|
|
111
|
+
opacity: 0.5,
|
|
112
|
+
},
|
|
113
|
+
itemIndicator: {
|
|
114
|
+
display: "inline-flex",
|
|
115
|
+
width: 14,
|
|
116
|
+
flexShrink: 0,
|
|
117
|
+
justifyContent: "center",
|
|
118
|
+
color: colors.accent,
|
|
119
|
+
},
|
|
120
|
+
itemMeta: {
|
|
121
|
+
marginLeft: "auto",
|
|
122
|
+
flexShrink: 0,
|
|
123
|
+
fontSize: type.xs,
|
|
124
|
+
color: colors.textMuted,
|
|
125
|
+
},
|
|
126
|
+
groupLabel: {
|
|
127
|
+
margin: 0,
|
|
128
|
+
paddingInline: space.lg,
|
|
129
|
+
paddingBlock: space.sm,
|
|
130
|
+
fontSize: type.xs,
|
|
131
|
+
fontWeight: 500,
|
|
132
|
+
color: colors.textMuted,
|
|
133
|
+
},
|
|
134
|
+
separator: {
|
|
135
|
+
height: 1,
|
|
136
|
+
marginBlock: space.xs,
|
|
137
|
+
backgroundColor: colors.border,
|
|
138
|
+
},
|
|
139
|
+
empty: {
|
|
140
|
+
margin: 0,
|
|
141
|
+
paddingInline: space.lg,
|
|
142
|
+
// Combobox.Empty stays mounted while items exist; collapse it then.
|
|
143
|
+
paddingBlock: { default: space.md, ":empty": 0 },
|
|
144
|
+
fontSize: type.sm,
|
|
145
|
+
color: colors.textMuted,
|
|
146
|
+
},
|
|
147
|
+
quietInput: {
|
|
148
|
+
display: "block",
|
|
149
|
+
width: "100%",
|
|
150
|
+
boxSizing: "border-box",
|
|
151
|
+
borderWidth: 0,
|
|
152
|
+
backgroundColor: "transparent",
|
|
153
|
+
color: colors.text,
|
|
154
|
+
paddingInline: space.lg,
|
|
155
|
+
paddingBlock: space.md,
|
|
156
|
+
fontFamily: type.sans,
|
|
157
|
+
fontSize: type.sm,
|
|
158
|
+
outline: "none",
|
|
159
|
+
":focus": {
|
|
160
|
+
outline: "none",
|
|
161
|
+
},
|
|
162
|
+
":focus-visible": {
|
|
163
|
+
outline: "none",
|
|
164
|
+
},
|
|
165
|
+
"::placeholder": {
|
|
166
|
+
color: colors.textMuted,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
searchInput: {
|
|
170
|
+
display: "block",
|
|
171
|
+
width: "100%",
|
|
172
|
+
boxSizing: "border-box",
|
|
173
|
+
marginTop: `calc(${space.xs} * -1)`,
|
|
174
|
+
marginBottom: space.xs,
|
|
175
|
+
borderWidth: 0,
|
|
176
|
+
borderBottomWidth: 1,
|
|
177
|
+
borderBottomStyle: "solid",
|
|
178
|
+
borderBottomColor: colors.border,
|
|
179
|
+
backgroundColor: "transparent",
|
|
180
|
+
color: colors.text,
|
|
181
|
+
paddingInline: space.lg,
|
|
182
|
+
paddingBlock: space.md,
|
|
183
|
+
fontFamily: type.sans,
|
|
184
|
+
fontSize: type.sm,
|
|
185
|
+
outline: "none",
|
|
186
|
+
":focus": {
|
|
187
|
+
outline: "none",
|
|
188
|
+
},
|
|
189
|
+
":focus-visible": {
|
|
190
|
+
outline: "none",
|
|
191
|
+
},
|
|
192
|
+
"::placeholder": {
|
|
193
|
+
color: colors.textMuted,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
export type TransitionStatus = "starting" | "ending" | "idle" | undefined;
|
|
199
|
+
|
|
200
|
+
/** True while a Base UI popup is animating in or out. */
|
|
201
|
+
export function isTransitioning(status: TransitionStatus) {
|
|
202
|
+
return status === "starting" || status === "ending";
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Wraps a popup `className` so Base UI's open/close transitions animate. */
|
|
206
|
+
export function popupClassName(
|
|
207
|
+
state: { transitionStatus?: TransitionStatus },
|
|
208
|
+
...extra: StyleArg[]
|
|
209
|
+
) {
|
|
210
|
+
return cx(
|
|
211
|
+
popup.surface,
|
|
212
|
+
state.transitionStatus === "starting" && popup.surfaceStarting,
|
|
213
|
+
state.transitionStatus === "ending" && popup.surfaceEnding,
|
|
214
|
+
...extra,
|
|
215
|
+
);
|
|
216
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// packages/studio/src/workspace/permissions.ts
|
|
2
|
+
|
|
3
|
+
export function canManageMembers(role: string): boolean {
|
|
4
|
+
return role === "admin";
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function canManageWorkspace(role: string): boolean {
|
|
8
|
+
return role === "admin";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function canDevelop(role: string): boolean {
|
|
12
|
+
return role === "admin" || role === "developer";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function canPublish(role: string): boolean {
|
|
16
|
+
return role === "admin" || role === "developer" || role === "editor";
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// packages/studio/src/workspace/types.ts
|
|
2
|
+
import type { Dispatch, SetStateAction } from "react";
|
|
3
|
+
import type { SchemaPayload, WorkspaceDetail } from "../api";
|
|
4
|
+
|
|
5
|
+
export type WorkspaceOutletContext = {
|
|
6
|
+
workspace: WorkspaceDetail;
|
|
7
|
+
models: SchemaPayload["models"];
|
|
8
|
+
blocks: NonNullable<SchemaPayload["blocks"]>;
|
|
9
|
+
richtext: NonNullable<SchemaPayload["richtext"]>;
|
|
10
|
+
setWorkspace: Dispatch<SetStateAction<WorkspaceDetail | null>>;
|
|
11
|
+
reload: () => Promise<void>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// packages/studio/src/workspace-path.ts
|
|
2
|
+
export function workspaceHomePath(slug: string) {
|
|
3
|
+
return `/${slug}`;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function contentTypePath(slug: string, type: string) {
|
|
7
|
+
return `/${slug}/content/${type}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function contentDocPath(
|
|
11
|
+
slug: string,
|
|
12
|
+
type: string,
|
|
13
|
+
docSlug: string,
|
|
14
|
+
locale: string,
|
|
15
|
+
defaultLocale: string,
|
|
16
|
+
) {
|
|
17
|
+
const path = `/${slug}/content/${type}/${docSlug}`;
|
|
18
|
+
if (locale && locale !== defaultLocale) {
|
|
19
|
+
return `${path}?locale=${encodeURIComponent(locale)}`;
|
|
20
|
+
}
|
|
21
|
+
return path;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function settingsPath(slug: string, page: string) {
|
|
25
|
+
return `/${slug}/settings/${page}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function githubConnectPath(slug: string) {
|
|
29
|
+
return `/${slug}/github`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const APP_ROOTS = new Set(["workspaces", "account", "invite", "__ui"]);
|
|
33
|
+
|
|
34
|
+
export function cmsWorkspaceSlug(pathname: string): string | null {
|
|
35
|
+
if (pathname === "/") return null;
|
|
36
|
+
const legacy = pathname.match(/^\/workspaces\/([^/]+)/);
|
|
37
|
+
if (legacy) {
|
|
38
|
+
const id = decodeURIComponent(legacy[1]!);
|
|
39
|
+
if (id === "new") return null;
|
|
40
|
+
return id;
|
|
41
|
+
}
|
|
42
|
+
const match = pathname.match(/^\/([^/]+)/);
|
|
43
|
+
if (!match) return null;
|
|
44
|
+
const first = decodeURIComponent(match[1]!);
|
|
45
|
+
if (APP_ROOTS.has(first)) return null;
|
|
46
|
+
return first;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function rewriteLegacyWorkspacePath(
|
|
50
|
+
pathname: string,
|
|
51
|
+
slug: string,
|
|
52
|
+
defaultLocale = "en",
|
|
53
|
+
): string {
|
|
54
|
+
const rest = pathname.match(/^\/workspaces\/[^/]+(?:\/(.*))?$/)?.[1] ?? "";
|
|
55
|
+
if (!rest) return workspaceHomePath(slug);
|
|
56
|
+
const types = rest.match(/^types\/([^/]+)\/?$/);
|
|
57
|
+
if (types) return contentTypePath(slug, decodeURIComponent(types[1]!));
|
|
58
|
+
const docs = rest.match(/^docs\/([^/]+)\/([^/]+)\/([^/]+)\/?$/);
|
|
59
|
+
if (docs) {
|
|
60
|
+
return contentDocPath(
|
|
61
|
+
slug,
|
|
62
|
+
decodeURIComponent(docs[2]!),
|
|
63
|
+
decodeURIComponent(docs[3]!),
|
|
64
|
+
decodeURIComponent(docs[1]!),
|
|
65
|
+
defaultLocale,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (rest === "github" || rest.startsWith("settings/")) {
|
|
69
|
+
return `/${slug}/${rest.replace(/\/$/, "")}`;
|
|
70
|
+
}
|
|
71
|
+
return workspaceHomePath(slug);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function defaultLocaleOf(locales: string[] | null | undefined) {
|
|
75
|
+
return locales?.[0] || "en";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function isWorkspaceEditorPath(pathname: string) {
|
|
79
|
+
return /\/content\/[^/]+\/[^/]+\/?$/.test(pathname);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function isWorkspaceTypeIndexPath(pathname: string) {
|
|
83
|
+
return /\/content\/[^/]+\/?$/.test(pathname) && !isWorkspaceEditorPath(pathname);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function isWorkspaceSettingsPath(pathname: string) {
|
|
87
|
+
return /\/settings(?:\/|$)/.test(pathname) || /\/github\/?$/.test(pathname);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function isGithubSettingsPath(pathname: string) {
|
|
91
|
+
return /\/(?:settings\/)?github\/?$/.test(pathname);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Full-bleed pages that hide the app sidebar. */
|
|
95
|
+
export function isOrgPickerPath(pathname: string) {
|
|
96
|
+
const path = pathname.replace(/\/$/, "") || "/";
|
|
97
|
+
return path === "/invite";
|
|
98
|
+
}
|