change resolution algo, update eslint, lint and prettier commands

This commit is contained in:
Rene Haas
2022-10-01 02:31:32 +02:00
parent eb99eba55e
commit 64a0d873f4
117 changed files with 900 additions and 508 deletions
+58 -46
View File
@@ -1,13 +1,48 @@
const resolve = require('@~local/config/resolve'); const defaultRules = {
'func-names': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'no-param-reassign': 'off',
'no-nested-ternary': 'off',
'no-underscore-dangle': 'off',
'no-multi-assign': 'off',
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-empty': ['error', { allowEmptyCatch: true }],
'no-cond-assign': ['error', 'except-parens'],
camelcase: ['error', { allow: ['^__', '^UNSAFE_'] }],
'prefer-destructuring': 'off',
'consistent-return': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/extensions': [
'off',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'index', 'internal', 'unknown', 'type'],
pathGroups: [
{
pattern: '**/*.{css,scss,sass}',
group: 'unknown',
position: 'after',
},
],
},
],
};
module.exports = { module.exports = {
extends: ['airbnb', 'prettier'], extends: ['airbnb', 'prettier'],
env: { plugins: ['prettier', 'json', '@typescript-eslint', 'import'],
browser: true,
es2020: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
ecmaFeatures: { ecmaFeatures: {
@@ -16,59 +51,35 @@ module.exports = {
ecmaVersion: 11, ecmaVersion: 11,
sourceType: 'module', sourceType: 'module',
}, },
env: {
browser: true,
es2020: true,
node: true,
jest: true,
},
settings: { settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': { 'import/resolver': {
node: { typescript: {
extensions: resolve.extensions, alwaysTryTypes: true,
moduleDirectory: resolve.directories, project: ['./packages/**/tsconfig.json', './local/**/tsconfig.json'],
}, },
}, },
}, },
plugins: ['prettier', 'json', 'react', 'jest', 'import', '@typescript-eslint'], rules: defaultRules,
rules: {
'func-names': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'no-param-reassign': 'off',
'no-nested-ternary': 'off',
'no-underscore-dangle': 'off',
'no-multi-assign': 'off',
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-empty': ['error', { allowEmptyCatch: true }],
'no-cond-assign': ['error', 'except-parens'],
camelcase: ['error', { allow: ['^__', '^UNSAFE_'] }],
'prefer-destructuring': 'off',
'consistent-return': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': [
'error',
{
ignore: [`^@/.*`],
},
],
'import/extensions': [
'off',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
overrides: [ overrides: [
{ {
files: ['*.ts', '*.tsx', '*.d.ts'], files: ['*.ts', '*.tsx', '*.d.ts'],
extends: ['plugin:@typescript-eslint/recommended', 'plugin:react/recommended'], extends: ['plugin:@typescript-eslint/recommended', 'airbnb', 'prettier'],
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
tsconfigRootDir: __dirname, tsconfigRootDir: __dirname,
project: ['./packages/**/tsconfig.json', './local/**/tsconfig.json'], project: ['./packages/**/tsconfig.json', './local/**/tsconfig.json'],
}, },
rules: { rules: {
...defaultRules,
'no-shadow': 'off', 'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'], '@typescript-eslint/no-shadow': ['error'],
'no-use-before-define': 'off', 'no-use-before-define': 'off',
@@ -83,6 +94,7 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/unbound-method': 'off', '@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/no-this-alias': [ '@typescript-eslint/no-this-alias': [
'error', 'error',
{ {
-1
View File
@@ -3,7 +3,6 @@
"tabWidth": 2, "tabWidth": 2,
"singleQuote": true, "singleQuote": true,
"trailingComma": "es5", "trailingComma": "es5",
"jsxBracketSameLine": true,
"arrowParens": "always", "arrowParens": "always",
"endOfLine": "lf", "endOfLine": "lf",
"parser": "babel-ts", "parser": "babel-ts",
+3
View File
@@ -4,6 +4,7 @@ const resolve = require('./resolve');
// For a detailed explanation regarding each configuration property, visit: // For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html // https://jestjs.io/docs/en/configuration.html
/** @type {import('jest').Config} */
module.exports = { module.exports = {
coverageDirectory: './.coverage/jest', coverageDirectory: './.coverage/jest',
projects: [ projects: [
@@ -16,6 +17,7 @@ module.exports = {
moduleFileExtensions: resolve.extensions.map((ext) => ext.replace(/\./, '')), moduleFileExtensions: resolve.extensions.map((ext) => ext.replace(/\./, '')),
testPathIgnorePatterns: ['\\\\node_modules\\\\'], testPathIgnorePatterns: ['\\\\node_modules\\\\'],
setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.js')], setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.js')],
...resolve.paths.jest,
}, },
{ {
displayName: 'jsdom', displayName: 'jsdom',
@@ -26,6 +28,7 @@ module.exports = {
moduleFileExtensions: resolve.extensions.map((ext) => ext.replace(/\./, '')), moduleFileExtensions: resolve.extensions.map((ext) => ext.replace(/\./, '')),
testPathIgnorePatterns: ['\\\\node_modules\\\\'], testPathIgnorePatterns: ['\\\\node_modules\\\\'],
setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.js')], setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.js')],
...resolve.paths.jest,
}, },
], ],
}; };
+15 -2
View File
@@ -1,5 +1,18 @@
{ {
"extensions": [".json", ".js", ".jsx", ".cjs", ".mjs", ".ts", ".tsx"], "extensions": [".json", ".js", ".jsx", ".cjs", ".mjs", ".ts", ".tsx"],
"directories": ["node_modules", "src"], "styleExtensions": [".scss", ".sass", ".css"],
"styleExtensions": [".scss", ".sass", ".css"] "directories": ["node_modules"],
"paths": {
"jest": {
"moduleNameMapper": {
"^~/(.*)": "<rootDir>/src/$1"
}
},
"rollupAlias": {
"^~/(.*)": "<rootDir>/src/$1"
},
"rollupTypes": {
"~/*": ["<typesDir>/*"]
}
}
} }
+17 -2
View File
@@ -19,9 +19,24 @@ const normalizePath = (pathName) =>
pathName ? pathName.split(path.sep).join(path.posix.sep) : pathName; pathName ? pathName.split(path.sep).join(path.posix.sep) : pathName;
module.exports = { module.exports = {
rollupAlias: (aliasEntries) => rollupAlias: (resolve, aliasEntries) =>
rollupPluginAlias({ rollupPluginAlias({
entries: aliasEntries, entries: [
...Object.entries(aliasEntries).reduce((arr, [key, value]) => {
arr.push({
find: key,
replacement: value,
});
return arr;
}, []),
...Object.entries(resolve.paths.rollupAlias).reduce((arr, [key, value]) => {
arr.push({
find: new RegExp(key),
replacement: value.replace('<rootDir>', normalizePath(process.cwd())),
});
return arr;
}, []),
],
}), }),
rollupCommonjs: (sourcemap, resolve) => rollupCommonjs: (sourcemap, resolve) =>
rollupPluginCommonjs({ rollupPluginCommonjs({
+1 -1
View File
@@ -64,7 +64,7 @@ module.exports = (resolve, options) => {
...rollupOptions, ...rollupOptions,
plugins: [ plugins: [
rollupLicense(banner, sourcemap), rollupLicense(banner, sourcemap),
rollupAlias(alias), rollupAlias(resolve, alias),
rollupScss(resolve, sourcemap, extractStyles, false), rollupScss(resolve, sourcemap, extractStyles, false),
rollupTs(input), rollupTs(input),
rollupResolve(resolve), rollupResolve(resolve),
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = (resolve, options) => {
...rollupOptions, ...rollupOptions,
plugins: [ plugins: [
rollupLicense(banner, sourcemap), rollupLicense(banner, sourcemap),
rollupAlias(alias), rollupAlias(resolve, alias),
rollupScss(resolve, sourcemap, extractStyles, false), rollupScss(resolve, sourcemap, extractStyles, false),
rollupEsBuild(sourcemap), rollupEsBuild(sourcemap),
rollupCommonjs(sourcemap, resolve), rollupCommonjs(sourcemap, resolve),
+1 -1
View File
@@ -11,7 +11,7 @@ module.exports = (resolve, options) => {
const pipeline = (cssFilename, minified) => ({ const pipeline = (cssFilename, minified) => ({
input, input,
plugins: [ plugins: [
rollupAlias(alias), rollupAlias(resolve, alias),
rollupScss( rollupScss(
resolve, resolve,
sourcemap && !minified, sourcemap && !minified,
+8 -1
View File
@@ -23,6 +23,7 @@ module.exports = (resolve, options) => {
output: { output: {
file: path.resolve(typesPath, `${file}`), file: path.resolve(typesPath, `${file}`),
}, },
external: [...resolve.styleExtensions.map((ext) => new RegExp(`.*\\${ext}`))],
plugins: [rollupTs(input, true)], plugins: [rollupTs(input, true)],
}, },
{ {
@@ -30,11 +31,17 @@ module.exports = (resolve, options) => {
output: { output: {
file: dtsOutput, file: dtsOutput,
}, },
external: [...resolve.styleExtensions.map((ext) => new RegExp(`.*\\${ext}`))],
plugins: [ plugins: [
rollupDts.default({ rollupDts.default({
respectExternal: true, respectExternal: true,
compilerOptions: { compilerOptions: {
baseUrl: typesPath, paths: {
...Object.entries(resolve.paths.rollupTypes).reduce((obj, [key, value]) => {
obj[key] = value.map((entry) => entry.replace('<typesDir>', typesPath));
return obj;
}, {}),
},
}, },
}), }),
{ {
+331 -12
View File
@@ -36,13 +36,12 @@
"eslint": "^8.20.0", "eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.1",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.8.0", "eslint-plugin-jest": "^26.8.0",
"eslint-plugin-json": "^3.1.0", "eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.6.1", "eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.6.0",
"glob": "^7.1.6", "glob": "^7.1.6",
"istanbul-lib-instrument": "^5.2.0", "istanbul-lib-instrument": "^5.2.0",
"jest": "^28.1.3", "jest": "^28.1.3",
@@ -2448,6 +2447,26 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/@pkgr/utils": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz",
"integrity": "sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.3",
"is-glob": "^4.0.3",
"open": "^8.4.0",
"picocolors": "^1.0.0",
"tiny-glob": "^0.2.9",
"tslib": "^2.4.0"
},
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/unts"
}
},
"node_modules/@playwright/test": { "node_modules/@playwright/test": {
"version": "1.22.2", "version": "1.22.2",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz",
@@ -3513,6 +3532,7 @@
"resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz",
"integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@@ -4475,6 +4495,15 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/define-lazy-prop": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/define-properties": { "node_modules/define-properties": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
@@ -5314,6 +5343,62 @@
"ms": "^2.1.1" "ms": "^2.1.1"
} }
}, },
"node_modules/eslint-import-resolver-typescript": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.1.tgz",
"integrity": "sha512-U7LUjNJPYjNsHvAUAkt/RU3fcTSpbllA0//35B4eLYTX74frmOepbt7F7J3D1IGtj9k21buOpaqtDd4ZlS/BYQ==",
"dev": true,
"dependencies": {
"debug": "^4.3.4",
"enhanced-resolve": "^5.10.0",
"get-tsconfig": "^4.2.0",
"globby": "^13.1.2",
"is-core-module": "^2.10.0",
"is-glob": "^4.0.3",
"synckit": "^0.8.3"
},
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/unts"
},
"peerDependencies": {
"eslint": "*",
"eslint-plugin-import": "*"
}
},
"node_modules/eslint-import-resolver-typescript/node_modules/globby": {
"version": "13.1.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz",
"integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==",
"dev": true,
"dependencies": {
"dir-glob": "^3.0.1",
"fast-glob": "^3.2.11",
"ignore": "^5.2.0",
"merge2": "^1.4.1",
"slash": "^4.0.0"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint-import-resolver-typescript/node_modules/slash": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
"integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint-module-utils": { "node_modules/eslint-module-utils": {
"version": "2.7.3", "version": "2.7.3",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz",
@@ -5547,6 +5632,7 @@
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.30.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.30.0.tgz",
"integrity": "sha512-RgwH7hjW48BleKsYyHK5vUAvxtE9SMPDKmcPRQgtRCYaZA0XQPt5FSkrU3nhz5ifzMZcA8opwmRJ2cmOO8tr5A==", "integrity": "sha512-RgwH7hjW48BleKsYyHK5vUAvxtE9SMPDKmcPRQgtRCYaZA0XQPt5FSkrU3nhz5ifzMZcA8opwmRJ2cmOO8tr5A==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"array-includes": "^3.1.5", "array-includes": "^3.1.5",
"array.prototype.flatmap": "^1.3.0", "array.prototype.flatmap": "^1.3.0",
@@ -5575,6 +5661,7 @@
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz",
"integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==",
"dev": true, "dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=10" "node": ">=10"
}, },
@@ -5587,6 +5674,7 @@
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"esutils": "^2.0.2" "esutils": "^2.0.2"
}, },
@@ -5599,6 +5687,7 @@
"resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz",
"integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"is-core-module": "^2.9.0", "is-core-module": "^2.9.0",
"path-parse": "^1.0.7", "path-parse": "^1.0.7",
@@ -6237,6 +6326,15 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/get-tsconfig": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.2.0.tgz",
"integrity": "sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==",
"dev": true,
"funding": {
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/glob": { "node_modules/glob": {
"version": "7.2.3", "version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -6284,6 +6382,12 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/globalyzer": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
"dev": true
},
"node_modules/globby": { "node_modules/globby": {
"version": "11.1.0", "version": "11.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
@@ -6304,6 +6408,12 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/globrex": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
"dev": true
},
"node_modules/graceful-fs": { "node_modules/graceful-fs": {
"version": "4.2.10", "version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
@@ -6667,9 +6777,9 @@
} }
}, },
"node_modules/is-core-module": { "node_modules/is-core-module": {
"version": "2.9.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz",
"integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"has": "^1.0.3" "has": "^1.0.3"
@@ -6693,6 +6803,21 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/is-docker": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
"dev": true,
"bin": {
"is-docker": "cli.js"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-extglob": { "node_modules/is-extglob": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -6886,6 +7011,18 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/is-wsl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"dev": true,
"dependencies": {
"is-docker": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/isexe": { "node_modules/isexe": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -8302,6 +8439,7 @@
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"js-tokens": "^3.0.0 || ^4.0.0" "js-tokens": "^3.0.0 || ^4.0.0"
}, },
@@ -8719,6 +8857,7 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"dev": true, "dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@@ -8778,6 +8917,7 @@
"resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz",
"integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@@ -8795,6 +8935,7 @@
"resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz", "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz",
"integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==", "integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"define-properties": "^1.1.4", "define-properties": "^1.1.4",
"es-abstract": "^1.19.5" "es-abstract": "^1.19.5"
@@ -8844,6 +8985,23 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/open": {
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
"integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
"dev": true,
"dependencies": {
"define-lazy-prop": "^2.0.0",
"is-docker": "^2.1.1",
"is-wsl": "^2.2.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/opener": { "node_modules/opener": {
"version": "1.5.2", "version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
@@ -9798,6 +9956,7 @@
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"loose-envify": "^1.4.0", "loose-envify": "^1.4.0",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
@@ -9808,7 +9967,8 @@
"version": "16.13.1", "version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
"dev": true "dev": true,
"peer": true
}, },
"node_modules/psl": { "node_modules/psl": {
"version": "1.8.0", "version": "1.8.0",
@@ -10774,6 +10934,7 @@
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz",
"integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@@ -10947,6 +11108,22 @@
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
"dev": true "dev": true
}, },
"node_modules/synckit": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.4.tgz",
"integrity": "sha512-Dn2ZkzMdSX827QbowGbU/4yjWuvNaCoScLLoMo/yKbu+P4GBR6cRGKZH27k6a9bRzdqcyd1DE96pQtQ6uNkmyw==",
"dev": true,
"dependencies": {
"@pkgr/utils": "^2.3.1",
"tslib": "^2.4.0"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/unts"
}
},
"node_modules/tapable": { "node_modules/tapable": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
@@ -11082,6 +11259,16 @@
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true "dev": true
}, },
"node_modules/tiny-glob": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
"dev": true,
"dependencies": {
"globalyzer": "0.1.0",
"globrex": "^0.1.2"
}
},
"node_modules/tmpl": { "node_modules/tmpl": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
@@ -11760,7 +11947,7 @@
} }
}, },
"packages/overlayscrollbars": { "packages/overlayscrollbars": {
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"license": "MIT" "license": "MIT"
} }
}, },
@@ -13457,6 +13644,20 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@pkgr/utils": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz",
"integrity": "sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
"is-glob": "^4.0.3",
"open": "^8.4.0",
"picocolors": "^1.0.0",
"tiny-glob": "^0.2.9",
"tslib": "^2.4.0"
}
},
"@playwright/test": { "@playwright/test": {
"version": "1.22.2", "version": "1.22.2",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz",
@@ -14294,6 +14495,7 @@
"resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz",
"integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@@ -15017,6 +15219,12 @@
"strip-bom": "^4.0.0" "strip-bom": "^4.0.0"
} }
}, },
"define-lazy-prop": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
"dev": true
},
"define-properties": { "define-properties": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
@@ -15600,6 +15808,42 @@
} }
} }
}, },
"eslint-import-resolver-typescript": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.1.tgz",
"integrity": "sha512-U7LUjNJPYjNsHvAUAkt/RU3fcTSpbllA0//35B4eLYTX74frmOepbt7F7J3D1IGtj9k21buOpaqtDd4ZlS/BYQ==",
"dev": true,
"requires": {
"debug": "^4.3.4",
"enhanced-resolve": "^5.10.0",
"get-tsconfig": "^4.2.0",
"globby": "^13.1.2",
"is-core-module": "^2.10.0",
"is-glob": "^4.0.3",
"synckit": "^0.8.3"
},
"dependencies": {
"globby": {
"version": "13.1.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz",
"integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==",
"dev": true,
"requires": {
"dir-glob": "^3.0.1",
"fast-glob": "^3.2.11",
"ignore": "^5.2.0",
"merge2": "^1.4.1",
"slash": "^4.0.0"
}
},
"slash": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
"integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==",
"dev": true
}
}
},
"eslint-module-utils": { "eslint-module-utils": {
"version": "2.7.3", "version": "2.7.3",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz",
@@ -15771,6 +16015,7 @@
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.30.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.30.0.tgz",
"integrity": "sha512-RgwH7hjW48BleKsYyHK5vUAvxtE9SMPDKmcPRQgtRCYaZA0XQPt5FSkrU3nhz5ifzMZcA8opwmRJ2cmOO8tr5A==", "integrity": "sha512-RgwH7hjW48BleKsYyHK5vUAvxtE9SMPDKmcPRQgtRCYaZA0XQPt5FSkrU3nhz5ifzMZcA8opwmRJ2cmOO8tr5A==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"array-includes": "^3.1.5", "array-includes": "^3.1.5",
"array.prototype.flatmap": "^1.3.0", "array.prototype.flatmap": "^1.3.0",
@@ -15793,6 +16038,7 @@
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"esutils": "^2.0.2" "esutils": "^2.0.2"
} }
@@ -15802,6 +16048,7 @@
"resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz",
"integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"is-core-module": "^2.9.0", "is-core-module": "^2.9.0",
"path-parse": "^1.0.7", "path-parse": "^1.0.7",
@@ -15815,6 +16062,7 @@
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz",
"integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==",
"dev": true, "dev": true,
"peer": true,
"requires": {} "requires": {}
}, },
"eslint-scope": { "eslint-scope": {
@@ -16221,6 +16469,12 @@
"get-intrinsic": "^1.1.1" "get-intrinsic": "^1.1.1"
} }
}, },
"get-tsconfig": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.2.0.tgz",
"integrity": "sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==",
"dev": true
},
"glob": { "glob": {
"version": "7.2.3", "version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -16256,6 +16510,12 @@
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true "dev": true
}, },
"globalyzer": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
"dev": true
},
"globby": { "globby": {
"version": "11.1.0", "version": "11.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
@@ -16270,6 +16530,12 @@
"slash": "^3.0.0" "slash": "^3.0.0"
} }
}, },
"globrex": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
"dev": true
},
"graceful-fs": { "graceful-fs": {
"version": "4.2.10", "version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
@@ -16532,9 +16798,9 @@
"dev": true "dev": true
}, },
"is-core-module": { "is-core-module": {
"version": "2.9.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz",
"integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==",
"dev": true, "dev": true,
"requires": { "requires": {
"has": "^1.0.3" "has": "^1.0.3"
@@ -16549,6 +16815,12 @@
"has-tostringtag": "^1.0.0" "has-tostringtag": "^1.0.0"
} }
}, },
"is-docker": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
"dev": true
},
"is-extglob": { "is-extglob": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -16682,6 +16954,15 @@
"integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
"dev": true "dev": true
}, },
"is-wsl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"dev": true,
"requires": {
"is-docker": "^2.0.0"
}
},
"isexe": { "isexe": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -17770,6 +18051,7 @@
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"js-tokens": "^3.0.0 || ^4.0.0" "js-tokens": "^3.0.0 || ^4.0.0"
} }
@@ -18095,7 +18377,8 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"dev": true "dev": true,
"peer": true
}, },
"object-inspect": { "object-inspect": {
"version": "1.12.2", "version": "1.12.2",
@@ -18137,6 +18420,7 @@
"resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz",
"integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@@ -18148,6 +18432,7 @@
"resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz", "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz",
"integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==", "integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"define-properties": "^1.1.4", "define-properties": "^1.1.4",
"es-abstract": "^1.19.5" "es-abstract": "^1.19.5"
@@ -18182,6 +18467,17 @@
"mimic-fn": "^2.1.0" "mimic-fn": "^2.1.0"
} }
}, },
"open": {
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
"integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
"dev": true,
"requires": {
"define-lazy-prop": "^2.0.0",
"is-docker": "^2.1.1",
"is-wsl": "^2.2.0"
}
},
"opener": { "opener": {
"version": "1.5.2", "version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
@@ -18808,6 +19104,7 @@
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"loose-envify": "^1.4.0", "loose-envify": "^1.4.0",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
@@ -18818,7 +19115,8 @@
"version": "16.13.1", "version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
"dev": true "dev": true,
"peer": true
} }
} }
}, },
@@ -19586,6 +19884,7 @@
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz",
"integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@@ -19710,6 +20009,16 @@
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
"dev": true "dev": true
}, },
"synckit": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.4.tgz",
"integrity": "sha512-Dn2ZkzMdSX827QbowGbU/4yjWuvNaCoScLLoMo/yKbu+P4GBR6cRGKZH27k6a9bRzdqcyd1DE96pQtQ6uNkmyw==",
"dev": true,
"requires": {
"@pkgr/utils": "^2.3.1",
"tslib": "^2.4.0"
}
},
"tapable": { "tapable": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
@@ -19799,6 +20108,16 @@
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true "dev": true
}, },
"tiny-glob": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
"dev": true,
"requires": {
"globalyzer": "0.1.0",
"globrex": "^0.1.2"
}
},
"tmpl": { "tmpl": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
+3 -3
View File
@@ -32,13 +32,12 @@
"eslint": "^8.20.0", "eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.1",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.8.0", "eslint-plugin-jest": "^26.8.0",
"eslint-plugin-json": "^3.1.0", "eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.6.1", "eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.6.0",
"glob": "^7.1.6", "glob": "^7.1.6",
"istanbul-lib-instrument": "^5.2.0", "istanbul-lib-instrument": "^5.2.0",
"jest": "^28.1.3", "jest": "^28.1.3",
@@ -74,6 +73,7 @@
"playwright": "npm run playwright --workspace=overlayscrollbars", "playwright": "npm run playwright --workspace=overlayscrollbars",
"playwright:dev": "npm run test:playwright:dev --workspace=overlayscrollbars", "playwright:dev": "npm run test:playwright:dev --workspace=overlayscrollbars",
"build": "npm run build --workspace=overlayscrollbars", "build": "npm run build --workspace=overlayscrollbars",
"lint": "npx eslint --fix ." "lint": "eslint ./packages/overlayscrollbars/{src,tests}/**/*.{js,jsx,ts,tsx}",
"prettier": "prettier --check ./packages/overlayscrollbars/{src,tests}/**/*.{js,jsx,ts,tsx}"
} }
} }
+17 -14
View File
@@ -8,7 +8,6 @@ import {
absoluteCoordinates, absoluteCoordinates,
offsetSize, offsetSize,
scrollLeft, scrollLeft,
XY,
removeAttr, removeAttr,
removeElements, removeElements,
equalBCRWH, equalBCRWH,
@@ -18,18 +17,20 @@ import {
createCache, createCache,
equalXY, equalXY,
createEventListenerHub, createEventListenerHub,
EventListener, } from '~/support';
} from 'support';
import { import {
classNameEnvironment, classNameEnvironment,
classNameEnvironmentFlexboxGlue, classNameEnvironmentFlexboxGlue,
classNameEnvironmentFlexboxGlueMax, classNameEnvironmentFlexboxGlueMax,
classNameViewportScrollbarHidden, classNameViewportScrollbarHidden,
} from 'classnames'; } from '~/classnames';
import { Options, defaultOptions } from 'options'; import { defaultOptions } from '~/options';
import { DeepPartial } from 'typings'; import { getPlugins, scrollbarsHidingPluginName } from '~/plugins';
import { Initialization } from 'initialization'; import type { XY, EventListener } from '~/support';
import { getPlugins, ScrollbarsHidingPluginInstance, scrollbarsHidingPluginName } from 'plugins'; import type { Options } from '~/options';
import type { DeepPartial } from '~/typings';
import type { ScrollbarsHidingPluginInstance } from '~/plugins';
import type { Initialization } from '~/initialization';
type EnvironmentEventMap = { type EnvironmentEventMap = {
_: []; _: [];
@@ -178,15 +179,17 @@ const createEnvironment = (): InternalEnvironment => {
_rtlScrollBehavior: getRtlScrollBehavior(envElm, envChildElm), _rtlScrollBehavior: getRtlScrollBehavior(envElm, envChildElm),
_flexboxGlue: getFlexboxGlue(envElm, envChildElm), _flexboxGlue: getFlexboxGlue(envElm, envChildElm),
_addListener: (listener) => addEvent('_', listener), _addListener: (listener) => addEvent('_', listener),
_getDefaultInitialization: assignDeep<Initialization, Initialization>.bind( _getDefaultInitialization: (
0, assignDeep as typeof assignDeep<Initialization, Initialization>
{} as Initialization, ).bind(0, {} as Initialization, staticDefaultInitialization),
staticDefaultInitialization
),
_setDefaultInitialization(newInitializationStrategy) { _setDefaultInitialization(newInitializationStrategy) {
assignDeep(staticDefaultInitialization, newInitializationStrategy); assignDeep(staticDefaultInitialization, newInitializationStrategy);
}, },
_getDefaultOptions: assignDeep<Options, Options>.bind(0, {} as Options, staticDefaultOptions), _getDefaultOptions: (assignDeep as typeof assignDeep<Options, Options>).bind(
0,
{} as Options,
staticDefaultOptions
),
_setDefaultOptions(newDefaultOptions) { _setDefaultOptions(newDefaultOptions) {
assignDeep(staticDefaultOptions, newDefaultOptions); assignDeep(staticDefaultOptions, newDefaultOptions);
}, },
@@ -1,10 +1,10 @@
import type { OverlayScrollbars } from 'overlayscrollbars'; import type { OverlayScrollbars } from '~/overlayscrollbars';
import type { DeepPartial } from 'typings'; import type { DeepPartial } from '~/typings';
import type { Options } from 'options'; import type { Options } from '~/options';
import type { import type {
InitialEventListeners as GeneralInitialEventListeners, InitialEventListeners as GeneralInitialEventListeners,
EventListener as GeneralEventListener, EventListener as GeneralEventListener,
} from 'support/eventListeners'; } from '~/support/eventListeners';
export interface OnUpdatedEventListenerArgs { export interface OnUpdatedEventListenerArgs {
updateHints: { updateHints: {
+7 -7
View File
@@ -1,20 +1,20 @@
import 'index.scss'; import '~/index.scss';
export { OverlayScrollbars } from 'overlayscrollbars'; export { OverlayScrollbars } from '~/overlayscrollbars';
export { ScrollbarsHidingPlugin, SizeObserverPlugin, ClickScrollPlugin } from 'plugins'; export { ScrollbarsHidingPlugin, SizeObserverPlugin, ClickScrollPlugin } from '~/plugins';
export type { export type {
Options, Options,
OverflowBehavior, OverflowBehavior,
ScrollbarVisibilityBehavior, ScrollbarVisibilityBehavior,
ScrollbarAutoHideBehavior, ScrollbarAutoHideBehavior,
} from 'options'; } from '~/options';
export type { export type {
EventListenerMap, EventListenerMap,
EventListener, EventListener,
InitialEventListeners, InitialEventListeners,
OnUpdatedEventListenerArgs, OnUpdatedEventListenerArgs,
} from 'eventListeners'; } from '~/eventListeners';
export type { export type {
Initialization, Initialization,
InitializationTarget, InitializationTarget,
@@ -22,5 +22,5 @@ export type {
InitializationTargetObject, InitializationTargetObject,
StaticInitializationElement, StaticInitializationElement,
DynamicInitializationElement, DynamicInitializationElement,
} from 'initialization'; } from '~/initialization';
export type { Plugin, PluginInstance } from 'plugins'; export type { Plugin, PluginInstance } from '~/plugins';
@@ -1,6 +1,6 @@
import { isFunction, isHTMLElement, isNull, isUndefined } from 'support'; import { isFunction, isHTMLElement, isNull, isUndefined } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import type { DeepPartial } from 'typings'; import type { DeepPartial } from '~/typings';
type StaticInitialization = HTMLElement | false | null; type StaticInitialization = HTMLElement | false | null;
type DynamicInitialization = HTMLElement | boolean | null; type DynamicInitialization = HTMLElement | boolean | null;
+1 -1
View File
@@ -1,4 +1,4 @@
import { OverlayScrollbars } from 'overlayscrollbars'; import type { OverlayScrollbars } from '~/overlayscrollbars';
const targetInstanceMap: WeakMap<Element, OverlayScrollbars> = new WeakMap(); const targetInstanceMap: WeakMap<Element, OverlayScrollbars> = new WeakMap();
@@ -13,7 +13,7 @@ import {
push, push,
from, from,
runEachAndClear, runEachAndClear,
} from 'support'; } from '~/support';
type DOMContentObserverCallback = (contentChangedThroughEvent: boolean) => any; type DOMContentObserverCallback = (contentChangedThroughEvent: boolean) => any;
@@ -1,3 +1,3 @@
export * from 'observers/domObserver'; export * from '~/observers/domObserver';
export * from 'observers/sizeObserver'; export * from '~/observers/sizeObserver';
export * from 'observers/trinsicObserver'; export * from '~/observers/trinsicObserver';
@@ -1,5 +1,4 @@
import { import {
CacheValues,
createCache, createCache,
createDOM, createDOM,
scrollLeft, scrollLeft,
@@ -17,15 +16,16 @@ import {
stopPropagation, stopPropagation,
appendChildren, appendChildren,
directionIsRTL, directionIsRTL,
} from 'support'; } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { import {
classNameSizeObserver, classNameSizeObserver,
classNameSizeObserverAppear, classNameSizeObserverAppear,
classNameSizeObserverListener, classNameSizeObserverListener,
} from 'classnames'; } from '~/classnames';
import { getPlugins, sizeObserverPluginName } from 'plugins'; import { getPlugins, sizeObserverPluginName } from '~/plugins';
import type { SizeObserverPluginInstance } from 'plugins'; import type { CacheValues } from '~/support';
import type { SizeObserverPluginInstance } from '~/plugins';
export interface SizeObserverOptions { export interface SizeObserverOptions {
_direction?: boolean; _direction?: boolean;
@@ -1,6 +1,4 @@
import { import {
WH,
CacheValues,
createDiv, createDiv,
offsetSize, offsetSize,
runEachAndClear, runEachAndClear,
@@ -9,9 +7,10 @@ import {
push, push,
IntersectionObserverConstructor, IntersectionObserverConstructor,
appendChildren, appendChildren,
} from 'support'; } from '~/support';
import { createSizeObserver } from 'observers/sizeObserver'; import { createSizeObserver } from '~/observers/sizeObserver';
import { classNameTrinsicObserver } from 'classnames'; import { classNameTrinsicObserver } from '~/classnames';
import type { WH, CacheValues } from '~/support';
export type TrinsicObserverCallback = (heightIntrinsic: CacheValues<boolean>) => any; export type TrinsicObserverCallback = (heightIntrinsic: CacheValues<boolean>) => any;
export type TrinsicObserver = [ export type TrinsicObserver = [
+2 -2
View File
@@ -7,8 +7,8 @@ import {
hasOwnProperty, hasOwnProperty,
isFunction, isFunction,
isEmptyObject, isEmptyObject,
} from 'support'; } from '~/support';
import { DeepPartial, DeepReadonly } from 'typings'; import type { DeepPartial, DeepReadonly } from '~/typings';
const opsStringify = (value: any) => const opsStringify = (value: any) =>
JSON.stringify(value, (_, val) => { JSON.stringify(value, (_, val) => {
@@ -7,23 +7,23 @@ import {
isHTMLElement, isHTMLElement,
createEventListenerHub, createEventListenerHub,
isPlainObject, isPlainObject,
} from 'support'; } from '~/support';
import { getOptionsDiff } from 'options'; import { getOptionsDiff } from '~/options';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { cancelInitialization } from 'initialization'; import { cancelInitialization } from '~/initialization';
import { addInstance, getInstance, removeInstance } from 'instances'; import { addInstance, getInstance, removeInstance } from '~/instances';
import { createStructureSetup, createScrollbarsSetup } from 'setups'; import { createStructureSetup, createScrollbarsSetup } from '~/setups';
import { getPlugins, addPlugin, optionsValidationPluginName, PluginInstance } from 'plugins'; import { getPlugins, addPlugin, optionsValidationPluginName } from '~/plugins';
import type { XY, TRBL } from 'support'; import type { XY, TRBL } from '~/support';
import type { Options, ReadonlyOptions } from 'options'; import type { Options, ReadonlyOptions } from '~/options';
import type { Plugin, OptionsValidationPluginInstance } from 'plugins'; import type { Plugin, OptionsValidationPluginInstance, PluginInstance } from '~/plugins';
import type { InitializationTarget, Initialization } from 'initialization'; import type { InitializationTarget, Initialization } from '~/initialization';
import type { DeepPartial, OverflowStyle } from 'typings'; import type { DeepPartial, OverflowStyle } from '~/typings';
import type { EventListenerMap, EventListener, InitialEventListeners } from 'eventListeners'; import type { EventListenerMap, EventListener, InitialEventListeners } from '~/eventListeners';
import type { import type {
ScrollbarsSetupElement, ScrollbarsSetupElement,
ScrollbarStructure, ScrollbarStructure,
} from 'setups/scrollbarsSetup/scrollbarsSetup.elements'; } from '~/setups/scrollbarsSetup/scrollbarsSetup.elements';
// Notes: // Notes:
// Height intrinsic detection use "content: true" init strategy - or open ticket for custom height intrinsic observer // Height intrinsic detection use "content: true" init strategy - or open ticket for custom height intrinsic observer
@@ -1,5 +1,5 @@
import { animateNumber, noop } from 'support'; import { animateNumber, noop } from '~/support';
import type { Plugin } from 'plugins'; import type { Plugin } from '~/plugins';
export type ClickScrollPluginInstance = { export type ClickScrollPluginInstance = {
_: ( _: (
@@ -1 +1 @@
export * from 'plugins/clickScrollPlugin/clickScrollPlugin'; export * from '~/plugins/clickScrollPlugin/clickScrollPlugin';
@@ -1,5 +1,5 @@
export * from './plugins'; export * from '~/plugins/plugins';
export * from './optionsValidationPlugin'; export * from '~/plugins/optionsValidationPlugin';
export * from './sizeObserverPlugin'; export * from '~/plugins/sizeObserverPlugin';
export * from './scrollbarsHidingPlugin'; export * from '~/plugins/scrollbarsHidingPlugin';
export * from './clickScrollPlugin'; export * from '~/plugins/clickScrollPlugin';
@@ -1 +1 @@
export * from 'plugins/optionsValidationPlugin/optionsValidationPlugin'; export * from '~/plugins/optionsValidationPlugin/optionsValidationPlugin';
@@ -1,17 +1,19 @@
import { import {
validateOptions,
optionsTemplateTypes as oTypes,
} from '~/plugins/optionsValidationPlugin/validation';
import type {
Options, Options,
OverflowBehavior, OverflowBehavior,
ScrollbarVisibilityBehavior, ScrollbarVisibilityBehavior,
ScrollbarAutoHideBehavior, ScrollbarAutoHideBehavior,
} from 'options'; } from '~/options';
import { import type {
validateOptions,
OptionsTemplate, OptionsTemplate,
OptionsTemplateValue, OptionsTemplateValue,
optionsTemplateTypes as oTypes, } from '~/plugins/optionsValidationPlugin/validation';
} from 'plugins/optionsValidationPlugin/validation'; import type { DeepPartial } from '~/typings';
import type { DeepPartial } from 'typings'; import type { Plugin } from '~/plugins';
import type { Plugin } from 'plugins';
const numberAllowedValues: OptionsTemplateValue<number> = oTypes.number; const numberAllowedValues: OptionsTemplateValue<number> = oTypes.number;
const booleanAllowedValues: OptionsTemplateValue<boolean> = oTypes.boolean; const booleanAllowedValues: OptionsTemplateValue<boolean> = oTypes.boolean;
@@ -1,13 +1,13 @@
import { import { isArray } from '~/support/utils/types';
import { each, keys } from '~/support/utils';
import type {
OptionsTemplate, OptionsTemplate,
OptionsObjectType, OptionsObjectType,
OptionsTemplateNativeTypes, OptionsTemplateNativeTypes,
OptionsTemplateTypes, OptionsTemplateTypes,
OptionsTemplateValue, OptionsTemplateValue,
} from 'plugins/optionsValidationPlugin/validation'; } from '~/plugins/optionsValidationPlugin/validation';
import { PlainObject } from 'typings'; import type { PlainObject } from '~/typings';
import { isArray } from 'support/utils/types';
import { each, keys } from 'support/utils';
export interface OptionsWithOptionsTemplateTransformation<T> { export interface OptionsWithOptionsTemplateTransformation<T> {
_template: OptionsTemplate<T>; _template: OptionsTemplate<T>;
@@ -1,6 +1,6 @@
import { each, hasOwnProperty, keys, push, isEmptyObject } from 'support/utils'; import { each, hasOwnProperty, keys, push, isEmptyObject } from '~/support/utils';
import { type, isArray, isUndefined, isPlainObject, isString } from 'support/utils/types'; import { type, isArray, isUndefined, isPlainObject, isString } from '~/support/utils/types';
import { PlainObject, DeepPartial } from 'typings'; import type { PlainObject, DeepPartial } from '~/typings';
export type OptionsObjectType = Record<string, unknown>; export type OptionsObjectType = Record<string, unknown>;
export type OptionsFunctionType = (this: any, ...args: any[]) => any; export type OptionsFunctionType = (this: any, ...args: any[]) => any;
@@ -1,5 +1,5 @@
import { each, isArray, keys, push } from 'support'; import { each, isArray, keys, push } from '~/support';
import { OverlayScrollbars, OverlayScrollbarsStatic } from 'overlayscrollbars'; import type { OverlayScrollbars, OverlayScrollbarsStatic } from '~/overlayscrollbars';
export type PluginInstance = export type PluginInstance =
| Record<string, unknown> | Record<string, unknown>
@@ -1 +1 @@
export * from 'plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin'; export * from '~/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin';
@@ -1,7 +1,6 @@
import { import {
keys, keys,
attr, attr,
WH,
style, style,
addClass, addClass,
removeClass, removeClass,
@@ -9,19 +8,18 @@ import {
each, each,
assignDeep, assignDeep,
windowSize, windowSize,
UpdateCache, } from '~/support';
XY, import { classNameViewportArrange } from '~/classnames';
} from 'support'; import type { WH, UpdateCache, XY } from '~/support';
import { classNameViewportArrange } from 'classnames'; import type { StyleObject } from '~/typings';
import type { StyleObject } from 'typings'; import type { StructureSetupState } from '~/setups/structureSetup';
import type { StructureSetupState } from 'setups/structureSetup';
import type { import type {
ViewportOverflowState, ViewportOverflowState,
GetViewportOverflowState, GetViewportOverflowState,
HideNativeScrollbars, HideNativeScrollbars,
} from 'setups/structureSetup/updateSegments/overflowUpdateSegment'; } from '~/setups/structureSetup/updateSegments/overflowUpdateSegment';
import type { InternalEnvironment } from 'environment'; import type { InternalEnvironment } from '~/environment';
import type { Plugin } from 'plugins'; import type { Plugin } from '~/plugins';
export type ArrangeViewport = ( export type ArrangeViewport = (
viewportOverflowState: ViewportOverflowState, viewportOverflowState: ViewportOverflowState,
@@ -1 +1 @@
export * from 'plugins/sizeObserverPlugin/sizeObserverPlugin'; export * from '~/plugins/sizeObserverPlugin/sizeObserverPlugin';
@@ -12,13 +12,13 @@ import {
cAF, cAF,
rAF, rAF,
stopPropagation, stopPropagation,
} from 'support'; } from '~/support';
import { import {
classNameSizeObserverListenerScroll, classNameSizeObserverListenerScroll,
classNameSizeObserverListenerItem, classNameSizeObserverListenerItem,
classNameSizeObserverListenerItemFinal, classNameSizeObserverListenerItemFinal,
} from 'classnames'; } from '~/classnames';
import type { Plugin } from 'plugins'; import type { Plugin } from '~/plugins';
export type SizeObserverPluginInstance = { export type SizeObserverPluginInstance = {
_: ( _: (
@@ -1,3 +1,3 @@
export * from 'setups/setups'; export * from '~/setups/setups';
export * from 'setups/structureSetup'; export * from '~/setups/structureSetup';
export * from 'setups/scrollbarsSetup'; export * from '~/setups/scrollbarsSetup';
@@ -1 +1 @@
export * from 'setups/scrollbarsSetup/scrollbarsSetup'; export * from '~/setups/scrollbarsSetup/scrollbarsSetup';
@@ -1,6 +1,6 @@
import { offsetSize } from 'support'; import { offsetSize } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import type { StructureSetupState } from 'setups'; import type { StructureSetupState } from '~/setups';
const { min, max, abs, round } = Math; const { min, max, abs, round } = Math;
@@ -12,7 +12,7 @@ import {
runEachAndClear, runEachAndClear,
setT, setT,
style, style,
} from 'support'; } from '~/support';
import { import {
classNameScrollbar, classNameScrollbar,
classNameScrollbarHorizontal, classNameScrollbarHorizontal,
@@ -20,22 +20,22 @@ import {
classNameScrollbarTrack, classNameScrollbarTrack,
classNameScrollbarHandle, classNameScrollbarHandle,
classNamesScrollbarTransitionless, classNamesScrollbarTransitionless,
} from 'classnames'; } from '~/classnames';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { dynamicInitializationElement as generalDynamicInitializationElement } from 'initialization'; import { dynamicInitializationElement as generalDynamicInitializationElement } from '~/initialization';
import { import {
getScrollbarHandleLengthRatio, getScrollbarHandleLengthRatio,
getScrollbarHandleOffsetRatio, getScrollbarHandleOffsetRatio,
} from 'setups/scrollbarsSetup/scrollbarsSetup.calculations'; } from '~/setups/scrollbarsSetup/scrollbarsSetup.calculations';
import type { import type {
InitializationTarget, InitializationTarget,
InitializationTargetElement, InitializationTargetElement,
InitializationTargetObject, InitializationTargetObject,
} from 'initialization'; } from '~/initialization';
import type { StructureSetupElementsObj } from 'setups/structureSetup/structureSetup.elements'; import type { StructureSetupElementsObj } from '~/setups/structureSetup/structureSetup.elements';
import type { ScrollbarsSetupEvents } from 'setups/scrollbarsSetup/scrollbarsSetup.events'; import type { ScrollbarsSetupEvents } from '~/setups/scrollbarsSetup/scrollbarsSetup.events';
import type { StyleObject } from 'typings'; import type { StyleObject } from '~/typings';
import type { StructureSetupState } from 'setups'; import type { StructureSetupState } from '~/setups';
export interface ScrollbarStructure { export interface ScrollbarStructure {
_scrollbar: HTMLElement; _scrollbar: HTMLElement;
@@ -6,26 +6,26 @@ import {
preventDefault, preventDefault,
runEachAndClear, runEachAndClear,
stopPropagation, stopPropagation,
XY,
selfClearTimeout, selfClearTimeout,
parent, parent,
closest, closest,
push, push,
} from 'support'; } from '~/support';
import { getPlugins, clickScrollPluginName } from 'plugins'; import { getPlugins, clickScrollPluginName } from '~/plugins';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { import {
classNameScrollbarHandle, classNameScrollbarHandle,
classNamesScrollbarInteraction, classNamesScrollbarInteraction,
classNamesScrollbarWheel, classNamesScrollbarWheel,
} from 'classnames'; } from '~/classnames';
import type { ClickScrollPluginInstance } from 'plugins'; import type { XY } from '~/support';
import type { ReadonlyOptions } from 'options'; import type { ClickScrollPluginInstance } from '~/plugins';
import type { StructureSetupState } from 'setups'; import type { ReadonlyOptions } from '~/options';
import type { StructureSetupState } from '~/setups';
import type { import type {
ScrollbarsSetupElementsObj, ScrollbarsSetupElementsObj,
ScrollbarStructure, ScrollbarStructure,
} from 'setups/scrollbarsSetup/scrollbarsSetup.elements'; } from '~/setups/scrollbarsSetup/scrollbarsSetup.elements';
export type ScrollbarsSetupEvents = ( export type ScrollbarsSetupEvents = (
scrollbarStructure: ScrollbarStructure, scrollbarStructure: ScrollbarStructure,
@@ -1,11 +1,7 @@
import { on, runEachAndClear, parent, scrollLeft, scrollTop, selfClearTimeout } from 'support'; import { on, runEachAndClear, parent, scrollLeft, scrollTop, selfClearTimeout } from '~/support';
import { createState, createOptionCheck } from 'setups/setups'; import { createState, createOptionCheck } from '~/setups/setups';
import { createScrollbarsSetupEvents } from 'setups/scrollbarsSetup/scrollbarsSetup.events'; import { createScrollbarsSetupEvents } from '~/setups/scrollbarsSetup/scrollbarsSetup.events';
import { import { createScrollbarsSetupElements } from '~/setups/scrollbarsSetup/scrollbarsSetup.elements';
createScrollbarsSetupElements,
ScrollbarsSetupElementsObj,
ScrollbarStructure,
} from 'setups/scrollbarsSetup/scrollbarsSetup.elements';
import { import {
classNamesScrollbarVisible, classNamesScrollbarVisible,
classNamesScrollbarUnusable, classNamesScrollbarUnusable,
@@ -14,16 +10,20 @@ import {
classNamesScrollbarHandleInteractive, classNamesScrollbarHandleInteractive,
classNamesScrollbarTrackInteractive, classNamesScrollbarTrackInteractive,
classNameScrollbarRtl, classNameScrollbarRtl,
} from 'classnames'; } from '~/classnames';
import type { StructureSetupUpdateHints } from 'setups/structureSetup/structureSetup.update'; import type {
ScrollbarsSetupElementsObj,
ScrollbarStructure,
} from '~/setups/scrollbarsSetup/scrollbarsSetup.elements';
import type { StructureSetupUpdateHints } from '~/setups/structureSetup/structureSetup.update';
import type { import type {
ReadonlyOptions, ReadonlyOptions,
ScrollbarVisibilityBehavior, ScrollbarVisibilityBehavior,
ScrollbarAutoHideBehavior, ScrollbarAutoHideBehavior,
} from 'options'; } from '~/options';
import type { Setup, StructureSetupState, StructureSetupStaticState } from 'setups'; import type { Setup, StructureSetupState, StructureSetupStaticState } from '~/setups';
import type { InitializationTarget } from 'initialization'; import type { InitializationTarget } from '~/initialization';
import type { DeepPartial, OverflowStyle, StyleObject } from 'typings'; import type { DeepPartial, OverflowStyle, StyleObject } from '~/typings';
// eslint-disable-next-line @typescript-eslint/no-empty-interface // eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ScrollbarsSetupState {} export interface ScrollbarsSetupState {}
@@ -1,6 +1,6 @@
import { assignDeep, hasOwnProperty } from 'support'; import { assignDeep, hasOwnProperty } from '~/support';
import type { Options, ReadonlyOptions } from 'options'; import type { Options, ReadonlyOptions } from '~/options';
import type { DeepPartial } from 'typings'; import type { DeepPartial } from '~/typings';
export type SetupElements<T extends Record<string, any>> = [elements: T, destroy: () => void]; export type SetupElements<T extends Record<string, any>> = [elements: T, destroy: () => void];
@@ -44,7 +44,7 @@ export const createOptionCheck =
(path: string) => (path: string) =>
[getPropByPath(options, path), force || getPropByPath(changedOptions, path) !== undefined]; [getPropByPath(options, path), force || getPropByPath(changedOptions, path) !== undefined];
export const createState = <S>(initialState: S): SetupState<S> => { export const createState = <S extends Record<string, any>>(initialState: S): SetupState<S> => {
let state: S = initialState; let state: S = initialState;
return [ return [
() => state, () => state,
@@ -1 +1 @@
export * from 'setups/structureSetup/structureSetup'; export * from '~/setups/structureSetup/structureSetup';
@@ -21,7 +21,7 @@ import {
hasAttrClass, hasAttrClass,
noop, noop,
on, on,
} from 'support'; } from '~/support';
import { import {
dataAttributeHost, dataAttributeHost,
dataAttributeHostOverflowX, dataAttributeHostOverflowX,
@@ -30,19 +30,19 @@ import {
classNameViewport, classNameViewport,
classNameContent, classNameContent,
classNameViewportScrollbarHidden, classNameViewportScrollbarHidden,
} from 'classnames'; } from '~/classnames';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { getPlugins, scrollbarsHidingPluginName } from 'plugins'; import { getPlugins, scrollbarsHidingPluginName } from '~/plugins';
import { import {
staticInitializationElement as generalStaticInitializationElement, staticInitializationElement as generalStaticInitializationElement,
dynamicInitializationElement as generalDynamicInitializationElement, dynamicInitializationElement as generalDynamicInitializationElement,
} from 'initialization'; } from '~/initialization';
import type { ScrollbarsHidingPluginInstance } from 'plugins/scrollbarsHidingPlugin'; import type { ScrollbarsHidingPluginInstance } from '~/plugins/scrollbarsHidingPlugin';
import type { import type {
InitializationTarget, InitializationTarget,
InitializationTargetElement, InitializationTargetElement,
InitializationTargetObject, InitializationTargetObject,
} from 'initialization'; } from '~/initialization';
export type StructureSetupElements = [ export type StructureSetupElements = [
elements: StructureSetupElementsObj, elements: StructureSetupElementsObj,
@@ -7,13 +7,11 @@ import {
isString, isString,
attr, attr,
removeAttr, removeAttr,
CacheValues,
keys, keys,
liesBetween, liesBetween,
scrollSize, scrollSize,
equalWH, equalWH,
createCache, createCache,
WH,
fractionalSize, fractionalSize,
isFunction, isFunction,
ResizeObserverConstructor, ResizeObserverConstructor,
@@ -23,8 +21,8 @@ import {
scrollLeft, scrollLeft,
scrollTop, scrollTop,
noop, noop,
} from 'support'; } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { import {
dataAttributeHost, dataAttributeHost,
dataValueHostOverflowVisible, dataValueHostOverflowVisible,
@@ -33,21 +31,17 @@ import {
classNameOverflowVisible, classNameOverflowVisible,
classNameScrollbar, classNameScrollbar,
classNameViewportArrange, classNameViewportArrange,
} from 'classnames'; } from '~/classnames';
import { import { createSizeObserver, createTrinsicObserver, createDOMObserver } from '~/observers';
createSizeObserver, import type { DOMObserver, SizeObserverCallbackParams } from '~/observers';
createTrinsicObserver, import type { CacheValues, WH } from '~/support';
createDOMObserver, import type { SetupState, SetupUpdateCheckOption } from '~/setups';
DOMObserver, import type { StructureSetupState } from '~/setups/structureSetup';
SizeObserverCallbackParams, import type { StructureSetupElementsObj } from '~/setups/structureSetup/structureSetup.elements';
} from 'observers';
import type { SetupState, SetupUpdateCheckOption } from 'setups';
import type { StructureSetupState } from 'setups/structureSetup';
import type { StructureSetupElementsObj } from 'setups/structureSetup/structureSetup.elements';
import type { import type {
StructureSetupUpdate, StructureSetupUpdate,
StructureSetupUpdateHints, StructureSetupUpdateHints,
} from 'setups/structureSetup/structureSetup.update'; } from '~/setups/structureSetup/structureSetup.update';
export type StructureSetupObserversUpdate = (checkOption: SetupUpdateCheckOption) => void; export type StructureSetupObserversUpdate = (checkOption: SetupUpdateCheckOption) => void;
@@ -1,15 +1,15 @@
import { createEventListenerHub, isEmptyObject, keys, scrollLeft, scrollTop } from 'support'; import { createEventListenerHub, isEmptyObject, keys, scrollLeft, scrollTop } from '~/support';
import { createState, createOptionCheck } from 'setups/setups'; import { createState, createOptionCheck } from '~/setups/setups';
import { createStructureSetupElements } from 'setups/structureSetup/structureSetup.elements'; import { createStructureSetupElements } from '~/setups/structureSetup/structureSetup.elements';
import { createStructureSetupUpdate } from 'setups/structureSetup/structureSetup.update'; import { createStructureSetupUpdate } from '~/setups/structureSetup/structureSetup.update';
import { createStructureSetupObservers } from 'setups/structureSetup/structureSetup.observers'; import { createStructureSetupObservers } from '~/setups/structureSetup/structureSetup.observers';
import type { StructureSetupUpdateHints } from 'setups/structureSetup/structureSetup.update'; import type { StructureSetupUpdateHints } from '~/setups/structureSetup/structureSetup.update';
import type { StructureSetupElementsObj } from 'setups/structureSetup/structureSetup.elements'; import type { StructureSetupElementsObj } from '~/setups/structureSetup/structureSetup.elements';
import type { TRBL, XY, EventListener } from 'support'; import type { TRBL, XY, EventListener } from '~/support';
import type { Options, ReadonlyOptions } from 'options'; import type { Options, ReadonlyOptions } from '~/options';
import type { Setup } from 'setups'; import type { Setup } from '~/setups';
import type { InitializationTarget } from 'initialization'; import type { InitializationTarget } from '~/initialization';
import type { DeepPartial, StyleObject, OverflowStyle } from 'typings'; import type { DeepPartial, StyleObject, OverflowStyle } from '~/typings';
export interface StructureSetupState { export interface StructureSetupState {
_padding: TRBL; _padding: TRBL;
@@ -1,14 +1,14 @@
import { each, scrollLeft, scrollTop, assignDeep, keys } from 'support'; import { each, scrollLeft, scrollTop, assignDeep, keys } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { dataValueHostUpdating } from 'classnames'; import { dataValueHostUpdating } from '~/classnames';
import { import {
createTrinsicUpdateSegment, createTrinsicUpdateSegment,
createPaddingUpdateSegment, createPaddingUpdateSegment,
createOverflowUpdateSegment, createOverflowUpdateSegment,
} from 'setups/structureSetup/updateSegments'; } from '~/setups/structureSetup/updateSegments';
import type { SetupState, SetupUpdateSegment, SetupUpdateCheckOption } from 'setups'; import type { SetupState, SetupUpdateSegment, SetupUpdateCheckOption } from '~/setups';
import type { StructureSetupState } from 'setups/structureSetup'; import type { StructureSetupState } from '~/setups/structureSetup';
import type { StructureSetupElementsObj } from 'setups/structureSetup/structureSetup.elements'; import type { StructureSetupElementsObj } from '~/setups/structureSetup/structureSetup.elements';
export type CreateStructureUpdateSegment = ( export type CreateStructureUpdateSegment = (
structureSetupElements: StructureSetupElementsObj, structureSetupElements: StructureSetupElementsObj,
@@ -1,3 +1,3 @@
export * from 'setups/structureSetup/updateSegments/trinsicUpdateSegment'; export * from '~/setups/structureSetup/updateSegments/trinsicUpdateSegment';
export * from 'setups/structureSetup/updateSegments/paddingUpdateSegment'; export * from '~/setups/structureSetup/updateSegments/paddingUpdateSegment';
export * from 'setups/structureSetup/updateSegments/overflowUpdateSegment'; export * from '~/setups/structureSetup/updateSegments/overflowUpdateSegment';
@@ -1,8 +1,6 @@
import { import {
createCache, createCache,
attr, attr,
WH,
XY,
style, style,
scrollSize, scrollSize,
fractionalSize, fractionalSize,
@@ -13,8 +11,8 @@ import {
equalXY, equalXY,
attrClass, attrClass,
noop, noop,
} from 'support'; } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import { import {
classNameViewportScrollbarHidden, classNameViewportScrollbarHidden,
classNameOverflowVisible, classNameOverflowVisible,
@@ -23,16 +21,17 @@ import {
dataAttributeHostOverflowY, dataAttributeHostOverflowY,
dataValueHostScrollbarHidden, dataValueHostScrollbarHidden,
dataValueHostOverflowVisible, dataValueHostOverflowVisible,
} from 'classnames'; } from '~/classnames';
import { getPlugins, scrollbarsHidingPluginName } from 'plugins'; import { getPlugins, scrollbarsHidingPluginName } from '~/plugins';
import type { WH, XY } from '~/support';
import type { import type {
ScrollbarsHidingPluginInstance, ScrollbarsHidingPluginInstance,
ArrangeViewport, ArrangeViewport,
UndoArrangeViewport, UndoArrangeViewport,
} from 'plugins/scrollbarsHidingPlugin'; } from '~/plugins/scrollbarsHidingPlugin';
import type { StyleObject, OverflowStyle } from 'typings'; import type { StyleObject, OverflowStyle } from '~/typings';
import type { OverflowBehavior } from 'options'; import type { OverflowBehavior } from '~/options';
import type { CreateStructureUpdateSegment } from 'setups/structureSetup/structureSetup.update'; import type { CreateStructureUpdateSegment } from '~/setups/structureSetup/structureSetup.update';
export interface ViewportOverflowState { export interface ViewportOverflowState {
_scrollbarsHideOffset: XY<number>; _scrollbarsHideOffset: XY<number>;
@@ -1,7 +1,7 @@
import { createCache, topRightBottomLeft, equalTRBL, style, assignDeep } from 'support'; import { createCache, topRightBottomLeft, equalTRBL, style, assignDeep } from '~/support';
import { StyleObject } from 'typings'; import { getEnvironment } from '~/environment';
import { getEnvironment } from 'environment'; import type { StyleObject } from '~/typings';
import type { CreateStructureUpdateSegment } from 'setups/structureSetup/structureSetup.update'; import type { CreateStructureUpdateSegment } from '~/setups/structureSetup/structureSetup.update';
/** /**
* Lifecycle with the responsibility to adjust the padding styling of the padding and viewport element. * Lifecycle with the responsibility to adjust the padding styling of the padding and viewport element.
@@ -1,6 +1,6 @@
import { style } from 'support'; import { style } from '~/support';
import { getEnvironment } from 'environment'; import { getEnvironment } from '~/environment';
import type { CreateStructureUpdateSegment } from 'setups/structureSetup/structureSetup.update'; import type { CreateStructureUpdateSegment } from '~/setups/structureSetup/structureSetup.update';
/** /**
* Lifecycle with the responsibility to adjust the trinsic behavior of the content element. * Lifecycle with the responsibility to adjust the trinsic behavior of the content element.
@@ -1,4 +1,4 @@
import { jsAPI } from 'support/compatibility/vendors'; import { jsAPI } from '~/support/compatibility/vendors';
export const MutationObserverConstructor = jsAPI<typeof MutationObserver>('MutationObserver'); export const MutationObserverConstructor = jsAPI<typeof MutationObserver>('MutationObserver');
export const IntersectionObserverConstructor = export const IntersectionObserverConstructor =
@@ -1,2 +1,2 @@
export * from 'support/compatibility/vendors'; export * from '~/support/compatibility/vendors';
export * from 'support/compatibility/apis'; export * from '~/support/compatibility/apis';
@@ -1,6 +1,6 @@
import { each } from 'support/utils/array'; import { each } from '~/support/utils/array';
import { hasOwnProperty } from 'support/utils/object'; import { hasOwnProperty } from '~/support/utils/object';
import { createDiv } from 'support/dom/create'; import { createDiv } from '~/support/dom/create';
const firstLetterToUpper = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1); const firstLetterToUpper = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);
const getDummyStyle = (): CSSStyleDeclaration => createDiv().style; const getDummyStyle = (): CSSStyleDeclaration => createDiv().style;
@@ -1,5 +1,5 @@
import { rAF, cAF } from 'support/compatibility'; import { rAF, cAF } from '~/support/compatibility';
import { isFunction } from 'support/utils'; import { isFunction } from '~/support/utils';
const { max } = Math; const { max } = Math;
const animationCurrentTime = () => performance.now(); const animationCurrentTime = () => performance.now();
@@ -1,5 +1,5 @@
import { from } from 'support/utils/array'; import { from } from '~/support/utils/array';
import { isNumber, isString, isUndefined } from 'support/utils/types'; import { isNumber, isString, isUndefined } from '~/support/utils/types';
type GetSetPropName = 'scrollLeft' | 'scrollTop' | 'value'; type GetSetPropName = 'scrollLeft' | 'scrollTop' | 'value';
@@ -1,6 +1,6 @@
import { isString } from 'support/utils/types'; import { isString } from '~/support/utils/types';
import { each } from 'support/utils/array'; import { each } from '~/support/utils/array';
import { keys } from 'support/utils/object'; import { keys } from '~/support/utils/object';
type ClassContainingElement = Node | Element | false | null | undefined; type ClassContainingElement = Node | Element | false | null | undefined;
type ClassName = string | false | null | undefined; type ClassName = string | false | null | undefined;
@@ -1,7 +1,7 @@
import { each } from 'support/utils/array'; import { each } from '~/support/utils/array';
import { attr } from 'support/dom/attribute'; import { attr } from '~/support/dom/attribute';
import { contents } from 'support/dom/traversal'; import { contents } from '~/support/dom/traversal';
import { removeElements } from 'support/dom/manipulation'; import { removeElements } from '~/support/dom/manipulation';
/** /**
* Creates a div DOM node. * Creates a div DOM node.
@@ -1,4 +1,4 @@
import { style } from 'support/dom/style'; import { style } from '~/support/dom/style';
export interface WH<T = number> { export interface WH<T = number> {
w: T; w: T;
@@ -1,5 +1,5 @@
import { isUndefined } from 'support/utils/types'; import { isUndefined } from '~/support/utils/types';
import { each, push, runEachAndClear } from 'support/utils/array'; import { each, push, runEachAndClear } from '~/support/utils/array';
let passiveEventsSupport: boolean; let passiveEventsSupport: boolean;
const supportPassiveEvents = (): boolean => { const supportPassiveEvents = (): boolean => {
@@ -1,10 +1,10 @@
export * from 'support/dom/animation'; export * from '~/support/dom/animation';
export * from 'support/dom/attribute'; export * from '~/support/dom/attribute';
export * from 'support/dom/class'; export * from '~/support/dom/class';
export * from 'support/dom/create'; export * from '~/support/dom/create';
export * from 'support/dom/dimensions'; export * from '~/support/dom/dimensions';
export * from 'support/dom/events'; export * from '~/support/dom/events';
export * from 'support/dom/style'; export * from '~/support/dom/style';
export * from 'support/dom/manipulation'; export * from '~/support/dom/manipulation';
export * from 'support/dom/offset'; export * from '~/support/dom/offset';
export * from 'support/dom/traversal'; export * from '~/support/dom/traversal';
@@ -1,6 +1,6 @@
import { isArrayLike } from 'support/utils/types'; import { isArrayLike } from '~/support/utils/types';
import { each, from } from 'support/utils/array'; import { each, from } from '~/support/utils/array';
import { parent } from 'support/dom/traversal'; import { parent } from '~/support/dom/traversal';
type NodeCollection = ArrayLike<Node> | Node | false | null | undefined; type NodeCollection = ArrayLike<Node> | Node | false | null | undefined;
@@ -1,4 +1,4 @@
import { getBoundingClientRect } from 'support/dom/dimensions'; import { getBoundingClientRect } from '~/support/dom/dimensions';
export interface XY<T = number> { export interface XY<T = number> {
x: T; x: T;
@@ -1,6 +1,6 @@
import { each, keys } from 'support/utils'; import { each, keys } from '~/support/utils';
import { isString, isNumber, isArray, isUndefined } from 'support/utils/types'; import { isString, isNumber, isArray, isUndefined } from '~/support/utils/types';
import { PlainObject, StyleObject } from 'typings'; import type { PlainObject, StyleObject } from '~/typings';
export interface TRBL { export interface TRBL {
t: number; t: number;
@@ -1,5 +1,5 @@
import { isElement } from 'support/utils/types'; import { isElement } from '~/support/utils/types';
import { push, from } from 'support/utils/array'; import { push, from } from '~/support/utils/array';
type InputElementType = Node | Element | Node | false | null | undefined; type InputElementType = Node | Element | Node | false | null | undefined;
type OutputElementType = Node | Element | null; type OutputElementType = Node | Element | null;
@@ -1,6 +1,6 @@
import { isArray } from 'support/utils/types'; import { isArray } from '~/support/utils/types';
import { keys } from 'support/utils/object'; import { keys } from '~/support/utils/object';
import { each, from, isEmptyArray } from 'support/utils/array'; import { each, from, isEmptyArray } from '~/support/utils/array';
export type EventListener<EventMap extends Record<string, any[]>, N extends keyof EventMap> = ( export type EventListener<EventMap extends Record<string, any[]>, N extends keyof EventMap> = (
...args: EventMap[N] ...args: EventMap[N]
@@ -1,5 +1,5 @@
export * from 'support/cache'; export * from '~/support/cache';
export * from 'support/compatibility'; export * from '~/support/compatibility';
export * from 'support/dom'; export * from '~/support/dom';
export * from 'support/utils'; export * from '~/support/utils';
export * from 'support/eventListeners'; export * from '~/support/eventListeners';
@@ -1,5 +1,5 @@
import { isArrayLike, isString } from 'support/utils/types'; import { isArrayLike, isString } from '~/support/utils/types';
import { PlainObject } from 'typings'; import type { PlainObject } from '~/typings';
type RunEachItem = ((...args: any) => any | any[]) | null | undefined; type RunEachItem = ((...args: any) => any | any[]) | null | undefined;
@@ -1,6 +1,6 @@
import { each } from 'support/utils/array'; import { each } from '~/support/utils/array';
import { WH, XY, TRBL } from 'support/dom'; import type { WH, XY, TRBL } from '~/support/dom';
import { PlainObject } from 'typings'; import type { PlainObject } from '~/typings';
/** /**
* Compares two objects and returns true if all values of the passed prop names are identical, false otherwise or if one of the two object is falsy. * Compares two objects and returns true if all values of the passed prop names are identical, false otherwise or if one of the two object is falsy.
@@ -1,6 +1,6 @@
import { isNumber, isFunction } from 'support/utils/types'; import { isNumber, isFunction } from '~/support/utils/types';
import { from } from 'support/utils/array'; import { from } from '~/support/utils/array';
import { rAF, cAF, setT, clearT } from 'support/compatibility/apis'; import { rAF, cAF, setT, clearT } from '~/support/compatibility/apis';
type DebounceTiming = number | false | null | undefined; type DebounceTiming = number | false | null | undefined;
@@ -1,5 +1,5 @@
export * from 'support/utils/array'; export * from '~/support/utils/array';
export * from 'support/utils/equal'; export * from '~/support/utils/equal';
export * from 'support/utils/function'; export * from '~/support/utils/function';
export * from 'support/utils/object'; export * from '~/support/utils/object';
export * from 'support/utils/types'; export * from '~/support/utils/types';
@@ -1,5 +1,5 @@
import { isArray, isFunction, isPlainObject, isNull } from 'support/utils/types'; import { isArray, isFunction, isPlainObject, isNull } from '~/support/utils/types';
import { each } from 'support/utils/array'; import { each } from '~/support/utils/array';
/** /**
* Determines whether the passed object has a property with the passed name. * Determines whether the passed object has a property with the passed name.
@@ -1,4 +1,4 @@
import { PlainObject } from 'typings'; import type { PlainObject } from '~/typings';
const ElementNodeType = Node.ELEMENT_NODE; const ElementNodeType = Node.ELEMENT_NODE;
const { toString, hasOwnProperty } = Object.prototype; const { toString, hasOwnProperty } = Object.prototype;
@@ -1,8 +1,9 @@
import { DeepPartial } from 'typings'; import type { DeepPartial } from '~/typings';
import { defaultOptions, Options } from 'options'; import type { Options } from '~/options';
import { Initialization } from 'initialization'; import { defaultOptions } from '~/options';
import { getEnvironment } from 'environment'; import type { Initialization } from '~/initialization';
import { ScrollbarsHidingPlugin, scrollbarsHidingPluginName } from 'plugins'; import { getEnvironment } from '~/environment';
import { ScrollbarsHidingPlugin, scrollbarsHidingPluginName } from '~/plugins';
const defaultInitialization = { const defaultInitialization = {
elements: { elements: {
@@ -25,8 +26,8 @@ let getEnv = getEnvironment;
describe('environment', () => { describe('environment', () => {
beforeEach(async () => { beforeEach(async () => {
jest.resetModules(); jest.resetModules();
jest.doMock('support', () => { jest.doMock('~/support', () => {
const originalModule = jest.requireActual('support'); const originalModule = jest.requireActual('~/support');
let i = 0; let i = 0;
return { return {
...originalModule, ...originalModule,
@@ -37,15 +38,15 @@ describe('environment', () => {
clientSize: jest.fn().mockImplementation(() => ({ w: 90, h: 90 })), clientSize: jest.fn().mockImplementation(() => ({ w: 90, h: 90 })),
}; };
}); });
jest.doMock('plugins', () => { jest.doMock('~/plugins', () => {
const originalModule = jest.requireActual('plugins'); const originalModule = jest.requireActual('~/plugins');
return { return {
...originalModule, ...originalModule,
getPlugins: jest.fn(() => originalModule.getPlugins()), getPlugins: jest.fn(() => originalModule.getPlugins()),
}; };
}); });
({ getEnvironment: getEnv } = await import('environment')); ({ getEnvironment: getEnv } = await import('~/environment'));
}); });
test('singleton behavior', () => { test('singleton behavior', () => {
@@ -143,7 +144,7 @@ describe('environment', () => {
describe('addListener', () => { describe('addListener', () => {
test('with scrollbarsHidingPlugin registered before environment was created', async () => { test('with scrollbarsHidingPlugin registered before environment was created', async () => {
const { getPlugins } = await import('plugins'); const { getPlugins } = await import('~/plugins');
(getPlugins as jest.Mock).mockImplementation(() => ({ (getPlugins as jest.Mock).mockImplementation(() => ({
[scrollbarsHidingPluginName]: ScrollbarsHidingPlugin[scrollbarsHidingPluginName], [scrollbarsHidingPluginName]: ScrollbarsHidingPlugin[scrollbarsHidingPluginName],
})); }));
@@ -163,7 +164,7 @@ describe('environment', () => {
_addListener(listener); _addListener(listener);
const { getPlugins } = await import('plugins'); const { getPlugins } = await import('~/plugins');
(getPlugins as jest.Mock).mockImplementation(() => ({ (getPlugins as jest.Mock).mockImplementation(() => ({
[scrollbarsHidingPluginName]: ScrollbarsHidingPlugin[scrollbarsHidingPluginName], [scrollbarsHidingPluginName]: ScrollbarsHidingPlugin[scrollbarsHidingPluginName],
})); }));
@@ -1,13 +1,13 @@
import type { Initialization } from '~/initialization';
import { import {
staticInitializationElement, staticInitializationElement,
dynamicInitializationElement, dynamicInitializationElement,
cancelInitialization, cancelInitialization,
Initialization, } from '~/initialization';
} from 'initialization'; import { getEnvironment } from '~/environment';
import { getEnvironment } from 'environment';
jest.mock('environment', () => ({ jest.mock('~/environment', () => ({
getEnvironment: jest.fn(() => jest.requireActual('environment').getEnvironment()), getEnvironment: jest.fn(() => jest.requireActual('~/environment').getEnvironment()),
})); }));
const createDiv = () => document.createElement('div'); const createDiv = () => document.createElement('div');
@@ -422,7 +422,7 @@ describe('initialization', () => {
}, },
].forEach((env) => { ].forEach((env) => {
(getEnvironment as jest.Mock).mockImplementation(() => ({ (getEnvironment as jest.Mock).mockImplementation(() => ({
...jest.requireActual('environment').getEnvironment(), ...jest.requireActual('~/environment').getEnvironment(),
...env, ...env,
})); }));
const hasOverlaidScrollbars = const hasOverlaidScrollbars =
@@ -474,7 +474,7 @@ describe('initialization', () => {
}, },
].forEach((env) => { ].forEach((env) => {
(getEnvironment as jest.Mock).mockImplementation(() => ({ (getEnvironment as jest.Mock).mockImplementation(() => ({
...jest.requireActual('environment').getEnvironment(), ...jest.requireActual('~/environment').getEnvironment(),
...env, ...env,
})); }));
const hasOverlaidScrollbars = const hasOverlaidScrollbars =
@@ -521,7 +521,7 @@ describe('initialization', () => {
(env) => { (env) => {
[false, true].forEach((isBody) => { [false, true].forEach((isBody) => {
(getEnvironment as jest.Mock).mockImplementation(() => ({ (getEnvironment as jest.Mock).mockImplementation(() => ({
...jest.requireActual('environment').getEnvironment(), ...jest.requireActual('~/environment').getEnvironment(),
...env, ...env,
})); }));
const defaultBody = defaultCancelInitialization.body; const defaultBody = defaultCancelInitialization.body;
@@ -561,7 +561,7 @@ describe('initialization', () => {
[{ _nativeScrollbarsHiding: false }, { _nativeScrollbarsHiding: true }].forEach((env) => { [{ _nativeScrollbarsHiding: false }, { _nativeScrollbarsHiding: true }].forEach((env) => {
[false, true].forEach((isBody) => { [false, true].forEach((isBody) => {
(getEnvironment as jest.Mock).mockImplementation(() => ({ (getEnvironment as jest.Mock).mockImplementation(() => ({
...jest.requireActual('environment').getEnvironment(), ...jest.requireActual('~/environment').getEnvironment(),
...env, ...env,
})); }));
const defaultBody = defaultCancelInitialization.body; const defaultBody = defaultCancelInitialization.body;
@@ -1,5 +1,5 @@
import { addInstance, removeInstance, getInstance } from 'instances'; import { addInstance, removeInstance, getInstance } from '~/instances';
import { OverlayScrollbars } from '../../src/overlayscrollbars'; import { OverlayScrollbars } from '~/overlayscrollbars';
const testElm = document.body; const testElm = document.body;
const testInstance = OverlayScrollbars(document.body, {}); const testInstance = OverlayScrollbars(document.body, {});
@@ -1,9 +1,9 @@
import { createDOMObserver } from 'observers'; import { createDOMObserver } from '~/observers';
jest.useFakeTimers(); jest.useFakeTimers();
jest.mock('support/compatibility/apis', () => { jest.mock('~/support/compatibility/apis', () => {
const originalModule = jest.requireActual('support/compatibility/apis'); const originalModule = jest.requireActual('~/support/compatibility/apis');
const mockRAF = (arg: any) => setTimeout(arg, 0); const mockRAF = (arg: any) => setTimeout(arg, 0);
return { return {
...originalModule, ...originalModule,
@@ -1,17 +1,17 @@
import { createSizeObserver as originalCreateSizeObserver } from 'observers'; import { createSizeObserver as originalCreateSizeObserver } from '~/observers';
import { SizeObserverPlugin, sizeObserverPluginName } from 'plugins'; import { SizeObserverPlugin, sizeObserverPluginName } from '~/plugins';
let createSizeObserver = originalCreateSizeObserver; let createSizeObserver = originalCreateSizeObserver;
const mockResizeObserverConstructor = async (value: any) => { const mockResizeObserverConstructor = async (value: any) => {
jest.resetModules(); jest.resetModules();
jest.unmock('plugins'); jest.unmock('~/plugins');
jest.doMock('support/compatibility/apis', () => ({ jest.doMock('~/support/compatibility/apis', () => ({
...jest.requireActual('support/compatibility/apis'), ...jest.requireActual('~/support/compatibility/apis'),
ResizeObserverConstructor: value, ResizeObserverConstructor: value,
})); }));
({ createSizeObserver } = await import('observers')); ({ createSizeObserver } = await import('~/observers'));
}; };
describe('createSizeObserver', () => { describe('createSizeObserver', () => {
@@ -64,8 +64,8 @@ describe('createSizeObserver', () => {
beforeEach(() => { beforeEach(() => {
mockResizeObserverConstructor(false); mockResizeObserverConstructor(false);
jest.doMock('plugins', () => ({ jest.doMock('~/plugins', () => ({
...jest.requireActual('plugins'), ...jest.requireActual('~/plugins'),
getPlugins: () => ({ getPlugins: () => ({
[sizeObserverPluginName]: { [sizeObserverPluginName]: {
_: mockSizeObserverPlugin, _: mockSizeObserverPlugin,
@@ -1,4 +1,4 @@
import { createTrinsicObserver } from 'observers'; import { createTrinsicObserver } from '~/observers';
describe('createTrinsicObserver', () => { describe('createTrinsicObserver', () => {
beforeEach(() => { beforeEach(() => {
@@ -1,4 +1,4 @@
import { defaultOptions, getOptionsDiff } from 'options'; import { defaultOptions, getOptionsDiff } from '~/options';
describe('options', () => { describe('options', () => {
test('defaultOptions', () => { test('defaultOptions', () => {
@@ -1,8 +1,9 @@
import { DeepPartial } from 'typings'; import type { DeepPartial } from '~/typings';
import { defaultOptions, Options } from 'options'; import type { Options } from '~/options';
import { assignDeep } from 'support'; import { defaultOptions } from '~/options';
import { OptionsValidationPlugin } from 'plugins'; import { assignDeep } from '~/support';
import { OverlayScrollbars as originalOverlayScrollbars } from '../../src/overlayscrollbars'; import { OptionsValidationPlugin } from '~/plugins';
import { OverlayScrollbars as originalOverlayScrollbars } from '~/overlayscrollbars';
const bodyElm = document.body; const bodyElm = document.body;
const div = document.createElement('div'); const div = document.createElement('div');
@@ -14,7 +15,7 @@ let OverlayScrollbars = originalOverlayScrollbars;
describe('overlayscrollbars', () => { describe('overlayscrollbars', () => {
beforeEach(async () => { beforeEach(async () => {
jest.resetModules(); jest.resetModules();
({ OverlayScrollbars } = await import('../../src/overlayscrollbars')); ({ OverlayScrollbars } = await import('~/overlayscrollbars'));
}); });
afterEach(() => { afterEach(() => {
@@ -1,8 +1,8 @@
import { defaultOptions } from 'options'; import { defaultOptions } from '~/options';
import { import {
OptionsValidationPlugin, OptionsValidationPlugin,
optionsValidationPluginName, optionsValidationPluginName,
} from 'plugins/optionsValidationPlugin'; } from '~/plugins/optionsValidationPlugin';
const getValidationFn = () => { const getValidationFn = () => {
const name = Object.keys(OptionsValidationPlugin)[0]; const name = Object.keys(OptionsValidationPlugin)[0];
@@ -1,12 +1,8 @@
import { PlainObject } from 'typings'; import type { PlainObject } from '~/typings';
import { import type { OptionsTemplate } from '~/plugins/optionsValidationPlugin/validation';
optionsTemplateTypes as oTypes, import { optionsTemplateTypes as oTypes } from '~/plugins/optionsValidationPlugin/validation';
OptionsTemplate, import type { OptionsWithOptionsTemplate } from '~/plugins/optionsValidationPlugin/transformation';
} from 'plugins/optionsValidationPlugin/validation'; import { transformOptions } from '~/plugins/optionsValidationPlugin/transformation';
import {
transformOptions,
OptionsWithOptionsTemplate,
} from 'plugins/optionsValidationPlugin/transformation';
type TestOptionsObj = { propA: 'propA'; null: null }; type TestOptionsObj = { propA: 'propA'; null: null };
type TestOptionsEnum = 'A' | 'B' | 'C'; type TestOptionsEnum = 'A' | 'B' | 'C';
@@ -1,9 +1,9 @@
import type { OptionsTemplate } from '~/plugins/optionsValidationPlugin/validation';
import { import {
validateOptions, validateOptions,
optionsTemplateTypes as oTypes, optionsTemplateTypes as oTypes,
OptionsTemplate, } from '~/plugins/optionsValidationPlugin/validation';
} from 'plugins/optionsValidationPlugin/validation'; import { assignDeep } from '~/support/utils';
import { assignDeep } from 'support/utils';
type TestOptionsObj = { propA: 'propA'; null: null }; type TestOptionsObj = { propA: 'propA'; null: null };
type TestOptionsEnum = 'A' | 'B' | 'C'; type TestOptionsEnum = 'A' | 'B' | 'C';
@@ -1,4 +1,4 @@
import { addPlugin, getPlugins } from 'plugins'; import { addPlugin, getPlugins } from '~/plugins';
describe('plugins', () => { describe('plugins', () => {
test('getPlugins', () => { test('getPlugins', () => {
@@ -1,13 +1,11 @@
import { import type {
createScrollbarsSetupElements,
ScrollbarsSetupElement, ScrollbarsSetupElement,
ScrollbarsSetupElementsObj, ScrollbarsSetupElementsObj,
ScrollbarStructure, ScrollbarStructure,
} from 'setups/scrollbarsSetup/scrollbarsSetup.elements'; } from '~/setups/scrollbarsSetup/scrollbarsSetup.elements';
import { import { createScrollbarsSetupElements } from '~/setups/scrollbarsSetup/scrollbarsSetup.elements';
createStructureSetupElements, import type { StructureSetupElementsObj } from '~/setups/structureSetup/structureSetup.elements';
StructureSetupElementsObj, import { createStructureSetupElements } from '~/setups/structureSetup/structureSetup.elements';
} from 'setups/structureSetup/structureSetup.elements';
import { import {
classNameScrollbar, classNameScrollbar,
classNameScrollbarHorizontal, classNameScrollbarHorizontal,
@@ -15,13 +13,13 @@ import {
classNameScrollbarTrack, classNameScrollbarTrack,
classNameScrollbarHandle, classNameScrollbarHandle,
classNamesScrollbarTransitionless, classNamesScrollbarTransitionless,
} from 'classnames'; } from '~/classnames';
import type { InitializationTarget } from 'initialization'; import type { InitializationTarget } from '~/initialization';
jest.useFakeTimers(); jest.useFakeTimers();
jest.mock('support/compatibility/apis', () => { jest.mock('~/support/compatibility/apis', () => {
const originalModule = jest.requireActual('support/compatibility/apis'); const originalModule = jest.requireActual('~/support/compatibility/apis');
return { return {
...originalModule, ...originalModule,
// @ts-ignore // @ts-ignore
@@ -1,23 +1,22 @@
import { hasClass, is, isFunction, isHTMLElement } from 'support'; import { hasClass, is, isFunction, isHTMLElement } from '~/support';
import { import {
dataAttributeHost, dataAttributeHost,
classNamePadding, classNamePadding,
classNameViewport, classNameViewport,
classNameContent, classNameContent,
} from 'classnames'; } from '~/classnames';
import { getEnvironment, InternalEnvironment } from 'environment'; import type { InternalEnvironment } from '~/environment';
import { import { getEnvironment } from '~/environment';
createStructureSetupElements, import type { StructureSetupElementsObj } from '~/setups/structureSetup/structureSetup.elements';
StructureSetupElementsObj, import { createStructureSetupElements } from '~/setups/structureSetup/structureSetup.elements';
} from 'setups/structureSetup/structureSetup.elements'; import { addPlugin, ScrollbarsHidingPlugin } from '~/plugins';
import { addPlugin, ScrollbarsHidingPlugin } from 'plugins';
import type { import type {
Initialization, Initialization,
InitializationTarget, InitializationTarget,
InitializationTargetObject, InitializationTargetObject,
} from 'initialization'; } from '~/initialization';
jest.mock('environment', () => ({ jest.mock('~/environment', () => ({
getEnvironment: jest.fn(), getEnvironment: jest.fn(),
})); }));
@@ -343,7 +342,7 @@ const assertCorrectDestroy = (snapshot: string, destroy: () => void) => {
expect(snapshot).toBe(getSnapshot()); expect(snapshot).toBe(getSnapshot());
}; };
const env: InternalEnvironment = jest.requireActual('environment').getEnvironment(); const env: InternalEnvironment = jest.requireActual('~/environment').getEnvironment();
const envDefault = { const envDefault = {
name: 'default', name: 'default',
env, env,
@@ -430,7 +429,7 @@ describe('structureSetup.elements', () => {
beforeEach(() => { beforeEach(() => {
(getEnvironment as jest.Mock).mockImplementation(() => (getEnvironment as jest.Mock).mockImplementation(() =>
jest.requireActual('environment').getEnvironment() jest.requireActual('~/environment').getEnvironment()
); );
}); });
@@ -1,4 +1,4 @@
import { createCache } from 'support/cache'; import { createCache } from '~/support/cache';
const createUpdater = <T>(updaterReturn: (i: number) => T) => { const createUpdater = <T>(updaterReturn: (i: number) => T) => {
let index = 0; let index = 0;
@@ -1,4 +1,4 @@
import { jsAPI, cssProperty, cssPropertyValue } from 'support/compatibility/vendors'; import { jsAPI, cssProperty, cssPropertyValue } from '~/support/compatibility/vendors';
describe('vendors', () => { describe('vendors', () => {
describe('jsAPI', () => { describe('jsAPI', () => {
@@ -1,9 +1,9 @@
import { animateNumber } from 'support/dom/animation'; import { animateNumber } from '~/support/dom/animation';
jest.useFakeTimers(); jest.useFakeTimers();
jest.mock('support/compatibility/apis', () => { jest.mock('~/support/compatibility/apis', () => {
const originalModule = jest.requireActual('support/compatibility/apis'); const originalModule = jest.requireActual('~/support/compatibility/apis');
const mockRAF = (arg: any) => setTimeout(arg, 0); const mockRAF = (arg: any) => setTimeout(arg, 0);
return { return {
...originalModule, ...originalModule,
@@ -6,7 +6,7 @@ import {
val, val,
scrollLeft, scrollLeft,
scrollTop, scrollTop,
} from 'support/dom/attribute'; } from '~/support/dom/attribute';
const testElm = document.body; const testElm = document.body;
const getAttribute = (name: string) => testElm.getAttribute(name); const getAttribute = (name: string) => testElm.getAttribute(name);
@@ -1,4 +1,4 @@
import { addClass, removeClass, hasClass, diffClass } from 'support/dom/class'; import { addClass, removeClass, hasClass, diffClass } from '~/support/dom/class';
const testElm = document.body; const testElm = document.body;
const removeAllClassNames = () => { const removeAllClassNames = () => {
@@ -1,5 +1,5 @@
import { each } from 'support/utils'; import { each } from '~/support/utils';
import { createDiv, createDOM } from 'support/dom/create'; import { createDiv, createDOM } from '~/support/dom/create';
const slotElm = document.body; const slotElm = document.body;
const testHTML = const testHTML =
@@ -1,5 +1,5 @@
import { isNumber, isPlainObject } from 'support/utils/types'; import { isNumber, isPlainObject } from '~/support/utils/types';
import { createDiv } from 'support/dom/create'; import { createDiv } from '~/support/dom/create';
import { import {
windowSize, windowSize,
offsetSize, offsetSize,
@@ -8,7 +8,7 @@ import {
fractionalSize, fractionalSize,
getBoundingClientRect, getBoundingClientRect,
hasDimensions, hasDimensions,
} from 'support/dom/dimensions'; } from '~/support/dom/dimensions';
describe('dom dimensions', () => { describe('dom dimensions', () => {
describe('offsetSize', () => { describe('offsetSize', () => {
@@ -1,10 +1,5 @@
import { import type { OnOptions } from '~/support/dom/events';
off, import { off, preventDefault, stopPropagation, stopAndPrevent } from '~/support/dom/events';
preventDefault,
stopPropagation,
stopAndPrevent,
OnOptions,
} from 'support/dom/events';
const testElm = document.body; const testElm = document.body;
const mockEventListener = ( const mockEventListener = (
@@ -89,7 +84,7 @@ describe('dom events', () => {
}; };
beforeEach(() => beforeEach(() =>
import('support/dom/events').then((module) => { import('~/support/dom/events').then((module) => {
eventsModule = module; eventsModule = module;
jest.resetModules(); jest.resetModules();
}) })
@@ -1,5 +1,13 @@
import { createDiv, contents, appendChildren, prependChildren, insertBefore, insertAfter, removeElements } from 'support/dom'; import {
import { each, isArray, isHTMLElement } from 'support/utils'; createDiv,
contents,
appendChildren,
prependChildren,
insertBefore,
insertAfter,
removeElements,
} from '~/support/dom';
import { each, isArray, isHTMLElement } from '~/support/utils';
const slotElm = document.body; const slotElm = document.body;
const fillSlotElm = () => { const fillSlotElm = () => {
@@ -19,7 +27,7 @@ const compareToNative = (
method: string, method: string,
snapshot: Array<Node>, snapshot: Array<Node>,
elms: Element | Node | Array<Element> | Array<Node>, elms: Element | Node | Array<Element> | Array<Node>,
compareIds = false, compareIds = false
) => { ) => {
if (!compareIds) { if (!compareIds) {
if (!isArray(elms)) { if (!isArray(elms)) {
@@ -47,7 +55,12 @@ const compareToNative = (
if (isHTMLElement(elm) && child.getAttribute('id') === elm.getAttribute('id')) { if (isHTMLElement(elm) && child.getAttribute('id') === elm.getAttribute('id')) {
realElms.push(child); realElms.push(child);
} }
if (compareIds && target !== slotElm && isHTMLElement(target) && child.getAttribute('id') === target.getAttribute('id')) { if (
compareIds &&
target !== slotElm &&
isHTMLElement(target) &&
child.getAttribute('id') === target.getAttribute('id')
) {
target = child; target = child;
} }
} }
@@ -1,5 +1,5 @@
import { isNumber, isPlainObject } from 'support/utils/types'; import { isNumber, isPlainObject } from '~/support/utils/types';
import { absoluteCoordinates, offsetCoordinates } from 'support/dom/offset'; import { absoluteCoordinates, offsetCoordinates } from '~/support/dom/offset';
describe('dom offset', () => { describe('dom offset', () => {
describe('absoluteCoordinates', () => { describe('absoluteCoordinates', () => {
@@ -1,6 +1,6 @@
import { isEmptyObject } from 'support/utils/object'; import { isEmptyObject } from '~/support/utils/object';
import { isString, isPlainObject } from 'support/utils/types'; import { isString, isPlainObject } from '~/support/utils/types';
import { style, topRightBottomLeft, directionIsRTL } from 'support/dom/style'; import { style, topRightBottomLeft, directionIsRTL } from '~/support/dom/style';
describe('dom style', () => { describe('dom style', () => {
afterEach(() => { afterEach(() => {
@@ -8,7 +8,7 @@ import {
createDiv, createDiv,
liesBetween, liesBetween,
createDOM, createDOM,
} from 'support/dom'; } from '~/support/dom';
const slotElm = document.body; const slotElm = document.body;
const testHTML = const testHTML =
@@ -1,4 +1,4 @@
import { createEventListenerHub } from 'support/eventListeners'; import { createEventListenerHub } from '~/support/eventListeners';
type EventMap = { type EventMap = {
onBoolean: [a: boolean, b: string]; onBoolean: [a: boolean, b: string];
@@ -1,4 +1,4 @@
import { push, each, from, indexOf, runEachAndClear, isEmptyArray } from 'support/utils/array'; import { push, each, from, indexOf, runEachAndClear, isEmptyArray } from '~/support/utils/array';
describe('array utilities', () => { describe('array utilities', () => {
describe('push', () => { describe('push', () => {

Some files were not shown because too many files have changed in this diff Show More