react-grab 0.0.47 → 0.0.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/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # <img src="https://github.com/aidenybai/react-grab/blob/main/.github/public/logo.png?raw=true" width="60" align="center" /> React Grab
2
+
3
+ [![size](https://img.shields.io/bundlephobia/minzip/react-grab?label=gzip&style=flat&colorA=000000&colorB=000000)](https://bundlephobia.com/package/react-grab)
4
+ [![version](https://img.shields.io/npm/v/react-grab?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/react-grab)
5
+ [![downloads](https://img.shields.io/npm/dt/react-grab.svg?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/react-grab)
6
+
7
+ Grab any element on in your app and give it to Cursor, Claude Code, etc. to change.
8
+
9
+ By default coding agents cannot access elements on your page. React Grab fixes this - just point and click to provide context!
10
+
11
+ - Hold <kbd>⌘C</kbd> and click on any element on your page
12
+ - Works with Cursor, Claude Code, OpenCode
13
+ - Just a single script tag (it’s just JavaScript!)
14
+
15
+ ### [Try out a demo! →](https://react-grab.com)
16
+
17
+ ![Demo](https://react-grab.com/demo.gif)
18
+
19
+ ## Install
20
+
21
+ > [**Install using Cursor**](https://cursor.com/link/prompt?text=1.+Run+curl+-s+https%3A%2F%2Freact-grab.com%2Fllms.txt+%0A2.+Understand+the+content+and+follow+the+instructions+to+install+React+Grab.%0A3.+Tell+the+user+to+refresh+their+local+app+and+explain+how+to+use+React+Grab)
22
+
23
+ Get started in 1 minute by adding this script tag to your app:
24
+
25
+ ```html
26
+ <script
27
+ src="//unpkg.com/react-grab/dist/index.global.js"
28
+ crossorigin="anonymous"
29
+ data-enabled="true"
30
+ ></script>
31
+ ```
32
+
33
+ If you're using a React framework or build tool, view instructions below:
34
+
35
+ #### Next.js (App router)
36
+
37
+ Add this inside of your `app/layout.tsx`:
38
+
39
+ ```jsx
40
+ import Script from "next/script";
41
+
42
+ export default function RootLayout({ children }) {
43
+ return (
44
+ <html>
45
+ <head>
46
+ {/* put this in the <head> */}
47
+ {process.env.NODE_ENV === "development" && (
48
+ <Script
49
+ src="//unpkg.com/react-grab/dist/index.global.js"
50
+ crossOrigin="anonymous"
51
+ strategy="beforeInteractive"
52
+ data-enabled="true"
53
+ />
54
+ )}
55
+ {/* rest of your scripts go under */}
56
+ </head>
57
+ <body>{children}</body>
58
+ </html>
59
+ );
60
+ }
61
+ ```
62
+
63
+ #### Next.js (Pages router)
64
+
65
+ Add this into your `pages/_document.tsx`:
66
+
67
+ ```jsx
68
+ import { Html, Head, Main, NextScript } from "next/document";
69
+
70
+ export default function Document() {
71
+ return (
72
+ <Html lang="en">
73
+ <Head>
74
+ {/* put this in the <Head> */}
75
+ {process.env.NODE_ENV === "development" && (
76
+ <Script
77
+ src="//unpkg.com/react-grab/dist/index.global.js"
78
+ crossOrigin="anonymous"
79
+ strategy="beforeInteractive"
80
+ data-enabled="true"
81
+ />
82
+ )}
83
+ {/* rest of your scripts go under */}
84
+ </Head>
85
+ <body>
86
+ <Main />
87
+ <NextScript />
88
+ </body>
89
+ </Html>
90
+ );
91
+ }
92
+ ```
93
+
94
+ #### Vite
95
+
96
+ Your `index.html` could look like this:
97
+
98
+ ```html
99
+ <!doctype html>
100
+ <html lang="en">
101
+ <head>
102
+ <script type="module">
103
+ // first npm i react-grab
104
+ // then in head:
105
+ if (import.meta.env.DEV) {
106
+ import("react-grab");
107
+ }
108
+ </script>
109
+ </head>
110
+ <body>
111
+ <div id="root"></div>
112
+ <script type="module" src="/src/main.tsx"></script>
113
+ </body>
114
+ </html>
115
+ ```
116
+
117
+ #### Webpack
118
+
119
+ First, install React Grab:
120
+
121
+ ```bash
122
+ npm install react-grab
123
+ ```
124
+
125
+ Then add this at the top of your main entry file (e.g., `src/index.tsx` or `src/main.tsx`):
126
+
127
+ ```tsx
128
+ if (process.env.NODE_ENV === "development") {
129
+ import("react-grab");
130
+ }
131
+ ```
132
+
133
+ ## Resources & Contributing Back
134
+
135
+ Want to try it out? Check the [our demo](https://react-grab.com).
136
+
137
+ Looking to contribute back? Check the [Contributing Guide](https://github.com/aidenybai/react-grab/blob/main/CONTRIBUTING.md) out.
138
+
139
+ Want to talk to the community? Hop in our [Discord](https://discord.com/invite/G7zxfUzkm7) and share your ideas and what you've build with React Grab.
140
+
141
+ Find a bug? Head over to our [issue tracker](https://github.com/aidenybai/react-grab/issues) and we'll do our best to help. We love pull requests, too!
142
+
143
+ We expect all contributors to abide by the terms of our [Code of Conduct](https://github.com/aidenybai/react-grab/blob/main/.github/CODE_OF_CONDUCT.md).
144
+
145
+ [**→ Start contributing on GitHub**](https://github.com/aidenybai/react-grab/blob/main/CONTRIBUTING.md)
146
+
147
+ ### License
148
+
149
+ React Grab is MIT-licensed open-source software.
package/dist/index.cjs CHANGED
@@ -1210,12 +1210,19 @@ var init = (rawOptions) => {
1210
1210
  hasInited = true;
1211
1211
  const logIntro = () => {
1212
1212
  try {
1213
- const version = "0.0.47";
1213
+ const version = "0.0.48";
1214
1214
  const logoSvg = `<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>`;
1215
1215
  const logoDataUri = `data:image/svg+xml;base64,${btoa(logoSvg)}`;
1216
1216
  console.log(`%cReact Grab${version ? ` v${version}` : ""}%c
1217
1217
  https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${logoDataUri}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`, "");
1218
- fetch("https://www.react-grab.com/api/version").then((res) => res.text()).catch(() => null);
1218
+ if (navigator.onLine) {
1219
+ fetch("https://www.react-grab.com/api/version", {
1220
+ referrerPolicy: "origin",
1221
+ keepalive: true,
1222
+ priority: "low",
1223
+ cache: "no-store"
1224
+ }).then((res) => res.text()).catch(() => null);
1225
+ }
1219
1226
  } catch {
1220
1227
  }
1221
1228
  };
@@ -1621,6 +1628,8 @@ ${plainTextContentOnly}` : plainTextContentOnly;
1621
1628
  return;
1622
1629
  }
1623
1630
  if (event.code === "Enter" && isHoldingKeys() && !isInputMode()) {
1631
+ event.preventDefault();
1632
+ event.stopPropagation();
1624
1633
  setIsToggleMode(true);
1625
1634
  if (keydownSpamTimerId !== null) {
1626
1635
  window.clearTimeout(keydownSpamTimerId);
@@ -25,8 +25,8 @@ ${t.stack}`:""}},ci=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=vo
25
25
  ${d}`),n.length>0){let g=n.length>100?`${n.slice(0,100)}...`:n;m+=`
26
26
  ${g}`;}let x=c(s);return x&&(m+=`
27
27
  ${x}`),m.length>0?`<${t}${r}>${m}
28
- </${t}>`:`<${t}${r} />`};var Li=()=>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();}),Lt=async(e,t)=>{await Li();try{try{return await navigator.clipboard.writeText(e),t?.(),!0}catch{return Mi(e,t)}}catch{return false}},Mi=(e,t)=>{if(!document.execCommand)return false;let n=document.createElement("textarea");n.value=String(e),n.style.clipPath="inset(50%)",n.ariaHidden="true",(document.body||document.documentElement).append(n);try{n.select();let o=document.execCommand("copy");return o&&t?.(),o}finally{n.remove();}};var ot=()=>{try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createGain();t.connect(e.destination),[{freq:523.25,start:0,duration:.1},{freq:659.25,start:.05,duration:.1},{freq:783.99,start:.1,duration:.15}].forEach(r=>{let o=e.createOscillator(),i=e.createGain();o.connect(i),i.connect(t),o.frequency.value=r.freq,o.type="triangle";let s=e.currentTime+r.start,l=s+.01,a=s+r.duration;i.gain.setValueAtTime(0,s),i.gain.linearRampToValueAtTime(.15,l),i.gain.exponentialRampToValueAtTime(.01,a),o.start(s),o.stop(a);});}catch{}};var Fr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var it=e=>{if(e.closest(`[${Ue}]`))return false;let t=window.getComputedStyle(e);return !(!Fr(e,t)||t.pointerEvents==="none")};var un=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(it(r))return r;return null};var $i=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),o=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom),s=Math.max(0,o-n),l=Math.max(0,i-r);return s*l},Di=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,Ir=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height};for(let s of o){if(!n){let c=(s.tagName||"").toUpperCase();if(c==="HTML"||c==="BODY")continue}if(!t(s))continue;let l=s.getBoundingClientRect(),a={left:l.left,top:l.top,right:l.left+l.width,bottom:l.top+l.height};if(n){let c=$i(i,a),m=Math.max(0,l.width*l.height);m>0&&c/m>=.75&&r.push(s);}else Di(a,i)&&r.push(s);}return r},Nr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),Pr=(e,t)=>{let n=Ir(e,t,true);return Nr(n)},Lr=(e,t)=>{let n=Ir(e,t,false);return Nr(n)};var Mt=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 Mr=false,$r=e=>{let t={enabled:true,keyHoldDuration:300,allowActivationInsideInput:true,playCopySound:false,...e};return t.enabled===false||Mr?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:(Mr=true,(()=>{try{let r="0.0.47",i=`data:image/svg+xml;base64,${btoa('<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>')}`;console.log(`%cReact Grab${r?` v${r}`:""}%c
29
- https://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${i}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,""),fetch("https://www.react-grab.com/api/version").then(s=>s.text()).catch(()=>null);}catch{}})(),Me(r=>{let[o,i]=E(false),[s,l]=E(-1e3),[a,c]=E(-1e3),[m,d]=E(false),[x,g]=E(-1e3),[p,S]=E(-1e3),[A,W]=E(false),[G,Y]=E(null),[V,Z]=E(null),[ye,Fe]=E(0),[_e,Ie]=E([]),[st,C]=E([]),[h,f]=E(false),[y,v]=E(false),[k,I]=E(false),[F,$]=E(false),[M,N]=E(-1e3),[U,z]=E(-1e3),[O,H]=E(false),[se,Ne]=E(0),[ae,we]=E(false),[Xe,Pe]=E(""),K=null,Q=null,de=null,te=null,he=null,Ce=null,Le=D(()=>h()&&!A()),Hr=D(()=>s()>-1e3&&a()>-1e3),Br=u=>(u.metaKey||u.ctrlKey)&&u.code==="KeyC",fn=(u,w)=>({top:w<25,bottom:w>window.innerHeight-25,left:u<25,right:u>window.innerWidth-25}),dn=(u,w)=>{let T=`grabbed-${Date.now()}-${Math.random()}`,B=Date.now(),le={id:T,bounds:u,createdAt:B,element:w},ce=_e();Ie([...ce,le]),setTimeout(()=>{Ie(X=>X.filter(oe=>oe.id!==T));},1700);},mn=u=>{let w=`success-${Date.now()}-${Math.random()}`;C(T=>[...T,{id:w,text:u}]),setTimeout(()=>{C(T=>T.filter(B=>B.id!==w));},1700);},jr=u=>`<selected_element>
28
+ </${t}>`:`<${t}${r} />`};var Li=()=>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();}),Lt=async(e,t)=>{await Li();try{try{return await navigator.clipboard.writeText(e),t?.(),!0}catch{return Mi(e,t)}}catch{return false}},Mi=(e,t)=>{if(!document.execCommand)return false;let n=document.createElement("textarea");n.value=String(e),n.style.clipPath="inset(50%)",n.ariaHidden="true",(document.body||document.documentElement).append(n);try{n.select();let o=document.execCommand("copy");return o&&t?.(),o}finally{n.remove();}};var ot=()=>{try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createGain();t.connect(e.destination),[{freq:523.25,start:0,duration:.1},{freq:659.25,start:.05,duration:.1},{freq:783.99,start:.1,duration:.15}].forEach(r=>{let o=e.createOscillator(),i=e.createGain();o.connect(i),i.connect(t),o.frequency.value=r.freq,o.type="triangle";let s=e.currentTime+r.start,l=s+.01,a=s+r.duration;i.gain.setValueAtTime(0,s),i.gain.linearRampToValueAtTime(.15,l),i.gain.exponentialRampToValueAtTime(.01,a),o.start(s),o.stop(a);});}catch{}};var Fr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var it=e=>{if(e.closest(`[${Ue}]`))return false;let t=window.getComputedStyle(e);return !(!Fr(e,t)||t.pointerEvents==="none")};var un=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(it(r))return r;return null};var $i=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),o=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom),s=Math.max(0,o-n),l=Math.max(0,i-r);return s*l},Di=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,Ir=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height};for(let s of o){if(!n){let c=(s.tagName||"").toUpperCase();if(c==="HTML"||c==="BODY")continue}if(!t(s))continue;let l=s.getBoundingClientRect(),a={left:l.left,top:l.top,right:l.left+l.width,bottom:l.top+l.height};if(n){let c=$i(i,a),m=Math.max(0,l.width*l.height);m>0&&c/m>=.75&&r.push(s);}else Di(a,i)&&r.push(s);}return r},Nr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),Pr=(e,t)=>{let n=Ir(e,t,true);return Nr(n)},Lr=(e,t)=>{let n=Ir(e,t,false);return Nr(n)};var Mt=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 Mr=false,$r=e=>{let t={enabled:true,keyHoldDuration:300,allowActivationInsideInput:true,playCopySound:false,...e};return t.enabled===false||Mr?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:(Mr=true,(()=>{try{let r="0.0.48",i=`data:image/svg+xml;base64,${btoa('<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>')}`;console.log(`%cReact Grab${r?` v${r}`:""}%c
29
+ https://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${i}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,""),navigator.onLine&&fetch("https://www.react-grab.com/api/version",{referrerPolicy:"origin",keepalive:!0,priority:"low",cache:"no-store"}).then(s=>s.text()).catch(()=>null);}catch{}})(),Me(r=>{let[o,i]=E(false),[s,l]=E(-1e3),[a,c]=E(-1e3),[m,d]=E(false),[x,g]=E(-1e3),[p,S]=E(-1e3),[A,W]=E(false),[G,Y]=E(null),[V,Z]=E(null),[ye,Fe]=E(0),[_e,Ie]=E([]),[st,C]=E([]),[h,f]=E(false),[y,v]=E(false),[k,I]=E(false),[F,$]=E(false),[M,N]=E(-1e3),[U,z]=E(-1e3),[O,H]=E(false),[se,Ne]=E(0),[ae,we]=E(false),[Xe,Pe]=E(""),K=null,Q=null,de=null,te=null,he=null,Ce=null,Le=D(()=>h()&&!A()),Hr=D(()=>s()>-1e3&&a()>-1e3),Br=u=>(u.metaKey||u.ctrlKey)&&u.code==="KeyC",fn=(u,w)=>({top:w<25,bottom:w>window.innerHeight-25,left:u<25,right:u>window.innerWidth-25}),dn=(u,w)=>{let T=`grabbed-${Date.now()}-${Math.random()}`,B=Date.now(),le={id:T,bounds:u,createdAt:B,element:w},ce=_e();Ie([...ce,le]),setTimeout(()=>{Ie(X=>X.filter(oe=>oe.id!==T));},1700);},mn=u=>{let w=`success-${Date.now()}-${Math.random()}`;C(T=>[...T,{id:w,text:u}]),setTimeout(()=>{C(T=>T.filter(B=>B.id!==w));},1700);},jr=u=>`<selected_element>
30
30
  ${u}
31
31
  </selected_element>`,gn=u=>(u.tagName||"").toLowerCase(),pn=u=>{let w=gn(u),T=_r(u);return w&&T?`<${w}> in ${T}`:w?`<${w}>`:"<element>"},hn=u=>{try{let w=u.map(T=>({tagName:gn(T)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:w}}));}catch{}},at=async(u,w,T)=>{N(u),z(w),W(true),Xr(),await T().finally(()=>{W(false),lt(),y()&&be();});},Vr=u=>"innerText"in u,Ur=u=>Vr(u)?u.innerText:u.textContent??"",bn=u=>u.map(w=>Ur(w).trim()).filter(w=>w.length>0).join(`
32
32
 
@@ -44,7 +44,7 @@ ${X}`:X;T=await Lt(oe,t.playCopySound?ot:void 0);}if(!T){let X=bn(u);if(X.length
44
44
 
45
45
  ${X}`:X;T=await Lt(oe,t.playCopySound?ot:void 0);}}}catch{let le=bn(u);if(le.length>0){let ce=w?`${w}
46
46
 
47
- ${le}`:le;T=await Lt(ce,t.playCopySound?ot:void 0);}}return T},wn=async(u,w)=>{dn(Mt(u),u),await new Promise(B=>requestAnimationFrame(B)),await yn([u],w)&&mn(pn(u)),hn([u]);},Cn=async u=>{if(u.length===0)return;for(let T of u)dn(Mt(T),T);await new Promise(T=>requestAnimationFrame(T)),await yn(u)&&mn(`${u.length} elements`),hn(u);},Be=D(()=>!Le()||m()?null:un(s(),a())),Gr=D(()=>{se();let u=Be();if(!u)return;let w=u.getBoundingClientRect(),T=window.getComputedStyle(u);return {borderRadius:T.borderRadius||"0px",height:w.height,transform:T.transform||"none",width:w.width,x:w.left,y:w.top}}),xn=(u,w)=>{let T=u+window.scrollX,B=w+window.scrollY;return {x:Math.abs(T-x()),y:Math.abs(B-p())}},Sn=D(()=>{if(!m())return false;let u=xn(s(),a());return u.x>2||u.y>2}),Tn=(u,w)=>{let T=u+window.scrollX,B=w+window.scrollY,le=Math.min(x(),T),ce=Math.min(p(),B),X=Math.abs(T-x()),oe=Math.abs(B-p());return {x:le-window.scrollX,y:ce-window.scrollY,width:X,height:oe}},Yr=D(()=>{if(!Sn())return;let u=Tn(s(),a());return {borderRadius:"0px",height:u.height,transform:"none",width:u.width,x:u.x,y:u.y}}),zr=D(()=>{let u=Be();return u?pn(u):"<element>"}),vn=D(()=>A()?{x:M(),y:U()}:{x:s(),y:a()}),En=D(()=>A()?{x:M(),y:U()}:{x:s(),y:a()});J($e(()=>[Be(),G()],([u,w])=>{w&&u&&w!==u&&Y(null);})),J($e(()=>se(),()=>{let u=_e();if(u.length===0)return;let w=u.map(T=>({...T,bounds:Mt(T.element)}));Ie(w);}));let Xr=()=>{let u=Date.now();Z(u),I(false),de=window.setTimeout(()=>{I(true),de=null;},150);let w=()=>{let T=V();if(T===null)return;let le=(Date.now()-T)/t.keyHoldDuration,ce=1-Math.exp(-le),oe=A()?Math.min(ce,.95):1;Fe(oe),oe<1&&(Q=requestAnimationFrame(w));};w();},lt=()=>{Q!==null&&(cancelAnimationFrame(Q),Q=null),de!==null&&(window.clearTimeout(de),de=null),Z(null),Fe(1),I(false);},qr=()=>{let u=()=>{if(!m()){qe();return}let w=fn(s(),a());w.top&&window.scrollBy(0,-10),w.bottom&&window.scrollBy(0,10),w.left&&window.scrollBy(-10,0),w.right&&window.scrollBy(10,0),w.top||w.bottom||w.left||w.right?Ce=requestAnimationFrame(u):Ce=null;};u();},qe=()=>{Ce!==null&&(cancelAnimationFrame(Ce),Ce=null);},ct=()=>{lt(),f(true),document.body.style.cursor="crosshair",t.onActivate?.();},be=()=>{v(false),i(false),f(false),we(false),Pe(""),document.body.style.cursor="",m()&&(d(false),document.body.style.userSelect=""),K&&window.clearTimeout(K),te&&window.clearTimeout(te),he&&(window.clearTimeout(he),he=null),H(false),qe(),lt(),t.onDeactivate?.();},Wr=u=>{Pe(u);},Zr=()=>{if(!ae())return;let u=Be(),w=Xe().trim(),T=s(),B=a();we(false),Pe(""),u?at(T,B,()=>wn(u,w||void 0)).then(()=>{be();}):be();},Rn=()=>{ae()&&be();},_n=new AbortController,xe=_n.signal;window.addEventListener("keydown",u=>{if(u.code==="Escape"&&o()){if(ae())return;be();return}if(u.code==="Enter"&&o()&&!ae()){v(true),te!==null&&(window.clearTimeout(te),te=null),h()||(K&&window.clearTimeout(K),ct()),we(true);return}if(!(!t.allowActivationInsideInput&&qn(u))&&Br(u)){if(h()){if(y())return;te!==null&&window.clearTimeout(te),te=window.setTimeout(()=>{be();},200);return}u.repeat||(K!==null&&window.clearTimeout(K),o()||i(true),K=window.setTimeout(()=>{ct();},t.keyHoldDuration));}},{signal:xe,capture:true}),window.addEventListener("keyup",u=>{if(!o()&&!h())return;let w=!u.metaKey&&!u.ctrlKey;if(u.code==="KeyC"||w){if(y())return;be();}},{signal:xe,capture:true}),window.addEventListener("mousemove",u=>{if(l(u.clientX),c(u.clientY),he!==null&&window.clearTimeout(he),H(false),he=window.setTimeout(()=>{H(true),he=null;},300),m()){let w=fn(u.clientX,u.clientY),T=w.top||w.bottom||w.left||w.right;T&&Ce===null?qr():!T&&Ce!==null&&qe();}},{signal:xe}),window.addEventListener("mousedown",u=>{if(ae()){u.target.closest("[data-react-grab-input]")||Rn();return}!Le()||A()||(u.preventDefault(),d(true),g(u.clientX+window.scrollX),S(u.clientY+window.scrollY),document.body.style.userSelect="none");},{signal:xe}),window.addEventListener("mouseup",u=>{if(!m())return;let w=xn(u.clientX,u.clientY),T=w.x>2||w.y>2;if(d(false),qe(),document.body.style.userSelect="",T){$(true);let B=Tn(u.clientX,u.clientY),le=Pr(B,it);if(le.length>0)at(u.clientX,u.clientY,()=>Cn(le));else {let ce=Lr(B,it);ce.length>0&&at(u.clientX,u.clientY,()=>Cn(ce));}}else {let B=un(u.clientX,u.clientY);if(!B)return;Y(B),at(u.clientX,u.clientY,()=>wn(B));}},{signal:xe}),window.addEventListener("click",u=>{(Le()||A()||F())&&(u.preventDefault(),u.stopPropagation(),F()&&$(false),y()&&!A()&&(o()?v(false):be()));},{signal:xe,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&Ie([]);},{signal:xe}),window.addEventListener("scroll",()=>{Ne(u=>u+1);},{signal:xe,capture:true}),window.addEventListener("resize",()=>{Ne(u=>u+1);},{signal:xe}),fe(()=>{_n.abort(),K&&window.clearTimeout(K),te&&window.clearTimeout(te),he&&window.clearTimeout(he),qe(),lt(),document.body.style.userSelect="",document.body.style.cursor="";});let Kr=Wn(),Qr=D(()=>Le()&&!m()&&!!Be()),Jr=D(()=>Le()&&Sn()),eo=D(()=>A()?"processing":"hover"),to=D(()=>ae()?false:A()?true:st().length>0?false:Le()&&!m()&&!!Be()),no=D(()=>A()&&k()&&Hr()),ro=D(()=>Le()&&!m()),oo=D(()=>ae());return Yn(()=>R(er,{get selectionVisible(){return Qr()},get selectionBounds(){return Gr()},get dragVisible(){return Jr()},get dragBounds(){return Yr()},get grabbedBoxes(){return _e()},get successLabels(){return st()},get labelVariant(){return eo()},get labelText(){return zr()},get labelX(){return vn().x},get labelY(){return vn().y},get labelVisible(){return to()},labelZIndex:2147483647,get labelShowHint(){return O()},get progressVisible(){return no()},get progress(){return ye()},get mouseX(){return En().x},get mouseY(){return En().y},get crosshairVisible(){return ro()},get inputVisible(){return oo()},get inputX(){return s()},get inputY(){return a()},get inputValue(){return Xe()},onInputChange:Wr,onInputSubmit:Zr,onInputCancel:Rn}),Kr),{activate:()=>{h()||ct();},deactivate:()=>{h()&&be();},toggle:()=>{h()?be():ct();},isActive:()=>h(),dispose:r}}))};var Dr=null,nc=()=>Dr;Dr=$r();/*! Bundled license information:
47
+ ${le}`:le;T=await Lt(ce,t.playCopySound?ot:void 0);}}return T},wn=async(u,w)=>{dn(Mt(u),u),await new Promise(B=>requestAnimationFrame(B)),await yn([u],w)&&mn(pn(u)),hn([u]);},Cn=async u=>{if(u.length===0)return;for(let T of u)dn(Mt(T),T);await new Promise(T=>requestAnimationFrame(T)),await yn(u)&&mn(`${u.length} elements`),hn(u);},Be=D(()=>!Le()||m()?null:un(s(),a())),Gr=D(()=>{se();let u=Be();if(!u)return;let w=u.getBoundingClientRect(),T=window.getComputedStyle(u);return {borderRadius:T.borderRadius||"0px",height:w.height,transform:T.transform||"none",width:w.width,x:w.left,y:w.top}}),xn=(u,w)=>{let T=u+window.scrollX,B=w+window.scrollY;return {x:Math.abs(T-x()),y:Math.abs(B-p())}},Sn=D(()=>{if(!m())return false;let u=xn(s(),a());return u.x>2||u.y>2}),Tn=(u,w)=>{let T=u+window.scrollX,B=w+window.scrollY,le=Math.min(x(),T),ce=Math.min(p(),B),X=Math.abs(T-x()),oe=Math.abs(B-p());return {x:le-window.scrollX,y:ce-window.scrollY,width:X,height:oe}},Yr=D(()=>{if(!Sn())return;let u=Tn(s(),a());return {borderRadius:"0px",height:u.height,transform:"none",width:u.width,x:u.x,y:u.y}}),zr=D(()=>{let u=Be();return u?pn(u):"<element>"}),vn=D(()=>A()?{x:M(),y:U()}:{x:s(),y:a()}),En=D(()=>A()?{x:M(),y:U()}:{x:s(),y:a()});J($e(()=>[Be(),G()],([u,w])=>{w&&u&&w!==u&&Y(null);})),J($e(()=>se(),()=>{let u=_e();if(u.length===0)return;let w=u.map(T=>({...T,bounds:Mt(T.element)}));Ie(w);}));let Xr=()=>{let u=Date.now();Z(u),I(false),de=window.setTimeout(()=>{I(true),de=null;},150);let w=()=>{let T=V();if(T===null)return;let le=(Date.now()-T)/t.keyHoldDuration,ce=1-Math.exp(-le),oe=A()?Math.min(ce,.95):1;Fe(oe),oe<1&&(Q=requestAnimationFrame(w));};w();},lt=()=>{Q!==null&&(cancelAnimationFrame(Q),Q=null),de!==null&&(window.clearTimeout(de),de=null),Z(null),Fe(1),I(false);},qr=()=>{let u=()=>{if(!m()){qe();return}let w=fn(s(),a());w.top&&window.scrollBy(0,-10),w.bottom&&window.scrollBy(0,10),w.left&&window.scrollBy(-10,0),w.right&&window.scrollBy(10,0),w.top||w.bottom||w.left||w.right?Ce=requestAnimationFrame(u):Ce=null;};u();},qe=()=>{Ce!==null&&(cancelAnimationFrame(Ce),Ce=null);},ct=()=>{lt(),f(true),document.body.style.cursor="crosshair",t.onActivate?.();},be=()=>{v(false),i(false),f(false),we(false),Pe(""),document.body.style.cursor="",m()&&(d(false),document.body.style.userSelect=""),K&&window.clearTimeout(K),te&&window.clearTimeout(te),he&&(window.clearTimeout(he),he=null),H(false),qe(),lt(),t.onDeactivate?.();},Wr=u=>{Pe(u);},Zr=()=>{if(!ae())return;let u=Be(),w=Xe().trim(),T=s(),B=a();we(false),Pe(""),u?at(T,B,()=>wn(u,w||void 0)).then(()=>{be();}):be();},Rn=()=>{ae()&&be();},_n=new AbortController,xe=_n.signal;window.addEventListener("keydown",u=>{if(u.code==="Escape"&&o()){if(ae())return;be();return}if(u.code==="Enter"&&o()&&!ae()){u.preventDefault(),u.stopPropagation(),v(true),te!==null&&(window.clearTimeout(te),te=null),h()||(K&&window.clearTimeout(K),ct()),we(true);return}if(!(!t.allowActivationInsideInput&&qn(u))&&Br(u)){if(h()){if(y())return;te!==null&&window.clearTimeout(te),te=window.setTimeout(()=>{be();},200);return}u.repeat||(K!==null&&window.clearTimeout(K),o()||i(true),K=window.setTimeout(()=>{ct();},t.keyHoldDuration));}},{signal:xe,capture:true}),window.addEventListener("keyup",u=>{if(!o()&&!h())return;let w=!u.metaKey&&!u.ctrlKey;if(u.code==="KeyC"||w){if(y())return;be();}},{signal:xe,capture:true}),window.addEventListener("mousemove",u=>{if(l(u.clientX),c(u.clientY),he!==null&&window.clearTimeout(he),H(false),he=window.setTimeout(()=>{H(true),he=null;},300),m()){let w=fn(u.clientX,u.clientY),T=w.top||w.bottom||w.left||w.right;T&&Ce===null?qr():!T&&Ce!==null&&qe();}},{signal:xe}),window.addEventListener("mousedown",u=>{if(ae()){u.target.closest("[data-react-grab-input]")||Rn();return}!Le()||A()||(u.preventDefault(),d(true),g(u.clientX+window.scrollX),S(u.clientY+window.scrollY),document.body.style.userSelect="none");},{signal:xe}),window.addEventListener("mouseup",u=>{if(!m())return;let w=xn(u.clientX,u.clientY),T=w.x>2||w.y>2;if(d(false),qe(),document.body.style.userSelect="",T){$(true);let B=Tn(u.clientX,u.clientY),le=Pr(B,it);if(le.length>0)at(u.clientX,u.clientY,()=>Cn(le));else {let ce=Lr(B,it);ce.length>0&&at(u.clientX,u.clientY,()=>Cn(ce));}}else {let B=un(u.clientX,u.clientY);if(!B)return;Y(B),at(u.clientX,u.clientY,()=>wn(B));}},{signal:xe}),window.addEventListener("click",u=>{(Le()||A()||F())&&(u.preventDefault(),u.stopPropagation(),F()&&$(false),y()&&!A()&&(o()?v(false):be()));},{signal:xe,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&Ie([]);},{signal:xe}),window.addEventListener("scroll",()=>{Ne(u=>u+1);},{signal:xe,capture:true}),window.addEventListener("resize",()=>{Ne(u=>u+1);},{signal:xe}),fe(()=>{_n.abort(),K&&window.clearTimeout(K),te&&window.clearTimeout(te),he&&window.clearTimeout(he),qe(),lt(),document.body.style.userSelect="",document.body.style.cursor="";});let Kr=Wn(),Qr=D(()=>Le()&&!m()&&!!Be()),Jr=D(()=>Le()&&Sn()),eo=D(()=>A()?"processing":"hover"),to=D(()=>ae()?false:A()?true:st().length>0?false:Le()&&!m()&&!!Be()),no=D(()=>A()&&k()&&Hr()),ro=D(()=>Le()&&!m()),oo=D(()=>ae());return Yn(()=>R(er,{get selectionVisible(){return Qr()},get selectionBounds(){return Gr()},get dragVisible(){return Jr()},get dragBounds(){return Yr()},get grabbedBoxes(){return _e()},get successLabels(){return st()},get labelVariant(){return eo()},get labelText(){return zr()},get labelX(){return vn().x},get labelY(){return vn().y},get labelVisible(){return to()},labelZIndex:2147483647,get labelShowHint(){return O()},get progressVisible(){return no()},get progress(){return ye()},get mouseX(){return En().x},get mouseY(){return En().y},get crosshairVisible(){return ro()},get inputVisible(){return oo()},get inputX(){return s()},get inputY(){return a()},get inputValue(){return Xe()},onInputChange:Wr,onInputSubmit:Zr,onInputCancel:Rn}),Kr),{activate:()=>{h()||ct();},deactivate:()=>{h()&&be();},toggle:()=>{h()?be():ct();},isActive:()=>h(),dispose:r}}))};var Dr=null,nc=()=>Dr;Dr=$r();/*! Bundled license information:
48
48
 
49
49
  bippy/dist/rdt-hook-CrcWl4lP.js:
50
50
  (**
package/dist/index.js CHANGED
@@ -1208,12 +1208,19 @@ var init = (rawOptions) => {
1208
1208
  hasInited = true;
1209
1209
  const logIntro = () => {
1210
1210
  try {
1211
- const version = "0.0.47";
1211
+ const version = "0.0.48";
1212
1212
  const logoSvg = `<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>`;
1213
1213
  const logoDataUri = `data:image/svg+xml;base64,${btoa(logoSvg)}`;
1214
1214
  console.log(`%cReact Grab${version ? ` v${version}` : ""}%c
1215
1215
  https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${logoDataUri}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`, "");
1216
- fetch("https://www.react-grab.com/api/version").then((res) => res.text()).catch(() => null);
1216
+ if (navigator.onLine) {
1217
+ fetch("https://www.react-grab.com/api/version", {
1218
+ referrerPolicy: "origin",
1219
+ keepalive: true,
1220
+ priority: "low",
1221
+ cache: "no-store"
1222
+ }).then((res) => res.text()).catch(() => null);
1223
+ }
1217
1224
  } catch {
1218
1225
  }
1219
1226
  };
@@ -1619,6 +1626,8 @@ ${plainTextContentOnly}` : plainTextContentOnly;
1619
1626
  return;
1620
1627
  }
1621
1628
  if (event.code === "Enter" && isHoldingKeys() && !isInputMode()) {
1629
+ event.preventDefault();
1630
+ event.stopPropagation();
1622
1631
  setIsToggleMode(true);
1623
1632
  if (keydownSpamTimerId !== null) {
1624
1633
  window.clearTimeout(keydownSpamTimerId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-grab",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "Grab any element in your app and give it to Cursor, Claude Code, or other AI coding agents.",
5
5
  "keywords": [
6
6
  "react",