@kabmo-labs/kabmo 0.60.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -49
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +1157 -825
- package/dist/client/static/js/{Body-p82s28sj.js → Body-z6kstvk6.js} +3 -3
- package/dist/client/static/js/{CsvGrid-erc5mcvc.js → CsvGrid-f73c0s4e.js} +2 -2
- package/dist/client/static/js/{DocxView-x3faj0jv.js → DocxView-a1pb7nsb.js} +3 -3
- package/dist/client/static/js/{DrawioView-t7fh3ens.js → DrawioView-r61gcg24.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-zy7x7jmm.js → HtmlPreview-vt7j0b05.js} +1 -1
- package/dist/client/static/js/ImageView-4nhr5dtm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-vwhy0vhj.js +2 -0
- package/dist/client/static/js/MergeDiffView-f4h9ss71.js +1 -0
- package/dist/client/static/js/Modal-cadmjkak.js +60 -0
- package/dist/client/static/js/{PdfView-kqx472q7.js → PdfView-mppt2gkd.js} +1 -1
- package/dist/client/static/js/SessionsView-vvsaw9f0.js +1 -0
- package/dist/client/static/js/{SheetView-0n9fze50.js → SheetView-5s9zfx9g.js} +9 -9
- package/dist/client/static/js/{SvgPreview-6xc6ts46.js → SvgPreview-ff78xn3e.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-2xdkkqwg.js → abnfDiagram-O67JEVCF-p29sh3w2.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-83w3kytq.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ja8cx19z.js → architectureDiagram-NJMV4G6O-nbpdyea3.js} +3 -3
- package/dist/client/static/js/{astro-yphdvdty.js → astro-qtfmc8x7.js} +1 -1
- package/dist/client/static/js/bash-wcy12qjx.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-ytf7s99c.js → blockDiagram-BEXU5L5S-t8xbexa6.js} +6 -6
- package/dist/client/static/js/c-vvantfth.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-5a0kdx0z.js → c4Diagram-YGBWAQC7-9fwf2zxk.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-hd98dvjw.js → classDiagram-v2-NBCMYWYE-nbapgqbs.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-man3fqcj.js → cose-bilkent-JH36ORCC-k54mmydp.js} +1 -1
- package/dist/client/static/js/cpp-5x63r6g0.js +1 -0
- package/dist/client/static/js/css-j2j6f03w.js +1 -0
- package/dist/client/static/js/css-qk59j6rj.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-80z02zrj.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-2f0kbbv2.js → cynefinDiagram-VND7K2PF-qdg32wah.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-k7pyhgzn.js → dagre-6A5THRUB-qzshg1vs.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-qx0afa2m.js → diagram-22UHCM2B-197hemfa.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-ydpe77sv.js → diagram-3UASUU5V-236gnjr6.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-e63v984n.js → diagram-ATOU4E4O-vjgpyaaq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-8c765h3a.js → diagram-CDSNMT55-ywvzcx7z.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-3pq0n7v8.js → diagram-MLGK6HIB-9ey7ev7j.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-638atzxz.js → diagram-MPIPVDR6-vrqbb6r7.js} +2 -2
- package/dist/client/static/js/{dockerfile-yehc914q.js → dockerfile-4nked309.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3gv43zvm.js → ebnfDiagram-ZINNZB2B-hvnkevqy.js} +1 -1
- package/dist/client/static/js/{elixir-3nwnd9yw.js → elixir-3jvh6v4k.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-6s5pggfc.js → elk-276RUBZZ-nej6yy1c.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-x7cqyb89.js → erDiagram-OPXOYQCR-ww453xcy.js} +5 -5
- package/dist/client/static/js/{erlang-p5c4n3t0.js → erlang-4fz73a1q.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-y9pq2709.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-e6v7513q.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-g97te4v1.js → ganttDiagram-FUAMR5RP-abc5wy70.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-fzaf9azs.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-sw4f94tc.js → gitGraphDiagram-X574FWY7-4acqzj2h.js} +7 -7
- package/dist/client/static/js/graphql-hpkvdvk7.js +1 -0
- package/dist/client/static/js/html-x12gb1wk.js +1 -0
- package/dist/client/static/js/{index-v88m5sva.js → index-0g82ph6h.js} +2 -2
- package/dist/client/static/js/{index-vejz38qt.js → index-0w1jzang.js} +5 -5
- package/dist/client/static/js/{index-bpcg34jp.js → index-1svt0cdw.js} +2 -2
- package/dist/client/static/js/{index-hgfyx8dt.js → index-1tb4py5v.js} +2 -2
- package/dist/client/static/js/index-2gt9krtj.js +4 -0
- package/dist/client/static/js/index-2x9m7s1a.js +1 -0
- package/dist/client/static/js/index-3fvqmz3m.js +4 -0
- package/dist/client/static/js/{index-pdz6j2g2.js → index-42wvbkm5.js} +2 -2
- package/dist/client/static/js/index-477vtt51.js +2 -0
- package/dist/client/static/js/{index-ca6tmamh.js → index-4px56qaz.js} +2 -2
- package/dist/client/static/js/{index-excgtjhx.js → index-5anvw7xg.js} +36 -36
- package/dist/client/static/js/index-5nb9k2ph.js +1 -0
- package/dist/client/static/js/{index-97sw4d9n.js → index-615je3km.js} +2 -2
- package/dist/client/static/js/{index-111bq6rs.js → index-66qxrh5n.js} +1 -1
- package/dist/client/static/js/{index-a145x0w2.js → index-7kct1sz1.js} +2 -2
- package/dist/client/static/js/{index-hwv7bfxc.js → index-8e0d8y30.js} +2 -2
- package/dist/client/static/js/{index-s4j2ghmx.js → index-90bq56xw.js} +2 -2
- package/dist/client/static/js/{index-wsy6y5em.js → index-b1gzh60t.js} +11 -11
- package/dist/client/static/js/{index-10vzyga1.js → index-bypkmjrz.js} +2 -2
- package/dist/client/static/js/{index-n8r7r86r.js → index-c1vd63yd.js} +2 -2
- package/dist/client/static/js/index-c9f0hejv.js +3 -0
- package/dist/client/static/js/{index-2dmew334.js → index-cgqj15g0.js} +2 -2
- package/dist/client/static/js/{index-mtav0rpf.js → index-cts5re1t.js} +2 -2
- package/dist/client/static/js/index-dxc14kmm.js +1 -0
- package/dist/client/static/js/{index-hwdkxe4n.js → index-dxyjxhm1.js} +2 -2
- package/dist/client/static/js/{index-43gmn7yb.js → index-edpyqz9f.js} +1 -1
- package/dist/client/static/js/{index-pdgc9ccr.js → index-eesepb70.js} +2 -2
- package/dist/client/static/js/{index-vec7m1yd.js → index-evh437bz.js} +2 -2
- package/dist/client/static/js/index-ey6v4t5b.js +1 -0
- package/dist/client/static/js/{index-025s3fp8.js → index-fsd7n336.js} +2 -2
- package/dist/client/static/js/{index-yfcy4cf6.js → index-h7a7fqag.js} +2 -2
- package/dist/client/static/js/{index-11qn05g9.js → index-hffgwnvz.js} +2 -2
- package/dist/client/static/js/index-j734ev6q.js +482 -0
- package/dist/client/static/js/{index-vcq6zfxx.js → index-jcbp1d9d.js} +6 -6
- package/dist/client/static/js/index-jg5h18sm.js +2 -0
- package/dist/client/static/js/{index-6qn9kygb.js → index-jtdve6xw.js} +7 -7
- package/dist/client/static/js/{index-4xbc0j7t.js → index-k0bqrb1y.js} +1 -1
- package/dist/client/static/js/{index-bdtftrym.js → index-kegevd10.js} +2 -2
- package/dist/client/static/js/{index-fr6wsqk8.js → index-kqcfxkch.js} +2 -2
- package/dist/client/static/js/{index-2n2evsg0.js → index-kv1xnem9.js} +2 -2
- package/dist/client/static/js/{index-8zct30zd.js → index-m54ctmxr.js} +1 -1
- package/dist/client/static/js/index-mgzbypt5.js +314 -0
- package/dist/client/static/js/{index-cf69bhjx.js → index-mh52531j.js} +2 -2
- package/dist/client/static/js/{index-0ze5bwvw.js → index-mhz5ywa4.js} +5 -5
- package/dist/client/static/js/{index-3j2he86h.js → index-nnwdbg3t.js} +2 -2
- package/dist/client/static/js/{index-9rz6kzsv.js → index-nxd6z7f9.js} +2 -2
- package/dist/client/static/js/{index-jfqd838j.js → index-pjrbt77c.js} +2 -2
- package/dist/client/static/js/index-r7h4pm42.js +2 -0
- package/dist/client/static/js/index-ratrdgc9.js +2 -0
- package/dist/client/static/js/{index-cfvc1zpk.js → index-rhmvh9w5.js} +2 -2
- package/dist/client/static/js/{index-twwsn91p.js → index-sqzjwy9h.js} +2 -2
- package/dist/client/static/js/{index-37apvxgj.js → index-tckzkw0f.js} +2 -2
- package/dist/client/static/js/index-tza9h3q6.css +1 -0
- package/dist/client/static/js/{index-qccydkze.js → index-vhjfr093.js} +2 -2
- package/dist/client/static/js/{index-z8k42dwz.js → index-w0j96eyy.js} +8 -8
- package/dist/client/static/js/{index-qkqkygrf.js → index-ws04kxy9.js} +1 -1
- package/dist/client/static/js/{index-a3bpmw2r.js → index-x1yqmzpr.js} +2 -2
- package/dist/client/static/js/{index-fb2fjndj.js → index-x2f7wykb.js} +6 -6
- package/dist/client/static/js/index-y8405hdg.js +10 -0
- package/dist/client/static/js/{index-sx83ans2.js → index-yxk7dgnb.js} +2 -2
- package/dist/client/static/js/{index-bkn6jtn1.js → index-zavecxak.js} +2 -2
- package/dist/client/static/js/{index-dv01prse.js → index-zg7q3kcb.js} +2 -2
- package/dist/client/static/js/{index-enm77k5z.js → index-zhn9vv3z.js} +2 -2
- package/dist/client/static/js/{index-ywp0sd1e.js → index-zy963qbh.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-t7pbg7rt.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-pw2qaa27.js → infoDiagram-VRGFBTTK-9pe7w3r5.js} +2 -2
- package/dist/client/static/js/ini-522adp5a.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-d13jhvxy.js → ishikawaDiagram-OU5B5YK6-38arfrx5.js} +2 -2
- package/dist/client/static/js/java-z0rgs7v6.js +1 -0
- package/dist/client/static/js/javascript-fv87f565.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-20gb8a04.js → journeyDiagram-ZHPQQLJL-kcwzjgtz.js} +4 -4
- package/dist/client/static/js/json-1czq1ped.js +1 -0
- package/dist/client/static/js/jsx-1fch2jyr.js +1 -0
- package/dist/client/static/js/{julia-rpd1y9vh.js → julia-pzzxbptm.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-s78e158c.js → kanban-definition-PNTS6WVX-nmegwy9w.js} +15 -15
- package/dist/client/static/js/lua-nn8bpjev.js +1 -0
- package/dist/client/static/js/markdown-38tqrgkn.js +1 -0
- package/dist/client/static/js/{mermaid.core-xbm27k28.js → mermaid.core-3aae27b9.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-6y7xe2zm.js → mindmap-definition-NLK3R4M7-zsaq4e65.js} +12 -12
- package/dist/client/static/js/one-dark-pro-trnff03z.js +1 -0
- package/dist/client/static/js/one-light-ck31ptqs.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-rwac7scq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-dmvewetf.js → pegDiagram-GJSIUBJH-2b6whj1p.js} +1 -1
- package/dist/client/static/js/{perl-kmtz9dnv.js → perl-zdkbbjd2.js} +1 -1
- package/dist/client/static/js/{php-bttrsbxy.js → php-ktaxff6g.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-gjz20apz.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-1q9e7rcm.js → pieDiagram-5QR66LMP-y09ar7vz.js} +3 -3
- package/dist/client/static/js/properties-kncqeqhn.js +1 -0
- package/dist/client/static/js/python-gx8ggmyh.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-mvrem3n6.js → quadrantDiagram-O4NWA36T-mapfzs06.js} +3 -3
- package/dist/client/static/js/r-x8rftkm3.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-akwdknab.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-m5v4rfhx.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-k2gmqcjb.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zdsfjf4.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-e98evqb6.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-axttcfhw.js → railroadDiagram-XR7U4H2S-70qy7qdh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-5qx7erta.js → requirementDiagram-PLB6GJNP-2vb2gp3e.js} +3 -3
- package/dist/client/static/js/{ruby-dve3y59w.js → ruby-ytqv3pqz.js} +1 -1
- package/dist/client/static/js/{rust-b3ckax3e.js → rust-6sddyxnt.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-es87a3j6.js → sankeyDiagram-IPEJSGJF-9jd8ebrn.js} +3 -3
- package/dist/client/static/js/{sass-emxqt5p2.js → sass-dvbra5b6.js} +1 -1
- package/dist/client/static/js/{scss-4j4t3r6y.js → scss-sy7w8916.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-dgpnjrtk.js → sequenceDiagram-PO4LG4MO-w7z84f80.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-kyw0p86n.js → sizeCapture-INFHLROL-q8w7ehgx.js} +1 -1
- package/dist/client/static/js/sql-99y0qnag.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vnsbw8y9.js → stateDiagram-v2-GCMORJYK-4978hapr.js} +3 -3
- package/dist/client/static/js/{svelte-dbsx1ehx.js → svelte-xvs3fkza.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-060q1rep.js → swimlanes-2SLR337P-eshg5fjy.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-914e28hd.js +8 -0
- package/dist/client/static/js/timeline-definition-EJHVYXUP-5h5q357k.js +120 -0
- package/dist/client/static/js/treeView-Q6P3EWNA-fkm3a7gx.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-hm4ktxjf.js +1 -0
- package/dist/client/static/js/tsx-phngprp0.js +1 -0
- package/dist/client/static/js/typescript-m62a7zr2.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-18sp73v7.js → usecaseDiagram-POWQR4AR-4j69y3zx.js} +20 -20
- package/dist/client/static/js/vennDiagram-UO4OBE2U-pa9p5jpw.js +34 -0
- package/dist/client/static/js/{vue-hyr58df9.js → vue-p4g4avm3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-3y2rvdmy.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-q0kwmbzh.js → wardleyDiagram-VNRHLVJA-hjddd656.js} +3 -3
- package/dist/client/static/js/xml-59n0cjn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-y0gpmg6m.js → xychartDiagram-PMCCYNJV-8ng5m849.js} +4 -4
- package/dist/client/static/js/yaml-9fw908s4.js +1 -0
- package/dist/client/tailwindcss-oxide.linux-x64-gnu-c0fa36dv.node +0 -0
- package/dist/client/tailwindcss-oxide.linux-x64-musl-kr04sh0e.node +0 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/app.tsx +2 -5
- package/marketplace/plugins/command-runner/src/panel/CustomForm.tsx +35 -52
- package/marketplace/plugins/command-runner/src/panel/Groups.tsx +6 -5
- package/marketplace/plugins/command-runner/src/panel/Header.tsx +18 -54
- package/marketplace/plugins/command-runner/src/panel/Output.tsx +3 -7
- package/marketplace/plugins/command-runner/src/panel/Row.tsx +19 -38
- package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -4
- package/marketplace/plugins/git-forge/package.json +2 -2
- package/marketplace/plugins/git-forge/src/app.tsx +2 -0
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +8 -15
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +35 -66
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +7 -13
- package/marketplace/plugins/git-forge/src/panel/List.tsx +28 -56
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +7 -9
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +21 -31
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +26 -40
- package/marketplace/plugins/git-forge/src/panel/index.tsx +0 -1
- package/marketplace/plugins/github-actions/package.json +2 -2
- package/marketplace/plugins/github-actions/src/app.tsx +2 -0
- package/marketplace/plugins/github-actions/src/panel/Actions.tsx +9 -17
- package/marketplace/plugins/github-actions/src/panel/LogView.tsx +4 -13
- package/marketplace/plugins/github-actions/src/panel/Row.tsx +4 -5
- package/marketplace/plugins/github-actions/src/panel/RunView.tsx +8 -15
- package/marketplace/plugins/github-actions/src/panel/index.test.tsx +3 -2
- package/marketplace/plugins/github-actions/src/panel/index.tsx +31 -37
- package/marketplace/plugins/kanban/package.json +2 -2
- package/marketplace/plugins/kanban/src/app.tsx +2 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +88 -98
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +6 -10
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +22 -18
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +59 -70
- package/marketplace/plugins/kanban/src/panel/index.tsx +37 -52
- package/marketplace/plugins/kanban/src/panel/use-board.ts +2 -0
- package/marketplace/plugins/session-info/package.json +2 -2
- package/marketplace/plugins/session-info/src/app.tsx +6 -3
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/KillConfirm.test.tsx +6 -4
- package/marketplace/plugins/stats/src/KillConfirm.tsx +26 -76
- package/marketplace/plugins/stats/src/ProcessTable.tsx +8 -6
- package/marketplace/plugins/stats/src/RefreshButton.tsx +7 -5
- package/marketplace/plugins/stats/src/app.tsx +11 -9
- package/package.json +10 -10
- package/src/cli/lib/commands/plugin.js +8 -5
- package/src/client/bootstrap.d.ts +5 -0
- package/src/client/chat-title-overlay.test.ts +53 -0
- package/src/client/components/auth/login-screen/index.tsx +31 -3
- package/src/client/components/common/SignOutButton.tsx +4 -5
- package/src/client/components/common/account-badge/index.tsx +31 -0
- package/src/client/components/common/footer-version/index.tsx +40 -0
- package/src/client/components/common/fullscreen-viewer/fullscreen-viewer.test.tsx +24 -0
- package/src/client/components/common/fullscreen-viewer/index.tsx +22 -31
- package/src/client/components/common/header-controls/MoreMenu.tsx +5 -56
- package/src/client/components/common/header-controls/index.test.tsx +2 -6
- package/src/client/components/common/header-controls/index.tsx +9 -25
- package/src/client/components/common/header-controls/phone-row.test.tsx +3 -16
- package/src/client/components/common/shell-update-button/index.tsx +2 -2
- package/src/client/components/common/zoom-pan-stage/index.tsx +54 -50
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +4 -5
- package/src/client/components/layout/desktop-layout/index.tsx +2 -4
- package/src/client/components/layout/left-bar/index.tsx +25 -3
- package/src/client/components/layout/rail-toggle.test.tsx +112 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.accent.test.tsx +81 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +11 -3
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +36 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +42 -61
- package/src/client/components/layout/session-sidebar/FooterHost.tsx +5 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +30 -10
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +4 -0
- package/src/client/components/layout/session-sidebar/modern/index.tsx +8 -1
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +25 -4
- package/src/client/components/layout/session-title-bar/index.tsx +13 -5
- package/src/client/components/layout/top-bars.test.tsx +4 -2
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/RightSidebar.tsx +12 -3
- package/src/client/components/mobile/SessionSidebar.tsx +6 -2
- package/src/client/components/mobile/drawer-layout.test.tsx +7 -3
- package/src/client/components/mobile/drawer-strip.tsx +9 -2
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +29 -9
- package/src/client/components/mobile/mobile-main-view/Header.tsx +43 -12
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +12 -1
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +1 -0
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +9 -1
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +4 -2
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Footer.tsx +48 -46
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +18 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +4 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +4 -6
- package/src/client/components/mobile/right-drawer-nav.test.tsx +53 -1
- package/src/client/components/settings/Band.tsx +5 -2
- package/src/client/components/settings/Modal.tsx +8 -5
- package/src/client/components/settings/Sidebar.tsx +5 -3
- package/src/client/components/settings/apply-side-effects.ts +5 -0
- package/src/client/components/settings/categories/AccountSettings.tsx +266 -0
- package/src/client/components/settings/categories/ProjectSettings.tsx +2 -0
- package/src/client/components/settings/categories/account-settings/Dialogs.tsx +223 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +3 -4
- package/src/client/components/settings/categories/appearance-settings/ChromeStyleSection.tsx +66 -39
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +7 -4
- package/src/client/components/settings/categories/project-settings/DetailsForm.tsx +14 -1
- package/src/client/components/settings/categories/project-settings/ProjectSharing.tsx +130 -0
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +5 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/SessionSkeleton.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.test.ts +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.ts +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +34 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +4 -1
- package/src/client/components/workspace/editor/Tab.tsx +19 -26
- package/src/client/components/workspace/editor/Tabs.test.ts +13 -7
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -0
- package/src/client/components/workspace/git-panel/commit-modal/floating.test.ts +46 -0
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -0
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +4 -5
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +40 -37
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +76 -49
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +9 -9
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +14 -1
- package/src/client/components/workspace/panel-tabs/index.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +22 -5
- package/src/client/components/workspace/plugin-panel/chrome.test.tsx +89 -0
- package/src/client/components/workspace/plugin-panel/chrome.tsx +62 -0
- package/src/client/data/settings/omp-schema.json +40 -4
- package/src/client/floating-phone.test.ts +189 -0
- package/src/client/floating.css +205 -2
- package/src/client/floating.test.ts +43 -0
- package/src/client/glass.css +47 -0
- package/src/client/hooks/chat/omp/index.ts +6 -5
- package/src/client/hooks/chat/omp/prompt-send.test.ts +18 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +26 -8
- package/src/client/hooks/chat/omp/session-list.tsx +20 -8
- package/src/client/hooks/chat/timeline/deferred-model.ts +13 -5
- package/src/client/hooks/chat/timeline/index.ts +2 -0
- package/src/client/hooks/chat/timeline/send-props.ts +14 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send-switch.test.ts +92 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +37 -7
- package/src/client/hooks/chat/timeline/send.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send.ts +62 -42
- package/src/client/hooks/editor/image-generation.ts +24 -0
- package/src/client/hooks/editor/resolve-viewer.test.ts +26 -20
- package/src/client/hooks/editor/resolve-viewer.ts +14 -5
- package/src/client/hooks/editor/use-file-editor.test.ts +34 -0
- package/src/client/hooks/editor/use-file-editor.ts +6 -2
- package/src/client/hooks/settings/accounts.ts +162 -0
- package/src/client/hooks/ui/auth.ts +58 -3
- package/src/client/hooks/ui/border-style.test.ts +5 -4
- package/src/client/hooks/ui/border-style.ts +3 -2
- package/src/client/hooks/ui/mobile-chrome-style.ts +68 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +1 -2
- package/src/client/hooks/ui/navbar-controls.ts +0 -3
- package/src/client/hooks/ui/zoom-gesture.ts +104 -0
- package/src/client/lib/desktop/titlebar.test.ts +21 -0
- package/src/client/lib/desktop/titlebar.ts +34 -0
- package/src/client/lib/plugins/bootstrap.test.ts +20 -0
- package/src/client/lib/plugins/bootstrap.tsx +10 -15
- package/src/client/lib/plugins/kit-components.test.tsx +119 -0
- package/src/client/lib/plugins/kit-components.tsx +79 -0
- package/src/client/lib/plugins/kit.ts +8 -0
- package/src/client/lib/plugins/slots.test.ts +34 -0
- package/src/client/lib/plugins/slots.ts +31 -4
- package/src/client/lib/plugins/stylesheets.ts +10 -11
- package/src/client/lib/ui/pinch.test.ts +74 -0
- package/src/client/lib/ui/pinch.ts +104 -0
- package/src/client/lib/ui/safe-area.test.ts +25 -0
- package/src/client/lib/ui/safe-area.ts +23 -0
- package/src/client/main.tsx +8 -1
- package/src/client/tailwind.css +54 -1
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/shell-attributes.server.ts +12 -4
- package/src/server/lib/assets/shell-attributes.test.ts +19 -18
- package/src/server/lib/auth/client-address.test.ts +2 -2
- package/src/server/lib/auth/guard.test.ts +2 -2
- package/src/server/lib/auth/guard.ts +81 -97
- package/src/server/lib/auth/handover-guard.test.ts +1 -1
- package/src/server/lib/auth/rate-limit.test.ts +2 -2
- package/src/server/lib/auth/token.test.ts +1 -1
- package/src/server/lib/auth/workspace-gate.server.ts +34 -0
- package/src/server/lib/bundler/css.test.ts +16 -0
- package/src/server/lib/connect/devices.server.test.ts +12 -0
- package/src/server/lib/connect/devices.server.ts +63 -19
- package/src/server/lib/connect/pairing.server.ts +5 -3
- package/src/server/lib/connect/status.server.ts +2 -2
- package/src/server/lib/db/schema.test.ts +3 -3
- package/src/server/lib/db/schema.ts +6 -0
- package/src/server/lib/harness/update-spawn.server.test.ts +97 -0
- package/src/server/lib/harness/update-spawn.server.ts +10 -0
- package/src/server/lib/models/provider-icon-override.server.test.ts +140 -0
- package/src/server/lib/models/provider-icon-override.server.ts +197 -0
- package/src/server/lib/models/provider-icon-store.server.ts +8 -0
- package/src/server/lib/models/provider-icon.server.ts +31 -6
- package/src/server/lib/omp/session/artifacts.server.test.ts +11 -7
- package/src/server/lib/omp/session/artifacts.server.ts +21 -17
- package/src/server/lib/panels/build.server.ts +19 -2
- package/src/server/lib/panels/css.server.test.ts +141 -0
- package/src/server/lib/panels/css.server.ts +255 -0
- package/src/server/lib/panels/plugin-ui-contract.test.ts +64 -0
- package/src/server/lib/panels/registry-stylesheet.server.test.ts +69 -0
- package/src/server/lib/panels/scan.server.ts +13 -7
- package/src/server/lib/panels/source-warnings.server.test.ts +65 -0
- package/src/server/lib/panels/source-warnings.server.ts +71 -0
- package/src/server/lib/realtime/topics/catalog.server.ts +3 -0
- package/src/server/lib/realtime/topics.server.ts +14 -0
- package/src/server/lib/sessions/last-opened-client.server.ts +1 -1
- package/src/server/lib/workspace/access.server.ts +108 -0
- package/src/server/lib/workspace/project-patch.server.ts +4 -2
- package/src/server/lib/workspace/register-folder.server.ts +19 -5
- package/src/server/lib/workspace/session-access.server.ts +55 -0
- package/src/server/lib/workspace/tenancy-schema.server.ts +40 -0
- package/src/server/plugins/ssr.ts +19 -3
- package/src/server/routes/accounts/index.ts +8 -0
- package/src/server/routes/accounts/management.test.ts +174 -0
- package/src/server/routes/accounts/management.ts +166 -0
- package/src/server/routes/auth/login.ts +22 -8
- package/src/server/routes/auth/logout.ts +1 -1
- package/src/server/routes/auth/password.ts +40 -33
- package/src/server/routes/auth/revoke.test.ts +1 -1
- package/src/server/routes/auth/revoke.ts +26 -8
- package/src/server/routes/auth/routes.test.ts +3 -3
- package/src/server/routes/auth/state.ts +14 -7
- package/src/server/routes/connect/devices.ts +7 -4
- package/src/server/routes/connect/pair.ts +4 -3
- package/src/server/routes/connect/status.ts +4 -2
- package/src/server/routes/connect/tunnels.ts +2 -1
- package/src/server/routes/folders/batch-delete.ts +12 -0
- package/src/server/routes/folders/clone.ts +7 -2
- package/src/server/routes/folders/create.ts +3 -1
- package/src/server/routes/folders/folder.ts +44 -4
- package/src/server/routes/folders/index.ts +3 -0
- package/src/server/routes/folders/shares.ts +62 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/panels/build.ts +1 -1
- package/src/server/routes/panels/css.test.ts +22 -0
- package/src/server/routes/panels/css.ts +5 -7
- package/src/server/routes/realtime/ws.ts +16 -1
- package/src/server/routes/sessions/list.ts +3 -2
- package/src/server/routes/settings/projects.ts +46 -7
- package/src/server/routes/settings/provider-icon.ts +18 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.test.ts +2 -2
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +6 -3
- package/src/shared/lib/icons/tint-hues.generated.ts +38 -37
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +27 -1
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +1 -1
- package/src/shared/lib/realtime/protocol.ts +16 -0
- package/src/shared/lib/settings/defaults.ts +2 -1
- package/src/shared/lib/settings/sections.ts +1 -1
- package/src/shared/lib/theme/border-style.test.ts +11 -9
- package/src/shared/lib/theme/border-style.ts +7 -7
- package/src/shared/lib/theme/chrome-style.test.ts +15 -0
- package/src/shared/lib/theme/chrome-style.ts +16 -1
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/state.ts +6 -5
- package/src/test-support/file-editor.test-util.ts +25 -6
- package/tsconfig.json +21 -0
- package/dist/client/static/js/ImageView-xc90jc1c.js +0 -1
- package/dist/client/static/js/LayoutWrapper-wyqe98kf.js +0 -2
- package/dist/client/static/js/MergeDiffView-bng34cpr.js +0 -1
- package/dist/client/static/js/Modal-89jk7wff.js +0 -60
- package/dist/client/static/js/SessionsView-6bpz1faj.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-sxrkxwbq.js +0 -1
- package/dist/client/static/js/bash-bcbct9gc.js +0 -1
- package/dist/client/static/js/c-fn9jz26e.js +0 -1
- package/dist/client/static/js/cpp-a1q64mke.js +0 -1
- package/dist/client/static/js/css-b92azee8.js +0 -1
- package/dist/client/static/js/css-sn00sq6v.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-g1xwa8b9.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-05p61bka.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7sn6nwjv.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-z1yehwys.js +0 -1
- package/dist/client/static/js/graphql-8d8bn59j.js +0 -1
- package/dist/client/static/js/html-6hdrwtz2.js +0 -1
- package/dist/client/static/js/index-4h2zkrk1.js +0 -2
- package/dist/client/static/js/index-5nm8hm4k.js +0 -2
- package/dist/client/static/js/index-95jfphx5.js +0 -481
- package/dist/client/static/js/index-9pw441wc.js +0 -4
- package/dist/client/static/js/index-bjz54ht6.js +0 -1
- package/dist/client/static/js/index-bqapt2e8.js +0 -2
- package/dist/client/static/js/index-ddkjgv5h.js +0 -2
- package/dist/client/static/js/index-dekvtt2a.js +0 -314
- package/dist/client/static/js/index-fnwaxc6r.js +0 -1
- package/dist/client/static/js/index-h65zrhva.js +0 -1
- package/dist/client/static/js/index-hxsqw7sz.js +0 -4
- package/dist/client/static/js/index-hxy1sadd.js +0 -2
- package/dist/client/static/js/index-ja0ajnvq.js +0 -10
- package/dist/client/static/js/index-qkyy563e.js +0 -1
- package/dist/client/static/js/index-t6nqy2n5.css +0 -1
- package/dist/client/static/js/index-wrk99kks.js +0 -3
- package/dist/client/static/js/info-A6RAGUB7-dqyaxjc1.js +0 -1
- package/dist/client/static/js/ini-g6a5xsaw.js +0 -1
- package/dist/client/static/js/java-n596am4c.js +0 -1
- package/dist/client/static/js/javascript-zc1qnyyp.js +0 -1
- package/dist/client/static/js/json-7k70qbkj.js +0 -1
- package/dist/client/static/js/jsx-sndenqrc.js +0 -1
- package/dist/client/static/js/lua-djd3g9q5.js +0 -1
- package/dist/client/static/js/markdown-r2tpvxpn.js +0 -1
- package/dist/client/static/js/one-dark-pro-7bgqnyhm.js +0 -1
- package/dist/client/static/js/one-light-47y6etng.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-7jxzax4z.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wc9wxr7f.js +0 -1
- package/dist/client/static/js/properties-brn72zdk.js +0 -1
- package/dist/client/static/js/python-g9mghwgm.js +0 -1
- package/dist/client/static/js/r-e247x4mw.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-kwj5padj.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-h8sdx3w5.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2wmwx246.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-h4cdgw3y.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-q7m0tfd0.js +0 -1
- package/dist/client/static/js/sql-0kar81jy.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y77g9dq0.js +0 -8
- package/dist/client/static/js/timeline-definition-EJHVYXUP-8a3yqmx0.js +0 -120
- package/dist/client/static/js/treeView-Q6P3EWNA-yv9640h3.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-7kpzjg21.js +0 -1
- package/dist/client/static/js/tsx-gjxfjnbk.js +0 -1
- package/dist/client/static/js/typescript-bm89v3gk.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-gf4y1r3s.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-mggay64p.js +0 -1
- package/dist/client/static/js/xml-b7824nx0.js +0 -1
- package/dist/client/static/js/yaml-kqqktdv1.js +0 -1
- package/src/server/lib/auth/client-address.ts +0 -89
- package/src/server/lib/auth/config.ts +0 -133
- package/src/server/lib/auth/rate-limit.ts +0 -146
- package/src/server/lib/auth/token.ts +0 -220
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
2
2
|
import { getLanguageFromPath } from '@/shared/lib/code/language';
|
|
3
3
|
import { resolveViewer } from '@/client/hooks/editor/resolve-viewer';
|
|
4
|
+
import { nextImageGeneration } from '@/client/hooks/editor/image-generation';
|
|
4
5
|
import { toDiskText, toLf, type LineEnding } from '@/shared/lib/code/line-endings';
|
|
5
6
|
import { deviceFileFor } from '@/client/lib/launch/device-files';
|
|
6
7
|
import { fileHandleFor } from '@/client/lib/launch/file-handlers';
|
|
@@ -66,6 +67,9 @@ export function useFileEditor(
|
|
|
66
67
|
const [revision, setRevision] = useState(0);
|
|
67
68
|
|
|
68
69
|
const key = target ? targetKey(target) : '';
|
|
70
|
+
// Per activation: `key` changes when the file becomes the active tab again,
|
|
71
|
+
// and a fresh mount runs the memo again — either way the URL is new.
|
|
72
|
+
const imageGeneration = useMemo(() => nextImageGeneration(), [key]);
|
|
69
73
|
// An inline `content` (attachment chip) can carry CRLF too, and the buffer it
|
|
70
74
|
// feeds is LF-only — normalizing here keeps `isDirty` comparing like with like.
|
|
71
75
|
const content = target ? (contents[key] ?? (target.content !== undefined ? toLf(target.content) : '')) : '';
|
|
@@ -74,7 +78,7 @@ export function useFileEditor(
|
|
|
74
78
|
// The viewer, its bytes and the image URL — see `resolve-viewer.ts` for the
|
|
75
79
|
// three rules this derivation encodes (the kind comes from the path; a
|
|
76
80
|
// handle-backed tab has no server path; an image keeps its own URL field).
|
|
77
|
-
const { viewerKind, isBinaryViewer, isImage, imageUrl, byteSource } = resolveViewer(target, revision);
|
|
81
|
+
const { viewerKind, isBinaryViewer, isImage, imageUrl, byteSource } = resolveViewer(target, revision, imageGeneration);
|
|
78
82
|
|
|
79
83
|
// Keys whose read has been requested or served, so a re-render cannot fire a
|
|
80
84
|
// duplicate fetch while the first one is still in flight.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Settings → Accounts data and writes. Every refusal keeps the server's text. */
|
|
7
|
+
|
|
8
|
+
import { useCallback, useEffect, useState } from 'preact/hooks';
|
|
9
|
+
import type { AccountListItem } from '@kabmo-labs/kabmo-auth/account';
|
|
10
|
+
import { isRecord } from '@kabmo-labs/kabmo-guards';
|
|
11
|
+
|
|
12
|
+
interface AccountsPayload {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
currentAccountId: string;
|
|
15
|
+
accounts: AccountListItem[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function readPayload(value: unknown): AccountsPayload | null {
|
|
19
|
+
if (!isRecord(value) || !Array.isArray(value.accounts)) return null;
|
|
20
|
+
const accounts: AccountListItem[] = [];
|
|
21
|
+
for (const row of value.accounts) {
|
|
22
|
+
if (!isRecord(row)) continue;
|
|
23
|
+
if (typeof row.id !== 'string' || typeof row.name !== 'string') continue;
|
|
24
|
+
if (row.role !== 'root' && row.role !== 'member') continue;
|
|
25
|
+
accounts.push({
|
|
26
|
+
id: row.id,
|
|
27
|
+
name: row.name,
|
|
28
|
+
role: row.role,
|
|
29
|
+
createdAt: typeof row.createdAt === 'string' ? row.createdAt : null,
|
|
30
|
+
ownedWorkspaces: typeof row.ownedWorkspaces === 'number' ? row.ownedWorkspaces : 0,
|
|
31
|
+
sharedWorkspaces: typeof row.sharedWorkspaces === 'number' ? row.sharedWorkspaces : 0,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
enabled: value.enabled === true,
|
|
36
|
+
currentAccountId: typeof value.currentAccountId === 'string' ? value.currentAccountId : '',
|
|
37
|
+
accounts,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function payloadOf(response: Response): Promise<unknown> {
|
|
42
|
+
return response.json().catch(() => null);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function refusal(response: Response, data: unknown): never {
|
|
46
|
+
const message = isRecord(data) && typeof data.error === 'string' ? data.error : `HTTP ${response.status}`;
|
|
47
|
+
throw new Error(message);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface AccountsState {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
currentAccountId: string;
|
|
53
|
+
accounts: AccountListItem[];
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
loadError: string | null;
|
|
56
|
+
refresh: () => Promise<void>;
|
|
57
|
+
create: (name: string, password: string) => Promise<void>;
|
|
58
|
+
rename: (id: string, name: string) => Promise<void>;
|
|
59
|
+
resetPassword: (id: string, newPassword: string, currentPassword?: string) => Promise<void>;
|
|
60
|
+
changeOwnPassword: (currentPassword: string, newPassword: string) => Promise<void>;
|
|
61
|
+
remove: (id: string, transferTo: string) => Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function useAccounts(): AccountsState {
|
|
65
|
+
const [enabled, setEnabled] = useState(false);
|
|
66
|
+
const [currentAccountId, setCurrentAccountId] = useState('');
|
|
67
|
+
const [accounts, setAccounts] = useState<AccountListItem[]>([]);
|
|
68
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
69
|
+
const [loadError, setLoadError] = useState<string | null>(null);
|
|
70
|
+
|
|
71
|
+
const apply = useCallback((data: unknown) => {
|
|
72
|
+
const payload = readPayload(data);
|
|
73
|
+
if (!payload) return false;
|
|
74
|
+
setEnabled(payload.enabled);
|
|
75
|
+
setCurrentAccountId(payload.currentAccountId);
|
|
76
|
+
setAccounts(payload.accounts);
|
|
77
|
+
return true;
|
|
78
|
+
}, []);
|
|
79
|
+
|
|
80
|
+
const refresh = useCallback(async () => {
|
|
81
|
+
try {
|
|
82
|
+
const response = await fetch('/api/accounts');
|
|
83
|
+
const data = await payloadOf(response);
|
|
84
|
+
if (!response.ok) refusal(response, data);
|
|
85
|
+
if (!apply(data)) throw new Error('The account list was not understood');
|
|
86
|
+
setLoadError(null);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
setLoadError(error instanceof Error ? error.message : String(error));
|
|
89
|
+
}
|
|
90
|
+
}, [apply]);
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
void refresh().finally(() => setIsLoading(false));
|
|
94
|
+
}, [refresh]);
|
|
95
|
+
|
|
96
|
+
const create = useCallback(async (name: string, password: string) => {
|
|
97
|
+
const response = await fetch('/api/accounts', {
|
|
98
|
+
method: 'POST',
|
|
99
|
+
headers: { 'Content-Type': 'application/json' },
|
|
100
|
+
body: JSON.stringify({ name, password }),
|
|
101
|
+
});
|
|
102
|
+
const data = await payloadOf(response);
|
|
103
|
+
if (!response.ok) refusal(response, data);
|
|
104
|
+
await refresh();
|
|
105
|
+
}, [refresh]);
|
|
106
|
+
|
|
107
|
+
const rename = useCallback(async (id: string, name: string) => {
|
|
108
|
+
const response = await fetch(`/api/accounts/${encodeURIComponent(id)}`, {
|
|
109
|
+
method: 'PATCH',
|
|
110
|
+
headers: { 'Content-Type': 'application/json' },
|
|
111
|
+
body: JSON.stringify({ name }),
|
|
112
|
+
});
|
|
113
|
+
const data = await payloadOf(response);
|
|
114
|
+
if (!response.ok) refusal(response, data);
|
|
115
|
+
await refresh();
|
|
116
|
+
}, [refresh]);
|
|
117
|
+
|
|
118
|
+
const resetPassword = useCallback(async (id: string, newPassword: string, currentPassword?: string) => {
|
|
119
|
+
const response = await fetch(`/api/accounts/${encodeURIComponent(id)}/password`, {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
headers: { 'Content-Type': 'application/json' },
|
|
122
|
+
body: JSON.stringify({ newPassword, ...(currentPassword ? { currentPassword } : {}) }),
|
|
123
|
+
});
|
|
124
|
+
const data = await payloadOf(response);
|
|
125
|
+
if (!response.ok) refusal(response, data);
|
|
126
|
+
}, []);
|
|
127
|
+
|
|
128
|
+
const changeOwnPassword = useCallback(async (currentPassword: string, newPassword: string) => {
|
|
129
|
+
const response = await fetch('/api/auth/password', {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers: { 'Content-Type': 'application/json' },
|
|
132
|
+
body: JSON.stringify({ currentPassword, newPassword }),
|
|
133
|
+
});
|
|
134
|
+
const data = await payloadOf(response);
|
|
135
|
+
if (!response.ok) refusal(response, data);
|
|
136
|
+
}, []);
|
|
137
|
+
|
|
138
|
+
const remove = useCallback(async (id: string, transferTo: string) => {
|
|
139
|
+
const response = await fetch(`/api/accounts/${encodeURIComponent(id)}`, {
|
|
140
|
+
method: 'DELETE',
|
|
141
|
+
headers: { 'Content-Type': 'application/json' },
|
|
142
|
+
body: JSON.stringify({ transferTo }),
|
|
143
|
+
});
|
|
144
|
+
const data = await payloadOf(response);
|
|
145
|
+
if (!response.ok) refusal(response, data);
|
|
146
|
+
await refresh();
|
|
147
|
+
}, [refresh]);
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
enabled,
|
|
151
|
+
currentAccountId,
|
|
152
|
+
accounts,
|
|
153
|
+
isLoading,
|
|
154
|
+
loadError,
|
|
155
|
+
refresh,
|
|
156
|
+
create,
|
|
157
|
+
rename,
|
|
158
|
+
resetPassword,
|
|
159
|
+
changeOwnPassword,
|
|
160
|
+
remove,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
@@ -27,10 +27,13 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import { useCallback, useSyncExternalStore } from 'preact/compat';
|
|
30
|
+
import type { AccountSummary } from '@kabmo-labs/kabmo-auth/account';
|
|
30
31
|
|
|
31
32
|
export type AuthState = 'authenticated' | 'required';
|
|
32
33
|
|
|
33
34
|
let state: AuthState = 'authenticated';
|
|
35
|
+
let account: AccountSummary | null = null;
|
|
36
|
+
let accounts = 0;
|
|
34
37
|
|
|
35
38
|
const listeners = new Set<() => void>();
|
|
36
39
|
|
|
@@ -71,9 +74,36 @@ let enabled = false;
|
|
|
71
74
|
* that visitor still needs to know the instance is password-protected (so the
|
|
72
75
|
* login screen's framing is right) without being told it is signed in.
|
|
73
76
|
*/
|
|
74
|
-
export function primeAuthState(
|
|
77
|
+
export function primeAuthState(
|
|
78
|
+
authenticated: boolean | undefined,
|
|
79
|
+
authEnabled = false,
|
|
80
|
+
nextAccount: AccountSummary | null = null,
|
|
81
|
+
accountCount = 1,
|
|
82
|
+
): void {
|
|
75
83
|
state = authenticated === false ? 'required' : 'authenticated';
|
|
76
84
|
enabled = authEnabled;
|
|
85
|
+
account = nextAccount;
|
|
86
|
+
accounts = Math.max(1, accountCount);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The signed-in account, or null on an open instance / login screen. */
|
|
90
|
+
export function useAccount(): AccountSummary | null {
|
|
91
|
+
return useSyncExternalStore(subscribe, () => account);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** How many accounts can sign in. `1` means the footer omits the picker state. */
|
|
95
|
+
export function useAccountCount(): number {
|
|
96
|
+
return useSyncExternalStore(subscribe, () => accounts);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function currentAccount(): AccountSummary | null {
|
|
100
|
+
return account;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function setAccount(next: AccountSummary | null, count = accounts): void {
|
|
104
|
+
account = next;
|
|
105
|
+
accounts = Math.max(1, count);
|
|
106
|
+
emit();
|
|
77
107
|
}
|
|
78
108
|
|
|
79
109
|
/** Whether this instance requires a password. */
|
|
@@ -191,12 +221,12 @@ export interface LoginResult {
|
|
|
191
221
|
* `replace`, not `reload`: the login screen is reached at `/login`, and reloading
|
|
192
222
|
* there would render the workspace at a URL that still says `/login`.
|
|
193
223
|
*/
|
|
194
|
-
export async function login(password: string, trustDevice: boolean): Promise<LoginResult> {
|
|
224
|
+
export async function login(accountId: string, password: string, trustDevice: boolean): Promise<LoginResult> {
|
|
195
225
|
try {
|
|
196
226
|
const response = await fetch('/api/auth/login', {
|
|
197
227
|
method: 'POST',
|
|
198
228
|
headers: { 'content-type': 'application/json' },
|
|
199
|
-
body: JSON.stringify({ password, trustDevice }),
|
|
229
|
+
body: JSON.stringify({ accountId, password, trustDevice }),
|
|
200
230
|
});
|
|
201
231
|
|
|
202
232
|
if (response.ok) {
|
|
@@ -251,6 +281,31 @@ export async function probeSession(): Promise<boolean | null> {
|
|
|
251
281
|
}
|
|
252
282
|
}
|
|
253
283
|
|
|
284
|
+
export interface LoginAccounts {
|
|
285
|
+
required: boolean;
|
|
286
|
+
accounts: AccountSummary[];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** The accounts the login screen may offer. Null means the read failed. */
|
|
290
|
+
export async function fetchLoginAccounts(): Promise<LoginAccounts | null> {
|
|
291
|
+
try {
|
|
292
|
+
const response = await fetch('/api/auth/state', { headers: { accept: 'application/json' } });
|
|
293
|
+
if (!response.ok) return null;
|
|
294
|
+
const body = (await response.json()) as { required?: boolean; accounts?: AccountSummary[] };
|
|
295
|
+
return {
|
|
296
|
+
required: body.required === true,
|
|
297
|
+
accounts: Array.isArray(body.accounts)
|
|
298
|
+
? body.accounts.filter((entry) => (
|
|
299
|
+
typeof entry?.id === 'string' && typeof entry?.name === 'string'
|
|
300
|
+
&& (entry.role === 'root' || entry.role === 'member')
|
|
301
|
+
))
|
|
302
|
+
: [],
|
|
303
|
+
};
|
|
304
|
+
} catch {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
254
309
|
/**
|
|
255
310
|
* Re-check the session against the server and adopt its answer.
|
|
256
311
|
*
|
|
@@ -65,10 +65,11 @@ describe('applyBorderStyle', () => {
|
|
|
65
65
|
expect(document.documentElement.hasAttribute('data-borders')).toBe(false);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
test('an unknown value resolves to
|
|
68
|
+
test('an unknown value resolves to hairline and therefore writes nothing', () => {
|
|
69
|
+
applyBorderStyle('borderless');
|
|
69
70
|
applyBorderStyle('naked');
|
|
70
71
|
|
|
71
|
-
expect(document.documentElement.
|
|
72
|
+
expect(document.documentElement.hasAttribute('data-borders')).toBe(false);
|
|
72
73
|
});
|
|
73
74
|
});
|
|
74
75
|
|
|
@@ -80,11 +81,11 @@ describe('the boot path', () => {
|
|
|
80
81
|
expect(document.documentElement.getAttribute('data-borders')).toBe('borderless');
|
|
81
82
|
});
|
|
82
83
|
|
|
83
|
-
test('an install with no stored preference boots
|
|
84
|
+
test('an install with no stored preference boots the ruled look', () => {
|
|
84
85
|
primeKabmoSettings({});
|
|
85
86
|
initBorderStyle();
|
|
86
87
|
|
|
87
|
-
expect(document.documentElement.
|
|
88
|
+
expect(document.documentElement.hasAttribute('data-borders')).toBe(false);
|
|
88
89
|
});
|
|
89
90
|
|
|
90
91
|
test('the settings key names a real field, so the write survives a reload', () => {
|
|
@@ -36,8 +36,9 @@ import {
|
|
|
36
36
|
* document carrying `hairline` and a document carrying nothing are the same
|
|
37
37
|
* state — which is what makes the rule set in `tailwind.css` the single
|
|
38
38
|
* statement of the ruled look. The comparison is against that ABSENT state, not
|
|
39
|
-
* against `DEFAULT_BORDER_STYLE`:
|
|
40
|
-
* attribute for it would paint rules while the setting
|
|
39
|
+
* against `DEFAULT_BORDER_STYLE`: if a later release makes `borderless` the
|
|
40
|
+
* default, omitting the attribute for it would paint rules while the setting
|
|
41
|
+
* says borderless.
|
|
41
42
|
*/
|
|
42
43
|
export function applyBorderStyle(style: unknown): void {
|
|
43
44
|
if (typeof document === 'undefined') return;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The single writer for the PHONE chrome arrangement.
|
|
8
|
+
*
|
|
9
|
+
* A second attribute (`data-mobile-chrome`) rather than a second value on
|
|
10
|
+
* `data-chrome`, because the two settings are independent: a user may keep the
|
|
11
|
+
* flat desktop frame and the floating phone drawers. CSS scopes it to the mobile
|
|
12
|
+
* `.app-window`, so the attribute is inert in the desktop layout.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { useState } from 'preact/hooks';
|
|
16
|
+
import { readKabmoSetting } from '@/shared/lib/settings/client';
|
|
17
|
+
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
18
|
+
import {
|
|
19
|
+
CHROME_STYLE_WITHOUT_ATTRIBUTE,
|
|
20
|
+
DEFAULT_MOBILE_CHROME_STYLE,
|
|
21
|
+
MOBILE_CHROME_ATTRIBUTE,
|
|
22
|
+
MOBILE_CHROME_STYLE_SETTING_KEY,
|
|
23
|
+
resolveMobileChromeStyle,
|
|
24
|
+
type ChromeStyle,
|
|
25
|
+
} from '@/shared/lib/theme/chrome-style';
|
|
26
|
+
|
|
27
|
+
/** Announced after the phone attribute moved. */
|
|
28
|
+
export const MOBILE_CHROME_STYLE_CHANGED_EVENT = 'omp:mobile-chrome-style-changed';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The attribute's value, resolved for a phone.
|
|
32
|
+
*
|
|
33
|
+
* An ABSENT attribute is what the writer leaves for `classic`, not the shipped
|
|
34
|
+
* default; resolving it to floating would make the hook disagree with the
|
|
35
|
+
* document `applyMobileChromeStyle` just cleared.
|
|
36
|
+
*/
|
|
37
|
+
export function readDocumentMobileChromeStyle(): ChromeStyle {
|
|
38
|
+
if (typeof document === 'undefined') return DEFAULT_MOBILE_CHROME_STYLE;
|
|
39
|
+
const raw = document.documentElement.getAttribute(MOBILE_CHROME_ATTRIBUTE);
|
|
40
|
+
return raw === null ? CHROME_STYLE_WITHOUT_ATTRIBUTE : resolveMobileChromeStyle(raw);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function applyMobileChromeStyle(style: unknown): void {
|
|
44
|
+
if (typeof document === 'undefined') return;
|
|
45
|
+
const root = document.documentElement;
|
|
46
|
+
const resolved = resolveMobileChromeStyle(style);
|
|
47
|
+
const previous = root.getAttribute(MOBILE_CHROME_ATTRIBUTE);
|
|
48
|
+
if (resolved === CHROME_STYLE_WITHOUT_ATTRIBUTE) root.removeAttribute(MOBILE_CHROME_ATTRIBUTE);
|
|
49
|
+
else root.setAttribute(MOBILE_CHROME_ATTRIBUTE, resolved);
|
|
50
|
+
const next = resolved === CHROME_STYLE_WITHOUT_ATTRIBUTE ? null : resolved;
|
|
51
|
+
if (previous === next) return;
|
|
52
|
+
// The attribute is the source the hook reads; the event only wakes a mounted
|
|
53
|
+
// drawer. Dispatch after the write so the re-read agrees with CSS.
|
|
54
|
+
if (typeof window !== 'undefined') {
|
|
55
|
+
window.dispatchEvent(new CustomEvent(MOBILE_CHROME_STYLE_CHANGED_EVENT, { detail: resolved }));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The phone chrome style currently on the document, subscribed. */
|
|
60
|
+
export function useMobileChromeStyle(): ChromeStyle {
|
|
61
|
+
const [style, setStyle] = useState(readDocumentMobileChromeStyle);
|
|
62
|
+
useKabmoEvent(MOBILE_CHROME_STYLE_CHANGED_EVENT, () => setStyle(readDocumentMobileChromeStyle()));
|
|
63
|
+
return style;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function initMobileChromeStyle(): void {
|
|
67
|
+
applyMobileChromeStyle(readKabmoSetting<unknown>(MOBILE_CHROME_STYLE_SETTING_KEY));
|
|
68
|
+
}
|
|
@@ -45,7 +45,7 @@ describe('navbar controls', () => {
|
|
|
45
45
|
// The menu and the row share these ids; a row with no control would be a
|
|
46
46
|
// checkbox that hides nothing.
|
|
47
47
|
const ids = NAVBAR_CONTROLS.map((item) => item.id);
|
|
48
|
-
expect(ids).toEqual(['install', 'reload', 'context', '
|
|
48
|
+
expect(ids).toEqual(['install', 'reload', 'context', 'right-panel']);
|
|
49
49
|
primeKabmoSettings({ [NAVBAR_HIDDEN_SETTING_KEY]: ids });
|
|
50
50
|
expect(readHiddenControls()).toEqual(ids);
|
|
51
51
|
});
|
|
@@ -68,7 +68,6 @@ describe('navbar controls', () => {
|
|
|
68
68
|
'plugin:stats',
|
|
69
69
|
'reload',
|
|
70
70
|
'context',
|
|
71
|
-
'signout',
|
|
72
71
|
'right-panel',
|
|
73
72
|
]);
|
|
74
73
|
expect(items[1]!.title).toBe('Stats');
|
|
@@ -49,7 +49,6 @@ export const NAVBAR_CONTROL = {
|
|
|
49
49
|
install: 'install',
|
|
50
50
|
reload: 'reload',
|
|
51
51
|
context: 'context',
|
|
52
|
-
signout: 'signout',
|
|
53
52
|
rightPanel: 'right-panel',
|
|
54
53
|
} as const;
|
|
55
54
|
|
|
@@ -92,7 +91,6 @@ const CONTROL_TITLES: Record<NavbarControlId, string> = {
|
|
|
92
91
|
install: 'Install app',
|
|
93
92
|
reload: 'Reload page',
|
|
94
93
|
context: 'Context usage',
|
|
95
|
-
signout: 'Sign out',
|
|
96
94
|
'right-panel': 'Right side',
|
|
97
95
|
};
|
|
98
96
|
|
|
@@ -113,7 +111,6 @@ export const NAVBAR_CONTROLS: NavbarControlItem[] = (
|
|
|
113
111
|
NAVBAR_CONTROL.install,
|
|
114
112
|
NAVBAR_CONTROL.reload,
|
|
115
113
|
NAVBAR_CONTROL.context,
|
|
116
|
-
NAVBAR_CONTROL.signout,
|
|
117
114
|
NAVBAR_CONTROL.rightPanel,
|
|
118
115
|
] satisfies NavbarControlId[]
|
|
119
116
|
).map((id) => ({ id, title: CONTROL_TITLES[id] }));
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The pointer half of a zoom surface: one contact pans, two contacts pinch.
|
|
8
|
+
*
|
|
9
|
+
* Both full-size viewers bind this and then answer it with their own state
|
|
10
|
+
* shape — the editor stage keeps `{scale,x,y}`, the full-screen shell anchors
|
|
11
|
+
* its `zoomTo` — but the gesture itself (which contact is captured, when a
|
|
12
|
+
* drag must yield to a pinch, and how a lifted finger hands panning back)
|
|
13
|
+
* is one contract. Two copies is how a pinch leaves the other viewer frozen.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useCallback, useRef, useState } from 'preact/hooks';
|
|
17
|
+
import type { TargetedPointerEvent } from 'preact';
|
|
18
|
+
import { PinchTracker } from '@/client/lib/ui/pinch';
|
|
19
|
+
import type { PinchFrame } from '@/client/lib/ui/pinch';
|
|
20
|
+
|
|
21
|
+
interface Drag {
|
|
22
|
+
pointerId: number;
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ZoomGestureOptions {
|
|
28
|
+
/** Pan by a pointer delta, in client px. */
|
|
29
|
+
onPan: (dx: number, dy: number) => void;
|
|
30
|
+
/** Scale and pan by a pinch frame. */
|
|
31
|
+
onPinch: (frame: PinchFrame) => void;
|
|
32
|
+
/** Whether a new drag may start; the editor waits for a measurement. */
|
|
33
|
+
canDrag?: boolean;
|
|
34
|
+
/** A contact landed and the reader is now driving the view. */
|
|
35
|
+
onStart?: () => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function useZoomGesture({ onPan, onPinch, canDrag = true, onStart }: ZoomGestureOptions) {
|
|
39
|
+
const dragRef = useRef<Drag | null>(null);
|
|
40
|
+
const pinchRef = useRef<PinchTracker | null>(null);
|
|
41
|
+
const pinch = (pinchRef.current ??= new PinchTracker());
|
|
42
|
+
const [dragging, setDragging] = useState(false);
|
|
43
|
+
|
|
44
|
+
const onPointerDown = useCallback(
|
|
45
|
+
(event: TargetedPointerEvent<HTMLElement>) => {
|
|
46
|
+
if (event.button !== 0 || !canDrag) return;
|
|
47
|
+
onStart?.();
|
|
48
|
+
// A mouse has one contact; only touch and pen can form a pinch.
|
|
49
|
+
if (event.pointerType !== 'mouse') pinch.begin(event.pointerId, event.clientX, event.clientY);
|
|
50
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
51
|
+
if (pinch.pinching) {
|
|
52
|
+
dragRef.current = null;
|
|
53
|
+
setDragging(false);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
dragRef.current = { pointerId: event.pointerId, x: event.clientX, y: event.clientY };
|
|
57
|
+
setDragging(true);
|
|
58
|
+
},
|
|
59
|
+
[canDrag, onStart, pinch],
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const onPointerMove = useCallback(
|
|
63
|
+
(event: TargetedPointerEvent<HTMLElement>) => {
|
|
64
|
+
const frame = pinch.move(event.pointerId, event.clientX, event.clientY);
|
|
65
|
+
if (frame) {
|
|
66
|
+
onPinch(frame);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const drag = dragRef.current;
|
|
70
|
+
if (!drag || drag.pointerId !== event.pointerId) return;
|
|
71
|
+
const dx = event.clientX - drag.x;
|
|
72
|
+
const dy = event.clientY - drag.y;
|
|
73
|
+
drag.x = event.clientX;
|
|
74
|
+
drag.y = event.clientY;
|
|
75
|
+
onPan(dx, dy);
|
|
76
|
+
},
|
|
77
|
+
[pinch, onPinch, onPan],
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const onPointerUp = useCallback(
|
|
81
|
+
(event: TargetedPointerEvent<HTMLElement>) => {
|
|
82
|
+
const remaining = pinch.end(event.pointerId);
|
|
83
|
+
if (dragRef.current?.pointerId === event.pointerId) {
|
|
84
|
+
dragRef.current = null;
|
|
85
|
+
setDragging(false);
|
|
86
|
+
}
|
|
87
|
+
// Lifting one finger out of a pinch hands panning to the other one,
|
|
88
|
+
// instead of freezing the picture until a new press.
|
|
89
|
+
if (remaining && !dragRef.current) {
|
|
90
|
+
dragRef.current = { pointerId: remaining.id, x: remaining.x, y: remaining.y };
|
|
91
|
+
setDragging(true);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
[pinch],
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
dragging,
|
|
99
|
+
onPointerDown,
|
|
100
|
+
onPointerMove,
|
|
101
|
+
onPointerUp,
|
|
102
|
+
onPointerCancel: onPointerUp,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -69,6 +69,7 @@ describe('shell title-bar contract', () => {
|
|
|
69
69
|
// The floating card asks for the width itself; a browser's answer is the
|
|
70
70
|
// PWA's own overlay arithmetic, which reads `0px` where WCO is inactive.
|
|
71
71
|
expect(bar.shellTrafficInsetLeft()).toBe('env(titlebar-area-x, 0px)');
|
|
72
|
+
expect(bar.hasLeftWindowControls()).toBe(false);
|
|
72
73
|
expect(bar.drawsWindowControls()).toBe(false);
|
|
73
74
|
});
|
|
74
75
|
|
|
@@ -78,6 +79,7 @@ describe('shell title-bar contract', () => {
|
|
|
78
79
|
expect(bar.dragRegionProps()).toEqual({ 'data-drag-region': '' });
|
|
79
80
|
expect(bar.titlebarInsetLeft('1rem')).toBe('5rem');
|
|
80
81
|
expect(bar.shellTrafficInsetLeft()).toBe('5rem');
|
|
82
|
+
expect(bar.hasLeftWindowControls()).toBe(true);
|
|
81
83
|
// The system owns the traffic lights: a page-drawn set would be a second one.
|
|
82
84
|
expect(bar.drawsWindowControls()).toBe(false);
|
|
83
85
|
});
|
|
@@ -89,6 +91,7 @@ describe('shell title-bar contract', () => {
|
|
|
89
91
|
// Nothing floats over the page on a borderless Windows window.
|
|
90
92
|
expect(bar.titlebarInsetLeft('1rem')).toBe('1rem');
|
|
91
93
|
expect(bar.shellTrafficInsetLeft()).toBe('env(titlebar-area-x, 0px)');
|
|
94
|
+
expect(bar.hasLeftWindowControls()).toBe(false);
|
|
92
95
|
expect(bar.drawsWindowControls()).toBe(true);
|
|
93
96
|
});
|
|
94
97
|
|
|
@@ -99,9 +102,26 @@ describe('shell title-bar contract', () => {
|
|
|
99
102
|
expect(bar.overlayTitlebar()).toBe(true);
|
|
100
103
|
expect(bar.titlebarInsetLeft('1rem')).toBe('1rem');
|
|
101
104
|
expect(bar.shellTrafficInsetLeft()).toBe('env(titlebar-area-x, 0px)');
|
|
105
|
+
expect(bar.hasLeftWindowControls()).toBe(false);
|
|
102
106
|
expect(bar.drawsWindowControls()).toBe(false);
|
|
103
107
|
});
|
|
104
108
|
|
|
109
|
+
/**
|
|
110
|
+
* The rail's way back moves to the title row ONLY when the shell's own
|
|
111
|
+
* controls are in its corner: the rail is 44px and macOS reserves 76px, so a
|
|
112
|
+
* toggle in the bar is drawn under the buttons and cannot be clicked.
|
|
113
|
+
*/
|
|
114
|
+
test('a closed rail hands its toggle to the title only under native left controls', async () => {
|
|
115
|
+
shell(MACOS);
|
|
116
|
+
const bar = await titlebar();
|
|
117
|
+
expect(bar.railToggleBelongsToTitle(true)).toBe(true);
|
|
118
|
+
// An open column keeps the toggle in its own bar.
|
|
119
|
+
expect(bar.railToggleBelongsToTitle(false)).toBe(false);
|
|
120
|
+
// A browser has no controls to avoid and its layout must not move.
|
|
121
|
+
scope().window = {};
|
|
122
|
+
expect(bar.railToggleBelongsToTitle(true)).toBe(false);
|
|
123
|
+
});
|
|
124
|
+
|
|
105
125
|
/** A shell that draws its own native bar must not mark a drag region. */
|
|
106
126
|
test('overlayTitlebar false marks no drag region and no controls', async () => {
|
|
107
127
|
shell({ platform: 'windows', shellVersion: '0.1.0', overlayTitlebar: false, windowControls: true });
|
|
@@ -109,6 +129,7 @@ describe('shell title-bar contract', () => {
|
|
|
109
129
|
expect(bar.overlayTitlebar()).toBe(false);
|
|
110
130
|
expect(bar.dragRegionProps()).toEqual({});
|
|
111
131
|
// The native bar owns the buttons when it is visible.
|
|
132
|
+
expect(bar.hasLeftWindowControls()).toBe(false);
|
|
112
133
|
expect(bar.drawsWindowControls()).toBe(false);
|
|
113
134
|
});
|
|
114
135
|
});
|
|
@@ -99,6 +99,40 @@ export function shellTrafficInsetLeft(): string {
|
|
|
99
99
|
return shellInfo()?.trafficLightInset ?? 'env(titlebar-area-x, 0px)';
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* True when the shell draws its own controls over the page's LEFT edge and
|
|
104
|
+
* therefore reserves that strip (`trafficLightInset`).
|
|
105
|
+
*
|
|
106
|
+
* The width, not the padding, is what the cohort needs: the floating app-name
|
|
107
|
+
* card starts after the controls, and the collapsed rail is narrower than them
|
|
108
|
+
* and cannot carry its toggle there at all (see `railToggleBelongsToTitle`).
|
|
109
|
+
*/
|
|
110
|
+
export function hasLeftWindowControls(): boolean {
|
|
111
|
+
return overlayTitlebar() && Boolean(shellInfo()?.trafficLightInset);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Whether a left column closed to its rail hands the expand toggle to the
|
|
116
|
+
* session title bar.
|
|
117
|
+
*
|
|
118
|
+
* The rail is 44px wide and the macOS shell reserves 76px for its traffic
|
|
119
|
+
* lights, so the rail's own bar cannot hold the toggle past them: the button
|
|
120
|
+
* would be drawn UNDER the close/minimise/maximise buttons and be unclickable
|
|
121
|
+
* (reported as "batasi posisi toggle left btn ke posisi app name"). The title
|
|
122
|
+
* row starts at the app-name position, so the way back moves there — the same
|
|
123
|
+
* shape a fully collapsed column already uses.
|
|
124
|
+
*
|
|
125
|
+
* `railOnly` is the caller's answer, because only it knows the column's state:
|
|
126
|
+
* a rail closed with the chat hidden (`chatHidden`) keeps the BAR's toggle —
|
|
127
|
+
* the title row is collapsed with the chat, so a control there would be
|
|
128
|
+
* invisible. A shell with no controls on the left never moves the button, and
|
|
129
|
+
* only the floating chrome can host the move: its bar slot is the one with a
|
|
130
|
+
* height, so the card below keeps its line.
|
|
131
|
+
*/
|
|
132
|
+
export function railToggleBelongsToTitle(railOnly: boolean): boolean {
|
|
133
|
+
return railOnly && hasLeftWindowControls();
|
|
134
|
+
}
|
|
135
|
+
|
|
102
136
|
/**
|
|
103
137
|
* True when the page must draw the window's own controls.
|
|
104
138
|
*
|
|
@@ -174,6 +174,26 @@ describe('PluginBootstrap', () => {
|
|
|
174
174
|
expect(surface?.querySelector('#demo-node')).not.toBeNull();
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
+
test('loads a panel-only plugin stylesheet — no content script required', async () => {
|
|
178
|
+
// The registry advertises a stylesheet for a plugin that registers no
|
|
179
|
+
// content script. The old gate filtered on content scripts, so this link
|
|
180
|
+
// never appeared and every class in the panel's compiled Tailwind was dead.
|
|
181
|
+
container = document.createElement('div');
|
|
182
|
+
document.body.appendChild(container);
|
|
183
|
+
await act(async () => {
|
|
184
|
+
render(
|
|
185
|
+
h(SessionStateProvider, { sessionId: 's1', children: h(PluginBootstrap, { workspacePath: null }) }),
|
|
186
|
+
container,
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
await server.waitForTopic(TOPIC_PANELS, (value) => value !== null);
|
|
190
|
+
|
|
191
|
+
const link = () =>
|
|
192
|
+
document.head.querySelector<HTMLLinkElement>('link[data-plugin-stylesheet="demo"]');
|
|
193
|
+
await waitFor(() => link() !== null);
|
|
194
|
+
expect(link()?.getAttribute('href')).toBe('/api/panels/css/demo.css');
|
|
195
|
+
});
|
|
196
|
+
|
|
177
197
|
test('disabling the plugin unmounts its content script without a reload', async () => {
|
|
178
198
|
await mountWithContentScript();
|
|
179
199
|
expect(generations()).toHaveLength(1);
|