@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,331 @@
|
|
|
1
|
+
// packages/studio/src/pages/UiKitPage.tsx
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import * as stylex from "@stylexjs/stylex";
|
|
4
|
+
import { StatusBar, StatusItem } from "../chrome/StatusBar";
|
|
5
|
+
import { colors, radius, space, type } from "../styles/tokens.stylex";
|
|
6
|
+
import { useTheme } from "../theme/ThemeProvider";
|
|
7
|
+
import { BackLink } from "../ui/BackLink";
|
|
8
|
+
import { Button, ButtonLink } from "../ui/Button";
|
|
9
|
+
import { Field } from "../ui/Field";
|
|
10
|
+
import { Input, Select, Textarea } from "../ui/Input";
|
|
11
|
+
import { List, ListRow } from "../ui/ListRow";
|
|
12
|
+
import { PageHeader, Panel, Stack } from "../ui/Page";
|
|
13
|
+
import { Text } from "../ui/Text";
|
|
14
|
+
|
|
15
|
+
const VARIANTS = ["primary", "secondary", "ghost", "danger"] as const;
|
|
16
|
+
|
|
17
|
+
export function UiKitPage() {
|
|
18
|
+
const { preference, resolved, setPreference } = useTheme();
|
|
19
|
+
const [locale, setLocale] = useState("en");
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div {...stylex.props(styles.page)}>
|
|
23
|
+
<header {...stylex.props(styles.top)}>
|
|
24
|
+
<div>
|
|
25
|
+
<Text as="p" size="xs" tone="muted" weight="semibold">
|
|
26
|
+
DEV ONLY · /__ui
|
|
27
|
+
</Text>
|
|
28
|
+
<Text as="h1" size="display" weight="semibold">
|
|
29
|
+
UI kit
|
|
30
|
+
</Text>
|
|
31
|
+
<Text tone="muted" size="sm">
|
|
32
|
+
StyleX + Base UI primitives. Theme is {preference} (resolved{" "}
|
|
33
|
+
{resolved}
|
|
34
|
+
).
|
|
35
|
+
</Text>
|
|
36
|
+
<div {...stylex.props(styles.back)}>
|
|
37
|
+
<BackLink to="/">← Back to app</BackLink>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div {...stylex.props(styles.themeRow)}>
|
|
41
|
+
<Button
|
|
42
|
+
variant={preference === "system" ? "primary" : "secondary"}
|
|
43
|
+
onClick={() => setPreference("system")}
|
|
44
|
+
>
|
|
45
|
+
System
|
|
46
|
+
</Button>
|
|
47
|
+
<Button
|
|
48
|
+
variant={preference === "light" ? "primary" : "secondary"}
|
|
49
|
+
onClick={() => setPreference("light")}
|
|
50
|
+
>
|
|
51
|
+
Light
|
|
52
|
+
</Button>
|
|
53
|
+
<Button
|
|
54
|
+
variant={preference === "dark" ? "primary" : "secondary"}
|
|
55
|
+
onClick={() => setPreference("dark")}
|
|
56
|
+
>
|
|
57
|
+
Dark
|
|
58
|
+
</Button>
|
|
59
|
+
</div>
|
|
60
|
+
</header>
|
|
61
|
+
|
|
62
|
+
<Stack gap="lg">
|
|
63
|
+
<section {...stylex.props(styles.section)}>
|
|
64
|
+
<SectionTitle>Buttons</SectionTitle>
|
|
65
|
+
<Panel>
|
|
66
|
+
<Stack gap="md">
|
|
67
|
+
{VARIANTS.map((variant) => (
|
|
68
|
+
<Row key={variant} label={variant}>
|
|
69
|
+
<Button variant={variant}>{variant}</Button>
|
|
70
|
+
<Button variant={variant} disabled>
|
|
71
|
+
disabled
|
|
72
|
+
</Button>
|
|
73
|
+
<ButtonLink variant={variant} to="/__ui">
|
|
74
|
+
link
|
|
75
|
+
</ButtonLink>
|
|
76
|
+
</Row>
|
|
77
|
+
))}
|
|
78
|
+
</Stack>
|
|
79
|
+
</Panel>
|
|
80
|
+
</section>
|
|
81
|
+
|
|
82
|
+
<section {...stylex.props(styles.section)}>
|
|
83
|
+
<SectionTitle>Fields</SectionTitle>
|
|
84
|
+
<Panel>
|
|
85
|
+
<Stack>
|
|
86
|
+
<Field label="Text" hint="Functional note under the field.">
|
|
87
|
+
<Input
|
|
88
|
+
defaultValue="Ada Lovelace"
|
|
89
|
+
autoComplete="off"
|
|
90
|
+
spellCheck={false}
|
|
91
|
+
/>
|
|
92
|
+
</Field>
|
|
93
|
+
<Field label="Disabled">
|
|
94
|
+
<Input defaultValue="Locked" disabled />
|
|
95
|
+
</Field>
|
|
96
|
+
<Field label="Select">
|
|
97
|
+
<Select
|
|
98
|
+
aria-label="Locale"
|
|
99
|
+
value={locale}
|
|
100
|
+
onValueChange={(next) => setLocale(next ?? "en")}
|
|
101
|
+
options={[
|
|
102
|
+
{ value: "en", label: "English (en)" },
|
|
103
|
+
{ value: "da", label: "Dansk (da)" },
|
|
104
|
+
]}
|
|
105
|
+
/>
|
|
106
|
+
</Field>
|
|
107
|
+
<Field label="Body (mono)">
|
|
108
|
+
<Textarea
|
|
109
|
+
mono
|
|
110
|
+
rows={4}
|
|
111
|
+
defaultValue={"---\ntitle: Hello\n---\n\nParagraph."}
|
|
112
|
+
/>
|
|
113
|
+
</Field>
|
|
114
|
+
</Stack>
|
|
115
|
+
</Panel>
|
|
116
|
+
</section>
|
|
117
|
+
|
|
118
|
+
<section {...stylex.props(styles.section)}>
|
|
119
|
+
<SectionTitle>Text</SectionTitle>
|
|
120
|
+
<Panel>
|
|
121
|
+
<Stack gap="sm">
|
|
122
|
+
<Text size="display" weight="semibold">
|
|
123
|
+
Display · 20px
|
|
124
|
+
</Text>
|
|
125
|
+
<Text size="xl" weight="semibold">
|
|
126
|
+
Title · 16px
|
|
127
|
+
</Text>
|
|
128
|
+
<Text size="lg" weight="medium">
|
|
129
|
+
Heading · 14px
|
|
130
|
+
</Text>
|
|
131
|
+
<Text>Body · 13px</Text>
|
|
132
|
+
<Text size="sm" tone="muted">
|
|
133
|
+
Muted · 12px
|
|
134
|
+
</Text>
|
|
135
|
+
<Text size="xs" tone="muted" weight="semibold">
|
|
136
|
+
OVERLINE
|
|
137
|
+
</Text>
|
|
138
|
+
<Text tone="danger">Danger</Text>
|
|
139
|
+
<Text tone="success">Success</Text>
|
|
140
|
+
<Text mono size="sm">
|
|
141
|
+
Geist Mono / content/en/blog/hello.mdx
|
|
142
|
+
</Text>
|
|
143
|
+
</Stack>
|
|
144
|
+
</Panel>
|
|
145
|
+
</section>
|
|
146
|
+
|
|
147
|
+
<section {...stylex.props(styles.section)}>
|
|
148
|
+
<SectionTitle>List + page chrome</SectionTitle>
|
|
149
|
+
<Panel>
|
|
150
|
+
<PageHeader
|
|
151
|
+
kicker={<BackLink to="/__ui">← Kit</BackLink>}
|
|
152
|
+
title="Documents"
|
|
153
|
+
description="Sample page header with action."
|
|
154
|
+
action={<Button>New</Button>}
|
|
155
|
+
/>
|
|
156
|
+
<List>
|
|
157
|
+
<ListRow
|
|
158
|
+
to="/__ui"
|
|
159
|
+
title="hello-world"
|
|
160
|
+
meta="en"
|
|
161
|
+
trailing="modified"
|
|
162
|
+
/>
|
|
163
|
+
<ListRow
|
|
164
|
+
to="/__ui"
|
|
165
|
+
title="about"
|
|
166
|
+
meta="da"
|
|
167
|
+
trailing="new"
|
|
168
|
+
/>
|
|
169
|
+
</List>
|
|
170
|
+
</Panel>
|
|
171
|
+
</section>
|
|
172
|
+
|
|
173
|
+
<section {...stylex.props(styles.section)}>
|
|
174
|
+
<SectionTitle>Top bar</SectionTitle>
|
|
175
|
+
<Panel>
|
|
176
|
+
<div {...stylex.props(styles.statusWrap)}>
|
|
177
|
+
<StatusBar>
|
|
178
|
+
<StatusItem>main</StatusItem>
|
|
179
|
+
<StatusItem>2 uncommitted</StatusItem>
|
|
180
|
+
</StatusBar>
|
|
181
|
+
<StatusBar>
|
|
182
|
+
<StatusItem>feat/sale</StatusItem>
|
|
183
|
+
<StatusItem>Unsaved</StatusItem>
|
|
184
|
+
</StatusBar>
|
|
185
|
+
<StatusBar>
|
|
186
|
+
<StatusItem tone="danger">Save failed</StatusItem>
|
|
187
|
+
</StatusBar>
|
|
188
|
+
</div>
|
|
189
|
+
</Panel>
|
|
190
|
+
</section>
|
|
191
|
+
|
|
192
|
+
<section {...stylex.props(styles.section)}>
|
|
193
|
+
<SectionTitle>Surfaces</SectionTitle>
|
|
194
|
+
<div {...stylex.props(styles.swatches)}>
|
|
195
|
+
<Swatch label="bgApp" fill={styles.bgApp} />
|
|
196
|
+
<Swatch label="bgSidebar" fill={styles.bgSidebar} />
|
|
197
|
+
<Swatch label="bgSurface" fill={styles.bgSurface} />
|
|
198
|
+
<Swatch label="accent" fill={styles.accent} />
|
|
199
|
+
<Swatch label="danger" fill={styles.dangerFill} />
|
|
200
|
+
<Swatch label="success" fill={styles.successFill} />
|
|
201
|
+
</div>
|
|
202
|
+
</section>
|
|
203
|
+
</Stack>
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function SectionTitle({ children }: { children: string }) {
|
|
209
|
+
return (
|
|
210
|
+
<Text as="h2" size="xs" tone="muted" weight="semibold">
|
|
211
|
+
{children}
|
|
212
|
+
</Text>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function Row({
|
|
217
|
+
label,
|
|
218
|
+
children,
|
|
219
|
+
}: {
|
|
220
|
+
label: string;
|
|
221
|
+
children: React.ReactNode;
|
|
222
|
+
}) {
|
|
223
|
+
return (
|
|
224
|
+
<div {...stylex.props(styles.row)}>
|
|
225
|
+
<span {...stylex.props(styles.rowLabel)}>{label}</span>
|
|
226
|
+
<div {...stylex.props(styles.rowItems)}>{children}</div>
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function Swatch({
|
|
232
|
+
label,
|
|
233
|
+
fill,
|
|
234
|
+
}: {
|
|
235
|
+
label: string;
|
|
236
|
+
fill: stylex.StyleXStyles;
|
|
237
|
+
}) {
|
|
238
|
+
return (
|
|
239
|
+
<div {...stylex.props(styles.swatch)}>
|
|
240
|
+
<div {...stylex.props(styles.chip, fill)} />
|
|
241
|
+
<Text size="xs" tone="muted" mono>
|
|
242
|
+
{label}
|
|
243
|
+
</Text>
|
|
244
|
+
</div>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const styles = stylex.create({
|
|
249
|
+
page: {
|
|
250
|
+
minHeight: "100dvh",
|
|
251
|
+
maxWidth: "880px",
|
|
252
|
+
marginInline: "auto",
|
|
253
|
+
paddingInline: space.xxl,
|
|
254
|
+
paddingBlock: space.xxl,
|
|
255
|
+
},
|
|
256
|
+
section: {
|
|
257
|
+
display: "flex",
|
|
258
|
+
flexDirection: "column",
|
|
259
|
+
gap: space.sm,
|
|
260
|
+
},
|
|
261
|
+
top: {
|
|
262
|
+
display: "flex",
|
|
263
|
+
flexWrap: "wrap",
|
|
264
|
+
alignItems: "flex-start",
|
|
265
|
+
justifyContent: "space-between",
|
|
266
|
+
gap: space.lg,
|
|
267
|
+
marginBottom: space.xxl,
|
|
268
|
+
},
|
|
269
|
+
back: {
|
|
270
|
+
marginTop: space.md,
|
|
271
|
+
},
|
|
272
|
+
themeRow: {
|
|
273
|
+
display: "flex",
|
|
274
|
+
flexWrap: "wrap",
|
|
275
|
+
gap: space.sm,
|
|
276
|
+
},
|
|
277
|
+
row: {
|
|
278
|
+
display: "flex",
|
|
279
|
+
flexWrap: "wrap",
|
|
280
|
+
alignItems: "center",
|
|
281
|
+
gap: space.lg,
|
|
282
|
+
},
|
|
283
|
+
rowLabel: {
|
|
284
|
+
width: "88px",
|
|
285
|
+
flexShrink: 0,
|
|
286
|
+
fontSize: type.xs,
|
|
287
|
+
fontWeight: 600,
|
|
288
|
+
letterSpacing: "0.04em",
|
|
289
|
+
textTransform: "uppercase",
|
|
290
|
+
color: colors.textMuted,
|
|
291
|
+
},
|
|
292
|
+
rowItems: {
|
|
293
|
+
display: "flex",
|
|
294
|
+
flexWrap: "wrap",
|
|
295
|
+
alignItems: "center",
|
|
296
|
+
gap: space.sm,
|
|
297
|
+
},
|
|
298
|
+
statusWrap: {
|
|
299
|
+
display: "flex",
|
|
300
|
+
flexDirection: "column",
|
|
301
|
+
gap: space.md,
|
|
302
|
+
overflow: "hidden",
|
|
303
|
+
borderRadius: radius.md,
|
|
304
|
+
borderWidth: 1,
|
|
305
|
+
borderStyle: "solid",
|
|
306
|
+
borderColor: colors.border,
|
|
307
|
+
},
|
|
308
|
+
swatches: {
|
|
309
|
+
display: "grid",
|
|
310
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))",
|
|
311
|
+
gap: space.md,
|
|
312
|
+
},
|
|
313
|
+
swatch: {
|
|
314
|
+
display: "flex",
|
|
315
|
+
flexDirection: "column",
|
|
316
|
+
gap: space.sm,
|
|
317
|
+
},
|
|
318
|
+
chip: {
|
|
319
|
+
height: "40px",
|
|
320
|
+
borderRadius: radius.md,
|
|
321
|
+
borderWidth: 1,
|
|
322
|
+
borderStyle: "solid",
|
|
323
|
+
borderColor: colors.border,
|
|
324
|
+
},
|
|
325
|
+
bgApp: { backgroundColor: colors.bgApp },
|
|
326
|
+
bgSidebar: { backgroundColor: colors.bgSidebar },
|
|
327
|
+
bgSurface: { backgroundColor: colors.bgSurface },
|
|
328
|
+
accent: { backgroundColor: colors.accent },
|
|
329
|
+
dangerFill: { backgroundColor: colors.danger },
|
|
330
|
+
successFill: { backgroundColor: colors.success },
|
|
331
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// packages/studio/src/pages/UserSettingsPage.tsx
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { fetchMe } from "../api";
|
|
4
|
+
import { authClient } from "../auth-client";
|
|
5
|
+
import { useAppChrome } from "../components/AppChromeContext";
|
|
6
|
+
import { McpConnectorsPanel } from "../mcp/McpConnectorsPanel";
|
|
7
|
+
import { Button } from "../ui/Button";
|
|
8
|
+
import { Field } from "../ui/Field";
|
|
9
|
+
import { Input } from "../ui/Input";
|
|
10
|
+
import { PageFrame, PageHeader, Panel, Stack } from "../ui/Page";
|
|
11
|
+
import { Text } from "../ui/Text";
|
|
12
|
+
|
|
13
|
+
export function UserSettingsPage() {
|
|
14
|
+
const { email, userId } = useAppChrome();
|
|
15
|
+
const [name, setName] = useState("");
|
|
16
|
+
const [status, setStatus] = useState<string | null>(null);
|
|
17
|
+
const [error, setError] = useState<string | null>(null);
|
|
18
|
+
const [busy, setBusy] = useState(false);
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
void fetchMe().then((me) => {
|
|
22
|
+
if (me?.user.name) setName(me.user.name);
|
|
23
|
+
});
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
26
|
+
async function onSaveName(e: React.FormEvent) {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
setBusy(true);
|
|
29
|
+
setError(null);
|
|
30
|
+
setStatus(null);
|
|
31
|
+
const result = await authClient().updateUser({ name });
|
|
32
|
+
setBusy(false);
|
|
33
|
+
if (result.error) {
|
|
34
|
+
setError(result.error.message ?? "Could not save name");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setStatus("Name saved. New publishes will use it.");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<PageFrame>
|
|
42
|
+
<PageHeader
|
|
43
|
+
title="User settings"
|
|
44
|
+
description="Your account on this Backmatter instance."
|
|
45
|
+
/>
|
|
46
|
+
<Stack gap="lg">
|
|
47
|
+
<Panel>
|
|
48
|
+
<form onSubmit={(e) => void onSaveName(e)}>
|
|
49
|
+
<Stack>
|
|
50
|
+
<Text as="h2" size="lg" weight="medium">
|
|
51
|
+
Account
|
|
52
|
+
</Text>
|
|
53
|
+
<Field label="Name">
|
|
54
|
+
<Input value={name} onChange={(e) => setName(e.target.value)} autoComplete="name" />
|
|
55
|
+
</Field>
|
|
56
|
+
<Field label="Email">
|
|
57
|
+
<Input
|
|
58
|
+
type="email"
|
|
59
|
+
value={email}
|
|
60
|
+
readOnly
|
|
61
|
+
autoComplete="off"
|
|
62
|
+
spellCheck={false}
|
|
63
|
+
/>
|
|
64
|
+
</Field>
|
|
65
|
+
<Field label="User ID" hint="Stable id for this account.">
|
|
66
|
+
<Input
|
|
67
|
+
value={userId}
|
|
68
|
+
readOnly
|
|
69
|
+
autoComplete="off"
|
|
70
|
+
spellCheck={false}
|
|
71
|
+
/>
|
|
72
|
+
</Field>
|
|
73
|
+
{error ? <Text tone="danger">{error}</Text> : null}
|
|
74
|
+
{status ? <Text tone="muted">{status}</Text> : null}
|
|
75
|
+
<div>
|
|
76
|
+
<Button type="submit" disabled={busy}>
|
|
77
|
+
{busy ? "Saving…" : "Save name"}
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
80
|
+
</Stack>
|
|
81
|
+
</form>
|
|
82
|
+
</Panel>
|
|
83
|
+
<div>
|
|
84
|
+
<PageHeader
|
|
85
|
+
title="Connectors"
|
|
86
|
+
description="Personal MCP servers that follow you across workspaces."
|
|
87
|
+
compact
|
|
88
|
+
/>
|
|
89
|
+
<McpConnectorsPanel scope="user" canEdit />
|
|
90
|
+
</div>
|
|
91
|
+
</Stack>
|
|
92
|
+
</PageFrame>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// packages/studio/src/pages/WorkspaceHomeRedirect.tsx
|
|
2
|
+
import { Navigate, useOutletContext } from "react-router";
|
|
3
|
+
import type { WorkspaceOutletContext } from "../workspace/types";
|
|
4
|
+
import { contentTypePath, settingsPath } from "../workspace-path";
|
|
5
|
+
|
|
6
|
+
export function WorkspaceHomeRedirect() {
|
|
7
|
+
const { workspace, models } = useOutletContext<WorkspaceOutletContext>();
|
|
8
|
+
const first = models[0]?.type;
|
|
9
|
+
if (first) {
|
|
10
|
+
return (
|
|
11
|
+
<Navigate to={contentTypePath(workspace.slug, first)} replace />
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return (
|
|
15
|
+
<Navigate to={settingsPath(workspace.slug, "schema")} replace />
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// packages/studio/src/pages/WorkspaceLayout.tsx
|
|
2
|
+
import { useCallback, useEffect, useMemo, type Dispatch, type SetStateAction } from "react";
|
|
3
|
+
import { Outlet, useLocation, useParams } from "react-router";
|
|
4
|
+
import type { SchemaPayload, WorkspaceDetail } from "../api";
|
|
5
|
+
import { useAppChrome } from "../components/AppChromeContext";
|
|
6
|
+
import { useSetWorkspaceNav } from "../chrome/WorkspaceNavContext";
|
|
7
|
+
import { rememberLastWorkspace } from "../last-workspace";
|
|
8
|
+
import { replicaStore } from "../replica/instance";
|
|
9
|
+
import { useReplicaSession } from "../replica/ReplicaProvider";
|
|
10
|
+
import { useReplicaState } from "../replica/useReplica";
|
|
11
|
+
import { PageFrame } from "../ui/Page";
|
|
12
|
+
import { Text } from "../ui/Text";
|
|
13
|
+
import type { WorkspaceOutletContext } from "../workspace/types";
|
|
14
|
+
import {
|
|
15
|
+
defaultLocaleOf,
|
|
16
|
+
isWorkspaceEditorPath,
|
|
17
|
+
isWorkspaceSettingsPath,
|
|
18
|
+
isWorkspaceTypeIndexPath,
|
|
19
|
+
} from "../workspace-path";
|
|
20
|
+
|
|
21
|
+
const EMPTY_MODELS: SchemaPayload["models"] = [];
|
|
22
|
+
const EMPTY_BLOCKS: NonNullable<SchemaPayload["blocks"]> = [];
|
|
23
|
+
const EMPTY_RICHTEXT: NonNullable<SchemaPayload["richtext"]> = [];
|
|
24
|
+
|
|
25
|
+
export function WorkspaceLayout() {
|
|
26
|
+
const { workspaceSlug = "" } = useParams();
|
|
27
|
+
const location = useLocation();
|
|
28
|
+
const isEditor = isWorkspaceEditorPath(location.pathname);
|
|
29
|
+
const isTypeIndex = isWorkspaceTypeIndexPath(location.pathname);
|
|
30
|
+
const isSettings = isWorkspaceSettingsPath(location.pathname);
|
|
31
|
+
const { userId } = useAppChrome();
|
|
32
|
+
const setNav = useSetWorkspaceNav();
|
|
33
|
+
const replica = useReplicaState();
|
|
34
|
+
const { revalidate } = useReplicaSession();
|
|
35
|
+
const workspace = replica.workspaceBySlug(workspaceSlug);
|
|
36
|
+
const slot = workspace ? replica.checkout(workspace.id) : null;
|
|
37
|
+
const models = slot?.schema?.payload.models ?? EMPTY_MODELS;
|
|
38
|
+
const blocks = slot?.schema?.payload.blocks ?? EMPTY_BLOCKS;
|
|
39
|
+
const richtext = slot?.schema?.payload.richtext ?? EMPTY_RICHTEXT;
|
|
40
|
+
|
|
41
|
+
const reload = useCallback(async () => {
|
|
42
|
+
if (!workspace) return;
|
|
43
|
+
await revalidate(workspace.id);
|
|
44
|
+
}, [workspace, revalidate]);
|
|
45
|
+
|
|
46
|
+
const setWorkspace = useCallback<Dispatch<SetStateAction<WorkspaceDetail | null>>>(
|
|
47
|
+
(update) => {
|
|
48
|
+
if (!workspace) return;
|
|
49
|
+
const next = typeof update === "function" ? update(workspace) : update;
|
|
50
|
+
if (next) replicaStore.updateWorkspace(next);
|
|
51
|
+
},
|
|
52
|
+
[workspace],
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!workspace) {
|
|
57
|
+
setNav(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
rememberLastWorkspace(userId, workspace.id);
|
|
61
|
+
setNav({
|
|
62
|
+
workspaceId: workspace.id,
|
|
63
|
+
workspaceSlug: workspace.slug,
|
|
64
|
+
workspaceName: workspace.name,
|
|
65
|
+
role: workspace.role,
|
|
66
|
+
defaultLocale: defaultLocaleOf(workspace.locales),
|
|
67
|
+
contentTypes: models.map((m) => m.type),
|
|
68
|
+
contentModels: models.map((m) => ({
|
|
69
|
+
type: m.type,
|
|
70
|
+
path: m.path,
|
|
71
|
+
route: m.route,
|
|
72
|
+
singleton: m.singleton,
|
|
73
|
+
})),
|
|
74
|
+
siteUrls: workspace.siteUrls ?? [],
|
|
75
|
+
});
|
|
76
|
+
}, [userId, workspace, models, setNav]);
|
|
77
|
+
|
|
78
|
+
const outletContext = useMemo<WorkspaceOutletContext | null>(() => {
|
|
79
|
+
if (!workspace) return null;
|
|
80
|
+
return {
|
|
81
|
+
workspace,
|
|
82
|
+
models,
|
|
83
|
+
blocks,
|
|
84
|
+
richtext,
|
|
85
|
+
setWorkspace,
|
|
86
|
+
reload,
|
|
87
|
+
};
|
|
88
|
+
}, [workspace, models, blocks, richtext, setWorkspace, reload]);
|
|
89
|
+
|
|
90
|
+
if (!workspace || !outletContext) {
|
|
91
|
+
return (
|
|
92
|
+
<PageFrame>
|
|
93
|
+
<Text tone="danger">Workspace not found.</Text>
|
|
94
|
+
</PageFrame>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<PageFrame flush={isEditor || isTypeIndex || isSettings}>
|
|
100
|
+
<Outlet context={outletContext} />
|
|
101
|
+
</PageFrame>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// packages/studio/src/pages/WorkspacesPage.tsx
|
|
2
|
+
import { ButtonLink } from "../ui/Button";
|
|
3
|
+
import { List, ListRow } from "../ui/ListRow";
|
|
4
|
+
import { PageFrame, PageHeader } from "../ui/Page";
|
|
5
|
+
import { Text } from "../ui/Text";
|
|
6
|
+
import { useReplicaState } from "../replica/useReplica";
|
|
7
|
+
import { workspaceHomePath } from "../workspace-path";
|
|
8
|
+
|
|
9
|
+
export function WorkspacesPage() {
|
|
10
|
+
const workspaces = useReplicaState().control?.workspaces ?? [];
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<PageFrame centered>
|
|
14
|
+
<PageHeader
|
|
15
|
+
title="Workspaces"
|
|
16
|
+
description="Each workspace is a site and a team."
|
|
17
|
+
action={<ButtonLink to="/workspaces/new">New workspace</ButtonLink>}
|
|
18
|
+
/>
|
|
19
|
+
{workspaces.length === 0 ? (
|
|
20
|
+
<Text tone="muted">No workspaces yet.</Text>
|
|
21
|
+
) : (
|
|
22
|
+
<List>
|
|
23
|
+
{workspaces.map((workspace) => (
|
|
24
|
+
<ListRow
|
|
25
|
+
key={workspace.id}
|
|
26
|
+
to={workspaceHomePath(workspace.slug)}
|
|
27
|
+
title={workspace.name}
|
|
28
|
+
meta={workspace.role}
|
|
29
|
+
/>
|
|
30
|
+
))}
|
|
31
|
+
</List>
|
|
32
|
+
)}
|
|
33
|
+
</PageFrame>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// packages/studio/src/pages/blocks-list.ts
|
|
2
|
+
|
|
3
|
+
export type BlockInstance = {
|
|
4
|
+
id: string;
|
|
5
|
+
type: string;
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function isBlockInstance(value: unknown): value is BlockInstance {
|
|
10
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
11
|
+
const row = value as Record<string, unknown>;
|
|
12
|
+
return (
|
|
13
|
+
typeof row.id === "string" &&
|
|
14
|
+
typeof row.type === "string" &&
|
|
15
|
+
!!row.props &&
|
|
16
|
+
typeof row.props === "object" &&
|
|
17
|
+
!Array.isArray(row.props)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function blocksFromFrontmatter(value: unknown): BlockInstance[] {
|
|
22
|
+
if (!Array.isArray(value)) return [];
|
|
23
|
+
return value.filter(isBlockInstance);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function addBlock(
|
|
27
|
+
blocks: BlockInstance[],
|
|
28
|
+
type: string,
|
|
29
|
+
id: string,
|
|
30
|
+
): BlockInstance[] {
|
|
31
|
+
return [...blocks, { id, type, props: {} }];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function removeBlock(blocks: BlockInstance[], id: string): BlockInstance[] {
|
|
35
|
+
return blocks.filter((b) => b.id !== id);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function moveBlock(
|
|
39
|
+
blocks: BlockInstance[],
|
|
40
|
+
id: string,
|
|
41
|
+
direction: -1 | 1,
|
|
42
|
+
): BlockInstance[] {
|
|
43
|
+
const at = blocks.findIndex((b) => b.id === id);
|
|
44
|
+
const next = at + direction;
|
|
45
|
+
if (at < 0 || next < 0 || next >= blocks.length) return blocks;
|
|
46
|
+
const copy = [...blocks];
|
|
47
|
+
const [row] = copy.splice(at, 1);
|
|
48
|
+
copy.splice(next, 0, row!);
|
|
49
|
+
return copy;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function reorderBlock(
|
|
53
|
+
blocks: BlockInstance[],
|
|
54
|
+
id: string,
|
|
55
|
+
toIndex: number,
|
|
56
|
+
): BlockInstance[] {
|
|
57
|
+
const from = blocks.findIndex((b) => b.id === id);
|
|
58
|
+
if (from < 0 || blocks.length === 0) return blocks;
|
|
59
|
+
const next = Math.max(0, Math.min(toIndex, blocks.length - 1));
|
|
60
|
+
if (from === next) return blocks;
|
|
61
|
+
const copy = [...blocks];
|
|
62
|
+
const [row] = copy.splice(from, 1);
|
|
63
|
+
copy.splice(next, 0, row!);
|
|
64
|
+
return copy;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function updateBlockProps(
|
|
68
|
+
blocks: BlockInstance[],
|
|
69
|
+
id: string,
|
|
70
|
+
props: Record<string, unknown>,
|
|
71
|
+
): BlockInstance[] {
|
|
72
|
+
return blocks.map((b) => (b.id === id ? { ...b, props } : b));
|
|
73
|
+
}
|