react-grab 0.0.34 → 0.0.35
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/index.cjs +4 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.global.js +2 -2
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1127,6 +1127,7 @@ var init = (rawOptions) => {
|
|
|
1127
1127
|
const options = {
|
|
1128
1128
|
enabled: true,
|
|
1129
1129
|
keyHoldDuration: 300,
|
|
1130
|
+
allowActivationInsideInput: true,
|
|
1130
1131
|
...rawOptions
|
|
1131
1132
|
};
|
|
1132
1133
|
if (options.enabled === false) {
|
|
@@ -1426,7 +1427,9 @@ ${context}
|
|
|
1426
1427
|
deactivateRenderer();
|
|
1427
1428
|
return;
|
|
1428
1429
|
}
|
|
1429
|
-
if (isKeyboardEventTriggeredByInput(event))
|
|
1430
|
+
if (!options.allowActivationInsideInput && isKeyboardEventTriggeredByInput(event)) {
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1430
1433
|
if (!isTargetKeyCombination(event)) return;
|
|
1431
1434
|
if (isActivated()) {
|
|
1432
1435
|
if (keydownSpamTimerId !== null) {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.global.js
CHANGED
|
@@ -20,11 +20,11 @@ ${t.stack}`:""}},Ho=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=vo
|
|
|
20
20
|
`).filter(r=>!!r.match(rr)),t).map(r=>{let o=r;o.includes("(eval ")&&(o=o.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=o.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;let a=ir(s?s[1]:i),l=s&&i||void 0,f=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {function:l,file:f,line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:o}});var Zn=(e,t)=>Jt(e.split(`
|
|
21
21
|
`).filter(r=>!r.match(jo)),t).map(r=>{let o=r;if(o.includes(" > eval")&&(o=o.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!o.includes("@")&&!o.includes(":"))return {function:o};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=o.match(i),a=s&&s[1]?s[1]:void 0,l=ir(o.replace(i,""));return {function:a,file:l[0],line:l[1]?+l[1]:void 0,col:l[2]?+l[2]:void 0,raw:o}}});var Vo=$o((e,t)=>{(function(n,r){typeof e=="object"&&t!==void 0?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.sourcemapCodec={}));})(void 0,function(n){let r=44,o=59,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(64),a=new Uint8Array(128);for(let w=0;w<i.length;w++){let u=i.charCodeAt(w);s[w]=u,a[u]=w;}function l(w,u){let c=0,m=0,y=0;do{let H=w.next();y=a[H],c|=(y&31)<<m,m+=5;}while(y&32);let E=c&1;return c>>>=1,E&&(c=-2147483648|-c),u+c}function f(w,u,c){let m=u-c;m=m<0?-m<<1|1:m<<1;do{let y=m&31;m>>>=5,m>0&&(y|=32),w.write(s[y]);}while(m>0);return u}function h(w,u){return w.pos>=u?false:w.peek()!==r}let g=1024*16,b=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(w){return Buffer.from(w.buffer,w.byteOffset,w.byteLength).toString()}}:{decode(w){let u="";for(let c=0;c<w.length;c++)u+=String.fromCharCode(w[c]);return u}};class x{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(g);}write(u){let{buffer:c}=this;c[this.pos++]=u,this.pos===g&&(this.out+=b.decode(c),this.pos=0);}flush(){let{buffer:u,out:c,pos:m}=this;return m>0?c+b.decode(u.subarray(0,m)):c}}class S{constructor(u){this.pos=0,this.buffer=u;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(u){let{buffer:c,pos:m}=this,y=c.indexOf(u,m);return y===-1?c.length:y}}let C=[];function R(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0;for(;c.pos<u;c.pos++){E=l(c,E);let H=l(c,0);if(!h(c,u)){let Y=y.pop();Y[2]=E,Y[3]=H;continue}let I=l(c,0),M=l(c,0),j=M&1,B=j?[E,H,0,0,I,l(c,0)]:[E,H,0,0,I],z=C;if(h(c,u)){z=[];do{let Y=l(c,0);z.push(Y);}while(h(c,u))}B.vars=z,m.push(B),y.push(B);}return m}function T(w){let u=new x;for(let c=0;c<w.length;)c=A(w,c,u,[0]);return u.flush()}function A(w,u,c,m){let y=w[u],{0:E,1:H,2:I,3:M,4:j,vars:B}=y;u>0&&c.write(r),m[0]=f(c,E,m[0]),f(c,H,0),f(c,j,0);let z=y.length===6?1:0;f(c,z,0),y.length===6&&f(c,y[5],0);for(let Y of B)f(c,Y,0);for(u++;u<w.length;){let Y=w[u],{0:F,1:G}=Y;if(F>I||F===I&&G>=M)break;u=A(w,u,c,m);}return c.write(r),m[0]=f(c,I,m[0]),f(c,M,0),u}function O(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0,H=0,I=0,M=0,j=0,B=0,z=0,Y=0;do{let F=c.indexOf(";"),G=0;for(;c.pos<F;c.pos++){if(G=l(c,G),!h(c,F)){let oe=y.pop();oe[2]=E,oe[3]=G;continue}let Q=l(c,0),fe=Q&1,Z=Q&2,ae=Q&4,we=null,be=C,Se;if(fe){let oe=l(c,H);I=l(c,H===oe?I:0),H=oe,Se=[E,G,0,0,oe,I];}else Se=[E,G,0,0];if(Se.isScope=!!ae,Z){let oe=M,Te=j;M=l(c,M);let Oe=oe===M;j=l(c,Oe?j:0),B=l(c,Oe&&Te===j?B:0),we=[M,j,B];}if(Se.callsite=we,h(c,F)){be=[];do{z=E,Y=G;let oe=l(c,0),Te;if(oe<-1){Te=[[l(c,0)]];for(let Oe=-1;Oe>oe;Oe--){let tt=z;z=l(c,z),Y=l(c,z===tt?Y:0);let nt=l(c,0);Te.push([nt,z,Y]);}}else Te=[[oe]];be.push(Te);}while(h(c,F))}Se.bindings=be,m.push(Se),y.push(Se);}E++,c.pos=F+1;}while(c.pos<u);return m}function _(w){if(w.length===0)return "";let u=new x;for(let c=0;c<w.length;)c=N(w,c,u,[0,0,0,0,0,0,0]);return u.flush()}function N(w,u,c,m){let y=w[u],{0:E,1:H,2:I,3:M,isScope:j,callsite:B,bindings:z}=y;m[0]<E?(D(c,m[0],E),m[0]=E,m[1]=0):u>0&&c.write(r),m[1]=f(c,y[1],m[1]);let Y=(y.length===6?1:0)|(B?2:0)|(j?4:0);if(f(c,Y,0),y.length===6){let{4:F,5:G}=y;F!==m[2]&&(m[3]=0),m[2]=f(c,F,m[2]),m[3]=f(c,G,m[3]);}if(B){let{0:F,1:G,2:Q}=y.callsite;F===m[4]?G!==m[5]&&(m[6]=0):(m[5]=0,m[6]=0),m[4]=f(c,F,m[4]),m[5]=f(c,G,m[5]),m[6]=f(c,Q,m[6]);}if(z)for(let F of z){F.length>1&&f(c,-F.length,0);let G=F[0][0];f(c,G,0);let Q=E,fe=H;for(let Z=1;Z<F.length;Z++){let ae=F[Z];Q=f(c,ae[1],Q),fe=f(c,ae[2],fe),f(c,ae[0],0);}}for(u++;u<w.length;){let F=w[u],{0:G,1:Q}=F;if(G>I||G===I&&Q>=M)break;u=N(w,u,c,m);}return m[0]<I?(D(c,m[0],I),m[0]=I,m[1]=0):c.write(r),m[1]=f(c,M,m[1]),u}function D(w,u,c){do w.write(o);while(++u<c)}function re(w){let{length:u}=w,c=new S(w),m=[],y=0,E=0,H=0,I=0,M=0;do{let j=c.indexOf(";"),B=[],z=true,Y=0;for(y=0;c.pos<j;){let F;y=l(c,y),y<Y&&(z=false),Y=y,h(c,j)?(E=l(c,E),H=l(c,H),I=l(c,I),h(c,j)?(M=l(c,M),F=[y,E,H,I,M]):F=[y,E,H,I]):F=[y],B.push(F),c.pos++;}z||se(B),m.push(B),c.pos=j+1;}while(c.pos<=u);return m}function se(w){w.sort(ue);}function ue(w,u){return w[0]-u[0]}function Re(w){let u=new x,c=0,m=0,y=0,E=0;for(let H=0;H<w.length;H++){let I=w[H];if(H>0&&u.write(o),I.length===0)continue;let M=0;for(let j=0;j<I.length;j++){let B=I[j];j>0&&u.write(r),M=f(u,B[0],M),B.length!==1&&(c=f(u,B[1],c),m=f(u,B[2],m),y=f(u,B[3],y),B.length!==4&&(E=f(u,B[4],E)));}}return u.flush()}n.decode=re,n.decodeGeneratedRanges=O,n.decodeOriginalScopes=R,n.encode=Re,n.encodeGeneratedRanges=_,n.encodeOriginalScopes=T,Object.defineProperty(n,"__esModule",{value:true});});}),sr=Io(Vo()),ar=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Yo=/^data:application\/json[^,]+base64,/,Go=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,lr=typeof WeakRef<"u",Ze=new Map,Rt=new Map,Uo=e=>lr&&e instanceof WeakRef,Jn=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let i=null;for(let h of o)if(h[0]<=r)i=h;else break;if(!i||i.length<4)return null;let[,s,a,l]=i;if(s===void 0||a===void 0||l===void 0)return null;let f=t[s];return f?{columnNumber:l,fileName:f,lineNumber:a+1}:null},zo=(e,t,n)=>{if(e.sections){let r=null;for(let s of e.sections)if(t>s.offset.line||t===s.offset.line&&n>=s.offset.column)r=s;else break;if(!r)return null;let o=t-r.offset.line,i=t===r.offset.line?n-r.offset.column:n;return Jn(r.map.mappings,r.map.sources,o,i)}return Jn(e.mappings,e.sources,t-1,n)},qo=(e,t)=>{let n=t.split(`
|
|
22
22
|
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Go);s&&(r=s[1]||s[2]);}if(!r)return null;let o=ar.test(r);if(!(Yo.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Xo=e=>({file:e.file,mappings:(0, sr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Wo=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, sr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Qn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(ar);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Ko=async(e,t=fetch)=>{if(!Qn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=qo(e,n);if(!r||!Qn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Wo(i):Xo(i)}catch{return null}},Zo=async(e,t=true,n)=>{if(t&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(Uo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&Rt.has(e))return Rt.get(e);let r=Ko(e,n);t&&Rt.set(e,r);let o=await r;return t&&Rt.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,lr?new WeakRef(o):o)),o},er=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Jo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],tr="about://React/",Qo=["<anonymous>","eval",""],ei=/\.(jsx|tsx|ts|js)$/,ti=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,ni=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,ri=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",oi=e=>{let t=e._debugSource;return t?typeof t=="object"&&!!t&&"fileName"in t&&typeof t.fileName=="string"&&"lineNumber"in t&&typeof t.lineNumber=="number":false},ii=async(e,t=true,n)=>{if(oi(e))return e._debugSource||null;let r=cr(e);return ur(r,void 0,t,n)},cr=e=>ri(e)?Ho(e._debugStack.stack):Do(e),si=async(e,t=true,n)=>{let r=await ur(e,1,t,n);return !r||r.length===0?null:r[0]},ur=async(e,t=1,n=true,r)=>{let o=or(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await Zo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=zo(a,s.line,s.col);if(l){i.push(l);continue}}i.push({fileName:s.file,lineNumber:s.line,columnNumber:s.col,functionName:s.function});}return i},je=e=>{if(!e||Qo.includes(e))return "";let t=e;if(t.startsWith(tr)){let r=t.slice(tr.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of Jo)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(er.test(t)){let r=t.match(er);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);ni.test(r)&&(t=t.slice(0,n));}return t},Qt=e=>{let t=je(e);return !(!t||!ei.test(t)||ti.test(t))},ai=async(e,t=true,n)=>{let r=He(e,s=>{if(We(s))return true},true);if(r){let s=await ii(r,t,n);if(s?.fileName){let a=je(s.fileName);if(Qt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=or(cr(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await si(s.raw,t,n);if(a)return {fileName:je(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:je(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},fr=async(e,t=true,n)=>{let r=Ke(e);if(!r||!Gt(r))return null;let o=Xt(r);return o?ai(o,t,n):null};var li=new Set(["role","name","aria-label","rel","href"]);function ci(e,t){let n=li.has(e);n||=e.startsWith("data-")&&Je(e);let r=Je(t)&&t.length<100;return r||=t.startsWith("#")&&Je(t.slice(1)),n&&r}function ui(e){return Je(e)}function fi(e){return Je(e)}function di(e){return true}function mr(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ui,className:fi,tagName:di,attr:ci,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=bi(o.root,n),s,a=0;for(let f of mi(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=gi(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return Qe(g)}if(a++,nn(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...pr(s,e,o,i,r)];return l.sort(en),l.length>0?Qe(l[0]):Qe(s)}function*mi(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=hi(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...gr(r)),s>=t.seedMinLength){o.sort(en);for(let l of o)yield l;o=[];}}o.sort(en);for(let a of o)yield a;}function Je(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function hi(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let s=0;s<e.classList.length;s++){let a=e.classList[s];t.className(a)&&n.push({name:"."+CSS.escape(a),penalty:1});}for(let s=0;s<e.attributes.length;s++){let a=e.attributes[s];t.attr(a.name,a.value)&&n.push({name:`[${CSS.escape(a.name)}="${CSS.escape(a.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let s=tn(e,o);s!==void 0&&n.push({name:hr(o,s),penalty:10});}let i=tn(e);return i!==void 0&&n.push({name:pi(o,i),penalty:50}),n}function Qe(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function dr(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function en(e,t){return dr(e)-dr(t)}function tn(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function gi(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=tn(r,i);if(s===void 0)return;o.push({name:hr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(nn(o,t))return o}function pi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function hr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*gr(e,t=[]){if(e.length>0)for(let n of e[0])yield*gr(e.slice(1,e.length),t.concat(n));else yield t;}function bi(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function nn(e,t){let n=Qe(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*pr(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let i=1;i<e.length-1;i++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let a=[...e];a.splice(i,1),nn(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*pr(a,t,n,r,o));}}Wt({onCommitFiberRoot(e,t){Et.add(t);}});var yi=e=>mr(e),rn=async e=>{let t=(u,c)=>u.length>c?`${u.substring(0,c)}...`:u,n=u=>!!(u.startsWith("_")||u.includes("Provider")&&u.includes("Context")),r=u=>{let c=Ke(u);if(!c)return null;let m=null;return He(c,y=>{if(We(y)){let E=Be(y);if(E&&!n(E))return m=E,true}return false},true),m},o=async u=>{let c=await fr(u);if(!c)return null;let m=je(c.fileName);return Qt(m)?`${m}:${c.lineNumber}:${c.columnNumber}`:null},i=new Set(["article","aside","footer","form","header","main","nav","section"]),s=u=>{let c=u.tagName.toLowerCase();if(i.has(c)||u.id)return true;if(u.className&&typeof u.className=="string"){let m=u.className.trim();if(m&&m.length>0)return true}return Array.from(u.attributes).some(m=>m.name.startsWith("data-"))},a=(u,c=10)=>{let m=[],y=u.parentElement,E=0;for(;y&&E<c&&y.tagName!=="BODY"&&!(s(y)&&(m.push(y),m.length>=3));)y=y.parentElement,E++;return m.reverse()},l=(u,c=false)=>{let m=u.tagName.toLowerCase(),y=[];if(u.id&&y.push(`id="${u.id}"`),u.className&&typeof u.className=="string"){let M=u.className.trim().split(/\s+/);if(M.length>0&&M[0]){let j=c?M.slice(0,3):M,B=t(j.join(" "),30);y.push(`class="${B}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),H=c?E.slice(0,1):E;for(let M of H)y.push(`${M.name}="${t(M.value,20)}"`);let I=u.getAttribute("aria-label");return I&&!c&&y.push(`aria-label="${t(I,20)}"`),y.length>0?`<${m} ${y.join(" ")}>`:`<${m}>`},f=u=>`</${u.tagName.toLowerCase()}>`,h=u=>{let c=(u.textContent||"").trim().replace(/\s+/g," ");return t(c,60)},g=u=>{if(u.id)return `#${u.id}`;if(u.className&&typeof u.className=="string"){let c=u.className.trim().split(/\s+/);if(c.length>0&&c[0])return `.${c[0]}`}return null},b=[],x=yi(e);b.push(`- selector: ${x}`);let S=e.getBoundingClientRect();b.push(`- width: ${Math.round(S.width)}`),b.push(`- height: ${Math.round(S.height)}`),b.push("HTML snippet:"),b.push("```html");let C=a(e),R=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),O=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),m=R[u],y=A[u];m&&y&&(u===0||R[u-1]!==m)&&b.push(`${c}<${m} source="${y}">`),b.push(`${c}${l(C[u],true)}`);}let _=e.parentElement,N=-1;if(_){let u=Array.from(_.children);if(N=u.indexOf(e),N>0){let c=u[N-1];if(g(c)&&N<=2){let y=" ".repeat(C.length);b.push(`${y} ${l(c,true)}`),b.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(N>0){let y=" ".repeat(C.length);b.push(`${y} ... (${N} element${N===1?"":"s"})`);}}}let D=" ".repeat(C.length),re=C.length>0?R[R.length-1]:null,se=T&&O&&T!==re;se&&b.push(`${D} <${T} used-at="${O}">`),b.push(`${D} <!-- IMPORTANT: selected element -->`);let ue=h(e),Re=e.children.length,w=`${D}${se?" ":" "}`;if(ue&&Re===0&&ue.length<40?b.push(`${w}${l(e)}${ue}${f(e)}`):(b.push(`${w}${l(e)}`),ue&&b.push(`${w} ${ue}`),Re>0&&b.push(`${w} ... (${Re} element${Re===1?"":"s"})`),b.push(`${w}${f(e)}`)),se&&b.push(`${D} </${T}>`),_&&N>=0){let u=Array.from(_.children),c=u.length-N-1;if(c>0){let m=u[N+1];g(m)&&c<=2?(b.push(`${D} ${l(m,true)}`),b.push(`${D} </${m.tagName.toLowerCase()}>`)):b.push(`${D} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);b.push(`${c}${f(C[u])}`);let m=R[u],y=A[u];m&&y&&(u===C.length-1||R[u+1]!==m)&&b.push(`${c}</${m}>`);}return b.push("```"),b.join(`
|
|
23
|
-
`)};var wi=()=>document.hasFocus()?new Promise(e=>setTimeout(e,50)):new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),setTimeout(e,50);};window.addEventListener("focus",t),window.focus();}),on=async e=>{await wi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let n of e)if(typeof n=="string"){let r=br(n);if(!r)return r}return !0}let t=new Map;for(let n of e)if(n instanceof Blob){let r=n.type||"text/plain";t.has(r)||t.set(r,n);}else t.has("text/plain")||t.set("text/plain",new Blob([n],{type:"text/plain"}));return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(t))]),!0}else {if(e instanceof Blob)return await navigator.clipboard.write([new ClipboardItem({[e.type]:e})]),!0;try{return await navigator.clipboard.writeText(String(e)),!0}catch{return br(e)}}}catch{return false}},br=e=>{if(!document.execCommand)return false;let t=document.createElement("textarea");t.value=String(e),t.style.clipPath="inset(50%)",t.ariaHidden="true",(document.body||document.documentElement).append(t);try{return t.select(),document.execCommand("copy")}finally{t.remove();}};var yr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var et=e=>{if(e.closest(`[${De}]`))return false;let t=window.getComputedStyle(e);return !(!yr(e,t)||t.pointerEvents==="none")};var sn=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(et(r))return r;return null};var wr=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i=e.x,s=e.y,a=e.x+e.width,l=e.y+e.height;for(let f of o){if(!n){let C=(f.tagName||"").toUpperCase();if(C==="HTML"||C==="BODY")continue}if(!t(f))continue;let h=f.getBoundingClientRect(),g=h.left,b=h.top,x=h.left+h.width,S=h.top+h.height;if(n){let C=Math.max(i,g),R=Math.max(s,b),T=Math.min(a,x),A=Math.min(l,S),O=Math.max(0,T-C),_=Math.max(0,A-R),N=O*_,D=Math.max(0,h.width*h.height);D>0&&N/D>=.75&&r.push(f);}else g<a&&x>i&&b<l&&S>s&&r.push(f);}return r},Sr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t)));var Tr=(e,t)=>{let n=wr(e,t,true);return Sr(n)},Cr=(e,t)=>{let n=wr(e,t,false);return Sr(n)};var an=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return {borderRadius:n.borderRadius||"0px",height:t.height,transform:n.transform||"none",width:t.width,x:t.left,y:t.top}};var Si=150,xr=e=>{let t={enabled:true,keyHoldDuration:300,...e};return t.enabled===false?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:ke(n=>{let[o,i]=$(false),[s,a]=$(-1e3),[l,f]=$(-1e3),[h,g]=$(false),[b,x]=$(-1e3),[S,C]=$(-1e3),[R,T]=$(false),[A,O]=$(null),[_,N]=$(null),[D,re]=$(0),[se,ue]=$([]),[Re,w]=$([]),[u,c]=$(false),[m,y]=$(false),[E,H]=$(false),[I,M]=$(-1e3),[j,B]=$(-1e3),[z,Y]=$(false),F=null,G=null,Q=null,fe=null,Z=null,ae=-1e3,we=-1e3,be=U(()=>u()&&!R()),Se=U(()=>s()>-1e3&&l()>-1e3),oe=d=>(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="c",Te=d=>{let v=`grabbed-${Date.now()}-${Math.random()}`,P=Date.now(),X={id:v,bounds:d,createdAt:P},J=se();ue([...J,X]),setTimeout(()=>{ue(ee=>ee.filter(it=>it.id!==v));},1700);},Oe=(d,v,P)=>{let X=`success-${Date.now()}-${Math.random()}`;w(J=>[...J,{id:X,text:d,x:v,y:P}]),setTimeout(()=>{w(J=>J.filter(ee=>ee.id!==X));},1700);},tt=d=>`<selected_element>
|
|
23
|
+
`)};var wi=()=>document.hasFocus()?new Promise(e=>setTimeout(e,50)):new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),setTimeout(e,50);};window.addEventListener("focus",t),window.focus();}),on=async e=>{await wi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let n of e)if(typeof n=="string"){let r=br(n);if(!r)return r}return !0}let t=new Map;for(let n of e)if(n instanceof Blob){let r=n.type||"text/plain";t.has(r)||t.set(r,n);}else t.has("text/plain")||t.set("text/plain",new Blob([n],{type:"text/plain"}));return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(t))]),!0}else {if(e instanceof Blob)return await navigator.clipboard.write([new ClipboardItem({[e.type]:e})]),!0;try{return await navigator.clipboard.writeText(String(e)),!0}catch{return br(e)}}}catch{return false}},br=e=>{if(!document.execCommand)return false;let t=document.createElement("textarea");t.value=String(e),t.style.clipPath="inset(50%)",t.ariaHidden="true",(document.body||document.documentElement).append(t);try{return t.select(),document.execCommand("copy")}finally{t.remove();}};var yr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var et=e=>{if(e.closest(`[${De}]`))return false;let t=window.getComputedStyle(e);return !(!yr(e,t)||t.pointerEvents==="none")};var sn=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(et(r))return r;return null};var wr=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i=e.x,s=e.y,a=e.x+e.width,l=e.y+e.height;for(let f of o){if(!n){let C=(f.tagName||"").toUpperCase();if(C==="HTML"||C==="BODY")continue}if(!t(f))continue;let h=f.getBoundingClientRect(),g=h.left,b=h.top,x=h.left+h.width,S=h.top+h.height;if(n){let C=Math.max(i,g),R=Math.max(s,b),T=Math.min(a,x),A=Math.min(l,S),O=Math.max(0,T-C),_=Math.max(0,A-R),N=O*_,D=Math.max(0,h.width*h.height);D>0&&N/D>=.75&&r.push(f);}else g<a&&x>i&&b<l&&S>s&&r.push(f);}return r},Sr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t)));var Tr=(e,t)=>{let n=wr(e,t,true);return Sr(n)},Cr=(e,t)=>{let n=wr(e,t,false);return Sr(n)};var an=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return {borderRadius:n.borderRadius||"0px",height:t.height,transform:n.transform||"none",width:t.width,x:t.left,y:t.top}};var Si=150,xr=e=>{let t={enabled:true,keyHoldDuration:300,allowActivationInsideInput:true,...e};return t.enabled===false?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:ke(n=>{let[o,i]=$(false),[s,a]=$(-1e3),[l,f]=$(-1e3),[h,g]=$(false),[b,x]=$(-1e3),[S,C]=$(-1e3),[R,T]=$(false),[A,O]=$(null),[_,N]=$(null),[D,re]=$(0),[se,ue]=$([]),[Re,w]=$([]),[u,c]=$(false),[m,y]=$(false),[E,H]=$(false),[I,M]=$(-1e3),[j,B]=$(-1e3),[z,Y]=$(false),F=null,G=null,Q=null,fe=null,Z=null,ae=-1e3,we=-1e3,be=U(()=>u()&&!R()),Se=U(()=>s()>-1e3&&l()>-1e3),oe=d=>(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="c",Te=d=>{let v=`grabbed-${Date.now()}-${Math.random()}`,P=Date.now(),X={id:v,bounds:d,createdAt:P},J=se();ue([...J,X]),setTimeout(()=>{ue(ee=>ee.filter(it=>it.id!==v));},1700);},Oe=(d,v,P)=>{let X=`success-${Date.now()}-${Math.random()}`;w(J=>[...J,{id:X,text:d,x:v,y:P}]),setTimeout(()=>{w(J=>J.filter(ee=>ee.id!==X));},1700);},tt=d=>`<selected_element>
|
|
24
24
|
${d}
|
|
25
25
|
</selected_element>`,nt=d=>{let v=window.getComputedStyle(d),P=d.getBoundingClientRect();return {width:`${Math.round(P.width)}px`,height:`${Math.round(P.height)}px`,paddingTop:v.paddingTop,paddingRight:v.paddingRight,paddingBottom:v.paddingBottom,paddingLeft:v.paddingLeft,background:v.background,opacity:v.opacity}},ln=d=>{let v={elements:d.map(J=>({tagName:J.tagName,content:J.content,computedStyles:J.computedStyles}))},X=`<div data-react-grab="${btoa(JSON.stringify(v))}"></div>`;return new Blob([X],{type:"text/html"})},rt=d=>(d.tagName||"").toLowerCase(),cn=d=>{try{let v=d.map(P=>({tagName:rt(P)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:v}}));}catch{}},Ot=async(d,v,P)=>{M(d),B(v),T(true),await P().finally(()=>{T(false);});},Er=async d=>{let v=rt(d);Te(an(d)),await new Promise(P=>requestAnimationFrame(P));try{let P=await rn(d),X=tt(P),J=ln([{tagName:v,content:P,computedStyles:nt(d)}]);await on([X,J]);}catch{}Oe(v?`<${v}>`:"<element>",I(),j()),cn([d]);},un=async d=>{if(d.length!==0){for(let v of d)Te(an(v));await new Promise(v=>requestAnimationFrame(v));try{let v=await Promise.all(d.map(ee=>rn(ee))),P=v.filter(ee=>ee.trim()).map(ee=>tt(ee)).join(`
|
|
26
26
|
|
|
27
|
-
`),X=v.map((ee,it)=>({tagName:rt(d[it]),content:ee,computedStyles:nt(d[it])})),J=ln(X);await on([P,J]);}catch{}Oe(`${d.length} elements`,I(),j()),cn(d);}},Fe=U(()=>!be()||h()?null:sn(s(),l())),Rr=U(()=>{let d=Fe();if(!d)return;let v=d.getBoundingClientRect(),P=window.getComputedStyle(d);return {borderRadius:P.borderRadius||"0px",height:v.height,transform:P.transform||"none",width:v.width,x:v.left,y:v.top}}),ot=2,fn=(d,v)=>({x:Math.abs(d-b()),y:Math.abs(v-S())}),dn=U(()=>{if(!h())return false;let d=fn(s(),l());return d.x>ot||d.y>ot}),mn=(d,v)=>{let P=Math.min(b(),d),X=Math.min(S(),v),J=Math.abs(d-b()),ee=Math.abs(v-S());return {x:P,y:X,width:J,height:ee}},Or=U(()=>{if(!dn())return;let d=mn(s(),l());return {borderRadius:"0px",height:d.height,transform:"none",width:d.width,x:d.x,y:d.y}}),Nr=U(()=>{let d=Fe();return d?`<${rt(d)}>`:"<element>"}),hn=U(()=>R()?{x:I(),y:j()}:{x:s(),y:l()}),_r=U(()=>!!(Fe()&&Fe()===A()));ne(_e(()=>[Fe(),A()],([d,v])=>{v&&d&&v!==d&&O(null);}));let gn=U(()=>{let d=_();if(D(),d===null)return 0;let v=Date.now()-d;return Math.min(v/t.keyHoldDuration,1)}),Ar=()=>{N(Date.now()),y(false),Q=window.setTimeout(()=>{y(true),Q=null;},Si);let d=()=>{if(_()===null)return;re(P=>P+1),gn()<1&&(G=requestAnimationFrame(d));};d();},Nt=()=>{G!==null&&(cancelAnimationFrame(G),G=null),Q!==null&&(window.clearTimeout(Q),Q=null),N(null),y(false);},_t=()=>{Nt(),c(true),document.body.style.cursor="crosshair";},Ve=()=>{i(false),c(false),document.body.style.cursor="",h()&&(g(false),document.body.style.userSelect=""),F&&window.clearTimeout(F),fe&&window.clearTimeout(fe),Z&&(window.clearTimeout(Z),Z=null),Y(false),ae=-1e3,we=-1e3,Nt();},pn=new AbortController,$e=pn.signal;window.addEventListener("keydown",d=>{if(d.key==="Escape"&&o()){Ve();return}if(!In(d)&&oe(d)){if(u()){fe!==null&&window.clearTimeout(fe),fe=window.setTimeout(()=>{Ve();},200);return}d.repeat||(F!==null&&window.clearTimeout(F),o()||i(true),Ar(),F=window.setTimeout(()=>{_t(),t.onActivate?.();},t.keyHoldDuration));}},{signal:$e}),window.addEventListener("keyup",d=>{if(!o()&&!u())return;let v=!d.metaKey&&!d.ctrlKey;(d.key.toLowerCase()==="c"||v)&&Ve();},{signal:$e,capture:true}),window.addEventListener("mousemove",d=>{a(d.clientX),f(d.clientY),ae===-1e3&&(ae=d.clientX,we=d.clientY);let v=d.clientX-ae,P=d.clientY-we;Math.sqrt(v*v+P*P)>=200?(Z!==null&&window.clearTimeout(Z),Y(false),ae=d.clientX,we=d.clientY,Z=window.setTimeout(()=>{Y(true),ae=s(),we=l(),Z=null;},100)):Z===null&&!z()&&(Z=window.setTimeout(()=>{Y(true),ae=s(),we=l(),Z=null;},100));},{signal:$e}),window.addEventListener("mousedown",d=>{!be()||R()||(d.preventDefault(),g(true),x(d.clientX),C(d.clientY),document.body.style.userSelect="none");},{signal:$e}),window.addEventListener("mouseup",d=>{if(!h())return;let v=fn(d.clientX,d.clientY),P=v.x>ot||v.y>ot;if(g(false),document.body.style.userSelect="",P){H(true);let X=mn(d.clientX,d.clientY),J=Tr(X,et);if(J.length>0)Ot(d.clientX,d.clientY,()=>un(J));else {let ee=Cr(X,et);ee.length>0&&Ot(d.clientX,d.clientY,()=>un(ee));}}else {let X=sn(d.clientX,d.clientY);if(!X)return;O(X),Ot(d.clientX,d.clientY,()=>Er(X));}},{signal:$e}),window.addEventListener("click",d=>{(be()||R()||E())&&(d.preventDefault(),d.stopPropagation(),E()&&H(false));},{signal:$e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&ue([]);},{signal:$e}),me(()=>{pn.abort(),F&&window.clearTimeout(F),fe&&window.clearTimeout(fe),Z&&window.clearTimeout(Z),Nt(),document.body.style.userSelect="",document.body.style.cursor="";});let Fr=Mn(),$r=U(()=>false),kr=U(()=>be()&&dn()),Ir=U(()=>R()?"processing":"hover"),Mr=U(()=>be()&&!h()&&z()&&(!!Fe()&&!_r()||!Fe())||R()),Pr=U(()=>o()&&m()&&Se()),Lr=U(()=>be()&&!h());return $n(()=>k(Bn,{get selectionVisible(){return $r()},get selectionBounds(){return Rr()},get dragVisible(){return kr()},get dragBounds(){return Or()},get grabbedBoxes(){return se()},get successLabels(){return Re()},get labelVariant(){return Ir()},get labelText(){return Nr()},get labelX(){return hn().x},get labelY(){return hn().y},get labelVisible(){return Mr()},get progressVisible(){return Pr()},get progress(){return gn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return Lr()}}),Fr),{activate:()=>{u()||(_t(),t.onActivate?.());},deactivate:()=>{u()&&Ve();},toggle:()=>{u()?Ve():(_t(),t.onActivate?.());},isActive:()=>u(),dispose:n}})};var vr=null,Sl=()=>vr;vr=xr();/*! Bundled license information:
|
|
27
|
+
`),X=v.map((ee,it)=>({tagName:rt(d[it]),content:ee,computedStyles:nt(d[it])})),J=ln(X);await on([P,J]);}catch{}Oe(`${d.length} elements`,I(),j()),cn(d);}},Fe=U(()=>!be()||h()?null:sn(s(),l())),Rr=U(()=>{let d=Fe();if(!d)return;let v=d.getBoundingClientRect(),P=window.getComputedStyle(d);return {borderRadius:P.borderRadius||"0px",height:v.height,transform:P.transform||"none",width:v.width,x:v.left,y:v.top}}),ot=2,fn=(d,v)=>({x:Math.abs(d-b()),y:Math.abs(v-S())}),dn=U(()=>{if(!h())return false;let d=fn(s(),l());return d.x>ot||d.y>ot}),mn=(d,v)=>{let P=Math.min(b(),d),X=Math.min(S(),v),J=Math.abs(d-b()),ee=Math.abs(v-S());return {x:P,y:X,width:J,height:ee}},Or=U(()=>{if(!dn())return;let d=mn(s(),l());return {borderRadius:"0px",height:d.height,transform:"none",width:d.width,x:d.x,y:d.y}}),Nr=U(()=>{let d=Fe();return d?`<${rt(d)}>`:"<element>"}),hn=U(()=>R()?{x:I(),y:j()}:{x:s(),y:l()}),_r=U(()=>!!(Fe()&&Fe()===A()));ne(_e(()=>[Fe(),A()],([d,v])=>{v&&d&&v!==d&&O(null);}));let gn=U(()=>{let d=_();if(D(),d===null)return 0;let v=Date.now()-d;return Math.min(v/t.keyHoldDuration,1)}),Ar=()=>{N(Date.now()),y(false),Q=window.setTimeout(()=>{y(true),Q=null;},Si);let d=()=>{if(_()===null)return;re(P=>P+1),gn()<1&&(G=requestAnimationFrame(d));};d();},Nt=()=>{G!==null&&(cancelAnimationFrame(G),G=null),Q!==null&&(window.clearTimeout(Q),Q=null),N(null),y(false);},_t=()=>{Nt(),c(true),document.body.style.cursor="crosshair";},Ve=()=>{i(false),c(false),document.body.style.cursor="",h()&&(g(false),document.body.style.userSelect=""),F&&window.clearTimeout(F),fe&&window.clearTimeout(fe),Z&&(window.clearTimeout(Z),Z=null),Y(false),ae=-1e3,we=-1e3,Nt();},pn=new AbortController,$e=pn.signal;window.addEventListener("keydown",d=>{if(d.key==="Escape"&&o()){Ve();return}if(!(!t.allowActivationInsideInput&&In(d))&&oe(d)){if(u()){fe!==null&&window.clearTimeout(fe),fe=window.setTimeout(()=>{Ve();},200);return}d.repeat||(F!==null&&window.clearTimeout(F),o()||i(true),Ar(),F=window.setTimeout(()=>{_t(),t.onActivate?.();},t.keyHoldDuration));}},{signal:$e}),window.addEventListener("keyup",d=>{if(!o()&&!u())return;let v=!d.metaKey&&!d.ctrlKey;(d.key.toLowerCase()==="c"||v)&&Ve();},{signal:$e,capture:true}),window.addEventListener("mousemove",d=>{a(d.clientX),f(d.clientY),ae===-1e3&&(ae=d.clientX,we=d.clientY);let v=d.clientX-ae,P=d.clientY-we;Math.sqrt(v*v+P*P)>=200?(Z!==null&&window.clearTimeout(Z),Y(false),ae=d.clientX,we=d.clientY,Z=window.setTimeout(()=>{Y(true),ae=s(),we=l(),Z=null;},100)):Z===null&&!z()&&(Z=window.setTimeout(()=>{Y(true),ae=s(),we=l(),Z=null;},100));},{signal:$e}),window.addEventListener("mousedown",d=>{!be()||R()||(d.preventDefault(),g(true),x(d.clientX),C(d.clientY),document.body.style.userSelect="none");},{signal:$e}),window.addEventListener("mouseup",d=>{if(!h())return;let v=fn(d.clientX,d.clientY),P=v.x>ot||v.y>ot;if(g(false),document.body.style.userSelect="",P){H(true);let X=mn(d.clientX,d.clientY),J=Tr(X,et);if(J.length>0)Ot(d.clientX,d.clientY,()=>un(J));else {let ee=Cr(X,et);ee.length>0&&Ot(d.clientX,d.clientY,()=>un(ee));}}else {let X=sn(d.clientX,d.clientY);if(!X)return;O(X),Ot(d.clientX,d.clientY,()=>Er(X));}},{signal:$e}),window.addEventListener("click",d=>{(be()||R()||E())&&(d.preventDefault(),d.stopPropagation(),E()&&H(false));},{signal:$e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&ue([]);},{signal:$e}),me(()=>{pn.abort(),F&&window.clearTimeout(F),fe&&window.clearTimeout(fe),Z&&window.clearTimeout(Z),Nt(),document.body.style.userSelect="",document.body.style.cursor="";});let Fr=Mn(),$r=U(()=>false),kr=U(()=>be()&&dn()),Ir=U(()=>R()?"processing":"hover"),Mr=U(()=>be()&&!h()&&z()&&(!!Fe()&&!_r()||!Fe())||R()),Pr=U(()=>o()&&m()&&Se()),Lr=U(()=>be()&&!h());return $n(()=>k(Bn,{get selectionVisible(){return $r()},get selectionBounds(){return Rr()},get dragVisible(){return kr()},get dragBounds(){return Or()},get grabbedBoxes(){return se()},get successLabels(){return Re()},get labelVariant(){return Ir()},get labelText(){return Nr()},get labelX(){return hn().x},get labelY(){return hn().y},get labelVisible(){return Mr()},get progressVisible(){return Pr()},get progress(){return gn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return Lr()}}),Fr),{activate:()=>{u()||(_t(),t.onActivate?.());},deactivate:()=>{u()&&Ve();},toggle:()=>{u()?Ve():(_t(),t.onActivate?.());},isActive:()=>u(),dispose:n}})};var vr=null,Sl=()=>vr;vr=xr();/*! Bundled license information:
|
|
28
28
|
|
|
29
29
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
30
30
|
(**
|
package/dist/index.js
CHANGED
|
@@ -1125,6 +1125,7 @@ var init = (rawOptions) => {
|
|
|
1125
1125
|
const options = {
|
|
1126
1126
|
enabled: true,
|
|
1127
1127
|
keyHoldDuration: 300,
|
|
1128
|
+
allowActivationInsideInput: true,
|
|
1128
1129
|
...rawOptions
|
|
1129
1130
|
};
|
|
1130
1131
|
if (options.enabled === false) {
|
|
@@ -1424,7 +1425,9 @@ ${context}
|
|
|
1424
1425
|
deactivateRenderer();
|
|
1425
1426
|
return;
|
|
1426
1427
|
}
|
|
1427
|
-
if (isKeyboardEventTriggeredByInput(event))
|
|
1428
|
+
if (!options.allowActivationInsideInput && isKeyboardEventTriggeredByInput(event)) {
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1428
1431
|
if (!isTargetKeyCombination(event)) return;
|
|
1429
1432
|
if (isActivated()) {
|
|
1430
1433
|
if (keydownSpamTimerId !== null) {
|