Files
archie/ui/dist/assets/Collection.js
T
sam da7efa3f4e fix(ui): keep the chat dock open across navigation
Clicking any navigation control counted as an outside click, so the dock
collapsed on every route change and the conversation disappeared. Hide and
Escape remain the only ways to collapse it.

The e2e accessibility check referenced the removed outside-click launcher and
the old Close chat label; both now use the dock's real controls.
2026-10-26 18:28:32 +11:00

1 line
3.1 KiB
JavaScript

import{I as e,M as t,S as n}from"./badge.js";import{Gt as r,Kt as i,M as a,U as o,Z as s,hn as c,xn as l,y as u,yt as d}from"./PageHeader.js";import{M as f}from"./createLucideIcon.js";function p(n){let r=t(``,1e3);return{search:r,handleTypeaheadSearch:(t,i)=>{if(r.value+=t,n)n(t);else{let t=e(),n=i.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),a=n.find(e=>e.ref===t),o=h(n.map(e=>e.textValue),r.value,a?.textValue),s=n.find(e=>e.textValue===o);return s&&s.ref.focus(),s?.ref}},resetTypeahead:()=>{r.value=``}}}function m(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function h(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=m(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function g(){let e=l();return{primitiveElement:e,currentElement:u(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:n(e))}}var _=`menu.itemSelect`,v=[`Enter`,` `],y=[`ArrowDown`,`PageUp`,`Home`],b=[`ArrowUp`,`PageDown`,`End`],x=[...y,...b],S={ltr:[...v,`ArrowRight`],rtl:[...v,`ArrowLeft`]},C={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]};function w(e){return e?`open`:`closed`}function T(e){return e===`indeterminate`}function E(e){return T(e)?`indeterminate`:e?`checked`:`unchecked`}function D(e){let{onEntryFocus:t,onEntryFocusOnce:n,...r}=e;return r}function O(t){let n=e();for(let r of t)if(r===n||(r.focus(),e()!==n))return}function k(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function A(e,t){return t?k({x:e.clientX,y:e.clientY},t):!1}function j(e){return e.pointerType===`mouse`}var M=`data-reka-collection-item`;function N(e={}){let{key:t=``,isProvider:n=!1}=e,p=`${t}CollectionProvider`,m;if(n){let e=l(new Map);m={collectionRef:l(),itemMap:e},d(p,m)}else m=s(p);let h=(e,t=!1)=>{if(!m.collectionRef.value)return;let n=m.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},_=(e=!1)=>{let t=m.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${M}]`)),r=new Map(n.map((e,t)=>[e,t])),i=Array.from(m.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?i:i.filter(e=>e.ref.dataset.disabled!==``)},v=a({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:i,currentElement:a}=g();return r(a,()=>{m.collectionRef.value=a.value}),()=>o(f,{ref:i,...n},t)}}),y=a({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=g();return i(t=>{if(a.value){let n=c(a.value);m.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>m.itemMap.value.delete(n))}}),()=>o(f,{...n,[M]:``,ref:r},t)}});return{getItems:_,getItem:h,reactiveItems:u(()=>Array.from(m.itemMap.value.values())),itemMapSize:u(()=>m.itemMap.value.size),CollectionSlot:v,CollectionItem:y}}export{m as _,v as a,O as c,T as d,j as f,p as g,g as h,b as i,E as l,D as m,x as n,C as o,A as p,_ as r,S as s,N as t,w as u};