Comparing version 0.1.13 to 0.1.14
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _reactdialog = require('@radix-ui/react-dialog'); var S = _interopRequireWildcard(_reactdialog);var _react = require('react'); var e = _interopRequireWildcard(_react);var _commandscore = require('command-score'); var _commandscore2 = _interopRequireDefault(_commandscore);var ne='[cmdk-list-sizer=""]',w='[cmdk-group=""]',j='[cmdk-group-items=""]',oe='[cmdk-group-heading=""]',J='[cmdk-item=""]',W=`${J}:not([aria-disabled="true"])`,K="cmdk-item-select",E="data-value",ie=(r,i)=>_commandscore2.default.call(void 0, r,i),Q=e.createContext(void 0),I=()=>e.useContext(Q),X=e.createContext(void 0),$=()=>e.useContext(X),Y=e.createContext(void 0),Z=e.forwardRef((r,i)=>{let n=e.useRef(null),o=x(()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}})),u=x(()=>new Set),l=x(()=>new Map),g=x(()=>new Map),m=x(()=>new Set),d=ee(r),p=e.useId(),b=e.useId(),h=e.useId(),R=Re();L(()=>{if(r.value!==void 0){let t=r.value.trim().toLowerCase();o.current.value=t,N(),f.emit()}},[r.value]);let f=e.useMemo(()=>({subscribe:t=>(m.current.add(t),()=>m.current.delete(t)),snapshot:()=>o.current,setState:(t,s)=>{var a,c,v;if(!Object.is(o.current[t],s)){if(o.current[t]=s,t==="search")A(),O(),R(1,()=>{_(),f.emit()});else if(t==="value")if(((a=d.current)==null?void 0:a.value)!==void 0){(v=(c=d.current).onValueChange)==null||v.call(c,s);return}else N();f.emit()}},emit:()=>{m.current.forEach(t=>t())}}),[]),y=e.useMemo(()=>({value:(t,s)=>{s!==g.current.get(t)&&(g.current.set(t,s),o.current.filtered.items.set(t,q(s)),R(2,()=>{O(),f.emit()}))},item:(t,s)=>(u.current.add(t),s&&(l.current.has(s)?l.current.get(s).add(t):l.current.set(s,new Set([t]))),R(3,()=>{A(),O(),o.current.value||_(),f.emit()}),()=>{g.current.delete(t),u.current.delete(t),o.current.filtered.items.delete(t),R(4,()=>{A(),_(),f.emit()})}),group:t=>(l.current.has(t)||l.current.set(t,new Set),()=>{g.current.delete(t),l.current.delete(t)}),filter:()=>d.current.shouldFilter,label:r.label||r["aria-label"],listId:p,inputId:h,labelId:b}),[]);function q(t){var a,c;let s=(c=(a=d.current)==null?void 0:a.filter)!=null?c:ie;return t?s(t,o.current.search):0}function O(){if(!n.current||!o.current.search||d.current.shouldFilter===!1)return;let t=o.current.filtered.items,s=[];o.current.filtered.groups.forEach(c=>{let v=l.current.get(c),C=0;v.forEach(F=>{let H=t.get(F);C=Math.max(H,C)}),s.push([c,C])});let a=n.current.querySelector(ne);D().sort((c,v)=>{var H,B;let C=c.getAttribute(E),F=v.getAttribute(E);return((H=t.get(F))!=null?H:0)-((B=t.get(C))!=null?B:0)}).forEach(c=>{let v=c.closest(j);v?v.appendChild(c.parentElement===v?c:c.closest(`${j} > *`)):a.appendChild(c.parentElement===a?c:c.closest(`${j} > *`))}),s.sort((c,v)=>v[1]-c[1]).forEach(c=>{let v=n.current.querySelector(`${w}[${E}="${c[0]}"]`);v==null||v.parentElement.appendChild(v)})}function _(){let t=D().find(a=>!a.ariaDisabled),s=t==null?void 0:t.getAttribute(E);o.current.value=s||void 0}function A(){if(!o.current.search||d.current.shouldFilter===!1){o.current.filtered.count=u.current.size;return}o.current.filtered.groups=new Set;let t=0;for(let s of u.current){let a=g.current.get(s),c=q(a);o.current.filtered.items.set(s,c),c>0&&t++}for(let[s,a]of l.current)for(let c of a)if(o.current.filtered.items.get(c)>0){o.current.filtered.groups.add(s);break}o.current.filtered.count=t}function N(){var s,a,c;let t=P();t&&(((s=t.parentElement)==null?void 0:s.firstChild)===t&&((c=(a=t.closest(w))==null?void 0:a.querySelector(oe))==null||c.scrollIntoView({block:"nearest"})),t.scrollIntoView({block:"nearest"}))}function P(){return n.current.querySelector(`${J}[aria-selected="true"]`)}function D(){return Array.from(n.current.querySelectorAll(W))}function G(t){let a=D()[t];a&&f.setState("value",a.getAttribute(E))}function V(t){let s=P(),a=D(),c=a.findIndex(C=>C===s),v=a[c+t];v&&f.setState("value",v.getAttribute(E))}function z(t){let s=P(),a=s==null?void 0:s.closest(w),c;for(;a&&!c;)a=t>0?ge(a,w):ve(a,w),c=a==null?void 0:a.querySelector(W);c?f.setState("value",c.getAttribute(E)):V(t)}let U=()=>G(o.current.filtered.count-1),{label:be,children:he,value:Ee,onValueChange:Se,filter:Ce,shouldFilter:ye,...k}=r;return e.createElement("div",{ref:M([n,i]),...k,"cmdk-root":"",onKeyDown:t=>{var s;if((s=k.onKeyDown)==null||s.call(k,t),!t.defaultPrevented)switch(t.key){case"ArrowDown":return t.metaKey?U():t.altKey?z(1):V(1);case"ArrowUp":return t.metaKey?G(0):t.altKey?z(-1):V(-1);case"Home":return G(0);case"End":return U();case"Enter":{let a=P();if(a){let c=new Event(K);a.dispatchEvent(c)}}}}},e.createElement("label",{"cmdk-label":"",htmlFor:y.inputId,id:y.labelId,style:pe},r.label),e.createElement(X.Provider,{value:f},e.createElement(Q.Provider,{value:y},r.children)))}),ce=e.forwardRef((r,i)=>{let n=e.useId(),o=e.useRef(null),u=e.useContext(Y),l=I(),g=ee(r);L(()=>l.item(n,u),[]);let m=te(n,o,[r.value,r.children,o]),d=$(),p=T(f=>f.value&&f.value===m.current),b=T(f=>l.filter()===!1?!0:f.search?f.filtered.items.get(n)>0:!0);e.useEffect(()=>{let f=o.current;if(!(!f||r.disabled))return f.addEventListener(K,h),()=>f.removeEventListener(K,h)},[b,r.onSelect,r.disabled]);function h(){var f,y;(y=(f=g.current).onSelect)==null||y.call(f,m.current)}function R(){d.setState("value",m.current)}return b?e.createElement("div",{ref:M([o,i]),"cmdk-item":"",role:"option","aria-disabled":r.disabled||void 0,"aria-selected":p||void 0,onPointerMove:r.disabled?void 0:R,onClick:r.disabled?void 0:h},r.children):null}),se=e.forwardRef((r,i)=>{let{heading:n,children:o,...u}=r,l=e.useId(),g=e.useRef(null),m=e.useRef(null),d=e.useId(),p=I(),b=T(R=>R.search?R.filtered.groups.has(l):!0);L(()=>p.group(l),[]),te(l,g,[r.value,r.heading,m]);let h=e.createElement(Y.Provider,{value:l},o);return b?e.createElement("div",{ref:M([g,i]),...u,"cmdk-group":"",role:"presentation"},n&&e.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),e.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},h)):h}),ae=e.forwardRef((r,i)=>{let{alwaysRender:n,...o}=r,u=e.useRef(null),l=T(g=>!g.search);return!n&&!l?null:e.createElement("div",{ref:M([u,i]),...o,"cmdk-separator":"",role:"separator"})}),le=e.forwardRef((r,i)=>{let{onValueChange:n,...o}=r,u=r.value!=null,l=$(),g=T(d=>d.search),m=I();return e.useEffect(()=>{r.value!=null&&l.setState("search",r.value)},[r.value]),e.createElement("input",{ref:i,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,id:m.inputId,type:"text",value:u?r.value:g,onChange:d=>{u||l.setState("search",d.target.value),n==null||n(d.target.value)}})}),ue=e.forwardRef((r,i)=>{let{children:n,...o}=r,u=e.useRef(null),l=e.useRef(null),g=I();return e.useEffect(()=>{if(l.current&&u.current){let m=l.current,d=u.current,p=new ResizeObserver(()=>{let b=m.getBoundingClientRect().height;d.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")});return p.observe(m),()=>p.unobserve(m)}},[]),e.createElement("div",{ref:M([u,i]),...o,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:g.listId,"aria-labelledby":g.inputId},e.createElement("div",{ref:l,"cmdk-list-sizer":""},n))}),de=e.forwardRef((r,i)=>{let{open:n,onOpenChange:o,...u}=r;return e.createElement(S.Root,{open:n,onOpenChange:o},e.createElement(S.Portal,null,e.createElement(S.Overlay,{"cmdk-overlay":""}),e.createElement(S.Content,{"aria-label":r.label,"cmdk-dialog":""},e.createElement(Z,{ref:i,...u}))))}),fe=e.forwardRef((r,i)=>{let n=e.useRef(!0),o=T(u=>u.filtered.count===0);return e.useEffect(()=>{n.current=!1},[]),n.current||!o?null:e.createElement("div",{ref:i,...r,"cmdk-empty":"",role:"presentation"})}),me=e.forwardRef((r,i)=>{let{progress:n,children:o,...u}=r;return e.createElement("div",{ref:i,...u,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},e.createElement("div",{"aria-hidden":!0},o))}),Le= exports.Command =Object.assign(Z,{List:ue,Item:ce,Input:le,Group:se,Separator:ae,Dialog:de,Empty:fe,Loading:me});function ge(r,i){let n=r.nextElementSibling;for(;n;){if(n.matches(i))return n;n=n.nextElementSibling}}function ve(r,i){let n=r.previousElementSibling;for(;n;){if(n.matches(i))return n;n=n.previousElementSibling}}function ee(r){let i=e.useRef(r);return L(()=>{i.current=r}),i}var L=typeof window>"u"?e.useEffect:e.useLayoutEffect;function x(r){let i=e.useRef();return i.current===void 0&&(i.current=r()),i}function M(r){return i=>{r.forEach(n=>{typeof n=="function"?n(i):n!=null&&(n.current=i)})}}function T(r){let i=$(),n=()=>r(i.snapshot());return e.useSyncExternalStore(i.subscribe,n,n)}function te(r,i,n){let o=e.useRef(),u=I();return L(()=>{var g;let l=(()=>{var m;for(let d of n){if(typeof d=="string")return d.trim().toLowerCase();if(typeof d=="object"&&"current"in d&&d.current)return(m=d.current.textContent)==null?void 0:m.trim().toLowerCase()}})();u.value(r,l),(g=i.current)==null||g.setAttribute(E,l),o.current=l}),o}var Re=()=>{let[r,i]=e.useState(),n=x(()=>new Map);return L(()=>{n.current.forEach(o=>o()),n.current=new Map},[r]),(o,u)=>{n.current.set(o,u),i({})}},pe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};exports.Command = Le; exports.useCommandState = T; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _reactdialog = require('@radix-ui/react-dialog'); var S = _interopRequireWildcard(_reactdialog);var _react = require('react'); var e = _interopRequireWildcard(_react);var _commandscore = require('command-score'); var _commandscore2 = _interopRequireDefault(_commandscore);var ie='[cmdk-list-sizer=""]',w='[cmdk-group=""]',j='[cmdk-group-items=""]',ce='[cmdk-group-heading=""]',X='[cmdk-item=""]',Q=`${X}:not([aria-disabled="true"])`,F="cmdk-item-select",E="data-value",se=(r,i)=>_commandscore2.default.call(void 0, r,i),Y=e.createContext(void 0),I=()=>e.useContext(Y),Z=e.createContext(void 0),$=()=>e.useContext(Z),ee=e.createContext(void 0),te=e.forwardRef((r,i)=>{let n=e.useRef(null),o=x(()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}})),u=x(()=>new Set),l=x(()=>new Map),g=x(()=>new Map),m=x(()=>new Set),d=re(r),p=e.useId(),b=e.useId(),h=e.useId(),R=be();L(()=>{if(r.value!==void 0){let t=r.value.trim().toLowerCase();o.current.value=t,N(),f.emit()}},[r.value]);let f=e.useMemo(()=>({subscribe:t=>(m.current.add(t),()=>m.current.delete(t)),snapshot:()=>o.current,setState:(t,s)=>{var a,c,v;if(!Object.is(o.current[t],s)){if(o.current[t]=s,t==="search")A(),O(),R(1,()=>{_(),f.emit()});else if(t==="value")if(((a=d.current)==null?void 0:a.value)!==void 0){(v=(c=d.current).onValueChange)==null||v.call(c,s);return}else N();f.emit()}},emit:()=>{m.current.forEach(t=>t())}}),[]),y=e.useMemo(()=>({value:(t,s)=>{s!==g.current.get(t)&&(g.current.set(t,s),o.current.filtered.items.set(t,q(s)),R(2,()=>{O(),f.emit()}))},item:(t,s)=>(u.current.add(t),s&&(l.current.has(s)?l.current.get(s).add(t):l.current.set(s,new Set([t]))),R(3,()=>{A(),O(),o.current.value||_(),f.emit()}),()=>{g.current.delete(t),u.current.delete(t),o.current.filtered.items.delete(t),R(4,()=>{A(),_(),f.emit()})}),group:t=>(l.current.has(t)||l.current.set(t,new Set),()=>{g.current.delete(t),l.current.delete(t)}),filter:()=>d.current.shouldFilter,label:r.label||r["aria-label"],listId:p,inputId:h,labelId:b}),[]);function q(t){var a,c;let s=(c=(a=d.current)==null?void 0:a.filter)!=null?c:se;return t?s(t,o.current.search):0}function O(){if(!n.current||!o.current.search||d.current.shouldFilter===!1)return;let t=o.current.filtered.items,s=[];o.current.filtered.groups.forEach(c=>{let v=l.current.get(c),C=0;v.forEach(V=>{let H=t.get(V);C=Math.max(H,C)}),s.push([c,C])});let a=n.current.querySelector(ie);D().sort((c,v)=>{var H,J;let C=c.getAttribute(E),V=v.getAttribute(E);return((H=t.get(V))!=null?H:0)-((J=t.get(C))!=null?J:0)}).forEach(c=>{let v=c.closest(j);v?v.appendChild(c.parentElement===v?c:c.closest(`${j} > *`)):a.appendChild(c.parentElement===a?c:c.closest(`${j} > *`))}),s.sort((c,v)=>v[1]-c[1]).forEach(c=>{let v=n.current.querySelector(`${w}[${E}="${c[0]}"]`);v==null||v.parentElement.appendChild(v)})}function _(){let t=D().find(a=>!a.ariaDisabled),s=t==null?void 0:t.getAttribute(E);o.current.value=s||void 0}function A(){if(!o.current.search||d.current.shouldFilter===!1){o.current.filtered.count=u.current.size;return}o.current.filtered.groups=new Set;let t=0;for(let s of u.current){let a=g.current.get(s),c=q(a);o.current.filtered.items.set(s,c),c>0&&t++}for(let[s,a]of l.current)for(let c of a)if(o.current.filtered.items.get(c)>0){o.current.filtered.groups.add(s);break}o.current.filtered.count=t}function N(){var s,a,c;let t=P();t&&(((s=t.parentElement)==null?void 0:s.firstChild)===t&&((c=(a=t.closest(w))==null?void 0:a.querySelector(ce))==null||c.scrollIntoView({block:"nearest"})),t.scrollIntoView({block:"nearest"}))}function P(){return n.current.querySelector(`${X}[aria-selected="true"]`)}function D(){return Array.from(n.current.querySelectorAll(Q))}function K(t){let a=D()[t];a&&f.setState("value",a.getAttribute(E))}function G(t){let s=P(),a=D(),c=a.findIndex(C=>C===s),v=a[c+t];v&&f.setState("value",v.getAttribute(E))}function z(t){let s=P(),a=s==null?void 0:s.closest(w),c;for(;a&&!c;)a=t>0?Re(a,w):pe(a,w),c=a==null?void 0:a.querySelector(Q);c?f.setState("value",c.getAttribute(E)):G(t)}let U=()=>K(o.current.filtered.count-1),B=t=>t.metaKey?U():t.altKey?z(1):G(1),W=t=>t.metaKey?K(0):t.altKey?z(-1):G(-1),{label:Ee,children:Se,value:Ce,onValueChange:ye,filter:xe,shouldFilter:Te,...k}=r;return e.createElement("div",{ref:M([n,i]),...k,"cmdk-root":"",onKeyDown:t=>{var s;if((s=k.onKeyDown)==null||s.call(k,t),!t.defaultPrevented)switch(t.key){case"j":{t.ctrlKey&&B(t);break}case"ArrowDown":{B(t);break}case"k":{t.ctrlKey&&W(t);break}case"ArrowUp":{W(t);break}case"Home":{K(0);break}case"End":{U();break}case"Enter":{let a=P();if(a){let c=new Event(F);a.dispatchEvent(c)}}}}},e.createElement("label",{"cmdk-label":"",htmlFor:y.inputId,id:y.labelId,style:he},r.label),e.createElement(Z.Provider,{value:f},e.createElement(Y.Provider,{value:y},r.children)))}),ae=e.forwardRef((r,i)=>{let n=e.useId(),o=e.useRef(null),u=e.useContext(ee),l=I(),g=re(r);L(()=>l.item(n,u),[]);let m=ne(n,o,[r.value,r.children,o]),d=$(),p=T(f=>f.value&&f.value===m.current),b=T(f=>l.filter()===!1?!0:f.search?f.filtered.items.get(n)>0:!0);e.useEffect(()=>{let f=o.current;if(!(!f||r.disabled))return f.addEventListener(F,h),()=>f.removeEventListener(F,h)},[b,r.onSelect,r.disabled]);function h(){var f,y;(y=(f=g.current).onSelect)==null||y.call(f,m.current)}function R(){d.setState("value",m.current)}return b?e.createElement("div",{ref:M([o,i]),"cmdk-item":"",role:"option","aria-disabled":r.disabled||void 0,"aria-selected":p||void 0,onPointerMove:r.disabled?void 0:R,onClick:r.disabled?void 0:h},r.children):null}),le=e.forwardRef((r,i)=>{let{heading:n,children:o,...u}=r,l=e.useId(),g=e.useRef(null),m=e.useRef(null),d=e.useId(),p=I(),b=T(R=>R.search?R.filtered.groups.has(l):!0);L(()=>p.group(l),[]),ne(l,g,[r.value,r.heading,m]);let h=e.createElement(ee.Provider,{value:l},o);return b?e.createElement("div",{ref:M([g,i]),...u,"cmdk-group":"",role:"presentation"},n&&e.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),e.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},h)):h}),ue=e.forwardRef((r,i)=>{let{alwaysRender:n,...o}=r,u=e.useRef(null),l=T(g=>!g.search);return!n&&!l?null:e.createElement("div",{ref:M([u,i]),...o,"cmdk-separator":"",role:"separator"})}),de=e.forwardRef((r,i)=>{let{onValueChange:n,...o}=r,u=r.value!=null,l=$(),g=T(d=>d.search),m=I();return e.useEffect(()=>{r.value!=null&&l.setState("search",r.value)},[r.value]),e.createElement("input",{ref:i,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,id:m.inputId,type:"text",value:u?r.value:g,onChange:d=>{u||l.setState("search",d.target.value),n==null||n(d.target.value)}})}),fe=e.forwardRef((r,i)=>{let{children:n,...o}=r,u=e.useRef(null),l=e.useRef(null),g=I();return e.useEffect(()=>{if(l.current&&u.current){let m=l.current,d=u.current,p=new ResizeObserver(()=>{let b=m.getBoundingClientRect().height;d.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")});return p.observe(m),()=>p.unobserve(m)}},[]),e.createElement("div",{ref:M([u,i]),...o,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:g.listId,"aria-labelledby":g.inputId},e.createElement("div",{ref:l,"cmdk-list-sizer":""},n))}),me=e.forwardRef((r,i)=>{let{open:n,onOpenChange:o,...u}=r;return e.createElement(S.Root,{open:n,onOpenChange:o},e.createElement(S.Portal,null,e.createElement(S.Overlay,{"cmdk-overlay":""}),e.createElement(S.Content,{"aria-label":r.label,"cmdk-dialog":""},e.createElement(te,{ref:i,...u}))))}),ge=e.forwardRef((r,i)=>{let n=e.useRef(!0),o=T(u=>u.filtered.count===0);return e.useEffect(()=>{n.current=!1},[]),n.current||!o?null:e.createElement("div",{ref:i,...r,"cmdk-empty":"",role:"presentation"})}),ve=e.forwardRef((r,i)=>{let{progress:n,children:o,...u}=r;return e.createElement("div",{ref:i,...u,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},e.createElement("div",{"aria-hidden":!0},o))}),Ie= exports.Command =Object.assign(te,{List:fe,Item:ae,Input:de,Group:le,Separator:ue,Dialog:me,Empty:ge,Loading:ve});function Re(r,i){let n=r.nextElementSibling;for(;n;){if(n.matches(i))return n;n=n.nextElementSibling}}function pe(r,i){let n=r.previousElementSibling;for(;n;){if(n.matches(i))return n;n=n.previousElementSibling}}function re(r){let i=e.useRef(r);return L(()=>{i.current=r}),i}var L=typeof window>"u"?e.useEffect:e.useLayoutEffect;function x(r){let i=e.useRef();return i.current===void 0&&(i.current=r()),i}function M(r){return i=>{r.forEach(n=>{typeof n=="function"?n(i):n!=null&&(n.current=i)})}}function T(r){let i=$(),n=()=>r(i.snapshot());return e.useSyncExternalStore(i.subscribe,n,n)}function ne(r,i,n){let o=e.useRef(),u=I();return L(()=>{var g;let l=(()=>{var m;for(let d of n){if(typeof d=="string")return d.trim().toLowerCase();if(typeof d=="object"&&"current"in d&&d.current)return(m=d.current.textContent)==null?void 0:m.trim().toLowerCase()}})();u.value(r,l),(g=i.current)==null||g.setAttribute(E,l),o.current=l}),o}var be=()=>{let[r,i]=e.useState(),n=x(()=>new Map);return L(()=>{n.current.forEach(o=>o()),n.current=new Map},[r]),(o,u)=>{n.current.set(o,u),i({})}},he={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};exports.Command = Ie; exports.useCommandState = T; |
{ | ||
"name": "cmdk", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
@@ -372,5 +372,5 @@ # ⌘K ![cmdk minzip package size](https://img.shields.io/bundlephobia/minzip/cmdk) ![cmdk package version](https://img.shields.io/npm/v/cmdk.svg?colorB=green) | ||
### Vim style keybindings | ||
### Drop in stylesheets | ||
Not currently possible. Upvote [this issue](#TODO) if you'd like to see it added. | ||
You can find global stylesheets to drop in as a starting point for styling. See [website/styles/cmdk](website/styles/cmdk) for examples. | ||
@@ -377,0 +377,0 @@ ## FAQ |
Sorry, the diff of this file is not supported yet
35790