@nextclaw/ui 0.12.5 → 0.12.7
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/CHANGELOG.md +65 -0
- package/dist/assets/ChannelsList-D8p4OlM6.js +8 -0
- package/dist/assets/ChatPage-A45t1Rmf.js +58 -0
- package/dist/assets/DocBrowser-B2MpsnU9.js +1 -0
- package/dist/assets/{DocBrowser-QUZ3nfmH.js → DocBrowser-Cse_F8Nn.js} +1 -1
- package/dist/assets/{DocBrowserContext-CpiIfhJO.js → DocBrowserContext-Bai1WU2H.js} +1 -1
- package/dist/assets/{LogoBadge-BUK13xK5.js → LogoBadge-BdxMPc9v.js} +1 -1
- package/dist/assets/MarketplacePage-BNZ3Jx5d.js +1 -0
- package/dist/assets/MarketplacePage-BbpAkllU.js +49 -0
- package/dist/assets/{McpMarketplacePage-BG4T_Pcx.js → McpMarketplacePage-CxPFOgxv.js} +2 -2
- package/dist/assets/ModelConfig-3GLqQ5GY.js +1 -0
- package/dist/assets/{ProviderScopedModelInput-DGn6sFEN.js → ProviderScopedModelInput-BYNouw-i.js} +1 -1
- package/dist/assets/ProvidersList-BR1gJ4Dm.js +1 -0
- package/dist/assets/{RemoteAccessPage-ff15qO-c.js → RemoteAccessPage-DyYVWsyK.js} +1 -1
- package/dist/assets/{RuntimeConfig-TgPandXF.js → RuntimeConfig-ChdfK4Y_.js} +1 -1
- package/dist/assets/SearchConfig-DTeJvp8m.js +1 -0
- package/dist/assets/{SecretsConfig-Bew4EF2A.js → SecretsConfig-CCYO6NcV.js} +2 -2
- package/dist/assets/SessionsConfig-Du39vDgt.js +2 -0
- package/dist/assets/app-query-client-Dr5d-K8d.js +1 -0
- package/dist/assets/{book-open-CJG8Yz3U.js → book-open-Da4OEPqB.js} +1 -1
- package/dist/assets/chat-session-display-CAlPrnlV.js +1 -0
- package/dist/assets/{chunk-JZWAC4HX-D5b3Iyas.js → chunk-JZWAC4HX-CoFVxHXV.js} +1 -1
- package/dist/assets/client-CSk58DcF.js +7 -0
- package/dist/assets/config-D8KzikVB.js +1 -0
- package/dist/assets/{createLucideIcon-_FMJqZw2.js → createLucideIcon-83gaZMtv.js} +1 -1
- package/dist/assets/desktop-update-config-CfoVwf-w.js +1 -0
- package/dist/assets/dist-aTmhMDVh.js +9 -0
- package/dist/assets/{dist-B1fpOuON.js → dist-toEYs-MZ.js} +1 -1
- package/dist/assets/{external-link-b7gAJWYY.js → external-link-QQ0TC6X4.js} +1 -1
- package/dist/assets/{hash-Bhy4TwfZ.js → hash-DaFBEkmi.js} +1 -1
- package/dist/assets/i18n-C3jb83S6.js +1 -0
- package/dist/assets/index-CE4N7ItL.css +1 -0
- package/dist/assets/index-riX7Sg0_.js +6 -0
- package/dist/assets/infiniteQueryBehavior-BmHX_ayZ.js +1 -0
- package/dist/assets/loader-circle-BjMg63eu.js +1 -0
- package/dist/assets/{logos-GMeYU9vc.js → logos-Dzlz30M3.js} +1 -1
- package/dist/assets/{page-layout-C8UbWuMt.js → page-layout-D2eRufRQ.js} +1 -1
- package/dist/assets/plus-CIXME2pD.js +1 -0
- package/dist/assets/{popover-8HSx9wQj.js → popover-BSXxm5bj.js} +1 -1
- package/dist/assets/{refresh-ccw-CA4_C7Zg.js → refresh-ccw-B3zMtN-_.js} +1 -1
- package/dist/assets/refresh-cw-DlZkIHnJ.js +1 -0
- package/dist/assets/{save-BtvMy4lk.js → save-Us9fg4Sj.js} +1 -1
- package/dist/assets/search-B_Qr0f6C.js +1 -0
- package/dist/assets/security-config-BGWYwxNr.js +1 -0
- package/dist/assets/{select-xp_Ac8ip.js → select-DLYqySQK.js} +1 -1
- package/dist/assets/skeleton-CYQJazv6.js +1 -0
- package/dist/assets/{status-dot-Cn4Pp7DZ.js → status-dot-DGayudyB.js} +1 -1
- package/dist/assets/{switch-BTi6UOij.js → switch-Dz2ScsKx.js} +1 -1
- package/dist/assets/{tabs-custom-BiiN8DME.js → tabs-custom-CdKyjiGk.js} +1 -1
- package/dist/assets/{trash-2-BpsF0N-r.js → trash-2-Db-mZOZs.js} +1 -1
- package/dist/assets/use-infinite-scroll-loader-DBJX5hj0.js +1 -0
- package/dist/assets/{useConfirmDialog-BJIwUZjH.js → useConfirmDialog-DL0a-oGC.js} +1 -1
- package/dist/assets/useMutation-BdZm-9PL.js +1 -0
- package/dist/assets/x-B8Tho_xC.js +1 -0
- package/dist/index.html +20 -19
- package/package.json +3 -3
- package/src/App.tsx +2 -0
- package/src/api/raw-client.test.ts +37 -0
- package/src/api/raw-client.ts +51 -8
- package/src/components/chat/ChatConversationPanel.test.tsx +161 -1
- package/src/components/chat/ChatSidebar.test.tsx +109 -4
- package/src/components/chat/ChatSidebar.tsx +62 -9
- package/src/components/chat/chat-child-session-panel.tsx +56 -18
- package/src/components/chat/chat-sidebar-session-item.tsx +189 -121
- package/src/components/chat/containers/chat-message-list.container.test.tsx +21 -3
- package/src/components/chat/containers/chat-message-list.container.tsx +14 -0
- package/src/components/chat/managers/chat-session-list.manager.test.ts +34 -0
- package/src/components/chat/managers/chat-session-list.manager.ts +13 -0
- package/src/components/chat/ncp/ncp-app-client-fetch.test.ts +1 -1
- package/src/components/chat/ncp/ncp-app-client-fetch.ts +45 -5
- package/src/components/chat/ncp/session-conversation/use-ncp-child-session-tabs-view.ts +18 -5
- package/src/components/chat/stores/chat-session-list.store.ts +96 -5
- package/src/components/config/ProviderForm.tsx +9 -15
- package/src/components/config/desktop-update-config.tsx +230 -0
- package/src/components/layout/Sidebar.tsx +6 -1
- package/src/components/layout/sidebar.layout.test.tsx +1 -0
- package/src/desktop/desktop-update.types.ts +36 -0
- package/src/desktop/managers/desktop-update.manager.ts +163 -0
- package/src/desktop/stores/desktop-update.store.ts +18 -0
- package/src/lib/desktop-update-labels.utils.ts +72 -0
- package/src/lib/i18n.chat.ts +13 -0
- package/src/lib/i18n.ts +3 -9
- package/src/lib/ui-document-title.ts +1 -0
- package/src/transport/local.transport.ts +57 -18
- package/src/vite-env.d.ts +10 -0
- package/dist/assets/ChannelsList-C6-lh55g.js +0 -8
- package/dist/assets/ChatPage-DOW0gPc2.js +0 -45
- package/dist/assets/DocBrowser-CGyeswYP.js +0 -1
- package/dist/assets/MarketplacePage-BDVwhIYE.js +0 -1
- package/dist/assets/MarketplacePage-LnKKL3xK.js +0 -49
- package/dist/assets/ModelConfig-LtWuogIw.js +0 -1
- package/dist/assets/ProvidersList-ma-_MlLo.js +0 -1
- package/dist/assets/SearchConfig-C9iBt7pl.js +0 -1
- package/dist/assets/SessionsConfig-2r2yAGZg.js +0 -2
- package/dist/assets/chat-session-display-DkAC5OMC.js +0 -1
- package/dist/assets/config-zvnxSXSP.js +0 -1
- package/dist/assets/dist-BCXX7FD-.js +0 -15
- package/dist/assets/i18n-DJg9BPYk.js +0 -1
- package/dist/assets/index-BoJbxdvZ.css +0 -1
- package/dist/assets/index-CtlT4E9Y.js +0 -6
- package/dist/assets/infiniteQueryBehavior-CTcVlD9s.js +0 -1
- package/dist/assets/loader-circle-B60I0hEk.js +0 -1
- package/dist/assets/plus-CR7RfK3H.js +0 -1
- package/dist/assets/react-BB4jko2M.js +0 -1
- package/dist/assets/search-C60UA27E.js +0 -1
- package/dist/assets/security-config-BkFDYZ6j.js +0 -1
- package/dist/assets/skeleton-uxz_5h3A.js +0 -1
- package/dist/assets/use-infinite-scroll-loader-C8jBv11-.js +0 -1
- package/dist/assets/useMutation-BjBOKHj_.js +0 -1
- package/dist/assets/x-BfTu-g7D.js +0 -1
- package/src/components/chat/ChatSessionsSidebar.tsx +0 -100
- /package/dist/assets/{config-hints-WtpHP_DW.js → config-hints-GSUMvmSo.js} +0 -0
- /package/dist/assets/{config-layout-LQ10ozRC.js → config-layout-CgBMG7OL.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,b as t,x as n,y as r}from"./dist-BCXX7FD-.js";function i(i){return{onFetch:(s,c)=>{let l=s.options,u=s.fetchOptions?.meta?.fetchMore?.direction,d=s.state.data?.pages||[],f=s.state.data?.pageParams||[],p={pages:[],pageParams:[]},m=0,h=async()=>{let c=!1,h=e=>{r(e,()=>s.signal,()=>c=!0)},g=e(s.options,s.fetchOptions),_=async(e,r,i)=>{if(c)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await g((()=>{let e={client:s.client,queryKey:s.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:s.options.meta};return h(e),e})()),{maxPages:o}=s.options,l=i?n:t;return{pages:l(e.pages,a,o),pageParams:l(e.pageParams,r,o)}};if(u&&d.length){let e=u===`backward`,t=e?o:a,n={pages:d,pageParams:f};p=await _(n,t(l,n),e)}else{let e=i??d.length;do{let e=m===0?f[0]??l.initialPageParam:a(l,p);if(m>0&&e==null)break;p=await _(p,e),m++}while(m<e)}return p};s.options.persister?s.fetchFn=()=>s.options.persister?.(h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},c):s.fetchFn=h}}}function a(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function o(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function s(e,t){return t?a(e,t)!=null:!1}function c(e,t){return!t||!e.getPreviousPageParam?!1:o(e,t)!=null}export{c as n,i as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-_FMJqZw2.js";var t=e(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-_FMJqZw2.js";var t=e(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-DJg9BPYk.js";import{A as n,C as r,D as i,E as a,N as o,O as s,P as c,T as l,_ as u,f as d,g as f,h as p,k as m,v as h,w as g}from"./dist-BCXX7FD-.js";import{r as _}from"./infiniteQueryBehavior-CTcVlD9s.js";var v=class extends c{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new d({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=y(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=y(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=y(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=y(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){u.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>a(t,e))}findAll(e={}){return this.getAll().filter(t=>a(e,t))}notify(e){u.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return u.batch(()=>Promise.all(e.map(e=>e.continue().catch(s))))}};function y(e){return e.options.scope?.id}var b=class extends c{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??l(r,t),a=this.get(i);return a||(a=new p({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){u.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>i(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>i(e,t)):t}notify(e){u.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){u.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){u.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},x=new class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new b,this.#t=e.mutationCache||new v,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=f.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#e.build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(n(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let i=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(i.queryHash)?.state.data,o=r(t,a);if(o!==void 0)return this.#e.build(this,i).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return u.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;u.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return u.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=u.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(s).catch(s)}invalidateQueries(e,t={}){return u.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=u.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(s)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(s)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let r=this.#e.build(this,t);return r.isStaleByTime(n(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(s).catch(s)}fetchInfiniteQuery(e){return e.behavior=_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(s).catch(s)}ensureInfiniteQueryData(e){return e.behavior=_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(g(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{m(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(g(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{m(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=l(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===o&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}}),S=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},C=(e=>e?S(e):S),w=e(t(),1),T=e=>e;function E(e,t=T){let n=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>t(e.getState()),[e,t]),w.useCallback(()=>t(e.getInitialState()),[e,t]));return w.useDebugValue(n),n}var D=e=>{let t=C(e),n=e=>E(t,e);return Object.assign(n,t),n},O=(e=>e?D(e):D);export{x as n,O as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-_FMJqZw2.js";var t=e(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,p as r}from"./i18n-DJg9BPYk.js";import{n as i,o as a}from"./dist-BCXX7FD-.js";import{$ as o,B as s,G as c,H as l,J as u,K as d,U as f,V as p,W as m,et as h,q as g,z as _}from"./index-CtlT4E9Y.js";import{n as v,t as y}from"./page-layout-C8UbWuMt.js";import{t as b}from"./switch-BTi6UOij.js";var x=e(n(),1),S=r(),C=8;function w(e){return e.trim().length>=C}function T(e,n){return e===n?!0:(i.error(t(`authPasswordMismatch`)),!1)}function E(){let e=_(),n=p(),r=l(),i=f(),v=s(),[y,C]=(0,x.useState)(``),[E,D]=(0,x.useState)(``),[O,k]=(0,x.useState)(``),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(``),P=e.data,F=y.trim().length>0&&w(E)&&E===O&&!n.isPending,I=w(A)&&A===M&&!i.isPending,L=async()=>{if(T(E,O))try{await n.mutateAsync({username:y.trim(),password:E}),D(``),k(``)}catch{}},R=async()=>{if(T(A,M))try{await i.mutateAsync({password:A}),j(``),N(``)}catch{}},z=async e=>{try{await r.mutateAsync({enabled:e})}catch{}},B=async()=>{try{await v.mutateAsync()}catch{}};return e.isLoading&&!P?(0,S.jsxs)(m,{children:[(0,S.jsxs)(g,{children:[(0,S.jsx)(u,{children:t(`authSecurityTitle`)}),(0,S.jsx)(d,{children:t(`authSecurityDescription`)})]}),(0,S.jsx)(c,{className:`text-sm text-gray-500`,children:t(`loading`)})]}):e.isError||!P?(0,S.jsxs)(m,{children:[(0,S.jsxs)(g,{children:[(0,S.jsx)(u,{children:t(`authSecurityTitle`)}),(0,S.jsx)(d,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(c,{className:`space-y-4`,children:[(0,S.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`authStatusLoadFailed`)}),(0,S.jsx)(a,{variant:`outline`,onClick:()=>{e.refetch()},children:t(`authRetryStatus`)})]})]}):P.configured?(0,S.jsxs)(m,{children:[(0,S.jsxs)(g,{children:[(0,S.jsx)(u,{children:t(`authSecurityTitle`)}),(0,S.jsx)(d,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(c,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authStatusLabel`)}),(0,S.jsx)(`p`,{className:`text-sm text-gray-600`,children:t(`authStatusConfiguredUser`).replace(`{username}`,P.username??``)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authUsernameFixedHelp`)})]}),(0,S.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700`,children:P.enabled?t(`enabled`):t(`disabled`)})]}),(0,S.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authEnableLabel`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:P.enabled?t(`authEnableOnHelp`):t(`authEnableOffHelp`)})]}),(0,S.jsx)(b,{checked:P.enabled,disabled:r.isPending,onCheckedChange:e=>{z(e)}})]})]}),(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4 space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authPasswordSectionTitle`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordSectionDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(o,{htmlFor:`auth-password-next`,children:t(`authPassword`)}),(0,S.jsx)(h,{id:`auth-password-next`,type:`password`,value:A,onChange:e=>j(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(o,{htmlFor:`auth-password-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(h,{id:`auth-password-confirm`,type:`password`,value:M,onChange:e=>N(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,S.jsx)(a,{type:`button`,disabled:!I,onClick:()=>void R(),children:i.isPending?t(`authPasswordUpdating`):t(`authPasswordAction`)}),P.enabled&&P.authenticated?(0,S.jsx)(a,{type:`button`,variant:`outline`,disabled:v.isPending,onClick:()=>void B(),children:v.isPending?t(`authLoggingOut`):t(`authLogoutAction`)}):null]}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authSessionMemoryNotice`)})]})]})]}):(0,S.jsxs)(m,{children:[(0,S.jsxs)(g,{children:[(0,S.jsx)(u,{children:t(`authSecurityTitle`)}),(0,S.jsx)(d,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(c,{className:`space-y-5`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authSetupTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t(`authSetupDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(o,{htmlFor:`auth-setup-username`,children:t(`authUsername`)}),(0,S.jsx)(h,{id:`auth-setup-username`,value:y,onChange:e=>C(e.target.value),placeholder:t(`authUsernamePlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(o,{htmlFor:`auth-setup-password`,children:t(`authPassword`)}),(0,S.jsx)(h,{id:`auth-setup-password`,type:`password`,value:E,onChange:e=>D(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(o,{htmlFor:`auth-setup-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(h,{id:`auth-setup-confirm`,type:`password`,value:O,onChange:e=>k(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordMinLengthHint`)})]}),(0,S.jsx)(a,{type:`button`,disabled:!F,onClick:()=>void L(),children:n.isPending?t(`authSettingUp`):t(`authSetupAction`)})]})]})}function D(){return(0,S.jsxs)(v,{className:`space-y-6`,children:[(0,S.jsx)(y,{title:t(`authSecurityTitle`),description:t(`authSecurityDescription`)}),(0,S.jsx)(E,{})]})}export{D as SecurityConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,u as t}from"./i18n-DJg9BPYk.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`animate-pulse rounded-md bg-slate-200`,e),...r})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,p as r}from"./i18n-DJg9BPYk.js";import{l as i,m as a}from"./dist-BCXX7FD-.js";import{n as o,r as s,t as c}from"./infiniteQueryBehavior-CTcVlD9s.js";import{a as l,i as u,n as d,r as f,t as p}from"./select-xp_Ac8ip.js";import{t as m}from"./createLucideIcon-_FMJqZw2.js";import{t as h}from"./skeleton-uxz_5h3A.js";var g=class extends a{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:s()})}getOptimisticResult(e){return e.behavior=s(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:s,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=i&&u===`forward`,p=s&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:c(t,n.data),hasPreviousPage:o(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:a&&!f&&!m}}};function _(e,t){return i(e,g,t)}var v=m(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]);function y(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}var b=r();function x(e){return(0,b.jsx)(`div`,{className:`mb-4`,children:(0,b.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,b.jsxs)(`div`,{className:`flex-1 min-w-0 relative`,children:[(0,b.jsx)(v,{className:`h-4 w-4 text-gray-400 absolute left-3 top-1/2 -translate-y-1/2`}),(0,b.jsx)(`input`,{value:e.searchText,onChange:t=>e.onSearchTextChange(t.target.value),placeholder:e.searchPlaceholder,className:`w-full h-9 border border-gray-200/80 rounded-xl pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40`})]}),e.scope===`all`&&(0,b.jsxs)(p,{value:e.sort,onValueChange:t=>e.onSortChange(t),children:[(0,b.jsx)(u,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,b.jsx)(l,{})}),(0,b.jsxs)(d,{children:[(0,b.jsx)(f,{value:`relevance`,children:t(`marketplaceSortRelevance`)}),(0,b.jsx)(f,{value:`updated`,children:t(`marketplaceSortUpdated`)})]})]})]})})}function S(e){return(0,b.jsx)(b.Fragment,{children:Array.from({length:e.count},(e,t)=>(0,b.jsx)(`article`,{className:`rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-start gap-3.5 justify-between`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,b.jsx)(h,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2 pt-0.5`,children:[(0,b.jsx)(h,{className:`h-4 w-32 max-w-[70%]`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(h,{className:`h-3 w-12`}),(0,b.jsx)(h,{className:`h-3 w-24`})]}),(0,b.jsx)(h,{className:`h-3 w-full`})]})]}),(0,b.jsx)(h,{className:`h-8 w-20 shrink-0 rounded-xl`})]})},`marketplace-skeleton-${t}`))})}function C(e){return!e.hasMore&&!e.loading?null:(0,b.jsxs)(`div`,{className:`py-4`,children:[e.hasMore&&(0,b.jsx)(`div`,{ref:e.sentinelRef,className:`h-1 w-full`,"aria-hidden":`true`}),e.loading&&(0,b.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:t(`loading`)})]})}function w(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function T(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function E(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:T(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=T(t),r=e.get(n);if(r)return r}for(let e of n){let n=T(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function D(e,t){if(!e)return``;for(let n of t)if(T(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}var O=e(n(),1),k=160;function A(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(e.onLoadMore),i=(0,O.useRef)(!1);return(0,O.useEffect)(()=>{r.current=e.onLoadMore},[e.onLoadMore]),(0,O.useEffect)(()=>{e.disabled&&(i.current=!1)},[e.disabled]),(0,O.useEffect)(()=>{let a=t.current,o=n.current,s=e.thresholdPx??k;if(e.disabled||!a||!o)return;let c=()=>{i.current||e.disabled||(i.current=!0,Promise.resolve(r.current()).finally(()=>{i.current=!1}))},l=()=>{o.getBoundingClientRect().top-a.getBoundingClientRect().bottom<=s&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:a,rootMargin:`0px 0px ${s}px 0px`});return e.observe(o),l(),()=>{e.disconnect()}}return a.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{a.removeEventListener(`scroll`,l)}},[e.disabled,e.thresholdPx,e.watchValue]),{containerRef:t,sentinelRef:n}}export{x as a,y as c,E as i,_ as l,w as n,C as o,D as r,S as s,A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-DJg9BPYk.js";import{M as n,O as r,P as i,_ as a,d as o,j as s,p as c,w as l}from"./dist-BCXX7FD-.js";var u=class extends i{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),s(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??c();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){a.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=e(t(),1);function f(e,t){let i=o(t),[s]=d.useState(()=>new u(i,e));d.useEffect(()=>{s.setOptions(e)},[s,e]);let c=d.useSyncExternalStore(d.useCallback(e=>s.subscribe(a.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),l=d.useCallback((e,t)=>{s.mutate(e,t).catch(r)},[s]);if(c.error&&n(s.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:l,mutateAsync:c.mutate}}export{f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-_FMJqZw2.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { SessionEntryView } from '@/api/types';
|
|
2
|
-
import { Button } from '@/components/ui/button';
|
|
3
|
-
import { Input } from '@/components/ui/input';
|
|
4
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
import { formatDateTime, t } from '@/lib/i18n';
|
|
7
|
-
import { MessageSquareText, Plus, RefreshCw, Search } from 'lucide-react';
|
|
8
|
-
|
|
9
|
-
type ChatSessionsSidebarProps = {
|
|
10
|
-
query: string;
|
|
11
|
-
onQueryChange: (value: string) => void;
|
|
12
|
-
selectedChannel: string;
|
|
13
|
-
onSelectedChannelChange: (value: string) => void;
|
|
14
|
-
channelOptions: string[];
|
|
15
|
-
channelLabel: (channel: string) => string;
|
|
16
|
-
isLoading: boolean;
|
|
17
|
-
isRefreshing: boolean;
|
|
18
|
-
sessions: SessionEntryView[];
|
|
19
|
-
selectedSessionKey: string | null;
|
|
20
|
-
onSelectSession: (key: string) => void;
|
|
21
|
-
sessionTitle: (session: SessionEntryView) => string;
|
|
22
|
-
onRefresh: () => void;
|
|
23
|
-
onCreateSession: () => void;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export function ChatSessionsSidebar(props: ChatSessionsSidebarProps) {
|
|
27
|
-
return (
|
|
28
|
-
<aside className="w-[320px] max-lg:w-full shrink-0 rounded-2xl border border-gray-200 bg-white shadow-card flex flex-col min-h-0">
|
|
29
|
-
<div className="p-4 border-b border-gray-100 space-y-3">
|
|
30
|
-
<div className="relative">
|
|
31
|
-
<Search className="h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400" />
|
|
32
|
-
<Input
|
|
33
|
-
value={props.query}
|
|
34
|
-
onChange={(event) => props.onQueryChange(event.target.value)}
|
|
35
|
-
placeholder={t('chatSearchSessionPlaceholder')}
|
|
36
|
-
className="pl-8 h-9 rounded-lg text-xs"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
<Select value={props.selectedChannel} onValueChange={props.onSelectedChannelChange}>
|
|
40
|
-
<SelectTrigger className="h-9 rounded-lg text-xs">
|
|
41
|
-
<SelectValue placeholder={t('sessionsAllChannels')} />
|
|
42
|
-
</SelectTrigger>
|
|
43
|
-
<SelectContent>
|
|
44
|
-
<SelectItem value="all">{t('sessionsAllChannels')}</SelectItem>
|
|
45
|
-
{props.channelOptions.map((channel) => (
|
|
46
|
-
<SelectItem key={channel} value={channel}>
|
|
47
|
-
{props.channelLabel(channel)}
|
|
48
|
-
</SelectItem>
|
|
49
|
-
))}
|
|
50
|
-
</SelectContent>
|
|
51
|
-
</Select>
|
|
52
|
-
<div className="grid grid-cols-2 gap-2">
|
|
53
|
-
<Button variant="outline" size="sm" className="rounded-lg" onClick={props.onRefresh}>
|
|
54
|
-
<RefreshCw className={cn('h-3.5 w-3.5 mr-1.5', props.isRefreshing && 'animate-spin')} />
|
|
55
|
-
{t('chatRefresh')}
|
|
56
|
-
</Button>
|
|
57
|
-
<Button variant="subtle" size="sm" className="rounded-lg" onClick={props.onCreateSession}>
|
|
58
|
-
<Plus className="h-3.5 w-3.5 mr-1.5" />
|
|
59
|
-
{t('chatNewSession')}
|
|
60
|
-
</Button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<div className="flex-1 min-h-0 overflow-y-auto custom-scrollbar p-2">
|
|
65
|
-
{props.isLoading ? (
|
|
66
|
-
<div className="text-sm text-gray-500 p-4">{t('sessionsLoading')}</div>
|
|
67
|
-
) : props.sessions.length === 0 ? (
|
|
68
|
-
<div className="p-5 m-2 rounded-xl border border-dashed border-gray-200 text-center text-sm text-gray-500">
|
|
69
|
-
<MessageSquareText className="h-7 w-7 mx-auto mb-2 text-gray-300" />
|
|
70
|
-
{t('sessionsEmpty')}
|
|
71
|
-
</div>
|
|
72
|
-
) : (
|
|
73
|
-
<div className="space-y-1">
|
|
74
|
-
{props.sessions.map((session) => {
|
|
75
|
-
const active = props.selectedSessionKey === session.key;
|
|
76
|
-
return (
|
|
77
|
-
<button
|
|
78
|
-
key={session.key}
|
|
79
|
-
onClick={() => props.onSelectSession(session.key)}
|
|
80
|
-
className={cn(
|
|
81
|
-
'w-full rounded-xl border px-3 py-2.5 text-left transition-all',
|
|
82
|
-
active
|
|
83
|
-
? 'border-primary/30 bg-primary/5'
|
|
84
|
-
: 'border-transparent hover:border-gray-200 hover:bg-gray-50'
|
|
85
|
-
)}
|
|
86
|
-
>
|
|
87
|
-
<div className="text-sm font-semibold text-gray-900 truncate">{props.sessionTitle(session)}</div>
|
|
88
|
-
<div className="mt-1 text-[11px] text-gray-500 truncate">{session.key}</div>
|
|
89
|
-
<div className="mt-1 text-[11px] text-gray-400">
|
|
90
|
-
{session.messageCount} · {formatDateTime(session.updatedAt)}
|
|
91
|
-
</div>
|
|
92
|
-
</button>
|
|
93
|
-
);
|
|
94
|
-
})}
|
|
95
|
-
</div>
|
|
96
|
-
)}
|
|
97
|
-
</div>
|
|
98
|
-
</aside>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
File without changes
|
|
File without changes
|