0b2d7ac50d
脚本 exec 立即返回 running 并在后台跑批次;/ws/alerts 推送 script_progress/complete; 新增 ScriptRunsPage、Telegram 汇总通知与可配置的浏览器完成提示音。 Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
import{$n as e,Dn as t,Dr as n,Er as r,Fr as i,G as a,Ir as o,Sn as s,Ur as c,Vn as l,Yn as ee,_r as u,a as d,cr as f,d as p,dn as m,en as h,f as g,g as _,hn as v,hr as te,i as y,kr as b,mr as x,nr as S,o as C,on as w,p as T,pr as E,r as D,rn as O,s as k,tr as A,vn as j,xn as M,y as N}from"./index-DbSyD28P.js";var P=v({autoGrow:Boolean,autofocus:Boolean,counter:[Boolean,Number,String],counterValue:Function,prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,noResize:Boolean,rows:{type:[Number,String],default:5,validator:e=>!isNaN(parseFloat(e))},maxHeight:{type:[Number,String],validator:e=>!isNaN(parseFloat(e))},maxRows:{type:[Number,String],validator:e=>!isNaN(parseFloat(e))},suffix:String,modelModifiers:Object,...y(),...l(k(),[`direction`]),...g()},`VTextarea`),F=m()({name:`VTextarea`,directives:{vIntersect:a},inheritAttrs:!1,props:P(),emits:{"click:control":e=>!0,"mousedown:control":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0,"update:rows":e=>!0},setup(l,{attrs:m,emit:g,slots:v}){let y=O(l,`modelValue`),{isFocused:k,focus:P,blur:F}=T(l),{onIntersect:ne}=D(l),re=A(()=>typeof l.counterValue==`function`?l.counterValue(y.value):(y.value||``).toString().length),ie=A(()=>{if(m.maxlength)return m.maxlength;if(!(!l.counter||typeof l.counter!=`number`&&typeof l.counter!=`string`))return l.counter}),I=i(),L=i(),R=o(``),z=i(),B=i(0),{platform:V}=h(),H=d(l),U=A(()=>l.persistentPlaceholder||k.value||l.active);function W(){H.isSuppressing.value&&H.update(),z.value!==document.activeElement&&z.value?.focus(),k.value||P()}function G(e){W(),g(`click:control`,e)}function K(e){g(`mousedown:control`,e)}function q(e){e.stopPropagation(),W(),x(()=>{y.value=``,j(l[`onClick:clear`],e)})}function J(e){let t=e.target;if(!l.modelModifiers?.trim){y.value=t.value;return}let n=t.value,r=t.selectionStart,i=t.selectionEnd;y.value=n,x(()=>{let e=0;n.trimStart().length===t.value.length&&(e=n.length-t.value.length),r!=null&&(t.selectionStart=r-e),i!=null&&(t.selectionEnd=i-e)})}let Y=i(),X=i(Number(l.rows)),Z=A(()=>[`plain`,`underlined`].includes(l.variant));n(()=>{l.autoGrow||(X.value=Number(l.rows))});function Q(){x(()=>{if(!z.value)return;if(V.value.firefox){B.value=12;return}let{offsetWidth:e,clientWidth:t}=z.value;B.value=Math.max(0,e-t)}),l.autoGrow&&x(()=>{if(!Y.value||!L.value)return;let e=getComputedStyle(Y.value),t=getComputedStyle(L.value.$el),n=parseFloat(e.getPropertyValue(`--v-field-padding-top`))+parseFloat(e.getPropertyValue(`--v-input-padding-top`))+parseFloat(e.getPropertyValue(`--v-field-padding-bottom`)),r=Y.value.scrollHeight,i=parseFloat(e.lineHeight),a=Math.max(parseFloat(l.rows)*i+n,parseFloat(t.getPropertyValue(`--v-input-control-height`))),o=l.maxHeight?parseFloat(l.maxHeight):parseFloat(l.maxRows)*i+n||1/0,c=M(r??0,a,o);X.value=Math.floor((c-n)/i),R.value=s(c)})}u(Q),r(y,Q),r(()=>l.rows,Q),r(()=>l.maxHeight,Q),r(()=>l.maxRows,Q),r(()=>l.density,Q),r(X,e=>{g(`update:rows`,e)});let $;return r(Y,e=>{e?($=new ResizeObserver(Q),$.observe(Y.value)):$?.disconnect()}),te(()=>{$?.disconnect()}),w(()=>{let n=!!(v.counter||l.counter||l.counterValue),r=!!(n||v.details),[i,o]=t(m),{modelValue:u,...d}=C.filterProps(l),h={...p.filterProps(l),"onClick:clear":q};return f(C,E({ref:I,modelValue:y.value,"onUpdate:modelValue":e=>y.value=e,class:[`v-textarea v-text-field`,{"v-textarea--prefixed":l.prefix,"v-textarea--suffixed":l.suffix,"v-text-field--prefixed":l.prefix,"v-text-field--suffixed":l.suffix,"v-textarea--auto-grow":l.autoGrow,"v-textarea--no-resize":l.noResize||l.autoGrow,"v-input--plain-underlined":Z.value},l.class],style:[{"--v-textarea-max-height":l.maxHeight?s(l.maxHeight):void 0,"--v-textarea-scroll-bar-width":s(B.value)},l.style]},i,d,{centerAffix:X.value===1&&!Z.value,focused:k.value,indentDetails:l.indentDetails??!Z.value}),{...v,default:({id:t,isDisabled:n,isDirty:r,isReadonly:i,isValid:s,hasDetails:u})=>f(p,E({ref:L,style:{"--v-textarea-control-height":R.value},onClick:G,onMousedown:K,"onClick:prependInner":l[`onClick:prependInner`],"onClick:appendInner":l[`onClick:appendInner`]},h,{id:t.value,active:U.value||r.value,labelId:`${t.value}-label`,centerAffix:X.value===1&&!Z.value,dirty:r.value||l.dirty,disabled:n.value,focused:k.value,details:u.value,error:s.value===!1}),{...v,default:({props:{class:r,...s},controlRef:u})=>S(e,null,[l.prefix&&S(`span`,{class:`v-text-field__prefix`},[l.prefix]),b(S(`textarea`,E({ref:e=>z.value=u.value=e,class:r,value:y.value,onInput:J,autofocus:l.autofocus,readonly:i.value,disabled:n.value,placeholder:l.placeholder,rows:l.rows,name:H.fieldName.value,autocomplete:H.fieldAutocomplete.value,onFocus:W,onBlur:F,"aria-labelledby":`${t.value}-label`},s,o),null),[[a,{handler:ne},null,{once:!0}]]),l.autoGrow&&b(S(`textarea`,{class:c([r,`v-textarea__sizer`]),id:`${s.id}-sizer`,"onUpdate:modelValue":e=>y.value=e,ref:Y,readonly:!0,"aria-hidden":`true`},null),[[ee,y.value]]),l.suffix&&S(`span`,{class:`v-text-field__suffix`},[l.suffix])])}),details:r?t=>S(e,null,[v.details?.(t),n&&S(e,null,[S(`span`,null,null),f(_,{active:l.persistentCounter||k.value,value:re.value,max:ie.value,disabled:l.disabled},v.counter)])]):void 0})}),N({},I,L,z)}});export{F as t}; |