react-grab 0.1.26 → 0.1.28

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.
@@ -1 +1 @@
1
- 'use strict';var chunkLCM4WNAK_cjs=require('../chunk-LCM4WNAK.cjs'),chunkGGMYMQUS_cjs=require('../chunk-GGMYMQUS.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.c}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.a}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.f}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkGGMYMQUS_cjs.Aa}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkGGMYMQUS_cjs.va}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkGGMYMQUS_cjs.pa}});
1
+ 'use strict';var chunkXWCIDYJD_cjs=require('../chunk-XWCIDYJD.cjs'),chunkQEVSATMF_cjs=require('../chunk-QEVSATMF.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.c}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.a}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.f}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkQEVSATMF_cjs.Ba}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkQEVSATMF_cjs.wa}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkQEVSATMF_cjs.qa}});
@@ -1 +1 @@
1
- export{c as DEFAULT_THEME,a as copyContent,b as generateSnippet,f as init}from'../chunk-447CSJVY.js';export{Aa as formatElementInfo,va as getStack,pa as isInstrumentationActive}from'../chunk-EMBZHHMN.js';
1
+ export{c as DEFAULT_THEME,a as copyContent,b as generateSnippet,f as init}from'../chunk-XYTXUEOE.js';export{Ba as formatElementInfo,wa as getStack,qa as isInstrumentationActive}from'../chunk-5RMV2HA7.js';
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkLCM4WNAK_cjs=require('./chunk-LCM4WNAK.cjs'),chunkGGMYMQUS_cjs=require('./chunk-GGMYMQUS.cjs');/**
1
+ 'use strict';var chunkXWCIDYJD_cjs=require('./chunk-XWCIDYJD.cjs'),chunkQEVSATMF_cjs=require('./chunk-QEVSATMF.cjs');/**
2
2
  * @license MIT
3
3
  *
4
4
  * Copyright (c) 2025 Aiden Bai
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- var e=null,d=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,c=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=chunkLCM4WNAK_cjs.f(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.c}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.d}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.f}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkLCM4WNAK_cjs.e}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkGGMYMQUS_cjs.Aa}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkGGMYMQUS_cjs.va}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkGGMYMQUS_cjs.pa}});exports.getGlobalApi=d;exports.setGlobalApi=c;
9
+ var n=null,l=()=>typeof window>"u"?n:window.__REACT_GRAB__??n??null,R=e=>{n=e,typeof window<"u"&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__);},o=[],p=e=>{for(;o.length>0;){let t=o.shift();t&&e.registerPlugin(t);}},P=e=>{let t=l();if(t){t.registerPlugin(e);return}o.push(e);},w=e=>{let t=l();if(t){t.unregisterPlugin(e);return}let r=o.findIndex(a=>a.name===e);r!==-1&&o.splice(r,1);};typeof window<"u"&&!window.__REACT_GRAB_DISABLED__&&(window.__REACT_GRAB__?n=window.__REACT_GRAB__:(n=chunkXWCIDYJD_cjs.f(),window.__REACT_GRAB__=n),p(n),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:n})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.c}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.d}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.f}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkXWCIDYJD_cjs.e}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkQEVSATMF_cjs.Ba}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkQEVSATMF_cjs.wa}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkQEVSATMF_cjs.qa}});exports.getGlobalApi=l;exports.registerPlugin=P;exports.setGlobalApi=R;exports.unregisterPlugin=w;
package/dist/index.d.cts CHANGED
@@ -10,9 +10,12 @@ declare const openPlugin: Plugin;
10
10
  declare global {
11
11
  interface Window {
12
12
  __REACT_GRAB__?: ReactGrabAPI;
13
+ __REACT_GRAB_DISABLED__?: boolean;
13
14
  }
14
15
  }
15
16
  declare const getGlobalApi: () => ReactGrabAPI | null;
16
17
  declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
18
+ declare const registerPlugin: (plugin: Plugin) => void;
19
+ declare const unregisterPlugin: (name: string) => void;
17
20
 
18
- export { Plugin, ReactGrabAPI, commentPlugin, getGlobalApi, openPlugin, setGlobalApi };
21
+ export { Plugin, ReactGrabAPI, commentPlugin, getGlobalApi, openPlugin, registerPlugin, setGlobalApi, unregisterPlugin };
package/dist/index.d.ts CHANGED
@@ -10,9 +10,12 @@ declare const openPlugin: Plugin;
10
10
  declare global {
11
11
  interface Window {
12
12
  __REACT_GRAB__?: ReactGrabAPI;
13
+ __REACT_GRAB_DISABLED__?: boolean;
13
14
  }
14
15
  }
15
16
  declare const getGlobalApi: () => ReactGrabAPI | null;
16
17
  declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
18
+ declare const registerPlugin: (plugin: Plugin) => void;
19
+ declare const unregisterPlugin: (name: string) => void;
17
20
 
18
- export { Plugin, ReactGrabAPI, commentPlugin, getGlobalApi, openPlugin, setGlobalApi };
21
+ export { Plugin, ReactGrabAPI, commentPlugin, getGlobalApi, openPlugin, registerPlugin, setGlobalApi, unregisterPlugin };