@inkeep/cxkit-primitives 0.5.46 → 0.5.48
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/dist/atoms/cmdk/index.cjs +1 -1
- package/dist/atoms/cmdk/index.js +125 -133
- package/dist/components/embedded-chat/use-inkeep-chat.cjs +3 -3
- package/dist/components/embedded-chat/use-inkeep-chat.js +83 -79
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/providers/chat-events-provider.cjs +1 -1
- package/dist/providers/chat-events-provider.js +38 -34
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),je=require("@radix-ui/react-dialog"),G=require("react"),_e=require("./command-score.cjs"),I=require("@radix-ui/react-primitive"),D=require("@radix-ui/react-id"),Pe=require("../../node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.cjs"),Ae=require("../../constants/search.cjs"),Me=require("../../utils/compose-event-handlers.cjs"),Le=require("../shadow/context.cjs");function fe(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const F=fe(je),c=fe(G),O='[cmdk-group=""]',te='[cmdk-group-items=""]',Oe='[cmdk-group-heading=""]',me='[cmdk-item=""]',de=`${me}:not([aria-disabled="true"])`,ne="cmdk-item-select",A="data-value",ve=(t,r,n)=>_e.commandScore(t,r,n??[]),he=c.createContext(void 0),q=()=>c.useContext(he),ge=c.createContext(void 0),K=()=>c.useContext(ge),be=c.createContext(void 0),re=c.forwardRef((t,r)=>{const n=M(()=>new Set),s=M(()=>new Map),a=M(()=>new Map),f=M(()=>new Set),i=Ie(t),{label:h,children:d,value:S,onValueChange:E,filter:y,shouldFilter:C,loop:w,disablePointerSelection:P=!1,vimBindings:B=!0,defaultSearch:oe,...$}=t,g=M(()=>({search:oe??"",value:t.value??t.defaultValue??"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),U=D.useId(),H=D.useId(),z=D.useId(),R=c.useRef(null),b=Fe();j(()=>{if(S!==void 0){const e=S.trim();g.current.value=e,x.emit()}},[S]),j(()=>{b(6,se)},[]);const V=Le.useShadow(),x=c.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>g.current,setState:(e,l,o)=>{if(!Object.is(g.current[e],l)){if(g.current[e]=l,e==="search")X(),J(),b(1,Q);else if(e==="value"&&(V?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("cmdk-input")||b(1,()=>{k()?.focus()}),b(7,()=>{g.current.selectedItemId=k()?.id,x.emit()}),o||b(5,se),i.current?.value!==void 0)){const p=l??"";i.current.onValueChange?.(p);return}x.emit()}},emit:()=>{f.current.forEach(e=>e())}}),[]),W=c.useMemo(()=>({value:(e,l,o)=>{l!==a.current.get(e)?.value&&(a.current.set(e,{value:l,keywords:o}),g.current.filtered.items.set(e,ce(l,o)),b(2,()=>{J(),x.emit()}))},item:(e,l)=>(n.current.add(e),l&&(s.current.has(l)?s.current?.get(l)?.add(e):s.current.set(l,new Set([e]))),b(3,()=>{X(),J(),g.current.value||Q(),x.emit()}),()=>{a.current.delete(e),n.current.delete(e),g.current.filtered.items.delete(e);const o=k();b(4,()=>{X(),o?.getAttribute("id")===e&&Q(),x.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{a.current.delete(e),s.current.delete(e)}),filter:()=>!!i.current.shouldFilter,label:h||t["aria-label"]||"",getDisablePointerSelection:()=>!!i.current.disablePointerSelection,listId:U,inputId:z,labelId:H,listInnerRef:R}),[]);function ce(e,l){const o=i.current?.filter??ve;return e?o?.(e,g.current.search,l):0}function J(){if(!g.current.search||i.current.shouldFilter===!1)return;const e=g.current.filtered.items,l=[];g.current.filtered.groups.forEach(u=>{const m=s.current.get(u);let p=0;m.forEach(ee=>{const ke=e.get(ee);p=Math.max(ke,p)}),l.push([u,p])});const o=R.current;L().sort((u,m)=>{const p=u.getAttribute("id"),ee=m.getAttribute("id");return(e.get(ee)??0)-(e.get(p)??0)}).forEach(u=>{const m=u.closest(te);if(m){const p=u.parentElement===m?u:u.closest(`${te} > *`);p&&m.appendChild(p)}else{const p=u.parentElement===o?u:u.closest(`${te} > *`);p&&o?.appendChild(p)}}),l.sort((u,m)=>m[1]-u[1]).forEach(u=>{const m=R.current?.querySelector(`${O}[${A}="${encodeURIComponent(u[0])}"]`);m?.parentElement?.appendChild(m)})}function Q(){const l=L().find(o=>o.getAttribute("aria-disabled")!=="true"&&o.getAttribute("data-value")!==Ae.ASK_AI_TRIGGER_VALUE)?.getAttribute(A);x.setState("value",l||void 0)}function X(){if(!g.current.search||i.current.shouldFilter===!1){g.current.filtered.count=n.current.size;return}g.current.filtered.groups=new Set;let e=0;for(const l of n.current){const o=a.current.get(l)?.value??"",u=a.current.get(l)?.keywords??[],m=ce(o,u);g.current.filtered.items.set(l,m),m>0&&e++}for(const[l,o]of s.current)for(const u of o){const m=g.current.filtered.items.get(u);if(m&&m>0){g.current.filtered.groups.add(l);break}}g.current.filtered.count=e}function se(){const e=k();e&&(e.parentElement?.firstChild===e&&e.closest(O)?.querySelector(Oe)?.scrollIntoView({block:"nearest"}),e.scrollIntoView({block:"nearest"}))}function k(){return R.current?.querySelector(`${me}[aria-selected="true"]`)}function L(){return Array.from(R.current?.querySelectorAll(de)||[])}function Y(e){const o=L()[e];o&&x.setState("value",o.getAttribute(A))}function Z(e){const l=k(),o=L(),u=o.findIndex(p=>p===l);let m=o[u+e];i.current?.loop&&(m=u+e<0?o[o.length-1]:u+e===o.length?o[0]:o[u+e]),m&&x.setState("value",m.getAttribute(A))}function ie(e){let o=k()?.closest(O),u;for(;o&&!u;)o=e>0?qe(o,O):Ve(o,O),u=o?.querySelector(de);u?x.setState("value",u.getAttribute(A)):Z(e)}const le=()=>Y(L().length-1),ue=e=>{e.preventDefault(),e.metaKey?le():e.altKey?ie(1):Z(1)},ae=e=>{e.preventDefault(),e.metaKey?Y(0):e.altKey?ie(-1):Z(-1)};return v.jsxs(I.Primitive.div,{ref:r,tabIndex:-1,...$,"cmdk-root":"",onKeyDown:e=>{if($.onKeyDown?.(e),!e.defaultPrevented)switch(e.key){case"n":case"j":{B&&e.ctrlKey&&ue(e);break}case"ArrowDown":{ue(e);break}case"p":case"k":{B&&e.ctrlKey&&ae(e);break}case"ArrowUp":{ae(e);break}case"Home":{e.preventDefault(),Y(0);break}case"End":{e.preventDefault(),le();break}case"Enter":if(!e.nativeEvent.isComposing&&e.keyCode!==229){e.preventDefault();const l=k();if(l){const o=new Event(ne);l.dispatchEvent(o)}}}},style:{display:"contents"},children:[v.jsx("label",{"cmdk-label":"",htmlFor:W.inputId,id:W.labelId,style:Ke,children:h}),N(t,e=>v.jsx(ge.Provider,{value:x,children:v.jsx(he.Provider,{value:W,children:e})}))]})}),pe=c.forwardRef((t,r)=>{const{id:n}=t,s=c.useRef(null),a=c.useContext(be),f=q(),i=Ie(t),h=i.current?.forceMount??a?.forceMount;j(()=>{if(!h)return f.item(n,a?.id)},[h]);const d=Re(n,s,[t.value,t.children,s],t.keywords),S=K(),E=_(b=>b.value&&b.value===d.current),y=_(b=>h||f.filter()===!1?!0:b.search?b.filtered.items.get(n)>0:!0);c.useEffect(()=>{const b=s.current;if(!b||t.disabled)return;const V=()=>w("keyboard");return b.addEventListener(ne,V),()=>b.removeEventListener(ne,V)},[y,t.onSelect,t.disabled]);const C=G.useCallback(()=>{S.setState("value",d.current,!0)},[S,d]),w=G.useCallback((b="click")=>{C(),i.current.onSelect?.({value:d.current,trigger:b})},[C,i,d]);if(!y)return null;const{disabled:P,value:B,onSelect:oe,forceMount:$,keywords:g,onClick:U,...H}=t,z=G.useMemo(()=>T([s,r]),[s,r]),R=Me.composeEventHandlers(U,w);return v.jsx(I.Primitive.div,{ref:z,...H,id:n,"cmdk-item":"",role:"option","aria-disabled":!!P,"aria-selected":!!E,"data-disabled":!!P,"data-selected":!!E,onPointerMove:P||f.getDisablePointerSelection()?void 0:C,onClick:P?void 0:R,onFocus:P?void 0:C,children:t.children})}),De=c.forwardRef((t,r)=>{const{heading:n,children:s,forceMount:a,...f}=t,i=D.useId(),h=c.useRef(null),d=c.useRef(null),S=D.useId(),E=q(),y=_(w=>a||E.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);j(()=>E.group(i),[]),Re(i,h,[t.value,t.heading,d]);const C=c.useMemo(()=>({id:i,forceMount:a}),[a]);return v.jsxs(I.Primitive.div,{ref:T([h,r]),...f,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0,children:[n&&v.jsx("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:S,children:n}),N(t,w=>v.jsx("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?S:void 0,children:v.jsx(be.Provider,{value:C,children:w})}))]})}),Se=c.forwardRef((t,r)=>{const{alwaysRender:n,...s}=t,a=c.useRef(null),f=_(i=>!i.search);return!n&&!f?null:v.jsx(I.Primitive.div,{ref:T([a,r]),...s,"cmdk-separator":"",role:"separator"})}),xe=c.forwardRef((t,r)=>{const{onValueChange:n,...s}=t,a=t.value!=null,f=K(),i=_(d=>d.search),h=q();return c.useEffect(()=>{t.value!=null&&f.setState("search",t.value)},[t.value]),v.jsx(I.Primitive.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,id:h.inputId,type:"text",value:a?t.value:i,onChange:d=>{a||f.setState("search",d.target.value),n?.(d.target.value)}})}),Ee=c.forwardRef((t,r)=>{const{children:n,label:s="Suggestions",...a}=t,f=c.useRef(null),i=c.useRef(null),h=q();return c.useEffect(()=>{if(i.current&&f.current){const d=i.current,S=f.current;let E;const y=new ResizeObserver(()=>{E=requestAnimationFrame(()=>{const C=d.offsetHeight;S.style.setProperty("--cmdk-list-height",C.toFixed(1)+"px")})});return y.observe(d),()=>{cancelAnimationFrame(E),y.unobserve(d)}}},[]),v.jsx(I.Primitive.div,{ref:T([f,r]),...a,"cmdk-list":"",tabIndex:-1,"aria-label":s,id:h.listId,children:N(t,d=>v.jsx("div",{ref:T([i,h.listInnerRef]),"cmdk-list-sizer":"",children:d}))})}),Ce=c.forwardRef((t,r)=>{const{open:n,onOpenChange:s,overlayClassName:a,contentClassName:f,container:i,...h}=t;return v.jsx(F.Root,{open:n,onOpenChange:s,children:v.jsxs(F.Portal,{container:i,children:[v.jsx(F.Overlay,{"cmdk-overlay":"",className:a}),v.jsx(F.Content,{"aria-label":t.label,"cmdk-dialog":"",className:f,children:v.jsx(re,{ref:r,...h})})]})})}),ye=c.forwardRef((t,r)=>_(s=>s.filtered.count===0)?v.jsx(I.Primitive.div,{ref:r,...t,"cmdk-empty":"",role:"presentation"}):null),we=c.forwardRef((t,r)=>{const{progress:n,children:s,label:a="Loading...",...f}=t;return v.jsx(I.Primitive.div,{ref:r,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a,children:N(t,i=>v.jsx("div",{"aria-hidden":!0,children:i}))})}),Te=Object.assign(re,{List:Ee,Item:pe,Input:xe,Group:De,Separator:Se,Dialog:Ce,Empty:ye,Loading:we});function qe(t,r){let n=t.nextElementSibling;for(;n;){if(n.matches(r))return n;n=n.nextElementSibling}}function Ve(t,r){let n=t.previousElementSibling;for(;n;){if(n.matches(r))return n;n=n.previousElementSibling}}function Ie(t){const r=c.useRef(t);return j(()=>{r.current=t}),r}const j=typeof window>"u"?c.useEffect:c.useLayoutEffect;function M(t){const r=c.useRef(void 0);return r.current===void 0&&(r.current=t()),r}function T(t){return r=>{t.forEach(n=>{typeof n=="function"?n(r):n!=null&&(n.current=r)})}}function _(t){const r=K(),n=()=>t(r.snapshot());return Pe.shimExports.useSyncExternalStore(r.subscribe,n,n)}function Re(t,r,n,s=[]){const a=c.useRef(void 0),f=q();return j(()=>{const i=(()=>{for(const d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?d.current.textContent?.trim():a.current}})(),h=s.map(d=>d.trim());f.value(t,i,h),r.current?.setAttribute(A,i),a.current=i}),a}const Fe=()=>{const[t,r]=c.useState(),n=M(()=>new Map);return j(()=>{n.current.forEach(s=>s()),n.current=new Map},[t]),(s,a)=>{n.current.set(s,a),r({})}};function Ge(t){const r=t.type;return typeof r=="function"?r(t.props):"render"in r?r.render(t.props):t}function N({asChild:t,children:r},n){return t&&c.isValidElement(r)?c.cloneElement(Ge(r),{ref:r.ref},n(r.props.children)):n(r)}const Ke={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};exports.Command=Te;exports.CommandDialog=Ce;exports.CommandEmpty=ye;exports.CommandInput=xe;exports.CommandItem=pe;exports.CommandList=Ee;exports.CommandLoading=we;exports.CommandRoot=re;exports.CommandSeparator=Se;exports.defaultFilter=ve;exports.useCommandState=_;exports.useCommandStore=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),je=require("@radix-ui/react-dialog"),G=require("react"),_e=require("./command-score.cjs"),I=require("@radix-ui/react-primitive"),T=require("@radix-ui/react-id"),Pe=require("../../node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.cjs"),Ae=require("../../constants/search.cjs"),Me=require("../../utils/compose-event-handlers.cjs"),Le=require("../shadow/context.cjs");function de(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const F=de(je),c=de(G),O='[cmdk-group=""]',ee='[cmdk-group-items=""]',Oe='[cmdk-group-heading=""]',fe='[cmdk-item=""]',ae=`${fe}:not([aria-disabled="true"])`,te="cmdk-item-select",A="data-value",me=(t,r,n)=>_e.commandScore(t,r,n??[]),ve=c.createContext(void 0),D=()=>c.useContext(ve),he=c.createContext(void 0),K=()=>c.useContext(he),ge=c.createContext(void 0),ne=c.forwardRef((t,r)=>{const n=M(()=>new Set),s=M(()=>new Map),a=M(()=>new Map),f=M(()=>new Set),i=we(t),{label:h,children:d,value:S,onValueChange:E,filter:y,shouldFilter:C,loop:w,disablePointerSelection:P=!1,vimBindings:B=!0,defaultSearch:re,...$}=t,g=M(()=>({search:re??"",value:t.value??t.defaultValue??"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),U=T.useId(),z=T.useId(),H=T.useId(),R=c.useRef(null),b=Fe();j(()=>{if(S!==void 0){const e=S.trim();g.current.value=e,x.emit()}},[S]),j(()=>{b(6,ce)},[]);const V=Le.useShadow(),x=c.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>g.current,setState:(e,l,o)=>{if(!Object.is(g.current[e],l)){if(g.current[e]=l,e==="search")X(),J(),b(1,Q);else if(e==="value"&&(V?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("cmdk-input")||b(1,()=>{k()?.focus()}),b(7,()=>{g.current.selectedItemId=k()?.id,x.emit()}),o||b(5,ce),i.current?.value!==void 0)){const p=l??"";i.current.onValueChange?.(p);return}x.emit()}},emit:()=>{f.current.forEach(e=>e())}}),[]),W=c.useMemo(()=>({value:(e,l,o)=>{l!==a.current.get(e)?.value&&(a.current.set(e,{value:l,keywords:o}),g.current.filtered.items.set(e,oe(l,o)),b(2,()=>{J(),x.emit()}))},item:(e,l)=>(n.current.add(e),l&&(s.current.has(l)?s.current?.get(l)?.add(e):s.current.set(l,new Set([e]))),b(3,()=>{X(),J(),g.current.value||Q(),x.emit()}),()=>{a.current.delete(e),n.current.delete(e),g.current.filtered.items.delete(e);const o=k();b(4,()=>{X(),o?.getAttribute("id")===e&&Q(),x.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{a.current.delete(e),s.current.delete(e)}),filter:()=>!!i.current.shouldFilter,label:h||t["aria-label"]||"",getDisablePointerSelection:()=>!!i.current.disablePointerSelection,listId:U,inputId:H,labelId:z,listInnerRef:R}),[]);function oe(e,l){const o=i.current?.filter??me;return e?o?.(e,g.current.search,l):0}function J(){if(!g.current.search||i.current.shouldFilter===!1)return;const e=g.current.filtered.items,l=[];g.current.filtered.groups.forEach(u=>{const m=s.current.get(u);let p=0;m.forEach(Z=>{const ke=e.get(Z);p=Math.max(ke,p)}),l.push([u,p])});const o=R.current;L().sort((u,m)=>{const p=u.getAttribute("id"),Z=m.getAttribute("id");return(e.get(Z)??0)-(e.get(p)??0)}).forEach(u=>{const m=u.closest(ee);if(m){const p=u.parentElement===m?u:u.closest(`${ee} > *`);p&&m.appendChild(p)}else{const p=u.parentElement===o?u:u.closest(`${ee} > *`);p&&o?.appendChild(p)}}),l.sort((u,m)=>m[1]-u[1]).forEach(u=>{const m=R.current?.querySelector(`${O}[${A}="${encodeURIComponent(u[0])}"]`);m?.parentElement?.appendChild(m)})}function Q(){const l=L().find(o=>o.getAttribute("aria-disabled")!=="true"&&o.getAttribute("data-value")!==Ae.ASK_AI_TRIGGER_VALUE)?.getAttribute(A);x.setState("value",l||void 0)}function X(){if(!g.current.search||i.current.shouldFilter===!1){g.current.filtered.count=n.current.size;return}g.current.filtered.groups=new Set;let e=0;for(const l of n.current){const o=a.current.get(l)?.value??"",u=a.current.get(l)?.keywords??[],m=oe(o,u);g.current.filtered.items.set(l,m),m>0&&e++}for(const[l,o]of s.current)for(const u of o){const m=g.current.filtered.items.get(u);if(m&&m>0){g.current.filtered.groups.add(l);break}}g.current.filtered.count=e}function ce(){const e=k();e&&(e.parentElement?.firstChild===e&&e.closest(O)?.querySelector(Oe)?.scrollIntoView({block:"nearest"}),e.scrollIntoView({block:"nearest"}))}function k(){return R.current?.querySelector(`${fe}[aria-selected="true"]`)}function L(){return Array.from(R.current?.querySelectorAll(ae)||[])}function se(e){const o=L()[e];o&&x.setState("value",o.getAttribute(A))}function Y(e){const l=k(),o=L(),u=o.findIndex(p=>p===l);let m=o[u+e];i.current?.loop&&(m=u+e<0?o[o.length-1]:u+e===o.length?o[0]:o[u+e]),m&&x.setState("value",m.getAttribute(A))}function ie(e){let o=k()?.closest(O),u;for(;o&&!u;)o=e>0?De(o,O):Ve(o,O),u=o?.querySelector(ae);u?x.setState("value",u.getAttribute(A)):Y(e)}const Re=()=>se(L().length-1),le=e=>{e.preventDefault(),e.metaKey?Re():e.altKey?ie(1):Y(1)},ue=e=>{e.preventDefault(),e.metaKey?se(0):e.altKey?ie(-1):Y(-1)};return v.jsxs(I.Primitive.div,{ref:r,tabIndex:-1,...$,"cmdk-root":"",onKeyDown:e=>{if($.onKeyDown?.(e),!e.defaultPrevented)switch(e.key){case"n":case"j":{B&&e.ctrlKey&&le(e);break}case"ArrowDown":{le(e);break}case"p":case"k":{B&&e.ctrlKey&&ue(e);break}case"ArrowUp":{ue(e);break}case"Enter":if(!e.nativeEvent.isComposing&&e.keyCode!==229){e.preventDefault();const l=k();if(l){const o=new Event(te);l.dispatchEvent(o)}}}},style:{display:"contents"},children:[v.jsx("label",{"cmdk-label":"",htmlFor:W.inputId,id:W.labelId,style:Ke,children:h}),N(t,e=>v.jsx(he.Provider,{value:x,children:v.jsx(ve.Provider,{value:W,children:e})}))]})}),be=c.forwardRef((t,r)=>{const{id:n}=t,s=c.useRef(null),a=c.useContext(ge),f=D(),i=we(t),h=i.current?.forceMount??a?.forceMount;j(()=>{if(!h)return f.item(n,a?.id)},[h]);const d=Ie(n,s,[t.value,t.children,s],t.keywords),S=K(),E=_(b=>b.value&&b.value===d.current),y=_(b=>h||f.filter()===!1?!0:b.search?b.filtered.items.get(n)>0:!0);c.useEffect(()=>{const b=s.current;if(!b||t.disabled)return;const V=()=>w("keyboard");return b.addEventListener(te,V),()=>b.removeEventListener(te,V)},[y,t.onSelect,t.disabled]);const C=G.useCallback(()=>{S.setState("value",d.current,!0)},[S,d]),w=G.useCallback((b="click")=>{C(),i.current.onSelect?.({value:d.current,trigger:b})},[C,i,d]);if(!y)return null;const{disabled:P,value:B,onSelect:re,forceMount:$,keywords:g,onClick:U,...z}=t,H=G.useMemo(()=>q([s,r]),[s,r]),R=Me.composeEventHandlers(U,w);return v.jsx(I.Primitive.div,{ref:H,...z,id:n,"cmdk-item":"",role:"option","aria-disabled":!!P,"aria-selected":!!E,"data-disabled":!!P,"data-selected":!!E,onPointerMove:P||f.getDisablePointerSelection()?void 0:C,onClick:P?void 0:R,onFocus:P?void 0:C,children:t.children})}),Te=c.forwardRef((t,r)=>{const{heading:n,children:s,forceMount:a,...f}=t,i=T.useId(),h=c.useRef(null),d=c.useRef(null),S=T.useId(),E=D(),y=_(w=>a||E.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);j(()=>E.group(i),[]),Ie(i,h,[t.value,t.heading,d]);const C=c.useMemo(()=>({id:i,forceMount:a}),[a]);return v.jsxs(I.Primitive.div,{ref:q([h,r]),...f,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0,children:[n&&v.jsx("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:S,children:n}),N(t,w=>v.jsx("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?S:void 0,children:v.jsx(ge.Provider,{value:C,children:w})}))]})}),pe=c.forwardRef((t,r)=>{const{alwaysRender:n,...s}=t,a=c.useRef(null),f=_(i=>!i.search);return!n&&!f?null:v.jsx(I.Primitive.div,{ref:q([a,r]),...s,"cmdk-separator":"",role:"separator"})}),Se=c.forwardRef((t,r)=>{const{onValueChange:n,...s}=t,a=t.value!=null,f=K(),i=_(d=>d.search),h=D();return c.useEffect(()=>{t.value!=null&&f.setState("search",t.value)},[t.value]),v.jsx(I.Primitive.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,id:h.inputId,type:"text",value:a?t.value:i,onChange:d=>{a||f.setState("search",d.target.value),n?.(d.target.value)}})}),xe=c.forwardRef((t,r)=>{const{children:n,label:s="Suggestions",...a}=t,f=c.useRef(null),i=c.useRef(null),h=D();return c.useEffect(()=>{if(i.current&&f.current){const d=i.current,S=f.current;let E;const y=new ResizeObserver(()=>{E=requestAnimationFrame(()=>{const C=d.offsetHeight;S.style.setProperty("--cmdk-list-height",C.toFixed(1)+"px")})});return y.observe(d),()=>{cancelAnimationFrame(E),y.unobserve(d)}}},[]),v.jsx(I.Primitive.div,{ref:q([f,r]),...a,"cmdk-list":"",tabIndex:-1,"aria-label":s,id:h.listId,children:N(t,d=>v.jsx("div",{ref:q([i,h.listInnerRef]),"cmdk-list-sizer":"",children:d}))})}),Ee=c.forwardRef((t,r)=>{const{open:n,onOpenChange:s,overlayClassName:a,contentClassName:f,container:i,...h}=t;return v.jsx(F.Root,{open:n,onOpenChange:s,children:v.jsxs(F.Portal,{container:i,children:[v.jsx(F.Overlay,{"cmdk-overlay":"",className:a}),v.jsx(F.Content,{"aria-label":t.label,"cmdk-dialog":"",className:f,children:v.jsx(ne,{ref:r,...h})})]})})}),Ce=c.forwardRef((t,r)=>_(s=>s.filtered.count===0)?v.jsx(I.Primitive.div,{ref:r,...t,"cmdk-empty":"",role:"presentation"}):null),ye=c.forwardRef((t,r)=>{const{progress:n,children:s,label:a="Loading...",...f}=t;return v.jsx(I.Primitive.div,{ref:r,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a,children:N(t,i=>v.jsx("div",{"aria-hidden":!0,children:i}))})}),qe=Object.assign(ne,{List:xe,Item:be,Input:Se,Group:Te,Separator:pe,Dialog:Ee,Empty:Ce,Loading:ye});function De(t,r){let n=t.nextElementSibling;for(;n;){if(n.matches(r))return n;n=n.nextElementSibling}}function Ve(t,r){let n=t.previousElementSibling;for(;n;){if(n.matches(r))return n;n=n.previousElementSibling}}function we(t){const r=c.useRef(t);return j(()=>{r.current=t}),r}const j=typeof window>"u"?c.useEffect:c.useLayoutEffect;function M(t){const r=c.useRef(void 0);return r.current===void 0&&(r.current=t()),r}function q(t){return r=>{t.forEach(n=>{typeof n=="function"?n(r):n!=null&&(n.current=r)})}}function _(t){const r=K(),n=()=>t(r.snapshot());return Pe.shimExports.useSyncExternalStore(r.subscribe,n,n)}function Ie(t,r,n,s=[]){const a=c.useRef(void 0),f=D();return j(()=>{const i=(()=>{for(const d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?d.current.textContent?.trim():a.current}})(),h=s.map(d=>d.trim());f.value(t,i,h),r.current?.setAttribute(A,i),a.current=i}),a}const Fe=()=>{const[t,r]=c.useState(),n=M(()=>new Map);return j(()=>{n.current.forEach(s=>s()),n.current=new Map},[t]),(s,a)=>{n.current.set(s,a),r({})}};function Ge(t){const r=t.type;return typeof r=="function"?r(t.props):"render"in r?r.render(t.props):t}function N({asChild:t,children:r},n){return t&&c.isValidElement(r)?c.cloneElement(Ge(r),{ref:r.ref},n(r.props.children)):n(r)}const Ke={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};exports.Command=qe;exports.CommandDialog=Ee;exports.CommandEmpty=Ce;exports.CommandInput=Se;exports.CommandItem=be;exports.CommandList=xe;exports.CommandLoading=ye;exports.CommandRoot=ne;exports.CommandSeparator=pe;exports.defaultFilter=me;exports.useCommandState=_;exports.useCommandStore=K;
|
package/dist/atoms/cmdk/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as ee, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import * as K from "@radix-ui/react-dialog";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { useCallback as
|
|
4
|
+
import { useCallback as ae, useMemo as Ee } from "react";
|
|
5
5
|
import { commandScore as Ce } from "./command-score.js";
|
|
6
6
|
import { Primitive as I } from "@radix-ui/react-primitive";
|
|
7
|
-
import { useId as
|
|
7
|
+
import { useId as F } from "@radix-ui/react-id";
|
|
8
8
|
import { s as we } from "../../node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js";
|
|
9
9
|
import { ASK_AI_TRIGGER_VALUE as ye } from "../../constants/search.js";
|
|
10
10
|
import { composeEventHandlers as Re } from "../../utils/compose-event-handlers.js";
|
|
11
11
|
import { useShadow as Ie } from "../shadow/context.js";
|
|
12
|
-
const
|
|
13
|
-
const r = M(() => /* @__PURE__ */ new Set()), i = M(() => /* @__PURE__ */ new Map()), u = M(() => /* @__PURE__ */ new Map()), f = M(() => /* @__PURE__ */ new Set()), s =
|
|
14
|
-
label:
|
|
12
|
+
const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-heading=""]', de = '[cmdk-item=""]', ue = `${de}:not([aria-disabled="true"])`, Z = "cmdk-item-select", L = "data-value", ke = (t, n, r) => Ce(t, n, r ?? []), fe = c.createContext(void 0), D = () => c.useContext(fe), me = c.createContext(void 0), te = () => c.useContext(me), he = c.createContext(void 0), ve = c.forwardRef((t, n) => {
|
|
13
|
+
const r = M(() => /* @__PURE__ */ new Set()), i = M(() => /* @__PURE__ */ new Map()), u = M(() => /* @__PURE__ */ new Map()), f = M(() => /* @__PURE__ */ new Set()), s = ge(t), {
|
|
14
|
+
label: h,
|
|
15
15
|
children: d,
|
|
16
16
|
value: S,
|
|
17
17
|
onValueChange: C,
|
|
@@ -20,11 +20,11 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
20
20
|
loop: R,
|
|
21
21
|
disablePointerSelection: _ = !1,
|
|
22
22
|
vimBindings: N = !0,
|
|
23
|
-
defaultSearch:
|
|
23
|
+
defaultSearch: re,
|
|
24
24
|
...U
|
|
25
|
-
} = t,
|
|
25
|
+
} = t, v = M(() => ({
|
|
26
26
|
/** Value of the search query. */
|
|
27
|
-
search:
|
|
27
|
+
search: re ?? "",
|
|
28
28
|
/** Currently selected item value. */
|
|
29
29
|
value: t.value ?? t.defaultValue ?? "",
|
|
30
30
|
/** Currently selected item id. */
|
|
@@ -37,27 +37,27 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
37
37
|
/** Set of groups with at least one visible item. */
|
|
38
38
|
groups: /* @__PURE__ */ new Set()
|
|
39
39
|
}
|
|
40
|
-
})), $ =
|
|
40
|
+
})), $ = F(), j = F(), q = F(), x = c.useRef(null), g = Ge();
|
|
41
41
|
A(() => {
|
|
42
42
|
if (S !== void 0) {
|
|
43
43
|
const e = S.trim();
|
|
44
|
-
|
|
44
|
+
v.current.value = e, E.emit();
|
|
45
45
|
}
|
|
46
46
|
}, [S]), A(() => {
|
|
47
|
-
g(6,
|
|
47
|
+
g(6, oe);
|
|
48
48
|
}, []);
|
|
49
49
|
const G = Ie(), E = c.useMemo(() => ({
|
|
50
50
|
subscribe: (e) => (f.current.add(e), () => f.current.delete(e)),
|
|
51
|
-
snapshot: () =>
|
|
51
|
+
snapshot: () => v.current,
|
|
52
52
|
setState: (e, l, o) => {
|
|
53
|
-
if (!Object.is(
|
|
54
|
-
if (
|
|
55
|
-
J(),
|
|
53
|
+
if (!Object.is(v.current[e], l)) {
|
|
54
|
+
if (v.current[e] = l, e === "search")
|
|
55
|
+
J(), H(), g(1, W);
|
|
56
56
|
else if (e === "value" && (G?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("cmdk-input") || g(1, () => {
|
|
57
|
-
|
|
57
|
+
k()?.focus();
|
|
58
58
|
}), g(7, () => {
|
|
59
|
-
|
|
60
|
-
}), o || g(5,
|
|
59
|
+
v.current.selectedItemId = k()?.id, E.emit();
|
|
60
|
+
}), o || g(5, oe), s.current?.value !== void 0)) {
|
|
61
61
|
const b = l ?? "";
|
|
62
62
|
s.current.onValueChange?.(b);
|
|
63
63
|
return;
|
|
@@ -68,20 +68,20 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
68
68
|
emit: () => {
|
|
69
69
|
f.current.forEach((e) => e());
|
|
70
70
|
}
|
|
71
|
-
}), []),
|
|
71
|
+
}), []), z = c.useMemo(
|
|
72
72
|
() => ({
|
|
73
73
|
// Keep id → {value, keywords} mapping up-to-date
|
|
74
74
|
value: (e, l, o) => {
|
|
75
|
-
l !== u.current.get(e)?.value && (u.current.set(e, { value: l, keywords: o }),
|
|
76
|
-
|
|
75
|
+
l !== u.current.get(e)?.value && (u.current.set(e, { value: l, keywords: o }), v.current.filtered.items.set(e, ne(l, o)), g(2, () => {
|
|
76
|
+
H(), E.emit();
|
|
77
77
|
}));
|
|
78
78
|
},
|
|
79
79
|
// Track item lifecycle (mount, unmount)
|
|
80
80
|
item: (e, l) => (r.current.add(e), l && (i.current.has(l) ? i.current?.get(l)?.add(e) : i.current.set(l, /* @__PURE__ */ new Set([e]))), g(3, () => {
|
|
81
|
-
J(),
|
|
81
|
+
J(), H(), v.current.value || W(), E.emit();
|
|
82
82
|
}), () => {
|
|
83
|
-
u.current.delete(e), r.current.delete(e),
|
|
84
|
-
const o =
|
|
83
|
+
u.current.delete(e), r.current.delete(e), v.current.filtered.items.delete(e);
|
|
84
|
+
const o = k();
|
|
85
85
|
g(4, () => {
|
|
86
86
|
J(), o?.getAttribute("id") === e && W(), E.emit();
|
|
87
87
|
});
|
|
@@ -91,48 +91,48 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
91
91
|
u.current.delete(e), i.current.delete(e);
|
|
92
92
|
}),
|
|
93
93
|
filter: () => !!s.current.shouldFilter,
|
|
94
|
-
label:
|
|
94
|
+
label: h || t["aria-label"] || "",
|
|
95
95
|
getDisablePointerSelection: () => !!s.current.disablePointerSelection,
|
|
96
96
|
listId: $,
|
|
97
97
|
inputId: q,
|
|
98
98
|
labelId: j,
|
|
99
|
-
listInnerRef:
|
|
99
|
+
listInnerRef: x
|
|
100
100
|
}),
|
|
101
101
|
[]
|
|
102
102
|
);
|
|
103
|
-
function
|
|
104
|
-
const o = s.current?.filter ??
|
|
105
|
-
return e ? o?.(e,
|
|
103
|
+
function ne(e, l) {
|
|
104
|
+
const o = s.current?.filter ?? ke;
|
|
105
|
+
return e ? o?.(e, v.current.search, l) : 0;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
if (!
|
|
107
|
+
function H() {
|
|
108
|
+
if (!v.current.search || // Explicitly false, because true | undefined is the default
|
|
109
109
|
s.current.shouldFilter === !1)
|
|
110
110
|
return;
|
|
111
|
-
const e =
|
|
112
|
-
|
|
111
|
+
const e = v.current.filtered.items, l = [];
|
|
112
|
+
v.current.filtered.groups.forEach((a) => {
|
|
113
113
|
const m = i.current.get(a);
|
|
114
114
|
let b = 0;
|
|
115
|
-
m.forEach((
|
|
116
|
-
const Se = e.get(
|
|
115
|
+
m.forEach((X) => {
|
|
116
|
+
const Se = e.get(X);
|
|
117
117
|
b = Math.max(Se, b);
|
|
118
118
|
}), l.push([a, b]);
|
|
119
119
|
});
|
|
120
|
-
const o =
|
|
120
|
+
const o = x.current;
|
|
121
121
|
V().sort((a, m) => {
|
|
122
|
-
const b = a.getAttribute("id"),
|
|
123
|
-
return (e.get(
|
|
122
|
+
const b = a.getAttribute("id"), X = m.getAttribute("id");
|
|
123
|
+
return (e.get(X) ?? 0) - (e.get(b) ?? 0);
|
|
124
124
|
}).forEach((a) => {
|
|
125
|
-
const m = a.closest(
|
|
125
|
+
const m = a.closest(Y);
|
|
126
126
|
if (m) {
|
|
127
|
-
const b = a.parentElement === m ? a : a.closest(`${
|
|
127
|
+
const b = a.parentElement === m ? a : a.closest(`${Y} > *`);
|
|
128
128
|
b && m.appendChild(b);
|
|
129
129
|
} else {
|
|
130
|
-
const b = a.parentElement === o ? a : a.closest(`${
|
|
130
|
+
const b = a.parentElement === o ? a : a.closest(`${Y} > *`);
|
|
131
131
|
b && o?.appendChild(b);
|
|
132
132
|
}
|
|
133
133
|
}), l.sort((a, m) => m[1] - a[1]).forEach((a) => {
|
|
134
|
-
const m =
|
|
135
|
-
`${
|
|
134
|
+
const m = x.current?.querySelector(
|
|
135
|
+
`${T}[${L}="${encodeURIComponent(a[0])}"]`
|
|
136
136
|
);
|
|
137
137
|
m?.parentElement?.appendChild(m);
|
|
138
138
|
});
|
|
@@ -144,58 +144,58 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
144
144
|
E.setState("value", l || void 0);
|
|
145
145
|
}
|
|
146
146
|
function J() {
|
|
147
|
-
if (!
|
|
147
|
+
if (!v.current.search || // Explicitly false, because true | undefined is the default
|
|
148
148
|
s.current.shouldFilter === !1) {
|
|
149
|
-
|
|
149
|
+
v.current.filtered.count = r.current.size;
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
v.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
153
153
|
let e = 0;
|
|
154
154
|
for (const l of r.current) {
|
|
155
|
-
const o = u.current.get(l)?.value ?? "", a = u.current.get(l)?.keywords ?? [], m =
|
|
156
|
-
|
|
155
|
+
const o = u.current.get(l)?.value ?? "", a = u.current.get(l)?.keywords ?? [], m = ne(o, a);
|
|
156
|
+
v.current.filtered.items.set(l, m), m > 0 && e++;
|
|
157
157
|
}
|
|
158
158
|
for (const [l, o] of i.current)
|
|
159
159
|
for (const a of o) {
|
|
160
|
-
const m =
|
|
160
|
+
const m = v.current.filtered.items.get(a);
|
|
161
161
|
if (m && m > 0) {
|
|
162
|
-
|
|
162
|
+
v.current.filtered.groups.add(l);
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
v.current.filtered.count = e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const e =
|
|
170
|
-
e && (e.parentElement?.firstChild === e && e.closest(
|
|
168
|
+
function oe() {
|
|
169
|
+
const e = k();
|
|
170
|
+
e && (e.parentElement?.firstChild === e && e.closest(T)?.querySelector(xe)?.scrollIntoView({ block: "nearest" }), e.scrollIntoView({ block: "nearest" }));
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
return
|
|
172
|
+
function k() {
|
|
173
|
+
return x.current?.querySelector(`${de}[aria-selected="true"]`);
|
|
174
174
|
}
|
|
175
175
|
function V() {
|
|
176
|
-
return Array.from(
|
|
176
|
+
return Array.from(x.current?.querySelectorAll(ue) || []);
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ce(e) {
|
|
179
179
|
const o = V()[e];
|
|
180
180
|
o && E.setState("value", o.getAttribute(L));
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const l =
|
|
182
|
+
function Q(e) {
|
|
183
|
+
const l = k(), o = V(), a = o.findIndex((b) => b === l);
|
|
184
184
|
let m = o[a + e];
|
|
185
185
|
s.current?.loop && (m = a + e < 0 ? o[o.length - 1] : a + e === o.length ? o[0] : o[a + e]), m && E.setState("value", m.getAttribute(L));
|
|
186
186
|
}
|
|
187
187
|
function se(e) {
|
|
188
|
-
let o =
|
|
188
|
+
let o = k()?.closest(T), a;
|
|
189
189
|
for (; o && !a; )
|
|
190
|
-
o = e > 0 ?
|
|
191
|
-
a ? E.setState("value", a.getAttribute(L)) :
|
|
190
|
+
o = e > 0 ? Oe(o, T) : De(o, T), a = o?.querySelector(ue);
|
|
191
|
+
a ? E.setState("value", a.getAttribute(L)) : Q(e);
|
|
192
192
|
}
|
|
193
|
-
const
|
|
194
|
-
e.preventDefault(), e.metaKey ?
|
|
195
|
-
},
|
|
196
|
-
e.preventDefault(), e.metaKey ?
|
|
193
|
+
const be = () => ce(V().length - 1), ie = (e) => {
|
|
194
|
+
e.preventDefault(), e.metaKey ? be() : e.altKey ? se(1) : Q(1);
|
|
195
|
+
}, le = (e) => {
|
|
196
|
+
e.preventDefault(), e.metaKey ? ce(0) : e.altKey ? se(-1) : Q(-1);
|
|
197
197
|
};
|
|
198
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ ee(
|
|
199
199
|
I.div,
|
|
200
200
|
{
|
|
201
201
|
ref: n,
|
|
@@ -207,36 +207,28 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
207
207
|
switch (e.key) {
|
|
208
208
|
case "n":
|
|
209
209
|
case "j": {
|
|
210
|
-
N && e.ctrlKey &&
|
|
210
|
+
N && e.ctrlKey && ie(e);
|
|
211
211
|
break;
|
|
212
212
|
}
|
|
213
213
|
case "ArrowDown": {
|
|
214
|
-
|
|
214
|
+
ie(e);
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
217
|
case "p":
|
|
218
218
|
case "k": {
|
|
219
|
-
N && e.ctrlKey &&
|
|
219
|
+
N && e.ctrlKey && le(e);
|
|
220
220
|
break;
|
|
221
221
|
}
|
|
222
222
|
case "ArrowUp": {
|
|
223
|
-
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
case "Home": {
|
|
227
|
-
e.preventDefault(), Q(0);
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
case "End": {
|
|
231
|
-
e.preventDefault(), ie();
|
|
223
|
+
le(e);
|
|
232
224
|
break;
|
|
233
225
|
}
|
|
234
226
|
case "Enter":
|
|
235
227
|
if (!e.nativeEvent.isComposing && e.keyCode !== 229) {
|
|
236
228
|
e.preventDefault();
|
|
237
|
-
const l =
|
|
229
|
+
const l = k();
|
|
238
230
|
if (l) {
|
|
239
|
-
const o = new Event(
|
|
231
|
+
const o = new Event(Z);
|
|
240
232
|
l.dispatchEvent(o);
|
|
241
233
|
}
|
|
242
234
|
}
|
|
@@ -250,34 +242,34 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
250
242
|
"label",
|
|
251
243
|
{
|
|
252
244
|
"cmdk-label": "",
|
|
253
|
-
htmlFor:
|
|
254
|
-
id:
|
|
245
|
+
htmlFor: z.inputId,
|
|
246
|
+
id: z.labelId,
|
|
255
247
|
style: Be,
|
|
256
|
-
children:
|
|
248
|
+
children: h
|
|
257
249
|
}
|
|
258
250
|
),
|
|
259
|
-
B(t, (e) => /* @__PURE__ */ p(
|
|
251
|
+
B(t, (e) => /* @__PURE__ */ p(me.Provider, { value: E, children: /* @__PURE__ */ p(fe.Provider, { value: z, children: e }) }))
|
|
260
252
|
]
|
|
261
253
|
}
|
|
262
254
|
);
|
|
263
255
|
}), Ae = c.forwardRef((t, n) => {
|
|
264
|
-
const { id: r } = t, i = c.useRef(null), u = c.useContext(he), f =
|
|
256
|
+
const { id: r } = t, i = c.useRef(null), u = c.useContext(he), f = D(), s = ge(t), h = s.current?.forceMount ?? u?.forceMount;
|
|
265
257
|
A(() => {
|
|
266
|
-
if (!
|
|
258
|
+
if (!h)
|
|
267
259
|
return f.item(r, u?.id);
|
|
268
|
-
}, [
|
|
269
|
-
const d =
|
|
270
|
-
(g) =>
|
|
260
|
+
}, [h]);
|
|
261
|
+
const d = pe(r, i, [t.value, t.children, i], t.keywords), S = te(), C = P((g) => g.value && g.value === d.current), y = P(
|
|
262
|
+
(g) => h || f.filter() === !1 ? !0 : g.search ? g.filtered.items.get(r) > 0 : !0
|
|
271
263
|
);
|
|
272
264
|
c.useEffect(() => {
|
|
273
265
|
const g = i.current;
|
|
274
266
|
if (!g || t.disabled) return;
|
|
275
267
|
const G = () => R("keyboard");
|
|
276
|
-
return g.addEventListener(
|
|
268
|
+
return g.addEventListener(Z, G), () => g.removeEventListener(Z, G);
|
|
277
269
|
}, [y, t.onSelect, t.disabled]);
|
|
278
|
-
const w =
|
|
270
|
+
const w = ae(() => {
|
|
279
271
|
S.setState("value", d.current, !0);
|
|
280
|
-
}, [S, d]), R =
|
|
272
|
+
}, [S, d]), R = ae(
|
|
281
273
|
(g = "click") => {
|
|
282
274
|
w(), s.current.onSelect?.({ value: d.current, trigger: g });
|
|
283
275
|
},
|
|
@@ -287,12 +279,12 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
287
279
|
const {
|
|
288
280
|
disabled: _,
|
|
289
281
|
value: N,
|
|
290
|
-
onSelect:
|
|
282
|
+
onSelect: re,
|
|
291
283
|
forceMount: U,
|
|
292
|
-
keywords:
|
|
284
|
+
keywords: v,
|
|
293
285
|
onClick: $,
|
|
294
286
|
...j
|
|
295
|
-
} = t, q = Ee(() =>
|
|
287
|
+
} = t, q = Ee(() => O([i, n]), [i, n]), x = Re($, R);
|
|
296
288
|
return /* @__PURE__ */ p(
|
|
297
289
|
I.div,
|
|
298
290
|
{
|
|
@@ -306,21 +298,21 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
306
298
|
"data-disabled": !!_,
|
|
307
299
|
"data-selected": !!C,
|
|
308
300
|
onPointerMove: _ || f.getDisablePointerSelection() ? void 0 : w,
|
|
309
|
-
onClick: _ ? void 0 :
|
|
301
|
+
onClick: _ ? void 0 : x,
|
|
310
302
|
onFocus: _ ? void 0 : w,
|
|
311
303
|
children: t.children
|
|
312
304
|
}
|
|
313
305
|
);
|
|
314
306
|
}), _e = c.forwardRef((t, n) => {
|
|
315
|
-
const { heading: r, children: i, forceMount: u, ...f } = t, s =
|
|
307
|
+
const { heading: r, children: i, forceMount: u, ...f } = t, s = F(), h = c.useRef(null), d = c.useRef(null), S = F(), C = D(), y = P(
|
|
316
308
|
(R) => u || C.filter() === !1 ? !0 : R.search ? R.filtered.groups.has(s) : !0
|
|
317
309
|
);
|
|
318
|
-
A(() => C.group(s), []),
|
|
310
|
+
A(() => C.group(s), []), pe(s, h, [t.value, t.heading, d]);
|
|
319
311
|
const w = c.useMemo(() => ({ id: s, forceMount: u }), [u]);
|
|
320
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ ee(
|
|
321
313
|
I.div,
|
|
322
314
|
{
|
|
323
|
-
ref:
|
|
315
|
+
ref: O([h, n]),
|
|
324
316
|
...f,
|
|
325
317
|
"cmdk-group": "",
|
|
326
318
|
role: "presentation",
|
|
@@ -339,14 +331,14 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
339
331
|
return !r && !f ? null : /* @__PURE__ */ p(
|
|
340
332
|
I.div,
|
|
341
333
|
{
|
|
342
|
-
ref:
|
|
334
|
+
ref: O([u, n]),
|
|
343
335
|
...i,
|
|
344
336
|
"cmdk-separator": "",
|
|
345
337
|
role: "separator"
|
|
346
338
|
}
|
|
347
339
|
);
|
|
348
340
|
}), Me = c.forwardRef((t, n) => {
|
|
349
|
-
const { onValueChange: r, ...i } = t, u = t.value != null, f =
|
|
341
|
+
const { onValueChange: r, ...i } = t, u = t.value != null, f = te(), s = P((d) => d.search), h = D();
|
|
350
342
|
return c.useEffect(() => {
|
|
351
343
|
t.value != null && f.setState("search", t.value);
|
|
352
344
|
}, [t.value]), /* @__PURE__ */ p(
|
|
@@ -361,9 +353,9 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
361
353
|
"aria-autocomplete": "list",
|
|
362
354
|
role: "combobox",
|
|
363
355
|
"aria-expanded": !0,
|
|
364
|
-
"aria-controls":
|
|
365
|
-
"aria-labelledby":
|
|
366
|
-
id:
|
|
356
|
+
"aria-controls": h.listId,
|
|
357
|
+
"aria-labelledby": h.labelId,
|
|
358
|
+
id: h.inputId,
|
|
367
359
|
type: "text",
|
|
368
360
|
value: u ? t.value : s,
|
|
369
361
|
onChange: (d) => {
|
|
@@ -372,7 +364,7 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
372
364
|
}
|
|
373
365
|
);
|
|
374
366
|
}), Pe = c.forwardRef((t, n) => {
|
|
375
|
-
const { children: r, label: i = "Suggestions", ...u } = t, f = c.useRef(null), s = c.useRef(null),
|
|
367
|
+
const { children: r, label: i = "Suggestions", ...u } = t, f = c.useRef(null), s = c.useRef(null), h = D();
|
|
376
368
|
return c.useEffect(() => {
|
|
377
369
|
if (s.current && f.current) {
|
|
378
370
|
const d = s.current, S = f.current;
|
|
@@ -390,22 +382,22 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
390
382
|
}, []), /* @__PURE__ */ p(
|
|
391
383
|
I.div,
|
|
392
384
|
{
|
|
393
|
-
ref:
|
|
385
|
+
ref: O([f, n]),
|
|
394
386
|
...u,
|
|
395
387
|
"cmdk-list": "",
|
|
396
388
|
tabIndex: -1,
|
|
397
389
|
"aria-label": i,
|
|
398
|
-
id:
|
|
399
|
-
children: B(t, (d) => /* @__PURE__ */ p("div", { ref:
|
|
390
|
+
id: h.listId,
|
|
391
|
+
children: B(t, (d) => /* @__PURE__ */ p("div", { ref: O([s, h.listInnerRef]), "cmdk-list-sizer": "", children: d }))
|
|
400
392
|
}
|
|
401
393
|
);
|
|
402
394
|
}), Ve = c.forwardRef((t, n) => {
|
|
403
|
-
const { open: r, onOpenChange: i, overlayClassName: u, contentClassName: f, container: s, ...
|
|
404
|
-
return /* @__PURE__ */ p(K.Root, { open: r, onOpenChange: i, children: /* @__PURE__ */
|
|
395
|
+
const { open: r, onOpenChange: i, overlayClassName: u, contentClassName: f, container: s, ...h } = t;
|
|
396
|
+
return /* @__PURE__ */ p(K.Root, { open: r, onOpenChange: i, children: /* @__PURE__ */ ee(K.Portal, { container: s, children: [
|
|
405
397
|
/* @__PURE__ */ p(K.Overlay, { "cmdk-overlay": "", className: u }),
|
|
406
|
-
/* @__PURE__ */ p(K.Content, { "aria-label": t.label, "cmdk-dialog": "", className: f, children: /* @__PURE__ */ p(
|
|
398
|
+
/* @__PURE__ */ p(K.Content, { "aria-label": t.label, "cmdk-dialog": "", className: f, children: /* @__PURE__ */ p(ve, { ref: n, ...h }) })
|
|
407
399
|
] }) });
|
|
408
|
-
}),
|
|
400
|
+
}), Te = c.forwardRef((t, n) => P((i) => i.filtered.count === 0) ? /* @__PURE__ */ p(I.div, { ref: n, ...t, "cmdk-empty": "", role: "presentation" }) : null), Fe = c.forwardRef((t, n) => {
|
|
409
401
|
const { progress: r, children: i, label: u = "Loading...", ...f } = t;
|
|
410
402
|
return /* @__PURE__ */ p(
|
|
411
403
|
I.div,
|
|
@@ -421,31 +413,31 @@ const D = '[cmdk-group=""]', Z = '[cmdk-group-items=""]', ke = '[cmdk-group-head
|
|
|
421
413
|
children: B(t, (s) => /* @__PURE__ */ p("div", { "aria-hidden": !0, children: s }))
|
|
422
414
|
}
|
|
423
415
|
);
|
|
424
|
-
}), Qe = Object.assign(
|
|
416
|
+
}), Qe = Object.assign(ve, {
|
|
425
417
|
List: Pe,
|
|
426
418
|
Item: Ae,
|
|
427
419
|
Input: Me,
|
|
428
420
|
Group: _e,
|
|
429
421
|
Separator: Le,
|
|
430
422
|
Dialog: Ve,
|
|
431
|
-
Empty:
|
|
432
|
-
Loading:
|
|
423
|
+
Empty: Te,
|
|
424
|
+
Loading: Fe
|
|
433
425
|
});
|
|
434
|
-
function
|
|
426
|
+
function Oe(t, n) {
|
|
435
427
|
let r = t.nextElementSibling;
|
|
436
428
|
for (; r; ) {
|
|
437
429
|
if (r.matches(n)) return r;
|
|
438
430
|
r = r.nextElementSibling;
|
|
439
431
|
}
|
|
440
432
|
}
|
|
441
|
-
function
|
|
433
|
+
function De(t, n) {
|
|
442
434
|
let r = t.previousElementSibling;
|
|
443
435
|
for (; r; ) {
|
|
444
436
|
if (r.matches(n)) return r;
|
|
445
437
|
r = r.previousElementSibling;
|
|
446
438
|
}
|
|
447
439
|
}
|
|
448
|
-
function
|
|
440
|
+
function ge(t) {
|
|
449
441
|
const n = c.useRef(t);
|
|
450
442
|
return A(() => {
|
|
451
443
|
n.current = t;
|
|
@@ -456,7 +448,7 @@ function M(t) {
|
|
|
456
448
|
const n = c.useRef(void 0);
|
|
457
449
|
return n.current === void 0 && (n.current = t()), n;
|
|
458
450
|
}
|
|
459
|
-
function
|
|
451
|
+
function O(t) {
|
|
460
452
|
return (n) => {
|
|
461
453
|
t.forEach((r) => {
|
|
462
454
|
typeof r == "function" ? r(n) : r != null && (r.current = n);
|
|
@@ -464,11 +456,11 @@ function F(t) {
|
|
|
464
456
|
};
|
|
465
457
|
}
|
|
466
458
|
function P(t) {
|
|
467
|
-
const n =
|
|
459
|
+
const n = te(), r = () => t(n.snapshot());
|
|
468
460
|
return we.useSyncExternalStore(n.subscribe, r, r);
|
|
469
461
|
}
|
|
470
|
-
function
|
|
471
|
-
const u = c.useRef(void 0), f =
|
|
462
|
+
function pe(t, n, r, i = []) {
|
|
463
|
+
const u = c.useRef(void 0), f = D();
|
|
472
464
|
return A(() => {
|
|
473
465
|
const s = (() => {
|
|
474
466
|
for (const d of r) {
|
|
@@ -477,8 +469,8 @@ function be(t, n, r, i = []) {
|
|
|
477
469
|
if (typeof d == "object" && "current" in d)
|
|
478
470
|
return d.current ? d.current.textContent?.trim() : u.current;
|
|
479
471
|
}
|
|
480
|
-
})(),
|
|
481
|
-
f.value(t, s,
|
|
472
|
+
})(), h = i.map((d) => d.trim());
|
|
473
|
+
f.value(t, s, h), n.current?.setAttribute(L, s), u.current = s;
|
|
482
474
|
}), u;
|
|
483
475
|
}
|
|
484
476
|
const Ge = () => {
|
|
@@ -515,14 +507,14 @@ const Be = {
|
|
|
515
507
|
export {
|
|
516
508
|
Qe as Command,
|
|
517
509
|
Ve as CommandDialog,
|
|
518
|
-
|
|
510
|
+
Te as CommandEmpty,
|
|
519
511
|
Me as CommandInput,
|
|
520
512
|
Ae as CommandItem,
|
|
521
513
|
Pe as CommandList,
|
|
522
|
-
|
|
523
|
-
|
|
514
|
+
Fe as CommandLoading,
|
|
515
|
+
ve as CommandRoot,
|
|
524
516
|
Le as CommandSeparator,
|
|
525
|
-
|
|
517
|
+
ke as defaultFilter,
|
|
526
518
|
P as useCommandState,
|
|
527
|
-
|
|
519
|
+
te as useCommandStore
|
|
528
520
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=require("openai"),t=require("react"),xe=require("../../providers/config-provider.cjs"),Be=require("../../providers/conversation-provider.cjs"),De=require("../../providers/chat-events-provider.cjs"),D=require("../../utils/get-message-metadata.cjs"),Oe=require("../../utils/misc.cjs"),ae=require("../../utils/reset-query-params.cjs"),Fe=require("../../providers/chat-form-provider.cjs"),Te=require("../../providers/widget-provider.cjs"),Ke=require("../../hooks/use-media-query.cjs"),Qe=require("./use-captcha.cjs"),We=require("../modal/modal-provider.cjs"),l=require("../../utils/generate-uid.cjs"),Je=require("../../utils/tools/links-tool.cjs"),ze=require("../../atoms/api/analytics/conversation.cjs"),He=()=>{const{chatId:p,setConversation:re,conversation:N,resetConversation:ie}=Be.useInkeepConversation(),{baseSettings:b,aiChatSettings:O}=xe.useInkeepConfig(),{aiApiBaseUrl:F,shouldBypassCaptcha:T,filters:K}=b,Q=We.useModal(),{getSolution:ce,prefetchSolution:q,invalidateSolution:W}=Qe.useCaptcha({fetchUrl:`${F}/v1/challenge`,shouldBypassCaptcha:T,shouldMakeInitialRequest:Q?Q.isOpen:!0}),ue=new Le({baseURL:`${F}/v1`,apiKey:b.apiKey,dangerouslyAllowBrowser:!0}),{onInputMessageChange:le,getTools:de,prompts:ge,model:me,filters:J,onToolCall:pe}=O,[f,_]=t.useState(""),z=t.useRef(null);t.useEffect(()=>{le?.(f)},[f]);const[d,u]=t.useState([]),[H,h]=t.useState(!1),[fe,v]=t.useState(!1),[he,j]=t.useState(null),[A,G]=t.useState(null),[y,S]=t.useState([]),ve=e=>{S(s=>[...s,e])},[ye,V]=t.useState({}),r=t.useRef([]),C=t.useRef(null),{logEvent:P,logConversation:Se}=De.useChatEvents(),X=ge?.map((e,s)=>({id:`system-${Date.now().toString()}-${l.generateUid(4)}-${s}`,role:"system",content:e})),[Ce,we]=t.useState(!!p);t.useEffect(()=>{if(p){const{apiKey:e,analyticsApiBaseUrl:s}=b;ze.getConversation(p,e,s).then(o=>{if(o){P({eventName:"shared_chat_loaded",properties:{conversation:o}}),we(!1),re({...o,id:""});const a=o.messages.map(c=>({id:Date.now().toString()+l.generateUid(4)+c.id,content:Oe.parseIfJson(c.content),role:c.role,links:c.links}));u(a),r.current=a}})}},[p]);const Me=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${b.organizationDisplayName??"Administrator"}`;default:return`Hmm..
|
|
2
2
|
|
|
3
|
-
It seems I might be having some issues right now. Please clear the chat and try again.`}},Y=e=>{j(e),
|
|
4
|
-
${D.serializeWorkflow(e)}`},...X,a,c];
|
|
3
|
+
It seems I might be having some issues right now. Please clear the chat and try again.`}},Y=e=>{j(e),u(s=>{const o=[...s],a=o[o.length-1];return a&&(a.content=Me(e)),o}),h(!1),v(!1),W(),q()},R=!f.trim()&&!y.length||H,Ie=e=>{e.key==="Enter"&&!e.shiftKey&&!R&&!e.nativeEvent.isComposing&&(e.preventDefault(),L())},ke=e=>{const s=e.target.value;_(s)},L=async(e=f)=>{if(R&&(!e||e.trim().length===0))return;h(!0);const s=A?d.length===2:d.length===0,o=D.getMessageMetadata(A,y,s);let a;const c=D.serializeAttachments(y);y.length&&c?a=[{type:"text",text:c}]:a=e;const ee={id:`${Date.now().toString()}-${l.generateUid(4)}-1`,role:"user",content:a,metadata:o},E=[...d.length?[]:X,ee];p&&ae.resetQueryParams(),u(w=>[...w,...E]),r.current=[...r.current,...E],S([]),_(""),P({eventName:"user_message_submitted",properties:{}},r.current);const te=[Je.provideLinksTool,...de?.({conversation:N})||[]];try{const w={model:me,messages:r.current,stream:!0,tools:te,tool_choice:"auto"},se=await ce(),ne=se?btoa(JSON.stringify(se)):null,oe=K||J?JSON.stringify({...K,...J}):void 0,U={};!T&&ne&&(U["X-INKEEP-CHALLENGE-SOLUTION"]=ne),oe&&(U["inkeep-filters"]=oe);const g=ue.beta.chat.completions.stream(w,Object.keys(U).length>0?{headers:U}:void 0),n={id:`${Date.now().toString()}-${l.generateUid(4)}-2`,role:"assistant",content:"",links:[],toolCalls:[]};u(M=>[...M,n]),g.on("content",(M,I)=>{v(!0),n.content=I,u($=>{const i=[...$],x=i.findIndex(k=>k.id===n.id);return x===-1?[...i,n]:(i[x]={...n},i)})}),g.on("tool_calls.function.arguments.done",async M=>{const{name:I,arguments:$}=M,i=te?.find(m=>m.function.name===I);if(!i)return;const k=("parse"in i.function?i.function.parse:JSON.parse)($),$e=i.function.function?.(k,g),Ne=i.renderMessageButtons?.({args:k,execution:$e})??[];I==="provideLinks"?n.links=k.links??[]:V(m=>({...m,[n.id]:[...m[n.id]??[],...Ne]})),n.toolCalls?.push({id:"call_"+l.generateUid(24),type:"function",function:{name:I,arguments:$}}),u(m=>{const B=[...m],Ae=B.findIndex(Re=>Re.id===n.id);return B[Ae]={...n},B});const _e=await Se([...r.current,n]);pe?.(M,{conversation:_e??N})}),g.on("error",Y),g.finalChatCompletion().then(()=>{r.current=[...r.current,n],C.current=null,h(!1),v(!1),q(),P({eventName:"assistant_message_received",properties:{}},r.current)}),C.current=g.controller}catch(w){Y(w),h(!1),v(!1)}},be=()=>{C.current&&(C.current.abort(),C.current=null),h(!1),v(!1),q()},Z=()=>{j(null),u([]),r.current=[],ie(),V({}),S([]),ae.resetQueryParams(),G(null),W(),q(),P({eventName:"chat_clear_button_clicked",properties:{conversation:N}})},qe=e=>{G(e);const{initialReplyMessage:s,displayName:o}=e,a={id:d.length.toString()+l.generateUid(4),role:"user",content:o},c={id:(d.length+1).toString()+l.generateUid(4),role:"assistant",content:s,links:[]},E=[{id:`system-${Date.now().toString()}-${l.generateUid(4)}-${e.id}`,role:"system",content:`Company has asked user to follow this guided workflow:
|
|
4
|
+
${D.serializeWorkflow(e)}`},...X,a,c];u(E),S([])},{openForm:Pe}=Fe.useChatForm(),Ee=Te.useWidget();t.useImperativeHandle(O.chatFunctionsRef,()=>({submitMessage:L,updateInputMessage(e){_(e)},clearChat:Z,openForm:e=>{Ee?.setView("chat"),Pe(e)},focusInput:()=>{z.current?.focus()}}));const Ue=Ke.useMediaQuery("(max-width: 768px)");return{messages:d,input:f,isLoading:H,isStreaming:fe,isLoadingConversation:Ce,error:he,isSubmitDisabled:R,handleInputChange:ke,handleInputKeyDown:Ie,handleSubmit:L,stop:be,clear:Z,handleWorkflow:qe,selectedWorkflow:A,messageAttachments:y,setMessageAttachments:S,addAttachment:ve,messageButtons:ye,isEmpty:d.length===0,inputRef:z,isMobile:Ue}};exports.useInkeepChat=He;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { useState as c, useRef as U, useEffect as ae, useImperativeHandle as
|
|
4
|
-
import { useInkeepConfig as
|
|
5
|
-
import { useInkeepConversation as
|
|
6
|
-
import { useChatEvents as
|
|
7
|
-
import { getMessageMetadata as
|
|
8
|
-
import { parseIfJson as
|
|
2
|
+
import Re from "openai";
|
|
3
|
+
import { useState as c, useRef as U, useEffect as ae, useImperativeHandle as Pe } from "react";
|
|
4
|
+
import { useInkeepConfig as Ue } from "../../providers/config-provider.js";
|
|
5
|
+
import { useInkeepConversation as Fe } from "../../providers/conversation-provider.js";
|
|
6
|
+
import { useChatEvents as Ke } from "../../providers/chat-events-provider.js";
|
|
7
|
+
import { getMessageMetadata as Te, serializeAttachments as We, serializeWorkflow as Je } from "../../utils/get-message-metadata.js";
|
|
8
|
+
import { parseIfJson as ze } from "../../utils/misc.js";
|
|
9
9
|
import { resetQueryParams as re } from "../../utils/reset-query-params.js";
|
|
10
|
-
import { useChatForm as
|
|
11
|
-
import { useWidget as
|
|
12
|
-
import { useMediaQuery as
|
|
13
|
-
import { useCaptcha as
|
|
14
|
-
import { useModal as
|
|
10
|
+
import { useChatForm as He } from "../../providers/chat-form-provider.js";
|
|
11
|
+
import { useWidget as Qe } from "../../providers/widget-provider.js";
|
|
12
|
+
import { useMediaQuery as je } from "../../hooks/use-media-query.js";
|
|
13
|
+
import { useCaptcha as qe } from "./use-captcha.js";
|
|
14
|
+
import { useModal as Ge } from "../modal/modal-provider.js";
|
|
15
15
|
import { generateUid as u } from "../../utils/generate-uid.js";
|
|
16
|
-
import { provideLinksTool as
|
|
17
|
-
import { getConversation as
|
|
18
|
-
const
|
|
19
|
-
const { chatId: d, setConversation: ie, conversation: x, resetConversation: ce } =
|
|
16
|
+
import { provideLinksTool as Ve } from "../../utils/tools/links-tool.js";
|
|
17
|
+
import { getConversation as Xe } from "../../atoms/api/analytics/conversation.js";
|
|
18
|
+
const dt = () => {
|
|
19
|
+
const { chatId: d, setConversation: ie, conversation: x, resetConversation: ce } = Fe(), { baseSettings: b, aiChatSettings: F } = Ue(), { aiApiBaseUrl: K, shouldBypassCaptcha: T, filters: W } = b, J = Ge(), { getSolution: le, prefetchSolution: $, invalidateSolution: z } = qe({
|
|
20
20
|
fetchUrl: `${K}/v1/challenge`,
|
|
21
21
|
shouldBypassCaptcha: T,
|
|
22
22
|
shouldMakeInitialRequest: J ? J.isOpen : !0
|
|
23
|
-
}), ue = new
|
|
23
|
+
}), ue = new Re({
|
|
24
24
|
baseURL: `${K}/v1`,
|
|
25
25
|
apiKey: b.apiKey,
|
|
26
26
|
dangerouslyAllowBrowser: !0
|
|
@@ -35,36 +35,36 @@ const gt = () => {
|
|
|
35
35
|
ae(() => {
|
|
36
36
|
me?.(f);
|
|
37
37
|
}, [f]);
|
|
38
|
-
const [m, l] = c([]), [j, h] = c(!1), [he, y] = c(!1), [ye, q] = c(null), [B, G] = c(null), [C,
|
|
39
|
-
|
|
40
|
-
}, [
|
|
38
|
+
const [m, l] = c([]), [j, h] = c(!1), [he, y] = c(!1), [ye, q] = c(null), [B, G] = c(null), [C, v] = c([]), Ce = (e) => {
|
|
39
|
+
v((t) => [...t, e]);
|
|
40
|
+
}, [ve, V] = c({}), a = U([]), w = U(null), { logEvent: E, logConversation: we } = Ke(), X = pe?.map((e, t) => ({
|
|
41
41
|
id: `system-${Date.now().toString()}-${u(4)}-${t}`,
|
|
42
42
|
role: "system",
|
|
43
43
|
content: e
|
|
44
|
-
})), [
|
|
44
|
+
})), [Ie, Me] = c(!!d);
|
|
45
45
|
ae(() => {
|
|
46
46
|
if (d) {
|
|
47
47
|
const { apiKey: e, analyticsApiBaseUrl: t } = b;
|
|
48
|
-
|
|
49
|
-
if (
|
|
48
|
+
Xe(d, e, t).then((n) => {
|
|
49
|
+
if (n) {
|
|
50
50
|
E({
|
|
51
51
|
eventName: "shared_chat_loaded",
|
|
52
52
|
properties: {
|
|
53
|
-
conversation:
|
|
53
|
+
conversation: n
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
56
|
-
const o =
|
|
55
|
+
}), Me(!1), ie({ ...n, id: "" });
|
|
56
|
+
const o = n.messages.map((i) => ({
|
|
57
57
|
id: Date.now().toString() + u(4) + i.id,
|
|
58
|
-
content:
|
|
58
|
+
content: ze(i.content),
|
|
59
59
|
role: i.role,
|
|
60
60
|
links: i.links
|
|
61
61
|
}));
|
|
62
|
-
l(o),
|
|
62
|
+
l(o), a.current = o;
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}, [d]);
|
|
67
|
-
const
|
|
67
|
+
const Se = (e) => {
|
|
68
68
|
switch (e.code) {
|
|
69
69
|
case 400:
|
|
70
70
|
return e.message;
|
|
@@ -77,39 +77,39 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
77
77
|
}
|
|
78
78
|
}, Y = (e) => {
|
|
79
79
|
q(e), l((t) => {
|
|
80
|
-
const
|
|
81
|
-
return o && (o.content =
|
|
80
|
+
const n = [...t], o = n[n.length - 1];
|
|
81
|
+
return o && (o.content = Se(e)), n;
|
|
82
82
|
}), h(!1), y(!1), z(), $();
|
|
83
|
-
}, D = !f.trim() && !C.length || j,
|
|
83
|
+
}, D = !f.trim() && !C.length || j, ke = (e) => {
|
|
84
84
|
e.key === "Enter" && !e.shiftKey && !D && !e.nativeEvent.isComposing && (e.preventDefault(), O());
|
|
85
|
-
},
|
|
85
|
+
}, be = (e) => {
|
|
86
86
|
const t = e.target.value;
|
|
87
87
|
L(t);
|
|
88
88
|
}, O = async (e = f) => {
|
|
89
89
|
if (D && (!e || e.trim().length === 0)) return;
|
|
90
90
|
h(!0);
|
|
91
|
-
const t = B ? m.length === 2 : m.length === 0,
|
|
91
|
+
const t = B ? m.length === 2 : m.length === 0, n = Te(B, C, t);
|
|
92
92
|
let o;
|
|
93
|
-
const i =
|
|
93
|
+
const i = We(C);
|
|
94
94
|
C.length && i ? o = [{ type: "text", text: i }] : o = e;
|
|
95
95
|
const ee = {
|
|
96
96
|
id: `${Date.now().toString()}-${u(4)}-1`,
|
|
97
97
|
role: "user",
|
|
98
98
|
content: o,
|
|
99
|
-
metadata:
|
|
99
|
+
metadata: n
|
|
100
100
|
}, N = [...m.length ? [] : X, ee];
|
|
101
|
-
d && re(), l((I) => [...I, ...N]),
|
|
101
|
+
d && re(), l((I) => [...I, ...N]), a.current = [...a.current, ...N], v([]), L(""), E(
|
|
102
102
|
{
|
|
103
103
|
eventName: "user_message_submitted",
|
|
104
104
|
properties: {}
|
|
105
105
|
},
|
|
106
|
-
|
|
106
|
+
a.current
|
|
107
107
|
);
|
|
108
|
-
const te = [
|
|
108
|
+
const te = [Ve, ...ge?.({ conversation: x }) || []];
|
|
109
109
|
try {
|
|
110
110
|
const I = {
|
|
111
111
|
model: de,
|
|
112
|
-
messages:
|
|
112
|
+
messages: a.current,
|
|
113
113
|
stream: !0,
|
|
114
114
|
tools: te,
|
|
115
115
|
tool_choice: "auto"
|
|
@@ -121,27 +121,26 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
121
121
|
const g = ue.beta.chat.completions.stream(
|
|
122
122
|
I,
|
|
123
123
|
Object.keys(_).length > 0 ? { headers: _ } : void 0
|
|
124
|
-
),
|
|
124
|
+
), s = {
|
|
125
125
|
id: `${Date.now().toString()}-${u(4)}-2`,
|
|
126
126
|
role: "assistant",
|
|
127
127
|
content: "",
|
|
128
128
|
links: [],
|
|
129
129
|
toolCalls: []
|
|
130
130
|
};
|
|
131
|
-
l((M) => [...M,
|
|
132
|
-
y(!0),
|
|
133
|
-
const
|
|
134
|
-
return R === -1 ? [...
|
|
131
|
+
l((M) => [...M, s]), g.on("content", (M, S) => {
|
|
132
|
+
y(!0), s.content = S, l((A) => {
|
|
133
|
+
const r = [...A], R = r.findIndex((k) => k.id === s.id);
|
|
134
|
+
return R === -1 ? [...r, s] : (r[R] = { ...s }, r);
|
|
135
135
|
});
|
|
136
|
-
}), g.on("tool_calls.function.arguments.done", (M) => {
|
|
137
|
-
const { name: S, arguments: A } = M,
|
|
138
|
-
if (!
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
S === "provideLinks" ? n.links = k.links ?? [] : V((p) => ({
|
|
136
|
+
}), g.on("tool_calls.function.arguments.done", async (M) => {
|
|
137
|
+
const { name: S, arguments: A } = M, r = te?.find((p) => p.function.name === S);
|
|
138
|
+
if (!r) return;
|
|
139
|
+
const k = ("parse" in r.function ? r.function.parse : JSON.parse)(A), xe = r.function.function?.(k, g), Le = r.renderMessageButtons?.({ args: k, execution: xe }) ?? [];
|
|
140
|
+
S === "provideLinks" ? s.links = k.links ?? [] : V((p) => ({
|
|
142
141
|
...p,
|
|
143
|
-
[
|
|
144
|
-
})),
|
|
142
|
+
[s.id]: [...p[s.id] ?? [], ...Le]
|
|
143
|
+
})), s.toolCalls?.push({
|
|
145
144
|
id: "call_" + u(24),
|
|
146
145
|
type: "function",
|
|
147
146
|
function: {
|
|
@@ -149,36 +148,41 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
149
148
|
arguments: A
|
|
150
149
|
}
|
|
151
150
|
}), l((p) => {
|
|
152
|
-
const P = [...p],
|
|
153
|
-
return P[
|
|
151
|
+
const P = [...p], De = P.findIndex((Oe) => Oe.id === s.id);
|
|
152
|
+
return P[De] = { ...s }, P;
|
|
154
153
|
});
|
|
154
|
+
const Be = await we([
|
|
155
|
+
...a.current,
|
|
156
|
+
s
|
|
157
|
+
]);
|
|
158
|
+
fe?.(M, { conversation: Be ?? x });
|
|
155
159
|
}), g.on("error", Y), g.finalChatCompletion().then(() => {
|
|
156
|
-
|
|
160
|
+
a.current = [...a.current, s], w.current = null, h(!1), y(!1), $(), E(
|
|
157
161
|
{
|
|
158
162
|
eventName: "assistant_message_received",
|
|
159
163
|
properties: {}
|
|
160
164
|
},
|
|
161
|
-
|
|
165
|
+
a.current
|
|
162
166
|
);
|
|
163
|
-
}),
|
|
167
|
+
}), w.current = g.controller;
|
|
164
168
|
} catch (I) {
|
|
165
169
|
Y(I), h(!1), y(!1);
|
|
166
170
|
}
|
|
167
|
-
},
|
|
168
|
-
|
|
171
|
+
}, $e = () => {
|
|
172
|
+
w.current && (w.current.abort(), w.current = null), h(!1), y(!1), $();
|
|
169
173
|
}, Z = () => {
|
|
170
|
-
q(null), l([]),
|
|
174
|
+
q(null), l([]), a.current = [], ce(), V({}), v([]), re(), G(null), z(), $(), E({
|
|
171
175
|
eventName: "chat_clear_button_clicked",
|
|
172
176
|
properties: {
|
|
173
177
|
conversation: x
|
|
174
178
|
}
|
|
175
179
|
});
|
|
176
|
-
},
|
|
180
|
+
}, Ee = (e) => {
|
|
177
181
|
G(e);
|
|
178
|
-
const { initialReplyMessage: t, displayName:
|
|
182
|
+
const { initialReplyMessage: t, displayName: n } = e, o = {
|
|
179
183
|
id: m.length.toString() + u(4),
|
|
180
184
|
role: "user",
|
|
181
|
-
content:
|
|
185
|
+
content: n
|
|
182
186
|
}, i = {
|
|
183
187
|
id: (m.length + 1).toString() + u(4),
|
|
184
188
|
role: "assistant",
|
|
@@ -188,48 +192,48 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
188
192
|
id: `system-${Date.now().toString()}-${u(4)}-${e.id}`,
|
|
189
193
|
role: "system",
|
|
190
194
|
content: `Company has asked user to follow this guided workflow:
|
|
191
|
-
${
|
|
195
|
+
${Je(e)}`
|
|
192
196
|
}, ...X, o, i];
|
|
193
|
-
l(N),
|
|
194
|
-
}, { openForm:
|
|
195
|
-
|
|
197
|
+
l(N), v([]);
|
|
198
|
+
}, { openForm: Ne } = He(), _e = Qe();
|
|
199
|
+
Pe(F.chatFunctionsRef, () => ({
|
|
196
200
|
submitMessage: O,
|
|
197
201
|
updateInputMessage(e) {
|
|
198
202
|
L(e);
|
|
199
203
|
},
|
|
200
204
|
clearChat: Z,
|
|
201
205
|
openForm: (e) => {
|
|
202
|
-
|
|
206
|
+
_e?.setView("chat"), Ne(e);
|
|
203
207
|
},
|
|
204
208
|
focusInput: () => {
|
|
205
209
|
Q.current?.focus();
|
|
206
210
|
}
|
|
207
211
|
}));
|
|
208
|
-
const
|
|
212
|
+
const Ae = je("(max-width: 768px)");
|
|
209
213
|
return {
|
|
210
214
|
messages: m,
|
|
211
215
|
input: f,
|
|
212
216
|
isLoading: j,
|
|
213
217
|
isStreaming: he,
|
|
214
|
-
isLoadingConversation:
|
|
218
|
+
isLoadingConversation: Ie,
|
|
215
219
|
error: ye,
|
|
216
220
|
isSubmitDisabled: D,
|
|
217
|
-
handleInputChange:
|
|
218
|
-
handleInputKeyDown:
|
|
221
|
+
handleInputChange: be,
|
|
222
|
+
handleInputKeyDown: ke,
|
|
219
223
|
handleSubmit: O,
|
|
220
|
-
stop:
|
|
224
|
+
stop: $e,
|
|
221
225
|
clear: Z,
|
|
222
|
-
handleWorkflow:
|
|
226
|
+
handleWorkflow: Ee,
|
|
223
227
|
selectedWorkflow: B,
|
|
224
228
|
messageAttachments: C,
|
|
225
|
-
setMessageAttachments:
|
|
229
|
+
setMessageAttachments: v,
|
|
226
230
|
addAttachment: Ce,
|
|
227
|
-
messageButtons:
|
|
231
|
+
messageButtons: ve,
|
|
228
232
|
isEmpty: m.length === 0,
|
|
229
233
|
inputRef: Q,
|
|
230
|
-
isMobile:
|
|
234
|
+
isMobile: Ae
|
|
231
235
|
};
|
|
232
236
|
};
|
|
233
237
|
export {
|
|
234
|
-
|
|
238
|
+
dt as useInkeepChat
|
|
235
239
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),f=require("./user-provider.cjs"),d=t.createContext(void 0),b=({children:e})=>{const{baseSettings:n,componentType:o}=B.useInkeepConfig(),{apiKey:r,analyticsApiBaseUrl:i,tags:c,privacyPreferences:E,env:g}=n,{userProperties:a}=f.useUser(),v=t.useMemo(()=>({widgetLibraryVersion:"0.5.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),f=require("./user-provider.cjs"),d=t.createContext(void 0),b=({children:e})=>{const{baseSettings:n,componentType:o}=B.useInkeepConfig(),{apiKey:r,analyticsApiBaseUrl:i,tags:c,privacyPreferences:E,env:g}=n,{userProperties:a}=f.useUser(),v=t.useMemo(()=>({widgetLibraryVersion:"0.5.48",componentType:o,tags:c}),[o,c]),u=!E.optOutAllAnalytics&&g!=="development",m={logEvent:t.useCallback(async l=>{const s={...v,...l.properties},p={eventName:l.eventName,properties:s,userProperties:a};if(u){if("conversation"in s&&!s.conversation?.id)return;y.logEvent(p,r,i)}n.onEvent?.(p)},[u,n,r,i,a,v])};return P.jsx(d.Provider,{value:m,children:e})},x=()=>{const e=t.useContext(d);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=b;exports.useBaseEvents=x;
|
|
@@ -7,7 +7,7 @@ import { useUser as b } from "./user-provider.js";
|
|
|
7
7
|
const u = x(void 0), U = ({ children: e }) => {
|
|
8
8
|
const { baseSettings: t, componentType: n } = C(), { apiKey: s, analyticsApiBaseUrl: r, tags: i, privacyPreferences: l, env: E } = t, { userProperties: a } = b(), c = g(
|
|
9
9
|
() => ({
|
|
10
|
-
widgetLibraryVersion: "0.5.
|
|
10
|
+
widgetLibraryVersion: "0.5.48",
|
|
11
11
|
componentType: n,
|
|
12
12
|
tags: i
|
|
13
13
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react"),j=require("../atoms/api/analytics/conversation.cjs"),w=require("./config-provider.cjs"),B=require("./conversation-provider.cjs"),k=require("./user-provider.cjs"),f=require("./base-events-provider.cjs"),g=t.createContext(void 0),b=({children:e})=>{const{baseSettings:x}=w.useInkeepConfig(),{apiKey:l,analyticsApiBaseUrl:C,tags:d,privacyPreferences:{optOutAllAnalytics:i},env:a}=x,{userProperties:E}=k.useUser(),{logEvent:h}=f.useBaseEvents(),{conversation:o,setConversation:y}=B.useInkeepConversation(),p=t.useRef(o);t.useEffect(()=>{p.current=o},[o]);const c=t.useCallback(async n=>{const s=p.current,v=!i&&a!=="development";let r=Object.assign({},s,{messages:n});if(v){const P=await j.logConversation(s.id,{messages:n,tags:d,userProperties:E},l,C);P&&(r=P)}return r},[C,l,d,E,i,a]),q={logEvent:t.useCallback(async(n,s)=>{if(s){const r=await c(s);y(r)}const v={...n,properties:{conversation:o,...n.properties}};h(v)},[h,c,i,a]),logConversation:c};return u.jsx(g.Provider,{value:q,children:e})},A=({children:e})=>u.jsx(f.BaseEventsProvider,{children:u.jsx(b,{children:e})}),O=()=>{const e=t.useContext(g);if(!e)throw new Error("useChatEvents must be used within a ChatEventsProvider");return e};exports.ChatEventsProvider=b;exports.ChatEventsProviderWithBase=A;exports.useChatEvents=O;
|
|
@@ -5,63 +5,67 @@ import { logConversation as k } from "../atoms/api/analytics/conversation.js";
|
|
|
5
5
|
import { useInkeepConfig as A } from "./config-provider.js";
|
|
6
6
|
import { useInkeepConversation as j } from "./conversation-provider.js";
|
|
7
7
|
import { useUser as I } from "./user-provider.js";
|
|
8
|
-
import { useBaseEvents as
|
|
9
|
-
const d = b(void 0),
|
|
8
|
+
import { useBaseEvents as O, BaseEventsProvider as U } from "./base-events-provider.js";
|
|
9
|
+
const d = b(void 0), K = ({ children: t }) => {
|
|
10
10
|
const { baseSettings: g } = A(), {
|
|
11
11
|
apiKey: u,
|
|
12
12
|
analyticsApiBaseUrl: p,
|
|
13
13
|
tags: l,
|
|
14
|
-
privacyPreferences: { optOutAllAnalytics:
|
|
15
|
-
env:
|
|
16
|
-
} = g, { userProperties: C } = I(), { logEvent: f } =
|
|
14
|
+
privacyPreferences: { optOutAllAnalytics: s },
|
|
15
|
+
env: i
|
|
16
|
+
} = g, { userProperties: C } = I(), { logEvent: f } = O(), { conversation: o, setConversation: P } = j(), E = y(o);
|
|
17
17
|
w(() => {
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
const
|
|
21
|
-
async (
|
|
22
|
-
const n =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
E.current = o;
|
|
19
|
+
}, [o]);
|
|
20
|
+
const a = m(
|
|
21
|
+
async (e) => {
|
|
22
|
+
const n = E.current, c = !s && i !== "development";
|
|
23
|
+
let r = Object.assign({}, n, { messages: e });
|
|
24
|
+
if (c) {
|
|
25
|
+
const h = await k(
|
|
26
|
+
n.id,
|
|
27
|
+
{
|
|
28
|
+
messages: e,
|
|
29
|
+
tags: l,
|
|
30
|
+
userProperties: C
|
|
31
|
+
},
|
|
32
|
+
u,
|
|
33
|
+
p
|
|
34
|
+
);
|
|
35
|
+
h && (r = h);
|
|
36
|
+
}
|
|
37
|
+
return r;
|
|
33
38
|
},
|
|
34
|
-
[p, u, l, C,
|
|
39
|
+
[p, u, l, C, s, i]
|
|
35
40
|
), x = {
|
|
36
41
|
logEvent: m(
|
|
37
|
-
async (
|
|
38
|
-
let e = a.current;
|
|
42
|
+
async (e, n) => {
|
|
39
43
|
if (n) {
|
|
40
|
-
const
|
|
41
|
-
|
|
44
|
+
const r = await a(n);
|
|
45
|
+
P(r);
|
|
42
46
|
}
|
|
43
|
-
const
|
|
44
|
-
...
|
|
47
|
+
const c = {
|
|
48
|
+
...e,
|
|
45
49
|
properties: {
|
|
46
|
-
conversation:
|
|
47
|
-
...
|
|
50
|
+
conversation: o,
|
|
51
|
+
...e.properties
|
|
48
52
|
}
|
|
49
53
|
};
|
|
50
|
-
f(
|
|
54
|
+
f(c);
|
|
51
55
|
},
|
|
52
|
-
[f,
|
|
56
|
+
[f, a, s, i]
|
|
53
57
|
),
|
|
54
|
-
logConversation:
|
|
58
|
+
logConversation: a
|
|
55
59
|
};
|
|
56
60
|
return /* @__PURE__ */ v(d.Provider, { value: x, children: t });
|
|
57
|
-
}, F = ({ children: t }) => /* @__PURE__ */ v(
|
|
61
|
+
}, F = ({ children: t }) => /* @__PURE__ */ v(U, { children: /* @__PURE__ */ v(K, { children: t }) }), G = () => {
|
|
58
62
|
const t = B(d);
|
|
59
63
|
if (!t)
|
|
60
64
|
throw new Error("useChatEvents must be used within a ChatEventsProvider");
|
|
61
65
|
return t;
|
|
62
66
|
};
|
|
63
67
|
export {
|
|
64
|
-
|
|
68
|
+
K as ChatEventsProvider,
|
|
65
69
|
F as ChatEventsProviderWithBase,
|
|
66
70
|
G as useChatEvents
|
|
67
71
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-primitives",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.48",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"remark-gfm": "^4.0.1",
|
|
60
60
|
"unist-util-visit": "^5.0.0",
|
|
61
61
|
"use-sync-external-store": "^1.4.0",
|
|
62
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
63
|
-
"@inkeep/cxkit-theme": "0.5.
|
|
64
|
-
"@inkeep/cxkit-types": "0.5.
|
|
62
|
+
"@inkeep/cxkit-color-mode": "0.5.48",
|
|
63
|
+
"@inkeep/cxkit-theme": "0.5.48",
|
|
64
|
+
"@inkeep/cxkit-types": "0.5.48"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@biomejs/biome": "1.9.4",
|