@wular/coder 0.3.18 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -16
- package/bin/coder.mjs +3 -1
- package/dist/actions-Mk3FSlpJ.js +20 -0
- package/dist/adapter-B0oYCI0S.js +1 -0
- package/dist/adapter-BKVzTDnn.js +1 -0
- package/dist/adapter-DPInwbJG.js +1 -0
- package/dist/adapter-DaiJMOYo.js +1 -0
- package/dist/adapter-PeKziOUg.js +1 -0
- package/dist/add-BxpLHnvD.js +1 -0
- package/dist/add-CE-70LFs.js +1 -0
- package/dist/add-U-pty9qJ.js +6 -0
- package/dist/add-ej0X9e3a.js +1 -0
- package/dist/add-json-CEa-6luW.js +1 -0
- package/dist/agent-BsYx3Odz.js +3 -0
- package/dist/agent-JdtZozvP.js +1 -0
- package/dist/alias-DX-Bm86x.js +2 -0
- package/dist/app-BT5f7zL5.js +1 -0
- package/dist/approvals-C-AvFt6s.js +2 -0
- package/dist/approve-DOmpQRNd.js +2 -0
- package/dist/apps-CjfrZyM5.js +1 -0
- package/dist/archive-BUB8gFKD.js +4 -0
- package/dist/archive-BziJ1rQ-.js +3 -0
- package/dist/archive-sweep-CtBcARgN.js +1 -0
- package/dist/args-BOEEdpWk.js +1 -0
- package/dist/ask-dE3U3ss2.js +4 -0
- package/dist/auth-BFny--17.js +1 -0
- package/dist/auth-DWHIzqbA.js +1 -0
- package/dist/builtin/coder/agent.json +24 -0
- package/dist/builtin/coder/system.md +17 -0
- package/dist/chat-3Znsevah.js +1 -0
- package/dist/chat-B_yhNTo0.js +13 -0
- package/dist/chat-bridge-BS9WtP3X.js +2 -0
- package/dist/cli-BilSDkvE.js +9 -0
- package/dist/cli.d.ts +71 -1
- package/dist/cli.js +1 -91
- package/dist/client-D9IoAuDD.js +1 -0
- package/dist/config-Da_cwoxI.js +3 -0
- package/dist/create-C_iMJV4Y.js +1 -0
- package/dist/credentials-B1jv6dkg.js +1 -0
- package/dist/dash/manifest.json +3427 -0
- package/dist/dash/public/assets/apple-touch-icon.png +0 -0
- package/dist/dash/public/assets/chunks/agent-pills-c9c4ac4d4a10df83.js +1 -0
- package/dist/dash/public/assets/chunks/agent-settings-form-8be2ddab074aba6d.js +1 -0
- package/dist/dash/public/assets/chunks/agents-grid-951584b6f4c4314e.js +1 -0
- package/dist/dash/public/assets/chunks/badge-676b01e0c615bf7b.js +1 -0
- package/dist/dash/public/assets/chunks/card-e0901d68b79dfa93.js +1 -0
- package/dist/dash/public/assets/chunks/combo-41234c24668b1db1.js +1 -0
- package/dist/dash/public/assets/chunks/composer-5534be50bc12385e.js +1 -0
- package/dist/dash/public/assets/chunks/composer-d10d4b1d54c4f751.js +1 -0
- package/dist/dash/public/assets/chunks/composer-data-6f7608fed13f3dd7.js +1 -0
- package/dist/dash/public/assets/chunks/confirm-f2fe4ba9905a89c6.js +1 -0
- package/dist/dash/public/assets/chunks/connect-apps-aa2a3d82e48ed8c3.js +1 -0
- package/dist/dash/public/assets/chunks/connect-repositories-5389ec8701a3deac.js +1 -0
- package/dist/dash/public/assets/chunks/credentials-list-bc5bfcab058176c5.js +2 -0
- package/dist/dash/public/assets/chunks/custom-range-4761ab14f05149df.js +1 -0
- package/dist/dash/public/assets/chunks/editor-bfe8cd854f8001be.js +7 -0
- package/dist/dash/public/assets/chunks/engines-list-f1191390f5715b39.js +1 -0
- package/dist/dash/public/assets/chunks/field-901f1f35c18c39c9.js +1 -0
- package/dist/dash/public/assets/chunks/format-eb03fc9d9744d960.js +1 -0
- package/dist/dash/public/assets/chunks/heads-f3bcd289663d48fa.js +1 -0
- package/dist/dash/public/assets/chunks/instructions-052fa45a9daf6db6.js +2 -0
- package/dist/dash/public/assets/chunks/instructions-d0a4b0d95009c262.js +1 -0
- package/dist/dash/public/assets/chunks/list-1d259660d7612c5f.js +1 -0
- package/dist/dash/public/assets/chunks/mcp-list-e3bebbbe831393b8.js +1 -0
- package/dist/dash/public/assets/chunks/model-options-15c53331a2f28a4f.js +1 -0
- package/dist/dash/public/assets/chunks/models-list-44f857a469ca04d5.js +1 -0
- package/dist/dash/public/assets/chunks/paged-bc6fa0c2b9d52ed7.js +1 -0
- package/dist/dash/public/assets/chunks/platform-actions-d1426602049926d2.js +1 -0
- package/dist/dash/public/assets/chunks/runners-list-1901af8a5dea1f09.js +1 -0
- package/dist/dash/public/assets/chunks/runtime-246221e985d863e5-1.js +2 -0
- package/dist/dash/public/assets/chunks/segmented-358ff2b4992b8384.js +1 -0
- package/dist/dash/public/assets/chunks/select-7ae25fd8a7d6c338.js +1 -0
- package/dist/dash/public/assets/chunks/sentinel-c972a33dc69a5135.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-246221e985d863e5-2.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-88cce66bb3cfe1e5.js +5 -0
- package/dist/dash/public/assets/chunks/shared-init-8f2ac936c95a7f7b.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-ffb3397e494137c9.js +2 -0
- package/dist/dash/public/assets/chunks/tail-7c27aab8ba268bd9.js +1 -0
- package/dist/dash/public/assets/chunks/task-actions-8e1d93c788d001df.js +1 -0
- package/dist/dash/public/assets/chunks/task-fa8b82e95e771c4a.js +1 -0
- package/dist/dash/public/assets/chunks/task-view-6d7618d2820a5cb4.js +3 -0
- package/dist/dash/public/assets/chunks/tasks-list-f4784e5cbd0ed785.js +1 -0
- package/dist/dash/public/assets/chunks/toolbar-a75d2570f07cbb70.js +1 -0
- package/dist/dash/public/assets/chunks/versions-list-fc2e0d2a7382e049.js +1 -0
- package/dist/dash/public/assets/chunks/wular-pnext-246221e985d863e5-0.js +1 -0
- package/dist/dash/public/assets/connect-382b1729a7ae7808.css +1 -0
- package/dist/dash/public/assets/dash-9e02d5d1a6d42ee3.css +1 -0
- package/dist/dash/public/assets/dash-account-04859899c1838ada.css +1 -0
- package/dist/dash/public/assets/dash-agents-9e678137267dec07.css +1 -0
- package/dist/dash/public/assets/dash-agents-new-26fa27b17ef9b8d8.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-b975c48f8abf3444.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-edit-e13fda599bb04843.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-platforms-70292932cb27bc96.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-settings-71f9a86251723fcc.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-tasks-fb8eb2ed71006601.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-usage-7c8740f1cdd52c71.css +1 -0
- package/dist/dash/public/assets/dash-settings-8eb818da462227e8.css +1 -0
- package/dist/dash/public/assets/dash-settings-param-tab-849a1a9542e273f5.css +1 -0
- package/dist/dash/public/assets/dash-tasks-81e510e0b6931b42.css +1 -0
- package/dist/dash/public/assets/dash-tasks-param-id-bbd2a83342f2ec10.css +1 -0
- package/dist/dash/public/assets/dash-usage-8e0259e03eaed1bd.css +1 -0
- package/dist/dash/public/assets/favicon.ico +0 -0
- package/dist/dash/public/assets/favicon.svg +1 -0
- package/dist/dash/public/assets/fonts/LICENSE-fira-code +93 -0
- package/dist/dash/public/assets/fonts/fira-code-latin-400-normal-717ee080.woff2 +0 -0
- package/dist/dash/public/assets/fonts/fira-code-latin-500-normal-530b6706.woff2 +0 -0
- package/dist/dash/public/assets/fonts/fira-code-latin-700-normal-98730669.woff2 +0 -0
- package/dist/dash/public/assets/global-d2adbf01910d9df5.css +1 -0
- package/dist/dash/public/assets/login-c129b1ce237be260.css +1 -0
- package/dist/dash/public/assets/pnext-client-03b03b254e525e82.js +1 -0
- package/dist/dash/public/assets/pnext-client-1b9ab0963a8ff77b.js +1 -0
- package/dist/dash/public/assets/pnext-client-1c7859bb888f4ef0.js +1 -0
- package/dist/dash/public/assets/pnext-client-3c748afe963fb05d.js +1 -0
- package/dist/dash/public/assets/pnext-client-4f47c2cae220f107.js +1 -0
- package/dist/dash/public/assets/pnext-client-6ab9fd9b53b794d2.js +1 -0
- package/dist/dash/public/assets/pnext-client-6c241786342498e4.js +1 -0
- package/dist/dash/public/assets/pnext-client-80b56d420f02b808.js +1 -0
- package/dist/dash/public/assets/pnext-client-83135c17bae850a3.js +1 -0
- package/dist/dash/public/assets/pnext-client-8e6fa4302ae0396f.js +1 -0
- package/dist/dash/public/assets/pnext-client-932c9d8cc0717fc8.js +1 -0
- package/dist/dash/public/assets/pnext-client-a42ae63d4de113f9.js +1 -0
- package/dist/dash/public/assets/pnext-client-d2ee6f8c1e337032.js +1 -0
- package/dist/dash/public/assets/pnext-client-d513f65ec23b7f20.js +1 -0
- package/dist/dash/public/assets/pnext-client-ecb88e2a8a109954.js +1 -0
- package/dist/dash/public/assets/pnext-client-f1545ee6270bbf9a.js +1 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/boot-B2MFTRO2.js +30 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/build-tier-XJJSL5FR.js +2704 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2HFY3DQT.js +208 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2ICEVELW.js +834 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-3UPROT2C.js +35 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4P5CMIYT.js +1582 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4TKZKZ3Q.js +131 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-5RDEILQB.js +437 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-62KEQM43.js +25 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-6KQSWT6D.js +831 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-7DCNCW6O.js +724 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-B4THCTQP.js +22 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-C2LIV2MM.js +172 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-CCATPVTW.js +378 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-COXJAPTU.js +89 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-E6IXL2NJ.js +6270 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FLGRBFAH.js +1198 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FTJVHFWD.js +61 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-H523KSIH.js +5151 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-HT6KKX6A.js +20 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JESFYECC.js +438 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JRPJM2XY.js +17 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L2IWDUXG.js +107 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L5P4Y4UC.js +183 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-NQE46AZN.js +647 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PA4QEARJ.js +129 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PZ5AXOLW.js +7146 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-SNVPTULL.js +2397 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-T3QZT3PG.js +220 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-VC5O2SDP.js +72 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-WZX4V6CM.js +231 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-XUUIDXY5.js +627 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-ZHFDO3PR.js +265 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/compile-CE2DN7ZA.js +18 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-UREY7XJT.js +16 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-loader-UI2XE3PZ.js +17 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/entry.js +219 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/generate-I2PPTDFD.js +16 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/modules-UVOCE4C2.js +48 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/pipeline-UW47K537.js +963 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/proxy-ITGOVJBW.js +26 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/register-4SA55SWT.js +12579 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/router-JNKHLBCZ.js +505 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/routes-PD6J2NXW.js +54 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/tsconfig-defaults-ZXEH7RQK.js +15 -0
- package/dist/default-Bobztoxf.js +1 -0
- package/dist/default-vYPT26DR.js +1 -0
- package/dist/delete-D8gEwoOj.js +4 -0
- package/dist/delete-z1_86nf6.js +2 -0
- package/dist/disable-DVKd-0Xb.js +1 -0
- package/dist/discover-Df-a8K4R.js +3 -0
- package/dist/discover-Dvr_3_Xr.js +1 -0
- package/dist/dispatch-BKeAch9E.js +14 -0
- package/dist/docs-BX65z2Iu.js +2 -0
- package/dist/docs-DKJnqZqt.js +2 -0
- package/dist/enable-C8Zf_wpN.js +1 -0
- package/dist/env-CRf6wkM2.js +1 -0
- package/dist/exec-RZFLclKX.js +11 -0
- package/dist/executor-BvAA7Cgw.js +10 -0
- package/dist/flow/builtin/review.d.ts +157 -0
- package/dist/flow/builtin/review.js +19 -0
- package/dist/flow/index.d.ts +1 -1
- package/dist/flow/index.js +1 -1
- package/dist/flow-17k25MHt.js +1 -0
- package/dist/github-actions-DwUzm4hC.js +24 -0
- package/dist/http-Bkg_OQ6r.js +1 -0
- package/dist/{index-BQ-b77or.d.ts → index-CZjFX5zV.d.ts} +116 -238
- package/dist/init-CoMfFxbG.js +1 -0
- package/dist/integrations-5xCaXSd-.js +1 -0
- package/dist/integrations-BAgdVDhj.js +5 -0
- package/dist/lib/broker.js +3 -3
- package/dist/list-BAKvxSbh.js +4 -0
- package/dist/list-BYiG8Zav.js +2 -0
- package/dist/list-BxEywhHU.js +1 -0
- package/dist/list-C5w01-8q.js +1 -0
- package/dist/list-CIW2joV1.js +1 -0
- package/dist/list-DX-z3SBp.js +3 -0
- package/dist/list-DpCf4G-H.js +4 -0
- package/dist/list-VToARh3C.js +1 -0
- package/dist/load-BpEsAn51.js +2 -0
- package/dist/local-H3uvqEbq.js +1 -0
- package/dist/log-view-dg0TlKLA.js +1 -0
- package/dist/login-BFxX4jJy.js +1 -0
- package/dist/login-DkkslfBx.js +1 -0
- package/dist/logout-BHAtw4Z8.js +1 -0
- package/dist/maintenance-C5FklUw3.js +1 -0
- package/dist/match-CXAjDhg7.js +1 -0
- package/dist/mcp-BgKb2Cdk.js +1 -0
- package/dist/mcp-CCZOAo06.js +1 -0
- package/dist/mcp-server-DGzme0YX.js +1 -0
- package/dist/migrate-C4vM7DQN.js +2 -0
- package/dist/migrate-N-85_N7J.js +1 -0
- package/dist/model-Bs1StDo3.js +1 -0
- package/dist/models-_5LVGC3m.js +1 -0
- package/dist/output-BKeyLbvt.js +5 -0
- package/dist/prompt-CEuBMNhk.js +7 -0
- package/dist/push-CUC55Bqd.js +1 -0
- package/dist/queue-6io_NOP3.js +116 -0
- package/dist/refresh-BIrmrWYq.js +1 -0
- package/dist/remote-miQNTVRa.js +1 -0
- package/dist/remove-B93LNkZI.js +1 -0
- package/dist/remove-C5_xggx7.js +1 -0
- package/dist/remove-CuH8a3L9.js +1 -0
- package/dist/remove-eQ8y5C5p.js +1 -0
- package/dist/rename-CYfy03FE.js +1 -0
- package/dist/result-BEtQZHaY.js +5 -0
- package/dist/result-BzaM3inj.js +15 -0
- package/dist/resume-DYzKvyEw.js +3 -0
- package/dist/review-oIBeECZE.js +7 -0
- package/dist/rolldown-runtime-DT7IzrpZ.js +1 -0
- package/dist/rotate-key-IdMYH7gg.js +1 -0
- package/dist/run-BDYl0CKl.js +2 -0
- package/dist/run-CTtd0Znc.js +5 -0
- package/dist/run-CawRGnOg.js +2 -0
- package/dist/runner-D7ScbIHJ.js +1 -0
- package/dist/runner-sUpWJ_k0.js +1 -0
- package/dist/schema-CU2iFkp8.js +1 -0
- package/dist/sdk.d.ts +1166 -191
- package/dist/sdk.js +1 -1
- package/dist/serve-BTeomYxW.js +1 -0
- package/dist/serve-CE8YV2e9.js +1 -0
- package/dist/serve-CPnmrKyf.js +2 -0
- package/dist/serve-CQKZxzFE.js +4 -0
- package/dist/serve-GmRO89s5.js +12 -0
- package/dist/server-Kb22cWfF.js +1 -0
- package/dist/setup-host-GFTUzzZJ.js +6 -0
- package/dist/shared-DVtzWhUT.js +1 -0
- package/dist/show-CMUg8SJu.js +1 -0
- package/dist/show-COTZEYgc.js +1 -0
- package/dist/status-D26U--p8.js +1 -0
- package/dist/steer-C6uARLp5.js +4 -0
- package/dist/stop-BrGI3hSS.js +1 -0
- package/dist/stop-ByCAlbmN.js +3 -0
- package/dist/store-B94tSate.js +42 -0
- package/dist/store-DzqXS2wT.js +8 -0
- package/dist/task-C6VAg5WU.js +1 -0
- package/dist/task-CgOKgkEG.js +1 -0
- package/dist/task-DeglY79z.js +5 -0
- package/dist/test-NEbhlxvo.js +1 -0
- package/dist/tools-D0Zfs8Hx.js +1 -0
- package/dist/types-D0q15RJa.js +1 -0
- package/dist/types-I5Cwtl_K.d.ts +389 -0
- package/dist/unalias-C9NqmSDq.js +1 -0
- package/dist/update-BTxYQj7Z.js +2 -0
- package/dist/upgrade-hA0yWBvx.js +2 -0
- package/dist/usage-BhqoCjvE.js +1 -0
- package/dist/usage-C4d9X2Uq.js +1 -0
- package/dist/watch-CSdj24ct.js +5 -0
- package/dist/watch-DtRuC0Wc.js +8 -0
- package/dist/wire-BeT1Axeo.js +1 -0
- package/dist/worker-CXndxmGF.js +9 -0
- package/dist/worker-DX7P9kWl.js +1 -0
- package/dist/workflow-Dcmdooi8.js +1 -0
- package/docs/agents/coder.md +26 -0
- package/docs/agents/index.md +120 -0
- package/docs/config.md +51 -30
- package/docs/dash.md +64 -0
- package/docs/flows.md +20 -15
- package/docs/mcp.md +62 -0
- package/docs/models.md +41 -23
- package/docs/review.md +41 -0
- package/docs/sdk.md +57 -38
- package/docs/self-host.md +188 -0
- package/migrations/0000_initial.sql +252 -0
- package/migrations/meta/0000_snapshot.json +1787 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +37 -7
- package/plugins/agents/skills/coder/SKILL.md +14 -60
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/setup.md +2 -2
- package/plugins/claude/skills/dispatch/SKILL.md +14 -58
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/README.md +5 -5
- package/plugins/cursor/assets/logo.png +0 -0
- package/plugins/cursor/skills/coder/SKILL.md +14 -59
- package/src/client/index.ts +573 -0
- package/src/client/types.ts +506 -0
- package/src/core/errors.ts +72 -0
- package/src/core/task/log-view.ts +173 -0
- package/src/server/auth/sign-in.ts +14 -0
- package/src/server/dash/api/load.ts +62 -0
- package/src/server/dash/api/types.ts +11 -0
- package/src/server/dash/app/connect/page.tsx +42 -0
- package/src/server/dash/app/dash/account/loading.tsx +11 -0
- package/src/server/dash/app/dash/account/notify.tsx +42 -0
- package/src/server/dash/app/dash/account/page.css +81 -0
- package/src/server/dash/app/dash/account/page.tsx +126 -0
- package/src/server/dash/app/dash/account/sign-out.tsx +24 -0
- package/src/server/dash/app/dash/agents/(list)/agent-menu.tsx +10 -0
- package/src/server/dash/app/dash/agents/(list)/agents-grid.tsx +143 -0
- package/src/server/dash/app/dash/agents/(list)/connect-apps.tsx +46 -0
- package/src/server/dash/app/dash/agents/(list)/loading.tsx +14 -0
- package/src/server/dash/app/dash/agents/(list)/page.css +72 -0
- package/src/server/dash/app/dash/agents/(list)/page.tsx +89 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/layout.tsx +135 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/loading.tsx +5 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/page.css +21 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/page.tsx +173 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/loading.tsx +18 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/page.css +87 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/page.tsx +258 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/platform-actions.tsx +111 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/agent-settings-form.css +114 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/agent-settings-form.tsx +294 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/loading.tsx +5 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/page.tsx +54 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/tasks/loading.tsx +5 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/tasks/page.tsx +14 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/usage/loading.tsx +31 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/usage/page.css +12 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/usage/page.tsx +163 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/versions-list.tsx +53 -0
- package/src/server/dash/app/dash/agents/[slug]/edit/loading.tsx +31 -0
- package/src/server/dash/app/dash/agents/[slug]/edit/page.tsx +91 -0
- package/src/server/dash/app/dash/agents/agent/agent-pills.css +27 -0
- package/src/server/dash/app/dash/agents/agent/agent-pills.tsx +133 -0
- package/src/server/dash/app/dash/agents/agent/hero.css +40 -0
- package/src/server/dash/app/dash/agents/agent/hero.tsx +60 -0
- package/src/server/dash/app/dash/agents/agent/instructions.css +29 -0
- package/src/server/dash/app/dash/agents/agent/instructions.tsx +82 -0
- package/src/server/dash/app/dash/agents/editor/connect-repositories.ts +16 -0
- package/src/server/dash/app/dash/agents/editor/editor.css +263 -0
- package/src/server/dash/app/dash/agents/editor/editor.tsx +774 -0
- package/src/server/dash/app/dash/agents/editor/import-picker.css +48 -0
- package/src/server/dash/app/dash/agents/editor/import-picker.tsx +253 -0
- package/src/server/dash/app/dash/agents/editor/names.ts +35 -0
- package/src/server/dash/app/dash/agents/new/loading.tsx +25 -0
- package/src/server/dash/app/dash/agents/new/page.tsx +72 -0
- package/src/server/dash/app/dash/layout.css +265 -0
- package/src/server/dash/app/dash/layout.tsx +332 -0
- package/src/server/dash/app/dash/page.tsx +14 -0
- package/src/server/dash/app/dash/settings/[tab]/credentials-list.css +94 -0
- package/src/server/dash/app/dash/settings/[tab]/credentials-list.tsx +619 -0
- package/src/server/dash/app/dash/settings/[tab]/credentials.tsx +36 -0
- package/src/server/dash/app/dash/settings/[tab]/engines-list.css +16 -0
- package/src/server/dash/app/dash/settings/[tab]/engines-list.tsx +135 -0
- package/src/server/dash/app/dash/settings/[tab]/list.css +98 -0
- package/src/server/dash/app/dash/settings/[tab]/list.tsx +215 -0
- package/src/server/dash/app/dash/settings/[tab]/loading.tsx +6 -0
- package/src/server/dash/app/dash/settings/[tab]/mcp-list.css +43 -0
- package/src/server/dash/app/dash/settings/[tab]/mcp-list.tsx +290 -0
- package/src/server/dash/app/dash/settings/[tab]/models-list.tsx +513 -0
- package/src/server/dash/app/dash/settings/[tab]/page.tsx +89 -0
- package/src/server/dash/app/dash/settings/[tab]/runners-list.css +153 -0
- package/src/server/dash/app/dash/settings/[tab]/runners-list.tsx +457 -0
- package/src/server/dash/app/dash/settings/layout.tsx +50 -0
- package/src/server/dash/app/dash/settings/model-options.ts +117 -0
- package/src/server/dash/app/dash/settings/page.tsx +7 -0
- package/src/server/dash/app/dash/settings/settings-head.tsx +24 -0
- package/src/server/dash/app/dash/settings/tunnel-guide.tsx +28 -0
- package/src/server/dash/app/dash/tasks/[id]/activity.tsx +202 -0
- package/src/server/dash/app/dash/tasks/[id]/loading.tsx +31 -0
- package/src/server/dash/app/dash/tasks/[id]/page.tsx +30 -0
- package/src/server/dash/app/dash/tasks/[id]/task-actions.tsx +164 -0
- package/src/server/dash/app/dash/tasks/[id]/task-view.css +407 -0
- package/src/server/dash/app/dash/tasks/[id]/task-view.tsx +513 -0
- package/src/server/dash/app/dash/tasks/composer-data.ts +96 -0
- package/src/server/dash/app/dash/tasks/composer.css +316 -0
- package/src/server/dash/app/dash/tasks/composer.tsx +890 -0
- package/src/server/dash/app/dash/tasks/list/status.css +50 -0
- package/src/server/dash/app/dash/tasks/list/status.tsx +20 -0
- package/src/server/dash/app/dash/tasks/list/task.ts +45 -0
- package/src/server/dash/app/dash/tasks/list/tasks-list.css +85 -0
- package/src/server/dash/app/dash/tasks/list/tasks-list.tsx +402 -0
- package/src/server/dash/app/dash/tasks/list/tasks-section.tsx +96 -0
- package/src/server/dash/app/dash/tasks/page.tsx +53 -0
- package/src/server/dash/app/dash/token-from-hash.tsx +17 -0
- package/src/server/dash/app/dash/usage/custom-range.tsx +63 -0
- package/src/server/dash/app/dash/usage/day-chart.css +109 -0
- package/src/server/dash/app/dash/usage/day-chart.tsx +110 -0
- package/src/server/dash/app/dash/usage/loading.tsx +17 -0
- package/src/server/dash/app/dash/usage/metric.ts +13 -0
- package/src/server/dash/app/dash/usage/page.tsx +117 -0
- package/src/server/dash/app/dash/usage/range-bar.css +13 -0
- package/src/server/dash/app/dash/usage/range-bar.tsx +69 -0
- package/src/server/dash/app/dash/usage/stats.css +52 -0
- package/src/server/dash/app/dash/usage/stats.tsx +19 -0
- package/src/server/dash/app/dash/usage/top-agents.css +40 -0
- package/src/server/dash/app/dash/usage/top-agents.tsx +138 -0
- package/src/server/dash/app/dash/usage/usage.css +0 -0
- package/src/server/dash/app/globals.css +692 -0
- package/src/server/dash/app/layout.tsx +52 -0
- package/src/server/dash/app/login/page.css +26 -0
- package/src/server/dash/app/login/page.tsx +57 -0
- package/src/server/dash/app/page.tsx +5 -0
- package/src/server/dash/app/responsive.css +49 -0
- package/src/server/dash/app/zone.tsx +13 -0
- package/src/server/dash/comps/frame/auth-panel.css +60 -0
- package/src/server/dash/comps/frame/auth-panel.tsx +44 -0
- package/src/server/dash/comps/frame/drawer.css +28 -0
- package/src/server/dash/comps/frame/drawer.tsx +39 -0
- package/src/server/dash/comps/frame/heads.ts +41 -0
- package/src/server/dash/comps/frame/loading-card.tsx +65 -0
- package/src/server/dash/comps/frame/page-head.css +83 -0
- package/src/server/dash/comps/frame/page-head.tsx +71 -0
- package/src/server/dash/comps/frame/stream.tsx +50 -0
- package/src/server/dash/comps/frame/task-toasts.tsx +214 -0
- package/src/server/dash/comps/frame/theme-choices.tsx +46 -0
- package/src/server/dash/comps/nav/current-link.tsx +53 -0
- package/src/server/dash/comps/nav/side-toggle.tsx +30 -0
- package/src/server/dash/comps/nav/to.ts +22 -0
- package/src/server/dash/comps/ui/badge.css +64 -0
- package/src/server/dash/comps/ui/badge.tsx +41 -0
- package/src/server/dash/comps/ui/card.css +93 -0
- package/src/server/dash/comps/ui/card.tsx +77 -0
- package/src/server/dash/comps/ui/collapse.css +32 -0
- package/src/server/dash/comps/ui/collapse.tsx +49 -0
- package/src/server/dash/comps/ui/combo.tsx +154 -0
- package/src/server/dash/comps/ui/confirm.css +36 -0
- package/src/server/dash/comps/ui/confirm.tsx +67 -0
- package/src/server/dash/comps/ui/field.css +25 -0
- package/src/server/dash/comps/ui/field.tsx +34 -0
- package/src/server/dash/comps/ui/icon.css +22 -0
- package/src/server/dash/comps/ui/icon.tsx +17 -0
- package/src/server/dash/comps/ui/icons.ts +44 -0
- package/src/server/dash/comps/ui/menu.css +178 -0
- package/src/server/dash/comps/ui/menu.tsx +152 -0
- package/src/server/dash/comps/ui/segmented.css +44 -0
- package/src/server/dash/comps/ui/segmented.tsx +58 -0
- package/src/server/dash/comps/ui/select.css +103 -0
- package/src/server/dash/comps/ui/select.tsx +250 -0
- package/src/server/dash/comps/ui/sentinel.css +58 -0
- package/src/server/dash/comps/ui/sentinel.tsx +67 -0
- package/src/server/dash/comps/ui/tabs.css +81 -0
- package/src/server/dash/comps/ui/tabs.tsx +32 -0
- package/src/server/dash/comps/ui/tail.css +12 -0
- package/src/server/dash/comps/ui/tail.tsx +37 -0
- package/src/server/dash/comps/ui/toast.css +72 -0
- package/src/server/dash/comps/ui/toolbar.css +143 -0
- package/src/server/dash/comps/ui/toolbar.tsx +93 -0
- package/src/server/dash/package.json +5 -0
- package/src/server/dash/pnext-env.d.ts +4 -0
- package/src/server/dash/pnext.config.ts +5 -0
- package/src/server/dash/public/assets/apple-touch-icon.png +0 -0
- package/src/server/dash/public/assets/favicon.ico +0 -0
- package/src/server/dash/public/assets/favicon.svg +1 -0
- package/src/server/dash/public/assets/fonts/LICENSE-fira-code +93 -0
- package/src/server/dash/public/assets/fonts/fira-code-latin-400-normal-717ee080.woff2 +0 -0
- package/src/server/dash/public/assets/fonts/fira-code-latin-500-normal-530b6706.woff2 +0 -0
- package/src/server/dash/public/assets/fonts/fira-code-latin-700-normal-98730669.woff2 +0 -0
- package/src/server/dash/tsconfig.json +10 -0
- package/src/server/dash/utils/client.ts +19 -0
- package/src/server/dash/utils/format.ts +75 -0
- package/src/server/dash/utils/paged.ts +184 -0
- package/src/server/dash/utils/range.ts +117 -0
- package/dist/app-server-CW93J9zJ.js +0 -3
- package/dist/runtime-D-U1DNkI.js +0 -26
- package/dist/upgrade-DOj06r5b.js +0 -37
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import './menu.css';
|
|
4
|
+
|
|
5
|
+
import type { ComponentChildren } from 'preact';
|
|
6
|
+
import { useId, useRef } from 'preact/hooks';
|
|
7
|
+
|
|
8
|
+
import { iCheck } from './icons';
|
|
9
|
+
import { Icon } from './icon';
|
|
10
|
+
|
|
11
|
+
/** A button and its popover panel, placed at the button; picking an item, an outside click or Escape closes it. */
|
|
12
|
+
export function Menu({
|
|
13
|
+
summary,
|
|
14
|
+
summaryClass,
|
|
15
|
+
label,
|
|
16
|
+
align = 'right',
|
|
17
|
+
wide,
|
|
18
|
+
class: cls,
|
|
19
|
+
children,
|
|
20
|
+
}: {
|
|
21
|
+
summary: ComponentChildren;
|
|
22
|
+
summaryClass?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
align?: 'right' | 'up' | 'left';
|
|
25
|
+
wide?: boolean;
|
|
26
|
+
class?: string;
|
|
27
|
+
children: ComponentChildren;
|
|
28
|
+
}) {
|
|
29
|
+
const id = useId();
|
|
30
|
+
return (
|
|
31
|
+
<span class={`menu ${align}${cls ? ` ${cls}` : ''}`}>
|
|
32
|
+
<button
|
|
33
|
+
popovertarget={id}
|
|
34
|
+
type="button"
|
|
35
|
+
class={summaryClass}
|
|
36
|
+
aria-label={label}
|
|
37
|
+
title={label}
|
|
38
|
+
>
|
|
39
|
+
{summary}
|
|
40
|
+
</button>
|
|
41
|
+
<div
|
|
42
|
+
id={id}
|
|
43
|
+
class={wide ? 'pop wide' : 'pop'}
|
|
44
|
+
popover="auto"
|
|
45
|
+
onBeforeToggle={event => {
|
|
46
|
+
// A tall menu scrolls within the room on its side of the button instead of leaving the viewport.
|
|
47
|
+
if ((event as ToggleEvent).newState !== 'open') return;
|
|
48
|
+
const pop = event.currentTarget as HTMLElement;
|
|
49
|
+
const box = pop.parentElement?.querySelector('button')?.getBoundingClientRect();
|
|
50
|
+
if (!box) return;
|
|
51
|
+
const room = align === 'up' ? box.top - 20 : window.innerHeight - box.bottom - 20;
|
|
52
|
+
pop.style.maxHeight = `${Math.max(120, Math.round(room))}px`;
|
|
53
|
+
}}
|
|
54
|
+
onClick={event => {
|
|
55
|
+
if ((event.target as Element).closest('a, button:not([data-keep])'))
|
|
56
|
+
event.currentTarget.hidePopover();
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
</div>
|
|
61
|
+
</span>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function MenuItem({
|
|
66
|
+
icon,
|
|
67
|
+
title,
|
|
68
|
+
sub,
|
|
69
|
+
href,
|
|
70
|
+
onClick,
|
|
71
|
+
danger,
|
|
72
|
+
}: {
|
|
73
|
+
icon?: string;
|
|
74
|
+
title: ComponentChildren;
|
|
75
|
+
sub?: ComponentChildren;
|
|
76
|
+
/** An outside page; in-app links use Link. */
|
|
77
|
+
href?: string;
|
|
78
|
+
onClick?: () => void;
|
|
79
|
+
/** Destructive: red on hover. */
|
|
80
|
+
danger?: boolean;
|
|
81
|
+
}) {
|
|
82
|
+
const inner = (
|
|
83
|
+
<>
|
|
84
|
+
{icon ? <Icon d={icon} /> : null}
|
|
85
|
+
<span class="grow">
|
|
86
|
+
{title}
|
|
87
|
+
{sub ? <small>{sub}</small> : null}
|
|
88
|
+
</span>
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
const cls = `pop-item${sub ? ' rich' : ''}${danger ? ' danger' : ''}`;
|
|
92
|
+
|
|
93
|
+
if (href)
|
|
94
|
+
return (
|
|
95
|
+
<a
|
|
96
|
+
class={cls}
|
|
97
|
+
href={href}
|
|
98
|
+
{...(/^https?:\/\//.test(href) ? { target: '_blank', rel: 'noreferrer' } : {})}
|
|
99
|
+
>
|
|
100
|
+
{inner}
|
|
101
|
+
</a>
|
|
102
|
+
);
|
|
103
|
+
return (
|
|
104
|
+
<button type="button" class={cls} onClick={onClick}>
|
|
105
|
+
{inner}
|
|
106
|
+
</button>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** A fixed "+n more" that opens the rest in a scrolling list, on hover or click. */
|
|
111
|
+
export function MoreList({ label, children }: { label: string; children: ComponentChildren }) {
|
|
112
|
+
const id = useId();
|
|
113
|
+
const list = useRef<HTMLDivElement>(null);
|
|
114
|
+
const hover = (open: boolean) => (event: PointerEvent) => {
|
|
115
|
+
if (event.pointerType === 'mouse') list.current!.togglePopover(open);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<span class="more" onPointerEnter={hover(true)} onPointerLeave={hover(false)}>
|
|
120
|
+
<button popovertarget={id} type="button">
|
|
121
|
+
{label}
|
|
122
|
+
</button>
|
|
123
|
+
<div id={id} ref={list} class="more-list scroll-box" popover="auto">
|
|
124
|
+
{children}
|
|
125
|
+
</div>
|
|
126
|
+
</span>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** One choice in a menu section; the picked one shows a check. */
|
|
131
|
+
export function MenuRadio({
|
|
132
|
+
on,
|
|
133
|
+
onPick,
|
|
134
|
+
children,
|
|
135
|
+
}: {
|
|
136
|
+
on: boolean;
|
|
137
|
+
onPick: () => void;
|
|
138
|
+
children: ComponentChildren;
|
|
139
|
+
}) {
|
|
140
|
+
return (
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
role="menuitemradio"
|
|
144
|
+
aria-checked={on}
|
|
145
|
+
class={on ? 'pop-item on' : 'pop-item'}
|
|
146
|
+
onClick={onPick}
|
|
147
|
+
>
|
|
148
|
+
<span class="grow">{children}</span>
|
|
149
|
+
{on ? <Icon d={iCheck} /> : null}
|
|
150
|
+
</button>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.seg-btns {
|
|
2
|
+
display: flex;
|
|
3
|
+
border: 1px solid var(--line2);
|
|
4
|
+
}
|
|
5
|
+
.seg-btns > a,
|
|
6
|
+
.seg-btns > button,
|
|
7
|
+
.seg-btns .menu > button {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 6px;
|
|
11
|
+
height: 32px;
|
|
12
|
+
padding: 0 12px;
|
|
13
|
+
border-left: 1px solid var(--line2);
|
|
14
|
+
background: var(--panel);
|
|
15
|
+
font-size: 10.5px;
|
|
16
|
+
letter-spacing: 0.14em;
|
|
17
|
+
color: var(--muted);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.seg-btns > button {
|
|
21
|
+
border-top: 0;
|
|
22
|
+
border-right: 0;
|
|
23
|
+
border-bottom: 0;
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
}
|
|
26
|
+
.seg-btns > :first-child {
|
|
27
|
+
border-left: 0;
|
|
28
|
+
}
|
|
29
|
+
.seg-btns > a:hover,
|
|
30
|
+
.seg-btns > button:hover,
|
|
31
|
+
.seg-btns .menu > button:hover {
|
|
32
|
+
color: var(--fg);
|
|
33
|
+
}
|
|
34
|
+
.seg-btns [aria-current],
|
|
35
|
+
.seg-btns [aria-checked='true'],
|
|
36
|
+
.seg-btns .on > button {
|
|
37
|
+
background: var(--accbg);
|
|
38
|
+
color: var(--acc);
|
|
39
|
+
}
|
|
40
|
+
.seg-btns > button:disabled {
|
|
41
|
+
opacity: 0.45;
|
|
42
|
+
color: var(--muted);
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import './segmented.css';
|
|
2
|
+
import type { Option } from './select';
|
|
3
|
+
|
|
4
|
+
/** One-click choices in a row, a radio group to the keyboard: arrows move and pick, Enter submits the form. */
|
|
5
|
+
export function Segmented({
|
|
6
|
+
label,
|
|
7
|
+
options,
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
class: cls,
|
|
11
|
+
disabled,
|
|
12
|
+
}: {
|
|
13
|
+
label: string;
|
|
14
|
+
options: Option[];
|
|
15
|
+
value: string;
|
|
16
|
+
onChange: (value: string) => void;
|
|
17
|
+
class?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}) {
|
|
20
|
+
const at = Math.max(
|
|
21
|
+
0,
|
|
22
|
+
options.findIndex(([key]) => key === value),
|
|
23
|
+
);
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
class={cls ? `seg-btns ${cls}` : 'seg-btns'}
|
|
27
|
+
role="radiogroup"
|
|
28
|
+
aria-label={label}
|
|
29
|
+
onKeyDown={event => {
|
|
30
|
+
const form = (event.currentTarget as HTMLElement).closest('form');
|
|
31
|
+
if (event.key === 'Enter' && form) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
return form.requestSubmit();
|
|
34
|
+
}
|
|
35
|
+
const step = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 }[event.key];
|
|
36
|
+
if (!step) return;
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
const next = (at + step + options.length) % options.length;
|
|
39
|
+
onChange(options[next]![0]);
|
|
40
|
+
((event.currentTarget as HTMLElement).children[next] as HTMLElement | undefined)?.focus();
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{options.map(([key, text], index) => (
|
|
44
|
+
<button
|
|
45
|
+
key={key}
|
|
46
|
+
type="button"
|
|
47
|
+
role="radio"
|
|
48
|
+
aria-checked={key === value}
|
|
49
|
+
tabIndex={index === at ? 0 : -1}
|
|
50
|
+
disabled={disabled}
|
|
51
|
+
onClick={() => onChange(key)}
|
|
52
|
+
>
|
|
53
|
+
{text}
|
|
54
|
+
</button>
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* select */
|
|
2
|
+
.select {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
}
|
|
7
|
+
.field .select {
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
.select > button {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 10px;
|
|
14
|
+
width: 100%;
|
|
15
|
+
min-height: 36px;
|
|
16
|
+
padding: 7px 10px 7px 12px;
|
|
17
|
+
border: 1px solid var(--line2);
|
|
18
|
+
background: var(--field);
|
|
19
|
+
text-align: left;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
touch-action: manipulation;
|
|
23
|
+
}
|
|
24
|
+
.select > button .grow {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
}
|
|
28
|
+
.select > button .ic {
|
|
29
|
+
color: var(--dim);
|
|
30
|
+
transition: transform 0.15s;
|
|
31
|
+
}
|
|
32
|
+
.select > button[aria-expanded="true"] .ic {
|
|
33
|
+
transform: rotate(180deg);
|
|
34
|
+
}
|
|
35
|
+
.select > button:focus-visible,
|
|
36
|
+
.select > button[aria-expanded="true"] {
|
|
37
|
+
outline: none;
|
|
38
|
+
border-color: var(--acc);
|
|
39
|
+
box-shadow: 0 0 0 3px var(--accbg);
|
|
40
|
+
}
|
|
41
|
+
.select > button:disabled {
|
|
42
|
+
color: var(--muted);
|
|
43
|
+
cursor: default;
|
|
44
|
+
}
|
|
45
|
+
.select-pop {
|
|
46
|
+
min-width: 0;
|
|
47
|
+
max-width: min(440px, calc(100vw - 16px));
|
|
48
|
+
overflow-y: auto;
|
|
49
|
+
overscroll-behavior: contain;
|
|
50
|
+
scrollbar-width: thin;
|
|
51
|
+
scrollbar-color: var(--line2) transparent;
|
|
52
|
+
}
|
|
53
|
+
.select-pop .pop-item {
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
.select-pop .pop-item:hover {
|
|
57
|
+
background: none;
|
|
58
|
+
}
|
|
59
|
+
.select-pop .pop-item.on {
|
|
60
|
+
background: var(--wash2);
|
|
61
|
+
}
|
|
62
|
+
.select-pop .pop-item > .ic {
|
|
63
|
+
visibility: hidden;
|
|
64
|
+
}
|
|
65
|
+
.select-pop .pop-item[aria-selected="true"] > .ic {
|
|
66
|
+
visibility: visible;
|
|
67
|
+
color: var(--acc);
|
|
68
|
+
}
|
|
69
|
+
.select > button:disabled {
|
|
70
|
+
opacity: 0.65;
|
|
71
|
+
cursor: default;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* a path under an option: one line, clipped from the start so the folder name stays */
|
|
75
|
+
.select-pop .pop-item .pop-path {
|
|
76
|
+
display: block;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
direction: rtl;
|
|
79
|
+
text-align: left;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
font-size: 11px;
|
|
83
|
+
color: var(--muted);
|
|
84
|
+
}
|
|
85
|
+
.select-pop .pop-item .grow {
|
|
86
|
+
min-width: 0;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* the action row leads with its icon and never shows a check */
|
|
92
|
+
.select-pop .pop-item.action {
|
|
93
|
+
margin-top: 4px;
|
|
94
|
+
color: var(--muted);
|
|
95
|
+
}
|
|
96
|
+
.select-pop .pop-item.action > .ic {
|
|
97
|
+
visibility: visible;
|
|
98
|
+
width: 14px;
|
|
99
|
+
height: 14px;
|
|
100
|
+
}
|
|
101
|
+
.select-pop .pop-item.action.on {
|
|
102
|
+
color: var(--fg);
|
|
103
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import './select.css';
|
|
2
|
+
import type { ComponentChildren } from 'preact';
|
|
3
|
+
import { Fragment } from 'preact';
|
|
4
|
+
import { useId, useLayoutEffect, useRef, useState } from 'preact/hooks';
|
|
5
|
+
|
|
6
|
+
import { iCheck, iDown, iPlus } from './icons';
|
|
7
|
+
import { Icon } from './icon';
|
|
8
|
+
|
|
9
|
+
export type Option = [value: string, label: string];
|
|
10
|
+
|
|
11
|
+
const PAGE = 10;
|
|
12
|
+
|
|
13
|
+
/** A select in the menu style, with keyboard, type-ahead and touch; `name` posts its value. */
|
|
14
|
+
export function Select({
|
|
15
|
+
label,
|
|
16
|
+
options,
|
|
17
|
+
value,
|
|
18
|
+
defaultValue,
|
|
19
|
+
onChange,
|
|
20
|
+
name,
|
|
21
|
+
disabled,
|
|
22
|
+
headings,
|
|
23
|
+
subs,
|
|
24
|
+
action,
|
|
25
|
+
}: {
|
|
26
|
+
label: string;
|
|
27
|
+
options: Option[];
|
|
28
|
+
/** Section titles shown above the options with these values. */
|
|
29
|
+
headings?: Record<string, string>;
|
|
30
|
+
/** A second, muted line under an option, clipped from the start, for paths. */
|
|
31
|
+
subs?: Record<string, string>;
|
|
32
|
+
/** One last row that acts instead of selecting, like "Add models"; it joins hover and keyboard like an option. */
|
|
33
|
+
action?: { label: string; icon?: string; onPick: () => void };
|
|
34
|
+
value?: string;
|
|
35
|
+
defaultValue?: string;
|
|
36
|
+
onChange?: (value: string) => void;
|
|
37
|
+
name?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
}) {
|
|
40
|
+
const [own, setOwn] = useState(defaultValue ?? options[0]?.[0] ?? '');
|
|
41
|
+
// A value the options no longer hold falls back to the first, as a native select does.
|
|
42
|
+
const selected = Math.max(
|
|
43
|
+
0,
|
|
44
|
+
options.findIndex(([key]) => key === (value ?? own)),
|
|
45
|
+
);
|
|
46
|
+
const current = options[selected]?.[0] ?? '';
|
|
47
|
+
const [open, setOpen] = useState(false);
|
|
48
|
+
const [active, setActive] = useState(selected);
|
|
49
|
+
const [place, setPlace] = useState('');
|
|
50
|
+
const button = useRef<HTMLButtonElement>(null);
|
|
51
|
+
const list = useRef<HTMLDivElement>(null);
|
|
52
|
+
const typed = useRef({ text: '', at: 0 });
|
|
53
|
+
const id = useId();
|
|
54
|
+
|
|
55
|
+
const show = (index = selected) => {
|
|
56
|
+
setActive(index);
|
|
57
|
+
setOpen(true);
|
|
58
|
+
};
|
|
59
|
+
const close = (focus = true) => {
|
|
60
|
+
setOpen(false);
|
|
61
|
+
if (focus) button.current?.focus();
|
|
62
|
+
};
|
|
63
|
+
const pick = (index: number) => {
|
|
64
|
+
if (action && index === options.length) {
|
|
65
|
+
close();
|
|
66
|
+
action.onPick();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const next = options[index]?.[0];
|
|
70
|
+
close();
|
|
71
|
+
if (next === undefined || next === current) return;
|
|
72
|
+
if (value === undefined) setOwn(next);
|
|
73
|
+
onChange?.(next);
|
|
74
|
+
};
|
|
75
|
+
/** Type-ahead: the next label starting with what was typed; one key repeated cycles. */
|
|
76
|
+
const seek = (key: string, from: number) => {
|
|
77
|
+
const now = Date.now();
|
|
78
|
+
const text = now - typed.current.at > 600 ? key : typed.current.text + key;
|
|
79
|
+
typed.current = { text, at: now };
|
|
80
|
+
const needle = /^(.)\1*$/.test(text) ? text[0]! : text;
|
|
81
|
+
const start = needle.length === 1 ? from + 1 : from;
|
|
82
|
+
for (let step = 0; step < options.length; step++) {
|
|
83
|
+
const index = (start + step) % options.length;
|
|
84
|
+
if (options[index]![1].toLowerCase().startsWith(needle.toLowerCase())) return index;
|
|
85
|
+
}
|
|
86
|
+
return -1;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
90
|
+
const last = options.length - 1 + (action ? 1 : 0);
|
|
91
|
+
const key = event.key;
|
|
92
|
+
if (!open) {
|
|
93
|
+
if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(key)) show();
|
|
94
|
+
else if (key === 'Home') show(0);
|
|
95
|
+
else if (key === 'End') show(last);
|
|
96
|
+
else if (key.length === 1 && !event.ctrlKey && !event.metaKey) {
|
|
97
|
+
const found = seek(key, selected);
|
|
98
|
+
if (found >= 0) show(found);
|
|
99
|
+
else return;
|
|
100
|
+
} else return;
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (key === 'ArrowDown') setActive(Math.min(last, active + 1));
|
|
105
|
+
else if (key === 'ArrowUp' && event.altKey) pick(active);
|
|
106
|
+
else if (key === 'ArrowUp') setActive(Math.max(0, active - 1));
|
|
107
|
+
else if (key === 'Home') setActive(0);
|
|
108
|
+
else if (key === 'End') setActive(last);
|
|
109
|
+
else if (key === 'PageDown') setActive(Math.min(last, active + PAGE));
|
|
110
|
+
else if (key === 'PageUp') setActive(Math.max(0, active - PAGE));
|
|
111
|
+
else if (key === 'Enter' || (key === ' ' && Date.now() - typed.current.at > 600)) pick(active);
|
|
112
|
+
else if (key === 'Escape') {
|
|
113
|
+
event.stopPropagation();
|
|
114
|
+
close();
|
|
115
|
+
} else if (key === 'Tab') {
|
|
116
|
+
pick(active);
|
|
117
|
+
return;
|
|
118
|
+
} else if (key.length === 1 && !event.ctrlKey && !event.metaKey) {
|
|
119
|
+
const found = seek(key, active);
|
|
120
|
+
if (found >= 0) setActive(found);
|
|
121
|
+
} else return;
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// In the top layer, so a dialog or scroll box never clips it; flips up near the bottom.
|
|
126
|
+
useLayoutEffect(() => {
|
|
127
|
+
if (!open) return;
|
|
128
|
+
list.current?.showPopover();
|
|
129
|
+
const position = () => {
|
|
130
|
+
const box = button.current?.getBoundingClientRect();
|
|
131
|
+
const menu = list.current;
|
|
132
|
+
if (!box || !menu) return;
|
|
133
|
+
const below = innerHeight - box.bottom - 12;
|
|
134
|
+
const up = below < Math.min(menu.scrollHeight, 240) && box.top > below;
|
|
135
|
+
setPlace(
|
|
136
|
+
`left:${Math.round(Math.min(box.left, innerWidth - menu.offsetWidth - 8))}px;min-width:${Math.round(box.width)}px;` +
|
|
137
|
+
(up
|
|
138
|
+
? `bottom:${Math.round(innerHeight - box.top + 4)}px;max-height:${Math.round(Math.min(480, box.top - 12))}px`
|
|
139
|
+
: `top:${Math.round(box.bottom + 4)}px;max-height:${Math.round(Math.min(480, below))}px`),
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
position();
|
|
143
|
+
const outside = (event: PointerEvent) => {
|
|
144
|
+
const target = event.target as Node;
|
|
145
|
+
if (!button.current?.contains(target) && !list.current?.contains(target)) close(false);
|
|
146
|
+
};
|
|
147
|
+
addEventListener('resize', position);
|
|
148
|
+
addEventListener('scroll', position, true);
|
|
149
|
+
document.addEventListener('pointerdown', outside);
|
|
150
|
+
return () => {
|
|
151
|
+
removeEventListener('resize', position);
|
|
152
|
+
removeEventListener('scroll', position, true);
|
|
153
|
+
document.removeEventListener('pointerdown', outside);
|
|
154
|
+
};
|
|
155
|
+
}, [open]);
|
|
156
|
+
|
|
157
|
+
useLayoutEffect(() => {
|
|
158
|
+
if (open)
|
|
159
|
+
list.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView({ block: 'nearest' });
|
|
160
|
+
}, [open, active, place]);
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<span class="select">
|
|
164
|
+
<button
|
|
165
|
+
ref={button}
|
|
166
|
+
type="button"
|
|
167
|
+
role="combobox"
|
|
168
|
+
data-keep
|
|
169
|
+
aria-label={label}
|
|
170
|
+
aria-haspopup="listbox"
|
|
171
|
+
aria-expanded={open}
|
|
172
|
+
aria-controls={`${id}-list`}
|
|
173
|
+
aria-activedescendant={open ? `${id}-${active}` : undefined}
|
|
174
|
+
disabled={disabled}
|
|
175
|
+
onClick={event => {
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
if (open) close();
|
|
178
|
+
else show();
|
|
179
|
+
}}
|
|
180
|
+
onKeyDown={onKeyDown}
|
|
181
|
+
>
|
|
182
|
+
<span class="grow">{options[selected]?.[1] ?? ''}</span>
|
|
183
|
+
<Icon d={iDown} />
|
|
184
|
+
</button>
|
|
185
|
+
{name ? <input type="hidden" name={name} value={current} /> : null}
|
|
186
|
+
{open ? (
|
|
187
|
+
<div
|
|
188
|
+
ref={list}
|
|
189
|
+
id={`${id}-list`}
|
|
190
|
+
class="pop select-pop"
|
|
191
|
+
popover="manual"
|
|
192
|
+
role="listbox"
|
|
193
|
+
aria-label={label}
|
|
194
|
+
style={place || 'visibility:hidden'}
|
|
195
|
+
onMouseDown={event => event.preventDefault()}
|
|
196
|
+
>
|
|
197
|
+
{options.map(([key, text], index) => (
|
|
198
|
+
<Fragment key={key}>
|
|
199
|
+
{headings?.[key] ? <p class="pop-label">{headings[key]}</p> : null}
|
|
200
|
+
<div
|
|
201
|
+
id={`${id}-${index}`}
|
|
202
|
+
data-index={index}
|
|
203
|
+
role="option"
|
|
204
|
+
aria-selected={index === selected}
|
|
205
|
+
class={index === active ? 'pop-item on' : 'pop-item'}
|
|
206
|
+
onPointerMove={() => index !== active && setActive(index)}
|
|
207
|
+
// Picks without letting a wrapping label re-open the list.
|
|
208
|
+
onClick={event => {
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
pick(index);
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
<span class="grow">
|
|
214
|
+
{text}
|
|
215
|
+
{subs?.[key] ? (
|
|
216
|
+
<small class="pop-path">
|
|
217
|
+
<bdi dir="ltr">{subs[key]}</bdi>
|
|
218
|
+
</small>
|
|
219
|
+
) : null}
|
|
220
|
+
</span>
|
|
221
|
+
<Icon d={iCheck} />
|
|
222
|
+
</div>
|
|
223
|
+
</Fragment>
|
|
224
|
+
))}
|
|
225
|
+
{action ? (
|
|
226
|
+
<div
|
|
227
|
+
id={`${id}-${options.length}`}
|
|
228
|
+
data-index={options.length}
|
|
229
|
+
role="option"
|
|
230
|
+
aria-selected={false}
|
|
231
|
+
class={active === options.length ? 'pop-item action on' : 'pop-item action'}
|
|
232
|
+
onPointerMove={() => active !== options.length && setActive(options.length)}
|
|
233
|
+
onClick={event => {
|
|
234
|
+
event.preventDefault();
|
|
235
|
+
pick(options.length);
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
<Icon d={action.icon ?? iPlus} />
|
|
239
|
+
<span class="grow">{action.label}</span>
|
|
240
|
+
</div>
|
|
241
|
+
) : null}
|
|
242
|
+
</div>
|
|
243
|
+
) : null}
|
|
244
|
+
</span>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** The label a filter's value shows. */
|
|
249
|
+
export const labelOf = (options: Array<[string, string]>, value: string) =>
|
|
250
|
+
(options.find(([key]) => key === value) ?? options[0]!)[1];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.sentinel {
|
|
2
|
+
display: block;
|
|
3
|
+
height: 0;
|
|
4
|
+
margin-bottom: -20px;
|
|
5
|
+
}
|
|
6
|
+
.page .head.stuck,
|
|
7
|
+
.page .hero.stuck {
|
|
8
|
+
padding-top: 10px;
|
|
9
|
+
}
|
|
10
|
+
.stuck {
|
|
11
|
+
border-bottom: 1px solid var(--line2);
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
}
|
|
15
|
+
.stuck h1 {
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
}
|
|
21
|
+
.stuck .lead {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
.stuck .title-row {
|
|
25
|
+
flex-wrap: nowrap;
|
|
26
|
+
}
|
|
27
|
+
.stuck .meta {
|
|
28
|
+
flex-wrap: nowrap;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
.stuck > div:first-child,
|
|
32
|
+
.stuck > .grow {
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
}
|
|
36
|
+
.stuck .actions {
|
|
37
|
+
flex: none;
|
|
38
|
+
flex-wrap: nowrap;
|
|
39
|
+
width: auto;
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
}
|
|
42
|
+
.stuck .hero-mark {
|
|
43
|
+
width: 28px;
|
|
44
|
+
height: 28px;
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
}
|
|
47
|
+
.stuck.hero {
|
|
48
|
+
gap: 12px;
|
|
49
|
+
}
|
|
50
|
+
.hero.stuck .title-row .badge {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (max-width: 760px) {
|
|
55
|
+
.stuck .actions > :not(.flash, dialog) ~ :not(.flash, dialog) {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
}
|