fix: resolve ES modules compatibility in E2E test files

- Replace __dirname with import.meta.url pattern for ES modules compatibility
- Add fileURLToPath imports to all E2E test files
- Fix duplicate require statements in setup-verification.spec.ts
- Update playwright.config.ts to use relative path instead of __dirname

This fixes the 'ReferenceError: __dirname is not defined in ES module scope' error
when running Playwright tests in the ES modules environment.
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 16:18:31 +02:00
parent a5fc85897b
commit baef924cfd
208 changed files with 212092 additions and 19 deletions

21
node_modules/react-remove-scroll/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Anton Korzunov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

153
node_modules/react-remove-scroll/README.md generated vendored Normal file
View File

@@ -0,0 +1,153 @@
<div align="center">
<h1>React-remove-📜</h1>
<br/>
dont even scroll
<br/>
<a href="https://www.npmjs.com/package/react-remove-scroll">
<img src="https://img.shields.io/npm/v/react-remove-scroll.svg?style=flat-square" />
</a>
<a href="https://travis-ci.org/theKashey/react-remove-scroll">
<img src="https://img.shields.io/travis/theKashey/react-remove-scroll.svg?style=flat-square" alt="Build status">
</a>
<a href="https://www.npmjs.com/package/react-remove-scroll">
<img src="https://img.shields.io/npm/dm/react-remove-scroll.svg" alt="npm downloads">
</a>
<a href="https://bundlephobia.com/result?p=react-remove-scroll">
<img src="https://img.shields.io/bundlephobia/minzip/react-remove-scroll.svg" alt="bundle size">
</a>
<br/>
</div>
react-remove-scroll
====
[![NPM version](https://img.shields.io/npm/v/react-remove-scroll.svg)](https://www.npmjs.com/package/react-remove-scroll)
Disables scroll outside of `children` node.
- 🖱 mouse and touch devices friendly
- 📈 vertical and horizontal
- 📜 removes document scroll bar maintaining it space
- ✅ support nested scrollable elements
- 🕳 supports react-portals (uses React Event system)
- ☠️ it could block literally any scroll anywhere
# Usage
Just wrap content, which should be scrollable, and everything else would not.
```js
import {RemoveScroll} from 'react-remove-scroll';
<RemoveScroll>
Only this content would be scrollable
</RemoveScroll>
```
`RemoveScroll` accept following props
- `children`
- `[enabled]` - activate or deactivate component behaviour without removing it.
- `[allowPinchZoom=false]` - enabled "pinch-n-zoom" behavior. By default it might be prevented. However - pinch and zoom might break "scroll isolation", and __disabled by default__.
- `[noRelative=false]` - prevents setting `position: relative` on the body.
- `[noIsolation=false]` - disables outer event capturing. Event capturing is React friendly and unlikely be a problem.
But if you are using _shadowbox_ of some sort - you dont need it.
- `[inert=false]` - ☠️(be careful) disables events the rest of page completely using `pointer-events` except the Lock(+shards).
React portals not friendly, might lead to production issues. Enable only for __rare__ cases, when you have to disable scrollbars somewhere on the page(except body, Lock and shards).
- `[forwardProps]` - will forward all props to the `children`
- `[className]` - className for an internal div
- `[removeScrollBar]` - to control scroll bar removal. Set to false, if you prefer to keep it (wheel and touch scroll is still disabled).
# Size
- (🧩 full) 1.7kb after compression (excluding tslib).
---
- (👁 UI) __400b__, visual elements only
- (🚗 sidecar) 1.5kb, side effects
```js
import {sidecar} from "react-remove-scroll";
import {RemoveScroll} from 'react-remove-scroll/UI';
const sidecar = sidecar(() => import('react-remove-scroll/sidecar'));
<RemoveScroll sideCar={sidecar}>
Will load logic from a sidecar when needed
</RemoveScroll>
```
> Consider setting `-webkit-overflow-scrolling: touch;` on a document level for a proper mobile experience.
## Internal div
By default RemoveScroll will create a div to handle and capture events.
You may specify `className` for it, if you need, or __remove it__.
The following code samples will produce the same output
```js
<RemoveScroll className="scroll">
Only this content would be scrollable
</RemoveScroll>
```
```js
<RemoveScroll forwardProps>
<div className="scroll"> //RemoveScroll will inject props to this div
Only this content would be scrollable
</div>
</RemoveScroll>
```
Pick the first one if you don't need a second.
## Position:fixed elements
To properly size these elements please add a special className to them.
```jsx
import {RemoveScroll} from 'react-remove-scroll';
// to make "width: 100%"
<div className={cx(classWithPositionFixed, RemoveScroll.classNames.fullWidth)} />
// to make "right:0"
<div className={cx(classWithPositionFixed, RemoveScroll.classNames.zeroRight)} />
```
See [react-remove-scroll-bar](https://github.com/theKashey/react-remove-scroll-bar) documentation for details.
## More than one lock
When stacked more is active (default) only one (last) component would be active.
## Over isolation
That could happen -
you disable scroll on the body,
you are suppressing all scroll and wheel events,
and you are ghosting the rest of the page by the `inert` prop.
Only something inside Lock does exists for the browser, and that might be less than you expected.
Dont forget about `shard`, dont forget - `inert` is not portals friendly, dont forget - you dont need over isolation in most of the cases.
> just be careful!
# Performance
To do the job this library setup _non_ passive event listener. Chrome dev tools would complain about it, as a
performance no-op.
We have to use synchronous scroll/touch handler, and it may affect scrolling performance.
Consider using `noIsolation` mode, if you have large scrollable areas.
# Supported React versions
- v1 supports React 15/16
- v2 requires 16.8.0+ (hooks)
# Scroll-Locky
This is a refactoring of another library - [react-scroll-locky](https://github.com/theKashey/react-scroll-locky) -
to make package smaller and more react-portals friendly.
## See also
- [react-focus-on](https://github.com/theKashey/react-focus-on) - Finite Modal creator (uses Scroll-Locky) underneath.
- [react-locky](https://github.com/theKashey/react-locky) - React event canceler
- [react-scrolllock](https://github.com/jossmac/react-scrolllock) - React scroll lock
- [scroll-lock](https://github.com/FL3NKEY/scroll-lock) - DOM scroll lock
- [body-scroll-lock](https://github.com/willmcpo/body-scroll-lock) - DOM scroll lock
> This package is relative smaller(1), more react friendly(2), works with non zero body margins(3), and has a better "overscroll" management.
# License
MIT

1
node_modules/react-remove-scroll/UI/UI.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from '../dist/es2015/UI'

8
node_modules/react-remove-scroll/UI/package.json generated vendored Normal file
View File

@@ -0,0 +1,8 @@
{
"private": true,
"main": "../dist/es5/UI.js",
"jsnext:main": "../dist/es2015/UI.js",
"module": "../dist/es2015/UI.js",
"types": "UI.d.ts",
"sideEffects": false
}

98
node_modules/react-remove-scroll/package.json generated vendored Normal file
View File

@@ -0,0 +1,98 @@
{
"name": "react-remove-scroll",
"version": "2.7.2",
"description": "Disables scroll outside of `children` node.",
"main": "dist/es5/index.js",
"jsnext:main": "dist/es2015/index.js",
"module": "dist/es2015/index.js",
"types": "dist/es5/index.d.ts",
"module:es2019": "dist/es2019/index.js",
"scripts": {
"dev": "lib-builder dev",
"test": "jest",
"test:ci": "jest --runInBand --coverage",
"build": "lib-builder build && yarn size:report",
"release": "yarn build && yarn test",
"size": "size-limit",
"size:report": "size-limit --json > .size.json",
"lint": "lib-builder lint",
"format": "lib-builder format",
"update": "lib-builder update",
"prepublish": "yarn build && yarn changelog",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"storybook": "start-storybook -p 6006"
},
"keywords": [
"scroll"
],
"author": "Anton Korzunov <thekashey@gmail.com>",
"license": "MIT",
"devDependencies": {
"@types/react": "^18.0.0",
"@babel/core": "^7.17.9",
"@size-limit/preset-small-lib": "^11.0.2",
"size-limit": "^11.0.2",
"@storybook/react": "^6.4.22",
"@theuiteam/lib-builder": "^0.1.4",
"@types/enzyme-adapter-react-16": "^1.0.6",
"babel-loader": "^8.2.4",
"enzyme-adapter-react-16": "^1.15.6"
},
"resolutions": {
"@types/react": "^18.0.0",
"tslib": "^2.1.0"
},
"engines": {
"node": ">=10"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"files": [
"dist",
"UI",
"sidecar"
],
"repository": "https://github.com/theKashey/react-remove-scroll",
"dependencies": {
"react-remove-scroll-bar": "^2.3.7",
"react-style-singleton": "^2.2.3",
"tslib": "^2.1.0",
"use-callback-ref": "^1.3.3",
"use-sidecar": "^1.1.3"
},
"sideEffects": [
"**/sidecar.js"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"eslint --fix",
"git add"
],
"*.{js,css,json,md}": [
"prettier --write",
"git add"
]
},
"prettier": {
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
},
"packageManager": "yarn@1.22.19"
}

View File

@@ -0,0 +1,7 @@
{
"private": true,
"main": "../dist/es5/sidecar.js",
"jsnext:main": "../dist/es2015/sidecar.js",
"module": "../dist/es2015/sidecar.js",
"types": "sidecar.d.ts"
}

View File

@@ -0,0 +1,5 @@
import * as React from 'react';
declare let sidecar: React.FC;
export default sidecar;