react-grab 0.0.80 → 0.0.81
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 +104 -0
- package/dist/chunk-HUGHVCPX.cjs +94 -0
- package/dist/chunk-YE5UYZQC.js +94 -0
- package/dist/cli.cjs +47 -47
- package/dist/core.cjs +1 -30
- package/dist/core.js +1 -1
- package/dist/index.cjs +2 -60
- package/dist/index.global.js +2 -2
- package/dist/index.js +2 -34
- package/package.json +2 -2
- package/dist/chunk-2OKPQEMK.cjs +0 -8761
- package/dist/chunk-VO4Y6JSD.js +0 -8754
package/dist/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { init }
|
|
2
|
-
export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet, getStack, init, Ee as isInstrumentationActive } from './chunk-VO4Y6JSD.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
1
|
+
import {f}from'./chunk-YE5UYZQC.js';export{d as DEFAULT_THEME,c as formatElementInfo,e as generateSnippet,b as getStack,f as init,a as isInstrumentationActive}from'./chunk-YE5UYZQC.js';/**
|
|
5
2
|
* @license MIT
|
|
6
3
|
*
|
|
7
4
|
* Copyright (c) 2025 Aiden Bai
|
|
@@ -9,33 +6,4 @@ export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet,
|
|
|
9
6
|
* This source code is licensed under the MIT license found in the
|
|
10
7
|
* LICENSE file in the root directory of this source tree.
|
|
11
8
|
*/
|
|
12
|
-
|
|
13
|
-
// src/index.ts
|
|
14
|
-
var globalApi = null;
|
|
15
|
-
var getGlobalApi = () => {
|
|
16
|
-
if (typeof window === "undefined") return globalApi;
|
|
17
|
-
return window.__REACT_GRAB__ ?? globalApi ?? null;
|
|
18
|
-
};
|
|
19
|
-
var setGlobalApi = (api) => {
|
|
20
|
-
globalApi = api;
|
|
21
|
-
if (typeof window !== "undefined") {
|
|
22
|
-
if (api) {
|
|
23
|
-
window.__REACT_GRAB__ = api;
|
|
24
|
-
} else {
|
|
25
|
-
delete window.__REACT_GRAB__;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
if (typeof window !== "undefined") {
|
|
30
|
-
if (window.__REACT_GRAB__) {
|
|
31
|
-
globalApi = window.__REACT_GRAB__;
|
|
32
|
-
} else {
|
|
33
|
-
globalApi = init();
|
|
34
|
-
window.__REACT_GRAB__ = globalApi;
|
|
35
|
-
window.dispatchEvent(
|
|
36
|
-
new CustomEvent("react-grab:init", { detail: globalApi })
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { getGlobalApi, setGlobalApi };
|
|
9
|
+
var e=null,A=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,d=t=>{e=t,typeof window<"u"&&(t?window.__REACT_GRAB__=t:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?e=window.__REACT_GRAB__:(e=f(),window.__REACT_GRAB__=e,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e}))));export{A as getGlobalApi,d as setGlobalApi};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-grab",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.81",
|
|
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",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"terser": "^5.36.0",
|
|
80
80
|
"tsup": "^8.2.4",
|
|
81
81
|
"typescript-eslint": "^8.46.1",
|
|
82
|
-
"@react-grab/cli": "0.0.
|
|
82
|
+
"@react-grab/cli": "0.0.81"
|
|
83
83
|
},
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|