@kabmo-labs/kabmo 0.39.1 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +363 -363
- package/dist/client/static/js/{CsvGrid-7synegzg.js → CsvGrid-j9nvnhq1.js} +2 -2
- package/dist/client/static/js/{DocxView-v5d9n5yw.js → DocxView-87gnpm81.js} +5 -5
- package/dist/client/static/js/{DrawioView-ww7y98tt.js → DrawioView-a351t8f8.js} +2 -2
- package/dist/client/static/js/ImageView-c139r891.js +1 -0
- package/dist/client/static/js/LayoutWrapper-08axzr3a.js +2 -0
- package/dist/client/static/js/{Modal-qj39shgb.js → Modal-0weqfqvk.js} +17 -17
- package/dist/client/static/js/{PdfView-t9v4datp.js → PdfView-n6bwcvc8.js} +1 -1
- package/dist/client/static/js/{SessionsView-yqy0a1xg.js → SessionsView-awef8ehj.js} +1 -1
- package/dist/client/static/js/{SheetView-6zkxbjd4.js → SheetView-k8ymr87w.js} +24 -24
- package/dist/client/static/js/{SvgPreview-7rt2p1y1.js → SvgPreview-5pcp444e.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-888zn5zg.js → abnfDiagram-O67JEVCF-psav75bx.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-6rbq97t9.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-b04e26rb.js → architectureDiagram-NJMV4G6O-9bk6ykn7.js} +3 -3
- package/dist/client/static/js/{astro-4ybhkc9b.js → astro-0rh34hha.js} +1 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-32ph2m52.js → blockDiagram-BEXU5L5S-17xsf182.js} +5 -5
- package/dist/client/static/js/c-67jyc7sg.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-hwnaa333.js → c4Diagram-YGBWAQC7-jn9j4n04.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-2kg7dqeb.js → classDiagram-v2-NBCMYWYE-663z1g1r.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-tj2sbtyv.js → cose-bilkent-JH36ORCC-vp4yvx8x.js} +1 -1
- package/dist/client/static/js/cpp-crfbnwv8.js +1 -0
- package/dist/client/static/js/css-983fbv00.js +1 -0
- package/dist/client/static/js/css-zj4qzw6r.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-zafxcz2k.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-wx2y8dhm.js → cynefinDiagram-VND7K2PF-dagkrjbh.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-5v3rzdxd.js → dagre-6A5THRUB-8qgwpb5a.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-7er2jwy1.js → diagram-22UHCM2B-671xtp0d.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-2b7nmdha.js → diagram-3UASUU5V-8nn5fha8.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-yf61ftn0.js → diagram-ATOU4E4O-dnar0ktg.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-cn3rs9xn.js → diagram-CDSNMT55-bt0fhk7n.js} +3 -3
- package/dist/client/static/js/{diagram-MLGK6HIB-7kvtsj6c.js → diagram-MLGK6HIB-tp6dwxdb.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-g3zg3r5e.js → diagram-MPIPVDR6-qgx8c8ee.js} +2 -2
- package/dist/client/static/js/{dockerfile-f9j396wm.js → dockerfile-hk0s4qaw.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-ft02nzne.js → ebnfDiagram-ZINNZB2B-nmf9r33z.js} +1 -1
- package/dist/client/static/js/{elixir-v9bbxsgg.js → elixir-gpez1k9m.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-87fvkn2k.js → elk-276RUBZZ-dheh5ngz.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-gh9mp6j8.js → erDiagram-OPXOYQCR-8837mk18.js} +5 -5
- package/dist/client/static/js/{erlang-55r0skxa.js → erlang-w9gmf866.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-cq3dvz7e.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-spzh2jxq.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-227xs61z.js → ganttDiagram-FUAMR5RP-g68mvnje.js} +2 -2
- package/dist/client/static/js/{ghostty-web-2gt2tp72.js → ghostty-web-22pdvhta.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-epgk26pj.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-4671gdym.js → gitGraphDiagram-X574FWY7-ymk81cdj.js} +2 -2
- package/dist/client/static/js/graphql-dewsj5g1.js +1 -0
- package/dist/client/static/js/html-1cpe2xc8.js +1 -0
- package/dist/client/static/js/{index-hdd8nqz8.js → index-018ehs1n.js} +1 -1
- package/dist/client/static/js/{index-442mbhwb.js → index-173x4bh0.js} +2 -2
- package/dist/client/static/js/{index-c1be3rva.js → index-2kg3r5jw.js} +2 -2
- package/dist/client/static/js/{index-d3prrt2q.js → index-4j1g7m8g.js} +1 -1
- package/dist/client/static/js/{index-m847wafq.js → index-4j5jwb54.js} +2 -2
- package/dist/client/static/js/{index-8egjccbq.js → index-547h1b8j.js} +52 -52
- package/dist/client/static/js/{index-f1nqk6z6.js → index-69xe17c1.js} +2 -2
- package/dist/client/static/js/{index-y91j4t1q.js → index-6wtx7a9x.js} +2 -2
- package/dist/client/static/js/{index-kkfbd1db.js → index-8888hgj8.js} +5 -5
- package/dist/client/static/js/{index-s80x8d58.js → index-8ggxxp8c.js} +2 -2
- package/dist/client/static/js/{index-b08hx4tw.js → index-9wjnbb3q.js} +2 -2
- package/dist/client/static/js/{index-qbnd827h.js → index-ag78jnva.js} +1 -1
- package/dist/client/static/js/{index-xrp2zv8z.js → index-agdbjh5k.js} +2 -2
- package/dist/client/static/js/index-aznkfx1z.js +2 -0
- package/dist/client/static/js/{index-cfnxda13.js → index-b612vske.js} +2 -2
- package/dist/client/static/js/{index-xnk1500f.js → index-bdz08fe2.js} +12 -12
- package/dist/client/static/js/{index-8xasfxf3.js → index-bgpcf3mr.js} +1 -1
- package/dist/client/static/js/index-bj3wn9je.js +1 -0
- package/dist/client/static/js/{index-phm1zb8m.js → index-c003wb3r.js} +1 -1
- package/dist/client/static/js/{index-87qandgr.js → index-cccrappc.js} +2 -2
- package/dist/client/static/js/{index-k7sdsmgv.js → index-ce4vytm6.js} +2 -2
- package/dist/client/static/js/{index-2rs03vfy.js → index-d1vearmk.js} +2 -2
- package/dist/client/static/js/index-dhrp656p.js +1 -0
- package/dist/client/static/js/{index-w0rbyw47.js → index-dj7y2df7.js} +2 -2
- package/dist/client/static/js/{index-4wtr5wjp.js → index-ek4gwrm8.js} +2 -2
- package/dist/client/static/js/{index-xfr6r539.js → index-ek7hqfp0.js} +2 -2
- package/dist/client/static/js/{index-drjtwfp5.js → index-fg965t62.js} +2 -2
- package/dist/client/static/js/{index-j2g39xq7.js → index-g10nr8m6.js} +5 -5
- package/dist/client/static/js/{index-4wvtar0v.js → index-gn92c6hp.js} +2 -2
- package/dist/client/static/js/{index-t6gznaxm.js → index-gx2xefdg.js} +2 -2
- package/dist/client/static/js/{index-q0bph5x0.js → index-haaz8t7e.js} +2 -2
- package/dist/client/static/js/{index-wgvysmnr.js → index-harsfp4x.js} +10 -10
- package/dist/client/static/js/{index-4c2zcvem.js → index-j4ks5s41.js} +179 -179
- package/dist/client/static/js/{index-cst843zs.css → index-jqs23cc7.css} +1 -1
- package/dist/client/static/js/{index-35mh9kbs.js → index-js81yrmy.js} +3 -3
- package/dist/client/static/js/{index-enmh3w27.js → index-jy91r3ap.js} +2 -2
- package/dist/client/static/js/{index-mtadrbxt.js → index-mxpgfj6p.js} +2 -2
- package/dist/client/static/js/{index-28a5kf88.js → index-p2812ygk.js} +1 -1
- package/dist/client/static/js/index-pp6mss9b.js +3 -0
- package/dist/client/static/js/index-q1bqg4f6.js +1 -0
- package/dist/client/static/js/{index-668chrpq.js → index-qnt118mp.js} +1 -1
- package/dist/client/static/js/index-qntpsp98.js +2 -0
- package/dist/client/static/js/{index-fjnkzk12.js → index-qsw5edtk.js} +5 -5
- package/dist/client/static/js/{index-tmnnafht.js → index-qw5aqk2d.js} +1 -1
- package/dist/client/static/js/{index-9gepbvdt.js → index-r1fe56cn.js} +2 -2
- package/dist/client/static/js/{index-72289dgx.js → index-rc8wrs2a.js} +2 -2
- package/dist/client/static/js/index-rvjc19x7.js +2 -0
- package/dist/client/static/js/{index-9d6x1f3t.js → index-s78n0dtv.js} +2 -2
- package/dist/client/static/js/{index-c36pag9y.js → index-sj4y8kj2.js} +2 -2
- package/dist/client/static/js/{index-qsrw5c67.js → index-vv9ytx0t.js} +2 -2
- package/dist/client/static/js/{index-1sgad84m.js → index-vwc8pdy3.js} +2 -2
- package/dist/client/static/js/{index-6rs8e8ng.js → index-w130cs7d.js} +1 -1
- package/dist/client/static/js/{index-vb3srfyc.js → index-wsqgp9jw.js} +2 -2
- package/dist/client/static/js/{index-y5ymgp20.js → index-wv36ddd5.js} +48 -48
- package/dist/client/static/js/{index-7qc2avfy.js → index-wy05jt00.js} +2 -2
- package/dist/client/static/js/{index-0j518hqm.js → index-xf36nmbm.js} +2 -2
- package/dist/client/static/js/{index-h8rr48px.js → index-y5hxhr7q.js} +4 -4
- package/dist/client/static/js/{index-f73v86a3.js → index-y82bk3hr.js} +3 -3
- package/dist/client/static/js/{index-rj81xrvw.js → index-ys4t1am4.js} +2 -2
- package/dist/client/static/js/{index-y3qxrs90.js → index-yzg9mbsv.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-0an46pag.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-k1jnhhbp.js → infoDiagram-VRGFBTTK-11trzn8c.js} +1 -1
- package/dist/client/static/js/ini-09e0scxh.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ar94x2gr.js → ishikawaDiagram-OU5B5YK6-8xnnymb5.js} +2 -2
- package/dist/client/static/js/java-vnaesxzs.js +1 -0
- package/dist/client/static/js/javascript-zegm06a1.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-ntfp0w54.js → journeyDiagram-ZHPQQLJL-wd47j0hy.js} +3 -3
- package/dist/client/static/js/json-g5ggnd94.js +1 -0
- package/dist/client/static/js/jsx-xz71aed4.js +1 -0
- package/dist/client/static/js/{julia-jhe2vd4f.js → julia-c2q0vwpd.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-q5rsr6j3.js → kanban-definition-PNTS6WVX-s5rgcp44.js} +4 -4
- package/dist/client/static/js/lua-e4wenyzt.js +1 -0
- package/dist/client/static/js/markdown-yv3p1p7m.js +1 -0
- package/dist/client/static/js/{mermaid.core-0gafsqrm.js → mermaid.core-9fxp8nt2.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-jgz6nyhk.js → mindmap-definition-NLK3R4M7-4fyewtst.js} +3 -3
- package/dist/client/static/js/one-dark-pro-ahch85zb.js +1 -0
- package/dist/client/static/js/one-light-9706jgqt.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-5e397pav.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-b3e9ma2c.js → pegDiagram-GJSIUBJH-s2xe2e2k.js} +1 -1
- package/dist/client/static/js/{perl-qhj6tk7k.js → perl-6pa0tn3b.js} +1 -1
- package/dist/client/static/js/{php-arycc4w7.js → php-1zy994pz.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-0zzmzg64.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-66mn2qnt.js → pieDiagram-5QR66LMP-1szpjbzy.js} +2 -2
- package/dist/client/static/js/properties-0ag74bdj.js +1 -0
- package/dist/client/static/js/python-zsn5tdbj.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-n7warg0e.js → quadrantDiagram-O4NWA36T-mv3ee2qa.js} +3 -3
- package/dist/client/static/js/r-mwtqhnw3.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-mtar9742.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-d6a6j9fq.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-1257kd8x.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-v8b6qmas.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-jxpbx410.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-k8j43rxj.js → railroadDiagram-XR7U4H2S-hgdqjpm9.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-ef2v7nyq.js → requirementDiagram-PLB6GJNP-yrfjp9wx.js} +3 -3
- package/dist/client/static/js/{ruby-fb6zzevm.js → ruby-arvs7kz4.js} +1 -1
- package/dist/client/static/js/{rust-jvkbr060.js → rust-3ahjk339.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-3njbd1yd.js → sankeyDiagram-IPEJSGJF-k7k871xa.js} +3 -3
- package/dist/client/static/js/{sass-fzs6a0kr.js → sass-cmkf7nwd.js} +1 -1
- package/dist/client/static/js/{scss-gdb52d0c.js → scss-x7ddw6gb.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-k2wqc0qt.js → sequenceDiagram-PO4LG4MO-gd80m0as.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-cpnd12ee.js → sizeCapture-INFHLROL-jv6p4834.js} +1 -1
- package/dist/client/static/js/sql-aczp05f2.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-1ydpxaeg.js → stateDiagram-v2-GCMORJYK-tvphxq2h.js} +3 -3
- package/dist/client/static/js/{svelte-8s3k6qjd.js → svelte-0hv6pak2.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-4md43da2.js → swimlanes-2SLR337P-3dt7nxj2.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-aqnh1hhp.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-sp32bf3e.js → timeline-definition-EJHVYXUP-40vvf856.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-q3qr7ew7.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-zgbdydeq.js +1 -0
- package/dist/client/static/js/tsx-s1shkfg9.js +1 -0
- package/dist/client/static/js/typescript-htx9v6bf.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-p2ssettn.js → usecaseDiagram-POWQR4AR-g1j5x0xh.js} +28 -28
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-ejqq8b82.js → vennDiagram-UO4OBE2U-5b8789qk.js} +1 -1
- package/dist/client/static/js/{vue-k3f3chre.js → vue-zccj3qa5.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-b230aajh.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-tkk79rsn.js → wardleyDiagram-VNRHLVJA-c7x3za3w.js} +3 -3
- package/dist/client/static/js/xml-23y6pgvx.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-zhgrsqpb.js → xychartDiagram-PMCCYNJV-h0fy45tg.js} +3 -3
- package/dist/client/static/js/yaml-vrayja34.js +1 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/panel/Custom.test.tsx +1 -0
- package/marketplace/plugins/command-runner/src/panel/Groups.test.tsx +10 -0
- package/marketplace/plugins/command-runner/src/panel/Groups.tsx +24 -3
- package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -0
- package/marketplace/plugins/command-runner/src/protocol.ts +10 -0
- package/marketplace/plugins/command-runner/src/server/discovery.test.ts +30 -0
- package/marketplace/plugins/command-runner/src/server/scan.ts +16 -3
- package/package.json +1 -1
- package/src/client/components/common/header-controls/MoreMenu.tsx +24 -14
- package/src/client/components/common/header-controls/index.test.tsx +22 -0
- package/src/client/components/common/header-controls/index.tsx +8 -2
- package/src/client/components/mobile/LayoutWrapper.tsx +19 -2
- package/src/client/components/mobile/RightSidebar.tsx +49 -1
- package/src/client/components/mobile/SessionSidebar.tsx +25 -1
- package/src/client/components/mobile/header-titlebar.test.tsx +17 -0
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +43 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +30 -0
- package/src/client/components/mobile/mobile-session-sidebar/Dock.tsx +5 -1
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +12 -1
- package/src/client/components/mobile/panel-chips.test.tsx +13 -0
- package/src/client/components/mobile/panel-chips.tsx +9 -2
- package/src/client/components/settings/categories/connect-settings/DeviceTable.test.tsx +92 -0
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +22 -3
- package/src/client/components/workspace/git-panel/commit-modal/Header.test.tsx +21 -0
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +13 -9
- package/src/client/components/workspace/terminal-panel/focus-target.test.ts +121 -0
- package/src/client/components/workspace/terminal-panel/focus-target.ts +54 -0
- package/src/client/components/workspace/terminal-panel/index.tsx +7 -1
- package/src/client/components/workspace/terminal-panel/instance.ts +82 -0
- package/src/client/components/workspace/terminal-panel/mount.ts +22 -63
- package/src/client/components/workspace/terminal-panel/soft-keyboard.ts +29 -0
- package/src/client/hooks/ui/touch-device.ts +8 -3
- package/src/client/hooks/ui/visibility-menu-trigger.test.ts +155 -0
- package/src/client/hooks/ui/visibility-menu-trigger.ts +85 -0
- package/src/client/hooks/workspace/panel-visibility-menu.ts +50 -0
- package/src/client/lib/ui/soft-keyboard.test.ts +103 -0
- package/src/client/lib/ui/soft-keyboard.ts +90 -0
- package/src/server/lib/auth/guard.ts +8 -2
- package/src/server/lib/connect/devices.server.test.ts +70 -0
- package/src/server/lib/connect/devices.server.ts +43 -1
- package/src/server/lib/connect/last-connect.gate.test.ts +52 -0
- package/src/server/routes/connect/devices.ts +5 -4
- package/src/shared/lib/connect/types.ts +1 -0
- package/dist/client/static/js/ImageView-t3rkypzs.js +0 -1
- package/dist/client/static/js/LayoutWrapper-th2pd4yt.js +0 -2
- package/dist/client/static/js/architecture-7GRP2DOG-y0zb4vqa.js +0 -1
- package/dist/client/static/js/bash-k6p3y3pr.js +0 -1
- package/dist/client/static/js/c-ve09y19q.js +0 -1
- package/dist/client/static/js/cpp-vhqp7bcy.js +0 -1
- package/dist/client/static/js/css-77mvf0ca.js +0 -1
- package/dist/client/static/js/css-tys2rrny.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-nt1ed192.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-v4edaxx7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-6gc6gd1d.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-adzhec96.js +0 -1
- package/dist/client/static/js/graphql-g97hycb3.js +0 -1
- package/dist/client/static/js/html-2syect3n.js +0 -1
- package/dist/client/static/js/index-1jeyjqkh.js +0 -2
- package/dist/client/static/js/index-4ry8kz8h.js +0 -3
- package/dist/client/static/js/index-fjqp03xe.js +0 -2
- package/dist/client/static/js/index-fs3pbqwn.js +0 -1
- package/dist/client/static/js/index-jze0zg3z.js +0 -2
- package/dist/client/static/js/index-w0xvdda9.js +0 -1
- package/dist/client/static/js/index-wfcgqjzr.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-2ye26vqn.js +0 -1
- package/dist/client/static/js/ini-7ffv28px.js +0 -1
- package/dist/client/static/js/java-4x5yky4a.js +0 -1
- package/dist/client/static/js/javascript-4kw2j9t3.js +0 -1
- package/dist/client/static/js/json-h3kwpty2.js +0 -1
- package/dist/client/static/js/jsx-jk20f0dr.js +0 -1
- package/dist/client/static/js/lua-k02dpxq8.js +0 -1
- package/dist/client/static/js/markdown-fhhg7ms6.js +0 -1
- package/dist/client/static/js/one-dark-pro-n0as47q7.js +0 -1
- package/dist/client/static/js/one-light-05nw3mzj.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-b0j3te0q.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-28qq62fn.js +0 -1
- package/dist/client/static/js/properties-qhvcxc13.js +0 -1
- package/dist/client/static/js/python-3qsrs510.js +0 -1
- package/dist/client/static/js/r-z2ng7mza.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-fyrcbpyd.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-9s62qncd.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-f7yjmhrk.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-sfrw8gkz.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-4mm4cern.js +0 -1
- package/dist/client/static/js/sql-ypk53ntb.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-d48g5gjf.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-a5vgg4gz.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-ctqhajgg.js +0 -1
- package/dist/client/static/js/tsx-zy7hb2hw.js +0 -1
- package/dist/client/static/js/typescript-2hr53c8j.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-ns7e0fqf.js +0 -1
- package/dist/client/static/js/xml-p4742r9b.js +0 -1
- package/dist/client/static/js/yaml-qbckg671.js +0 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The device split in the terminal's focus target.
|
|
8
|
+
*
|
|
9
|
+
* A phone types into the renderer's textarea (`beforeinput`); a hardware
|
|
10
|
+
* keyboard types into the container (`keydown`). Focusing the container on a
|
|
11
|
+
* phone is what left the keyboard closed and the first characters swallowed, so
|
|
12
|
+
* the two branches are pinned here — including the redirect that survives
|
|
13
|
+
* ghostty's own delayed container focus.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import type { Terminal } from 'ghostty-web';
|
|
19
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
20
|
+
import {
|
|
21
|
+
focusTerminal,
|
|
22
|
+
focusTerminalTextarea,
|
|
23
|
+
redirectSoftKeyboardFocus,
|
|
24
|
+
} from '@/client/components/workspace/terminal-panel/focus-target';
|
|
25
|
+
|
|
26
|
+
let win: Window;
|
|
27
|
+
let container: HTMLDivElement;
|
|
28
|
+
let textarea: HTMLTextAreaElement;
|
|
29
|
+
let containerFocuses = 0;
|
|
30
|
+
|
|
31
|
+
function setSoftKeyboardDevice(value: boolean): void {
|
|
32
|
+
win.matchMedia = ((query: string) => ({
|
|
33
|
+
matches: value && query === '(pointer: coarse)',
|
|
34
|
+
media: query,
|
|
35
|
+
onchange: null,
|
|
36
|
+
addListener() {},
|
|
37
|
+
removeListener() {},
|
|
38
|
+
addEventListener() {},
|
|
39
|
+
removeEventListener() {},
|
|
40
|
+
dispatchEvent: () => false,
|
|
41
|
+
})) as unknown as typeof win.matchMedia;
|
|
42
|
+
Object.defineProperty(win.navigator, 'maxTouchPoints', { value: 0, configurable: true });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function fakeTerminal(): Terminal {
|
|
46
|
+
return {
|
|
47
|
+
textarea,
|
|
48
|
+
focus() {
|
|
49
|
+
containerFocuses += 1;
|
|
50
|
+
container.focus();
|
|
51
|
+
},
|
|
52
|
+
} as unknown as Terminal;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
beforeAll(() => {
|
|
56
|
+
win = new Window({ url: 'http://localhost' });
|
|
57
|
+
installDomGlobals(win);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
afterEach(() => {
|
|
61
|
+
document.body.innerHTML = '';
|
|
62
|
+
containerFocuses = 0;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
afterAll(() => {
|
|
66
|
+
restoreDomGlobals();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
function mount(): void {
|
|
70
|
+
container = document.createElement('div');
|
|
71
|
+
container.tabIndex = 0;
|
|
72
|
+
textarea = document.createElement('textarea');
|
|
73
|
+
container.appendChild(textarea);
|
|
74
|
+
document.body.appendChild(container);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
describe('terminal focus target', () => {
|
|
78
|
+
test('a phone focuses the textarea, not the container', () => {
|
|
79
|
+
mount();
|
|
80
|
+
setSoftKeyboardDevice(true);
|
|
81
|
+
focusTerminal(fakeTerminal());
|
|
82
|
+
expect(document.activeElement).toBe(textarea);
|
|
83
|
+
expect(containerFocuses).toBe(0);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('a hardware keyboard focuses the container', () => {
|
|
87
|
+
mount();
|
|
88
|
+
setSoftKeyboardDevice(false);
|
|
89
|
+
focusTerminal(fakeTerminal());
|
|
90
|
+
expect(document.activeElement).toBe(container);
|
|
91
|
+
expect(containerFocuses).toBe(1);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('the textarea helper is a no-op on a desktop', () => {
|
|
95
|
+
mount();
|
|
96
|
+
setSoftKeyboardDevice(false);
|
|
97
|
+
focusTerminalTextarea(fakeTerminal());
|
|
98
|
+
expect(document.activeElement).not.toBe(textarea);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('a phone redirects the container focus ghostty schedules after open', () => {
|
|
102
|
+
mount();
|
|
103
|
+
setSoftKeyboardDevice(true);
|
|
104
|
+
const stop = redirectSoftKeyboardFocus(container, fakeTerminal());
|
|
105
|
+
container.focus();
|
|
106
|
+
expect(document.activeElement).toBe(textarea);
|
|
107
|
+
stop();
|
|
108
|
+
textarea.blur();
|
|
109
|
+
container.focus();
|
|
110
|
+
expect(document.activeElement).toBe(container);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test('a desktop keeps the container focus', () => {
|
|
114
|
+
mount();
|
|
115
|
+
setSoftKeyboardDevice(false);
|
|
116
|
+
const stop = redirectSoftKeyboardFocus(container, fakeTerminal());
|
|
117
|
+
container.focus();
|
|
118
|
+
expect(document.activeElement).toBe(container);
|
|
119
|
+
stop();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which element takes the terminal's focus, per device.
|
|
8
|
+
*
|
|
9
|
+
* ghostty-web focuses its CONTAINER (`tabindex=0`, `contenteditable`), which is
|
|
10
|
+
* the hardware-keyboard surface: its `keydown` listener is what encodes a
|
|
11
|
+
* physical key. A phone's input arrives as `beforeinput` on the renderer's
|
|
12
|
+
* textarea instead, and only an editable element that is focused can open the
|
|
13
|
+
* soft keyboard — focusing the container there left the keyboard closed and the
|
|
14
|
+
* panel needing a tap before it accepted a character.
|
|
15
|
+
*
|
|
16
|
+
* The second half is a race the vendor creates: `Terminal.open()` ends with
|
|
17
|
+
* `focus()`, and `Terminal.focus()` focuses the container and then focuses it
|
|
18
|
+
* AGAIN on a 0 ms timer. Focusing the textarea after `open()` therefore lost to
|
|
19
|
+
* that timer one tick later — measured on the phone layout: the textarea held
|
|
20
|
+
* focus at mount and the container owned it 12 ms after. A `focusin` redirect is
|
|
21
|
+
* event-driven, so it survives the timer and any later internal `focus()`;
|
|
22
|
+
* keydown still reaches the container because the textarea is its child.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { Terminal } from 'ghostty-web';
|
|
26
|
+
import { isSoftKeyboardDevice } from '@/client/hooks/ui/touch-device';
|
|
27
|
+
|
|
28
|
+
/** Focus whatever this device types into. */
|
|
29
|
+
export function focusTerminal(term: Terminal): void {
|
|
30
|
+
if (isSoftKeyboardDevice() && term.textarea) term.textarea.focus();
|
|
31
|
+
else term.focus();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Move the textarea's keyboard focus onto the terminal on a phone.
|
|
36
|
+
*
|
|
37
|
+
* A no-op on a desktop, where the container is the correct target and the
|
|
38
|
+
* padding click's caret behaviour is pinned by `terminal.e2e.ts`.
|
|
39
|
+
*/
|
|
40
|
+
export function focusTerminalTextarea(term: Terminal): void {
|
|
41
|
+
if (isSoftKeyboardDevice()) term.textarea?.focus();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Keep a soft-keyboard device's focus on the textarea. Returns the disposer.
|
|
46
|
+
*/
|
|
47
|
+
export function redirectSoftKeyboardFocus(container: HTMLElement, term: Terminal): () => void {
|
|
48
|
+
const redirect = (event: FocusEvent) => {
|
|
49
|
+
if (event.target !== container || !isSoftKeyboardDevice()) return;
|
|
50
|
+
term.textarea?.focus();
|
|
51
|
+
};
|
|
52
|
+
container.addEventListener('focusin', redirect);
|
|
53
|
+
return () => container.removeEventListener('focusin', redirect);
|
|
54
|
+
}
|
|
@@ -9,6 +9,7 @@ import { TerminalHeader } from '@/client/components/workspace/terminal-panel/Hea
|
|
|
9
9
|
import { TerminalQuickActions } from '@/client/components/workspace/terminal-panel/QuickActions';
|
|
10
10
|
import { TerminalKeyBar } from '@/client/components/workspace/terminal-panel/KeyBar';
|
|
11
11
|
import { RealtimeTerminalView, type RealtimeTerminalHandle } from '@/client/components/workspace/terminal-panel/RealtimeTerminalView';
|
|
12
|
+
import { releaseSoftKeyboard } from '@/client/lib/ui/soft-keyboard';
|
|
12
13
|
import {
|
|
13
14
|
NO_MODIFIERS,
|
|
14
15
|
applyModifiers,
|
|
@@ -62,7 +63,12 @@ export function TerminalPanel({ className = '', enabled = true, rootPath, showHe
|
|
|
62
63
|
* renderer's async mount (`focus.ts`).
|
|
63
64
|
*/
|
|
64
65
|
useEffect(() => {
|
|
65
|
-
if (!active || !enabled)
|
|
66
|
+
if (!active || !enabled) {
|
|
67
|
+
// The drawer armed the keyboard for a terminal that will not take focus
|
|
68
|
+
// (no workspace, a hidden view); do not leave it up over the placeholder.
|
|
69
|
+
releaseSoftKeyboard();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
66
72
|
terminalRef.current?.focus();
|
|
67
73
|
}, [active, enabled]);
|
|
68
74
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One ghostty-web terminal and the addons bound to it.
|
|
8
|
+
*
|
|
9
|
+
* Split from `mount.ts` so the mount lifecycle (import, observers, replay,
|
|
10
|
+
* focus) stays readable and this file owns only "make a terminal, wire it, tear
|
|
11
|
+
* it down". The caller supplies `wire` because the event handlers it installs
|
|
12
|
+
* close over the mount's own state (the replay gate, the grid announcer).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { FitAddon, Ghostty, Terminal } from 'ghostty-web';
|
|
16
|
+
import { installCellMetrics } from '@/client/components/workspace/terminal-panel/fonts';
|
|
17
|
+
import { installFullWidthFit } from '@/client/components/workspace/terminal-panel/fit';
|
|
18
|
+
import { focusTerminalTextarea } from '@/client/components/workspace/terminal-panel/focus-target';
|
|
19
|
+
import {
|
|
20
|
+
getTerminalTheme,
|
|
21
|
+
TERMINAL_FONT_FAMILY,
|
|
22
|
+
TERMINAL_FONT_SIZE,
|
|
23
|
+
TERMINAL_SCROLLBACK_BYTES,
|
|
24
|
+
} from '@/client/data/theme/terminal';
|
|
25
|
+
|
|
26
|
+
export interface TerminalInstance {
|
|
27
|
+
term: Terminal;
|
|
28
|
+
fitAddon: FitAddon;
|
|
29
|
+
disposables: { dispose(): void }[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function createTerminalInstance(
|
|
33
|
+
module: { Terminal: typeof Terminal; FitAddon: typeof FitAddon },
|
|
34
|
+
ghostty: Ghostty,
|
|
35
|
+
container: HTMLElement,
|
|
36
|
+
themeId: string,
|
|
37
|
+
wire: (instance: TerminalInstance) => void,
|
|
38
|
+
): TerminalInstance {
|
|
39
|
+
const term = new module.Terminal({
|
|
40
|
+
cursorBlink: true,
|
|
41
|
+
cursorStyle: 'block',
|
|
42
|
+
fontSize: TERMINAL_FONT_SIZE,
|
|
43
|
+
fontFamily: TERMINAL_FONT_FAMILY,
|
|
44
|
+
theme: getTerminalTheme(themeId),
|
|
45
|
+
// A byte budget, not xterm's line count. See `theme/terminal.ts`.
|
|
46
|
+
scrollback: TERMINAL_SCROLLBACK_BYTES,
|
|
47
|
+
// No `convertEol`: the PTY already emits CRLF, and converting a lone LF
|
|
48
|
+
// would re-introduce the line-feed doubling a real terminal avoids.
|
|
49
|
+
smoothScrollDuration: 0,
|
|
50
|
+
ghostty,
|
|
51
|
+
});
|
|
52
|
+
term.open(container);
|
|
53
|
+
installCellMetrics(term);
|
|
54
|
+
// The WASM allocator reuses pages: a fresh terminal can inherit the previous
|
|
55
|
+
// screen's cells until something overwrites them. Clear before the first byte
|
|
56
|
+
// is shown.
|
|
57
|
+
term.clear();
|
|
58
|
+
// Only when the container is really on screen: the desktop mounts every view
|
|
59
|
+
// hidden, and a hidden terminal must not take focus (or a keyboard).
|
|
60
|
+
if (container.clientWidth > 0) focusTerminalTextarea(term);
|
|
61
|
+
const fitAddon = new module.FitAddon();
|
|
62
|
+
term.loadAddon(fitAddon);
|
|
63
|
+
installFullWidthFit(fitAddon, term);
|
|
64
|
+
const instance: TerminalInstance = { term, fitAddon, disposables: [] };
|
|
65
|
+
wire(instance);
|
|
66
|
+
return instance;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function disposeTerminalInstance(instance: TerminalInstance | null): void {
|
|
70
|
+
if (!instance) return;
|
|
71
|
+
for (const disposable of instance.disposables) {
|
|
72
|
+
try {
|
|
73
|
+
disposable.dispose();
|
|
74
|
+
} catch {}
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
instance.fitAddon.dispose();
|
|
78
|
+
} catch {}
|
|
79
|
+
try {
|
|
80
|
+
instance.term.dispose();
|
|
81
|
+
} catch {}
|
|
82
|
+
}
|
|
@@ -37,24 +37,28 @@
|
|
|
37
37
|
* pages and can hand a fresh terminal the previous screen's cells.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
import type {
|
|
40
|
+
import type { Ghostty } from 'ghostty-web';
|
|
41
41
|
import { terminalInputFrame } from '@/shared/lib/workspace/terminal/input';
|
|
42
42
|
import {
|
|
43
|
-
installCellMetrics,
|
|
44
43
|
remeasureTerminal,
|
|
45
44
|
waitForTerminalFonts,
|
|
46
45
|
watchTerminalFonts,
|
|
47
46
|
} from '@/client/components/workspace/terminal-panel/fonts';
|
|
48
|
-
import { installFullWidthFit } from '@/client/components/workspace/terminal-panel/fit';
|
|
49
47
|
import { createGridAnnouncer } from '@/client/components/workspace/terminal-panel/grid';
|
|
50
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
attachTouchScroll,
|
|
50
|
+
handleKeyNavigation,
|
|
51
|
+
} from '@/client/components/workspace/terminal-panel/navigation';
|
|
51
52
|
import { holdAcrossWrite, watchPointerPress } from '@/client/components/workspace/terminal-panel/scroll-hold';
|
|
52
53
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
focusTerminal,
|
|
55
|
+
redirectSoftKeyboardFocus,
|
|
56
|
+
} from '@/client/components/workspace/terminal-panel/focus-target';
|
|
57
|
+
import {
|
|
58
|
+
createTerminalInstance,
|
|
59
|
+
disposeTerminalInstance,
|
|
60
|
+
type TerminalInstance,
|
|
61
|
+
} from '@/client/components/workspace/terminal-panel/instance';
|
|
58
62
|
|
|
59
63
|
export interface TerminalMountCallbacks {
|
|
60
64
|
/** Keystrokes, paste, mouse reports — straight to the PTY. */
|
|
@@ -95,12 +99,6 @@ export interface TerminalMount {
|
|
|
95
99
|
dispose: () => void;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
interface TerminalInstance {
|
|
99
|
-
term: Terminal;
|
|
100
|
-
fitAddon: FitAddon;
|
|
101
|
-
disposables: { dispose(): void }[];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
102
|
/**
|
|
105
103
|
* Mount the terminal inside `container`. Resolves to null when the module could
|
|
106
104
|
* not be loaded or the component unmounted while importing.
|
|
@@ -134,6 +132,9 @@ export async function mountTerminal(
|
|
|
134
132
|
// one.
|
|
135
133
|
term.attachCustomKeyEventHandler((event: globalThis.KeyboardEvent) => handleKeyNavigation(term, event));
|
|
136
134
|
instance.disposables.push(
|
|
135
|
+
// ghostty's own `open()` re-focuses the container on a timer; see
|
|
136
|
+
// `focus-target.ts` for why a phone's textarea needs this redirect.
|
|
137
|
+
{ dispose: redirectSoftKeyboardFocus(container, term) },
|
|
137
138
|
term.onScroll((viewportY: number) => callbacks.onScrolledUpChange(viewportY > 0)),
|
|
138
139
|
term.onData((data: string) => {
|
|
139
140
|
const frame = terminalInputFrame(data);
|
|
@@ -153,49 +154,6 @@ export async function mountTerminal(
|
|
|
153
154
|
);
|
|
154
155
|
};
|
|
155
156
|
|
|
156
|
-
const create = (nextThemeId: string): TerminalInstance => {
|
|
157
|
-
const term = new module.Terminal({
|
|
158
|
-
cursorBlink: true,
|
|
159
|
-
cursorStyle: 'block',
|
|
160
|
-
fontSize: TERMINAL_FONT_SIZE,
|
|
161
|
-
fontFamily: TERMINAL_FONT_FAMILY,
|
|
162
|
-
theme: getTerminalTheme(nextThemeId),
|
|
163
|
-
// A byte budget, not xterm's line count. See `theme/terminal.ts`.
|
|
164
|
-
scrollback: TERMINAL_SCROLLBACK_BYTES,
|
|
165
|
-
// No `convertEol`: the PTY already emits CRLF, and converting a lone LF
|
|
166
|
-
// would re-introduce the line-feed doubling a real terminal avoids.
|
|
167
|
-
smoothScrollDuration: 0,
|
|
168
|
-
ghostty: ghostty as Ghostty,
|
|
169
|
-
});
|
|
170
|
-
term.open(container);
|
|
171
|
-
installCellMetrics(term);
|
|
172
|
-
// The WASM allocator reuses pages: a fresh terminal can inherit the previous
|
|
173
|
-
// screen's cells until something overwrites them. Clear before the first
|
|
174
|
-
// byte is shown.
|
|
175
|
-
term.clear();
|
|
176
|
-
const fitAddon = new module.FitAddon();
|
|
177
|
-
term.loadAddon(fitAddon);
|
|
178
|
-
installFullWidthFit(fitAddon, term);
|
|
179
|
-
const instance: TerminalInstance = { term, fitAddon, disposables: [] };
|
|
180
|
-
wire(instance);
|
|
181
|
-
return instance;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
const disposeInstance = (instance: TerminalInstance | null): void => {
|
|
185
|
-
if (!instance) return;
|
|
186
|
-
for (const disposable of instance.disposables) {
|
|
187
|
-
try {
|
|
188
|
-
disposable.dispose();
|
|
189
|
-
} catch {}
|
|
190
|
-
}
|
|
191
|
-
try {
|
|
192
|
-
instance.fitAddon.dispose();
|
|
193
|
-
} catch {}
|
|
194
|
-
try {
|
|
195
|
-
instance.term.dispose();
|
|
196
|
-
} catch {}
|
|
197
|
-
};
|
|
198
|
-
|
|
199
157
|
/**
|
|
200
158
|
* Fit to the container. Returns false when no fit was possible — the panel is
|
|
201
159
|
* hidden, or the cell has not been measured yet — which is what keeps the
|
|
@@ -259,7 +217,7 @@ export async function mountTerminal(
|
|
|
259
217
|
|
|
260
218
|
const pointer = watchPointerPress(container);
|
|
261
219
|
|
|
262
|
-
current =
|
|
220
|
+
current = createTerminalInstance(module, ghostty as Ghostty, container, currentThemeId, wire);
|
|
263
221
|
safeFit();
|
|
264
222
|
grid.schedule();
|
|
265
223
|
|
|
@@ -309,7 +267,8 @@ export async function mountTerminal(
|
|
|
309
267
|
safeFit();
|
|
310
268
|
},
|
|
311
269
|
focus() {
|
|
312
|
-
current?.term
|
|
270
|
+
const term = current?.term;
|
|
271
|
+
if (term) focusTerminal(term);
|
|
313
272
|
},
|
|
314
273
|
applicationCursorKeys() {
|
|
315
274
|
return current?.term.wasmTerm?.getMode(1, false) ?? false;
|
|
@@ -326,8 +285,8 @@ export async function mountTerminal(
|
|
|
326
285
|
setTheme(nextThemeId: string) {
|
|
327
286
|
if (disposed || nextThemeId === currentThemeId) return;
|
|
328
287
|
currentThemeId = nextThemeId;
|
|
329
|
-
|
|
330
|
-
current =
|
|
288
|
+
disposeTerminalInstance(current);
|
|
289
|
+
current = createTerminalInstance(module, ghostty as Ghostty, container, nextThemeId, wire);
|
|
331
290
|
safeFit();
|
|
332
291
|
},
|
|
333
292
|
dispose() {
|
|
@@ -339,7 +298,7 @@ export async function mountTerminal(
|
|
|
339
298
|
touch();
|
|
340
299
|
pointer.stop();
|
|
341
300
|
resizeObserver.disconnect();
|
|
342
|
-
|
|
301
|
+
disposeTerminalInstance(current);
|
|
343
302
|
current = null;
|
|
344
303
|
},
|
|
345
304
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The terminal is the one built-in panel that is typed into, so it is the one
|
|
8
|
+
* that needs the soft keyboard open before its view mounts.
|
|
9
|
+
*
|
|
10
|
+
* The phone shell arms it at the moment of the tap, before the view exists; the
|
|
11
|
+
* drawer releases the bridge (`lib/ui/soft-keyboard.ts`) when the panel it
|
|
12
|
+
* actually resolved is not the terminal — a stored tab the user has since
|
|
13
|
+
* disabled or moved, or a session with no workspace, must not leave the keyboard
|
|
14
|
+
* up over another view.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { openSoftKeyboard } from '@/client/lib/ui/soft-keyboard';
|
|
18
|
+
|
|
19
|
+
/** The built-in id of this panel (`RIGHT_PANEL_TYPES`), spelled once here. */
|
|
20
|
+
const TERMINAL_PANEL_ID = 'terminal';
|
|
21
|
+
|
|
22
|
+
export function panelWantsSoftKeyboard(panelKey: string | null | undefined): boolean {
|
|
23
|
+
return panelKey === TERMINAL_PANEL_ID;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Arm the keyboard for the panel about to open; a no-op for every other view. */
|
|
27
|
+
export function armTerminalSoftKeyboard(panelKey: string | null | undefined): void {
|
|
28
|
+
if (panelWantsSoftKeyboard(panelKey)) openSoftKeyboard();
|
|
29
|
+
}
|
|
@@ -24,18 +24,23 @@ import { useEffect, useState } from 'preact/hooks';
|
|
|
24
24
|
const COARSE_POINTER_QUERY = '(pointer: coarse)';
|
|
25
25
|
const NO_HOVER_QUERY = '(hover: none)';
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The same verdict the hook reports, for code that runs outside a render — the
|
|
29
|
+
* terminal's focus target and the soft-keyboard bridge both need it at the
|
|
30
|
+
* moment of a tap, not at the moment of a render.
|
|
31
|
+
*/
|
|
32
|
+
export function isSoftKeyboardDevice(): boolean {
|
|
28
33
|
if (typeof window === 'undefined') return false;
|
|
29
34
|
if (window.matchMedia(COARSE_POINTER_QUERY).matches) return true;
|
|
30
35
|
return navigator.maxTouchPoints > 0 && window.matchMedia(NO_HOVER_QUERY).matches;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
export function useTouchDevice(): boolean {
|
|
34
|
-
const [isTouch, setIsTouch] = useState(
|
|
39
|
+
const [isTouch, setIsTouch] = useState(isSoftKeyboardDevice);
|
|
35
40
|
|
|
36
41
|
useEffect(() => {
|
|
37
42
|
const queries = [COARSE_POINTER_QUERY, NO_HOVER_QUERY].map((q) => window.matchMedia(q));
|
|
38
|
-
const update = () => setIsTouch(
|
|
43
|
+
const update = () => setIsTouch(isSoftKeyboardDevice());
|
|
39
44
|
for (const query of queries) query.addEventListener('change', update);
|
|
40
45
|
return () => {
|
|
41
46
|
for (const query of queries) query.removeEventListener('change', update);
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The phone's right-click: a long press opens the same visibility menu the
|
|
8
|
+
* desktop rails and navbar open on `contextmenu`.
|
|
9
|
+
*
|
|
10
|
+
* Four rules, each a way the gesture would otherwise misbehave:
|
|
11
|
+
*
|
|
12
|
+
* 1. **A right-click still works.** A desktop showing the phone layout keeps
|
|
13
|
+
* the menu it had, anchored to the surface rather than to the pixel.
|
|
14
|
+
* 2. **A hold opens at the press point.** There is no cursor to anchor to.
|
|
15
|
+
* 3. **The click the same gesture produces is swallowed.** Lifting the finger
|
|
16
|
+
* after the menu opened must not also press the control underneath.
|
|
17
|
+
* 4. **A press that moves is a scroll.** The surface is a scroller on a phone;
|
|
18
|
+
* a flick that starts on it must not open a menu.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from 'bun:test';
|
|
22
|
+
import { Window } from 'happy-dom';
|
|
23
|
+
import { h, render } from 'preact';
|
|
24
|
+
import { act } from 'preact/test-utils';
|
|
25
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
26
|
+
import {
|
|
27
|
+
useVisibilityMenuTrigger,
|
|
28
|
+
type VisibilityMenuTrigger,
|
|
29
|
+
} from '@/client/hooks/ui/visibility-menu-trigger';
|
|
30
|
+
|
|
31
|
+
let win: Window;
|
|
32
|
+
let container: HTMLElement;
|
|
33
|
+
let trigger: VisibilityMenuTrigger | null = null;
|
|
34
|
+
let clicks = 0;
|
|
35
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
vi.useFakeTimers();
|
|
38
|
+
win = new Window({ url: 'http://localhost' });
|
|
39
|
+
installDomGlobals(win);
|
|
40
|
+
container = document.createElement('div');
|
|
41
|
+
document.body.appendChild(container);
|
|
42
|
+
trigger = null;
|
|
43
|
+
clicks = 0;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
render(null, container);
|
|
48
|
+
container.remove();
|
|
49
|
+
restoreDomGlobals();
|
|
50
|
+
vi.useRealTimers();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/** Mount the hook on a surface with one child control. */
|
|
54
|
+
async function mount(coarse: boolean): Promise<void> {
|
|
55
|
+
win.matchMedia = ((query: string) => ({
|
|
56
|
+
matches: coarse && query === '(pointer: coarse)',
|
|
57
|
+
media: query,
|
|
58
|
+
onchange: null,
|
|
59
|
+
addEventListener: () => {},
|
|
60
|
+
removeEventListener: () => {},
|
|
61
|
+
addListener: () => {},
|
|
62
|
+
removeListener: () => {},
|
|
63
|
+
dispatchEvent: () => false,
|
|
64
|
+
})) as unknown as typeof win.matchMedia;
|
|
65
|
+
|
|
66
|
+
const Probe = () => {
|
|
67
|
+
trigger = useVisibilityMenuTrigger();
|
|
68
|
+
return h(
|
|
69
|
+
'div',
|
|
70
|
+
{ 'data-testid': 'surface', ...trigger.surfaceProps },
|
|
71
|
+
h('button', { 'data-testid': 'child', onClick: () => { clicks += 1; } }, 'child'),
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
await act(async () => {
|
|
75
|
+
render(h(Probe, {}), container);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** A touch event carrying one finger at `(x, y)`. */
|
|
80
|
+
function touch(type: string, x: number, y: number): globalThis.TouchEvent {
|
|
81
|
+
const event = new win.Event(type, { bubbles: true, cancelable: true }) as unknown as globalThis.TouchEvent;
|
|
82
|
+
Object.defineProperty(event, 'touches', {
|
|
83
|
+
value: type === 'touchend' || type === 'touchcancel' ? [] : [{ clientX: x, clientY: y }],
|
|
84
|
+
});
|
|
85
|
+
return event;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
describe('useVisibilityMenuTrigger', () => {
|
|
89
|
+
test('a right-click anchors the menu to the surface', async () => {
|
|
90
|
+
await mount(false);
|
|
91
|
+
(container.querySelector('[data-testid="surface"]') as HTMLElement).getBoundingClientRect = () => ({
|
|
92
|
+
top: 10, bottom: 50, left: 20, right: 120, width: 100, height: 40, x: 20, y: 10,
|
|
93
|
+
toJSON: () => ({}),
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
act(() => {
|
|
97
|
+
(container.querySelector('[data-testid="surface"]') as HTMLElement).dispatchEvent(new win.MouseEvent('contextmenu', { bubbles: true, cancelable: true }) as unknown as Event);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
expect(trigger!.anchor).toEqual({ top: 10, bottom: 50, left: 20, right: 120 });
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('a hold opens the menu at the press point and swallows the click', async () => {
|
|
104
|
+
await mount(true);
|
|
105
|
+
|
|
106
|
+
act(() => {
|
|
107
|
+
(container.querySelector('[data-testid="surface"]') as HTMLElement).dispatchEvent(touch('touchstart', 30, 40));
|
|
108
|
+
});
|
|
109
|
+
await act(async () => {
|
|
110
|
+
vi.advanceTimersByTime(450);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
expect(trigger!.anchor).toEqual({ top: 40, bottom: 40, left: 30, right: 30 });
|
|
114
|
+
|
|
115
|
+
act(() => {
|
|
116
|
+
(container.querySelector('[data-testid="child"]') as HTMLElement).dispatchEvent(new win.MouseEvent('click', { bubbles: true, cancelable: true }) as unknown as Event);
|
|
117
|
+
});
|
|
118
|
+
expect(clicks).toBe(0);
|
|
119
|
+
|
|
120
|
+
// The suppression is one-shot: the next tap is the user's own.
|
|
121
|
+
act(() => {
|
|
122
|
+
(container.querySelector('[data-testid="child"]') as HTMLElement).dispatchEvent(new win.MouseEvent('click', { bubbles: true, cancelable: true }) as unknown as Event);
|
|
123
|
+
});
|
|
124
|
+
expect(clicks).toBe(1);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('a press that moves is a scroll, not a menu', async () => {
|
|
128
|
+
await mount(true);
|
|
129
|
+
|
|
130
|
+
act(() => {
|
|
131
|
+
(container.querySelector('[data-testid="surface"]') as HTMLElement).dispatchEvent(touch('touchstart', 30, 40));
|
|
132
|
+
});
|
|
133
|
+
act(() => {
|
|
134
|
+
(container.querySelector('[data-testid="surface"]') as HTMLElement).dispatchEvent(touch('touchmove', 60, 40));
|
|
135
|
+
});
|
|
136
|
+
await act(async () => {
|
|
137
|
+
vi.advanceTimersByTime(450);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
expect(trigger!.anchor).toBeNull();
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
test('a mouse hold does not open the menu', async () => {
|
|
144
|
+
await mount(false);
|
|
145
|
+
|
|
146
|
+
act(() => {
|
|
147
|
+
(container.querySelector('[data-testid="surface"]') as HTMLElement).dispatchEvent(touch('touchstart', 30, 40));
|
|
148
|
+
});
|
|
149
|
+
await act(async () => {
|
|
150
|
+
vi.advanceTimersByTime(450);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
expect(trigger!.anchor).toBeNull();
|
|
154
|
+
});
|
|
155
|
+
});
|