shioricode 0.5.1 → 0.5.3
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 +22 -1
- package/dist/bin.cjs +386 -142
- package/dist/bin.mjs +386 -142
- package/dist/client/assets/{ArtifactPanel-1Tg5ZLm5.js → ArtifactPanel-ClA97FO8.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-BvwoXC6z.js → ChatMarkdown-DkldD1_B.js} +2 -2
- package/dist/client/assets/{DiffPanel-D-xp36wD.js → DiffPanel-BYSH-G7M.js} +3 -3
- package/dist/client/assets/{DiffPanelShell-DdBr4p9c.js → DiffPanelShell-Ce2wOE9L.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider--93ReMXi.js → DiffWorkerPoolProvider-DjSdGkRQ.js} +2 -2
- package/dist/client/assets/{NoActiveThreadState-B_C5Y_aO.js → NoActiveThreadState-CVDfDuF2.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-BWTkQW8f.js → ProviderModelPicker-BFlX8lZL.js} +2 -2
- package/dist/client/assets/SettingsPanels-_8_YaXgc.js +4 -0
- package/dist/client/assets/{_chat-BhqvWJHj.js → _chat-CQ5UewiP.js} +2 -2
- package/dist/client/assets/_chat._threadId-5846z-_l.js +289 -0
- package/dist/client/assets/{_chat.index-oZTnMcB3.js → _chat.index-DI7egWLc.js} +2 -2
- package/dist/client/assets/automations-D6SQKJ83.js +2 -0
- package/dist/client/assets/{badge-BkzSFcY-.js → badge-iReKY3O4.js} +2 -2
- package/dist/client/assets/{clientSettings--1UP2ayD.js → clientSettings-DFgmWajw.js} +2 -2
- package/dist/client/assets/{collapsible-CqRg_DyH.js → collapsible-BEW6Xu4N.js} +2 -2
- package/dist/client/assets/{dialog-C7Ppq2qI.js → dialog-CZ2IjObB.js} +2 -2
- package/dist/client/assets/{gitReactQuery-BBOGuHot.js → gitReactQuery-BxToLb49.js} +2 -2
- package/dist/client/assets/{index-DvBh1mNh.js → index-B42nGfCf.js} +5 -5
- package/dist/client/assets/{input-emuaAuIe.js → input-CthhcRBE.js} +2 -2
- package/dist/client/assets/pull-requests-DGa0NhIZ.js +46 -0
- package/dist/client/assets/{queuedTurnsStore-I4LoXHLF.js → queuedTurnsStore-CYufNsaQ.js} +2 -2
- package/dist/client/assets/{scroll-area-kK2XF1gm.js → scroll-area-D6P_hAXV.js} +2 -2
- package/dist/client/assets/{separator-CSqq2xHm.js → separator-ByukCTaZ.js} +2 -2
- package/dist/client/assets/{settings-C9R1j3GG.js → settings-BwPioqTL.js} +2 -2
- package/dist/client/assets/{settings.appearance-Cac_fbGk.js → settings.appearance-DxQzPuf5.js} +2 -2
- package/dist/client/assets/settings.archived-BSqIxOKY.js +2 -0
- package/dist/client/assets/{settings.computer-use-BL801Zu5.js → settings.computer-use-DuuUffvc.js} +2 -2
- package/dist/client/assets/{settings.credits-Brx-cGXe.js → settings.credits-DiXAbJQa.js} +2 -2
- package/dist/client/assets/settings.general-DjIbwGSI.js +2 -0
- package/dist/client/assets/{settings.mcp-DEMm4v5q.js → settings.mcp-CHZOA1L-.js} +2 -2
- package/dist/client/assets/{settings.mobile-DF1raoba.js → settings.mobile-D3UiSzxp.js} +2 -2
- package/dist/client/assets/{settings.plugins-CewrpoKP.js → settings.plugins-qo7Fls2x.js} +2 -2
- package/dist/client/assets/{settings.remote-BufK_lG_.js → settings.remote-CmdhJhKY.js} +2 -2
- package/dist/client/assets/{settings.skills-Cz9xy1ba.js → settings.skills-UB5Wtkl5.js} +2 -2
- package/dist/client/assets/{settings.theme-builder-BU_DRAvo.js → settings.theme-builder-CnwNYRga.js} +2 -2
- package/dist/client/assets/{skillsMcpShared-DxxY1mEt.js → skillsMcpShared-CiunLdEL.js} +2 -2
- package/dist/client/assets/{store-BQMb1nBV.js → store-LT9wKN7R.js} +3 -3
- package/dist/client/assets/{terminalStateStore-C38k-Eaw.js → terminalStateStore-B-V7Awi_.js} +2 -2
- package/dist/client/assets/{textarea-DXuuOfmM.js → textarea-DAzODx1v.js} +2 -2
- package/dist/client/assets/{toggle-group-CvAnsecf.js → toggle-group-CMWeXyeK.js} +2 -2
- package/dist/client/assets/{toggle-nUm5N7vp.js → toggle-uzFsauJb.js} +2 -2
- package/dist/client/assets/{uiStateStore-Di3ieZaJ.js → uiStateStore-CgvPrTF8.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-WYMZPumx.js → useHandleNewThread-Chs2blac.js} +2 -2
- package/dist/client/assets/{useSettings-DOuHg9jg.js → useSettings-CaigvboL.js} +2 -2
- package/dist/client/assets/{useTheme-Dhz9U3on.js → useTheme-7QjQMsSZ.js} +2 -2
- package/dist/client/assets/{vendor-ui-DmvKhMzf.js → vendor-ui-Ds9VgrYb.js} +2 -2
- package/dist/client/index.html +12 -12
- package/package.json +1 -1
- package/dist/client/assets/SettingsPanels-DGYlfoWv.js +0 -4
- package/dist/client/assets/_chat._threadId-Blwb3CRP.js +0 -289
- package/dist/client/assets/automations-ChGelqHO.js +0 -2
- package/dist/client/assets/pull-requests-xKFO2G81.js +0 -46
- package/dist/client/assets/settings.archived-KRU4XARw.js +0 -2
- package/dist/client/assets/settings.general-BXcV60tY.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-CM5SpFmF.js";import{c as r}from"./vendor--lexical-react-B6TeCrpE.js";import{_ as i,s as a}from"./clientSettings--1UP2ayD.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-BQMb1nBV.js";import"./terminalStateStore-C38k-Eaw.js";import"./uiStateStore-Di3ieZaJ.js";import{$n as o,An as s,Ar as c,Mr as l,Nr as u,Rn as d,Vr as f,Yn as p,fr as m,kr as h,mr as g,vr as _}from"./vendor-ui-DmvKhMzf.js";import"./useSettings-DOuHg9jg.js";import"./useHandleNewThread-WYMZPumx.js";import"./gitReactQuery-BBOGuHot.js";import{t as v}from"./input-emuaAuIe.js";import{D as y,F as b,N as x,P as S,l as C,u as w}from"./index-DvBh1mNh.js";import"./ProviderModelPicker-BWTkQW8f.js";import"./empty-CwEqZDMX.js";import"./collapsible-CqRg_DyH.js";import{a as T,o as E,s as D}from"./SettingsPanels-DGYlfoWv.js";import{t as O}from"./vendor-qrcode-generator-BI2MWdJH.js";var k=n(),A=e(t(),1),j=r();function ee(e){let t=(0,k.c)(24),{url:n}=e,[r,i]=(0,A.useState)(!1),[o,s]=(0,A.useState)(!1),l,d;if(t[0]!==n){let e=O(0,`M`);e.addData(n,`Byte`),e.make(),d=e.createDataURL(7,2),t[0]=n,t[1]=d}else d=t[1];l=d;let p=l,m=typeof navigator<`u`&&!!navigator.clipboard,h;t[2]===n?h=t[3]:(h=async()=>{m&&(await navigator.clipboard.writeText(n),s(!0),window.setTimeout(()=>s(!1),1200))},t[2]=n,t[3]=h);let g=h,_;t[4]===n?_=t[5]:(_=(0,j.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-md border border-border bg-muted/40 px-3 py-2 text-xs`,children:n}),t[4]=n,t[5]=_);let v;t[6]===g?v=t[7]:(v=()=>void g(),t[6]=g,t[7]=v);let y;t[8]===o?y=t[9]:(y=o?(0,j.jsx)(u,{className:`size-3.5`}):(0,j.jsx)(c,{className:`size-3.5`}),t[8]=o,t[9]=y);let b=o?`Copied`:`Copy`,x;t[10]!==v||t[11]!==y||t[12]!==b?(x=(0,j.jsxs)(a,{size:`sm`,variant:`outline`,disabled:!m,onClick:v,children:[y,b]}),t[10]=v,t[11]=y,t[12]=b,t[13]=x):x=t[13];let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,j.jsxs)(a,{size:`sm`,variant:`outline`,onClick:()=>i(M),children:[(0,j.jsx)(f,{className:`size-3.5`}),`QR`]}),t[14]=S):S=t[14];let C;t[15]!==_||t[16]!==x?(C=(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[_,x,S]}),t[15]=_,t[16]=x,t[17]=C):C=t[17];let w;t[18]!==p||t[19]!==r?(w=r?(0,j.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-xl border border-border bg-white p-4`,children:[(0,j.jsx)(`img`,{src:p,alt:`Remote access QR code`,className:`size-56 max-w-full rounded-md`}),(0,j.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:`Scan with the iOS app to prefill Remote Server, or open it in a browser.`})]}):null,t[18]=p,t[19]=r,t[20]=w):w=t[20];let T;return t[21]!==C||t[22]!==w?(T=(0,j.jsxs)(`div`,{className:`space-y-3`,children:[C,w]}),t[21]=C,t[22]=w,t[23]=T):T=t[23],T}function M(e){return!e}var N=[{id:`method`,title:`Who can reach it`},{id:`prerequisites`,title:`Get ready`},{id:`credentials`,title:`Sign-in`},{id:`enable`,title:`Turn on`}],P=[{value:`shiori-link`,label:`ShioriCode Link`,badge:`Recommended · no Tailscale`,description:`Get a stable shiori.codes link through Shiori's hosted relay. Sign in once; this machine only makes an outbound encrypted connection.`},{value:`tailscale-serve`,label:`Only my devices`,badge:`Private · recommended`,description:`Reachable from devices signed into your tailnet (phone, laptop…) — Tailscale gates the network, your sign-in gates the app. No ports, DNS, or certificates to manage.`},{value:`tailscale-funnel`,label:`Public link`,badge:`Anywhere, behind sign-in`,description:`A public https://….ts.net address that works from any browser — your sign-in is the only gate, so use a strong password. Zero infrastructure.`}];function F(e,t){if(e===`shiori-link`)return[{id:`shiori-account`,label:`Shiori account is connected`,ok:t.link.accountLinked,hint:t.link.accountLinked?null:`Sign in to Shiori in your browser, then return here.`,href:null}];let n=t.tailscale,r=[{id:`installed`,label:`Tailscale is installed`,ok:n.installed,hint:n.installed?null:`Install Tailscale on this machine, then check again.`,href:n.installed?null:`https://tailscale.com/download`},{id:`running`,label:`Tailscale is connected`,ok:n.running,hint:n.running?null:n.backendState===`NeedsLogin`?"Open the Tailscale app and sign in (or run `tailscale up`).":"Open the Tailscale app or run `tailscale up`.",href:null}];return e===`tailscale-funnel`&&r.push({id:`https`,label:`HTTPS certificates are enabled on your tailnet`,ok:n.httpsEnabled,hint:n.httpsEnabled?null:`In the Tailscale admin console, open DNS and enable HTTPS certificates.`,href:n.httpsEnabled?null:`https://login.tailscale.com/admin/dns`}),r}function I(e){return e.keepExisting?null:e.username.trim()?e.password.length<8?`Use at least 8 characters — this password is the only thing between the internet and this machine.`:e.password===e.confirm?null:`Passwords don't match.`:`Pick a username.`}var L=4e3;function R({status:e,onStatus:t,onClose:n,initialMethod:r}){let[o,c]=(0,A.useState)(`method`),[f,h]=(0,A.useState)(r??`shiori-link`),[g,_]=(0,A.useState)(e.username??``),[y,T]=(0,A.useState)(``),[E,D]=(0,A.useState)(``),[O,k]=(0,A.useState)(e.authConfigured),[M,R]=(0,A.useState)(!1),[z,B]=(0,A.useState)(null),[V,H]=(0,A.useState)(!1),[U,W]=(0,A.useState)(null),[G,K]=(0,A.useState)(!1),q=N.findIndex(e=>e.id===o),J=(0,A.useCallback)(async()=>{try{t(await i().remote.getStatus())}catch{}},[t]);(0,A.useEffect)(()=>{if(o!==`prerequisites`)return;let e=window.setInterval(()=>void J(),L);return()=>window.clearInterval(e)},[o,J]);let te=(0,A.useCallback)(()=>{B(null);let e=N[q-1];e&&!V&&c(e.id)},[q,V]),ne=(0,A.useCallback)(()=>{B(null),c(`prerequisites`)},[]),re=(0,A.useCallback)(()=>{B(null),c(`credentials`)},[]),ie=(0,A.useCallback)(async()=>{R(!0),B(null);try{let e=await i().remote.beginLinkSignIn({provider:`github`});(await window.desktopBridge?.openExternal(e.authUrl)===!1||window.desktopBridge===void 0)&&window.open(e.authUrl,`_blank`,`noopener,noreferrer`)}catch(e){B(e instanceof Error?e.message:`Couldn't start Shiori sign-in.`)}finally{R(!1)}},[]),Y=(0,A.useCallback)(async()=>{B(null);let e=I({username:g,password:y,confirm:E,keepExisting:O});if(e){B(e);return}if(O){c(`enable`);return}R(!0);try{t(await i().remote.setCredentials({username:g.trim(),password:y})),await w(g.trim(),y),T(``),D(``),c(`enable`)}catch(e){B(e instanceof Error?e.message:`Couldn't save the credentials.`)}finally{R(!1)}},[g,y,E,O,t]),X=(0,A.useCallback)(async()=>{B(null),R(!0);try{t(await i().remote.setExposure({method:f})),H(!0)}catch(e){B(e instanceof Error?e.message:`Couldn't turn on remote access.`)}finally{R(!1)}},[f,t]),ae=(0,A.useCallback)(async()=>{K(!0),W(null);try{W(await i().remote.testConnection())}catch(e){W({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{K(!1)}},[]),Z=F(f,e),Q=Z.every(e=>e.ok),$=P.find(e=>e.value===f);return(0,j.jsxs)(`div`,{className:`space-y-4 px-4 py-4 sm:px-5`,children:[(0,j.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]`,children:N.map((e,t)=>{let n=t<q?`done`:t===q?`current`:`upcoming`;return(0,j.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t>0?(0,j.jsx)(`span`,{className:`text-muted-foreground/40`,children:`—`}):null,(0,j.jsxs)(`span`,{className:n===`current`?`font-medium text-foreground`:n===`done`?`text-primary`:`text-muted-foreground`,children:[t+1,`. `,e.title]})]},e.id)})}),z?(0,j.jsxs)(x,{variant:`error`,children:[(0,j.jsx)(b,{children:`Couldn't continue`}),(0,j.jsx)(S,{children:z})]}):null,o===`method`?(0,j.jsx)(`div`,{className:`space-y-3`,children:(0,j.jsx)(`div`,{className:`grid gap-2`,children:P.map(e=>{let t=f===e.value;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>h(e.value),className:`flex flex-col items-start gap-0.5 rounded-lg border px-3 py-2.5 text-left transition-colors ${t?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-muted/40`}`,children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[t?(0,j.jsx)(u,{className:`size-3.5 text-primary`}):null,e.label,(0,j.jsx)(`span`,{className:`rounded-full border border-border px-1.5 py-px text-[10px] font-normal text-muted-foreground`,children:e.badge})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.value)})})}):null,o===`prerequisites`?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsx)(`ul`,{className:`divide-y divide-border rounded-lg border border-border`,children:Z.map(e=>(0,j.jsxs)(`li`,{className:`flex items-start gap-2.5 px-3 py-2.5`,children:[e.ok?(0,j.jsx)(u,{className:`mt-0.5 size-4 shrink-0 text-emerald-500`}):(0,j.jsx)(l,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,j.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,j.jsx)(`div`,{className:`text-sm text-foreground`,children:e.label}),!e.ok&&e.hint?(0,j.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.hint,` `,e.href?(0,j.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`Open`,(0,j.jsx)(m,{className:`size-3`})]}):null]}):null]})]},e.id))}),(0,j.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,j.jsx)(p,{className:`size-3 animate-spin [animation-duration:3s]`}),`Checking automatically — finish the steps above and they'll turn green.`]}),f===`shiori-link`&&!e.link.accountLinked?(0,j.jsxs)(a,{size:`sm`,disabled:M,onClick:()=>void ie(),children:[M?(0,j.jsx)(s,{className:`size-3.5 animate-spin`}):null,`Sign in with GitHub`,(0,j.jsx)(m,{className:`size-3.5`})]}):null]}):null,o===`credentials`?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[e.authConfigured?(0,j.jsx)(x,{variant:`info`,children:(0,j.jsxs)(S,{children:[`A sign-in is already set`,e.username?` for “${e.username}”`:``,`.`,` `,(0,j.jsx)(`button`,{type:`button`,className:`font-medium text-primary hover:underline`,onClick:()=>k(e=>!e),children:O?`Set a new one instead`:`Keep the existing one`})]})}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This username and password is what you'll type on your phone or any remote browser. Anyone who signs in has full access to this machine — make it strong.`}),O?null:(0,j.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`wizard-username`,children:`Username`}),(0,j.jsx)(v,{id:`wizard-username`,autoComplete:`username`,value:g,onChange:e=>_(e.target.value),disabled:M})]}),(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`wizard-password`,children:`Password`}),(0,j.jsx)(v,{id:`wizard-password`,type:`password`,autoComplete:`new-password`,value:y,onChange:e=>T(e.target.value),disabled:M})]}),(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`wizard-confirm`,children:`Confirm password`}),(0,j.jsx)(v,{id:`wizard-confirm`,type:`password`,autoComplete:`new-password`,value:E,onChange:e=>D(e.target.value),disabled:M})]})]})]}):null,o===`enable`?(0,j.jsx)(`div`,{className:`space-y-3`,children:V?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(x,{variant:`success`,children:[(0,j.jsx)(b,{children:`Remote access is on`}),(0,j.jsx)(S,{children:e.url?`Open this URL on your phone or another device and sign in.`:`Waiting for the URL — refresh in a moment.`})]}),e.url?(0,j.jsx)(ee,{url:e.url}):null,(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(a,{size:`sm`,variant:`outline`,disabled:G,onClick:()=>void ae(),children:[G?(0,j.jsx)(s,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),U?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${U.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[U.ok?(0,j.jsx)(u,{className:`size-3.5`}):(0,j.jsx)(l,{className:`size-3.5`}),U.ok?`Reachable${U.latencyMs===null?``:` · ${U.latencyMs}ms`}`:U.error??`Not reachable.`]}):null]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Ready to go:`,` `,(0,j.jsx)(`span`,{className:`font-medium text-foreground`,children:$?.label}),`. Sign-in required for every device.`,f===`tailscale-funnel`?` The first public request can take a minute while Tailscale provisions the TLS certificate.`:f===`shiori-link`?` The first setup downloads a checksum-verified connector and can take a moment.`:``]}),(0,j.jsxs)(a,{disabled:M,onClick:()=>void X(),children:[M?(0,j.jsx)(s,{className:`size-3.5 animate-spin`}):null,`Turn on remote access`]})]})}):null,(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border pt-3`,children:[(0,j.jsx)(`div`,{children:q>0&&!V?(0,j.jsxs)(a,{size:`sm`,variant:`ghost`,disabled:M,onClick:te,children:[(0,j.jsx)(d,{className:`size-3.5`}),`Back`]}):null}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(a,{size:`sm`,variant:`ghost`,disabled:M,onClick:n,children:V?`Done`:`Cancel`}),o===`method`?(0,j.jsx)(a,{size:`sm`,onClick:ne,children:`Continue`}):null,o===`prerequisites`?(0,j.jsx)(a,{size:`sm`,disabled:M||!Q,onClick:re,children:`Continue`}):null,o===`credentials`?(0,j.jsxs)(a,{size:`sm`,disabled:M,onClick:()=>void Y(),children:[M?(0,j.jsx)(s,{className:`size-3.5 animate-spin`}):null,`Continue`]}):null]})]})]})}function z(){let e=(0,k.c)(29),{busy:t,connect:n,error:r,label:i,supported:o}=y(),[s,c]=(0,A.useState)(``);if(!o)return null;let l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,j.jsx)(h,{className:`size-3.5`}),e[0]=l):l=e[0];let u;e[1]===r?u=e[2]:(u=r?(0,j.jsx)(x,{variant:`error`,className:`mb-3`,children:(0,j.jsx)(S,{children:r})}):null,e[1]=r,e[2]=u);let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,j.jsx)(C,{htmlFor:`desktop-remote-url`,children:`Add a remote`}),e[3]=d):d=e[3];let f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>c(e.target.value),e[4]=f):f=e[4];let p;e[5]!==n||e[6]!==s?(p=e=>{e.key===`Enter`&&s.trim()&&n(s.trim())},e[5]=n,e[6]=s,e[7]=p):p=e[7];let m;e[8]!==t||e[9]!==p||e[10]!==s?(m=(0,j.jsx)(v,{id:`desktop-remote-url`,type:`url`,inputMode:`url`,placeholder:`sc-….link.shiori.codes`,value:s,disabled:t,onChange:f,onKeyDown:p}),e[8]=t,e[9]=p,e[10]=s,e[11]=m):m=e[11];let g;e[12]!==t||e[13]!==s?(g=t||!s.trim(),e[12]=t,e[13]=s,e[14]=g):g=e[14];let _;e[15]!==n||e[16]!==s?(_=()=>void n(s.trim()),e[15]=n,e[16]=s,e[17]=_):_=e[17];let b=t?`Connecting…`:`Connect`,w;e[18]!==g||e[19]!==_||e[20]!==b?(w=(0,j.jsx)(a,{disabled:g,onClick:_,children:b}),e[18]=g,e[19]=_,e[20]=b,e[21]=w):w=e[21];let T;e[22]!==m||e[23]!==w?(T=(0,j.jsx)(`div`,{className:`grid gap-3`,children:(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[d,(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[m,w]})]})}),e[22]=m,e[23]=w,e[24]=T):T=e[24];let O;return e[25]!==i||e[26]!==u||e[27]!==T?(O=(0,j.jsx)(D,{title:`Connection`,icon:l,children:(0,j.jsxs)(E,{title:`Run ShioriCode on`,description:`Add a server here, then switch between environments from the main sidebar.`,status:i,children:[u,T]})}),e[25]=i,e[26]=u,e[27]=T,e[28]=O):O=e[28],O}var B=[{value:`off`,label:`Off`,hint:`This machine only`},{value:`shiori-link`,label:`Link`,hint:`Public · hosted by Shiori`},{value:`tailscale-serve`,label:`My devices`,hint:`Private · via your tailnet`},{value:`tailscale-funnel`,label:`Public link`,hint:`Anywhere · behind sign-in`}];function V(e){let t=new Date(e).getTime();if(Number.isNaN(t))return`unknown`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<45)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function H(){let[e,t]=(0,A.useState)(null),[n,r]=(0,A.useState)(!0),[c,d]=(0,A.useState)(!1),[f,m]=(0,A.useState)(!1),[h,y]=(0,A.useState)(null),[w,O]=(0,A.useState)(!1),[k,M]=(0,A.useState)(void 0),[N,P]=(0,A.useState)(null),[F,I]=(0,A.useState)(!1),L=(0,A.useRef)(!1),[H,U]=(0,A.useState)(``),[W,G]=(0,A.useState)(``),K=(0,A.useCallback)(async()=>{d(!0),y(null);try{t(await i().remote.getStatus())}catch(e){y(e instanceof Error?e.message:`Failed to load remote status.`)}finally{d(!1)}},[]);(0,A.useEffect)(()=>{let e=!1;return i().remote.getStatus().then(n=>{e||(t(n),!L.current&&n.desiredMethod===`off`&&!n.enabled&&(L.current=!0,O(!0)))}).catch(t=>{e||y(t instanceof Error?t.message:`Failed to load remote status.`)}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]),(0,A.useEffect)(()=>{e?.username&&U(e.username)},[e?.username]);let q=(0,A.useCallback)(async e=>{m(!0),y(null);try{t(await e())}catch(e){y(e instanceof Error?e.message:`Something went wrong.`)}finally{m(!1)}},[]),J=(0,A.useCallback)(e=>q(()=>i().remote.setExposure({method:e})),[q]),te=(0,A.useCallback)(()=>q(()=>i().remote.setCredentials({username:H.trim(),password:W}).then(e=>(G(``),e))),[q,H,W]),ne=(0,A.useCallback)(e=>q(()=>i().remote.revokeSession({sessionId:e})),[q]);(0,A.useCallback)(()=>q(()=>i().remote.disconnectLinkAccount({})),[q]);let re=(0,A.useCallback)(async()=>{I(!0),P(null);try{P(await i().remote.testConnection())}catch(e){P({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{I(!1)}},[]),ie=(0,A.useCallback)(e=>{M(e),O(!0)},[]),Y=e?.tailscale,X=e?.link,ae=!!X?.accountLinked,Z=!!Y?.installed,Q=!!(Y?.installed&&Y.httpsEnabled),$=!!(e&&e.desiredMethod!==`off`&&e.desiredMethod!==e.method),oe=(0,A.useMemo)(()=>e?e.enabled?e.reachability===`public`?`Public`:`Live`:`Off`:`…`,[e]);return n?(0,j.jsx)(T,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-8 text-sm text-muted-foreground`,children:[(0,j.jsx)(s,{className:`size-4 animate-spin`}),`Loading remote access…`]})}):(0,j.jsxs)(T,{children:[(0,j.jsx)(z,{}),(0,j.jsx)(D,{title:`Remote access`,icon:(0,j.jsx)(g,{className:`size-3.5`}),headerAction:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium ${e?.enabled?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:[(0,j.jsx)(`span`,{className:`size-1.5 rounded-full ${e?.enabled?`bg-emerald-500`:`bg-muted-foreground/50`}`}),oe]}),(0,j.jsx)(a,{size:`xs`,variant:`outline`,disabled:f||c,onClick:()=>void K(),children:(0,j.jsx)(p,{className:`size-3.5 ${c?`animate-spin`:``}`})})]}),children:w&&e?(0,j.jsx)(R,{status:e,onStatus:t,onClose:()=>{O(!1),M(void 0)},...k===void 0?{}:{initialMethod:k}},k??`default`):(0,j.jsxs)(E,{title:`Reach ShioriCode from your phone and other devices`,description:`The server keeps running on this machine; remote access only changes how devices reach it. Anyone who signs in has full access — keep the password strong.`,status:e?.enabled&&e.url?`${e.sessions.length} device${e.sessions.length===1?``:`s`} connected`:void 0,control:(0,j.jsx)(a,{size:`sm`,variant:`outline`,disabled:f,onClick:()=>ie(),children:e?.enabled?`Run setup again`:`Set up remote access`}),children:[h?(0,j.jsxs)(x,{variant:`error`,className:`mb-3`,children:[(0,j.jsx)(b,{children:`Couldn't complete that`}),(0,j.jsx)(S,{children:h})]}):null,$&&e?(0,j.jsxs)(x,{variant:`warning`,className:`mb-3`,children:[(0,j.jsx)(b,{children:`Remote access was interrupted`}),(0,j.jsx)(S,{children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{children:e.notice??`The exposure no longer matches what you set up.`}),(0,j.jsx)(a,{size:`xs`,variant:`outline`,disabled:f,onClick:()=>void J(e.desiredMethod),children:`Repair`})]})})]}):null,e?.enabled&&e.url?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsx)(ee,{url:e.url}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(a,{size:`sm`,variant:`outline`,disabled:F,onClick:()=>void re(),children:[F?(0,j.jsx)(s,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),N?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${N.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[N.ok?(0,j.jsx)(u,{className:`size-3.5`}):(0,j.jsx)(l,{className:`size-3.5`}),N.ok?`Reachable${N.latencyMs===null?``:` · ${N.latencyMs}ms`}`:N.error??`Not reachable.`]}):null]})]}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Not exposed yet. Use the setup wizard to get a link in about a minute.`}),e?.notice&&!$?(0,j.jsx)(x,{variant:`warning`,className:`mt-3`,children:(0,j.jsx)(S,{children:e.notice})}):null]})}),w?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(D,{title:`How it's reached`,icon:(0,j.jsx)(_,{className:`size-3.5`}),children:(0,j.jsxs)(E,{title:`Access method`,description:X?.accountLinked?`Link is ready. Tailscale remains available for private tailnet-only access.`:Y?.installed?Y.running?`Connect Shiori for Link, or keep using this machine's Tailscale connection.`:`Connect Shiori for Link without Tailscale, or reconnect the Tailscale app.`:`ShioriCode Link gives this machine a hosted link without Tailscale, ports, or DNS setup.`,children:[(0,j.jsx)(`div`,{className:`mt-1 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:B.map(t=>{let n=e?.method===t.value;return(0,j.jsxs)(`button`,{type:`button`,disabled:f||t.value===`shiori-link`&&!ae||t.value===`tailscale-serve`&&!Z||t.value===`tailscale-funnel`&&!Q,onClick:()=>void J(t.value),className:`flex flex-col items-start gap-0.5 rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-muted/40`}`,children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[n?(0,j.jsx)(u,{className:`size-3.5 text-primary`}):null,t.label]}),(0,j.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t.hint})]},t.value)})}),Y&&!Y.installed?(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[(0,j.jsx)(`a`,{href:`https://tailscale.com/download`,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:`Download Tailscale`}),` `,`and sign in, then come back — the setup wizard checks it live.`]}):null,Q||e?.method===`tailscale-funnel`?null:Y?.installed&&!Y.httpsEnabled?(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:`Public access needs HTTPS certificates enabled on your tailnet (admin console → DNS → Enable HTTPS).`}):null]})}),(0,j.jsx)(D,{title:`Sign-in`,children:(0,j.jsx)(E,{title:`Owner credentials`,description:e?.requireAuth?`A login is required for remote access.`:`Set a password so the iOS app and remote browsers can sign in. It's required the moment you expose this machine.`,status:e?.authConfigured?`Configured${e.username?` · ${e.username}`:``}`:`Not set`,children:(0,j.jsxs)(`div`,{className:`mt-1 grid gap-3 sm:grid-cols-[1fr_1fr_auto] sm:items-end`,children:[(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`remote-username`,children:`Username`}),(0,j.jsx)(v,{id:`remote-username`,autoComplete:`username`,value:H,onChange:e=>U(e.target.value),disabled:f})]}),(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`remote-password`,children:e?.authConfigured?`New password`:`Password`}),(0,j.jsx)(v,{id:`remote-password`,type:`password`,autoComplete:`new-password`,value:W,onChange:e=>G(e.target.value),disabled:f})]}),(0,j.jsx)(a,{disabled:f||H.trim().length===0||W.length===0,onClick:()=>void te(),children:e?.authConfigured?`Update`:`Set password`})]})})}),(0,j.jsx)(D,{title:`Devices`,icon:(0,j.jsx)(o,{className:`size-3.5`}),children:(0,j.jsx)(E,{title:`Connected devices`,description:`Sessions that have signed in remotely. Revoke one to sign it out immediately.`,children:e&&e.sessions.length>0?(0,j.jsx)(`div`,{className:`mt-1 divide-y divide-border rounded-lg border border-border`,children:e.sessions.map(e=>(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 px-3 py-2.5`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label??e.username}),(0,j.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`last seen `,V(e.lastSeenAt)]})]}),(0,j.jsx)(a,{size:`xs`,variant:`ghost`,disabled:f,onClick:()=>void ne(e.id),children:`Revoke`})]},e.id))}):(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No devices connected yet.`})})})]})]})}var U=H;export{U as component};
|
|
2
|
-
//# sourceMappingURL=settings.remote-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-CM5SpFmF.js";import{c as r}from"./vendor--lexical-react-B6TeCrpE.js";import{_ as i,s as a}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Br as o,Jn as s,Ln as c,Mr as l,Or as u,Qn as d,_r as f,dr as p,jr as m,kn as h,kr as g,pr as _}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import{t as v}from"./input-CthhcRBE.js";import{D as y,F as b,N as x,P as S,l as C,u as w}from"./index-B42nGfCf.js";import"./ProviderModelPicker-BFlX8lZL.js";import"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{a as T,o as E,s as D}from"./SettingsPanels-_8_YaXgc.js";import{t as O}from"./vendor-qrcode-generator-BI2MWdJH.js";var k=n(),A=e(t(),1),j=r();function ee(e){let t=(0,k.c)(24),{url:n}=e,[r,i]=(0,A.useState)(!1),[s,c]=(0,A.useState)(!1),u,d;if(t[0]!==n){let e=O(0,`M`);e.addData(n,`Byte`),e.make(),d=e.createDataURL(7,2),t[0]=n,t[1]=d}else d=t[1];u=d;let f=u,p=typeof navigator<`u`&&!!navigator.clipboard,m;t[2]===n?m=t[3]:(m=async()=>{p&&(await navigator.clipboard.writeText(n),c(!0),window.setTimeout(()=>c(!1),1200))},t[2]=n,t[3]=m);let h=m,_;t[4]===n?_=t[5]:(_=(0,j.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-md border border-border bg-muted/40 px-3 py-2 text-xs`,children:n}),t[4]=n,t[5]=_);let v;t[6]===h?v=t[7]:(v=()=>void h(),t[6]=h,t[7]=v);let y;t[8]===s?y=t[9]:(y=s?(0,j.jsx)(l,{className:`size-3.5`}):(0,j.jsx)(g,{className:`size-3.5`}),t[8]=s,t[9]=y);let b=s?`Copied`:`Copy`,x;t[10]!==v||t[11]!==y||t[12]!==b?(x=(0,j.jsxs)(a,{size:`sm`,variant:`outline`,disabled:!p,onClick:v,children:[y,b]}),t[10]=v,t[11]=y,t[12]=b,t[13]=x):x=t[13];let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,j.jsxs)(a,{size:`sm`,variant:`outline`,onClick:()=>i(M),children:[(0,j.jsx)(o,{className:`size-3.5`}),`QR`]}),t[14]=S):S=t[14];let C;t[15]!==_||t[16]!==x?(C=(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[_,x,S]}),t[15]=_,t[16]=x,t[17]=C):C=t[17];let w;t[18]!==f||t[19]!==r?(w=r?(0,j.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-xl border border-border bg-white p-4`,children:[(0,j.jsx)(`img`,{src:f,alt:`Remote access QR code`,className:`size-56 max-w-full rounded-md`}),(0,j.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:`Scan with the iOS app to prefill Remote Server, or open it in a browser.`})]}):null,t[18]=f,t[19]=r,t[20]=w):w=t[20];let T;return t[21]!==C||t[22]!==w?(T=(0,j.jsxs)(`div`,{className:`space-y-3`,children:[C,w]}),t[21]=C,t[22]=w,t[23]=T):T=t[23],T}function M(e){return!e}var N=[{id:`method`,title:`Who can reach it`},{id:`prerequisites`,title:`Get ready`},{id:`credentials`,title:`Sign-in`},{id:`enable`,title:`Turn on`}],P=[{value:`shiori-link`,label:`ShioriCode Link`,badge:`Recommended · no Tailscale`,description:`Get a stable shiori.codes link through Shiori's hosted relay. Sign in once; this machine only makes an outbound encrypted connection.`},{value:`tailscale-serve`,label:`Only my devices`,badge:`Private · recommended`,description:`Reachable from devices signed into your tailnet (phone, laptop…) — Tailscale gates the network, your sign-in gates the app. No ports, DNS, or certificates to manage.`},{value:`tailscale-funnel`,label:`Public link`,badge:`Anywhere, behind sign-in`,description:`A public https://….ts.net address that works from any browser — your sign-in is the only gate, so use a strong password. Zero infrastructure.`}];function F(e,t){if(e===`shiori-link`)return[{id:`shiori-account`,label:`Shiori account is connected`,ok:t.link.accountLinked,hint:t.link.accountLinked?null:`Sign in to Shiori in your browser, then return here.`,href:null}];let n=t.tailscale,r=[{id:`installed`,label:`Tailscale is installed`,ok:n.installed,hint:n.installed?null:`Install Tailscale on this machine, then check again.`,href:n.installed?null:`https://tailscale.com/download`},{id:`running`,label:`Tailscale is connected`,ok:n.running,hint:n.running?null:n.backendState===`NeedsLogin`?"Open the Tailscale app and sign in (or run `tailscale up`).":"Open the Tailscale app or run `tailscale up`.",href:null}];return e===`tailscale-funnel`&&r.push({id:`https`,label:`HTTPS certificates are enabled on your tailnet`,ok:n.httpsEnabled,hint:n.httpsEnabled?null:`In the Tailscale admin console, open DNS and enable HTTPS certificates.`,href:n.httpsEnabled?null:`https://login.tailscale.com/admin/dns`}),r}function I(e){return e.keepExisting?null:e.username.trim()?e.password.length<8?`Use at least 8 characters — this password is the only thing between the internet and this machine.`:e.password===e.confirm?null:`Passwords don't match.`:`Pick a username.`}var L=4e3;function R({status:e,onStatus:t,onClose:n,initialMethod:r}){let[o,u]=(0,A.useState)(`method`),[d,f]=(0,A.useState)(r??`shiori-link`),[g,_]=(0,A.useState)(e.username??``),[y,T]=(0,A.useState)(``),[E,D]=(0,A.useState)(``),[O,k]=(0,A.useState)(e.authConfigured),[M,R]=(0,A.useState)(!1),[z,B]=(0,A.useState)(null),[V,H]=(0,A.useState)(!1),[U,W]=(0,A.useState)(null),[G,K]=(0,A.useState)(!1),q=N.findIndex(e=>e.id===o),J=(0,A.useCallback)(async()=>{try{t(await i().remote.getStatus())}catch{}},[t]);(0,A.useEffect)(()=>{if(o!==`prerequisites`)return;let e=window.setInterval(()=>void J(),L);return()=>window.clearInterval(e)},[o,J]);let te=(0,A.useCallback)(()=>{B(null);let e=N[q-1];e&&!V&&u(e.id)},[q,V]),ne=(0,A.useCallback)(()=>{B(null),u(`prerequisites`)},[]),re=(0,A.useCallback)(()=>{B(null),u(`credentials`)},[]),ie=(0,A.useCallback)(async()=>{R(!0),B(null);try{let e=await i().remote.beginLinkSignIn({provider:`github`});(await window.desktopBridge?.openExternal(e.authUrl)===!1||window.desktopBridge===void 0)&&window.open(e.authUrl,`_blank`,`noopener,noreferrer`)}catch(e){B(e instanceof Error?e.message:`Couldn't start Shiori sign-in.`)}finally{R(!1)}},[]),Y=(0,A.useCallback)(async()=>{B(null);let e=I({username:g,password:y,confirm:E,keepExisting:O});if(e){B(e);return}if(O){u(`enable`);return}R(!0);try{t(await i().remote.setCredentials({username:g.trim(),password:y})),await w(g.trim(),y),T(``),D(``),u(`enable`)}catch(e){B(e instanceof Error?e.message:`Couldn't save the credentials.`)}finally{R(!1)}},[g,y,E,O,t]),X=(0,A.useCallback)(async()=>{B(null),R(!0);try{t(await i().remote.setExposure({method:d})),H(!0)}catch(e){B(e instanceof Error?e.message:`Couldn't turn on remote access.`)}finally{R(!1)}},[d,t]),ae=(0,A.useCallback)(async()=>{K(!0),W(null);try{W(await i().remote.testConnection())}catch(e){W({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{K(!1)}},[]),Z=F(d,e),Q=Z.every(e=>e.ok),$=P.find(e=>e.value===d);return(0,j.jsxs)(`div`,{className:`space-y-4 px-4 py-4 sm:px-5`,children:[(0,j.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]`,children:N.map((e,t)=>{let n=t<q?`done`:t===q?`current`:`upcoming`;return(0,j.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t>0?(0,j.jsx)(`span`,{className:`text-muted-foreground/40`,children:`—`}):null,(0,j.jsxs)(`span`,{className:n===`current`?`font-medium text-foreground`:n===`done`?`text-primary`:`text-muted-foreground`,children:[t+1,`. `,e.title]})]},e.id)})}),z?(0,j.jsxs)(x,{variant:`error`,children:[(0,j.jsx)(b,{children:`Couldn't continue`}),(0,j.jsx)(S,{children:z})]}):null,o===`method`?(0,j.jsx)(`div`,{className:`space-y-3`,children:(0,j.jsx)(`div`,{className:`grid gap-2`,children:P.map(e=>{let t=d===e.value;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>f(e.value),className:`flex flex-col items-start gap-0.5 rounded-lg border px-3 py-2.5 text-left transition-colors ${t?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-muted/40`}`,children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[t?(0,j.jsx)(l,{className:`size-3.5 text-primary`}):null,e.label,(0,j.jsx)(`span`,{className:`rounded-full border border-border px-1.5 py-px text-[10px] font-normal text-muted-foreground`,children:e.badge})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.value)})})}):null,o===`prerequisites`?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsx)(`ul`,{className:`divide-y divide-border rounded-lg border border-border`,children:Z.map(e=>(0,j.jsxs)(`li`,{className:`flex items-start gap-2.5 px-3 py-2.5`,children:[e.ok?(0,j.jsx)(l,{className:`mt-0.5 size-4 shrink-0 text-emerald-500`}):(0,j.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,j.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,j.jsx)(`div`,{className:`text-sm text-foreground`,children:e.label}),!e.ok&&e.hint?(0,j.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.hint,` `,e.href?(0,j.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`Open`,(0,j.jsx)(p,{className:`size-3`})]}):null]}):null]})]},e.id))}),(0,j.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,j.jsx)(s,{className:`size-3 animate-spin [animation-duration:3s]`}),`Checking automatically — finish the steps above and they'll turn green.`]}),d===`shiori-link`&&!e.link.accountLinked?(0,j.jsxs)(a,{size:`sm`,disabled:M,onClick:()=>void ie(),children:[M?(0,j.jsx)(h,{className:`size-3.5 animate-spin`}):null,`Sign in with GitHub`,(0,j.jsx)(p,{className:`size-3.5`})]}):null]}):null,o===`credentials`?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[e.authConfigured?(0,j.jsx)(x,{variant:`info`,children:(0,j.jsxs)(S,{children:[`A sign-in is already set`,e.username?` for “${e.username}”`:``,`.`,` `,(0,j.jsx)(`button`,{type:`button`,className:`font-medium text-primary hover:underline`,onClick:()=>k(e=>!e),children:O?`Set a new one instead`:`Keep the existing one`})]})}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This username and password is what you'll type on your phone or any remote browser. Anyone who signs in has full access to this machine — make it strong.`}),O?null:(0,j.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`wizard-username`,children:`Username`}),(0,j.jsx)(v,{id:`wizard-username`,autoComplete:`username`,value:g,onChange:e=>_(e.target.value),disabled:M})]}),(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`wizard-password`,children:`Password`}),(0,j.jsx)(v,{id:`wizard-password`,type:`password`,autoComplete:`new-password`,value:y,onChange:e=>T(e.target.value),disabled:M})]}),(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`wizard-confirm`,children:`Confirm password`}),(0,j.jsx)(v,{id:`wizard-confirm`,type:`password`,autoComplete:`new-password`,value:E,onChange:e=>D(e.target.value),disabled:M})]})]})]}):null,o===`enable`?(0,j.jsx)(`div`,{className:`space-y-3`,children:V?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(x,{variant:`success`,children:[(0,j.jsx)(b,{children:`Remote access is on`}),(0,j.jsx)(S,{children:e.url?`Open this URL on your phone or another device and sign in.`:`Waiting for the URL — refresh in a moment.`})]}),e.url?(0,j.jsx)(ee,{url:e.url}):null,(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(a,{size:`sm`,variant:`outline`,disabled:G,onClick:()=>void ae(),children:[G?(0,j.jsx)(h,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),U?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${U.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[U.ok?(0,j.jsx)(l,{className:`size-3.5`}):(0,j.jsx)(m,{className:`size-3.5`}),U.ok?`Reachable${U.latencyMs===null?``:` · ${U.latencyMs}ms`}`:U.error??`Not reachable.`]}):null]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Ready to go:`,` `,(0,j.jsx)(`span`,{className:`font-medium text-foreground`,children:$?.label}),`. Sign-in required for every device.`,d===`tailscale-funnel`?` The first public request can take a minute while Tailscale provisions the TLS certificate.`:d===`shiori-link`?` The first setup downloads a checksum-verified connector and can take a moment.`:``]}),(0,j.jsxs)(a,{disabled:M,onClick:()=>void X(),children:[M?(0,j.jsx)(h,{className:`size-3.5 animate-spin`}):null,`Turn on remote access`]})]})}):null,(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border pt-3`,children:[(0,j.jsx)(`div`,{children:q>0&&!V?(0,j.jsxs)(a,{size:`sm`,variant:`ghost`,disabled:M,onClick:te,children:[(0,j.jsx)(c,{className:`size-3.5`}),`Back`]}):null}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(a,{size:`sm`,variant:`ghost`,disabled:M,onClick:n,children:V?`Done`:`Cancel`}),o===`method`?(0,j.jsx)(a,{size:`sm`,onClick:ne,children:`Continue`}):null,o===`prerequisites`?(0,j.jsx)(a,{size:`sm`,disabled:M||!Q,onClick:re,children:`Continue`}):null,o===`credentials`?(0,j.jsxs)(a,{size:`sm`,disabled:M,onClick:()=>void Y(),children:[M?(0,j.jsx)(h,{className:`size-3.5 animate-spin`}):null,`Continue`]}):null]})]})]})}function z(){let e=(0,k.c)(29),{busy:t,connect:n,error:r,label:i,supported:o}=y(),[s,c]=(0,A.useState)(``);if(!o)return null;let l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,j.jsx)(u,{className:`size-3.5`}),e[0]=l):l=e[0];let d;e[1]===r?d=e[2]:(d=r?(0,j.jsx)(x,{variant:`error`,className:`mb-3`,children:(0,j.jsx)(S,{children:r})}):null,e[1]=r,e[2]=d);let f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,j.jsx)(C,{htmlFor:`desktop-remote-url`,children:`Add a remote`}),e[3]=f):f=e[3];let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>c(e.target.value),e[4]=p):p=e[4];let m;e[5]!==n||e[6]!==s?(m=e=>{e.key===`Enter`&&s.trim()&&n(s.trim())},e[5]=n,e[6]=s,e[7]=m):m=e[7];let h;e[8]!==t||e[9]!==m||e[10]!==s?(h=(0,j.jsx)(v,{id:`desktop-remote-url`,type:`url`,inputMode:`url`,placeholder:`sc-….link.shiori.codes`,value:s,disabled:t,onChange:p,onKeyDown:m}),e[8]=t,e[9]=m,e[10]=s,e[11]=h):h=e[11];let g;e[12]!==t||e[13]!==s?(g=t||!s.trim(),e[12]=t,e[13]=s,e[14]=g):g=e[14];let _;e[15]!==n||e[16]!==s?(_=()=>void n(s.trim()),e[15]=n,e[16]=s,e[17]=_):_=e[17];let b=t?`Connecting…`:`Connect`,w;e[18]!==g||e[19]!==_||e[20]!==b?(w=(0,j.jsx)(a,{disabled:g,onClick:_,children:b}),e[18]=g,e[19]=_,e[20]=b,e[21]=w):w=e[21];let T;e[22]!==h||e[23]!==w?(T=(0,j.jsx)(`div`,{className:`grid gap-3`,children:(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[f,(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[h,w]})]})}),e[22]=h,e[23]=w,e[24]=T):T=e[24];let O;return e[25]!==i||e[26]!==d||e[27]!==T?(O=(0,j.jsx)(D,{title:`Connection`,icon:l,children:(0,j.jsxs)(E,{title:`Run ShioriCode on`,description:`Add a server here, then switch between environments from the main sidebar.`,status:i,children:[d,T]})}),e[25]=i,e[26]=d,e[27]=T,e[28]=O):O=e[28],O}var B=[{value:`off`,label:`Off`,hint:`This machine only`},{value:`shiori-link`,label:`Link`,hint:`Public · hosted by Shiori`},{value:`tailscale-serve`,label:`My devices`,hint:`Private · via your tailnet`},{value:`tailscale-funnel`,label:`Public link`,hint:`Anywhere · behind sign-in`}];function V(e){let t=new Date(e).getTime();if(Number.isNaN(t))return`unknown`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<45)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function H(){let[e,t]=(0,A.useState)(null),[n,r]=(0,A.useState)(!0),[o,c]=(0,A.useState)(!1),[u,p]=(0,A.useState)(!1),[g,y]=(0,A.useState)(null),[w,O]=(0,A.useState)(!1),[k,M]=(0,A.useState)(void 0),[N,P]=(0,A.useState)(null),[F,I]=(0,A.useState)(!1),L=(0,A.useRef)(!1),[H,U]=(0,A.useState)(``),[W,G]=(0,A.useState)(``),K=(0,A.useCallback)(async()=>{c(!0),y(null);try{t(await i().remote.getStatus())}catch(e){y(e instanceof Error?e.message:`Failed to load remote status.`)}finally{c(!1)}},[]);(0,A.useEffect)(()=>{let e=!1;return i().remote.getStatus().then(n=>{e||(t(n),!L.current&&n.desiredMethod===`off`&&!n.enabled&&(L.current=!0,O(!0)))}).catch(t=>{e||y(t instanceof Error?t.message:`Failed to load remote status.`)}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]),(0,A.useEffect)(()=>{e?.username&&U(e.username)},[e?.username]);let q=(0,A.useCallback)(async e=>{p(!0),y(null);try{t(await e())}catch(e){y(e instanceof Error?e.message:`Something went wrong.`)}finally{p(!1)}},[]),J=(0,A.useCallback)(e=>q(()=>i().remote.setExposure({method:e})),[q]),te=(0,A.useCallback)(()=>q(()=>i().remote.setCredentials({username:H.trim(),password:W}).then(e=>(G(``),e))),[q,H,W]),ne=(0,A.useCallback)(e=>q(()=>i().remote.revokeSession({sessionId:e})),[q]);(0,A.useCallback)(()=>q(()=>i().remote.disconnectLinkAccount({})),[q]);let re=(0,A.useCallback)(async()=>{I(!0),P(null);try{P(await i().remote.testConnection())}catch(e){P({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{I(!1)}},[]),ie=(0,A.useCallback)(e=>{M(e),O(!0)},[]),Y=e?.tailscale,X=e?.link,ae=!!X?.accountLinked,Z=!!Y?.installed,Q=!!(Y?.installed&&Y.httpsEnabled),$=!!(e&&e.desiredMethod!==`off`&&e.desiredMethod!==e.method),oe=(0,A.useMemo)(()=>e?e.enabled?e.reachability===`public`?`Public`:`Live`:`Off`:`…`,[e]);return n?(0,j.jsx)(T,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-8 text-sm text-muted-foreground`,children:[(0,j.jsx)(h,{className:`size-4 animate-spin`}),`Loading remote access…`]})}):(0,j.jsxs)(T,{children:[(0,j.jsx)(z,{}),(0,j.jsx)(D,{title:`Remote access`,icon:(0,j.jsx)(_,{className:`size-3.5`}),headerAction:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium ${e?.enabled?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:[(0,j.jsx)(`span`,{className:`size-1.5 rounded-full ${e?.enabled?`bg-emerald-500`:`bg-muted-foreground/50`}`}),oe]}),(0,j.jsx)(a,{size:`xs`,variant:`outline`,disabled:u||o,onClick:()=>void K(),children:(0,j.jsx)(s,{className:`size-3.5 ${o?`animate-spin`:``}`})})]}),children:w&&e?(0,j.jsx)(R,{status:e,onStatus:t,onClose:()=>{O(!1),M(void 0)},...k===void 0?{}:{initialMethod:k}},k??`default`):(0,j.jsxs)(E,{title:`Reach ShioriCode from your phone and other devices`,description:`The server keeps running on this machine; remote access only changes how devices reach it. Anyone who signs in has full access — keep the password strong.`,status:e?.enabled&&e.url?`${e.sessions.length} device${e.sessions.length===1?``:`s`} connected`:void 0,control:(0,j.jsx)(a,{size:`sm`,variant:`outline`,disabled:u,onClick:()=>ie(),children:e?.enabled?`Run setup again`:`Set up remote access`}),children:[g?(0,j.jsxs)(x,{variant:`error`,className:`mb-3`,children:[(0,j.jsx)(b,{children:`Couldn't complete that`}),(0,j.jsx)(S,{children:g})]}):null,$&&e?(0,j.jsxs)(x,{variant:`warning`,className:`mb-3`,children:[(0,j.jsx)(b,{children:`Remote access was interrupted`}),(0,j.jsx)(S,{children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{children:e.notice??`The exposure no longer matches what you set up.`}),(0,j.jsx)(a,{size:`xs`,variant:`outline`,disabled:u,onClick:()=>void J(e.desiredMethod),children:`Repair`})]})})]}):null,e?.enabled&&e.url?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsx)(ee,{url:e.url}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(a,{size:`sm`,variant:`outline`,disabled:F,onClick:()=>void re(),children:[F?(0,j.jsx)(h,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),N?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${N.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[N.ok?(0,j.jsx)(l,{className:`size-3.5`}):(0,j.jsx)(m,{className:`size-3.5`}),N.ok?`Reachable${N.latencyMs===null?``:` · ${N.latencyMs}ms`}`:N.error??`Not reachable.`]}):null]})]}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Not exposed yet. Use the setup wizard to get a link in about a minute.`}),e?.notice&&!$?(0,j.jsx)(x,{variant:`warning`,className:`mt-3`,children:(0,j.jsx)(S,{children:e.notice})}):null]})}),w?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(D,{title:`How it's reached`,icon:(0,j.jsx)(f,{className:`size-3.5`}),children:(0,j.jsxs)(E,{title:`Access method`,description:X?.accountLinked?`Link is ready. Tailscale remains available for private tailnet-only access.`:Y?.installed?Y.running?`Connect Shiori for Link, or keep using this machine's Tailscale connection.`:`Connect Shiori for Link without Tailscale, or reconnect the Tailscale app.`:`ShioriCode Link gives this machine a hosted link without Tailscale, ports, or DNS setup.`,children:[(0,j.jsx)(`div`,{className:`mt-1 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:B.map(t=>{let n=e?.method===t.value;return(0,j.jsxs)(`button`,{type:`button`,disabled:u||t.value===`shiori-link`&&!ae||t.value===`tailscale-serve`&&!Z||t.value===`tailscale-funnel`&&!Q,onClick:()=>void J(t.value),className:`flex flex-col items-start gap-0.5 rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-muted/40`}`,children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[n?(0,j.jsx)(l,{className:`size-3.5 text-primary`}):null,t.label]}),(0,j.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t.hint})]},t.value)})}),Y&&!Y.installed?(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[(0,j.jsx)(`a`,{href:`https://tailscale.com/download`,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:`Download Tailscale`}),` `,`and sign in, then come back — the setup wizard checks it live.`]}):null,Q||e?.method===`tailscale-funnel`?null:Y?.installed&&!Y.httpsEnabled?(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:`Public access needs HTTPS certificates enabled on your tailnet (admin console → DNS → Enable HTTPS).`}):null]})}),(0,j.jsx)(D,{title:`Sign-in`,children:(0,j.jsx)(E,{title:`Owner credentials`,description:e?.requireAuth?`A login is required for remote access.`:`Set a password so the iOS app and remote browsers can sign in. It's required the moment you expose this machine.`,status:e?.authConfigured?`Configured${e.username?` · ${e.username}`:``}`:`Not set`,children:(0,j.jsxs)(`div`,{className:`mt-1 grid gap-3 sm:grid-cols-[1fr_1fr_auto] sm:items-end`,children:[(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`remote-username`,children:`Username`}),(0,j.jsx)(v,{id:`remote-username`,autoComplete:`username`,value:H,onChange:e=>U(e.target.value),disabled:u})]}),(0,j.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,j.jsx)(C,{htmlFor:`remote-password`,children:e?.authConfigured?`New password`:`Password`}),(0,j.jsx)(v,{id:`remote-password`,type:`password`,autoComplete:`new-password`,value:W,onChange:e=>G(e.target.value),disabled:u})]}),(0,j.jsx)(a,{disabled:u||H.trim().length===0||W.length===0,onClick:()=>void te(),children:e?.authConfigured?`Update`:`Set password`})]})})}),(0,j.jsx)(D,{title:`Devices`,icon:(0,j.jsx)(d,{className:`size-3.5`}),children:(0,j.jsx)(E,{title:`Connected devices`,description:`Sessions that have signed in remotely. Revoke one to sign it out immediately.`,children:e&&e.sessions.length>0?(0,j.jsx)(`div`,{className:`mt-1 divide-y divide-border rounded-lg border border-border`,children:e.sessions.map(e=>(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 px-3 py-2.5`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label??e.username}),(0,j.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`last seen `,V(e.lastSeenAt)]})]}),(0,j.jsx)(a,{size:`xs`,variant:`ghost`,disabled:u,onClick:()=>void ne(e.id),children:`Revoke`})]},e.id))}):(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No devices connected yet.`})})})]})]})}var U=H;export{U as component};
|
|
2
|
+
//# sourceMappingURL=settings.remote-CmdhJhKY.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{d as r,m as i}from"./vendor-tanstack-CM5SpFmF.js";import{c as a}from"./vendor--lexical-react-B6TeCrpE.js";import{f as o,s}from"./clientSettings
|
|
2
|
-
//# sourceMappingURL=settings.skills-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{d as r,m as i}from"./vendor-tanstack-CM5SpFmF.js";import{c as a}from"./vendor--lexical-react-B6TeCrpE.js";import{f as o,s}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Nn as c,Tn as l}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import"./input-CthhcRBE.js";import"./ProviderModelPicker-BFlX8lZL.js";import{t as u}from"./badge-iReKY3O4.js";import{a as d,i as f,o as p,r as m,t as h}from"./empty-CwEqZDMX.js";import"./collapsible-BEW6Xu4N.js";import{a as g,s as _}from"./SettingsPanels-_8_YaXgc.js";import{a as v,i as y,n as b,o as x,r as S}from"./skillsMcpShared-CiunLdEL.js";var C=n(),w=e(t(),1),T=a();function E(e){let t=(0,C.c)(18),{skill:n,onDelete:r}=e,i;t[0]===n.name?i=t[1]:(i=(0,T.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n.name}),t[0]=n.name,t[1]=i);let a;t[2]===n.scope?a=t[3]:(a=(0,T.jsx)(u,{variant:`outline`,className:`text-[10px] capitalize`,children:n.scope}),t[2]=n.scope,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let l;t[7]===n.description?l=t[8]:(l=n.description?(0,T.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,children:n.description}):null,t[7]=n.description,t[8]=l);let d;t[9]!==o||t[10]!==l?(d=(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,l]}),t[9]=o,t[10]=l,t[11]=d):d=t[11];let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,T.jsx)(c,{className:`size-3.5 text-muted-foreground`}),t[12]=f):f=t[12];let p;t[13]===r?p=t[14]:(p=(0,T.jsx)(s,{size:`icon-xs`,variant:`ghost`,onClick:r,children:f}),t[13]=r,t[14]=p);let m;return t[15]!==d||t[16]!==p?(m=(0,T.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border/60 px-4 py-2.5 pl-10 sm:px-5 sm:pl-11`,children:[d,p]}),t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function D({skills:e,onDelete:t}){let[n,r]=(0,w.useState)(``),i=(0,w.useMemo)(()=>n?e.filter(e=>x(n,e.name,e.description,e.source,e.scope)):e,[e,n]),a=(0,w.useMemo)(()=>v(i),[i]),o=e.length>5,s=a.size>1;return(0,T.jsx)(_,{title:`Skills`,icon:(0,T.jsx)(l,{className:`size-3.5`}),children:e.length===0?(0,T.jsxs)(h,{className:`min-h-36`,children:[(0,T.jsx)(d,{variant:`icon`,children:(0,T.jsx)(l,{})}),(0,T.jsxs)(f,{children:[(0,T.jsx)(p,{children:`No skills found`}),(0,T.jsx)(m,{children:`Add skills under ~/.agents/skills or workspace .agents/skills.`})]})]}):(0,T.jsxs)(T.Fragment,{children:[o?(0,T.jsx)(S,{value:n,onChange:r,placeholder:`Filter skills…`,resultCount:i.length,totalCount:e.length}):null,(0,T.jsx)(`div`,{className:`max-h-96 overflow-y-auto`,children:i.length===0?(0,T.jsxs)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground sm:px-5`,children:[`No skills match “`,n,`”`]}):s?Array.from(a.entries()).map(([e,n])=>(0,T.jsx)(y,{source:e,count:n.length,defaultOpen:!0,children:n.map(e=>(0,T.jsx)(E,{skill:e,onDelete:()=>t(e)},`${e.scope}|${e.path}`))},e)):i.map(e=>(0,T.jsx)(E,{skill:e,onDelete:()=>t(e)},`${e.source}|${e.scope}|${e.path}`))})]})})}function O(){let e=(0,C.c)(7),t=i(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={queryKey:b,queryFn:k,staleTime:5e3},e[0]=n):n=e[0];let a=r(n),s;e[1]===t?s=e[2]:(s=e=>{o().server.removeSkill({source:e.source,name:e.name,path:e.path}).then(()=>t.invalidateQueries({queryKey:b}))},e[1]=t,e[2]=s);let c=s,u;return e[3]!==c||e[4]!==a.data?.skills||e[5]!==a.isLoading?(u=(0,T.jsx)(g,{children:a.isLoading?(0,T.jsx)(_,{title:`Skills`,icon:(0,T.jsx)(l,{className:`size-3.5`}),children:(0,T.jsxs)(h,{className:`min-h-36`,children:[(0,T.jsx)(d,{variant:`icon`,children:(0,T.jsx)(l,{})}),(0,T.jsxs)(f,{children:[(0,T.jsx)(p,{children:`Loading skills`}),(0,T.jsx)(m,{children:`Checking ShioriCode, Codex, and Claude skill locations.`})]})]})}):(0,T.jsx)(D,{skills:a.data?.skills??[],onDelete:c})}),e[3]=c,e[4]=a.data?.skills,e[5]=a.isLoading,e[6]=u):u=e[6],u}function k(){return o().server.listSkills()}var A=O;export{A as component};
|
|
2
|
+
//# sourceMappingURL=settings.skills-UB5Wtkl5.js.map
|
package/dist/client/assets/{settings.theme-builder-BU_DRAvo.js → settings.theme-builder-CnwNYRga.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{C as r}from"./vendor-tanstack-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{s as a}from"./clientSettings--1UP2ayD.js";import"./vendor-effect-Chd9hYxF.js";import{O as o,t as s}from"./utils-B-Di8CjF.js";import"./store-BQMb1nBV.js";import"./terminalStateStore-C38k-Eaw.js";import"./uiStateStore-Di3ieZaJ.js";import{Ar as c,Or as l,Rn as u,ar as d,cr as f,tr as p,wr as m}from"./vendor-ui-DmvKhMzf.js";import"./useSettings-DOuHg9jg.js";import"./useHandleNewThread-WYMZPumx.js";import"./gitReactQuery-BBOGuHot.js";import{t as h}from"./input-emuaAuIe.js";import{it as g}from"./index-DvBh1mNh.js";import{n as _,t as v}from"./useTheme-Dhz9U3on.js";import{a as y,i as b,o as x,r as S,s as ee}from"./ProviderModelPicker-BWTkQW8f.js";import"./empty-CwEqZDMX.js";import{n as C,r as w,t as T}from"./collapsible-CqRg_DyH.js";import{a as E,o as D,s as O}from"./SettingsPanels-DGYlfoWv.js";var te=n(),k=e(t(),1),A=i(),j=[{label:`Base`,description:`Main application background and text colors.`,tokens:[{key:`background`,label:`Background`},{key:`foreground`,label:`Foreground`}]},{label:`Primary`,description:`Buttons, links, and key interactive elements.`,tokens:[{key:`primary`,label:`Primary`},{key:`primaryForeground`,label:`Primary text`}]},{label:`Secondary`,description:`Secondary buttons and less prominent controls.`,tokens:[{key:`secondary`,label:`Secondary`},{key:`secondaryForeground`,label:`Secondary text`}]},{label:`Card`,description:`Card surfaces and their text.`,tokens:[{key:`card`,label:`Card`},{key:`cardForeground`,label:`Card text`}]},{label:`Popover`,description:`Dropdown menus, tooltips, and floating panels.`,tokens:[{key:`popover`,label:`Popover`},{key:`popoverForeground`,label:`Popover text`}]},{label:`Muted`,description:`Subdued backgrounds and secondary text.`,tokens:[{key:`muted`,label:`Muted`},{key:`mutedForeground`,label:`Muted text`}]},{label:`Accent`,description:`Hover states and highlighted areas.`,tokens:[{key:`accent`,label:`Accent`},{key:`accentForeground`,label:`Accent text`}]},{label:`Borders & Input`,description:`Borders, input fields, and focus rings.`,tokens:[{key:`border`,label:`Border`},{key:`input`,label:`Input border`},{key:`ring`,label:`Focus ring`}]},{label:`Destructive`,description:`Errors, deletions, and dangerous actions.`,tokens:[{key:`destructive`,label:`Destructive`},{key:`destructiveForeground`,label:`Destructive text`}]},{label:`Status`,description:`Informational, success, and warning indicators.`,tokens:[{key:`info`,label:`Info`},{key:`infoForeground`,label:`Info text`},{key:`success`,label:`Success`},{key:`successForeground`,label:`Success text`},{key:`warning`,label:`Warning`},{key:`warningForeground`,label:`Warning text`}]}],ne=[{label:`Chrome`,colors:[{key:`background`,label:`Background`},{key:`foreground`,label:`Foreground`},{key:`cursor`,label:`Cursor`},{key:`selectionBackground`,label:`Selection`}]},{label:`Scrollbar`,colors:[{key:`scrollbarSliderBackground`,label:`Scrollbar`},{key:`scrollbarSliderHoverBackground`,label:`Scrollbar hover`},{key:`scrollbarSliderActiveBackground`,label:`Scrollbar active`}]},{label:`ANSI Colors`,colors:[{key:`black`,label:`Black`},{key:`red`,label:`Red`},{key:`green`,label:`Green`},{key:`yellow`,label:`Yellow`},{key:`blue`,label:`Blue`},{key:`magenta`,label:`Magenta`},{key:`cyan`,label:`Cyan`},{key:`white`,label:`White`}]},{label:`Bright ANSI Colors`,colors:[{key:`brightBlack`,label:`Bright black`},{key:`brightRed`,label:`Bright red`},{key:`brightGreen`,label:`Bright green`},{key:`brightYellow`,label:`Bright yellow`},{key:`brightBlue`,label:`Bright blue`},{key:`brightMagenta`,label:`Bright magenta`},{key:`brightCyan`,label:`Bright cyan`},{key:`brightWhite`,label:`Bright white`}]}];function M(e){let{radius:t,tokens:n,terminal:r}=_(e);return{radius:t,tokens:n,terminalColors:r}}function N(e){return parseInt(e,10).toString(16).padStart(2,`0`)}function P(e){let t=e.trim();if(/^#[0-9a-fA-F]{6}$/i.test(t))return t;if(/^#[0-9a-fA-F]{3}$/i.test(t)){let[,e,n,r]=/^#(.)(.)(.)$/i.exec(t);return`#${e}${e}${n}${n}${r}${r}`}let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(t);return n?`#${N(n[1])}${N(n[2])}${N(n[3])}`:t}function F(e){return/^#[0-9a-fA-F]{6}$/i.test(e.trim())}function I(e){let t=(0,te.c)(28),{label:n,value:r,onChange:i}=e,a,o;t[0]===r?(a=t[1],o=t[2]):(a=P(r),o=F(a),t[0]=r,t[1]=a,t[2]=o);let s=o,c=(0,k.useRef)(null),l;t[3]===a?l=t[4]:(l={backgroundColor:a},t[3]=a,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c.current?.click(),t[5]=u):u=t[5];let d=`Pick color for ${n}`,f=s?a:`#000000`,p;t[6]===i?p=t[7]:(p=e=>i(e.target.value),t[6]=i,t[7]=p);let m;t[8]!==f||t[9]!==p?(m=(0,A.jsx)(`input`,{ref:c,type:`color`,value:f,onChange:p,className:`absolute inset-0 cursor-pointer opacity-0`,tabIndex:-1}),t[8]=f,t[9]=p,t[10]=m):m=t[10];let g;t[11]!==l||t[12]!==d||t[13]!==m?(g=(0,A.jsx)(`button`,{type:`button`,className:`group relative size-8 shrink-0 cursor-pointer rounded-lg border border-border shadow-xs/5 transition-shadow hover:ring-2 hover:ring-ring/24`,style:l,onClick:u,"aria-label":d,children:m}),t[11]=l,t[12]=d,t[13]=m,t[14]=g):g=t[14];let _;t[15]===n?_=t[16]:(_=(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[15]=n,t[16]=_);let v;t[17]===i?v=t[18]:(v=e=>i(e.target.value),t[17]=i,t[18]=v);let y;t[19]!==v||t[20]!==r?(y=(0,A.jsx)(h,{size:`sm`,value:r,onChange:v,className:`font-mono text-xs`,spellCheck:!1,autoComplete:`off`}),t[19]=v,t[20]=r,t[21]=y):y=t[21];let b;t[22]!==y||t[23]!==_?(b=(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[_,y]}),t[22]=y,t[23]=_,t[24]=b):b=t[24];let x;return t[25]!==b||t[26]!==g?(x=(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[g,b]}),t[25]=b,t[26]=g,t[27]=x):x=t[27],x}function L(e){let t=(0,te.c)(113),{tokens:n}=e,r;t[0]!==n.accent||t[1]!==n.background||t[2]!==n.border||t[3]!==n.card||t[4]!==n.cardForeground||t[5]!==n.destructive||t[6]!==n.destructiveForeground||t[7]!==n.foreground||t[8]!==n.info||t[9]!==n.input||t[10]!==n.muted||t[11]!==n.mutedForeground||t[12]!==n.primary||t[13]!==n.primaryForeground||t[14]!==n.secondary||t[15]!==n.secondaryForeground||t[16]!==n.success||t[17]!==n.warning?(r={"--p-bg":n.background,"--p-fg":n.foreground,"--p-card":n.card,"--p-card-fg":n.cardForeground,"--p-primary":n.primary,"--p-primary-fg":n.primaryForeground,"--p-secondary":n.secondary,"--p-secondary-fg":n.secondaryForeground,"--p-muted":n.muted,"--p-muted-fg":n.mutedForeground,"--p-accent":n.accent,"--p-border":n.border,"--p-input":n.input,"--p-destructive":n.destructive,"--p-destructive-fg":n.destructiveForeground,"--p-info":n.info,"--p-success":n.success,"--p-warning":n.warning,borderColor:n.border},t[0]=n.accent,t[1]=n.background,t[2]=n.border,t[3]=n.card,t[4]=n.cardForeground,t[5]=n.destructive,t[6]=n.destructiveForeground,t[7]=n.foreground,t[8]=n.info,t[9]=n.input,t[10]=n.muted,t[11]=n.mutedForeground,t[12]=n.primary,t[13]=n.primaryForeground,t[14]=n.secondary,t[15]=n.secondaryForeground,t[16]=n.success,t[17]=n.warning,t[18]=r):r=t[18];let i=r,a=`1px solid ${n.border}`,o;t[19]!==a||t[20]!==n.card?(o={backgroundColor:n.card,borderBottom:a},t[19]=a,t[20]=n.card,t[21]=o):o=t[21];let s;t[22]===n.destructive?s=t[23]:(s=(0,A.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{backgroundColor:n.destructive}}),t[22]=n.destructive,t[23]=s);let c;t[24]===n.warning?c=t[25]:(c=(0,A.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{backgroundColor:n.warning}}),t[24]=n.warning,t[25]=c);let l;t[26]===n.success?l=t[27]:(l=(0,A.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{backgroundColor:n.success}}),t[26]=n.success,t[27]=l);let u;t[28]!==s||t[29]!==c||t[30]!==l?(u=(0,A.jsxs)(`div`,{className:`flex gap-1.5`,children:[s,c,l]}),t[28]=s,t[29]=c,t[30]=l,t[31]=u):u=t[31];let d;t[32]===n.mutedForeground?d=t[33]:(d=(0,A.jsx)(`span`,{className:`text-[10px] font-medium`,style:{color:n.mutedForeground},children:`Preview`}),t[32]=n.mutedForeground,t[33]=d);let f;t[34]!==o||t[35]!==u||t[36]!==d?(f=(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,style:o,children:[u,d]}),t[34]=o,t[35]=u,t[36]=d,t[37]=f):f=t[37];let p;t[38]===n.background?p=t[39]:(p={backgroundColor:n.background},t[38]=n.background,t[39]=p);let m=`1px solid ${n.border}`,h;t[40]===m?h=t[41]:(h={borderRight:m},t[40]=m,t[41]=h);let g;t[42]!==n.accent||t[43]!==n.foreground?(g=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px] font-medium`,style:{backgroundColor:n.accent,color:n.foreground},children:`Active item`}),t[42]=n.accent,t[43]=n.foreground,t[44]=g):g=t[44];let _;t[45]===n.mutedForeground?_=t[46]:(_=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px]`,style:{color:n.mutedForeground},children:`Menu item`}),t[45]=n.mutedForeground,t[46]=_);let v;t[47]===n.mutedForeground?v=t[48]:(v=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px]`,style:{color:n.mutedForeground},children:`Menu item`}),t[47]=n.mutedForeground,t[48]=v);let y;t[49]!==h||t[50]!==g||t[51]!==_||t[52]!==v?(y=(0,A.jsxs)(`div`,{className:`w-28 shrink-0 space-y-1 p-2`,style:h,children:[g,_,v]}),t[49]=h,t[50]=g,t[51]=_,t[52]=v,t[53]=y):y=t[53];let b;t[54]===n.foreground?b=t[55]:(b=(0,A.jsx)(`span`,{className:`text-xs font-semibold`,style:{color:n.foreground},children:`Theme Preview`}),t[54]=n.foreground,t[55]=b);let x;t[56]===n.mutedForeground?x=t[57]:(x=(0,A.jsx)(`p`,{className:`text-[10px] leading-relaxed`,style:{color:n.mutedForeground},children:`This is how your theme will look in the application.`}),t[56]=n.mutedForeground,t[57]=x);let S;t[58]!==b||t[59]!==x?(S=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[b,x]}),t[58]=b,t[59]=x,t[60]=S):S=t[60];let ee=`1px solid ${n.border}`,C;t[61]!==ee||t[62]!==n.card?(C={backgroundColor:n.card,border:ee},t[61]=ee,t[62]=n.card,t[63]=C):C=t[63];let w;t[64]===n.cardForeground?w=t[65]:(w=(0,A.jsx)(`span`,{className:`text-[10px] font-medium`,style:{color:n.cardForeground},children:`Card component`}),t[64]=n.cardForeground,t[65]=w);let T;t[66]===n.mutedForeground?T=t[67]:(T=(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px]`,style:{color:n.mutedForeground},children:`Cards contain grouped content.`}),t[66]=n.mutedForeground,t[67]=T);let E;t[68]!==C||t[69]!==w||t[70]!==T?(E=(0,A.jsxs)(`div`,{className:`rounded-lg p-2.5`,style:C,children:[w,T]}),t[68]=C,t[69]=w,t[70]=T,t[71]=E):E=t[71];let D;t[72]!==n.primary||t[73]!==n.primaryForeground?(D=(0,A.jsx)(`span`,{className:`rounded-md px-2.5 py-1 text-[10px] font-medium`,style:{backgroundColor:n.primary,color:n.primaryForeground},children:`Primary`}),t[72]=n.primary,t[73]=n.primaryForeground,t[74]=D):D=t[74];let O;t[75]!==n.secondary||t[76]!==n.secondaryForeground?(O=(0,A.jsx)(`span`,{className:`rounded-md px-2.5 py-1 text-[10px] font-medium`,style:{backgroundColor:n.secondary,color:n.secondaryForeground},children:`Secondary`}),t[75]=n.secondary,t[76]=n.secondaryForeground,t[77]=O):O=t[77];let k;t[78]!==n.destructive||t[79]!==n.destructiveForeground?(k=(0,A.jsx)(`span`,{className:`rounded-md px-2.5 py-1 text-[10px] font-medium`,style:{backgroundColor:n.destructive,color:n.destructiveForeground},children:`Delete`}),t[78]=n.destructive,t[79]=n.destructiveForeground,t[80]=k):k=t[80];let j;t[81]!==D||t[82]!==O||t[83]!==k?(j=(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[D,O,k]}),t[81]=D,t[82]=O,t[83]=k,t[84]=j):j=t[84];let ne=`1px solid ${n.input}`,M;t[85]!==ne||t[86]!==n.background||t[87]!==n.mutedForeground?(M=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px]`,style:{backgroundColor:n.background,border:ne,color:n.mutedForeground},children:`Placeholder text...`}),t[85]=ne,t[86]=n.background,t[87]=n.mutedForeground,t[88]=M):M=t[88];let N;t[89]===n.info?N=t[90]:(N=(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[9px] font-medium text-white`,style:{backgroundColor:n.info},children:`Info`}),t[89]=n.info,t[90]=N);let P;t[91]===n.success?P=t[92]:(P=(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[9px] font-medium text-white`,style:{backgroundColor:n.success},children:`Success`}),t[91]=n.success,t[92]=P);let F;t[93]===n.warning?F=t[94]:(F=(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[9px] font-medium text-white`,style:{backgroundColor:n.warning},children:`Warning`}),t[93]=n.warning,t[94]=F);let I;t[95]!==N||t[96]!==P||t[97]!==F?(I=(0,A.jsxs)(`div`,{className:`flex gap-1.5`,children:[N,P,F]}),t[95]=N,t[96]=P,t[97]=F,t[98]=I):I=t[98];let L;t[99]!==S||t[100]!==E||t[101]!==j||t[102]!==M||t[103]!==I?(L=(0,A.jsxs)(`div`,{className:`flex-1 space-y-2.5 p-3`,children:[S,E,j,M,I]}),t[99]=S,t[100]=E,t[101]=j,t[102]=M,t[103]=I,t[104]=L):L=t[104];let R;t[105]!==p||t[106]!==y||t[107]!==L?(R=(0,A.jsxs)(`div`,{className:`flex`,style:p,children:[y,L]}),t[105]=p,t[106]=y,t[107]=L,t[108]=R):R=t[108];let re;return t[109]!==f||t[110]!==i||t[111]!==R?(re=(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-xl border shadow-xs/5`,style:i,children:[f,R]}),t[109]=f,t[110]=i,t[111]=R,t[112]=re):re=t[112],re}function R(){let e=(0,te.c)(108),{themeOptionsByAppearance:t,importTheme:n}=v(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=M(`dark`),e[0]=i):i=e[0];let _=i,N,P;e[1]!==t.dark||e[2]!==t.light?(P=[...t.light,...t.dark],e[1]=t.dark,e[2]=t.light,e[3]=P):P=e[3],N=P;let F=N,[R,oe]=(0,k.useState)(``),[z,se]=(0,k.useState)(``),[B,ce]=(0,k.useState)(``),[V,le]=(0,k.useState)(`dark`),[H,ue]=(0,k.useState)(_.radius),[U,de]=(0,k.useState)(_.tokens),[W,fe]=(0,k.useState)(_.terminalColors),[pe,me]=(0,k.useState)(!1),he;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(he=(e,t)=>{de(n=>({...n,[e]:t}))},e[4]=he):he=e[4];let ge=he,_e;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(e,t)=>{fe(n=>({...n,[e]:t}))},e[5]=_e):_e=e[5];let ve=_e,ye;e[6]===F?ye=e[7]:(ye=e=>{if(e==null)return;let t=F.find(t=>t.id===e);t&&(le(t.appearance),de({...t.tokens}),t.terminal?fe({...t.terminal}):fe(M(t.appearance).terminalColors),t.radius&&ue(t.radius))},e[6]=F,e[7]=ye);let be=ye,xe;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(xe=e=>{if(e!==`light`&&e!==`dark`)return;let t=M(e);le(e),ue(t.radius),de(t.tokens),fe(t.terminalColors)},e[8]=xe):xe=e[8];let Se=xe,Ce;e[9]===V?Ce=e[10]:(Ce=()=>{let e=M(V);oe(``),se(``),ce(``),ue(e.radius),de(e.tokens),fe(e.terminalColors)},e[9]=V,e[10]=Ce);let we=Ce,Te;e[11]!==V||e[12]!==z||e[13]!==B||e[14]!==R||e[15]!==H||e[16]!==W||e[17]!==U?(Te=()=>JSON.stringify({version:1,name:R.trim()||`Untitled Theme`,appearance:V,author:z.trim()||void 0,description:B.trim()||void 0,radius:H,tokens:U,terminal:W},null,2),e[11]=V,e[12]=z,e[13]=B,e[14]=R,e[15]=H,e[16]=W,e[17]=U,e[18]=Te):Te=e[18];let G=Te,Ee;e[19]!==V||e[20]!==G||e[21]!==n||e[22]!==R?(Ee=()=>{let e=R.trim()||`Untitled Theme`;try{n(G()),g.add({type:`success`,title:`Saved "${e}"`,description:`The theme is now active for your ${V} appearance.`})}catch(e){let t=e;g.add({type:`error`,title:`Could not save theme`,description:t instanceof Error?t.message:`The theme data is invalid.`})}},e[19]=V,e[20]=G,e[21]=n,e[22]=R,e[23]=Ee):Ee=e[23];let De=Ee,Oe;e[24]!==G||e[25]!==R?(Oe=()=>{let e=G(),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${(R.trim()||`theme`).toLowerCase().replace(/[^a-z0-9]+/g,`-`)}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},e[24]=G,e[25]=R,e[26]=Oe):Oe=e[26];let ke=Oe,Ae;e[27]===G?Ae=e[28]:(Ae=()=>{navigator.clipboard.writeText(G()).then(ae,ie)},e[27]=G,e[28]=Ae);let je=Ae,Me=o.every(e=>U[e]?.trim()),Ne,Pe;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,A.jsxs)(r,{to:`/settings/appearance`,className:`inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,A.jsx)(u,{className:`size-3.5`}),`Appearance`]}),Pe=(0,A.jsx)(`span`,{className:`text-border`,children:`/`}),e[29]=Ne,e[30]=Pe):(Ne=e[29],Pe=e[30]);let Fe;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[Ne,Pe,(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(p,{className:`size-4 text-primary`}),(0,A.jsx)(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Theme Builder`})]})]}),e[31]=Fe):Fe=e[31];let Ie;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,A.jsx)(c,{className:`size-3.5`}),e[32]=Ie):Ie=e[32];let K;e[33]===je?K=e[34]:(K=(0,A.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:je,title:`Copy JSON`,children:[Ie,`Copy JSON`]}),e[33]=je,e[34]=K);let Le;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,A.jsx)(m,{className:`size-3.5`}),e[35]=Le):Le=e[35];let q;e[36]===ke?q=e[37]:(q=(0,A.jsxs)(a,{size:`sm`,variant:`outline`,onClick:ke,children:[Le,`Export`]}),e[36]=ke,e[37]=q);let Re=!Me,ze;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,A.jsx)(l,{className:`size-3.5`}),e[38]=ze):ze=e[38];let J;e[39]!==De||e[40]!==Re?(J=(0,A.jsxs)(a,{size:`sm`,variant:`default`,disabled:Re,onClick:De,children:[ze,`Save & Apply`]}),e[39]=De,e[40]=Re,e[41]=J):J=e[41];let Y;e[42]!==K||e[43]!==q||e[44]!==J?(Y=(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[Fe,(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,q,J]})]}),e[42]=K,e[43]=q,e[44]=J,e[45]=Y):Y=e[45];let Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(Be=e=>oe(e.target.value),e[46]=Be):Be=e[46];let X;e[47]===R?X=e[48]:(X=(0,A.jsx)(D,{title:`Name`,description:`Give your theme a recognizable name.`,control:(0,A.jsx)(h,{size:`sm`,value:R,onChange:Be,placeholder:`My Theme`,className:`w-full sm:w-52`})}),e[47]=R,e[48]=X);let Ve;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=e=>se(e.target.value),e[49]=Ve):Ve=e[49];let Z;e[50]===z?Z=e[51]:(Z=(0,A.jsx)(D,{title:`Author`,description:`Optional creator attribution.`,control:(0,A.jsx)(h,{size:`sm`,value:z,onChange:Ve,placeholder:`Your name`,className:`w-full sm:w-52`})}),e[50]=z,e[51]=Z);let He;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(He=e=>ce(e.target.value),e[52]=He):He=e[52];let Q;e[53]===B?Q=e[54]:(Q=(0,A.jsx)(D,{title:`Description`,description:`A short summary of the theme's look and feel.`,control:(0,A.jsx)(h,{size:`sm`,value:B,onChange:He,placeholder:`A warm dark palette with…`,className:`w-full sm:w-52`})}),e[53]=B,e[54]=Q);let Ue=V===`light`?`Light`:`Dark`,We;e[55]===Ue?We=e[56]:(We=(0,A.jsx)(x,{className:`w-full sm:w-40`,"aria-label":`Appearance`,children:(0,A.jsx)(ee,{children:Ue})}),e[55]=Ue,e[56]=We);let Ge;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,A.jsxs)(y,{align:`end`,alignItemWithTrigger:!1,children:[(0,A.jsx)(b,{hideIndicator:!0,value:`light`,children:`Light`}),(0,A.jsx)(b,{hideIndicator:!0,value:`dark`,children:`Dark`})]}),e[57]=Ge):Ge=e[57];let Ke;e[58]!==V||e[59]!==We?(Ke=(0,A.jsx)(D,{title:`Appearance`,description:`Whether this theme targets light or dark mode.`,control:(0,A.jsxs)(S,{value:V,onValueChange:Se,children:[We,Ge]})}),e[58]=V,e[59]=We,e[60]=Ke):Ke=e[60];let qe;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(qe=e=>ue(e.target.value),e[61]=qe):qe=e[61];let Je;e[62]===H?Je=e[63]:(Je=(0,A.jsx)(D,{title:`Border radius`,description:`Default border radius for UI components.`,control:(0,A.jsx)(h,{size:`sm`,value:H,onChange:qe,placeholder:`0.625rem`,className:`w-full sm:w-40 font-mono text-xs`})}),e[62]=H,e[63]=Je);let Ye;e[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,A.jsx)(x,{className:`w-full sm:w-52`,"aria-label":`Base theme`,children:(0,A.jsx)(ee,{children:`Choose a theme...`})}),e[64]=Ye):Ye=e[64];let Xe;e[65]===F?Xe=e[66]:(Xe=(0,A.jsx)(y,{align:`end`,alignItemWithTrigger:!1,children:F.map(re)}),e[65]=F,e[66]=Xe);let Ze;e[67]!==be||e[68]!==Xe?(Ze=(0,A.jsx)(D,{title:`Start from base`,description:`Load colors from an existing theme to use as a starting point.`,control:(0,A.jsxs)(S,{value:``,onValueChange:be,children:[Ye,Xe]})}),e[67]=be,e[68]=Xe,e[69]=Ze):Ze=e[69];let Qe;e[70]!==X||e[71]!==Z||e[72]!==Q||e[73]!==Ke||e[74]!==Je||e[75]!==Ze?(Qe=(0,A.jsxs)(O,{title:`Theme Details`,children:[X,Z,Q,Ke,Je,Ze]}),e[70]=X,e[71]=Z,e[72]=Q,e[73]=Ke,e[74]=Je,e[75]=Ze,e[76]=Qe):Qe=e[76];let $e,et;e[77]===U?($e=e[78],et=e[79]):($e=(0,A.jsx)(O,{title:`Live Preview`,children:(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(L,{tokens:U})})}),et=j.map(e=>(0,A.jsx)(O,{title:e.label,children:(0,A.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[(0,A.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:e.description}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.tokens.map(e=>(0,A.jsx)(I,{label:e.label,value:U[e.key],onChange:t=>ge(e.key,t)},e.key))})]})},e.label)),e[77]=U,e[78]=$e,e[79]=et);let tt;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(tt=s(`inline-flex items-center gap-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground`),e[80]=tt):tt=e[80];let nt=pe&&`rotate-180`,rt;e[81]===nt?rt=e[82]:(rt=s(`size-3.5 transition-transform duration-200`,nt),e[81]=nt,e[82]=rt);let it;e[83]===rt?it=e[84]:(it=(0,A.jsx)(d,{className:rt}),e[83]=rt,e[84]=it);let at=pe?`Collapse`:`Expand`,$;e[85]!==it||e[86]!==at?($=(0,A.jsxs)(w,{className:tt,children:[it,at]}),e[85]=it,e[86]=at,e[87]=$):$=e[87];let ot;e[88]===W?ot=e[89]:(ot=ne.map(e=>(0,A.jsxs)(`div`,{className:`border-t border-border px-4 py-4 first:border-t-0 sm:px-5`,children:[(0,A.jsx)(`p`,{className:`mb-4 text-xs font-medium text-foreground`,children:e.label}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.colors.map(e=>(0,A.jsx)(I,{label:e.label,value:W[e.key],onChange:t=>ve(e.key,t)},e.key))})]},e.label)),e[88]=W,e[89]=ot);let st;e[90]===ot?st=e[91]:(st=(0,A.jsx)(C,{children:ot}),e[90]=ot,e[91]=st);let ct;e[92]!==$||e[93]!==st?(ct=(0,A.jsx)(O,{title:`Terminal Colors`,headerAction:$,children:st}),e[92]=$,e[93]=st,e[94]=ct):ct=e[94];let lt;e[95]!==ct||e[96]!==pe?(lt=(0,A.jsx)(T,{open:pe,onOpenChange:me,children:ct}),e[95]=ct,e[96]=pe,e[97]=lt):lt=e[97];let ut;e[98]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,A.jsx)(f,{className:`size-3.5`}),e[98]=ut):ut=e[98];let dt;e[99]===we?dt=e[100]:(dt=(0,A.jsx)(`div`,{className:`flex justify-end pb-6`,children:(0,A.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:we,children:[ut,`Reset all colors`]})}),e[99]=we,e[100]=dt);let ft;return e[101]!==Y||e[102]!==Qe||e[103]!==$e||e[104]!==et||e[105]!==lt||e[106]!==dt?(ft=(0,A.jsxs)(E,{children:[Y,Qe,$e,et,lt,dt]}),e[101]=Y,e[102]=Qe,e[103]=$e,e[104]=et,e[105]=lt,e[106]=dt,e[107]=ft):ft=e[107],ft}function re(e){return(0,A.jsxs)(b,{hideIndicator:!0,value:e.id,children:[e.name,(0,A.jsxs)(`span`,{className:`ml-1.5 text-muted-foreground`,children:[`(`,e.appearance,`)`]})]},e.id)}function ie(){g.add({type:`error`,title:`Copy failed`,description:`Could not copy to clipboard.`})}function ae(){g.add({type:`success`,title:`Copied to clipboard`,description:`Theme JSON has been copied.`})}var oe=R;export{oe as component};
|
|
2
|
-
//# sourceMappingURL=settings.theme-builder-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{C as r}from"./vendor-tanstack-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{s as a}from"./clientSettings-DFgmWajw.js";import"./vendor-effect-Chd9hYxF.js";import{O as o,t as s}from"./utils-B-Di8CjF.js";import"./store-LT9wKN7R.js";import"./terminalStateStore-B-V7Awi_.js";import"./uiStateStore-CgvPrTF8.js";import{Cr as c,Dr as l,Ln as u,er as d,ir as f,kr as p,sr as m}from"./vendor-ui-Ds9VgrYb.js";import"./useSettings-CaigvboL.js";import"./useHandleNewThread-Chs2blac.js";import"./gitReactQuery-BxToLb49.js";import{t as h}from"./input-CthhcRBE.js";import{it as g}from"./index-B42nGfCf.js";import{n as _,t as v}from"./useTheme-7QjQMsSZ.js";import{a as y,i as b,o as x,r as S,s as ee}from"./ProviderModelPicker-BFlX8lZL.js";import"./empty-CwEqZDMX.js";import{n as C,r as w,t as T}from"./collapsible-BEW6Xu4N.js";import{a as E,o as D,s as O}from"./SettingsPanels-_8_YaXgc.js";var te=n(),k=e(t(),1),A=i(),j=[{label:`Base`,description:`Main application background and text colors.`,tokens:[{key:`background`,label:`Background`},{key:`foreground`,label:`Foreground`}]},{label:`Primary`,description:`Buttons, links, and key interactive elements.`,tokens:[{key:`primary`,label:`Primary`},{key:`primaryForeground`,label:`Primary text`}]},{label:`Secondary`,description:`Secondary buttons and less prominent controls.`,tokens:[{key:`secondary`,label:`Secondary`},{key:`secondaryForeground`,label:`Secondary text`}]},{label:`Card`,description:`Card surfaces and their text.`,tokens:[{key:`card`,label:`Card`},{key:`cardForeground`,label:`Card text`}]},{label:`Popover`,description:`Dropdown menus, tooltips, and floating panels.`,tokens:[{key:`popover`,label:`Popover`},{key:`popoverForeground`,label:`Popover text`}]},{label:`Muted`,description:`Subdued backgrounds and secondary text.`,tokens:[{key:`muted`,label:`Muted`},{key:`mutedForeground`,label:`Muted text`}]},{label:`Accent`,description:`Hover states and highlighted areas.`,tokens:[{key:`accent`,label:`Accent`},{key:`accentForeground`,label:`Accent text`}]},{label:`Borders & Input`,description:`Borders, input fields, and focus rings.`,tokens:[{key:`border`,label:`Border`},{key:`input`,label:`Input border`},{key:`ring`,label:`Focus ring`}]},{label:`Destructive`,description:`Errors, deletions, and dangerous actions.`,tokens:[{key:`destructive`,label:`Destructive`},{key:`destructiveForeground`,label:`Destructive text`}]},{label:`Status`,description:`Informational, success, and warning indicators.`,tokens:[{key:`info`,label:`Info`},{key:`infoForeground`,label:`Info text`},{key:`success`,label:`Success`},{key:`successForeground`,label:`Success text`},{key:`warning`,label:`Warning`},{key:`warningForeground`,label:`Warning text`}]}],ne=[{label:`Chrome`,colors:[{key:`background`,label:`Background`},{key:`foreground`,label:`Foreground`},{key:`cursor`,label:`Cursor`},{key:`selectionBackground`,label:`Selection`}]},{label:`Scrollbar`,colors:[{key:`scrollbarSliderBackground`,label:`Scrollbar`},{key:`scrollbarSliderHoverBackground`,label:`Scrollbar hover`},{key:`scrollbarSliderActiveBackground`,label:`Scrollbar active`}]},{label:`ANSI Colors`,colors:[{key:`black`,label:`Black`},{key:`red`,label:`Red`},{key:`green`,label:`Green`},{key:`yellow`,label:`Yellow`},{key:`blue`,label:`Blue`},{key:`magenta`,label:`Magenta`},{key:`cyan`,label:`Cyan`},{key:`white`,label:`White`}]},{label:`Bright ANSI Colors`,colors:[{key:`brightBlack`,label:`Bright black`},{key:`brightRed`,label:`Bright red`},{key:`brightGreen`,label:`Bright green`},{key:`brightYellow`,label:`Bright yellow`},{key:`brightBlue`,label:`Bright blue`},{key:`brightMagenta`,label:`Bright magenta`},{key:`brightCyan`,label:`Bright cyan`},{key:`brightWhite`,label:`Bright white`}]}];function M(e){let{radius:t,tokens:n,terminal:r}=_(e);return{radius:t,tokens:n,terminalColors:r}}function N(e){return parseInt(e,10).toString(16).padStart(2,`0`)}function P(e){let t=e.trim();if(/^#[0-9a-fA-F]{6}$/i.test(t))return t;if(/^#[0-9a-fA-F]{3}$/i.test(t)){let[,e,n,r]=/^#(.)(.)(.)$/i.exec(t);return`#${e}${e}${n}${n}${r}${r}`}let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(t);return n?`#${N(n[1])}${N(n[2])}${N(n[3])}`:t}function F(e){return/^#[0-9a-fA-F]{6}$/i.test(e.trim())}function I(e){let t=(0,te.c)(28),{label:n,value:r,onChange:i}=e,a,o;t[0]===r?(a=t[1],o=t[2]):(a=P(r),o=F(a),t[0]=r,t[1]=a,t[2]=o);let s=o,c=(0,k.useRef)(null),l;t[3]===a?l=t[4]:(l={backgroundColor:a},t[3]=a,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c.current?.click(),t[5]=u):u=t[5];let d=`Pick color for ${n}`,f=s?a:`#000000`,p;t[6]===i?p=t[7]:(p=e=>i(e.target.value),t[6]=i,t[7]=p);let m;t[8]!==f||t[9]!==p?(m=(0,A.jsx)(`input`,{ref:c,type:`color`,value:f,onChange:p,className:`absolute inset-0 cursor-pointer opacity-0`,tabIndex:-1}),t[8]=f,t[9]=p,t[10]=m):m=t[10];let g;t[11]!==l||t[12]!==d||t[13]!==m?(g=(0,A.jsx)(`button`,{type:`button`,className:`group relative size-8 shrink-0 cursor-pointer rounded-lg border border-border shadow-xs/5 transition-shadow hover:ring-2 hover:ring-ring/24`,style:l,onClick:u,"aria-label":d,children:m}),t[11]=l,t[12]=d,t[13]=m,t[14]=g):g=t[14];let _;t[15]===n?_=t[16]:(_=(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[15]=n,t[16]=_);let v;t[17]===i?v=t[18]:(v=e=>i(e.target.value),t[17]=i,t[18]=v);let y;t[19]!==v||t[20]!==r?(y=(0,A.jsx)(h,{size:`sm`,value:r,onChange:v,className:`font-mono text-xs`,spellCheck:!1,autoComplete:`off`}),t[19]=v,t[20]=r,t[21]=y):y=t[21];let b;t[22]!==y||t[23]!==_?(b=(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[_,y]}),t[22]=y,t[23]=_,t[24]=b):b=t[24];let x;return t[25]!==b||t[26]!==g?(x=(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[g,b]}),t[25]=b,t[26]=g,t[27]=x):x=t[27],x}function L(e){let t=(0,te.c)(113),{tokens:n}=e,r;t[0]!==n.accent||t[1]!==n.background||t[2]!==n.border||t[3]!==n.card||t[4]!==n.cardForeground||t[5]!==n.destructive||t[6]!==n.destructiveForeground||t[7]!==n.foreground||t[8]!==n.info||t[9]!==n.input||t[10]!==n.muted||t[11]!==n.mutedForeground||t[12]!==n.primary||t[13]!==n.primaryForeground||t[14]!==n.secondary||t[15]!==n.secondaryForeground||t[16]!==n.success||t[17]!==n.warning?(r={"--p-bg":n.background,"--p-fg":n.foreground,"--p-card":n.card,"--p-card-fg":n.cardForeground,"--p-primary":n.primary,"--p-primary-fg":n.primaryForeground,"--p-secondary":n.secondary,"--p-secondary-fg":n.secondaryForeground,"--p-muted":n.muted,"--p-muted-fg":n.mutedForeground,"--p-accent":n.accent,"--p-border":n.border,"--p-input":n.input,"--p-destructive":n.destructive,"--p-destructive-fg":n.destructiveForeground,"--p-info":n.info,"--p-success":n.success,"--p-warning":n.warning,borderColor:n.border},t[0]=n.accent,t[1]=n.background,t[2]=n.border,t[3]=n.card,t[4]=n.cardForeground,t[5]=n.destructive,t[6]=n.destructiveForeground,t[7]=n.foreground,t[8]=n.info,t[9]=n.input,t[10]=n.muted,t[11]=n.mutedForeground,t[12]=n.primary,t[13]=n.primaryForeground,t[14]=n.secondary,t[15]=n.secondaryForeground,t[16]=n.success,t[17]=n.warning,t[18]=r):r=t[18];let i=r,a=`1px solid ${n.border}`,o;t[19]!==a||t[20]!==n.card?(o={backgroundColor:n.card,borderBottom:a},t[19]=a,t[20]=n.card,t[21]=o):o=t[21];let s;t[22]===n.destructive?s=t[23]:(s=(0,A.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{backgroundColor:n.destructive}}),t[22]=n.destructive,t[23]=s);let c;t[24]===n.warning?c=t[25]:(c=(0,A.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{backgroundColor:n.warning}}),t[24]=n.warning,t[25]=c);let l;t[26]===n.success?l=t[27]:(l=(0,A.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{backgroundColor:n.success}}),t[26]=n.success,t[27]=l);let u;t[28]!==s||t[29]!==c||t[30]!==l?(u=(0,A.jsxs)(`div`,{className:`flex gap-1.5`,children:[s,c,l]}),t[28]=s,t[29]=c,t[30]=l,t[31]=u):u=t[31];let d;t[32]===n.mutedForeground?d=t[33]:(d=(0,A.jsx)(`span`,{className:`text-[10px] font-medium`,style:{color:n.mutedForeground},children:`Preview`}),t[32]=n.mutedForeground,t[33]=d);let f;t[34]!==o||t[35]!==u||t[36]!==d?(f=(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,style:o,children:[u,d]}),t[34]=o,t[35]=u,t[36]=d,t[37]=f):f=t[37];let p;t[38]===n.background?p=t[39]:(p={backgroundColor:n.background},t[38]=n.background,t[39]=p);let m=`1px solid ${n.border}`,h;t[40]===m?h=t[41]:(h={borderRight:m},t[40]=m,t[41]=h);let g;t[42]!==n.accent||t[43]!==n.foreground?(g=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px] font-medium`,style:{backgroundColor:n.accent,color:n.foreground},children:`Active item`}),t[42]=n.accent,t[43]=n.foreground,t[44]=g):g=t[44];let _;t[45]===n.mutedForeground?_=t[46]:(_=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px]`,style:{color:n.mutedForeground},children:`Menu item`}),t[45]=n.mutedForeground,t[46]=_);let v;t[47]===n.mutedForeground?v=t[48]:(v=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px]`,style:{color:n.mutedForeground},children:`Menu item`}),t[47]=n.mutedForeground,t[48]=v);let y;t[49]!==h||t[50]!==g||t[51]!==_||t[52]!==v?(y=(0,A.jsxs)(`div`,{className:`w-28 shrink-0 space-y-1 p-2`,style:h,children:[g,_,v]}),t[49]=h,t[50]=g,t[51]=_,t[52]=v,t[53]=y):y=t[53];let b;t[54]===n.foreground?b=t[55]:(b=(0,A.jsx)(`span`,{className:`text-xs font-semibold`,style:{color:n.foreground},children:`Theme Preview`}),t[54]=n.foreground,t[55]=b);let x;t[56]===n.mutedForeground?x=t[57]:(x=(0,A.jsx)(`p`,{className:`text-[10px] leading-relaxed`,style:{color:n.mutedForeground},children:`This is how your theme will look in the application.`}),t[56]=n.mutedForeground,t[57]=x);let S;t[58]!==b||t[59]!==x?(S=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[b,x]}),t[58]=b,t[59]=x,t[60]=S):S=t[60];let ee=`1px solid ${n.border}`,C;t[61]!==ee||t[62]!==n.card?(C={backgroundColor:n.card,border:ee},t[61]=ee,t[62]=n.card,t[63]=C):C=t[63];let w;t[64]===n.cardForeground?w=t[65]:(w=(0,A.jsx)(`span`,{className:`text-[10px] font-medium`,style:{color:n.cardForeground},children:`Card component`}),t[64]=n.cardForeground,t[65]=w);let T;t[66]===n.mutedForeground?T=t[67]:(T=(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px]`,style:{color:n.mutedForeground},children:`Cards contain grouped content.`}),t[66]=n.mutedForeground,t[67]=T);let E;t[68]!==C||t[69]!==w||t[70]!==T?(E=(0,A.jsxs)(`div`,{className:`rounded-lg p-2.5`,style:C,children:[w,T]}),t[68]=C,t[69]=w,t[70]=T,t[71]=E):E=t[71];let D;t[72]!==n.primary||t[73]!==n.primaryForeground?(D=(0,A.jsx)(`span`,{className:`rounded-md px-2.5 py-1 text-[10px] font-medium`,style:{backgroundColor:n.primary,color:n.primaryForeground},children:`Primary`}),t[72]=n.primary,t[73]=n.primaryForeground,t[74]=D):D=t[74];let O;t[75]!==n.secondary||t[76]!==n.secondaryForeground?(O=(0,A.jsx)(`span`,{className:`rounded-md px-2.5 py-1 text-[10px] font-medium`,style:{backgroundColor:n.secondary,color:n.secondaryForeground},children:`Secondary`}),t[75]=n.secondary,t[76]=n.secondaryForeground,t[77]=O):O=t[77];let k;t[78]!==n.destructive||t[79]!==n.destructiveForeground?(k=(0,A.jsx)(`span`,{className:`rounded-md px-2.5 py-1 text-[10px] font-medium`,style:{backgroundColor:n.destructive,color:n.destructiveForeground},children:`Delete`}),t[78]=n.destructive,t[79]=n.destructiveForeground,t[80]=k):k=t[80];let j;t[81]!==D||t[82]!==O||t[83]!==k?(j=(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[D,O,k]}),t[81]=D,t[82]=O,t[83]=k,t[84]=j):j=t[84];let ne=`1px solid ${n.input}`,M;t[85]!==ne||t[86]!==n.background||t[87]!==n.mutedForeground?(M=(0,A.jsx)(`div`,{className:`rounded-md px-2 py-1 text-[10px]`,style:{backgroundColor:n.background,border:ne,color:n.mutedForeground},children:`Placeholder text...`}),t[85]=ne,t[86]=n.background,t[87]=n.mutedForeground,t[88]=M):M=t[88];let N;t[89]===n.info?N=t[90]:(N=(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[9px] font-medium text-white`,style:{backgroundColor:n.info},children:`Info`}),t[89]=n.info,t[90]=N);let P;t[91]===n.success?P=t[92]:(P=(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[9px] font-medium text-white`,style:{backgroundColor:n.success},children:`Success`}),t[91]=n.success,t[92]=P);let F;t[93]===n.warning?F=t[94]:(F=(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-[9px] font-medium text-white`,style:{backgroundColor:n.warning},children:`Warning`}),t[93]=n.warning,t[94]=F);let I;t[95]!==N||t[96]!==P||t[97]!==F?(I=(0,A.jsxs)(`div`,{className:`flex gap-1.5`,children:[N,P,F]}),t[95]=N,t[96]=P,t[97]=F,t[98]=I):I=t[98];let L;t[99]!==S||t[100]!==E||t[101]!==j||t[102]!==M||t[103]!==I?(L=(0,A.jsxs)(`div`,{className:`flex-1 space-y-2.5 p-3`,children:[S,E,j,M,I]}),t[99]=S,t[100]=E,t[101]=j,t[102]=M,t[103]=I,t[104]=L):L=t[104];let R;t[105]!==p||t[106]!==y||t[107]!==L?(R=(0,A.jsxs)(`div`,{className:`flex`,style:p,children:[y,L]}),t[105]=p,t[106]=y,t[107]=L,t[108]=R):R=t[108];let re;return t[109]!==f||t[110]!==i||t[111]!==R?(re=(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-xl border shadow-xs/5`,style:i,children:[f,R]}),t[109]=f,t[110]=i,t[111]=R,t[112]=re):re=t[112],re}function R(){let e=(0,te.c)(108),{themeOptionsByAppearance:t,importTheme:n}=v(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=M(`dark`),e[0]=i):i=e[0];let _=i,N,P;e[1]!==t.dark||e[2]!==t.light?(P=[...t.light,...t.dark],e[1]=t.dark,e[2]=t.light,e[3]=P):P=e[3],N=P;let F=N,[R,oe]=(0,k.useState)(``),[z,se]=(0,k.useState)(``),[B,ce]=(0,k.useState)(``),[V,le]=(0,k.useState)(`dark`),[H,ue]=(0,k.useState)(_.radius),[U,de]=(0,k.useState)(_.tokens),[W,fe]=(0,k.useState)(_.terminalColors),[pe,me]=(0,k.useState)(!1),he;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(he=(e,t)=>{de(n=>({...n,[e]:t}))},e[4]=he):he=e[4];let ge=he,_e;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(e,t)=>{fe(n=>({...n,[e]:t}))},e[5]=_e):_e=e[5];let ve=_e,ye;e[6]===F?ye=e[7]:(ye=e=>{if(e==null)return;let t=F.find(t=>t.id===e);t&&(le(t.appearance),de({...t.tokens}),t.terminal?fe({...t.terminal}):fe(M(t.appearance).terminalColors),t.radius&&ue(t.radius))},e[6]=F,e[7]=ye);let be=ye,xe;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(xe=e=>{if(e!==`light`&&e!==`dark`)return;let t=M(e);le(e),ue(t.radius),de(t.tokens),fe(t.terminalColors)},e[8]=xe):xe=e[8];let Se=xe,Ce;e[9]===V?Ce=e[10]:(Ce=()=>{let e=M(V);oe(``),se(``),ce(``),ue(e.radius),de(e.tokens),fe(e.terminalColors)},e[9]=V,e[10]=Ce);let we=Ce,Te;e[11]!==V||e[12]!==z||e[13]!==B||e[14]!==R||e[15]!==H||e[16]!==W||e[17]!==U?(Te=()=>JSON.stringify({version:1,name:R.trim()||`Untitled Theme`,appearance:V,author:z.trim()||void 0,description:B.trim()||void 0,radius:H,tokens:U,terminal:W},null,2),e[11]=V,e[12]=z,e[13]=B,e[14]=R,e[15]=H,e[16]=W,e[17]=U,e[18]=Te):Te=e[18];let G=Te,Ee;e[19]!==V||e[20]!==G||e[21]!==n||e[22]!==R?(Ee=()=>{let e=R.trim()||`Untitled Theme`;try{n(G()),g.add({type:`success`,title:`Saved "${e}"`,description:`The theme is now active for your ${V} appearance.`})}catch(e){let t=e;g.add({type:`error`,title:`Could not save theme`,description:t instanceof Error?t.message:`The theme data is invalid.`})}},e[19]=V,e[20]=G,e[21]=n,e[22]=R,e[23]=Ee):Ee=e[23];let De=Ee,Oe;e[24]!==G||e[25]!==R?(Oe=()=>{let e=G(),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${(R.trim()||`theme`).toLowerCase().replace(/[^a-z0-9]+/g,`-`)}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},e[24]=G,e[25]=R,e[26]=Oe):Oe=e[26];let ke=Oe,Ae;e[27]===G?Ae=e[28]:(Ae=()=>{navigator.clipboard.writeText(G()).then(ae,ie)},e[27]=G,e[28]=Ae);let je=Ae,Me=o.every(e=>U[e]?.trim()),Ne,Pe;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,A.jsxs)(r,{to:`/settings/appearance`,className:`inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,A.jsx)(u,{className:`size-3.5`}),`Appearance`]}),Pe=(0,A.jsx)(`span`,{className:`text-border`,children:`/`}),e[29]=Ne,e[30]=Pe):(Ne=e[29],Pe=e[30]);let Fe;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[Ne,Pe,(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(d,{className:`size-4 text-primary`}),(0,A.jsx)(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Theme Builder`})]})]}),e[31]=Fe):Fe=e[31];let Ie;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,A.jsx)(p,{className:`size-3.5`}),e[32]=Ie):Ie=e[32];let K;e[33]===je?K=e[34]:(K=(0,A.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:je,title:`Copy JSON`,children:[Ie,`Copy JSON`]}),e[33]=je,e[34]=K);let Le;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,A.jsx)(c,{className:`size-3.5`}),e[35]=Le):Le=e[35];let q;e[36]===ke?q=e[37]:(q=(0,A.jsxs)(a,{size:`sm`,variant:`outline`,onClick:ke,children:[Le,`Export`]}),e[36]=ke,e[37]=q);let Re=!Me,ze;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,A.jsx)(l,{className:`size-3.5`}),e[38]=ze):ze=e[38];let J;e[39]!==De||e[40]!==Re?(J=(0,A.jsxs)(a,{size:`sm`,variant:`default`,disabled:Re,onClick:De,children:[ze,`Save & Apply`]}),e[39]=De,e[40]=Re,e[41]=J):J=e[41];let Y;e[42]!==K||e[43]!==q||e[44]!==J?(Y=(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[Fe,(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,q,J]})]}),e[42]=K,e[43]=q,e[44]=J,e[45]=Y):Y=e[45];let Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(Be=e=>oe(e.target.value),e[46]=Be):Be=e[46];let X;e[47]===R?X=e[48]:(X=(0,A.jsx)(D,{title:`Name`,description:`Give your theme a recognizable name.`,control:(0,A.jsx)(h,{size:`sm`,value:R,onChange:Be,placeholder:`My Theme`,className:`w-full sm:w-52`})}),e[47]=R,e[48]=X);let Ve;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=e=>se(e.target.value),e[49]=Ve):Ve=e[49];let Z;e[50]===z?Z=e[51]:(Z=(0,A.jsx)(D,{title:`Author`,description:`Optional creator attribution.`,control:(0,A.jsx)(h,{size:`sm`,value:z,onChange:Ve,placeholder:`Your name`,className:`w-full sm:w-52`})}),e[50]=z,e[51]=Z);let He;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(He=e=>ce(e.target.value),e[52]=He):He=e[52];let Q;e[53]===B?Q=e[54]:(Q=(0,A.jsx)(D,{title:`Description`,description:`A short summary of the theme's look and feel.`,control:(0,A.jsx)(h,{size:`sm`,value:B,onChange:He,placeholder:`A warm dark palette with…`,className:`w-full sm:w-52`})}),e[53]=B,e[54]=Q);let Ue=V===`light`?`Light`:`Dark`,We;e[55]===Ue?We=e[56]:(We=(0,A.jsx)(x,{className:`w-full sm:w-40`,"aria-label":`Appearance`,children:(0,A.jsx)(ee,{children:Ue})}),e[55]=Ue,e[56]=We);let Ge;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,A.jsxs)(y,{align:`end`,alignItemWithTrigger:!1,children:[(0,A.jsx)(b,{hideIndicator:!0,value:`light`,children:`Light`}),(0,A.jsx)(b,{hideIndicator:!0,value:`dark`,children:`Dark`})]}),e[57]=Ge):Ge=e[57];let Ke;e[58]!==V||e[59]!==We?(Ke=(0,A.jsx)(D,{title:`Appearance`,description:`Whether this theme targets light or dark mode.`,control:(0,A.jsxs)(S,{value:V,onValueChange:Se,children:[We,Ge]})}),e[58]=V,e[59]=We,e[60]=Ke):Ke=e[60];let qe;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(qe=e=>ue(e.target.value),e[61]=qe):qe=e[61];let Je;e[62]===H?Je=e[63]:(Je=(0,A.jsx)(D,{title:`Border radius`,description:`Default border radius for UI components.`,control:(0,A.jsx)(h,{size:`sm`,value:H,onChange:qe,placeholder:`0.625rem`,className:`w-full sm:w-40 font-mono text-xs`})}),e[62]=H,e[63]=Je);let Ye;e[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,A.jsx)(x,{className:`w-full sm:w-52`,"aria-label":`Base theme`,children:(0,A.jsx)(ee,{children:`Choose a theme...`})}),e[64]=Ye):Ye=e[64];let Xe;e[65]===F?Xe=e[66]:(Xe=(0,A.jsx)(y,{align:`end`,alignItemWithTrigger:!1,children:F.map(re)}),e[65]=F,e[66]=Xe);let Ze;e[67]!==be||e[68]!==Xe?(Ze=(0,A.jsx)(D,{title:`Start from base`,description:`Load colors from an existing theme to use as a starting point.`,control:(0,A.jsxs)(S,{value:``,onValueChange:be,children:[Ye,Xe]})}),e[67]=be,e[68]=Xe,e[69]=Ze):Ze=e[69];let Qe;e[70]!==X||e[71]!==Z||e[72]!==Q||e[73]!==Ke||e[74]!==Je||e[75]!==Ze?(Qe=(0,A.jsxs)(O,{title:`Theme Details`,children:[X,Z,Q,Ke,Je,Ze]}),e[70]=X,e[71]=Z,e[72]=Q,e[73]=Ke,e[74]=Je,e[75]=Ze,e[76]=Qe):Qe=e[76];let $e,et;e[77]===U?($e=e[78],et=e[79]):($e=(0,A.jsx)(O,{title:`Live Preview`,children:(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(L,{tokens:U})})}),et=j.map(e=>(0,A.jsx)(O,{title:e.label,children:(0,A.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[(0,A.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:e.description}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.tokens.map(e=>(0,A.jsx)(I,{label:e.label,value:U[e.key],onChange:t=>ge(e.key,t)},e.key))})]})},e.label)),e[77]=U,e[78]=$e,e[79]=et);let tt;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(tt=s(`inline-flex items-center gap-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground`),e[80]=tt):tt=e[80];let nt=pe&&`rotate-180`,rt;e[81]===nt?rt=e[82]:(rt=s(`size-3.5 transition-transform duration-200`,nt),e[81]=nt,e[82]=rt);let it;e[83]===rt?it=e[84]:(it=(0,A.jsx)(f,{className:rt}),e[83]=rt,e[84]=it);let at=pe?`Collapse`:`Expand`,$;e[85]!==it||e[86]!==at?($=(0,A.jsxs)(w,{className:tt,children:[it,at]}),e[85]=it,e[86]=at,e[87]=$):$=e[87];let ot;e[88]===W?ot=e[89]:(ot=ne.map(e=>(0,A.jsxs)(`div`,{className:`border-t border-border px-4 py-4 first:border-t-0 sm:px-5`,children:[(0,A.jsx)(`p`,{className:`mb-4 text-xs font-medium text-foreground`,children:e.label}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.colors.map(e=>(0,A.jsx)(I,{label:e.label,value:W[e.key],onChange:t=>ve(e.key,t)},e.key))})]},e.label)),e[88]=W,e[89]=ot);let st;e[90]===ot?st=e[91]:(st=(0,A.jsx)(C,{children:ot}),e[90]=ot,e[91]=st);let ct;e[92]!==$||e[93]!==st?(ct=(0,A.jsx)(O,{title:`Terminal Colors`,headerAction:$,children:st}),e[92]=$,e[93]=st,e[94]=ct):ct=e[94];let lt;e[95]!==ct||e[96]!==pe?(lt=(0,A.jsx)(T,{open:pe,onOpenChange:me,children:ct}),e[95]=ct,e[96]=pe,e[97]=lt):lt=e[97];let ut;e[98]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,A.jsx)(m,{className:`size-3.5`}),e[98]=ut):ut=e[98];let dt;e[99]===we?dt=e[100]:(dt=(0,A.jsx)(`div`,{className:`flex justify-end pb-6`,children:(0,A.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:we,children:[ut,`Reset all colors`]})}),e[99]=we,e[100]=dt);let ft;return e[101]!==Y||e[102]!==Qe||e[103]!==$e||e[104]!==et||e[105]!==lt||e[106]!==dt?(ft=(0,A.jsxs)(E,{children:[Y,Qe,$e,et,lt,dt]}),e[101]=Y,e[102]=Qe,e[103]=$e,e[104]=et,e[105]=lt,e[106]=dt,e[107]=ft):ft=e[107],ft}function re(e){return(0,A.jsxs)(b,{hideIndicator:!0,value:e.id,children:[e.name,(0,A.jsxs)(`span`,{className:`ml-1.5 text-muted-foreground`,children:[`(`,e.appearance,`)`]})]},e.id)}function ie(){g.add({type:`error`,title:`Copy failed`,description:`Could not copy to clipboard.`})}function ae(){g.add({type:`success`,title:`Copied to clipboard`,description:`Theme JSON has been copied.`})}var oe=R;export{oe as component};
|
|
2
|
+
//# sourceMappingURL=settings.theme-builder-CnwNYRga.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{m as r}from"./vendor-tanstack-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{t as a}from"./utils-B-Di8CjF.js";import{
|
|
2
|
-
//# sourceMappingURL=skillsMcpShared-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{m as r}from"./vendor-tanstack-CM5SpFmF.js";import{c as i}from"./vendor--lexical-react-B6TeCrpE.js";import{t as a}from"./utils-B-Di8CjF.js";import{An as o,ir as s}from"./vendor-ui-Ds9VgrYb.js";import{n as c,r as l}from"./useSettings-CaigvboL.js";import{t as u}from"./badge-iReKY3O4.js";import{n as d,r as f,t as p}from"./collapsible-BEW6Xu4N.js";var m=n(),h=e(t(),1),g=i(),_=[`settings`,`mcpServers`,`effective`],v=[`settings`,`skills`,`effective`],y=[];function b(e){let t=(0,m.c)(14),{value:n,onChange:r,placeholder:i,resultCount:a,totalCount:s}=e,c=n.length>0,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,g.jsx)(o,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=e=>r(e.target.value),t[1]=r,t[2]=u);let d;t[3]!==i||t[4]!==u||t[5]!==n?(d=(0,g.jsx)(`input`,{type:`text`,value:n,onChange:u,placeholder:i,className:`min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground/60`}),t[3]=i,t[4]=u,t[5]=n,t[6]=d):d=t[6];let f;t[7]!==c||t[8]!==a||t[9]!==s?(f=c?(0,g.jsxs)(`span`,{className:`shrink-0 text-[11px] tabular-nums text-muted-foreground`,children:[a,` / `,s]}):null,t[7]=c,t[8]=a,t[9]=s,t[10]=f):f=t[10];let p;return t[11]!==d||t[12]!==f?(p=(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-4 py-2 sm:px-5`,children:[l,d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function x(e){let t=(0,m.c)(18),{source:n,count:r,defaultOpen:i,children:o}=e,[c,l]=(0,h.useState)(i),_=!c&&`-rotate-90`,v;t[0]===_?v=t[1]:(v=a(`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200`,_),t[0]=_,t[1]=v);let y;t[2]===v?y=t[3]:(y=(0,g.jsx)(s,{className:v}),t[2]=v,t[3]=y);let b;t[4]===n?b=t[5]:(b=(0,g.jsx)(`span`,{className:`text-xs font-medium capitalize text-foreground`,children:n}),t[4]=n,t[5]=b);let x;t[6]===r?x=t[7]:(x=(0,g.jsx)(u,{variant:`secondary`,className:`text-[10px] tabular-nums`,children:r}),t[6]=r,t[7]=x);let S;t[8]!==y||t[9]!==b||t[10]!==x?(S=(0,g.jsxs)(f,{className:`flex w-full items-center gap-2 border-t border-border px-4 py-2.5 first:border-t-0 hover:bg-accent/40 sm:px-5`,children:[y,b,x]}),t[8]=y,t[9]=b,t[10]=x,t[11]=S):S=t[11];let C;t[12]===o?C=t[13]:(C=(0,g.jsx)(d,{children:(0,g.jsx)(`div`,{children:o})}),t[12]=o,t[13]=C);let w;return t[14]!==c||t[15]!==S||t[16]!==C?(w=(0,g.jsxs)(p,{open:c,onOpenChange:l,children:[S,C]}),t[14]=c,t[15]=S,t[16]=C,t[17]=w):w=t[17],w}var S=[`shiori`,`codex`,`claude`];function C(e){let t=new Map;for(let n of e){let e=t.get(n.source);e?e.push(n):t.set(n.source,[n])}let n=new Map;for(let e of S){let r=t.get(e);r&&n.set(e,r)}for(let[e,r]of t)n.has(e)||n.set(e,r);return n}function w(e,...t){let n=e.toLowerCase();return t.some(e=>e?.toLowerCase().includes(n))}function T(){let e=(0,m.c)(7),t=c(),{updateSettings:n}=l(),i=r(),a=t.mcpServers?.servers??y,o;e[0]!==i||e[1]!==n?(o=e=>{n({mcpServers:{servers:e}}),i.invalidateQueries({queryKey:_}),i.invalidateQueries({queryKey:v})},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,u;return e[3]!==s||e[4]!==i||e[5]!==a?(u={servers:a,persistServers:s,queryClient:i},e[3]=s,e[4]=i,e[5]=a,e[6]=u):u=e[6],u}export{C as a,x as i,v as n,w as o,b as r,T as s,_ as t};
|
|
2
|
+
//# sourceMappingURL=skillsMcpShared-CiunLdEL.js.map
|