@askly/widget 3.5.0 → 3.6.0
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/README.md +9 -0
- package/dist/app/{AttachmentTray-V6_MacwL.js → AttachmentTray-DTcRO7P2.js} +1 -1
- package/dist/app/{HelpTab-VtqHb4om.js → HelpTab-CTrnceVW.js} +1 -1
- package/dist/app/{VoiceRecorder-DfmVzsvl.js → VoiceRecorder-D8yLPc9h.js} +1 -1
- package/dist/app/askly-app.js +1 -1
- package/dist/app/replyStream-9ZRCzkDS.js +1 -0
- package/dist/app/{shared-CbUI7AAU.js → shared-CcPBIeG2.js} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/core/replyStream.d.ts +15 -0
- package/dist/types/core/sse.d.ts +17 -0
- package/dist/types/realtime.d.ts +2 -5
- package/dist/types/ui/MessageList.d.ts +3 -0
- package/dist/widget.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -312,6 +312,15 @@ Writing into a closed conversation reopens it. Nothing to configure; these need
|
|
|
312
312
|
from October 2026 or later, and degrade to the previous behaviour (local history only, no
|
|
313
313
|
delivery marks beyond the error) on an older one.
|
|
314
314
|
|
|
315
|
+
### Streamed replies
|
|
316
|
+
|
|
317
|
+
Where your Askly plan has it switched on, AI replies appear as they are written instead of after
|
|
318
|
+
a pause. The text grows in a draft bubble; when the reply is complete it replaces the draft as an
|
|
319
|
+
ordinary message (that is when `message:received` fires, the sound plays, and screen readers
|
|
320
|
+
read it). If the connection drops mid-reply the widget fetches the finished reply on its own.
|
|
321
|
+
Nothing to configure; if your site sets a Content Security Policy, `connect-src` must already
|
|
322
|
+
allow the Askly API origin.
|
|
323
|
+
|
|
315
324
|
### Sources and talking to a person
|
|
316
325
|
|
|
317
326
|
Each AI reply lists the documents it drew on as small chips underneath. A source backed by a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,t,
|
|
1
|
+
import{g as e,t,w as a,I as r,f as m,P as n,X as c}from"./shared-CcPBIeG2.js";function s({attachments:s,removeAttachment:o}){return e.createElement("ul",{className:"composer-attachments","aria-label":t(1===s.length?"attachments_summary_one":"attachments_summary_other",{count:m(s.length)})},s.map(s=>{const l=s.error?t("too-large"===s.error?"attachment_too_large":"rejected"===s.error?"attachment_rejected":"attachment_failed"):s.url?a(s.size,r()):t("attachment_uploading",{name:s.name,percent:m(s.progress)});return e.createElement("li",{key:s.id,className:"composer-attachment"+(s.error?" failed":s.url?" ready":" uploading")},s.previewUrl?e.createElement("img",{className:"composer-attachment-thumb",src:s.previewUrl,alt:""}):e.createElement("span",{className:"composer-attachment-icon","aria-hidden":"true"},e.createElement(n,{size:14})),e.createElement("span",{className:"composer-attachment-text"},e.createElement("span",{className:"composer-attachment-name"},s.name),e.createElement("span",{className:"composer-attachment-status",role:s.error?"alert":void 0},l)),!s.url&&!s.error&&e.createElement("span",{className:"composer-attachment-bar","aria-hidden":"true"},e.createElement("span",{style:{width:`${s.progress}%`}})),e.createElement("button",{type:"button",className:"composer-attachment-remove",onClick:()=>o(s.id),"aria-label":t("attachment_remove",{name:s.name}),title:t("attachment_remove",{name:s.name})},e.createElement(c,{size:12})))}))}export{s as AttachmentTray};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aq as e,g as t,t as l,o as a,b as c,u as n,ar as s,C as r,as as i,d as o,f as m,B as p}from"./shared-CcPBIeG2.js";function d(e,t=[]){const a=t.find(t=>t.id===e);if(a)return{title:a.name,desc:a.description};switch(e){case"guide":return{title:l("help_collection_guide_title"),desc:l("help_collection_guide_desc")};case"faq":return{title:l("help_collection_faq_title"),desc:l("help_collection_faq_desc")};case"troubleshooting":return{title:l("help_collection_troubleshooting_title"),desc:l("help_collection_troubleshooting_desc")};default:return{title:l("help_collection_other_title"),desc:l("help_collection_other_desc")}}}function h(e,t){const l=e.excerpt||e.content.replace(/[\n\r]+/g," ");return l?l.length>t?l.slice(0,t)+"…":l:""}function u(u){const{allArticles:E,articleError:y,articleFeedback:_,articleLoading:k,articlesLoading:f,handleSearchChange:N,handleSelectArticle:b,helpCollections:g,helpSearchPlaceholder:v,helpSiteUrl:w,organizationLogo:x,organizationName:C,rateArticle:z,searchError:S,searchLoading:A,searchQuery:I,searchResults:L,selectedArticle:q,selectedCollection:D,setActiveTab:T,setInput:B,setSelectedArticle:M,setSelectedCollection:W,themeColor:j}=u,F=g.filter(e=>!e.parentId),H=(null==q?void 0:q.updatedAt)?e(new Date(q.updatedAt)):null;return t.createElement("div",{className:"chat-body help-layout"},q?t.createElement("div",{className:"help-article-reader"},t.createElement("div",{className:"article-breadcrumb"},t.createElement("button",{type:"button",className:"article-breadcrumb-link",onClick:()=>{M(null),W(null)}},l("header_help_center")),t.createElement("span",{"aria-hidden":"true"},"/"),t.createElement("span",{className:"article-breadcrumb-type"},q.document_type?d(q.document_type.toLowerCase(),g).title:l("help_document_type_fallback"))),t.createElement("button",{type:"button",className:"help-back-btn",onClick:()=>M(null),style:{marginBottom:14}},t.createElement(a,{size:16,className:"askly-flip-rtl"}),t.createElement("span",null,l("help_back_to_articles"))),t.createElement("h1",{className:"help-article-heading",tabIndex:-1},q.title),t.createElement("div",{className:"article-author-bar"},t.createElement("img",{src:x||"https://askly.co.in/logo-small.png",alt:C,className:"article-author-avatar"}),t.createElement("div",{className:"article-author-text"},t.createElement("span",{className:"article-author-name"},l("help_written_by",{organizationName:C})),t.createElement("span",{className:"article-author-meta"},H?l("help_updated_on",{date:H}):l("help_updated_recently"),!k&&!y&&t.createElement(t.Fragment,null," • ",t.createElement("span",{"aria-hidden":"true"},"⏱ "),c("help_read_time",(O=q.content,Math.max(1,Math.ceil((O||"").split(/\s+/).length/180)))))))),k?t.createElement("div",{className:"help-article-body","aria-busy":"true"},t.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"92%"}}),t.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"100%"}}),t.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"78%"}}),t.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"88%"}})):y?t.createElement("div",{className:"no-search-results",role:"alert"},l("help_article_unavailable"),t.createElement("button",{type:"button",className:"msg-retry-btn",style:{marginInlineStart:8},onClick:()=>b(q)},l("message_retry"))):t.createElement("div",{className:"help-article-body",dangerouslySetInnerHTML:{__html:n(s(q.content))}}),q.url&&t.createElement("a",{className:"help-article-site-link",href:q.url,target:"_blank",rel:"noopener noreferrer"},l("help_open_site")," ",t.createElement("span",{className:"askly-sr-only"},l("link_opens_new_tab")),t.createElement(r,{size:14,className:"askly-flip-rtl"})),t.createElement("div",{className:"article-feedback"},t.createElement("div",{className:"article-feedback-title"},l("help_feedback_title")),_[q.id]?t.createElement("div",{className:"article-feedback-thanks",role:"status"},t.createElement("span",{"aria-hidden":"true"},"🎉 "),l("help_feedback_thanks")):t.createElement("div",{className:"article-feedback-options"},t.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(q,"yes")},t.createElement("span",{"aria-hidden":"true"},"😃 "),l("help_feedback_yes")),t.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(q,"somewhat")},t.createElement("span",{"aria-hidden":"true"},"😐 "),l("help_feedback_somewhat")),t.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(q,"no")},t.createElement("span",{"aria-hidden":"true"},"😞 "),l("help_feedback_no"))),t.createElement("button",{type:"button",className:"article-handoff",onClick:()=>{B(l("help_handoff_prefill",{title:q.title})),T("messages")}},t.createElement("div",{className:"article-handoff-text"},t.createElement("span",{className:"article-handoff-title"},t.createElement(i,{size:13})," ",l("help_handoff_title")),t.createElement("span",{className:"article-handoff-desc"},l("help_handoff_desc"))),t.createElement(r,{size:16,className:"article-handoff-chevron askly-flip-rtl"})))):t.createElement("div",null,t.createElement("div",{className:"home-search-input-wrapper",style:{marginBottom:14}},t.createElement(o,{size:14,className:"search-icon-svg"}),t.createElement("input",{type:"text",value:I,onChange:N,placeholder:v||l("help_search_placeholder"),"aria-label":l("help_search_label")}),A&&t.createElement("span",{className:"search-loader"})),D&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12}},t.createElement("button",{type:"button",onClick:()=>W(null),style:{all:"unset",cursor:"pointer",fontSize:12,color:j,fontWeight:500,display:"flex",alignItems:"center",gap:4}},t.createElement(a,{size:14,className:"askly-flip-rtl"}),t.createElement("span",null,l("help_all_collections"))),t.createElement("span",{style:{fontSize:12,color:"var(--text-4)"},"aria-hidden":"true"},"/"),t.createElement("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-1)",textTransform:"capitalize"}},d(D,g).title)),t.createElement("div",{className:"help-articles-list"},""===I.trim()?D?(()=>{const e=E.filter(e=>(e.document_type||"guide").toLowerCase()===D.toLowerCase());return t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:10,width:"100%"}},t.createElement("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-3)",textTransform:"uppercase",letterSpacing:"0.5px"}},l("help_collection_articles",{collection:d(D,g).title,count:m(e.length)})),t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:8}},e.map(e=>t.createElement("button",{type:"button",key:e.id,className:"help-article-row",onClick:()=>b(e)},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},t.createElement("span",{className:"article-row-title"},e.title),h(e,85)&&t.createElement("span",{className:"article-row-preview"},h(e,85))),t.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"})))))})():t.createElement("div",{className:"help-collections"},(()=>{if(f)return[0,1,2].map(e=>t.createElement("div",{key:e,className:"help-collection-card is-skeleton"},t.createElement("div",{className:"help-collection-left"},t.createElement("span",{className:"askly-skeleton help-collection-icon-skel"}),t.createElement("div",{className:"help-collection-text"},t.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"60%"}}),t.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"90%"}})))));const e={};E.forEach(t=>{const l=(t.document_type||"guide").toLowerCase();e[l]||(e[l]=[]),e[l].push(t)});const a=F.map(e=>e.id).filter(t=>e[t]),n=a.concat(Object.keys(e).filter(e=>!a.includes(e)));return 0===n.length?t.createElement("div",{className:"askly-empty-state"},t.createElement("div",{className:"askly-empty-icon"},t.createElement(p,{size:22})),t.createElement("div",{className:"askly-empty-title"},l("help_empty_title")),t.createElement("div",{className:"askly-empty-desc"},l("help_empty_desc"))):n.map(l=>{const a=e[l],{title:n,desc:s}=d(l,g);return t.createElement("button",{type:"button",key:l,className:"help-collection-card",onClick:()=>W(l)},t.createElement("div",{className:"help-collection-left"},t.createElement("div",{className:"help-collection-icon"},t.createElement(p,{size:16})),t.createElement("div",{className:"help-collection-text"},t.createElement("div",{className:"help-collection-title"},n),t.createElement("div",{className:"help-collection-desc"},s),t.createElement("div",{className:"help-collection-count"},c("help_article_count",a.length)))),t.createElement(r,{size:16,className:"help-collection-chevron askly-flip-rtl"}))})})()):S?t.createElement("div",{className:"no-search-results"},S):0!==L.length||A?L.map(e=>t.createElement("button",{type:"button",key:e.id,className:"help-article-row",onClick:()=>b(e)},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},t.createElement("span",{className:"article-row-title"},e.title),h(e,80)&&t.createElement("span",{className:"article-row-preview"},h(e,80))),t.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"}))):t.createElement("div",{className:"no-search-results",role:"status"},l("help_search_no_results",{query:I}))),w&&""===I.trim()&&!D&&!f&&E.length>0&&t.createElement("a",{className:"help-article-site-link",href:w,target:"_blank",rel:"noopener noreferrer",style:{marginTop:14}},l("help_open_site")," ",t.createElement("span",{className:"askly-sr-only"},l("link_opens_new_tab")),t.createElement(r,{size:14,className:"askly-flip-rtl"}))));var O}export{u as HelpTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{q as e,r as t,t as a,b as s,g as n,f as c,X as l}from"./shared-CcPBIeG2.js";function i({phase:i,meterRef:o,maxMs:r,onStop:m,onCancel:v}){const[u,p]=e([]),[d,y]=e(0);t(()=>{if("recording"!==i)return;const e=setInterval(()=>{const{level:e,elapsedMs:t}=o.current;y(t),p(t=>(t.length>=80?t.slice(1):t).concat(e))},100);return()=>clearInterval(e)},[i]);const b="recording"===i,_=r-d,h=Math.max(0,Math.ceil(_/1e3)),k=b&&_<=1e4,E=a("transcribing"===i?"voice_status_transcribing":b?"voice_status_listening":"voice_status_waiting"),g=b&&_<=5e3?`${E} ${s("voice_seconds_left",h)}`:E;return n.createElement("div",{className:`askly-voice ${i}`},n.createElement("button",{type:"button",className:"askly-voice-btn",onClick:v,title:a("voice_cancel"),"aria-label":a("voice_cancel")},n.createElement(l,{size:20})),n.createElement("span",{className:"askly-voice-meter","aria-hidden":"true"},u.map((e,t)=>n.createElement("i",{key:t,style:{height:`${Math.round(2+22*Math.min(1,e))}px`}}))),n.createElement("span",{className:"askly-voice-status",role:"status"},g),k&&n.createElement("span",{className:"askly-voice-time","aria-hidden":"true"},a("voice_countdown",{count:c(h)})),b?n.createElement("button",{type:"button",className:"askly-voice-btn done",onClick:m,title:a("voice_stop"),"aria-label":a("voice_stop")},n.createElement("span",{className:"askly-voice-stop"})):n.createElement("span",{className:"askly-voice-btn done busy","aria-hidden":"true"},n.createElement("span",{className:"askly-voice-spinner"})))}export{i as VoiceRecorder};
|