@yeaft/webchat-agent 1.0.304 → 1.0.305

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.
@@ -1 +1 @@
1
- {"version":"1.0.304"}
1
+ {"version":"1.0.305"}
@@ -1758,7 +1758,7 @@ ${String(e||"").trim()}
1758
1758
  >&times;</button>
1759
1759
  </div>
1760
1760
  </div>
1761
- <div class="input-wrapper" :class="{ 'btw-active': store.btwMode }">
1761
+ <div class="input-wrapper chat-composer" :class="{ 'btw-active': store.btwMode }">
1762
1762
  <input
1763
1763
  v-if="attachmentsAllowed"
1764
1764
  type="file"
@@ -1769,28 +1769,6 @@ ${String(e||"").trim()}
1769
1769
  accept="image/*,text/*,.pdf,.doc,.docx,.xls,.xlsx,.json,.md,.py,.js,.ts,.css,.html"
1770
1770
  class="file-input-hidden"
1771
1771
  />
1772
- <label
1773
- v-if="attachmentsAllowed"
1774
- class="attach-btn"
1775
- for="chat-file-input"
1776
- :title="$t('chatInput.upload')"
1777
- :aria-label="$t('chatInput.upload')"
1778
- >
1779
- <svg viewBox="0 0 24 24" width="20" height="20">
1780
- <path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"/>
1781
- </svg>
1782
- </label>
1783
- <button
1784
- v-if="workItemFn && !store.btwMode"
1785
- class="work-item-draft-btn"
1786
- type="button"
1787
- @click="workItemFn(inputText.trim())"
1788
- :title="$t('workCenter.fromSession')"
1789
- :aria-label="$t('workCenter.fromSession')"
1790
- >
1791
- <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm2 5v2h10V8H7zm0 4v2h7v-2H7zm0 4v2h5v-2H7z"/></svg>
1792
- </button>
1793
- <span v-if="store.btwMode" class="btw-input-tag">BTW</span>
1794
1772
  <div class="textarea-wrapper">
1795
1773
  <!-- Slash command autocomplete -->
1796
1774
  <div class="slash-autocomplete" v-if="!store.btwMode && showAutocomplete && flatItems.length > 0" ref="autocompleteRef">
@@ -1849,29 +1827,57 @@ ${String(e||"").trim()}
1849
1827
  :aria-activedescendant="vpMentionActiveOptionId"
1850
1828
  :placeholder="store.btwMode ? $t('btw.placeholder') : (isCompacting ? $t('chatHeader.compacting') : $t(effectivePlaceholderKey))"
1851
1829
  :disabled="isCompacting"
1852
- rows="1"
1830
+ rows="3"
1853
1831
  ></textarea>
1854
1832
  </div>
1855
- <button
1856
- v-if="isStopVisible"
1857
- type="button"
1858
- class="send-btn stop-btn"
1859
- @click="cancelExecution"
1860
- :title="$t('chatInput.stop')"
1861
- :aria-label="$t('chatInput.stop')"
1862
- >
1863
- <svg viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="6" width="12" height="12" rx="2"/></svg>
1864
- </button>
1865
- <button
1866
- type="button"
1867
- class="send-btn"
1868
- @click="send"
1869
- :disabled="!canSend"
1870
- :title="$t('chatInput.send')"
1871
- :aria-label="$t('chatInput.send')"
1872
- >
1873
- <svg viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>
1874
- </button>
1833
+ <div class="chat-composer-actions">
1834
+ <div class="chat-composer-actions-start">
1835
+ <label
1836
+ v-if="attachmentsAllowed"
1837
+ class="attach-btn"
1838
+ for="chat-file-input"
1839
+ :title="$t('chatInput.upload')"
1840
+ :aria-label="$t('chatInput.upload')"
1841
+ >
1842
+ <svg viewBox="0 0 24 24" width="20" height="20">
1843
+ <path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"/>
1844
+ </svg>
1845
+ </label>
1846
+ <button
1847
+ v-if="workItemFn && !store.btwMode"
1848
+ class="work-item-draft-btn"
1849
+ type="button"
1850
+ @click="workItemFn(inputText.trim())"
1851
+ :title="$t('workCenter.fromSession')"
1852
+ :aria-label="$t('workCenter.fromSession')"
1853
+ >
1854
+ <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm2 5v2h10V8H7zm0 4v2h7v-2H7zm0 4v2h5v-2H7z"/></svg>
1855
+ </button>
1856
+ <span v-if="store.btwMode" class="btw-input-tag">BTW</span>
1857
+ </div>
1858
+ <div class="chat-composer-actions-end">
1859
+ <button
1860
+ v-if="isStopVisible"
1861
+ type="button"
1862
+ class="send-btn stop-btn"
1863
+ @click="cancelExecution"
1864
+ :title="$t('chatInput.stop')"
1865
+ :aria-label="$t('chatInput.stop')"
1866
+ >
1867
+ <svg viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="6" width="12" height="12" rx="2"/></svg>
1868
+ </button>
1869
+ <button
1870
+ type="button"
1871
+ class="send-btn"
1872
+ @click="send"
1873
+ :disabled="!canSend"
1874
+ :title="$t('chatInput.send')"
1875
+ :aria-label="$t('chatInput.send')"
1876
+ >
1877
+ <svg viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>
1878
+ </button>
1879
+ </div>
1880
+ </div>
1875
1881
  </div>
