react-resizable-panels 2.0.22 → 2.0.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.23
4
+
5
+ - Improve obfuscation for `React.useId` references (#382)
6
+
3
7
  ## 2.0.22
4
8
 
5
9
  - Force eager layout re-calculation after panel added/removed (#375)
@@ -43,8 +43,8 @@ const {
43
43
  useState
44
44
  } = React__namespace;
45
45
 
46
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
47
- const useId = React__namespace["useId".toString()];
46
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
47
+ const useId = React__namespace[`useId${Math.random()}`.slice(0, 5)];
48
48
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
49
49
 
50
50
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -43,8 +43,8 @@ const {
43
43
  useState
44
44
  } = React__namespace;
45
45
 
46
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
47
- const useId = React__namespace["useId".toString()];
46
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
47
+ const useId = React__namespace[`useId${Math.random()}`.slice(0, 5)];
48
48
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
49
49
 
50
50
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -19,8 +19,8 @@ const {
19
19
  useState
20
20
  } = React;
21
21
 
22
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
23
- const useId = React["useId".toString()];
22
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
23
+ const useId = React[`useId${Math.random()}`.slice(0, 5)];
24
24
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
25
25
 
26
26
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -19,8 +19,8 @@ const {
19
19
  useState
20
20
  } = React;
21
21
 
22
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
23
- const useId = React["useId".toString()];
22
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
23
+ const useId = React[`useId${Math.random()}`.slice(0, 5)];
24
24
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
25
25
 
26
26
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -45,8 +45,8 @@ const {
45
45
  useState
46
46
  } = React__namespace;
47
47
 
48
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
49
- const useId = React__namespace["useId".toString()];
48
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
49
+ const useId = React__namespace[`useId${Math.random()}`.slice(0, 5)];
50
50
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
51
51
 
52
52
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -45,8 +45,8 @@ const {
45
45
  useState
46
46
  } = React__namespace;
47
47
 
48
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
49
- const useId = React__namespace["useId".toString()];
48
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
49
+ const useId = React__namespace[`useId${Math.random()}`.slice(0, 5)];
50
50
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
51
51
 
52
52
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -21,8 +21,8 @@ const {
21
21
  useState
22
22
  } = React;
23
23
 
24
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
25
- const useId = React["useId".toString()];
24
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
25
+ const useId = React[`useId${Math.random()}`.slice(0, 5)];
26
26
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
27
27
 
28
28
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -43,8 +43,8 @@ const {
43
43
  useState
44
44
  } = React__namespace;
45
45
 
46
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
47
- const useId = React__namespace["useId".toString()];
46
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
47
+ const useId = React__namespace[`useId${Math.random()}`.slice(0, 5)];
48
48
 
49
49
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
50
50
 
@@ -19,8 +19,8 @@ const {
19
19
  useState
20
20
  } = React;
21
21
 
22
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
23
- const useId = React["useId".toString()];
22
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
23
+ const useId = React[`useId${Math.random()}`.slice(0, 5)];
24
24
 
25
25
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
26
26
 
@@ -21,8 +21,8 @@ const {
21
21
  useState
22
22
  } = React;
23
23
 
24
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
25
- const useId = React["useId".toString()];
24
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
25
+ const useId = React[`useId${Math.random()}`.slice(0, 5)];
26
26
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
27
27
 
28
28
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
@@ -43,8 +43,8 @@ const {
43
43
  useState
44
44
  } = React__namespace;
45
45
 
46
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
47
- const useId = React__namespace["useId".toString()];
46
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
47
+ const useId = React__namespace[`useId${Math.random()}`.slice(0, 5)];
48
48
 
49
49
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
50
50
 
@@ -19,8 +19,8 @@ const {
19
19
  useState
20
20
  } = React;
21
21
 
22
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
23
- const useId = React["useId".toString()];
22
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
23
+ const useId = React[`useId${Math.random()}`.slice(0, 5)];
24
24
 
25
25
  // The "contextmenu" event is not supported as a PointerEvent in all browsers yet, so MouseEvent still need to be handled
26
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-resizable-panels",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "description": "React components for resizable panel groups/layouts",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
6
6
  "license": "MIT",
@@ -36,8 +36,10 @@ const {
36
36
  useState,
37
37
  } = React;
38
38
 
39
- // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
40
- const useId = (React as any)["useId".toString()] as () => string;
39
+ // `Math.random()` and `.slice(0, 5)` prevents bundlers from trying to `import { useId } from 'react'`
40
+ const useId = (React as any)[
41
+ `useId${Math.random()}`.slice(0, 5)
42
+ ] as () => string;
41
43
 
42
44
  const useLayoutEffect_do_not_use_directly = useLayoutEffect;
43
45