1876
1882
  </footer>
1877
1883
  `,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Pinia.useAuthStore(),r=Pinia.useVpStore(),i=Pinia.useSessionsStore?Pinia.useSessionsStore():null,o=Vue.ref(""),a=Vue.ref(null),c=`chat-input-${Vue.getCurrentInstance()?.uid??0}`,d=Vue.ref(null),u=Vue.ref([]),f=Vue.computed(()=>u.value.some(P=>P.uploading)),p=Vue.ref(null),g=Vue.ref(null),b=Vue.ref(null),h=Vue.computed(()=>!!e.sendFn),A=Vue.computed(()=>!s.btwMode),w=Vue.computed(()=>e.placeholderKey||"chatInput.placeholder"),S=Vue.computed(()=>e.showStop||!h.value&&s.isProcessing),y=Vue.computed({get:()=>s.expertSelections||[],set:P=>{s.expertSelections=P}}),m=Vue.ref(!1),v=Vue.ref(0),E=Vue.computed(()=>Qc(s.customExpertRoles)),V=Vue.computed(()=>{let P=o.value,X=P.lastIndexOf("@");if(X===-1||!m.value)return[];let ge=P.slice(X+1).toLowerCase();return E.value.filter(de=>ge?de.searchText.includes(ge):!0).filter(de=>!y.value.some(ye=>ye.role===de.roleId)).slice(0,12)}),U=P=>{if(y.value.length>=as)return;let X={role:P.roleId,action:P.actionId};s.expertSelections=[...y.value,X];let ge=o.value,de=ge.lastIndexOf("@");de!==-1&&(o.value=ge.slice(0,de).trimEnd()),m.value=!1,Vue.nextTick(()=>a.value?.focus())},L=P=>{let X=[...y.value];X.splice(P,1),s.expertSelections=X},D=P=>os(P,s.customExpertRoles),M=P=>P==="completed"?"\u2713":P==="in_progress"?"\u2192":"\u25CB",T=Vue.ref(!1),C=Vue.ref(0),R=()=>s.currentView==="yeaft"&&!!s.currentAgent,B=Vue.computed(()=>{let P=o.value,X=P.lastIndexOf("@");return X<0||!T.value?"":P.slice(X+1)}),O=Vue.computed(()=>{if(!i)return r.vpList||[];let P=s.yeaftActiveSessionFilter||i.activeSessionId||null,X=typeof i.sessionById=="function"?i.sessionById(P,s.currentAgent||null):i.sessions?.[P];return Op(r.vpList,X)}),j=Vue.computed(()=>Va(O.value,B.value)),ne=Vue.computed(()=>!s.btwMode&&T.value&&!m.value&&j.value.length>0),ve=Fa(c),ue=Vue.computed(()=>{if(!ne.value)return null;let P=j.value[C.value];return P?Oa(c,P.vpId):null}),be=P=>{!P||!P.vpId||(o.value=Hp(o.value,P.vpId),T.value=!1,C.value=0,Vue.nextTick(()=>a.value?.focus()))},ie=Vue.computed(()=>e.draftKey||e.conversationId||s.currentConversation||null);ie.value&&s.inputDrafts[ie.value]&&(o.value=s.inputDrafts[ie.value]),Vue.watch(o,P=>{let X=ie.value;X&&(P?s.inputDrafts[X]=P:delete s.inputDrafts[X])}),Vue.watch(j,P=>{if(P.length===0){C.value=0;return}C.value>=P.length&&(C.value=P.length-1)}),Vue.watch(ie,(P,X)=>{X&&o.value&&(s.inputDrafts[X]=o.value),o.value=P&&s.inputDrafts[P]||""});let Ce=P=>{if(!P||typeof P!="string")return;let X=o.value||"",ge=X.length>0&&!/\s$/.test(X),de=X+(ge?" ":"")+"@"+P+" ";o.value=de,Vue.nextTick(()=>{let ye=a.value;ye&&(ye.focus(),ye.setSelectionRange(de.length,de.length),se())})},x=Vue.ref(!1),Y=Vue.ref(0),oe=Vue.computed(()=>{let P=e.conversationId||s.activeConversationId||s.currentConversation,X=s.currentAgent,ge=Rp(s,P,X),de=s.currentView==="yeaft"?Pp:Mp;return pi(de,ge).map(Se=>Se.startsWith("/")?Se:"/"+Se)}),he=Vue.computed(()=>{let P=o.value.trim();if(!P.startsWith("/"))return[];let X=P.toLowerCase();return oe.value.filter(ge=>ge.toLowerCase().startsWith(X)&&ge.toLowerCase()!==X).map(ge=>({cmd:ge,desc:_p(ge,s.slashCommandDescriptions)}))}),W=Vue.computed(()=>Ep(he.value,s.slashCommandDescriptions,oe.value)),te=Vue.computed(()=>he.value.map(P=>P.cmd)),K=Vue.computed(()=>e.conversationId||s.activeConversationId||s.currentConversation||null),N=Vue.computed(()=>s.compactStatus?.status==="compacting"&&s.compactStatus?.conversationId===K.value),H=P=>typeof P?.fileId=="string"&&P.fileId.trim().length>0,_=Vue.computed(()=>{if(N.value)return!1;let P=!!o.value.trim(),X=u.value.length>0;if(h.value){let Le=!f.value&&u.value.every(H);return(P||X)&&Le}let ge=y.value.length>0,de=y.value.some(Le=>Le.action),ye=P||X||ge&&(P||de),Se=!f.value&&u.value.every(H);return ye&&s.currentAgent&&s.currentConversation&&Se}),J=120,se=()=>{let P=a.value;if(!P)return;P.style.height="auto";let X=Math.min(P.scrollHeight,J);P.style.height=X+"px",P.style.overflowY=P.scrollHeight>J?"auto":"hidden"},me=()=>{let P=a.value;P&&(P.style.height="auto",P.style.overflowY="hidden")},z=()=>{se();let P=o.value.trim();P.startsWith("/")&&!P.includes(" ")?(x.value=!0,Y.value=0,m.value=!1):x.value=!1;let X=o.value,ge=X.lastIndexOf("@");if(ge!==-1&&!x.value){let de=ge>0?X[ge-1]:" ";de===" "||de===`
Binary file
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
6
6
  <title>Yeaft</title>
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='8' fill='%232c2c2c'/><path d='M16 22V13M16 13L10 8M16 13L22 8' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/><circle cx='10' cy='8' r='2.4' fill='white'/><circle cx='22' cy='8' r='2.4' fill='white'/><circle cx='16' cy='22' r='2.4' fill='white'/></svg>">
8
- <link rel="stylesheet" href="style.bundle.css?v=5661e0d4">
8
+ <link rel="stylesheet" href="style.bundle.css?v=6ca93b59">
9
9
  <script src="vendor.bundle.js?v=103fd8e7"></script>
10
10
  <script defer src="jszip.min.js"></script>
11
11
  <script defer src="docx-preview.min.js"></script>
@@ -16,6 +16,6 @@
16
16
  </head>
17
17
  <body>
18
18
  <div id="app"></div>
19
- <script type="module" src="app.bundle.js?v=6a483d5e"></script>
19
+ <script type="module" src="app.bundle.js?v=ccedc092"></script>
20
20
  </body>
21
21
  </html>